dsp-semactic 0.7.4 → 0.7.5
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/README.md +5 -5
- package/dist/dsp-semactic.css +1 -1
- package/dist/index.cjs.js +36 -34
- package/dist/index.es.js +7497 -7203
- package/package.json +48 -48
package/dist/index.cjs.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),co=require("vue-i18n"),$a={key:0,class:"dss-datepicker__input-wrap dss-datepicker__input-wrap--readonly"},La=["value"],Ta=["placeholder","value","disabled"],Aa=["placeholder","value"],Da=["placeholder","value"],Ha=["aria-selected","onClick"],Ra={class:"dss-datepicker__list-item-label"},Fa={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"},Ia={key:1,class:"dss-datepicker__list-empty"},za={key:1,class:"dss-datepicker__double-wrap"},Pa={key:0,class:"dss-datepicker__quick-select","aria-label":"Quick range"},Oa=["disabled","onClick"],Wa={class:"dss-datepicker__double-calendars"},qa={class:"dss-datepicker__double-calendar"},Za={class:"dss-datepicker__calendar-header"},Ua=["aria-label"],Xa={class:"dss-datepicker__month-year-row"},Ya=["aria-label"],ja={class:"dss-datepicker__weekdays"},Ka={class:"dss-datepicker__grid"},Ga=["disabled","onClick","onMouseenter"],Qa={key:1,class:"dss-datepicker__day dss-datepicker__day--empty"},Ja={class:"dss-datepicker__double-calendar"},es={class:"dss-datepicker__calendar-header"},ts=["aria-label"],ns={class:"dss-datepicker__month-year-row"},ls=["aria-label"],os={class:"dss-datepicker__weekdays"},as={class:"dss-datepicker__grid"},ss=["disabled","onClick","onMouseenter"],rs={key:1,class:"dss-datepicker__day dss-datepicker__day--empty"},is={class:"dss-datepicker__calendar-header"},cs=["aria-label"],us={class:"dss-datepicker__month-year-row"},ds=["aria-label"],ms={class:"dss-datepicker__weekdays"},ps={class:"dss-datepicker__grid"},fs=["disabled","onClick","onMouseenter"],vs={key:1,class:"dss-datepicker__day dss-datepicker__day--empty"},gs={class:"dss-datepicker__calendar-header"},hs={class:"dss-datepicker__month-year-row"},ys={class:"dss-datepicker__month-year dss-datepicker__month-year--static"},ks={class:"dss-datepicker__months-grid"},Cs=["onClick"],bs={class:"dss-datepicker__calendar-header dss-datepicker__calendar-header--center"},ws={class:"dss-datepicker__month-year"},xs={class:"dss-datepicker__years-grid"},Es=["data-year","onClick"],ua=27,ql=8,la={__name:"DSSDatepicker",props:{mode:{type:String,default:"single",validator:E=>["single","range","singleFromAvailable","rangeFromAvailable","listFromAvailable","readonly"].includes(E)},modelValue:{type:[Date,Object],default:null},availableDates:{type:Array,default:()=>[]},minDate:{type:Date,default:null},maxDate:{type:Date,default:null},exceptDates:{type:Array,default:()=>[]},doubleCalendar:{type:Boolean,default:!1},quickSelect:{type:Boolean,default:!0},placeholder:{type:String,default:""}},emits:["update:modelValue"],setup(E,{emit:ne}){const $=E,V=ne,{t:ce,locale:I}=co.useI18n(),_=e.ref(!1),pe=e.ref("days"),st=new Date,te=e.computed(()=>$.minDate instanceof Date?$.minDate:st),v=e.ref(te.value.getMonth()),Ce=e.ref(te.value.getFullYear()),ke=e.ref(te.value.getMonth()),Q=e.ref(te.value.getFullYear()),X=e.ref(te.value.getMonth()),me=e.ref(te.value.getFullYear()),F=e.ref("start"),ue=e.ref(null),Me=e.ref(null);function tt(){const A=te.value,z=A.getMonth(),L=A.getFullYear(),le=z===11?0:z+1,Te=z===11?L+1:L;return{left:{month:z,year:L},right:{month:le,year:Te}}}const mt=e.ref(null),Z=e.ref(null),Ae=e.ref(null),We=e.ref(null),Ee=e.ref(null),_e=e.ref(null),Ye=e.ref(null),ie=e.ref(null),Je=new Date().getFullYear(),we=e.computed(()=>["single","singleFromAvailable"].includes($.mode)),et=e.computed(()=>["range","rangeFromAvailable"].includes($.mode)),ct=e.computed(()=>$.mode==="listFromAvailable"),vt=e.computed(()=>{if(!["single","singleFromAvailable","listFromAvailable"].includes($.mode))return null;const A=$.modelValue;return A instanceof Date?A:null}),ut=e.computed(()=>{if(!et.value)return{start:null,end:null};const A=$.modelValue;return!A||typeof A!="object"?{start:null,end:null}:{start:A.start instanceof Date?A.start:null,end:A.end instanceof Date?A.end:null}});function Ft(A){if(!A||!(A instanceof Date))return"";const z=A.getDate(),L=A.getMonth()+1,le=A.getFullYear(),Te=ft=>String(ft).padStart(2,"0");return`${Te(z)}/${Te(L)}/${le}`}const It=e.computed(()=>Ft(vt.value)),bt=e.computed(()=>{const{start:A,end:z}=ut.value;if(!A&&!z)return"";const L=!z||A&&A<=z?A:z,le=!A||z&&z>=A?z:A;return Xt(L,le)?Ft(L):`${Ft(L)} - ${Ft(le)}`}),wt=e.computed(()=>{if($.mode!=="readonly")return"—";const A=$.modelValue;if(A instanceof Date)return Ft(A)||"—";if(A&&typeof A=="object"&&("start"in A||"end"in A)){const z=A.start instanceof Date?A.start:null,L=A.end instanceof Date?A.end:null;if(!z&&!L)return"—";const le=!L||z&&z<=L?z:L,Te=!z||L&&L>=z?L:z;return Xt(le,Te)?Ft(le):`${Ft(le)} - ${Ft(Te)}`}return"—"});e.computed(()=>{const A=new Date(Ce.value,v.value,1);return new Intl.DateTimeFormat(I.value,{month:"long",year:"numeric"}).format(A)});const Jt=e.computed(()=>Me.value==="left"?ke.value:Me.value==="right"?X.value:v.value),pt=e.computed(()=>Me.value==="left"?Q.value:Me.value==="right"?me.value:Ce.value),jt=e.computed(()=>{const A=new Date(Ce.value,v.value,1);return new Intl.DateTimeFormat(I.value,{month:"long"}).format(A)}),kt=e.computed(()=>{const A=new Date(pt.value,Jt.value,1);return new Intl.DateTimeFormat(I.value,{month:"long"}).format(A)}),tn=e.computed(()=>{const A=new Intl.DateTimeFormat(I.value,{month:"short"});return Array.from({length:12},(z,L)=>A.format(new Date(2024,L,1)))}),U=e.computed(()=>{const z=(Me.value?pt.value:Ce.value)-Math.floor(ua/2);return Array.from({length:ua},(L,le)=>z+le)}),ye=e.computed(()=>{const A=U.value;return A.length?`${A[0]} – ${A[A.length-1]}`:""});function P(A){return A===7?0:A}function K(A){try{const z=new Intl.Locale(A);if(z.weekInfo?.firstDay!=null)return P(z.weekInfo.firstDay)}catch{}return 1}function Se(A){const z=new Date(2024,0,1),L=(z.getDay()-A+7)%7,le=new Date(z);return le.setDate(z.getDate()-L),le}const Re=e.computed(()=>K(I.value)),Ze=e.computed(()=>{const A=new Intl.DateTimeFormat(I.value,{weekday:"short"}),z=Se(Re.value),L=[];for(let le=0;le<7;le++){const Te=new Date(z);Te.setDate(z.getDate()+le),L.push(A.format(Te).slice(0,2))}return L});function xt(A,z,L){const le=new Date(A,z,1),Te=new Date(A,z+1,0),ft=(le.getDay()-L+7)%7,dt=Te.getDate(),ot=[];for(let at=0;at<ft;at++)ot.push(null);for(let at=1;at<=dt;at++)ot.push(new Date(A,z,at));return ot}const Ke=e.computed(()=>xt(Ce.value,v.value,Re.value)),zt=e.computed(()=>xt(Q.value,ke.value,Re.value)),qe=e.computed(()=>xt(me.value,X.value,Re.value));e.computed(()=>{const A=new Date(Q.value,ke.value,1);return new Intl.DateTimeFormat(I.value,{month:"long",year:"numeric"}).format(A)}),e.computed(()=>{const A=new Date(me.value,X.value,1);return new Intl.DateTimeFormat(I.value,{month:"long",year:"numeric"}).format(A)});const ze=e.computed(()=>{const A=new Date(Q.value,ke.value,1);return new Intl.DateTimeFormat(I.value,{month:"long"}).format(A)}),Lt=e.computed(()=>{const A=new Date(me.value,X.value,1);return new Intl.DateTimeFormat(I.value,{month:"long"}).format(A)}),$t=e.computed(()=>$.availableDates&&$.availableDates.length>0),oe=e.computed(()=>$t.value?[{id:"all",labelKey:"datepicker.quickSelect.allDates"},{id:"last2",labelKey:"datepicker.quickSelect.last2Dates"},{id:"last3",labelKey:"datepicker.quickSelect.last3Dates"},{id:"last4",labelKey:"datepicker.quickSelect.last4Dates"},{id:"last5",labelKey:"datepicker.quickSelect.last5Dates"}]:[{id:"today",labelKey:"datepicker.quickSelect.today"},{id:"lastWeek",labelKey:"datepicker.quickSelect.lastWeek"},{id:"last15Days",labelKey:"datepicker.quickSelect.last15Days"},{id:"last30Days",labelKey:"datepicker.quickSelect.last30Days"},{id:"thisMonth",labelKey:"datepicker.quickSelect.thisMonth"},{id:"last3Months",labelKey:"datepicker.quickSelect.last3Months"},{id:"last6Months",labelKey:"datepicker.quickSelect.last6Months"},{id:"last12Months",labelKey:"datepicker.quickSelect.last12Months"},{id:"lastYear",labelKey:"datepicker.quickSelect.lastYear"}]),Y=e.ref({top:0,left:0}),j=e.ref("left");let de=null;function be(){_.value&&e.nextTick(()=>{_.value&&(de!==null&&window.cancelAnimationFrame(de),de=window.requestAnimationFrame(()=>{de=null,je()}))})}function je(){if(!Ee.value||!_.value)return;const A=Ee.value.getBoundingClientRect(),z=window.innerWidth||document.documentElement.clientWidth,L=window.innerHeight||document.documentElement.clientHeight;let le=A.left,Te=A.bottom+4;const ft=_e.value;if(ft){const dt=ft.offsetWidth,ot=ft.offsetHeight;j.value==="right"||le+dt>z-ql?(j.value="right",le=A.right-dt):j.value="left";const vn=Math.max(ql,z-dt-ql);if(le=Math.min(Math.max(le,ql),vn),Te+ot>L-ql){const bn=A.top-4-ot;bn>=ql?Te=bn:Te=Math.max(ql,L-ot-ql)}}Y.value={top:Te,left:le}}const Tt=e.computed(()=>!Ee.value||!_.value?{}:{position:"fixed",left:`${Y.value.left}px`,top:`${Y.value.top}px`,zIndex:1002});function Xt(A,z){return!A||!z?!1:A.getFullYear()===z.getFullYear()&&A.getMonth()===z.getMonth()&&A.getDate()===z.getDate()}function nt(A){return new Date(A.getFullYear(),A.getMonth(),A.getDate()).getTime()}function sn(A){return!$.availableDates||!$.availableDates.length?!0:$.availableDates.some(z=>z instanceof Date&&Xt(z,A))}function N(A){const z=nt(A);return!($.minDate instanceof Date&&z<nt($.minDate)||$.maxDate instanceof Date&&z>nt($.maxDate))}function b(A){const z=new Date(A);return new Date(z.getFullYear(),z.getMonth(),z.getDate())}function B(A){return A.filter(z=>N(z))}function G(A,z){if(!(A instanceof Date)||!(z instanceof Date))return null;let L=nt(A),le=nt(z);if(L>le&&([L,le]=[le,L]),$.minDate instanceof Date){const Te=nt($.minDate);L=Math.max(L,Te),le=Math.max(le,Te)}if($.maxDate instanceof Date){const Te=nt($.maxDate);L=Math.min(L,Te),le=Math.min(le,Te)}return L>le?null:{start:b(L),end:b(le)}}function ae(A){return!$.exceptDates||!$.exceptDates.length?!1:$.exceptDates.some(z=>z instanceof Date&&Xt(z,A))}function De(A){return ae(A)?!1:["singleFromAvailable","rangeFromAvailable"].includes($.mode)?sn(A):N(A)}function Ct(A){const z=vt.value,L=ut.value,le=nt(A),Te=et.value&&L.start&&L.end&&le>nt(L.start)&&le<nt(L.end),ft=et.value&&L.start&&Xt(A,L.start),dt=et.value&&L.end&&Xt(A,L.end),ot=ft&&dt,at=we.value&&z&&Xt(A,z)||ft||dt;let vn=!1;if(et.value&&L.start&&!L.end&&ue.value){const bn=nt(L.start),Wt=nt(ue.value),gn=Math.min(bn,Wt),Kt=Math.max(bn,Wt);vn=le>gn&&le<Kt}return{"dss-datepicker__day--selected":at&&!ot,"dss-datepicker__day--range-start":ft&&!ot,"dss-datepicker__day--range-end":dt&&!ot,"dss-datepicker__day--range-single":ot,"dss-datepicker__day--in-range":Te&&!ft&&!dt,"dss-datepicker__day--in-range-preview":vn&&!ft&&!dt&&!Te,"dss-datepicker__day--disabled":!De(A)}}function lt(A){if(!et.value)return;const z=ut.value;if(!z.start||z.end){ue.value=null;return}if(!De(A)){ue.value=null;return}ue.value=new Date(A.getFullYear(),A.getMonth(),A.getDate())}function Ie(){ue.value=null}function Et(){if(!$.doubleCalendar||!et.value)return;const A=ut.value,{start:z,end:L}=A;if(z&&L){const ft=z<=L?z:L,dt=z<=L?L:z,ot=ft.getMonth(),at=ft.getFullYear(),vn=dt.getMonth(),bn=dt.getFullYear();if(ot!==vn||at!==bn){const Wt=ke.value===ot&&Q.value===at,gn=X.value===vn&&me.value===bn;if(Wt&&gn)return;ke.value=ot,Q.value=at,X.value=vn,me.value=bn}else{const Wt=ot===0?11:ot-1,gn=ot===0?at-1:at;ke.value===Wt&&Q.value===gn&&X.value===ot&&me.value===at||(ke.value=ot,Q.value=at,ot===11?(X.value=0,me.value=at+1):(X.value=ot+1,me.value=at))}return}const le=z||L;if(le){const ft=le.getMonth(),dt=le.getFullYear(),ot=ke.value===ft&&Q.value===dt,at=X.value===ft&&me.value===dt;if(ot||at)return;ke.value=ft,Q.value=dt,ft===11?(X.value=0,me.value=dt+1):(X.value=ft+1,me.value=dt);return}const Te=tt();ke.value=Te.left.month,Q.value=Te.left.year,X.value=Te.right.month,me.value=Te.right.year}const Bt=e.computed(()=>new Intl.DateTimeFormat(I.value,{day:"2-digit",month:"long",year:"numeric"})),St=e.computed(()=>{if(!ct.value)return[];const A=($.availableDates||[]).filter(L=>L instanceof Date&&!Number.isNaN(L.getTime())).filter(L=>!ae(L)&&N(L)).map(L=>new Date(L.getFullYear(),L.getMonth(),L.getDate()));A.sort((L,le)=>le.getTime()-L.getTime());const z=vt.value;return A.map(L=>({date:L,ts:L.getTime(),label:Bt.value.format(L),selected:!!(z&&Xt(L,z))}))});function rt(){if(_.value){rn();return}Ee.value=We.value?.closest(".dss-datepicker__input-wrap"),j.value="left",_.value=!0,be(),e.nextTick(()=>{ie.value?.querySelector(".dss-datepicker__list-item--selected")?.scrollIntoView({block:"nearest",behavior:"auto"})})}function At(A){if(!(A instanceof Date))return;const z=new Date(A.getFullYear(),A.getMonth(),A.getDate());V("update:modelValue",z),rn()}function Nt(A="start"){if($.mode==="readonly")return;F.value=A;const z=vt.value,L=ut.value;if(we.value&&z)v.value=z.getMonth(),Ce.value=z.getFullYear();else if(et.value)if($.doubleCalendar)Et();else{const le=A==="start"&&L.start?L.start:L.end||L.start;le&&(v.value=le.getMonth(),Ce.value=le.getFullYear())}Ee.value=we.value?mt.value?.closest(".dss-datepicker__input-wrap"):Z.value,pe.value="days",Me.value=null,j.value="left",_.value=!0,be()}function rn(){pe.value="days",Me.value=null,ue.value=null,_.value=!1}function Vn(A,z){Me.value=A,pe.value=z}function Zn(){pe.value="days",Me.value=null}function en(A){const z=new Date,L=z.getFullYear(),le=z.getMonth(),Te=z.getDate();let ft,dt;if($t.value){const ot=B([...$.availableDates].filter(at=>at instanceof Date).map(at=>new Date(at.getFullYear(),at.getMonth(),at.getDate()))).sort((at,vn)=>at.getTime()-vn.getTime());if(ot.length===0)return null;if(A==="all")ft=ot[0],dt=ot[ot.length-1];else{const at=parseInt(A.replace("last",""),10);if(at<2||at>5)return null;const vn=ot.slice(-at);if(vn.length===0)return null;ft=vn[0],dt=vn[vn.length-1]}}else{const ot=new Date(L,le,Te);switch(A){case"today":ft=ot,dt=ot;break;case"lastWeek":ft=new Date(L,le,Te-6),dt=ot;break;case"last15Days":ft=new Date(L,le,Te-14),dt=ot;break;case"last30Days":ft=new Date(L,le,Te-29),dt=ot;break;case"thisMonth":ft=new Date(L,le,1),dt=ot;break;case"last3Months":ft=new Date(L,le-3,1),dt=new Date(L,le,0);break;case"last6Months":ft=new Date(L,le-6,1),dt=new Date(L,le,0);break;case"last12Months":ft=new Date(L,le-12,1),dt=new Date(L,le,0);break;case"lastYear":ft=new Date(L-1,0,1),dt=new Date(L-1,11,31);break;default:return null}}return{start:ft,end:dt}}function pn(A){const z=en(A);return z?G(z.start,z.end):null}function ll(A){return pn(A)!==null}function vl(A){const z=pn(A);z&&(V("update:modelValue",z),Et())}function il(A){Me.value==="left"?ke.value=A:Me.value==="right"?X.value=A:v.value=A,Zn()}function _n(A){Me.value==="left"?Q.value=A:Me.value==="right"?me.value=A:Ce.value=A,Zn()}function gl(){v.value===0?(v.value=11,Ce.value--):v.value--}function $n(){v.value===11?(v.value=0,Ce.value++):v.value++}function Vl(){ke.value===0?(ke.value=11,Q.value--):ke.value--}function Rl(){ke.value===11?(ke.value=0,Q.value++):ke.value++}function hl(){X.value===0?(X.value=11,me.value--):X.value--}function An(){X.value===11?(X.value=0,me.value++):X.value++}function Un(A){if(!De(A))return;const z=new Date(A.getFullYear(),A.getMonth(),A.getDate());if(we.value){V("update:modelValue",z),rn();return}const L=ut.value;if(!L.start&&!L.end){V("update:modelValue",{start:z,end:null}),F.value="end";return}if(L.start&&L.end){V("update:modelValue",{start:z,end:null}),F.value="end";return}if(F.value==="start"){let le=z,Te=L.end;le&&Te&&le>Te&&([le,Te]=[Te,le]),V("update:modelValue",{start:le||Te,end:Te||le}),F.value="end"}else{let le=L.start,Te=z;le&&Te&&Te<le&&([le,Te]=[Te,le]),V("update:modelValue",{start:le||Te,end:Te||le}),F.value="start"}}e.watch(ut,()=>{$.doubleCalendar&&et.value&&_.value&&Et()},{deep:!0});let Xn=null,Hn=null,zn=null;function Nl(){Xn&&(document.removeEventListener("keydown",Xn),Xn=null),Hn&&(window.removeEventListener("resize",Hn),Hn=null),zn&&(window.removeEventListener("scroll",zn,!0),zn=null)}return e.watch(pe,A=>{A==="years"&&e.nextTick(()=>{Ye.value?.querySelector(`[data-year="${pt.value}"]`)?.scrollIntoView({block:"center",behavior:"auto"})})}),e.watch(()=>[_.value,pe.value,v.value,Ce.value,ke.value,Q.value,X.value,me.value,Me.value,$.doubleCalendar,$.quickSelect],()=>{be()}),e.watch(_,A=>{Nl(),A&&(Xn=z=>{z.key==="Escape"&&(pe.value==="years"||pe.value==="months"?Zn():rn())},Hn=()=>{je()},zn=()=>{je()},document.addEventListener("keydown",Xn),window.addEventListener("resize",Hn),window.addEventListener("scroll",zn,!0))}),e.onBeforeUnmount(()=>{de!==null&&(window.cancelAnimationFrame(de),de=null),Nl()}),(A,z)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-datepicker",{"dss-datepicker--readonly":E.mode==="readonly"}])},[E.mode==="readonly"?(e.openBlock(),e.createElementBlock("div",$a,[z[10]||(z[10]=e.createElementVNode("span",{class:"dss-datepicker__icon","aria-hidden":"true"},[e.createElementVNode("svg",{class:"dss-datepicker__icon-svg",width:"24",height:"24",viewBox:"0 0 256 256",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[e.createElementVNode("path",{d:"M208,32H184V24a8,8,0,0,0-16,0v8H88V24a8,8,0,0,0-16,0v8H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32Zm0,48H48V48H72v8a8,8,0,0,0,16,0V48h80v8a8,8,0,0,0,16,0V48h24Z"})])],-1)),e.createElementVNode("input",{type:"text",class:"dss-datepicker__input",value:wt.value,readonly:"",disabled:"",tabindex:"-1"},null,8,La)])):we.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-datepicker__input-wrap",onClick:z[0]||(z[0]=L=>Nt("start"))},[z[11]||(z[11]=e.createElementVNode("span",{class:"dss-datepicker__icon","aria-hidden":"true"},[e.createElementVNode("svg",{class:"dss-datepicker__icon-svg",width:"24",height:"24",viewBox:"0 0 256 256",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[e.createElementVNode("path",{d:"M208,32H184V24a8,8,0,0,0-16,0v8H88V24a8,8,0,0,0-16,0v8H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32Zm0,48H48V48H72v8a8,8,0,0,0,16,0V48h80v8a8,8,0,0,0,16,0V48h24Z"})])],-1)),e.createElementVNode("input",{ref_key:"inputSingleRef",ref:mt,type:"text",class:"dss-datepicker__input",placeholder:$.placeholder||e.unref(ce)("datepicker.selectDate"),value:It.value,readonly:"",disabled:E.mode==="readonly"},null,8,Ta)])):ct.value?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(["dss-datepicker__input-wrap dss-datepicker__input-wrap--list",{"dss-datepicker__input-wrap--open":_.value}]),onClick:rt},[z[13]||(z[13]=e.createElementVNode("span",{class:"dss-datepicker__icon","aria-hidden":"true"},[e.createElementVNode("svg",{class:"dss-datepicker__icon-svg",width:"24",height:"24",viewBox:"0 0 256 256",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[e.createElementVNode("path",{d:"M208,32H184V24a8,8,0,0,0-16,0v8H88V24a8,8,0,0,0-16,0v8H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32Zm0,48H48V48H72v8a8,8,0,0,0,16,0V48h80v8a8,8,0,0,0,16,0V48h24Z"})])],-1)),e.createElementVNode("input",{ref_key:"inputListRef",ref:We,type:"text",class:"dss-datepicker__input",placeholder:$.placeholder||e.unref(ce)("datepicker.selectFromList"),value:It.value,readonly:""},null,8,Aa),e.createElementVNode("span",{class:e.normalizeClass(["dss-datepicker__chevron",{"dss-datepicker__chevron--open":_.value}]),"aria-hidden":"true"},[...z[12]||(z[12]=[e.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 256 256",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z"})],-1)])],2)],2)):et.value?(e.openBlock(),e.createElementBlock("div",{key:3,class:"dss-datepicker__input-wrap",ref_key:"inputRangeWrapRef",ref:Z,onClick:z[1]||(z[1]=L=>Nt("start"))},[z[14]||(z[14]=e.createElementVNode("span",{class:"dss-datepicker__icon","aria-hidden":"true"},[e.createElementVNode("svg",{class:"dss-datepicker__icon-svg",width:"24",height:"24",viewBox:"0 0 256 256",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[e.createElementVNode("path",{d:"M208,32H184V24a8,8,0,0,0-16,0v8H88V24a8,8,0,0,0-16,0v8H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32Zm0,48H48V48H72v8a8,8,0,0,0,16,0V48h80v8a8,8,0,0,0,16,0V48h24Z"})])],-1)),e.createElementVNode("input",{ref_key:"inputRangeRef",ref:Ae,type:"text",class:"dss-datepicker__input",placeholder:$.placeholder||e.unref(ce)("datepicker.selectRange"),value:bt.value,readonly:""},null,8,Da)],512)):e.createCommentVNode("",!0),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[_.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-datepicker__overlay",onClick:e.withModifiers(rn,["self"])},[e.createElementVNode("div",{ref_key:"dropdownRef",ref:_e,class:e.normalizeClass(["dss-datepicker__dropdown",{"dss-datepicker__dropdown--double":E.doubleCalendar&&et.value&&pe.value==="days","dss-datepicker__dropdown--quick-select":E.doubleCalendar&&et.value&&pe.value==="days"&&E.quickSelect,"dss-datepicker__dropdown--list":ct.value}]),onClick:z[9]||(z[9]=e.withModifiers(()=>{},["stop"])),style:e.normalizeStyle(Tt.value)},[ct.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[St.value.length?(e.openBlock(),e.createElementBlock("ul",{key:0,class:"dss-datepicker__list",role:"listbox",ref_key:"listRef",ref:ie},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(St.value,L=>(e.openBlock(),e.createElementBlock("li",{key:L.ts,role:"option","aria-selected":L.selected,class:e.normalizeClass(["dss-datepicker__list-item",{"dss-datepicker__list-item--selected":L.selected}]),onClick:le=>At(L.date)},[e.createElementVNode("span",Ra,e.toDisplayString(L.label),1),L.selected?(e.openBlock(),e.createElementBlock("svg",Fa,[...z[15]||(z[15]=[e.createElementVNode("path",{d:"M229.66,77.66l-128,128a8,8,0,0,1-11.32,0l-56-56a8,8,0,0,1,11.32-11.32L96,188.69,218.34,66.34a8,8,0,0,1,11.32,11.32Z"},null,-1)])])):e.createCommentVNode("",!0)],10,Ha))),128))],512)):(e.openBlock(),e.createElementBlock("div",Ia,e.toDisplayString(e.unref(ce)("datepicker.noAvailableDates")),1))],64)):pe.value==="days"&&E.doubleCalendar&&et.value?(e.openBlock(),e.createElementBlock("div",za,[E.quickSelect?(e.openBlock(),e.createElementBlock("nav",Pa,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(oe.value,L=>(e.openBlock(),e.createElementBlock("button",{key:L.id,type:"button",class:"dss-datepicker__quick-select-btn",disabled:!ll(L.id),onClick:le=>vl(L.id)},e.toDisplayString(e.unref(ce)(L.labelKey)),9,Oa))),128))])):e.createCommentVNode("",!0),e.createElementVNode("div",Wa,[e.createElementVNode("div",qa,[e.createElementVNode("div",Za,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(ce)("datepicker.prevMonth"),onClick:Vl}," ‹ ",8,Ua),e.createElementVNode("div",Xa,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:z[2]||(z[2]=L=>Vn("left","months"))},e.toDisplayString(ze.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:z[3]||(z[3]=L=>Vn("left","years"))},e.toDisplayString(Q.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(ce)("datepicker.nextMonth"),onClick:Rl}," › ",8,Ya)]),e.createElementVNode("div",ja,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ze.value,L=>(e.openBlock(),e.createElementBlock("span",{key:L,class:"dss-datepicker__weekday"},e.toDisplayString(L),1))),128))]),e.createElementVNode("div",Ka,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(zt.value,(L,le)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"L-"+le},[L?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-datepicker__day",Ct(L)]),disabled:!De(L),onClick:Te=>Un(L),onMouseenter:Te=>lt(L),onMouseleave:Ie},e.toDisplayString(L.getDate()),43,Ga)):(e.openBlock(),e.createElementBlock("span",Qa))],64))),128))])]),e.createElementVNode("div",Ja,[e.createElementVNode("div",es,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(ce)("datepicker.prevMonth"),onClick:hl}," ‹ ",8,ts),e.createElementVNode("div",ns,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:z[4]||(z[4]=L=>Vn("right","months"))},e.toDisplayString(Lt.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:z[5]||(z[5]=L=>Vn("right","years"))},e.toDisplayString(me.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(ce)("datepicker.nextMonth"),onClick:An}," › ",8,ls)]),e.createElementVNode("div",os,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ze.value,L=>(e.openBlock(),e.createElementBlock("span",{key:L,class:"dss-datepicker__weekday"},e.toDisplayString(L),1))),128))]),e.createElementVNode("div",as,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(qe.value,(L,le)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"R-"+le},[L?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-datepicker__day",Ct(L)]),disabled:!De(L),onClick:Te=>Un(L),onMouseenter:Te=>lt(L),onMouseleave:Ie},e.toDisplayString(L.getDate()),43,ss)):(e.openBlock(),e.createElementBlock("span",rs))],64))),128))])])])])):pe.value==="days"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createElementVNode("div",is,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(ce)("datepicker.prevMonth"),onClick:gl}," ‹ ",8,cs),e.createElementVNode("div",us,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:z[6]||(z[6]=L=>pe.value="months")},e.toDisplayString(jt.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:z[7]||(z[7]=L=>pe.value="years")},e.toDisplayString(Ce.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(ce)("datepicker.nextMonth"),onClick:$n}," › ",8,ds)]),e.createElementVNode("div",ms,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ze.value,L=>(e.openBlock(),e.createElementBlock("span",{key:L,class:"dss-datepicker__weekday"},e.toDisplayString(L),1))),128))]),e.createElementVNode("div",ps,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ke.value,(L,le)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:le},[L?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-datepicker__day",Ct(L)]),disabled:!De(L),onClick:Te=>Un(L),onMouseenter:Te=>lt(L),onMouseleave:Ie},e.toDisplayString(L.getDate()),43,fs)):(e.openBlock(),e.createElementBlock("span",vs))],64))),128))])],64)):pe.value==="months"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.createElementVNode("div",gs,[e.createElementVNode("div",hs,[e.createElementVNode("span",ys,e.toDisplayString(kt.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:z[8]||(z[8]=L=>pe.value="years")},e.toDisplayString(pt.value),1)])]),e.createElementVNode("div",ks,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(tn.value,(L,le)=>(e.openBlock(),e.createElementBlock("button",{key:le,type:"button",class:e.normalizeClass(["dss-datepicker__month-cell",{"dss-datepicker__month-cell--selected":le===Jt.value}]),onClick:Te=>il(le)},e.toDisplayString(L),11,Cs))),128))])],64)):pe.value==="years"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:4},[e.createElementVNode("div",bs,[e.createElementVNode("span",ws,e.toDisplayString(ye.value),1)]),e.createElementVNode("div",{class:"dss-datepicker__years-wrap",ref_key:"yearsWrapRef",ref:Ye},[e.createElementVNode("div",xs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(U.value,L=>(e.openBlock(),e.createElementBlock("button",{key:L,type:"button",class:e.normalizeClass(["dss-datepicker__year-cell",{"dss-datepicker__year-cell--selected":L===pt.value,"dss-datepicker__year-cell--current":L===e.unref(Je)}]),"data-year":L,onClick:le=>_n(L)},e.toDisplayString(L),11,Es))),128))])],512)],64)):e.createCommentVNode("",!0)],6)])):e.createCommentVNode("",!0)]))],2))}},Ss=["data-chart-type"],Vs={class:"dss-chart-header-titles"},Ns={key:0,class:"dss-chart-title"},Bs={key:1,class:"dss-chart-subtitle"},Ms=["onClick","onMouseenter"],_s={class:"dss-legend-text"},$s=["onClick","onMouseenter"],Ls={class:"dss-legend-text"},Ts=["title"],As=["src"],Ds={class:"dss-chart-area-wrapper"},Hs={key:0,class:"dss-chart-z-axis-label"},Rs=["width","height","data-smooth","data-animated"],Fs=["id"],Is=["y","width","height"],zs=["id"],Ps=["d"],Os=["id"],Ws=["d"],qs={key:0},Zs=["clip-path"],Us=["x1","x2","y1","y2"],Xs={class:"dss-axes"},Ys=["x1","x2","y1","y2"],js=["x1","x2","y1","y2"],Ks=["x1","x2","y1","y2"],Gs={class:"dss-axis-labels"},Qs=["x","y"],Js=["x","y"],er=["x","y"],tr=["x","y"],nr=["y","transform"],lr=["x","y","transform"],or={key:1,class:"dss-flag-markers"},ar=["clip-path"],sr=["x1","x2","y1","y2","onMouseover"],rr=["x1","x2","y1","y2","onMouseover"],ir=["x1","x2","y1","y2","onMouseover"],cr=["cx","cy","onMouseover"],ur=["cx","cy","fill","onMouseover"],dr=["x","y"],mr=["clip-path"],pr={key:0},fr=["d","onMouseover"],vr=["x","y","width","height","fill","onMouseover"],gr={class:"dss-line-chart"},hr=["d","stroke","stroke-width","stroke-dasharray"],yr=["d","stroke","stroke-width","opacity"],kr=["cx","cy","r","fill","onMouseover"],Cr={key:1},br=["d","stroke","stroke-width","stroke-dasharray"],wr=["d","stroke","stroke-width","stroke-dasharray"],xr=["d","stroke","stroke-width","opacity"],Er=["cx","cy","r","fill","onMouseover"],Sr={key:2},Vr=["id"],Nr=["x","y","width","height"],Br=["d","fill","fill-opacity","mask"],Mr=["d","stroke","stroke-width"],_r=["d","fill","onMouseover"],$r=["x","y","width","height","onMouseover"],Lr=["clip-path"],Tr=["x1","x2","y1","y2","stroke"],Ar=["cx","cy","r","fill"],Dr={key:1,class:"dss-bubble-chart"},Hr={key:0,class:"dss-bubble-group"},Rr=["cx","cy","r","fill","fill-opacity","stroke","onMouseenter","onMouseleave","onClick"],Fr=["x","y","width","height","xlink:href","clip-path","onLoad","onError","onMouseenter","onMouseleave","onClick"],Ir=["transform"],zr=["cx","cy","r"],Pr=["data-chart-type","clip-path"],Or=["d","fill","fill-opacity","stroke","stroke-width","clip-path","onMouseover"],Wr={key:1,class:"dss-radial-segment-data-labels"},qr=["x","y"],Zr=["x","y","font-size","fill"],Ur=["x1","y1","x2","y2","stroke"],Xr=["x1","y1","x2","y2","stroke"],Yr=["x","y","text-anchor","font-size"],jr=["transform"],Kr={key:0,class:"dss-spider-grid"},Gr=["cx","cy","r"],Qr={class:"dss-spider-grid-labels"},Jr=["x","y"],ei=["x","y"],ti=["x1","x2","y1","y2"],ni={class:"dss-spider-labels"},li=["x","y","text-anchor","dominant-baseline"],oi=["points","fill","fill-opacity","stroke","stroke-width","stroke-dasharray"],ai=["cx","cy","r","fill","stroke","stroke-width","onMouseover"],si={class:"dss-chart-logos"},ri=["cx","cy","r","fill"],ii=["x","y","width","height","xlink:href","onLoad","onError","clip-path"],ci=["onClick","onMouseenter"],ui=["src"],di={class:"dss-marker-tooltip-category"},mi={key:0,class:"dss-marker-tooltip-description"},pi={key:0,class:"dss-tooltip-section dss-spider-tooltip-section"},fi={class:"dss-tooltip-title dss-spider-tooltip-area-title"},vi={class:"dss-tooltip-series-name"},gi={class:"dss-tooltip-series-value"},hi={key:1,class:"dss-tooltip-section"},yi={key:0,class:"dss-tooltip-title"},ki={class:"dss-bubble-tooltip-data"},Ci={key:2,class:"dss-tooltip-section"},bi={class:"dss-tooltip-title"},wi={class:"dss-tooltip-value"},xi={key:0,class:"dss-tooltip-section"},Ei={class:"dss-tooltip-section-title"},Si={class:"dss-tooltip-group-header"},Vi={class:"dss-tooltip-item-content"},Ni={class:"dss-tooltip-item-text"},Bi={key:1,class:"dss-tooltip-section"},Mi={class:"dss-tooltip-section-title"},_i={class:"dss-tooltip-item-content"},$i={class:"dss-tooltip-item-title"},Li={key:0,class:"dss-tooltip-item-description"},Ti={class:"dss-tooltip-section"},Ai={class:"dss-tooltip-title"},Di={key:0,class:"dss-bubble-tooltip-data"},Hi={class:"dss-tooltip-series-name"},Ri={class:"dss-tooltip-series-value"},Fi={key:0,class:"dss-tooltip-section"},Ii={class:"dss-tooltip-section-title"},zi={class:"dss-tooltip-group-header"},Pi={class:"dss-tooltip-item-content"},Oi={class:"dss-tooltip-item-text"},Wi={key:1,class:"dss-tooltip-section"},qi={class:"dss-tooltip-section-title"},Zi={class:"dss-tooltip-item-content"},Ui={class:"dss-tooltip-item-title"},Xi={key:0,class:"dss-tooltip-item-description"},Yi=["onClick","onMouseenter"],ji={class:"dss-legend-text"},Ki={key:1,class:"dss-context-menu-separator"},Gi={key:0,class:"dss-context-menu-separator"},Qi={key:0,class:"dss-context-menu-separator"},Ji=["onClick"],ec=["innerHTML"],tc={key:0,class:"dss-context-menu-icon"},nc={class:"dss-marker-modal-header"},lc={class:"dss-marker-modal-body"},oc={class:"dss-form-group"},ac={class:"dss-form-group"},sc={for:"dss-marker-description"},rc={key:0,class:"dss-form-text-display"},ic=["placeholder"],cc={class:"dss-marker-modal-footer"},uc={class:"modal-footer-left"},dc={class:"dss-modal-footer-right"},mc=["disabled"],pc={name:"DSSChart"},fc=Object.assign(pc,{props:{series:{type:Array,required:!0,default:()=>[]},categories:{type:Array,default:()=>[]},flags:{type:Array,default:()=>[]},markers:{type:Array,default:()=>[]},showAddMarkerButton:{type:Boolean,default:!0},chartId:{type:String,default:()=>"chart-"+Math.random().toString(36).substring(2,9)},i18n:{type:Object,default:null},locale:{type:String,default:null},options:{type:Object,default:()=>({}),validator:E=>typeof E=="object"&&E!==null},innerSize:{type:Number,default:null},old:{type:Boolean,default:!1}},emits:["add-marker","update-marker","delete-marker"],setup(E,{emit:ne}){const{t:$,locale:V}=co.useI18n(),ce=ne,I=e.ref(null),_=e.ref(null),pe=e.ref(null),st=e.ref(0),te=e.ref(0);let v=null,Ce=null;const ke=20,Q=e.computed(()=>{if(te.value,st.value,!I.value||!_.value)return 0;try{const t=I.value.getBoundingClientRect();return _.value.getBoundingClientRect().top-t.top}catch{return 0}}),X=e.computed(()=>`chart-clip-${F.chartId}`),me=e.computed(()=>`url(#${X.value})`),F=E,ue={chart:{type:"line",width:800,height:400,orientation:"vertical"},title:{text:"",style:{}},subtitle:{text:"",style:{}},zAxis:"",xAxis:{title:{text:""},type:"category"},yAxis:{min:"auto",max:"auto",title:{text:""}},legend:{show:!0,position:"top",orientation:"horizontal"},radialLabels:{show:!1,pointerLength:25,horizontalLength:35,fontSize:14,color:"#000",textOffset:8},radialBar:{dataLabels:{show:!1,minAngleDegrees:20},dataCenter:{show:!1,fontSize:16}},miniRadial:{minVisiblePercent:1,trackColor:"#E5E7EB",thresholds:{low:33,medium:66},colors:{low:"#E53E3E",medium:"#ED8936",high:"#38A169"}},grid:{show:!0,style:{}},watermark:{enabled:!0,opacity:.05,size:35,position:"bottom-right"},colors:["#3B82F6","#EF4444","#10B981","#F59E0B","#8B5CF6","#F97316","#06B6D4","#84CC16"],logos:[],stroke:{width:2,curve:"smooth"},bubbles:{size:4},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 Me(t,a){const n=Object.assign({},t);return mt(t)&&mt(a)&&Object.keys(a).forEach(r=>{mt(a[r])?r in t?n[r]=Me(t[r],a[r]):Object.assign(n,{[r]:a[r]}):Object.assign(n,{[r]:a[r]})}),n}const tt=()=>{let t=20,a=0,n=0;if(ct.value&&(t+=30),vt.value&&(t+=25),P.value&&F.series.length>0){const r=F.series.filter((p,g)=>!Ht.value.has(g)).length;if(K.value==="top"||K.value==="bottom"){if(Se.value==="horizontal"){const g=Math.floor(Ee.value/100);a=Math.ceil(r/g)*25+10}else a=r*25+10;t+=a}else n=150}return{height:t,legendHeight:a,legendWidth:n}};function mt(t){return t&&typeof t=="object"&&!Array.isArray(t)}const Z=e.computed(()=>Me(ue,F.options)),Ae=e.computed(()=>{const t=Z.value;return t&&t.chart&&t.chart.width==="auto"}),We=e.computed(()=>{const t=Z.value;return t&&t.chart&&t.chart.height==="auto"}),Ee=e.computed(()=>{const t=Z.value;return Ae.value?st.value||800:t&&t.chart&&typeof t.chart.width=="number"?t.chart.width:800}),_e=e.ref(ke),Ye=e.computed(()=>{if(We.value){const t=Ye.value;return t??Math.max(0,(te.value||400)-_e.value*5)}}),ie=e.computed(()=>{const t=Z.value;if(we.value==="mini-radial")return Ee.value;if(We.value){const a=Ye.value;return a??Math.max(0,(te.value||400)-_e.value)}return t&&t.chart&&typeof t.chart.height=="number"?t.chart.height:400}),Je=e.computed(()=>{if(We.value&&we.value==="semi-radial"&&Ye.value!=null)return _e.value+ie.value+"px";if(We.value)return"100%";if(Sn.value)return _e.value+ie.value+"px";if(P.value&&K.value==="bottom"){const t=tt();return ie.value+(t.legendHeight||35)+"px"}return ie.value+(P.value?20:0)+"px"}),we=e.computed(()=>{const t=Z.value;return t&&t.chart&&t.chart.type?t.chart.type:"line"}),et=e.computed(()=>{const t=F.series.map(a=>a.type||we.value);return new Set(t).size>1}),ct=e.computed(()=>{const t=Z.value;return t&&t.title&&t.title.text?t.title.text:""}),vt=e.computed(()=>{const t=Z.value;return t&&t.subtitle&&t.subtitle.text?t.subtitle.text:""}),ut=e.computed(()=>{const t=Z.value;if(!t||!t.zAxis)return"";const a=t.zAxis;return typeof a=="string"?a:a&&typeof a.label=="string"?a.label:""}),Ft=e.computed(()=>{const t=Z.value;return t&&t.xAxis&&t.xAxis.title&&t.xAxis.title.text?t.xAxis.title.text:""}),It=e.computed(()=>{const t=Z.value;return t&&t.yAxis&&t.yAxis.title&&t.yAxis.title.text?t.yAxis.title.text:""}),bt=e.computed(()=>{const t=Z.value;return t&&t.yAxis&&t.yAxis.secondary&&typeof t.yAxis.secondary=="object"?t.yAxis.secondary:null}),wt=e.computed(()=>{const t=bt.value;return t&&t.title&&t.title.text?t.title.text:""}),Jt=e.computed(()=>{const t=Z.value;if(!t||!t.yAxis)return Dn;const a=t.yAxis.min;return typeof a=="number"||a===Dn?a:Dn}),pt=e.computed(()=>{const t=Z.value;if(!t||!t.yAxis)return Dn;const a=t.yAxis.max;return typeof a=="number"||a===Dn?a:Dn}),jt=e.computed(()=>{const t=bt.value;if(!t)return Dn;const a=t.min;return typeof a=="number"||a===Dn?a:Dn}),kt=e.computed(()=>{const t=bt.value;if(!t)return Dn;const a=t.max;return typeof a=="number"||a===Dn?a:Dn}),tn=e.computed(()=>{const t=Z.value;return!t||!t.xAxis?null:typeof t.xAxis.min=="number"?t.xAxis.min:null}),U=e.computed(()=>{const t=Z.value;return!t||!t.xAxis?null:typeof t.xAxis.max=="number"?t.xAxis.max:null}),ye=e.computed(()=>{const t=Z.value;return t&&t.grid&&t.grid.show!==!1}),P=e.computed(()=>{const t=Z.value;return t&&t.legend&&t.legend.show!==!1}),K=e.computed(()=>{const t=Z.value;return t&&t.legend&&t.legend.position?t.legend.position:"top"}),Se=e.computed(()=>{const t=Z.value;return t&&t.legend&&t.legend.orientation?t.legend.orientation:"horizontal"}),Re=e.computed(()=>{const t=Z.value;return!t||!t.tooltip?!0:t.tooltip.enabled!==!1}),Ze=e.computed(()=>{const t=Z.value;if(!t||!t.crosshair)return!1;const a=t.crosshair.show;return a===!0||a==="true"}),xt=e.computed(()=>{const t=Z.value;return t&&t.crosshair&&t.crosshair.color?t.crosshair.color:"#666"}),Ke=e.computed(()=>{const t=Z.value;return!t||!t.zoom?!1:t.zoom.enabled===!0}),zt=e.computed(()=>{const t=Z.value;return t&&t.zoom&&typeof t.zoom.minScale=="number"?t.zoom.minScale:1}),qe=e.computed(()=>{const t=Z.value;return t&&t.zoom&&typeof t.zoom.maxScale=="number"?t.zoom.maxScale:2.5}),ze=e.computed(()=>{const t=Z.value;return t&&t.stroke&&typeof t.stroke.width=="number"?t.stroke.width:2}),Lt=e.computed(()=>{if(!Sn.value)return 0;const t=Z.value;return t&&t.stroke&&typeof t.stroke.width=="number"?t.stroke.width:0}),$t=e.computed(()=>{const t=Z.value;return t&&t.bubbles&&typeof t.bubbles.size=="number"?t.bubbles.size:4}),oe=e.computed(()=>{const{maxX:t}=Vt.value;return t===0}),Y=(t,a)=>oe.value&&a===0?5:a,j=t=>{const a=Number(t);return!Number.isFinite(a)||a<=0?0:a},de=e.computed(()=>{const t=Z.value;return t&&t.fill&&t.fill.area&&typeof t.fill.area.opacity=="number"?t.fill.area.opacity:.3}),be=e.computed(()=>{const t=Z.value;return t&&t.smoothing&&t.smoothing.enabled===!0}),je=e.computed(()=>{const t=Z.value;return t&&t.smoothing&&typeof t.smoothing.factor=="number"?t.smoothing.factor:.3}),Tt=e.computed(()=>{const t=Z.value;return be.value?t&&t.smoothing&&typeof t.smoothing.barRadius=="number"?t.smoothing.barRadius:4:0}),Xt=e.computed(()=>{const t=Z.value,a=t&&t.colors&&Array.isArray(t.colors)?t.colors:[];return a.length>0?a:["#3B82F6","#EF4444","#10B981","#F59E0B","#8B5CF6","#F97316","#06B6D4","#84CC16"]}),nt=e.computed(()=>{const t=Z.value;return t&&t.animations&&t.animations.enabled!==!1}),sn=e.computed(()=>{const t=Z.value;return t&&t.animations&&t.animations.type?t.animations.type:"draw"}),N=e.computed(()=>{const t=Z.value;return t&&t.animations&&typeof t.animations.duration=="number"?t.animations.duration:2500}),b=e.computed(()=>{const t=Z.value;return t&&t.animations&&typeof t.animations.delay=="number"?t.animations.delay:0}),B=e.computed(()=>{const t=Z.value;return t&&t.animations&&t.animations.easing?t.animations.easing:"ease-out"}),G=e.computed(()=>{const t=Z.value;return t&&t.animations&&typeof t.animations.staggerDelay=="number"?t.animations.staggerDelay:200}),ae=e.computed(()=>{const t=Z.value;return t&&t.animations&&t.animations.onDataChange!==!1}),De=e.computed(()=>{const t=Z.value;return t&&t.animations&&t.animations.respectReducedMotion!==!1}),Ct=e.computed(()=>{const t=Z.value;return t&&t.fill&&t.fill.spider&&typeof t.fill.spider.opacity=="number"?t.fill.spider.opacity:.15}),lt=e.computed(()=>Z.value?.spider?.gridSteps||5),Ie=e.computed(()=>{const t=[],a=lt.value;for(let n=1;n<=a;n++)t.push(it.value/a*n);return t}),Et=t=>{const a=Bt.value;if(a&&Array.isArray(a)&&a[t]!==void 0)return a[t].toString();const n=Ie.value[t];return Math.round(n/it.value*100)+"%"},Bt=e.computed(()=>Z.value?.spider?.gridLabels||null),St=e.computed(()=>{const t=Z.value;return t&&t.contextMenu&&t.contextMenu.enabled===!0}),rt=e.computed(()=>{const t=Z.value,a={addMarker:!0,downloadSvg:!0,downloadPng:!0,downloadCsv:!0};return t&&t.contextMenu&&t.contextMenu.items?{...a,...t.contextMenu.items}:a}),At=e.computed(()=>{const t=Z.value;return t&&t.contextMenu&&Array.isArray(t.contextMenu.customItems)?t.contextMenu.customItems:[]}),Nt=e.computed(()=>{const t=Z.value;return t&&t.markers&&t.markers.icon?t.markers.icon:Un.value}),rn=e.computed(()=>{const t=Z.value;return t&&t.markers&&t.markers.customIcons?t.markers.customIcons:{}}),Vn=e.computed(()=>{const t=Z.value;return t&&t.markers&&typeof t.markers.iconSize=="number"?t.markers.iconSize:20}),Zn=e.computed(()=>{const a=Z.value?.valueFormat?.extension;return typeof a=="string"?a:""}),en=t=>{const a=Zn.value;if(t==null)return"";const n=String(t);return a?n+a:n},pn=e.computed(()=>!se.value.isZooming);e.computed(()=>on.value.map(t=>{if(t.categoryIndex!==void 0&&(En.value||Yt.value)){const a=ln(t.categoryIndex),n=Q.value+O.value.bottom-Vn.value/2;return{...t,x:a,y:n}}return t}));function ll(t,a){let n;if(t instanceof Date)n=new Date(t.getFullYear(),t.getMonth(),t.getDate());else if(typeof t=="string"){const[g,C,w]=t.split("-"),W=Number(w?.length===2?`20${w}`:w);n=new Date(W,Number(C)-1,Number(g))}else return 0;let r=0,p=1/0;return a.forEach((g,C)=>{const[w,W,M]=g.split("-"),H=Number(M?.length===2?`20${M}`:M),T=new Date(H,Number(W)-1,Number(w)),ee=Math.abs(T-n);ee<p&&(p=ee,r=C)}),r}const vl=e.computed(()=>{const t=F.markers.map(n=>{const r=ll(n.marker_date,F.categories),p=ln(r),g=Q.value+O.value.bottom-Vn.value/2;return{...n,x:p,y:g,categoryIndex:r,source:"props"}}),a=on.value.map(n=>{if(n.categoryIndex!==void 0&&(En.value||Yt.value)){const r=ln(n.categoryIndex),p=Q.value+O.value.bottom-Vn.value/2;return{...n,x:r,y:p,source:"internal"}}return{...n,source:"internal"}});return[...t,...a]}),il=e.computed(()=>{const t=Z.value;return t&&t.watermark&&t.watermark.enabled===!0}),_n=e.computed(()=>{const t=Z.value;return t&&t.watermark&&typeof t.watermark.opacity=="number"?t.watermark.opacity:.05}),gl=e.computed(()=>{const t=Z.value;return t&&t.watermark&&t.watermark.size?t.watermark.size:35}),$n=e.computed(()=>{const t=Z.value;return t&&t.watermark&&t.watermark.position?t.watermark.position:"bottom-right"}),Vl=e.computed(()=>{const t={left:O.value.left,top:O.value.top,width:O.value.width,height:O.value.height};let a,n;const r=String(gl.value);if(r.includes("%")){const p=parseFloat(r)/100;a=t.width*p,n=a*(96/499)}else{const p=parseFloat(r)||25;a=Math.min(t.width*.25,200)*(p/25),n=a*(96/499)}return{width:a,height:n,area:t}}),Rl=e.computed(()=>{const{width:t,height:a}=Vl.value,n=$n.value;let r,p;const g=O.value.left,C=O.value.right,w=O.value.top,W=O.value.bottom,M=O.value.width,H=O.value.height;switch(n){case"center":r=g+(M-t)/2,p=w+(H-a)/2;break;case"top-left":r=g+15,p=w+5;break;case"top-right":r=C-t-15,p=w+5;break;case"bottom-left":r=g+15,p=W-a-5;break;case"bottom-right":default:r=C-t-15,p=W-a-5;break}return{backgroundPositionX:r+"px",backgroundPositionY:p+"px",backgroundSize:`${t}px ${a}px`}}),hl=t=>!F.flags||!F.flags.length?[]:F.flags.filter(a=>a.categoryIndex===t),An=t=>{const a=hl(t),n=kl(t),r=a.filter(C=>C.manual),p=a.filter(C=>!C.manual),g=[];return r.length>0&&g.push({type:$("chart.tooltip.manualFlags"),color:"#698dbe",flags:r.map(C=>({text:C.text,color:"#698dbe"}))}),p.length>0&&g.push({type:$("chart.tooltip.autoFlags"),color:"#a1d499",flags:p.map(C=>({text:C.text,color:"#a1d499"}))}),{flagGroups:g,markers:n.map(C=>({title:C.title,description:C.description,type:$("chart.tooltip.markers"),color:C.color||"#9784ba"}))}},Un=e.computed(()=>{const t=F.old?`<svg width="55" height="56" viewBox="0 0 55 56" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),ro=require("vue-i18n"),ss={key:0,class:"dss-datepicker__input-wrap dss-datepicker__input-wrap--readonly"},rs=["value"],is=["placeholder","value","disabled"],cs=["placeholder","value"],us=["placeholder","value"],ds=["aria-selected","onClick"],ms={class:"dss-datepicker__list-item-label"},ps={key:0,class:"dss-datepicker__list-item-check",width:"16",height:"16",viewBox:"0 0 256 256",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},fs={key:1,class:"dss-datepicker__list-empty"},vs={key:1,class:"dss-datepicker__double-wrap"},hs={key:0,class:"dss-datepicker__quick-select","aria-label":"Quick range"},gs=["disabled","onClick"],ys={class:"dss-datepicker__double-calendars"},ks={class:"dss-datepicker__double-calendar"},Cs={class:"dss-datepicker__calendar-header"},bs=["aria-label"],xs={class:"dss-datepicker__month-year-row"},ws=["aria-label"],Es={class:"dss-datepicker__weekdays"},Ss={class:"dss-datepicker__grid"},Vs=["disabled","onClick","onMouseenter"],Ns={key:1,class:"dss-datepicker__day dss-datepicker__day--empty"},Bs={class:"dss-datepicker__double-calendar"},Ms={class:"dss-datepicker__calendar-header"},_s=["aria-label"],$s={class:"dss-datepicker__month-year-row"},Ls=["aria-label"],As={class:"dss-datepicker__weekdays"},Ts={class:"dss-datepicker__grid"},Ds=["disabled","onClick","onMouseenter"],Hs={key:1,class:"dss-datepicker__day dss-datepicker__day--empty"},Rs={class:"dss-datepicker__calendar-header"},Fs=["aria-label"],Is={class:"dss-datepicker__month-year-row"},zs=["aria-label"],Ps={class:"dss-datepicker__weekdays"},Os={class:"dss-datepicker__grid"},Ws=["disabled","onClick","onMouseenter"],qs={key:1,class:"dss-datepicker__day dss-datepicker__day--empty"},Zs={class:"dss-datepicker__calendar-header"},Us={class:"dss-datepicker__month-year-row"},Xs={class:"dss-datepicker__month-year dss-datepicker__month-year--static"},Ys={class:"dss-datepicker__months-grid"},js=["onClick"],Ks={class:"dss-datepicker__calendar-header dss-datepicker__calendar-header--center"},Gs={class:"dss-datepicker__month-year"},Qs={class:"dss-datepicker__years-grid"},Js=["data-year","onClick"],Na=27,zn=8,pa={__name:"DSSDatepicker",props:{mode:{type:String,default:"single",validator:E=>["single","range","singleFromAvailable","rangeFromAvailable","listFromAvailable","readonly"].includes(E)},modelValue:{type:[Date,Object],default:null},availableDates:{type:Array,default:()=>[]},minDate:{type:Date,default:null},maxDate:{type:Date,default:null},exceptDates:{type:Array,default:()=>[]},doubleCalendar:{type:Boolean,default:!1},quickSelect:{type:Boolean,default:!0},placeholder:{type:String,default:""}},emits:["update:modelValue"],setup(E,{emit:te}){const $=E,V=te,{t:ce,locale:O}=ro.useI18n(),L=e.ref(!1),fe=e.ref("days"),rt=new Date,ee=e.computed(()=>$.minDate instanceof Date?$.minDate:rt),v=e.ref(ee.value.getMonth()),be=e.ref(ee.value.getFullYear()),ke=e.ref(ee.value.getMonth()),J=e.ref(ee.value.getFullYear()),Y=e.ref(ee.value.getMonth()),me=e.ref(ee.value.getFullYear()),F=e.ref("start"),ue=e.ref(null),$e=e.ref(null);function tt(){const T=ee.value,z=T.getMonth(),_=T.getFullYear(),le=z===11?0:z+1,Te=z===11?_+1:_;return{left:{month:z,year:_},right:{month:le,year:Te}}}const mt=e.ref(null),U=e.ref(null),ze=e.ref(null),qe=e.ref(null),Ve=e.ref(null),Le=e.ref(null),je=e.ref(null),re=e.ref(null),Qe=new Date().getFullYear(),Ce=e.computed(()=>["single","singleFromAvailable"].includes($.mode)),Je=e.computed(()=>["range","rangeFromAvailable"].includes($.mode)),ut=e.computed(()=>$.mode==="listFromAvailable"),ht=e.computed(()=>{if(!["single","singleFromAvailable","listFromAvailable"].includes($.mode))return null;const T=$.modelValue;return T instanceof Date?T:null}),dt=e.computed(()=>{if(!Je.value)return{start:null,end:null};const T=$.modelValue;return!T||typeof T!="object"?{start:null,end:null}:{start:T.start instanceof Date?T.start:null,end:T.end instanceof Date?T.end:null}});function Wt(T){if(!T||!(T instanceof Date))return"";const z=T.getDate(),_=T.getMonth()+1,le=T.getFullYear(),Te=pt=>String(pt).padStart(2,"0");return`${Te(z)}/${Te(_)}/${le}`}const qt=e.computed(()=>Wt(ht.value)),Ct=e.computed(()=>{const{start:T,end:z}=dt.value;if(!T&&!z)return"";const _=!z||T&&T<=z?T:z,le=!T||z&&z>=T?z:T;return jt(_,le)?Wt(_):`${Wt(_)} - ${Wt(le)}`}),wt=e.computed(()=>{if($.mode!=="readonly")return"—";const T=$.modelValue;if(T instanceof Date)return Wt(T)||"—";if(T&&typeof T=="object"&&("start"in T||"end"in T)){const z=T.start instanceof Date?T.start:null,_=T.end instanceof Date?T.end:null;if(!z&&!_)return"—";const le=!_||z&&z<=_?z:_,Te=!z||_&&_>=z?_:z;return jt(le,Te)?Wt(le):`${Wt(le)} - ${Wt(Te)}`}return"—"});e.computed(()=>{const T=new Date(be.value,v.value,1);return new Intl.DateTimeFormat(O.value,{month:"long",year:"numeric"}).format(T)});const Yt=e.computed(()=>$e.value==="left"?ke.value:$e.value==="right"?Y.value:v.value),it=e.computed(()=>$e.value==="left"?J.value:$e.value==="right"?me.value:be.value),Kt=e.computed(()=>{const T=new Date(be.value,v.value,1);return new Intl.DateTimeFormat(O.value,{month:"long"}).format(T)}),yt=e.computed(()=>{const T=new Date(it.value,Yt.value,1);return new Intl.DateTimeFormat(O.value,{month:"long"}).format(T)}),el=e.computed(()=>{const T=new Intl.DateTimeFormat(O.value,{month:"short"});return Array.from({length:12},(z,_)=>T.format(new Date(2024,_,1)))}),X=e.computed(()=>{const z=($e.value?it.value:be.value)-Math.floor(Na/2);return Array.from({length:Na},(_,le)=>z+le)}),ge=e.computed(()=>{const T=X.value;return T.length?`${T[0]} – ${T[T.length-1]}`:""});function W(T){return T===7?0:T}function G(T){try{const z=new Intl.Locale(T);if(z.weekInfo?.firstDay!=null)return W(z.weekInfo.firstDay)}catch{}return 1}function Ne(T){const z=new Date(2024,0,1),_=(z.getDay()-T+7)%7,le=new Date(z);return le.setDate(z.getDate()-_),le}const Pe=e.computed(()=>G(O.value)),Xe=e.computed(()=>{const T=new Intl.DateTimeFormat(O.value,{weekday:"short"}),z=Ne(Pe.value),_=[];for(let le=0;le<7;le++){const Te=new Date(z);Te.setDate(z.getDate()+le),_.push(T.format(Te).slice(0,2))}return _});function Et(T,z,_){const le=new Date(T,z,1),Te=new Date(T,z+1,0),pt=(le.getDay()-_+7)%7,ct=Te.getDate(),lt=[];for(let st=0;st<pt;st++)lt.push(null);for(let st=1;st<=ct;st++)lt.push(new Date(T,z,st));return lt}const Ge=e.computed(()=>Et(be.value,v.value,Pe.value)),Zt=e.computed(()=>Et(J.value,ke.value,Pe.value)),Ue=e.computed(()=>Et(me.value,Y.value,Pe.value));e.computed(()=>{const T=new Date(J.value,ke.value,1);return new Intl.DateTimeFormat(O.value,{month:"long",year:"numeric"}).format(T)}),e.computed(()=>{const T=new Date(me.value,Y.value,1);return new Intl.DateTimeFormat(O.value,{month:"long",year:"numeric"}).format(T)});const We=e.computed(()=>{const T=new Date(J.value,ke.value,1);return new Intl.DateTimeFormat(O.value,{month:"long"}).format(T)}),Dt=e.computed(()=>{const T=new Date(me.value,Y.value,1);return new Intl.DateTimeFormat(O.value,{month:"long"}).format(T)}),Lt=e.computed(()=>$.availableDates&&$.availableDates.length>0),ne=e.computed(()=>Lt.value?[{id:"all",labelKey:"datepicker.quickSelect.allDates"},{id:"last2",labelKey:"datepicker.quickSelect.last2Dates"},{id:"last3",labelKey:"datepicker.quickSelect.last3Dates"},{id:"last4",labelKey:"datepicker.quickSelect.last4Dates"},{id:"last5",labelKey:"datepicker.quickSelect.last5Dates"}]:[{id:"today",labelKey:"datepicker.quickSelect.today"},{id:"lastWeek",labelKey:"datepicker.quickSelect.lastWeek"},{id:"last15Days",labelKey:"datepicker.quickSelect.last15Days"},{id:"last30Days",labelKey:"datepicker.quickSelect.last30Days"},{id:"thisMonth",labelKey:"datepicker.quickSelect.thisMonth"},{id:"last3Months",labelKey:"datepicker.quickSelect.last3Months"},{id:"last6Months",labelKey:"datepicker.quickSelect.last6Months"},{id:"last12Months",labelKey:"datepicker.quickSelect.last12Months"},{id:"lastYear",labelKey:"datepicker.quickSelect.lastYear"}]),j=e.ref({top:0,left:0}),K=e.ref("left");let de=null;function xe(){L.value&&e.nextTick(()=>{L.value&&(de!==null&&window.cancelAnimationFrame(de),de=window.requestAnimationFrame(()=>{de=null,Ke()}))})}function Ke(){if(!Ve.value||!L.value)return;const T=Ve.value.getBoundingClientRect(),z=window.innerWidth||document.documentElement.clientWidth,_=window.innerHeight||document.documentElement.clientHeight;let le=T.left,Te=T.bottom+4;const pt=Le.value;if(pt){const ct=pt.offsetWidth,lt=pt.offsetHeight;K.value==="right"||le+ct>z-zn?(K.value="right",le=T.right-ct):K.value="left";const il=Math.max(zn,z-ct-zn);if(le=Math.min(Math.max(le,zn),il),Te+lt>_-zn){const kl=T.top-4-lt;kl>=zn?Te=kl:Te=Math.max(zn,_-lt-zn)}}j.value={top:Te,left:le}}const Ht=e.computed(()=>!Ve.value||!L.value?{}:{position:"fixed",left:`${j.value.left}px`,top:`${j.value.top}px`,zIndex:1002});function jt(T,z){return!T||!z?!1:T.getFullYear()===z.getFullYear()&&T.getMonth()===z.getMonth()&&T.getDate()===z.getDate()}function et(T){return new Date(T.getFullYear(),T.getMonth(),T.getDate()).getTime()}function vl(T){return!$.availableDates||!$.availableDates.length?!0:$.availableDates.some(z=>z instanceof Date&&jt(z,T))}function M(T){const z=et(T);return!($.minDate instanceof Date&&z<et($.minDate)||$.maxDate instanceof Date&&z>et($.maxDate))}function x(T){const z=new Date(T);return new Date(z.getFullYear(),z.getMonth(),z.getDate())}function A(T){return T.filter(z=>M(z))}function ae(T,z){if(!(T instanceof Date)||!(z instanceof Date))return null;let _=et(T),le=et(z);if(_>le&&([_,le]=[le,_]),$.minDate instanceof Date){const Te=et($.minDate);_=Math.max(_,Te),le=Math.max(le,Te)}if($.maxDate instanceof Date){const Te=et($.maxDate);_=Math.min(_,Te),le=Math.min(le,Te)}return _>le?null:{start:x(_),end:x(le)}}function oe(T){return!$.exceptDates||!$.exceptDates.length?!1:$.exceptDates.some(z=>z instanceof Date&&jt(z,T))}function Fe(T){return oe(T)?!1:["singleFromAvailable","rangeFromAvailable"].includes($.mode)?vl(T):M(T)}function bt(T){const z=ht.value,_=dt.value,le=et(T),Te=Je.value&&_.start&&_.end&&le>et(_.start)&&le<et(_.end),pt=Je.value&&_.start&&jt(T,_.start),ct=Je.value&&_.end&&jt(T,_.end),lt=pt&&ct,st=Ce.value&&z&&jt(T,z)||pt||ct;let il=!1;if(Je.value&&_.start&&!_.end&&ue.value){const kl=et(_.start),Gt=et(ue.value),wl=Math.min(kl,Gt),Rt=Math.max(kl,Gt);il=le>wl&&le<Rt}return{"dss-datepicker__day--selected":st&&!lt,"dss-datepicker__day--range-start":pt&&!lt,"dss-datepicker__day--range-end":ct&&!lt,"dss-datepicker__day--range-single":lt,"dss-datepicker__day--in-range":Te&&!pt&&!ct,"dss-datepicker__day--in-range-preview":il&&!pt&&!ct&&!Te,"dss-datepicker__day--disabled":!Fe(T)}}function ot(T){if(!Je.value)return;const z=dt.value;if(!z.start||z.end){ue.value=null;return}if(!Fe(T)){ue.value=null;return}ue.value=new Date(T.getFullYear(),T.getMonth(),T.getDate())}function Ie(){ue.value=null}function xt(){if(!$.doubleCalendar||!Je.value)return;const T=dt.value,{start:z,end:_}=T;if(z&&_){const pt=z<=_?z:_,ct=z<=_?_:z,lt=pt.getMonth(),st=pt.getFullYear(),il=ct.getMonth(),kl=ct.getFullYear();if(lt!==il||st!==kl){const Gt=ke.value===lt&&J.value===st,wl=Y.value===il&&me.value===kl;if(Gt&&wl)return;ke.value=lt,J.value=st,Y.value=il,me.value=kl}else{const Gt=lt===0?11:lt-1,wl=lt===0?st-1:st;ke.value===Gt&&J.value===wl&&Y.value===lt&&me.value===st||(ke.value=lt,J.value=st,lt===11?(Y.value=0,me.value=st+1):(Y.value=lt+1,me.value=st))}return}const le=z||_;if(le){const pt=le.getMonth(),ct=le.getFullYear(),lt=ke.value===pt&&J.value===ct,st=Y.value===pt&&me.value===ct;if(lt||st)return;ke.value=pt,J.value=ct,pt===11?(Y.value=0,me.value=ct+1):(Y.value=pt+1,me.value=ct);return}const Te=tt();ke.value=Te.left.month,J.value=Te.left.year,Y.value=Te.right.month,me.value=Te.right.year}const Mt=e.computed(()=>new Intl.DateTimeFormat(O.value,{day:"2-digit",month:"long",year:"numeric"})),St=e.computed(()=>{if(!ut.value)return[];const T=($.availableDates||[]).filter(_=>_ instanceof Date&&!Number.isNaN(_.getTime())).filter(_=>!oe(_)&&M(_)).map(_=>new Date(_.getFullYear(),_.getMonth(),_.getDate()));T.sort((_,le)=>le.getTime()-_.getTime());const z=ht.value;return T.map(_=>({date:_,ts:_.getTime(),label:Mt.value.format(_),selected:!!(z&&jt(_,z))}))});function At(){if(L.value){yl();return}Ve.value=qe.value?.closest(".dss-datepicker__input-wrap"),K.value="left",L.value=!0,xe(),e.nextTick(()=>{re.value?.querySelector(".dss-datepicker__list-item--selected")?.scrollIntoView({block:"nearest",behavior:"auto"})})}function It(T){if(!(T instanceof Date))return;const z=new Date(T.getFullYear(),T.getMonth(),T.getDate());V("update:modelValue",z),yl()}function Nt(T="start"){if($.mode==="readonly")return;F.value=T;const z=ht.value,_=dt.value;if(Ce.value&&z)v.value=z.getMonth(),be.value=z.getFullYear();else if(Je.value)if($.doubleCalendar)xt();else{const le=T==="start"&&_.start?_.start:_.end||_.start;le&&(v.value=le.getMonth(),be.value=le.getFullYear())}Ve.value=Ce.value?mt.value?.closest(".dss-datepicker__input-wrap"):U.value,fe.value="days",$e.value=null,K.value="left",L.value=!0,xe()}function yl(){fe.value="days",$e.value=null,ue.value=null,L.value=!1}function nn(T,z){$e.value=T,fe.value=z}function Vl(){fe.value="days",$e.value=null}function Nl(T){const z=new Date,_=z.getFullYear(),le=z.getMonth(),Te=z.getDate();let pt,ct;if(Lt.value){const lt=A([...$.availableDates].filter(st=>st instanceof Date).map(st=>new Date(st.getFullYear(),st.getMonth(),st.getDate()))).sort((st,il)=>st.getTime()-il.getTime());if(lt.length===0)return null;if(T==="all")pt=lt[0],ct=lt[lt.length-1];else{const st=parseInt(T.replace("last",""),10);if(st<2||st>5)return null;const il=lt.slice(-st);if(il.length===0)return null;pt=il[0],ct=il[il.length-1]}}else{const lt=new Date(_,le,Te);switch(T){case"today":pt=lt,ct=lt;break;case"lastWeek":pt=new Date(_,le,Te-6),ct=lt;break;case"last15Days":pt=new Date(_,le,Te-14),ct=lt;break;case"last30Days":pt=new Date(_,le,Te-29),ct=lt;break;case"thisMonth":pt=new Date(_,le,1),ct=lt;break;case"last3Months":pt=new Date(_,le-3,1),ct=new Date(_,le,0);break;case"last6Months":pt=new Date(_,le-6,1),ct=new Date(_,le,0);break;case"last12Months":pt=new Date(_,le-12,1),ct=new Date(_,le,0);break;case"lastYear":pt=new Date(_-1,0,1),ct=new Date(_-1,11,31);break;default:return null}}return{start:pt,end:ct}}function tl(T){const z=Nl(T);return z?ae(z.start,z.end):null}function jl(T){return tl(T)!==null}function on(T){const z=tl(T);z&&(V("update:modelValue",z),xt())}function xl(T){$e.value==="left"?ke.value=T:$e.value==="right"?Y.value=T:v.value=T,Vl()}function Fl(T){$e.value==="left"?J.value=T:$e.value==="right"?me.value=T:be.value=T,Vl()}function dn(){v.value===0?(v.value=11,be.value--):v.value--}function Hl(){v.value===11?(v.value=0,be.value++):v.value++}function Pn(){ke.value===0?(ke.value=11,J.value--):ke.value--}function mn(){ke.value===11?(ke.value=0,J.value++):ke.value++}function pn(){Y.value===0?(Y.value=11,me.value--):Y.value--}function wn(){Y.value===11?(Y.value=0,me.value++):Y.value++}function ql(T){if(!Fe(T))return;const z=new Date(T.getFullYear(),T.getMonth(),T.getDate());if(Ce.value){V("update:modelValue",z),yl();return}const _=dt.value;if(!_.start&&!_.end){V("update:modelValue",{start:z,end:null}),F.value="end";return}if(_.start&&_.end){V("update:modelValue",{start:z,end:null}),F.value="end";return}if(F.value==="start"){let le=z,Te=_.end;le&&Te&&le>Te&&([le,Te]=[Te,le]),V("update:modelValue",{start:le||Te,end:Te||le}),F.value="end"}else{let le=_.start,Te=z;le&&Te&&Te<le&&([le,Te]=[Te,le]),V("update:modelValue",{start:le||Te,end:Te||le}),F.value="start"}}e.watch(dt,()=>{$.doubleCalendar&&Je.value&&L.value&&xt()},{deep:!0});let rl=null,Il=null,Kl=null;function sn(){rl&&(document.removeEventListener("keydown",rl),rl=null),Il&&(window.removeEventListener("resize",Il),Il=null),Kl&&(window.removeEventListener("scroll",Kl,!0),Kl=null)}return e.watch(fe,T=>{T==="years"&&e.nextTick(()=>{je.value?.querySelector(`[data-year="${it.value}"]`)?.scrollIntoView({block:"center",behavior:"auto"})})}),e.watch(()=>[L.value,fe.value,v.value,be.value,ke.value,J.value,Y.value,me.value,$e.value,$.doubleCalendar,$.quickSelect],()=>{xe()}),e.watch(L,T=>{sn(),T&&(rl=z=>{z.key==="Escape"&&(fe.value==="years"||fe.value==="months"?Vl():yl())},Il=()=>{Ke()},Kl=()=>{Ke()},document.addEventListener("keydown",rl),window.addEventListener("resize",Il),window.addEventListener("scroll",Kl,!0))}),e.onBeforeUnmount(()=>{de!==null&&(window.cancelAnimationFrame(de),de=null),sn()}),(T,z)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-datepicker",{"dss-datepicker--readonly":E.mode==="readonly"}])},[E.mode==="readonly"?(e.openBlock(),e.createElementBlock("div",ss,[z[10]||(z[10]=e.createElementVNode("span",{class:"dss-datepicker__icon","aria-hidden":"true"},[e.createElementVNode("svg",{class:"dss-datepicker__icon-svg",width:"24",height:"24",viewBox:"0 0 256 256",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[e.createElementVNode("path",{d:"M208,32H184V24a8,8,0,0,0-16,0v8H88V24a8,8,0,0,0-16,0v8H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32Zm0,48H48V48H72v8a8,8,0,0,0,16,0V48h80v8a8,8,0,0,0,16,0V48h24Z"})])],-1)),e.createElementVNode("input",{type:"text",class:"dss-datepicker__input",value:wt.value,readonly:"",disabled:"",tabindex:"-1"},null,8,rs)])):Ce.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-datepicker__input-wrap",onClick:z[0]||(z[0]=_=>Nt("start"))},[z[11]||(z[11]=e.createElementVNode("span",{class:"dss-datepicker__icon","aria-hidden":"true"},[e.createElementVNode("svg",{class:"dss-datepicker__icon-svg",width:"24",height:"24",viewBox:"0 0 256 256",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[e.createElementVNode("path",{d:"M208,32H184V24a8,8,0,0,0-16,0v8H88V24a8,8,0,0,0-16,0v8H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32Zm0,48H48V48H72v8a8,8,0,0,0,16,0V48h80v8a8,8,0,0,0,16,0V48h24Z"})])],-1)),e.createElementVNode("input",{ref_key:"inputSingleRef",ref:mt,type:"text",class:"dss-datepicker__input",placeholder:$.placeholder||e.unref(ce)("datepicker.selectDate"),value:qt.value,readonly:"",disabled:E.mode==="readonly"},null,8,is)])):ut.value?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(["dss-datepicker__input-wrap dss-datepicker__input-wrap--list",{"dss-datepicker__input-wrap--open":L.value}]),onClick:At},[z[13]||(z[13]=e.createElementVNode("span",{class:"dss-datepicker__icon","aria-hidden":"true"},[e.createElementVNode("svg",{class:"dss-datepicker__icon-svg",width:"24",height:"24",viewBox:"0 0 256 256",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[e.createElementVNode("path",{d:"M208,32H184V24a8,8,0,0,0-16,0v8H88V24a8,8,0,0,0-16,0v8H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32Zm0,48H48V48H72v8a8,8,0,0,0,16,0V48h80v8a8,8,0,0,0,16,0V48h24Z"})])],-1)),e.createElementVNode("input",{ref_key:"inputListRef",ref:qe,type:"text",class:"dss-datepicker__input",placeholder:$.placeholder||e.unref(ce)("datepicker.selectFromList"),value:qt.value,readonly:""},null,8,cs),e.createElementVNode("span",{class:e.normalizeClass(["dss-datepicker__chevron",{"dss-datepicker__chevron--open":L.value}]),"aria-hidden":"true"},[...z[12]||(z[12]=[e.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 256 256",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z"})],-1)])],2)],2)):Je.value?(e.openBlock(),e.createElementBlock("div",{key:3,class:"dss-datepicker__input-wrap",ref_key:"inputRangeWrapRef",ref:U,onClick:z[1]||(z[1]=_=>Nt("start"))},[z[14]||(z[14]=e.createElementVNode("span",{class:"dss-datepicker__icon","aria-hidden":"true"},[e.createElementVNode("svg",{class:"dss-datepicker__icon-svg",width:"24",height:"24",viewBox:"0 0 256 256",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[e.createElementVNode("path",{d:"M208,32H184V24a8,8,0,0,0-16,0v8H88V24a8,8,0,0,0-16,0v8H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32Zm0,48H48V48H72v8a8,8,0,0,0,16,0V48h80v8a8,8,0,0,0,16,0V48h24Z"})])],-1)),e.createElementVNode("input",{ref_key:"inputRangeRef",ref:ze,type:"text",class:"dss-datepicker__input",placeholder:$.placeholder||e.unref(ce)("datepicker.selectRange"),value:Ct.value,readonly:""},null,8,us)],512)):e.createCommentVNode("",!0),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[L.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-datepicker__overlay",onClick:e.withModifiers(yl,["self"])},[e.createElementVNode("div",{ref_key:"dropdownRef",ref:Le,class:e.normalizeClass(["dss-datepicker__dropdown",{"dss-datepicker__dropdown--double":E.doubleCalendar&&Je.value&&fe.value==="days","dss-datepicker__dropdown--quick-select":E.doubleCalendar&&Je.value&&fe.value==="days"&&E.quickSelect,"dss-datepicker__dropdown--list":ut.value}]),onClick:z[9]||(z[9]=e.withModifiers(()=>{},["stop"])),style:e.normalizeStyle(Ht.value)},[ut.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[St.value.length?(e.openBlock(),e.createElementBlock("ul",{key:0,class:"dss-datepicker__list",role:"listbox",ref_key:"listRef",ref:re},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(St.value,_=>(e.openBlock(),e.createElementBlock("li",{key:_.ts,role:"option","aria-selected":_.selected,class:e.normalizeClass(["dss-datepicker__list-item",{"dss-datepicker__list-item--selected":_.selected}]),onClick:le=>It(_.date)},[e.createElementVNode("span",ms,e.toDisplayString(_.label),1),_.selected?(e.openBlock(),e.createElementBlock("svg",ps,[...z[15]||(z[15]=[e.createElementVNode("path",{d:"M229.66,77.66l-128,128a8,8,0,0,1-11.32,0l-56-56a8,8,0,0,1,11.32-11.32L96,188.69,218.34,66.34a8,8,0,0,1,11.32,11.32Z"},null,-1)])])):e.createCommentVNode("",!0)],10,ds))),128))],512)):(e.openBlock(),e.createElementBlock("div",fs,e.toDisplayString(e.unref(ce)("datepicker.noAvailableDates")),1))],64)):fe.value==="days"&&E.doubleCalendar&&Je.value?(e.openBlock(),e.createElementBlock("div",vs,[E.quickSelect?(e.openBlock(),e.createElementBlock("nav",hs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ne.value,_=>(e.openBlock(),e.createElementBlock("button",{key:_.id,type:"button",class:"dss-datepicker__quick-select-btn",disabled:!jl(_.id),onClick:le=>on(_.id)},e.toDisplayString(e.unref(ce)(_.labelKey)),9,gs))),128))])):e.createCommentVNode("",!0),e.createElementVNode("div",ys,[e.createElementVNode("div",ks,[e.createElementVNode("div",Cs,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(ce)("datepicker.prevMonth"),onClick:Pn}," ‹ ",8,bs),e.createElementVNode("div",xs,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:z[2]||(z[2]=_=>nn("left","months"))},e.toDisplayString(We.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:z[3]||(z[3]=_=>nn("left","years"))},e.toDisplayString(J.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(ce)("datepicker.nextMonth"),onClick:mn}," › ",8,ws)]),e.createElementVNode("div",Es,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Xe.value,_=>(e.openBlock(),e.createElementBlock("span",{key:_,class:"dss-datepicker__weekday"},e.toDisplayString(_),1))),128))]),e.createElementVNode("div",Ss,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Zt.value,(_,le)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"L-"+le},[_?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-datepicker__day",bt(_)]),disabled:!Fe(_),onClick:Te=>ql(_),onMouseenter:Te=>ot(_),onMouseleave:Ie},e.toDisplayString(_.getDate()),43,Vs)):(e.openBlock(),e.createElementBlock("span",Ns))],64))),128))])]),e.createElementVNode("div",Bs,[e.createElementVNode("div",Ms,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(ce)("datepicker.prevMonth"),onClick:pn}," ‹ ",8,_s),e.createElementVNode("div",$s,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:z[4]||(z[4]=_=>nn("right","months"))},e.toDisplayString(Dt.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:z[5]||(z[5]=_=>nn("right","years"))},e.toDisplayString(me.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(ce)("datepicker.nextMonth"),onClick:wn}," › ",8,Ls)]),e.createElementVNode("div",As,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Xe.value,_=>(e.openBlock(),e.createElementBlock("span",{key:_,class:"dss-datepicker__weekday"},e.toDisplayString(_),1))),128))]),e.createElementVNode("div",Ts,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ue.value,(_,le)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"R-"+le},[_?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-datepicker__day",bt(_)]),disabled:!Fe(_),onClick:Te=>ql(_),onMouseenter:Te=>ot(_),onMouseleave:Ie},e.toDisplayString(_.getDate()),43,Ds)):(e.openBlock(),e.createElementBlock("span",Hs))],64))),128))])])])])):fe.value==="days"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createElementVNode("div",Rs,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(ce)("datepicker.prevMonth"),onClick:dn}," ‹ ",8,Fs),e.createElementVNode("div",Is,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:z[6]||(z[6]=_=>fe.value="months")},e.toDisplayString(Kt.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:z[7]||(z[7]=_=>fe.value="years")},e.toDisplayString(be.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(ce)("datepicker.nextMonth"),onClick:Hl}," › ",8,zs)]),e.createElementVNode("div",Ps,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Xe.value,_=>(e.openBlock(),e.createElementBlock("span",{key:_,class:"dss-datepicker__weekday"},e.toDisplayString(_),1))),128))]),e.createElementVNode("div",Os,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ge.value,(_,le)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:le},[_?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-datepicker__day",bt(_)]),disabled:!Fe(_),onClick:Te=>ql(_),onMouseenter:Te=>ot(_),onMouseleave:Ie},e.toDisplayString(_.getDate()),43,Ws)):(e.openBlock(),e.createElementBlock("span",qs))],64))),128))])],64)):fe.value==="months"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.createElementVNode("div",Zs,[e.createElementVNode("div",Us,[e.createElementVNode("span",Xs,e.toDisplayString(yt.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:z[8]||(z[8]=_=>fe.value="years")},e.toDisplayString(it.value),1)])]),e.createElementVNode("div",Ys,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(el.value,(_,le)=>(e.openBlock(),e.createElementBlock("button",{key:le,type:"button",class:e.normalizeClass(["dss-datepicker__month-cell",{"dss-datepicker__month-cell--selected":le===Yt.value}]),onClick:Te=>xl(le)},e.toDisplayString(_),11,js))),128))])],64)):fe.value==="years"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:4},[e.createElementVNode("div",Ks,[e.createElementVNode("span",Gs,e.toDisplayString(ge.value),1)]),e.createElementVNode("div",{class:"dss-datepicker__years-wrap",ref_key:"yearsWrapRef",ref:je},[e.createElementVNode("div",Qs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(X.value,_=>(e.openBlock(),e.createElementBlock("button",{key:_,type:"button",class:e.normalizeClass(["dss-datepicker__year-cell",{"dss-datepicker__year-cell--selected":_===it.value,"dss-datepicker__year-cell--current":_===e.unref(Qe)}]),"data-year":_,onClick:le=>Fl(_)},e.toDisplayString(_),11,Js))),128))])],512)],64)):e.createCommentVNode("",!0)],6)])):e.createCommentVNode("",!0)]))],2))}},er=["data-chart-type"],tr={class:"dss-chart-header-titles"},lr={key:0,class:"dss-chart-title"},nr={key:1,class:"dss-chart-subtitle"},or=["onClick","onMouseenter"],ar={class:"dss-legend-text"},sr=["onClick","onMouseenter"],rr={class:"dss-legend-text"},ir=["title"],cr=["src"],ur={class:"dss-chart-area-wrapper"},dr={key:0,class:"dss-chart-z-axis-label"},mr=["width","height","data-smooth","data-animated"],pr=["id"],fr=["y","width","height"],vr=["id"],hr=["d"],gr=["id"],yr=["d"],kr={key:0},Cr=["clip-path"],br=["x1","x2","y1","y2"],xr=["clip-path"],wr=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray","opacity"],Er=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray","opacity"],Sr={class:"dss-axes"},Vr=["x1","x2","y1","y2"],Nr=["x1","x2","y1","y2"],Br=["x1","x2","y1","y2"],Mr={class:"dss-axis-labels"},_r=["x","y"],$r=["x","y"],Lr=["x","y"],Ar=["x","y"],Tr=["y","transform"],Dr=["x","y","transform"],Hr={key:2,class:"dss-flag-markers"},Rr=["clip-path"],Fr=["x1","x2","y1","y2","onMouseover"],Ir=["x1","x2","y1","y2","onMouseover"],zr=["x1","x2","y1","y2","onMouseover"],Pr=["cx","cy","onMouseover"],Or=["cx","cy","fill","onMouseover"],Wr=["x","y"],qr=["clip-path"],Zr={key:0},Ur=["d","onMouseover"],Xr=["x","y","width","height","fill","onMouseover"],Yr={class:"dss-line-chart"},jr=["d","stroke","stroke-width","stroke-dasharray"],Kr=["d","stroke","stroke-width","opacity"],Gr=["cx","cy","r","fill","onMouseover"],Qr={key:1},Jr=["d","stroke","stroke-width","stroke-dasharray"],ei=["d","stroke","stroke-width","stroke-dasharray"],ti=["d","stroke","stroke-width","opacity"],li=["cx","cy","r","fill","onMouseover"],ni={key:2},oi=["id"],ai=["x","y","width","height"],si=["d","fill","fill-opacity","mask"],ri=["d","stroke","stroke-width"],ii={key:3,class:"dss-stepbar-chart"},ci=["x","y","width","height","rx","ry","fill","onMouseover"],ui=["transform"],di=["r","fill","stroke","stroke-width"],mi=["font-size","fill"],pi=["d","fill","onMouseover"],fi=["x","y","width","height","onMouseover"],vi=["clip-path"],hi=["x1","x2","y1","y2","stroke"],gi=["cx","cy","r","fill"],yi={key:1,class:"dss-bubble-chart"},ki={key:0,class:"dss-bubble-group"},Ci=["cx","cy","r","fill","fill-opacity","stroke","onMouseenter","onMouseleave","onClick"],bi=["x","y","width","height","xlink:href","clip-path","onLoad","onError","onMouseenter","onMouseleave","onClick"],xi=["transform"],wi=["cx","cy","r"],Ei=["data-chart-type","clip-path"],Si=["d","fill","fill-opacity","stroke","stroke-width","clip-path","onMouseover"],Vi={key:1,class:"dss-radial-segment-data-labels"},Ni=["x","y"],Bi=["x","y","font-size","fill"],Mi=["x1","y1","x2","y2","stroke"],_i=["x1","y1","x2","y2","stroke"],$i=["x","y","text-anchor","font-size"],Li=["transform"],Ai={key:0,class:"dss-spider-grid"},Ti=["cx","cy","r"],Di={class:"dss-spider-grid-labels"},Hi=["x","y"],Ri=["x","y"],Fi=["x1","x2","y1","y2"],Ii={class:"dss-spider-labels"},zi=["x","y","text-anchor","dominant-baseline"],Pi=["points","fill","fill-opacity","stroke","stroke-width","stroke-dasharray"],Oi=["cx","cy","r","fill","stroke","stroke-width","onMouseover"],Wi={class:"dss-chart-logos"},qi=["cx","cy","r","fill"],Zi=["x","y","width","height","xlink:href","onLoad","onError","clip-path"],Ui=["onClick","onMouseenter"],Xi=["src"],Yi={class:"dss-marker-tooltip-category"},ji={key:0,class:"dss-marker-tooltip-description"},Ki={key:0,class:"dss-tooltip-section dss-spider-tooltip-section"},Gi={class:"dss-tooltip-title dss-spider-tooltip-area-title"},Qi={class:"dss-tooltip-series-name"},Ji={class:"dss-tooltip-series-value"},ec={key:1,class:"dss-tooltip-section"},tc={key:0,class:"dss-tooltip-title"},lc={class:"dss-bubble-tooltip-data"},nc={key:2,class:"dss-tooltip-section"},oc={class:"dss-tooltip-title"},ac={class:"dss-tooltip-value"},sc={key:0,class:"dss-tooltip-section"},rc={class:"dss-tooltip-section-title"},ic={class:"dss-tooltip-group-header"},cc={class:"dss-tooltip-item-content"},uc={class:"dss-tooltip-item-text"},dc={key:1,class:"dss-tooltip-section"},mc={class:"dss-tooltip-section-title"},pc={class:"dss-tooltip-item-content"},fc={class:"dss-tooltip-item-title"},vc={key:0,class:"dss-tooltip-item-description"},hc={class:"dss-tooltip-section"},gc={class:"dss-tooltip-title"},yc={key:0,class:"dss-bubble-tooltip-data"},kc={class:"dss-tooltip-series-name"},Cc={class:"dss-tooltip-series-value"},bc={key:0,class:"dss-tooltip-section"},xc={class:"dss-tooltip-section-title"},wc={class:"dss-tooltip-group-header"},Ec={class:"dss-tooltip-item-content"},Sc={class:"dss-tooltip-item-text"},Vc={key:1,class:"dss-tooltip-section"},Nc={class:"dss-tooltip-section-title"},Bc={class:"dss-tooltip-item-content"},Mc={class:"dss-tooltip-item-title"},_c={key:0,class:"dss-tooltip-item-description"},$c=["onClick","onMouseenter"],Lc={class:"dss-legend-text"},Ac={key:1,class:"dss-context-menu-separator"},Tc={key:0,class:"dss-context-menu-separator"},Dc={key:0,class:"dss-context-menu-separator"},Hc=["onClick"],Rc=["innerHTML"],Fc={key:0,class:"dss-context-menu-icon"},Ic={class:"dss-marker-modal-header"},zc={class:"dss-marker-modal-body"},Pc={class:"dss-form-group"},Oc={class:"dss-form-group"},Wc={for:"dss-marker-description"},qc={key:0,class:"dss-form-text-display"},Zc=["placeholder"],Uc={class:"dss-marker-modal-footer"},Xc={class:"modal-footer-left"},Yc={class:"dss-modal-footer-right"},jc=["disabled"],Kc={name:"DSSChart"},Gc=Object.assign(Kc,{props:{series:{type:Array,required:!0,default:()=>[]},categories:{type:Array,default:()=>[]},flags:{type:Array,default:()=>[]},markers:{type:Array,default:()=>[]},showAddMarkerButton:{type:Boolean,default:!0},chartId:{type:String,default:()=>"chart-"+Math.random().toString(36).substring(2,9)},i18n:{type:Object,default:null},locale:{type:String,default:null},options:{type:Object,default:()=>({}),validator:E=>typeof E=="object"&&E!==null},innerSize:{type:Number,default:null},old:{type:Boolean,default:!1}},emits:["add-marker","update-marker","delete-marker"],setup(E,{emit:te}){const{t:$,locale:V}=ro.useI18n(),ce=te,O=e.ref(null),L=e.ref(null),fe=e.ref(null),rt=e.ref(0),ee=e.ref(0);let v=null,be=null;const ke=20,J=e.computed(()=>{if(ee.value,rt.value,!O.value||!L.value)return 0;try{const t=O.value.getBoundingClientRect();return L.value.getBoundingClientRect().top-t.top}catch{return 0}}),Y=e.computed(()=>`chart-clip-${F.chartId}`),me=e.computed(()=>`url(#${Y.value})`),F=E,ue={chart:{type:"line",width:800,height:400,orientation:"vertical"},title:{text:"",style:{}},subtitle:{text:"",style:{}},zAxis:"",xAxis:{title:{text:""},type:"category"},yAxis:{min:"auto",max:"auto",title:{text:""}},legend:{show:!0,position:"top",orientation:"horizontal"},radialLabels:{show:!1,pointerLength:25,horizontalLength:35,fontSize:14,color:"#000",textOffset:8},radialBar:{dataLabels:{show:!1,minAngleDegrees:20},dataCenter:{show:!1,fontSize:16}},miniRadial:{minVisiblePercent:1,trackColor:"#E5E7EB",thresholds:{low:33,medium:66},colors:{low:"#E53E3E",medium:"#ED8936",high:"#38A169"}},grid:{show:!0,style:{}},watermark:{enabled:!0,opacity:.05,size:35,position:"bottom-right"},colors:["#3B82F6","#EF4444","#10B981","#F59E0B","#8B5CF6","#F97316","#06B6D4","#84CC16"],logos:[],stroke:{width:2,curve:"smooth"},bubbles:{size:4},stepbar:{totalValue:100,segmentOrder:"input",showRemainder:!0,remainderLabel:"Remaining",remainderColor:"#E5E7EB",barWidth:42,minBarWidth:12,maxBarWidth:58,barRadius:6,axisBars:{show:!0,showVertical:!1,color:"#d6d6d6",opacity:.75,width:1,dashArray:"3,4"},maxSegment:{marker:{enabled:!1,icon:"",radius:8,backgroundColor:null,borderColor:"#fafafa",borderWidth:2,color:"#fafafa",fontSize:10}}},markers:{show:!0,icon:null,iconSize:25,customIcons:{}},fill:{area:{opacity:.3},spider:{opacity:.15}},crosshair:{show:!1,color:"#666"},bubbles:{size:4,tooltip:{fields:["x","y","size"],labels:{x:"X",y:"Y",size:"Size",label:"Label",seriesName:"Series"},formatters:{}}},spider:{gridLabels:null,gridSteps:5,comparison:{fillOpacity:0,strokeDasharray:"6,4",usePrimaryColor:!0,bubbleSize:0}},zoom:{enabled:!1,minScale:1,maxScale:2.5},smoothing:{enabled:!1,factor:.3,barRadius:4},animations:{enabled:!0,type:"draw",duration:2500,delay:0,staggerDelay:200,easing:"ease-out",onDataChange:!0,respectReducedMotion:!0},valueFormat:{extension:""},contextMenu:{enabled:!0,items:{addMarker:!0,downloadSvg:!0,downloadPng:!0,downloadCsv:!0},customItems:[]}};function $e(t,o){const l=Object.assign({},t);return mt(t)&&mt(o)&&Object.keys(o).forEach(r=>{mt(o[r])?r in t?l[r]=$e(t[r],o[r]):Object.assign(l,{[r]:o[r]}):Object.assign(l,{[r]:o[r]})}),l}const tt=()=>{let t=20,o=0,l=0;if(ut.value&&(t+=30),ht.value&&(t+=25),W.value&&F.series.length>0){const r=F.series.filter((m,f)=>!zt.value.has(f)).length;if(G.value==="top"||G.value==="bottom"){if(Ne.value==="horizontal"){const f=Math.floor(Ve.value/100);o=Math.ceil(r/f)*25+10}else o=r*25+10;t+=o}else l=150}return{height:t,legendHeight:o,legendWidth:l}};function mt(t){return t&&typeof t=="object"&&!Array.isArray(t)}const U=e.computed(()=>$e(ue,F.options)),ze=e.computed(()=>{const t=U.value;return t&&t.chart&&t.chart.width==="auto"}),qe=e.computed(()=>{const t=U.value;return t&&t.chart&&t.chart.height==="auto"}),Ve=e.computed(()=>{const t=U.value;return ze.value?rt.value||800:t&&t.chart&&typeof t.chart.width=="number"?t.chart.width:800}),Le=e.ref(ke),je=e.computed(()=>{if(qe.value){const t=je.value;return t??Math.max(0,(ee.value||400)-Le.value*5)}}),re=e.computed(()=>{const t=U.value;if(Ce.value==="mini-radial")return Ve.value;if(qe.value){const o=je.value;return o??Math.max(0,(ee.value||400)-Le.value)}return t&&t.chart&&typeof t.chart.height=="number"?t.chart.height:400}),Qe=e.computed(()=>{if(qe.value&&Ce.value==="semi-radial"&&je.value!=null)return Le.value+re.value+"px";if(qe.value)return"100%";if(al.value)return Le.value+re.value+"px";if(W.value&&G.value==="bottom"){const t=tt();return re.value+(t.legendHeight||35)+"px"}return re.value+(W.value?20:0)+"px"}),Ce=e.computed(()=>{const t=U.value;return t&&t.chart&&t.chart.type?t.chart.type:"line"}),Je=e.computed(()=>{const t=F.series.map(o=>o.type||Ce.value);return new Set(t).size>1}),ut=e.computed(()=>{const t=U.value;return t&&t.title&&t.title.text?t.title.text:""}),ht=e.computed(()=>{const t=U.value;return t&&t.subtitle&&t.subtitle.text?t.subtitle.text:""}),dt=e.computed(()=>{const t=U.value;if(!t||!t.zAxis)return"";const o=t.zAxis;return typeof o=="string"?o:o&&typeof o.label=="string"?o.label:""}),Wt=e.computed(()=>{const t=U.value;return t&&t.xAxis&&t.xAxis.title&&t.xAxis.title.text?t.xAxis.title.text:""}),qt=e.computed(()=>{const t=U.value;return t&&t.yAxis&&t.yAxis.title&&t.yAxis.title.text?t.yAxis.title.text:""}),Ct=e.computed(()=>{const t=U.value;return t&&t.yAxis&&t.yAxis.secondary&&typeof t.yAxis.secondary=="object"?t.yAxis.secondary:null}),wt=e.computed(()=>{const t=Ct.value;return t&&t.title&&t.title.text?t.title.text:""}),Yt=e.computed(()=>{const t=U.value;if(!t||!t.yAxis)return Be;const o=t.yAxis.min;return typeof o=="number"||o===Be?o:Be}),it=e.computed(()=>{const t=U.value;if(!t||!t.yAxis)return Be;const o=t.yAxis.max;return typeof o=="number"||o===Be?o:Be}),Kt=e.computed(()=>{const t=Ct.value;if(!t)return Be;const o=t.min;return typeof o=="number"||o===Be?o:Be}),yt=e.computed(()=>{const t=Ct.value;if(!t)return Be;const o=t.max;return typeof o=="number"||o===Be?o:Be}),el=e.computed(()=>{const t=U.value;return!t||!t.xAxis?null:typeof t.xAxis.min=="number"?t.xAxis.min:null}),X=e.computed(()=>{const t=U.value;return!t||!t.xAxis?null:typeof t.xAxis.max=="number"?t.xAxis.max:null}),ge=e.computed(()=>{const t=U.value;return t&&t.grid&&t.grid.show!==!1}),W=e.computed(()=>{const t=U.value;return t&&t.legend&&t.legend.show!==!1}),G=e.computed(()=>{const t=U.value;return t&&t.legend&&t.legend.position?t.legend.position:"top"}),Ne=e.computed(()=>{const t=U.value;return t&&t.legend&&t.legend.orientation?t.legend.orientation:"horizontal"}),Pe=e.computed(()=>{const t=U.value;return!t||!t.tooltip?!0:t.tooltip.enabled!==!1}),Xe=e.computed(()=>{const t=U.value;if(!t||!t.crosshair)return!1;const o=t.crosshair.show;return o===!0||o==="true"}),Et=e.computed(()=>{const t=U.value;return t&&t.crosshair&&t.crosshair.color?t.crosshair.color:"#666"}),Ge=e.computed(()=>{const t=U.value;return!t||!t.zoom?!1:t.zoom.enabled===!0}),Zt=e.computed(()=>{const t=U.value;return t&&t.zoom&&typeof t.zoom.minScale=="number"?t.zoom.minScale:1}),Ue=e.computed(()=>{const t=U.value;return t&&t.zoom&&typeof t.zoom.maxScale=="number"?t.zoom.maxScale:2.5}),We=e.computed(()=>{const t=U.value;return t&&t.stroke&&typeof t.stroke.width=="number"?t.stroke.width:2}),Dt=e.computed(()=>{if(!al.value)return 0;const t=U.value;return t&&t.stroke&&typeof t.stroke.width=="number"?t.stroke.width:0}),Lt=e.computed(()=>{const t=U.value;return t&&t.bubbles&&typeof t.bubbles.size=="number"?t.bubbles.size:4}),ne=e.computed(()=>{const{maxX:t}=He.value;return t===0}),j=(t,o)=>ne.value&&o===0?5:o,K=t=>{const o=Number(t);return!Number.isFinite(o)||o<=0?0:o},de=e.computed(()=>{const t=U.value;return t&&t.fill&&t.fill.area&&typeof t.fill.area.opacity=="number"?t.fill.area.opacity:.3}),xe=e.computed(()=>{const t=U.value;return t&&t.smoothing&&t.smoothing.enabled===!0}),Ke=e.computed(()=>{const t=U.value;return t&&t.smoothing&&typeof t.smoothing.factor=="number"?t.smoothing.factor:.3}),Ht=e.computed(()=>{const t=U.value;return xe.value?t&&t.smoothing&&typeof t.smoothing.barRadius=="number"?t.smoothing.barRadius:4:0}),jt=e.computed(()=>{const t=U.value,o=t&&t.colors&&Array.isArray(t.colors)?t.colors:[];return o.length>0?o:["#3B82F6","#EF4444","#10B981","#F59E0B","#8B5CF6","#F97316","#06B6D4","#84CC16"]}),et=e.computed(()=>U.value?.stepbar||{}),vl=e.computed(()=>{const t=et.value?.segmentOrder;return["asc","desc","input"].includes(t)?t:"input"}),M=e.computed(()=>{const t=Number(et.value?.totalValue);return Number.isFinite(t)&&t>0?t:100}),x=e.computed(()=>et.value?.showRemainder!==!1),A=e.computed(()=>et.value?.remainderLabel||"Remaining"),ae=e.computed(()=>et.value?.remainderColor||"#E5E7EB"),oe=e.computed(()=>{const t=Number(et.value?.barWidth);return Number.isFinite(t)&&t>0?t:42}),Fe=e.computed(()=>{const t=Number(et.value?.minBarWidth);return Number.isFinite(t)&&t>0?t:12}),bt=e.computed(()=>{const t=Number(et.value?.maxBarWidth);return Number.isFinite(t)&&t>0?t:58}),ot=e.computed(()=>{const t=Number(et.value?.barRadius);return Number.isFinite(t)&&t>=0?t:6}),Ie=e.computed(()=>et.value?.axisBars||{}),xt=e.computed(()=>Ie.value?.show!==!1),Mt=e.computed(()=>Ie.value?.showVertical===!0),St=e.computed(()=>Ie.value?.color||"#d6d6d6"),At=e.computed(()=>{const t=Number(Ie.value?.opacity);return Number.isFinite(t)?Math.min(Math.max(t,0),1):.75}),It=e.computed(()=>{const t=Number(Ie.value?.width);return Number.isFinite(t)&&t>0?t:1}),Nt=e.computed(()=>Ie.value?.dashArray||"3,4"),yl=e.computed(()=>et.value?.maxSegment?.marker||{}),nn=e.computed(()=>yl.value?.enabled===!0),Vl=e.computed(()=>{const t=U.value;return t&&t.animations&&t.animations.enabled!==!1}),Nl=e.computed(()=>{const t=U.value;return t&&t.animations&&t.animations.type?t.animations.type:"draw"}),tl=e.computed(()=>{const t=U.value;return t&&t.animations&&typeof t.animations.duration=="number"?t.animations.duration:2500}),jl=e.computed(()=>{const t=U.value;return t&&t.animations&&typeof t.animations.delay=="number"?t.animations.delay:0}),on=e.computed(()=>{const t=U.value;return t&&t.animations&&t.animations.easing?t.animations.easing:"ease-out"}),xl=e.computed(()=>{const t=U.value;return t&&t.animations&&typeof t.animations.staggerDelay=="number"?t.animations.staggerDelay:200}),Fl=e.computed(()=>{const t=U.value;return t&&t.animations&&t.animations.onDataChange!==!1}),dn=e.computed(()=>{const t=U.value;return t&&t.animations&&t.animations.respectReducedMotion!==!1}),Hl=e.computed(()=>{const t=U.value;return t&&t.fill&&t.fill.spider&&typeof t.fill.spider.opacity=="number"?t.fill.spider.opacity:.15}),Pn=e.computed(()=>U.value?.spider?.gridSteps||5),mn=e.computed(()=>{const t=[],o=Pn.value;for(let l=1;l<=o;l++)t.push(gt.value/o*l);return t}),pn=t=>{const o=wn.value;if(o&&Array.isArray(o)&&o[t]!==void 0)return o[t].toString();const l=mn.value[t];return Math.round(l/gt.value*100)+"%"},wn=e.computed(()=>U.value?.spider?.gridLabels||null),ql=e.computed(()=>{const t=U.value;return t&&t.contextMenu&&t.contextMenu.enabled===!0}),rl=e.computed(()=>{const t=U.value,o={addMarker:!0,downloadSvg:!0,downloadPng:!0,downloadCsv:!0};return t&&t.contextMenu&&t.contextMenu.items?{...o,...t.contextMenu.items}:o}),Il=e.computed(()=>{const t=U.value;return t&&t.contextMenu&&Array.isArray(t.contextMenu.customItems)?t.contextMenu.customItems:[]}),Kl=e.computed(()=>{const t=U.value;return t&&t.markers&&t.markers.icon?t.markers.icon:Ll.value}),sn=e.computed(()=>{const t=U.value;return t&&t.markers&&t.markers.customIcons?t.markers.customIcons:{}}),T=e.computed(()=>{const t=U.value;return t&&t.markers&&typeof t.markers.iconSize=="number"?t.markers.iconSize:20}),z=e.computed(()=>{const o=U.value?.valueFormat?.extension;return typeof o=="string"?o:""}),_=t=>{const o=z.value;if(t==null)return"";const l=String(t);return o?l+o:l},le=e.computed(()=>!ie.value.isZooming);e.computed(()=>Tt.value.map(t=>{if(t.categoryIndex!==void 0&&(ol.value||ul.value)){const o=vt(t.categoryIndex),l=J.value+R.value.bottom-T.value/2;return{...t,x:o,y:l}}return t}));function Te(t,o){let l;if(t instanceof Date)l=new Date(t.getFullYear(),t.getMonth(),t.getDate());else if(typeof t=="string"){const[f,C,b]=t.split("-"),P=Number(b?.length===2?`20${b}`:b);l=new Date(P,Number(C)-1,Number(f))}else return 0;let r=0,m=1/0;return o.forEach((f,C)=>{const[b,P,B]=f.split("-"),H=Number(B?.length===2?`20${B}`:B),S=new Date(H,Number(P)-1,Number(b)),q=Math.abs(S-l);q<m&&(m=q,r=C)}),r}const pt=e.computed(()=>{const t=F.markers.map(l=>{const r=Te(l.marker_date,F.categories),m=vt(r),f=J.value+R.value.bottom-T.value/2;return{...l,x:m,y:f,categoryIndex:r,source:"props"}}),o=Tt.value.map(l=>{if(l.categoryIndex!==void 0&&(ol.value||ul.value)){const r=vt(l.categoryIndex),m=J.value+R.value.bottom-T.value/2;return{...l,x:r,y:m,source:"internal"}}return{...l,source:"internal"}});return[...t,...o]}),ct=e.computed(()=>{const t=U.value;return t&&t.watermark&&t.watermark.enabled===!0}),lt=e.computed(()=>{const t=U.value;return t&&t.watermark&&typeof t.watermark.opacity=="number"?t.watermark.opacity:.05}),st=e.computed(()=>{const t=U.value;return t&&t.watermark&&t.watermark.size?t.watermark.size:35}),il=e.computed(()=>{const t=U.value;return t&&t.watermark&&t.watermark.position?t.watermark.position:"bottom-right"}),kl=e.computed(()=>{const t={left:R.value.left,top:R.value.top,width:R.value.width,height:R.value.height};let o,l;const r=String(st.value);if(r.includes("%")){const m=parseFloat(r)/100;o=t.width*m,l=o*(96/499)}else{const m=parseFloat(r)||25;o=Math.min(t.width*.25,200)*(m/25),l=o*(96/499)}return{width:o,height:l,area:t}}),Gt=e.computed(()=>{const{width:t,height:o}=kl.value,l=il.value;let r,m;const f=R.value.left,C=R.value.right,b=R.value.top,P=R.value.bottom,B=R.value.width,H=R.value.height;switch(l){case"center":r=f+(B-t)/2,m=b+(H-o)/2;break;case"top-left":r=f+15,m=b+5;break;case"top-right":r=C-t-15,m=b+5;break;case"bottom-left":r=f+15,m=P-o-5;break;case"bottom-right":default:r=C-t-15,m=P-o-5;break}return{backgroundPositionX:r+"px",backgroundPositionY:m+"px",backgroundSize:`${t}px ${o}px`}}),wl=t=>!F.flags||!F.flags.length?[]:F.flags.filter(o=>o.categoryIndex===t),Rt=t=>{const o=wl(t),l=Xo(t),r=o.filter(C=>C.manual),m=o.filter(C=>!C.manual),f=[];return r.length>0&&f.push({type:$("chart.tooltip.manualFlags"),color:"#698dbe",flags:r.map(C=>({text:C.text,color:"#698dbe"}))}),m.length>0&&f.push({type:$("chart.tooltip.autoFlags"),color:"#a1d499",flags:m.map(C=>({text:C.text,color:"#a1d499"}))}),{flagGroups:f,markers:l.map(C=>({title:C.title,description:C.description,type:$("chart.tooltip.markers"),color:C.color||"#9784ba"}))}},Ll=e.computed(()=>{const t=F.old?`<svg width="55" height="56" viewBox="0 0 55 56" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
2
|
<path d="M55 51.841V4.14647C55 1.86149 53.1797 0.00915527 50.9343 0.00915527L4.06568 0.00915527C1.82027 0.00915527 0 1.86149 0 4.14647V51.841C0 54.126 1.82027 55.9783 4.06568 55.9783H50.9343C53.1797 55.9783 55 54.126 55 51.841Z" fill="#020203"/>
|
|
3
3
|
<path d="M27.7145 10.8883H16.9591C12.7639 10.8883 9.3623 14.3498 9.3623 18.619C9.3623 22.8882 12.7639 26.3497 16.9591 26.3497H27.8036C28.3624 26.3497 28.816 25.8881 28.816 25.3112L28.7188 11.9103C28.7188 11.3416 28.2653 10.8883 27.7064 10.8883H27.7145Z" fill="#FFC230"/>
|
|
4
4
|
<path d="M38.6799 25.649C42.5176 25.649 45.6288 22.483 45.6288 18.5776C45.6288 14.6722 42.5176 11.5063 38.6799 11.5063C34.8421 11.5063 31.731 14.6722 31.731 18.5776C31.731 22.483 34.8421 25.649 38.6799 25.649Z" fill="white"/>
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
<rect width="57" height="57" fill="white"/>
|
|
16
16
|
</clipPath>
|
|
17
17
|
</defs>
|
|
18
|
-
</svg>`;return`data:image/svg+xml;base64,${btoa(t)}`}),
|
|
18
|
+
</svg>`;return`data:image/svg+xml;base64,${btoa(t)}`}),fn=e.computed(()=>{const t=F.old?`<svg width="499" height="96" viewBox="0 0 499 96" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
19
19
|
<path d="M171.52 37.8399H160.38C160.26 36.4799 160.02 35.0599 159.68 33.5699C159.34 32.0799 158.77 30.7399 157.96 29.5299C157.16 28.3199 156 27.3199 154.48 26.5099C152.96 25.7099 150.94 25.2999 148.4 25.2999C144.69 25.2999 141.93 26.1299 140.14 27.8099C138.34 29.4799 137.45 31.5499 137.45 34.0299C137.45 37.7999 139.29 40.0799 142.97 40.8499C146.65 41.6299 150.67 42.3799 155.03 43.1199C159.39 43.8599 163.41 45.3899 167.09 47.7099C170.77 50.0299 172.61 54.6199 172.61 61.4899C172.61 64.6499 172.02 67.5099 170.85 70.0699C169.67 72.6399 168.02 74.7899 165.89 76.5199C163.76 78.2499 161.19 79.5799 158.19 80.5099C155.19 81.4399 151.93 81.8999 148.4 81.8999C143.95 81.8999 140.12 81.2699 136.94 79.9999C133.75 78.7299 131.19 77.0799 129.24 75.0399C127.29 72.9999 125.93 70.6899 125.16 68.1299C124.39 65.5599 124.19 62.9499 124.56 60.2899H136.25C136.37 62.0799 136.58 63.7899 136.85 65.3899C137.13 66.9999 137.68 68.4099 138.52 69.6099C139.35 70.8199 140.58 71.7799 142.19 72.4899C143.8 73.1999 145.99 73.5599 148.78 73.5599C153.3 73.5599 156.47 72.6199 158.29 70.7299C160.11 68.8399 161.03 66.6899 161.03 64.2799C161.03 60.2599 159.19 57.7799 155.51 56.8599C151.83 55.9299 147.79 55.0499 143.4 54.2099C139.01 53.3799 134.97 51.7699 131.29 49.3799C127.61 46.9999 125.77 42.3699 125.77 35.5099C125.77 32.8499 126.3 30.3899 127.35 28.1299C128.4 25.8699 129.9 23.9199 131.85 22.2799C133.8 20.6399 136.16 19.3399 138.95 18.3799C141.73 17.4199 144.8 16.9399 148.14 16.9399C152.41 16.9399 156.07 17.4699 159.14 18.5199C162.2 19.5699 164.69 21.0299 166.61 22.8799C168.53 24.7399 169.89 26.9499 170.69 29.5199C171.49 32.0899 171.77 34.8599 171.52 37.8199V37.8399Z" fill="#020203"/>
|
|
20
20
|
<path d="M179.04 58.1699C179.04 55.0799 179.55 52.0499 180.57 49.0699C181.59 46.0999 183.04 43.4899 184.93 41.2299C186.82 38.9699 189.09 37.1499 191.75 35.7499C194.41 34.3599 197.35 33.6599 200.57 33.6599C207 33.6599 212.15 35.9299 216.02 40.4799C219.89 45.0299 221.97 51.5999 222.28 60.1999H189.34C189.77 64.2199 191.09 67.1499 193.28 68.9699C195.48 70.7999 198.12 71.7099 201.21 71.7099C203 71.7099 204.5 71.4599 205.71 70.9699C206.92 70.4799 207.91 69.8899 208.68 69.2099C209.45 68.5299 210.06 67.8199 210.49 67.0799C210.92 66.3399 211.26 65.7199 211.51 65.2199H221.72C221.6 66.7699 221.1 68.5099 220.24 70.4599C219.37 72.4099 218.14 74.2299 216.53 75.9399C214.92 77.6399 212.85 79.0599 210.31 80.2099C207.77 81.3499 204.77 81.9299 201.31 81.9299C197.85 81.9299 194.91 81.2799 192.12 79.9799C189.34 78.6799 186.98 76.9499 185.07 74.7799C183.15 72.6099 181.67 70.0899 180.61 67.2199C179.56 64.3399 179.03 61.3299 179.03 58.1699H179.04ZM200.94 42.0199C198.47 42.0199 196.24 42.7299 194.26 44.1499C192.28 45.5699 190.89 47.8299 190.08 50.9199H211.33C211.02 48.0799 209.95 45.8799 208.13 44.3299C206.3 42.7899 203.91 42.0099 200.94 42.0099V42.0199Z" fill="#020203"/>
|
|
21
21
|
<path d="M268.59 80.9999H258.01V50.3799C258.01 48.2099 257.3 46.5099 255.88 45.2799C254.46 44.0399 252.6 43.4199 250.31 43.4199C248.45 43.4199 246.94 43.8399 245.76 44.6699C244.58 45.4999 243.67 46.5399 243.02 47.7799C242.37 49.0199 241.94 50.3799 241.72 51.8599C241.5 53.3399 241.4 54.7099 241.4 55.9399V80.9999H230.82V34.5999H241.03V38.3099C241.83 37.6899 243.27 36.7599 245.34 35.5199C247.41 34.2799 250.3 33.6599 254.02 33.6599C256.68 33.6599 259.12 34.1599 261.35 35.1399C263.58 36.1299 265.31 37.6799 266.55 39.7799C267.04 39.2899 267.71 38.6799 268.55 37.9699C269.38 37.2599 270.41 36.5799 271.61 35.9299C272.82 35.2799 274.22 34.7399 275.83 34.3099C277.44 33.8799 279.23 33.6599 281.21 33.6599C285.23 33.6599 288.67 34.8099 291.51 37.0899C294.36 39.3799 295.78 43.0599 295.78 48.1299V80.9799H285.2V50.3599C285.2 48.1899 284.49 46.4899 283.07 45.2599C281.65 44.0199 279.79 43.3999 277.5 43.3999C275.64 43.3999 274.13 43.8199 272.95 44.6499C271.77 45.4799 270.86 46.5199 270.21 47.7599C269.56 48.9999 269.13 50.3599 268.91 51.8399C268.69 53.3199 268.59 54.6899 268.59 55.9199V80.9799V80.9999Z" fill="#020203"/>
|
|
@@ -41,23 +41,23 @@
|
|
|
41
41
|
<rect width="45" height="45" fill="white" transform="translate(0 1)"/>
|
|
42
42
|
</clipPath>
|
|
43
43
|
</defs>
|
|
44
|
-
</svg>`;return`data:image/svg+xml;base64,${btoa(t)}`}),
|
|
45
|
-
`)}})}),Wt=e.ref({show:!1,x:0,y:0,content:"",count:0}),gn=e.computed(()=>Z.value?.bubbles?.tooltip?.fields||["x","y","size","label"]),Kt=e.computed(()=>{const t=Z.value;return{...{x:"X",y:"Y",size:"Size",label:"Label",seriesName:"Series"},...t?.bubbles?.tooltip?.labels||{}}}),Ln=e.computed(()=>Z.value?.bubbles?.tooltip?.formatters||{}),Ht=e.ref(new Set),he=e.ref(null),Mt=e.ref(!1),gt=e.ref({show:!1,x:0,y:0,title:"",value:"",bubbleData:[],spiderAreas:[]}),Rn=e.ref({show:!1,x:0,y:0,categoryValue:"",description:""}),Ue=e.ref({show:!1,x:0,categoryIndex:-1,data:[]}),ht=e.ref({show:!1,x:0,y:0,mouseDataX:0,mouseDataY:0,categoryIndex:-1,chartX:0,chartY:0}),se=e.ref({scale:1,offsetX:0,minScale:1,maxScale:2.5,isDragging:!1,lastMouseX:0,lastMouseY:0,isZooming:!1,zoomTimeout:null}),on=e.ref([]),Fe=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 rn.value&&t.push(...Object.keys(rn.value)),t}),e.computed(()=>{if(!F.categories||F.categories.length===0){const{maxX:t}=Vt.value;return Array.from({length:t+1},(a,n)=>$("chart.fallback.item",{number:n+1}))}return F.categories});const ol=e.computed(()=>{if(!F.categories||F.categories.length===0)return null;const t=F.categories[0],[a,n,r]=String(t).split("-"),p=Number(r?.length===2?`20${r}`:r),g=Number(a),C=Number(n)-1;return!g||!n||!p?null:new Date(p,C,g)}),cn=e.computed(()=>{if(!F.categories||F.categories.length===0)return null;const t=F.categories[F.categories.length-1],[a,n,r]=String(t).split("-"),p=Number(r?.length===2?`20${r}`:r),g=Number(a),C=Number(n)-1;return!g||!n||!p?null:new Date(p,C,g)}),yl=e.computed(()=>Fe.value.editingMarkerId!==null),Nn=e.computed(()=>Fe.value.readonly),Gt=t=>{Ht.value.has(t)||(Jo.value=!0,he.value=t)},Fl=()=>{Jo.value=!1,he.value=null},un=t=>{if(xo.value||Fo.value){Ue.value.show=!1;return}const n=t.currentTarget.getBoundingClientRect(),r=t.clientX-n.left,p=t.clientY-n.top,g=Yt.value?r>=O.value.left-50&&r<=O.value.right+50&&p>=O.value.top-50&&p<=O.value.bottom+100:r>=O.value.left&&r<=O.value.right&&p>=O.value.top&&p<=O.value.bottom;if(Mt.value=g,Yt.value){if(!Ze.value||!g||se.value.isDragging||se.value.isZooming){Ue.value.show=!1;return}if(dn.value.find(ve=>!ve||ve.isHidden?!1:Math.sqrt(Math.pow(ve.x-r,2)+Math.pow(ve.y-p,2))<=ve.radius+3))Ue.value.show=!1;else{const ve=dn.value.filter(xe=>!xe||xe.isHidden?!1:Math.sqrt(Math.pow(xe.x-r,2)+Math.pow(xe.y-p,2))<=250);if(ve.length>0){let xe=ve[0],Ve=Math.sqrt(Math.pow(xe.x-r,2)+Math.pow(xe.y-p,2));ve.forEach(Oe=>{const Le=Math.sqrt(Math.pow(Oe.x-r,2)+Math.pow(Oe.y-p,2));Le<Ve&&(Ve=Le,xe=Oe)});const ge=30,Qe=dn.value.filter(Oe=>!Oe||Oe.isHidden?!1:Math.abs(Oe.x-xe.x)<=ge).sort((Oe,Le)=>Oe.y-Le.y);Ue.value={show:!0,x:xe.x,categoryIndex:Math.round(xe.originalX),data:(()=>{const Oe=gn.value,Le=Kt.value,$e=[];return Qe.forEach(He=>{Oe.forEach(_t=>{const Ot=Le[_t]||_t,tl=Ao(_t,He);tl&&$e.push({seriesName:He.seriesName,label:He.label,value:`${Ot}: ${tl}`,color:He.color,y:He.y})})}),$e})()}}else Ue.value.show=!1}return}if(se.value.isDragging&&se.value.scale>1&&En.value&&Ke.value){Ue.value.show=!1;const Xe=t.clientX-se.value.lastMouseX,{minX:ve,maxX:xe}=Vt.value,Ve=xe-ve||1,Qe=Xe*.8;se.value.offsetX+=Qe;const Oe=Ve/se.value.scale,Le=Ve-Oe,$e=0,He=-Le/Ve*O.value.width,_t=$e;se.value.offsetX=Math.max(He,Math.min(_t,se.value.offsetX)),se.value.lastMouseX=t.clientX,se.value.lastMouseY=t.clientY;return}if(!Ze.value||!En.value||se.value.isDragging||se.value.isZooming||!g){Ue.value.show=!1;return}const{minX:C,maxX:w}=Vt.value,W=w-C||1,M=W/se.value.scale,H=C-se.value.offsetX/O.value.width*W,T=(r-O.value.left)/O.value.width,ee=H+T*M,Ne=Math.round(ee);if(Ne>=0&&Ne<=w){const Xe=ln(Ne),ve=Jn.value.map((xe,Ve)=>{const ge=F.series.findIndex(Oe=>Oe===xe),Qe=xe.data[Ne];return{seriesName:xe.name,value:Qe!==void 0?Qe:null,color:f(ge),y:Qe!==void 0?qn(xe,Qe):null}}).filter(xe=>xe.value!==null);Ue.value={show:!0,x:Xe,categoryIndex:Ne,data:ve}}},Pn=()=>{Ue.value.show=!1,Mt.value=!1,Fo.value=!1,xo.value||(Wt.value.show=!1),se.value.isDragging&&(se.value.isDragging=!1),se.value.zoomTimeout&&(clearTimeout(se.value.zoomTimeout),se.value.zoomTimeout=null),se.value.isZooming=!1,setTimeout(()=>{he.value=null,gt.value.show=!1},150)},Zl=t=>{if(t.preventDefault(),t.stopPropagation(),!St.value)return;const a=t.currentTarget.getBoundingClientRect(),n=t.clientX-a.left,r=t.clientY-a.top;if(Sn.value){ht.value.show=!1,e.nextTick(()=>{ht.value.show=!0,ht.value.x=t.clientX,ht.value.y=t.clientY,ht.value.categoryIndex=null});return}const p=Math.max(0,O.value.left-20),g=O.value.right,C=O.value.top,w=O.value.bottom+80;n>=p&&n<=g&&r>=C&&r<=w&&(ht.value.show=!1,e.nextTick(()=>{ht.value.show=!0,ht.value.x=t.clientX,ht.value.y=t.clientY,ht.value.categoryIndex=null;const W=Math.max(O.value.left,Math.min(n,O.value.right))-O.value.left,H=O.value.width/c.value.length,T=Math.floor(W/H);T>=0&&T<c.value.length&&(ht.value.categoryIndex=T)}))},Yn=t=>{if(!(t&&t.button===2)){if(ht.value.show&&t&&t.type==="click"){const a=document.querySelector(".dss-context-menu");if(a&&a.contains(t.target))return}ht.value.show=!1}},Bl=t=>{if(typeof t.template=="function"){const a={series:F.series,categories:F.categories,markers:on.value},n={chartX:ht.value.chartX,chartY:ht.value.chartY,dataX:ht.value.mouseDataX,dataY:ht.value.mouseDataY,categoryIndex:ht.value.categoryIndex};return t.template(a,n)}return t.template||t.label||""},Bn=t=>{const a=["dss-context-menu-item"];return t.cssClass&&a.push(t.cssClass),a},Gl=t=>t.style||{},cl=t=>t.type&&rn.value[t.type]?rn.value[t.type]:t.customIcon?t.customIcon:Nt.value,Ul=t=>t==null?"":F.categories&&F.categories[t]?F.categories[t]:"",kl=t=>on.value.length?on.value.filter(a=>a.categoryIndex===t):[],Ql=t=>{if(!En.value&&!Yt.value)return{x:0,y:0};const a=ln(t),n=Q.value+O.value.bottom-Vn.value/2;return{x:a,y:n}},Mn=()=>{on.value.forEach(t=>{if(t.categoryIndex!==void 0&&(En.value||Yt.value)){const a=Ql(t.categoryIndex);t.x=a.x,t.y=a.y}})},ul=()=>{if(Fe.value.description&&Fe.value.description.length&&Fe.value.date){if(yl.value){const t=on.value.findIndex(a=>a.id===Fe.value.editingMarkerId);t!==-1?(on.value[t].description=Fe.value.description||"",on.value[t].color=Fe.value.color||"",on.value[t].type=Fe.value.type||"default",ce("update-marker",on.value[t])):ce("update-marker",{id:Fe.value.editingMarkerId,description:Fe.value.description||"",color:Fe.value.color||"",type:Fe.value.type||"default"})}else{const t="dss-marker-"+Date.now()+"-"+Math.random().toString(36).substring(2,9);let a=ll(Fe.value.date,F.categories||[]);if(Yt.value){const{maxX:C}=Vt.value;a=Math.max(0,Math.min(a,Math.floor(C)))}else En.value&&(a=Math.max(0,Math.min(a,Vt.value.maxX)));const n=ln(a),r=Q.value+O.value.bottom-Vn.value/2,p=Array.isArray(F.categories)?F.categories[a]:null,g={id:t,title:"",description:Fe.value.description||"",color:Fe.value.color||"",type:Fe.value.type||"default",categoryIndex:a,x:n,y:r,marker_date:p||null};Fe.value.categoryIndex=a,on.value.push(g),ce("add-marker",g)}xn(),h()}},xn=()=>{Fe.value.show=!1,Fe.value.title="",Fe.value.description="",Fe.value.color="#FF6B6B",Fe.value.type="default",Fe.value.editingMarkerId=null,Fe.value.readonly=!1,Fe.value.categoryIndex=null,Fe.value.fromButton=!1,Fe.value.date=null},hn=()=>{yl.value&&(jn(Fe.value.editingMarkerId),xn())},jn=t=>{const a=on.value.findIndex(n=>n.id===t);a!==-1&&(on.value.splice(a,1),h()),ce("delete-marker",t)},y=t=>{if(Fe.value.show=!0,Fe.value.title=t?.title??t?.comment??"",Fe.value.description=t?.description??t?.comment??"",Fe.value.color=t?.color??"",Fe.value.type=t?.type??"default",Fe.value.editingMarkerId=t?.id??t?.marker_id??null,Fe.value.readonly=t?.readonly??!1,Fe.value.categoryIndex=t?.categoryIndex??null,t?.marker_date){const[a,n,r]=String(t.marker_date).split("-"),p=Number(r?.length===2?`20${r}`:r),g=Number(a),C=Number(n)-1;g&&n&&p?Fe.value.date=new Date(p,C,g):Fe.value.date=null}else Fe.value.date=null},h=()=>{try{const t=`dss-chart-markers-${F.chartId}`;localStorage.setItem(t,JSON.stringify(on.value))}catch(t){console.warn("Could not save markers to localStorage:",t)}},x=()=>{try{const t=`dss-chart-markers-${F.chartId}`,a=localStorage.getItem(t);if(a){const n=JSON.parse(a);Array.isArray(n)&&(on.value=n.map(r=>({...r,originalYOffset:r.originalYOffset!==void 0?r.originalYOffset:15})))}}catch(t){console.warn("Could not load markers from localStorage:",t),on.value=[]}},q=t=>{const a=ct.value||"Chart",n=new Date().toLocaleDateString("en-GB",{day:"2-digit",month:"2-digit",year:"2-digit"}).replace(/\//g,"-");return`${a.replace(/[^a-zA-Z0-9\s]/g,"").replace(/\s+/g,"-").substring(0,50).replace(/^-|-$/g,"")||"Chart"}-${n}.${t}`},fe=()=>{const t=Ue.value.show,a=gt.value.show;return Ue.value.show=!1,gt.value.show=!1,{originalCrosshair:t,originalTooltip:a}},Ge=t=>{Ue.value.show=t.originalCrosshair,gt.value.show=t.originalTooltip},qt=async(t,a=32,n=32)=>new Promise((r,p)=>{if(t.startsWith("data:")){r(t);return}const g=new Image;g.crossOrigin="anonymous";const C=setTimeout(()=>{console.warn("Image conversion timeout for:",t),r(t)},5e3);g.onload=()=>{clearTimeout(C);try{const w=document.createElement("canvas"),W=w.getContext("2d");w.width=a,w.height=n,W.fillStyle="#fafafa",W.fillRect(0,0,a,n),W.drawImage(g,0,0,a,n);const M=w.toDataURL("image/png");r(M)}catch(w){console.warn("Canvas conversion failed:",w),r(t)}},g.onerror=w=>{clearTimeout(C),console.warn("Failed to load image:",t,w),r(t)},g.src=t}),yn=async()=>{try{const t=fe();setTimeout(async()=>{try{const a=_.value;if(!a){console.error("Chart SVG element not found"),Ge(t);return}const n=tt(),r=Ee.value,p=ie.value+n.height,g=a.cloneNode(!0);g.querySelectorAll(".dss-flag-markers, .dss-flag-line, .dss-flag-extension-line, .dss-flag-count-indicator, .dss-flag-count-text").forEach(ge=>ge.remove());const w=g.querySelectorAll("image"),W=Array.from(w).map(async ge=>{const Qe=ge.getAttribute("xlink:href")||ge.getAttribute("href");if(Qe&&!Qe.startsWith("data:"))try{const Oe=await qt(Qe,32,32);ge.setAttribute("xlink:href",Oe),ge.setAttribute("href",Oe)}catch(Oe){console.warn("Failed to convert logo to base64:",Oe)}});await Promise.all(W);const H=new XMLSerializer().serializeToString(g).replace(/<svg[^>]*>/,"").replace("</svg>","");let T="",ee=30;if(ct.value&&(T+=`
|
|
46
|
-
<text x="24" y="${
|
|
44
|
+
</svg>`;return`data:image/svg+xml;base64,${btoa(t)}`}),Qt=e.computed(()=>{const t=U.value;return t&&t.radialLabels&&t.radialLabels.show===!0}),_t=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 Ln=e.computed(()=>{const t=U.value;return t&&t.radialLabels&&typeof t.radialLabels.pointerLength=="number"?t.radialLabels.pointerLength:25}),En=e.computed(()=>{const t=U.value;return t&&t.radialLabels&&typeof t.radialLabels.horizontalLength=="number"?t.radialLabels.horizontalLength:40}),Zl=e.computed(()=>{const t=U.value;return t&&t.radialLabels&&typeof t.radialLabels.textOffset=="number"?t.radialLabels.textOffset:8}),vn=e.computed(()=>{const o=U.value?.radialBar?.dataLabels;return o&&(o.show===!0||o.enabled===!0)}),hn=e.computed(()=>{const o=U.value?.radialBar?.dataLabels?.minAngleDegrees;return typeof o=="number"&&o>=0?o:20}),An=e.computed(()=>{const o=U.value?.radialBar?.dataCenter;return en.value?!0:Cn.value&&o&&(o.show===!0||o.enabled===!0)}),Tn=e.computed(()=>{if(!An.value||!Mn.value.length)return"";if(en.value){const r=Mn.value[1]??Mn.value[0];return _(r?.value??0)}const l=U.value?.radialBar?.dataCenter?.showValueOnly===!0?Mn.value[0]?.value??0:Mn.value.reduce((r,m)=>r+(m.value??0),0);return _(l)}),Gl=e.computed(()=>{const o=U.value?.radialBar?.dataCenter?.fontSize;return typeof o=="number"&&o>0?o:24}),ll=e.computed(()=>({x:Ut.value,y:en.value?Pt.value:Pt.value-Gl.value/2})),Xn=e.computed(()=>{const o=U.value?.radialBar?.dataCenter?.color;return typeof o=="string"&&o?o:"#333"}),Ql=e.computed(()=>{if(!vn.value||!al.value||!Mn.value.length)return[];const t=hn.value*Math.PI/180,o=(sl.value+gt.value)/2;return Mn.value.map(l=>{const m=l.endAngle-l.startAngle>=t&&!l.isHidden,f=Ut.value+Math.cos(l.midAngle)*o,C=Pt.value+Math.sin(l.midAngle)*o;return{value:_(l.value),x:f,y:C,show:m,color:l.color,contrastColor:ln(l.color)}})}),Jt=e.computed(()=>{if(!F.flags||!F.flags.length)return[];const t=new Map;return F.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=vt(o),m=l.filter(C=>C.manual),f=l.filter(C=>!C.manual);return{categoryIndex:parseInt(o),x:r,flags:l,manualCount:m.length,autoCount:f.length,totalCount:l.length,hasManual:m.length>0,hasAuto:f.length>0,texts:l.map(C=>C.text).join(`
|
|
45
|
+
`)}})}),Dn=e.ref({show:!1,x:0,y:0,content:"",count:0}),nl=e.computed(()=>U.value?.bubbles?.tooltip?.fields||["x","y","size","label"]),zl=e.computed(()=>{const t=U.value;return{...{x:"X",y:"Y",size:"Size",label:"Label",seriesName:"Series"},...t?.bubbles?.tooltip?.labels||{}}}),On=e.computed(()=>U.value?.bubbles?.tooltip?.formatters||{}),zt=e.ref(new Set),Me=e.ref(null),El=e.ref(!1),kt=e.ref({show:!1,x:0,y:0,title:"",value:"",bubbleData:[],spiderAreas:[]}),Ml=e.ref({show:!1,x:0,y:0,categoryValue:"",description:""}),nt=e.ref({show:!1,x:0,categoryIndex:-1,data:[]}),ft=e.ref({show:!1,x:0,y:0,mouseDataX:0,mouseDataY:0,categoryIndex:-1,chartX:0,chartY:0}),ie=e.ref({scale:1,offsetX:0,minScale:1,maxScale:2.5,isDragging:!1,lastMouseX:0,lastMouseY:0,isZooming:!1,zoomTimeout:null}),Tt=e.ref([]),De=e.ref({show:!1,title:"",description:"",color:"#FF6B6B",type:"default",editingMarkerId:null,readonly:!1,categoryIndex:null,fromButton:!1,date:null});e.computed(()=>{const t=["default"];return sn.value&&t.push(...Object.keys(sn.value)),t}),e.computed(()=>{if(!F.categories||F.categories.length===0){const{maxX:t}=He.value;return Array.from({length:t+1},(o,l)=>$("chart.fallback.item",{number:l+1}))}return F.categories});const Jl=e.computed(()=>{if(!F.categories||F.categories.length===0)return null;const t=F.categories[0],[o,l,r]=String(t).split("-"),m=Number(r?.length===2?`20${r}`:r),f=Number(o),C=Number(l)-1;return!f||!l||!m?null:new Date(m,C,f)}),Cl=e.computed(()=>{if(!F.categories||F.categories.length===0)return null;const t=F.categories[F.categories.length-1],[o,l,r]=String(t).split("-"),m=Number(r?.length===2?`20${r}`:r),f=Number(o),C=Number(l)-1;return!f||!l||!m?null:new Date(m,C,f)}),Al=e.computed(()=>De.value.editingMarkerId!==null),y=e.computed(()=>De.value.readonly),g=t=>{zt.value.has(t)||(ia.value=!0,Me.value=t)},w=()=>{ia.value=!1,Me.value=null},Z=t=>{if(go.value||Io.value){nt.value.show=!1;return}const l=t.currentTarget.getBoundingClientRect(),r=t.clientX-l.left,m=t.clientY-l.top,f=ul.value?r>=R.value.left-50&&r<=R.value.right+50&&m>=R.value.top-50&&m<=R.value.bottom+100:r>=R.value.left&&r<=R.value.right&&m>=R.value.top&&m<=R.value.bottom;if(El.value=f,ul.value){if(!Xe.value||!f||ie.value.isDragging||ie.value.isZooming){nt.value.show=!1;return}if(Ro.value.find(pe=>!pe||pe.isHidden?!1:Math.sqrt(Math.pow(pe.x-r,2)+Math.pow(pe.y-m,2))<=pe.radius+3))nt.value.show=!1;else{const pe=Ro.value.filter(ye=>!ye||ye.isHidden?!1:Math.sqrt(Math.pow(ye.x-r,2)+Math.pow(ye.y-m,2))<=250);if(pe.length>0){let ye=pe[0],Se=Math.sqrt(Math.pow(ye.x-r,2)+Math.pow(ye.y-m,2));pe.forEach(Oe=>{const Ae=Math.sqrt(Math.pow(Oe.x-r,2)+Math.pow(Oe.y-m,2));Ae<Se&&(Se=Ae,ye=Oe)});const ve=30,Ye=Ro.value.filter(Oe=>!Oe||Oe.isHidden?!1:Math.abs(Oe.x-ye.x)<=ve).sort((Oe,Ae)=>Oe.y-Ae.y);nt.value={show:!0,x:ye.x,categoryIndex:Math.round(ye.originalX),data:(()=>{const Oe=nl.value,Ae=zl.value,Ee=[];return Ye.forEach(Re=>{Oe.forEach(Vt=>{const Ft=Ae[Vt]||Vt,Dl=ka(Vt,Re);Dl&&Ee.push({seriesName:Re.seriesName,label:Re.label,value:`${Ft}: ${Dl}`,color:Re.color,y:Re.y})})}),Ee})()}}else nt.value.show=!1}return}if(ie.value.isDragging&&ie.value.scale>1&&ol.value&&Ge.value){nt.value.show=!1;const Ze=t.clientX-ie.value.lastMouseX,{minX:pe,maxX:ye}=He.value,Se=ye-pe||1,Ye=Ze*.8;ie.value.offsetX+=Ye;const Oe=Se/ie.value.scale,Ae=Se-Oe,Ee=0,Re=-Ae/Se*R.value.width,Vt=Ee;ie.value.offsetX=Math.max(Re,Math.min(Vt,ie.value.offsetX)),ie.value.lastMouseX=t.clientX,ie.value.lastMouseY=t.clientY;return}if(!Xe.value||!ol.value||ie.value.isDragging||ie.value.isZooming||!f){nt.value.show=!1;return}const{minX:C,maxX:b}=He.value,P=b-C||1,B=P/ie.value.scale,H=C-ie.value.offsetX/R.value.width*P,S=(r-R.value.left)/R.value.width,q=H+S*B,we=Math.round(q);if(we>=0&&we<=b){const Ze=vt(we),pe=a.value.map((ye,Se)=>{const ve=F.series.findIndex(Oe=>Oe===ye),Ye=ye.data[we];return{seriesName:ye.name,value:Ye!==void 0?Ye:null,color:$t(ve),y:Ye!==void 0?gl(ye,Ye):null}}).filter(ye=>ye.value!==null);nt.value={show:!0,x:Ze,categoryIndex:we,data:pe}}},he=()=>{nt.value.show=!1,El.value=!1,Io.value=!1,go.value||(Dn.value.show=!1),ie.value.isDragging&&(ie.value.isDragging=!1),ie.value.zoomTimeout&&(clearTimeout(ie.value.zoomTimeout),ie.value.zoomTimeout=null),ie.value.isZooming=!1,setTimeout(()=>{Me.value=null,kt.value.show=!1},150)},at=t=>{if(t.preventDefault(),t.stopPropagation(),!ql.value)return;const o=t.currentTarget.getBoundingClientRect(),l=t.clientX-o.left,r=t.clientY-o.top;if(al.value){ft.value.show=!1,e.nextTick(()=>{ft.value.show=!0,ft.value.x=t.clientX,ft.value.y=t.clientY,ft.value.categoryIndex=null});return}const m=Math.max(0,R.value.left-20),f=R.value.right,C=R.value.top,b=R.value.bottom+80;l>=m&&l<=f&&r>=C&&r<=b&&(ft.value.show=!1,e.nextTick(()=>{ft.value.show=!0,ft.value.x=t.clientX,ft.value.y=t.clientY,ft.value.categoryIndex=null;const P=Math.max(R.value.left,Math.min(l,R.value.right))-R.value.left,H=R.value.width/To.value.length,S=Math.floor(P/H);S>=0&&S<To.value.length&&(ft.value.categoryIndex=S)}))},Bt=t=>{if(!(t&&t.button===2)){if(ft.value.show&&t&&t.type==="click"){const o=document.querySelector(".dss-context-menu");if(o&&o.contains(t.target))return}ft.value.show=!1}},bl=t=>{if(typeof t.template=="function"){const o={series:F.series,categories:F.categories,markers:Tt.value},l={chartX:ft.value.chartX,chartY:ft.value.chartY,dataX:ft.value.mouseDataX,dataY:ft.value.mouseDataY,categoryIndex:ft.value.categoryIndex};return t.template(o,l)}return t.template||t.label||""},Pl=t=>{const o=["dss-context-menu-item"];return t.cssClass&&o.push(t.cssClass),o},Ul=t=>t.style||{},gn=t=>t.type&&sn.value[t.type]?sn.value[t.type]:t.customIcon?t.customIcon:Kl.value,mo=t=>t==null?"":F.categories&&F.categories[t]?F.categories[t]:"",Xo=t=>Tt.value.length?Tt.value.filter(o=>o.categoryIndex===t):[],Co=t=>{if(!ol.value&&!ul.value)return{x:0,y:0};const o=vt(t),l=J.value+R.value.bottom-T.value/2;return{x:o,y:l}},bo=()=>{Tt.value.forEach(t=>{if(t.categoryIndex!==void 0&&(ol.value||ul.value)){const o=Co(t.categoryIndex);t.x=o.x,t.y=o.y}})},Yo=()=>{if(De.value.description&&De.value.description.length&&De.value.date){if(Al.value){const t=Tt.value.findIndex(o=>o.id===De.value.editingMarkerId);t!==-1?(Tt.value[t].description=De.value.description||"",Tt.value[t].color=De.value.color||"",Tt.value[t].type=De.value.type||"default",ce("update-marker",Tt.value[t])):ce("update-marker",{id:De.value.editingMarkerId,description:De.value.description||"",color:De.value.color||"",type:De.value.type||"default"})}else{const t="dss-marker-"+Date.now()+"-"+Math.random().toString(36).substring(2,9);let o=Te(De.value.date,F.categories||[]);if(ul.value){const{maxX:C}=He.value;o=Math.max(0,Math.min(o,Math.floor(C)))}else ol.value&&(o=Math.max(0,Math.min(o,He.value.maxX)));const l=vt(o),r=J.value+R.value.bottom-T.value/2,m=Array.isArray(F.categories)?F.categories[o]:null,f={id:t,title:"",description:De.value.description||"",color:De.value.color||"",type:De.value.type||"default",categoryIndex:o,x:l,y:r,marker_date:m||null};De.value.categoryIndex=o,Tt.value.push(f),ce("add-marker",f)}Sn(),wo()}},Sn=()=>{De.value.show=!1,De.value.title="",De.value.description="",De.value.color="#FF6B6B",De.value.type="default",De.value.editingMarkerId=null,De.value.readonly=!1,De.value.categoryIndex=null,De.value.fromButton=!1,De.value.date=null},po=()=>{Al.value&&(xo(De.value.editingMarkerId),Sn())},xo=t=>{const o=Tt.value.findIndex(l=>l.id===t);o!==-1&&(Tt.value.splice(o,1),wo()),ce("delete-marker",t)},jo=t=>{if(De.value.show=!0,De.value.title=t?.title??t?.comment??"",De.value.description=t?.description??t?.comment??"",De.value.color=t?.color??"",De.value.type=t?.type??"default",De.value.editingMarkerId=t?.id??t?.marker_id??null,De.value.readonly=t?.readonly??!1,De.value.categoryIndex=t?.categoryIndex??null,t?.marker_date){const[o,l,r]=String(t.marker_date).split("-"),m=Number(r?.length===2?`20${r}`:r),f=Number(o),C=Number(l)-1;f&&l&&m?De.value.date=new Date(m,C,f):De.value.date=null}else De.value.date=null},wo=()=>{try{const t=`dss-chart-markers-${F.chartId}`;localStorage.setItem(t,JSON.stringify(Tt.value))}catch(t){console.warn("Could not save markers to localStorage:",t)}},Eo=()=>{try{const t=`dss-chart-markers-${F.chartId}`,o=localStorage.getItem(t);if(o){const l=JSON.parse(o);Array.isArray(l)&&(Tt.value=l.map(r=>({...r,originalYOffset:r.originalYOffset!==void 0?r.originalYOffset:15})))}}catch(t){console.warn("Could not load markers from localStorage:",t),Tt.value=[]}},Hn=t=>{const o=ut.value||"Chart",l=new Date().toLocaleDateString("en-GB",{day:"2-digit",month:"2-digit",year:"2-digit"}).replace(/\//g,"-");return`${o.replace(/[^a-zA-Z0-9\s]/g,"").replace(/\s+/g,"-").substring(0,50).replace(/^-|-$/g,"")||"Chart"}-${l}.${t}`},fo=()=>{const t=nt.value.show,o=kt.value.show;return nt.value.show=!1,kt.value.show=!1,{originalCrosshair:t,originalTooltip:o}},Vn=t=>{nt.value.show=t.originalCrosshair,kt.value.show=t.originalTooltip},Ko=async(t,o=32,l=32)=>new Promise((r,m)=>{if(t.startsWith("data:")){r(t);return}const f=new Image;f.crossOrigin="anonymous";const C=setTimeout(()=>{console.warn("Image conversion timeout for:",t),r(t)},5e3);f.onload=()=>{clearTimeout(C);try{const b=document.createElement("canvas"),P=b.getContext("2d");b.width=o,b.height=l,P.fillStyle="#fafafa",P.fillRect(0,0,o,l),P.drawImage(f,0,0,o,l);const B=b.toDataURL("image/png");r(B)}catch(b){console.warn("Canvas conversion failed:",b),r(t)}},f.onerror=b=>{clearTimeout(C),console.warn("Failed to load image:",t,b),r(t)},f.src=t}),Go=async()=>{try{const t=fo();setTimeout(async()=>{try{const o=L.value;if(!o){console.error("Chart SVG element not found"),Vn(t);return}const l=tt(),r=Ve.value,m=re.value+l.height,f=o.cloneNode(!0);f.querySelectorAll(".dss-flag-markers, .dss-flag-line, .dss-flag-extension-line, .dss-flag-count-indicator, .dss-flag-count-text").forEach(ve=>ve.remove());const b=f.querySelectorAll("image"),P=Array.from(b).map(async ve=>{const Ye=ve.getAttribute("xlink:href")||ve.getAttribute("href");if(Ye&&!Ye.startsWith("data:"))try{const Oe=await Ko(Ye,32,32);ve.setAttribute("xlink:href",Oe),ve.setAttribute("href",Oe)}catch(Oe){console.warn("Failed to convert logo to base64:",Oe)}});await Promise.all(P);const H=new XMLSerializer().serializeToString(f).replace(/<svg[^>]*>/,"").replace("</svg>","");let S="",q=30;if(ut.value&&(S+=`
|
|
46
|
+
<text x="24" y="${q}"
|
|
47
47
|
font-family="Arial, sans-serif"
|
|
48
48
|
font-size="18"
|
|
49
49
|
font-weight="bold"
|
|
50
50
|
fill="#333">
|
|
51
|
-
${
|
|
52
|
-
</text>`,
|
|
53
|
-
<text x="24" y="${
|
|
51
|
+
${ut.value.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}
|
|
52
|
+
</text>`,q+=30),ht.value&&(S+=`
|
|
53
|
+
<text x="24" y="${q}"
|
|
54
54
|
font-family="Arial, sans-serif"
|
|
55
55
|
font-size="14"
|
|
56
56
|
fill="#666">
|
|
57
|
-
${
|
|
58
|
-
</text>`,
|
|
59
|
-
<g opacity="${
|
|
60
|
-
<g transform="translate(${
|
|
57
|
+
${ht.value.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}
|
|
58
|
+
</text>`,q+=25),W.value&&F.series.length>0){let ve=r-200,Ye=ut.value||ht.value?35:25;const Oe=Math.floor((r-250)/120);let Ae=0;F.series.forEach((Ee,Re)=>{if(!zt.value.has(Re)){const Vt=$t(Re),Ft=Ee.name.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">");S+=`<circle cx="${ve+6}" cy="${Ye-4}" r="6" fill="${Vt}"/>`,S+=`<text x="${ve+18}" y="${Ye}" font-family="Arial, sans-serif" font-size="12" fill="#333">${Ft}</text>`,Ae++,Ae%Oe===0?(ve=r-200,Ye+=20):ve+=Math.min(120,Ft.length*8+35)}})}let we="";if(ct.value)try{const{width:ve,height:Ye}=kl.value,Oe=il.value,Ae=R.value.left,Ee=R.value.right,Re=R.value.top,Vt=R.value.bottom,Ft=R.value.width,Dl=R.value.height;let fl,$l;switch(Oe){case"center":fl=Ae+(Ft-ve)/2,$l=Re+(Dl-Ye)/2;break;case"top-left":fl=Ae+15,$l=Re+5;break;case"top-right":fl=Ee-ve-5,$l=Re+5;break;case"bottom-left":fl=Ae+15,$l=Vt-Ye-5;break;case"bottom-right":default:fl=Ee-ve-5,$l=Vt-Ye-5;break}we=`
|
|
59
|
+
<g opacity="${lt.value}">
|
|
60
|
+
<g transform="translate(${fl}, ${$l}) scale(${ve/499})">
|
|
61
61
|
<path d="M171.52 37.8399H160.38C160.26 36.4799 160.02 35.0599 159.68 33.5699C159.34 32.0799 158.77 30.7399 157.96 29.5299C157.16 28.3199 156 27.3199 154.48 26.5099C152.96 25.7099 150.94 25.2999 148.4 25.2999C144.69 25.2999 141.93 26.1299 140.14 27.8099C138.34 29.4799 137.45 31.5499 137.45 34.0299C137.45 37.7999 139.29 40.0799 142.97 40.8499C146.65 41.6299 150.67 42.3799 155.03 43.1199C159.39 43.8599 163.41 45.3899 167.09 47.7099C170.77 50.0299 172.61 54.6199 172.61 61.4899C172.61 64.6499 172.02 67.5099 170.85 70.0699C169.67 72.6399 168.02 74.7899 165.89 76.5199C163.76 78.2499 161.19 79.5799 158.19 80.5099C155.19 81.4399 151.93 81.8999 148.4 81.8999C143.95 81.8999 140.12 81.2699 136.94 79.9999C133.75 78.7299 131.19 77.0799 129.24 75.0399C127.29 72.9999 125.93 70.6899 125.16 68.1299C124.39 65.5599 124.19 62.9499 124.56 60.2899H136.25C136.37 62.0799 136.58 63.7899 136.85 65.3899C137.13 66.9999 137.68 68.4099 138.52 69.6099C139.35 70.8199 140.58 71.7799 142.19 72.4899C143.8 73.1999 145.99 73.5599 148.78 73.5599C153.3 73.5599 156.47 72.6199 158.29 70.7299C160.11 68.8399 161.03 66.6899 161.03 64.2799C161.03 60.2599 159.19 57.7799 155.51 56.8599C151.83 55.9299 147.79 55.0499 143.4 54.2099C139.01 53.3799 134.97 51.7699 131.29 49.3799C127.61 46.9999 125.77 42.3699 125.77 35.5099C125.77 32.8499 126.3 30.3899 127.35 28.1299C128.4 25.8699 129.9 23.9199 131.85 22.2799C133.8 20.6399 136.16 19.3399 138.95 18.3799C141.73 17.4199 144.8 16.9399 148.14 16.9399C152.41 16.9399 156.07 17.4699 159.14 18.5199C162.2 19.5699 164.69 21.0299 166.61 22.8799C168.53 24.7399 169.89 26.9499 170.69 29.5199C171.49 32.0899 171.77 34.8599 171.52 37.8199V37.8399Z" fill="#020203"/>
|
|
62
62
|
<path d="M179.04 58.1699C179.04 55.0799 179.55 52.0499 180.57 49.0699C181.59 46.0999 183.04 43.4899 184.93 41.2299C186.82 38.9699 189.09 37.1499 191.75 35.7499C194.41 34.3599 197.35 33.6599 200.57 33.6599C207 33.6599 212.15 35.9299 216.02 40.4799C219.89 45.0299 221.97 51.5999 222.28 60.1999H189.34C189.77 64.2199 191.09 67.1499 193.28 68.9699C195.48 70.7999 198.12 71.7099 201.21 71.7099C203 71.7099 204.5 71.4599 205.71 70.9699C206.92 70.4799 207.91 69.8899 208.68 69.2099C209.45 68.5299 210.06 67.8199 210.49 67.0799C210.92 66.3399 211.26 65.7199 211.51 65.2199H221.72C221.6 66.7699 221.1 68.5099 220.24 70.4599C219.37 72.4099 218.14 74.2299 216.53 75.9399C214.92 77.6399 212.85 79.0599 210.31 80.2099C207.77 81.3499 204.77 81.9299 201.31 81.9299C197.85 81.9299 194.91 81.2799 192.12 79.9799C189.34 78.6799 186.98 76.9499 185.07 74.7799C183.15 72.6099 181.67 70.0899 180.61 67.2199C179.56 64.3399 179.03 61.3299 179.03 58.1699H179.04ZM200.94 42.0199C198.47 42.0199 196.24 42.7299 194.26 44.1499C192.28 45.5699 190.89 47.8299 190.08 50.9199H211.33C211.02 48.0799 209.95 45.8799 208.13 44.3299C206.3 42.7899 203.91 42.0099 200.94 42.0099V42.0199Z" fill="#020203"/>
|
|
63
63
|
<path d="M268.59 80.9999H258.01V50.3799C258.01 48.2099 257.3 46.5099 255.88 45.2799C254.46 44.0399 252.6 43.4199 250.31 43.4199C248.45 43.4199 246.94 43.8399 245.76 44.6699C244.58 45.4999 243.67 46.5399 243.02 47.7799C242.37 49.0199 241.94 50.3799 241.72 51.8599C241.5 53.3399 241.4 54.7099 241.4 55.9399V80.9999H230.82V34.5999H241.03V38.3099C241.83 37.6899 243.27 36.7599 245.34 35.5199C247.41 34.2799 250.3 33.6599 254.02 33.6599C256.68 33.6599 259.12 34.1599 261.35 35.1399C263.58 36.1299 265.31 37.6799 266.55 39.7799C267.04 39.2899 267.71 38.6799 268.55 37.9699C269.38 37.2599 270.41 36.5799 271.61 35.9299C272.82 35.2799 274.22 34.7399 275.83 34.3099C277.44 33.8799 279.23 33.6599 281.21 33.6599C285.23 33.6599 288.67 34.8099 291.51 37.0899C294.36 39.3799 295.78 43.0599 295.78 48.1299V80.9799H285.2V50.3599C285.2 48.1899 284.49 46.4899 283.07 45.2599C281.65 44.0199 279.79 43.3999 277.5 43.3999C275.64 43.3999 274.13 43.8199 272.95 44.6499C271.77 45.4799 270.86 46.5199 270.21 47.7599C269.56 48.9999 269.13 50.3599 268.91 51.8399C268.69 53.3199 268.59 54.6899 268.59 55.9199V80.9799V80.9999Z" fill="#020203"/>
|
|
@@ -72,8 +72,8 @@
|
|
|
72
72
|
<path d="M47.5201 77.18H66.2501C73.5601 77.18 79.4801 71.26 79.4801 63.95C79.4801 56.64 73.5601 50.72 66.2501 50.72H47.3601C46.3801 50.72 45.5901 51.52 45.6001 52.5L45.7601 75.44C45.7601 76.41 46.5501 77.19 47.5201 77.19V77.18Z" fill="#07ACDD"/>
|
|
73
73
|
<path d="M28.4201 76.12C35.1082 76.12 40.5301 70.6982 40.5301 64.01C40.5301 57.3218 35.1082 51.9 28.4201 51.9C21.7319 51.9 16.3101 57.3218 16.3101 64.01C16.3101 70.6982 21.7319 76.12 28.4201 76.12Z" fill="#fafafa"/>
|
|
74
74
|
</g>
|
|
75
|
-
</g>`}catch(
|
|
76
|
-
<svg width="${r}" height="${
|
|
75
|
+
</g>`}catch(ve){console.warn("Watermark processing failed, skipping watermark in SVG:",ve),we=""}const Ze=`<?xml version="1.0" encoding="UTF-8"?>
|
|
76
|
+
<svg width="${r}" height="${m}"
|
|
77
77
|
xmlns="http://www.w3.org/2000/svg"
|
|
78
78
|
xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
79
79
|
<defs>
|
|
@@ -84,35 +84,37 @@
|
|
|
84
84
|
</style>
|
|
85
85
|
</defs>
|
|
86
86
|
<rect width="100%" height="100%" fill="#fafafa"/>
|
|
87
|
-
${
|
|
88
|
-
<g transform="translate(0, ${
|
|
87
|
+
${S}
|
|
88
|
+
<g transform="translate(0, ${l.height})">
|
|
89
89
|
${H}
|
|
90
|
-
${
|
|
90
|
+
${we}
|
|
91
91
|
</g>
|
|
92
|
-
</svg>`,
|
|
93
|
-
`),
|
|
92
|
+
</svg>`,pe=new Blob([Ze],{type:"image/svg+xml;charset=utf-8"}),ye=URL.createObjectURL(pe),Se=document.createElement("a");Se.href=ye,Se.download=Hn("svg"),document.body.appendChild(Se),Se.click(),document.body.removeChild(Se),URL.revokeObjectURL(ye),Vn(t),Bt()}catch(o){console.error("Error downloading SVG:",o),Vn(t)}},50)}catch(t){console.error("Error downloading SVG:",t)}},So=async()=>{try{const t=fo();O.value&&O.value.offsetHeight,await new Promise(ve=>setTimeout(ve,300));const o=tt(),l=Ve.value,r=re.value+o.height,m=document.createElement("canvas"),f=m.getContext("2d"),C=2;m.width=l*C,m.height=r*C,m.style.width=l+"px",m.style.height=r+"px",f.scale(C,C),f.fillStyle="#fafafa",f.fillRect(0,0,l,r);let b=30;if(ut.value&&(f.fillStyle="#333",f.font="bold 18px Arial, sans-serif",f.fillText(ut.value,24,b),b+=30),ht.value&&(f.fillStyle="#666",f.font="14px Arial, sans-serif",f.fillText(ht.value,24,b),b+=25),W.value&&F.series.length>0){let ve=l-200,Ye=ut.value||ht.value?35:25;const Oe=Math.floor((l-250)/120);let Ae=0;f.font="12px Arial, sans-serif",F.series.forEach((Ee,Re)=>{if(!zt.value.has(Re)){const Vt=$t(Re);f.beginPath(),f.arc(ve+6,Ye-4,6,0,2*Math.PI),f.fillStyle=Vt,f.fill(),f.fillStyle="#333",f.fillText(Ee.name,ve+18,Ye),Ae++,Ae%Oe===0?(ve=l-200,Ye+=20):ve+=Math.min(120,Ee.name.length*8+35)}})}const B=L.value.cloneNode(!0),H=B.querySelectorAll(".dss-flag-markers, .dss-flag-line, .dss-flag-extension-line, .dss-flag-count-indicator, .dss-flag-count-text"),S=B.querySelectorAll(".dss-crosshair"),q=B.querySelectorAll('[class*="tooltip"]');H.forEach(ve=>ve.remove()),S.forEach(ve=>ve.remove()),q.forEach(ve=>ve.remove()),B.querySelectorAll("image").forEach((ve,Ye)=>{const Oe=ve.getAttribute("xlink:href")||ve.getAttribute("href");if(Oe&&!Oe.startsWith("data:")){const Ae=Fo.value[Ye],Ee=Ae?$t(Ae.seriesIndex):"#3B82F6",Re=ve.getAttribute("x")||0,Vt=ve.getAttribute("y")||0,Ft=ve.getAttribute("width")||32,Dl=ve.getAttribute("height")||32,fl=document.createElementNS("http://www.w3.org/2000/svg","circle");fl.setAttribute("cx",parseFloat(Re)+parseFloat(Ft)/2),fl.setAttribute("cy",parseFloat(Vt)+parseFloat(Dl)/2),fl.setAttribute("r",Math.min(parseFloat(Ft),parseFloat(Dl))/2-1),fl.setAttribute("fill",Ee),fl.setAttribute("stroke","#fafafa"),fl.setAttribute("stroke-width","2"),ve.parentNode.replaceChild(fl,ve)}});const Ze=new XMLSerializer().serializeToString(B),pe=new Blob([Ze],{type:"image/svg+xml;charset=utf-8"}),ye=URL.createObjectURL(pe),Se=new Image;return new Promise((ve,Ye)=>{Se.onload=async()=>{try{if(f.drawImage(Se,0,o.height),Fo.value.forEach(Oe=>{const Ae=Oe.x,Ee=Oe.y+o.height,Re=(Oe.width||32)/2,Vt=$t(Oe.seriesIndex);f.save(),f.beginPath(),f.arc(Ae,Ee,Re-1,0,2*Math.PI),f.fillStyle=Vt,f.fill(),f.strokeStyle="#fafafa",f.lineWidth=2,f.stroke(),f.restore()}),ct.value){const Oe=new Image,Ae=()=>{const{width:Re,height:Vt}=kl.value,Ft=il.value,Dl=R.value.left,fl=R.value.right,$l=R.value.top,ao=R.value.bottom,Po=R.value.width,da=R.value.height;let In,so;switch(Ft){case"center":In=Dl+(Po-Re)/2,so=$l+o.height+(da-Vt)/2;break;case"top-left":In=Dl+15,so=$l+o.height+10;break;case"top-right":In=fl-Re-5,so=$l+o.height+10;break;case"bottom-left":In=Dl+15,so=ao+o.height-Vt-5;break;case"bottom-right":default:In=fl-Re-5,so=ao+o.height-Vt-5;break}f.globalAlpha=lt.value,f.drawImage(Oe,In,so,Re,Vt),f.globalAlpha=1,Ee()},Ee=()=>{m.toBlob(Re=>{const Vt=URL.createObjectURL(Re),Ft=document.createElement("a");Ft.href=Vt,Ft.download=Hn("png"),document.body.appendChild(Ft),Ft.click(),document.body.removeChild(Ft),URL.revokeObjectURL(Vt),URL.revokeObjectURL(ye),Vn(t),Bt(),ve()},"image/png")};Oe.onload=Ae,Oe.onerror=Ee,Oe.src=fn.value}else m.toBlob(Oe=>{const Ae=URL.createObjectURL(Oe),Ee=document.createElement("a");Ee.href=Ae,Ee.download=Hn("png"),document.body.appendChild(Ee),Ee.click(),document.body.removeChild(Ee),URL.revokeObjectURL(Ae),URL.revokeObjectURL(ye),Vn(t),Bt(),ve()},"image/png")}catch(Oe){URL.revokeObjectURL(ye),Vn(t),Ye(Oe)}},Se.onerror=()=>{URL.revokeObjectURL(ye),Vn(t),Ye(new Error("Failed to load SVG image"))},Se.src=ye})}catch(t){console.error("Error downloading PNG:",t)}},Rn=()=>{try{let t="";if(ut.value&&(t+=`# ${$("chart.csv.chartTitle")}: ${ut.value}
|
|
93
|
+
`),ht.value&&(t+=`# ${$("chart.csv.chartSubtitle")}: ${ht.value}
|
|
94
94
|
`),t+=`# ${$("chart.csv.generated")}: ${new Date().toLocaleString()}
|
|
95
95
|
|
|
96
|
-
`,
|
|
97
|
-
|
|
98
|
-
`}const n=new Blob([t],{type:"text/csv;charset=utf-8;"}),r=URL.createObjectURL(n),p=document.createElement("a");p.href=r,p.download=q("csv"),document.body.appendChild(p),p.click(),document.body.removeChild(p),URL.revokeObjectURL(r),Yn()}catch(t){console.error("Error downloading CSV:",t)}},Cl=t=>{if(typeof t.action=="function"){const a={series:F.series,categories:F.categories,markers:on.value},n={chartX:ht.value.chartX,chartY:ht.value.chartY,dataX:ht.value.mouseDataX,dataY:ht.value.mouseDataY,categoryIndex:clampedCategoryIndex||ht.value.categoryIndex};t.action(a,n)}Yn()},fo=()=>{xn(),Fe.value.show=!0,Fe.value.categoryIndex=ht.value.categoryIndex,Fe.value.fromButton=!1,Yn()},Uo=()=>{xn(),Fe.value.show=!0,Fe.value.categoryIndex=0,Fe.value.fromButton=!0},vo=t=>{if(ht.value.show){const a=document.querySelector(".dss-context-menu");a&&!a.contains(t.target)&&(ht.value.show=!1)}},go=t=>{ht.value.show&&!t.target.closest(".context-menu")&&(ht.value.show=!1)},Vo=t=>{if(!En.value||!Ke.value)return;t.preventDefault(),t.stopPropagation(),se.value.isZooming=!0,Ue.value.show=!1,se.value.zoomTimeout&&clearTimeout(se.value.zoomTimeout);const n=t.currentTarget.getBoundingClientRect(),r=t.clientX-n.left,p=t.clientY-n.top;if(r<O.value.left-50||r>O.value.right+50||p<O.value.top-50||p>O.value.bottom+100){se.value.isZooming=!1;return}const g=t.deltaY>0?.9:1.1,C=Math.max(se.value.minScale,Math.min(se.value.maxScale,se.value.scale*g));if(C!==se.value.scale){const{minX:w,maxX:W}=Vt.value,M=W-w||1,H=M/se.value.scale,T=w-se.value.offsetX/O.value.width*M,ee=(r-O.value.left)/O.value.width,Ne=T+ee*H;se.value.scale=C;const Xe=M/se.value.scale,ve=Ne-ee*Xe;se.value.offsetX=-(ve-w)/M*O.value.width,se.value.scale<=1.01&&(se.value.scale=1,se.value.offsetX=0)}se.value.zoomTimeout=setTimeout(()=>{se.value.isZooming=!1,se.value.zoomTimeout=null},300)},Xo=t=>{if(!En.value||!Ke.value||se.value.scale<=1)return;Ue.value.show=!1;const n=t.currentTarget.getBoundingClientRect();t.clientX-n.left,t.clientY-n.top,se.value.isDragging=!0,se.value.lastMouseX=t.clientX,se.value.lastMouseY=t.clientY,t.preventDefault()},ho=()=>{se.value.isDragging=!1},Jl=()=>{!En.value||!Ke.value||(se.value.scale=1,se.value.offsetX=0,se.value.isDragging=!1,se.value.zoomTimeout&&(clearTimeout(se.value.zoomTimeout),se.value.zoomTimeout=null),se.value.isZooming=!1)},Yo=()=>!En.value||!Mt.value||!Ke.value?"default":se.value.isDragging?"grabbing":se.value.scale>1?"grab":"dss-crosshair",yo=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 a=`M ${t[0].x} ${t[0].y}`;for(let n=0;n<t.length-1;n++){const r=t[Math.max(n-1,0)],p=t[n],g=t[n+1],C=t[Math.min(n+2,t.length-1)],w=p.x+(g.x-r.x)/6*je.value,W=p.y+(g.y-r.y)/6*je.value,M=g.x-(C.x-p.x)/6*je.value,H=g.y-(C.y-p.y)/6*je.value;a+=` C ${w} ${W} ${M} ${H} ${g.x} ${g.y}`}return a},Tn=e.computed(()=>{const a=Z.value?.chart?.padding,n=typeof a=="number"?a:null,r=a&&typeof a=="object"?a:null,p=50;let g=p+(Ft.value?30:0)+60;if(wn.value){const T={left:p+40,top:p+40,right:p+40,bottom:p+40};return n!=null?{left:n,top:n,right:n,bottom:n}:r?{left:r.left??T.left,top:r.top??T.top,right:r.right??T.right,bottom:r.bottom??T.bottom}:T}if(Sn.value){const T=!P.value,ee=Hn.value,Ne=ee?Nl.value+A.value+Math.max(24,zn.value+16):0,Xe=T?12:p;let ve=0;ct.value&&(ve+=T?8:15),vt.value&&(ve+=T?6:10);const xe=tt();let Ve=Xe+(T?4:16)+(ee?Ne:0),ge=Xe+(ee?Ne:0);P.value&&K.value==="left"?Ve+=xe.legendWidth||150:P.value&&K.value==="right"&&(ge+=xe.legendWidth||150);const Oe=we.value==="semi-radial"?ee?Ne:8:ee?Ne:T?8:p+80,Le=ee?14:0,$e=Xe+ve+Le,He={left:Ve,top:$e,right:ge,bottom:Oe};return n!=null?{left:n,top:n,right:n,bottom:n}:r?{left:r.left??He.left,top:r.top??He.top,right:r.right??He.right,bottom:r.bottom??He.bottom}:He}let C=0;ct.value&&(C+=15),vt.value&&(C+=10);const w=tt();let W=p+16+(It.value?30:0),M=p+(wt.value?30:0);P.value&&K.value==="left"?W+=w.legendWidth||150:P.value&&K.value==="right"&&(M+=w.legendWidth||150),Ll.value&&(M+=44);const H={left:W,top:p+C,right:M,bottom:g};return n!=null?{left:n,top:n,right:n,bottom:n}:r?{left:r.left??H.left,top:r.top??H.top,right:r.right??H.right,bottom:r.bottom??H.bottom}:H}),O=e.computed(()=>({left:Tn.value.left,top:Tn.value.top,right:Ee.value-Tn.value.right,bottom:ie.value-Tn.value.bottom,width:Ee.value-(Tn.value.left+Tn.value.right),height:ie.value-(Tn.value.top+Tn.value.bottom)})),En=e.computed(()=>["line","area","bar"].includes(we.value)||et.value),Kn=e.computed(()=>et.value),Xl=e.computed(()=>we.value==="mini-radial"),Sn=e.computed(()=>["radial","semi-radial","mini-radial"].includes(we.value)),wn=e.computed(()=>we.value==="spider"),Yt=e.computed(()=>we.value==="bubble"),nn=e.computed(()=>Z.value?.chart?.orientation==="horizontal"&&(we.value==="bar"||Kn.value)),Gn=t=>{const{minY:a,maxY:n}=Vt.value,r=n-a||1;return O.value.left+(t-a)/r*O.value.width},Ml=t=>{const{maxX:a}=Vt.value,n=a+1,p=O.value.height/n;return O.value.top+(t+.5)*p},Pt=e.computed(()=>Sn.value?Tn.value.left+(Ee.value-Tn.value.left-Tn.value.right)/2:Ee.value/2),Dt=e.computed(()=>wn.value?ie.value/2-40:Sn.value?Tn.value.top+(ie.value-Tn.value.top-Tn.value.bottom)/2:ie.value/2),it=e.computed(()=>{if(wn.value){const t=O.value.width-80,a=O.value.height-80;return Math.min(t,a)/2}return Math.min(O.value.width,O.value.height)/2}),Zt=e.computed(()=>{const t=Z.value,a=t?.plotOptions?.radialBar?.innerRadiusRatio??t?.radialBar?.innerRadiusRatio,n=typeof a=="number"&&a>=0&&a<=1?a:.45;return it.value*n}),_l=e.computed(()=>{const t=Z.value,a=typeof F.innerSize=="number"?F.innerSize:t?.innerSize;return typeof a!="number"||a<=-100||!(Sn.value||wn.value)?1:1+a/100}),Il=e.computed(()=>{const t=_l.value;if(t===1||t<=0)return;const a=Pt.value,n=Dt.value;return`translate(${a}, ${n}) scale(${t}) translate(${-a}, ${-n})`}),Qt=e.ref(0),eo=e.computed(()=>`semi-radial-fill-clip-${F.chartId}`),bl=e.computed(()=>we.value==="semi-radial"),dl=e.computed(()=>bl.value&&nt.value&&!Hl.value),al=e.computed(()=>bl.value&&nt.value&&!Hl.value&&sn.value==="fill"),zl=e.computed(()=>{const t=dl.value?Qt.value:1,a=Pt.value,n=Dt.value,r=Zt.value,p=it.value,g=Math.PI,C=Math.PI+t*Math.PI;if(t<=0)return`M ${a} ${n} L ${a} ${n} Z`;const w=a+p*Math.cos(g),W=n+p*Math.sin(g),M=a+p*Math.cos(C),H=n+p*Math.sin(C),T=a+r*Math.cos(C),ee=n+r*Math.sin(C),Ne=a+r*Math.cos(g),Xe=n+r*Math.sin(g),ve=t>.5?1:0;return`M ${a} ${n} L ${w} ${W} A ${p} ${p} 0 ${ve} 1 ${M} ${H} L ${T} ${ee} A ${r} ${r} 0 ${ve} 1 ${Ne} ${Xe} Z`}),wl=e.computed(()=>{if(!(!bl.value||!dl.value)&&!al.value)return`url(#${eo.value})`}),Pl=t=>{if(!(!al.value||t!==0))return`url(#${eo.value})`},$l=e.ref(0),No=e.computed(()=>`radial-reveal-clip-${F.chartId}`),In=e.computed(()=>we.value==="radial"),Bo=e.computed(()=>{const t=In.value?$l.value:1,a=Pt.value,n=Dt.value,r=Math.max(it.value*1.5,Ee.value,ie.value);if(t<=0)return`M ${a} ${n} L ${a} ${n} Z`;if(t>=1){const T=a-r,ee=a+r;return`M ${T} ${n} A ${r} ${r} 0 0 1 ${ee} ${n} A ${r} ${r} 0 0 1 ${T} ${n} Z`}const p=-Math.PI/2,g=p+t*Math.PI*2,C=a+r*Math.cos(p),w=n+r*Math.sin(p),W=a+r*Math.cos(g),M=n+r*Math.sin(g),H=t>=.5?1:0;return`M ${a} ${n} L ${C} ${w} A ${r} ${r} 0 ${H} 1 ${W} ${M} Z`}),Yl=e.computed(()=>{if(wl.value)return wl.value;if(In.value)return`url(#${No.value})`});let Ol=null;const jo=()=>{if(!dl.value)return;Qt.value=0;const t=N.value,a=performance.now(),n=r=>{const p=r-a,g=Math.min(1,p/t);Qt.value=ea(B.value,g),g<1&&(Ol=requestAnimationFrame(n))};Ol=requestAnimationFrame(n)},Mo=e.computed(()=>Z.value?.bubbles?.minSize||8),to=e.computed(()=>Z.value?.bubbles?.maxSize||50),no=e.computed(()=>Z.value?.bubbles?.opacity||.7),lo=(t,a)=>{const n=[15,20,25,18,22],r=n[t%n.length]||20,p=1+Math.sin(a*.5)*.2;return Math.max(5,r*p)},Ko=t=>{const a=document.querySelector(`.dss-bubble-image-${t}`);a&&(a.style.opacity="1")},_o=t=>{const a=document.querySelector(`.dss-bubble-image-${t}`);a&&(a.style.display="none")},Qn=e.computed(()=>F.series),Jn=e.computed(()=>F.series.filter((t,a)=>!Ht.value.has(a))),ko=t=>{if(!t)return"primary";const a=t.yAxis??t.axis??t.yAxisId;return a==="secondary"||a==="right"||a===1?"secondary":"primary"},oo=t=>t?typeof t.strokeDasharray=="string"?t.strokeDasharray:Array.isArray(t.strokeDasharray)?t.strokeDasharray.join(","):t.dotted===!0?"4,4":null:null,Wn=t=>t?t.old===!0||t.comparison===!0||t.dotted===!0:!1,ao=e.computed(()=>{const a=Z.value?.spider?.comparison||{};return{fillOpacity:typeof a.fillOpacity=="number"?a.fillOpacity:0,strokeDasharray:a.strokeDasharray||"6,4",usePrimaryColor:a.usePrimaryColor!==!1,bubbleSize:typeof a.bubbleSize=="number"?a.bubbleSize:0}}),jl=(t,a)=>typeof t?.bubbles?.size=="number"?t.bubbles.size:typeof t?.bubbleSize=="number"?t.bubbleSize:a?ao.value.bubbleSize:$t.value,ml=(t,a)=>Wn(t)&&ao.value.usePrimaryColor?f(0):f(a),xl=(t,a)=>wn.value&&Wn(t)?ml(t,a):f(a),Co=e.computed(()=>Jn.value.filter(t=>ko(t)==="primary")),$o=e.computed(()=>Jn.value.filter(t=>ko(t)==="secondary")),Ll=e.computed(()=>!nn.value&&!!bt.value&&$o.value.length>0),Dn="auto",Kl=(t,a,n,r=0,p=100)=>{let g=1/0,C=-1/0;if(t.forEach(M=>{M?.data?.length&&M.data.forEach(H=>{typeof H=="number"&&Number.isFinite(H)&&(g=Math.min(g,H),C=Math.max(C,H))})}),g===1/0)return{minY:r,maxY:p};let w;if(a===Dn){const M=C-g,H=M>0?M*.1:1;w=Math.max(0,g-H)}else if(typeof a=="number")w=a;else{const M=C-g,H=M>0?M*.1:1;w=Math.max(0,g-H)}let W;if(n===Dn){const M=C-g,H=M>0?M*.1:2;W=C+H}else if(typeof n=="number")W=n;else{const M=C-g,H=M>0?M*.1:2;W=C+H}return{minY:w,maxY:W}},Vt=e.computed(()=>{if(Yt.value)return Tl();if(!Jn.value.length)return{minX:0,maxX:1,minY:0,maxY:1};let t=0;Jn.value.forEach(n=>{n.data&&n.data.length&&(t=Math.max(t,n.data.length-1))}),F.categories.length>0&&(t=Math.max(t,F.categories.length-1));const a=Kl(Co.value.length?Co.value:Jn.value,Jt.value,pt.value);return{minX:0,maxX:t,minY:a.minY,maxY:a.maxY}}),Lo=e.computed(()=>Ll.value?Kl($o.value,jt.value,kt.value,Vt.value.minY,Vt.value.maxY):{minY:Vt.value.minY,maxY:Vt.value.maxY}),Tl=()=>{if(!Jn.value.length)return{minX:0,maxX:8,minY:0,maxY:50,minSize:10,maxSize:30};let t=1/0,a=-1/0,n=1/0,r=-1/0,p=1/0,g=-1/0,C=!1;if(Jn.value.forEach((Ne,Xe)=>{Ne?.data?.length&&Ne.data.forEach((ve,xe)=>{let Ve,ge,Qe;if(typeof ve=="object"&&ve!==null&&!Array.isArray(ve))Ve=typeof ve.x=="number"?ve.x:xe,ge=typeof ve.y=="number"?ve.y:0,Qe=typeof ve.size=="number"?ve.size:20;else if(Array.isArray(ve)&&ve.length>=3)Ve=typeof ve[0]=="number"?ve[0]:xe,ge=typeof ve[1]=="number"?ve[1]:0,Qe=typeof ve[2]=="number"?ve[2]:20;else if(typeof ve=="number")Ve=xe,ge=ve,Qe=lo(Xe,xe);else return;isFinite(Ve)&&isFinite(ge)&&isFinite(Qe)&&(t=Math.min(t,Ve),a=Math.max(a,Ve),n=Math.min(n,ge),r=Math.max(r,ge),p=Math.min(p,Qe),g=Math.max(g,Qe),C=!0)})}),!C)return{minX:0,maxX:8,minY:0,maxY:50,minSize:10,maxSize:30};t===a&&(t=Math.min(t,0),a=Math.max(a,F.categories?.length-1||8)),n===r&&(n=Math.max(0,n-10),r=n+20);const w=a-t,W=r-n;let M,H,T,ee;return tn.value!==null?M=tn.value:M=t-w*.1,U.value!==null?H=U.value:H=a+w*.1,Jt.value!==null&&typeof Jt.value=="number"?T=Jt.value:T=Math.max(0,n-W*.1),pt.value!==null&&typeof pt.value=="number"?ee=pt.value:ee=r+W*.1,{minX:M,maxX:H,minY:T,maxY:ee,minSize:p,maxSize:g}},ln=t=>{if(Yt.value){const{minX:w,maxX:W}=Vt.value,M=W-w||1;return O.value.left+(t-w)/M*O.value.width}const{minX:a,maxX:n}=Vt.value,r=n-a;if(n===0||r===0)return O.value.left+O.value.width/2;const p=r/se.value.scale,g=a-se.value.offsetX/O.value.width*r,C=(t-g)/p;return O.value.left+C*O.value.width},Al=t=>{const{minY:a,maxY:n}=Vt.value,r=n-a||1;return O.value.bottom-(t-a)/r*O.value.height},bo=t=>{const{minY:a,maxY:n}=Lo.value,r=n-a||1;return O.value.bottom-(t-a)/r*O.value.height},qn=(t,a)=>Ll.value&&ko(t)==="secondary"?bo(a):Al(a),o=t=>{if(!Yt.value)return $t.value||4;const{maxSize:a}=Vt.value,n=Math.max(1,a),r=Math.min(1,Math.max(0,t/n));return Mo.value+r*(to.value-Mo.value)},l=(t,a=12,n="Arial, sans-serif")=>{if(typeof t!="string"||!t)return 0;if(typeof document>"u")return t.length*(a*.62);l.canvas||(l.canvas=document.createElement("canvas"));const r=l.canvas.getContext("2d");return r?(r.font=`${a}px ${n}`,r.measureText(t).width):t.length*(a*.62)},s=(t,a,n=12)=>{if(typeof t!="string"||typeof a!="number"||a<=0||l(t,n)<=a)return t;const r="..";if(l(r,n)>=a)return r;let g=t.length;for(;g>0;){const C=`${t.slice(0,g)}${r}`;if(l(C,n)<=a)return C;g-=1}return r},i=e.computed(()=>u.value.map(t=>({y:t.y}))),c=e.computed(()=>{if(Yt.value)return d();if(we.value==="bar"){if(nn.value){const $e=[],{minY:He,maxY:_t}=Vt.value,Ot=5,tl=_t-He||1;for(let Cn=0;Cn<=Ot;Cn++){const nl=He+tl*(Cn/Ot),zo=Gn(nl);$e.push({x:zo,y:O.value.bottom+20,text:en(Math.round(nl))})}return $e}const xe=[],{maxX:Ve}=Vt.value,ge=Ve+1,Qe=5,Le=(O.value.width-Qe*2)/ge;for(let $e=0;$e<=Ve;$e++){const He=O.value.left+Qe+($e+.5)*Le;xe.push({x:He,y:O.value.bottom+20,text:s(F.categories[$e]||$("chart.fallback.item",{number:$e+1}),Math.max(Le-8,24))})}return xe}const t=[],{minX:a,maxX:n}=Vt.value,r=tn.value!==null?tn.value:a,p=U.value!==null?U.value:n,g=p-r||1,C=g/se.value.scale,w=r-se.value.offsetX/O.value.width*g,W=w+C,M=Math.max(0,Math.floor(w-2)),H=Math.min(p,Math.ceil(W+2)),T=H-M,ee=O.value.width,Xe=Math.floor(ee/60);let ve=1;T>Xe&&(ve=Math.ceil(T/Xe));for(let xe=M;xe<=H;xe+=ve)if(xe>=0&&xe<=p){const Ve=ln(xe);Ve>=O.value.left-100&&Ve<=O.value.right+100&&t.push({x:Ve,y:O.value.bottom+20,text:F.categories[xe]||`Item ${xe+1}`})}return t}),d=()=>{const t=[],{minX:a,maxX:n}=Vt.value,r=n-a||1,p=Math.min(8,Math.max(4,Math.floor(O.value.width/80)));for(let g=0;g<=p;g++){const C=a+r*g/p,w=ln(C);if(w>=O.value.left-10&&w<=O.value.right+10){const W=Math.round(C),M=F.categories?.[W];t.push({x:w,y:O.value.bottom+20,text:M||(Number.isInteger(C)?C.toString():C.toFixed(1))})}}return t},u=e.computed(()=>{if(nn.value){const p=[],{maxX:g}=Vt.value;for(let C=0;C<=g;C++)p.push({x:O.value.left-10,y:Ml(C),text:s(F.categories[C]||`Item ${C+1}`,Math.max(O.value.left-28,40))});return p}const t=[],{minY:a,maxY:n}=Vt.value,r=5;for(let p=0;p<=r;p++){const g=a+(n-a)*(p/r),C=Math.round(g);t.push({x:O.value.left-10,y:Al(g),text:en(C)})}return t}),m=e.computed(()=>{if(!Ll.value||nn.value)return[];const t=[],{minY:a,maxY:n}=Lo.value,r=5;for(let p=0;p<=r;p++){const g=a+(n-a)*(p/r),C=Math.round(g);t.push({x:O.value.right+10,y:bo(g),text:en(C)})}return t}),f=t=>{const a=Xt.value;if(!a||a.length===0){const n=["#3B82F6","#EF4444","#10B981","#F59E0B","#8B5CF6","#F97316","#06B6D4","#84CC16"];return n[t%n.length]}return a[t%a.length]},k=t=>{if(!t||typeof t!="string")return"#3a3a3a";const a=t.trim();let n=0,r=0,p=0;const g=a.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i);if(g)n=Number(g[1])/255,r=Number(g[2])/255,p=Number(g[3])/255;else{const w=a.match(/^rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)\s*\)$/i);if(w)n=Number(w[1])/255,r=Number(w[2])/255,p=Number(w[3])/255;else{const W=a.match(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/);if(W){let M=W[1];M.length===3&&(M=M[0]+M[0]+M[1]+M[1]+M[2]+M[2]),n=parseInt(M.slice(0,2),16)/255,r=parseInt(M.slice(2,4),16)/255,p=parseInt(M.slice(4,6),16)/255}else if(typeof document<"u"){const M=document.createElement("span");M.style.color=a,M.style.display="none",document.body.appendChild(M);const H=getComputedStyle(M).color;document.body.removeChild(M);const T=H.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i);if(T)n=Number(T[1])/255,r=Number(T[2])/255,p=Number(T[3])/255;else return"#3a3a3a"}else return"#3a3a3a"}}return .2126*n+.7152*r+.0722*p>.5?"#3a3a3a":"#fafafa"},D=t=>{if(!t||typeof t!="string")return t;const a=t.trim(),n=a.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i);if(n){const g=Math.max(0,Math.floor(Number(n[1])*.65)),C=Math.max(0,Math.floor(Number(n[2])*.65)),w=Math.max(0,Math.floor(Number(n[3])*.65));return`rgb(${g}, ${C}, ${w})`}const r=a.match(/^rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)\s*\)$/i);if(r){const g=Math.max(0,Math.floor(Number(r[1])*.65)),C=Math.max(0,Math.floor(Number(r[2])*.65)),w=Math.max(0,Math.floor(Number(r[3])*.65));return`rgba(${g}, ${C}, ${w}, ${r[4]})`}const p=a.match(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/);if(p){let g=p[1];g.length===3&&(g=g[0]+g[0]+g[1]+g[1]+g[2]+g[2]);const C=Math.max(0,Math.min(255,Math.floor(parseInt(g.slice(0,2),16)*.65))),w=Math.max(0,Math.min(255,Math.floor(parseInt(g.slice(2,4),16)*.65))),W=Math.max(0,Math.min(255,Math.floor(parseInt(g.slice(4,6),16)*.65)));return`#${[C,w,W].map(M=>M.toString(16).padStart(2,"0")).join("")}`}return a},R=(t,a)=>{const r=Z.value?.stroke?.color;return r==null?D(a):typeof r=="string"?r:Array.isArray(r)&&r.length?r[t%r.length]??D(a):D(a)},S=t=>{let a=0;for(let n=1;n<t.length;n++){const r=t[n].x-t[n-1].x,p=t[n].y-t[n-1].y;a+=Math.sqrt(r*r+p*p)}return a},re=e.computed(()=>we.value==="line"||Kn.value?(Kn.value?F.series.filter(a=>(a.type||we.value)==="line"):Qn.value).map((a,n)=>{const r=F.series.findIndex(T=>T===a),p=[];let g=[];a.data.forEach((T,ee)=>{T==null?g.length>0&&(p.push([...g]),g=[]):g.push({x:nn.value?Gn(T):ln(ee),y:nn.value?Ml(ee):qn(a,T),index:ee})}),g.length>0&&p.push(g);let C="";p.forEach(T=>{if(T.length>0){let ee="";be.value?ee=yo(T):ee=`M ${T[0].x} ${T[0].y}`+T.slice(1).map(Ne=>` L ${Ne.x} ${Ne.y}`).join(""),C+=(C?" ":"")+ee}});const w=p.reduce((T,ee)=>T+S(ee),0),W=Ht.value.has(r),M=he.value===r,H=he.value!==null&&he.value!==r;return{path:C,color:f(r),strokeDasharray:oo(a),pathLength:w,seriesIndex:r,animationDelay:n*G.value,isHighlighted:M,isDimmed:H,isHidden:W}}):[]),J=e.computed(()=>{if(!(we.value==="line"||Kn.value))return[];const t=Kn.value?F.series.filter(n=>(n.type||we.value)==="line"):Qn.value,a=[];return t.forEach((n,r)=>{const p=F.series.findIndex(g=>g===n);for(let g=0;g<n.data.length-1;g++){const C=n.data[g];if(C!=null){let w=-1,W=0;for(let M=g+1;M<n.data.length;M++){const H=n.data[M];if(H==null)W++;else{w=M;break}}if(W>0&&w!==-1){const M=n.data[w],H=nn.value?Gn(C):ln(g),T=nn.value?Ml(g):qn(n,C),ee=nn.value?Gn(M):ln(w),Ne=nn.value?Ml(w):qn(n,M),Xe=Ht.value.has(p),ve=he.value===p,xe=he.value!==null&&he.value!==p;a.push({path:`M ${H} ${T} L ${ee} ${Ne}`,color:f(p),seriesIndex:p,animationDelay:r*G.value,isHighlighted:ve,isDimmed:xe,isHidden:Xe,gapSize:W}),g=w-1}}}}),a}),Pe=e.computed(()=>we.value==="line"||Kn.value?!nt.value||Hl.value||Rt.value.hasAnimated?[]:(Kn.value?F.series.filter(a=>(a.type||we.value)==="line"):Qn.value).map((a,n)=>{const r=F.series.findIndex(W=>W===a);let p="",g=null;a.data.forEach((W,M)=>{if(W!=null){const H={x:nn.value?Gn(W):ln(M),y:nn.value?Ml(M):qn(a,W)};g===null?p+=`M ${H.x} ${H.y}`:p+=` L ${H.x} ${H.y}`,g=H}else if(g!==null){const H=a.data.findIndex((T,ee)=>ee>M&&T!==null&&T!==void 0);if(H!==-1){const T={x:nn.value?Gn(a.data[H]):ln(H),y:nn.value?Ml(H):qn(a,a.data[H])};p+=` L ${T.x} ${T.y}`,g=T}}});const C=a.data.map((W,M)=>W==null?null:{x:nn.value?Gn(W):ln(M),y:nn.value?Ml(M):qn(a,W)}).filter(W=>W!==null),w=S(C);return{path:p,pathLength:w,color:f(r),strokeDasharray:oo(a),animationDelay:n*G.value,seriesIndex:r}}):[]),Be=e.computed(()=>{if(we.value!=="line")return[];const t=[];return Qn.value.forEach((a,n)=>{const r=he.value===n,p=he.value!==null&&he.value!==n,g=Ht.value.has(n);a.data.forEach((C,w)=>{C!=null&&t.push({x:ln(w),y:qn(a,C),color:f(n),value:C,label:F.categories[w]||w.toString(),seriesName:a.name,categoryIndex:w,dataIndex:w,animationDelay:(n*a.data.length+w)*(G.value/8),isHighlighted:r,isDimmed:p,isHidden:g})})}),t}),yt=e.computed(()=>{if(!Kn.value)return[];const t=[];return F.series.filter(n=>(n.type||we.value)==="line").forEach((n,r)=>{const p=F.series.findIndex(W=>W===n),g=he.value===p,C=he.value!==null&&he.value!==p,w=Ht.value.has(p);n.data.forEach((W,M)=>{W!=null&&t.push({x:ln(M),y:qn(n,W),color:f(p),value:W,label:F.categories[M]||M.toString(),seriesName:n.name,categoryIndex:M,dataIndex:M,animationDelay:(r*n.data.length+M)*(G.value/8),isHighlighted:g,isDimmed:C,isHidden:w})})}),t}),dn=e.computed(()=>{if(!Yt.value)return[];const t=[];return Qn.value.forEach((a,n)=>{if(!a?.data?.length)return;const r=he.value,p=r!==null&&r===n,g=r!==null&&r!==n,C=Ht.value.has(n);a.data.forEach((w,W)=>{let M,H,T,ee,Ne;if(typeof w=="object"&&w!==null&&!Array.isArray(w))M=typeof w.x=="number"?w.x:W,H=typeof w.y=="number"?w.y:0,T=typeof w.size=="number"?w.size:20,ee=w.label||F.categories?.[W]||`Point ${W+1}`,Ne=w.image||w.imageUrl;else if(Array.isArray(w)&&w.length>=3)M=typeof w[0]=="number"?w[0]:W,H=typeof w[1]=="number"?w[1]:0,T=typeof w[2]=="number"?w[2]:20,ee=w[3]||F.categories?.[W]||`Point ${W+1}`,Ne=w[4];else if(typeof w=="number")M=W,H=w,T=lo(n,W),ee=F.categories?.[W]||`Point ${W+1}`;else return;!isFinite(M)||!isFinite(H)||!isFinite(T)||t.push({x:ln(M),y:Al(H),radius:o(T),originalX:M,originalY:H,originalSize:T,color:f(n),seriesName:a.name||`Series ${n+1}`,label:ee,imageUrl:Ne,seriesIndex:n,dataIndex:W,categoryIndex:Math.round(M),isHighlighted:p,isDimmed:g,isHidden:C,opacity:no.value})})}),t}),mn=e.computed(()=>we.value!=="area"?[]:Qn.value.map((t,a)=>{const n=[];let r=[];if(t.data.forEach((T,ee)=>{T==null?r.length>0&&(n.push([...r]),r=[]):r.push({x:ln(ee),y:qn(t,T),index:ee})}),r.length>0&&n.push(r),n.length===0)return{linePath:"",areaPath:"",color:f(a),isHidden:Ht.value.has(a)};const p=O.value.bottom+1;let g="",C="";n.forEach((T,ee)=>{if(T.length===0)return;let Ne=`M ${T[0].x} ${T[0].y}`;be.value&&T.length>1?Ne=yo(T):T.slice(1).forEach(ve=>{Ne+=` L ${ve.x} ${ve.y}`}),g+=(g?" ":"")+Ne;let Xe=`M ${T[0].x} ${p}`;if(Xe+=` L ${T[0].x} ${T[0].y}`,be.value&&T.length>1){const ve=yo(T),xe=ve.substring(ve.indexOf("C")||ve.indexOf("Q")||ve.indexOf("L"));xe?Xe+=" "+xe:T.slice(1).forEach(Ve=>{Xe+=` L ${Ve.x} ${Ve.y}`})}else T.slice(1).forEach(ve=>{Xe+=` L ${ve.x} ${ve.y}`});Xe+=` L ${T[T.length-1].x} ${p} Z`,C+=(C?" ":"")+Xe});const w=he.value===a,W=he.value!==null&&he.value!==a,M=Ht.value.has(a),H=n.reduce((T,ee)=>T+S(ee),0);return{linePath:g,areaPath:C,color:f(a),pathLength:H,isHighlighted:w,isDimmed:W,isHidden:M}})),an=e.computed(()=>{if(!(["bar"].includes(we.value)||Kn.value))return[];const t=[],{maxX:a}=Vt.value,n=Kn.value?F.series.filter(p=>(p.type||we.value)==="bar"):Qn.value,r=n.length;if(nn.value){const p=a+1,C=O.value.height/p,w=C*(2/3),W=Math.min(4,w/r*.15),M=w-(r-1)*W,H=Math.max(4,M/r);n.forEach((T,ee)=>{const Ne=F.series.findIndex(Ve=>Ve===T),Xe=he.value===Ne,ve=he.value!==null&&he.value!==Ne,xe=Ht.value.has(Ne);T.data.forEach((Ve,ge)=>{if(Ve==null||typeof Ve!="number"||!isFinite(Ve))return;const Le=O.value.top+(ge+.5)*C-w/2+ee*(H+W),$e=O.value.left,He=Math.abs(Gn(Ve)-O.value.left);let _t="";if(be.value&&He>0){const Ot=Math.min(Tt.value,H/2,He/2);_t=[`M ${$e} ${Le}`,`L ${$e+He-Ot} ${Le}`,`Q ${$e+He} ${Le} ${$e+He} ${Le+Ot}`,`L ${$e+He} ${Le+H-Ot}`,`Q ${$e+He} ${Le+H} ${$e+He-Ot} ${Le+H}`,`L ${$e} ${Le+H}`,"Z"].join(" ")}t.push({x:$e,y:Le,width:He,height:H,color:f(r===1?ge:Ne),value:Ve,label:F.categories[ge]||ge.toString(),seriesName:T.name,animationDelay:(ee*n.length+ge)*(G.value/4),isHighlighted:Xe,isDimmed:ve,isHidden:xe,barPath:_t,isSmooth:be.value&&He>0})})})}else{const p=a+1,C=O.value.width/p,w=C*.8,W=w/r,M=W*.05,H=W-M;n.forEach((T,ee)=>{const Ne=F.series.findIndex(Ve=>Ve===T),Xe=he.value===Ne,ve=he.value!==null&&he.value!==Ne,xe=Ht.value.has(Ne);T.data.forEach((Ve,ge)=>{if(Ve==null||typeof Ve!="number"||!isFinite(Ve))return;const Le=O.value.left+(ge+.5)*C-w/2+ee*W+M/2,$e=Al(Math.max(0,Ve)),He=Math.abs(Al(0)-Al(Ve));let _t="";if(be.value&&He>0){const Ot=Math.min(Tt.value,H/2,He/2);_t=[`M ${Le} ${$e+He}`,`L ${Le} ${$e+Ot}`,`Q ${Le} ${$e} ${Le+Ot} ${$e}`,`L ${Le+H-Ot} ${$e}`,`Q ${Le+H} ${$e} ${Le+H} ${$e+Ot}`,`L ${Le+H} ${$e+He}`,"Z"].join(" ")}t.push({x:Le,y:$e,width:H,height:He,color:f(r===1?ge:Ne),value:Ve,label:F.categories[ge]||ge.toString(),seriesName:T.name,animationDelay:(ee*n.length+ge)*(G.value/4),isHighlighted:Xe,isDimmed:ve,isHidden:xe,barPath:_t,isSmooth:be.value&&He>0})})})}return t}),Ut=e.computed(()=>{if(!Sn.value)return[];const t=Qn.value.map((C,w)=>({series:C,originalIndex:w})).filter(({originalIndex:C})=>!Ht.value.has(C));if(t.length===0)return[];let a=we.value==="semi-radial"?Math.PI:-Math.PI/2;const n=we.value==="semi-radial"?Math.PI:Math.PI*2,r=[],p=(C,w,W,M,H,T)=>{const ee=C+(w-C)/2,Ne=w-C,Xe=Pt.value+Math.cos(C)*Zt.value,ve=Dt.value+Math.sin(C)*Zt.value,xe=Pt.value+Math.cos(w)*Zt.value,Ve=Dt.value+Math.sin(w)*Zt.value,ge=Pt.value+Math.cos(w)*it.value,Qe=Dt.value+Math.sin(w)*it.value,Oe=Pt.value+Math.cos(C)*it.value,Le=Dt.value+Math.sin(C)*it.value,$e=Ne>Math.PI?1:0,He=[`M ${Xe} ${ve}`,`A ${Zt.value} ${Zt.value} 0 ${$e} 1 ${xe} ${Ve}`,`L ${ge} ${Qe}`,`A ${it.value} ${it.value} 0 ${$e} 0 ${Oe} ${Le}`,"Z"].join(" "),_t=T||f(W);return{path:He,color:_t,strokeWidth:Lt.value,strokeColor:R(r.length,_t),value:H,seriesName:M,opacity:.8,isHighlighted:he.value===W,isDimmed:he.value!==null&&he.value!==W,isHidden:!1,startAngle:C,endAngle:w,midAngle:ee}};if(Xl.value){const{series:C,originalIndex:w}=t[0],W=Number(C?.data?.[0]??0),M=Number.isFinite(W)?Math.min(Math.max(W,0),100):0,H=Z.value,T=Math.min(Math.max(Number(H?.miniRadial?.minVisiblePercent??1),0),100),Ne=(M<=0?T:M)/100*n,Xe=Number(H?.miniRadial?.thresholds?.low??33),ve=Number(H?.miniRadial?.thresholds?.medium??66),xe=H?.miniRadial?.colors?.low||"#E53E3E",Ve=H?.miniRadial?.colors?.medium||"#ED8936",ge=H?.miniRadial?.colors?.high||"#38A169",Qe=M<=Xe?xe:M<=ve?Ve:ge,Oe=H?.miniRadial?.trackColor||"#E5E7EB",Le=C?.name||"Score";return r.push(p(a,a+n-.001,w+1,"Track",100,Oe)),r.push(p(a,a+Ne,w,Le,M,Qe)),r}if(t.length===1){const{series:C,originalIndex:w}=t[0],W=C.data[0]||0,M=a,H=a+n-.001,T=M+n/2,ee=Pt.value+Math.cos(M)*Zt.value,Ne=Dt.value+Math.sin(M)*Zt.value,Xe=Pt.value+Math.cos(H)*Zt.value,ve=Dt.value+Math.sin(H)*Zt.value,xe=Pt.value+Math.cos(H)*it.value,Ve=Dt.value+Math.sin(H)*it.value,ge=Pt.value+Math.cos(M)*it.value,Qe=Dt.value+Math.sin(M)*it.value,Oe=1,Le=[`M ${ee} ${Ne}`,`A ${Zt.value} ${Zt.value} 0 ${Oe} 1 ${Xe} ${ve}`,`L ${xe} ${Ve}`,`A ${it.value} ${it.value} 0 ${Oe} 0 ${ge} ${Qe}`,"Z"].join(" "),$e=f(w);return r.push({path:Le,color:$e,strokeWidth:Lt.value,strokeColor:R(0,$e),value:W,seriesName:C.name,opacity:.8,isHighlighted:he.value===w,isDimmed:!1,isHidden:!1,startAngle:M,endAngle:H,midAngle:T}),r}if(al.value&&t.length===2){const C=t[0],w=t[1],W=Math.min(100,Math.max(0,C.series.data[0]||0)),M=W/100*n;return r.push(p(a,a+M,C.originalIndex,C.series.name,W)),r.push(p(a,a+n,w.originalIndex,w.series.name,100)),r}const g=t.reduce((C,{series:w})=>C+(w.data[0]||0),0);return g===0?[]:(t.forEach(({series:C,originalIndex:w})=>{const W=C.data[0]||0,M=W/g*n,H=a,T=a+M,ee=H+M/2,Ne=Pt.value+Math.cos(H)*Zt.value,Xe=Dt.value+Math.sin(H)*Zt.value,ve=Pt.value+Math.cos(T)*Zt.value,xe=Dt.value+Math.sin(T)*Zt.value,Ve=Pt.value+Math.cos(T)*it.value,ge=Dt.value+Math.sin(T)*it.value,Qe=Pt.value+Math.cos(H)*it.value,Oe=Dt.value+Math.sin(H)*it.value,Le=M>Math.PI?1:0,$e=[`M ${Ne} ${Xe}`,`A ${Zt.value} ${Zt.value} 0 ${Le} 1 ${ve} ${xe}`,`L ${Ve} ${ge}`,`A ${it.value} ${it.value} 0 ${Le} 0 ${Qe} ${Oe}`,"Z"].join(" "),He=f(w);r.push({path:$e,color:He,strokeWidth:Lt.value,strokeColor:R(r.length,He),value:W,seriesName:C.name,opacity:.8,isHighlighted:he.value===w,isDimmed:he.value!==null&&he.value!==w,isHidden:!1,startAngle:H,endAngle:T,midAngle:ee}),a=T}),r)}),kn=e.computed(()=>{const t=Ut.value;return al.value&&t.length>=2?[{segment:t[1],originalIndex:1},{segment:t[0],originalIndex:0}]:t.map((a,n)=>({segment:a,originalIndex:n}))}),fn=e.computed(()=>{if(!Hn.value||!Sn.value)return[];const t=zn.value,a=Nl.value,n=A.value,r=z.value,p=15,g=t*1.3,C=.55,w=(T,ee)=>{const Ne=Pt.value+Math.cos(T.midAngle)*it.value,Xe=Dt.value+Math.sin(T.midAngle)*it.value,ve=Pt.value+Math.cos(T.midAngle)*(it.value+a),xe=Dt.value+Math.sin(T.midAngle)*(it.value+a),ge=ve+n*(ee?1:-1),Qe=ee?ve+p:ve-p,Oe=xe-r,Le=`${T.seriesName}: ${en(T.value)}`,$e=Le.length*t*C;return{pointerStartX:Ne,pointerStartY:Xe,pointerEndX:ve,pointerEndY:xe,horizontalEndX:ge,horizontalEndY:xe,textX:Qe,textY:Oe,text:Le,textWidth:$e,textAnchor:ee?"start":"end",isRightSide:ee,pointerLineLength:Math.hypot(ve-Ne,xe-Xe),horizontalLineLength:Math.hypot(ge-ve,0)}},W=(T,ee)=>{const Ne=Math.abs(T.textY-ee.textY)<g,Xe=T.isRightSide?T.textX:T.textX-T.textWidth,ve=T.isRightSide?T.textX+T.textWidth:T.textX,xe=ee.isRightSide?ee.textX:ee.textX-ee.textWidth,Ve=ee.isRightSide?ee.textX+ee.textWidth:ee.textX,ge=Xe<Ve&&xe<ve;return Ne&&ge},M=Ut.value.filter(T=>!T.isHidden),H=[];for(let T=0;T<M.length;T++){const ee=M[T];let Ne=Math.cos(ee.midAngle)>=0;if(T>0){const ve=H[T-1],xe=w(ee,Ne);W(ve,xe)&&(Ne=!Ne)}const Xe=w(ee,Ne);H.push({...Xe,color:ee.color,isHighlighted:ee.isHighlighted,isDimmed:ee.isDimmed})}return H}),sl=t=>{if(!t||t.isHidden)return 0;const a=t.opacity||no.value||.7;return he.value===null||he.value===void 0?a:he.value!==null?t.seriesIndex===he.value?Math.min(1,a+.1):Math.max(.5,a*.8):a},El=t=>{if(!t||t.isHidden)return 0;const a=t.radius>20?.9:.8;return he.value!==null?t.seriesIndex===he.value?Math.min(1,a+.1):a*.7:a},pl=(t,a)=>{if(t)try{if(he.value===t.seriesIndex?he.value=null:he.value=t.seriesIndex,typeof window<"u"&&window.dispatchEvent){const n=new CustomEvent("dss-bubble-click",{detail:{bubble:t,originalEvent:a,chartId:F.chartId}});window.dispatchEvent(n)}}catch(n){console.error("Error in onBubbleClick:",n)}},To=(t,a)=>{const n=[`dss-bubble-fallback-${a}`];return t.isHighlighted&&n.push("dss-bubble-highlighted"),t.isDimmed&&n.push("dss-bubble-dimmed"),t.isHidden&&n.push("dss-bubble-hidden"),n.push(`dss-bubble-series-${t.seriesIndex}`),n.join(" ")},wo=(t,a)=>{if(!t||(a.stopPropagation(),Fo.value=!0,he.value=t.seriesIndex,Ue.value.show=!1,!Re.value))return;const n=a.target.closest(".dss-custom-chart-container");if(!n)return;const r=n.getBoundingClientRect();let p=a.clientX-r.left+10,g=a.clientY-r.top-10;const C=200,w=120;p+C>Ee.value&&(p=a.clientX-r.left-C-10),g+w>r.height&&(g=a.clientY-r.top-w-10),p<0&&(p=10),g<0&&(g=10);const W=gn.value,M=Kt.value,H=W.map(T=>{const ee=M[T]||T,Ne=Ao(T,t);return Ne?{seriesName:t.seriesName,label:t.label,value:`${ee}: ${Ne}`,color:t.color}:null}).filter(Boolean);gt.value={show:!0,x:p,y:g,title:t.label||t.seriesName||"",value:"",bubbleData:H,categoryIndex:void 0,spiderAreas:[]}},Ao=(t,a)=>{let n;switch(t){case"x":n=a.originalX;break;case"y":n=a.originalY;break;case"size":n=a.originalSize;break;case"label":n=a.label;break;case"seriesName":n=a.seriesName;break;default:n=a[t]||""}const r=Ln.value[t];if(typeof r=="function")return r(n,a);if(typeof n=="number"){const p=n.toFixed(1);return Zn.value?p+Zn.value:p}return n?.toString()||""},Do=()=>{if(!Yt.value||!Ue.value.data||Ue.value.data.length===0)return"Bubbles";const t=[],a=new Set;return Ue.value.data.forEach(n=>{if(n.seriesName&&n.label){const r=`${n.seriesName} - ${n.label}`;a.has(r)||(t.push(r),a.add(r))}else n.seriesName&&(a.has(n.seriesName)||(t.push(n.seriesName),a.add(n.seriesName)))}),t.length>0?t.join(" | "):"Bubbles"},Go=(t,a)=>{t&&(Fo.value=!1,he.value=null,gt.value.show=!1,gt.value.bubbleData=[])},Ho=(t,a)=>{const n=a.target.closest(".dss-custom-chart-container");if(!n)return;const r=n.getBoundingClientRect(),p=Ul(t.categoryIndex),g=t.description||t.comment||"";let C=a.clientX-r.left+15,w=a.clientY-r.top-10;const W=200,M=g?80:50;C+W>Ee.value&&(C=a.clientX-r.left-W-15),w+M>ie.value&&(w=a.clientY-r.top-M-10),C<0&&(C=10),w<0&&(w=10),Rn.value={show:!0,x:C,y:w,categoryValue:p,description:g}},so=()=>{Rn.value.show=!1},Dl=e.computed(()=>F.categories.length||Math.max(...Jn.value.map(t=>t.data.length))),fl=e.computed(()=>{let t=0;return Jn.value.forEach(a=>{a.data.forEach(n=>{typeof n=="number"&&(t=Math.max(t,n))})}),t||100}),rl=e.computed(()=>{const t=[],a=Dl.value;for(let n=0;n<a;n++){const r=n*2*Math.PI/a-Math.PI/2,p=Pt.value+Math.cos(r)*it.value,g=Dt.value+Math.sin(r)*it.value;t.push({x:p,y:g,angle:r,index:n})}return t}),el=e.computed(()=>{const t=[],a=Dl.value;return rl.value.forEach((n,r)=>{const p=it.value+15,g=r*2*Math.PI/a-Math.PI/2,C=Pt.value+Math.cos(g)*p,w=Dt.value+Math.sin(g)*p+5;let W="middle",M="middle";Math.abs(Math.cos(g))>.5&&(W=Math.cos(g)>0?"start":"end"),Math.abs(Math.sin(g))>.5&&(M=Math.sin(g)>0?"hanging":"auto"),t.push({x:C,y:w,text:F.categories[r]||`Axis ${r+1}`,anchor:W,baseline:M})}),t}),oa=e.ref(new Set),ha=(t,a,n)=>{const r=`current-${n}`,p=oa.value.has(r),g=a.fillOpacity??Ct.value;return!p&&he.value===null?g:a.isHighlighted||p?a.isComparison?g:g+.15:a.isDimmed?g*.3:g},aa=e.computed(()=>{if(!wn.value)return[];const t=[],a=Dl.value;return Qn.value.map((r,p)=>({series:r,seriesIndex:p})).sort((r,p)=>{const g=Wn(r.series)?0:1,C=Wn(p.series)?0:1;return g-C}).forEach(({series:r,seriesIndex:p})=>{const g=Wn(r),C=[],w=[],W=[],M=he.value===p,H=he.value!==null&&he.value!==p,T=Ht.value.has(p);for(let ee=0;ee<a;ee++){const Ne=r.data[ee]||0,ve=Ne/fl.value*it.value,xe=ee*2*Math.PI/a-Math.PI/2,Ve=Pt.value+Math.cos(xe)*ve,ge=Dt.value+Math.sin(xe)*ve;C.push(`${Ve},${ge}`),w.push({x:Ve,y:ge}),W.push({x:Ve,y:ge,value:Ne,label:F.categories[ee]||`Axis ${ee+1}`,seriesName:r.name})}t.push({points:C.join(" "),polygonPoints:w,dataPoints:W,color:ml(r,p),fillOpacity:g?ao.value.fillOpacity:Ct.value,strokeDasharray:g?oo(r)||ao.value.strokeDasharray:null,pointRadius:jl(r,g),seriesName:r.name,value:`${r.name}: ${r.data.join(", ")}`,isHighlighted:M,isDimmed:H,isHidden:T,isComparison:g,seriesIndex:p})}),t}),ya=(t,a)=>{if(!a||a.length<3)return!1;let n=!1;for(let r=0,p=a.length-1;r<a.length;p=r++){const g=a[r].x,C=a[r].y,w=a[p].x,W=a[p].y;C>t.y!=W>t.y&&t.x<(w-g)*(t.y-C)/(W-C)+g&&(n=!n)}return n},ka=t=>{if(!wn.value)return;const a=t.currentTarget.closest(".dss-custom-chart-container");if(!a)return;const n=a.getBoundingClientRect(),r=_.value?.getBoundingClientRect();if(!r)return;const p=t.clientX-r.left,g=t.clientY-r.top,C=aa.value.filter(w=>w.isHidden?!1:ya({x:p,y:g},w.polygonPoints));if(C.length>0){C.length,he.value=C[0].seriesIndex;const w=t.clientX-n.left+10,W=t.clientY-n.top-10,M=C.length>1?460:260,H=70+Dl.value*20;let T=w,ee=W;T+M>Ee.value&&(T=t.clientX-n.left-M-10),ee+H>ie.value&&(ee=t.clientY-n.top-H-10),T<0&&(T=10),ee<0&&(ee=10);const Ne=C.map(Xe=>({seriesName:Xe.seriesName,color:Xe.color,points:Xe.dataPoints.map(ve=>({label:ve.label,value:en(ve.value)}))}));gt.value={show:!0,x:T,y:ee,title:"",value:"",bubbleData:[],spiderAreas:Ne}}else Sl()},Ro=e.computed(()=>{const t=Z.value;return t.logos.map((a,n)=>{const r=F.series[a.seriesIndex];if(!r||!r.data||r.data.length===0||Ht.value.has(a.seriesIndex))return null;let p,g;if(En.value){let w=-1,W=null;for(let H=r.data.length-1;H>=0;H--)if(r.data[H]!==null&&r.data[H]!==void 0){w=H,W=r.data[H];break}if(w===-1||W===null)return null;const M=r.data.map((H,T)=>H==null?null:{x:ln(T),y:qn(r,H),index:T}).filter(H=>H!==null);if(t.animations.enabled&&!Hl.value&&t.animations.type==="draw"&&t.chart.type==="line"&&(Rt.value.isAnimating||!Rt.value.hasAnimated))if(Rt.value.isAnimating){const H=Rt.value.currentFrame/Rt.value.totalFrames,T=ea(t.animations.easing,Math.min(H,1)),ee=Ba(M,T);p=ee.x+(a.offsetX||0),g=ee.y+(a.offsetY||0)}else p=M[0].x+(a.offsetX||0),g=M[0].y+(a.offsetY||0);else p=ln(w)+(a.offsetX||0),g=Al(W)+(a.offsetY||0)}else if(Sn.value||wn.value){const w=Math.PI*2/t.logos.length*n;p=Pt.value+Math.cos(w)*(it.value+30)+(a.offsetX||0),g=Dt.value+Math.sin(w)*(it.value+30)+(a.offsetY||0)}return{...a,x:p,y:g,seriesIndex:a.seriesIndex}}).filter(Boolean)}),Ca=t=>{const a=document.querySelector(`.dss-logo-fallback-${t}`),n=document.querySelector(`.dss-logo-image-${t}`);a&&(a.style.opacity="0"),n&&(n.style.opacity="1")},ba=t=>{console.warn(`Logo ${t} failed to load, keeping fallback circle`);const a=document.querySelector(`.dss-logo-image-${t}`);a&&(a.style.display="none")},Qo=t=>{Ht.value.has(t)?Ht.value.delete(t):Ht.value.add(t)},wa=e.computed(()=>{if(!gt.value.show&&!(Ze.value&&Ue.value.show&&!se.value.isZooming))return{display:"none"};let t,a;if(Ze.value&&Ue.value.show&&!se.value.isZooming){t=Ue.value.x+15,a=O.value.top;const n=Yt.value?200:150;t+n>Ee.value&&(t=Ue.value.x-n-15),t<0&&(t=10),a<10&&(a=10)}else t=gt.value.x,a=gt.value.y;return{left:t+"px",top:a+"px"}}),Wl=(t,a)=>{if(!Re.value||xo.value)return;const r=a.target.closest(".dss-custom-chart-container").getBoundingClientRect();let p=a.clientX-r.left+10,g=a.clientY-r.top-10;const C=200,w=120,W=Ee.value,M=ie.value;p+C>W&&(p=a.clientX-r.left-C-10),g+w>M&&(g=a.clientY-r.top-w-10),p<0&&(p=10),g<0&&(g=10);let H;typeof t.categoryIndex=="number"?H=t.categoryIndex:typeof t.dataIndex=="number"?H=t.dataIndex:t.label&&F.categories.includes(t.label)&&(H=F.categories.indexOf(t.label));const T=(nn.value||we.value==="bar")&&t.label?t.label:t.seriesName||t.label||"";gt.value={show:!0,x:p,y:g,title:T,value:en(t.value)||"",categoryIndex:H,spiderAreas:[]}},Jo=e.ref(!1),Fo=e.ref(!1),Sl=()=>{gt.value.show=!1,gt.value.spiderAreas=[],gt.value.bubbleData=[],Ue.value.show=!1,Jo.value||(he.value=null)},xo=e.ref(!1),Eo=(t,a)=>{xo.value=!0,gt.value.show=!1,Ue.value.show=!1;const r=a.target.closest(".dss-custom-chart-container").getBoundingClientRect();let p=a.clientX-r.left+15,g=a.clientY-r.top-10;const C=250;p+C>Ee.value&&(p=a.clientX-r.left-C-15),p<0&&(p=10),g<0&&(g=10),Wt.value={show:!0,x:p,y:g,content:t.texts,count:t.totalCount}},So=()=>{xo.value=!1,Wt.value.show=!1},Rt=e.ref({isAnimating:!1,currentFrame:0,totalFrames:0,animationId:null,hasAnimated:!1}),ea=(t,a)=>{switch(t){case"linear":return a;case"ease":return a<.5?2*a*a:-1+(4-2*a)*a;case"ease-in":return a*a;case"ease-out":return a*(2-a);case"ease-in-out":return a<.5?2*a*a:-1+(4-2*a)*a;default:return a}},Hl=e.computed(()=>De.value?window.matchMedia("(prefers-reduced-motion: reduce)").matches:!1),sa=()=>{if(!nt.value||Hl.value){Rt.value.hasAnimated=!0,In.value&&($l.value=1);return}In.value&&($l.value=0),Rt.value.isAnimating=!0,Rt.value.currentFrame=0,Rt.value.totalFrames=Math.ceil(N.value/16.67);const t=()=>{const a=Rt.value.currentFrame/Rt.value.totalFrames,n=ea(B.value,Math.min(a,1));xa(n),In.value&&($l.value=n),a<1?(Rt.value.currentFrame++,Rt.value.animationId=requestAnimationFrame(t)):Ea()};Rt.value.animationId=requestAnimationFrame(t)},xa=t=>{const a=I.value;a&&a.style.setProperty("--dss-animation-progress",t)},Ea=()=>{Rt.value.isAnimating=!1,Rt.value.hasAnimated=!0,In.value&&($l.value=1),Rt.value.animationId&&(cancelAnimationFrame(Rt.value.animationId),Rt.value.animationId=null)},ta=e.computed(()=>!Sn.value||Rt.value.hasAnimated?!0:In.value?$l.value>=1:bl.value?Qt.value>=1:!0),ra=e.computed(()=>Hn.value&&ta.value),Io=e.ref(!1);e.watch(ra,t=>{t?(Io.value=!1,e.nextTick(()=>{requestAnimationFrame(()=>{Io.value=!0})})):Io.value=!1},{immediate:!0});const Sa=e.computed(()=>{if(!nt.value||Hl.value||Rt.value.hasAnimated)return{};const t={};return t["--dss-animation-duration"]=`${N.value}ms`,t["--dss-animation-easing"]=Va(B.value),t["--dss-stagger-delay"]=`${G.value}ms`,t}),Va=t=>({linear:"linear",ease:"ease","ease-in":"ease-in","ease-out":"ease-out","ease-in-out":"ease-in-out"})[t]||"ease-out",Na=()=>{if(!nt.value||Hl.value)return"";const t=["dss-chart-animated"];return Rt.value.hasAnimated||t.push(`dss-animate-${sn.value}`),Rt.value.hasAnimated||(Sn.value&&we.value!=="semi-radial"?t.push("dss-animate-fill"):Sn.value||t.push(`dss-animate-${sn.value}`)),Rt.value.isAnimating&&t.push("dss-is-animating"),t.join(" ")};e.watch(()=>F.series,(t,a)=>{ae.value&&a&&Rt.value.hasAnimated&&(Rt.value.hasAnimated=!1,e.nextTick(()=>{setTimeout(()=>sa(),b.value)}))},{deep:!0}),e.watch(()=>se.value.isZooming,(t,a)=>{a&&!t&&setTimeout(()=>{Mn()},50)}),e.watch(()=>[se.value.scale,se.value.offsetX],()=>{!se.value.isZooming&&!se.value.isDragging&&Mn()},{flush:"post"}),e.watch([zt,qe],([t,a])=>{se.value.minScale=t,se.value.maxScale=a,(se.value.scale<t||se.value.scale>a)&&Jl()},{immediate:!0}),e.watch(()=>F.locale,t=>{t&&t!==V.value&&(V.value=t)},{immediate:!0}),e.watch(()=>ht.value.show,t=>{t?e.nextTick(()=>{document.addEventListener("click",go)}):document.removeEventListener("click",go)}),e.onMounted(()=>{he.value=null,In.value&&(!nt.value||Hl.value)&&($l.value=1),x(),I.value&&typeof ResizeObserver<"u"&&(v=new ResizeObserver(t=>{const a=t[0];!a||!a.contentRect||(Ce&&cancelAnimationFrame(Ce),Ce=requestAnimationFrame(()=>{Ce=null;const{width:n,height:r}=a.contentRect;st.value=Math.round(n),te.value=Math.round(r),pe.value&&(_e.value=pe.value.offsetHeight||ke)}))}),v.observe(I.value)),nt.value&&!Hl.value?we.value==="semi-radial"?setTimeout(()=>jo(),b.value):setTimeout(()=>sa(),b.value):(Rt.value.hasAnimated=!0,we.value==="semi-radial"&&(Qt.value=1)),document.addEventListener("mousemove",ia),document.addEventListener("mouseup",ca),document.addEventListener("click",vo)}),e.onUnmounted(()=>{Ce&&cancelAnimationFrame(Ce),v&&I.value&&(v.unobserve(I.value),v.disconnect(),v=null),Rt.value.animationId&&cancelAnimationFrame(Rt.value.animationId),Ol&&(cancelAnimationFrame(Ol),Ol=null),se.value.zoomTimeout&&clearTimeout(se.value.zoomTimeout),document.removeEventListener("mousemove",ia),document.removeEventListener("mouseup",ca),document.removeEventListener("click",vo),document.removeEventListener("click",go)});const ia=t=>{if(se.value.isDragging&&se.value.scale>1&&En.value){Ue.value.show=!1;const a=t.clientX-se.value.lastMouseX,{minX:n,maxX:r}=Vt.value,p=r-n||1,C=a*.8;se.value.offsetX+=C;const w=p/se.value.scale,W=p-w,M=0,H=-W/p*O.value.width,T=M;se.value.offsetX=Math.max(H,Math.min(T,se.value.offsetX)),se.value.lastMouseX=t.clientX,se.value.lastMouseY=t.clientY}},ca=()=>{se.value.isDragging&&(se.value.isDragging=!1,setTimeout(()=>{!se.value.isDragging&&se.value.isZooming},100))},Ba=(t,a)=>{const n=t.filter(w=>w!=null);if(!n||n.length===0)return{x:0,y:0};if(n.length===1||a<=0)return n[0];if(a>=1)return n[n.length-1];let r=0;const p=[];for(let w=1;w<n.length;w++){const W=n[w].x-n[w-1].x,M=n[w].y-n[w-1].y,H=Math.sqrt(W*W+M*M);p.push(H),r+=H}const g=r*a;let C=0;for(let w=0;w<p.length;w++){const W=C+p[w];if(g<=W){const M=(g-C)/p[w],H=n[w],T=n[w+1];return{x:H.x+(T.x-H.x)*M,y:H.y+(T.y-H.y)*M}}C=W}return n[n.length-1]};return(t,a)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{class:e.normalizeClass(["dss-custom-chart-container",[Na(),{"dss-chart-fill-width":Ae.value,"dss-chart-fill-height":We.value,"dss-chart-compact":Sn.value&&!P.value}]]),style:e.normalizeStyle({width:Ae.value?"100%":Ee.value+"px",height:Je.value,...Ae.value||We.value?{overflow:Sn.value?"visible":"hidden",maxWidth:"100%",maxHeight:"100%"}:{},...Sa.value,cursor:Yo()}),"data-chart-type":we.value,ref_key:"containerEl",ref:I,onWheel:Vo,onMousedown:Xo,onMousemove:un,onMouseup:ho,onMouseleave:Pn,onDblclick:Jl,onContextmenu:e.withModifiers(Zl,["prevent"]),onClick:e.withModifiers(Yn,["left"]),onWheelCapture:Vo},[e.createElementVNode("div",{class:"dss-chart-header",ref_key:"headerEl",ref:pe},[e.createElementVNode("div",Vs,[ct.value?(e.openBlock(),e.createElementBlock("div",Ns,e.toDisplayString(ct.value),1)):e.createCommentVNode("",!0),vt.value?(e.openBlock(),e.createElementBlock("div",Bs,e.toDisplayString(vt.value),1)):e.createCommentVNode("",!0)]),P.value&&K.value==="top"?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["dss-chart-legend",{"dss-legend-horizontal":Se.value==="horizontal","dss-legend-vertical":Se.value==="vertical","dss-legend-top":K.value==="top","dss-legend-bottom":K.value==="bottom"}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(F.series,(n,r)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-${r}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":Ht.value.has(r),"dss-legend-hovered":he.value===r,"dss-legend-dimmed":he.value!==null&&he.value!==r}]),onClick:p=>Qo(r),onMouseenter:p=>Gt(r),onMouseleave:Fl,style:e.normalizeStyle({animationDelay:`${r*100}ms`})},[e.createElementVNode("div",{class:e.normalizeClass(["dss-legend-color",{"dss-legend-color--comparison":wn.value&&Wn(n)}]),style:e.normalizeStyle({backgroundColor:wn.value&&Wn(n)?"transparent":xl(n,r),borderColor:xl(n,r)})},null,6),e.createElementVNode("span",_s,e.toDisplayString(n.name),1)],46,Ms))),128))],2)):e.createCommentVNode("",!0),P.value&&(K.value==="left"||K.value==="right")?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["dss-chart-legend-side",{"dss-legend-left":K.value==="left","dss-legend-right":K.value==="right"}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(F.series,(n,r)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-${r}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":Ht.value.has(r),"dss-legend-hovered":he.value===r,"dss-legend-dimmed":he.value!==null&&he.value!==r}]),onClick:p=>Qo(r),onMouseenter:p=>Gt(r),onMouseleave:Fl,style:e.normalizeStyle({animationDelay:`${r*100}ms`})},[e.createElementVNode("div",{class:e.normalizeClass(["dss-legend-color",{"dss-legend-color--comparison":wn.value&&Wn(n)}]),style:e.normalizeStyle({backgroundColor:wn.value&&Wn(n)?"transparent":xl(n,r),borderColor:xl(n,r)})},null,6),e.createElementVNode("span",Ls,e.toDisplayString(n.name),1)],46,$s))),128))],2)):e.createCommentVNode("",!0)],512),E.showAddMarkerButton&&St.value&&rt.value.addMarker&&(En.value||Yt.value)?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-add-marker-button",onClick:Uo,title:e.unref($)("chart.contextMenu.addMarker")},[e.createElementVNode("img",{src:Nt.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,As),a[4]||(a[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,Ts)):e.createCommentVNode("",!0),e.createElementVNode("div",Ds,[Yt.value&&ut.value?(e.openBlock(),e.createElementBlock("div",Hs,"Bubble size: "+e.toDisplayString(ut.value),1)):e.createCommentVNode("",!0),(e.openBlock(),e.createElementBlock("svg",{width:Ee.value,height:ie.value,class:"dss-chart-svg","data-smooth":be.value,"data-animated":nt.value,ref_key:"svgEl",ref:_},[e.createElementVNode("defs",null,[e.createElementVNode("clipPath",{id:X.value},[e.createElementVNode("rect",{x:0,y:O.value.top,width:Ee.value,height:O.value.height*4},null,8,Is)],8,Fs),bl.value?(e.openBlock(),e.createElementBlock("clipPath",{key:0,id:eo.value},[e.createElementVNode("path",{d:zl.value},null,8,Ps)],8,zs)):e.createCommentVNode("",!0),In.value?(e.openBlock(),e.createElementBlock("clipPath",{key:1,id:No.value},[e.createElementVNode("path",{d:Bo.value},null,8,Ws)],8,Os)):e.createCommentVNode("",!0)]),En.value||Yt.value?(e.openBlock(),e.createElementBlock("g",qs,[ye.value?(e.openBlock(),e.createElementBlock("g",{key:0,class:"dss-grid-lines","clip-path":me.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,(n,r)=>(e.openBlock(),e.createElementBlock("line",{key:`h-grid-${r}`,x1:O.value.left,x2:O.value.right,y1:n.y,y2:n.y,stroke:"#e0e0e0","stroke-width":"1","stroke-dasharray":"4,2",style:e.normalizeStyle({animationDelay:`${r*50}ms`})},null,12,Us))),128))],8,Zs)):e.createCommentVNode("",!0),e.createElementVNode("g",Xs,[e.createElementVNode("line",{x1:O.value.left,x2:O.value.right,y1:O.value.bottom,y2:O.value.bottom,stroke:"#ccc","stroke-width":"1"},null,8,Ys),e.createElementVNode("line",{x1:O.value.left,x2:O.value.left,y1:O.value.top,y2:O.value.bottom,stroke:"#ccc","stroke-width":"1"},null,8,js),Ll.value?(e.openBlock(),e.createElementBlock("line",{key:0,x1:O.value.right,x2:O.value.right,y1:O.value.top,y2:O.value.bottom,stroke:"#ccc","stroke-width":"1"},null,8,Ks)):e.createCommentVNode("",!0)]),e.createElementVNode("g",Gs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,(n,r)=>(e.openBlock(),e.createElementBlock("text",{key:`x-${r}`,x:n.x,y:n.y,"text-anchor":"middle","font-size":"12",fill:"#666",style:e.normalizeStyle({animationDelay:`${r*100}ms`})},e.toDisplayString(n.text),13,Qs))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value,(n,r)=>(e.openBlock(),e.createElementBlock("text",{key:`y-${r}`,x:n.x,y:n.y,"text-anchor":"end","font-size":"12",fill:"#666","dominant-baseline":"middle",style:e.normalizeStyle({animationDelay:`${r*80}ms`})},e.toDisplayString(n.text),13,Js))),128)),Ll.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(m.value,(n,r)=>(e.openBlock(),e.createElementBlock("text",{key:`y-secondary-${r}`,x:n.x,y:n.y,"text-anchor":"start","font-size":"12",fill:"#666","dominant-baseline":"middle",style:e.normalizeStyle({animationDelay:`${r*80}ms`})},e.toDisplayString(n.text),13,er))),128)):e.createCommentVNode("",!0),Ft.value?(e.openBlock(),e.createElementBlock("text",{key:1,x:O.value.left+O.value.width/2,y:O.value.bottom+45,"text-anchor":"middle","font-size":"14",fill:"#666"},e.toDisplayString(Ft.value),9,tr)):e.createCommentVNode("",!0),It.value?(e.openBlock(),e.createElementBlock("text",{key:2,x:15,y:O.value.top+12+O.value.height/2,"text-anchor":"middle","font-size":"14",fill:"#666",transform:`rotate(-90, 15, ${O.value.top+O.value.height/2})`},e.toDisplayString(It.value),9,nr)):e.createCommentVNode("",!0),Ll.value&&wt.value?(e.openBlock(),e.createElementBlock("text",{key:3,x:Ee.value-15,y:O.value.top+12+O.value.height/2,"text-anchor":"middle","font-size":"14",fill:"#666",transform:`rotate(90, ${Ee.value-15}, ${O.value.top+O.value.height/2})`},e.toDisplayString(wt.value),9,lr)):e.createCommentVNode("",!0)]),bn.value.length>0?(e.openBlock(),e.createElementBlock("g",or,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(bn.value,n=>(e.openBlock(),e.createElementBlock("g",{key:`flag-group-${n.categoryIndex}`},[e.createElementVNode("g",{"clip-path":me.value},[n.hasManual?(e.openBlock(),e.createElementBlock("line",{key:0,x1:n.x,x2:n.x,y1:O.value.bottom,y2:O.value.top,stroke:"#698dbe","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:r=>Eo(n,r),onMouseleave:So},null,40,sr)):e.createCommentVNode("",!0),n.hasAuto&&!n.hasManual?(e.openBlock(),e.createElementBlock("line",{key:1,x1:n.x,x2:n.x,y1:O.value.bottom,y2:O.value.top,stroke:"#a1d499","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:r=>Eo(n,r),onMouseleave:So},null,40,rr)):e.createCommentVNode("",!0),n.hasAuto&&n.hasManual?(e.openBlock(),e.createElementBlock("line",{key:2,x1:n.x,x2:n.x,y1:O.value.bottom,y2:O.value.top,stroke:"#698dbe","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:r=>Eo(n,r),onMouseleave:So},null,40,ir)):e.createCommentVNode("",!0)],8,ar),n.hasManual&&n.hasAuto?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:n.x+8,cy:Math.max(15,O.value.top-10),r:"14",fill:"#a1d499",stroke:"#fafafa","stroke-width":"2",class:"flag-count-circle",onMouseover:r=>Eo(n,r),onMouseleave:So},null,40,cr)):e.createCommentVNode("",!0),e.createElementVNode("circle",{cx:n.x,cy:Math.max(15,O.value.top-10),r:"14",fill:n.hasManual&&n.hasAuto||n.hasManual?"#698dbe":"#a1d499",stroke:"#fafafa","stroke-width":"2",class:"dss-flag-count-indicator",onMouseover:r=>Eo(n,r),onMouseleave:So},null,40,ur),e.createElementVNode("text",{x:n.x,y:Math.max(15,O.value.top-5),"text-anchor":"middle","font-size":"12","font-weight":"bold",fill:"#fafafa",class:"dss-flag-count-text","pointer-events":"none"},e.toDisplayString(n.totalCount),9,dr)]))),128))])):e.createCommentVNode("",!0),e.createElementVNode("g",{class:"dss-chart-data","clip-path":me.value},[Kn.value?(e.openBlock(),e.createElementBlock("g",pr,[e.createElementVNode("g",{class:e.normalizeClass(["dss-bar-chart",{"dss-horizontal-bars":nn.value}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(an.value,(n,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`mixed-bar-${r}`},[n.isSmooth?(e.openBlock(),e.createElementBlock("path",{key:0,d:n.barPath,stroke:"#fafafa","stroke-width":"1",class:e.normalizeClass({"dss-bar-highlighted":n.isHighlighted,"dss-bar-dimmed":n.isDimmed,"dss-bar-hidden":n.isHidden}),style:e.normalizeStyle({fill:n.color,fillOpacity:n.isDimmed?.4:1,animationDelay:`${n.animationDelay}ms`}),onMouseover:p=>Wl(n,p),onMouseleave:Sl},null,46,fr)):(e.openBlock(),e.createElementBlock("rect",{key:1,x:n.x,y:n.y,width:n.width,height:n.height,fill:n.color,stroke:"#fafafa","stroke-width":"1",class:e.normalizeClass({"dss-bar-highlighted":n.isHighlighted,"dss-bar-dimmed":n.isDimmed,"dss-bar-hidden":n.isHidden}),style:e.normalizeStyle({animationDelay:`${n.animationDelay}ms`}),onMouseover:p=>Wl(n,p),onMouseleave:Sl},null,46,vr))],64))),128))],2),e.createElementVNode("g",gr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(re.value,(n,r)=>(e.openBlock(),e.createElementBlock("path",{key:`mixed-line-${r}`,d:n.path,stroke:n.color,"stroke-width":n.isHighlighted?ze.value+2:ze.value,"stroke-dasharray":n.strokeDasharray,fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass({"dss-series-highlighted":n.isHighlighted,"dss-series-dimmed":n.isDimmed,"dss-series-hidden":n.isHidden}),style:e.normalizeStyle({"--dss-path-length":n.pathLength,animationDelay:`${n.animationDelay}ms`})},null,14,hr))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(J.value,(n,r)=>(e.openBlock(),e.createElementBlock("path",{key:`mixed-gap-connector-${r}`,d:n.path,stroke:n.color,"stroke-width":n.isHighlighted?ze.value+2:ze.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round","stroke-dasharray":"15, 10, 5, 10",opacity:n.isHighlighted?0:.5,class:e.normalizeClass({"dss-gap-connector":!0,"dss-series-dimmed":n.isDimmed,"dss-series-hidden":n.isHidden}),style:e.normalizeStyle({animationDelay:`${n.animationDelay}ms`,transition:"opacity 0.2s ease"})},null,14,yr))),128)),$t.value>0||oe.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(yt.value,(n,r)=>(e.openBlock(),e.createElementBlock("circle",{key:`mixed-point-${r}`,cx:n.x,cy:n.y,r:j(n.isHighlighted?Y(n,$t.value)+2:Y(n,$t.value)),fill:n.color,stroke:"none",class:e.normalizeClass({"dss-point-highlighted":n.isHighlighted,"dss-point-dimmed":n.isDimmed,"dss-point-hidden":n.isHidden}),style:e.normalizeStyle({animationDelay:`${n.animationDelay}ms`}),onMouseover:p=>Wl(n,p),onMouseleave:Sl},null,46,kr))),128)):e.createCommentVNode("",!0)])])):we.value==="line"?(e.openBlock(),e.createElementBlock("g",Cr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Pe.value,(n,r)=>(e.openBlock(),e.createElementBlock("path",{key:`anim-${r}`,d:n.path,stroke:n.color,"stroke-width":ze.value,"stroke-dasharray":n.strokeDasharray,fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass(["dss-line-animation-overlay",{"dss-animation-complete":Rt.value.hasAnimated}]),style:e.normalizeStyle({"--dss-path-length":n.pathLength,animationDelay:`${n.animationDelay}ms`})},null,14,br))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(re.value,(n,r)=>(e.openBlock(),e.createElementBlock("path",{key:`line-${r}`,d:n.path,stroke:n.color,"stroke-width":n.isHighlighted?ze.value+2:ze.value,"stroke-dasharray":n.strokeDasharray,fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass({"dss-series-highlighted":n.isHighlighted,"dss-series-dimmed":n.isDimmed,"dss-series-hidden":n.isHidden}),style:e.normalizeStyle({"--dss-path-length":n.pathLength,animationDelay:`${n.animationDelay}ms`})},null,14,wr))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(J.value,(n,r)=>(e.openBlock(),e.createElementBlock("path",{key:`gap-connector-${r}`,d:n.path,stroke:n.color,"stroke-width":n.isHighlighted?ze.value+2:ze.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round","stroke-dasharray":"15, 10, 5, 10",opacity:n.isHighlighted?0:.5,class:e.normalizeClass({"dss-gap-connector":!0,"dss-series-dimmed":n.isDimmed,"dss-series-hidden":n.isHidden}),style:e.normalizeStyle({animationDelay:`${n.animationDelay}ms`,transition:"opacity 0.2s ease"})},null,14,xr))),128)),$t.value>0||oe.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(Be.value,(n,r)=>(e.openBlock(),e.createElementBlock("circle",{key:`point-${r}`,cx:n.x,cy:n.y,r:j(n.isHighlighted?Y(n,$t.value)+2:Y(n,$t.value)),fill:n.color,stroke:"none",class:e.normalizeClass({"dss-point-highlighted":n.isHighlighted,"dss-point-dimmed":n.isDimmed,"dss-point-hidden":n.isHidden}),style:e.normalizeStyle({animationDelay:`${n.animationDelay}ms`}),onMouseover:p=>Wl(n,p),onMouseleave:Sl},null,46,Er))),128)):e.createCommentVNode("",!0)])):we.value==="area"?(e.openBlock(),e.createElementBlock("g",Sr,[e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(mn.value,(n,r)=>(e.openBlock(),e.createElementBlock("mask",{key:`mask-${r}`,id:`area-mask-${r}-${E.chartId}`},[e.createElementVNode("rect",{x:O.value.left-10,y:O.value.top-10,width:O.value.width+20,height:O.value.height+20,fill:"#fafafa",class:"dss-area-mask-rect",style:e.normalizeStyle({"--dss-mask-width":`${O.value.width+20}px`})},null,12,Nr)],8,Vr))),128))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(mn.value,(n,r)=>(e.openBlock(),e.createElementBlock("path",{key:`area-fill-${r}`,d:n.areaPath,fill:n.color,"fill-opacity":n.isHighlighted?de.value+.2:de.value,mask:`url(#area-mask-${r}-${E.chartId})`,class:e.normalizeClass({"dss-area-fill-smooth":!0,"dss-series-highlighted":n.isHighlighted,"dss-series-dimmed":n.isDimmed,"dss-series-hidden":n.isHidden})},null,10,Br))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(mn.value,(n,r)=>(e.openBlock(),e.createElementBlock("path",{key:`area-line-${r}`,d:n.linePath,stroke:n.color,"stroke-width":n.isHighlighted?ze.value+1:ze.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass({"dss-area-line-animated":!0,"dss-series-highlighted":n.isHighlighted,"dss-series-dimmed":n.isDimmed,"dss-series-hidden":n.isHidden}),style:e.normalizeStyle({"--dss-path-length":n.pathLength,animationDelay:`${r*G.value}ms`})},null,14,Mr))),128))])):we.value==="bar"?(e.openBlock(),e.createElementBlock("g",{key:3,class:e.normalizeClass({"dss-horizontal-bars":nn.value})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(an.value,(n,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`bar-${r}`},[n.isSmooth?(e.openBlock(),e.createElementBlock("path",{key:0,d:n.barPath,fill:n.color,stroke:"#fafafa","stroke-width":"1",class:e.normalizeClass({"dss-bar-highlighted":n.isHighlighted,"dss-bar-dimmed":n.isDimmed,"dss-bar-hidden":n.isHidden}),style:e.normalizeStyle({animationDelay:`${n.animationDelay}ms`}),onMouseover:p=>Wl(n,p),onMouseleave:Sl},null,46,_r)):(e.openBlock(),e.createElementBlock("rect",{key:1,x:n.x,y:n.y,width:n.width,height:n.height,stroke:"#fafafa","stroke-width":"1",class:e.normalizeClass({"dss-bar-highlighted":n.isHighlighted,"dss-bar-dimmed":n.isDimmed,"dss-bar-hidden":n.isHidden}),style:e.normalizeStyle({fill:n.color,fillOpacity:n.isDimmed?.4:1,animationDelay:`${n.animationDelay}ms`}),onMouseover:p=>Wl(n,p),onMouseleave:Sl},null,46,$r))],64))),128))],2)):e.createCommentVNode("",!0)],8,mr),Ze.value&&Ue.value.show&&!se.value.isZooming?(e.openBlock(),e.createElementBlock("g",{key:2,class:"dss-crosshair","clip-path":me.value},[e.createElementVNode("line",{x1:Ue.value.x,x2:Ue.value.x,y1:O.value.top,y2:O.value.bottom,stroke:xt.value,"stroke-width":"1","stroke-dasharray":"4,4",opacity:"0.8"},null,8,Tr),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ue.value.data,(n,r)=>(e.openBlock(),e.createElementBlock("circle",{key:`dss-crosshair-point-${r}`,cx:Ue.value.x,cy:n.y,r:j($t.value+2),fill:n.color,stroke:"none",opacity:"0.9"},null,8,Ar))),128))],8,Lr)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),Yt.value?(e.openBlock(),e.createElementBlock("g",Dr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(dn.value,(n,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`bubble-${r}`},[n?(e.openBlock(),e.createElementBlock("g",Hr,[e.createElementVNode("circle",{cx:n.x,cy:n.y,r:j(n.radius),fill:n.color,"fill-opacity":sl(n),stroke:n.color,"stroke-width":"1","stroke-opacity":"0.8",class:e.normalizeClass(To(n,r)),style:{cursor:"pointer",transition:"all 0.3s ease"},onMouseenter:p=>wo(n,p),onMouseleave:p=>Go(n),onClick:p=>pl(n,p)},null,42,Rr),n.imageUrl?(e.openBlock(),e.createElementBlock("image",{key:0,x:n.x-n.radius*.65,y:n.y-n.radius*.65,width:n.radius*1.3,height:n.radius*1.3,"xlink:href":n.imageUrl,class:e.normalizeClass(`dss-bubble-image-${r} ${n.isHighlighted?"dss-bubble-highlighted":""} ${n.isDimmed?"dss-bubble-dimmed":""} ${n.isHidden?"dss-bubble-hidden":""}`),"clip-path":`circle(${n.radius*.65}px at ${n.radius*.65}px ${n.radius*.65}px)`,style:e.normalizeStyle({cursor:"pointer",transition:"all 0.3s ease",opacity:El(n)}),onLoad:p=>Ko(r),onError:p=>_o(r),onMouseenter:p=>wo(n,p),onMouseleave:p=>Go(n),onClick:p=>pl(n,p)},null,46,Fr)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],64))),128))])):e.createCommentVNode("",!0),Sn.value?(e.openBlock(),e.createElementBlock("g",{key:2,class:"radial-chart",transform:Il.value},[we.value==="radial"?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:Pt.value,cy:Dt.value,r:it.value,fill:"none",stroke:"#e0e0e0","stroke-width":"1"},null,8,zr)):e.createCommentVNode("",!0),e.createElementVNode("g",{class:"dss-radial-data","data-chart-type":we.value,"clip-path":Yl.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(kn.value,(n,r)=>(e.openBlock(),e.createElementBlock("path",{key:`radial-${n.originalIndex}-${r}`,d:n.segment.path,fill:n.segment.color,"fill-opacity":n.segment.isHighlighted?(n.segment.opacity||.8)+.2:n.segment.opacity||.8,stroke:n.segment.strokeWidth?n.segment.strokeColor||n.segment.color:"none","stroke-width":n.segment.strokeWidth||0,"clip-path":Pl(n.originalIndex),class:e.normalizeClass({"dss-series-highlighted":n.segment.isHighlighted,"dss-series-dimmed":n.segment.isDimmed,"dss-series-hidden":n.segment.isHidden}),onMouseover:p=>Wl(n.segment,p),onMouseleave:Sl},null,42,Or))),128))],8,Pr),L.value&&ta.value?(e.openBlock(),e.createElementBlock("g",Wr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(vn.value,(n,r)=>e.withDirectives((e.openBlock(),e.createElementBlock("text",{key:`radial-segment-label-${r}`,x:n.x,y:n.y,"text-anchor":"middle","dominant-baseline":"middle",class:"dss-radial-segment-data-label",style:e.normalizeStyle({fill:n.contrastColor})},e.toDisplayString(n.value),13,qr)),[[e.vShow,n.show]])),128))])):e.createCommentVNode("",!0),Te.value&&(ta.value||bl.value||Xl.value)?(e.openBlock(),e.createElementBlock("text",{key:2,x:ot.value.x,y:ot.value.y,"text-anchor":"middle","dominant-baseline":"middle","font-size":dt.value,fill:at.value,class:"dss-radial-data-center"},e.toDisplayString(ft.value),9,Zr)):e.createCommentVNode("",!0),ra.value?(e.openBlock(),e.createElementBlock("g",{key:3,class:e.normalizeClass(["dss-radial-labels dss-radial-labels-initial",{"dss-radial-labels-animated":Io.value}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(fn.value,(n,r)=>(e.openBlock(),e.createElementBlock("g",{key:`radial-label-${r}`,class:e.normalizeClass(["dss-radial-label-group",{"dss-label-highlighted":n.isHighlighted,"dss-label-dimmed":n.isDimmed}]),style:e.normalizeStyle({"--label-delay":`${r*.08}s`})},[e.createElementVNode("line",{class:"dss-radial-label-line dss-radial-label-line-pointer",x1:n.pointerStartX,y1:n.pointerStartY,x2:n.pointerEndX,y2:n.pointerEndY,stroke:n.color,"stroke-width":"1.5",opacity:"0.8",style:e.normalizeStyle({"--line-length":n.pointerLineLength})},null,12,Ur),e.createElementVNode("line",{class:"dss-radial-label-line dss-radial-label-line-horizontal",x1:n.pointerEndX,y1:n.pointerEndY,x2:n.horizontalEndX,y2:n.horizontalEndY,stroke:n.color,"stroke-width":"1.5",opacity:"0.8",style:e.normalizeStyle({"--line-length":n.horizontalLineLength})},null,12,Xr),e.createElementVNode("text",{class:"dss-radial-label-text",x:n.textX,y:n.textY,"text-anchor":n.textAnchor,"font-size":zn.value,"dominant-baseline":"middle"},e.toDisplayString(n.text),9,Yr)],6))),128))],2)):e.createCommentVNode("",!0)],8,Ir)):e.createCommentVNode("",!0),wn.value?(e.openBlock(),e.createElementBlock("g",{key:3,class:"dss-spider-chart",transform:Il.value},[ye.value?(e.openBlock(),e.createElementBlock("g",Kr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ie.value,(n,r)=>(e.openBlock(),e.createElementBlock("circle",{key:`spider-grid-circle-${r}`,cx:Pt.value,cy:Dt.value,r:j(n),fill:"none",stroke:"#dedede","stroke-width":"1",style:e.normalizeStyle({animationDelay:`${r*150}ms`})},null,12,Gr))),128)),e.createElementVNode("g",Qr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ie.value,(n,r)=>(e.openBlock(),e.createElementBlock("g",{key:`spider-grid-label-group-${r}`},[e.createElementVNode("rect",{x:Pt.value-16,y:Dt.value-n-7,width:"32",height:"16",fill:"transparent",stroke:"none"},null,8,Jr),e.createElementVNode("text",{x:Pt.value,y:Dt.value-n+2,"text-anchor":"middle","dominant-baseline":"central",class:"dss-spider-grid-label",style:{fontSize:"10px",fill:"#999",fontWeight:"600"}},e.toDisplayString(Et(r)),9,ei)]))),128))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(rl.value,(n,r)=>(e.openBlock(),e.createElementBlock("line",{key:`spider-axis-${r}`,x1:Pt.value,x2:n.x,y1:Dt.value,y2:n.y,stroke:"#dedede","stroke-width":"1",style:e.normalizeStyle({animationDelay:`${r*100}ms`})},null,12,ti))),128))])):e.createCommentVNode("",!0),e.createElementVNode("g",ni,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(el.value,(n,r)=>(e.openBlock(),e.createElementBlock("text",{key:`spider-label-${r}`,x:n.x+Math.cos(r*2*Math.PI/Dl.value-Math.PI/2)*16,y:n.y+Math.sin(r*2*Math.PI/Dl.value-Math.PI/2)*16,"text-anchor":n.anchor,"dominant-baseline":n.baseline,"font-size":"14px",fill:"#666","font-weight":"500",style:e.normalizeStyle({animationDelay:`${r*120}ms`})},e.toDisplayString(n.text.charAt(0).toUpperCase()+n.text.slice(1)),13,li))),128))]),e.createElementVNode("g",{class:"dss-spider-data",onMousemove:ka,onMouseleave:Sl},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(aa.value,(n,r)=>(e.openBlock(),e.createElementBlock("g",{key:`spider-${r}`},[e.createElementVNode("polygon",{points:n.points,fill:n.color,"fill-opacity":ha("current",n,r),stroke:n.color,"stroke-width":n.isHighlighted?ze.value+1:ze.value,"stroke-dasharray":n.strokeDasharray||void 0,"stroke-linejoin":"round",class:e.normalizeClass({"dss-series-highlighted":n.isHighlighted,"dss-series-dimmed":n.isDimmed,"dss-series-hidden":n.isHidden}),style:e.normalizeStyle({animationDelay:`${r*G.value}ms`,transition:"all 0.2s ease"})},null,14,oi),n.pointRadius>0?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(n.dataPoints,(p,g)=>(e.openBlock(),e.createElementBlock("circle",{key:`spider-point-${r}-${g}`,cx:p.x,cy:p.y,r:j(n.isHighlighted?n.pointRadius+1:n.pointRadius),fill:n.isComparison?"none":n.color,stroke:n.isComparison?n.color:"none","stroke-width":n.isComparison?2:0,class:e.normalizeClass({"dss-point-highlighted":n.isHighlighted,"dss-point-dimmed":n.isDimmed,"dss-point-hidden":n.isHidden}),style:e.normalizeStyle({animationDelay:`${r*G.value+g*50}ms`,transition:"all 0.2s ease"}),onMouseover:C=>Wl(p,C),onMouseleave:Sl},null,46,ai))),128)):e.createCommentVNode("",!0)]))),128))],32)],8,jr)):e.createCommentVNode("",!0),e.createElementVNode("g",si,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ro.value,(n,r)=>(e.openBlock(),e.createElementBlock("circle",{key:`logo-fallback-${r}`,cx:n.x,cy:n.y,r:j(n.width/2),fill:f(n.seriesIndex),stroke:"#fafafa","stroke-width":"2",class:e.normalizeClass(`logo-fallback-${r}`),style:e.normalizeStyle({animationDelay:`${r*200}ms`})},null,14,ri))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ro.value,(n,r)=>(e.openBlock(),e.createElementBlock("image",{key:`logo-${r}`,x:n.x-n.width/2,y:n.y-n.height/2,width:n.width,height:n.height,"xlink:href":n.url,onLoad:p=>Ca(r),onError:p=>ba(r),preserveAspectRatio:"xMidYMid slice",class:e.normalizeClass(`dss-logo-image-${r}`),"clip-path":`circle(${n.width/2}px at ${n.width/2}px ${n.height/2}px)`,style:e.normalizeStyle({animationDelay:`${r*200}ms`})},null,46,ii))),128))])],8,Rs))]),il.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-chart-watermark",style:e.normalizeStyle({position:"absolute",top:"0px",left:"0px",width:Ee.value+"px",height:ie.value+"px",backgroundImage:`url('${Xn.value}')`,backgroundRepeat:"no-repeat",...Rl.value,opacity:_n.value,pointerEvents:"none",zIndex:10})},null,4)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(vl.value,(n,r)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{key:"marker-"+n.id,class:"dss-chart-marker",style:e.normalizeStyle({position:"absolute",left:n.x+"px",top:n.y+"px",width:Vn.value+"px",height:Vn.value+"px",backgroundColor:"#fafafa",borderRadius:"50%",border:"2px solid #ddd",cursor:"pointer",zIndex:500}),onClick:e.withModifiers(p=>y(n),["stop"]),onMouseenter:p=>Ho(n,p),onMouseleave:so},[e.createElementVNode("img",{src:cl(n),class:"dss-marker-icon",alt:"Marker Icon",style:{width:"100%",height:"100%","object-fit":"contain","border-radius":"50%","pointer-events":"none"}},null,8,ui)],44,ci)),[[e.vShow,pn.value]])),128)),Rn.value.show?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-marker-tooltip",style:e.normalizeStyle({left:Rn.value.x+"px",top:Rn.value.y+"px"})},[e.createElementVNode("div",di,e.toDisplayString(Rn.value.categoryValue),1),Rn.value.description?(e.openBlock(),e.createElementBlock("div",mi,e.toDisplayString(Rn.value.description),1)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),Re.value&&(gt.value.show||Ze.value&&Ue.value.show&&!se.value.isZooming)?(e.openBlock(),e.createElementBlock("div",{key:3,class:e.normalizeClass(["dss-chart-tooltip",{"dss-crosshair-tooltip":Ze.value&&Ue.value.show&&!se.value.isZooming,"dss-spider-tooltip":wn.value&>.value.spiderAreas&>.value.spiderAreas.length>0}]),style:e.normalizeStyle(wa.value)},[!Ze.value||!Ue.value.show||se.value.isZooming?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[wn.value&>.value.spiderAreas&>.value.spiderAreas.length>0?(e.openBlock(),e.createElementBlock("div",pi,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(gt.value.spiderAreas,(n,r)=>(e.openBlock(),e.createElementBlock("div",{key:`spider-tooltip-area-${r}`,class:"dss-spider-tooltip-area"},[e.createElementVNode("div",fi,[e.createElementVNode("span",{class:"dss-spider-tooltip-area-indicator",style:e.normalizeStyle({backgroundColor:n.color})},null,4),e.createTextVNode(" "+e.toDisplayString(n.seriesName),1)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.points,(p,g)=>(e.openBlock(),e.createElementBlock("div",{key:`spider-tooltip-point-${r}-${g}`,class:"dss-tooltip-series"},[e.createElementVNode("span",vi,e.toDisplayString(p.label),1),e.createElementVNode("span",gi,e.toDisplayString(p.value),1)]))),128))]))),128))])):Yt.value&>.value.bubbleData&>.value.bubbleData.length>0?(e.openBlock(),e.createElementBlock("div",hi,[gt.value.title?(e.openBlock(),e.createElementBlock("div",yi,e.toDisplayString(gt.value.title),1)):e.createCommentVNode("",!0),e.createElementVNode("div",ki,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(gt.value.bubbleData,(n,r)=>(e.openBlock(),e.createElementBlock("div",{key:`bubble-tooltip-${r}`,class:"dss-bubble-tooltip-item"},e.toDisplayString(n.value),1))),128))])])):(e.openBlock(),e.createElementBlock("div",Ci,[e.createElementVNode("div",bi,e.toDisplayString(gt.value.title),1),e.createElementVNode("div",wi,e.toDisplayString(gt.value.value),1)])),gt.value.categoryIndex!==void 0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[An(gt.value.categoryIndex).flagGroups.length>0?(e.openBlock(),e.createElementBlock("div",xi,[a[5]||(a[5]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",Ei,e.toDisplayString(e.unref($)("chart.tooltip.flags")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(An(gt.value.categoryIndex).flagGroups,(n,r)=>(e.openBlock(),e.createElementBlock("div",{key:`tooltip-flag-group-${r}`},[e.createElementVNode("div",Si,[e.createElementVNode("div",{class:"dss-tooltip-item-indicator",style:e.normalizeStyle({backgroundColor:n.color})},null,4),e.createElementVNode("span",null,e.toDisplayString(n.type),1)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.flags,(p,g)=>(e.openBlock(),e.createElementBlock("div",{key:`tooltip-flag-${r}-${g}`,class:"dss-tooltip-item dss-tooltip-item-no-indicator"},[e.createElementVNode("div",Vi,[e.createElementVNode("div",Ni,e.toDisplayString(p.text),1)])]))),128))]))),128))])):e.createCommentVNode("",!0),An(gt.value.categoryIndex).markers.length>0?(e.openBlock(),e.createElementBlock("div",Bi,[a[6]||(a[6]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",Mi,e.toDisplayString(e.unref($)("chart.tooltip.markers")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(An(gt.value.categoryIndex).markers,(n,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:n.color})},null,4),e.createElementVNode("div",_i,[e.createElementVNode("div",$i,e.toDisplayString(n.title),1),n.description?(e.openBlock(),e.createElementBlock("div",Li,e.toDisplayString(n.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",Ti,[e.createElementVNode("div",Ai,e.toDisplayString(Yt.value?Do():E.categories[Ue.value.categoryIndex]||`Category ${Ue.value.categoryIndex+1}`),1),Yt.value?(e.openBlock(),e.createElementBlock("div",Di,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ue.value.data,(n,r)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-tooltip-${r}`,class:"dss-bubble-tooltip-item"},e.toDisplayString(n.value),1))),128))])):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(Ue.value.data,(n,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:n.color})},null,4),e.createElementVNode("span",Hi,e.toDisplayString(n.seriesName)+":",1),e.createElementVNode("span",Ri,e.toDisplayString(en(n.value)),1)]))),128))]),An(Ue.value.categoryIndex).flagGroups.length>0?(e.openBlock(),e.createElementBlock("div",Fi,[a[7]||(a[7]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",Ii,e.toDisplayString(e.unref($)("chart.tooltip.flags")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(An(Ue.value.categoryIndex).flagGroups,(n,r)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-flag-group-${r}`},[e.createElementVNode("div",zi,[e.createElementVNode("div",{class:"dss-tooltip-item-indicator",style:e.normalizeStyle({backgroundColor:n.color})},null,4),e.createElementVNode("span",null,e.toDisplayString(n.type),1)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.flags,(p,g)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-flag-${r}-${g}`,class:"dss-tooltip-item dss-tooltip-item-no-indicator"},[e.createElementVNode("div",Pi,[e.createElementVNode("div",Oi,e.toDisplayString(p.text),1)])]))),128))]))),128))])):e.createCommentVNode("",!0),An(Ue.value.categoryIndex).markers.length>0?(e.openBlock(),e.createElementBlock("div",Wi,[a[8]||(a[8]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",qi,e.toDisplayString(e.unref($)("chart.tooltip.markers")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(An(Ue.value.categoryIndex).markers,(n,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:n.color})},null,4),e.createElementVNode("div",Zi,[e.createElementVNode("div",Ui,e.toDisplayString(n.title),1),n.description?(e.openBlock(),e.createElementBlock("div",Xi,e.toDisplayString(n.description),1)):e.createCommentVNode("",!0)])]))),128))])):e.createCommentVNode("",!0)],64))],6)):e.createCommentVNode("",!0),En.value&&Ke.value&&se.value.scale>1?(e.openBlock(),e.createElementBlock("div",{key:4,class:"dss-zoom-indicator",onClick:Jl},[a[9]||(a[9]=e.createElementVNode("span",{style:{display:"inline-block",transform:"scaleX(-1)","font-size":"14px"}},"⌕",-1)),e.createTextVNode(" "+e.toDisplayString(Math.round(se.value.scale*100))+"% "+e.toDisplayString(e.unref($)("chart.zoom.doubleClickToReset")),1)])):e.createCommentVNode("",!0)],46,Ss),P.value&&K.value==="bottom"?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["dss-chart-legend",{"dss-legend-horizontal":Se.value==="horizontal","dss-legend-vertical":Se.value==="vertical","dss-legend-bottom":!0}]),style:{display:"flex","flex-wrap":"wrap","justify-content":"center",padding:"6px 8px 0"}},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(F.series,(n,r)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-bottom-${r}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":Ht.value.has(r),"dss-legend-hovered":he.value===r,"dss-legend-dimmed":he.value!==null&&he.value!==r}]),onClick:p=>Qo(r),onMouseenter:p=>Gt(r),onMouseleave:Fl,style:e.normalizeStyle({animationDelay:`${r*100}ms`})},[e.createElementVNode("div",{class:e.normalizeClass(["dss-legend-color",{"dss-legend-color--comparison":wn.value&&Wn(n)}]),style:e.normalizeStyle({backgroundColor:wn.value&&Wn(n)?"transparent":xl(n,r),borderColor:xl(n,r)})},null,6),e.createElementVNode("span",ji,e.toDisplayString(n.name),1)],46,Yi))),128))],2)):e.createCommentVNode("",!0),ht.value.show?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-chart-context-menu",style:e.normalizeStyle({left:ht.value.x+"px",top:ht.value.y+"px"}),onClick:a[0]||(a[0]=e.withModifiers(()=>{},["stop"]))},[rt.value.addMarker?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-context-menu-item",onClick:fo},e.toDisplayString(e.unref($)("chart.contextMenu.addMarker")),1)):e.createCommentVNode("",!0),rt.value.addMarker&&(rt.value.downloadSvg||rt.value.downloadPng||rt.value.downloadCsv||At.value.length>0)?(e.openBlock(),e.createElementBlock("div",Ki)):e.createCommentVNode("",!0),rt.value.downloadSvg?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-context-menu-item",onClick:yn},e.toDisplayString(e.unref($)("chart.contextMenu.downloadSvg")),1)):e.createCommentVNode("",!0),rt.value.downloadPng?(e.openBlock(),e.createElementBlock("div",{key:3,class:"dss-context-menu-item",onClick:Fn},e.toDisplayString(e.unref($)("chart.contextMenu.downloadPng")),1)):e.createCommentVNode("",!0),rt.value.downloadCsv?(e.openBlock(),e.createElementBlock("div",{key:4,class:"dss-context-menu-item",onClick:On},e.toDisplayString(e.unref($)("chart.contextMenu.downloadCsv")),1)):e.createCommentVNode("",!0),At.value.length>0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:5},[rt.value.downloadSvg||rt.value.downloadPng||rt.value.downloadCsv?(e.openBlock(),e.createElementBlock("div",Gi)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(At.value,(n,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"custom-"+r},[n.separator?(e.openBlock(),e.createElementBlock("div",Qi)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(Bn(n)),style:e.normalizeStyle(Gl(n)),onClick:p=>Cl(n)},[n.template?(e.openBlock(),e.createElementBlock("div",{key:0,innerHTML:Bl(n),class:"dss-custom-menu-content"},null,8,ec)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[n.icon?(e.openBlock(),e.createElementBlock("span",tc,e.toDisplayString(n.icon),1)):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(n.label),1)],64))],14,Ji)],64))),128))],64)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),Fe.value.show?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-marker-modal-overlay",onClick:xn},[e.createElementVNode("div",{class:"dss-marker-modal",onClick:a[3]||(a[3]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",nc,[e.createElementVNode("h3",null,e.toDisplayString(Nn.value?e.unref($)("chart.modalMarker.viewMarker"):yl.value?e.unref($)("chart.modalMarker.editMarker"):e.unref($)("chart.contextMenu.addMarker")),1),e.createElementVNode("button",{class:"dss-modal-close-btn",onClick:xn},"×")]),e.createElementVNode("div",lc,[e.createElementVNode("div",oc,[e.createVNode(la,{id:"dss-marker-date",mode:"single",modelValue:Fe.value.date,"onUpdate:modelValue":a[1]||(a[1]=n=>Fe.value.date=n),"min-date":ol.value,"max-date":cn.value,disabled:Nn.value},null,8,["modelValue","min-date","max-date","disabled"])]),e.createElementVNode("div",ac,[e.createElementVNode("label",sc,e.toDisplayString(e.unref($)("chart.modalMarker.description")),1),Nn.value?(e.openBlock(),e.createElementBlock("div",rc,e.toDisplayString(Fe.value.description),1)):e.withDirectives((e.openBlock(),e.createElementBlock("textarea",{key:1,id:"dss-marker-description","onUpdate:modelValue":a[2]||(a[2]=n=>Fe.value.description=n),placeholder:e.unref($)("chart.modalMarker.placeholderDescription"),class:"dss-form-textarea",rows:"5"},null,8,ic)),[[e.vModelText,Fe.value.description]])])]),e.createElementVNode("div",cc,[e.createElementVNode("div",uc,[yl.value&&!Nn.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-btn dss-btn-danger",onClick:hn},e.toDisplayString(e.unref($)("chart.modalMarker.deleteMarker")),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",dc,[e.createElementVNode("button",{class:"dss-btn dss-btn-secondary",onClick:xn},e.toDisplayString(Nn.value?e.unref($)("chart.modalMarker.close"):e.unref($)("chart.modalMarker.cancel")),1),Nn.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-btn dss-btn-primary",onClick:ul,disabled:!(Fe.value.description&&Fe.value.description.length)},e.toDisplayString(yl.value?e.unref($)("chart.modalMarker.save"):e.unref($)("chart.contextMenu.addMarker")),9,mc))])])])])):e.createCommentVNode("",!0)],64))}}),vc={class:"dss-modal-title"},gc={class:"dss-modal-actions"},na={__name:"DSSModal",props:{showModal:{type:Boolean,required:!0},backDrop:{type:Boolean,default:!0},width:{type:String,default:"800px"},height:{type:String,default:"auto"},showCloseBtn:{type:Boolean,default:!0},headerType:{type:String,default:"space-between"},titleSize:{type:String,default:"24px"}},emits:["close-modal"],setup(E,{emit:ne}){const $=E,V=ne,ce=e.ref(null),I=e.ref(null),_=e.computed(()=>{const X={"max-width":$.width};return $.height!=="auto"&&(X.height=$.height,X["min-height"]="0"),X}),pe=e.computed(()=>({}));function st(){V("close-modal")}function te(){$.backDrop&&!ce.value&&V("close-modal")}function v(X){X.target.tagName==="INPUT"&&(ce.value=X.target.tagName)}function Ce(){setTimeout(()=>{ce.value=null},300)}function ke(){const X=document.body,me=document.documentElement;I.value={bodyOverflow:X.style.overflow,bodyPosition:X.style.position,bodyTop:X.style.top,bodyWidth:X.style.width,htmlOverflow:me.style.overflow,scrollY:window.scrollY},X.style.overflow="hidden",X.style.position="fixed",X.style.top=`-${I.value.scrollY}px`,X.style.width="100%",X.style.left="0",me.style.overflow="hidden"}function Q(){if(!I.value)return;const X=document.body,me=document.documentElement,{bodyOverflow:F,bodyPosition:ue,bodyTop:Me,bodyWidth:tt,htmlOverflow:mt,scrollY:Z}=I.value;X.style.overflow=F||"",X.style.position=ue||"",X.style.top=Me||"",X.style.width=tt||"",X.style.left="",me.style.overflow=mt||"",window.scrollTo(0,Z||0)}return e.watch(()=>$.showModal,X=>{if(X)ke(),document.body.classList.add("dss-modal-open"),setTimeout(()=>{const me=document.getElementById("dss-modal-backdrop");me&&(me.addEventListener("focusin",v),me.addEventListener("focusout",Ce))},100);else{Q(),document.body.classList.remove("dss-modal-open");const me=document.getElementById("dss-modal-backdrop");me&&(me.removeEventListener("focusin",v),me.removeEventListener("focusout",Ce))}},{immediate:!0}),e.onUnmounted(()=>{$.showModal&&Q()}),(X,me)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[E.showModal?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-modal-backdrop",onClick:te},[e.withDirectives(e.createElementVNode("div",{id:"dss-modal-backdrop",class:"dss-modal",style:e.normalizeStyle(_.value)},[e.createElementVNode("div",{class:"dss-modal-content",onClick:me[0]||(me[0]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:"dss-modal-header",style:e.normalizeStyle({"justify-content":E.headerType,"font-size":E.titleSize})},[e.createElementVNode("h1",vc,[e.renderSlot(X.$slots,"title",{},()=>[me[1]||(me[1]=e.createTextVNode("Default Title",-1))])]),e.renderSlot(X.$slots,"title-data"),E.showCloseBtn?(e.openBlock(),e.createElementBlock("span",{key:0,class:"dss-modal-close",onClick:st,title:"Close"},"×")):e.createCommentVNode("",!0)],4),e.createElementVNode("div",{class:"dss-modal-body",style:e.normalizeStyle(pe.value)},[e.renderSlot(X.$slots,"content",{},()=>[me[2]||(me[2]=e.createTextVNode("Default Content",-1))])],4),e.createElementVNode("div",gc,[e.renderSlot(X.$slots,"actions")])])],4),[[e.vShow,E.showModal]])])):e.createCommentVNode("",!0)]))}},hc={key:0,class:"dss-table-toolbar"},yc={class:"dss-table-toolbar-left"},kc=["aria-expanded"],Cc={class:"dss-pagination-select-dropdown",role:"listbox"},bc={class:"dss-table-column-visibility-label"},wc={class:"dss-table-checkbox-wrapper"},xc=["checked","onChange"],Ec={key:0,class:"dss-table-checkbox__check","aria-hidden":"true"},Sc={class:"dss-table-column-visibility-text"},Vc={class:"dss-table-toolbar-right"},Nc=["placeholder","aria-label"],Bc=["aria-label"],Mc=["aria-label","aria-expanded"],_c={key:1,class:"dss-table-toolbar-extra"},$c={class:"dss-table-thead"},Lc={key:0,class:"dss-table-th dss-table-selection-column"},Tc={key:0,class:"dss-table-checkbox-wrapper"},Ac=["checked","indeterminate"],Dc={key:0,class:"dss-table-checkbox__indeterminate"},Hc={key:1,class:"dss-table-checkbox__check","aria-hidden":"true"},Rc=["aria-label"],Fc=["onClick"],Ic={class:"dss-table-th-content"},zc={class:"dss-table-th-text"},Pc={key:0},Oc={key:1},Wc={key:2},qc=["data-filter-column-key","aria-expanded","aria-label","onClick"],Zc={class:"dss-table-tbody"},Uc=["onClick"],Xc={class:"dss-table-checkbox-wrapper"},Yc=["type","name","checked","disabled","onChange"],jc={key:0,class:"dss-table-checkbox__check","aria-hidden":"true"},Kc={key:1,class:"dss-table-checkbox__dot"},Gc=["onClick"],Qc=["aria-expanded","aria-label"],Jc={key:1,class:"dss-table-expansion-placeholder","aria-hidden":"true"},eu={key:0,class:"dss-table-expansion-row"},tu=["colspan"],nu=["colspan"],lu={key:1,class:"dss-table-pagination"},ou={class:"dss-table-pagination-left"},au={key:0},su={key:1,class:"dss-table-pagination-placeholder","aria-hidden":"true"},ru={class:"dss-table-pagination-center"},iu={key:0,class:"dss-pagination-controls"},cu=["disabled","title"],uu=["disabled","title"],du=["aria-label","onKeydown"],mu={class:"dss-pagination-of"},pu=["disabled","title"],fu=["disabled","title"],vu={class:"dss-table-pagination-right"},gu={class:"dss-pagination-rows-label"},hu=["aria-expanded"],yu=["aria-selected","onClick"],ku={key:0,class:"dss-table-filter-row"},Cu=["value","placeholder"],bu=["min","max","value"],wu=["min","max","value"],xu={class:"dss-table-filter-double-range-values"},Eu={key:2,class:"dss-table-filter-daterange"},Su={class:"dss-table-filter-daterange-row"},Vu={class:"dss-table-filter-daterange-label"},Nu=["value"],Bu={class:"dss-table-filter-daterange-row"},Mu={class:"dss-table-filter-daterange-label"},_u=["value"],$u=["value","placeholder"],Lu={class:"dss-table-filter-list"},Tu=["checked","onChange"],Au={class:"dss-table-filter-actions"},Du={name:"DSSTable"},Hu=Object.assign(Du,{props:{data:{type:Array,required:!0,default:()=>[]},columns:{type:Array,required:!0,default:()=>[]},tableId:{type:String,default:()=>"table-"+Math.random().toString(36).substring(2,9)},locale:{type:String,default:null},options:{type:Object,default:()=>({}),validator:E=>typeof E=="object"&&E!==null},columnVisibility:{type:Array,default:null}},emits:["row-click","row-select","row-unselect","select-all","unselect-all","row-expand","row-collapse","sort","page","download-pdf","download-excel","search","update:columnVisibility"],setup(E,{emit:ne}){const{t:$,locale:V}=co.useI18n(),ce=E,I=ne,_={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 pe(y,h){const x=Object.assign({},y);return st(y)&&st(h)&&Object.keys(h).forEach(q=>{st(h[q])?q in y?x[q]=pe(y[q],h[q]):Object.assign(x,{[q]:h[q]}):Object.assign(x,{[q]:h[q]})}),x}function st(y){return y&&typeof y=="object"&&!Array.isArray(y)}const te=e.computed(()=>pe(_,ce.options)),v=e.computed(()=>{const y=te.value.table.width;return y==="auto"?null:typeof y=="number"?y:null}),Ce=e.computed(()=>te.value.table.height),ke=e.computed(()=>te.value.table.rowHeight??"auto"),Q=e.computed(()=>({height:ke.value})),X=e.computed(()=>te.value.table.expandable===!0),me=e.computed(()=>te.value.table.expandableRowData??null),F=e.computed(()=>te.value.table.expandableRowCondition??null),ue=e.computed(()=>te.value.table.truncated===!0),Me=e.computed(()=>te.value.table.striped),tt=e.computed(()=>te.value.table.bordered),mt=e.computed(()=>te.value.table.hoverable),Z=e.computed(()=>te.value.table.size),Ae=e.computed(()=>te.value.table.align||"left");e.computed(()=>te.value.title.text),e.computed(()=>te.value.subtitle.text);const We=e.computed(()=>te.value.selection.enabled),Ee=e.computed(()=>te.value.selection.mode),_e=e.computed(()=>te.value.selection.rowCondition??null),Ye=e.computed(()=>te.value.sorting.enabled),ie=e.computed(()=>te.value.sorting.mode),Je=e.computed(()=>te.value.pagination.enabled),we=e.computed(()=>te.value.pagination.rows),et=e.computed(()=>te.value.pagination.rowsPerPageOptions),ct=e.computed(()=>te.value.pagination.showCounter!==!1),vt=e.computed(()=>te.value.pagination.showControlsGroup),ut=e.computed(()=>vt.value===!1?!1:te.value.pagination.showControls!==!1),Ft=e.computed(()=>vt.value===!1?!1:te.value.pagination.showRowsPerPage!==!1),It=e.computed(()=>Je.value&&(ct.value||ut.value||Ft.value)),bt=e.computed(()=>te.value.scrollable),wt=e.computed(()=>te.value.emptyMessage||$("table.emptyMessage")),Jt=e.computed(()=>te.value.toolbar?.downloads?.pdf!==!1),pt=e.computed(()=>te.value.toolbar?.downloads?.excel!==!1),jt=e.computed(()=>te.value.toolbar?.search!==!1),kt=e.computed(()=>Jt.value||pt.value||jt.value||tn.value),tn=e.computed(()=>te.value.toolbar?.columnVisibility!==!1),U=e.ref(""),ye=e.ref(!1),P=e.ref(null);let K=null;function Se(){ye.value?(K&&(clearTimeout(K),K=null),ye.value=!1,U.value="",I("search",""),P.value?.blur()):(ye.value=!0,K=setTimeout(()=>{K=null,P.value?.focus()},80))}function Re(){U.value||(ye.value=!1)}function Ze(){U.value="",I("search",""),P.value?.focus()}const xt=e.computed(()=>({"dss-table-striped":Me.value,"dss-table-bordered":tt.value,"dss-table-hoverable":mt.value,[`dss-table-${Z.value}`]:Z.value!=="default","dss-table-truncated":ue.value})),Ke=(y,h)=>y?.field??y?.key??h,zt=e.ref(new Set);function qe(){const y=new Set;return ce.columns.forEach((h,x)=>{h?.hidden!==!0&&y.add(Ke(h,x))}),y}function ze(){const y=new Set;return ce.columns.forEach((h,x)=>{y.add(Ke(h,x))}),y}function Lt(y){if(!Array.isArray(y))return null;const h=ze(),x=[];return y.forEach(q=>{h.has(q)&&x.push(q)}),x}function $t(){zt.value=qe()}const oe=e.computed(()=>{const y=Lt(ce.columnVisibility);return y===null?null:new Set(y)}),Y=e.computed(()=>oe.value??zt.value),j=e.computed(()=>ce.columns.filter((y,h)=>Y.value.has(Ke(y,h)))),de=y=>{const h=ce.columns.findIndex(x=>x===y);return Ke(y,h>=0?h:0)},be=(y,h)=>Y.value.has(Ke(y,h));function je(y){I("update:columnVisibility",Array.from(y))}function Tt(y,h){const x=Ke(y,h),q=new Set(Y.value);q.has(x)?q.delete(x):q.add(x),oe.value===null&&(zt.value=q),je(q)}const Xt=e.ref(null),nt=e.ref(!1);function sn(y){Xt.value&&!Xt.value.contains(y.target)&&(nt.value=!1)}const N=e.computed(()=>j.value.length+(We.value?1:0)+(X.value?1:0)),b=(y,h)=>y?.id??y?.key??h,B=e.ref(new Set),G=e.ref(null),ae=(y,h)=>B.value.has(b(y,h)),De=(y,h)=>{if(!X.value)return!1;if(typeof F.value=="function")return!!F.value(y,h);if(typeof me.value=="string"&&me.value.trim()){const x=xn(y,me.value.trim());return Array.isArray(x)?x.length>0:x&&typeof x=="object"?Object.keys(x).length>0:x!=null&&x!==""}return!0},Ct=(y,h,x)=>{if(x&&x.stopPropagation(),!De(y,h))return;const q=b(y,h),fe=new Set(B.value);fe.has(q)?(fe.delete(q),I("row-collapse",{data:y,index:h})):(fe.add(q),I("row-expand",{data:y,index:h})),B.value=fe},lt=(y,h)=>{if(!ue.value)return;const x=b(y,h);G.value!==x&&(G.value=x)},Ie=e.ref(null),Et=e.ref(0),Bt=e.ref([]),St=y=>{if(ie.value==="single")return Ie.value===y.field?Et.value:0;{const h=Bt.value.find(x=>x.field===y.field);return h?h.order:0}},rt=y=>{const h=St(y);return{"dss-sort-active":h!==0,"dss-sort-asc":h===1,"dss-sort-desc":h===-1}},At=e.ref({}),Nt=e.ref(null),rn=e.ref(null),Vn=220,Zn=e.ref(null),en=e.computed(()=>j.value.find(y=>de(y)===Nt.value)??null),pn=e.computed(()=>{if(!en.value||en.value.filter!=="range")return null;const y=en.value,h=Nt.value,{min:x,max:q}=Nl(y),fe=y.filterMin??x,Ge=y.filterMax??q,qt=_n(h),yn=qt.min??fe,Fn=qt.max??Ge,On=Ge-fe,Cl=On===0?0:(yn-fe)/On*100,fo=On===0?100:(Fn-fe)/On*100;return{rangeMin:fe,rangeMax:Ge,currentMin:yn,currentMax:Fn,minPct:Cl,maxPct:fo}}),ll=e.ref(null),vl=e.ref("max");function il(y){const h=ll.value,x=pn.value;if(!h||!x)return;const q=h.getBoundingClientRect(),Ge=(y.clientX-q.left)/q.width*100,qt=(x.minPct+x.maxPct)/2;vl.value=Ge<qt?"min":"max"}function _n(y){return At.value[y]??{}}function gl(y,h){At.value={...At.value,[y]:h}}function $n(y){const h=At.value[y];return h?h.type==="string"?!!h.value?.trim():h.type==="range"?h.min!=null||h.max!=null:h.type==="dateRange"?!!(h.from||h.to):h.type==="list"?h.selected?.length>0:!1:!1}function Vl(y){const h={...At.value};delete h[y],At.value=h,Nt.value=null,rn.value=null}function Rl(){if(!Nt.value){rn.value=null;return}const y=Zn.value;if(!y)return;const h=y.querySelector(`.dss-table-filter-trigger[data-filter-column-key="${Nt.value}"]`);if(!h)return;const x=h.getBoundingClientRect();rn.value={top:x.bottom+6,left:Math.max(8,x.right-Vn)}}const hl=e.computed(()=>{const y=String(U.value??"").trim().toLowerCase();return y?ce.data.filter(h=>j.value.some(x=>Un(ul(h,x)).some(fe=>String(fe).toLowerCase().includes(y)))):ce.data}),An=e.computed(()=>{let y=[...hl.value];const h=(U.value??"").trim().toLowerCase();return h&&(y=y.filter(x=>ce.columns.some(q=>{if(!q||!q.field)return!1;const fe=ul(x,q);return String(fe??"").toLowerCase().includes(h)}))),j.value.forEach(x=>{const q=de(x),fe=At.value[q];if(!fe)return;const Ge=x.field;if(Ge){if(fe.type==="string"&&fe.value?.trim()){const qt=fe.value.trim().toLowerCase();y=y.filter(yn=>{const Fn=ul(yn,x);return String(Fn??"").toLowerCase().includes(qt)})}else if(fe.type==="range")y=y.filter(qt=>{const yn=xn(qt,Ge),Fn=Number(yn);return!(Number.isNaN(Fn)||fe.min!=null&&Fn<fe.min||fe.max!=null&&Fn>fe.max)});else if(fe.type==="dateRange"){const qt=fe.from?new Date(fe.from).getTime():null,yn=fe.to?new Date(fe.to).getTime():null;y=y.filter(Fn=>{const On=xn(Fn,Ge),Cl=On?new Date(On).getTime():NaN;return!(Number.isNaN(Cl)||qt!=null&&Cl<qt||yn!=null&&Cl>yn)})}else if(fe.type==="list"&&fe.selected?.length){const qt=new Set(fe.selected);y=y.filter(yn=>Un(ul(yn,x)).some(On=>qt.has(On)))}}}),y});function Un(y){if(y==null)return[""];if(Array.isArray(y))return y.flatMap(Un);if(typeof y=="object"){const h=y?.label??y?.name??y?.value??y?.title;return[h!=null?String(h):String(y)]}return[String(y)]}function Xn(y){const h=new Set;return ce.data.forEach(x=>{Un(ul(x,y)).forEach(fe=>h.add(fe))}),Array.from(h).sort((x,q)=>String(x).localeCompare(String(q)))}function Hn(y,h){if(Nt.value===y){Nt.value=null,rn.value=null;return}if(Nt.value=y,h?.currentTarget){const x=h.currentTarget.getBoundingClientRect();rn.value={top:x.bottom+6,left:Math.max(8,x.right-Vn)}}else Rl()}function zn(y,h){gl(y,{type:"string",value:h})}function Nl(y){const h=y.field;if(!h)return{min:0,max:100};let x=1/0,q=-1/0;return ce.data.forEach(fe=>{const Ge=xn(fe,h),qt=Number(Ge);Number.isNaN(qt)||(x=Math.min(x,qt),q=Math.max(q,qt))}),{min:x===1/0?0:x,max:q===-1/0?100:q}}function A(y,h,x){const q={..._n(y),type:"range"},fe=x===""?null:Number(x),Ge=fe===null||Number.isNaN(fe)?null:fe;q[h]=Ge,Ge!=null&&(h==="min"&&q.max!=null&&Ge>q.max&&(q.max=Ge),h==="max"&&q.min!=null&&Ge<q.min&&(q.min=Ge)),gl(y,q)}function z(y,h,x){const q={..._n(y),type:"dateRange"};q[h]=x||"",gl(y,q)}const L=e.reactive({});function le(y,h){L[y]=h}function Te(y){const h=de(y),x=(L[h]??"").trim().toLowerCase(),q=Xn(y);return x?q.filter(fe=>String(fe).toLowerCase().includes(x)):q}function ft(y,h){return(_n(y).selected??[]).includes(h!=null?String(h):"")}function dt(y,h){const q=[..._n(y).selected??[]],fe=h!=null?String(h):"",Ge=q.indexOf(fe);Ge>=0?q.splice(Ge,1):q.push(fe),gl(y,{type:"list",selected:q})}function ot(y){Nt.value&&!y.target.closest(".dss-table-filter-wrap")&&!y.target.closest(".dss-table-filter-dropdown")&&(Nt.value=null,rn.value=null)}function at(){Rl(),Kt.value&&Ue()}const vn=y=>{if(!(y.sortable===!1||!Ye.value))if(ie.value==="single")Ie.value===y.field?Et.value=Et.value===1?-1:Et.value===-1?0:1:(Ie.value=y.field,Et.value=1),Et.value===0&&(Ie.value=null),I("sort",{field:Ie.value,order:Et.value});else{const h=Bt.value.findIndex(x=>x.field===y.field);h>=0?Bt.value[h].order===1?Bt.value[h].order=-1:Bt.value.splice(h,1):Bt.value.push({field:y.field,order:1}),I("sort",{multiSortMeta:Bt.value})}},bn=e.computed(()=>{if(!Ye.value)return An.value;let y=[...An.value];return ie.value==="single"&&Ie.value&&Et.value!==0?y.sort((h,x)=>{const q=xn(h,Ie.value),fe=xn(x,Ie.value);return q===fe?0:q==null?1:fe==null?-1:(q<fe?-1:q>fe?1:0)*Et.value}):ie.value==="multiple"&&Bt.value.length>0&&y.sort((h,x)=>{for(const q of Bt.value){const fe=xn(h,q.field),Ge=xn(x,q.field);if(fe===Ge)continue;if(fe==null)return 1;if(Ge==null)return-1;const qt=fe<Ge?-1:fe>Ge?1:0;if(qt!==0)return qt*q.order}return 0}),y}),Wt=e.ref(0),gn=e.ref(we.value),Kt=e.ref(!1),Ln=e.ref(null),Ht=e.ref(null),he=e.ref("bottom"),Mt=e.ref(null),gt=y=>{gn.value=y,Kt.value=!1,Wt.value=0,I("page",{page:0,rows:gn.value})};function Rn(y){Ln.value&&!Ln.value.contains(y.target)&&(Kt.value=!1)}function Ue(){const y=Ln.value,h=Ht.value;if(!y||!h)return;const x=y.querySelector(".dss-pagination-select-dropdown");if(!x)return;const q=h.getBoundingClientRect(),fe=x.offsetHeight||0,qt=(window.innerHeight||document.documentElement.clientHeight)-q.bottom,yn=q.top;he.value=qt<fe+8&&yn>qt?"top":"bottom",Mt.value={width:`${Math.ceil(q.width)}px`,left:`${Math.max(0,Math.round(h.offsetLeft))}px`}}const ht=e.computed(()=>bn.value.length),se=e.computed(()=>Math.ceil(ht.value/gn.value)),on=e.computed(()=>Math.max(se.value,1)),Fe=e.computed(()=>ht.value===0?0:cn.value+1),ol=e.computed(()=>yl.value),cn=e.computed(()=>Je.value?Wt.value*gn.value:0),yl=e.computed(()=>Je.value?Math.min((Wt.value+1)*gn.value,ht.value):ht.value),Nn=e.computed(()=>{if(!Je.value)return bn.value;const y=cn.value,h=yl.value;return bn.value.slice(y,h)}),Gt=e.ref(new Set),Fl=e.computed(()=>bn.value.filter((y,h)=>Gt.value.has(b(y,h)))),un=(y,h)=>{const x=_e.value;return typeof x!="function"?!0:!!x(y,h)},Pn=e.computed(()=>bn.value.map((y,h)=>({row:y,index:h})).filter(({row:y,index:h})=>un(y,h))),Zl=e.computed(()=>{const y=Pn.value;return y.length===0?!1:y.every(({row:h,index:x})=>Gt.value.has(b(h,x)))}),Yn=e.computed(()=>{const y=Pn.value;if(y.length===0)return!1;const h=y.filter(({row:x,index:q})=>Gt.value.has(b(x,q))).length;return h>0&&h<y.length}),Bl=(y,h)=>Gt.value.has(b(y,h)),Bn=()=>{if(Zl.value)Gt.value=new Set,I("unselect-all");else{const y=new Set;Pn.value.forEach(({row:h,index:x})=>y.add(b(h,x))),Gt.value=y,I("select-all",Fl.value)}},Gl=(y,h)=>{if(!un(y,h))return;const x=b(y,h),q=new Set(Gt.value),fe=q.has(x);Ee.value==="single"?fe?(q.delete(x),I("row-unselect",y)):(q.clear(),q.add(x),I("row-select",y)):fe?(q.delete(x),I("row-unselect",y)):(q.add(x),I("row-select",y)),Gt.value=q},cl=e.ref("1"),Ul=()=>{const y=Number.parseInt(String(cl.value),10);if(!Number.isFinite(y)){cl.value=String(Wt.value+1);return}const h=Math.min(on.value,Math.max(1,y));h!==Wt.value+1?kl(h-1):cl.value=String(h)},kl=y=>{y<0||y>=se.value||(Wt.value=y,I("page",{page:y,rows:gn.value}))},Ql=(y,h,x)=>{I("row-click",{data:y,index:h,originalEvent:x}),lt(y,cn.value+h)},Mn=(y,h)=>{const x=cn.value+h;return{"dss-table-row-selected":Bl(y,x),"dss-table-row-even":h%2===0,"dss-table-row-odd":h%2!==0,"dss-table-row-truncated-clickable":ue.value,"dss-table-row-truncated-expanded":G.value===b(y,x)}},ul=(y,h)=>h.field?xn(y,h.field):"",xn=(y,h)=>h.split(".").reduce((x,q)=>x&&x[q],y),hn=y=>{const h=y.align??Ae.value;return{"dss-table-sortable":y.sortable!==!1&&Ye.value,"dss-table-align-left":h==="left","dss-table-align-center":h==="center","dss-table-align-right":h==="right",[y.className]:y.className}},jn=y=>{const h={};return y.width&&(h.width=typeof y.width=="number"?`${y.width}px`:y.width),y.minWidth&&(h.minWidth=typeof y.minWidth=="number"?`${y.minWidth}px`:y.minWidth),y.maxWidth&&(h.maxWidth=typeof y.maxWidth=="number"?`${y.maxWidth}px`:y.maxWidth),h};return e.watch(()=>ce.locale,y=>{y&&y!==V.value&&(V.value=y)},{immediate:!0}),e.watch(we,y=>{gn.value=y,Wt.value=0}),e.watch(Kt,async y=>{y&&(await e.nextTick(),Ue())}),e.watch(Wt,y=>{cl.value=String(y+1)},{immediate:!0}),e.watch(U,y=>{I("search",y??"")}),e.watch(()=>ce.columns,()=>{if(oe.value===null){$t();return}const y=Lt(ce.columnVisibility)??[];y.length!==ce.columnVisibility.length&&I("update:columnVisibility",y)},{immediate:!0,deep:!0}),e.onMounted(()=>{document.addEventListener("click",Rn),document.addEventListener("click",sn),document.addEventListener("click",ot),window.addEventListener("resize",at),window.addEventListener("scroll",at,!0)}),e.onUnmounted(()=>{document.removeEventListener("click",Rn),document.removeEventListener("click",sn),document.removeEventListener("click",ot),window.removeEventListener("resize",at),window.removeEventListener("scroll",at,!0)}),(y,h)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{class:"dss-table-container",ref_key:"tableContainerRef",ref:Zn,style:e.normalizeStyle({width:v.value+"px",height:Ce.value?Ce.value+"px":"auto"})},[kt.value?(e.openBlock(),e.createElementBlock("div",hc,[e.createElementVNode("div",yc,[Jt.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-table-toolbar-btn",onClick:h[0]||(h[0]=x=>I("download-pdf"))},[h[22]||(h[22]=e.createStaticVNode('<span class="dss-table-toolbar-btn-icon" aria-hidden="true"><svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#clip0_download)"><path d="M16.59 9H15V4C15 3.45 14.55 3 14 3H10C9.45 3 9 3.45 9 4V9H7.41C6.52 9 6.07 10.08 6.7 10.71L11.29 15.3C11.68 15.69 12.31 15.69 12.7 15.3L17.29 10.71C17.92 10.08 17.48 9 16.59 9ZM5 19C5 19.55 5.45 20 6 20H18C18.55 20 19 19.55 19 19C19 18.45 18.55 18 18 18H6C5.45 18 5 18.45 5 19Z" fill="currentColor"></path></g><defs><clipPath id="clip0_download"><rect width="24" height="24" fill="white"></rect></clipPath></defs></svg></span>',1)),e.createTextVNode(" "+e.toDisplayString(e.unref($)("table.downloadPdf")),1)])):e.createCommentVNode("",!0),pt.value?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-table-toolbar-btn",onClick:h[1]||(h[1]=x=>I("download-excel"))},[h[23]||(h[23]=e.createStaticVNode('<span class="dss-table-toolbar-btn-icon" aria-hidden="true"><svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#clip0_download_excel)"><path d="M16.59 9H15V4C15 3.45 14.55 3 14 3H10C9.45 3 9 3.45 9 4V9H7.41C6.52 9 6.07 10.08 6.7 10.71L11.29 15.3C11.68 15.69 12.31 15.69 12.7 15.3L17.29 10.71C17.92 10.08 17.48 9 16.59 9ZM5 19C5 19.55 5.45 20 6 20H18C18.55 20 19 19.55 19 19C19 18.45 18.55 18 18 18H6C5.45 18 5 18.45 5 19Z" fill="currentColor"></path></g><defs><clipPath id="clip0_download_excel"><rect width="24" height="24" fill="white"></rect></clipPath></defs></svg></span>',1)),e.createTextVNode(" "+e.toDisplayString(e.unref($)("table.downloadExcel")),1)])):e.createCommentVNode("",!0),tn.value?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-table-toolbar-column-visibility",ref_key:"columnVisibilityDropdownRef",ref:Xt},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-pagination-select-trigger",{"dss-pagination-select-open":nt.value}]),onClick:h[2]||(h[2]=x=>nt.value=!nt.value),"aria-expanded":nt.value,"aria-haspopup":"listbox"},[e.createTextVNode(e.toDisplayString(e.unref($)("table.columnVisibility"))+" ",1),h[24]||(h[24]=e.createElementVNode("span",{class:"dss-pagination-select-chevron","aria-hidden":"true"},"▼",-1))],10,kc),e.createVNode(e.Transition,{name:"dss-dropdown"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("ul",Cc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(E.columns,(x,q)=>(e.openBlock(),e.createElementBlock("li",{key:Ke(x,q),role:"option",class:"dss-table-column-visibility-option",onClick:h[3]||(h[3]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("label",bc,[e.createElementVNode("span",wc,[e.createElementVNode("input",{type:"checkbox",checked:be(x,q),onChange:fe=>Tt(x,q),class:"dss-table-checkbox dss-table-checkbox--checkbox"},null,40,xc),be(x,q)?(e.openBlock(),e.createElementBlock("span",Ec,[...h[25]||(h[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",Sc,e.toDisplayString(x.header),1)])]))),128))],512),[[e.vShow,nt.value]])]),_:1})],512)):e.createCommentVNode("",!0),e.renderSlot(y.$slots,"header")]),e.createElementVNode("div",Vc,[jt.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["dss-table-toolbar-search",{"dss-table-toolbar-search--expanded":ye.value||U.value}])},[e.withDirectives(e.createElementVNode("input",{ref_key:"searchInputRef",ref:P,"onUpdate:modelValue":h[4]||(h[4]=x=>U.value=x),type:"text",class:"dss-table-toolbar-search-input",placeholder:e.unref($)("table.searchPlaceholder"),"aria-label":e.unref($)("table.searchTableAriaLabel"),onFocus:h[5]||(h[5]=x=>ye.value=!0),onBlur:Re},null,40,Nc),[[e.vModelText,U.value]]),U.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-table-toolbar-search-clear","aria-label":e.unref($)("table.clearSearchAriaLabel"),onClick:Ze},[...h[26]||(h[26]=[e.createElementVNode("span",{"aria-hidden":"true"},"×",-1)])],8,Bc)):e.createCommentVNode("",!0),e.createElementVNode("button",{type:"button",class:"dss-table-toolbar-search-trigger","aria-label":e.unref($)("table.searchAriaLabel"),"aria-expanded":ye.value||!!U.value,onMousedown:e.withModifiers(Se,["prevent"])},[...h[27]||(h[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,Mc)],2)):e.createCommentVNode("",!0),y.$slots["toolbar-extra"]?(e.openBlock(),e.createElementBlock("div",_c,[e.renderSlot(y.$slots,"toolbar-extra")])):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["dss-table-wrapper",{"dss-table-scrollable":bt.value}])},[e.createElementVNode("table",{class:e.normalizeClass(["dss-table",xt.value])},[e.createElementVNode("thead",$c,[e.createElementVNode("tr",null,[We.value?(e.openBlock(),e.createElementBlock("th",Lc,[Ee.value==="multiple"?(e.openBlock(),e.createElementBlock("span",Tc,[e.createElementVNode("input",{type:"checkbox",checked:Zl.value,indeterminate:Yn.value,onChange:Bn,class:"dss-table-checkbox dss-table-checkbox--checkbox"},null,40,Ac),Yn.value?(e.openBlock(),e.createElementBlock("span",Dc)):Zl.value?(e.openBlock(),e.createElementBlock("span",Hc,[...h[28]||(h[28]=[e.createElementVNode("svg",{viewBox:"0 0 12 12",preserveAspectRatio:"xMidYMid meet",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M4.82415 9.75587C4.46867 10.0814 3.89442 10.0814 3.53893 9.75587L0.266616 6.75952C-0.088872 6.43401 -0.088872 5.90819 0.266616 5.58268C0.622104 5.25717 1.19635 5.25717 1.55184 5.58268L4.17698 7.98644L10.4482 2.24413C10.8036 1.91862 11.3779 1.91862 11.7334 2.24413C12.0889 2.56964 12.0889 3.09546 11.7334 3.42097L4.82415 9.75587Z","stroke-width":"1.2",stroke:"currentColor",fill:"currentColor"})],-1)])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),X.value?(e.openBlock(),e.createElementBlock("th",{key:1,class:"dss-table-th dss-table-expansion-column","aria-label":e.unref($)("table.expandRowAriaLabel")},null,8,Rc)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(j.value,(x,q)=>(e.openBlock(),e.createElementBlock("th",{key:de(x),class:e.normalizeClass(["dss-table-th",hn(x)]),style:e.normalizeStyle(jn(x)),onClick:fe=>vn(x)},[e.createElementVNode("div",Ic,[e.createElementVNode("span",zc,e.toDisplayString(x.header),1),x.sortable!==!1&&Ye.value?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["dss-table-sort-icon",rt(x)])},[St(x)===0?(e.openBlock(),e.createElementBlock("span",Pc,[...h[29]||(h[29]=[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M5.413 9.06387C5.45434 9.16352 5.4652 9.27319 5.4442 9.37901C5.42321 9.48484 5.3713 9.58206 5.29505 9.65837L3.11339 11.84C3.06273 11.8907 3.00258 11.931 2.93637 11.9584C2.87016 11.9859 2.79918 12 2.72751 12C2.65583 12 2.58486 11.9859 2.51865 11.9584C2.45243 11.931 2.39228 11.8907 2.34163 11.84L0.159964 9.65837C0.0835992 9.58209 0.0315843 9.48487 0.0105038 9.37902C-0.0105768 9.27316 0.000224981 9.16343 0.0415416 9.06371C0.0828581 8.964 0.152832 8.87879 0.242604 8.81886C0.332376 8.75894 0.43791 8.72699 0.545845 8.72708H2.18209V0.545845C2.18209 0.401191 2.23955 0.262463 2.34184 0.160178C2.44413 0.0578925 2.58285 0.000429123 2.72751 0.000429123C2.87216 0.000429123 3.01089 0.0578925 3.11317 0.160178C3.21546 0.262463 3.27292 0.401191 3.27292 0.545845V8.72708H4.90917C5.01704 8.7271 5.12248 8.75911 5.21216 8.81906C5.30185 8.87901 5.37174 8.9642 5.413 9.06387ZM11.84 2.34162L9.65837 0.159963C9.60772 0.109252 9.54757 0.0690231 9.48135 0.0415755C9.41514 0.0141278 9.34417 0 9.27249 0C9.20082 0 9.12984 0.0141278 9.06363 0.0415755C8.99742 0.0690231 8.93727 0.109252 8.88661 0.159963L6.70495 2.34162C6.62858 2.4179 6.57657 2.51513 6.55549 2.62098C6.53441 2.72684 6.54521 2.83657 6.58653 2.93629C6.62784 3.036 6.69782 3.12121 6.78759 3.18114C6.87736 3.24107 6.9829 3.27301 7.09083 3.27292H8.72708V11.4542C8.72708 11.5988 8.78454 11.7375 8.88683 11.8398C8.98911 11.9421 9.12784 11.9996 9.27249 11.9996C9.41715 11.9996 9.55587 11.9421 9.65816 11.8398C9.76045 11.7375 9.81791 11.5988 9.81791 11.4542V3.27292H11.4542C11.5621 3.27301 11.6676 3.24107 11.7574 3.18114C11.8472 3.12121 11.9171 3.036 11.9585 2.93629C11.9998 2.83657 12.0106 2.72684 11.9895 2.62098C11.9684 2.51513 11.9164 2.4179 11.84 2.34162Z",fill:"#3a3a3a"})],-1)])])):St(x)===1?(e.openBlock(),e.createElementBlock("span",Oc,[...h[30]||(h[30]=[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M6 12C6.36819 12 6.66667 11.7015 6.66667 11.3333L6.66667 2.55333L8.58967 4.47098C8.84953 4.73012 9.27017 4.72983 9.52967 4.47033C9.78943 4.21057 9.78943 3.78943 9.52967 3.52967L6.70711 0.707106C6.31658 0.316582 5.68342 0.316582 5.29289 0.707107L2.47033 3.52967C2.21057 3.78943 2.21057 4.21057 2.47033 4.47033C2.72983 4.72983 3.15047 4.73012 3.41033 4.47098L5.33333 2.55333L5.33333 11.3333C5.33333 11.7015 5.63181 12 6 12Z",fill:"#7fa2cc"})],-1)])])):St(x)===-1?(e.openBlock(),e.createElementBlock("span",Wc,[...h[31]||(h[31]=[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M6 -1.74846e-07C5.63181 -1.58751e-07 5.33333 0.298476 5.33333 0.666666L5.33333 9.44667L3.41033 7.52902C3.15047 7.26988 2.72983 7.27017 2.47033 7.52967C2.21057 7.78943 2.21057 8.21057 2.47033 8.47033L5.29289 11.2929C5.68342 11.6834 6.31658 11.6834 6.70711 11.2929L9.52967 8.47033C9.78943 8.21057 9.78943 7.78943 9.52967 7.52967C9.27017 7.27017 8.84953 7.26988 8.58967 7.52902L6.66667 9.44667L6.66667 0.666667C6.66667 0.298477 6.36819 -1.9094e-07 6 -1.74846e-07Z",fill:"#7fa2cc"})],-1)])])):e.createCommentVNode("",!0)],2)):e.createCommentVNode("",!0),x.filter?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["dss-table-filter-wrap",{"dss-table-filter-wrap--open":Nt.value===de(x)}]),onClick:h[6]||(h[6]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-table-filter-trigger",{"dss-table-filter-trigger--active":$n(de(x))}]),"data-filter-column-key":de(x),"aria-expanded":Nt.value===de(x),"aria-label":e.unref($)("table.filterColumnAriaLabel"),onClick:fe=>Hn(de(x),fe)},[...h[32]||(h[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,qc)],2)):e.createCommentVNode("",!0)])],14,Fc))),128))])]),e.createElementVNode("tbody",Zc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Nn.value,(x,q)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:b(x,cn.value+q)},[e.createElementVNode("tr",{class:e.normalizeClass(["dss-table-tr",Mn(x,q)]),style:e.normalizeStyle(Q.value),onClick:fe=>Ql(x,q,fe)},[We.value?(e.openBlock(),e.createElementBlock("td",{key:0,class:"dss-table-td dss-table-selection-cell",onClick:h[7]||(h[7]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("span",Xc,[e.createElementVNode("input",{type:Ee.value==="multiple"?"checkbox":"radio",name:`dss-table-select-${E.tableId}`,checked:Bl(x,cn.value+q),disabled:!un(x,cn.value+q),onChange:fe=>Gl(x,cn.value+q),class:e.normalizeClass(["dss-table-checkbox",Ee.value==="multiple"?"dss-table-checkbox--checkbox":"dss-table-checkbox--radio",{"dss-table-checkbox--disabled":!un(x,cn.value+q)}])},null,42,Yc),Ee.value==="multiple"&&Bl(x,cn.value+q)?(e.openBlock(),e.createElementBlock("span",jc,[...h[33]||(h[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)])])):Ee.value==="single"&&Bl(x,cn.value+q)?(e.openBlock(),e.createElementBlock("span",Kc)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),X.value?(e.openBlock(),e.createElementBlock("td",{key:1,class:"dss-table-td dss-table-expansion-cell",onClick:e.withModifiers(fe=>Ct(x,cn.value+q,fe),["stop"])},[De(x,cn.value+q)?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-table-expansion-trigger","aria-expanded":ae(x,cn.value+q),"aria-label":ae(x,cn.value+q)?e.unref($)("table.collapseRowAriaLabel"):e.unref($)("table.expandRowAriaLabel")},[e.createElementVNode("span",{class:e.normalizeClass(["dss-table-expansion-icon",{"dss-table-expansion-icon--expanded":ae(x,cn.value+q)}]),"aria-hidden":"true"},[...h[34]||(h[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,Qc)):(e.openBlock(),e.createElementBlock("span",Jc))],8,Gc)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(j.value,(fe,Ge)=>(e.openBlock(),e.createElementBlock("td",{key:de(fe),class:e.normalizeClass(["dss-table-td",hn(fe)]),style:e.normalizeStyle(jn(fe))},[e.renderSlot(y.$slots,`cell-${fe.field}`,{data:x,column:fe,rowIndex:q,isExpanded:G.value===b(x,cn.value+q)},()=>[e.createTextVNode(e.toDisplayString(ul(x,fe)),1)])],6))),128))],14,Uc),X.value&&De(x,cn.value+q)&&ae(x,cn.value+q)?(e.openBlock(),e.createElementBlock("tr",eu,[e.createElementVNode("td",{colspan:N.value,class:"dss-table-expansion-content-cell"},[e.renderSlot(y.$slots,"expansion",{data:x,rowIndex:q})],8,tu)])):e.createCommentVNode("",!0)],64))),128)),Nn.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:N.value,class:"dss-table-empty-cell"},[e.renderSlot(y.$slots,"empty",{},()=>[e.createTextVNode(e.toDisplayString(wt.value),1)])],8,nu)],4))])],2)],2),It.value?(e.openBlock(),e.createElementBlock("div",lu,[e.createElementVNode("div",ou,[ct.value?(e.openBlock(),e.createElementBlock("span",au,e.toDisplayString(e.unref($)("table.showingRange",{start:Fe.value,end:ol.value,total:ht.value})),1)):(e.openBlock(),e.createElementBlock("span",su," "))]),e.createElementVNode("div",ru,[ut.value?(e.openBlock(),e.createElementBlock("div",iu,[e.createElementVNode("button",{class:"dss-pagination-btn",disabled:Wt.value===0,onClick:h[8]||(h[8]=x=>kl(0)),title:e.unref($)("table.firstPage")},[...h[35]||(h[35]=[e.createElementVNode("span",{class:"dss-pagination-double-arrow"},[e.createElementVNode("span",null,"‹"),e.createElementVNode("span",null,"‹")],-1)])],8,cu),e.createElementVNode("button",{class:"dss-pagination-btn",disabled:Wt.value===0,onClick:h[9]||(h[9]=x=>kl(Wt.value-1)),title:e.unref($)("table.previousPage")}," ‹ ",8,uu),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":h[10]||(h[10]=x=>cl.value=x),type:"text",class:"dss-pagination-page-input","aria-label":e.unref($)("table.currentPageAriaLabel"),onBlur:Ul,onKeydown:e.withKeys(e.withModifiers(Ul,["prevent"]),["enter"])},null,40,du),[[e.vModelText,cl.value]]),e.createElementVNode("span",mu,e.toDisplayString(e.unref($)("table.ofPages",{total:on.value})),1),e.createElementVNode("button",{class:"dss-pagination-btn",disabled:Wt.value>=se.value-1,onClick:h[11]||(h[11]=x=>kl(Wt.value+1)),title:e.unref($)("table.nextPage")}," › ",8,pu),e.createElementVNode("button",{class:"dss-pagination-btn",disabled:Wt.value>=se.value-1,onClick:h[12]||(h[12]=x=>kl(se.value-1)),title:e.unref($)("table.lastPage")},[...h[36]||(h[36]=[e.createElementVNode("span",{class:"dss-pagination-double-arrow"},[e.createElementVNode("span",null,"›"),e.createElementVNode("span",null,"›")],-1)])],8,fu)])):e.createCommentVNode("",!0)]),e.createElementVNode("div",vu,[Ft.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-pagination-rows-per-page",ref_key:"rowsPerPageDropdownRef",ref:Ln},[e.createElementVNode("span",gu,e.toDisplayString(e.unref($)("table.rowsPerPage"))+":",1),e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-pagination-select-trigger",{"dss-pagination-select-open":Kt.value}]),onClick:h[13]||(h[13]=x=>Kt.value=!Kt.value),"aria-expanded":Kt.value,"aria-haspopup":"listbox",ref_key:"rowsPerPageTriggerRef",ref:Ht},[e.createTextVNode(e.toDisplayString(gn.value)+" ",1),h[37]||(h[37]=e.createElementVNode("span",{class:"dss-pagination-select-chevron","aria-hidden":"true"},"▼",-1))],10,hu),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":he.value==="top"}]),style:e.normalizeStyle(Mt.value),role:"listbox"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(et.value,x=>(e.openBlock(),e.createElementBlock("li",{key:x,role:"option","aria-selected":x===gn.value,class:e.normalizeClass(["dss-pagination-select-option",{"dss-pagination-select-option--selected":x===gn.value}]),onClick:q=>gt(x)},e.toDisplayString(x),11,yu))),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(rn.value?{top:rn.value.top+"px",left:rn.value.left+"px",width:Vn+"px"}:void 0),onClick:h[21]||(h[21]=e.withModifiers(()=>{},["stop"]))},[en.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[en.value.filter==="string"?(e.openBlock(),e.createElementBlock("div",ku,[e.createElementVNode("input",{type:"text",value:_n(Nt.value).value??"",onInput:h[14]||(h[14]=x=>zn(Nt.value,x.target.value)),class:"dss-table-filter-input",placeholder:e.unref($)("table.search")},null,40,Cu)])):en.value.filter==="range"&&pn.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-table-filter-double-range",style:e.normalizeStyle({"--range-min-pct":pn.value.minPct+"%","--range-max-pct":pn.value.maxPct+"%"})},[e.createElementVNode("div",{ref_key:"doubleRangeTrackRef",ref:ll,class:"dss-table-filter-double-range-track",onMousemove:il,onMouseenter:il},[e.createElementVNode("input",{type:"range",min:pn.value.rangeMin,max:pn.value.rangeMax,value:pn.value.currentMin,onInput:h[15]||(h[15]=x=>A(Nt.value,"min",x.target.value)),class:"dss-table-filter-double-range-input dss-table-filter-double-range-input--min",style:e.normalizeStyle({zIndex:vl.value==="min"?2:1})},null,44,bu),e.createElementVNode("input",{type:"range",min:pn.value.rangeMin,max:pn.value.rangeMax,value:pn.value.currentMax,onInput:h[16]||(h[16]=x=>A(Nt.value,"max",x.target.value)),class:"dss-table-filter-double-range-input dss-table-filter-double-range-input--max",style:e.normalizeStyle({zIndex:vl.value==="max"?2:1})},null,44,wu)],544),e.createElementVNode("div",xu,e.toDisplayString(pn.value.currentMin)+" – "+e.toDisplayString(pn.value.currentMax),1)],4)):en.value.filter==="dateRange"?(e.openBlock(),e.createElementBlock("div",Eu,[e.createElementVNode("div",Su,[e.createElementVNode("label",Vu,e.toDisplayString(e.unref($)("table.filterFrom")),1),e.createElementVNode("input",{type:"date",value:_n(Nt.value).from??"",onInput:h[17]||(h[17]=x=>z(Nt.value,"from",x.target.value)),class:"dss-table-filter-input dss-table-filter-daterange-input"},null,40,Nu)]),e.createElementVNode("div",Bu,[e.createElementVNode("label",Mu,e.toDisplayString(e.unref($)("table.filterTo")),1),e.createElementVNode("input",{type:"date",value:_n(Nt.value).to??"",onInput:h[18]||(h[18]=x=>z(Nt.value,"to",x.target.value)),class:"dss-table-filter-input dss-table-filter-daterange-input"},null,40,_u)])])):en.value.filter==="list"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.createElementVNode("input",{type:"text",value:L[Nt.value]??"",onInput:h[19]||(h[19]=x=>le(Nt.value,x.target.value)),class:"dss-table-filter-input dss-table-filter-list-search",placeholder:e.unref($)("table.search")},null,40,$u),e.createElementVNode("div",Lu,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Te(en.value),x=>(e.openBlock(),e.createElementBlock("label",{key:x,class:"dss-table-filter-list-item"},[e.createElementVNode("input",{type:"checkbox",checked:ft(Nt.value,x),onChange:q=>dt(Nt.value,x)},null,40,Tu),e.createElementVNode("span",null,e.toDisplayString(x),1)]))),128))])],64)):e.createCommentVNode("",!0),e.createElementVNode("div",Au,[e.createElementVNode("button",{type:"button",class:"dss-table-filter-clear",onClick:h[20]||(h[20]=x=>Vl(Nt.value))},e.toDisplayString(e.unref($)("table.clearFilter")),1)])],64)):e.createCommentVNode("",!0)],4),[[e.vShow,Nt.value&&en.value&&rn.value]])]),_:1})]))],64))}}),Ru="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",Fu="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",Iu="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",zu="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",Pu="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",Ou="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",Wu={class:"dss-toolbar-left"},qu=["title"],Zu=["title"],Uu={class:"dss-toolbar-dropdown-wrapper"},Xu=["title"],Yu=["src"],ju=["src"],Ku=["src"],Gu=["src"],Qu=["src"],Ju=["src"],ed={key:6,width:"13",height:"14",viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"paragraph-icon"},td=["src"],nd=["src"],ld=["src"],od=["src"],ad=["src"],sd=["src"],rd=["title"],id=["title"],cd=["title"],ud=["title"],dd=["title"],md=["title"],pd=["title"],fd=["title"],vd=["title"],gd={key:2,class:"dss-toolbar-separator"},hd=["title"],yd={key:4,class:"dss-toolbar-separator"},kd={key:5,class:"dss-toolbar-dropdown-wrapper"},Cd=["title"],bd={class:"dss-toolbar-dropdown-ai"},wd={class:"dss-toolbar-right"},xd={key:0,class:"dss-toolbar-custom-group"},Ed={key:1,class:"dss-toolbar-separator"},Sd={class:"dss-link-modal-content"},Vd={class:"dss-link-modal-field"},Nd={class:"dss-link-modal-label"},Bd=["placeholder"],Md={class:"dss-link-modal-field"},_d={class:"dss-link-modal-label"},$d=["placeholder"],Ld={class:"dss-image-modal-tabs"},Td={key:0,class:"dss-image-tab-content"},Ad={class:"dss-link-modal-content"},Dd={class:"dss-link-modal-field"},Hd={key:0,class:"dss-link-modal-label"},Rd=["src"],Fd={class:"dss-link-modal-field"},Id={class:"dss-link-modal-label"},zd=["placeholder"],Pd={class:"dss-link-modal-field"},Od={class:"dss-link-modal-label"},Wd=["placeholder"],qd={class:"dss-link-modal-field"},Zd={class:"dss-link-modal-label"},Ud=["placeholder"],Xd={key:1,class:"dss-image-tab-content"},Yd={class:"dss-link-modal-content"},jd={class:"dss-link-modal-field"},Kd={class:"dss-link-modal-label"},Gd=["placeholder"],Qd={class:"dss-link-modal-field"},Jd={class:"dss-link-modal-label"},e1=["placeholder"],t1={class:"dss-link-modal-field"},n1={class:"dss-link-modal-label"},l1=["placeholder"],o1={class:"dss-link-modal-field"},a1={class:"dss-link-modal-label"},s1=["placeholder"],r1={class:"dss-text-editor-title-input-container"},i1={key:0,class:"dss-text-editor-title-preview"},c1={key:0},u1={key:1,class:"dss-text-editor-preview-placeholder"},d1=["value","placeholder","disabled"],m1={key:3,class:"dss-text-editor-title-slot dss-text-editor-slot-last"},p1={class:"dss-text-editor-description-input-container"},f1={key:0,class:"dss-text-editor-description-preview"},v1={key:0},g1={key:1,class:"dss-text-editor-preview-placeholder"},h1=["value","placeholder","disabled"],y1={key:5,class:"dss-text-editor-description-slot dss-text-editor-slot-last"},k1=["data-comment-id","onMouseenter"],C1=["onClick"],b1=["src","alt"],w1={key:1},x1=["onClick"],E1=["src","alt"],S1={key:1},V1=["data-has-second-user","onClick"],N1={class:"editor-comment-marker-count"},B1={key:7,class:"dss-text-editor-textarea-wrapper"},M1=["value","placeholder","rows","disabled"],_1={class:"dss-text-editor-footer"},$1={class:"dss-text-editor-footer-content"},L1={class:"dss-text-editor-footer-stat"},T1={class:"dss-text-editor-footer-stat"},A1={key:8,class:"dss-text-editor-content-wrapper"},D1={key:0,class:"dss-comment-overlay-body"},H1={class:"dss-comment-selection-wrapper"},R1=["innerHTML"],F1={class:"dss-comment-messages-wrapper"},I1={key:0,class:"dss-comment-avatar-wrapper"},z1={class:"dss-comment-avatar"},P1=["src","alt"],O1={key:1},W1={class:"dss-comment-header"},q1={class:"dss-comment-header-text"},Z1={class:"dss-comment-author"},U1={key:0,class:"dss-comment-date"},X1=["onClick","title"],Y1={class:"dss-comment-overlay-inner"},j1=["placeholder","onKeydown"],K1={class:"dss-text-editor-footer"},G1={class:"dss-text-editor-footer-content"},Q1={class:"dss-text-editor-footer-stat"},J1={class:"dss-text-editor-footer-stat"},em=["title"],tm=["title"],nm={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:""},lm={class:"dss-image-popup-content"},om={key:0,class:"dss-image-popup-no-alt-icon"},am=["title"],sm=["title"],rm={xmlns:"http://www.w3.org/2000/svg",version:"1.1","xmlns:xlink":"http://www.w3.org/1999/xlink",width:"512",height:"512",x:"0",y:"0",viewBox:"0 0 32 32",style:{"enable-background":"new 0 0 512 512"},"xml:space":"preserve",class:""},im={class:"dss-toolbar-left"},cm=["title"],um=["title"],dm={class:"dss-toolbar-dropdown-wrapper"},mm=["title"],pm=["src"],fm=["src"],vm=["src"],gm=["src"],hm=["src"],ym=["src"],km={key:6,width:"13",height:"14",viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"paragraph-icon"},Cm=["title"],bm=["title"],wm=["title"],xm=["title"],Em=["title"],Sm=["title"],Vm=["title"],Nm=["title"],Bm=["title"],Mm={key:2,class:"dss-toolbar-separator"},_m=["title"],$m={key:4,class:"dss-toolbar-separator"},Lm={key:5,class:"dss-toolbar-dropdown-wrapper"},Tm=["title"],Am={class:"dss-toolbar-dropdown-ai"},Dm={key:0,class:"dss-toolbar-right"},Hm={key:0,class:"dss-toolbar-separator"},Rm={key:0,class:"dss-toolbar-custom-group"},Fm={key:1,class:"dss-toolbar-separator"},Im={name:"DSSTextEditor"},zm=Object.assign(Im,{props:{modelValue:{type:String,default:""},title:{type:String,default:""},description:{type:String,default:""},titlePlaceholder:{type:String,default:null},descriptionPlaceholder:{type:String,default:null},placeholder:{type:String,default:null},rows:{type:Number,default:10},fullHeight:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},richText:{type:Boolean,default:!1},border:{type:Boolean,default:!0},rounded:{type:Boolean,default:!1},fixedHeight:{type:Boolean,default:!1},options:{type:Object,default:()=>({}),validator:E=>typeof E=="object"&&E!==null},floatingToolbar:{type:Boolean,default:!1},askAi:{type:Boolean,default:!1},showTitle:{type:Boolean,default:!0},showDescription:{type:Boolean,default:!0},commentUser:{type:Object,default:null},customToolbarSlots:{type:Array,default:()=>["custom-tool-1","custom-tool-2","custom-tool-3"]},customToolbarFloatingMap:{type:Object,default:()=>({}),validator:E=>typeof E=="object"&&E!==null},locale:{type:String,default:null},comments:{type:Array,default:()=>[]}},emits:["update:modelValue","update:title","update:description","update:comments","change","blur","title-change","description-change","comment-submitted","comment-marker-clicked","comment-deleted"],setup(E,{expose:ne,emit:$}){const{t:V,locale:ce}=co.useI18n(),I={h1:Ru,h2:Fu,h3:Iu,h4:zu,h5:Pu,h6:Ou},_=E,pe=$,st=e.useSlots(),te=`<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
96
|
+
`,Ol.value){t+=`Category,Segment,Value
|
|
97
|
+
`,Q.value.forEach(P=>{P.segments.forEach(B=>{const H=String(P.label||"").replace(/"/g,'""'),S=String(B.label||"").replace(/"/g,'""');t+=`"${H}","${S}",${B.value}
|
|
98
|
+
`})});const f=new Blob([t],{type:"text/csv;charset=utf-8;"}),C=URL.createObjectURL(f),b=document.createElement("a");b.href=C,b.download=Hn("csv"),document.body.appendChild(b),b.click(),document.body.removeChild(b),URL.revokeObjectURL(C),Bt();return}t+="Category",F.series.forEach(f=>{const C=f.name.replace(/"/g,'""');t+=',"'+C+'"'}),t+=`
|
|
99
|
+
`;const o=Math.max(...F.series.map(f=>f.data?.length||0));for(let f=0;f<o;f++){let P='"'+(F.categories[f]||$("chart.fallback.item",{number:f+1})).toString().replace(/"/g,'""')+'"';F.series.forEach(B=>{const H=B.data&&B.data[f]!==void 0?B.data[f]:"";P+=","+H}),t+=P+`
|
|
100
|
+
`}const l=new Blob([t],{type:"text/csv;charset=utf-8;"}),r=URL.createObjectURL(l),m=document.createElement("a");m.href=r,m.download=Hn("csv"),document.body.appendChild(m),m.click(),document.body.removeChild(m),URL.revokeObjectURL(r),Bt()}catch(t){console.error("Error downloading CSV:",t)}},Yn=t=>{if(typeof t.action=="function"){const o={series:F.series,categories:F.categories,markers:Tt.value},l={chartX:ft.value.chartX,chartY:ft.value.chartY,dataX:ft.value.mouseDataX,dataY:ft.value.mouseDataY,categoryIndex:clampedCategoryIndex||ft.value.categoryIndex};t.action(o,l)}Bt()},jn=()=>{Sn(),De.value.show=!0,De.value.categoryIndex=ft.value.categoryIndex,De.value.fromButton=!1,Bt()},Qo=()=>{Sn(),De.value.show=!0,De.value.categoryIndex=0,De.value.fromButton=!0},Vo=t=>{if(ft.value.show){const o=document.querySelector(".dss-context-menu");o&&!o.contains(t.target)&&(ft.value.show=!1)}},Kn=t=>{ft.value.show&&!t.target.closest(".context-menu")&&(ft.value.show=!1)},rn=t=>{if(!ol.value||!Ge.value)return;t.preventDefault(),t.stopPropagation(),ie.value.isZooming=!0,nt.value.show=!1,ie.value.zoomTimeout&&clearTimeout(ie.value.zoomTimeout);const l=t.currentTarget.getBoundingClientRect(),r=t.clientX-l.left,m=t.clientY-l.top;if(r<R.value.left-50||r>R.value.right+50||m<R.value.top-50||m>R.value.bottom+100){ie.value.isZooming=!1;return}const f=t.deltaY>0?.9:1.1,C=Math.max(ie.value.minScale,Math.min(ie.value.maxScale,ie.value.scale*f));if(C!==ie.value.scale){const{minX:b,maxX:P}=He.value,B=P-b||1,H=B/ie.value.scale,S=b-ie.value.offsetX/R.value.width*B,q=(r-R.value.left)/R.value.width,we=S+q*H;ie.value.scale=C;const Ze=B/ie.value.scale,pe=we-q*Ze;ie.value.offsetX=-(pe-b)/B*R.value.width,ie.value.scale<=1.01&&(ie.value.scale=1,ie.value.offsetX=0)}ie.value.zoomTimeout=setTimeout(()=>{ie.value.isZooming=!1,ie.value.zoomTimeout=null},300)},yn=t=>{if(!ol.value||!Ge.value||ie.value.scale<=1)return;nt.value.show=!1;const l=t.currentTarget.getBoundingClientRect();t.clientX-l.left,t.clientY-l.top,ie.value.isDragging=!0,ie.value.lastMouseX=t.clientX,ie.value.lastMouseY=t.clientY,t.preventDefault()},Nn=()=>{ie.value.isDragging=!1},Bn=()=>{!ol.value||!Ge.value||(ie.value.scale=1,ie.value.offsetX=0,ie.value.isDragging=!1,ie.value.zoomTimeout&&(clearTimeout(ie.value.zoomTimeout),ie.value.zoomTimeout=null),ie.value.isZooming=!1)},cl=()=>!ol.value||!El.value||!Ge.value?"default":ie.value.isDragging?"grabbing":ie.value.scale>1?"grab":"dss-crosshair",Gn=t=>{if(t.length<2)return"";if(t.length===2)return`M ${t[0].x} ${t[0].y} L ${t[1].x} ${t[1].y}`;let o=`M ${t[0].x} ${t[0].y}`;for(let l=0;l<t.length-1;l++){const r=t[Math.max(l-1,0)],m=t[l],f=t[l+1],C=t[Math.min(l+2,t.length-1)],b=m.x+(f.x-r.x)/6*Ke.value,P=m.y+(f.y-r.y)/6*Ke.value,B=f.x-(C.x-m.x)/6*Ke.value,H=f.y-(C.y-m.y)/6*Ke.value;o+=` C ${b} ${P} ${B} ${H} ${f.x} ${f.y}`}return o},Tl=e.computed(()=>{const o=U.value?.chart?.padding,l=typeof o=="number"?o:null,r=o&&typeof o=="object"?o:null,m=50;let f=m+(Wt.value?30:0)+60;if(Bl.value){const S={left:m+40,top:m+40,right:m+40,bottom:m+40};return l!=null?{left:l,top:l,right:l,bottom:l}:r?{left:r.left??S.left,top:r.top??S.top,right:r.right??S.right,bottom:r.bottom??S.bottom}:S}if(al.value){const S=!W.value,q=Qt.value,we=q?Ln.value+En.value+Math.max(24,_t.value+16):0,Ze=S?12:m;let pe=0;ut.value&&(pe+=S?8:15),ht.value&&(pe+=S?6:10);const ye=tt();let Se=Ze+(S?4:16)+(q?we:0),ve=Ze+(q?we:0);W.value&&G.value==="left"?Se+=ye.legendWidth||150:W.value&&G.value==="right"&&(ve+=ye.legendWidth||150);const Oe=Ce.value==="semi-radial"?q?we:8:q?we:S?8:m+80,Ae=q?14:0,Ee=Ze+pe+Ae,Re={left:Se,top:Ee,right:ve,bottom:Oe};return l!=null?{left:l,top:l,right:l,bottom:l}:r?{left:r.left??Re.left,top:r.top??Re.top,right:r.right??Re.right,bottom:r.bottom??Re.bottom}:Re}let C=0;ut.value&&(C+=15),ht.value&&(C+=10);const b=tt();let P=m+16+(qt.value?30:0),B=m+(wt.value?30:0);W.value&&G.value==="left"?P+=b.legendWidth||150:W.value&&G.value==="right"&&(B+=b.legendWidth||150),D.value&&(B+=44);const H={left:P,top:m+C,right:B,bottom:f};return l!=null?{left:l,top:l,right:l,bottom:l}:r?{left:r.left??H.left,top:r.top??H.top,right:r.right??H.right,bottom:r.bottom??H.bottom}:H}),R=e.computed(()=>({left:Tl.value.left,top:Tl.value.top,right:Ve.value-Tl.value.right,bottom:re.value-Tl.value.bottom,width:Ve.value-(Tl.value.left+Tl.value.right),height:re.value-(Tl.value.top+Tl.value.bottom)})),ol=e.computed(()=>["line","area","bar","stepbar"].includes(Ce.value)||Je.value),_l=e.computed(()=>Je.value),en=e.computed(()=>Ce.value==="mini-radial"),al=e.computed(()=>["radial","semi-radial","mini-radial"].includes(Ce.value)),Bl=e.computed(()=>Ce.value==="spider"),ul=e.computed(()=>Ce.value==="bubble"),Ol=e.computed(()=>Ce.value==="stepbar"),dl=e.computed(()=>U.value?.chart?.orientation==="horizontal"&&(Ce.value==="bar"||_l.value)),Xl=t=>{const{minY:o,maxY:l}=He.value,r=l-o||1;return R.value.left+(t-o)/r*R.value.width},kn=t=>{const{maxX:o}=He.value,l=o+1,m=R.value.height/l;return R.value.top+(t+.5)*m},Ut=e.computed(()=>al.value?Tl.value.left+(Ve.value-Tl.value.left-Tl.value.right)/2:Ve.value/2),Pt=e.computed(()=>Bl.value?re.value/2-40:al.value?Tl.value.top+(re.value-Tl.value.top-Tl.value.bottom)/2:re.value/2),gt=e.computed(()=>{if(Bl.value){const t=R.value.width-80,o=R.value.height-80;return Math.min(t,o)/2}return Math.min(R.value.width,R.value.height)/2}),sl=e.computed(()=>{const t=U.value,o=t?.plotOptions?.radialBar?.innerRadiusRatio??t?.radialBar?.innerRadiusRatio,l=typeof o=="number"&&o>=0&&o<=1?o:.45;return gt.value*l}),vo=e.computed(()=>{const t=U.value,o=typeof F.innerSize=="number"?F.innerSize:t?.innerSize;return typeof o!="number"||o<=-100||!(al.value||Bl.value)?1:1+o/100}),No=e.computed(()=>{const t=vo.value;if(t===1||t<=0)return;const o=Ut.value,l=Pt.value;return`translate(${o}, ${l}) scale(${t}) translate(${-o}, ${-l})`}),Fn=e.ref(0),Wn=e.computed(()=>`semi-radial-fill-clip-${F.chartId}`),Cn=e.computed(()=>Ce.value==="semi-radial"),ho=e.computed(()=>Cn.value&&Vl.value&&!$n.value),qn=e.computed(()=>Cn.value&&Vl.value&&!$n.value&&Nl.value==="fill"),Bo=e.computed(()=>{const t=ho.value?Fn.value:1,o=Ut.value,l=Pt.value,r=sl.value,m=gt.value,f=Math.PI,C=Math.PI+t*Math.PI;if(t<=0)return`M ${o} ${l} L ${o} ${l} Z`;const b=o+m*Math.cos(f),P=l+m*Math.sin(f),B=o+m*Math.cos(C),H=l+m*Math.sin(C),S=o+r*Math.cos(C),q=l+r*Math.sin(C),we=o+r*Math.cos(f),Ze=l+r*Math.sin(f),pe=t>.5?1:0;return`M ${o} ${l} L ${b} ${P} A ${m} ${m} 0 ${pe} 1 ${B} ${H} L ${S} ${q} A ${r} ${r} 0 ${pe} 1 ${we} ${Ze} Z`}),Mo=e.computed(()=>{if(!(!Cn.value||!ho.value)&&!qn.value)return`url(#${Wn.value})`}),Zn=t=>{if(!(!qn.value||t!==0))return`url(#${Wn.value})`},Rl=e.ref(0),Qn=e.computed(()=>`radial-reveal-clip-${F.chartId}`),an=e.computed(()=>Ce.value==="radial"),Jo=e.computed(()=>{const t=an.value?Rl.value:1,o=Ut.value,l=Pt.value,r=Math.max(gt.value*1.5,Ve.value,re.value);if(t<=0)return`M ${o} ${l} L ${o} ${l} Z`;if(t>=1){const S=o-r,q=o+r;return`M ${S} ${l} A ${r} ${r} 0 0 1 ${q} ${l} A ${r} ${r} 0 0 1 ${S} ${l} Z`}const m=-Math.PI/2,f=m+t*Math.PI*2,C=o+r*Math.cos(m),b=l+r*Math.sin(m),P=o+r*Math.cos(f),B=l+r*Math.sin(f),H=t>=.5?1:0;return`M ${o} ${l} L ${C} ${b} A ${r} ${r} 0 ${H} 1 ${P} ${B} Z`}),ea=e.computed(()=>{if(Mo.value)return Mo.value;if(an.value)return`url(#${Qn.value})`});let Un=null;const Jn=()=>{if(!ho.value)return;Fn.value=0;const t=tl.value,o=performance.now(),l=r=>{const m=r-o,f=Math.min(1,m/t);Fn.value=ca(on.value,f),f<1&&(Un=requestAnimationFrame(l))};Un=requestAnimationFrame(l)},Yl=e.computed(()=>U.value?.bubbles?.minSize||8),ta=e.computed(()=>U.value?.bubbles?.maxSize||50),bn=e.computed(()=>U.value?.bubbles?.opacity||.7),eo=(t,o)=>{const l=[15,20,25,18,22],r=l[t%l.length]||20,m=1+Math.sin(o*.5)*.2;return Math.max(5,r*m)},la=t=>{const o=document.querySelector(`.dss-bubble-image-${t}`);o&&(o.style.opacity="1")},_o=t=>{const o=document.querySelector(`.dss-bubble-image-${t}`);o&&(o.style.display="none")},tn=e.computed(()=>F.series),a=e.computed(()=>F.series.filter((t,o)=>!zt.value.has(o))),n=t=>{if(!t)return"primary";const o=t.yAxis??t.axis??t.yAxisId;return o==="secondary"||o==="right"||o===1?"secondary":"primary"},s=t=>t?typeof t.strokeDasharray=="string"?t.strokeDasharray:Array.isArray(t.strokeDasharray)?t.strokeDasharray.join(","):t.dotted===!0?"4,4":null:null,i=t=>t?t.old===!0||t.comparison===!0||t.dotted===!0:!1,c=e.computed(()=>{const o=U.value?.spider?.comparison||{};return{fillOpacity:typeof o.fillOpacity=="number"?o.fillOpacity:0,strokeDasharray:o.strokeDasharray||"6,4",usePrimaryColor:o.usePrimaryColor!==!1,bubbleSize:typeof o.bubbleSize=="number"?o.bubbleSize:0}}),d=(t,o)=>typeof t?.bubbles?.size=="number"?t.bubbles.size:typeof t?.bubbleSize=="number"?t.bubbleSize:o?c.value.bubbleSize:Lt.value,u=(t,o)=>i(t)&&c.value.usePrimaryColor?$t(0):$t(o),p=(t,o)=>Bl.value&&i(t)?u(t,o):$t(o),h=e.computed(()=>a.value.filter(t=>n(t)==="primary")),k=e.computed(()=>a.value.filter(t=>n(t)==="secondary")),D=e.computed(()=>!dl.value&&!!Ct.value&&k.value.length>0),I=(t,o=0)=>{const l=Number(t);return Number.isFinite(l)?l:o},N=(t,o,l)=>{if(!Array.isArray(t))return[];const r=t.map((m,f)=>{const C=m&&typeof m=="object"&&!Array.isArray(m),b=I(C?m.value:m,0);return b<=0?null:{key:`${l}-${f}-${C&&m.label||f}`,label:C?m.label||o?.name||`Segment ${f+1}`:o?.name||`Segment ${f+1}`,value:b,color:C?m.color||$t(f):$t(l),marker:C?m.marker:null,isRemainder:!1}}).filter(Boolean);return vl.value==="asc"?r.sort((m,f)=>m.value-f.value):vl.value==="desc"?r.sort((m,f)=>f.value-m.value):r},se=(t,o,l,r)=>{const m=t&&typeof t=="object"&&!Array.isArray(t),f=m?t.segments:Array.isArray(t)?t:[{label:l?.name,value:t,color:$t(r)}],C=N(f,l,r),b=C.reduce((S,q)=>S+q.value,0),P=I(m?t.totalValue??t.total??l?.totalValue??l?.total:l?.totalValue??l?.total,M.value),B=Math.max(P,b,1);x.value&&B>b&&C.push({key:`${r}-${o}-remainder`,label:A.value,value:B-b,color:ae.value,marker:null,isRemainder:!0});const H=C.filter(S=>!S.isRemainder).reduce((S,q)=>!S||q.value>S.value?q:S,null);return{key:`${r}-${o}`,label:m?t.label||t.name||F.categories?.[o]||$("chart.fallback.item",{number:o+1}):F.categories?.[o]||$("chart.fallback.item",{number:o+1}),axisLabel:m?t.xLabel??t.label??t.name??F.categories?.[o]??$("chart.fallback.item",{number:o+1}):F.categories?.[o]||$("chart.fallback.item",{number:o+1}),yLabel:m?t.yLabel??null:null,totalValue:B,usedValue:b,segments:C,maxSegmentKey:H?.key||null,seriesName:l?.name||"",seriesIndex:r}},Q=e.computed(()=>{if(!Ol.value)return[];const t=[];return tn.value.forEach((o,l)=>{zt.value.has(l)||!Array.isArray(o?.data)||o.data.forEach(r=>{const m=se(r,t.length,o,l);m.segments.length>0&&t.push(m)})}),t}),Be="auto",_e=(t,o,l,r=0,m=100)=>{let f=1/0,C=-1/0;if(t.forEach(B=>{B?.data?.length&&B.data.forEach(H=>{typeof H=="number"&&Number.isFinite(H)&&(f=Math.min(f,H),C=Math.max(C,H))})}),f===1/0)return{minY:r,maxY:m};let b;if(o===Be){const B=C-f,H=B>0?B*.1:1;b=Math.max(0,f-H)}else if(typeof o=="number")b=o;else{const B=C-f,H=B>0?B*.1:1;b=Math.max(0,f-H)}let P;if(l===Be){const B=C-f,H=B>0?B*.1:2;P=C+H}else if(typeof l=="number")P=l;else{const B=C-f,H=B>0?B*.1:2;P=C+H}return{minY:b,maxY:P}},He=e.computed(()=>{if(ul.value)return ml();if(Ol.value)return Sl();if(!a.value.length)return{minX:0,maxX:1,minY:0,maxY:1};let t=0;a.value.forEach(l=>{l.data&&l.data.length&&(t=Math.max(t,l.data.length-1))}),F.categories.length>0&&(t=Math.max(t,F.categories.length-1));const o=_e(h.value.length?h.value:a.value,Yt.value,it.value);return{minX:0,maxX:t,minY:o.minY,maxY:o.maxY}}),Sl=()=>{const t=Q.value,o=t.reduce((f,C)=>Math.max(f,C.totalValue),M.value),l=typeof Yt.value=="number"?Yt.value:0,r=typeof it.value=="number"?it.value:o,m=Math.max(r,l+1);return{minX:0,maxX:Math.max(t.length-1,0),minY:l,maxY:m}},hl=e.computed(()=>D.value?_e(k.value,Kt.value,yt.value,He.value.minY,He.value.maxY):{minY:He.value.minY,maxY:He.value.maxY}),ml=()=>{if(!a.value.length)return{minX:0,maxX:8,minY:0,maxY:50,minSize:10,maxSize:30};let t=1/0,o=-1/0,l=1/0,r=-1/0,m=1/0,f=-1/0,C=!1;if(a.value.forEach((we,Ze)=>{we?.data?.length&&we.data.forEach((pe,ye)=>{let Se,ve,Ye;if(typeof pe=="object"&&pe!==null&&!Array.isArray(pe))Se=typeof pe.x=="number"?pe.x:ye,ve=typeof pe.y=="number"?pe.y:0,Ye=typeof pe.size=="number"?pe.size:20;else if(Array.isArray(pe)&&pe.length>=3)Se=typeof pe[0]=="number"?pe[0]:ye,ve=typeof pe[1]=="number"?pe[1]:0,Ye=typeof pe[2]=="number"?pe[2]:20;else if(typeof pe=="number")Se=ye,ve=pe,Ye=eo(Ze,ye);else return;isFinite(Se)&&isFinite(ve)&&isFinite(Ye)&&(t=Math.min(t,Se),o=Math.max(o,Se),l=Math.min(l,ve),r=Math.max(r,ve),m=Math.min(m,Ye),f=Math.max(f,Ye),C=!0)})}),!C)return{minX:0,maxX:8,minY:0,maxY:50,minSize:10,maxSize:30};t===o&&(t=Math.min(t,0),o=Math.max(o,F.categories?.length-1||8)),l===r&&(l=Math.max(0,l-10),r=l+20);const b=o-t,P=r-l;let B,H,S,q;return el.value!==null?B=el.value:B=t-b*.1,X.value!==null?H=X.value:H=o+b*.1,Yt.value!==null&&typeof Yt.value=="number"?S=Yt.value:S=Math.max(0,l-P*.1),it.value!==null&&typeof it.value=="number"?q=it.value:q=r+P*.1,{minX:B,maxX:H,minY:S,maxY:q,minSize:m,maxSize:f}},vt=t=>{if(ul.value){const{minX:b,maxX:P}=He.value,B=P-b||1;return R.value.left+(t-b)/B*R.value.width}const{minX:o,maxX:l}=He.value,r=l-o;if(l===0||r===0)return R.value.left+R.value.width/2;const m=r/ie.value.scale,f=o-ie.value.offsetX/R.value.width*r,C=(t-f)/m;return R.value.left+C*R.value.width},Xt=t=>{const{minY:o,maxY:l}=He.value,r=l-o||1;return R.value.bottom-(t-o)/r*R.value.height},pl=t=>{const{minY:o,maxY:l}=hl.value,r=l-o||1;return R.value.bottom-(t-o)/r*R.value.height},gl=(t,o)=>D.value&&n(t)==="secondary"?pl(o):Xt(o),xn=t=>{if(!ul.value)return Lt.value||4;const{maxSize:o}=He.value,l=Math.max(1,o),r=Math.min(1,Math.max(0,t/l));return Yl.value+r*(ta.value-Yl.value)},Wl=(t,o=12,l="Arial, sans-serif")=>{if(typeof t!="string"||!t)return 0;if(typeof document>"u")return t.length*(o*.62);Wl.canvas||(Wl.canvas=document.createElement("canvas"));const r=Wl.canvas.getContext("2d");return r?(r.font=`${o}px ${l}`,r.measureText(t).width):t.length*(o*.62)},to=(t,o,l=12)=>{if(typeof t!="string"||typeof o!="number"||o<=0||Wl(t,l)<=o)return t;const r="..";if(Wl(r,l)>=o)return r;let f=t.length;for(;f>0;){const C=`${t.slice(0,f)}${r}`;if(Wl(C,l)<=o)return C;f-=1}return r},$o=e.computed(()=>no.value.map(t=>({y:t.y}))),Lo=e.computed(()=>!Ol.value||!xt.value?[]:no.value.map(t=>({y:t.y}))),Ao=e.computed(()=>!Ol.value||!xt.value||!Mt.value?[]:sa.value.map(t=>({x:t.centerX}))),To=e.computed(()=>{if(ul.value)return Do();if(Ol.value)return lo();if(Ce.value==="bar"){if(dl.value){const Ee=[],{minY:Re,maxY:Vt}=He.value,Ft=5,Dl=Vt-Re||1;for(let fl=0;fl<=Ft;fl++){const $l=Re+Dl*(fl/Ft),ao=Xl($l);Ee.push({x:ao,y:R.value.bottom+20,text:_(Math.round($l))})}return Ee}const ye=[],{maxX:Se}=He.value,ve=Se+1,Ye=5,Ae=(R.value.width-Ye*2)/ve;for(let Ee=0;Ee<=Se;Ee++){const Re=R.value.left+Ye+(Ee+.5)*Ae;ye.push({x:Re,y:R.value.bottom+20,text:to(F.categories[Ee]||$("chart.fallback.item",{number:Ee+1}),Math.max(Ae-8,24))})}return ye}const t=[],{minX:o,maxX:l}=He.value,r=el.value!==null?el.value:o,m=X.value!==null?X.value:l,f=m-r||1,C=f/ie.value.scale,b=r-ie.value.offsetX/R.value.width*f,P=b+C,B=Math.max(0,Math.floor(b-2)),H=Math.min(m,Math.ceil(P+2)),S=H-B,q=R.value.width,Ze=Math.floor(q/60);let pe=1;S>Ze&&(pe=Math.ceil(S/Ze));for(let ye=B;ye<=H;ye+=pe)if(ye>=0&&ye<=m){const Se=vt(ye);Se>=R.value.left-100&&Se<=R.value.right+100&&t.push({x:Se,y:R.value.bottom+20,text:F.categories[ye]||`Item ${ye+1}`})}return t}),Do=()=>{const t=[],{minX:o,maxX:l}=He.value,r=l-o||1,m=Math.min(8,Math.max(4,Math.floor(R.value.width/80)));for(let f=0;f<=m;f++){const C=o+r*f/m,b=vt(C);if(b>=R.value.left-10&&b<=R.value.right+10){const P=Math.round(C),B=F.categories?.[P];t.push({x:b,y:R.value.bottom+20,text:B||(Number.isInteger(C)?C.toString():C.toFixed(1))})}}return t},lo=()=>sa.value.map(o=>({x:o.centerX,y:R.value.bottom+20,text:to(o.axisLabel||o.label,Math.max(o.categoryWidth-8,24))})),no=e.computed(()=>{if(dl.value){const m=[],{maxX:f}=He.value;for(let C=0;C<=f;C++)m.push({x:R.value.left-10,y:kn(C),text:to(F.categories[C]||`Item ${C+1}`,Math.max(R.value.left-28,40))});return m}const t=[],{minY:o,maxY:l}=He.value,r=5;for(let m=0;m<=r;m++){const f=o+(l-o)*(m/r),C=Math.round(f);t.push({x:R.value.left-10,y:Xt(f),text:_(C)})}return t}),cn=e.computed(()=>{if(!D.value||dl.value)return[];const t=[],{minY:o,maxY:l}=hl.value,r=5;for(let m=0;m<=r;m++){const f=o+(l-o)*(m/r),C=Math.round(f);t.push({x:R.value.right+10,y:pl(f),text:_(C)})}return t}),$t=t=>{const o=jt.value;if(!o||o.length===0){const l=["#3B82F6","#EF4444","#10B981","#F59E0B","#8B5CF6","#F97316","#06B6D4","#84CC16"];return l[t%l.length]}return o[t%o.length]},ln=t=>{if(!t||typeof t!="string")return"#3a3a3a";const o=t.trim();let l=0,r=0,m=0;const f=o.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i);if(f)l=Number(f[1])/255,r=Number(f[2])/255,m=Number(f[3])/255;else{const b=o.match(/^rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)\s*\)$/i);if(b)l=Number(b[1])/255,r=Number(b[2])/255,m=Number(b[3])/255;else{const P=o.match(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/);if(P){let B=P[1];B.length===3&&(B=B[0]+B[0]+B[1]+B[1]+B[2]+B[2]),l=parseInt(B.slice(0,2),16)/255,r=parseInt(B.slice(2,4),16)/255,m=parseInt(B.slice(4,6),16)/255}else if(typeof document<"u"){const B=document.createElement("span");B.style.color=o,B.style.display="none",document.body.appendChild(B);const H=getComputedStyle(B).color;document.body.removeChild(B);const S=H.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i);if(S)l=Number(S[1])/255,r=Number(S[2])/255,m=Number(S[3])/255;else return"#3a3a3a"}else return"#3a3a3a"}}return .2126*l+.7152*r+.0722*m>.5?"#3a3a3a":"#fafafa"},Ho=t=>{if(!t||typeof t!="string")return t;const o=t.trim(),l=o.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i);if(l){const f=Math.max(0,Math.floor(Number(l[1])*.65)),C=Math.max(0,Math.floor(Number(l[2])*.65)),b=Math.max(0,Math.floor(Number(l[3])*.65));return`rgb(${f}, ${C}, ${b})`}const r=o.match(/^rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)\s*\)$/i);if(r){const f=Math.max(0,Math.floor(Number(r[1])*.65)),C=Math.max(0,Math.floor(Number(r[2])*.65)),b=Math.max(0,Math.floor(Number(r[3])*.65));return`rgba(${f}, ${C}, ${b}, ${r[4]})`}const m=o.match(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/);if(m){let f=m[1];f.length===3&&(f=f[0]+f[0]+f[1]+f[1]+f[2]+f[2]);const C=Math.max(0,Math.min(255,Math.floor(parseInt(f.slice(0,2),16)*.65))),b=Math.max(0,Math.min(255,Math.floor(parseInt(f.slice(2,4),16)*.65))),P=Math.max(0,Math.min(255,Math.floor(parseInt(f.slice(4,6),16)*.65)));return`#${[C,b,P].map(B=>B.toString(16).padStart(2,"0")).join("")}`}return o},na=(t,o)=>{const r=U.value?.stroke?.color;return r==null?Ho(o):typeof r=="string"?r:Array.isArray(r)&&r.length?r[t%r.length]??Ho(o):Ho(o)},oa=t=>{let o=0;for(let l=1;l<t.length;l++){const r=t[l].x-t[l-1].x,m=t[l].y-t[l-1].y;o+=Math.sqrt(r*r+m*m)}return o},fa=e.computed(()=>Ce.value==="line"||_l.value?(_l.value?F.series.filter(o=>(o.type||Ce.value)==="line"):tn.value).map((o,l)=>{const r=F.series.findIndex(S=>S===o),m=[];let f=[];o.data.forEach((S,q)=>{S==null?f.length>0&&(m.push([...f]),f=[]):f.push({x:dl.value?Xl(S):vt(q),y:dl.value?kn(q):gl(o,S),index:q})}),f.length>0&&m.push(f);let C="";m.forEach(S=>{if(S.length>0){let q="";xe.value?q=Gn(S):q=`M ${S[0].x} ${S[0].y}`+S.slice(1).map(we=>` L ${we.x} ${we.y}`).join(""),C+=(C?" ":"")+q}});const b=m.reduce((S,q)=>S+oa(q),0),P=zt.value.has(r),B=Me.value===r,H=Me.value!==null&&Me.value!==r;return{path:C,color:$t(r),strokeDasharray:s(o),pathLength:b,seriesIndex:r,animationDelay:l*xl.value,isHighlighted:B,isDimmed:H,isHidden:P}}):[]),va=e.computed(()=>{if(!(Ce.value==="line"||_l.value))return[];const t=_l.value?F.series.filter(l=>(l.type||Ce.value)==="line"):tn.value,o=[];return t.forEach((l,r)=>{const m=F.series.findIndex(f=>f===l);for(let f=0;f<l.data.length-1;f++){const C=l.data[f];if(C!=null){let b=-1,P=0;for(let B=f+1;B<l.data.length;B++){const H=l.data[B];if(H==null)P++;else{b=B;break}}if(P>0&&b!==-1){const B=l.data[b],H=dl.value?Xl(C):vt(f),S=dl.value?kn(f):gl(l,C),q=dl.value?Xl(B):vt(b),we=dl.value?kn(b):gl(l,B),Ze=zt.value.has(m),pe=Me.value===m,ye=Me.value!==null&&Me.value!==m;o.push({path:`M ${H} ${S} L ${q} ${we}`,color:$t(m),seriesIndex:m,animationDelay:r*xl.value,isHighlighted:pe,isDimmed:ye,isHidden:Ze,gapSize:P}),f=b-1}}}}),o}),Ta=e.computed(()=>Ce.value==="line"||_l.value?!Vl.value||$n.value||Ot.value.hasAnimated?[]:(_l.value?F.series.filter(o=>(o.type||Ce.value)==="line"):tn.value).map((o,l)=>{const r=F.series.findIndex(P=>P===o);let m="",f=null;o.data.forEach((P,B)=>{if(P!=null){const H={x:dl.value?Xl(P):vt(B),y:dl.value?kn(B):gl(o,P)};f===null?m+=`M ${H.x} ${H.y}`:m+=` L ${H.x} ${H.y}`,f=H}else if(f!==null){const H=o.data.findIndex((S,q)=>q>B&&S!==null&&S!==void 0);if(H!==-1){const S={x:dl.value?Xl(o.data[H]):vt(H),y:dl.value?kn(H):gl(o,o.data[H])};m+=` L ${S.x} ${S.y}`,f=S}}});const C=o.data.map((P,B)=>P==null?null:{x:dl.value?Xl(P):vt(B),y:dl.value?kn(B):gl(o,P)}).filter(P=>P!==null),b=oa(C);return{path:m,pathLength:b,color:$t(r),strokeDasharray:s(o),animationDelay:l*xl.value,seriesIndex:r}}):[]),Da=e.computed(()=>{if(Ce.value!=="line")return[];const t=[];return tn.value.forEach((o,l)=>{const r=Me.value===l,m=Me.value!==null&&Me.value!==l,f=zt.value.has(l);o.data.forEach((C,b)=>{C!=null&&t.push({x:vt(b),y:gl(o,C),color:$t(l),value:C,label:F.categories[b]||b.toString(),seriesName:o.name,categoryIndex:b,dataIndex:b,animationDelay:(l*o.data.length+b)*(xl.value/8),isHighlighted:r,isDimmed:m,isHidden:f})})}),t}),Ha=e.computed(()=>{if(!_l.value)return[];const t=[];return F.series.filter(l=>(l.type||Ce.value)==="line").forEach((l,r)=>{const m=F.series.findIndex(P=>P===l),f=Me.value===m,C=Me.value!==null&&Me.value!==m,b=zt.value.has(m);l.data.forEach((P,B)=>{P!=null&&t.push({x:vt(B),y:gl(l,P),color:$t(m),value:P,label:F.categories[B]||B.toString(),seriesName:l.name,categoryIndex:B,dataIndex:B,animationDelay:(r*l.data.length+B)*(xl.value/8),isHighlighted:f,isDimmed:C,isHidden:b})})}),t}),Ro=e.computed(()=>{if(!ul.value)return[];const t=[];return tn.value.forEach((o,l)=>{if(!o?.data?.length)return;const r=Me.value,m=r!==null&&r===l,f=r!==null&&r!==l,C=zt.value.has(l);o.data.forEach((b,P)=>{let B,H,S,q,we;if(typeof b=="object"&&b!==null&&!Array.isArray(b))B=typeof b.x=="number"?b.x:P,H=typeof b.y=="number"?b.y:0,S=typeof b.size=="number"?b.size:20,q=b.label||F.categories?.[P]||`Point ${P+1}`,we=b.image||b.imageUrl;else if(Array.isArray(b)&&b.length>=3)B=typeof b[0]=="number"?b[0]:P,H=typeof b[1]=="number"?b[1]:0,S=typeof b[2]=="number"?b[2]:20,q=b[3]||F.categories?.[P]||`Point ${P+1}`,we=b[4];else if(typeof b=="number")B=P,H=b,S=eo(l,P),q=F.categories?.[P]||`Point ${P+1}`;else return;!isFinite(B)||!isFinite(H)||!isFinite(S)||t.push({x:vt(B),y:Xt(H),radius:xn(S),originalX:B,originalY:H,originalSize:S,color:$t(l),seriesName:o.name||`Series ${l+1}`,label:q,imageUrl:we,seriesIndex:l,dataIndex:P,categoryIndex:Math.round(B),isHighlighted:m,isDimmed:f,isHidden:C,opacity:bn.value})})}),t}),aa=e.computed(()=>Ce.value!=="area"?[]:tn.value.map((t,o)=>{const l=[];let r=[];if(t.data.forEach((S,q)=>{S==null?r.length>0&&(l.push([...r]),r=[]):r.push({x:vt(q),y:gl(t,S),index:q})}),r.length>0&&l.push(r),l.length===0)return{linePath:"",areaPath:"",color:$t(o),isHidden:zt.value.has(o)};const m=R.value.bottom+1;let f="",C="";l.forEach((S,q)=>{if(S.length===0)return;let we=`M ${S[0].x} ${S[0].y}`;xe.value&&S.length>1?we=Gn(S):S.slice(1).forEach(pe=>{we+=` L ${pe.x} ${pe.y}`}),f+=(f?" ":"")+we;let Ze=`M ${S[0].x} ${m}`;if(Ze+=` L ${S[0].x} ${S[0].y}`,xe.value&&S.length>1){const pe=Gn(S),ye=pe.substring(pe.indexOf("C")||pe.indexOf("Q")||pe.indexOf("L"));ye?Ze+=" "+ye:S.slice(1).forEach(Se=>{Ze+=` L ${Se.x} ${Se.y}`})}else S.slice(1).forEach(pe=>{Ze+=` L ${pe.x} ${pe.y}`});Ze+=` L ${S[S.length-1].x} ${m} Z`,C+=(C?" ":"")+Ze});const b=Me.value===o,P=Me.value!==null&&Me.value!==o,B=zt.value.has(o),H=l.reduce((S,q)=>S+oa(q),0);return{linePath:f,areaPath:C,color:$t(o),pathLength:H,isHighlighted:b,isDimmed:P,isHidden:B}})),sa=e.computed(()=>{if(!Ol.value)return[];const t=Q.value,o=t.length;if(!o)return[];const l=Math.max(R.value.width,0),r=o>0?l/o:l,m=Math.max(Fe.value,bt.value),f=Math.min(oe.value,m),C=Math.max(4,Math.min(m,Math.max(Fe.value,f),Math.max(4,r*.62))),b=yl.value,P=Number.isFinite(Number(b.radius))?Math.max(Number(b.radius),0):8,B=Number.isFinite(Number(b.borderWidth))?Math.max(Number(b.borderWidth),0):2,H=Number.isFinite(Number(b.fontSize))?Math.max(Number(b.fontSize),1):10,S=typeof b.icon=="string"?b.icon:"";return t.map((q,we)=>{const Ze=R.value.left+(we+.5)*r,pe=Ze-C/2;let ye=0,Se=null;const ve=Me.value===q.seriesIndex,Ye=Me.value!==null&&Me.value!==q.seriesIndex,Oe=zt.value.has(q.seriesIndex),Ae=q.segments.map((Ee,Re)=>{const Vt=ye,Ft=ye+Ee.value;ye=Ft;const Dl=Xt(Ft),fl=Xt(Vt),$l=Math.max(0,fl-Dl),ao=Math.min(ot.value,C/2,$l/2),Po=(we*q.segments.length+Re)*(xl.value/5),da={key:`${q.key}-${Ee.key}`,x:pe,y:Dl,width:C,height:$l,radius:ao,color:Ee.color,value:Ee.value,label:q.label,axisLabel:q.axisLabel,yLabel:q.yLabel,segmentLabel:Ee.label,seriesName:Ee.label,tooltipTitle:`${Ee.label} - ${q.label}`,categoryIndex:we,dataIndex:we,animationDelay:Po,isHighlighted:ve,isDimmed:Ye,isHidden:Oe,isRemainder:Ee.isRemainder};if(nn.value&&Ee.key===q.maxSegmentKey&&$l>0){const In=b.backgroundColor&&b.backgroundColor!=="inherit"?b.backgroundColor:Ee.color;Se={x:Ze,y:Dl+$l/2,radius:P,backgroundColor:In,borderColor:b.borderColor||"#fafafa",borderWidth:B,color:b.color||"#fafafa",fontSize:H,icon:S,animationDelay:Po}}return da});return{key:q.key,label:q.label,axisLabel:q.axisLabel,centerX:Ze,categoryWidth:r,segments:Ae,maxMarker:Se}})}),ha=e.computed(()=>{if(!(["bar"].includes(Ce.value)||_l.value))return[];const t=[],{maxX:o}=He.value,l=_l.value?F.series.filter(m=>(m.type||Ce.value)==="bar"):tn.value,r=l.length;if(dl.value){const m=o+1,C=R.value.height/m,b=C*(2/3),P=Math.min(4,b/r*.15),B=b-(r-1)*P,H=Math.max(4,B/r);l.forEach((S,q)=>{const we=F.series.findIndex(Se=>Se===S),Ze=Me.value===we,pe=Me.value!==null&&Me.value!==we,ye=zt.value.has(we);S.data.forEach((Se,ve)=>{if(Se==null||typeof Se!="number"||!isFinite(Se))return;const Ae=R.value.top+(ve+.5)*C-b/2+q*(H+P),Ee=R.value.left,Re=Math.abs(Xl(Se)-R.value.left);let Vt="";if(xe.value&&Re>0){const Ft=Math.min(Ht.value,H/2,Re/2);Vt=[`M ${Ee} ${Ae}`,`L ${Ee+Re-Ft} ${Ae}`,`Q ${Ee+Re} ${Ae} ${Ee+Re} ${Ae+Ft}`,`L ${Ee+Re} ${Ae+H-Ft}`,`Q ${Ee+Re} ${Ae+H} ${Ee+Re-Ft} ${Ae+H}`,`L ${Ee} ${Ae+H}`,"Z"].join(" ")}t.push({x:Ee,y:Ae,width:Re,height:H,color:$t(r===1?ve:we),value:Se,label:F.categories[ve]||ve.toString(),seriesName:S.name,animationDelay:(q*l.length+ve)*(xl.value/4),isHighlighted:Ze,isDimmed:pe,isHidden:ye,barPath:Vt,isSmooth:xe.value&&Re>0})})})}else{const m=o+1,C=R.value.width/m,b=C*.8,P=b/r,B=P*.05,H=P-B;l.forEach((S,q)=>{const we=F.series.findIndex(Se=>Se===S),Ze=Me.value===we,pe=Me.value!==null&&Me.value!==we,ye=zt.value.has(we);S.data.forEach((Se,ve)=>{if(Se==null||typeof Se!="number"||!isFinite(Se))return;const Ae=R.value.left+(ve+.5)*C-b/2+q*P+B/2,Ee=Xt(Math.max(0,Se)),Re=Math.abs(Xt(0)-Xt(Se));let Vt="";if(xe.value&&Re>0){const Ft=Math.min(Ht.value,H/2,Re/2);Vt=[`M ${Ae} ${Ee+Re}`,`L ${Ae} ${Ee+Ft}`,`Q ${Ae} ${Ee} ${Ae+Ft} ${Ee}`,`L ${Ae+H-Ft} ${Ee}`,`Q ${Ae+H} ${Ee} ${Ae+H} ${Ee+Ft}`,`L ${Ae+H} ${Ee+Re}`,"Z"].join(" ")}t.push({x:Ae,y:Ee,width:H,height:Re,color:$t(r===1?ve:we),value:Se,label:F.categories[ve]||ve.toString(),seriesName:S.name,animationDelay:(q*l.length+ve)*(xl.value/4),isHighlighted:Ze,isDimmed:pe,isHidden:ye,barPath:Vt,isSmooth:xe.value&&Re>0})})})}return t}),Mn=e.computed(()=>{if(!al.value)return[];const t=tn.value.map((C,b)=>({series:C,originalIndex:b})).filter(({originalIndex:C})=>!zt.value.has(C));if(t.length===0)return[];let o=Ce.value==="semi-radial"?Math.PI:-Math.PI/2;const l=Ce.value==="semi-radial"?Math.PI:Math.PI*2,r=[],m=(C,b,P,B,H,S)=>{const q=C+(b-C)/2,we=b-C,Ze=Ut.value+Math.cos(C)*sl.value,pe=Pt.value+Math.sin(C)*sl.value,ye=Ut.value+Math.cos(b)*sl.value,Se=Pt.value+Math.sin(b)*sl.value,ve=Ut.value+Math.cos(b)*gt.value,Ye=Pt.value+Math.sin(b)*gt.value,Oe=Ut.value+Math.cos(C)*gt.value,Ae=Pt.value+Math.sin(C)*gt.value,Ee=we>Math.PI?1:0,Re=[`M ${Ze} ${pe}`,`A ${sl.value} ${sl.value} 0 ${Ee} 1 ${ye} ${Se}`,`L ${ve} ${Ye}`,`A ${gt.value} ${gt.value} 0 ${Ee} 0 ${Oe} ${Ae}`,"Z"].join(" "),Vt=S||$t(P);return{path:Re,color:Vt,strokeWidth:Dt.value,strokeColor:na(r.length,Vt),value:H,seriesName:B,opacity:.8,isHighlighted:Me.value===P,isDimmed:Me.value!==null&&Me.value!==P,isHidden:!1,startAngle:C,endAngle:b,midAngle:q}};if(en.value){const{series:C,originalIndex:b}=t[0],P=Number(C?.data?.[0]??0),B=Number.isFinite(P)?Math.min(Math.max(P,0),100):0,H=U.value,S=Math.min(Math.max(Number(H?.miniRadial?.minVisiblePercent??1),0),100),we=(B<=0?S:B)/100*l,Ze=Number(H?.miniRadial?.thresholds?.low??33),pe=Number(H?.miniRadial?.thresholds?.medium??66),ye=H?.miniRadial?.colors?.low||"#E53E3E",Se=H?.miniRadial?.colors?.medium||"#ED8936",ve=H?.miniRadial?.colors?.high||"#38A169",Ye=B<=Ze?ye:B<=pe?Se:ve,Oe=H?.miniRadial?.trackColor||"#E5E7EB",Ae=C?.name||"Score";return r.push(m(o,o+l-.001,b+1,"Track",100,Oe)),r.push(m(o,o+we,b,Ae,B,Ye)),r}if(t.length===1){const{series:C,originalIndex:b}=t[0],P=C.data[0]||0,B=o,H=o+l-.001,S=B+l/2,q=Ut.value+Math.cos(B)*sl.value,we=Pt.value+Math.sin(B)*sl.value,Ze=Ut.value+Math.cos(H)*sl.value,pe=Pt.value+Math.sin(H)*sl.value,ye=Ut.value+Math.cos(H)*gt.value,Se=Pt.value+Math.sin(H)*gt.value,ve=Ut.value+Math.cos(B)*gt.value,Ye=Pt.value+Math.sin(B)*gt.value,Oe=1,Ae=[`M ${q} ${we}`,`A ${sl.value} ${sl.value} 0 ${Oe} 1 ${Ze} ${pe}`,`L ${ye} ${Se}`,`A ${gt.value} ${gt.value} 0 ${Oe} 0 ${ve} ${Ye}`,"Z"].join(" "),Ee=$t(b);return r.push({path:Ae,color:Ee,strokeWidth:Dt.value,strokeColor:na(0,Ee),value:P,seriesName:C.name,opacity:.8,isHighlighted:Me.value===b,isDimmed:!1,isHidden:!1,startAngle:B,endAngle:H,midAngle:S}),r}if(qn.value&&t.length===2){const C=t[0],b=t[1],P=Math.min(100,Math.max(0,C.series.data[0]||0)),B=P/100*l;return r.push(m(o,o+B,C.originalIndex,C.series.name,P)),r.push(m(o,o+l,b.originalIndex,b.series.name,100)),r}const f=t.reduce((C,{series:b})=>C+(b.data[0]||0),0);return f===0?[]:(t.forEach(({series:C,originalIndex:b})=>{const P=C.data[0]||0,B=P/f*l,H=o,S=o+B,q=H+B/2,we=Ut.value+Math.cos(H)*sl.value,Ze=Pt.value+Math.sin(H)*sl.value,pe=Ut.value+Math.cos(S)*sl.value,ye=Pt.value+Math.sin(S)*sl.value,Se=Ut.value+Math.cos(S)*gt.value,ve=Pt.value+Math.sin(S)*gt.value,Ye=Ut.value+Math.cos(H)*gt.value,Oe=Pt.value+Math.sin(H)*gt.value,Ae=B>Math.PI?1:0,Ee=[`M ${we} ${Ze}`,`A ${sl.value} ${sl.value} 0 ${Ae} 1 ${pe} ${ye}`,`L ${Se} ${ve}`,`A ${gt.value} ${gt.value} 0 ${Ae} 0 ${Ye} ${Oe}`,"Z"].join(" "),Re=$t(b);r.push({path:Ee,color:Re,strokeWidth:Dt.value,strokeColor:na(r.length,Re),value:P,seriesName:C.name,opacity:.8,isHighlighted:Me.value===b,isDimmed:Me.value!==null&&Me.value!==b,isHidden:!1,startAngle:H,endAngle:S,midAngle:q}),o=S}),r)}),Ra=e.computed(()=>{const t=Mn.value;return qn.value&&t.length>=2?[{segment:t[1],originalIndex:1},{segment:t[0],originalIndex:0}]:t.map((o,l)=>({segment:o,originalIndex:l}))}),Fa=e.computed(()=>{if(!Qt.value||!al.value)return[];const t=_t.value,o=Ln.value,l=En.value,r=Zl.value,m=15,f=t*1.3,C=.55,b=(S,q)=>{const we=Ut.value+Math.cos(S.midAngle)*gt.value,Ze=Pt.value+Math.sin(S.midAngle)*gt.value,pe=Ut.value+Math.cos(S.midAngle)*(gt.value+o),ye=Pt.value+Math.sin(S.midAngle)*(gt.value+o),ve=pe+l*(q?1:-1),Ye=q?pe+m:pe-m,Oe=ye-r,Ae=`${S.seriesName}: ${_(S.value)}`,Ee=Ae.length*t*C;return{pointerStartX:we,pointerStartY:Ze,pointerEndX:pe,pointerEndY:ye,horizontalEndX:ve,horizontalEndY:ye,textX:Ye,textY:Oe,text:Ae,textWidth:Ee,textAnchor:q?"start":"end",isRightSide:q,pointerLineLength:Math.hypot(pe-we,ye-Ze),horizontalLineLength:Math.hypot(ve-pe,0)}},P=(S,q)=>{const we=Math.abs(S.textY-q.textY)<f,Ze=S.isRightSide?S.textX:S.textX-S.textWidth,pe=S.isRightSide?S.textX+S.textWidth:S.textX,ye=q.isRightSide?q.textX:q.textX-q.textWidth,Se=q.isRightSide?q.textX+q.textWidth:q.textX,ve=Ze<Se&&ye<pe;return we&&ve},B=Mn.value.filter(S=>!S.isHidden),H=[];for(let S=0;S<B.length;S++){const q=B[S];let we=Math.cos(q.midAngle)>=0;if(S>0){const pe=H[S-1],ye=b(q,we);P(pe,ye)&&(we=!we)}const Ze=b(q,we);H.push({...Ze,color:q.color,isHighlighted:q.isHighlighted,isDimmed:q.isDimmed})}return H}),Ia=t=>{if(!t||t.isHidden)return 0;const o=t.opacity||bn.value||.7;return Me.value===null||Me.value===void 0?o:Me.value!==null?t.seriesIndex===Me.value?Math.min(1,o+.1):Math.max(.5,o*.8):o},za=t=>{if(!t||t.isHidden)return 0;const o=t.radius>20?.9:.8;return Me.value!==null?t.seriesIndex===Me.value?Math.min(1,o+.1):o*.7:o},ga=(t,o)=>{if(t)try{if(Me.value===t.seriesIndex?Me.value=null:Me.value=t.seriesIndex,typeof window<"u"&&window.dispatchEvent){const l=new CustomEvent("dss-bubble-click",{detail:{bubble:t,originalEvent:o,chartId:F.chartId}});window.dispatchEvent(l)}}catch(l){console.error("Error in onBubbleClick:",l)}},Pa=(t,o)=>{const l=[`dss-bubble-fallback-${o}`];return t.isHighlighted&&l.push("dss-bubble-highlighted"),t.isDimmed&&l.push("dss-bubble-dimmed"),t.isHidden&&l.push("dss-bubble-hidden"),l.push(`dss-bubble-series-${t.seriesIndex}`),l.join(" ")},ya=(t,o)=>{if(!t||(o.stopPropagation(),Io.value=!0,Me.value=t.seriesIndex,nt.value.show=!1,!Pe.value))return;const l=o.target.closest(".dss-custom-chart-container");if(!l)return;const r=l.getBoundingClientRect();let m=o.clientX-r.left+10,f=o.clientY-r.top-10;const C=200,b=120;m+C>Ve.value&&(m=o.clientX-r.left-C-10),f+b>r.height&&(f=o.clientY-r.top-b-10),m<0&&(m=10),f<0&&(f=10);const P=nl.value,B=zl.value,H=P.map(S=>{const q=B[S]||S,we=ka(S,t);return we?{seriesName:t.seriesName,label:t.label,value:`${q}: ${we}`,color:t.color}:null}).filter(Boolean);kt.value={show:!0,x:m,y:f,title:t.label||t.seriesName||"",value:"",bubbleData:H,categoryIndex:void 0,spiderAreas:[]}},ka=(t,o)=>{let l;switch(t){case"x":l=o.originalX;break;case"y":l=o.originalY;break;case"size":l=o.originalSize;break;case"label":l=o.label;break;case"seriesName":l=o.seriesName;break;default:l=o[t]||""}const r=On.value[t];if(typeof r=="function")return r(l,o);if(typeof l=="number"){const m=l.toFixed(1);return z.value?m+z.value:m}return l?.toString()||""},Oa=()=>{if(!ul.value||!nt.value.data||nt.value.data.length===0)return"Bubbles";const t=[],o=new Set;return nt.value.data.forEach(l=>{if(l.seriesName&&l.label){const r=`${l.seriesName} - ${l.label}`;o.has(r)||(t.push(r),o.add(r))}else l.seriesName&&(o.has(l.seriesName)||(t.push(l.seriesName),o.add(l.seriesName)))}),t.length>0?t.join(" | "):"Bubbles"},Ca=(t,o)=>{t&&(Io.value=!1,Me.value=null,kt.value.show=!1,kt.value.bubbleData=[])},Wa=(t,o)=>{const l=o.target.closest(".dss-custom-chart-container");if(!l)return;const r=l.getBoundingClientRect(),m=mo(t.categoryIndex),f=t.description||t.comment||"";let C=o.clientX-r.left+15,b=o.clientY-r.top-10;const P=200,B=f?80:50;C+P>Ve.value&&(C=o.clientX-r.left-P-15),b+B>re.value&&(b=o.clientY-r.top-B-10),C<0&&(C=10),b<0&&(b=10),Ml.value={show:!0,x:C,y:b,categoryValue:m,description:f}},qa=()=>{Ml.value.show=!1},oo=e.computed(()=>F.categories.length||Math.max(...a.value.map(t=>t.data.length))),Za=e.computed(()=>{let t=0;return a.value.forEach(o=>{o.data.forEach(l=>{typeof l=="number"&&(t=Math.max(t,l))})}),t||100}),ba=e.computed(()=>{const t=[],o=oo.value;for(let l=0;l<o;l++){const r=l*2*Math.PI/o-Math.PI/2,m=Ut.value+Math.cos(r)*gt.value,f=Pt.value+Math.sin(r)*gt.value;t.push({x:m,y:f,angle:r,index:l})}return t}),Ua=e.computed(()=>{const t=[],o=oo.value;return ba.value.forEach((l,r)=>{const m=gt.value+15,f=r*2*Math.PI/o-Math.PI/2,C=Ut.value+Math.cos(f)*m,b=Pt.value+Math.sin(f)*m+5;let P="middle",B="middle";Math.abs(Math.cos(f))>.5&&(P=Math.cos(f)>0?"start":"end"),Math.abs(Math.sin(f))>.5&&(B=Math.sin(f)>0?"hanging":"auto"),t.push({x:C,y:b,text:F.categories[r]||`Axis ${r+1}`,anchor:P,baseline:B})}),t}),Xa=e.ref(new Set),Ya=(t,o,l)=>{const r=`current-${l}`,m=Xa.value.has(r),f=o.fillOpacity??Hl.value;return!m&&Me.value===null?f:o.isHighlighted||m?o.isComparison?f:f+.15:o.isDimmed?f*.3:f},xa=e.computed(()=>{if(!Bl.value)return[];const t=[],o=oo.value;return tn.value.map((r,m)=>({series:r,seriesIndex:m})).sort((r,m)=>{const f=i(r.series)?0:1,C=i(m.series)?0:1;return f-C}).forEach(({series:r,seriesIndex:m})=>{const f=i(r),C=[],b=[],P=[],B=Me.value===m,H=Me.value!==null&&Me.value!==m,S=zt.value.has(m);for(let q=0;q<o;q++){const we=r.data[q]||0,pe=we/Za.value*gt.value,ye=q*2*Math.PI/o-Math.PI/2,Se=Ut.value+Math.cos(ye)*pe,ve=Pt.value+Math.sin(ye)*pe;C.push(`${Se},${ve}`),b.push({x:Se,y:ve}),P.push({x:Se,y:ve,value:we,label:F.categories[q]||`Axis ${q+1}`,seriesName:r.name})}t.push({points:C.join(" "),polygonPoints:b,dataPoints:P,color:u(r,m),fillOpacity:f?c.value.fillOpacity:Hl.value,strokeDasharray:f?s(r)||c.value.strokeDasharray:null,pointRadius:d(r,f),seriesName:r.name,value:`${r.name}: ${r.data.join(", ")}`,isHighlighted:B,isDimmed:H,isHidden:S,isComparison:f,seriesIndex:m})}),t}),ja=(t,o)=>{if(!o||o.length<3)return!1;let l=!1;for(let r=0,m=o.length-1;r<o.length;m=r++){const f=o[r].x,C=o[r].y,b=o[m].x,P=o[m].y;C>t.y!=P>t.y&&t.x<(b-f)*(t.y-C)/(P-C)+f&&(l=!l)}return l},Ka=t=>{if(!Bl.value)return;const o=t.currentTarget.closest(".dss-custom-chart-container");if(!o)return;const l=o.getBoundingClientRect(),r=L.value?.getBoundingClientRect();if(!r)return;const m=t.clientX-r.left,f=t.clientY-r.top,C=xa.value.filter(b=>b.isHidden?!1:ja({x:m,y:f},b.polygonPoints));if(C.length>0){C.length,Me.value=C[0].seriesIndex;const b=t.clientX-l.left+10,P=t.clientY-l.top-10,B=C.length>1?460:260,H=70+oo.value*20;let S=b,q=P;S+B>Ve.value&&(S=t.clientX-l.left-B-10),q+H>re.value&&(q=t.clientY-l.top-H-10),S<0&&(S=10),q<0&&(q=10);const we=C.map(Ze=>({seriesName:Ze.seriesName,color:Ze.color,points:Ze.dataPoints.map(pe=>({label:pe.label,value:_(pe.value)}))}));kt.value={show:!0,x:S,y:q,title:"",value:"",bubbleData:[],spiderAreas:we}}else un()},Fo=e.computed(()=>{const t=U.value;return t.logos.map((o,l)=>{const r=F.series[o.seriesIndex];if(!r||!r.data||r.data.length===0||zt.value.has(o.seriesIndex))return null;let m,f;if(ol.value){let b=-1,P=null;for(let H=r.data.length-1;H>=0;H--)if(r.data[H]!==null&&r.data[H]!==void 0){b=H,P=r.data[H];break}if(b===-1||P===null)return null;const B=r.data.map((H,S)=>H==null?null:{x:vt(S),y:gl(r,H),index:S}).filter(H=>H!==null);if(t.animations.enabled&&!$n.value&&t.animations.type==="draw"&&t.chart.type==="line"&&(Ot.value.isAnimating||!Ot.value.hasAnimated))if(Ot.value.isAnimating){const H=Ot.value.currentFrame/Ot.value.totalFrames,S=ca(t.animations.easing,Math.min(H,1)),q=as(B,S);m=q.x+(o.offsetX||0),f=q.y+(o.offsetY||0)}else m=B[0].x+(o.offsetX||0),f=B[0].y+(o.offsetY||0);else m=vt(b)+(o.offsetX||0),f=Xt(P)+(o.offsetY||0)}else if(al.value||Bl.value){const b=Math.PI*2/t.logos.length*l;m=Ut.value+Math.cos(b)*(gt.value+30)+(o.offsetX||0),f=Pt.value+Math.sin(b)*(gt.value+30)+(o.offsetY||0)}return{...o,x:m,y:f,seriesIndex:o.seriesIndex}}).filter(Boolean)}),Ga=t=>{const o=document.querySelector(`.dss-logo-fallback-${t}`),l=document.querySelector(`.dss-logo-image-${t}`);o&&(o.style.opacity="0"),l&&(l.style.opacity="1")},Qa=t=>{console.warn(`Logo ${t} failed to load, keeping fallback circle`);const o=document.querySelector(`.dss-logo-image-${t}`);o&&(o.style.display="none")},ra=t=>{zt.value.has(t)?zt.value.delete(t):zt.value.add(t)},Ja=e.computed(()=>{if(!kt.value.show&&!(Xe.value&&nt.value.show&&!ie.value.isZooming))return{display:"none"};let t,o;if(Xe.value&&nt.value.show&&!ie.value.isZooming){t=nt.value.x+15,o=R.value.top;const l=ul.value?200:150;t+l>Ve.value&&(t=nt.value.x-l-15),t<0&&(t=10),o<10&&(o=10)}else t=kt.value.x,o=kt.value.y;return{left:t+"px",top:o+"px"}}),_n=(t,o)=>{if(!Pe.value||go.value)return;const r=o.target.closest(".dss-custom-chart-container").getBoundingClientRect();let m=o.clientX-r.left+10,f=o.clientY-r.top-10;const C=200,b=120,P=Ve.value,B=re.value;m+C>P&&(m=o.clientX-r.left-C-10),f+b>B&&(f=o.clientY-r.top-b-10),m<0&&(m=10),f<0&&(f=10);let H;typeof t.categoryIndex=="number"?H=t.categoryIndex:typeof t.dataIndex=="number"?H=t.dataIndex:t.label&&F.categories.includes(t.label)&&(H=F.categories.indexOf(t.label));let S=t.seriesName||t.label||"";(dl.value||Ce.value==="bar")&&t.label&&(S=t.label),t.tooltipTitle&&(S=t.tooltipTitle),kt.value={show:!0,x:m,y:f,title:S,value:_(t.value)||"",categoryIndex:H,spiderAreas:[]}},ia=e.ref(!1),Io=e.ref(!1),un=()=>{kt.value.show=!1,kt.value.spiderAreas=[],kt.value.bubbleData=[],nt.value.show=!1,ia.value||(Me.value=null)},go=e.ref(!1),yo=(t,o)=>{go.value=!0,kt.value.show=!1,nt.value.show=!1;const r=o.target.closest(".dss-custom-chart-container").getBoundingClientRect();let m=o.clientX-r.left+15,f=o.clientY-r.top-10;const C=250;m+C>Ve.value&&(m=o.clientX-r.left-C-15),m<0&&(m=10),f<0&&(f=10),Dn.value={show:!0,x:m,y:f,content:t.texts,count:t.totalCount}},ko=()=>{go.value=!1,Dn.value.show=!1},Ot=e.ref({isAnimating:!1,currentFrame:0,totalFrames:0,animationId:null,hasAnimated:!1}),ca=(t,o)=>{switch(t){case"linear":return o;case"ease":return o<.5?2*o*o:-1+(4-2*o)*o;case"ease-in":return o*o;case"ease-out":return o*(2-o);case"ease-in-out":return o<.5?2*o*o:-1+(4-2*o)*o;default:return o}},$n=e.computed(()=>dn.value?window.matchMedia("(prefers-reduced-motion: reduce)").matches:!1),wa=()=>{if(!Vl.value||$n.value){Ot.value.hasAnimated=!0,an.value&&(Rl.value=1);return}an.value&&(Rl.value=0),Ot.value.isAnimating=!0,Ot.value.currentFrame=0,Ot.value.totalFrames=Math.ceil(tl.value/16.67);const t=()=>{const o=Ot.value.currentFrame/Ot.value.totalFrames,l=ca(on.value,Math.min(o,1));es(l),an.value&&(Rl.value=l),o<1?(Ot.value.currentFrame++,Ot.value.animationId=requestAnimationFrame(t)):ts()};Ot.value.animationId=requestAnimationFrame(t)},es=t=>{const o=O.value;o&&o.style.setProperty("--dss-animation-progress",t)},ts=()=>{Ot.value.isAnimating=!1,Ot.value.hasAnimated=!0,an.value&&(Rl.value=1),Ot.value.animationId&&(cancelAnimationFrame(Ot.value.animationId),Ot.value.animationId=null)},ua=e.computed(()=>!al.value||Ot.value.hasAnimated?!0:an.value?Rl.value>=1:Cn.value?Fn.value>=1:!0),Ea=e.computed(()=>Qt.value&&ua.value),zo=e.ref(!1);e.watch(Ea,t=>{t?(zo.value=!1,e.nextTick(()=>{requestAnimationFrame(()=>{zo.value=!0})})):zo.value=!1},{immediate:!0});const ls=e.computed(()=>{if(!Vl.value||$n.value||Ot.value.hasAnimated)return{};const t={};return t["--dss-animation-duration"]=`${tl.value}ms`,t["--dss-animation-easing"]=ns(on.value),t["--dss-stagger-delay"]=`${xl.value}ms`,t}),ns=t=>({linear:"linear",ease:"ease","ease-in":"ease-in","ease-out":"ease-out","ease-in-out":"ease-in-out"})[t]||"ease-out",os=()=>{if(!Vl.value||$n.value)return"";const t=["dss-chart-animated"];return Ot.value.hasAnimated||t.push(`dss-animate-${Nl.value}`),Ot.value.hasAnimated||(al.value&&Ce.value!=="semi-radial"?t.push("dss-animate-fill"):al.value||t.push(`dss-animate-${Nl.value}`)),Ot.value.isAnimating&&t.push("dss-is-animating"),t.join(" ")};e.watch(()=>F.series,(t,o)=>{Fl.value&&o&&Ot.value.hasAnimated&&(Ot.value.hasAnimated=!1,e.nextTick(()=>{setTimeout(()=>wa(),jl.value)}))},{deep:!0}),e.watch(()=>ie.value.isZooming,(t,o)=>{o&&!t&&setTimeout(()=>{bo()},50)}),e.watch(()=>[ie.value.scale,ie.value.offsetX],()=>{!ie.value.isZooming&&!ie.value.isDragging&&bo()},{flush:"post"}),e.watch([Zt,Ue],([t,o])=>{ie.value.minScale=t,ie.value.maxScale=o,(ie.value.scale<t||ie.value.scale>o)&&Bn()},{immediate:!0}),e.watch(()=>F.locale,t=>{t&&t!==V.value&&(V.value=t)},{immediate:!0}),e.watch(()=>ft.value.show,t=>{t?e.nextTick(()=>{document.addEventListener("click",Kn)}):document.removeEventListener("click",Kn)}),e.onMounted(()=>{Me.value=null,an.value&&(!Vl.value||$n.value)&&(Rl.value=1),Eo(),O.value&&typeof ResizeObserver<"u"&&(v=new ResizeObserver(t=>{const o=t[0];!o||!o.contentRect||(be&&cancelAnimationFrame(be),be=requestAnimationFrame(()=>{be=null;const{width:l,height:r}=o.contentRect;rt.value=Math.round(l),ee.value=Math.round(r),fe.value&&(Le.value=fe.value.offsetHeight||ke)}))}),v.observe(O.value)),Vl.value&&!$n.value?Ce.value==="semi-radial"?setTimeout(()=>Jn(),jl.value):setTimeout(()=>wa(),jl.value):(Ot.value.hasAnimated=!0,Ce.value==="semi-radial"&&(Fn.value=1)),document.addEventListener("mousemove",Sa),document.addEventListener("mouseup",Va),document.addEventListener("click",Vo)}),e.onUnmounted(()=>{be&&cancelAnimationFrame(be),v&&O.value&&(v.unobserve(O.value),v.disconnect(),v=null),Ot.value.animationId&&cancelAnimationFrame(Ot.value.animationId),Un&&(cancelAnimationFrame(Un),Un=null),ie.value.zoomTimeout&&clearTimeout(ie.value.zoomTimeout),document.removeEventListener("mousemove",Sa),document.removeEventListener("mouseup",Va),document.removeEventListener("click",Vo),document.removeEventListener("click",Kn)});const Sa=t=>{if(ie.value.isDragging&&ie.value.scale>1&&ol.value){nt.value.show=!1;const o=t.clientX-ie.value.lastMouseX,{minX:l,maxX:r}=He.value,m=r-l||1,C=o*.8;ie.value.offsetX+=C;const b=m/ie.value.scale,P=m-b,B=0,H=-P/m*R.value.width,S=B;ie.value.offsetX=Math.max(H,Math.min(S,ie.value.offsetX)),ie.value.lastMouseX=t.clientX,ie.value.lastMouseY=t.clientY}},Va=()=>{ie.value.isDragging&&(ie.value.isDragging=!1,setTimeout(()=>{!ie.value.isDragging&&ie.value.isZooming},100))},as=(t,o)=>{const l=t.filter(b=>b!=null);if(!l||l.length===0)return{x:0,y:0};if(l.length===1||o<=0)return l[0];if(o>=1)return l[l.length-1];let r=0;const m=[];for(let b=1;b<l.length;b++){const P=l[b].x-l[b-1].x,B=l[b].y-l[b-1].y,H=Math.sqrt(P*P+B*B);m.push(H),r+=H}const f=r*o;let C=0;for(let b=0;b<m.length;b++){const P=C+m[b];if(f<=P){const B=(f-C)/m[b],H=l[b],S=l[b+1];return{x:H.x+(S.x-H.x)*B,y:H.y+(S.y-H.y)*B}}C=P}return l[l.length-1]};return(t,o)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{class:e.normalizeClass(["dss-custom-chart-container",[os(),{"dss-chart-fill-width":ze.value,"dss-chart-fill-height":qe.value,"dss-chart-compact":al.value&&!W.value}]]),style:e.normalizeStyle({width:ze.value?"100%":Ve.value+"px",height:Qe.value,...ze.value||qe.value?{overflow:al.value?"visible":"hidden",maxWidth:"100%",maxHeight:"100%"}:{},...ls.value,cursor:cl()}),"data-chart-type":Ce.value,ref_key:"containerEl",ref:O,onWheel:rn,onMousedown:yn,onMousemove:Z,onMouseup:Nn,onMouseleave:he,onDblclick:Bn,onContextmenu:e.withModifiers(at,["prevent"]),onClick:e.withModifiers(Bt,["left"]),onWheelCapture:rn},[e.createElementVNode("div",{class:"dss-chart-header",ref_key:"headerEl",ref:fe},[e.createElementVNode("div",tr,[ut.value?(e.openBlock(),e.createElementBlock("div",lr,e.toDisplayString(ut.value),1)):e.createCommentVNode("",!0),ht.value?(e.openBlock(),e.createElementBlock("div",nr,e.toDisplayString(ht.value),1)):e.createCommentVNode("",!0)]),W.value&&G.value==="top"?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["dss-chart-legend",{"dss-legend-horizontal":Ne.value==="horizontal","dss-legend-vertical":Ne.value==="vertical","dss-legend-top":G.value==="top","dss-legend-bottom":G.value==="bottom"}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(F.series,(l,r)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-${r}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":zt.value.has(r),"dss-legend-hovered":Me.value===r,"dss-legend-dimmed":Me.value!==null&&Me.value!==r}]),onClick:m=>ra(r),onMouseenter:m=>g(r),onMouseleave:w,style:e.normalizeStyle({animationDelay:`${r*100}ms`})},[e.createElementVNode("div",{class:e.normalizeClass(["dss-legend-color",{"dss-legend-color--comparison":Bl.value&&i(l)}]),style:e.normalizeStyle({backgroundColor:Bl.value&&i(l)?"transparent":p(l,r),borderColor:p(l,r)})},null,6),e.createElementVNode("span",ar,e.toDisplayString(l.name),1)],46,or))),128))],2)):e.createCommentVNode("",!0),W.value&&(G.value==="left"||G.value==="right")?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["dss-chart-legend-side",{"dss-legend-left":G.value==="left","dss-legend-right":G.value==="right"}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(F.series,(l,r)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-${r}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":zt.value.has(r),"dss-legend-hovered":Me.value===r,"dss-legend-dimmed":Me.value!==null&&Me.value!==r}]),onClick:m=>ra(r),onMouseenter:m=>g(r),onMouseleave:w,style:e.normalizeStyle({animationDelay:`${r*100}ms`})},[e.createElementVNode("div",{class:e.normalizeClass(["dss-legend-color",{"dss-legend-color--comparison":Bl.value&&i(l)}]),style:e.normalizeStyle({backgroundColor:Bl.value&&i(l)?"transparent":p(l,r),borderColor:p(l,r)})},null,6),e.createElementVNode("span",rr,e.toDisplayString(l.name),1)],46,sr))),128))],2)):e.createCommentVNode("",!0)],512),E.showAddMarkerButton&&ql.value&&rl.value.addMarker&&(ol.value||ul.value)&&!Ol.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-add-marker-button",onClick:Qo,title:e.unref($)("chart.contextMenu.addMarker")},[e.createElementVNode("img",{src:Kl.value,class:"dss-add-marker-button-icon",alt:"Marker Icon",style:{width:"100%",height:"100%","object-fit":"contain","border-radius":"50%","pointer-events":"none"}},null,8,cr),o[4]||(o[4]=e.createElementVNode("svg",{width:"18",height:"18",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M10 4V16M4 10H16",stroke:"hsl(60, 2%, 47%)","stroke-width":"2","stroke-linecap":"round"})],-1))],8,ir)):e.createCommentVNode("",!0),e.createElementVNode("div",ur,[ul.value&&dt.value?(e.openBlock(),e.createElementBlock("div",dr,"Bubble size: "+e.toDisplayString(dt.value),1)):e.createCommentVNode("",!0),(e.openBlock(),e.createElementBlock("svg",{width:Ve.value,height:re.value,class:"dss-chart-svg","data-smooth":xe.value,"data-animated":Vl.value,ref_key:"svgEl",ref:L},[e.createElementVNode("defs",null,[e.createElementVNode("clipPath",{id:Y.value},[e.createElementVNode("rect",{x:0,y:R.value.top,width:Ve.value,height:R.value.height*4},null,8,fr)],8,pr),Cn.value?(e.openBlock(),e.createElementBlock("clipPath",{key:0,id:Wn.value},[e.createElementVNode("path",{d:Bo.value},null,8,hr)],8,vr)):e.createCommentVNode("",!0),an.value?(e.openBlock(),e.createElementBlock("clipPath",{key:1,id:Qn.value},[e.createElementVNode("path",{d:Jo.value},null,8,yr)],8,gr)):e.createCommentVNode("",!0)]),ol.value||ul.value?(e.openBlock(),e.createElementBlock("g",kr,[ge.value?(e.openBlock(),e.createElementBlock("g",{key:0,class:"dss-grid-lines","clip-path":me.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList($o.value,(l,r)=>(e.openBlock(),e.createElementBlock("line",{key:`h-grid-${r}`,x1:R.value.left,x2:R.value.right,y1:l.y,y2:l.y,stroke:"#e0e0e0","stroke-width":"1","stroke-dasharray":"4,2",style:e.normalizeStyle({animationDelay:`${r*50}ms`})},null,12,br))),128))],8,Cr)):e.createCommentVNode("",!0),Ol.value&&Lo.value.length?(e.openBlock(),e.createElementBlock("g",{key:1,class:"dss-stepbar-axis-bars","clip-path":me.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Lo.value,(l,r)=>(e.openBlock(),e.createElementBlock("line",{key:`stepbar-axis-bar-${r}`,x1:R.value.left,x2:R.value.right,y1:l.y,y2:l.y,stroke:St.value,"stroke-width":It.value,"stroke-dasharray":Nt.value,opacity:At.value},null,8,wr))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ao.value,(l,r)=>(e.openBlock(),e.createElementBlock("line",{key:`stepbar-vertical-axis-bar-${r}`,x1:l.x,x2:l.x,y1:R.value.top,y2:R.value.bottom,stroke:St.value,"stroke-width":It.value,"stroke-dasharray":Nt.value,opacity:At.value*.7},null,8,Er))),128))],8,xr)):e.createCommentVNode("",!0),e.createElementVNode("g",Sr,[e.createElementVNode("line",{x1:R.value.left,x2:R.value.right,y1:R.value.bottom,y2:R.value.bottom,stroke:"#ccc","stroke-width":"1"},null,8,Vr),e.createElementVNode("line",{x1:R.value.left,x2:R.value.left,y1:R.value.top,y2:R.value.bottom,stroke:"#ccc","stroke-width":"1"},null,8,Nr),D.value?(e.openBlock(),e.createElementBlock("line",{key:0,x1:R.value.right,x2:R.value.right,y1:R.value.top,y2:R.value.bottom,stroke:"#ccc","stroke-width":"1"},null,8,Br)):e.createCommentVNode("",!0)]),e.createElementVNode("g",Mr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(To.value,(l,r)=>(e.openBlock(),e.createElementBlock("text",{key:`x-${r}`,x:l.x,y:l.y,"text-anchor":"middle","font-size":"12",fill:"#666",style:e.normalizeStyle({animationDelay:`${r*100}ms`})},e.toDisplayString(l.text),13,_r))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(no.value,(l,r)=>(e.openBlock(),e.createElementBlock("text",{key:`y-${r}`,x:l.x,y:l.y,"text-anchor":"end","font-size":"12",fill:"#666","dominant-baseline":"middle",style:e.normalizeStyle({animationDelay:`${r*80}ms`})},e.toDisplayString(l.text),13,$r))),128)),D.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(cn.value,(l,r)=>(e.openBlock(),e.createElementBlock("text",{key:`y-secondary-${r}`,x:l.x,y:l.y,"text-anchor":"start","font-size":"12",fill:"#666","dominant-baseline":"middle",style:e.normalizeStyle({animationDelay:`${r*80}ms`})},e.toDisplayString(l.text),13,Lr))),128)):e.createCommentVNode("",!0),Wt.value?(e.openBlock(),e.createElementBlock("text",{key:1,x:R.value.left+R.value.width/2,y:R.value.bottom+45,"text-anchor":"middle","font-size":"14",fill:"#666"},e.toDisplayString(Wt.value),9,Ar)):e.createCommentVNode("",!0),qt.value?(e.openBlock(),e.createElementBlock("text",{key:2,x:15,y:R.value.top+12+R.value.height/2,"text-anchor":"middle","font-size":"14",fill:"#666",transform:`rotate(-90, 15, ${R.value.top+R.value.height/2})`},e.toDisplayString(qt.value),9,Tr)):e.createCommentVNode("",!0),D.value&&wt.value?(e.openBlock(),e.createElementBlock("text",{key:3,x:Ve.value-15,y:R.value.top+12+R.value.height/2,"text-anchor":"middle","font-size":"14",fill:"#666",transform:`rotate(90, ${Ve.value-15}, ${R.value.top+R.value.height/2})`},e.toDisplayString(wt.value),9,Dr)):e.createCommentVNode("",!0)]),Jt.value.length>0?(e.openBlock(),e.createElementBlock("g",Hr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Jt.value,l=>(e.openBlock(),e.createElementBlock("g",{key:`flag-group-${l.categoryIndex}`},[e.createElementVNode("g",{"clip-path":me.value},[l.hasManual?(e.openBlock(),e.createElementBlock("line",{key:0,x1:l.x,x2:l.x,y1:R.value.bottom,y2:R.value.top,stroke:"#698dbe","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:r=>yo(l,r),onMouseleave:ko},null,40,Fr)):e.createCommentVNode("",!0),l.hasAuto&&!l.hasManual?(e.openBlock(),e.createElementBlock("line",{key:1,x1:l.x,x2:l.x,y1:R.value.bottom,y2:R.value.top,stroke:"#a1d499","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:r=>yo(l,r),onMouseleave:ko},null,40,Ir)):e.createCommentVNode("",!0),l.hasAuto&&l.hasManual?(e.openBlock(),e.createElementBlock("line",{key:2,x1:l.x,x2:l.x,y1:R.value.bottom,y2:R.value.top,stroke:"#698dbe","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:r=>yo(l,r),onMouseleave:ko},null,40,zr)):e.createCommentVNode("",!0)],8,Rr),l.hasManual&&l.hasAuto?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:l.x+8,cy:Math.max(15,R.value.top-10),r:"14",fill:"#a1d499",stroke:"#fafafa","stroke-width":"2",class:"flag-count-circle",onMouseover:r=>yo(l,r),onMouseleave:ko},null,40,Pr)):e.createCommentVNode("",!0),e.createElementVNode("circle",{cx:l.x,cy:Math.max(15,R.value.top-10),r:"14",fill:l.hasManual&&l.hasAuto||l.hasManual?"#698dbe":"#a1d499",stroke:"#fafafa","stroke-width":"2",class:"dss-flag-count-indicator",onMouseover:r=>yo(l,r),onMouseleave:ko},null,40,Or),e.createElementVNode("text",{x:l.x,y:Math.max(15,R.value.top-5),"text-anchor":"middle","font-size":"12","font-weight":"bold",fill:"#fafafa",class:"dss-flag-count-text","pointer-events":"none"},e.toDisplayString(l.totalCount),9,Wr)]))),128))])):e.createCommentVNode("",!0),e.createElementVNode("g",{class:"dss-chart-data","clip-path":me.value},[_l.value?(e.openBlock(),e.createElementBlock("g",Zr,[e.createElementVNode("g",{class:e.normalizeClass(["dss-bar-chart",{"dss-horizontal-bars":dl.value}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ha.value,(l,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`mixed-bar-${r}`},[l.isSmooth?(e.openBlock(),e.createElementBlock("path",{key:0,d:l.barPath,stroke:"#fafafa","stroke-width":"1",class:e.normalizeClass({"dss-bar-highlighted":l.isHighlighted,"dss-bar-dimmed":l.isDimmed,"dss-bar-hidden":l.isHidden}),style:e.normalizeStyle({fill:l.color,fillOpacity:l.isDimmed?.4:1,animationDelay:`${l.animationDelay}ms`}),onMouseover:m=>_n(l,m),onMouseleave:un},null,46,Ur)):(e.openBlock(),e.createElementBlock("rect",{key:1,x:l.x,y:l.y,width:l.width,height:l.height,fill:l.color,stroke:"#fafafa","stroke-width":"1",class:e.normalizeClass({"dss-bar-highlighted":l.isHighlighted,"dss-bar-dimmed":l.isDimmed,"dss-bar-hidden":l.isHidden}),style:e.normalizeStyle({animationDelay:`${l.animationDelay}ms`}),onMouseover:m=>_n(l,m),onMouseleave:un},null,46,Xr))],64))),128))],2),e.createElementVNode("g",Yr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(fa.value,(l,r)=>(e.openBlock(),e.createElementBlock("path",{key:`mixed-line-${r}`,d:l.path,stroke:l.color,"stroke-width":l.isHighlighted?We.value+2:We.value,"stroke-dasharray":l.strokeDasharray,fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass({"dss-series-highlighted":l.isHighlighted,"dss-series-dimmed":l.isDimmed,"dss-series-hidden":l.isHidden}),style:e.normalizeStyle({"--dss-path-length":l.pathLength,animationDelay:`${l.animationDelay}ms`})},null,14,jr))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(va.value,(l,r)=>(e.openBlock(),e.createElementBlock("path",{key:`mixed-gap-connector-${r}`,d:l.path,stroke:l.color,"stroke-width":l.isHighlighted?We.value+2:We.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round","stroke-dasharray":"15, 10, 5, 10",opacity:l.isHighlighted?0:.5,class:e.normalizeClass({"dss-gap-connector":!0,"dss-series-dimmed":l.isDimmed,"dss-series-hidden":l.isHidden}),style:e.normalizeStyle({animationDelay:`${l.animationDelay}ms`,transition:"opacity 0.2s ease"})},null,14,Kr))),128)),Lt.value>0||ne.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(Ha.value,(l,r)=>(e.openBlock(),e.createElementBlock("circle",{key:`mixed-point-${r}`,cx:l.x,cy:l.y,r:K(l.isHighlighted?j(l,Lt.value)+2:j(l,Lt.value)),fill:l.color,stroke:"none",class:e.normalizeClass({"dss-point-highlighted":l.isHighlighted,"dss-point-dimmed":l.isDimmed,"dss-point-hidden":l.isHidden}),style:e.normalizeStyle({animationDelay:`${l.animationDelay}ms`}),onMouseover:m=>_n(l,m),onMouseleave:un},null,46,Gr))),128)):e.createCommentVNode("",!0)])])):Ce.value==="line"?(e.openBlock(),e.createElementBlock("g",Qr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ta.value,(l,r)=>(e.openBlock(),e.createElementBlock("path",{key:`anim-${r}`,d:l.path,stroke:l.color,"stroke-width":We.value,"stroke-dasharray":l.strokeDasharray,fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass(["dss-line-animation-overlay",{"dss-animation-complete":Ot.value.hasAnimated}]),style:e.normalizeStyle({"--dss-path-length":l.pathLength,animationDelay:`${l.animationDelay}ms`})},null,14,Jr))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(fa.value,(l,r)=>(e.openBlock(),e.createElementBlock("path",{key:`line-${r}`,d:l.path,stroke:l.color,"stroke-width":l.isHighlighted?We.value+2:We.value,"stroke-dasharray":l.strokeDasharray,fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass({"dss-series-highlighted":l.isHighlighted,"dss-series-dimmed":l.isDimmed,"dss-series-hidden":l.isHidden}),style:e.normalizeStyle({"--dss-path-length":l.pathLength,animationDelay:`${l.animationDelay}ms`})},null,14,ei))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(va.value,(l,r)=>(e.openBlock(),e.createElementBlock("path",{key:`gap-connector-${r}`,d:l.path,stroke:l.color,"stroke-width":l.isHighlighted?We.value+2:We.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round","stroke-dasharray":"15, 10, 5, 10",opacity:l.isHighlighted?0:.5,class:e.normalizeClass({"dss-gap-connector":!0,"dss-series-dimmed":l.isDimmed,"dss-series-hidden":l.isHidden}),style:e.normalizeStyle({animationDelay:`${l.animationDelay}ms`,transition:"opacity 0.2s ease"})},null,14,ti))),128)),Lt.value>0||ne.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(Da.value,(l,r)=>(e.openBlock(),e.createElementBlock("circle",{key:`point-${r}`,cx:l.x,cy:l.y,r:K(l.isHighlighted?j(l,Lt.value)+2:j(l,Lt.value)),fill:l.color,stroke:"none",class:e.normalizeClass({"dss-point-highlighted":l.isHighlighted,"dss-point-dimmed":l.isDimmed,"dss-point-hidden":l.isHidden}),style:e.normalizeStyle({animationDelay:`${l.animationDelay}ms`}),onMouseover:m=>_n(l,m),onMouseleave:un},null,46,li))),128)):e.createCommentVNode("",!0)])):Ce.value==="area"?(e.openBlock(),e.createElementBlock("g",ni,[e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(aa.value,(l,r)=>(e.openBlock(),e.createElementBlock("mask",{key:`mask-${r}`,id:`area-mask-${r}-${E.chartId}`},[e.createElementVNode("rect",{x:R.value.left-10,y:R.value.top-10,width:R.value.width+20,height:R.value.height+20,fill:"#fafafa",class:"dss-area-mask-rect",style:e.normalizeStyle({"--dss-mask-width":`${R.value.width+20}px`})},null,12,ai)],8,oi))),128))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(aa.value,(l,r)=>(e.openBlock(),e.createElementBlock("path",{key:`area-fill-${r}`,d:l.areaPath,fill:l.color,"fill-opacity":l.isHighlighted?de.value+.2:de.value,mask:`url(#area-mask-${r}-${E.chartId})`,class:e.normalizeClass({"dss-area-fill-smooth":!0,"dss-series-highlighted":l.isHighlighted,"dss-series-dimmed":l.isDimmed,"dss-series-hidden":l.isHidden})},null,10,si))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(aa.value,(l,r)=>(e.openBlock(),e.createElementBlock("path",{key:`area-line-${r}`,d:l.linePath,stroke:l.color,"stroke-width":l.isHighlighted?We.value+1:We.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass({"dss-area-line-animated":!0,"dss-series-highlighted":l.isHighlighted,"dss-series-dimmed":l.isDimmed,"dss-series-hidden":l.isHidden}),style:e.normalizeStyle({"--dss-path-length":l.pathLength,animationDelay:`${r*xl.value}ms`})},null,14,ri))),128))])):Ce.value==="stepbar"?(e.openBlock(),e.createElementBlock("g",ii,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(sa.value,l=>(e.openBlock(),e.createElementBlock("g",{key:l.key,class:"dss-stepbar-column"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.segments,r=>(e.openBlock(),e.createElementBlock("rect",{key:r.key,x:r.x,y:r.y,width:r.width,height:r.height,rx:r.radius,ry:r.radius,fill:r.color,stroke:"#fafafa","stroke-width":"1",class:e.normalizeClass({"dss-bar-highlighted":r.isHighlighted,"dss-bar-dimmed":r.isDimmed,"dss-bar-hidden":r.isHidden}),style:e.normalizeStyle({fillOpacity:r.isDimmed?.4:1,animationDelay:`${r.animationDelay}ms`}),onMouseover:m=>_n(r,m),onMouseleave:un},null,46,ci))),128)),l.maxMarker?(e.openBlock(),e.createElementBlock("g",{key:0,class:"dss-stepbar-marker",transform:`translate(${l.maxMarker.x}, ${l.maxMarker.y})`,style:e.normalizeStyle({animationDelay:`${l.maxMarker.animationDelay}ms`})},[e.createElementVNode("circle",{r:l.maxMarker.radius,fill:l.maxMarker.backgroundColor,stroke:l.maxMarker.borderColor,"stroke-width":l.maxMarker.borderWidth},null,8,di),l.maxMarker.icon?(e.openBlock(),e.createElementBlock("text",{key:0,x:"0",y:"0","text-anchor":"middle","dominant-baseline":"central","font-size":l.maxMarker.fontSize,"font-weight":"700",fill:l.maxMarker.color},e.toDisplayString(l.maxMarker.icon),9,mi)):e.createCommentVNode("",!0)],12,ui)):e.createCommentVNode("",!0)]))),128))])):Ce.value==="bar"?(e.openBlock(),e.createElementBlock("g",{key:4,class:e.normalizeClass({"dss-horizontal-bars":dl.value})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ha.value,(l,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`bar-${r}`},[l.isSmooth?(e.openBlock(),e.createElementBlock("path",{key:0,d:l.barPath,fill:l.color,stroke:"#fafafa","stroke-width":"1",class:e.normalizeClass({"dss-bar-highlighted":l.isHighlighted,"dss-bar-dimmed":l.isDimmed,"dss-bar-hidden":l.isHidden}),style:e.normalizeStyle({animationDelay:`${l.animationDelay}ms`}),onMouseover:m=>_n(l,m),onMouseleave:un},null,46,pi)):(e.openBlock(),e.createElementBlock("rect",{key:1,x:l.x,y:l.y,width:l.width,height:l.height,stroke:"#fafafa","stroke-width":"1",class:e.normalizeClass({"dss-bar-highlighted":l.isHighlighted,"dss-bar-dimmed":l.isDimmed,"dss-bar-hidden":l.isHidden}),style:e.normalizeStyle({fill:l.color,fillOpacity:l.isDimmed?.4:1,animationDelay:`${l.animationDelay}ms`}),onMouseover:m=>_n(l,m),onMouseleave:un},null,46,fi))],64))),128))],2)):e.createCommentVNode("",!0)],8,qr),Xe.value&&nt.value.show&&!ie.value.isZooming?(e.openBlock(),e.createElementBlock("g",{key:3,class:"dss-crosshair","clip-path":me.value},[e.createElementVNode("line",{x1:nt.value.x,x2:nt.value.x,y1:R.value.top,y2:R.value.bottom,stroke:Et.value,"stroke-width":"1","stroke-dasharray":"4,4",opacity:"0.8"},null,8,hi),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(nt.value.data,(l,r)=>(e.openBlock(),e.createElementBlock("circle",{key:`dss-crosshair-point-${r}`,cx:nt.value.x,cy:l.y,r:K(Lt.value+2),fill:l.color,stroke:"none",opacity:"0.9"},null,8,gi))),128))],8,vi)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),ul.value?(e.openBlock(),e.createElementBlock("g",yi,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ro.value,(l,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`bubble-${r}`},[l?(e.openBlock(),e.createElementBlock("g",ki,[e.createElementVNode("circle",{cx:l.x,cy:l.y,r:K(l.radius),fill:l.color,"fill-opacity":Ia(l),stroke:l.color,"stroke-width":"1","stroke-opacity":"0.8",class:e.normalizeClass(Pa(l,r)),style:{cursor:"pointer",transition:"all 0.3s ease"},onMouseenter:m=>ya(l,m),onMouseleave:m=>Ca(l),onClick:m=>ga(l,m)},null,42,Ci),l.imageUrl?(e.openBlock(),e.createElementBlock("image",{key:0,x:l.x-l.radius*.65,y:l.y-l.radius*.65,width:l.radius*1.3,height:l.radius*1.3,"xlink:href":l.imageUrl,class:e.normalizeClass(`dss-bubble-image-${r} ${l.isHighlighted?"dss-bubble-highlighted":""} ${l.isDimmed?"dss-bubble-dimmed":""} ${l.isHidden?"dss-bubble-hidden":""}`),"clip-path":`circle(${l.radius*.65}px at ${l.radius*.65}px ${l.radius*.65}px)`,style:e.normalizeStyle({cursor:"pointer",transition:"all 0.3s ease",opacity:za(l)}),onLoad:m=>la(r),onError:m=>_o(r),onMouseenter:m=>ya(l,m),onMouseleave:m=>Ca(l),onClick:m=>ga(l,m)},null,46,bi)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],64))),128))])):e.createCommentVNode("",!0),al.value?(e.openBlock(),e.createElementBlock("g",{key:2,class:"radial-chart",transform:No.value},[Ce.value==="radial"?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:Ut.value,cy:Pt.value,r:gt.value,fill:"none",stroke:"#e0e0e0","stroke-width":"1"},null,8,wi)):e.createCommentVNode("",!0),e.createElementVNode("g",{class:"dss-radial-data","data-chart-type":Ce.value,"clip-path":ea.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ra.value,(l,r)=>(e.openBlock(),e.createElementBlock("path",{key:`radial-${l.originalIndex}-${r}`,d:l.segment.path,fill:l.segment.color,"fill-opacity":l.segment.isHighlighted?(l.segment.opacity||.8)+.2:l.segment.opacity||.8,stroke:l.segment.strokeWidth?l.segment.strokeColor||l.segment.color:"none","stroke-width":l.segment.strokeWidth||0,"clip-path":Zn(l.originalIndex),class:e.normalizeClass({"dss-series-highlighted":l.segment.isHighlighted,"dss-series-dimmed":l.segment.isDimmed,"dss-series-hidden":l.segment.isHidden}),onMouseover:m=>_n(l.segment,m),onMouseleave:un},null,42,Si))),128))],8,Ei),vn.value&&ua.value?(e.openBlock(),e.createElementBlock("g",Vi,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ql.value,(l,r)=>e.withDirectives((e.openBlock(),e.createElementBlock("text",{key:`radial-segment-label-${r}`,x:l.x,y:l.y,"text-anchor":"middle","dominant-baseline":"middle",class:"dss-radial-segment-data-label",style:e.normalizeStyle({fill:l.contrastColor})},e.toDisplayString(l.value),13,Ni)),[[e.vShow,l.show]])),128))])):e.createCommentVNode("",!0),An.value&&(ua.value||Cn.value||en.value)?(e.openBlock(),e.createElementBlock("text",{key:2,x:ll.value.x,y:ll.value.y,"text-anchor":"middle","dominant-baseline":"middle","font-size":Gl.value,fill:Xn.value,class:"dss-radial-data-center"},e.toDisplayString(Tn.value),9,Bi)):e.createCommentVNode("",!0),Ea.value?(e.openBlock(),e.createElementBlock("g",{key:3,class:e.normalizeClass(["dss-radial-labels dss-radial-labels-initial",{"dss-radial-labels-animated":zo.value}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Fa.value,(l,r)=>(e.openBlock(),e.createElementBlock("g",{key:`radial-label-${r}`,class:e.normalizeClass(["dss-radial-label-group",{"dss-label-highlighted":l.isHighlighted,"dss-label-dimmed":l.isDimmed}]),style:e.normalizeStyle({"--label-delay":`${r*.08}s`})},[e.createElementVNode("line",{class:"dss-radial-label-line dss-radial-label-line-pointer",x1:l.pointerStartX,y1:l.pointerStartY,x2:l.pointerEndX,y2:l.pointerEndY,stroke:l.color,"stroke-width":"1.5",opacity:"0.8",style:e.normalizeStyle({"--line-length":l.pointerLineLength})},null,12,Mi),e.createElementVNode("line",{class:"dss-radial-label-line dss-radial-label-line-horizontal",x1:l.pointerEndX,y1:l.pointerEndY,x2:l.horizontalEndX,y2:l.horizontalEndY,stroke:l.color,"stroke-width":"1.5",opacity:"0.8",style:e.normalizeStyle({"--line-length":l.horizontalLineLength})},null,12,_i),e.createElementVNode("text",{class:"dss-radial-label-text",x:l.textX,y:l.textY,"text-anchor":l.textAnchor,"font-size":_t.value,"dominant-baseline":"middle"},e.toDisplayString(l.text),9,$i)],6))),128))],2)):e.createCommentVNode("",!0)],8,xi)):e.createCommentVNode("",!0),Bl.value?(e.openBlock(),e.createElementBlock("g",{key:3,class:"dss-spider-chart",transform:No.value},[ge.value?(e.openBlock(),e.createElementBlock("g",Ai,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(mn.value,(l,r)=>(e.openBlock(),e.createElementBlock("circle",{key:`spider-grid-circle-${r}`,cx:Ut.value,cy:Pt.value,r:K(l),fill:"none",stroke:"#dedede","stroke-width":"1",style:e.normalizeStyle({animationDelay:`${r*150}ms`})},null,12,Ti))),128)),e.createElementVNode("g",Di,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(mn.value,(l,r)=>(e.openBlock(),e.createElementBlock("g",{key:`spider-grid-label-group-${r}`},[e.createElementVNode("rect",{x:Ut.value-16,y:Pt.value-l-7,width:"32",height:"16",fill:"transparent",stroke:"none"},null,8,Hi),e.createElementVNode("text",{x:Ut.value,y:Pt.value-l+2,"text-anchor":"middle","dominant-baseline":"central",class:"dss-spider-grid-label",style:{fontSize:"10px",fill:"#999",fontWeight:"600"}},e.toDisplayString(pn(r)),9,Ri)]))),128))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ba.value,(l,r)=>(e.openBlock(),e.createElementBlock("line",{key:`spider-axis-${r}`,x1:Ut.value,x2:l.x,y1:Pt.value,y2:l.y,stroke:"#dedede","stroke-width":"1",style:e.normalizeStyle({animationDelay:`${r*100}ms`})},null,12,Fi))),128))])):e.createCommentVNode("",!0),e.createElementVNode("g",Ii,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ua.value,(l,r)=>(e.openBlock(),e.createElementBlock("text",{key:`spider-label-${r}`,x:l.x+Math.cos(r*2*Math.PI/oo.value-Math.PI/2)*16,y:l.y+Math.sin(r*2*Math.PI/oo.value-Math.PI/2)*16,"text-anchor":l.anchor,"dominant-baseline":l.baseline,"font-size":"14px",fill:"#666","font-weight":"500",style:e.normalizeStyle({animationDelay:`${r*120}ms`})},e.toDisplayString(l.text.charAt(0).toUpperCase()+l.text.slice(1)),13,zi))),128))]),e.createElementVNode("g",{class:"dss-spider-data",onMousemove:Ka,onMouseleave:un},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(xa.value,(l,r)=>(e.openBlock(),e.createElementBlock("g",{key:`spider-${r}`},[e.createElementVNode("polygon",{points:l.points,fill:l.color,"fill-opacity":Ya("current",l,r),stroke:l.color,"stroke-width":l.isHighlighted?We.value+1:We.value,"stroke-dasharray":l.strokeDasharray||void 0,"stroke-linejoin":"round",class:e.normalizeClass({"dss-series-highlighted":l.isHighlighted,"dss-series-dimmed":l.isDimmed,"dss-series-hidden":l.isHidden}),style:e.normalizeStyle({animationDelay:`${r*xl.value}ms`,transition:"all 0.2s ease"})},null,14,Pi),l.pointRadius>0?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(l.dataPoints,(m,f)=>(e.openBlock(),e.createElementBlock("circle",{key:`spider-point-${r}-${f}`,cx:m.x,cy:m.y,r:K(l.isHighlighted?l.pointRadius+1:l.pointRadius),fill:l.isComparison?"none":l.color,stroke:l.isComparison?l.color:"none","stroke-width":l.isComparison?2:0,class:e.normalizeClass({"dss-point-highlighted":l.isHighlighted,"dss-point-dimmed":l.isDimmed,"dss-point-hidden":l.isHidden}),style:e.normalizeStyle({animationDelay:`${r*xl.value+f*50}ms`,transition:"all 0.2s ease"}),onMouseover:C=>_n(m,C),onMouseleave:un},null,46,Oi))),128)):e.createCommentVNode("",!0)]))),128))],32)],8,Li)):e.createCommentVNode("",!0),e.createElementVNode("g",Wi,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Fo.value,(l,r)=>(e.openBlock(),e.createElementBlock("circle",{key:`logo-fallback-${r}`,cx:l.x,cy:l.y,r:K(l.width/2),fill:$t(l.seriesIndex),stroke:"#fafafa","stroke-width":"2",class:e.normalizeClass(`logo-fallback-${r}`),style:e.normalizeStyle({animationDelay:`${r*200}ms`})},null,14,qi))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Fo.value,(l,r)=>(e.openBlock(),e.createElementBlock("image",{key:`logo-${r}`,x:l.x-l.width/2,y:l.y-l.height/2,width:l.width,height:l.height,"xlink:href":l.url,onLoad:m=>Ga(r),onError:m=>Qa(r),preserveAspectRatio:"xMidYMid slice",class:e.normalizeClass(`dss-logo-image-${r}`),"clip-path":`circle(${l.width/2}px at ${l.width/2}px ${l.height/2}px)`,style:e.normalizeStyle({animationDelay:`${r*200}ms`})},null,46,Zi))),128))])],8,mr))]),ct.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-chart-watermark",style:e.normalizeStyle({position:"absolute",top:"0px",left:"0px",width:Ve.value+"px",height:re.value+"px",backgroundImage:`url('${fn.value}')`,backgroundRepeat:"no-repeat",...Gt.value,opacity:lt.value,pointerEvents:"none",zIndex:10})},null,4)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(pt.value,(l,r)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{key:"marker-"+l.id,class:"dss-chart-marker",style:e.normalizeStyle({position:"absolute",left:l.x+"px",top:l.y+"px",width:T.value+"px",height:T.value+"px",backgroundColor:"#fafafa",borderRadius:"50%",border:"2px solid #ddd",cursor:"pointer",zIndex:500}),onClick:e.withModifiers(m=>jo(l),["stop"]),onMouseenter:m=>Wa(l,m),onMouseleave:qa},[e.createElementVNode("img",{src:gn(l),class:"dss-marker-icon",alt:"Marker Icon",style:{width:"100%",height:"100%","object-fit":"contain","border-radius":"50%","pointer-events":"none"}},null,8,Xi)],44,Ui)),[[e.vShow,le.value]])),128)),Ml.value.show?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-marker-tooltip",style:e.normalizeStyle({left:Ml.value.x+"px",top:Ml.value.y+"px"})},[e.createElementVNode("div",Yi,e.toDisplayString(Ml.value.categoryValue),1),Ml.value.description?(e.openBlock(),e.createElementBlock("div",ji,e.toDisplayString(Ml.value.description),1)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),Pe.value&&(kt.value.show||Xe.value&&nt.value.show&&!ie.value.isZooming)?(e.openBlock(),e.createElementBlock("div",{key:3,class:e.normalizeClass(["dss-chart-tooltip",{"dss-crosshair-tooltip":Xe.value&&nt.value.show&&!ie.value.isZooming,"dss-spider-tooltip":Bl.value&&kt.value.spiderAreas&&kt.value.spiderAreas.length>0}]),style:e.normalizeStyle(Ja.value)},[!Xe.value||!nt.value.show||ie.value.isZooming?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[Bl.value&&kt.value.spiderAreas&&kt.value.spiderAreas.length>0?(e.openBlock(),e.createElementBlock("div",Ki,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(kt.value.spiderAreas,(l,r)=>(e.openBlock(),e.createElementBlock("div",{key:`spider-tooltip-area-${r}`,class:"dss-spider-tooltip-area"},[e.createElementVNode("div",Gi,[e.createElementVNode("span",{class:"dss-spider-tooltip-area-indicator",style:e.normalizeStyle({backgroundColor:l.color})},null,4),e.createTextVNode(" "+e.toDisplayString(l.seriesName),1)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.points,(m,f)=>(e.openBlock(),e.createElementBlock("div",{key:`spider-tooltip-point-${r}-${f}`,class:"dss-tooltip-series"},[e.createElementVNode("span",Qi,e.toDisplayString(m.label),1),e.createElementVNode("span",Ji,e.toDisplayString(m.value),1)]))),128))]))),128))])):ul.value&&kt.value.bubbleData&&kt.value.bubbleData.length>0?(e.openBlock(),e.createElementBlock("div",ec,[kt.value.title?(e.openBlock(),e.createElementBlock("div",tc,e.toDisplayString(kt.value.title),1)):e.createCommentVNode("",!0),e.createElementVNode("div",lc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(kt.value.bubbleData,(l,r)=>(e.openBlock(),e.createElementBlock("div",{key:`bubble-tooltip-${r}`,class:"dss-bubble-tooltip-item"},e.toDisplayString(l.value),1))),128))])])):(e.openBlock(),e.createElementBlock("div",nc,[e.createElementVNode("div",oc,e.toDisplayString(kt.value.title),1),e.createElementVNode("div",ac,e.toDisplayString(kt.value.value),1)])),kt.value.categoryIndex!==void 0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[Rt(kt.value.categoryIndex).flagGroups.length>0?(e.openBlock(),e.createElementBlock("div",sc,[o[5]||(o[5]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",rc,e.toDisplayString(e.unref($)("chart.tooltip.flags")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Rt(kt.value.categoryIndex).flagGroups,(l,r)=>(e.openBlock(),e.createElementBlock("div",{key:`tooltip-flag-group-${r}`},[e.createElementVNode("div",ic,[e.createElementVNode("div",{class:"dss-tooltip-item-indicator",style:e.normalizeStyle({backgroundColor:l.color})},null,4),e.createElementVNode("span",null,e.toDisplayString(l.type),1)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.flags,(m,f)=>(e.openBlock(),e.createElementBlock("div",{key:`tooltip-flag-${r}-${f}`,class:"dss-tooltip-item dss-tooltip-item-no-indicator"},[e.createElementVNode("div",cc,[e.createElementVNode("div",uc,e.toDisplayString(m.text),1)])]))),128))]))),128))])):e.createCommentVNode("",!0),Rt(kt.value.categoryIndex).markers.length>0?(e.openBlock(),e.createElementBlock("div",dc,[o[6]||(o[6]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",mc,e.toDisplayString(e.unref($)("chart.tooltip.markers")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Rt(kt.value.categoryIndex).markers,(l,r)=>(e.openBlock(),e.createElementBlock("div",{key:`tooltip-marker-${r}`,class:"dss-tooltip-item"},[e.createElementVNode("div",{class:"dss-tooltip-item-indicator",style:e.normalizeStyle({backgroundColor:l.color})},null,4),e.createElementVNode("div",pc,[e.createElementVNode("div",fc,e.toDisplayString(l.title),1),l.description?(e.openBlock(),e.createElementBlock("div",vc,e.toDisplayString(l.description),1)):e.createCommentVNode("",!0)])]))),128))])):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",hc,[e.createElementVNode("div",gc,e.toDisplayString(ul.value?Oa():E.categories[nt.value.categoryIndex]||`Category ${nt.value.categoryIndex+1}`),1),ul.value?(e.openBlock(),e.createElementBlock("div",yc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(nt.value.data,(l,r)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-tooltip-${r}`,class:"dss-bubble-tooltip-item"},e.toDisplayString(l.value),1))),128))])):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(nt.value.data,(l,r)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-tooltip-${r}`,class:"dss-tooltip-series"},[e.createElementVNode("div",{class:"dss-tooltip-series-indicator",style:e.normalizeStyle({backgroundColor:l.color})},null,4),e.createElementVNode("span",kc,e.toDisplayString(l.seriesName)+":",1),e.createElementVNode("span",Cc,e.toDisplayString(_(l.value)),1)]))),128))]),Rt(nt.value.categoryIndex).flagGroups.length>0?(e.openBlock(),e.createElementBlock("div",bc,[o[7]||(o[7]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",xc,e.toDisplayString(e.unref($)("chart.tooltip.flags")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Rt(nt.value.categoryIndex).flagGroups,(l,r)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-flag-group-${r}`},[e.createElementVNode("div",wc,[e.createElementVNode("div",{class:"dss-tooltip-item-indicator",style:e.normalizeStyle({backgroundColor:l.color})},null,4),e.createElementVNode("span",null,e.toDisplayString(l.type),1)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.flags,(m,f)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-flag-${r}-${f}`,class:"dss-tooltip-item dss-tooltip-item-no-indicator"},[e.createElementVNode("div",Ec,[e.createElementVNode("div",Sc,e.toDisplayString(m.text),1)])]))),128))]))),128))])):e.createCommentVNode("",!0),Rt(nt.value.categoryIndex).markers.length>0?(e.openBlock(),e.createElementBlock("div",Vc,[o[8]||(o[8]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",Nc,e.toDisplayString(e.unref($)("chart.tooltip.markers")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Rt(nt.value.categoryIndex).markers,(l,r)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-dss-marker-${r}`,class:"dss-tooltip-item"},[e.createElementVNode("div",{class:"dss-tooltip-item-indicator",style:e.normalizeStyle({backgroundColor:l.color})},null,4),e.createElementVNode("div",Bc,[e.createElementVNode("div",Mc,e.toDisplayString(l.title),1),l.description?(e.openBlock(),e.createElementBlock("div",_c,e.toDisplayString(l.description),1)):e.createCommentVNode("",!0)])]))),128))])):e.createCommentVNode("",!0)],64))],6)):e.createCommentVNode("",!0),ol.value&&Ge.value&&ie.value.scale>1?(e.openBlock(),e.createElementBlock("div",{key:4,class:"dss-zoom-indicator",onClick:Bn},[o[9]||(o[9]=e.createElementVNode("span",{style:{display:"inline-block",transform:"scaleX(-1)","font-size":"14px"}},"⌕",-1)),e.createTextVNode(" "+e.toDisplayString(Math.round(ie.value.scale*100))+"% "+e.toDisplayString(e.unref($)("chart.zoom.doubleClickToReset")),1)])):e.createCommentVNode("",!0)],46,er),W.value&&G.value==="bottom"?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["dss-chart-legend",{"dss-legend-horizontal":Ne.value==="horizontal","dss-legend-vertical":Ne.value==="vertical","dss-legend-bottom":!0}]),style:{display:"flex","flex-wrap":"wrap","justify-content":"center",padding:"6px 8px 0"}},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(F.series,(l,r)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-bottom-${r}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":zt.value.has(r),"dss-legend-hovered":Me.value===r,"dss-legend-dimmed":Me.value!==null&&Me.value!==r}]),onClick:m=>ra(r),onMouseenter:m=>g(r),onMouseleave:w,style:e.normalizeStyle({animationDelay:`${r*100}ms`})},[e.createElementVNode("div",{class:e.normalizeClass(["dss-legend-color",{"dss-legend-color--comparison":Bl.value&&i(l)}]),style:e.normalizeStyle({backgroundColor:Bl.value&&i(l)?"transparent":p(l,r),borderColor:p(l,r)})},null,6),e.createElementVNode("span",Lc,e.toDisplayString(l.name),1)],46,$c))),128))],2)):e.createCommentVNode("",!0),ft.value.show?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-chart-context-menu",style:e.normalizeStyle({left:ft.value.x+"px",top:ft.value.y+"px"}),onClick:o[0]||(o[0]=e.withModifiers(()=>{},["stop"]))},[rl.value.addMarker?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-context-menu-item",onClick:jn},e.toDisplayString(e.unref($)("chart.contextMenu.addMarker")),1)):e.createCommentVNode("",!0),rl.value.addMarker&&(rl.value.downloadSvg||rl.value.downloadPng||rl.value.downloadCsv||Il.value.length>0)?(e.openBlock(),e.createElementBlock("div",Ac)):e.createCommentVNode("",!0),rl.value.downloadSvg?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-context-menu-item",onClick:Go},e.toDisplayString(e.unref($)("chart.contextMenu.downloadSvg")),1)):e.createCommentVNode("",!0),rl.value.downloadPng?(e.openBlock(),e.createElementBlock("div",{key:3,class:"dss-context-menu-item",onClick:So},e.toDisplayString(e.unref($)("chart.contextMenu.downloadPng")),1)):e.createCommentVNode("",!0),rl.value.downloadCsv?(e.openBlock(),e.createElementBlock("div",{key:4,class:"dss-context-menu-item",onClick:Rn},e.toDisplayString(e.unref($)("chart.contextMenu.downloadCsv")),1)):e.createCommentVNode("",!0),Il.value.length>0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:5},[rl.value.downloadSvg||rl.value.downloadPng||rl.value.downloadCsv?(e.openBlock(),e.createElementBlock("div",Tc)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Il.value,(l,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"custom-"+r},[l.separator?(e.openBlock(),e.createElementBlock("div",Dc)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(Pl(l)),style:e.normalizeStyle(Ul(l)),onClick:m=>Yn(l)},[l.template?(e.openBlock(),e.createElementBlock("div",{key:0,innerHTML:bl(l),class:"dss-custom-menu-content"},null,8,Rc)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[l.icon?(e.openBlock(),e.createElementBlock("span",Fc,e.toDisplayString(l.icon),1)):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(l.label),1)],64))],14,Hc)],64))),128))],64)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),De.value.show?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-marker-modal-overlay",onClick:Sn},[e.createElementVNode("div",{class:"dss-marker-modal",onClick:o[3]||(o[3]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",Ic,[e.createElementVNode("h3",null,e.toDisplayString(y.value?e.unref($)("chart.modalMarker.viewMarker"):Al.value?e.unref($)("chart.modalMarker.editMarker"):e.unref($)("chart.contextMenu.addMarker")),1),e.createElementVNode("button",{class:"dss-modal-close-btn",onClick:Sn},"×")]),e.createElementVNode("div",zc,[e.createElementVNode("div",Pc,[e.createVNode(pa,{id:"dss-marker-date",mode:"single",modelValue:De.value.date,"onUpdate:modelValue":o[1]||(o[1]=l=>De.value.date=l),"min-date":Jl.value,"max-date":Cl.value,disabled:y.value},null,8,["modelValue","min-date","max-date","disabled"])]),e.createElementVNode("div",Oc,[e.createElementVNode("label",Wc,e.toDisplayString(e.unref($)("chart.modalMarker.description")),1),y.value?(e.openBlock(),e.createElementBlock("div",qc,e.toDisplayString(De.value.description),1)):e.withDirectives((e.openBlock(),e.createElementBlock("textarea",{key:1,id:"dss-marker-description","onUpdate:modelValue":o[2]||(o[2]=l=>De.value.description=l),placeholder:e.unref($)("chart.modalMarker.placeholderDescription"),class:"dss-form-textarea",rows:"5"},null,8,Zc)),[[e.vModelText,De.value.description]])])]),e.createElementVNode("div",Uc,[e.createElementVNode("div",Xc,[Al.value&&!y.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-btn dss-btn-danger",onClick:po},e.toDisplayString(e.unref($)("chart.modalMarker.deleteMarker")),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",Yc,[e.createElementVNode("button",{class:"dss-btn dss-btn-secondary",onClick:Sn},e.toDisplayString(y.value?e.unref($)("chart.modalMarker.close"):e.unref($)("chart.modalMarker.cancel")),1),y.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-btn dss-btn-primary",onClick:Yo,disabled:!(De.value.description&&De.value.description.length)},e.toDisplayString(Al.value?e.unref($)("chart.modalMarker.save"):e.unref($)("chart.contextMenu.addMarker")),9,jc))])])])])):e.createCommentVNode("",!0)],64))}}),Qc={class:"dss-modal-title"},Jc={class:"dss-modal-actions"},ma={__name:"DSSModal",props:{showModal:{type:Boolean,required:!0},backDrop:{type:Boolean,default:!0},width:{type:String,default:"800px"},height:{type:String,default:"auto"},showCloseBtn:{type:Boolean,default:!0},headerType:{type:String,default:"space-between"},titleSize:{type:String,default:"24px"}},emits:["close-modal"],setup(E,{emit:te}){const $=E,V=te,ce=e.ref(null),O=e.ref(null),L=e.computed(()=>{const Y={"max-width":$.width};return $.height!=="auto"&&(Y.height=$.height,Y["min-height"]="0"),Y}),fe=e.computed(()=>({}));function rt(){V("close-modal")}function ee(){$.backDrop&&!ce.value&&V("close-modal")}function v(Y){Y.target.tagName==="INPUT"&&(ce.value=Y.target.tagName)}function be(){setTimeout(()=>{ce.value=null},300)}function ke(){const Y=document.body,me=document.documentElement;O.value={bodyOverflow:Y.style.overflow,bodyPosition:Y.style.position,bodyTop:Y.style.top,bodyWidth:Y.style.width,htmlOverflow:me.style.overflow,scrollY:window.scrollY},Y.style.overflow="hidden",Y.style.position="fixed",Y.style.top=`-${O.value.scrollY}px`,Y.style.width="100%",Y.style.left="0",me.style.overflow="hidden"}function J(){if(!O.value)return;const Y=document.body,me=document.documentElement,{bodyOverflow:F,bodyPosition:ue,bodyTop:$e,bodyWidth:tt,htmlOverflow:mt,scrollY:U}=O.value;Y.style.overflow=F||"",Y.style.position=ue||"",Y.style.top=$e||"",Y.style.width=tt||"",Y.style.left="",me.style.overflow=mt||"",window.scrollTo(0,U||0)}return e.watch(()=>$.showModal,Y=>{if(Y)ke(),document.body.classList.add("dss-modal-open"),setTimeout(()=>{const me=document.getElementById("dss-modal-backdrop");me&&(me.addEventListener("focusin",v),me.addEventListener("focusout",be))},100);else{J(),document.body.classList.remove("dss-modal-open");const me=document.getElementById("dss-modal-backdrop");me&&(me.removeEventListener("focusin",v),me.removeEventListener("focusout",be))}},{immediate:!0}),e.onUnmounted(()=>{$.showModal&&J()}),(Y,me)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[E.showModal?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-modal-backdrop",onClick:ee},[e.withDirectives(e.createElementVNode("div",{id:"dss-modal-backdrop",class:"dss-modal",style:e.normalizeStyle(L.value)},[e.createElementVNode("div",{class:"dss-modal-content",onClick:me[0]||(me[0]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:"dss-modal-header",style:e.normalizeStyle({"justify-content":E.headerType,"font-size":E.titleSize})},[e.createElementVNode("h1",Qc,[e.renderSlot(Y.$slots,"title",{},()=>[me[1]||(me[1]=e.createTextVNode("Default Title",-1))])]),e.renderSlot(Y.$slots,"title-data"),E.showCloseBtn?(e.openBlock(),e.createElementBlock("span",{key:0,class:"dss-modal-close",onClick:rt,title:"Close"},"×")):e.createCommentVNode("",!0)],4),e.createElementVNode("div",{class:"dss-modal-body",style:e.normalizeStyle(fe.value)},[e.renderSlot(Y.$slots,"content",{},()=>[me[2]||(me[2]=e.createTextVNode("Default Content",-1))])],4),e.createElementVNode("div",Jc,[e.renderSlot(Y.$slots,"actions")])])],4),[[e.vShow,E.showModal]])])):e.createCommentVNode("",!0)]))}},eu={key:0,class:"dss-table-toolbar"},tu={class:"dss-table-toolbar-left"},lu=["aria-expanded"],nu={class:"dss-pagination-select-dropdown",role:"listbox"},ou={class:"dss-table-column-visibility-label"},au={class:"dss-table-checkbox-wrapper"},su=["checked","onChange"],ru={key:0,class:"dss-table-checkbox__check","aria-hidden":"true"},iu={class:"dss-table-column-visibility-text"},cu={class:"dss-table-toolbar-right"},uu=["placeholder","aria-label"],du=["aria-label"],mu=["aria-label","aria-expanded"],pu={key:1,class:"dss-table-toolbar-extra"},fu={class:"dss-table-thead"},vu={key:0,class:"dss-table-th dss-table-selection-column"},hu={key:0,class:"dss-table-checkbox-wrapper"},gu=["checked","indeterminate"],yu={key:0,class:"dss-table-checkbox__indeterminate"},ku={key:1,class:"dss-table-checkbox__check","aria-hidden":"true"},Cu=["aria-label"],bu=["onClick"],xu={class:"dss-table-th-content"},wu={class:"dss-table-th-text"},Eu={key:0},Su={key:1},Vu={key:2},Nu=["data-filter-column-key","aria-expanded","aria-label","onClick"],Bu={class:"dss-table-tbody"},Mu=["onClick"],_u={class:"dss-table-checkbox-wrapper"},$u=["type","name","checked","disabled","onChange"],Lu={key:0,class:"dss-table-checkbox__check","aria-hidden":"true"},Au={key:1,class:"dss-table-checkbox__dot"},Tu=["onClick"],Du=["aria-expanded","aria-label"],Hu={key:1,class:"dss-table-expansion-placeholder","aria-hidden":"true"},Ru={key:0,class:"dss-table-expansion-row"},Fu=["colspan"],Iu=["colspan"],zu={key:1,class:"dss-table-pagination"},Pu={class:"dss-table-pagination-left"},Ou={key:0},Wu={key:1,class:"dss-table-pagination-placeholder","aria-hidden":"true"},qu={class:"dss-table-pagination-center"},Zu={key:0,class:"dss-pagination-controls"},Uu=["disabled","title"],Xu=["disabled","title"],Yu=["aria-label","onKeydown"],ju={class:"dss-pagination-of"},Ku=["disabled","title"],Gu=["disabled","title"],Qu={class:"dss-table-pagination-right"},Ju={class:"dss-pagination-rows-label"},ed=["aria-expanded"],td=["aria-selected","onClick"],ld={key:0,class:"dss-table-filter-row"},nd=["value","placeholder"],od=["min","max","value"],ad=["min","max","value"],sd={class:"dss-table-filter-double-range-values"},rd={key:2,class:"dss-table-filter-daterange"},id={class:"dss-table-filter-daterange-row"},cd={class:"dss-table-filter-daterange-label"},ud=["value"],dd={class:"dss-table-filter-daterange-row"},md={class:"dss-table-filter-daterange-label"},pd=["value"],fd=["value","placeholder"],vd={class:"dss-table-filter-list"},hd=["checked","onChange"],gd={class:"dss-table-filter-actions"},yd={name:"DSSTable"},kd=Object.assign(yd,{props:{data:{type:Array,required:!0,default:()=>[]},columns:{type:Array,required:!0,default:()=>[]},tableId:{type:String,default:()=>"table-"+Math.random().toString(36).substring(2,9)},locale:{type:String,default:null},options:{type:Object,default:()=>({}),validator:E=>typeof E=="object"&&E!==null},columnVisibility:{type:Array,default:null}},emits:["row-click","row-select","row-unselect","select-all","unselect-all","row-expand","row-collapse","sort","page","download-pdf","download-excel","search","update:columnVisibility"],setup(E,{emit:te}){const{t:$,locale:V}=ro.useI18n(),ce=E,O=te,L={table:{width:"auto",height:null,rowHeight:"auto",truncated:!1,expandable:!1,expandableRowData:null,expandableRowCondition:null,striped:!1,bordered:!1,hoverable:!0,size:"default",align:"left"},title:{text:""},subtitle:{text:""},selection:{enabled:!1,mode:"single",rowCondition:null},sorting:{enabled:!0,mode:"single"},pagination:{enabled:!1,rows:10,rowsPerPageOptions:[5,10,25,50,100],showCounter:!0,showControlsGroup:!0,showControls:!0,showRowsPerPage:!0},toolbar:{downloads:{pdf:!0,excel:!0},columnVisibility:!0,search:!0},scrollable:!1,emptyMessage:null};function fe(y,g){const w=Object.assign({},y);return rt(y)&&rt(g)&&Object.keys(g).forEach(Z=>{rt(g[Z])?Z in y?w[Z]=fe(y[Z],g[Z]):Object.assign(w,{[Z]:g[Z]}):Object.assign(w,{[Z]:g[Z]})}),w}function rt(y){return y&&typeof y=="object"&&!Array.isArray(y)}const ee=e.computed(()=>fe(L,ce.options)),v=e.computed(()=>{const y=ee.value.table.width;return y==="auto"?null:typeof y=="number"?y:null}),be=e.computed(()=>ee.value.table.height),ke=e.computed(()=>ee.value.table.rowHeight??"auto"),J=e.computed(()=>({height:ke.value})),Y=e.computed(()=>ee.value.table.expandable===!0),me=e.computed(()=>ee.value.table.expandableRowData??null),F=e.computed(()=>ee.value.table.expandableRowCondition??null),ue=e.computed(()=>ee.value.table.truncated===!0),$e=e.computed(()=>ee.value.table.striped),tt=e.computed(()=>ee.value.table.bordered),mt=e.computed(()=>ee.value.table.hoverable),U=e.computed(()=>ee.value.table.size),ze=e.computed(()=>ee.value.table.align||"left");e.computed(()=>ee.value.title.text),e.computed(()=>ee.value.subtitle.text);const qe=e.computed(()=>ee.value.selection.enabled),Ve=e.computed(()=>ee.value.selection.mode),Le=e.computed(()=>ee.value.selection.rowCondition??null),je=e.computed(()=>ee.value.sorting.enabled),re=e.computed(()=>ee.value.sorting.mode),Qe=e.computed(()=>ee.value.pagination.enabled),Ce=e.computed(()=>ee.value.pagination.rows),Je=e.computed(()=>ee.value.pagination.rowsPerPageOptions),ut=e.computed(()=>ee.value.pagination.showCounter!==!1),ht=e.computed(()=>ee.value.pagination.showControlsGroup),dt=e.computed(()=>ht.value===!1?!1:ee.value.pagination.showControls!==!1),Wt=e.computed(()=>ht.value===!1?!1:ee.value.pagination.showRowsPerPage!==!1),qt=e.computed(()=>Qe.value&&(ut.value||dt.value||Wt.value)),Ct=e.computed(()=>ee.value.scrollable),wt=e.computed(()=>ee.value.emptyMessage||$("table.emptyMessage")),Yt=e.computed(()=>ee.value.toolbar?.downloads?.pdf!==!1),it=e.computed(()=>ee.value.toolbar?.downloads?.excel!==!1),Kt=e.computed(()=>ee.value.toolbar?.search!==!1),yt=e.computed(()=>Yt.value||it.value||Kt.value||el.value),el=e.computed(()=>ee.value.toolbar?.columnVisibility!==!1),X=e.ref(""),ge=e.ref(!1),W=e.ref(null);let G=null;function Ne(){ge.value?(G&&(clearTimeout(G),G=null),ge.value=!1,X.value="",O("search",""),W.value?.blur()):(ge.value=!0,G=setTimeout(()=>{G=null,W.value?.focus()},80))}function Pe(){X.value||(ge.value=!1)}function Xe(){X.value="",O("search",""),W.value?.focus()}const Et=e.computed(()=>({"dss-table-striped":$e.value,"dss-table-bordered":tt.value,"dss-table-hoverable":mt.value,[`dss-table-${U.value}`]:U.value!=="default","dss-table-truncated":ue.value})),Ge=(y,g)=>y?.field??y?.key??g,Zt=e.ref(new Set);function Ue(){const y=new Set;return ce.columns.forEach((g,w)=>{g?.hidden!==!0&&y.add(Ge(g,w))}),y}function We(){const y=new Set;return ce.columns.forEach((g,w)=>{y.add(Ge(g,w))}),y}function Dt(y){if(!Array.isArray(y))return null;const g=We(),w=[];return y.forEach(Z=>{g.has(Z)&&w.push(Z)}),w}function Lt(){Zt.value=Ue()}const ne=e.computed(()=>{const y=Dt(ce.columnVisibility);return y===null?null:new Set(y)}),j=e.computed(()=>ne.value??Zt.value),K=e.computed(()=>ce.columns.filter((y,g)=>j.value.has(Ge(y,g)))),de=y=>{const g=ce.columns.findIndex(w=>w===y);return Ge(y,g>=0?g:0)},xe=(y,g)=>j.value.has(Ge(y,g));function Ke(y){O("update:columnVisibility",Array.from(y))}function Ht(y,g){const w=Ge(y,g),Z=new Set(j.value);Z.has(w)?Z.delete(w):Z.add(w),ne.value===null&&(Zt.value=Z),Ke(Z)}const jt=e.ref(null),et=e.ref(!1);function vl(y){jt.value&&!jt.value.contains(y.target)&&(et.value=!1)}const M=e.computed(()=>K.value.length+(qe.value?1:0)+(Y.value?1:0)),x=(y,g)=>y?.id??y?.key??g,A=e.ref(new Set),ae=e.ref(null),oe=(y,g)=>A.value.has(x(y,g)),Fe=(y,g)=>{if(!Y.value)return!1;if(typeof F.value=="function")return!!F.value(y,g);if(typeof me.value=="string"&&me.value.trim()){const w=Jl(y,me.value.trim());return Array.isArray(w)?w.length>0:w&&typeof w=="object"?Object.keys(w).length>0:w!=null&&w!==""}return!0},bt=(y,g,w)=>{if(w&&w.stopPropagation(),!Fe(y,g))return;const Z=x(y,g),he=new Set(A.value);he.has(Z)?(he.delete(Z),O("row-collapse",{data:y,index:g})):(he.add(Z),O("row-expand",{data:y,index:g})),A.value=he},ot=(y,g)=>{if(!ue.value)return;const w=x(y,g);ae.value!==w&&(ae.value=w)},Ie=e.ref(null),xt=e.ref(0),Mt=e.ref([]),St=y=>{if(re.value==="single")return Ie.value===y.field?xt.value:0;{const g=Mt.value.find(w=>w.field===y.field);return g?g.order:0}},At=y=>{const g=St(y);return{"dss-sort-active":g!==0,"dss-sort-asc":g===1,"dss-sort-desc":g===-1}},It=e.ref({}),Nt=e.ref(null),yl=e.ref(null),nn=220,Vl=e.ref(null),Nl=e.computed(()=>K.value.find(y=>de(y)===Nt.value)??null),tl=e.computed(()=>{if(!Nl.value||Nl.value.filter!=="range")return null;const y=Nl.value,g=Nt.value,{min:w,max:Z}=sn(y),he=y.filterMin??w,at=y.filterMax??Z,Bt=Fl(g),bl=Bt.min??he,Pl=Bt.max??at,Ul=at-he,gn=Ul===0?0:(bl-he)/Ul*100,mo=Ul===0?100:(Pl-he)/Ul*100;return{rangeMin:he,rangeMax:at,currentMin:bl,currentMax:Pl,minPct:gn,maxPct:mo}}),jl=e.ref(null),on=e.ref("max");function xl(y){const g=jl.value,w=tl.value;if(!g||!w)return;const Z=g.getBoundingClientRect(),at=(y.clientX-Z.left)/Z.width*100,Bt=(w.minPct+w.maxPct)/2;on.value=at<Bt?"min":"max"}function Fl(y){return It.value[y]??{}}function dn(y,g){It.value={...It.value,[y]:g}}function Hl(y){const g=It.value[y];return g?g.type==="string"?!!g.value?.trim():g.type==="range"?g.min!=null||g.max!=null:g.type==="dateRange"?!!(g.from||g.to):g.type==="list"?g.selected?.length>0:!1:!1}function Pn(y){const g={...It.value};delete g[y],It.value=g,Nt.value=null,yl.value=null}function mn(){if(!Nt.value){yl.value=null;return}const y=Vl.value;if(!y)return;const g=y.querySelector(`.dss-table-filter-trigger[data-filter-column-key="${Nt.value}"]`);if(!g)return;const w=g.getBoundingClientRect();yl.value={top:w.bottom+6,left:Math.max(8,w.right-nn)}}const pn=e.computed(()=>{const y=String(X.value??"").trim().toLowerCase();return y?ce.data.filter(g=>K.value.some(w=>ql(De(g,w)).some(he=>String(he).toLowerCase().includes(y)))):ce.data}),wn=e.computed(()=>{let y=[...pn.value];const g=(X.value??"").trim().toLowerCase();return g&&(y=y.filter(w=>ce.columns.some(Z=>{if(!Z||!Z.field)return!1;const he=De(w,Z);return String(he??"").toLowerCase().includes(g)}))),K.value.forEach(w=>{const Z=de(w),he=It.value[Z];if(!he)return;const at=w.field;if(at){if(he.type==="string"&&he.value?.trim()){const Bt=he.value.trim().toLowerCase();y=y.filter(bl=>{const Pl=De(bl,w);return String(Pl??"").toLowerCase().includes(Bt)})}else if(he.type==="range")y=y.filter(Bt=>{const bl=Jl(Bt,at),Pl=Number(bl);return!(Number.isNaN(Pl)||he.min!=null&&Pl<he.min||he.max!=null&&Pl>he.max)});else if(he.type==="dateRange"){const Bt=he.from?new Date(he.from).getTime():null,bl=he.to?new Date(he.to).getTime():null;y=y.filter(Pl=>{const Ul=Jl(Pl,at),gn=Ul?new Date(Ul).getTime():NaN;return!(Number.isNaN(gn)||Bt!=null&&gn<Bt||bl!=null&&gn>bl)})}else if(he.type==="list"&&he.selected?.length){const Bt=new Set(he.selected);y=y.filter(bl=>ql(De(bl,w)).some(Ul=>Bt.has(Ul)))}}}),y});function ql(y){if(y==null)return[""];if(Array.isArray(y))return y.flatMap(ql);if(typeof y=="object"){const g=y?.label??y?.name??y?.value??y?.title;return[g!=null?String(g):String(y)]}return[String(y)]}function rl(y){const g=new Set;return ce.data.forEach(w=>{ql(De(w,y)).forEach(he=>g.add(he))}),Array.from(g).sort((w,Z)=>String(w).localeCompare(String(Z)))}function Il(y,g){if(Nt.value===y){Nt.value=null,yl.value=null;return}if(Nt.value=y,g?.currentTarget){const w=g.currentTarget.getBoundingClientRect();yl.value={top:w.bottom+6,left:Math.max(8,w.right-nn)}}else mn()}function Kl(y,g){dn(y,{type:"string",value:g})}function sn(y){const g=y.field;if(!g)return{min:0,max:100};let w=1/0,Z=-1/0;return ce.data.forEach(he=>{const at=Jl(he,g),Bt=Number(at);Number.isNaN(Bt)||(w=Math.min(w,Bt),Z=Math.max(Z,Bt))}),{min:w===1/0?0:w,max:Z===-1/0?100:Z}}function T(y,g,w){const Z={...Fl(y),type:"range"},he=w===""?null:Number(w),at=he===null||Number.isNaN(he)?null:he;Z[g]=at,at!=null&&(g==="min"&&Z.max!=null&&at>Z.max&&(Z.max=at),g==="max"&&Z.min!=null&&at<Z.min&&(Z.min=at)),dn(y,Z)}function z(y,g,w){const Z={...Fl(y),type:"dateRange"};Z[g]=w||"",dn(y,Z)}const _=e.reactive({});function le(y,g){_[y]=g}function Te(y){const g=de(y),w=(_[g]??"").trim().toLowerCase(),Z=rl(y);return w?Z.filter(he=>String(he).toLowerCase().includes(w)):Z}function pt(y,g){return(Fl(y).selected??[]).includes(g!=null?String(g):"")}function ct(y,g){const Z=[...Fl(y).selected??[]],he=g!=null?String(g):"",at=Z.indexOf(he);at>=0?Z.splice(at,1):Z.push(he),dn(y,{type:"list",selected:Z})}function lt(y){Nt.value&&!y.target.closest(".dss-table-filter-wrap")&&!y.target.closest(".dss-table-filter-dropdown")&&(Nt.value=null,yl.value=null)}function st(){mn(),Rt.value&&Zl()}const il=y=>{if(!(y.sortable===!1||!je.value))if(re.value==="single")Ie.value===y.field?xt.value=xt.value===1?-1:xt.value===-1?0:1:(Ie.value=y.field,xt.value=1),xt.value===0&&(Ie.value=null),O("sort",{field:Ie.value,order:xt.value});else{const g=Mt.value.findIndex(w=>w.field===y.field);g>=0?Mt.value[g].order===1?Mt.value[g].order=-1:Mt.value.splice(g,1):Mt.value.push({field:y.field,order:1}),O("sort",{multiSortMeta:Mt.value})}},kl=e.computed(()=>{if(!je.value)return wn.value;let y=[...wn.value];return re.value==="single"&&Ie.value&&xt.value!==0?y.sort((g,w)=>{const Z=Jl(g,Ie.value),he=Jl(w,Ie.value);return Z===he?0:Z==null?1:he==null?-1:(Z<he?-1:Z>he?1:0)*xt.value}):re.value==="multiple"&&Mt.value.length>0&&y.sort((g,w)=>{for(const Z of Mt.value){const he=Jl(g,Z.field),at=Jl(w,Z.field);if(he===at)continue;if(he==null)return 1;if(at==null)return-1;const Bt=he<at?-1:he>at?1:0;if(Bt!==0)return Bt*Z.order}return 0}),y}),Gt=e.ref(0),wl=e.ref(Ce.value),Rt=e.ref(!1),Ll=e.ref(null),fn=e.ref(null),Qt=e.ref("bottom"),_t=e.ref(null),Ln=y=>{wl.value=y,Rt.value=!1,Gt.value=0,O("page",{page:0,rows:wl.value})};function En(y){Ll.value&&!Ll.value.contains(y.target)&&(Rt.value=!1)}function Zl(){const y=Ll.value,g=fn.value;if(!y||!g)return;const w=y.querySelector(".dss-pagination-select-dropdown");if(!w)return;const Z=g.getBoundingClientRect(),he=w.offsetHeight||0,Bt=(window.innerHeight||document.documentElement.clientHeight)-Z.bottom,bl=Z.top;Qt.value=Bt<he+8&&bl>Bt?"top":"bottom",_t.value={width:`${Math.ceil(Z.width)}px`,left:`${Math.max(0,Math.round(g.offsetLeft))}px`}}const vn=e.computed(()=>kl.value.length),hn=e.computed(()=>Math.ceil(vn.value/wl.value)),An=e.computed(()=>Math.max(hn.value,1)),Tn=e.computed(()=>vn.value===0?0:ll.value+1),Gl=e.computed(()=>Xn.value),ll=e.computed(()=>Qe.value?Gt.value*wl.value:0),Xn=e.computed(()=>Qe.value?Math.min((Gt.value+1)*wl.value,vn.value):vn.value),Ql=e.computed(()=>{if(!Qe.value)return kl.value;const y=ll.value,g=Xn.value;return kl.value.slice(y,g)}),Jt=e.ref(new Set),Dn=e.computed(()=>kl.value.filter((y,g)=>Jt.value.has(x(y,g)))),nl=(y,g)=>{const w=Le.value;return typeof w!="function"?!0:!!w(y,g)},zl=e.computed(()=>kl.value.map((y,g)=>({row:y,index:g})).filter(({row:y,index:g})=>nl(y,g))),On=e.computed(()=>{const y=zl.value;return y.length===0?!1:y.every(({row:g,index:w})=>Jt.value.has(x(g,w)))}),zt=e.computed(()=>{const y=zl.value;if(y.length===0)return!1;const g=y.filter(({row:w,index:Z})=>Jt.value.has(x(w,Z))).length;return g>0&&g<y.length}),Me=(y,g)=>Jt.value.has(x(y,g)),El=()=>{if(On.value)Jt.value=new Set,O("unselect-all");else{const y=new Set;zl.value.forEach(({row:g,index:w})=>y.add(x(g,w))),Jt.value=y,O("select-all",Dn.value)}},kt=(y,g)=>{if(!nl(y,g))return;const w=x(y,g),Z=new Set(Jt.value),he=Z.has(w);Ve.value==="single"?he?(Z.delete(w),O("row-unselect",y)):(Z.clear(),Z.add(w),O("row-select",y)):he?(Z.delete(w),O("row-unselect",y)):(Z.add(w),O("row-select",y)),Jt.value=Z},Ml=e.ref("1"),nt=()=>{const y=Number.parseInt(String(Ml.value),10);if(!Number.isFinite(y)){Ml.value=String(Gt.value+1);return}const g=Math.min(An.value,Math.max(1,y));g!==Gt.value+1?ft(g-1):Ml.value=String(g)},ft=y=>{y<0||y>=hn.value||(Gt.value=y,O("page",{page:y,rows:wl.value}))},ie=(y,g,w)=>{O("row-click",{data:y,index:g,originalEvent:w}),ot(y,ll.value+g)},Tt=(y,g)=>{const w=ll.value+g;return{"dss-table-row-selected":Me(y,w),"dss-table-row-even":g%2===0,"dss-table-row-odd":g%2!==0,"dss-table-row-truncated-clickable":ue.value,"dss-table-row-truncated-expanded":ae.value===x(y,w)}},De=(y,g)=>g.field?Jl(y,g.field):"",Jl=(y,g)=>g.split(".").reduce((w,Z)=>w&&w[Z],y),Cl=y=>{const g=y.align??ze.value;return{"dss-table-sortable":y.sortable!==!1&&je.value,"dss-table-align-left":g==="left","dss-table-align-center":g==="center","dss-table-align-right":g==="right",[y.className]:y.className}},Al=y=>{const g={};return y.width&&(g.width=typeof y.width=="number"?`${y.width}px`:y.width),y.minWidth&&(g.minWidth=typeof y.minWidth=="number"?`${y.minWidth}px`:y.minWidth),y.maxWidth&&(g.maxWidth=typeof y.maxWidth=="number"?`${y.maxWidth}px`:y.maxWidth),g};return e.watch(()=>ce.locale,y=>{y&&y!==V.value&&(V.value=y)},{immediate:!0}),e.watch(Ce,y=>{wl.value=y,Gt.value=0}),e.watch(Rt,async y=>{y&&(await e.nextTick(),Zl())}),e.watch(Gt,y=>{Ml.value=String(y+1)},{immediate:!0}),e.watch(X,y=>{O("search",y??"")}),e.watch(()=>ce.columns,()=>{if(ne.value===null){Lt();return}const y=Dt(ce.columnVisibility)??[];y.length!==ce.columnVisibility.length&&O("update:columnVisibility",y)},{immediate:!0,deep:!0}),e.onMounted(()=>{document.addEventListener("click",En),document.addEventListener("click",vl),document.addEventListener("click",lt),window.addEventListener("resize",st),window.addEventListener("scroll",st,!0)}),e.onUnmounted(()=>{document.removeEventListener("click",En),document.removeEventListener("click",vl),document.removeEventListener("click",lt),window.removeEventListener("resize",st),window.removeEventListener("scroll",st,!0)}),(y,g)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{class:"dss-table-container",ref_key:"tableContainerRef",ref:Vl,style:e.normalizeStyle({width:v.value+"px",height:be.value?be.value+"px":"auto"})},[yt.value?(e.openBlock(),e.createElementBlock("div",eu,[e.createElementVNode("div",tu,[Yt.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-table-toolbar-btn",onClick:g[0]||(g[0]=w=>O("download-pdf"))},[g[22]||(g[22]=e.createStaticVNode('<span class="dss-table-toolbar-btn-icon" aria-hidden="true"><svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#clip0_download)"><path d="M16.59 9H15V4C15 3.45 14.55 3 14 3H10C9.45 3 9 3.45 9 4V9H7.41C6.52 9 6.07 10.08 6.7 10.71L11.29 15.3C11.68 15.69 12.31 15.69 12.7 15.3L17.29 10.71C17.92 10.08 17.48 9 16.59 9ZM5 19C5 19.55 5.45 20 6 20H18C18.55 20 19 19.55 19 19C19 18.45 18.55 18 18 18H6C5.45 18 5 18.45 5 19Z" fill="currentColor"></path></g><defs><clipPath id="clip0_download"><rect width="24" height="24" fill="white"></rect></clipPath></defs></svg></span>',1)),e.createTextVNode(" "+e.toDisplayString(e.unref($)("table.downloadPdf")),1)])):e.createCommentVNode("",!0),it.value?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-table-toolbar-btn",onClick:g[1]||(g[1]=w=>O("download-excel"))},[g[23]||(g[23]=e.createStaticVNode('<span class="dss-table-toolbar-btn-icon" aria-hidden="true"><svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#clip0_download_excel)"><path d="M16.59 9H15V4C15 3.45 14.55 3 14 3H10C9.45 3 9 3.45 9 4V9H7.41C6.52 9 6.07 10.08 6.7 10.71L11.29 15.3C11.68 15.69 12.31 15.69 12.7 15.3L17.29 10.71C17.92 10.08 17.48 9 16.59 9ZM5 19C5 19.55 5.45 20 6 20H18C18.55 20 19 19.55 19 19C19 18.45 18.55 18 18 18H6C5.45 18 5 18.45 5 19Z" fill="currentColor"></path></g><defs><clipPath id="clip0_download_excel"><rect width="24" height="24" fill="white"></rect></clipPath></defs></svg></span>',1)),e.createTextVNode(" "+e.toDisplayString(e.unref($)("table.downloadExcel")),1)])):e.createCommentVNode("",!0),el.value?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-table-toolbar-column-visibility",ref_key:"columnVisibilityDropdownRef",ref:jt},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-pagination-select-trigger",{"dss-pagination-select-open":et.value}]),onClick:g[2]||(g[2]=w=>et.value=!et.value),"aria-expanded":et.value,"aria-haspopup":"listbox"},[e.createTextVNode(e.toDisplayString(e.unref($)("table.columnVisibility"))+" ",1),g[24]||(g[24]=e.createElementVNode("span",{class:"dss-pagination-select-chevron","aria-hidden":"true"},"▼",-1))],10,lu),e.createVNode(e.Transition,{name:"dss-dropdown"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("ul",nu,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(E.columns,(w,Z)=>(e.openBlock(),e.createElementBlock("li",{key:Ge(w,Z),role:"option",class:"dss-table-column-visibility-option",onClick:g[3]||(g[3]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("label",ou,[e.createElementVNode("span",au,[e.createElementVNode("input",{type:"checkbox",checked:xe(w,Z),onChange:he=>Ht(w,Z),class:"dss-table-checkbox dss-table-checkbox--checkbox"},null,40,su),xe(w,Z)?(e.openBlock(),e.createElementBlock("span",ru,[...g[25]||(g[25]=[e.createElementVNode("svg",{viewBox:"0 0 12 12",preserveAspectRatio:"xMidYMid meet",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M4.82415 9.75587C4.46867 10.0814 3.89442 10.0814 3.53893 9.75587L0.266616 6.75952C-0.088872 6.43401 -0.088872 5.90819 0.266616 5.58268C0.622104 5.25717 1.19635 5.25717 1.55184 5.58268L4.17698 7.98644L10.4482 2.24413C10.8036 1.91862 11.3779 1.91862 11.7334 2.24413C12.0889 2.56964 12.0889 3.09546 11.7334 3.42097L4.82415 9.75587Z","stroke-width":"1.2",stroke:"currentColor",fill:"currentColor"})],-1)])])):e.createCommentVNode("",!0)]),e.createElementVNode("span",iu,e.toDisplayString(w.header),1)])]))),128))],512),[[e.vShow,et.value]])]),_:1})],512)):e.createCommentVNode("",!0),e.renderSlot(y.$slots,"header")]),e.createElementVNode("div",cu,[Kt.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["dss-table-toolbar-search",{"dss-table-toolbar-search--expanded":ge.value||X.value}])},[e.withDirectives(e.createElementVNode("input",{ref_key:"searchInputRef",ref:W,"onUpdate:modelValue":g[4]||(g[4]=w=>X.value=w),type:"text",class:"dss-table-toolbar-search-input",placeholder:e.unref($)("table.searchPlaceholder"),"aria-label":e.unref($)("table.searchTableAriaLabel"),onFocus:g[5]||(g[5]=w=>ge.value=!0),onBlur:Pe},null,40,uu),[[e.vModelText,X.value]]),X.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-table-toolbar-search-clear","aria-label":e.unref($)("table.clearSearchAriaLabel"),onClick:Xe},[...g[26]||(g[26]=[e.createElementVNode("span",{"aria-hidden":"true"},"×",-1)])],8,du)):e.createCommentVNode("",!0),e.createElementVNode("button",{type:"button",class:"dss-table-toolbar-search-trigger","aria-label":e.unref($)("table.searchAriaLabel"),"aria-expanded":ge.value||!!X.value,onMousedown:e.withModifiers(Ne,["prevent"])},[...g[27]||(g[27]=[e.createElementVNode("span",{class:"dss-table-toolbar-search-icon","aria-hidden":"true"},[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M4.81738 0C7.47741 0.000327759 9.63379 2.09488 9.63379 4.67773C9.63366 5.68756 9.30172 6.62133 8.74121 7.38574L11.2324 9.80469C11.653 10.213 11.6528 10.8885 11.2324 11.2969C10.829 11.6886 10.1866 11.6886 9.7832 11.2969L7.16895 8.75781C6.47333 9.13671 5.67174 9.35439 4.81738 9.35449C2.15724 9.35449 -0.000652839 7.26049 -0.000976562 4.67773C-0.000976562 2.09468 2.15704 0 4.81738 0ZM4.81738 1.41895C2.96425 1.41895 1.46213 2.87754 1.46191 4.67676C1.46202 6.47611 2.96418 7.93555 4.81738 7.93555C6.67025 7.93519 8.17275 6.47589 8.17285 4.67676C8.17263 2.87776 6.67018 1.4193 4.81738 1.41895Z",fill:"currentColor"})])],-1)])],40,mu)],2)):e.createCommentVNode("",!0),y.$slots["toolbar-extra"]?(e.openBlock(),e.createElementBlock("div",pu,[e.renderSlot(y.$slots,"toolbar-extra")])):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["dss-table-wrapper",{"dss-table-scrollable":Ct.value}])},[e.createElementVNode("table",{class:e.normalizeClass(["dss-table",Et.value])},[e.createElementVNode("thead",fu,[e.createElementVNode("tr",null,[qe.value?(e.openBlock(),e.createElementBlock("th",vu,[Ve.value==="multiple"?(e.openBlock(),e.createElementBlock("span",hu,[e.createElementVNode("input",{type:"checkbox",checked:On.value,indeterminate:zt.value,onChange:El,class:"dss-table-checkbox dss-table-checkbox--checkbox"},null,40,gu),zt.value?(e.openBlock(),e.createElementBlock("span",yu)):On.value?(e.openBlock(),e.createElementBlock("span",ku,[...g[28]||(g[28]=[e.createElementVNode("svg",{viewBox:"0 0 12 12",preserveAspectRatio:"xMidYMid meet",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M4.82415 9.75587C4.46867 10.0814 3.89442 10.0814 3.53893 9.75587L0.266616 6.75952C-0.088872 6.43401 -0.088872 5.90819 0.266616 5.58268C0.622104 5.25717 1.19635 5.25717 1.55184 5.58268L4.17698 7.98644L10.4482 2.24413C10.8036 1.91862 11.3779 1.91862 11.7334 2.24413C12.0889 2.56964 12.0889 3.09546 11.7334 3.42097L4.82415 9.75587Z","stroke-width":"1.2",stroke:"currentColor",fill:"currentColor"})],-1)])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),Y.value?(e.openBlock(),e.createElementBlock("th",{key:1,class:"dss-table-th dss-table-expansion-column","aria-label":e.unref($)("table.expandRowAriaLabel")},null,8,Cu)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(K.value,(w,Z)=>(e.openBlock(),e.createElementBlock("th",{key:de(w),class:e.normalizeClass(["dss-table-th",Cl(w)]),style:e.normalizeStyle(Al(w)),onClick:he=>il(w)},[e.createElementVNode("div",xu,[e.createElementVNode("span",wu,e.toDisplayString(w.header),1),w.sortable!==!1&&je.value?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["dss-table-sort-icon",At(w)])},[St(w)===0?(e.openBlock(),e.createElementBlock("span",Eu,[...g[29]||(g[29]=[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M5.413 9.06387C5.45434 9.16352 5.4652 9.27319 5.4442 9.37901C5.42321 9.48484 5.3713 9.58206 5.29505 9.65837L3.11339 11.84C3.06273 11.8907 3.00258 11.931 2.93637 11.9584C2.87016 11.9859 2.79918 12 2.72751 12C2.65583 12 2.58486 11.9859 2.51865 11.9584C2.45243 11.931 2.39228 11.8907 2.34163 11.84L0.159964 9.65837C0.0835992 9.58209 0.0315843 9.48487 0.0105038 9.37902C-0.0105768 9.27316 0.000224981 9.16343 0.0415416 9.06371C0.0828581 8.964 0.152832 8.87879 0.242604 8.81886C0.332376 8.75894 0.43791 8.72699 0.545845 8.72708H2.18209V0.545845C2.18209 0.401191 2.23955 0.262463 2.34184 0.160178C2.44413 0.0578925 2.58285 0.000429123 2.72751 0.000429123C2.87216 0.000429123 3.01089 0.0578925 3.11317 0.160178C3.21546 0.262463 3.27292 0.401191 3.27292 0.545845V8.72708H4.90917C5.01704 8.7271 5.12248 8.75911 5.21216 8.81906C5.30185 8.87901 5.37174 8.9642 5.413 9.06387ZM11.84 2.34162L9.65837 0.159963C9.60772 0.109252 9.54757 0.0690231 9.48135 0.0415755C9.41514 0.0141278 9.34417 0 9.27249 0C9.20082 0 9.12984 0.0141278 9.06363 0.0415755C8.99742 0.0690231 8.93727 0.109252 8.88661 0.159963L6.70495 2.34162C6.62858 2.4179 6.57657 2.51513 6.55549 2.62098C6.53441 2.72684 6.54521 2.83657 6.58653 2.93629C6.62784 3.036 6.69782 3.12121 6.78759 3.18114C6.87736 3.24107 6.9829 3.27301 7.09083 3.27292H8.72708V11.4542C8.72708 11.5988 8.78454 11.7375 8.88683 11.8398C8.98911 11.9421 9.12784 11.9996 9.27249 11.9996C9.41715 11.9996 9.55587 11.9421 9.65816 11.8398C9.76045 11.7375 9.81791 11.5988 9.81791 11.4542V3.27292H11.4542C11.5621 3.27301 11.6676 3.24107 11.7574 3.18114C11.8472 3.12121 11.9171 3.036 11.9585 2.93629C11.9998 2.83657 12.0106 2.72684 11.9895 2.62098C11.9684 2.51513 11.9164 2.4179 11.84 2.34162Z",fill:"#3a3a3a"})],-1)])])):St(w)===1?(e.openBlock(),e.createElementBlock("span",Su,[...g[30]||(g[30]=[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M6 12C6.36819 12 6.66667 11.7015 6.66667 11.3333L6.66667 2.55333L8.58967 4.47098C8.84953 4.73012 9.27017 4.72983 9.52967 4.47033C9.78943 4.21057 9.78943 3.78943 9.52967 3.52967L6.70711 0.707106C6.31658 0.316582 5.68342 0.316582 5.29289 0.707107L2.47033 3.52967C2.21057 3.78943 2.21057 4.21057 2.47033 4.47033C2.72983 4.72983 3.15047 4.73012 3.41033 4.47098L5.33333 2.55333L5.33333 11.3333C5.33333 11.7015 5.63181 12 6 12Z",fill:"#7fa2cc"})],-1)])])):St(w)===-1?(e.openBlock(),e.createElementBlock("span",Vu,[...g[31]||(g[31]=[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M6 -1.74846e-07C5.63181 -1.58751e-07 5.33333 0.298476 5.33333 0.666666L5.33333 9.44667L3.41033 7.52902C3.15047 7.26988 2.72983 7.27017 2.47033 7.52967C2.21057 7.78943 2.21057 8.21057 2.47033 8.47033L5.29289 11.2929C5.68342 11.6834 6.31658 11.6834 6.70711 11.2929L9.52967 8.47033C9.78943 8.21057 9.78943 7.78943 9.52967 7.52967C9.27017 7.27017 8.84953 7.26988 8.58967 7.52902L6.66667 9.44667L6.66667 0.666667C6.66667 0.298477 6.36819 -1.9094e-07 6 -1.74846e-07Z",fill:"#7fa2cc"})],-1)])])):e.createCommentVNode("",!0)],2)):e.createCommentVNode("",!0),w.filter?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["dss-table-filter-wrap",{"dss-table-filter-wrap--open":Nt.value===de(w)}]),onClick:g[6]||(g[6]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-table-filter-trigger",{"dss-table-filter-trigger--active":Hl(de(w))}]),"data-filter-column-key":de(w),"aria-expanded":Nt.value===de(w),"aria-label":e.unref($)("table.filterColumnAriaLabel"),onClick:he=>Il(de(w),he)},[...g[32]||(g[32]=[e.createElementVNode("span",{class:"dss-table-filter-icon","aria-hidden":"true"},[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M11.7583 1.54409L11.7537 1.54928L7.84558 5.72226V8.92411C7.84581 9.07639 7.80836 9.22636 7.73658 9.36067C7.6648 9.49497 7.56091 9.60943 7.43417 9.69385L5.58772 10.9252C5.44858 11.0179 5.28688 11.071 5.11988 11.079C4.95288 11.087 4.78685 11.0494 4.63952 10.9704C4.49219 10.8914 4.36908 10.7738 4.28334 10.6303C4.1976 10.4868 4.15244 10.3226 4.15269 10.1555V5.72226L0.244567 1.54928L0.239951 1.54409C0.119785 1.41185 0.0405781 1.24758 0.0119374 1.0712C-0.0167033 0.894829 0.00645342 0.713935 0.0785984 0.550463C0.150743 0.386991 0.268776 0.247968 0.418378 0.150258C0.56798 0.0525488 0.742722 0.000352071 0.921405 0H11.0769C11.2557 1.73676e-05 11.4307 0.051972 11.5805 0.149551C11.7304 0.247131 11.8487 0.386134 11.9211 0.549673C11.9934 0.713211 12.0167 0.894244 11.9881 1.07078C11.9596 1.24731 11.8803 1.41174 11.7601 1.54409H11.7583Z",fill:"currentColor"})])],-1)])],10,Nu)],2)):e.createCommentVNode("",!0)])],14,bu))),128))])]),e.createElementVNode("tbody",Bu,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ql.value,(w,Z)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:x(w,ll.value+Z)},[e.createElementVNode("tr",{class:e.normalizeClass(["dss-table-tr",Tt(w,Z)]),style:e.normalizeStyle(J.value),onClick:he=>ie(w,Z,he)},[qe.value?(e.openBlock(),e.createElementBlock("td",{key:0,class:"dss-table-td dss-table-selection-cell",onClick:g[7]||(g[7]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("span",_u,[e.createElementVNode("input",{type:Ve.value==="multiple"?"checkbox":"radio",name:`dss-table-select-${E.tableId}`,checked:Me(w,ll.value+Z),disabled:!nl(w,ll.value+Z),onChange:he=>kt(w,ll.value+Z),class:e.normalizeClass(["dss-table-checkbox",Ve.value==="multiple"?"dss-table-checkbox--checkbox":"dss-table-checkbox--radio",{"dss-table-checkbox--disabled":!nl(w,ll.value+Z)}])},null,42,$u),Ve.value==="multiple"&&Me(w,ll.value+Z)?(e.openBlock(),e.createElementBlock("span",Lu,[...g[33]||(g[33]=[e.createElementVNode("svg",{viewBox:"0 0 12 12",preserveAspectRatio:"xMidYMid meet",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M4.82415 9.75587C4.46867 10.0814 3.89442 10.0814 3.53893 9.75587L0.266616 6.75952C-0.088872 6.43401 -0.088872 5.90819 0.266616 5.58268C0.622104 5.25717 1.19635 5.25717 1.55184 5.58268L4.17698 7.98644L10.4482 2.24413C10.8036 1.91862 11.3779 1.91862 11.7334 2.24413C12.0889 2.56964 12.0889 3.09546 11.7334 3.42097L4.82415 9.75587Z","stroke-width":"1.2",stroke:"currentColor",fill:"currentColor"})],-1)])])):Ve.value==="single"&&Me(w,ll.value+Z)?(e.openBlock(),e.createElementBlock("span",Au)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),Y.value?(e.openBlock(),e.createElementBlock("td",{key:1,class:"dss-table-td dss-table-expansion-cell",onClick:e.withModifiers(he=>bt(w,ll.value+Z,he),["stop"])},[Fe(w,ll.value+Z)?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-table-expansion-trigger","aria-expanded":oe(w,ll.value+Z),"aria-label":oe(w,ll.value+Z)?e.unref($)("table.collapseRowAriaLabel"):e.unref($)("table.expandRowAriaLabel")},[e.createElementVNode("span",{class:e.normalizeClass(["dss-table-expansion-icon",{"dss-table-expansion-icon--expanded":oe(w,ll.value+Z)}]),"aria-hidden":"true"},[...g[34]||(g[34]=[e.createElementVNode("svg",{viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M10.1611 2.81093L5.99463 6.93546L1.82819 2.81093C1.4094 2.39636 0.732886 2.39636 0.314094 2.81093C-0.104698 3.22551 -0.104698 3.89522 0.314094 4.30979L5.24295 9.18907C5.66175 9.60364 6.33826 9.60364 6.75705 9.18907L11.6859 4.30979C12.1047 3.89522 12.1047 3.22551 11.6859 2.81093C11.2671 2.40699 10.5799 2.39636 10.1611 2.81093Z",fill:"#3a3a3a"})],-1)])],2)],8,Du)):(e.openBlock(),e.createElementBlock("span",Hu))],8,Tu)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(K.value,(he,at)=>(e.openBlock(),e.createElementBlock("td",{key:de(he),class:e.normalizeClass(["dss-table-td",Cl(he)]),style:e.normalizeStyle(Al(he))},[e.renderSlot(y.$slots,`cell-${he.field}`,{data:w,column:he,rowIndex:Z,isExpanded:ae.value===x(w,ll.value+Z)},()=>[e.createTextVNode(e.toDisplayString(De(w,he)),1)])],6))),128))],14,Mu),Y.value&&Fe(w,ll.value+Z)&&oe(w,ll.value+Z)?(e.openBlock(),e.createElementBlock("tr",Ru,[e.createElementVNode("td",{colspan:M.value,class:"dss-table-expansion-content-cell"},[e.renderSlot(y.$slots,"expansion",{data:w,rowIndex:Z})],8,Fu)])):e.createCommentVNode("",!0)],64))),128)),Ql.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("tr",{key:0,class:"dss-table-empty",style:e.normalizeStyle(J.value)},[e.createElementVNode("td",{colspan:M.value,class:"dss-table-empty-cell"},[e.renderSlot(y.$slots,"empty",{},()=>[e.createTextVNode(e.toDisplayString(wt.value),1)])],8,Iu)],4))])],2)],2),qt.value?(e.openBlock(),e.createElementBlock("div",zu,[e.createElementVNode("div",Pu,[ut.value?(e.openBlock(),e.createElementBlock("span",Ou,e.toDisplayString(e.unref($)("table.showingRange",{start:Tn.value,end:Gl.value,total:vn.value})),1)):(e.openBlock(),e.createElementBlock("span",Wu," "))]),e.createElementVNode("div",qu,[dt.value?(e.openBlock(),e.createElementBlock("div",Zu,[e.createElementVNode("button",{class:"dss-pagination-btn",disabled:Gt.value===0,onClick:g[8]||(g[8]=w=>ft(0)),title:e.unref($)("table.firstPage")},[...g[35]||(g[35]=[e.createElementVNode("span",{class:"dss-pagination-double-arrow"},[e.createElementVNode("span",null,"‹"),e.createElementVNode("span",null,"‹")],-1)])],8,Uu),e.createElementVNode("button",{class:"dss-pagination-btn",disabled:Gt.value===0,onClick:g[9]||(g[9]=w=>ft(Gt.value-1)),title:e.unref($)("table.previousPage")}," ‹ ",8,Xu),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":g[10]||(g[10]=w=>Ml.value=w),type:"text",class:"dss-pagination-page-input","aria-label":e.unref($)("table.currentPageAriaLabel"),onBlur:nt,onKeydown:e.withKeys(e.withModifiers(nt,["prevent"]),["enter"])},null,40,Yu),[[e.vModelText,Ml.value]]),e.createElementVNode("span",ju,e.toDisplayString(e.unref($)("table.ofPages",{total:An.value})),1),e.createElementVNode("button",{class:"dss-pagination-btn",disabled:Gt.value>=hn.value-1,onClick:g[11]||(g[11]=w=>ft(Gt.value+1)),title:e.unref($)("table.nextPage")}," › ",8,Ku),e.createElementVNode("button",{class:"dss-pagination-btn",disabled:Gt.value>=hn.value-1,onClick:g[12]||(g[12]=w=>ft(hn.value-1)),title:e.unref($)("table.lastPage")},[...g[36]||(g[36]=[e.createElementVNode("span",{class:"dss-pagination-double-arrow"},[e.createElementVNode("span",null,"›"),e.createElementVNode("span",null,"›")],-1)])],8,Gu)])):e.createCommentVNode("",!0)]),e.createElementVNode("div",Qu,[Wt.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-pagination-rows-per-page",ref_key:"rowsPerPageDropdownRef",ref:Ll},[e.createElementVNode("span",Ju,e.toDisplayString(e.unref($)("table.rowsPerPage"))+":",1),e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-pagination-select-trigger",{"dss-pagination-select-open":Rt.value}]),onClick:g[13]||(g[13]=w=>Rt.value=!Rt.value),"aria-expanded":Rt.value,"aria-haspopup":"listbox",ref_key:"rowsPerPageTriggerRef",ref:fn},[e.createTextVNode(e.toDisplayString(wl.value)+" ",1),g[37]||(g[37]=e.createElementVNode("span",{class:"dss-pagination-select-chevron","aria-hidden":"true"},"▼",-1))],10,ed),e.createVNode(e.Transition,{name:"dss-dropdown"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("ul",{class:e.normalizeClass(["dss-pagination-select-dropdown",{"dss-pagination-select-dropdown--top":Qt.value==="top"}]),style:e.normalizeStyle(_t.value),role:"listbox"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Je.value,w=>(e.openBlock(),e.createElementBlock("li",{key:w,role:"option","aria-selected":w===wl.value,class:e.normalizeClass(["dss-pagination-select-option",{"dss-pagination-select-option--selected":w===wl.value}]),onClick:Z=>Ln(w)},e.toDisplayString(w),11,td))),128))],6),[[e.vShow,Rt.value]])]),_:1})],512)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)],4),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.createVNode(e.Transition,{name:"dss-dropdown"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",{class:"dss-table-filter-dropdown dss-table-filter-dropdown--teleport",style:e.normalizeStyle(yl.value?{top:yl.value.top+"px",left:yl.value.left+"px",width:nn+"px"}:void 0),onClick:g[21]||(g[21]=e.withModifiers(()=>{},["stop"]))},[Nl.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[Nl.value.filter==="string"?(e.openBlock(),e.createElementBlock("div",ld,[e.createElementVNode("input",{type:"text",value:Fl(Nt.value).value??"",onInput:g[14]||(g[14]=w=>Kl(Nt.value,w.target.value)),class:"dss-table-filter-input",placeholder:e.unref($)("table.search")},null,40,nd)])):Nl.value.filter==="range"&&tl.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-table-filter-double-range",style:e.normalizeStyle({"--range-min-pct":tl.value.minPct+"%","--range-max-pct":tl.value.maxPct+"%"})},[e.createElementVNode("div",{ref_key:"doubleRangeTrackRef",ref:jl,class:"dss-table-filter-double-range-track",onMousemove:xl,onMouseenter:xl},[e.createElementVNode("input",{type:"range",min:tl.value.rangeMin,max:tl.value.rangeMax,value:tl.value.currentMin,onInput:g[15]||(g[15]=w=>T(Nt.value,"min",w.target.value)),class:"dss-table-filter-double-range-input dss-table-filter-double-range-input--min",style:e.normalizeStyle({zIndex:on.value==="min"?2:1})},null,44,od),e.createElementVNode("input",{type:"range",min:tl.value.rangeMin,max:tl.value.rangeMax,value:tl.value.currentMax,onInput:g[16]||(g[16]=w=>T(Nt.value,"max",w.target.value)),class:"dss-table-filter-double-range-input dss-table-filter-double-range-input--max",style:e.normalizeStyle({zIndex:on.value==="max"?2:1})},null,44,ad)],544),e.createElementVNode("div",sd,e.toDisplayString(tl.value.currentMin)+" – "+e.toDisplayString(tl.value.currentMax),1)],4)):Nl.value.filter==="dateRange"?(e.openBlock(),e.createElementBlock("div",rd,[e.createElementVNode("div",id,[e.createElementVNode("label",cd,e.toDisplayString(e.unref($)("table.filterFrom")),1),e.createElementVNode("input",{type:"date",value:Fl(Nt.value).from??"",onInput:g[17]||(g[17]=w=>z(Nt.value,"from",w.target.value)),class:"dss-table-filter-input dss-table-filter-daterange-input"},null,40,ud)]),e.createElementVNode("div",dd,[e.createElementVNode("label",md,e.toDisplayString(e.unref($)("table.filterTo")),1),e.createElementVNode("input",{type:"date",value:Fl(Nt.value).to??"",onInput:g[18]||(g[18]=w=>z(Nt.value,"to",w.target.value)),class:"dss-table-filter-input dss-table-filter-daterange-input"},null,40,pd)])])):Nl.value.filter==="list"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.createElementVNode("input",{type:"text",value:_[Nt.value]??"",onInput:g[19]||(g[19]=w=>le(Nt.value,w.target.value)),class:"dss-table-filter-input dss-table-filter-list-search",placeholder:e.unref($)("table.search")},null,40,fd),e.createElementVNode("div",vd,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Te(Nl.value),w=>(e.openBlock(),e.createElementBlock("label",{key:w,class:"dss-table-filter-list-item"},[e.createElementVNode("input",{type:"checkbox",checked:pt(Nt.value,w),onChange:Z=>ct(Nt.value,w)},null,40,hd),e.createElementVNode("span",null,e.toDisplayString(w),1)]))),128))])],64)):e.createCommentVNode("",!0),e.createElementVNode("div",gd,[e.createElementVNode("button",{type:"button",class:"dss-table-filter-clear",onClick:g[20]||(g[20]=w=>Pn(Nt.value))},e.toDisplayString(e.unref($)("table.clearFilter")),1)])],64)):e.createCommentVNode("",!0)],4),[[e.vShow,Nt.value&&Nl.value&&yl.value]])]),_:1})]))],64))}}),Cd="data:image/svg+xml,%3csvg%20width='13'%20height='18'%20viewBox='0%200%2013%2018'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M1.116%2012V3.24H2.196V6.984H5.004V3.24H6.084V12H5.004V7.968H2.196V12H1.116Z'%20fill='%233a3a3a'/%3e%3cpath%20d='M6.008%2014V12.68H8.288V6.572L5.996%208.276V6.692L8.012%205.24H9.788V12.68H11.624V14H6.008Z'%20fill='%23CFBEED'/%3e%3c/svg%3e",bd="data:image/svg+xml,%3csvg%20width='13'%20height='18'%20viewBox='0%200%2013%2018'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M1.116%2012V3.24H2.196V6.984H5.004V3.24H6.084V12H5.004V7.968H2.196V12H1.116Z'%20fill='%233a3a3a'/%3e%3cpath%20d='M5.948%2014V12.548L8.684%209.8C9.068%209.408%209.352%209.056%209.536%208.744C9.72%208.424%209.812%208.096%209.812%207.76C9.812%207.352%209.7%207.036%209.476%206.812C9.252%206.58%208.948%206.464%208.564%206.464C8.14%206.464%207.808%206.588%207.568%206.836C7.328%207.076%207.208%207.412%207.208%207.844H5.708C5.716%207.284%205.836%206.804%206.068%206.404C6.308%205.996%206.644%205.68%207.076%205.456C7.508%205.232%208.012%205.12%208.588%205.12C9.14%205.12%209.62%205.224%2010.028%205.432C10.436%205.64%2010.752%205.932%2010.976%206.308C11.2%206.684%2011.312%207.132%2011.312%207.652C11.312%208.188%2011.172%208.712%2010.892%209.224C10.62%209.728%2010.18%2010.272%209.572%2010.856L7.748%2012.644H11.42V14H5.948Z'%20fill='%23CFBEED'/%3e%3c/svg%3e",xd="data:image/svg+xml,%3csvg%20width='13'%20height='18'%20viewBox='0%200%2013%2018'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M1.116%2012V3.24H2.196V6.984H5.004V3.24H6.084V12H5.004V7.968H2.196V12H1.116Z'%20fill='%233a3a3a'/%3e%3cpath%20d='M8.516%2014.12C7.948%2014.12%207.452%2014.016%207.028%2013.808C6.612%2013.6%206.288%2013.308%206.056%2012.932C5.824%2012.556%205.708%2012.112%205.708%2011.6H7.22C7.22%2011.992%207.332%2012.3%207.556%2012.524C7.788%2012.74%208.112%2012.848%208.528%2012.848C8.944%2012.848%209.264%2012.736%209.488%2012.512C9.712%2012.288%209.824%2011.984%209.824%2011.6V10.916C9.824%2010.524%209.712%2010.22%209.488%2010.004C9.264%209.78%208.944%209.668%208.528%209.668H7.544V8.312L9.476%206.524H6.104V5.24H11V6.596L8.528%208.864V8.384C9.392%208.384%2010.076%208.612%2010.58%209.068C11.084%209.524%2011.336%2010.14%2011.336%2010.916V11.6C11.336%2012.112%2011.22%2012.556%2010.988%2012.932C10.756%2013.308%2010.428%2013.6%2010.004%2013.808C9.58%2014.016%209.084%2014.12%208.516%2014.12Z'%20fill='%23CFBEED'/%3e%3c/svg%3e",wd="data:image/svg+xml,%3csvg%20width='13'%20height='18'%20viewBox='0%200%2013%2018'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M1.116%2012V3.24H2.196V6.984H5.004V3.24H6.084V12H5.004V7.968H2.196V12H1.116Z'%20fill='%233a3a3a'/%3e%3cpath%20d='M9.68%2014V12.26H5.78V10.088L9.152%205.24H10.832L7.22%2010.484V10.94H9.68V8.96H11.18V14H9.68Z'%20fill='%23CFBEED'/%3e%3c/svg%3e",Ed="data:image/svg+xml,%3csvg%20width='13'%20height='18'%20viewBox='0%200%2013%2018'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M1.116%2012V3.24H2.196V6.984H5.004V3.24H6.084V12H5.004V7.968H2.196V12H1.116Z'%20fill='%233a3a3a'/%3e%3cpath%20d='M8.588%2014.12C7.78%2014.12%207.132%2013.92%206.644%2013.52C6.156%2013.112%205.888%2012.56%205.84%2011.864H7.34C7.372%2012.168%207.492%2012.404%207.7%2012.572C7.916%2012.732%208.212%2012.812%208.588%2012.812C9.004%2012.812%209.32%2012.704%209.536%2012.488C9.752%2012.264%209.86%2011.956%209.86%2011.564V10.712C9.86%2010.312%209.752%2010.008%209.536%209.8C9.32%209.584%209.004%209.476%208.588%209.476C8.332%209.476%208.112%209.528%207.928%209.632C7.744%209.736%207.604%209.88%207.508%2010.064H6.044L6.104%205.24H11.036V6.596H7.52L7.496%209.14H7.844L7.484%209.44C7.484%209.072%207.628%208.784%207.916%208.576C8.212%208.36%208.608%208.252%209.104%208.252C9.816%208.244%2010.368%208.46%2010.76%208.9C11.16%209.332%2011.36%209.936%2011.36%2010.712V11.564C11.36%2012.356%2011.112%2012.98%2010.616%2013.436C10.128%2013.892%209.452%2014.12%208.588%2014.12Z'%20fill='%23CFBEED'/%3e%3c/svg%3e",Sd="data:image/svg+xml,%3csvg%20width='13'%20height='18'%20viewBox='0%200%2013%2018'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M1.116%2012V3.24H2.196V6.984H5.004V3.24H6.084V12H5.004V7.968H2.196V12H1.116Z'%20fill='%233a3a3a'/%3e%3cpath%20d='M8.6%2014.12C8.016%2014.12%207.5%2014%207.052%2013.76C6.612%2013.512%206.268%2013.168%206.02%2012.728C5.78%2012.28%205.66%2011.764%205.66%2011.18C5.66%2010.764%205.728%2010.328%205.864%209.872C6.008%209.416%206.204%208.988%206.452%208.588L8.516%205.24H10.184L7.592%209.32L7.664%209.368C7.824%209.12%208.04%208.932%208.312%208.804C8.584%208.676%208.888%208.612%209.224%208.612C9.696%208.612%2010.104%208.724%2010.448%208.948C10.792%209.172%2011.06%209.484%2011.252%209.884C11.444%2010.284%2011.54%2010.752%2011.54%2011.288C11.54%2011.856%2011.416%2012.352%2011.168%2012.776C10.928%2013.2%2010.588%2013.532%2010.148%2013.772C9.716%2014.004%209.2%2014.12%208.6%2014.12ZM8.6%2012.848C9.04%2012.848%209.396%2012.708%209.668%2012.428C9.94%2012.14%2010.076%2011.768%2010.076%2011.312C10.076%2010.84%209.94%2010.464%209.668%2010.184C9.396%209.896%209.04%209.752%208.6%209.752C8.16%209.752%207.804%209.896%207.532%2010.184C7.26%2010.464%207.124%2010.84%207.124%2011.312C7.124%2011.768%207.26%2012.14%207.532%2012.428C7.804%2012.708%208.16%2012.848%208.6%2012.848Z'%20fill='%23CFBEED'/%3e%3c/svg%3e",Vd={class:"dss-toolbar-left"},Nd=["title"],Bd=["title"],Md={class:"dss-toolbar-dropdown-wrapper"},_d=["title"],$d=["src"],Ld=["src"],Ad=["src"],Td=["src"],Dd=["src"],Hd=["src"],Rd={key:6,width:"13",height:"14",viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"paragraph-icon"},Fd=["src"],Id=["src"],zd=["src"],Pd=["src"],Od=["src"],Wd=["src"],qd=["title"],Zd=["title"],Ud=["title"],Xd=["title"],Yd=["title"],jd=["title"],Kd=["title"],Gd=["title"],Qd=["title"],Jd={key:2,class:"dss-toolbar-separator"},e1=["title"],t1={key:4,class:"dss-toolbar-separator"},l1={key:5,class:"dss-toolbar-dropdown-wrapper"},n1=["title"],o1={class:"dss-toolbar-dropdown-ai"},a1={class:"dss-toolbar-right"},s1={key:0,class:"dss-toolbar-custom-group"},r1={key:1,class:"dss-toolbar-separator"},i1={class:"dss-link-modal-content"},c1={class:"dss-link-modal-field"},u1={class:"dss-link-modal-label"},d1=["placeholder"],m1={class:"dss-link-modal-field"},p1={class:"dss-link-modal-label"},f1=["placeholder"],v1={class:"dss-image-modal-tabs"},h1={key:0,class:"dss-image-tab-content"},g1={class:"dss-link-modal-content"},y1={class:"dss-link-modal-field"},k1={key:0,class:"dss-link-modal-label"},C1=["src"],b1={class:"dss-link-modal-field"},x1={class:"dss-link-modal-label"},w1=["placeholder"],E1={class:"dss-link-modal-field"},S1={class:"dss-link-modal-label"},V1=["placeholder"],N1={class:"dss-link-modal-field"},B1={class:"dss-link-modal-label"},M1=["placeholder"],_1={key:1,class:"dss-image-tab-content"},$1={class:"dss-link-modal-content"},L1={class:"dss-link-modal-field"},A1={class:"dss-link-modal-label"},T1=["placeholder"],D1={class:"dss-link-modal-field"},H1={class:"dss-link-modal-label"},R1=["placeholder"],F1={class:"dss-link-modal-field"},I1={class:"dss-link-modal-label"},z1=["placeholder"],P1={class:"dss-link-modal-field"},O1={class:"dss-link-modal-label"},W1=["placeholder"],q1={class:"dss-text-editor-title-input-container"},Z1={key:0,class:"dss-text-editor-title-preview"},U1={key:0},X1={key:1,class:"dss-text-editor-preview-placeholder"},Y1=["value","placeholder","disabled"],j1={key:3,class:"dss-text-editor-title-slot dss-text-editor-slot-last"},K1={class:"dss-text-editor-description-input-container"},G1={key:0,class:"dss-text-editor-description-preview"},Q1={key:0},J1={key:1,class:"dss-text-editor-preview-placeholder"},em=["value","placeholder","disabled"],tm={key:5,class:"dss-text-editor-description-slot dss-text-editor-slot-last"},lm=["data-comment-id","onMouseenter"],nm=["onClick"],om=["src","alt"],am={key:1},sm=["onClick"],rm=["src","alt"],im={key:1},cm=["data-has-second-user","onClick"],um={class:"editor-comment-marker-count"},dm={key:7,class:"dss-text-editor-textarea-wrapper"},mm=["value","placeholder","rows","disabled"],pm={class:"dss-text-editor-footer"},fm={class:"dss-text-editor-footer-content"},vm={class:"dss-text-editor-footer-stat"},hm={class:"dss-text-editor-footer-stat"},gm={key:8,class:"dss-text-editor-content-wrapper"},ym={key:0,class:"dss-comment-overlay-body"},km={class:"dss-comment-selection-wrapper"},Cm=["innerHTML"],bm={class:"dss-comment-messages-wrapper"},xm={key:0,class:"dss-comment-avatar-wrapper"},wm={class:"dss-comment-avatar"},Em=["src","alt"],Sm={key:1},Vm={class:"dss-comment-header"},Nm={class:"dss-comment-header-text"},Bm={class:"dss-comment-author"},Mm={key:0,class:"dss-comment-date"},_m=["onClick","title"],$m={class:"dss-comment-overlay-inner"},Lm=["placeholder","onKeydown"],Am={class:"dss-text-editor-footer"},Tm={class:"dss-text-editor-footer-content"},Dm={class:"dss-text-editor-footer-stat"},Hm={class:"dss-text-editor-footer-stat"},Rm=["title"],Fm=["title"],Im={xmlns:"http://www.w3.org/2000/svg",version:"1.1","xmlns:xlink":"http://www.w3.org/1999/xlink",width:"512",height:"512",x:"0",y:"0",viewBox:"0 0 32 32",style:{"enable-background":"new 0 0 512 512"},"xml:space":"preserve",class:""},zm={class:"dss-image-popup-content"},Pm={key:0,class:"dss-image-popup-no-alt-icon"},Om=["title"],Wm=["title"],qm={xmlns:"http://www.w3.org/2000/svg",version:"1.1","xmlns:xlink":"http://www.w3.org/1999/xlink",width:"512",height:"512",x:"0",y:"0",viewBox:"0 0 32 32",style:{"enable-background":"new 0 0 512 512"},"xml:space":"preserve",class:""},Zm={class:"dss-toolbar-left"},Um=["title"],Xm=["title"],Ym={class:"dss-toolbar-dropdown-wrapper"},jm=["title"],Km=["src"],Gm=["src"],Qm=["src"],Jm=["src"],e2=["src"],t2=["src"],l2={key:6,width:"13",height:"14",viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"paragraph-icon"},n2=["title"],o2=["title"],a2=["title"],s2=["title"],r2=["title"],i2=["title"],c2=["title"],u2=["title"],d2=["title"],m2={key:2,class:"dss-toolbar-separator"},p2=["title"],f2={key:4,class:"dss-toolbar-separator"},v2={key:5,class:"dss-toolbar-dropdown-wrapper"},h2=["title"],g2={class:"dss-toolbar-dropdown-ai"},y2={key:0,class:"dss-toolbar-right"},k2={key:0,class:"dss-toolbar-separator"},C2={key:0,class:"dss-toolbar-custom-group"},b2={key:1,class:"dss-toolbar-separator"},x2={name:"DSSTextEditor"},w2=Object.assign(x2,{props:{modelValue:{type:String,default:""},title:{type:String,default:""},description:{type:String,default:""},titlePlaceholder:{type:String,default:null},descriptionPlaceholder:{type:String,default:null},placeholder:{type:String,default:null},rows:{type:Number,default:10},fullHeight:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},richText:{type:Boolean,default:!1},border:{type:Boolean,default:!0},rounded:{type:Boolean,default:!1},fixedHeight:{type:Boolean,default:!1},options:{type:Object,default:()=>({}),validator:E=>typeof E=="object"&&E!==null},floatingToolbar:{type:Boolean,default:!1},askAi:{type:Boolean,default:!1},showTitle:{type:Boolean,default:!0},showDescription:{type:Boolean,default:!0},commentUser:{type:Object,default:null},customToolbarSlots:{type:Array,default:()=>["custom-tool-1","custom-tool-2","custom-tool-3"]},customToolbarFloatingMap:{type:Object,default:()=>({}),validator:E=>typeof E=="object"&&E!==null},locale:{type:String,default:null},comments:{type:Array,default:()=>[]}},emits:["update:modelValue","update:title","update:description","update:comments","change","blur","title-change","description-change","comment-submitted","comment-marker-clicked","comment-deleted"],setup(E,{expose:te,emit:$}){const{t:V,locale:ce}=ro.useI18n(),O={h1:Cd,h2:bd,h3:xd,h4:wd,h5:Ed,h6:Sd},L=E,fe=$,rt=e.useSlots(),ee=`<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
99
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"/>
|
|
100
|
-
</svg>`,v=e.ref(null),Ce=e.ref(null),ke=e.ref(!1),Q=e.ref(!1),X=e.ref(!1),me=e.ref(""),F=e.ref({}),ue=e.ref(!1),Me=e.ref(!1),tt=e.ref(""),mt=e.ref(""),Z=e.ref(null),Ae=e.ref(null),We=e.ref(null),Ee=e.ref(null),_e=e.ref(""),Ye=e.ref(!1),ie=e.ref({}),Je=e.ref(!1),we=e.ref({}),et=e.ref(null),ct=e.ref(null),vt=e.ref(!1),ut=e.ref(""),Ft=e.ref(null),It=e.ref(""),bt=e.ref(""),wt=e.ref(""),Jt=e.ref(null),pt=e.ref(null),jt=e.ref(null),kt=e.ref(null),tn=e.ref(null),U=e.ref(!1),ye=e.ref(""),P=e.ref({}),K=e.ref(!1),Se=e.ref("upload"),Re=e.ref(""),Ze=e.ref(null),xt=e.ref(null),Ke=e.ref([]),zt=e.ref([]),qe=e.ref(null),ze=e.ref(!1),Lt=e.ref(""),$t=e.ref(""),oe=e.ref(""),Y=e.ref(""),j=e.ref(""),de=e.ref(""),be=e.ref(null),je=e.ref(null),Tt=e.ref(null),Xt=e.ref(!1),nt=e.ref(null),sn=e.ref(!1),N=e.ref(!1),b=e.ref(null),B=e.ref("p"),G=e.ref(!1),ae=e.ref([]),De=e.ref(null),Ct=e.ref(null),lt=e.ref(null),Ie=e.ref(!1),Et=e.ref(0),Bt=100,St=e.ref(null),rt=e.computed(()=>!!_.commentUser),At=e.computed(()=>({"dss-text-editor-no-border":!_.border,"dss-text-editor-rounded":_.rounded,"dss-text-editor-full-height":_.fullHeight,"dss-comment-overlay-open":rt.value&&hn.value!==null})),Nt=e.computed(()=>({})),rn=e.computed(()=>!_.fixedHeight||_.fullHeight?{}:{height:`${1.6*14*_.rows+24+2}px`,resize:"none",overflowY:"auto"}),Vn=e.computed(()=>!_.fixedHeight||_.fullHeight?{}:{height:`${1.6*14*_.rows+32}px`,overflowY:"auto"}),Zn=e.computed(()=>_.richText&&zt.value.length>0),en=e.computed(()=>{if(!_.modelValue)return"";if(_.richText){let o=_.modelValue.replace(/<script[^>]*>[\s\S]*?<\/script>/gi,"");return o=o.replace(/<style[^>]*>[\s\S]*?<\/style>/gi,""),o=o.replace(/<[^>]+>/g,""),o=o.replace(/ /g," "),o=o.replace(/&/g,"&"),o=o.replace(/</g,"<"),o=o.replace(/>/g,">"),o=o.replace(/"/g,'"'),o=o.replace(/'/g,"'"),o=o.replace(/\s+/g," ").trim(),o}return _.modelValue}),pn=e.computed(()=>{const o=en.value.trim();return o?o.split(/\s+/).filter(l=>l.length>0).length:0}),ll=e.computed(()=>en.value.length),vl=e.computed(()=>kt.value!==null&&Se.value==="upload"&&It.value&&It.value.startsWith("data:")),il=e.computed(()=>_.titlePlaceholder||V("textEditor.placeholders.title")),_n=e.computed(()=>_.descriptionPlaceholder||V("textEditor.placeholders.description")),gl=e.computed(()=>_.placeholder||V("textEditor.placeholders.startTyping")),$n=o=>st&&st[o]!==void 0,Vl=o=>{for(let l=o+1;l<_.customToolbarSlots.length;l++)if($n(_.customToolbarSlots[l]))return!0;return!1},Rl=o=>{for(let l=o+1;l<_.customToolbarSlots.length;l++){const s=_.customToolbarSlots[l];if($n(s)&&hl(s))return!0}return!1},hl=o=>_.customToolbarFloatingMap.hasOwnProperty(o)?_.customToolbarFloatingMap[o]===!0:!0,An=e.computed(()=>_.customToolbarSlots.some(o=>$n(o)&&hl(o))),Un=e.computed(()=>$n("title-slot")),Xn=e.computed(()=>$n("description-slot")),Hn=o=>{if(!o||o.trim()==="")return"<html></html>";const l=o.trim();return l.startsWith("<html>")&&l.endsWith("</html>")?o:`<html>${o}</html>`},zn=o=>{if(!o||o.trim()==="")return"";const l=o.replace(/<!--[\s\S]*?-->/g,""),s=l.trim();return s.startsWith("<html>")&&s.endsWith("</html>")?s.slice(6,-7).trim():l},Nl=o=>{if(!o)return;const l=document.createTreeWalker(o,NodeFilter.SHOW_COMMENT,null,!1),s=[];let i=l.nextNode();for(;i;)s.push(i),i=l.nextNode();s.forEach(c=>c.remove())},A=o=>{try{const l=String(o.getDate()).padStart(2,"0"),i=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][o.getMonth()],c=o.getFullYear();return`${l} ${i} ${c}`}catch{return""}},z=o=>{if(!o||typeof o!="string")return!1;const l=o.trim();if(!l)return!1;if(["Started conversation","A démarré la conversation","started_conversation","conv_started"].includes(l))return!0;try{const c=V("textEditor.started_conversation");if(c&&l===c)return!0}catch{}const i=l.toLowerCase();return i.includes("started conversation")||i.includes("démarré la conversation")||i==="started conversation"||i==="a démarré la conversation"},L=o=>{const l=o.target.value;pe("update:modelValue",l),pe("change",l)},le=()=>{if(!be.value)return;const o=be.value;if(o.style.setProperty("text-overflow","","important"),o.style.setProperty("white-space","","important"),o.style.setProperty("overflow-x","","important"),o.style.setProperty("height","auto","important"),o.value.trim()===""){const i=o.value;o.value="M";const c=o.scrollHeight;o.value=i,o.style.setProperty("height",`${c}px`,"important"),o.style.setProperty("overflow-y","hidden","important");return}o.offsetHeight;const s=o.scrollHeight;o.style.setProperty("height",`${s}px`,"important"),o.style.setProperty("overflow-y","hidden","important")},Te=()=>{sn.value=!0,le()},ft=()=>{sn.value=!1,dt()},dt=()=>{if(!be.value)return;const o=be.value;o.style.setProperty("text-overflow","","important"),o.style.setProperty("white-space","","important"),o.style.setProperty("overflow-x","","important"),o.style.setProperty("height","auto","important");const l=o.value;o.value="M";const s=o.scrollHeight;o.value=l,o.offsetHeight,o.style.setProperty("height",`${s}px`,"important"),o.style.setProperty("overflow-y","hidden","important"),o.style.setProperty("overflow-x","hidden","important"),o.style.setProperty("text-overflow","ellipsis","important"),o.style.setProperty("white-space","nowrap","important")},ot=o=>{const s=o.target.value;sn.value&&le(),pe("update:title",s),pe("title-change",s),Tt.value="title",_.richText&&(ze.value||($t.value=Lt.value,j.value=oe.value,de.value=Y.value),qe.value&&clearTimeout(qe.value),ze.value=!0,qe.value=setTimeout(()=>{ze.value=!1,he()},500))},at=()=>{if(!je.value)return;const o=je.value;if(o.style.setProperty("text-overflow","","important"),o.style.setProperty("white-space","","important"),o.style.setProperty("overflow-x","","important"),o.style.setProperty("height","auto","important"),o.value.trim()===""){const i=o.value;o.value="M";const c=o.scrollHeight;o.value=i,o.style.setProperty("height",`${c}px`,"important"),o.style.setProperty("overflow-y","hidden","important");return}o.offsetHeight;const s=o.scrollHeight;o.style.setProperty("height",`${s}px`,"important"),o.style.setProperty("overflow-y","hidden","important")},vn=()=>{N.value=!0,at()},bn=()=>{N.value=!1,Wt()},Wt=()=>{if(!je.value)return;const o=je.value;o.style.setProperty("text-overflow","","important"),o.style.setProperty("white-space","","important"),o.style.setProperty("overflow-x","","important"),o.style.setProperty("height","auto","important");const l=o.value;o.value="M";const s=o.scrollHeight;o.value=l,o.offsetHeight,o.style.setProperty("height",`${s}px`,"important"),o.style.setProperty("overflow-y","hidden","important"),o.style.setProperty("overflow-x","hidden","important"),o.style.setProperty("text-overflow","ellipsis","important"),o.style.setProperty("white-space","nowrap","important")},gn=o=>{const s=o.target.value;N.value&&at(),pe("update:description",s),pe("description-change",s),Tt.value="description",_.richText&&(ze.value||($t.value=Lt.value,j.value=oe.value,de.value=Y.value),qe.value&&clearTimeout(qe.value),ze.value=!0,qe.value=setTimeout(()=>{ze.value=!1,he()},500))},Kt=()=>{const o=window.getSelection();if(o.rangeCount===0)return null;const l=o.getRangeAt(0);if(l.startContainer.nodeType===1)return{type:"element",element:l.startContainer,offset:l.startOffset};const s=l.cloneRange();return s.selectNodeContents(v.value),s.setEnd(l.startContainer,l.startOffset),{type:"text",start:s.toString().length,end:s.toString().length+l.toString().length}},Ln=o=>{if(!(!o||!v.value))try{const l=window.getSelection(),s=document.createRange();if(o.type==="element"&&o.element)if(v.value.contains(o.element)){s.setStart(o.element,o.offset),s.collapse(!0),l.removeAllRanges(),l.addRange(s);return}else{v.value.focus();return}let i=0;const c=[v.value];let d=null,u=!1,m=!1;for(;!m&&(d=c.pop());)if(d.nodeType===3){const f=i+d.length;!u&&o.start>=i&&o.start<=f&&(s.setStart(d,o.start-i),u=!0),u&&o.end>=i&&o.end<=f&&(s.setEnd(d,o.end-i),m=!0),i=f}else{let f=d.childNodes.length;for(;f--;)c.push(d.childNodes[f])}l.removeAllRanges(),l.addRange(s)}catch{v.value.focus()}},Ht=()=>{if(!v.value)return;v.value.focus();const o=window.getSelection(),l=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],m=s(u);if(m)return m}return c},i=s(v.value);if(i.nodeType===3)l.setStart(i,i.length),l.setEnd(i,i.length);else if(i.childNodes.length>0){const c=s(i);c&&c.nodeType===3?(l.setStart(c,c.length),l.setEnd(c,c.length)):(l.selectNodeContents(i),l.collapse(!1))}else l.setStart(i,0),l.setEnd(i,0);o.removeAllRanges(),o.addRange(l)},he=(o=!1)=>{if(!v.value)return;const l=v.value.innerHTML,s=_.title||"",i=_.description||"";if(!o&&l===Lt.value&&s===oe.value&&i===Y.value)return;const c={content:$t.value||Lt.value,title:j.value!==void 0?j.value:oe.value,description:de.value!==void 0?de.value:Y.value},d=Ke.value.length>0?Ke.value[Ke.value.length-1]:null;let u=!0;d&&(typeof d=="string"?u=c.content!==d:u=c.content!==d.content||c.title!==d.title||c.description!==d.description),u&&(Ke.value.push(c),Ke.value.length>50&&Ke.value.shift(),zt.value=[]),Lt.value=l,oe.value=s,Y.value=i,$t.value=l,j.value=s,de.value=i},Mt=o=>{if(!v.value)return;gt(),v.value&&Nl(v.value);let l=null;v.value&&(v.value.querySelector("p")||(l=Kt(),Rn()));const s=o&&o.inputType&&(o.inputType==="insertText"||o.inputType==="insertCompositionText"||o.inputType==="deleteContentBackward"||o.inputType==="deleteContentForward");s&&b.value&&(b.value=null),Q.value=!0;const i=v.value.innerHTML.replace(/<!--[\s\S]*?-->/g,"").replace(/ |\u00A0/g," "),c=Hn(i);pe("update:modelValue",c),pe("change",c),Tt.value="editor",ze.value||($t.value=Lt.value,j.value=oe.value,de.value=Y.value),qe.value&&clearTimeout(qe.value),ze.value=!0,qe.value=setTimeout(()=>{ze.value=!1,he(),lo(),_o()},500),e.nextTick(()=>{l&&Ln(l),gt();const d=["bold","italic","underline"],u=window.getSelection(),m=u.rangeCount>0?u.getRangeAt(0):null,f=m&&m.collapsed;if(d.forEach(k=>{try{if(f&&b.value?.command===k){ie.value[k]=b.value.state;return}if(k==="bold")if(m){const D=m.commonAncestorContainer,R=D.nodeType===3?D.parentElement:D;let S=!1;if(R&&((R.tagName==="STRONG"||R.tagName==="B"||R.closest&&R.closest("strong, b"))&&(S=!0),!S&&R.style&&parseInt(R.style.fontWeight)>=600&&(S=!0),!S))try{const re=window.getComputedStyle(R);parseInt(re.fontWeight)>=600&&(S=!0)}catch{}ie.value[k]=S}else ie.value.hasOwnProperty(k)||(ie.value[k]=!1);else if(k==="italic")if(m){const D=m.commonAncestorContainer,R=D.nodeType===3?D.parentElement:D,S=R&&(R.tagName==="EM"||R.tagName==="I"||R.closest&&R.closest("em, i"));ie.value[k]=!!S}else{const D=document.queryCommandState(k);ie.value[k]=D}else{const D=document.queryCommandState(k);ie.value[k]=D}}catch{}}),Mn(),Ue(),ol(),Qt(),it(),Vt("handleRichTextInput"),s&&(o.inputType==="insertText"||o.inputType==="insertCompositionText")){const k=o.data||"";k&&k.length===1&&setTimeout(()=>_o(k),0),(k===" "||k===`
|
|
101
|
-
`||/[.,;:!?]/.test(k))&&setTimeout(()=>{lo()},100)}Q.value=!1})},gt=()=>{if(!v.value)return;const o=window.getSelection();if(!o||o.rangeCount===0)return;const l=o.getRangeAt(0),s=l.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=l.startContainer.nodeType===3?l.startContainer.parentElement:l.startContainer,m=l.endContainer.nodeType===3?l.endContainer.parentElement:l.endContainer;if(c.contains(u)&&u!==d||c.contains(m)&&m!==d){const f=document.createRange();f.setStartAfter(c),f.collapse(!0),o.removeAllRanges(),o.addRange(f)}}}},Rn=()=>{if(!v.value)return;const o=v.value;if(o.querySelector&&o.querySelector("p"))return;const l=new Set(["P","H1","H2","H3","H4","H5","H6","BLOCKQUOTE","UL","OL","DIV"]),s=Array.from(o.childNodes);let i=null;s.forEach(c=>{if(c.nodeType===Node.TEXT_NODE){if((c.textContent||"").trim()===""){c.parentNode===o&&o.removeChild(c);return}i||(i=document.createElement("p"),o.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(l.has(u)){i=null;return}i||(i=document.createElement("p"),o.insertBefore(i,d)),i.appendChild(d)}})},Ue=()=>{if(v.value&&!Xt.value){Xt.value=!0;try{v.value.querySelectorAll(".dss-image-wrapper").forEach(i=>{i.querySelector("img")||i.remove()}),v.value.querySelectorAll(".dss-image-no-alt-icon").forEach(i=>{const c=i.parentElement;!c||!c.classList.contains("dss-image-wrapper")?i.remove():c.querySelector("img")||i.remove()}),v.value.querySelectorAll("img").forEach(i=>{let c=i.getAttribute("alt");c===null&&(c=i.alt||"");const d=i.getAttribute("src")||i.src||"";if(c){const k=d.replace(/^https?:\/\//,"").replace(/^data:.*,/,""),D=c===d||c===k;(c.startsWith("http://")||c.startsWith("https://")||c.startsWith("data:")||D||D)&&(c="")}i.setAttribute("alt",c),i.setAttribute("data-alt",c);const u=!c||c.trim()==="";let m=i.parentElement;const f=m&&m.classList.contains("dss-image-wrapper");if(f){const k=m.querySelector(".dss-image-no-alt-icon");k&&k.remove()}else{const k=i.nextElementSibling?.classList.contains("dss-image-no-alt-icon")?i.nextElementSibling:null;k&&k.remove()}if(u){f?m.setAttribute("contenteditable","false"):(m=document.createElement("span"),m.className="dss-image-wrapper",m.setAttribute("contenteditable","false"),i.parentNode.insertBefore(m,i),m.appendChild(i));const k=document.createElement("div");k.className="dss-image-no-alt-icon",k.setAttribute("contenteditable","false"),k.innerHTML=te,m.appendChild(k)}else if(f&&m.children.length===1){const k=m.parentNode;k.insertBefore(i,m),k.removeChild(m)}})}finally{Xt.value=!1}}},ht=o=>{lo(),pe("blur",o),Il()},se=()=>{if(_.disabled||!_.richText||!v.value)return;un(),qe.value&&(clearTimeout(qe.value),qe.value=null),ze.value&&(he(),ze.value=!1);const o=Tt.value==="title",l=Tt.value==="description",s=Tt.value==="editor";if(Ke.value.length===0){o&&be.value?be.value.focus():l&&je.value?je.value.focus():v.value.focus(),document.execCommand("undo",!1),e.nextTick(()=>{Mt()});return}const i={content:v.value.innerHTML,title:_.title||"",description:_.description||""};zt.value.push(i);const c=Ke.value.pop();if(c!==void 0){Q.value=!0;const d=typeof c=="string"?c:c.content,u=typeof c=="object"&&c.title||"",m=typeof c=="object"&&c.description||"";v.value.innerHTML=d,Lt.value=d,oe.value=u,Y.value=m,$t.value=d,j.value=u,de.value=m,e.nextTick(()=>{Mn(),Bn(),Zt(),Qt();const f=Hn(d);pe("update:modelValue",f),pe("update:title",u),pe("update:description",m),pe("change",f),pe("title-change",u),pe("description-change",m),Q.value=!1,e.nextTick(()=>{setTimeout(()=>{if(o){if(be.value){be.value.focus();const k=u.length;be.value.setSelectionRange&&be.value.setSelectionRange(k,k),le()}}else if(l){if(je.value){je.value.focus();const k=m.length;je.value.setSelectionRange(k,k)}}else if(s)Ht();else if(be.value&&document.activeElement===be.value){const k=u.length;be.value.setSelectionRange&&be.value.setSelectionRange(k,k),le()}else if(je.value&&document.activeElement===je.value){const k=m.length;je.value.setSelectionRange(k,k)}else v.value&&Ht()},10)})})}},on=()=>{if(_.disabled||!_.richText||!v.value)return;un();const o=Tt.value==="title",l=Tt.value==="description",s=Tt.value==="editor";if(zt.value.length===0){o&&be.value?be.value.focus():l&&je.value?je.value.focus():v.value.focus(),document.execCommand("redo",!1),e.nextTick(()=>{Mt()});return}const i={content:v.value.innerHTML,title:_.title||"",description:_.description||""};Ke.value.push(i);const c=zt.value.pop();if(c!==void 0){Q.value=!0;const d=typeof c=="string"?c:c.content,u=typeof c=="object"&&c.title||"",m=typeof c=="object"&&c.description||"";v.value.innerHTML=d,Lt.value=d,oe.value=u,Y.value=m,$t.value=d,j.value=u,de.value=m,e.nextTick(()=>{Mn(),Bn(),Zt(),Qt();const f=Hn(d);pe("update:modelValue",f),pe("update:title",u),pe("update:description",m),pe("change",f),pe("title-change",u),pe("description-change",m),Q.value=!1,e.nextTick(()=>{setTimeout(()=>{if(o){if(be.value){be.value.focus();const k=u.length;be.value.setSelectionRange&&be.value.setSelectionRange(k,k),le()}}else if(l){if(je.value){je.value.focus();const k=m.length;je.value.setSelectionRange(k,k)}}else if(s)Ht();else if(be.value&&document.activeElement===be.value){const k=u.length;be.value.setSelectionRange&&be.value.setSelectionRange(k,k),le()}else if(je.value&&document.activeElement===je.value){const k=m.length;je.value.setSelectionRange(k,k)}else v.value&&Ht()},10)})})}},Fe=()=>{if(!v.value)return;v.value.querySelectorAll('span[style*="font-weight"]').forEach(i=>{const c=i.style.fontWeight;if(c==="normal"||c==="400"){const d=document.createDocumentFragment();for(;i.firstChild;)d.appendChild(i.firstChild);i.parentNode&&i.parentNode.replaceChild(d,i)}}),v.value.querySelectorAll('span[style*="font-weight"]').forEach(i=>{if(parseInt(i.style.fontWeight)>=600){const d=document.createElement("b");for(d.style.fontWeight="600";i.firstChild;)d.appendChild(i.firstChild);i.parentNode&&i.parentNode.replaceChild(d,i)}}),v.value.querySelectorAll("b, strong").forEach(i=>{i.style.fontWeight="600"})},ol=()=>{if(!v.value)return;v.value.querySelectorAll("i, em").forEach(l=>{l.style.fontStyle="italic"})},cn=()=>{const o=window.getSelection();if(!o||o.rangeCount===0)return!1;const l=o.getRangeAt(0);let s=!1;if(l.collapsed){const i=l.startContainer;let c=i.nodeType===3?i.parentElement:i;for(;c&&c!==v.value;){if(c.tagName==="EM"||c.tagName==="I"){s=!0;break}if(c.style&&c.style.fontStyle==="italic"){s=!0;break}c=c.parentElement}}else{const i=l.commonAncestorContainer.nodeType===1?l.commonAncestorContainer:l.commonAncestorContainer.parentNode;if(i){const c=document.createTreeWalker(i,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let d;for(;d=c.nextNode();)if(!(typeof l.intersectsNode=="function"&&!l.intersectsNode(d))){if(d.nodeType===3){let u=d.parentElement;for(;u&&u!==v.value;){if(u.tagName==="EM"||u.tagName==="I"){s=!0;break}if(u.style&&u.style.fontStyle==="italic"){s=!0;break}u=u.parentElement}}else if(d.nodeType===1){const u=d;if(u.tagName==="EM"||u.tagName==="I"){s=!0;break}if(u.style&&u.style.fontStyle==="italic"){s=!0;break}}if(s)break}}}if(s)return document.execCommand("italic",!1),e.nextTick(()=>{ol()}),!1;if(l.collapsed)document.execCommand("italic",!1),e.nextTick(()=>{ol()});else try{const i=l.extractContents(),c=document.createElement("em");c.style.fontStyle="italic",c.appendChild(i),l.insertNode(c),l.setStartAfter(c),l.collapse(!0),o.removeAllRanges(),o.addRange(l),e.nextTick(()=>{ol()})}catch{document.execCommand("italic",!1),e.nextTick(()=>{ol()})}return!0},yl=()=>{const o=window.getSelection();if(!o||o.rangeCount===0)return!1;const l=o.getRangeAt(0);let s=!1;if(l.collapsed){const i=l.startContainer;let c=i.nodeType===3?i.parentElement:i;for(;c&&c!==v.value;){if(c.tagName==="STRONG"||c.tagName==="B"){s=!0;break}if(c.style&&parseInt(c.style.fontWeight)>=600){s=!0;break}c=c.parentElement}}else{const i=l.commonAncestorContainer.nodeType===1?l.commonAncestorContainer:l.commonAncestorContainer.parentNode;if(i){const c=document.createTreeWalker(i,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let d;for(;d=c.nextNode();)if(!(typeof l.intersectsNode=="function"&&!l.intersectsNode(d))){if(d.nodeType===3){let u=d.parentElement;for(;u&&u!==v.value;){if(u.tagName==="STRONG"||u.tagName==="B"){s=!0;break}if(u.style&&parseInt(u.style.fontWeight)>=600){s=!0;break}u=u.parentElement}}else if(d.nodeType===1){const u=d;if(u.tagName==="STRONG"||u.tagName==="B"){s=!0;break}if(u.style&&parseInt(u.style.fontWeight)>=600){s=!0;break}}if(s)break}}}if(s)return document.execCommand("bold",!1),e.nextTick(()=>{Fe()}),!1;if(l.collapsed)document.execCommand("bold",!1),e.nextTick(()=>{const i=window.getSelection();if(i.rangeCount>0){const c=i.getRangeAt(0),d=c.startContainer;let u=d.nodeType===3?d.parentElement:d;for(;u&&u!==v.value;){if(u.tagName==="SPAN"&&u.style.fontWeight){const m=u.style.fontWeight;if(m==="normal"||m==="400"){const f=document.createElement("b");f.style.fontWeight="600";const k=document.createDocumentFragment();for(;u.firstChild;)k.appendChild(u.firstChild);f.appendChild(k),u.parentNode&&u.parentNode.replaceChild(f,u),c.setStart(f,0),c.collapse(!0),i.removeAllRanges(),i.addRange(c);break}}else if(u.tagName==="STRONG"||u.tagName==="B"){u.style.fontWeight="600";break}u=u.parentElement}if(!u||u===v.value){const m=document.createElement("b");m.style.fontWeight="600",m.innerHTML="<br>",c.insertNode(m),c.setStart(m,0),c.collapse(!0),i.removeAllRanges(),i.addRange(c)}}Fe()});else try{const i=l.extractContents(),c=document.createElement("b");c.style.fontWeight="600",c.appendChild(i),l.insertNode(c),l.setStartAfter(c),l.collapse(!0),o.removeAllRanges(),o.addRange(l),e.nextTick(()=>{Fe()})}catch{document.execCommand("bold",!1),e.nextTick(()=>{Fe()})}return!0},Nn=(o,l=null)=>{if(_.disabled||!_.richText||!v.value)return;ze.value?(qe.value&&(clearTimeout(qe.value),qe.value=null),he(),ze.value=!1):he(),un(),v.value.focus();const s=window.getSelection();let i=null;if(s&&s.rangeCount>0){const d=s.getRangeAt(0);!d.collapsed&&_l(d)&&(i=Kt())}if(o==="createLink"&&l){const d=window.getSelection();if(d.rangeCount>0){const u=d.getRangeAt(0);if(u.collapsed)try{u.expand("word")}catch{const f=document.createTextNode(l);u.insertNode(f),u.selectNodeContents(f)}}}if(o==="bold"){const d=yl();ie.value.bold=d;const u=window.getSelection();u.rangeCount>0&&u.getRangeAt(0).collapsed&&(b.value={command:"bold",state:d}),e.nextTick(()=>{i&&(Ln(i),e.nextTick(()=>{const m=Gt("bold");ie.value.bold=m})),Mt(),Bn(),Qt()});return}if(o==="italic"){const d=cn();ie.value.italic=d;const u=window.getSelection();u.rangeCount>0&&u.getRangeAt(0).collapsed&&(b.value={command:"italic",state:d}),e.nextTick(()=>{i&&(Ln(i),e.nextTick(()=>{const m=Gt("italic");ie.value.italic=m})),Mt(),ol(),Bn(),Qt()});return}let c=!1;try{c=document.execCommand(o,!1,l)}catch{}e.nextTick(()=>{if(i&&Ln(i),["bold","italic","underline"].includes(o))try{if(o==="bold")i&&e.nextTick(()=>{const u=Gt("bold");ie.value.bold=u});else if(o==="italic")if(i)e.nextTick(()=>{const u=Gt("italic");ie.value.italic=u});else{const u=document.queryCommandState(o);ie.value[o]=u}else{const u=document.queryCommandState(o);ie.value[o]=u}}catch{ie.value.hasOwnProperty(o)?ie.value[o]=!ie.value[o]:ie.value[o]=!0}if(o==="createLink"&&l){const u=window.getSelection();if(u.rangeCount>0){const f=u.getRangeAt(0),k=f.commonAncestorContainer.nodeType===1?f.commonAncestorContainer.closest("a"):f.commonAncestorContainer.parentElement?.closest("a");k&&(!k.getAttribute("href")||k.getAttribute("href")==="")&&k.setAttribute("href",l)}v.value.querySelectorAll("a").forEach(f=>{const k=f.getAttribute("href");(!k||k===""||k==="#")&&f.setAttribute("href",l)})}Mt(),Bn(),Qt()})},Gt=(o,l=null)=>{if(_.disabled||!v.value)return!1;try{if(o==="formatBlock"&&l){const i=document.queryCommandValue("formatBlock");if(l==="<blockquote>"){const c=i.toLowerCase();if(c==="blockquote"||c==="<blockquote>")return!0;const d=window.getSelection();if(d.rangeCount>0){const m=d.getRangeAt(0).commonAncestorContainer;return!!(m.nodeType===1?m.tagName==="BLOCKQUOTE"?m:m.closest("blockquote"):m.parentElement?.closest("blockquote"))}}return i===l||i.toLowerCase()===l.toLowerCase()}if(["bold","italic","underline"].includes(o))try{const i=window.getSelection();if(i.rangeCount>0){const c=i.getRangeAt(0);if(o==="bold"){let u=!1;if(c.collapsed){const m=c.commonAncestorContainer,f=m.nodeType===3?m.parentElement:m;if(f&&((f.tagName==="STRONG"||f.tagName==="B"||f.closest&&f.closest("strong, b"))&&(u=!0),!u&&f.style&&parseInt(f.style.fontWeight)>=600&&(u=!0),!u))try{const k=window.getComputedStyle(f);parseInt(k.fontWeight)>=600&&(u=!0)}catch{}return ie.value.hasOwnProperty(o)?ie.value[o]:(ie.value[o]=u,u)}else{const m=c.commonAncestorContainer.nodeType===1?c.commonAncestorContainer:c.commonAncestorContainer.parentNode;let f=!1;if(m){const k=document.createTreeWalker(m,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let D;for(;D=k.nextNode();)if(!(typeof c.intersectsNode=="function"&&!c.intersectsNode(D))){if(D.nodeType===3){if(!(D.textContent||"").trim())continue;f=!0;let S=D.parentElement;for(;S&&S!==v.value;){if(S.tagName==="STRONG"||S.tagName==="B"){u=!0;break}if(S.style&&parseInt(S.style.fontWeight)>=600){u=!0;break}S=S.parentElement}}else if(D.nodeType===1){const R=D;if(R.tagName==="STRONG"||R.tagName==="B"){u=!0;break}if(R.style&&parseInt(R.style.fontWeight)>=600){u=!0;break}}if(u)break}}return ie.value[o]=u&&f,u&&f}}if(o==="italic"){let u=!1;if(c.collapsed){const m=c.commonAncestorContainer,f=m.nodeType===3?m.parentElement:m;if(f&&((f.tagName==="EM"||f.tagName==="I"||f.closest&&f.closest("em, i"))&&(u=!0),!u&&f.style&&f.style.fontStyle==="italic"&&(u=!0),!u))try{window.getComputedStyle(f).fontStyle==="italic"&&(u=!0)}catch{}return ie.value.hasOwnProperty(o)?ie.value[o]:(ie.value[o]=u,u)}else{const m=c.commonAncestorContainer.nodeType===1?c.commonAncestorContainer:c.commonAncestorContainer.parentNode;let f=!1;if(m){const k=document.createTreeWalker(m,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let D;for(;D=k.nextNode();)if(!(typeof c.intersectsNode=="function"&&!c.intersectsNode(D))){if(D.nodeType===3){if(!(D.textContent||"").trim())continue;f=!0;let S=D.parentElement;for(;S&&S!==v.value;){if(S.tagName==="EM"||S.tagName==="I"){u=!0;break}if(S.style&&S.style.fontStyle==="italic"){u=!0;break}S=S.parentElement}}else if(D.nodeType===1){const R=D;if(R.tagName==="EM"||R.tagName==="I"){u=!0;break}if(R.style&&R.style.fontStyle==="italic"){u=!0;break}}if(u)break}}return ie.value[o]=u&&f,u&&f}}const d=document.queryCommandState(o);return c.collapsed&&ie.value.hasOwnProperty(o)?ie.value[o]:(ie.value[o]=d,d)}return ie.value.hasOwnProperty(o)?ie.value[o]:!1}catch{return ie.value.hasOwnProperty(o)?ie.value[o]:!1}try{return document.queryCommandState(o)}catch{return!1}}catch{return!1}},Fl=o=>{_.disabled||!_.richText||(Ce.value=Ce.value===o?null:o,o==="askAi"&&(ct.value=null))},un=()=>{Ce.value=null,Ze.value=null},Pn=o=>{Nn("formatBlock",o),un()},Zl=o=>{if(!o||!v.value)return o;const l=Pe=>{let Be=Pe.nodeType===Node.TEXT_NODE?Pe.parentElement:Pe;for(;Be&&Be!==v.value;){const yt=Be.tagName;if(yt==="P"){const dn=Be.parentElement;if(dn===v.value||dn.tagName==="BLOCKQUOTE")return Be}if(yt==="BLOCKQUOTE")break;Be=Be.parentElement}return null},s=l(o.startContainer),i=l(o.endContainer);if(!s||!i)return o;const c=[],d=document.createTreeWalker(v.value,NodeFilter.SHOW_ELEMENT,{acceptNode:Pe=>{const Be=Pe.tagName;if(Be==="P"){const yt=Pe.parentElement;if(yt===v.value||yt.tagName==="BLOCKQUOTE")return NodeFilter.FILTER_ACCEPT}return Be==="BLOCKQUOTE"?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_SKIP}});let u;for(;u=d.nextNode();)c.push(u);const m=c.indexOf(s),f=c.indexOf(i);if(m===-1||f===-1)return o;const k=Math.min(m,f),D=Math.max(m,f),R=c.slice(k,D+1);if(R.length===0)return o;const S=R[0],re=R[R.length-1],J=document.createRange();return J.setStartBefore(S),J.setEndAfter(re),J},Yn=()=>{if(_.disabled||!_.richText||!v.value)return;ze.value?(qe.value&&(clearTimeout(qe.value),qe.value=null),he(),ze.value=!1):he(),un(),v.value.focus();const o=window.getSelection();if(o.rangeCount===0)return;let l=o.getRangeAt(0);!l.collapsed&&_l(l)&&(l=Zl(l),o.removeAllRanges(),o.addRange(l));let s=null;!l.collapsed&&_l(l)&&(s=Kt());const i=l.commonAncestorContainer,c=i.nodeType===1?i.tagName==="BLOCKQUOTE"?i:i.closest("blockquote"):i.parentElement?.closest("blockquote");if(!!(c&&v.value.contains(c))){if(c){const u=c.parentNode;Array.from(c.childNodes).forEach(f=>{if(f.nodeType===Node.ELEMENT_NODE)if(f.tagName==="P"||f.tagName==="DIV")u.insertBefore(f,c);else{const k=document.createElement("p");k.appendChild(f.cloneNode(!0)),u.insertBefore(k,c)}else if(f.nodeType===Node.TEXT_NODE&&f.textContent.trim()){const k=document.createElement("p");k.appendChild(f.cloneNode(!0)),u.insertBefore(k,c)}}),c.remove()}}else if(l.collapsed)document.execCommand("formatBlock",!1,"<blockquote>");else{const u=document.createElement("blockquote"),m=l.extractContents();u.appendChild(m),l.insertNode(u);const f=[],k=document.createTreeWalker(u,NodeFilter.SHOW_TEXT,{acceptNode:S=>S.parentNode===u&&S.textContent.trim()?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});let D;for(;D=k.nextNode();)f.push(D);if(f.forEach(S=>{const re=document.createElement("p");S.parentNode.insertBefore(re,S),re.appendChild(S)}),u.querySelectorAll("p, div").forEach(S=>{S.textContent.trim()===""&&!S.querySelector("img")&&(S.innerHTML="<br>")}),u.children.length===0&&u.textContent.trim()===""){const S=document.createElement("p");S.innerHTML="<br>",u.appendChild(S)}}e.nextTick(()=>{s&&Ln(s),Zt(),Mt(),Qt()})},Bl=()=>{if(!v.value)return;const o=window.getSelection();if(o.rangeCount===0)return;const s=o.getRangeAt(0).commonAncestorContainer,i=s.nodeType===1?s.tagName==="BLOCKQUOTE"?s:s.closest("blockquote"):s.parentElement?.closest("blockquote");if(!i||!v.value.contains(i))return;const c=D=>{if(!D)return!1;const R=D.textContent||"",re=(D.innerHTML||"").trim();return R.trim()===""||re===""||re==="<br>"||re==="<br/>"||re==="<p></p>"||re==="<p><br></p>"||re==="<p><br/></p>"||re==="<p> </p>"||re==="<p><br> </p>"||re==="<div></div>"||re==="<div><br></div>"||re==="<div><br/></div>"};let d=null;for(s.nodeType===3?d=s.parentElement:s.tagName==="P"||s.tagName==="DIV"?d=s:d=s.closest("p, div"),d&&i.contains(d)&&c(d)&&d.remove();i.lastChild;){const D=i.lastChild;if(D.nodeType===1&&D.tagName==="BR")D.remove();else if(D.nodeType===3)if((D.textContent||"").trim()==="")D.remove();else break;else break}if(i.children.length>0)for(let D=i.children.length-1;D>=0;D--){const R=i.children[D];if((R.tagName==="P"||R.tagName==="DIV")&&c(R))R.remove();else break}let u=i.innerHTML;const m=u;u=u.replace(/(<br\s*\/?>)+$/gi,""),u!==m&&(i.innerHTML=u);const f=document.createElement("p");f.innerHTML="<br>",i.parentNode?i.nextSibling?i.parentNode.insertBefore(f,i.nextSibling):i.parentNode.appendChild(f):v.value&&v.value.appendChild(f);const k=document.createRange();k.selectNodeContents(f),k.collapse(!0),o.removeAllRanges(),o.addRange(k),e.nextTick(()=>{Zt(),Mt()})},Bn=()=>{if(!v.value){ke.value=!1;return}try{const o=window.getSelection();if(o.rangeCount>0){const s=o.getRangeAt(0).commonAncestorContainer,i=s.nodeType===1?s.closest("a"):s.parentElement?.closest("a");ke.value=!!i}else ke.value=!1}catch{ke.value=!1}},Gl=()=>{if(!v.value)return;const o=window.getSelection();o&&o.rangeCount>0&&o.getRangeAt(0),Ee.value=Kt();const l=window.getSelection();let s="";l.rangeCount>0&&(s=l.getRangeAt(0).toString()),tt.value="",mt.value=s,_e.value="",We.value=null,Me.value=!0,un(),e.nextTick(()=>{Z.value&&Z.value.focus()})},cl=()=>{if(!v.value)return;ze.value?(qe.value&&(clearTimeout(qe.value),qe.value=null),he(),ze.value=!1):he();const o=window.getSelection();let l=null;if(o.rangeCount>0){const i=o.getRangeAt(0).commonAncestorContainer;l=i.nodeType===1?i.closest("a"):i.parentElement?.closest("a")}if(!l&&We.value&&(l=We.value),l&&l.parentNode){const s=document.createDocumentFragment();for(;l.firstChild;)s.appendChild(l.firstChild);if(l.parentNode.replaceChild(s,l),s.firstChild){const i=document.createRange();i.setStartBefore(s.firstChild),i.setEndAfter(s.lastChild||s.firstChild),o.removeAllRanges(),o.addRange(i),document.execCommand("removeFormat",!1),i.collapse(!1),o.removeAllRanges(),o.addRange(i)}We.value=null}else Nn("unlink");ke.value=!1,un(),e.nextTick(()=>{Mt(),Bn()})},Ul=()=>{_.disabled||!_.richText||v.value&&(ze.value?(qe.value&&(clearTimeout(qe.value),qe.value=null),he(),ze.value=!1):he(),un(),v.value.focus(),document.execCommand("insertUnorderedList",!1),e.nextTick(()=>{Mn(),Mt(),Qt()}))},kl=()=>{_.disabled||!_.richText||v.value&&(ze.value?(qe.value&&(clearTimeout(qe.value),qe.value=null),he(),ze.value=!1):he(),un(),v.value.focus(),document.execCommand("insertOrderedList",!1),e.nextTick(()=>{Mn(),Mt(),Qt()}))},Ql=o=>{const l=o.parentElement;if(!l||l.tagName!=="OL")return null;let s=0,i=o.previousElementSibling;for(;i;)i.tagName==="LI"&&s++,i=i.previousElementSibling;return s+1},Mn=()=>{if(!v.value)return;v.value.querySelectorAll("li > ol").forEach(l=>{const s=l.parentElement;if(s&&s.tagName==="LI"){const i=Ql(s);i!==null&&Array.from(l.children).filter(d=>d.tagName==="LI").forEach(d=>{d.setAttribute("data-parent-num",String(i))})}})},ul=()=>{if(_.disabled||!_.richText||!v.value)return;un(),v.value.focus();const o=window.getSelection();if(o.rangeCount===0)return;const l=o.getRangeAt(0),s=l.commonAncestorContainer.nodeType===1?l.commonAncestorContainer.closest("li"):l.commonAncestorContainer.parentElement?.closest("li");if(!s){document.execCommand("indent",!1),e.nextTick(()=>{Mn(),Mt()});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 m=Ql(c);u.appendChild(s),m!==null&&i.tagName==="OL"&&s.setAttribute("data-parent-num",String(m)),Mn();const f=document.createRange();f.selectNodeContents(s),f.collapse(!1),o.removeAllRanges(),o.addRange(f),e.nextTick(()=>{Mt(),Qt()})}else document.execCommand("indent",!1),e.nextTick(()=>{Mn(),Mt(),Qt()})},xn=()=>{if(_.disabled||!_.richText||!v.value)return;un(),v.value.focus();const o=window.getSelection();if(o.rangeCount===0)return;const l=o.getRangeAt(0),s=l.commonAncestorContainer.nodeType===1?l.commonAncestorContainer.closest("li"):l.commonAncestorContainer.parentElement?.closest("li");if(!s){document.execCommand("outdent",!1),e.nextTick(()=>{Mn(),Mt()});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(),Mn();const u=document.createRange();u.selectNodeContents(s),u.collapse(!1),o.removeAllRanges(),o.addRange(u),e.nextTick(()=>{Mt(),Qt()});return}}document.execCommand("outdent",!1),e.nextTick(()=>{Mn(),Mt(),Qt()})},hn=e.ref(null),jn=e.ref(null),y=e.ref({}),h=e.ref(""),x=e.ref(null),q=e.ref("");e.ref("");const fe=e.ref(null);e.ref("");const Ge=e.ref([]),qt=e.ref(!1),yn=e.ref(!1),Fn=o=>{if(!o)return"";const l=o.cloneRange(),s=document.createElement("div");return s.appendChild(l.cloneContents()),s.innerHTML},On=()=>{if(!_.commentUser||_.disabled||!_.richText||!v.value)return;if(hn.value!==null){hn.value=null,h.value="",q.value="",fe.value=null,Ge.value=[],Tl(!0);return}un(),v.value.focus();const o=window.getSelection();if(!o||o.rangeCount===0)return;const l=o.getRangeAt(0);if(l.collapsed||!_l(l))return;q.value=Fn(l)||"",fe.value=Kt();const s=l.getBoundingClientRect(),i=v.value.parentElement;if(!i)return;const c=i.getBoundingClientRect(),d=s.bottom-c.top,m=Math.max(d+8,0);y.value={top:`${m}px`,bottom:"auto"},hn.value=Date.now(),e.nextTick(()=>{if(h.value="",x.value){const k=x.value;k.style.height="auto",k.style.height=`${k.scrollHeight}px`,k.focus()}const f=i.querySelector(".dss-comment-overlay");if(f&&i){const k=i.querySelector(".dss-text-editor-footer");if(k){const D=i.getBoundingClientRect(),R=f.getBoundingClientRect(),S=k.getBoundingClientRect(),re=R.bottom-D.top,J=S.top-D.top,Pe=8;if(re>J-Pe){const Be=S.height;y.value={bottom:`${Be+Pe}px`,top:"auto"}}else y.value={top:`${m}px`,bottom:"auto"}}}})},Cl=()=>{if(!h.value.trim())return;const o=h.value.trim(),l=new Date,s={text:o,selectionText:q.value,selectionRange:fe.value,commentId:hn.value,user:_.commentUser||null,createdAt:l.toISOString()};Ge.value=[...Ge.value,s],pe("comment-submitted",s),Vo(s),fe.value&&!Uo(fe.value)&&go(hn.value,fe.value),h.value="",e.nextTick(()=>{if(x.value){const i=x.value;i.style.height="auto",i.style.height=`${i.scrollHeight}px`,i.focus()}Vt("sendComment")})},fo=(o,l)=>{if(!(!_.commentUser||!o.user||o.user.id!==_.commentUser.id)){if(Ge.value=Ge.value.filter((s,i)=>i!==l),hn.value!==null&&v.value){const s=String(hn.value),i=v.value.querySelector(`[data-comment="${s}"], [data-fake-comment="${s}"]`);if(i&&Ge.value.length>0){const c=[],d=new Set;Ge.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(Ge.value.length))}else i&&Ge.value.length===0&&(i.removeAttribute("data-comment-user"),i.removeAttribute("data-comment-user-2"),i.setAttribute("data-comment-count","0"))}if(pe("comment-deleted",{comment:o,index:l,commentId:hn.value}),_.comments&&Array.isArray(_.comments)){const s=_.comments.filter(i=>!(i.commentId===o.commentId&&i.text===o.text&&i.user?.id===o.user?.id));pe("update:comments",s)}e.nextTick(()=>{Vt("deleteComment")})}},Uo=o=>{if(!o||!v.value)return!1;try{const l=vo(o);if(!l)return!1;const s=l.commonAncestorContainer,i=s.nodeType===3?s.parentElement:s;if(i)return!!i.closest("[data-comment], [data-fake-comment]")}catch{}return!1},vo=o=>{if(!o||!v.value)return null;try{const l=document.createRange();if(o.type==="element"&&o.element)return v.value.contains(o.element)?(l.setStart(o.element,o.offset),l.collapse(!0),l):null;let s=0;const i=[v.value];let c=null,d=!1,u=!1;for(;!u&&(c=i.pop());)if(c.nodeType===3){const m=s+c.length;!d&&o.start>=s&&o.start<=m&&(l.setStart(c,o.start-s),d=!0),d&&o.end>=s&&o.end<=m&&(l.setEnd(c,o.end-s),u=!0),s=m}else{let m=c.childNodes.length;for(;m--;)i.push(c.childNodes[m])}return d?l:null}catch{return null}},go=(o,l)=>{if(!(!o||!l||!v.value))try{const s=vo(l);if(!s||s.collapsed)return;const i=s.commonAncestorContainer,c=i.nodeType===3?i.parentElement:i;if(c){const m=c.closest("[data-comment], [data-fake-comment]");if(m){m.getAttribute("data-comment")!==String(o)&&m.getAttribute("data-fake-comment")!==String(o)&&m.setAttribute("data-comment",String(o));return}}const d=document.createElement("span");d.setAttribute("data-comment",String(o));try{const m=s.startContainer,f=s.endContainer,k=s.startOffset,D=s.endOffset,R=m.nodeType===3?m.parentNode:m,S=f.nodeType===3?f.parentNode:f;if(R===S&&k===0&&D===(f.nodeType===3?f.length:S.childNodes.length)&&(R.tagName==="P"||R.tagName==="DIV"||R.tagName==="H1"||R.tagName==="H2"||R.tagName==="H3"||R.tagName==="H4"||R.tagName==="H5"||R.tagName==="H6")){const J=s.extractContents();d.appendChild(J),s.insertNode(d)}else s.surroundContents(d)}catch{const f=s.extractContents();d.appendChild(f),s.insertNode(d)}const u=v.value.querySelector(`[data-comment="${String(o)}"]`);e.nextTick(()=>{Vt("wrapSelectionWithCommentMarker"),Mt()})}catch{}},Vo=o=>{if(!o||!o.commentId)return;const l=Array.isArray(_.comments)?[..._.comments]:[],s=typeof o.commentId=="string"&&o.commentId.startsWith("comment-")?Date.now():Number(o.commentId)||o.commentId;let i=l.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:o.text,user:o.user,createdAt:o.createdAt,created_at:o.createdAt,updated_at:o.createdAt};if(i>=0){const d=l[i];if(d.conversation||(d.conversation=[]),d.conversation.push(c),d.updated_at=o.createdAt,!d.article_id&&l.length>0){const u=l.find(m=>m.article_id);u&&(d.article_id=u.article_id)}}else{const d=o.selectionRange,u=l.length>0&&l.find(f=>f.article_id)?.article_id||null,m={conversation_id:s,article_id:u,selection_range:d?{start:d.start||0,end:d.end||0,type:d.type||"text"}:null,selection_text:o.selectionText||"",conversation:[c],created_by_user:o.user,created_at:o.createdAt,updated_at:o.createdAt,status:"active"};l.push(m)}qt.value=!0,pe("update:comments",l)},Xo=(o,l=[])=>{if(!_.commentUser||_.disabled||!_.richText||!v.value)return;const s=v.value;let i=null;try{i=s.querySelector(o)}catch{return}if(!i)return;un(),s.focus();const c=document.createRange();c.selectNodeContents(i);const d=window.getSelection();d&&(d.removeAllRanges(),d.addRange(c)),q.value=i.innerHTML||"",fe.value=Kt();const u=c.getBoundingClientRect(),m=s.parentElement;if(m){const D=m.getBoundingClientRect(),R=u.bottom-D.top,re=Math.max(R+8,0);y.value={top:`${re}px`,bottom:"auto"}}const f=i.getAttribute("data-comment")||i.getAttribute("data-fake-comment");let k=[];if(f&&_.comments&&Array.isArray(_.comments)){const D=_.comments.find(R=>String(R.conversation_id)===String(f));if(D&&D.conversation&&Array.isArray(D.conversation)){const R=D.conversation.map(S=>({id:S.id||S.commentary_id,commentary_id:S.id||S.commentary_id,conversation_id:D.id||D.conversation_id,text:S.text,user:S.user,createdAt:S.created_at||S.createdAt,updated_at:S.updated_at||S.updatedAt}));k.push(...R)}}k.length===0&&Array.isArray(l)&&l.length>0&&(k=l.slice()),k.sort((D,R)=>{const S=Pe=>{if(!Pe)return 0;const Be=new Date(Pe).getTime();return isNaN(Be)?0:Be},re=S(D.createdAt),J=S(R.createdAt);return re===J?0:re-J}),Ge.value=k,Tl(!0),hn.value=f||null,i&&(jn.value=i,i.classList.add("editor-comment-highlighted")),e.nextTick(()=>{if(h.value="",x.value){const D=x.value;D.style.height="auto",D.style.height=`${D.scrollHeight}px`,D.focus()}if(m){const D=m.querySelector(".dss-comment-overlay");if(D){const R=m.querySelector(".dss-text-editor-footer");if(R){const S=m.getBoundingClientRect(),re=D.getBoundingClientRect(),J=R.getBoundingClientRect(),Pe=re.bottom-S.top,Be=J.top-S.top,yt=8;if(Pe>Be-yt){const dn=J.height;y.value={bottom:`${dn+yt}px`,top:"auto"}}}}}Vt("openCommentOverlayForSelector")})},ho=e.ref(null),Jl=e.ref(0),Yo=o=>{if(!(_.disabled||!_.richText)){if(o.key==="Escape"){const l=window.getSelection();if(l.rangeCount>0){const i=l.getRangeAt(0).commonAncestorContainer,c=i.nodeType===1?i.tagName==="BLOCKQUOTE"?i:i.closest("blockquote"):i.parentElement?.closest("blockquote");if(!!(c&&v.value&&v.value.contains(c))){o.preventDefault();let u=null;i.nodeType===3?u=i.parentElement:i.tagName==="P"||i.tagName==="DIV"?u=i:u=i.closest("p, div");const m=document.createElement("p");m.innerHTML="<br>",u&&c.contains(u)&&u.nextSibling?c.insertBefore(m,u.nextSibling):c.appendChild(m),setTimeout(()=>{Bl()},50);return}}}if(o.key.length===1||o.key==="Enter"){const l=window.getSelection();if(l&&l.rangeCount>0){const s=l.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 m=s.startContainer.nodeType===3?s.startContainer.parentElement:s.startContainer,f=s.endContainer.nodeType===3?s.endContainer.parentElement:s.endContainer;if(d.contains(m)&&m!==u||d.contains(f)&&f!==u){o.preventDefault();const k=document.createRange();k.setStartAfter(d),k.collapse(!0),l.removeAllRanges(),l.addRange(k);return}}}}}}if(o.key==="Backspace"||o.key==="Delete"){const l=window.getSelection();if(l.rangeCount>0){const s=l.getRangeAt(0);let i=null,c=null;if(s.collapsed)if(o.key==="Backspace"){const d=s.startContainer;let u=d;d.nodeType===3&&(s.startOffset===0?u=d.previousSibling||d.parentNode:u=d.parentNode);const m=u.previousSibling;m&&(m.classList&&m.classList.contains("dss-image-wrapper")?c=m:m.tagName==="IMG"&&(i=m,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 m=u.nextSibling;m&&(m.classList&&m.classList.contains("dss-image-wrapper")?c=m:m.tagName==="IMG"&&(i=m,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,m=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 f=c.contains(u)||u===c,k=c.contains(m)||m===c,R=s.cloneContents().textContent?.trim()||"",S=c.textContent?.trim()||"";(!f||!k||R.length>S.length)&&(c=null,i=null)}}if(c){o.preventDefault(),o.stopPropagation();const d=c.parentNode;if(d){const u=document.createTextNode("");d.insertBefore(u,c),c.remove();const m=document.createRange();m.setStartAfter(u),m.collapse(!0),l.removeAllRanges(),l.addRange(m),e.nextTick(()=>{Mt()});return}}}}if(o.key==="Tab"){o.preventDefault(),o.shiftKey?xn():ul();return}if(o.key==="Enter"){const l=window.getSelection();if(l.rangeCount>0){const s=l.getRangeAt(0);if(s.collapsed){const u=s.startContainer,m=f=>{if(!f)return!1;let k=f.previousSibling;for(;k;){if(k.classList&&k.classList.contains("dss-image-wrapper")||k.tagName==="IMG"||k.querySelector&&k.querySelector(".dss-image-wrapper")||k.querySelector&&k.querySelector("img"))return!0;k=k.previousSibling}const D=f.parentElement;return D&&D!==v.value?m(D):!1};if(u.nodeType===3){const f=u.parentElement;if(f&&(m(f)||m(u))){const k=f.closest("p, div");if(k&&k!==v.value){o.preventDefault(),o.stopPropagation();let D=null;const R=s.startOffset;R<u.length&&(D=u.splitText(R));const S=document.createElement("p");if(D?S.appendChild(D):S.innerHTML="<br>",u.length===0){const J=u.parentElement;J&&(J.removeChild(u),J.childNodes.length===0&&J.appendChild(document.createElement("br")))}k.nextSibling?k.parentNode.insertBefore(S,k.nextSibling):k.parentNode.appendChild(S);const re=document.createRange();D?re.setStart(D,0):re.setStart(S,0),re.collapse(!0),l.removeAllRanges(),l.addRange(re),e.nextTick(()=>{Mt()});return}}}}const i=s.commonAncestorContainer,c=i.nodeType===1?i.tagName==="BLOCKQUOTE"?i:i.closest("blockquote"):i.parentElement?.closest("blockquote");if(!!(c&&v.value&&v.value.contains(c))){let u=null;i.nodeType===3?u=i.parentElement:i.tagName==="P"||i.tagName==="DIV"?u=i:u=i.closest("p, div");const m=J=>{if(!J)return!1;const Pe=J.textContent||"",yt=(J.innerHTML||"").trim(),dn=yt.replace(/<br\s*\/?>/gi,"").trim();return Pe.trim()===""||yt===""||dn===""||yt==="<br>"||yt==="<br/>"||yt==="<p></p>"||yt==="<p><br></p>"||yt==="<p><br/></p>"||yt==="<p> </p>"||yt==="<p><br> </p>"||yt==="<div></div>"||yt==="<div><br></div>"||yt==="<div><br/></div>"},f=c.lastChild,k=f&&f.nodeType===1&&f.tagName==="BR",D=s.startContainer,R=D.nodeType===3?D.parentElement:D,S=R===c||R&&R.parentElement===c;if(u&&m(u)||k&&S){o.preventDefault(),setTimeout(()=>{Bl()},50);return}}}}if(o.key===" "){const l=Date.now(),s=l-Jl.value;if(ho.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){o.preventDefault(),ul();return}}}}ho.value=" ",Jl.value=l}else ho.value=o.key}},yo=o=>{if(_.disabled||!_.richText)return;o.preventDefault();let l=o.clipboardData.getData("text/html"),s=o.clipboardData.getData("text/plain");l&&(l=l.replace(/<!--[\s\S]*?-->/g,"")),s&&(s=s.replace(/<!--[\s\S]*?-->/g,"")),he();const i=window.getSelection();let c=null;if(i&&i.rangeCount>0){let m=i.getRangeAt(0).commonAncestorContainer;m.nodeType===3&&(m=m.parentNode),c=m.closest("p, h1, h2, h3, h4, h5, h6, li, blockquote")}const d=u=>{const f=new DOMParser().parseFromString(u,"text/html");let k=v.value.querySelector("h1")?1:0;if(f.querySelectorAll("h1").forEach(R=>{if(k>0){const S=f.createElement("p");S.innerHTML=R.innerHTML,R.parentNode.replaceChild(S,R)}else k++}),c){const R=["P","H1","H2","H3","H4","H5","H6","DIV","BLOCKQUOTE","UL","OL","LI"],S=Array.from(f.body.children).filter(re=>R.includes(re.tagName));if(S.length===1){const re=S[0].tagName,J=c.tagName,Pe=c.textContent.trim()===""&&!c.querySelector("img");let Be=!1;if(["H1","H2","H3","H4","H5","H6"].includes(J)?Be=!0:Pe||(re===J||re==="P")&&(Be=!0),Be)return S[0].innerHTML.trim()}}return f.body.innerHTML.trim()};if(l){const u=d(l);document.execCommand("insertHTML",!1,u)}else if(s)if(/<[a-z][\s\S]*>/i.test(s)){const m=d(s);document.execCommand("insertHTML",!1,m)}else document.execCommand("insertText",!1,s);Mt()},Tn=o=>{if(Ce.value){const s=o.target;!s.closest(".dss-toolbar-dropdown")&&!s.closest(".dss-toolbar-dropdown-toggle")&&un()}if(Je.value){const s=o.target,i=s.closest(".dss-floating-toolbar"),c=v.value&&s.closest(".dss-text-editor-content");!i&&!c&&Il()}if(ct.value){const s=o.target,i=s.closest(".dss-floating-toolbar"),c=s.closest(".dss-toolbar-dropdown");!i&&!c&&bl()}const l=o.target;if(!l.closest(".dss-toolbar-dropdown")&&!l.closest(".dss-toolbar-dropdown-submenu")&&(Ze.value=null),!v.value||!l.closest(".dss-text-editor-content")){const s=window.getSelection();if(s&&s.rangeCount>0){const i=s.getRangeAt(0);G.value=!i.collapsed&&_l(i)}else G.value=!1}if(hn.value!==null){const s=document.querySelector(".dss-comment-overlay");let i=!1;if(s){const u=s.getBoundingClientRect(),m=o.clientX,f=o.clientY;i=m>=u.left&&m<=u.right&&f>=u.top&&f<=u.bottom}const c=l.closest(".dss-toolbar-button"),d=c&&c.getAttribute("title")==="Comment";!i&&!d&&(hn.value=null,h.value="",q.value="",fe.value=null,Ge.value=[],Tl(!0))}},O=(o,l)=>{o&&o.stopPropagation&&o.stopPropagation(),xt.value&&(clearTimeout(xt.value),xt.value=null),Ze.value=l},En=o=>{const l=o.relatedTarget;if(l){const s=l.closest(".dss-toolbar-dropdown-submenu"),i=l.closest(".dss-toolbar-dropdown-item-has-submenu");if(s||i)return}xt.value&&clearTimeout(xt.value),xt.value=setTimeout(()=>{Ze.value=null,xt.value=null},150)},Kn=o=>{Ze.value=null};let Xl=0;const Sn=o=>{if(!o)return;const l=Array.from(o.children);l.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")}),l.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(m=>m.tagName==="DIV"?m.classList.contains("dss-toolbar-dropdown-item")?!1:Array.from(m.children).filter(k=>k.tagName==="BUTTON"||k.tagName==="DIV").length>0:!1),d=s.nextElementSibling,u=d&&!d.classList.contains("dss-toolbar-dropdown-submenu")&&!d.classList.contains("dss-toolbar-dropdown-item-has-submenu")&&d.tagName==="DIV"&&!d.classList.contains("dss-toolbar-dropdown-item")&&Array.from(d.children).some(m=>m.tagName==="BUTTON"||m.tagName==="DIV");if(c||u){const m=`submenu-auto-${++Xl}`;s.classList.add("dss-toolbar-dropdown-item-has-submenu"),s.setAttribute("data-submenu-id",m);let f=null;c?(s.tagName==="BUTTON"&&s.parentNode.insertBefore(c,s.nextSibling),c.classList.add("dss-toolbar-dropdown-submenu"),f=c):u&&(d.classList.add("dss-toolbar-dropdown-submenu"),f=d),f&&(f.setAttribute("data-submenu-id",m),f.setAttribute("data-processed","true"),c&&s.tagName!=="BUTTON"?f.dataset.originalParentRef="inside":f.dataset.originalParentRef="sibling",Array.from(f.children).forEach(D=>{(D.tagName==="BUTTON"||D.tagName==="DIV")&&!D.classList.contains("dss-toolbar-dropdown-item")&&D.classList.add("dss-toolbar-dropdown-item")}))}})},wn=()=>{document.querySelectorAll(".dss-toolbar-dropdown").forEach(l=>{Sn(l),l.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=f=>{const k=c.getAttribute("data-submenu-id");k&&O(f,k)},m=En;c.addEventListener("mouseenter",u),c.addEventListener("mouseleave",m),c._subMenuHandlers={enter:u,leave:m}}),l.querySelectorAll(".dss-toolbar-dropdown-submenu").forEach(c=>{const d=c._subMenuHandlers;d&&(c.removeEventListener("mouseenter",d.enter),c.removeEventListener("mouseleave",d.leave));const u=k=>{const D=c.getAttribute("data-submenu-id");D&&O(k,D)},m=En;c.addEventListener("mouseenter",u),c.addEventListener("mouseleave",m),c._subMenuHandlers={enter:u,leave:m},c.querySelectorAll(".dss-toolbar-dropdown-item").forEach(k=>{k.addEventListener("click",Kn)})})})};let Yt=null;const nn=()=>{if(Ze.value){const o=document.querySelector(`.dss-toolbar-dropdown-submenu[data-submenu-id="${Ze.value}"]`),l=document.querySelector(`.dss-toolbar-dropdown-item-has-submenu[data-submenu-id="${Ze.value}"]`);o&&l&&qn(o,l)}if(Je.value&&Qt(),_.richText){if(Yt!==null)return;Yt=setTimeout(()=>{Yt=null,Vt("handleWindowResize")},150)}},Gn=()=>{if(!_.richText)return;document.querySelectorAll(".dss-toolbar-custom-group").forEach(l=>{Array.from(l.children).filter(i=>i.tagName==="DIV"&&!i.classList.contains("dss-toolbar-button")).forEach(i=>{i.classList.add("dss-toolbar-button")})})},Ml=()=>{const o=document.querySelectorAll(".dss-text-editor-footer, .dss-text-editor-footer-content, .dss-text-editor-footer-stat, .dss-text-editor-footer-separator"),l=s=>{if(s.preventDefault(),s.stopPropagation(),window.getSelection){const i=window.getSelection();i.removeAllRanges?i.removeAllRanges():i.empty&&i.empty()}return!1};o.forEach(s=>{s.addEventListener("selectstart",l),s.addEventListener("mousedown",l),s.addEventListener("dragstart",l),s.addEventListener("contextmenu",l),s.addEventListener("click",i=>{if(window.getSelection){const c=window.getSelection();c.removeAllRanges&&c.removeAllRanges()}})})};e.onMounted(()=>{if(e.nextTick(()=>{requestAnimationFrame(()=>{sn.value?le():dt(),N.value?at():Wt()})}),e.nextTick(()=>{Ml()}),_.richText&&v.value){try{document.execCommand("defaultParagraphSeparator",!1,"p")}catch{}document.addEventListener("click",Tn),window.addEventListener("resize",nn);let o=null;const l=()=>{o===null&&(o=setTimeout(()=>{o=null,nn()},150))};window.addEventListener("scroll",l,!0),v.value._windowScrollHandler=l,v.value._windowScrollTimeout=o,v.value.closest(".editor-with-comments"),v.value.closest(".dss-text-editor-content-wrapper");const s=v.value.closest(".dss-text-editor-content");let i=null;const c=()=>{i===null&&(i=setTimeout(()=>{i=null,nn()},150))};s&&(s.addEventListener("scroll",c),v.value._scrollHandlers={wrapper:null,content:s,handler:c}),e.nextTick(()=>{wn(),Gn()}),v.value.addEventListener("click",m=>{const f=m.target;f.closest("a")&&!_.disabled&&m.preventDefault();const D=f.closest(".dss-image-no-alt-icon"),R=f.closest(".dss-image-wrapper");if(D||R&&f===R){m.preventDefault(),m.stopPropagation();const S=window.getSelection(),re=document.createRange();re.setStartAfter(R),re.collapse(!0),S.removeAllRanges(),S.addRange(re)}else R&&f.tagName!=="IMG"&&(m.preventDefault(),e.nextTick(()=>{const S=window.getSelection();if(S.rangeCount>0){const J=S.getRangeAt(0).commonAncestorContainer,Pe=J.nodeType===3?J.parentElement:J;if(R.contains(Pe)&&Pe!==R.querySelector("img")){const Be=document.createRange();Be.setStartAfter(R),Be.collapse(!0),S.removeAllRanges(),S.addRange(Be)}}else{const re=document.createRange();re.setStartAfter(R),re.collapse(!0),S.addRange(re)}}))},!0),v.value.addEventListener("mousedown",m=>{const f=m.target,k=f.closest(".dss-image-no-alt-icon"),D=f.closest(".dss-image-wrapper");if(k||D&&f.tagName!=="IMG"){m.preventDefault();const R=window.getSelection(),S=document.createRange();D&&(S.setStartAfter(D),S.collapse(!0),R.removeAllRanges(),R.addRange(S))}},!0),v.value.addEventListener("paste",m=>{e.nextTick(()=>{if(!v.value)return;v.value.querySelectorAll("img").forEach(k=>{if(!k.closest(".dss-image-wrapper"))k.removeAttribute("alt"),k.removeAttribute("data-alt"),k.setAttribute("alt",""),k.setAttribute("data-alt",""),k.alt="";else{const R=k.getAttribute("alt")||k.alt||"";if(R){const S=k.getAttribute("src")||k.src||"",re=S.replace(/^https?:\/\//,"").replace(/^data:.*,/,""),J=R===S||R===re;(R.startsWith("http://")||R.startsWith("https://")||R.startsWith("data:")||J||J)&&(k.setAttribute("alt",""),k.setAttribute("data-alt",""),k.alt="")}}}),Ue()})}),v.value.addEventListener("dragstart",m=>{const f=m.target,k=f.tagName==="IMG"?f:f.closest("img"),D=k?.closest(".dss-image-wrapper");k&&v.value.contains(k)&&(nt.value=D||k,m.dataTransfer.effectAllowed="move",m.dataTransfer.setData("text/html","image-drag"))}),v.value.addEventListener("dragover",m=>{nt.value&&(m.preventDefault(),m.stopPropagation(),m.dataTransfer.dropEffect="move")}),v.value.addEventListener("dragenter",m=>{nt.value&&(m.preventDefault(),m.stopPropagation())}),v.value.addEventListener("drop",m=>{if(!nt.value||!v.value)return;m.preventDefault(),m.stopPropagation();const f=nt.value,k=f.classList?.contains("dss-image-wrapper"),D=k?f.querySelector("img"):f,R=k?f:D?.closest(".dss-image-wrapper");if(!D||!v.value.contains(D)){nt.value=null;return}let S=null;const re=m.clientX,J=m.clientY;if(document.caretRangeFromPoint)S=document.caretRangeFromPoint(re,J);else{const an=window.getSelection();an.rangeCount>0?S=an.getRangeAt(0).cloneRange():(S=document.createRange(),S.selectNodeContents(v.value),S.collapse(!1))}if(!S){nt.value=null;return}const Pe=S.commonAncestorContainer,Be=Pe.nodeType===3?Pe.parentElement:Pe;if(Be?.closest(".dss-image-wrapper")===R||R&&R.contains(Be)){nt.value=null;return}if(R&&(Be===R||R.contains(Be))){nt.value=null;return}const dn=D.getAttribute("src");let mn=null;R?mn=R.cloneNode(!0):mn=D.cloneNode(!0);try{let an=S.startContainer;if(an.nodeType===3&&(an=an.parentElement),R&&(an===R||R.contains(an))){const fn=document.createRange();fn.setStartAfter(R),fn.collapse(!0),S=fn}S.insertNode(mn);const Ut=document.createRange();Ut.setStartAfter(mn),Ut.collapse(!0);const kn=window.getSelection();kn.removeAllRanges(),kn.addRange(Ut)}catch{if(v.value.childNodes.length===0){const Ut=document.createElement("p");Ut.appendChild(mn),v.value.appendChild(Ut)}else{const Ut=v.value.lastChild;if(Ut&&Ut.nodeType===1)Ut.appendChild(mn);else{const kn=document.createElement("p");kn.appendChild(mn),v.value.appendChild(kn)}}}R?R.remove():D.remove(),nt.value=null,e.nextTick(()=>{const an=v.value.querySelectorAll("img");let Ut=!1;an.forEach(kn=>{if(kn.getAttribute("src")===dn)if(!Ut)Ut=!0;else{const fn=kn.closest(".dss-image-wrapper");fn?fn.remove():kn.remove()}}),Ue(),Mt()})}),v.value.addEventListener("dragend",m=>{nt.value=null});let d=null;const u=new MutationObserver(m=>{m.forEach(f=>{f.addedNodes.forEach(k=>{if(k.nodeType===1){k.tagName==="IMG"&&(k.removeAttribute("alt"),k.removeAttribute("data-alt"),k.setAttribute("alt",""),k.setAttribute("data-alt",""),k.alt="");const D=k.querySelectorAll&&k.querySelectorAll("img");D&&D.forEach(R=>{R.removeAttribute("alt"),R.removeAttribute("data-alt"),R.setAttribute("alt",""),R.setAttribute("data-alt",""),R.alt=""})}})}),d&&clearTimeout(d),d=setTimeout(()=>{Ue(),Gn(),d=null},100)});if(u.observe(v.value,{childList:!0,subtree:!0}),e.nextTick(()=>{const m=document.querySelector(".dss-text-editor-toolbar");if(m){const f=new MutationObserver(()=>{e.nextTick(()=>{Gn()})});f.observe(m,{childList:!0,subtree:!0}),m._toolbarMutationObserver=f}}),_.modelValue){const m=zn(_.modelValue);v.value.innerHTML=m,Rn()}e.nextTick(()=>{const m=v.value.innerHTML||"",f=_.title||"",k=_.description||"";Lt.value=m,oe.value=f,Y.value=k,j.value=f,de.value=k,Mn(),Ue(),ol(),it(),bo(),xl()}),Bn(),Zt(),v.value._mutationObserver=u}}),e.onUnmounted(()=>{if(document.removeEventListener("click",Tn),window.removeEventListener("resize",nn),v.value&&v.value._windowScrollHandler&&window.removeEventListener("scroll",v.value._windowScrollHandler,!0),Yt!==null&&(clearTimeout(Yt),Yt=null),v.value&&v.value._windowScrollTimeout!==null&&clearTimeout(v.value._windowScrollTimeout),qe.value&&clearTimeout(qe.value),xt.value&&clearTimeout(xt.value),v.value&&v.value._mutationObserver&&v.value._mutationObserver.disconnect(),De.value&&De.value.disconnect(),Ct.value!==null&&(cancelAnimationFrame(Ct.value),Ct.value=null),lt.value!==null&&(clearTimeout(lt.value),lt.value=null),St.value!==null&&(clearTimeout(St.value),St.value=null),Tl(!0),v.value&&v.value._scrollHandlers){const{wrapper:l,content:s,handler:i}=v.value._scrollHandlers;l&&l.removeEventListener("scroll",i),s&&s.removeEventListener("scroll",i)}const o=document.querySelector(".dss-text-editor-toolbar");o&&o._toolbarMutationObserver&&o._toolbarMutationObserver.disconnect()});const Pt=o=>{const l=o.target,s=l.closest("a");if(s&&!_.disabled){o.preventDefault();const c=document.createRange();c.selectNodeContents(s);const d=window.getSelection();d.removeAllRanges(),d.addRange(c)}const i=l.closest(".dss-image-wrapper");i&&l.tagName!=="IMG"?e.nextTick(()=>{const c=window.getSelection();if(c.rangeCount>0){const u=c.getRangeAt(0).commonAncestorContainer,m=u.nodeType===3?u.parentElement:u;if(i.contains(m)&&m!==i.querySelector("img")){const f=document.createRange();f.setStartAfter(i),f.collapse(!0),c.removeAllRanges(),c.addRange(f)}}Ue(),Bn(),Zt(),Qt(),it()}):e.nextTick(()=>{Ue(),Bn(),Zt(),Qt(),it()})},Dt=()=>{gt();const o=window.getSelection();if(o&&o.rangeCount>0){const s=o.getRangeAt(0);G.value=!s.collapsed&&_l(s),!s.collapsed&&b.value&&(b.value=null)}else G.value=!1;if(Ue(),Bn(),Zt(),Qt(),it(),o&&o.rangeCount>0){const i=o.getRangeAt(0).commonAncestorContainer,c=i.nodeType===3?i.parentElement:i;if(c&&c.closest(".dss-text-editor-footer")){o.removeAllRanges(),G.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 m=!1;if(u&&((u.tagName==="STRONG"||u.tagName==="B"||u.closest&&u.closest("strong, b"))&&(m=!0),!m&&u.style&&parseInt(u.style.fontWeight)>=600&&(m=!0),!m))try{const f=window.getComputedStyle(u);parseInt(f.fontWeight)>=600&&(m=!0)}catch{}ie.value[s]=m}else{const d=document.queryCommandState(s);ie.value[s]=d}}}catch{}})},it=()=>{if(!_.richText||_.disabled||!v.value){B.value="p";return}try{const o=window.getSelection();if(!o||o.rangeCount===0){B.value="p";return}const s=o.getRangeAt(0).commonAncestorContainer,i=s.nodeType===3?s.parentElement:s;if(!i||!v.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"}},Zt=()=>{if(!v.value){Ye.value=!1;return}try{const o=window.getSelection();let l=!1;if(o.rangeCount>0){const i=o.getRangeAt(0).commonAncestorContainer,c=i.nodeType===1?i.tagName==="BLOCKQUOTE"?i:i.closest("blockquote"):i.parentElement?.closest("blockquote");l=!!(c&&v.value.contains(c))}Ye.value=l}catch{Ye.value=!1}},_l=o=>{if(!o||!v.value)return!1;const l=o.commonAncestorContainer;if(!l)return!1;const s=l.nodeType===3?l.parentElement:l;return s?v.value.contains(s):!1},Il=()=>{Je.value=!1},Qt=()=>{if(!_.floatingToolbar||!_.richText||_.disabled){Je.value=!1;return}const o=window.getSelection();if(!o||o.rangeCount===0){Je.value=!1;return}const l=o.getRangeAt(0);if(l.collapsed||!_l(l)){Je.value=!1;return}const s=l.getBoundingClientRect();if(!s||s.width===0&&s.height===0){Je.value=!1;return}const i=v.value;if(!i){Je.value=!1;return}const c=i.getBoundingClientRect();if(!c||c.width===0){Je.value=!1;return}const d=40,u=8,m=s.top-d/2+15;let f=s.left+s.width/2;const k=window.innerWidth||document.documentElement.clientWidth||0;let D=0;et.value&&(D=et.value.getBoundingClientRect().width);const R=(D||320)/2;let S=c.left+R,re=c.right-R;if(re<S){const J=c.left+c.width/2;S=J,re=J}if(k>0){const J=R+u,Pe=k-R-u;if(S=Math.max(S,J),re=Math.min(re,Pe),re<S){const Be=k/2;S=Be,re=Be}}f<S?f=S:f>re&&(f=re),we.value={position:"fixed",top:`${Math.max(m,8)}px`,left:`${f}px`,transform:"translate(-50%, -100%)",zIndex:10003},Je.value=!0},eo=o=>{_.disabled||!_.richText||(ct.value=ct.value===o?null:o,o==="askAi"&&(Ce.value=null))},bl=()=>{ct.value=null,Ze.value=null},dl=o=>{Pn(o),bl()};let al=null,zl=null,wl=null,Pl=null;const $l=o=>{if(_.disabled||!_.richText){In(),Yl();return}const l=o.target,s=l.closest("a"),i=l.closest("img");if(al&&(clearTimeout(al),al=null),wl&&(clearTimeout(wl),wl=null),s&&s!==zl){Yl(),zl=s;let c=s.getAttribute("href")||"";(!c||c==="#"||c==="")&&(c=s.textContent||""),We.value=s,me.value=c,X.value=!0,ue.value=!0,Bo(s)}else!s&&zl?(zl=null,al=setTimeout(()=>{ue.value||In()},150)):s&&s===zl&&Bo(s);if(i&&i!==Pl){In(),Pl=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),kt.value=i,ye.value=c.trim()||V("textEditor.image.noAlt"),U.value=!0,K.value=!0,Ol(i)}else!i&&Pl?(Pl=null,wl=setTimeout(()=>{K.value||Yl()},150)):i&&i===Pl&&Ol(i)},No=o=>{const l=o.relatedTarget;(!l||!l.closest(".dss-text-editor-content")&&!l.closest(".dss-link-popup"))&&(zl=null,Pl=null,al&&(clearTimeout(al),al=null),wl&&(clearTimeout(wl),wl=null),In(),Yl())},In=()=>{ue.value=!1,setTimeout(()=>{ue.value||(X.value=!1,me.value="",Me.value||(We.value=null))},100)},Bo=o=>{if(!o||!v.value)return;const l=o.getBoundingClientRect(),c=l.top-32-8,d=l.left+l.width/2;F.value={position:"fixed",top:`${c}px`,left:`${d}px`,transform:"translateX(-50%)",zIndex:10002}},Yl=()=>{K.value=!1,setTimeout(()=>{K.value||(U.value=!1,ye.value="",vt.value||(kt.value=null))},100)},Ol=o=>{if(!o||!v.value)return;const l=o.getBoundingClientRect(),c=l.top-32-8,d=l.left+l.width/2;P.value={position:"fixed",top:`${c}px`,left:`${d}px`,transform:"translateX(-50%)",zIndex:10002}},jo=()=>{if(!me.value||!We.value)return;let l=We.value.getAttribute("href")||me.value;!l.startsWith("http://")&&!l.startsWith("https://")&&!l.startsWith("mailto:")&&(l="https://"+l),window.open(l,"_blank","noopener,noreferrer")},Mo=()=>{if(We.value){const o=We.value.textContent||"",l=We.value.getAttribute("href")||"",s=We.value;tt.value=l,mt.value=o,_e.value=o,ue.value=!1,X.value=!1,me.value="",We.value=s,Me.value=!0}else if(ke.value){const o=window.getSelection();if(o.rangeCount>0){const s=o.getRangeAt(0).commonAncestorContainer,i=s.nodeType===1?s.closest("a"):s.parentElement?.closest("a");if(i){const c=i.textContent||"",d=i.getAttribute("href")||"";tt.value=d,mt.value=c,_e.value=c,We.value=i,Me.value=!0}}}else{Ee.value=Kt();const o=window.getSelection();let l="";o.rangeCount>0&&(l=o.getRangeAt(0).toString()),tt.value="",mt.value=l,_e.value="",We.value=null,Me.value=!0}e.nextTick(()=>{Z.value&&(Z.value.focus(),Z.value.select())})},to=()=>{Me.value=!1,tt.value="",mt.value="",_e.value="",We.value=null,Ee.value=null},no=()=>{if(!tt.value.trim()){to();return}if(ze.value?(qe.value&&(clearTimeout(qe.value),qe.value=null),he(),ze.value=!1):he(),mt.value.trim()||(mt.value=tt.value.trim()),We.value&&v.value&&v.value.contains(We.value)){const o=window.getSelection();o.rangeCount>0&&o.removeAllRanges();const l=We.value;if(l.setAttribute("href",tt.value.trim()),mt.value.trim()!==_e.value.trim()){for(;l.firstChild;)l.removeChild(l.firstChild);l.textContent=mt.value.trim()}l.style.color="#60afdf",l.style.textDecoration="underline";const s=document.createRange();s.selectNodeContents(l),s.collapse(!1),o.removeAllRanges(),o.addRange(s),Mt()}else if(v.value){v.value.focus();const o=window.getSelection();o.removeAllRanges(),Ee.value&&Ln(Ee.value);let l=null;if(o.rangeCount>0&&(l=o.getRangeAt(0)),l&&!l.collapsed){l.toString();const s=document.createElement("a");s.href=tt.value.trim(),s.textContent=mt.value.trim(),s.style.color="#60afdf",s.style.textDecoration="underline",l.deleteContents(),l.insertNode(s);const i=document.createTextNode(" ");l.setStartAfter(s),l.insertNode(i),l.setStartAfter(i),l.collapse(!0),o.removeAllRanges(),o.addRange(l)}else{l||(l=document.createRange(),l.selectNodeContents(v.value),l.collapse(!1));const s=l.startContainer,i=s.nodeType===3,c=i&&l.startOffset===s.textContent.length,d=document.createElement("a");if(d.href=tt.value.trim(),d.textContent=mt.value.trim(),d.style.color="#60afdf",d.style.textDecoration="underline",c){let u=s.parentElement;for(;u&&u!==v.value&&!["P","DIV","H1","H2","H3","H4","H5","H6"].includes(u.tagName);)u=u.parentElement;if(u&&u!==v.value){let m=u.nextElementSibling;if(m&&(m.innerHTML==="<br>"||m.innerHTML==="<br/>"||m.textContent.trim()==="")){m.textContent="",m.appendChild(d);const f=document.createTextNode(" ");m.appendChild(f);const k=document.createRange();k.setStartAfter(d),k.collapse(!0),o.removeAllRanges(),o.addRange(k)}else{if(l.startOffset>0){const k=s.textContent.substring(0,l.startOffset),D=k[k.length-1];if(D&&D!==" "&&D!==" "&&D!==`
|
|
102
|
-
`){const
|
|
103
|
-
`){const k=document.createTextNode(" ");l.insertNode(k),l.setStartAfter(k)}}l.insertNode(d);const u=document.createTextNode(" ");l.setStartAfter(d),l.insertNode(u),l.setStartAfter(u),l.collapse(!0),o.removeAllRanges(),o.addRange(l)}}Mt()}e.nextTick(()=>{Bn(),to()})},lo=()=>{if(!v.value||Q.value)return;const o=window.getSelection();let l=null;o&&o.rangeCount>0&&(l=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(v.value,NodeFilter.SHOW_TEXT,{acceptNode:m=>{const f=m.parentElement;return!f||f.closest("a")||f.closest(".dss-image-wrapper")||!m.textContent||m.textContent.trim()===""?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}}),c=[];let d;for(;d=i.nextNode();)c.push(d);let u=!1;for(let m=c.length-1;m>=0;m--){const f=c[m],k=f.textContent;s.lastIndex=0;const D=[...k.matchAll(s)];if(D.length===0)continue;const R=D.filter(J=>{const Pe=J[0],Be=J.index;if(Be>0&&k[Be-1]==="@"||Be+Pe.length<k.length&&k[Be+Pe.length]==="@")return!1;const yt=f.parentElement;return!(yt&&yt.closest("a"))});if(R.length===0)continue;if(R.length===1&&R[0][0]===k.trim()){const J=R[0][0],Pe=J.startsWith("http://")||J.startsWith("https://")?J:`https://${J}`,Be=document.createElement("a");Be.href=Pe,Be.textContent=J,Be.style.color="#60afdf",Be.style.textDecoration="underline",f.parentNode&&(f.parentNode.replaceChild(Be,f),u=!0);continue}let S=0;const re=document.createDocumentFragment();if(R.forEach(J=>{const Pe=J.index,Be=J[0];if(Pe>S){const mn=k.substring(S,Pe);mn&&re.appendChild(document.createTextNode(mn))}const yt=Be.startsWith("http://")||Be.startsWith("https://")?Be:`https://${Be}`,dn=document.createElement("a");dn.href=yt,dn.textContent=Be,dn.style.color="#60afdf",dn.style.textDecoration="underline",re.appendChild(dn),S=Pe+Be.length}),S<k.length){const J=k.substring(S);J&&re.appendChild(document.createTextNode(J))}f.parentNode&&re.childNodes.length>0&&(f.parentNode.replaceChild(re,f),u=!0)}u&&l&&e.nextTick(()=>{Ln(l),Bn()})},Ko=()=>{if(!v.value)return;const o=/<u>([\s\S]*?)<\/u>|<ins>([\s\S]*?)<\/ins>/gi,l=document.createTreeWalker(v.value,NodeFilter.SHOW_TEXT,{acceptNode:c=>{const d=c.parentElement;return!d||d.closest("a, code, pre, u, ins")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}}),s=[];let i;for(;i=l.nextNode();)s.push(i);for(let c=s.length-1;c>=0;c--){const d=s[c],u=d.textContent,m=[...u.matchAll(o)];if(m.length===0)continue;let f=0;const k=document.createDocumentFragment();m.forEach(D=>{const R=D.index,S=D[0].startsWith("<u>")?"u":"ins",re=D[1]||D[2]||"";R>f&&k.appendChild(document.createTextNode(u.substring(f,R)));const J=document.createElement(S);J.textContent=re,k.appendChild(J),f=R+D[0].length}),f<u.length&&k.appendChild(document.createTextNode(u.substring(f))),d.parentNode&&k.childNodes.length>0&&d.parentNode.replaceChild(k,d)}},_o=o=>{if(!v.value||Q.value)return;if(!o){Ko();return}if(!["*","_",">"].includes(o))return;const s=window.getSelection();if(!s||s.rangeCount===0)return;const i=s.getRangeAt(0);if(!i.collapsed)return;const c=i.startContainer.nodeType===Node.TEXT_NODE?i.startContainer.parentElement?.closest("p, h1, h2, h3, h4, h5, h6, li, td, th, blockquote, div"):i.startContainer.closest?.("p, h1, h2, h3, h4, h5, h6, li, td, th, blockquote, div");if(!c||c===v.value||!v.value.contains(c))return;const d=()=>{let mn="",an=0,Ut=!1;const kn=document.createTreeWalker(c,NodeFilter.SHOW_TEXT,{acceptNode:sl=>sl.parentElement?.closest("a, code, pre")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT});document.createTreeWalker(c,NodeFilter.SHOW_TEXT,null);let fn=0;for(;kn.nextNode();){const sl=kn.currentNode,El=sl.textContent||"",pl=fn;if(fn+=El.length,sl===i.startContainer){mn+=El.substring(0,i.startOffset),an=pl+i.startOffset,Ut=!0;break}mn+=El}return Ut||(an=mn.length),{textBeforeCursor:mn,cursorCharOffset:an}},{textBeforeCursor:u}=d();if(!u.length)return;let m=null,f=null;if(u.endsWith("**")&&(m=u.match(/\*\*(.+?)\*\*$/s))||u.endsWith("__")&&(m=u.match(/__(.+?)__$/s))?f="strong":u.endsWith("*")&&!u.endsWith("**")&&(m=u.match(new RegExp("(?<!\\*)\\*([^*]+)\\*$")))||u.endsWith("_")&&!u.endsWith("__")&&(m=u.match(new RegExp("(?<!_)_([^_]+)_$")))?f="em":o===">"&&((m=u.match(/<u>(.+?)<\/u>$/s))||(m=u.match(/<ins>(.+?)<\/ins>$/s)))&&(f=m[0].startsWith("<u>")?"u":"ins",m[0].startsWith("<u>"),m[0].startsWith("<u>")),!m||!m[1])return;const k=m[0],D=m[1],R=u.length-k.length,re=(mn=>{let an=0;const Ut=document.createTreeWalker(c,NodeFilter.SHOW_TEXT,{acceptNode:fn=>fn.parentElement?.closest("a, code, pre")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT});let kn;for(;kn=Ut.nextNode();){const fn=(kn.textContent||"").length;if(an+fn>=mn)return{node:kn,offset:mn-an};an+=fn}return null})(R);if(!re)return;const J=document.createRange();J.setStart(re.node,re.offset),J.setEnd(i.endContainer,i.endOffset);const Pe=document.createElement(f);Pe.textContent=D,J.deleteContents(),J.insertNode(Pe);const Be=window.getSelection(),yt=document.createRange();yt.setStartAfter(Pe),yt.collapse(!0),Be.removeAllRanges(),Be.addRange(yt);const dn=Kt();e.nextTick(()=>{Mt(),dn&&Ln(dn)})},Qn=()=>{v.value&&(tn.value=Kt(),ut.value="",It.value="",Re.value="",bt.value="",wt.value="",Ft.value=null,kt.value=null,Se.value="upload",vt.value=!0,un(),e.nextTick(()=>{Jt.value&&Jt.value.focus(),pt.value&&(pt.value.value="")}))},Jn=o=>{const l=o.target?.files?.[0];if(!l){Ft.value=null,It.value="";return}Ft.value=l;const s=new FileReader;s.onload=i=>{It.value=i.target?.result||""},s.readAsDataURL(l)},ko=()=>{pt.value&&pt.value.click()},oo=()=>{bt.value&&(wt.value="")},Wn=()=>{wt.value&&(bt.value="")},ao=()=>{let o=kt.value;if(!o){const l=window.getSelection();if(l&&l.rangeCount>0){const i=l.getRangeAt(0).commonAncestorContainer;o=i.nodeType===1?i.closest("img"):i.parentElement?.closest("img")}}if(o){const l=o.getAttribute("data-alt")||o.getAttribute("alt")||"";kt.value=o,ut.value=l.trim()===""||l.trim()==="Image"?"":l;const s=o.getAttribute("src")||o.src||"";s.startsWith("http://")||s.startsWith("https://")?(Re.value=s,It.value="",Se.value="url"):(It.value=s,Re.value="",Se.value="upload");const c=o.style.width||o.getAttribute("width")||"",d=o.style.height||o.getAttribute("height")||"";bt.value=c.endsWith("px")?c.replace("px",""):c,wt.value=d.endsWith("px")?d.replace("px",""):d,tn.value=null}else{Qn();return}vt.value=!0,K.value=!1,U.value=!1,e.nextTick(()=>{Se.value==="url"&&jt.value?(jt.value.focus(),jt.value.select()):Jt.value&&(Jt.value.focus(),Jt.value.select()),pt.value&&(pt.value.value="")})},jl=()=>{vt.value=!1,ut.value="",It.value="",Re.value="",bt.value="",wt.value="",Ft.value=null,kt.value=null,tn.value=null,Se.value="upload"},ml=()=>{const o=(ut.value||"").trim(),l=v.value?._mutationObserver;l&&l.disconnect(),ze.value?(qe.value&&(clearTimeout(qe.value),qe.value=null),he(),ze.value=!1):he();const s=Se.value==="url"?Re.value.trim():It.value;if(kt.value&&v.value&&v.value.contains(kt.value)){s&&(kt.value.src=s),kt.value.setAttribute("alt",o),kt.value.setAttribute("data-alt",o),bt.value?(kt.value.style.width=`${bt.value}px`,kt.value.setAttribute("width",bt.value)):(kt.value.style.removeProperty("width"),kt.value.removeAttribute("width")),wt.value?(kt.value.style.height=`${wt.value}px`,kt.value.setAttribute("height",wt.value)):(kt.value.style.removeProperty("height"),kt.value.removeAttribute("height"));const i=window.getSelection();if(i){i.removeAllRanges();const c=document.createRange();c.setStartAfter(kt.value),c.collapse(!0),i.addRange(c)}Mt()}else{if(!s){l&&v.value&&l.observe(v.value,{childList:!0,subtree:!0}),jl();return}if(v.value){v.value.focus();const i=window.getSelection();i&&i.rangeCount>0&&i.removeAllRanges();const c=window.getSelection();let d=null;if(tn.value&&(Ln(tn.value),c&&c.rangeCount>0&&(d=c.getRangeAt(0))),!d&&c&&c.rangeCount>0&&(d=c.getRangeAt(0)),!d&&v.value){if(d=document.createRange(),v.value.childNodes.length===0){const k=document.createElement("p");k.innerHTML="<br>",v.value.appendChild(k),d.setStart(k,0),d.collapse(!0)}else d.selectNodeContents(v.value),d.collapse(!1);c&&(c.removeAllRanges(),c.addRange(d))}if(!d){jl();return}const u=d.commonAncestorContainer,m=u.nodeType===3?u.parentElement:u;if(!v.value.contains(m)){if(d=document.createRange(),v.value.childNodes.length===0){const k=document.createElement("p");k.innerHTML="<br>",v.value.appendChild(k),d.setStart(k,0),d.collapse(!0)}else d.selectNodeContents(v.value),d.collapse(!1);c&&(c.removeAllRanges(),c.addRange(d))}const f=document.createElement("img");f.src=s,f.setAttribute("alt",o),f.setAttribute("data-alt",o),bt.value&&(f.style.width=`${bt.value}px`,f.setAttribute("width",bt.value)),wt.value&&(f.style.height=`${wt.value}px`,f.setAttribute("height",wt.value));try{d.insertNode(f),d.setStartAfter(f),d.collapse(!0),c&&(c.removeAllRanges(),c.addRange(d))}catch{if(v.value){if(v.value.childNodes.length===0){const R=document.createElement("p");v.value.appendChild(R),R.appendChild(f)}else{const R=v.value.lastChild;if(R&&R.nodeType===1)R.appendChild(f);else{const S=document.createElement("p");v.value.appendChild(S),S.appendChild(f)}}const D=document.createRange();D.setStartAfter(f),D.collapse(!0),c&&(c.removeAllRanges(),c.addRange(D))}}kt.value=f,Mt()}}e.nextTick(()=>{l&&v.value&&l.observe(v.value,{childList:!0,subtree:!0}),Bn(),Qt(),jl()})};e.watch(()=>_.modelValue,o=>{if(_.richText&&v.value&&!Q.value){const l=zn(o||""),i=v.value.innerHTML.replace(/ |\u00A0/g," "),c=l.replace(/ |\u00A0/g," ");if(i!==c){const d=Kt();v.value.innerHTML=l,e.nextTick(()=>{Rn();const u=v.value.innerHTML||"",m=_.title||"",f=_.description||"";Lt.value=u,oe.value=m,Y.value=f,$t.value=u,j.value=m,de.value=f,Ke.value=[],zt.value=[],qe.value&&(clearTimeout(qe.value),qe.value=null),ze.value=!1,d&&Ln(d),Mn(),Ue(),ol(),Bn(),Qt(),it(),Vt("watch-modelValue")})}}},{immediate:!0}),e.watch(()=>_.richText,o=>{o?(Qt(),e.nextTick(()=>{bo()})):(Il(),ae.value=[],De.value&&(De.value.disconnect(),De.value=null)),it()}),e.watch(()=>_.floatingToolbar,o=>{o?Qt():Il()}),e.watch(()=>_.disabled,o=>{o&&Il(),it()}),e.watch(()=>_.description,()=>{e.nextTick(()=>{N.value?at():Wt()})}),e.watch(()=>_.title,()=>{e.nextTick(()=>{sn.value?le():dt()})}),e.watch(()=>_.customToolbarSlots,()=>{e.nextTick(()=>{Gn()})},{deep:!0}),e.watch(()=>_.comments,(o,l)=>{if(_.commentUser){if(qt.value){qt.value=!1;return}yn.value||_.richText&&v.value&&e.nextTick(()=>{xl()})}},{deep:!0,immediate:!1});const xl=()=>{if(_.commentUser&&!yn.value&&!(!_.comments||!Array.isArray(_.comments)||_.comments.length===0)&&!(!_.richText||!v.value)){yn.value=!0;try{const o=new Set,l=_.comments.filter(u=>{const m=String(u.conversation_id||u.id);return o.has(m)?!1:(o.add(m),!0)}),s=v.value.querySelectorAll("[data-comment], [data-fake-comment]"),i=s.length;s.forEach(u=>{const m=u.parentNode;if(m){for(;u.firstChild;)m.insertBefore(u.firstChild,u);m.removeChild(u)}});let c=0;const d=new Set;l.forEach(u=>{if(!u.conversation_id||!u.selection_range)return;const m=typeof u.conversation_id=="string"&&u.conversation_id.startsWith("comment-")?null:Number(u.conversation_id)||u.conversation_id;if(!m)return;const f=String(m);if(d.has(f))return;const k=v.value.querySelector(`[data-comment="${f}"]`);if(k){Kl(k,u),d.add(f);return}try{const D=Dn(u.selection_range,u.selection_text);if(D&&!D.collapsed){const R=D.commonAncestorContainer,S=R.nodeType===3?R.parentElement:R;if(S){const Pe=S.closest("[data-comment], [data-fake-comment]");if(Pe){const Be=Pe.getAttribute("data-comment")||Pe.getAttribute("data-fake-comment");if(String(Be)===String(m)){Pe.setAttribute("data-comment",f),Pe.removeAttribute("data-fake-comment"),Kl(Pe,u),d.add(f);return}else return}}const re=v.value.querySelector(`[data-comment="${f}"]`);if(re){Kl(re,u),d.add(f);return}const J=document.createElement("span");J.setAttribute("data-comment",f),Kl(J,u);try{D.surroundContents(J),c++,d.add(f)}catch{try{const Be=document.createRange();Be.setStart(D.startContainer,D.startOffset),Be.setEnd(D.endContainer,D.endOffset),Co(Be),Be.surroundContents(J),c++,d.add(f)}catch{try{const yt=D.extractContents();J.appendChild(yt),D.insertNode(J),c++,d.add(f)}catch(yt){console.warn("Failed to create comment marker:",yt)}}}}}catch{}}),e.nextTick(()=>{Vt("restoreCommentsFromModel"),Mt(),yn.value=!1})}catch{yn.value=!1}}},Co=o=>{if(!o||!v.value)return o;try{const l=["P","DIV","H1","H2","H3","H4","H5","H6","LI","BLOCKQUOTE","PRE"];let s=o.startContainer,i=o.startOffset;if(s.nodeType===3){const u=s.parentElement;u&&l.includes(u.tagName)&&(i===0&&!$o(s)||o.setStartBefore(u))}else s.nodeType===1&&l.includes(s.tagName)&&i>0&&o.setStartBefore(s);let c=o.endContainer,d=o.endOffset;if(c.nodeType===3){const u=c.parentElement;u&&l.includes(u.tagName)&&(d===c.length&&!Ll(c)||o.setEndAfter(u))}else c.nodeType===1&&l.includes(c.tagName)&&d<c.childNodes.length&&o.setEndAfter(c);return o}catch{return o}},$o=o=>{let l=o.previousSibling;for(;l;){if(l.nodeType===3&&l.textContent.trim().length>0||l.nodeType===1&&l.textContent.trim().length>0)return!0;l=l.previousSibling}return!1},Ll=o=>{let l=o.nextSibling;for(;l;){if(l.nodeType===3&&l.textContent.trim().length>0||l.nodeType===1&&l.textContent.trim().length>0)return!0;l=l.nextSibling}return!1},Dn=(o,l)=>{if(!o||!v.value)return null;try{const s=document.createRange();if(o.type==="text"&&typeof o.start=="number"&&typeof o.end=="number"){let i=0;const c=[v.value];let d=null,u=!1,m=!1;for(;!m&&(d=c.pop());)if(d.nodeType===3){const f=i+d.length;!u&&o.start>=i&&o.start<=f&&(s.setStart(d,o.start-i),u=!0),u&&o.end>=i&&o.end<=f&&(s.setEnd(d,o.end-i),m=!0),i=f}else{let f=d.childNodes.length;for(;f--;)c.push(d.childNodes[f])}return u?Co(s):null}}catch{return null}return null},Kl=(o,l)=>{if(!o||!l)return;const s=l.conversation||[],i=new Set,c=[],d=m=>{m&&m.id&&!i.has(m.id)&&(i.add(m.id),c.push(m))};s.length>0&&s.forEach(m=>{m.user&&d(m.user)}),c.length>0?o.setAttribute("data-comment-user",JSON.stringify(c[0])):o.removeAttribute("data-comment-user"),c.length>1?o.setAttribute("data-comment-user-2",JSON.stringify(c[1])):o.removeAttribute("data-comment-user-2");const u=s.length;u>0?o.setAttribute("data-comment-count",String(u)):o.removeAttribute("data-comment-count")},Vt=(o="unknown")=>{if(!_.commentUser||!_.richText||!v.value){ae.value=[];return}Date.now()-Et.value<Bt&&Ct.value!==null||Ct.value===null&&(Ct.value=requestAnimationFrame(()=>{if(Ct.value=null,Et.value=Date.now(),Ie.value)return;Ie.value=!0;const s={},i=v.value;if(!i){Ie.value=!1;return}const c=i.closest(".editor-with-comments");if(!c){Ie.value=!1;return}const d=i.querySelectorAll("[data-comment], [data-fake-comment]"),u=[],m=new Set;d.forEach(S=>{const re=S.getAttribute("data-comment")||S.getAttribute("data-fake-comment");re&&S.tagName==="SPAN"&&(m.has(re)||(u.push(S),m.add(re)))}),d.forEach(S=>{const re=S.getAttribute("data-comment")||S.getAttribute("data-fake-comment");!re||m.has(re)||(["P","DIV","H1","H2","H3","H4","H5","H6"].includes(S.tagName)?S.querySelector(`span[data-comment="${re}"], span[data-fake-comment="${re}"]`)||(u.push(S),m.add(re)):S.tagName!=="SPAN"&&(u.push(S),m.add(re)))});const f=c.getBoundingClientRect(),k=i.getBoundingClientRect();u.forEach((S,re)=>{let J=S.getAttribute("data-comment")||S.getAttribute("data-fake-comment");if(!J)return;if(typeof J=="string"&&J.startsWith("comment-")){const fl=S.textContent?.trim(),rl=_.comments?.find(el=>(typeof el.conversation_id=="string"&&el.conversation_id.startsWith("comment-")?null:el.conversation_id)&&el.selection_text?.trim()===fl);rl?(J=String(rl.conversation_id),S.setAttribute("data-comment",J),S.removeAttribute("data-fake-comment")):(J=String(Date.now()),S.setAttribute("data-comment",J),S.removeAttribute("data-fake-comment"))}const Pe=S.getBoundingClientRect(),Be=window.getComputedStyle(S),yt=parseFloat(Be.lineHeight)||parseFloat(Be.fontSize)*1.2,an=Pe.top-k.top+yt/2-15,kn=k.top-f.top+an;let fn=null,sl=null,El=0;const pl=[],To=new Set;if(J&&_.comments){const fl=_.comments.find(rl=>String(rl.conversation_id||rl.id)===String(J));if(fl){const rl=fl.conversation||[];rl.length>0?(rl.forEach(el=>{el.user&&el.user.id&&!To.has(el.user.id)&&(To.add(el.user.id),pl.push(el.user))}),El=rl.length):(El=0,fn=null,sl=null),pl.length>0?fn=pl[0]:fn=null,pl.length>1?sl=pl[1]:sl=null}}const wo=Pe.top+yt/2-15,Ao=wo+30,Do=5,Ho=Ao>k.top+Do&&wo<k.bottom-Do?1:0;ae.value.find(fl=>fl.id===J);let so=S;if(!so&&J&&v.value){const fl=String(J);so=v.value.querySelector(`[data-comment="${fl}"], [data-fake-comment="${fl}"]`)}const Dl=pl.length;s[J]?(s[J].top=kn,s[J].opacity=Ho,s[J].element=so,s[J].firstUser=fn,s[J].secondUser=sl,s[J].totalCount=El,s[J].uniqueUserCount=Dl):s[J]={id:J,top:kn,opacity:Ho,element:so,firstUser:fn,secondUser:sl,totalCount:El,uniqueUserCount:Dl}});const D=Object.values(s).map(S=>{const re=Math.max(0,(S.uniqueUserCount??0)-2);if(!S.element&&S.id&&v.value){const Pe=String(S.id);S.element=v.value.querySelector(`[data-comment="${Pe}"], [data-fake-comment="${Pe}"]`)}return{...S,firstUser:S.firstUser||null,secondUser:S.secondUser||null,totalCount:S.totalCount,additionalCount:re}});(ae.value.length!==D.length||D.some((S,re)=>{const J=ae.value[re];if(!J)return!0;const Pe=(J.firstUser?.id||null)!==(S.firstUser?.id||null),Be=(J.secondUser?.id||null)!==(S.secondUser?.id||null);return J.id!==S.id||Math.abs(J.top-S.top)>1||J.opacity!==S.opacity||J.totalCount!==S.totalCount||J.additionalCount!==S.additionalCount||Pe||Be||J.element!==S.element}))&&(ae.value=D),Ie.value=!1}))},Lo=o=>{if(!o)return;let l=o.element;if(!l&&o.id&&v.value){const s=String(o.id);l=v.value.querySelector(`[data-comment="${s}"], [data-fake-comment="${s}"]`)}l&&(Tl(),jn.value=l,l.classList.add("editor-comment-highlighted"))},Tl=(o=!1)=>{!o&&hn.value!==null&&jn.value&&(jn.value.getAttribute("data-comment")||jn.value.getAttribute("data-fake-comment"))===hn.value||(v.value&&v.value.querySelectorAll(".editor-comment-highlighted").forEach(s=>{s.classList.remove("editor-comment-highlighted")}),jn.value&&(jn.value.classList.remove("editor-comment-highlighted"),jn.value=null))},ln=o=>{if(!o||!o.element)return;Tl(!0);const l=o.element.getAttribute("data-comment")||o.element.getAttribute("data-fake-comment");if(!l)return;const s=`[data-comment="${l}"], [data-fake-comment="${l}"]`;pe("comment-marker-clicked",{commentId:l,selector:s,element:o.element})},Al=()=>{Tl()},bo=()=>{!_.richText||!v.value||(De.value&&De.value.disconnect(),St.value!==null&&(clearTimeout(St.value),St.value=null),De.value=new MutationObserver(()=>{St.value===null&&(St.value=setTimeout(()=>{St.value=null,e.nextTick(()=>{Vt("MutationObserver")})},200))}),De.value.observe(v.value,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-comment","data-fake-comment","data-comment-user","data-comment-user-2","data-comment-count"]}),Vt("setupCommentMarkersObserver-initial"))},qn=(o,l)=>{if(!o||!l)return;const s=l.getBoundingClientRect();let i=s.top,c=s.right+4;o.style.top=`${i}px`,o.style.left=`${c}px`,o.offsetHeight;const d=o.getBoundingClientRect(),u=window.innerWidth,m=window.innerHeight;if(d.right>u){const f=s.left-d.width-4;o.style.left=`${f}px`}if(d.bottom>m){const f=Math.max(8,m-d.height-8);o.style.top=`${f}px`}d.top<0&&(o.style.top="8px")};return e.watch(()=>Ze.value,o=>{e.nextTick(()=>{document.querySelectorAll(".dss-toolbar-dropdown-submenu").forEach(s=>{const i=s.getAttribute("data-submenu-id");if(i===o&&o){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(()=>{qn(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(()=>[Ce.value,ct.value],()=>{Ce.value==="askAi"||ct.value==="askAi"?e.nextTick(()=>{wn()}):(Ze.value=null,e.nextTick(()=>{document.querySelectorAll(".dss-toolbar-dropdown-submenu").forEach(l=>{if(l.parentNode===document.body){const s=l.getAttribute("data-submenu-id");if(s){const i=document.querySelector(`.dss-toolbar-dropdown-item-has-submenu[data-submenu-id="${s}"]`);if(i)if(l.dataset.originalParentRef==="inside")i.appendChild(l);else{const d=i.closest(".dss-toolbar-dropdown");d&&d.insertBefore(l,i.nextSibling)}}}})}))}),e.watch(()=>_.locale,o=>{o&&o!==ce.value&&(ce.value=o)},{immediate:!0}),ne({openCommentOverlayForSelector:Xo,updateCommentMarkers:Vt,restoreCommentsFromModel:xl}),(o,l)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-text-editor-container",[{"editor-with-comments":rt.value},At.value]]),style:e.normalizeStyle(Nt.value)},[E.richText?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-text-editor-toolbar",onMousedown:l[14]||(l[14]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("div",Wu,[e.createElementVNode("div",{class:"dss-toolbar-button",onClick:se,title:e.unref(V)("textEditor.toolbar.undo")},[...l[45]||(l[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,qu),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-disabled":!Zn.value}]),onClick:on,title:e.unref(V)("textEditor.toolbar.redo")},[...l[46]||(l[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,Zu),l[61]||(l[61]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",Uu,[e.createElementVNode("div",{class:"dss-toolbar-button dss-toolbar-dropdown-toggle",onClick:l[0]||(l[0]=s=>Fl("paragraph")),title:e.unref(V)("textEditor.toolbar.paragraphFormat")},[B.value==="h1"?(e.openBlock(),e.createElementBlock("img",{key:0,src:I.h1,alt:"H1",class:"dss-toolbar-heading-icon"},null,8,Yu)):B.value==="h2"?(e.openBlock(),e.createElementBlock("img",{key:1,src:I.h2,alt:"H2",class:"dss-toolbar-heading-icon"},null,8,ju)):B.value==="h3"?(e.openBlock(),e.createElementBlock("img",{key:2,src:I.h3,alt:"H3",class:"dss-toolbar-heading-icon"},null,8,Ku)):B.value==="h4"?(e.openBlock(),e.createElementBlock("img",{key:3,src:I.h4,alt:"H4",class:"dss-toolbar-heading-icon"},null,8,Gu)):B.value==="h5"?(e.openBlock(),e.createElementBlock("img",{key:4,src:I.h5,alt:"H5",class:"dss-toolbar-heading-icon"},null,8,Qu)):B.value==="h6"?(e.openBlock(),e.createElementBlock("img",{key:5,src:I.h6,alt:"H6",class:"dss-toolbar-heading-icon"},null,8,Ju)):(e.openBlock(),e.createElementBlock("svg",ed,[...l[47]||(l[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)])])),l[48]||(l[48]=e.createElementVNode("span",{class:"dss-toolbar-dropdown-arrow"},"˅",-1))],8,Xu),Ce.value==="paragraph"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:l[8]||(l[8]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[1]||(l[1]=s=>Pn("<h1>"))},[e.createElementVNode("img",{src:I.h1,alt:"H1",class:"dss-toolbar-heading-icon"},null,8,td),e.createElementVNode("h1",null,e.toDisplayString(e.unref(V)("textEditor.paragraph.heading1")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[2]||(l[2]=s=>Pn("<h2>"))},[e.createElementVNode("img",{src:I.h2,alt:"H2",class:"dss-toolbar-heading-icon"},null,8,nd),e.createElementVNode("h2",null,e.toDisplayString(e.unref(V)("textEditor.paragraph.heading2")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[3]||(l[3]=s=>Pn("<h3>"))},[e.createElementVNode("img",{src:I.h3,alt:"H3",class:"dss-toolbar-heading-icon"},null,8,ld),e.createElementVNode("h3",null,e.toDisplayString(e.unref(V)("textEditor.paragraph.heading3")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[4]||(l[4]=s=>Pn("<h4>"))},[e.createElementVNode("img",{src:I.h4,alt:"H4",class:"dss-toolbar-heading-icon"},null,8,od),e.createElementVNode("h4",null,e.toDisplayString(e.unref(V)("textEditor.paragraph.heading4")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[5]||(l[5]=s=>Pn("<h5>"))},[e.createElementVNode("img",{src:I.h5,alt:"H5",class:"dss-toolbar-heading-icon"},null,8,ad),e.createElementVNode("h5",null,e.toDisplayString(e.unref(V)("textEditor.paragraph.heading5")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[6]||(l[6]=s=>Pn("<h6>"))},[e.createElementVNode("img",{src:I.h6,alt:"H6",class:"dss-toolbar-heading-icon"},null,8,sd),e.createElementVNode("h6",null,e.toDisplayString(e.unref(V)("textEditor.paragraph.heading6")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[7]||(l[7]=s=>Pn("<p>"))},[l[49]||(l[49]=e.createElementVNode("svg",{width:"13",height:"14",viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"paragraph-icon"},[e.createElementVNode("path",{d:"M4.33333 8.61539V14H6.5V2.15385H8.66667V14H10.8333V2.15385H13V0H4.33333C1.93917 0 0 1.92769 0 4.30769C0 6.68769 1.93917 8.61539 4.33333 8.61539Z",fill:"#323232"})],-1)),e.createElementVNode("p",null,e.toDisplayString(e.unref(V)("textEditor.paragraph.paragraph")),1)])])):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Gt("bold")}]),onClick:l[9]||(l[9]=s=>Nn("bold")),title:e.unref(V)("textEditor.toolbar.bold")},[...l[50]||(l[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,rd),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Gt("italic")}]),onClick:l[10]||(l[10]=s=>Nn("italic")),title:e.unref(V)("textEditor.toolbar.italic")},[...l[51]||(l[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,id),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Gt("underline")}]),onClick:l[11]||(l[11]=s=>Nn("underline")),title:e.unref(V)("textEditor.toolbar.underline")},[...l[52]||(l[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,cd),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Ye.value}]),onClick:Yn,title:e.unref(V)("textEditor.toolbar.citation")},[...l[53]||(l[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,ud),l[62]||(l[62]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),ke.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-button",onClick:cl,title:e.unref(V)("textEditor.toolbar.removeLink")},[...l[55]||(l[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,md)):(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-button",onClick:Gl,title:e.unref(V)("textEditor.toolbar.insertLink")},[...l[54]||(l[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,dd)),l[63]||(l[63]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Gt("insertUnorderedList")}]),onClick:Ul,title:e.unref(V)("textEditor.toolbar.bulletList")},[...l[56]||(l[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,pd),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Gt("insertOrderedList")}]),onClick:kl,title:e.unref(V)("textEditor.toolbar.numberList")},[...l[57]||(l[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,fd),l[64]||(l[64]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:"dss-toolbar-button",onClick:Qn,title:e.unref(V)("textEditor.toolbar.image")},[...l[58]||(l[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,vd),rt.value&&G.value?(e.openBlock(),e.createElementBlock("div",gd)):e.createCommentVNode("",!0),rt.value&&G.value?(e.openBlock(),e.createElementBlock("div",{key:3,class:"dss-toolbar-button",title:e.unref(V)("textEditor.toolbar.comment"),onClick:On},[...l[59]||(l[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,hd)):e.createCommentVNode("",!0),E.askAi?(e.openBlock(),e.createElementBlock("div",yd)):e.createCommentVNode("",!0),E.askAi?(e.openBlock(),e.createElementBlock("div",kd,[e.createElementVNode("div",{class:"dss-toolbar-ai-button dss-toolbar-dropdown-toggle",onClick:l[12]||(l[12]=s=>Fl("askAi")),title:e.unref(V)("textEditor.toolbar.askAi")},[l[60]||(l[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",bd,e.toDisplayString(e.unref(V)("textEditor.toolbar.askAi")),1)],8,Cd),Ce.value==="askAi"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:l[13]||(l[13]=e.withModifiers(()=>{},["stop"]))},[e.renderSlot(o.$slots,"ask-ai-dropdown")])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),e.createElementVNode("div",wd,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(E.customToolbarSlots,(s,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:i},[$n(s)?(e.openBlock(),e.createElementBlock("div",xd,[e.renderSlot(o.$slots,s)])):e.createCommentVNode("",!0),$n(s)&&i<E.customToolbarSlots.length-1&&Vl(i)?(e.openBlock(),e.createElementBlock("div",Ed)):e.createCommentVNode("",!0)],64))),128))])],32)):e.createCommentVNode("",!0),(Ce.value==="paragraph"||Ce.value==="askAi")&&E.richText?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-dropdown-overlay",onClick:un})):e.createCommentVNode("",!0),e.createVNode(na,{showModal:Me.value,width:"500px",height:"55vh",onCloseModal:to},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(V)("textEditor.link.editLink")),1)]),content:e.withCtx(()=>[e.createElementVNode("div",Sd,[e.createElementVNode("div",Vd,[e.createElementVNode("label",Nd,e.toDisplayString(e.unref(V)("textEditor.link.altText")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"linkAltInput",ref:Ae,type:"text","onUpdate:modelValue":l[15]||(l[15]=s=>mt.value=s),class:"dss-link-modal-input",placeholder:e.unref(V)("textEditor.link.enterAltText"),onKeyup:e.withKeys(no,["enter"])},null,40,Bd),[[e.vModelText,mt.value]])]),e.createElementVNode("div",Md,[e.createElementVNode("label",_d,e.toDisplayString(e.unref(V)("textEditor.link.url")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"linkUrlInput",ref:Z,type:"text","onUpdate:modelValue":l[16]||(l[16]=s=>tt.value=s),class:"dss-link-modal-input",placeholder:e.unref(V)("textEditor.link.enterUrl"),onKeyup:e.withKeys(no,["enter"])},null,40,$d),[[e.vModelText,tt.value]])])])]),actions:e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-cancel",onClick:to},e.toDisplayString(e.unref(V)("textEditor.link.cancel")),1),e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-save",onClick:no},e.toDisplayString(e.unref(V)("textEditor.link.save")),1)]),_:1},8,["showModal"]),e.createVNode(na,{showModal:vt.value,width:"500px",height:"80vh",onCloseModal:jl},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(kt.value?e.unref(V)("textEditor.image.editImage"):e.unref(V)("textEditor.image.addImage")),1)]),content:e.withCtx(()=>[e.createElementVNode("div",Ld,[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-image-modal-tab",{"dss-image-modal-tab-active":Se.value==="upload"}]),onClick:l[17]||(l[17]=s=>Se.value="upload")},e.toDisplayString(e.unref(V)("textEditor.image.upload")),3),l[65]||(l[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":Se.value==="url"}]),onClick:l[18]||(l[18]=s=>Se.value="url")},e.toDisplayString(e.unref(V)("textEditor.image.imageLink")),3)]),Se.value==="upload"?(e.openBlock(),e.createElementBlock("div",Td,[e.createElementVNode("div",Ad,[e.createElementVNode("div",Dd,[vl.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("label",Hd,e.toDisplayString(e.unref(V)("textEditor.image.uploadImage")),1)),vl.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-image-upload-preview",onClick:ko},[e.createElementVNode("img",{src:It.value,alt:"Preview",class:"dss-image-preview-image"},null,8,Rd),l[66]||(l[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:pt,type:"file",accept:"image/*",class:"dss-image-file-input-hidden",onChange:Jn},null,544)])):(e.openBlock(),e.createElementBlock("input",{key:2,ref_key:"imageFileInput",ref:pt,type:"file",accept:"image/*",class:"dss-link-modal-input dss-link-modal-input-image",onChange:Jn},null,544))]),e.createElementVNode("div",Fd,[e.createElementVNode("label",Id,e.toDisplayString(e.unref(V)("textEditor.image.altText")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"imageAltInput",ref:Jt,type:"text","onUpdate:modelValue":l[19]||(l[19]=s=>ut.value=s),class:"dss-link-modal-input",placeholder:e.unref(V)("textEditor.image.enterAltText"),onKeyup:e.withKeys(ml,["enter"])},null,40,zd),[[e.vModelText,ut.value]])]),e.createElementVNode("div",Pd,[e.createElementVNode("label",Od,e.toDisplayString(e.unref(V)("textEditor.image.width")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":l[20]||(l[20]=s=>bt.value=s),class:"dss-link-modal-input",placeholder:e.unref(V)("textEditor.image.auto"),onKeyup:e.withKeys(ml,["enter"]),onInput:oo},null,40,Wd),[[e.vModelText,bt.value]])]),e.createElementVNode("div",qd,[e.createElementVNode("label",Zd,e.toDisplayString(e.unref(V)("textEditor.image.height")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":l[21]||(l[21]=s=>wt.value=s),class:"dss-link-modal-input",placeholder:e.unref(V)("textEditor.image.auto"),onKeyup:e.withKeys(ml,["enter"]),onInput:Wn},null,40,Ud),[[e.vModelText,wt.value]])])])])):e.createCommentVNode("",!0),Se.value==="url"?(e.openBlock(),e.createElementBlock("div",Xd,[e.createElementVNode("div",Yd,[e.createElementVNode("div",jd,[e.createElementVNode("label",Kd,e.toDisplayString(e.unref(V)("textEditor.image.imageUrl")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"imageUrlInput",ref:jt,type:"text","onUpdate:modelValue":l[22]||(l[22]=s=>Re.value=s),class:"dss-link-modal-input",placeholder:e.unref(V)("textEditor.image.enterImageUrl"),onKeyup:e.withKeys(ml,["enter"])},null,40,Gd),[[e.vModelText,Re.value]])]),e.createElementVNode("div",Qd,[e.createElementVNode("label",Jd,e.toDisplayString(e.unref(V)("textEditor.image.altText")),1),e.withDirectives(e.createElementVNode("input",{type:"text","onUpdate:modelValue":l[23]||(l[23]=s=>ut.value=s),class:"dss-link-modal-input",placeholder:e.unref(V)("textEditor.image.enterAltText"),onKeyup:e.withKeys(ml,["enter"])},null,40,e1),[[e.vModelText,ut.value]])]),e.createElementVNode("div",t1,[e.createElementVNode("label",n1,e.toDisplayString(e.unref(V)("textEditor.image.width")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":l[24]||(l[24]=s=>bt.value=s),class:"dss-link-modal-input",placeholder:e.unref(V)("textEditor.image.auto"),onKeyup:e.withKeys(ml,["enter"]),onInput:oo},null,40,l1),[[e.vModelText,bt.value]])]),e.createElementVNode("div",o1,[e.createElementVNode("label",a1,e.toDisplayString(e.unref(V)("textEditor.image.height")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":l[25]||(l[25]=s=>wt.value=s),class:"dss-link-modal-input",placeholder:e.unref(V)("textEditor.image.auto"),onKeyup:e.withKeys(ml,["enter"]),onInput:Wn},null,40,s1),[[e.vModelText,wt.value]])])])])):e.createCommentVNode("",!0)]),actions:e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-cancel",onClick:jl},e.toDisplayString(e.unref(V)("textEditor.image.cancel")),1),e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-save",onClick:ml},e.toDisplayString(e.unref(V)("textEditor.image.save")),1)]),_:1},8,["showModal"]),E.showTitle?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(["dss-text-editor-title-wrapper",{"dss-text-editor-no-border-bottom":Un.value&&sn.value}])},[e.createElementVNode("p",null,e.toDisplayString(e.unref(V)("textEditor.labels.title")),1),e.createElementVNode("div",r1,[sn.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",i1,[E.title?(e.openBlock(),e.createElementBlock("span",c1,e.toDisplayString(E.title),1)):(e.openBlock(),e.createElementBlock("span",u1,e.toDisplayString(il.value),1))])),e.createElementVNode("textarea",{ref_key:"titleInputRef",ref:be,value:E.title,onInput:ot,onFocus:Te,onBlur:ft,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-title-input",{"dss-text-editor-title-input-blurred":!sn.value}]),placeholder:il.value,disabled:E.disabled,rows:"1"},null,42,d1)])],2)):e.createCommentVNode("",!0),E.showTitle&&Un.value&&sn.value?(e.openBlock(),e.createElementBlock("div",m1,[e.renderSlot(o.$slots,"title-slot")])):e.createCommentVNode("",!0),E.showDescription?(e.openBlock(),e.createElementBlock("div",{key:4,class:e.normalizeClass(["dss-text-editor-description-wrapper",{"dss-text-editor-no-border-bottom":Xn.value&&N.value}])},[e.createElementVNode("p",null,e.toDisplayString(e.unref(V)("textEditor.labels.description")),1),e.createElementVNode("div",p1,[N.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",f1,[E.description?(e.openBlock(),e.createElementBlock("span",v1,e.toDisplayString(E.description),1)):(e.openBlock(),e.createElementBlock("span",g1,e.toDisplayString(_n.value),1))])),e.createElementVNode("textarea",{ref_key:"descriptionInputRef",ref:je,value:E.description,onInput:gn,onFocus:vn,onBlur:bn,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-description-input",{"dss-text-editor-description-input-blurred":!N.value}]),placeholder:_n.value,disabled:E.disabled,rows:"1"},null,42,h1)])],2)):e.createCommentVNode("",!0),E.showDescription&&Xn.value&&N.value?(e.openBlock(),e.createElementBlock("div",y1,[e.renderSlot(o.$slots,"description-slot")])):e.createCommentVNode("",!0),rt.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:6},e.renderList(ae.value,s=>(e.openBlock(),e.createElementBlock("div",{key:s.id,class:e.normalizeClass(["editor-comment-marker-group",{"editor-comment-marker-active":hn.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=>Lo(s),onMouseleave:Al},[s.firstUser?(e.openBlock(),e.createElementBlock("div",{key:0,class:"editor-comment-marker editor-comment-marker-first",onClick:e.withModifiers(i=>ln(s),["stop"])},[s.firstUser.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:s.firstUser.avatar,alt:s.firstUser.name||"avatar"},null,8,b1)):(e.openBlock(),e.createElementBlock("span",w1,e.toDisplayString(s.firstUser.initials||(s.firstUser.name?s.firstUser.name.charAt(0):"")),1))],8,C1)):e.createCommentVNode("",!0),s.secondUser?(e.openBlock(),e.createElementBlock("div",{key:1,class:"editor-comment-marker editor-comment-marker-second",onClick:e.withModifiers(i=>ln(s),["stop"])},[s.secondUser.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:s.secondUser.avatar,alt:s.secondUser.name||"avatar"},null,8,E1)):(e.openBlock(),e.createElementBlock("span",S1,e.toDisplayString(s.secondUser.initials||(s.secondUser.name?s.secondUser.name.charAt(0):"")),1))],8,x1)):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=>ln(s),["stop"])},[e.createElementVNode("span",N1,"+"+e.toDisplayString(s.additionalCount),1)],12,V1)):e.createCommentVNode("",!0)],46,k1))),128)):e.createCommentVNode("",!0),E.richText?(e.openBlock(),e.createElementBlock("div",A1,[e.createElementVNode("div",{ref_key:"editorRef",ref:v,contenteditable:"true",spellcheck:"false",class:e.normalizeClass(["dss-text-editor-content",{"dss-text-editor-content-disabled":E.disabled,"dss-text-editor-fixed-height":E.fixedHeight}]),style:e.normalizeStyle(Vn.value),onInput:Mt,onBlur:ht,onClick:Pt,onMouseup:Dt,onKeyup:Dt,onKeydown:Yo,onPaste:yo,onMousemove:$l,onMouseleave:No},null,38),e.createVNode(e.Transition,{name:"comment-overlay"},{default:e.withCtx(()=>[rt.value&&hn.value!==null?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-comment-overlay",style:e.normalizeStyle(y.value)},[q.value||Ge.value.length>0?(e.openBlock(),e.createElementBlock("div",D1,[e.createElementVNode("div",H1,[q.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-comment-selection",innerHTML:q.value},null,8,R1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",F1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ge.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",I1,[e.createElementVNode("div",z1,[s.user.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:s.user.avatar,alt:s.user.name||"avatar"},null,8,P1)):(e.openBlock(),e.createElementBlock("span",O1,e.toDisplayString(s.user.initials||(s.user.name?s.user.name.charAt(0):"")),1))])])):e.createCommentVNode("",!0),e.createElementVNode("div",W1,[e.createElementVNode("div",q1,[e.createElementVNode("div",Z1,e.toDisplayString(s.user&&s.user.name||"Comment"),1),s.createdAt?(e.openBlock(),e.createElementBlock("div",U1,e.toDisplayString(A(new Date(s.createdAt))),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:e.normalizeClass(["dss-comment-body-text",{"comment-started":z(s.text)||s.class==="comment-started"}])},e.toDisplayString(s.text||""),3)]),_.commentUser&&s.user&&s.user.id===_.commentUser.id&&!z(s.text)?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-comment-delete-button",onClick:e.withModifiers(c=>fo(s,i),["stop"]),title:e.unref(V)("textEditor.comment.delete")||"Delete comment"},[...l[68]||(l[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,X1)):e.createCommentVNode("",!0)]))),128))])])):e.createCommentVNode("",!0),e.createElementVNode("div",Y1,[e.withDirectives(e.createElementVNode("textarea",{ref_key:"commentInputRef",ref:x,"onUpdate:modelValue":l[26]||(l[26]=s=>h.value=s),class:"dss-comment-input",rows:"1",placeholder:e.unref(V)("textEditor.comment.placeholder"),onKeydown:e.withKeys(e.withModifiers(Cl,["prevent","stop"]),["enter"]),onInput:l[27]||(l[27]=()=>{if(x.value){const s=x.value;s.style.height="auto",s.style.height=`${s.scrollHeight}px`}})},null,40,j1),[[e.vModelText,h.value]]),e.createElementVNode("button",{type:"button",class:"dss-comment-send-button",onClick:e.withModifiers(Cl,["stop"])},[...l[69]||(l[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",K1,[e.createElementVNode("div",G1,[e.createElementVNode("span",Q1,e.toDisplayString(pn.value)+" "+e.toDisplayString(pn.value===1?e.unref(V)("textEditor.footer.word"):e.unref(V)("textEditor.footer.words")),1),l[70]||(l[70]=e.createElementVNode("span",{class:"dss-text-editor-footer-separator"},"•",-1)),e.createElementVNode("span",J1,e.toDisplayString(ll.value)+" "+e.toDisplayString(ll.value===1?e.unref(V)("textEditor.footer.character"):e.unref(V)("textEditor.footer.characters")),1)])])])):(e.openBlock(),e.createElementBlock("div",B1,[e.createElementVNode("textarea",{value:E.modelValue,onInput:L,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-textarea",{"dss-text-editor-fixed-height":E.fixedHeight}]),placeholder:gl.value,rows:E.rows,disabled:E.disabled,style:e.normalizeStyle(rn.value)},null,46,M1),e.createElementVNode("div",_1,[e.createElementVNode("div",$1,[e.createElementVNode("span",L1,e.toDisplayString(pn.value)+" "+e.toDisplayString(pn.value===1?e.unref(V)("textEditor.footer.word"):e.unref(V)("textEditor.footer.words")),1),l[67]||(l[67]=e.createElementVNode("span",{class:"dss-text-editor-footer-separator"},"•",-1)),e.createElementVNode("span",T1,e.toDisplayString(ll.value)+" "+e.toDisplayString(ll.value===1?e.unref(V)("textEditor.footer.character"):e.unref(V)("textEditor.footer.characters")),1)])])])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[X.value&&me.value&&v.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-link-popup",style:e.normalizeStyle(F.value),onMouseenter:l[28]||(l[28]=s=>ue.value=!0),onMouseleave:In},[e.createElementVNode("span",{class:"dss-link-popup-url",onClick:e.withModifiers(jo,["stop"]),title:me.value},e.toDisplayString(me.value),9,em),e.createElementVNode("button",{type:"button",class:"dss-link-popup-edit",onClick:e.withModifiers(Mo,["stop"]),title:e.unref(V)("textEditor.link.editLink")},[(e.openBlock(),e.createElementBlock("svg",nm,[...l[71]||(l[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,tm)],36)):e.createCommentVNode("",!0)])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[U.value&&ye.value&&v.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-link-popup",style:e.normalizeStyle(P.value),onMouseenter:l[29]||(l[29]=s=>K.value=!0),onMouseleave:Yl},[e.createElementVNode("div",lm,[ye.value===e.unref(V)("textEditor.image.noAlt")?(e.openBlock(),e.createElementBlock("div",om,[...l[72]||(l[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:ye.value},e.toDisplayString(ye.value),9,am)]),e.createElementVNode("button",{type:"button",class:"dss-link-popup-edit",onClick:e.withModifiers(ao,["stop"]),title:e.unref(V)("textEditor.image.editImage")},[(e.openBlock(),e.createElementBlock("svg",rm,[...l[73]||(l[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,sm)],36)):e.createCommentVNode("",!0)])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[E.floatingToolbar&&E.richText&&Je.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"floatingToolbarRef",ref:et,class:"dss-floating-toolbar",style:e.normalizeStyle(we.value),onMousedown:l[44]||(l[44]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("div",im,[e.createElementVNode("div",{class:"dss-toolbar-button",onClick:e.withModifiers(se,["stop"]),title:e.unref(V)("textEditor.toolbar.undo")},[...l[74]||(l[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,cm),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-disabled":!Zn.value}]),onClick:e.withModifiers(on,["stop"]),title:e.unref(V)("textEditor.toolbar.redo")},[...l[75]||(l[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,um),l[89]||(l[89]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",dm,[e.createElementVNode("div",{class:"dss-toolbar-button dss-toolbar-dropdown-toggle",onClick:l[30]||(l[30]=e.withModifiers(s=>eo("paragraph"),["stop"])),title:e.unref(V)("textEditor.toolbar.paragraphFormat")},[B.value==="h1"?(e.openBlock(),e.createElementBlock("img",{key:0,src:I.h1,alt:"H1",class:"dss-toolbar-heading-icon"},null,8,pm)):B.value==="h2"?(e.openBlock(),e.createElementBlock("img",{key:1,src:I.h2,alt:"H2",class:"dss-toolbar-heading-icon"},null,8,fm)):B.value==="h3"?(e.openBlock(),e.createElementBlock("img",{key:2,src:I.h3,alt:"H3",class:"dss-toolbar-heading-icon"},null,8,vm)):B.value==="h4"?(e.openBlock(),e.createElementBlock("img",{key:3,src:I.h4,alt:"H4",class:"dss-toolbar-heading-icon"},null,8,gm)):B.value==="h5"?(e.openBlock(),e.createElementBlock("img",{key:4,src:I.h5,alt:"H5",class:"dss-toolbar-heading-icon"},null,8,hm)):B.value==="h6"?(e.openBlock(),e.createElementBlock("img",{key:5,src:I.h6,alt:"H6",class:"dss-toolbar-heading-icon"},null,8,ym)):(e.openBlock(),e.createElementBlock("svg",km,[...l[76]||(l[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)])])),l[77]||(l[77]=e.createElementVNode("span",{class:"dss-toolbar-dropdown-arrow"},"˅",-1))],8,mm),ct.value==="paragraph"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:l[38]||(l[38]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[31]||(l[31]=s=>dl("<h1>"))},[e.createElementVNode("h1",null,e.toDisplayString(e.unref(V)("textEditor.paragraph.heading1")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[32]||(l[32]=s=>dl("<h2>"))},[e.createElementVNode("h2",null,e.toDisplayString(e.unref(V)("textEditor.paragraph.heading2")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[33]||(l[33]=s=>dl("<h3>"))},[e.createElementVNode("h3",null,e.toDisplayString(e.unref(V)("textEditor.paragraph.heading3")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[34]||(l[34]=s=>dl("<h4>"))},[e.createElementVNode("h4",null,e.toDisplayString(e.unref(V)("textEditor.paragraph.heading4")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[35]||(l[35]=s=>dl("<h5>"))},[e.createElementVNode("h5",null,e.toDisplayString(e.unref(V)("textEditor.paragraph.heading5")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[36]||(l[36]=s=>dl("<h6>"))},[e.createElementVNode("h6",null,e.toDisplayString(e.unref(V)("textEditor.paragraph.heading6")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[37]||(l[37]=s=>dl("<p>"))},[e.createElementVNode("p",null,e.toDisplayString(e.unref(V)("textEditor.paragraph.paragraph")),1)])])):e.createCommentVNode("",!0)]),l[90]||(l[90]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Gt("bold")}]),onClick:l[39]||(l[39]=e.withModifiers(s=>Nn("bold"),["stop"])),title:e.unref(V)("textEditor.toolbar.bold")},[...l[78]||(l[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,Cm),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Gt("italic")}]),onClick:l[40]||(l[40]=e.withModifiers(s=>Nn("italic"),["stop"])),title:e.unref(V)("textEditor.toolbar.italic")},[...l[79]||(l[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,bm),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Gt("underline")}]),onClick:l[41]||(l[41]=e.withModifiers(s=>Nn("underline"),["stop"])),title:e.unref(V)("textEditor.toolbar.underline")},[...l[80]||(l[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,wm),l[91]||(l[91]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Ye.value}]),onClick:e.withModifiers(Yn,["stop"]),title:e.unref(V)("textEditor.toolbar.citation")},[...l[81]||(l[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,xm),l[92]||(l[92]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),ke.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-button",onClick:e.withModifiers(cl,["stop"]),title:e.unref(V)("textEditor.toolbar.removeLink")},[...l[83]||(l[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,Sm)):(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-button",onClick:e.withModifiers(Gl,["stop"]),title:e.unref(V)("textEditor.toolbar.insertLink")},[...l[82]||(l[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,Em)),l[93]||(l[93]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Gt("insertUnorderedList")}]),onClick:e.withModifiers(Ul,["stop"]),title:e.unref(V)("textEditor.toolbar.bulletList")},[...l[84]||(l[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,Vm),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Gt("insertOrderedList")}]),onClick:e.withModifiers(kl,["stop"]),title:e.unref(V)("textEditor.toolbar.numberList")},[...l[85]||(l[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,Nm),l[94]||(l[94]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:"dss-toolbar-button",onClick:e.withModifiers(Qn,["stop"]),title:e.unref(V)("textEditor.toolbar.image")},[...l[86]||(l[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,Bm),rt.value?(e.openBlock(),e.createElementBlock("div",Mm)):e.createCommentVNode("",!0),rt.value?(e.openBlock(),e.createElementBlock("div",{key:3,class:"dss-toolbar-button",title:e.unref(V)("textEditor.toolbar.comment"),onClick:e.withModifiers(On,["stop"])},[...l[87]||(l[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,_m)):e.createCommentVNode("",!0),E.askAi?(e.openBlock(),e.createElementBlock("div",$m)):e.createCommentVNode("",!0),E.askAi?(e.openBlock(),e.createElementBlock("div",Lm,[e.createElementVNode("div",{class:"dss-toolbar-ai-button dss-toolbar-ai-float dss-toolbar-dropdown-toggle",onClick:l[42]||(l[42]=e.withModifiers(s=>eo("askAi"),["stop"])),title:e.unref(V)("textEditor.toolbar.askAi")},[l[88]||(l[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",Am,e.toDisplayString(e.unref(V)("textEditor.toolbar.askAi")),1)],8,Tm),ct.value==="askAi"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:l[43]||(l[43]=e.withModifiers(()=>{},["stop"]))},[e.renderSlot(o.$slots,"ask-ai-dropdown")])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),An.value?(e.openBlock(),e.createElementBlock("div",Dm,[E.askAi&&An.value?(e.openBlock(),e.createElementBlock("div",Hm)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(E.customToolbarSlots,(s,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:i},[$n(s)&&hl(s)?(e.openBlock(),e.createElementBlock("div",Rm,[e.renderSlot(o.$slots,s)])):e.createCommentVNode("",!0),$n(s)&&hl(s)&&i<E.customToolbarSlots.length-1&&Rl(i)?(e.openBlock(),e.createElementBlock("div",Fm)):e.createCommentVNode("",!0)],64))),128))])):e.createCommentVNode("",!0)],36)):e.createCommentVNode("",!0)]))],6))}}),Pm={class:"dss-color-picker__section-title"},Om={class:"dss-color-picker__presets-row"},Wm=["title","onClick"],qm={key:1,class:"dss-color-picker__section"},Zm={class:"dss-color-picker__presets-row"},Um=["title","onClick"],Xm={key:2,class:"dss-color-picker__section"},Ym={class:"dss-color-picker__section-header"},jm={class:"dss-color-picker__presets-row"},Km=["title","onClick"],Gm=["onClick"],Qm={key:1,class:"dss-color-picker__presets-row dss-color-picker__presets-row--standalone"},Jm=["title","onClick"],e2={class:"dss-color-picker__input-row"},t2=["value"],n2={__name:"DSSColorPicker",props:{modelValue:{type:String,default:"#b8a5de"},disabled:{type:Boolean,default:!1},presetColors:{type:Array,default:()=>[]},presetGroups:{type:Array,default:null},max:{type:Number,default:12},initialPresetCount:{type:Number,default:null},disableCustomColors:{type:Boolean,default:!1}},emits:["update:modelValue","update:presetColors"],setup(E,{emit:ne}){function $(oe){const Y=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(oe);if(!Y)return{h:0,s:0,l:50};const j=parseInt(Y[1],16)/255,de=parseInt(Y[2],16)/255,be=parseInt(Y[3],16)/255,je=Math.max(j,de,be),Tt=Math.min(j,de,be);let Xt=0,nt=0;const sn=(je+Tt)/2;if(je!==Tt){const N=je-Tt;switch(nt=sn>.5?N/(2-je-Tt):N/(je+Tt),je){case j:Xt=((de-be)/N+(de<be?6:0))/6;break;case de:Xt=((be-j)/N+2)/6;break;case be:Xt=((j-de)/N+4)/6;break}}return{h:Xt*360,s:nt*100,l:sn*100}}function V(oe,Y,j){Y/=100,j/=100;const de=Y*Math.min(j,1-j),be=je=>{const Tt=(je+oe/30)%12,Xt=j-de*Math.max(Math.min(Tt-3,9-Tt,1),-1);return Math.round(255*Xt).toString(16).padStart(2,"0")};return`#${be(0)}${be(8)}${be(4)}`}function ce(oe){const Y=oe.replace(/^#/,"").match(/^([a-f\d]{6}|[a-f\d]{3})$/i);if(!Y)return null;let j=Y[1];return j.length===3&&(j=j.split("").map(de=>de+de).join("")),"#"+j}function I(oe){const Y=oe.match(/^rgba?\(\s*(\d{1,3})[\s,]+(\d{1,3})[\s,]+(\d{1,3})(?:[\s,\/]+[\d.]+)?\s*\)$/i);if(!Y)return null;const j=Math.max(0,Math.min(255,Number.parseInt(Y[1],10))),de=Math.max(0,Math.min(255,Number.parseInt(Y[2],10))),be=Math.max(0,Math.min(255,Number.parseInt(Y[3],10)));return`#${j.toString(16).padStart(2,"0")}${de.toString(16).padStart(2,"0")}${be.toString(16).padStart(2,"0")}`}function _(oe){if(typeof oe!="string")return null;const Y=oe.trim();return ce(Y)||I(Y)}function pe(oe,Y,j){Y/=100,j/=100;const de=j+Y*Math.min(j,1-j),be=de===0?0:2-2*j/de;return{h:oe,s:be*100,v:de*100}}function st(oe,Y,j){Y/=100,j/=100;const de=j*(1-Y/2),be=de===0||de===1?0:(j-de)/Math.min(de,1-de);return{h:oe,s:be*100,l:de*100}}const te=E,v=ne,Ce=e.ref(!1),ke=e.ref(!1),Q=e.ref(!1),X=e.ref(-1),me=e.ref(-1),F=e.ref(null),ue=e.ref(null),Me=e.ref(null),tt=e.ref(null),mt=e.ref({top:0,left:0}),Z=e.ref($(te.modelValue||"#b8a5de")),Ae=e.computed(()=>Array.isArray(te.presetGroups)&&te.presetGroups.length>0),We=e.computed(()=>!te.disableCustomColors),Ee=e.computed(()=>Ae.value?0:te.initialPresetCount!=null?te.initialPresetCount:me.value<0?null:me.value),_e=e.computed(()=>{const oe=Ee.value;return oe==null?!0:Math.max(0,te.presetColors.length-oe)<te.max}),Ye=e.computed(()=>!!(ke.value||X.value>=0||!ie.value&&te.presetColors.length===0));e.computed(()=>{const oe=Ee.value;return oe!=null&&te.presetColors.length>oe});const ie=e.computed(()=>Ae.value||Ee.value!=null),Je=e.computed(()=>{const oe=Ee.value;return oe==null?[]:te.presetColors.slice(0,oe)}),we=e.computed(()=>{const oe=Ee.value;return oe==null?[]:te.presetColors.slice(oe)});function et(oe){const Y=Ee.value;return Y!=null?Y+oe:-1}function ct(oe){const Y=Ee.value;return Y!=null&&oe>=Y}function vt(oe){ct(oe)&&(X.value=oe,Z.value=$(te.presetColors[oe]),ke.value=!0,e.nextTick(()=>tt.value?.focus()))}function ut(oe){if(!ct(oe))return;const Y=te.presetColors.filter((be,je)=>je!==oe);v("update:presetColors",Y);const j=ce(te.modelValue),de=ce(te.presetColors[oe]);if(j&&de&&j.toLowerCase()===de.toLowerCase()){const be=Y[Math.max(0,oe-1)]||Y[0];be&&v("update:modelValue",be)}}function Ft(){Q.value=!Q.value,Q.value||(X.value=-1,ke.value=!1)}function It(){if(!We.value||X.value<0)return;const oe=pt.value,Y=ce(oe);if(Y){const j=[...te.presetColors];j[X.value]=Y,v("update:presetColors",j),v("update:modelValue",Y),X.value=-1,ke.value=!1}}function bt(){te.disabled||!We.value||(X.value=-1,ke.value=!ke.value,ke.value&&(K(),e.nextTick(()=>tt.value?.focus())))}function wt(oe){const Y=_(oe),j=_(te.modelValue);return Y&&j&&Y.toLowerCase()===j.toLowerCase()}function Jt(){if(te.disabled||!We.value||!_e.value)return;const oe=pt.value,Y=ce(oe);if(Y){const j=[...te.presetColors,Y];v("update:presetColors",j),v("update:modelValue",Y);const de=Ee.value??me.value;de>=0&&j.length-de>=te.max&&(ke.value=!1)}}const pt=e.computed(()=>{const{h:oe,s:Y,l:j}=Z.value;return V(oe,Y,j)}),jt=e.computed(()=>pt.value.toLowerCase()),kt=e.computed(()=>({background:`linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, hsl(${Z.value.h}, 100%, 50%))`})),tn=e.computed(()=>{const oe=pe(Z.value.h,Z.value.s,Z.value.l);return{left:`${oe.s}%`,bottom:`${oe.v}%`,transform:"translate(-50%, 50%)"}}),U=e.computed(()=>({left:`${Z.value.h/360*100}%`,transform:"translateX(-50%)"})),ye=e.computed(()=>({position:"fixed",left:`${mt.value.left}px`,top:`${mt.value.top}px`,zIndex:1002}));function P(){if(!F.value||!Ce.value)return;const oe=F.value.getBoundingClientRect(),Y=window.innerHeight||document.documentElement.clientHeight;let j=oe.bottom+4;const de=ue.value;de&&j+de.offsetHeight>Y-8&&(j=oe.top-4-de.offsetHeight),mt.value={top:j,left:oe.left}}function K(){const oe=te.modelValue||"#b8a5de",Y=_(oe);Y&&(Z.value=$(Y))}function Se(){v("update:modelValue",pt.value)}function Re(){te.disabled||(Ce.value=!Ce.value,Ce.value&&(K(),e.nextTick(()=>{P(),tt.value?.focus()})))}function Ze(){const oe=pt.value,Y=ce(oe);if(Y){if(X.value>=0){const j=[...te.presetColors];j[X.value]=Y,v("update:presetColors",j),v("update:modelValue",Y)}else if(We.value&&(te.presetColors.length>0||Ae.value)&&ke.value&&_e.value&&!te.presetColors.some(de=>ce(de)?.toLowerCase()===Y.toLowerCase())){const de=[...te.presetColors,Y];v("update:presetColors",de),v("update:modelValue",Y)}}Ce.value=!1,ke.value=!1,Q.value=!1,X.value=-1}function xt(oe){if(!Me.value)return;const Y=Me.value.getBoundingClientRect(),j=de=>{const be=Math.max(0,Math.min(1,(de.clientX-Y.left)/Y.width)),je=Math.max(0,Math.min(1,1-(de.clientY-Y.top)/Y.height)),Tt={h:Z.value.h,s:be*100,v:je*100};Z.value=st(Tt.h,Tt.s,Tt.v)};j(oe),document.addEventListener("mousemove",j),document.addEventListener("mouseup",()=>{document.removeEventListener("mousemove",j),Se()},{once:!0})}function Ke(oe){if(!oe.currentTarget)return;const j=oe.currentTarget.getBoundingClientRect(),de=be=>{const je=Math.max(0,Math.min(1,(be.clientX-j.left)/j.width));Z.value={...Z.value,h:je*360}};de(oe),document.addEventListener("mousemove",de),document.addEventListener("mouseup",()=>{document.removeEventListener("mousemove",de),Se()},{once:!0})}function zt(oe){const Y=oe.target.value,j=_(Y);j&&(Z.value=$(j),v("update:modelValue",j))}function qe(oe){if(te.disabled)return;const Y=_(oe);Y&&(Z.value=$(Y),v("update:modelValue",Y))}let ze=null,Lt=null;function $t(){ze&&(document.removeEventListener("keydown",ze),ze=null),Lt&&(window.removeEventListener("resize",Lt),Lt=null)}return e.watch(Ce,oe=>{if($t(),oe){if(!Ae.value&&te.initialPresetCount==null){const Y=te.presetColors.length;Y>0&&(me.value<0||Y<me.value)&&(me.value=Y)}ze=Y=>{Y.key==="Escape"&&Ze()},Lt=P,document.addEventListener("keydown",ze),window.addEventListener("resize",Lt)}}),e.watch(()=>te.modelValue,()=>{Ce.value&&K()},{immediate:!1}),e.watch(we,oe=>{oe.length===0&&(Q.value=!1,X.value=-1,ke.value=!1)}),e.onBeforeUnmount($t),(oe,Y)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-color-picker",{"dss-color-picker--disabled":E.disabled}])},[e.createElementVNode("div",{ref_key:"triggerRef",ref:F,class:e.normalizeClass(["dss-color-picker__trigger",{"dss-color-picker__trigger--open":Ce.value}]),onClick:Re},[e.createElementVNode("span",{class:"dss-color-picker__swatch",style:e.normalizeStyle({backgroundColor:pt.value})},[...Y[0]||(Y[0]=[e.createElementVNode("span",{class:"dss-color-picker__hover-layer"},[e.createElementVNode("svg",{class:"dss-color-picker__pen-icon",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[e.createElementVNode("path",{d:"M0 9.64033V11.6667C0 11.8534 0.146646 12 0.333287 12H2.35967C2.44633 12 2.53298 11.9667 2.59297 11.9L9.87196 4.62769L7.37231 2.12804L0.0999862 9.40036C0.0333288 9.46702 0 9.54701 0 9.64033ZM11.805 2.69463C12.065 2.43466 12.065 2.01472 11.805 1.75476L10.2452 0.194973C9.98528 -0.064991 9.56534 -0.064991 9.30537 0.194973L8.08554 1.4148L10.5852 3.91446L11.805 2.69463Z",fill:"currentColor"})])],-1)])],4)],2),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[Ce.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-color-picker__overlay",onClick:e.withModifiers(Ze,["self"])},[e.createElementVNode("div",{ref_key:"dropdownRef",ref:ue,class:"dss-color-picker__dropdown",style:e.normalizeStyle(ye.value)},[ie.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[Ae.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(E.presetGroups,(j,de)=>(e.openBlock(),e.createElementBlock("div",{key:"g-"+de,class:"dss-color-picker__section"},[e.createElementVNode("span",Pm,e.toDisplayString(j.title),1),e.createElementVNode("div",Om,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(j.colors,(be,je)=>(e.openBlock(),e.createElementBlock("button",{key:"g-"+de+"-"+je,type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":wt(be)}]),style:e.normalizeStyle({backgroundColor:be,"--dss-preset-color":be}),title:be,onClick:e.withModifiers(Tt=>qe(be),["stop"])},null,14,Wm))),128))])]))),128)):Je.value.length?(e.openBlock(),e.createElementBlock("div",qm,[Y[1]||(Y[1]=e.createElementVNode("span",{class:"dss-color-picker__section-title"},"Preset colors",-1)),e.createElementVNode("div",Zm,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Je.value,(j,de)=>(e.openBlock(),e.createElementBlock("button",{key:"p-"+de,type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":wt(j)}]),style:e.normalizeStyle({backgroundColor:j,"--dss-preset-color":j}),title:j,onClick:e.withModifiers(be=>qe(j),["stop"])},null,14,Um))),128))])])):e.createCommentVNode("",!0),We.value?(e.openBlock(),e.createElementBlock("div",Xm,[e.createElementVNode("div",Ym,[Y[3]||(Y[3]=e.createElementVNode("span",{class:"dss-color-picker__section-title"},"Custom Colors",-1)),we.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(Ft,["stop"])},[...Y[2]||(Y[2]=[e.createElementVNode("svg",{viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M0 9.64V11.67c0 .19.15.33.33.33h2.03c.09 0 .17-.03.23-.1l7.28-7.27-2.5-2.5L.1 9.4A.33.33 0 0 0 0 9.64ZM11.8 2.69c.26-.26.26-.68 0-.94L10.25.2a.66.66 0 0 0-.94 0L8.09 1.41l2.5 2.5 1.22-1.22Z",fill:"currentColor"})],-1)])],2)):e.createCommentVNode("",!0)]),e.createElementVNode("div",jm,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(we.value,(j,de)=>(e.openBlock(),e.createElementBlock("div",{key:"c-"+de,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&&wt(j),"dss-color-picker__preset-bubble--editing":Q.value&&X.value===et(de)}]),style:e.normalizeStyle({backgroundColor:X.value===et(de)?pt.value:j,"--dss-preset-color":X.value===et(de)?pt.value:j}),title:X.value===et(de)?pt.value:j,onClick:e.withModifiers(be=>Q.value?vt(et(de)):qe(j),["stop"])},null,14,Km),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(be=>ut(et(de)),["stop"])},[...Y[4]||(Y[4]=[e.createElementVNode("svg",{viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M2 2l8 8M10 2L2 10",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round"})],-1)])],8,Gm)):e.createCommentVNode("",!0)],2))),128)),_e.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-color-picker__add-bubble",{"dss-color-picker__add-bubble--active":ke.value}]),onClick:e.withModifiers(bt,["stop"])}," + ",2)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)],64)):E.presetColors.length?(e.openBlock(),e.createElementBlock("div",Qm,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(E.presetColors,(j,de)=>(e.openBlock(),e.createElementBlock("button",{key:de,type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":wt(j)}]),style:e.normalizeStyle({backgroundColor:j,"--dss-preset-color":j}),title:j,onClick:e.withModifiers(be=>qe(j),["stop"])},null,14,Jm))),128)),We.value&&_e.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-color-picker__add-bubble",{"dss-color-picker__add-bubble--active":ke.value}]),onClick:e.withModifiers(bt,["stop"])}," + ",2)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),Ye.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createElementVNode("div",{class:"dss-color-picker__sl-area",ref_key:"slAreaRef",ref:Me,onMousedown:xt},[e.createElementVNode("div",{class:"dss-color-picker__sl-bg",style:e.normalizeStyle(kt.value)},null,4),e.createElementVNode("div",{class:"dss-color-picker__sl-pointer",style:e.normalizeStyle(tn.value)},null,4)],544),e.createElementVNode("div",{class:"dss-color-picker__hue-wrap",onMousedown:Ke},[Y[5]||(Y[5]=e.createElementVNode("div",{class:"dss-color-picker__hue-track"},null,-1)),e.createElementVNode("div",{class:"dss-color-picker__hue-pointer",style:e.normalizeStyle(U.value)},null,4)],32),e.createElementVNode("div",e2,[e.createElementVNode("input",{ref_key:"hexInputRef",ref:tt,type:"text",class:"dss-color-picker__hex-input",value:jt.value,onInput:zt},null,40,t2)]),We.value&&ie.value&&(E.presetColors.length||Ae.value)&&_e.value&&X.value<0?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-color-picker__add-btn",onClick:Jt}," Save color ")):e.createCommentVNode("",!0),We.value&&ie.value&&X.value>=0?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-color-picker__add-btn",onClick:It}," Save color ")):e.createCommentVNode("",!0),ie.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:2,type:"button",class:"dss-color-picker__add-btn",onClick:Ze}," Save color "))],64)):e.createCommentVNode("",!0)],4)])):e.createCommentVNode("",!0)]))],2))}},l2={key:0,class:"dss-loader"},o2={key:0,class:"dss-loader-label"},a2={key:1,class:"dss-loader"},s2={key:0,class:"dss-loader-label"},r2={key:2,class:"dss-loader"},i2={key:0,class:"dss-loader-label"},c2={key:3,class:"dss-loader"},u2={key:0,class:"dss-loader-label"},d2={key:4,class:"dss-loader"},m2={key:0,class:"dss-loader-label"},p2={key:5,class:"dss-loader dss-loader--inline"},f2={class:"dss-loader-inline-text"},v2={__name:"DSSLoaders",props:{type:{type:String,default:"spinner"},label:{type:String,default:""},size:{type:[String,Number],default:"medium"},color:{type:String,default:""}},setup(E){const ne=E,$=e.computed(()=>ne.size==="small"?"dss-loaders--size-small":ne.size==="large"?"dss-loaders--size-large":ne.size==="medium"||ne.size==null?"dss-loaders--size-medium":null),V=e.computed(()=>{const ce={};if(!(ne.size==="small"||ne.size==="medium"||ne.size==="large"||ne.size==null)){const I=typeof ne.size=="number"?`${ne.size}px`:String(ne.size);ce["--dss-loader-size"]=I}return ne.color&&(ce["--dss-loader-accent"]=ne.color,ce["--dss-loader-accent-soft"]=`color-mix(in srgb, ${ne.color} 30%, white)`),ce});return(ce,I)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-loaders",$.value]),style:e.normalizeStyle(V.value)},[E.type==="spinner"?(e.openBlock(),e.createElementBlock("div",l2,[I[0]||(I[0]=e.createElementVNode("span",{class:"dss-loader-spinner","aria-hidden":"true"},null,-1)),E.label?(e.openBlock(),e.createElementBlock("span",o2,e.toDisplayString(E.label),1)):e.createCommentVNode("",!0)])):E.type==="dots"?(e.openBlock(),e.createElementBlock("div",a2,[I[1]||(I[1]=e.createElementVNode("span",{class:"dss-loader-dots","aria-hidden":"true"},[e.createElementVNode("span",{class:"dss-loader-dot"}),e.createElementVNode("span",{class:"dss-loader-dot"}),e.createElementVNode("span",{class:"dss-loader-dot"})],-1)),E.label?(e.openBlock(),e.createElementBlock("span",s2,e.toDisplayString(E.label),1)):e.createCommentVNode("",!0)])):E.type==="battery"?(e.openBlock(),e.createElementBlock("div",r2,[I[2]||(I[2]=e.createElementVNode("div",{class:"battery","aria-hidden":"true"},null,-1)),E.label?(e.openBlock(),e.createElementBlock("span",i2,e.toDisplayString(E.label),1)):e.createCommentVNode("",!0)])):E.type==="double-circle"?(e.openBlock(),e.createElementBlock("div",c2,[I[3]||(I[3]=e.createElementVNode("span",{class:"dss-loader-double-circle","aria-hidden":"true"},[e.createElementVNode("span",{class:"dss-loader-double-circle-outer"}),e.createElementVNode("span",{class:"dss-loader-double-circle-inner"})],-1)),E.label?(e.openBlock(),e.createElementBlock("span",u2,e.toDisplayString(E.label),1)):e.createCommentVNode("",!0)])):E.type==="bars"?(e.openBlock(),e.createElementBlock("div",d2,[I[4]||(I[4]=e.createElementVNode("span",{class:"dss-loader-bars","aria-hidden":"true"},[e.createElementVNode("span",{class:"dss-loader-bar"}),e.createElementVNode("span",{class:"dss-loader-bar"}),e.createElementVNode("span",{class:"dss-loader-bar"})],-1)),E.label?(e.openBlock(),e.createElementBlock("span",m2,e.toDisplayString(E.label),1)):e.createCommentVNode("",!0)])):E.type==="inline"?(e.openBlock(),e.createElementBlock("div",p2,[I[5]||(I[5]=e.createElementVNode("span",{class:"dss-loader-inline-spinner","aria-hidden":"true"},null,-1)),e.createElementVNode("span",f2,[e.renderSlot(ce.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(E.label),1)])])])):e.createCommentVNode("",!0)],6))}},da="dss-skeleton-item",g2={__name:"DSSSkeleton",props:{loading:{type:Boolean,default:!1},darkMode:{type:Boolean,default:!1},borderRadius:{type:String,default:"16px"},shimmer:{type:Boolean,default:!0},mode:{type:String,default:"single",validator:E=>["single","multiple"].includes(E)},targetClass:{type:String,default:da},bgColor:{type:String,default:null},shimmerColor:{type:String,default:null},bgDark:{type:String,default:null},shimmerDark:{type:String,default:null}},setup(E){const ne=E,$=e.computed(()=>{const I={"dss-skeleton--loading":ne.loading,"dss-skeleton--static":!ne.shimmer,"dss-skeleton--multiple":ne.mode==="multiple","dss-skeleton--dark":ne.darkMode};return ne.mode==="multiple"&&ne.targetClass!==da&&(I[`dss-skeleton--target-${ne.targetClass}`]=!0),I}),V=e.computed(()=>{const I={};return ne.borderRadius&&(I.borderRadius=ne.borderRadius),I}),ce=e.computed(()=>{const I={};return ne.borderRadius&&(I["--dss-skeleton-border-radius"]=ne.borderRadius),ne.darkMode?(I["--dss-skeleton-bg"]=ne.bgDark||"#322c3f",I["--dss-skeleton-shimmer"]=ne.shimmerDark||"#3e3f41",I):(ne.bgColor&&(I["--dss-skeleton-bg"]=ne.bgColor),ne.shimmerColor&&(I["--dss-skeleton-shimmer"]=ne.shimmerColor),I)});return(I,_)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-skeleton",$.value]),style:e.normalizeStyle(ce.value)},[E.loading&&E.mode==="single"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-skeleton-overlay",style:e.normalizeStyle(V.value),"aria-hidden":"true"},null,4)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["dss-skeleton-content",{"dss-skeleton-content--hidden":E.loading&&E.mode==="single"}])},[e.renderSlot(I.$slots,"default")],2)],6))}},h2={key:0,class:"dss-dnd-column-header"},y2={class:"dss-dnd-column-title"},k2={class:"dss-dnd-column-count"},C2=["data-column"],b2={key:0,class:"dss-dnd-indicator"},w2=["onPointerdown"],x2=["onPointerdown"],E2={class:"dss-dnd-item-content"},S2={class:"dss-dnd-item-default"},V2={key:0,class:"dss-dnd-empty"},N2={name:"DSSDnd"},B2=Object.assign(N2,{props:{items:{type:Array,required:!0},columns:{type:Array,required:!0},columnKey:{type:String,default:"status"},positionKey:{type:String,default:"position"},itemKey:{type:String,default:"id"},options:{type:Object,default:()=>({})}},emits:["move","delete"],setup(E,{emit:ne}){const $=E,V=ne,ce=e.useSlots(),I=e.computed(()=>!!ce["delete-zone"]),_={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},pe=e.computed(()=>({..._,...$.options})),st=e.computed(()=>({"--dss-dnd-col-min-w":pe.value.columnMinWidth,"--dss-dnd-col-max-w":pe.value.columnMaxWidth,"--dss-dnd-col-gap":pe.value.columnGap,"--dss-dnd-indicator-color":pe.value.indicatorColor,"--dss-dnd-body-max-h":pe.value.columnBodyMaxHeight}));function te(P){if(!pe.value.ColColor||!P)return{};const K=P.background||P.color;return K?{background:K}:{}}const v=e.ref(null),Ce=e.ref(null),ke=e.ref(!1),Q=e.ref(-1),X=e.ref(null);let me=null,F=null,ue=null,Me=null,tt=0,mt=0,Z="",Ae=null;const We=5,Ee=e.computed(()=>{const P={};for(const K of $.columns)P[K.value]=$.items.filter(Se=>Se[$.columnKey]===K.value).sort((Se,Re)=>(Se[$.positionKey]??0)-(Re[$.positionKey]??0));return P}),_e=e.computed(()=>{const P={},K=!!v.value,Se=v.value?.[$.itemKey],Re=Ce.value,Ze=Q.value;for(const xt of $.columns){const Ke=Ee.value[xt.value]||[],zt=[],qe=Re==xt.value;let ze=0;for(let Lt=0;Lt<Ke.length;Lt++){const $t=Ke[Lt],oe=K&&$t[$.itemKey]===Se;!oe&&qe&&Ze===ze&&zt.push({type:"indicator",key:`ind-${ze}`}),oe||ze++,zt.push({type:"item",item:$t,isDragged:oe,key:`item-${$t[$.itemKey]}`})}qe&&Ze>=ze&&zt.push({type:"indicator",key:"ind-end"}),P[xt.value]=zt}return P});function Ye(P,K){const Re=(Ee.value[P]||[]).filter(Ke=>Ke[$.itemKey]!==v.value?.[$.itemKey]);if(Re.length===0)return 1;if(K<=0){const Ke=Re[0][$.positionKey];return Ke!=null&&Ke>0?Ke/2:.5}if(K>=Re.length){const Ke=Re[Re.length-1][$.positionKey];return(Ke??0)+1}const Ze=Re[K-1][$.positionKey]??0,xt=Re[K][$.positionKey]??0;return(Ze+xt)/2}function ie(P,K,Se){ue&&ue.remove();const Re=P.getBoundingClientRect(),Ze=P.cloneNode(!0);Ze.classList.add("dss-dnd-ghost"),Ze.style.cssText=`
|
|
102
|
+
</svg>`,v=e.ref(null),be=e.ref(null),ke=e.ref(!1),J=e.ref(!1),Y=e.ref(!1),me=e.ref(""),F=e.ref({}),ue=e.ref(!1),$e=e.ref(!1),tt=e.ref(""),mt=e.ref(""),U=e.ref(null),ze=e.ref(null),qe=e.ref(null),Ve=e.ref(null),Le=e.ref(""),je=e.ref(!1),re=e.ref({}),Qe=e.ref(!1),Ce=e.ref({}),Je=e.ref(null),ut=e.ref(null),ht=e.ref(!1),dt=e.ref(""),Wt=e.ref(null),qt=e.ref(""),Ct=e.ref(""),wt=e.ref(""),Yt=e.ref(null),it=e.ref(null),Kt=e.ref(null),yt=e.ref(null),el=e.ref(null),X=e.ref(!1),ge=e.ref(""),W=e.ref({}),G=e.ref(!1),Ne=e.ref("upload"),Pe=e.ref(""),Xe=e.ref(null),Et=e.ref(null),Ge=e.ref([]),Zt=e.ref([]),Ue=e.ref(null),We=e.ref(!1),Dt=e.ref(""),Lt=e.ref(""),ne=e.ref(""),j=e.ref(""),K=e.ref(""),de=e.ref(""),xe=e.ref(null),Ke=e.ref(null),Ht=e.ref(null),jt=e.ref(!1),et=e.ref(null),vl=e.ref(!1),M=e.ref(!1),x=e.ref(null),A=e.ref("p"),ae=e.ref(!1),oe=e.ref([]),Fe=e.ref(null),bt=e.ref(null),ot=e.ref(null),Ie=e.ref(!1),xt=e.ref(0),Mt=100,St=e.ref(null),At=e.computed(()=>!!L.commentUser),It=e.computed(()=>({"dss-text-editor-no-border":!L.border,"dss-text-editor-rounded":L.rounded,"dss-text-editor-full-height":L.fullHeight,"dss-comment-overlay-open":At.value&&Cl.value!==null})),Nt=e.computed(()=>({})),yl=e.computed(()=>!L.fixedHeight||L.fullHeight?{}:{height:`${1.6*14*L.rows+24+2}px`,resize:"none",overflowY:"auto"}),nn=e.computed(()=>!L.fixedHeight||L.fullHeight?{}:{height:`${1.6*14*L.rows+32}px`,overflowY:"auto"}),Vl=e.computed(()=>L.richText&&Zt.value.length>0),Nl=e.computed(()=>{if(!L.modelValue)return"";if(L.richText){let a=L.modelValue.replace(/<script[^>]*>[\s\S]*?<\/script>/gi,"");return a=a.replace(/<style[^>]*>[\s\S]*?<\/style>/gi,""),a=a.replace(/<[^>]+>/g,""),a=a.replace(/ /g," "),a=a.replace(/&/g,"&"),a=a.replace(/</g,"<"),a=a.replace(/>/g,">"),a=a.replace(/"/g,'"'),a=a.replace(/'/g,"'"),a=a.replace(/\s+/g," ").trim(),a}return L.modelValue}),tl=e.computed(()=>{const a=Nl.value.trim();return a?a.split(/\s+/).filter(n=>n.length>0).length:0}),jl=e.computed(()=>Nl.value.length),on=e.computed(()=>yt.value!==null&&Ne.value==="upload"&&qt.value&&qt.value.startsWith("data:")),xl=e.computed(()=>L.titlePlaceholder||V("textEditor.placeholders.title")),Fl=e.computed(()=>L.descriptionPlaceholder||V("textEditor.placeholders.description")),dn=e.computed(()=>L.placeholder||V("textEditor.placeholders.startTyping")),Hl=a=>rt&&rt[a]!==void 0,Pn=a=>{for(let n=a+1;n<L.customToolbarSlots.length;n++)if(Hl(L.customToolbarSlots[n]))return!0;return!1},mn=a=>{for(let n=a+1;n<L.customToolbarSlots.length;n++){const s=L.customToolbarSlots[n];if(Hl(s)&&pn(s))return!0}return!1},pn=a=>L.customToolbarFloatingMap.hasOwnProperty(a)?L.customToolbarFloatingMap[a]===!0:!0,wn=e.computed(()=>L.customToolbarSlots.some(a=>Hl(a)&&pn(a))),ql=e.computed(()=>Hl("title-slot")),rl=e.computed(()=>Hl("description-slot")),Il=a=>{if(!a||a.trim()==="")return"<html></html>";const n=a.trim();return n.startsWith("<html>")&&n.endsWith("</html>")?a:`<html>${a}</html>`},Kl=a=>{if(!a||a.trim()==="")return"";const n=a.replace(/<!--[\s\S]*?-->/g,""),s=n.trim();return s.startsWith("<html>")&&s.endsWith("</html>")?s.slice(6,-7).trim():n},sn=a=>{if(!a)return;const n=document.createTreeWalker(a,NodeFilter.SHOW_COMMENT,null,!1),s=[];let i=n.nextNode();for(;i;)s.push(i),i=n.nextNode();s.forEach(c=>c.remove())},T=a=>{try{const n=String(a.getDate()).padStart(2,"0"),i=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][a.getMonth()],c=a.getFullYear();return`${n} ${i} ${c}`}catch{return""}},z=a=>{if(!a||typeof a!="string")return!1;const n=a.trim();if(!n)return!1;if(["Started conversation","A démarré la conversation","started_conversation","conv_started"].includes(n))return!0;try{const c=V("textEditor.started_conversation");if(c&&n===c)return!0}catch{}const i=n.toLowerCase();return i.includes("started conversation")||i.includes("démarré la conversation")||i==="started conversation"||i==="a démarré la conversation"},_=a=>{const n=a.target.value;fe("update:modelValue",n),fe("change",n)},le=()=>{if(!xe.value)return;const a=xe.value;if(a.style.setProperty("text-overflow","","important"),a.style.setProperty("white-space","","important"),a.style.setProperty("overflow-x","","important"),a.style.setProperty("height","auto","important"),a.value.trim()===""){const i=a.value;a.value="M";const c=a.scrollHeight;a.value=i,a.style.setProperty("height",`${c}px`,"important"),a.style.setProperty("overflow-y","hidden","important");return}a.offsetHeight;const s=a.scrollHeight;a.style.setProperty("height",`${s}px`,"important"),a.style.setProperty("overflow-y","hidden","important")},Te=()=>{vl.value=!0,le()},pt=()=>{vl.value=!1,ct()},ct=()=>{if(!xe.value)return;const a=xe.value;a.style.setProperty("text-overflow","","important"),a.style.setProperty("white-space","","important"),a.style.setProperty("overflow-x","","important"),a.style.setProperty("height","auto","important");const n=a.value;a.value="M";const s=a.scrollHeight;a.value=n,a.offsetHeight,a.style.setProperty("height",`${s}px`,"important"),a.style.setProperty("overflow-y","hidden","important"),a.style.setProperty("overflow-x","hidden","important"),a.style.setProperty("text-overflow","ellipsis","important"),a.style.setProperty("white-space","nowrap","important")},lt=a=>{const s=a.target.value;vl.value&&le(),fe("update:title",s),fe("title-change",s),Ht.value="title",L.richText&&(We.value||(Lt.value=Dt.value,K.value=ne.value,de.value=j.value),Ue.value&&clearTimeout(Ue.value),We.value=!0,Ue.value=setTimeout(()=>{We.value=!1,Qt()},500))},st=()=>{if(!Ke.value)return;const a=Ke.value;if(a.style.setProperty("text-overflow","","important"),a.style.setProperty("white-space","","important"),a.style.setProperty("overflow-x","","important"),a.style.setProperty("height","auto","important"),a.value.trim()===""){const i=a.value;a.value="M";const c=a.scrollHeight;a.value=i,a.style.setProperty("height",`${c}px`,"important"),a.style.setProperty("overflow-y","hidden","important");return}a.offsetHeight;const s=a.scrollHeight;a.style.setProperty("height",`${s}px`,"important"),a.style.setProperty("overflow-y","hidden","important")},il=()=>{M.value=!0,st()},kl=()=>{M.value=!1,Gt()},Gt=()=>{if(!Ke.value)return;const a=Ke.value;a.style.setProperty("text-overflow","","important"),a.style.setProperty("white-space","","important"),a.style.setProperty("overflow-x","","important"),a.style.setProperty("height","auto","important");const n=a.value;a.value="M";const s=a.scrollHeight;a.value=n,a.offsetHeight,a.style.setProperty("height",`${s}px`,"important"),a.style.setProperty("overflow-y","hidden","important"),a.style.setProperty("overflow-x","hidden","important"),a.style.setProperty("text-overflow","ellipsis","important"),a.style.setProperty("white-space","nowrap","important")},wl=a=>{const s=a.target.value;M.value&&st(),fe("update:description",s),fe("description-change",s),Ht.value="description",L.richText&&(We.value||(Lt.value=Dt.value,K.value=ne.value,de.value=j.value),Ue.value&&clearTimeout(Ue.value),We.value=!0,Ue.value=setTimeout(()=>{We.value=!1,Qt()},500))},Rt=()=>{const a=window.getSelection();if(a.rangeCount===0)return null;const n=a.getRangeAt(0);if(n.startContainer.nodeType===1)return{type:"element",element:n.startContainer,offset:n.startOffset};const s=n.cloneRange();return s.selectNodeContents(v.value),s.setEnd(n.startContainer,n.startOffset),{type:"text",start:s.toString().length,end:s.toString().length+n.toString().length}},Ll=a=>{if(!(!a||!v.value))try{const n=window.getSelection(),s=document.createRange();if(a.type==="element"&&a.element)if(v.value.contains(a.element)){s.setStart(a.element,a.offset),s.collapse(!0),n.removeAllRanges(),n.addRange(s);return}else{v.value.focus();return}let i=0;const c=[v.value];let d=null,u=!1,p=!1;for(;!p&&(d=c.pop());)if(d.nodeType===3){const h=i+d.length;!u&&a.start>=i&&a.start<=h&&(s.setStart(d,a.start-i),u=!0),u&&a.end>=i&&a.end<=h&&(s.setEnd(d,a.end-i),p=!0),i=h}else{let h=d.childNodes.length;for(;h--;)c.push(d.childNodes[h])}n.removeAllRanges(),n.addRange(s)}catch{v.value.focus()}},fn=()=>{if(!v.value)return;v.value.focus();const a=window.getSelection(),n=document.createRange(),s=c=>{if(c.nodeType===3||c.childNodes.length===0)return c;for(let d=c.childNodes.length-1;d>=0;d--){const u=c.childNodes[d],p=s(u);if(p)return p}return c},i=s(v.value);if(i.nodeType===3)n.setStart(i,i.length),n.setEnd(i,i.length);else if(i.childNodes.length>0){const c=s(i);c&&c.nodeType===3?(n.setStart(c,c.length),n.setEnd(c,c.length)):(n.selectNodeContents(i),n.collapse(!1))}else n.setStart(i,0),n.setEnd(i,0);a.removeAllRanges(),a.addRange(n)},Qt=(a=!1)=>{if(!v.value)return;const n=v.value.innerHTML,s=L.title||"",i=L.description||"";if(!a&&n===Dt.value&&s===ne.value&&i===j.value)return;const c={content:Lt.value||Dt.value,title:K.value!==void 0?K.value:ne.value,description:de.value!==void 0?de.value:j.value},d=Ge.value.length>0?Ge.value[Ge.value.length-1]:null;let u=!0;d&&(typeof d=="string"?u=c.content!==d:u=c.content!==d.content||c.title!==d.title||c.description!==d.description),u&&(Ge.value.push(c),Ge.value.length>50&&Ge.value.shift(),Zt.value=[]),Dt.value=n,ne.value=s,j.value=i,Lt.value=n,K.value=s,de.value=i},_t=a=>{if(!v.value)return;Ln(),v.value&&sn(v.value);let n=null;v.value&&(v.value.querySelector("p")||(n=Rt(),En()));const s=a&&a.inputType&&(a.inputType==="insertText"||a.inputType==="insertCompositionText"||a.inputType==="deleteContentBackward"||a.inputType==="deleteContentForward");s&&x.value&&(x.value=null),J.value=!0;const i=v.value.innerHTML.replace(/<!--[\s\S]*?-->/g,"").replace(/ |\u00A0/g," "),c=Il(i);fe("update:modelValue",c),fe("change",c),Ht.value="editor",We.value||(Lt.value=Dt.value,K.value=ne.value,de.value=j.value),Ue.value&&clearTimeout(Ue.value),We.value=!0,Ue.value=setTimeout(()=>{We.value=!1,Qt(),vo(),Fn()},500),e.nextTick(()=>{n&&Ll(n),Ln();const d=["bold","italic","underline"],u=window.getSelection(),p=u.rangeCount>0?u.getRangeAt(0):null,h=p&&p.collapsed;if(d.forEach(k=>{try{if(h&&x.value?.command===k){re.value[k]=x.value.state;return}if(k==="bold")if(p){const D=p.commonAncestorContainer,I=D.nodeType===3?D.parentElement:D;let N=!1;if(I&&((I.tagName==="STRONG"||I.tagName==="B"||I.closest&&I.closest("strong, b"))&&(N=!0),!N&&I.style&&parseInt(I.style.fontWeight)>=600&&(N=!0),!N))try{const se=window.getComputedStyle(I);parseInt(se.fontWeight)>=600&&(N=!0)}catch{}re.value[k]=N}else re.value.hasOwnProperty(k)||(re.value[k]=!1);else if(k==="italic")if(p){const D=p.commonAncestorContainer,I=D.nodeType===3?D.parentElement:D,N=I&&(I.tagName==="EM"||I.tagName==="I"||I.closest&&I.closest("em, i"));re.value[k]=!!N}else{const D=document.queryCommandState(k);re.value[k]=D}else{const D=document.queryCommandState(k);re.value[k]=D}}catch{}}),Tt(),Zl(),Gl(),cl(),rn(),Yl("handleRichTextInput"),s&&(a.inputType==="insertText"||a.inputType==="insertCompositionText")){const k=a.data||"";k&&k.length===1&&setTimeout(()=>Fn(k),0),(k===" "||k===`
|
|
103
|
+
`||/[.,;:!?]/.test(k))&&setTimeout(()=>{vo()},100)}J.value=!1})},Ln=()=>{if(!v.value)return;const a=window.getSelection();if(!a||a.rangeCount===0)return;const n=a.getRangeAt(0),s=n.commonAncestorContainer,i=s.nodeType===3?s.parentElement:s;if(!i)return;const c=i.closest(".dss-image-wrapper");if(c){const d=c.querySelector("img");if(i!==d&&!d?.contains(i)){const u=n.startContainer.nodeType===3?n.startContainer.parentElement:n.startContainer,p=n.endContainer.nodeType===3?n.endContainer.parentElement:n.endContainer;if(c.contains(u)&&u!==d||c.contains(p)&&p!==d){const h=document.createRange();h.setStartAfter(c),h.collapse(!0),a.removeAllRanges(),a.addRange(h)}}}},En=()=>{if(!v.value)return;const a=v.value;if(a.querySelector&&a.querySelector("p"))return;const n=new Set(["P","H1","H2","H3","H4","H5","H6","BLOCKQUOTE","UL","OL","DIV"]),s=Array.from(a.childNodes);let i=null;s.forEach(c=>{if(c.nodeType===Node.TEXT_NODE){if((c.textContent||"").trim()===""){c.parentNode===a&&a.removeChild(c);return}i||(i=document.createElement("p"),a.insertBefore(i,c)),i.appendChild(c);return}if(c.nodeType===Node.ELEMENT_NODE){const d=c,u=d.tagName;if(u==="BR"){i=null;return}if(n.has(u)){i=null;return}i||(i=document.createElement("p"),a.insertBefore(i,d)),i.appendChild(d)}})},Zl=()=>{if(v.value&&!jt.value){jt.value=!0;try{v.value.querySelectorAll(".dss-image-wrapper").forEach(i=>{i.querySelector("img")||i.remove()}),v.value.querySelectorAll(".dss-image-no-alt-icon").forEach(i=>{const c=i.parentElement;!c||!c.classList.contains("dss-image-wrapper")?i.remove():c.querySelector("img")||i.remove()}),v.value.querySelectorAll("img").forEach(i=>{let c=i.getAttribute("alt");c===null&&(c=i.alt||"");const d=i.getAttribute("src")||i.src||"";if(c){const k=d.replace(/^https?:\/\//,"").replace(/^data:.*,/,""),D=c===d||c===k;(c.startsWith("http://")||c.startsWith("https://")||c.startsWith("data:")||D||D)&&(c="")}i.setAttribute("alt",c),i.setAttribute("data-alt",c);const u=!c||c.trim()==="";let p=i.parentElement;const h=p&&p.classList.contains("dss-image-wrapper");if(h){const k=p.querySelector(".dss-image-no-alt-icon");k&&k.remove()}else{const k=i.nextElementSibling?.classList.contains("dss-image-no-alt-icon")?i.nextElementSibling:null;k&&k.remove()}if(u){h?p.setAttribute("contenteditable","false"):(p=document.createElement("span"),p.className="dss-image-wrapper",p.setAttribute("contenteditable","false"),i.parentNode.insertBefore(p,i),p.appendChild(i));const k=document.createElement("div");k.className="dss-image-no-alt-icon",k.setAttribute("contenteditable","false"),k.innerHTML=ee,p.appendChild(k)}else if(h&&p.children.length===1){const k=p.parentNode;k.insertBefore(i,p),k.removeChild(p)}})}finally{jt.value=!1}}},vn=a=>{vo(),fe("blur",a),Bn()},hn=()=>{if(L.disabled||!L.richText||!v.value)return;nl(),Ue.value&&(clearTimeout(Ue.value),Ue.value=null),We.value&&(Qt(),We.value=!1);const a=Ht.value==="title",n=Ht.value==="description",s=Ht.value==="editor";if(Ge.value.length===0){a&&xe.value?xe.value.focus():n&&Ke.value?Ke.value.focus():v.value.focus(),document.execCommand("undo",!1),e.nextTick(()=>{_t()});return}const i={content:v.value.innerHTML,title:L.title||"",description:L.description||""};Zt.value.push(i);const c=Ge.value.pop();if(c!==void 0){J.value=!0;const d=typeof c=="string"?c:c.content,u=typeof c=="object"&&c.title||"",p=typeof c=="object"&&c.description||"";v.value.innerHTML=d,Dt.value=d,ne.value=u,j.value=p,Lt.value=d,K.value=u,de.value=p,e.nextTick(()=>{Tt(),El(),yn(),cl();const h=Il(d);fe("update:modelValue",h),fe("update:title",u),fe("update:description",p),fe("change",h),fe("title-change",u),fe("description-change",p),J.value=!1,e.nextTick(()=>{setTimeout(()=>{if(a){if(xe.value){xe.value.focus();const k=u.length;xe.value.setSelectionRange&&xe.value.setSelectionRange(k,k),le()}}else if(n){if(Ke.value){Ke.value.focus();const k=p.length;Ke.value.setSelectionRange(k,k)}}else if(s)fn();else if(xe.value&&document.activeElement===xe.value){const k=u.length;xe.value.setSelectionRange&&xe.value.setSelectionRange(k,k),le()}else if(Ke.value&&document.activeElement===Ke.value){const k=p.length;Ke.value.setSelectionRange(k,k)}else v.value&&fn()},10)})})}},An=()=>{if(L.disabled||!L.richText||!v.value)return;nl();const a=Ht.value==="title",n=Ht.value==="description",s=Ht.value==="editor";if(Zt.value.length===0){a&&xe.value?xe.value.focus():n&&Ke.value?Ke.value.focus():v.value.focus(),document.execCommand("redo",!1),e.nextTick(()=>{_t()});return}const i={content:v.value.innerHTML,title:L.title||"",description:L.description||""};Ge.value.push(i);const c=Zt.value.pop();if(c!==void 0){J.value=!0;const d=typeof c=="string"?c:c.content,u=typeof c=="object"&&c.title||"",p=typeof c=="object"&&c.description||"";v.value.innerHTML=d,Dt.value=d,ne.value=u,j.value=p,Lt.value=d,K.value=u,de.value=p,e.nextTick(()=>{Tt(),El(),yn(),cl();const h=Il(d);fe("update:modelValue",h),fe("update:title",u),fe("update:description",p),fe("change",h),fe("title-change",u),fe("description-change",p),J.value=!1,e.nextTick(()=>{setTimeout(()=>{if(a){if(xe.value){xe.value.focus();const k=u.length;xe.value.setSelectionRange&&xe.value.setSelectionRange(k,k),le()}}else if(n){if(Ke.value){Ke.value.focus();const k=p.length;Ke.value.setSelectionRange(k,k)}}else if(s)fn();else if(xe.value&&document.activeElement===xe.value){const k=u.length;xe.value.setSelectionRange&&xe.value.setSelectionRange(k,k),le()}else if(Ke.value&&document.activeElement===Ke.value){const k=p.length;Ke.value.setSelectionRange(k,k)}else v.value&&fn()},10)})})}},Tn=()=>{if(!v.value)return;v.value.querySelectorAll('span[style*="font-weight"]').forEach(i=>{const c=i.style.fontWeight;if(c==="normal"||c==="400"){const d=document.createDocumentFragment();for(;i.firstChild;)d.appendChild(i.firstChild);i.parentNode&&i.parentNode.replaceChild(d,i)}}),v.value.querySelectorAll('span[style*="font-weight"]').forEach(i=>{if(parseInt(i.style.fontWeight)>=600){const d=document.createElement("b");for(d.style.fontWeight="600";i.firstChild;)d.appendChild(i.firstChild);i.parentNode&&i.parentNode.replaceChild(d,i)}}),v.value.querySelectorAll("b, strong").forEach(i=>{i.style.fontWeight="600"})},Gl=()=>{if(!v.value)return;v.value.querySelectorAll("i, em").forEach(n=>{n.style.fontStyle="italic"})},ll=()=>{const a=window.getSelection();if(!a||a.rangeCount===0)return!1;const n=a.getRangeAt(0);let s=!1;if(n.collapsed){const i=n.startContainer;let c=i.nodeType===3?i.parentElement:i;for(;c&&c!==v.value;){if(c.tagName==="EM"||c.tagName==="I"){s=!0;break}if(c.style&&c.style.fontStyle==="italic"){s=!0;break}c=c.parentElement}}else{const i=n.commonAncestorContainer.nodeType===1?n.commonAncestorContainer:n.commonAncestorContainer.parentNode;if(i){const c=document.createTreeWalker(i,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let d;for(;d=c.nextNode();)if(!(typeof n.intersectsNode=="function"&&!n.intersectsNode(d))){if(d.nodeType===3){let u=d.parentElement;for(;u&&u!==v.value;){if(u.tagName==="EM"||u.tagName==="I"){s=!0;break}if(u.style&&u.style.fontStyle==="italic"){s=!0;break}u=u.parentElement}}else if(d.nodeType===1){const u=d;if(u.tagName==="EM"||u.tagName==="I"){s=!0;break}if(u.style&&u.style.fontStyle==="italic"){s=!0;break}}if(s)break}}}if(s)return document.execCommand("italic",!1),e.nextTick(()=>{Gl()}),!1;if(n.collapsed)document.execCommand("italic",!1),e.nextTick(()=>{Gl()});else try{const i=n.extractContents(),c=document.createElement("em");c.style.fontStyle="italic",c.appendChild(i),n.insertNode(c),n.setStartAfter(c),n.collapse(!0),a.removeAllRanges(),a.addRange(n),e.nextTick(()=>{Gl()})}catch{document.execCommand("italic",!1),e.nextTick(()=>{Gl()})}return!0},Xn=()=>{const a=window.getSelection();if(!a||a.rangeCount===0)return!1;const n=a.getRangeAt(0);let s=!1;if(n.collapsed){const i=n.startContainer;let c=i.nodeType===3?i.parentElement:i;for(;c&&c!==v.value;){if(c.tagName==="STRONG"||c.tagName==="B"){s=!0;break}if(c.style&&parseInt(c.style.fontWeight)>=600){s=!0;break}c=c.parentElement}}else{const i=n.commonAncestorContainer.nodeType===1?n.commonAncestorContainer:n.commonAncestorContainer.parentNode;if(i){const c=document.createTreeWalker(i,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let d;for(;d=c.nextNode();)if(!(typeof n.intersectsNode=="function"&&!n.intersectsNode(d))){if(d.nodeType===3){let u=d.parentElement;for(;u&&u!==v.value;){if(u.tagName==="STRONG"||u.tagName==="B"){s=!0;break}if(u.style&&parseInt(u.style.fontWeight)>=600){s=!0;break}u=u.parentElement}}else if(d.nodeType===1){const u=d;if(u.tagName==="STRONG"||u.tagName==="B"){s=!0;break}if(u.style&&parseInt(u.style.fontWeight)>=600){s=!0;break}}if(s)break}}}if(s)return document.execCommand("bold",!1),e.nextTick(()=>{Tn()}),!1;if(n.collapsed)document.execCommand("bold",!1),e.nextTick(()=>{const i=window.getSelection();if(i.rangeCount>0){const c=i.getRangeAt(0),d=c.startContainer;let u=d.nodeType===3?d.parentElement:d;for(;u&&u!==v.value;){if(u.tagName==="SPAN"&&u.style.fontWeight){const p=u.style.fontWeight;if(p==="normal"||p==="400"){const h=document.createElement("b");h.style.fontWeight="600";const k=document.createDocumentFragment();for(;u.firstChild;)k.appendChild(u.firstChild);h.appendChild(k),u.parentNode&&u.parentNode.replaceChild(h,u),c.setStart(h,0),c.collapse(!0),i.removeAllRanges(),i.addRange(c);break}}else if(u.tagName==="STRONG"||u.tagName==="B"){u.style.fontWeight="600";break}u=u.parentElement}if(!u||u===v.value){const p=document.createElement("b");p.style.fontWeight="600",p.innerHTML="<br>",c.insertNode(p),c.setStart(p,0),c.collapse(!0),i.removeAllRanges(),i.addRange(c)}}Tn()});else try{const i=n.extractContents(),c=document.createElement("b");c.style.fontWeight="600",c.appendChild(i),n.insertNode(c),n.setStartAfter(c),n.collapse(!0),a.removeAllRanges(),a.addRange(n),e.nextTick(()=>{Tn()})}catch{document.execCommand("bold",!1),e.nextTick(()=>{Tn()})}return!0},Ql=(a,n=null)=>{if(L.disabled||!L.richText||!v.value)return;We.value?(Ue.value&&(clearTimeout(Ue.value),Ue.value=null),Qt(),We.value=!1):Qt(),nl(),v.value.focus();const s=window.getSelection();let i=null;if(s&&s.rangeCount>0){const d=s.getRangeAt(0);!d.collapsed&&Nn(d)&&(i=Rt())}if(a==="createLink"&&n){const d=window.getSelection();if(d.rangeCount>0){const u=d.getRangeAt(0);if(u.collapsed)try{u.expand("word")}catch{const h=document.createTextNode(n);u.insertNode(h),u.selectNodeContents(h)}}}if(a==="bold"){const d=Xn();re.value.bold=d;const u=window.getSelection();u.rangeCount>0&&u.getRangeAt(0).collapsed&&(x.value={command:"bold",state:d}),e.nextTick(()=>{i&&(Ll(i),e.nextTick(()=>{const p=Jt("bold");re.value.bold=p})),_t(),El(),cl()});return}if(a==="italic"){const d=ll();re.value.italic=d;const u=window.getSelection();u.rangeCount>0&&u.getRangeAt(0).collapsed&&(x.value={command:"italic",state:d}),e.nextTick(()=>{i&&(Ll(i),e.nextTick(()=>{const p=Jt("italic");re.value.italic=p})),_t(),Gl(),El(),cl()});return}let c=!1;try{c=document.execCommand(a,!1,n)}catch{}e.nextTick(()=>{if(i&&Ll(i),["bold","italic","underline"].includes(a))try{if(a==="bold")i&&e.nextTick(()=>{const u=Jt("bold");re.value.bold=u});else if(a==="italic")if(i)e.nextTick(()=>{const u=Jt("italic");re.value.italic=u});else{const u=document.queryCommandState(a);re.value[a]=u}else{const u=document.queryCommandState(a);re.value[a]=u}}catch{re.value.hasOwnProperty(a)?re.value[a]=!re.value[a]:re.value[a]=!0}if(a==="createLink"&&n){const u=window.getSelection();if(u.rangeCount>0){const h=u.getRangeAt(0),k=h.commonAncestorContainer.nodeType===1?h.commonAncestorContainer.closest("a"):h.commonAncestorContainer.parentElement?.closest("a");k&&(!k.getAttribute("href")||k.getAttribute("href")==="")&&k.setAttribute("href",n)}v.value.querySelectorAll("a").forEach(h=>{const k=h.getAttribute("href");(!k||k===""||k==="#")&&h.setAttribute("href",n)})}_t(),El(),cl()})},Jt=(a,n=null)=>{if(L.disabled||!v.value)return!1;try{if(a==="formatBlock"&&n){const i=document.queryCommandValue("formatBlock");if(n==="<blockquote>"){const c=i.toLowerCase();if(c==="blockquote"||c==="<blockquote>")return!0;const d=window.getSelection();if(d.rangeCount>0){const p=d.getRangeAt(0).commonAncestorContainer;return!!(p.nodeType===1?p.tagName==="BLOCKQUOTE"?p:p.closest("blockquote"):p.parentElement?.closest("blockquote"))}}return i===n||i.toLowerCase()===n.toLowerCase()}if(["bold","italic","underline"].includes(a))try{const i=window.getSelection();if(i.rangeCount>0){const c=i.getRangeAt(0);if(a==="bold"){let u=!1;if(c.collapsed){const p=c.commonAncestorContainer,h=p.nodeType===3?p.parentElement:p;if(h&&((h.tagName==="STRONG"||h.tagName==="B"||h.closest&&h.closest("strong, b"))&&(u=!0),!u&&h.style&&parseInt(h.style.fontWeight)>=600&&(u=!0),!u))try{const k=window.getComputedStyle(h);parseInt(k.fontWeight)>=600&&(u=!0)}catch{}return re.value.hasOwnProperty(a)?re.value[a]:(re.value[a]=u,u)}else{const p=c.commonAncestorContainer.nodeType===1?c.commonAncestorContainer:c.commonAncestorContainer.parentNode;let h=!1;if(p){const k=document.createTreeWalker(p,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let D;for(;D=k.nextNode();)if(!(typeof c.intersectsNode=="function"&&!c.intersectsNode(D))){if(D.nodeType===3){if(!(D.textContent||"").trim())continue;h=!0;let N=D.parentElement;for(;N&&N!==v.value;){if(N.tagName==="STRONG"||N.tagName==="B"){u=!0;break}if(N.style&&parseInt(N.style.fontWeight)>=600){u=!0;break}N=N.parentElement}}else if(D.nodeType===1){const I=D;if(I.tagName==="STRONG"||I.tagName==="B"){u=!0;break}if(I.style&&parseInt(I.style.fontWeight)>=600){u=!0;break}}if(u)break}}return re.value[a]=u&&h,u&&h}}if(a==="italic"){let u=!1;if(c.collapsed){const p=c.commonAncestorContainer,h=p.nodeType===3?p.parentElement:p;if(h&&((h.tagName==="EM"||h.tagName==="I"||h.closest&&h.closest("em, i"))&&(u=!0),!u&&h.style&&h.style.fontStyle==="italic"&&(u=!0),!u))try{window.getComputedStyle(h).fontStyle==="italic"&&(u=!0)}catch{}return re.value.hasOwnProperty(a)?re.value[a]:(re.value[a]=u,u)}else{const p=c.commonAncestorContainer.nodeType===1?c.commonAncestorContainer:c.commonAncestorContainer.parentNode;let h=!1;if(p){const k=document.createTreeWalker(p,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let D;for(;D=k.nextNode();)if(!(typeof c.intersectsNode=="function"&&!c.intersectsNode(D))){if(D.nodeType===3){if(!(D.textContent||"").trim())continue;h=!0;let N=D.parentElement;for(;N&&N!==v.value;){if(N.tagName==="EM"||N.tagName==="I"){u=!0;break}if(N.style&&N.style.fontStyle==="italic"){u=!0;break}N=N.parentElement}}else if(D.nodeType===1){const I=D;if(I.tagName==="EM"||I.tagName==="I"){u=!0;break}if(I.style&&I.style.fontStyle==="italic"){u=!0;break}}if(u)break}}return re.value[a]=u&&h,u&&h}}const d=document.queryCommandState(a);return c.collapsed&&re.value.hasOwnProperty(a)?re.value[a]:(re.value[a]=d,d)}return re.value.hasOwnProperty(a)?re.value[a]:!1}catch{return re.value.hasOwnProperty(a)?re.value[a]:!1}try{return document.queryCommandState(a)}catch{return!1}}catch{return!1}},Dn=a=>{L.disabled||!L.richText||(be.value=be.value===a?null:a,a==="askAi"&&(ut.value=null))},nl=()=>{be.value=null,Xe.value=null},zl=a=>{Ql("formatBlock",a),nl()},On=a=>{if(!a||!v.value)return a;const n=Be=>{let _e=Be.nodeType===Node.TEXT_NODE?Be.parentElement:Be;for(;_e&&_e!==v.value;){const He=_e.tagName;if(He==="P"){const Sl=_e.parentElement;if(Sl===v.value||Sl.tagName==="BLOCKQUOTE")return _e}if(He==="BLOCKQUOTE")break;_e=_e.parentElement}return null},s=n(a.startContainer),i=n(a.endContainer);if(!s||!i)return a;const c=[],d=document.createTreeWalker(v.value,NodeFilter.SHOW_ELEMENT,{acceptNode:Be=>{const _e=Be.tagName;if(_e==="P"){const He=Be.parentElement;if(He===v.value||He.tagName==="BLOCKQUOTE")return NodeFilter.FILTER_ACCEPT}return _e==="BLOCKQUOTE"?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_SKIP}});let u;for(;u=d.nextNode();)c.push(u);const p=c.indexOf(s),h=c.indexOf(i);if(p===-1||h===-1)return a;const k=Math.min(p,h),D=Math.max(p,h),I=c.slice(k,D+1);if(I.length===0)return a;const N=I[0],se=I[I.length-1],Q=document.createRange();return Q.setStartBefore(N),Q.setEndAfter(se),Q},zt=()=>{if(L.disabled||!L.richText||!v.value)return;We.value?(Ue.value&&(clearTimeout(Ue.value),Ue.value=null),Qt(),We.value=!1):Qt(),nl(),v.value.focus();const a=window.getSelection();if(a.rangeCount===0)return;let n=a.getRangeAt(0);!n.collapsed&&Nn(n)&&(n=On(n),a.removeAllRanges(),a.addRange(n));let s=null;!n.collapsed&&Nn(n)&&(s=Rt());const i=n.commonAncestorContainer,c=i.nodeType===1?i.tagName==="BLOCKQUOTE"?i:i.closest("blockquote"):i.parentElement?.closest("blockquote");if(!!(c&&v.value.contains(c))){if(c){const u=c.parentNode;Array.from(c.childNodes).forEach(h=>{if(h.nodeType===Node.ELEMENT_NODE)if(h.tagName==="P"||h.tagName==="DIV")u.insertBefore(h,c);else{const k=document.createElement("p");k.appendChild(h.cloneNode(!0)),u.insertBefore(k,c)}else if(h.nodeType===Node.TEXT_NODE&&h.textContent.trim()){const k=document.createElement("p");k.appendChild(h.cloneNode(!0)),u.insertBefore(k,c)}}),c.remove()}}else if(n.collapsed)document.execCommand("formatBlock",!1,"<blockquote>");else{const u=document.createElement("blockquote"),p=n.extractContents();u.appendChild(p),n.insertNode(u);const h=[],k=document.createTreeWalker(u,NodeFilter.SHOW_TEXT,{acceptNode:N=>N.parentNode===u&&N.textContent.trim()?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});let D;for(;D=k.nextNode();)h.push(D);if(h.forEach(N=>{const se=document.createElement("p");N.parentNode.insertBefore(se,N),se.appendChild(N)}),u.querySelectorAll("p, div").forEach(N=>{N.textContent.trim()===""&&!N.querySelector("img")&&(N.innerHTML="<br>")}),u.children.length===0&&u.textContent.trim()===""){const N=document.createElement("p");N.innerHTML="<br>",u.appendChild(N)}}e.nextTick(()=>{s&&Ll(s),yn(),_t(),cl()})},Me=()=>{if(!v.value)return;const a=window.getSelection();if(a.rangeCount===0)return;const s=a.getRangeAt(0).commonAncestorContainer,i=s.nodeType===1?s.tagName==="BLOCKQUOTE"?s:s.closest("blockquote"):s.parentElement?.closest("blockquote");if(!i||!v.value.contains(i))return;const c=D=>{if(!D)return!1;const I=D.textContent||"",se=(D.innerHTML||"").trim();return I.trim()===""||se===""||se==="<br>"||se==="<br/>"||se==="<p></p>"||se==="<p><br></p>"||se==="<p><br/></p>"||se==="<p> </p>"||se==="<p><br> </p>"||se==="<div></div>"||se==="<div><br></div>"||se==="<div><br/></div>"};let d=null;for(s.nodeType===3?d=s.parentElement:s.tagName==="P"||s.tagName==="DIV"?d=s:d=s.closest("p, div"),d&&i.contains(d)&&c(d)&&d.remove();i.lastChild;){const D=i.lastChild;if(D.nodeType===1&&D.tagName==="BR")D.remove();else if(D.nodeType===3)if((D.textContent||"").trim()==="")D.remove();else break;else break}if(i.children.length>0)for(let D=i.children.length-1;D>=0;D--){const I=i.children[D];if((I.tagName==="P"||I.tagName==="DIV")&&c(I))I.remove();else break}let u=i.innerHTML;const p=u;u=u.replace(/(<br\s*\/?>)+$/gi,""),u!==p&&(i.innerHTML=u);const h=document.createElement("p");h.innerHTML="<br>",i.parentNode?i.nextSibling?i.parentNode.insertBefore(h,i.nextSibling):i.parentNode.appendChild(h):v.value&&v.value.appendChild(h);const k=document.createRange();k.selectNodeContents(h),k.collapse(!0),a.removeAllRanges(),a.addRange(k),e.nextTick(()=>{yn(),_t()})},El=()=>{if(!v.value){ke.value=!1;return}try{const a=window.getSelection();if(a.rangeCount>0){const s=a.getRangeAt(0).commonAncestorContainer,i=s.nodeType===1?s.closest("a"):s.parentElement?.closest("a");ke.value=!!i}else ke.value=!1}catch{ke.value=!1}},kt=()=>{if(!v.value)return;const a=window.getSelection();a&&a.rangeCount>0&&a.getRangeAt(0),Ve.value=Rt();const n=window.getSelection();let s="";n.rangeCount>0&&(s=n.getRangeAt(0).toString()),tt.value="",mt.value=s,Le.value="",qe.value=null,$e.value=!0,nl(),e.nextTick(()=>{U.value&&U.value.focus()})},Ml=()=>{if(!v.value)return;We.value?(Ue.value&&(clearTimeout(Ue.value),Ue.value=null),Qt(),We.value=!1):Qt();const a=window.getSelection();let n=null;if(a.rangeCount>0){const i=a.getRangeAt(0).commonAncestorContainer;n=i.nodeType===1?i.closest("a"):i.parentElement?.closest("a")}if(!n&&qe.value&&(n=qe.value),n&&n.parentNode){const s=document.createDocumentFragment();for(;n.firstChild;)s.appendChild(n.firstChild);if(n.parentNode.replaceChild(s,n),s.firstChild){const i=document.createRange();i.setStartBefore(s.firstChild),i.setEndAfter(s.lastChild||s.firstChild),a.removeAllRanges(),a.addRange(i),document.execCommand("removeFormat",!1),i.collapse(!1),a.removeAllRanges(),a.addRange(i)}qe.value=null}else Ql("unlink");ke.value=!1,nl(),e.nextTick(()=>{_t(),El()})},nt=()=>{L.disabled||!L.richText||v.value&&(We.value?(Ue.value&&(clearTimeout(Ue.value),Ue.value=null),Qt(),We.value=!1):Qt(),nl(),v.value.focus(),document.execCommand("insertUnorderedList",!1),e.nextTick(()=>{Tt(),_t(),cl()}))},ft=()=>{L.disabled||!L.richText||v.value&&(We.value?(Ue.value&&(clearTimeout(Ue.value),Ue.value=null),Qt(),We.value=!1):Qt(),nl(),v.value.focus(),document.execCommand("insertOrderedList",!1),e.nextTick(()=>{Tt(),_t(),cl()}))},ie=a=>{const n=a.parentElement;if(!n||n.tagName!=="OL")return null;let s=0,i=a.previousElementSibling;for(;i;)i.tagName==="LI"&&s++,i=i.previousElementSibling;return s+1},Tt=()=>{if(!v.value)return;v.value.querySelectorAll("li > ol").forEach(n=>{const s=n.parentElement;if(s&&s.tagName==="LI"){const i=ie(s);i!==null&&Array.from(n.children).filter(d=>d.tagName==="LI").forEach(d=>{d.setAttribute("data-parent-num",String(i))})}})},De=()=>{if(L.disabled||!L.richText||!v.value)return;nl(),v.value.focus();const a=window.getSelection();if(a.rangeCount===0)return;const n=a.getRangeAt(0),s=n.commonAncestorContainer.nodeType===1?n.commonAncestorContainer.closest("li"):n.commonAncestorContainer.parentElement?.closest("li");if(!s){document.execCommand("indent",!1),e.nextTick(()=>{Tt(),_t()});return}const i=s.parentElement;if(!i||i.tagName!=="OL"&&i.tagName!=="UL")return;const c=s.previousElementSibling;if(c&&c.tagName==="LI"){const d=i.tagName.toLowerCase();let u=c.querySelector(`:scope > ${d}`);u||(u=document.createElement(d),c.appendChild(u));const p=ie(c);u.appendChild(s),p!==null&&i.tagName==="OL"&&s.setAttribute("data-parent-num",String(p)),Tt();const h=document.createRange();h.selectNodeContents(s),h.collapse(!1),a.removeAllRanges(),a.addRange(h),e.nextTick(()=>{_t(),cl()})}else document.execCommand("indent",!1),e.nextTick(()=>{Tt(),_t(),cl()})},Jl=()=>{if(L.disabled||!L.richText||!v.value)return;nl(),v.value.focus();const a=window.getSelection();if(a.rangeCount===0)return;const n=a.getRangeAt(0),s=n.commonAncestorContainer.nodeType===1?n.commonAncestorContainer.closest("li"):n.commonAncestorContainer.parentElement?.closest("li");if(!s){document.execCommand("outdent",!1),e.nextTick(()=>{Tt(),_t()});return}const i=s.parentElement;if(!i||i.tagName!=="OL"&&i.tagName!=="UL")return;const c=i.parentElement;if(c&&c.tagName==="LI"){const d=c.parentElement;if(d&&(d.tagName==="OL"||d.tagName==="UL")){i.tagName==="OL"&&s.removeAttribute("data-parent-num"),d.insertBefore(s,c.nextSibling),i.children.length===0&&i.remove(),Tt();const u=document.createRange();u.selectNodeContents(s),u.collapse(!1),a.removeAllRanges(),a.addRange(u),e.nextTick(()=>{_t(),cl()});return}}document.execCommand("outdent",!1),e.nextTick(()=>{Tt(),_t(),cl()})},Cl=e.ref(null),Al=e.ref(null),y=e.ref({}),g=e.ref(""),w=e.ref(null),Z=e.ref("");e.ref("");const he=e.ref(null);e.ref("");const at=e.ref([]),Bt=e.ref(!1),bl=e.ref(!1),Pl=a=>{if(!a)return"";const n=a.cloneRange(),s=document.createElement("div");return s.appendChild(n.cloneContents()),s.innerHTML},Ul=()=>{if(!L.commentUser||L.disabled||!L.richText||!v.value)return;if(Cl.value!==null){Cl.value=null,g.value="",Z.value="",he.value=null,at.value=[],bn(!0);return}nl(),v.value.focus();const a=window.getSelection();if(!a||a.rangeCount===0)return;const n=a.getRangeAt(0);if(n.collapsed||!Nn(n))return;Z.value=Pl(n)||"",he.value=Rt();const s=n.getBoundingClientRect(),i=v.value.parentElement;if(!i)return;const c=i.getBoundingClientRect(),d=s.bottom-c.top,p=Math.max(d+8,0);y.value={top:`${p}px`,bottom:"auto"},Cl.value=Date.now(),e.nextTick(()=>{if(g.value="",w.value){const k=w.value;k.style.height="auto",k.style.height=`${k.scrollHeight}px`,k.focus()}const h=i.querySelector(".dss-comment-overlay");if(h&&i){const k=i.querySelector(".dss-text-editor-footer");if(k){const D=i.getBoundingClientRect(),I=h.getBoundingClientRect(),N=k.getBoundingClientRect(),se=I.bottom-D.top,Q=N.top-D.top,Be=8;if(se>Q-Be){const _e=N.height;y.value={bottom:`${_e+Be}px`,top:"auto"}}else y.value={top:`${p}px`,bottom:"auto"}}}})},gn=()=>{if(!g.value.trim())return;const a=g.value.trim(),n=new Date,s={text:a,selectionText:Z.value,selectionRange:he.value,commentId:Cl.value,user:L.commentUser||null,createdAt:n.toISOString()};at.value=[...at.value,s],fe("comment-submitted",s),Yo(s),he.value&&!Xo(he.value)&&bo(Cl.value,he.value),g.value="",e.nextTick(()=>{if(w.value){const i=w.value;i.style.height="auto",i.style.height=`${i.scrollHeight}px`,i.focus()}Yl("sendComment")})},mo=(a,n)=>{if(!(!L.commentUser||!a.user||a.user.id!==L.commentUser.id)){if(at.value=at.value.filter((s,i)=>i!==n),Cl.value!==null&&v.value){const s=String(Cl.value),i=v.value.querySelector(`[data-comment="${s}"], [data-fake-comment="${s}"]`);if(i&&at.value.length>0){const c=[],d=new Set;at.value.forEach(u=>{u.user&&u.user.id&&!d.has(u.user.id)&&(d.add(u.user.id),c.push(u.user))}),c.length>0?i.setAttribute("data-comment-user",JSON.stringify(c[0])):i.removeAttribute("data-comment-user"),c.length>1?i.setAttribute("data-comment-user-2",JSON.stringify(c[1])):i.removeAttribute("data-comment-user-2"),i.setAttribute("data-comment-count",String(at.value.length))}else i&&at.value.length===0&&(i.removeAttribute("data-comment-user"),i.removeAttribute("data-comment-user-2"),i.setAttribute("data-comment-count","0"))}if(fe("comment-deleted",{comment:a,index:n,commentId:Cl.value}),L.comments&&Array.isArray(L.comments)){const s=L.comments.filter(i=>!(i.commentId===a.commentId&&i.text===a.text&&i.user?.id===a.user?.id));fe("update:comments",s)}e.nextTick(()=>{Yl("deleteComment")})}},Xo=a=>{if(!a||!v.value)return!1;try{const n=Co(a);if(!n)return!1;const s=n.commonAncestorContainer,i=s.nodeType===3?s.parentElement:s;if(i)return!!i.closest("[data-comment], [data-fake-comment]")}catch{}return!1},Co=a=>{if(!a||!v.value)return null;try{const n=document.createRange();if(a.type==="element"&&a.element)return v.value.contains(a.element)?(n.setStart(a.element,a.offset),n.collapse(!0),n):null;let s=0;const i=[v.value];let c=null,d=!1,u=!1;for(;!u&&(c=i.pop());)if(c.nodeType===3){const p=s+c.length;!d&&a.start>=s&&a.start<=p&&(n.setStart(c,a.start-s),d=!0),d&&a.end>=s&&a.end<=p&&(n.setEnd(c,a.end-s),u=!0),s=p}else{let p=c.childNodes.length;for(;p--;)i.push(c.childNodes[p])}return d?n:null}catch{return null}},bo=(a,n)=>{if(!(!a||!n||!v.value))try{const s=Co(n);if(!s||s.collapsed)return;const i=s.commonAncestorContainer,c=i.nodeType===3?i.parentElement:i;if(c){const p=c.closest("[data-comment], [data-fake-comment]");if(p){p.getAttribute("data-comment")!==String(a)&&p.getAttribute("data-fake-comment")!==String(a)&&p.setAttribute("data-comment",String(a));return}}const d=document.createElement("span");d.setAttribute("data-comment",String(a));try{const p=s.startContainer,h=s.endContainer,k=s.startOffset,D=s.endOffset,I=p.nodeType===3?p.parentNode:p,N=h.nodeType===3?h.parentNode:h;if(I===N&&k===0&&D===(h.nodeType===3?h.length:N.childNodes.length)&&(I.tagName==="P"||I.tagName==="DIV"||I.tagName==="H1"||I.tagName==="H2"||I.tagName==="H3"||I.tagName==="H4"||I.tagName==="H5"||I.tagName==="H6")){const Q=s.extractContents();d.appendChild(Q),s.insertNode(d)}else s.surroundContents(d)}catch{const h=s.extractContents();d.appendChild(h),s.insertNode(d)}const u=v.value.querySelector(`[data-comment="${String(a)}"]`);e.nextTick(()=>{Yl("wrapSelectionWithCommentMarker"),_t()})}catch{}},Yo=a=>{if(!a||!a.commentId)return;const n=Array.isArray(L.comments)?[...L.comments]:[],s=typeof a.commentId=="string"&&a.commentId.startsWith("comment-")?Date.now():Number(a.commentId)||a.commentId;let i=n.findIndex(d=>typeof d.conversation_id=="string"&&d.conversation_id.startsWith("comment-")?null:Number(d.conversation_id)===Number(s)||d.conversation_id===s);const c={text:a.text,user:a.user,createdAt:a.createdAt,created_at:a.createdAt,updated_at:a.createdAt};if(i>=0){const d=n[i];if(d.conversation||(d.conversation=[]),d.conversation.push(c),d.updated_at=a.createdAt,!d.article_id&&n.length>0){const u=n.find(p=>p.article_id);u&&(d.article_id=u.article_id)}}else{const d=a.selectionRange,u=n.length>0&&n.find(h=>h.article_id)?.article_id||null,p={conversation_id:s,article_id:u,selection_range:d?{start:d.start||0,end:d.end||0,type:d.type||"text"}:null,selection_text:a.selectionText||"",conversation:[c],created_by_user:a.user,created_at:a.createdAt,updated_at:a.createdAt,status:"active"};n.push(p)}Bt.value=!0,fe("update:comments",n)},Sn=(a,n=[])=>{if(!L.commentUser||L.disabled||!L.richText||!v.value)return;const s=v.value;let i=null;try{i=s.querySelector(a)}catch{return}if(!i)return;nl(),s.focus();const c=document.createRange();c.selectNodeContents(i);const d=window.getSelection();d&&(d.removeAllRanges(),d.addRange(c)),Z.value=i.innerHTML||"",he.value=Rt();const u=c.getBoundingClientRect(),p=s.parentElement;if(p){const D=p.getBoundingClientRect(),I=u.bottom-D.top,se=Math.max(I+8,0);y.value={top:`${se}px`,bottom:"auto"}}const h=i.getAttribute("data-comment")||i.getAttribute("data-fake-comment");let k=[];if(h&&L.comments&&Array.isArray(L.comments)){const D=L.comments.find(I=>String(I.conversation_id)===String(h));if(D&&D.conversation&&Array.isArray(D.conversation)){const I=D.conversation.map(N=>({id:N.id||N.commentary_id,commentary_id:N.id||N.commentary_id,conversation_id:D.id||D.conversation_id,text:N.text,user:N.user,createdAt:N.created_at||N.createdAt,updated_at:N.updated_at||N.updatedAt}));k.push(...I)}}k.length===0&&Array.isArray(n)&&n.length>0&&(k=n.slice()),k.sort((D,I)=>{const N=Be=>{if(!Be)return 0;const _e=new Date(Be).getTime();return isNaN(_e)?0:_e},se=N(D.createdAt),Q=N(I.createdAt);return se===Q?0:se-Q}),at.value=k,bn(!0),Cl.value=h||null,i&&(Al.value=i,i.classList.add("editor-comment-highlighted")),e.nextTick(()=>{if(g.value="",w.value){const D=w.value;D.style.height="auto",D.style.height=`${D.scrollHeight}px`,D.focus()}if(p){const D=p.querySelector(".dss-comment-overlay");if(D){const I=p.querySelector(".dss-text-editor-footer");if(I){const N=p.getBoundingClientRect(),se=D.getBoundingClientRect(),Q=I.getBoundingClientRect(),Be=se.bottom-N.top,_e=Q.top-N.top,He=8;if(Be>_e-He){const Sl=Q.height;y.value={bottom:`${Sl+He}px`,top:"auto"}}}}}Yl("openCommentOverlayForSelector")})},po=e.ref(null),xo=e.ref(0),jo=a=>{if(!(L.disabled||!L.richText)){if(a.key==="Escape"){const n=window.getSelection();if(n.rangeCount>0){const i=n.getRangeAt(0).commonAncestorContainer,c=i.nodeType===1?i.tagName==="BLOCKQUOTE"?i:i.closest("blockquote"):i.parentElement?.closest("blockquote");if(!!(c&&v.value&&v.value.contains(c))){a.preventDefault();let u=null;i.nodeType===3?u=i.parentElement:i.tagName==="P"||i.tagName==="DIV"?u=i:u=i.closest("p, div");const p=document.createElement("p");p.innerHTML="<br>",u&&c.contains(u)&&u.nextSibling?c.insertBefore(p,u.nextSibling):c.appendChild(p),setTimeout(()=>{Me()},50);return}}}if(a.key.length===1||a.key==="Enter"){const n=window.getSelection();if(n&&n.rangeCount>0){const s=n.getRangeAt(0),i=s.commonAncestorContainer,c=i.nodeType===3?i.parentElement:i;if(c){const d=c.closest(".dss-image-wrapper");if(d){const u=d.querySelector("img");if(c!==u&&!u?.contains(c)){const p=s.startContainer.nodeType===3?s.startContainer.parentElement:s.startContainer,h=s.endContainer.nodeType===3?s.endContainer.parentElement:s.endContainer;if(d.contains(p)&&p!==u||d.contains(h)&&h!==u){a.preventDefault();const k=document.createRange();k.setStartAfter(d),k.collapse(!0),n.removeAllRanges(),n.addRange(k);return}}}}}}if(a.key==="Backspace"||a.key==="Delete"){const n=window.getSelection();if(n.rangeCount>0){const s=n.getRangeAt(0);let i=null,c=null;if(s.collapsed)if(a.key==="Backspace"){const d=s.startContainer;let u=d;d.nodeType===3&&(s.startOffset===0?u=d.previousSibling||d.parentNode:u=d.parentNode);const p=u.previousSibling;p&&(p.classList&&p.classList.contains("dss-image-wrapper")?c=p:p.tagName==="IMG"&&(i=p,c=i.closest(".dss-image-wrapper"))),c||(c=u.closest(".dss-image-wrapper"),c&&(i=c.querySelector("img")))}else{const d=s.startContainer;let u=d;d.nodeType===3&&(s.startOffset===d.length?u=d.nextSibling||d.parentNode:u=d.parentNode);const p=u.nextSibling;p&&(p.classList&&p.classList.contains("dss-image-wrapper")?c=p:p.tagName==="IMG"&&(i=p,c=i.closest(".dss-image-wrapper"))),c||(c=u.closest(".dss-image-wrapper"),c&&(i=c.querySelector("img")))}else{const d=s.commonAncestorContainer,u=s.startContainer.nodeType===3?s.startContainer.parentElement:s.startContainer,p=s.endContainer.nodeType===3?s.endContainer.parentElement:s.endContainer;if(d.nodeType===1&&d.tagName==="IMG"?(i=d,c=i.closest(".dss-image-wrapper")):(i=d.querySelector("img"),i&&(c=i.closest(".dss-image-wrapper"))),c){const h=c.contains(u)||u===c,k=c.contains(p)||p===c,I=s.cloneContents().textContent?.trim()||"",N=c.textContent?.trim()||"";(!h||!k||I.length>N.length)&&(c=null,i=null)}}if(c){a.preventDefault(),a.stopPropagation();const d=c.parentNode;if(d){const u=document.createTextNode("");d.insertBefore(u,c),c.remove();const p=document.createRange();p.setStartAfter(u),p.collapse(!0),n.removeAllRanges(),n.addRange(p),e.nextTick(()=>{_t()});return}}}}if(a.key==="Tab"){a.preventDefault(),a.shiftKey?Jl():De();return}if(a.key==="Enter"){const n=window.getSelection();if(n.rangeCount>0){const s=n.getRangeAt(0);if(s.collapsed){const u=s.startContainer,p=h=>{if(!h)return!1;let k=h.previousSibling;for(;k;){if(k.classList&&k.classList.contains("dss-image-wrapper")||k.tagName==="IMG"||k.querySelector&&k.querySelector(".dss-image-wrapper")||k.querySelector&&k.querySelector("img"))return!0;k=k.previousSibling}const D=h.parentElement;return D&&D!==v.value?p(D):!1};if(u.nodeType===3){const h=u.parentElement;if(h&&(p(h)||p(u))){const k=h.closest("p, div");if(k&&k!==v.value){a.preventDefault(),a.stopPropagation();let D=null;const I=s.startOffset;I<u.length&&(D=u.splitText(I));const N=document.createElement("p");if(D?N.appendChild(D):N.innerHTML="<br>",u.length===0){const Q=u.parentElement;Q&&(Q.removeChild(u),Q.childNodes.length===0&&Q.appendChild(document.createElement("br")))}k.nextSibling?k.parentNode.insertBefore(N,k.nextSibling):k.parentNode.appendChild(N);const se=document.createRange();D?se.setStart(D,0):se.setStart(N,0),se.collapse(!0),n.removeAllRanges(),n.addRange(se),e.nextTick(()=>{_t()});return}}}}const i=s.commonAncestorContainer,c=i.nodeType===1?i.tagName==="BLOCKQUOTE"?i:i.closest("blockquote"):i.parentElement?.closest("blockquote");if(!!(c&&v.value&&v.value.contains(c))){let u=null;i.nodeType===3?u=i.parentElement:i.tagName==="P"||i.tagName==="DIV"?u=i:u=i.closest("p, div");const p=Q=>{if(!Q)return!1;const Be=Q.textContent||"",He=(Q.innerHTML||"").trim(),Sl=He.replace(/<br\s*\/?>/gi,"").trim();return Be.trim()===""||He===""||Sl===""||He==="<br>"||He==="<br/>"||He==="<p></p>"||He==="<p><br></p>"||He==="<p><br/></p>"||He==="<p> </p>"||He==="<p><br> </p>"||He==="<div></div>"||He==="<div><br></div>"||He==="<div><br/></div>"},h=c.lastChild,k=h&&h.nodeType===1&&h.tagName==="BR",D=s.startContainer,I=D.nodeType===3?D.parentElement:D,N=I===c||I&&I.parentElement===c;if(u&&p(u)||k&&N){a.preventDefault(),setTimeout(()=>{Me()},50);return}}}}if(a.key===" "){const n=Date.now(),s=n-xo.value;if(po.value===" "&&s<300){const i=window.getSelection();if(i.rangeCount>0){const c=i.getRangeAt(0),d=c.commonAncestorContainer.nodeType===1?c.commonAncestorContainer.closest("li"):c.commonAncestorContainer.parentElement?.closest("li");if(d){const u=c.startContainer.textContent?.substring(0,c.startOffset)||"";if((d.textContent||"").indexOf(u.trim())<=10||u.trim().length<=2){a.preventDefault(),De();return}}}}po.value=" ",xo.value=n}else po.value=a.key}},wo=a=>{if(L.disabled||!L.richText)return;a.preventDefault();let n=a.clipboardData.getData("text/html"),s=a.clipboardData.getData("text/plain");n&&(n=n.replace(/<!--[\s\S]*?-->/g,"")),s&&(s=s.replace(/<!--[\s\S]*?-->/g,"")),Qt();const i=window.getSelection();let c=null;if(i&&i.rangeCount>0){let p=i.getRangeAt(0).commonAncestorContainer;p.nodeType===3&&(p=p.parentNode),c=p.closest("p, h1, h2, h3, h4, h5, h6, li, blockquote")}const d=u=>{const h=new DOMParser().parseFromString(u,"text/html");let k=v.value.querySelector("h1")?1:0;if(h.querySelectorAll("h1").forEach(I=>{if(k>0){const N=h.createElement("p");N.innerHTML=I.innerHTML,I.parentNode.replaceChild(N,I)}else k++}),c){const I=["P","H1","H2","H3","H4","H5","H6","DIV","BLOCKQUOTE","UL","OL","LI"],N=Array.from(h.body.children).filter(se=>I.includes(se.tagName));if(N.length===1){const se=N[0].tagName,Q=c.tagName,Be=c.textContent.trim()===""&&!c.querySelector("img");let _e=!1;if(["H1","H2","H3","H4","H5","H6"].includes(Q)?_e=!0:Be||(se===Q||se==="P")&&(_e=!0),_e)return N[0].innerHTML.trim()}}return h.body.innerHTML.trim()};if(n){const u=d(n);document.execCommand("insertHTML",!1,u)}else if(s)if(/<[a-z][\s\S]*>/i.test(s)){const p=d(s);document.execCommand("insertHTML",!1,p)}else document.execCommand("insertText",!1,s);_t()},Eo=a=>{if(be.value){const s=a.target;!s.closest(".dss-toolbar-dropdown")&&!s.closest(".dss-toolbar-dropdown-toggle")&&nl()}if(Qe.value){const s=a.target,i=s.closest(".dss-floating-toolbar"),c=v.value&&s.closest(".dss-text-editor-content");!i&&!c&&Bn()}if(ut.value){const s=a.target,i=s.closest(".dss-floating-toolbar"),c=s.closest(".dss-toolbar-dropdown");!i&&!c&&Tl()}const n=a.target;if(!n.closest(".dss-toolbar-dropdown")&&!n.closest(".dss-toolbar-dropdown-submenu")&&(Xe.value=null),!v.value||!n.closest(".dss-text-editor-content")){const s=window.getSelection();if(s&&s.rangeCount>0){const i=s.getRangeAt(0);ae.value=!i.collapsed&&Nn(i)}else ae.value=!1}if(Cl.value!==null){const s=document.querySelector(".dss-comment-overlay");let i=!1;if(s){const u=s.getBoundingClientRect(),p=a.clientX,h=a.clientY;i=p>=u.left&&p<=u.right&&h>=u.top&&h<=u.bottom}const c=n.closest(".dss-toolbar-button"),d=c&&c.getAttribute("title")==="Comment";!i&&!d&&(Cl.value=null,g.value="",Z.value="",he.value=null,at.value=[],bn(!0))}},Hn=(a,n)=>{a&&a.stopPropagation&&a.stopPropagation(),Et.value&&(clearTimeout(Et.value),Et.value=null),Xe.value=n},fo=a=>{const n=a.relatedTarget;if(n){const s=n.closest(".dss-toolbar-dropdown-submenu"),i=n.closest(".dss-toolbar-dropdown-item-has-submenu");if(s||i)return}Et.value&&clearTimeout(Et.value),Et.value=setTimeout(()=>{Xe.value=null,Et.value=null},150)},Vn=a=>{Xe.value=null};let Ko=0;const Go=a=>{if(!a)return;const n=Array.from(a.children);n.forEach(s=>{s.classList.contains("dss-toolbar-dropdown-submenu")||s.classList.contains("dss-toolbar-dropdown-item-has-submenu")||(s.tagName==="BUTTON"||s.tagName==="DIV")&&!s.classList.contains("dss-toolbar-dropdown-item")&&s.classList.add("dss-toolbar-dropdown-item")}),n.forEach((s,i)=>{if(s.classList.contains("dss-toolbar-dropdown-item-has-submenu")||s.classList.contains("dss-toolbar-dropdown-submenu")||!s.classList.contains("dss-toolbar-dropdown-item"))return;const c=Array.from(s.children).find(p=>p.tagName==="DIV"?p.classList.contains("dss-toolbar-dropdown-item")?!1:Array.from(p.children).filter(k=>k.tagName==="BUTTON"||k.tagName==="DIV").length>0:!1),d=s.nextElementSibling,u=d&&!d.classList.contains("dss-toolbar-dropdown-submenu")&&!d.classList.contains("dss-toolbar-dropdown-item-has-submenu")&&d.tagName==="DIV"&&!d.classList.contains("dss-toolbar-dropdown-item")&&Array.from(d.children).some(p=>p.tagName==="BUTTON"||p.tagName==="DIV");if(c||u){const p=`submenu-auto-${++Ko}`;s.classList.add("dss-toolbar-dropdown-item-has-submenu"),s.setAttribute("data-submenu-id",p);let h=null;c?(s.tagName==="BUTTON"&&s.parentNode.insertBefore(c,s.nextSibling),c.classList.add("dss-toolbar-dropdown-submenu"),h=c):u&&(d.classList.add("dss-toolbar-dropdown-submenu"),h=d),h&&(h.setAttribute("data-submenu-id",p),h.setAttribute("data-processed","true"),c&&s.tagName!=="BUTTON"?h.dataset.originalParentRef="inside":h.dataset.originalParentRef="sibling",Array.from(h.children).forEach(D=>{(D.tagName==="BUTTON"||D.tagName==="DIV")&&!D.classList.contains("dss-toolbar-dropdown-item")&&D.classList.add("dss-toolbar-dropdown-item")}))}})},So=()=>{document.querySelectorAll(".dss-toolbar-dropdown").forEach(n=>{Go(n),n.querySelectorAll(".dss-toolbar-dropdown-item-has-submenu").forEach(c=>{const d=c._subMenuHandlers;d&&(c.removeEventListener("mouseenter",d.enter),c.removeEventListener("mouseleave",d.leave));const u=h=>{const k=c.getAttribute("data-submenu-id");k&&Hn(h,k)},p=fo;c.addEventListener("mouseenter",u),c.addEventListener("mouseleave",p),c._subMenuHandlers={enter:u,leave:p}}),n.querySelectorAll(".dss-toolbar-dropdown-submenu").forEach(c=>{const d=c._subMenuHandlers;d&&(c.removeEventListener("mouseenter",d.enter),c.removeEventListener("mouseleave",d.leave));const u=k=>{const D=c.getAttribute("data-submenu-id");D&&Hn(k,D)},p=fo;c.addEventListener("mouseenter",u),c.addEventListener("mouseleave",p),c._subMenuHandlers={enter:u,leave:p},c.querySelectorAll(".dss-toolbar-dropdown-item").forEach(k=>{k.addEventListener("click",Vn)})})})};let Rn=null;const Yn=()=>{if(Xe.value){const a=document.querySelector(`.dss-toolbar-dropdown-submenu[data-submenu-id="${Xe.value}"]`),n=document.querySelector(`.dss-toolbar-dropdown-item-has-submenu[data-submenu-id="${Xe.value}"]`);a&&n&&tn(a,n)}if(Qe.value&&cl(),L.richText){if(Rn!==null)return;Rn=setTimeout(()=>{Rn=null,Yl("handleWindowResize")},150)}},jn=()=>{if(!L.richText)return;document.querySelectorAll(".dss-toolbar-custom-group").forEach(n=>{Array.from(n.children).filter(i=>i.tagName==="DIV"&&!i.classList.contains("dss-toolbar-button")).forEach(i=>{i.classList.add("dss-toolbar-button")})})},Qo=()=>{const a=document.querySelectorAll(".dss-text-editor-footer, .dss-text-editor-footer-content, .dss-text-editor-footer-stat, .dss-text-editor-footer-separator"),n=s=>{if(s.preventDefault(),s.stopPropagation(),window.getSelection){const i=window.getSelection();i.removeAllRanges?i.removeAllRanges():i.empty&&i.empty()}return!1};a.forEach(s=>{s.addEventListener("selectstart",n),s.addEventListener("mousedown",n),s.addEventListener("dragstart",n),s.addEventListener("contextmenu",n),s.addEventListener("click",i=>{if(window.getSelection){const c=window.getSelection();c.removeAllRanges&&c.removeAllRanges()}})})};e.onMounted(()=>{if(e.nextTick(()=>{requestAnimationFrame(()=>{vl.value?le():ct(),M.value?st():Gt()})}),e.nextTick(()=>{Qo()}),L.richText&&v.value){try{document.execCommand("defaultParagraphSeparator",!1,"p")}catch{}document.addEventListener("click",Eo),window.addEventListener("resize",Yn);let a=null;const n=()=>{a===null&&(a=setTimeout(()=>{a=null,Yn()},150))};window.addEventListener("scroll",n,!0),v.value._windowScrollHandler=n,v.value._windowScrollTimeout=a,v.value.closest(".editor-with-comments"),v.value.closest(".dss-text-editor-content-wrapper");const s=v.value.closest(".dss-text-editor-content");let i=null;const c=()=>{i===null&&(i=setTimeout(()=>{i=null,Yn()},150))};s&&(s.addEventListener("scroll",c),v.value._scrollHandlers={wrapper:null,content:s,handler:c}),e.nextTick(()=>{So(),jn()}),v.value.addEventListener("click",p=>{const h=p.target;h.closest("a")&&!L.disabled&&p.preventDefault();const D=h.closest(".dss-image-no-alt-icon"),I=h.closest(".dss-image-wrapper");if(D||I&&h===I){p.preventDefault(),p.stopPropagation();const N=window.getSelection(),se=document.createRange();se.setStartAfter(I),se.collapse(!0),N.removeAllRanges(),N.addRange(se)}else I&&h.tagName!=="IMG"&&(p.preventDefault(),e.nextTick(()=>{const N=window.getSelection();if(N.rangeCount>0){const Q=N.getRangeAt(0).commonAncestorContainer,Be=Q.nodeType===3?Q.parentElement:Q;if(I.contains(Be)&&Be!==I.querySelector("img")){const _e=document.createRange();_e.setStartAfter(I),_e.collapse(!0),N.removeAllRanges(),N.addRange(_e)}}else{const se=document.createRange();se.setStartAfter(I),se.collapse(!0),N.addRange(se)}}))},!0),v.value.addEventListener("mousedown",p=>{const h=p.target,k=h.closest(".dss-image-no-alt-icon"),D=h.closest(".dss-image-wrapper");if(k||D&&h.tagName!=="IMG"){p.preventDefault();const I=window.getSelection(),N=document.createRange();D&&(N.setStartAfter(D),N.collapse(!0),I.removeAllRanges(),I.addRange(N))}},!0),v.value.addEventListener("paste",p=>{e.nextTick(()=>{if(!v.value)return;v.value.querySelectorAll("img").forEach(k=>{if(!k.closest(".dss-image-wrapper"))k.removeAttribute("alt"),k.removeAttribute("data-alt"),k.setAttribute("alt",""),k.setAttribute("data-alt",""),k.alt="";else{const I=k.getAttribute("alt")||k.alt||"";if(I){const N=k.getAttribute("src")||k.src||"",se=N.replace(/^https?:\/\//,"").replace(/^data:.*,/,""),Q=I===N||I===se;(I.startsWith("http://")||I.startsWith("https://")||I.startsWith("data:")||Q||Q)&&(k.setAttribute("alt",""),k.setAttribute("data-alt",""),k.alt="")}}}),Zl()})}),v.value.addEventListener("dragstart",p=>{const h=p.target,k=h.tagName==="IMG"?h:h.closest("img"),D=k?.closest(".dss-image-wrapper");k&&v.value.contains(k)&&(et.value=D||k,p.dataTransfer.effectAllowed="move",p.dataTransfer.setData("text/html","image-drag"))}),v.value.addEventListener("dragover",p=>{et.value&&(p.preventDefault(),p.stopPropagation(),p.dataTransfer.dropEffect="move")}),v.value.addEventListener("dragenter",p=>{et.value&&(p.preventDefault(),p.stopPropagation())}),v.value.addEventListener("drop",p=>{if(!et.value||!v.value)return;p.preventDefault(),p.stopPropagation();const h=et.value,k=h.classList?.contains("dss-image-wrapper"),D=k?h.querySelector("img"):h,I=k?h:D?.closest(".dss-image-wrapper");if(!D||!v.value.contains(D)){et.value=null;return}let N=null;const se=p.clientX,Q=p.clientY;if(document.caretRangeFromPoint)N=document.caretRangeFromPoint(se,Q);else{const ml=window.getSelection();ml.rangeCount>0?N=ml.getRangeAt(0).cloneRange():(N=document.createRange(),N.selectNodeContents(v.value),N.collapse(!1))}if(!N){et.value=null;return}const Be=N.commonAncestorContainer,_e=Be.nodeType===3?Be.parentElement:Be;if(_e?.closest(".dss-image-wrapper")===I||I&&I.contains(_e)){et.value=null;return}if(I&&(_e===I||I.contains(_e))){et.value=null;return}const Sl=D.getAttribute("src");let hl=null;I?hl=I.cloneNode(!0):hl=D.cloneNode(!0);try{let ml=N.startContainer;if(ml.nodeType===3&&(ml=ml.parentElement),I&&(ml===I||I.contains(ml))){const pl=document.createRange();pl.setStartAfter(I),pl.collapse(!0),N=pl}N.insertNode(hl);const vt=document.createRange();vt.setStartAfter(hl),vt.collapse(!0);const Xt=window.getSelection();Xt.removeAllRanges(),Xt.addRange(vt)}catch{if(v.value.childNodes.length===0){const vt=document.createElement("p");vt.appendChild(hl),v.value.appendChild(vt)}else{const vt=v.value.lastChild;if(vt&&vt.nodeType===1)vt.appendChild(hl);else{const Xt=document.createElement("p");Xt.appendChild(hl),v.value.appendChild(Xt)}}}I?I.remove():D.remove(),et.value=null,e.nextTick(()=>{const ml=v.value.querySelectorAll("img");let vt=!1;ml.forEach(Xt=>{if(Xt.getAttribute("src")===Sl)if(!vt)vt=!0;else{const pl=Xt.closest(".dss-image-wrapper");pl?pl.remove():Xt.remove()}}),Zl(),_t()})}),v.value.addEventListener("dragend",p=>{et.value=null});let d=null;const u=new MutationObserver(p=>{p.forEach(h=>{h.addedNodes.forEach(k=>{if(k.nodeType===1){k.tagName==="IMG"&&(k.removeAttribute("alt"),k.removeAttribute("data-alt"),k.setAttribute("alt",""),k.setAttribute("data-alt",""),k.alt="");const D=k.querySelectorAll&&k.querySelectorAll("img");D&&D.forEach(I=>{I.removeAttribute("alt"),I.removeAttribute("data-alt"),I.setAttribute("alt",""),I.setAttribute("data-alt",""),I.alt=""})}})}),d&&clearTimeout(d),d=setTimeout(()=>{Zl(),jn(),d=null},100)});if(u.observe(v.value,{childList:!0,subtree:!0}),e.nextTick(()=>{const p=document.querySelector(".dss-text-editor-toolbar");if(p){const h=new MutationObserver(()=>{e.nextTick(()=>{jn()})});h.observe(p,{childList:!0,subtree:!0}),p._toolbarMutationObserver=h}}),L.modelValue){const p=Kl(L.modelValue);v.value.innerHTML=p,En()}e.nextTick(()=>{const p=v.value.innerHTML||"",h=L.title||"",k=L.description||"";Dt.value=p,ne.value=h,j.value=k,K.value=h,de.value=k,Tt(),Zl(),Gl(),rn(),_o(),Qn()}),El(),yn(),v.value._mutationObserver=u}}),e.onUnmounted(()=>{if(document.removeEventListener("click",Eo),window.removeEventListener("resize",Yn),v.value&&v.value._windowScrollHandler&&window.removeEventListener("scroll",v.value._windowScrollHandler,!0),Rn!==null&&(clearTimeout(Rn),Rn=null),v.value&&v.value._windowScrollTimeout!==null&&clearTimeout(v.value._windowScrollTimeout),Ue.value&&clearTimeout(Ue.value),Et.value&&clearTimeout(Et.value),v.value&&v.value._mutationObserver&&v.value._mutationObserver.disconnect(),Fe.value&&Fe.value.disconnect(),bt.value!==null&&(cancelAnimationFrame(bt.value),bt.value=null),ot.value!==null&&(clearTimeout(ot.value),ot.value=null),St.value!==null&&(clearTimeout(St.value),St.value=null),bn(!0),v.value&&v.value._scrollHandlers){const{wrapper:n,content:s,handler:i}=v.value._scrollHandlers;n&&n.removeEventListener("scroll",i),s&&s.removeEventListener("scroll",i)}const a=document.querySelector(".dss-text-editor-toolbar");a&&a._toolbarMutationObserver&&a._toolbarMutationObserver.disconnect()});const Vo=a=>{const n=a.target,s=n.closest("a");if(s&&!L.disabled){a.preventDefault();const c=document.createRange();c.selectNodeContents(s);const d=window.getSelection();d.removeAllRanges(),d.addRange(c)}const i=n.closest(".dss-image-wrapper");i&&n.tagName!=="IMG"?e.nextTick(()=>{const c=window.getSelection();if(c.rangeCount>0){const u=c.getRangeAt(0).commonAncestorContainer,p=u.nodeType===3?u.parentElement:u;if(i.contains(p)&&p!==i.querySelector("img")){const h=document.createRange();h.setStartAfter(i),h.collapse(!0),c.removeAllRanges(),c.addRange(h)}}Zl(),El(),yn(),cl(),rn()}):e.nextTick(()=>{Zl(),El(),yn(),cl(),rn()})},Kn=()=>{Ln();const a=window.getSelection();if(a&&a.rangeCount>0){const s=a.getRangeAt(0);ae.value=!s.collapsed&&Nn(s),!s.collapsed&&x.value&&(x.value=null)}else ae.value=!1;if(Zl(),El(),yn(),cl(),rn(),a&&a.rangeCount>0){const i=a.getRangeAt(0).commonAncestorContainer,c=i.nodeType===3?i.parentElement:i;if(c&&c.closest(".dss-text-editor-footer")){a.removeAllRanges(),ae.value=!1;return}}["bold","italic","underline"].forEach(s=>{try{const i=window.getSelection();if(i.rangeCount>0){const c=i.getRangeAt(0);if(!c.collapsed)if(s==="bold"){const d=c.commonAncestorContainer,u=d.nodeType===3?d.parentElement:d;let p=!1;if(u&&((u.tagName==="STRONG"||u.tagName==="B"||u.closest&&u.closest("strong, b"))&&(p=!0),!p&&u.style&&parseInt(u.style.fontWeight)>=600&&(p=!0),!p))try{const h=window.getComputedStyle(u);parseInt(h.fontWeight)>=600&&(p=!0)}catch{}re.value[s]=p}else{const d=document.queryCommandState(s);re.value[s]=d}}}catch{}})},rn=()=>{if(!L.richText||L.disabled||!v.value){A.value="p";return}try{const a=window.getSelection();if(!a||a.rangeCount===0){A.value="p";return}const s=a.getRangeAt(0).commonAncestorContainer,i=s.nodeType===3?s.parentElement:s;if(!i||!v.value.contains(i)){A.value="p";return}const c=i.closest("h1, h2, h3, h4, h5, h6, p");if(!c){A.value="p";return}const d=c.tagName.toLowerCase();["h1","h2","h3","h4","h5","h6","p"].includes(d)?A.value=d:A.value="p"}catch{A.value="p"}},yn=()=>{if(!v.value){je.value=!1;return}try{const a=window.getSelection();let n=!1;if(a.rangeCount>0){const i=a.getRangeAt(0).commonAncestorContainer,c=i.nodeType===1?i.tagName==="BLOCKQUOTE"?i:i.closest("blockquote"):i.parentElement?.closest("blockquote");n=!!(c&&v.value.contains(c))}je.value=n}catch{je.value=!1}},Nn=a=>{if(!a||!v.value)return!1;const n=a.commonAncestorContainer;if(!n)return!1;const s=n.nodeType===3?n.parentElement:n;return s?v.value.contains(s):!1},Bn=()=>{Qe.value=!1},cl=()=>{if(!L.floatingToolbar||!L.richText||L.disabled){Qe.value=!1;return}const a=window.getSelection();if(!a||a.rangeCount===0){Qe.value=!1;return}const n=a.getRangeAt(0);if(n.collapsed||!Nn(n)){Qe.value=!1;return}const s=n.getBoundingClientRect();if(!s||s.width===0&&s.height===0){Qe.value=!1;return}const i=v.value;if(!i){Qe.value=!1;return}const c=i.getBoundingClientRect();if(!c||c.width===0){Qe.value=!1;return}const d=40,u=8,p=s.top-d/2+15;let h=s.left+s.width/2;const k=window.innerWidth||document.documentElement.clientWidth||0;let D=0;Je.value&&(D=Je.value.getBoundingClientRect().width);const I=(D||320)/2;let N=c.left+I,se=c.right-I;if(se<N){const Q=c.left+c.width/2;N=Q,se=Q}if(k>0){const Q=I+u,Be=k-I-u;if(N=Math.max(N,Q),se=Math.min(se,Be),se<N){const _e=k/2;N=_e,se=_e}}h<N?h=N:h>se&&(h=se),Ce.value={position:"fixed",top:`${Math.max(p,8)}px`,left:`${h}px`,transform:"translate(-50%, -100%)",zIndex:10003},Qe.value=!0},Gn=a=>{L.disabled||!L.richText||(ut.value=ut.value===a?null:a,a==="askAi"&&(be.value=null))},Tl=()=>{ut.value=null,Xe.value=null},R=a=>{zl(a),Tl()};let ol=null,_l=null,en=null,al=null;const Bl=a=>{if(L.disabled||!L.richText){Ol(),Xl();return}const n=a.target,s=n.closest("a"),i=n.closest("img");if(ol&&(clearTimeout(ol),ol=null),en&&(clearTimeout(en),en=null),s&&s!==_l){Xl(),_l=s;let c=s.getAttribute("href")||"";(!c||c==="#"||c==="")&&(c=s.textContent||""),qe.value=s,me.value=c,Y.value=!0,ue.value=!0,dl(s)}else!s&&_l?(_l=null,ol=setTimeout(()=>{ue.value||Ol()},150)):s&&s===_l&&dl(s);if(i&&i!==al){Ol(),al=i;let c=i.getAttribute("alt");c===null&&(c=i.alt||"");let d=i.getAttribute("data-alt");d===null&&(d=c),i.hasAttribute("alt")||i.setAttribute("alt",c),i.hasAttribute("data-alt")||i.setAttribute("data-alt",d),yt.value=i,ge.value=c.trim()||V("textEditor.image.noAlt"),X.value=!0,G.value=!0,kn(i)}else!i&&al?(al=null,en=setTimeout(()=>{G.value||Xl()},150)):i&&i===al&&kn(i)},ul=a=>{const n=a.relatedTarget;(!n||!n.closest(".dss-text-editor-content")&&!n.closest(".dss-link-popup"))&&(_l=null,al=null,ol&&(clearTimeout(ol),ol=null),en&&(clearTimeout(en),en=null),Ol(),Xl())},Ol=()=>{ue.value=!1,setTimeout(()=>{ue.value||(Y.value=!1,me.value="",$e.value||(qe.value=null))},100)},dl=a=>{if(!a||!v.value)return;const n=a.getBoundingClientRect(),c=n.top-32-8,d=n.left+n.width/2;F.value={position:"fixed",top:`${c}px`,left:`${d}px`,transform:"translateX(-50%)",zIndex:10002}},Xl=()=>{G.value=!1,setTimeout(()=>{G.value||(X.value=!1,ge.value="",ht.value||(yt.value=null))},100)},kn=a=>{if(!a||!v.value)return;const n=a.getBoundingClientRect(),c=n.top-32-8,d=n.left+n.width/2;W.value={position:"fixed",top:`${c}px`,left:`${d}px`,transform:"translateX(-50%)",zIndex:10002}},Ut=()=>{if(!me.value||!qe.value)return;let n=qe.value.getAttribute("href")||me.value;!n.startsWith("http://")&&!n.startsWith("https://")&&!n.startsWith("mailto:")&&(n="https://"+n),window.open(n,"_blank","noopener,noreferrer")},Pt=()=>{if(qe.value){const a=qe.value.textContent||"",n=qe.value.getAttribute("href")||"",s=qe.value;tt.value=n,mt.value=a,Le.value=a,ue.value=!1,Y.value=!1,me.value="",qe.value=s,$e.value=!0}else if(ke.value){const a=window.getSelection();if(a.rangeCount>0){const s=a.getRangeAt(0).commonAncestorContainer,i=s.nodeType===1?s.closest("a"):s.parentElement?.closest("a");if(i){const c=i.textContent||"",d=i.getAttribute("href")||"";tt.value=d,mt.value=c,Le.value=c,qe.value=i,$e.value=!0}}}else{Ve.value=Rt();const a=window.getSelection();let n="";a.rangeCount>0&&(n=a.getRangeAt(0).toString()),tt.value="",mt.value=n,Le.value="",qe.value=null,$e.value=!0}e.nextTick(()=>{U.value&&(U.value.focus(),U.value.select())})},gt=()=>{$e.value=!1,tt.value="",mt.value="",Le.value="",qe.value=null,Ve.value=null},sl=()=>{if(!tt.value.trim()){gt();return}if(We.value?(Ue.value&&(clearTimeout(Ue.value),Ue.value=null),Qt(),We.value=!1):Qt(),mt.value.trim()||(mt.value=tt.value.trim()),qe.value&&v.value&&v.value.contains(qe.value)){const a=window.getSelection();a.rangeCount>0&&a.removeAllRanges();const n=qe.value;if(n.setAttribute("href",tt.value.trim()),mt.value.trim()!==Le.value.trim()){for(;n.firstChild;)n.removeChild(n.firstChild);n.textContent=mt.value.trim()}n.style.color="#60afdf",n.style.textDecoration="underline";const s=document.createRange();s.selectNodeContents(n),s.collapse(!1),a.removeAllRanges(),a.addRange(s),_t()}else if(v.value){v.value.focus();const a=window.getSelection();a.removeAllRanges(),Ve.value&&Ll(Ve.value);let n=null;if(a.rangeCount>0&&(n=a.getRangeAt(0)),n&&!n.collapsed){n.toString();const s=document.createElement("a");s.href=tt.value.trim(),s.textContent=mt.value.trim(),s.style.color="#60afdf",s.style.textDecoration="underline",n.deleteContents(),n.insertNode(s);const i=document.createTextNode(" ");n.setStartAfter(s),n.insertNode(i),n.setStartAfter(i),n.collapse(!0),a.removeAllRanges(),a.addRange(n)}else{n||(n=document.createRange(),n.selectNodeContents(v.value),n.collapse(!1));const s=n.startContainer,i=s.nodeType===3,c=i&&n.startOffset===s.textContent.length,d=document.createElement("a");if(d.href=tt.value.trim(),d.textContent=mt.value.trim(),d.style.color="#60afdf",d.style.textDecoration="underline",c){let u=s.parentElement;for(;u&&u!==v.value&&!["P","DIV","H1","H2","H3","H4","H5","H6"].includes(u.tagName);)u=u.parentElement;if(u&&u!==v.value){let p=u.nextElementSibling;if(p&&(p.innerHTML==="<br>"||p.innerHTML==="<br/>"||p.textContent.trim()==="")){p.textContent="",p.appendChild(d);const h=document.createTextNode(" ");p.appendChild(h);const k=document.createRange();k.setStartAfter(d),k.collapse(!0),a.removeAllRanges(),a.addRange(k)}else{if(n.startOffset>0){const k=s.textContent.substring(0,n.startOffset),D=k[k.length-1];if(D&&D!==" "&&D!==" "&&D!==`
|
|
104
|
+
`){const I=document.createTextNode(" ");n.insertNode(I),n.setStartAfter(I)}}n.insertNode(d);const h=document.createTextNode(" ");n.setStartAfter(d),n.insertNode(h),n.setStartAfter(h),n.collapse(!0),a.removeAllRanges(),a.addRange(n)}}}else{if(i&&n.startOffset>0){const p=s.textContent.substring(0,n.startOffset),h=p[p.length-1];if(h&&h!==" "&&h!==" "&&h!==`
|
|
105
|
+
`){const k=document.createTextNode(" ");n.insertNode(k),n.setStartAfter(k)}}n.insertNode(d);const u=document.createTextNode(" ");n.setStartAfter(d),n.insertNode(u),n.setStartAfter(u),n.collapse(!0),a.removeAllRanges(),a.addRange(n)}}_t()}e.nextTick(()=>{El(),gt()})},vo=()=>{if(!v.value||J.value)return;const a=window.getSelection();let n=null;a&&a.rangeCount>0&&(n=Rt());const s=/(https?:\/\/[^\s<>"{}|\\^`\[\]]+[^\s<>"{}|\\^`\[\].,;:!?])|(www\.[^\s<>"{}|\\^`\[\]]+[^\s<>"{}|\\^`\[\].,;:!?])|([a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.([a-zA-Z]{2,})(\/[^\s<>"{}|\\^`\[\]]*)?)/gi,i=document.createTreeWalker(v.value,NodeFilter.SHOW_TEXT,{acceptNode:p=>{const h=p.parentElement;return!h||h.closest("a")||h.closest(".dss-image-wrapper")||!p.textContent||p.textContent.trim()===""?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}}),c=[];let d;for(;d=i.nextNode();)c.push(d);let u=!1;for(let p=c.length-1;p>=0;p--){const h=c[p],k=h.textContent;s.lastIndex=0;const D=[...k.matchAll(s)];if(D.length===0)continue;const I=D.filter(Q=>{const Be=Q[0],_e=Q.index;if(_e>0&&k[_e-1]==="@"||_e+Be.length<k.length&&k[_e+Be.length]==="@")return!1;const He=h.parentElement;return!(He&&He.closest("a"))});if(I.length===0)continue;if(I.length===1&&I[0][0]===k.trim()){const Q=I[0][0],Be=Q.startsWith("http://")||Q.startsWith("https://")?Q:`https://${Q}`,_e=document.createElement("a");_e.href=Be,_e.textContent=Q,_e.style.color="#60afdf",_e.style.textDecoration="underline",h.parentNode&&(h.parentNode.replaceChild(_e,h),u=!0);continue}let N=0;const se=document.createDocumentFragment();if(I.forEach(Q=>{const Be=Q.index,_e=Q[0];if(Be>N){const hl=k.substring(N,Be);hl&&se.appendChild(document.createTextNode(hl))}const He=_e.startsWith("http://")||_e.startsWith("https://")?_e:`https://${_e}`,Sl=document.createElement("a");Sl.href=He,Sl.textContent=_e,Sl.style.color="#60afdf",Sl.style.textDecoration="underline",se.appendChild(Sl),N=Be+_e.length}),N<k.length){const Q=k.substring(N);Q&&se.appendChild(document.createTextNode(Q))}h.parentNode&&se.childNodes.length>0&&(h.parentNode.replaceChild(se,h),u=!0)}u&&n&&e.nextTick(()=>{Ll(n),El()})},No=()=>{if(!v.value)return;const a=/<u>([\s\S]*?)<\/u>|<ins>([\s\S]*?)<\/ins>/gi,n=document.createTreeWalker(v.value,NodeFilter.SHOW_TEXT,{acceptNode:c=>{const d=c.parentElement;return!d||d.closest("a, code, pre, u, ins")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}}),s=[];let i;for(;i=n.nextNode();)s.push(i);for(let c=s.length-1;c>=0;c--){const d=s[c],u=d.textContent,p=[...u.matchAll(a)];if(p.length===0)continue;let h=0;const k=document.createDocumentFragment();p.forEach(D=>{const I=D.index,N=D[0].startsWith("<u>")?"u":"ins",se=D[1]||D[2]||"";I>h&&k.appendChild(document.createTextNode(u.substring(h,I)));const Q=document.createElement(N);Q.textContent=se,k.appendChild(Q),h=I+D[0].length}),h<u.length&&k.appendChild(document.createTextNode(u.substring(h))),d.parentNode&&k.childNodes.length>0&&d.parentNode.replaceChild(k,d)}},Fn=a=>{if(!v.value||J.value)return;if(!a){No();return}if(!["*","_",">"].includes(a))return;const s=window.getSelection();if(!s||s.rangeCount===0)return;const i=s.getRangeAt(0);if(!i.collapsed)return;const c=i.startContainer.nodeType===Node.TEXT_NODE?i.startContainer.parentElement?.closest("p, h1, h2, h3, h4, h5, h6, li, td, th, blockquote, div"):i.startContainer.closest?.("p, h1, h2, h3, h4, h5, h6, li, td, th, blockquote, div");if(!c||c===v.value||!v.value.contains(c))return;const d=()=>{let hl="",ml=0,vt=!1;const Xt=document.createTreeWalker(c,NodeFilter.SHOW_TEXT,{acceptNode:gl=>gl.parentElement?.closest("a, code, pre")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT});document.createTreeWalker(c,NodeFilter.SHOW_TEXT,null);let pl=0;for(;Xt.nextNode();){const gl=Xt.currentNode,xn=gl.textContent||"",Wl=pl;if(pl+=xn.length,gl===i.startContainer){hl+=xn.substring(0,i.startOffset),ml=Wl+i.startOffset,vt=!0;break}hl+=xn}return vt||(ml=hl.length),{textBeforeCursor:hl,cursorCharOffset:ml}},{textBeforeCursor:u}=d();if(!u.length)return;let p=null,h=null;if(u.endsWith("**")&&(p=u.match(/\*\*(.+?)\*\*$/s))||u.endsWith("__")&&(p=u.match(/__(.+?)__$/s))?h="strong":u.endsWith("*")&&!u.endsWith("**")&&(p=u.match(new RegExp("(?<!\\*)\\*([^*]+)\\*$")))||u.endsWith("_")&&!u.endsWith("__")&&(p=u.match(new RegExp("(?<!_)_([^_]+)_$")))?h="em":a===">"&&((p=u.match(/<u>(.+?)<\/u>$/s))||(p=u.match(/<ins>(.+?)<\/ins>$/s)))&&(h=p[0].startsWith("<u>")?"u":"ins",p[0].startsWith("<u>"),p[0].startsWith("<u>")),!p||!p[1])return;const k=p[0],D=p[1],I=u.length-k.length,se=(hl=>{let ml=0;const vt=document.createTreeWalker(c,NodeFilter.SHOW_TEXT,{acceptNode:pl=>pl.parentElement?.closest("a, code, pre")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT});let Xt;for(;Xt=vt.nextNode();){const pl=(Xt.textContent||"").length;if(ml+pl>=hl)return{node:Xt,offset:hl-ml};ml+=pl}return null})(I);if(!se)return;const Q=document.createRange();Q.setStart(se.node,se.offset),Q.setEnd(i.endContainer,i.endOffset);const Be=document.createElement(h);Be.textContent=D,Q.deleteContents(),Q.insertNode(Be);const _e=window.getSelection(),He=document.createRange();He.setStartAfter(Be),He.collapse(!0),_e.removeAllRanges(),_e.addRange(He);const Sl=Rt();e.nextTick(()=>{_t(),Sl&&Ll(Sl)})},Wn=()=>{v.value&&(el.value=Rt(),dt.value="",qt.value="",Pe.value="",Ct.value="",wt.value="",Wt.value=null,yt.value=null,Ne.value="upload",ht.value=!0,nl(),e.nextTick(()=>{Yt.value&&Yt.value.focus(),it.value&&(it.value.value="")}))},Cn=a=>{const n=a.target?.files?.[0];if(!n){Wt.value=null,qt.value="";return}Wt.value=n;const s=new FileReader;s.onload=i=>{qt.value=i.target?.result||""},s.readAsDataURL(n)},ho=()=>{it.value&&it.value.click()},qn=()=>{Ct.value&&(wt.value="")},Bo=()=>{wt.value&&(Ct.value="")},Mo=()=>{let a=yt.value;if(!a){const n=window.getSelection();if(n&&n.rangeCount>0){const i=n.getRangeAt(0).commonAncestorContainer;a=i.nodeType===1?i.closest("img"):i.parentElement?.closest("img")}}if(a){const n=a.getAttribute("data-alt")||a.getAttribute("alt")||"";yt.value=a,dt.value=n.trim()===""||n.trim()==="Image"?"":n;const s=a.getAttribute("src")||a.src||"";s.startsWith("http://")||s.startsWith("https://")?(Pe.value=s,qt.value="",Ne.value="url"):(qt.value=s,Pe.value="",Ne.value="upload");const c=a.style.width||a.getAttribute("width")||"",d=a.style.height||a.getAttribute("height")||"";Ct.value=c.endsWith("px")?c.replace("px",""):c,wt.value=d.endsWith("px")?d.replace("px",""):d,el.value=null}else{Wn();return}ht.value=!0,G.value=!1,X.value=!1,e.nextTick(()=>{Ne.value==="url"&&Kt.value?(Kt.value.focus(),Kt.value.select()):Yt.value&&(Yt.value.focus(),Yt.value.select()),it.value&&(it.value.value="")})},Zn=()=>{ht.value=!1,dt.value="",qt.value="",Pe.value="",Ct.value="",wt.value="",Wt.value=null,yt.value=null,el.value=null,Ne.value="upload"},Rl=()=>{const a=(dt.value||"").trim(),n=v.value?._mutationObserver;n&&n.disconnect(),We.value?(Ue.value&&(clearTimeout(Ue.value),Ue.value=null),Qt(),We.value=!1):Qt();const s=Ne.value==="url"?Pe.value.trim():qt.value;if(yt.value&&v.value&&v.value.contains(yt.value)){s&&(yt.value.src=s),yt.value.setAttribute("alt",a),yt.value.setAttribute("data-alt",a),Ct.value?(yt.value.style.width=`${Ct.value}px`,yt.value.setAttribute("width",Ct.value)):(yt.value.style.removeProperty("width"),yt.value.removeAttribute("width")),wt.value?(yt.value.style.height=`${wt.value}px`,yt.value.setAttribute("height",wt.value)):(yt.value.style.removeProperty("height"),yt.value.removeAttribute("height"));const i=window.getSelection();if(i){i.removeAllRanges();const c=document.createRange();c.setStartAfter(yt.value),c.collapse(!0),i.addRange(c)}_t()}else{if(!s){n&&v.value&&n.observe(v.value,{childList:!0,subtree:!0}),Zn();return}if(v.value){v.value.focus();const i=window.getSelection();i&&i.rangeCount>0&&i.removeAllRanges();const c=window.getSelection();let d=null;if(el.value&&(Ll(el.value),c&&c.rangeCount>0&&(d=c.getRangeAt(0))),!d&&c&&c.rangeCount>0&&(d=c.getRangeAt(0)),!d&&v.value){if(d=document.createRange(),v.value.childNodes.length===0){const k=document.createElement("p");k.innerHTML="<br>",v.value.appendChild(k),d.setStart(k,0),d.collapse(!0)}else d.selectNodeContents(v.value),d.collapse(!1);c&&(c.removeAllRanges(),c.addRange(d))}if(!d){Zn();return}const u=d.commonAncestorContainer,p=u.nodeType===3?u.parentElement:u;if(!v.value.contains(p)){if(d=document.createRange(),v.value.childNodes.length===0){const k=document.createElement("p");k.innerHTML="<br>",v.value.appendChild(k),d.setStart(k,0),d.collapse(!0)}else d.selectNodeContents(v.value),d.collapse(!1);c&&(c.removeAllRanges(),c.addRange(d))}const h=document.createElement("img");h.src=s,h.setAttribute("alt",a),h.setAttribute("data-alt",a),Ct.value&&(h.style.width=`${Ct.value}px`,h.setAttribute("width",Ct.value)),wt.value&&(h.style.height=`${wt.value}px`,h.setAttribute("height",wt.value));try{d.insertNode(h),d.setStartAfter(h),d.collapse(!0),c&&(c.removeAllRanges(),c.addRange(d))}catch{if(v.value){if(v.value.childNodes.length===0){const I=document.createElement("p");v.value.appendChild(I),I.appendChild(h)}else{const I=v.value.lastChild;if(I&&I.nodeType===1)I.appendChild(h);else{const N=document.createElement("p");v.value.appendChild(N),N.appendChild(h)}}const D=document.createRange();D.setStartAfter(h),D.collapse(!0),c&&(c.removeAllRanges(),c.addRange(D))}}yt.value=h,_t()}}e.nextTick(()=>{n&&v.value&&n.observe(v.value,{childList:!0,subtree:!0}),El(),cl(),Zn()})};e.watch(()=>L.modelValue,a=>{if(L.richText&&v.value&&!J.value){const n=Kl(a||""),i=v.value.innerHTML.replace(/ |\u00A0/g," "),c=n.replace(/ |\u00A0/g," ");if(i!==c){const d=Rt();v.value.innerHTML=n,e.nextTick(()=>{En();const u=v.value.innerHTML||"",p=L.title||"",h=L.description||"";Dt.value=u,ne.value=p,j.value=h,Lt.value=u,K.value=p,de.value=h,Ge.value=[],Zt.value=[],Ue.value&&(clearTimeout(Ue.value),Ue.value=null),We.value=!1,d&&Ll(d),Tt(),Zl(),Gl(),El(),cl(),rn(),Yl("watch-modelValue")})}}},{immediate:!0}),e.watch(()=>L.richText,a=>{a?(cl(),e.nextTick(()=>{_o()})):(Bn(),oe.value=[],Fe.value&&(Fe.value.disconnect(),Fe.value=null)),rn()}),e.watch(()=>L.floatingToolbar,a=>{a?cl():Bn()}),e.watch(()=>L.disabled,a=>{a&&Bn(),rn()}),e.watch(()=>L.description,()=>{e.nextTick(()=>{M.value?st():Gt()})}),e.watch(()=>L.title,()=>{e.nextTick(()=>{vl.value?le():ct()})}),e.watch(()=>L.customToolbarSlots,()=>{e.nextTick(()=>{jn()})},{deep:!0}),e.watch(()=>L.comments,(a,n)=>{if(L.commentUser){if(Bt.value){Bt.value=!1;return}bl.value||L.richText&&v.value&&e.nextTick(()=>{Qn()})}},{deep:!0,immediate:!1});const Qn=()=>{if(L.commentUser&&!bl.value&&!(!L.comments||!Array.isArray(L.comments)||L.comments.length===0)&&!(!L.richText||!v.value)){bl.value=!0;try{const a=new Set,n=L.comments.filter(u=>{const p=String(u.conversation_id||u.id);return a.has(p)?!1:(a.add(p),!0)}),s=v.value.querySelectorAll("[data-comment], [data-fake-comment]"),i=s.length;s.forEach(u=>{const p=u.parentNode;if(p){for(;u.firstChild;)p.insertBefore(u.firstChild,u);p.removeChild(u)}});let c=0;const d=new Set;n.forEach(u=>{if(!u.conversation_id||!u.selection_range)return;const p=typeof u.conversation_id=="string"&&u.conversation_id.startsWith("comment-")?null:Number(u.conversation_id)||u.conversation_id;if(!p)return;const h=String(p);if(d.has(h))return;const k=v.value.querySelector(`[data-comment="${h}"]`);if(k){Jn(k,u),d.add(h);return}try{const D=Un(u.selection_range,u.selection_text);if(D&&!D.collapsed){const I=D.commonAncestorContainer,N=I.nodeType===3?I.parentElement:I;if(N){const Be=N.closest("[data-comment], [data-fake-comment]");if(Be){const _e=Be.getAttribute("data-comment")||Be.getAttribute("data-fake-comment");if(String(_e)===String(p)){Be.setAttribute("data-comment",h),Be.removeAttribute("data-fake-comment"),Jn(Be,u),d.add(h);return}else return}}const se=v.value.querySelector(`[data-comment="${h}"]`);if(se){Jn(se,u),d.add(h);return}const Q=document.createElement("span");Q.setAttribute("data-comment",h),Jn(Q,u);try{D.surroundContents(Q),c++,d.add(h)}catch{try{const _e=document.createRange();_e.setStart(D.startContainer,D.startOffset),_e.setEnd(D.endContainer,D.endOffset),an(_e),_e.surroundContents(Q),c++,d.add(h)}catch{try{const He=D.extractContents();Q.appendChild(He),D.insertNode(Q),c++,d.add(h)}catch(He){console.warn("Failed to create comment marker:",He)}}}}}catch{}}),e.nextTick(()=>{Yl("restoreCommentsFromModel"),_t(),bl.value=!1})}catch{bl.value=!1}}},an=a=>{if(!a||!v.value)return a;try{const n=["P","DIV","H1","H2","H3","H4","H5","H6","LI","BLOCKQUOTE","PRE"];let s=a.startContainer,i=a.startOffset;if(s.nodeType===3){const u=s.parentElement;u&&n.includes(u.tagName)&&(i===0&&!Jo(s)||a.setStartBefore(u))}else s.nodeType===1&&n.includes(s.tagName)&&i>0&&a.setStartBefore(s);let c=a.endContainer,d=a.endOffset;if(c.nodeType===3){const u=c.parentElement;u&&n.includes(u.tagName)&&(d===c.length&&!ea(c)||a.setEndAfter(u))}else c.nodeType===1&&n.includes(c.tagName)&&d<c.childNodes.length&&a.setEndAfter(c);return a}catch{return a}},Jo=a=>{let n=a.previousSibling;for(;n;){if(n.nodeType===3&&n.textContent.trim().length>0||n.nodeType===1&&n.textContent.trim().length>0)return!0;n=n.previousSibling}return!1},ea=a=>{let n=a.nextSibling;for(;n;){if(n.nodeType===3&&n.textContent.trim().length>0||n.nodeType===1&&n.textContent.trim().length>0)return!0;n=n.nextSibling}return!1},Un=(a,n)=>{if(!a||!v.value)return null;try{const s=document.createRange();if(a.type==="text"&&typeof a.start=="number"&&typeof a.end=="number"){let i=0;const c=[v.value];let d=null,u=!1,p=!1;for(;!p&&(d=c.pop());)if(d.nodeType===3){const h=i+d.length;!u&&a.start>=i&&a.start<=h&&(s.setStart(d,a.start-i),u=!0),u&&a.end>=i&&a.end<=h&&(s.setEnd(d,a.end-i),p=!0),i=h}else{let h=d.childNodes.length;for(;h--;)c.push(d.childNodes[h])}return u?an(s):null}}catch{return null}return null},Jn=(a,n)=>{if(!a||!n)return;const s=n.conversation||[],i=new Set,c=[],d=p=>{p&&p.id&&!i.has(p.id)&&(i.add(p.id),c.push(p))};s.length>0&&s.forEach(p=>{p.user&&d(p.user)}),c.length>0?a.setAttribute("data-comment-user",JSON.stringify(c[0])):a.removeAttribute("data-comment-user"),c.length>1?a.setAttribute("data-comment-user-2",JSON.stringify(c[1])):a.removeAttribute("data-comment-user-2");const u=s.length;u>0?a.setAttribute("data-comment-count",String(u)):a.removeAttribute("data-comment-count")},Yl=(a="unknown")=>{if(!L.commentUser||!L.richText||!v.value){oe.value=[];return}Date.now()-xt.value<Mt&&bt.value!==null||bt.value===null&&(bt.value=requestAnimationFrame(()=>{if(bt.value=null,xt.value=Date.now(),Ie.value)return;Ie.value=!0;const s={},i=v.value;if(!i){Ie.value=!1;return}const c=i.closest(".editor-with-comments");if(!c){Ie.value=!1;return}const d=i.querySelectorAll("[data-comment], [data-fake-comment]"),u=[],p=new Set;d.forEach(N=>{const se=N.getAttribute("data-comment")||N.getAttribute("data-fake-comment");se&&N.tagName==="SPAN"&&(p.has(se)||(u.push(N),p.add(se)))}),d.forEach(N=>{const se=N.getAttribute("data-comment")||N.getAttribute("data-fake-comment");!se||p.has(se)||(["P","DIV","H1","H2","H3","H4","H5","H6"].includes(N.tagName)?N.querySelector(`span[data-comment="${se}"], span[data-fake-comment="${se}"]`)||(u.push(N),p.add(se)):N.tagName!=="SPAN"&&(u.push(N),p.add(se)))});const h=c.getBoundingClientRect(),k=i.getBoundingClientRect();u.forEach((N,se)=>{let Q=N.getAttribute("data-comment")||N.getAttribute("data-fake-comment");if(!Q)return;if(typeof Q=="string"&&Q.startsWith("comment-")){const cn=N.textContent?.trim(),$t=L.comments?.find(ln=>(typeof ln.conversation_id=="string"&&ln.conversation_id.startsWith("comment-")?null:ln.conversation_id)&&ln.selection_text?.trim()===cn);$t?(Q=String($t.conversation_id),N.setAttribute("data-comment",Q),N.removeAttribute("data-fake-comment")):(Q=String(Date.now()),N.setAttribute("data-comment",Q),N.removeAttribute("data-fake-comment"))}const Be=N.getBoundingClientRect(),_e=window.getComputedStyle(N),He=parseFloat(_e.lineHeight)||parseFloat(_e.fontSize)*1.2,ml=Be.top-k.top+He/2-15,Xt=k.top-h.top+ml;let pl=null,gl=null,xn=0;const Wl=[],to=new Set;if(Q&&L.comments){const cn=L.comments.find($t=>String($t.conversation_id||$t.id)===String(Q));if(cn){const $t=cn.conversation||[];$t.length>0?($t.forEach(ln=>{ln.user&&ln.user.id&&!to.has(ln.user.id)&&(to.add(ln.user.id),Wl.push(ln.user))}),xn=$t.length):(xn=0,pl=null,gl=null),Wl.length>0?pl=Wl[0]:pl=null,Wl.length>1?gl=Wl[1]:gl=null}}const $o=Be.top+He/2-15,Lo=$o+30,Ao=5,Do=Lo>k.top+Ao&&$o<k.bottom-Ao?1:0;oe.value.find(cn=>cn.id===Q);let lo=N;if(!lo&&Q&&v.value){const cn=String(Q);lo=v.value.querySelector(`[data-comment="${cn}"], [data-fake-comment="${cn}"]`)}const no=Wl.length;s[Q]?(s[Q].top=Xt,s[Q].opacity=Do,s[Q].element=lo,s[Q].firstUser=pl,s[Q].secondUser=gl,s[Q].totalCount=xn,s[Q].uniqueUserCount=no):s[Q]={id:Q,top:Xt,opacity:Do,element:lo,firstUser:pl,secondUser:gl,totalCount:xn,uniqueUserCount:no}});const D=Object.values(s).map(N=>{const se=Math.max(0,(N.uniqueUserCount??0)-2);if(!N.element&&N.id&&v.value){const Be=String(N.id);N.element=v.value.querySelector(`[data-comment="${Be}"], [data-fake-comment="${Be}"]`)}return{...N,firstUser:N.firstUser||null,secondUser:N.secondUser||null,totalCount:N.totalCount,additionalCount:se}});(oe.value.length!==D.length||D.some((N,se)=>{const Q=oe.value[se];if(!Q)return!0;const Be=(Q.firstUser?.id||null)!==(N.firstUser?.id||null),_e=(Q.secondUser?.id||null)!==(N.secondUser?.id||null);return Q.id!==N.id||Math.abs(Q.top-N.top)>1||Q.opacity!==N.opacity||Q.totalCount!==N.totalCount||Q.additionalCount!==N.additionalCount||Be||_e||Q.element!==N.element}))&&(oe.value=D),Ie.value=!1}))},ta=a=>{if(!a)return;let n=a.element;if(!n&&a.id&&v.value){const s=String(a.id);n=v.value.querySelector(`[data-comment="${s}"], [data-fake-comment="${s}"]`)}n&&(bn(),Al.value=n,n.classList.add("editor-comment-highlighted"))},bn=(a=!1)=>{!a&&Cl.value!==null&&Al.value&&(Al.value.getAttribute("data-comment")||Al.value.getAttribute("data-fake-comment"))===Cl.value||(v.value&&v.value.querySelectorAll(".editor-comment-highlighted").forEach(s=>{s.classList.remove("editor-comment-highlighted")}),Al.value&&(Al.value.classList.remove("editor-comment-highlighted"),Al.value=null))},eo=a=>{if(!a||!a.element)return;bn(!0);const n=a.element.getAttribute("data-comment")||a.element.getAttribute("data-fake-comment");if(!n)return;const s=`[data-comment="${n}"], [data-fake-comment="${n}"]`;fe("comment-marker-clicked",{commentId:n,selector:s,element:a.element})},la=()=>{bn()},_o=()=>{!L.richText||!v.value||(Fe.value&&Fe.value.disconnect(),St.value!==null&&(clearTimeout(St.value),St.value=null),Fe.value=new MutationObserver(()=>{St.value===null&&(St.value=setTimeout(()=>{St.value=null,e.nextTick(()=>{Yl("MutationObserver")})},200))}),Fe.value.observe(v.value,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-comment","data-fake-comment","data-comment-user","data-comment-user-2","data-comment-count"]}),Yl("setupCommentMarkersObserver-initial"))},tn=(a,n)=>{if(!a||!n)return;const s=n.getBoundingClientRect();let i=s.top,c=s.right+4;a.style.top=`${i}px`,a.style.left=`${c}px`,a.offsetHeight;const d=a.getBoundingClientRect(),u=window.innerWidth,p=window.innerHeight;if(d.right>u){const h=s.left-d.width-4;a.style.left=`${h}px`}if(d.bottom>p){const h=Math.max(8,p-d.height-8);a.style.top=`${h}px`}d.top<0&&(a.style.top="8px")};return e.watch(()=>Xe.value,a=>{e.nextTick(()=>{document.querySelectorAll(".dss-toolbar-dropdown-submenu").forEach(s=>{const i=s.getAttribute("data-submenu-id");if(i===a&&a){const c=document.querySelector(`.dss-toolbar-dropdown-item-has-submenu[data-submenu-id="${i}"]`);if(c){if(s.parentNode!==document.body){const d=s.parentNode;s.dataset.originalParentRef=d===c?"inside":"sibling",document.body.appendChild(s)}s.style.display="block",s.style.visibility="hidden",s.style.opacity="0",requestAnimationFrame(()=>{requestAnimationFrame(()=>{tn(s,c),s.offsetHeight,s.setAttribute("data-active","true"),s.style.visibility="visible",s.style.opacity="1"})})}else s.setAttribute("data-active","true")}else s.setAttribute("data-active","false"),s.style.display="none",s.style.top="",s.style.left="",s.style.visibility="",s.style.opacity=""})})}),e.watch(()=>[be.value,ut.value],()=>{be.value==="askAi"||ut.value==="askAi"?e.nextTick(()=>{So()}):(Xe.value=null,e.nextTick(()=>{document.querySelectorAll(".dss-toolbar-dropdown-submenu").forEach(n=>{if(n.parentNode===document.body){const s=n.getAttribute("data-submenu-id");if(s){const i=document.querySelector(`.dss-toolbar-dropdown-item-has-submenu[data-submenu-id="${s}"]`);if(i)if(n.dataset.originalParentRef==="inside")i.appendChild(n);else{const d=i.closest(".dss-toolbar-dropdown");d&&d.insertBefore(n,i.nextSibling)}}}})}))}),e.watch(()=>L.locale,a=>{a&&a!==ce.value&&(ce.value=a)},{immediate:!0}),te({openCommentOverlayForSelector:Sn,updateCommentMarkers:Yl,restoreCommentsFromModel:Qn}),(a,n)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-text-editor-container",[{"editor-with-comments":At.value},It.value]]),style:e.normalizeStyle(Nt.value)},[E.richText?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-text-editor-toolbar",onMousedown:n[14]||(n[14]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("div",Vd,[e.createElementVNode("div",{class:"dss-toolbar-button",onClick:hn,title:e.unref(V)("textEditor.toolbar.undo")},[...n[45]||(n[45]=[e.createElementVNode("svg",{viewBox:"0 0 18 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M9.23302 0.888889C6.90278 0.888889 4.79238 1.76889 3.16561 3.2L0 0V8H7.91402L4.73083 4.78222C5.9531 3.75111 7.50953 3.11111 9.23302 3.11111C12.3459 3.11111 14.9927 5.16444 15.916 8L18 7.30667C16.7777 3.58222 13.3219 0.888889 9.23302 0.888889Z",fill:"#323232"})],-1)])],8,Nd),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-disabled":!Vl.value}]),onClick:An,title:e.unref(V)("textEditor.toolbar.redo")},[...n[46]||(n[46]=[e.createElementVNode("svg",{viewBox:"0 0 18 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M14.8328 3.2C13.2053 1.76889 11.0938 0.888889 8.76246 0.888889C4.67155 0.888889 1.21408 3.58222 0 7.30667L2.07625 8C3 5.16444 5.6393 3.11111 8.76246 3.11111C10.478 3.11111 12.044 3.75111 13.2669 4.78222L10.0821 8H18V0L14.8328 3.2Z",fill:"#323232"})],-1)])],10,Bd),n[61]||(n[61]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",Md,[e.createElementVNode("div",{class:"dss-toolbar-button dss-toolbar-dropdown-toggle",onClick:n[0]||(n[0]=s=>Dn("paragraph")),title:e.unref(V)("textEditor.toolbar.paragraphFormat")},[A.value==="h1"?(e.openBlock(),e.createElementBlock("img",{key:0,src:O.h1,alt:"H1",class:"dss-toolbar-heading-icon"},null,8,$d)):A.value==="h2"?(e.openBlock(),e.createElementBlock("img",{key:1,src:O.h2,alt:"H2",class:"dss-toolbar-heading-icon"},null,8,Ld)):A.value==="h3"?(e.openBlock(),e.createElementBlock("img",{key:2,src:O.h3,alt:"H3",class:"dss-toolbar-heading-icon"},null,8,Ad)):A.value==="h4"?(e.openBlock(),e.createElementBlock("img",{key:3,src:O.h4,alt:"H4",class:"dss-toolbar-heading-icon"},null,8,Td)):A.value==="h5"?(e.openBlock(),e.createElementBlock("img",{key:4,src:O.h5,alt:"H5",class:"dss-toolbar-heading-icon"},null,8,Dd)):A.value==="h6"?(e.openBlock(),e.createElementBlock("img",{key:5,src:O.h6,alt:"H6",class:"dss-toolbar-heading-icon"},null,8,Hd)):(e.openBlock(),e.createElementBlock("svg",Rd,[...n[47]||(n[47]=[e.createElementVNode("path",{d:"M4.33333 8.61539V14H6.5V2.15385H8.66667V14H10.8333V2.15385H13V0H4.33333C1.93917 0 0 1.92769 0 4.30769C0 6.68769 1.93917 8.61539 4.33333 8.61539Z",fill:"#323232"},null,-1)])])),n[48]||(n[48]=e.createElementVNode("span",{class:"dss-toolbar-dropdown-arrow"},"˅",-1))],8,_d),be.value==="paragraph"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:n[8]||(n[8]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[1]||(n[1]=s=>zl("<h1>"))},[e.createElementVNode("img",{src:O.h1,alt:"H1",class:"dss-toolbar-heading-icon"},null,8,Fd),e.createElementVNode("h1",null,e.toDisplayString(e.unref(V)("textEditor.paragraph.heading1")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[2]||(n[2]=s=>zl("<h2>"))},[e.createElementVNode("img",{src:O.h2,alt:"H2",class:"dss-toolbar-heading-icon"},null,8,Id),e.createElementVNode("h2",null,e.toDisplayString(e.unref(V)("textEditor.paragraph.heading2")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[3]||(n[3]=s=>zl("<h3>"))},[e.createElementVNode("img",{src:O.h3,alt:"H3",class:"dss-toolbar-heading-icon"},null,8,zd),e.createElementVNode("h3",null,e.toDisplayString(e.unref(V)("textEditor.paragraph.heading3")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[4]||(n[4]=s=>zl("<h4>"))},[e.createElementVNode("img",{src:O.h4,alt:"H4",class:"dss-toolbar-heading-icon"},null,8,Pd),e.createElementVNode("h4",null,e.toDisplayString(e.unref(V)("textEditor.paragraph.heading4")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[5]||(n[5]=s=>zl("<h5>"))},[e.createElementVNode("img",{src:O.h5,alt:"H5",class:"dss-toolbar-heading-icon"},null,8,Od),e.createElementVNode("h5",null,e.toDisplayString(e.unref(V)("textEditor.paragraph.heading5")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[6]||(n[6]=s=>zl("<h6>"))},[e.createElementVNode("img",{src:O.h6,alt:"H6",class:"dss-toolbar-heading-icon"},null,8,Wd),e.createElementVNode("h6",null,e.toDisplayString(e.unref(V)("textEditor.paragraph.heading6")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[7]||(n[7]=s=>zl("<p>"))},[n[49]||(n[49]=e.createElementVNode("svg",{width:"13",height:"14",viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"paragraph-icon"},[e.createElementVNode("path",{d:"M4.33333 8.61539V14H6.5V2.15385H8.66667V14H10.8333V2.15385H13V0H4.33333C1.93917 0 0 1.92769 0 4.30769C0 6.68769 1.93917 8.61539 4.33333 8.61539Z",fill:"#323232"})],-1)),e.createElementVNode("p",null,e.toDisplayString(e.unref(V)("textEditor.paragraph.paragraph")),1)])])):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Jt("bold")}]),onClick:n[9]||(n[9]=s=>Ql("bold")),title:e.unref(V)("textEditor.toolbar.bold")},[...n[50]||(n[50]=[e.createElementVNode("svg",{viewBox:"0 0 11 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M8.8 6.79C9.79256 6.12 10.4884 5.02 10.4884 4C10.4884 1.74 8.69767 0 6.39535 0H0V14H7.20372C9.34233 14 11 12.3 11 10.21C11 8.69 10.12 7.39 8.8 6.79ZM3.06977 2.5H6.13953C6.98884 2.5 7.67442 3.17 7.67442 4C7.67442 4.83 6.98884 5.5 6.13953 5.5H3.06977V2.5ZM6.65116 11.5H3.06977V8.5H6.65116C7.50047 8.5 8.18605 9.17 8.18605 10C8.18605 10.83 7.50047 11.5 6.65116 11.5Z",fill:"currentColor"})],-1)])],10,qd),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Jt("italic")}]),onClick:n[10]||(n[10]=s=>Ql("italic")),title:e.unref(V)("textEditor.toolbar.italic")},[...n[51]||(n[51]=[e.createElementVNode("svg",{viewBox:"0 0 12 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M4 0V3H6.21L2.79 11H0V14H8V11H5.79L9.21 3H12V0H4Z",fill:"#323232"})],-1)])],10,Zd),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Jt("underline")}]),onClick:n[11]||(n[11]=s=>Ql("underline")),title:e.unref(V)("textEditor.toolbar.underline")},[...n[52]||(n[52]=[e.createElementVNode("svg",{viewBox:"0 0 11 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M5.5 10.8889C8.10071 10.8889 10.2143 8.79667 10.2143 6.22222V0H8.25V6.22222C8.25 7.72333 7.01643 8.94444 5.5 8.94444C3.98357 8.94444 2.75 7.72333 2.75 6.22222V0H0.785714V6.22222C0.785714 8.79667 2.89929 10.8889 5.5 10.8889ZM0 12.4444V14H11V12.4444H0Z",fill:"#323232"})],-1)])],10,Ud),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":je.value}]),onClick:zt,title:e.unref(V)("textEditor.toolbar.citation")},[...n[53]||(n[53]=[e.createElementVNode("svg",{viewBox:"0 0 20 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.42857 14H5.71429L8.57143 8.4V0H0V8.4H4.28571L1.42857 14ZM12.8571 14H17.1429L20 8.4V0H11.4286V8.4H15.7143L12.8571 14Z",fill:"currentColor"})],-1)])],10,Xd),n[62]||(n[62]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),ke.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-button",onClick:Ml,title:e.unref(V)("textEditor.toolbar.removeLink")},[...n[55]||(n[55]=[e.createElementVNode("svg",{width:"20",height:"20",viewBox:"0 0 24 22",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M18 4.88889H13.2V7.21111H18C20.052 7.21111 21.72 8.91 21.72 11C21.72 12.7478 20.544 14.2144 18.948 14.6422L20.7 16.4267C22.656 15.4122 24 13.3833 24 11C24 7.62667 21.312 4.88889 18 4.88889ZM16.8 9.77778H14.172L16.572 12.2222H16.8V9.77778ZM0 1.55222L3.732 5.35333C1.548 6.25778 0 8.44556 0 11C0 14.3733 2.688 17.1111 6 17.1111H10.8V14.7889H6C3.948 14.7889 2.28 13.09 2.28 11C2.28 9.05667 3.732 7.45556 5.592 7.24778L8.076 9.77778H7.2V12.2222H10.476L13.2 14.9967V17.1111H15.276L20.088 22L21.6 20.46L1.524 0L0 1.55222Z",fill:"#323232"})],-1)])],8,jd)):(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-button",onClick:kt,title:e.unref(V)("textEditor.toolbar.insertLink")},[...n[54]||(n[54]=[e.createElementVNode("svg",{width:"20",height:"14",viewBox:"0 0 27 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M2.565 7C2.565 4.606 4.4415 2.66 6.75 2.66H12.15V0H6.75C3.024 0 0 3.136 0 7C0 10.864 3.024 14 6.75 14H12.15V11.34H6.75C4.4415 11.34 2.565 9.394 2.565 7ZM8.1 8.4H18.9V5.6H8.1V8.4ZM20.25 0H14.85V2.66H20.25C22.5585 2.66 24.435 4.606 24.435 7C24.435 9.394 22.5585 11.34 20.25 11.34H14.85V14H20.25C23.976 14 27 10.864 27 7C27 3.136 23.976 0 20.25 0Z",fill:"#323232"})],-1)])],8,Yd)),n[63]||(n[63]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Jt("insertUnorderedList")}]),onClick:nt,title:e.unref(V)("textEditor.toolbar.bulletList")},[...n[56]||(n[56]=[e.createElementVNode("svg",{viewBox:"0 0 17 13",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.37838 5.2C0.615676 5.2 0 5.78067 0 6.5C0 7.21933 0.615676 7.8 1.37838 7.8C2.14108 7.8 2.75676 7.21933 2.75676 6.5C2.75676 5.78067 2.14108 5.2 1.37838 5.2ZM1.37838 0C0.615676 0 0 0.580667 0 1.3C0 2.01933 0.615676 2.6 1.37838 2.6C2.14108 2.6 2.75676 2.01933 2.75676 1.3C2.75676 0.580667 2.14108 0 1.37838 0ZM1.37838 10.4C0.615676 10.4 0 10.9893 0 11.7C0 12.4107 0.624865 13 1.37838 13C2.13189 13 2.75676 12.4107 2.75676 11.7C2.75676 10.9893 2.14108 10.4 1.37838 10.4ZM4.13514 12.5667H17V10.8333H4.13514V12.5667ZM4.13514 7.36667H17V5.63333H4.13514V7.36667ZM4.13514 0.433333V2.16667H17V0.433333H4.13514Z",fill:"#323232"})],-1)])],10,Kd),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Jt("insertOrderedList")}]),onClick:ft,title:e.unref(V)("textEditor.toolbar.numberList")},[...n[57]||(n[57]=[e.createElementVNode("svg",{viewBox:"0 0 18 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M0 12.1875H1.89474V12.6562H0.947368V13.5938H1.89474V14.0625H0V15H2.84211V11.25H0V12.1875ZM0.947368 3.75H1.89474V0H0V0.9375H0.947368V3.75ZM0 6.5625H1.70526L0 8.53125V9.375H2.84211V8.4375H1.13684L2.84211 6.46875V5.625H0V6.5625ZM4.73684 0.9375V2.8125H18V0.9375H4.73684ZM4.73684 14.0625H18V12.1875H4.73684V14.0625ZM4.73684 8.4375H18V6.5625H4.73684V8.4375Z",fill:"#323232"})],-1)])],10,Gd),n[64]||(n[64]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:"dss-toolbar-button",onClick:Wn,title:e.unref(V)("textEditor.toolbar.image")},[...n[58]||(n[58]=[e.createElementVNode("svg",{viewBox:"1.5 1.5 17 17",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M2.15065 15.8414L2.13398 15.8581C1.90898 15.3664 1.76732 14.8081 1.70898 14.1914C1.76732 14.7997 1.92565 15.3497 2.15065 15.8414Z",fill:"#323232"}),e.createElementVNode("path",{d:"M7.50091 8.65026C8.59628 8.65026 9.48425 7.76229 9.48425 6.66693C9.48425 5.57156 8.59628 4.68359 7.50091 4.68359C6.40555 4.68359 5.51758 5.57156 5.51758 6.66693C5.51758 7.76229 6.40555 8.65026 7.50091 8.65026Z",fill:"#323232"}),e.createElementVNode("path",{d:"M13.491 1.66699H6.50768C3.47435 1.66699 1.66602 3.47533 1.66602 6.50866V13.492C1.66602 14.4003 1.82435 15.192 2.13268 15.8587C2.84935 17.442 4.38268 18.3337 6.50768 18.3337H13.491C16.5243 18.3337 18.3327 16.5253 18.3327 13.492V11.5837V6.50866C18.3327 3.47533 16.5243 1.66699 13.491 1.66699ZM16.9743 10.417C16.3243 9.85866 15.2743 9.85866 14.6243 10.417L11.1577 13.392C10.5077 13.9503 9.45768 13.9503 8.80768 13.392L8.52435 13.1587C7.93268 12.642 6.99102 12.592 6.32435 13.042L3.20768 15.1337C3.02435 14.667 2.91602 14.1253 2.91602 13.492V6.50866C2.91602 4.15866 4.15768 2.91699 6.50768 2.91699H13.491C15.841 2.91699 17.0827 4.15866 17.0827 6.50866V10.5087L16.9743 10.417Z",fill:"#323232"})],-1)])],8,Qd),At.value&&ae.value?(e.openBlock(),e.createElementBlock("div",Jd)):e.createCommentVNode("",!0),At.value&&ae.value?(e.openBlock(),e.createElementBlock("div",{key:3,class:"dss-toolbar-button",title:e.unref(V)("textEditor.toolbar.comment"),onClick:Ul},[...n[59]||(n[59]=[e.createElementVNode("svg",{viewBox:"2 2 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M13.19 6H6.79C6.53 6 6.28 6.01 6.04 6.04C3.35 6.27 2 7.86 2 10.79V14.79C2 18.79 3.6 19.58 6.79 19.58H7.19C7.41 19.58 7.7 19.73 7.83 19.9L9.03 21.5C9.56 22.21 10.42 22.21 10.95 21.5L12.15 19.9C12.3 19.7 12.54 19.58 12.79 19.58H13.19C16.12 19.58 17.71 18.24 17.94 15.54C17.97 15.3 17.98 15.05 17.98 14.79V10.79C17.98 7.6 16.38 6 13.19 6ZM6.5 14C5.94 14 5.5 13.55 5.5 13C5.5 12.45 5.95 12 6.5 12C7.05 12 7.5 12.45 7.5 13C7.5 13.55 7.05 14 6.5 14ZM9.99 14C9.43 14 8.99 13.55 8.99 13C8.99 12.45 9.44 12 9.99 12C10.54 12 10.99 12.45 10.99 13C10.99 13.55 10.55 14 9.99 14ZM13.49 14C12.93 14 12.49 13.55 12.49 13C12.49 12.45 12.94 12 13.49 12C14.04 12 14.49 12.45 14.49 13C14.49 13.55 14.04 14 13.49 14Z",fill:"#323232"}),e.createElementVNode("path",{d:"M21.9802 6.79V10.79C21.9802 12.79 21.3602 14.15 20.1202 14.9C19.8202 15.08 19.4702 14.84 19.4702 14.49L19.4802 10.79C19.4802 6.79 17.1902 4.5 13.1902 4.5L7.10025 4.51C6.75025 4.51 6.51025 4.16 6.69025 3.86C7.44025 2.62 8.80025 2 10.7902 2H17.1902C20.3802 2 21.9802 3.6 21.9802 6.79Z",fill:"#323232"})],-1)])],8,e1)):e.createCommentVNode("",!0),E.askAi?(e.openBlock(),e.createElementBlock("div",t1)):e.createCommentVNode("",!0),E.askAi?(e.openBlock(),e.createElementBlock("div",l1,[e.createElementVNode("div",{class:"dss-toolbar-ai-button dss-toolbar-dropdown-toggle",onClick:n[12]||(n[12]=s=>Dn("askAi")),title:e.unref(V)("textEditor.toolbar.askAi")},[n[60]||(n[60]=e.createElementVNode("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M3.97363 4.34473C5.4926 6.769 7.88838 8.45732 10.7598 9.01855C9.21102 10.2499 7.99851 11.8959 7.30762 13.8027C7.21982 14.066 6.82404 14.066 6.69238 13.8027C5.59521 10.7746 3.18158 8.40476 0.197266 7.30762C-0.0658032 7.21978 -0.0656958 6.82515 0.197266 6.69336C1.62341 6.17665 2.90369 5.36753 3.97363 4.34473Z",fill:"#9784ba"}),e.createElementVNode("path",{d:"M6.66895 0.197266C6.75687 -0.0657415 7.1515 -0.0657945 7.2832 0.197266C8.38035 3.22532 10.7941 5.5952 13.7783 6.69238C14.0416 6.78015 14.0416 7.17497 13.7783 7.30664C12.6735 7.71282 11.6469 8.29371 10.7363 9.01758C7.86425 8.45633 5.46822 6.76786 3.94922 4.34277C5.15088 3.1939 6.08858 1.77583 6.66895 0.197266Z",fill:"#cfbeed"})],-1)),e.createElementVNode("span",o1,e.toDisplayString(e.unref(V)("textEditor.toolbar.askAi")),1)],8,n1),be.value==="askAi"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:n[13]||(n[13]=e.withModifiers(()=>{},["stop"]))},[e.renderSlot(a.$slots,"ask-ai-dropdown")])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),e.createElementVNode("div",a1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(E.customToolbarSlots,(s,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:i},[Hl(s)?(e.openBlock(),e.createElementBlock("div",s1,[e.renderSlot(a.$slots,s)])):e.createCommentVNode("",!0),Hl(s)&&i<E.customToolbarSlots.length-1&&Pn(i)?(e.openBlock(),e.createElementBlock("div",r1)):e.createCommentVNode("",!0)],64))),128))])],32)):e.createCommentVNode("",!0),(be.value==="paragraph"||be.value==="askAi")&&E.richText?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-dropdown-overlay",onClick:nl})):e.createCommentVNode("",!0),e.createVNode(ma,{showModal:$e.value,width:"500px",height:"55vh",onCloseModal:gt},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(V)("textEditor.link.editLink")),1)]),content:e.withCtx(()=>[e.createElementVNode("div",i1,[e.createElementVNode("div",c1,[e.createElementVNode("label",u1,e.toDisplayString(e.unref(V)("textEditor.link.altText")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"linkAltInput",ref:ze,type:"text","onUpdate:modelValue":n[15]||(n[15]=s=>mt.value=s),class:"dss-link-modal-input",placeholder:e.unref(V)("textEditor.link.enterAltText"),onKeyup:e.withKeys(sl,["enter"])},null,40,d1),[[e.vModelText,mt.value]])]),e.createElementVNode("div",m1,[e.createElementVNode("label",p1,e.toDisplayString(e.unref(V)("textEditor.link.url")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"linkUrlInput",ref:U,type:"text","onUpdate:modelValue":n[16]||(n[16]=s=>tt.value=s),class:"dss-link-modal-input",placeholder:e.unref(V)("textEditor.link.enterUrl"),onKeyup:e.withKeys(sl,["enter"])},null,40,f1),[[e.vModelText,tt.value]])])])]),actions:e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-cancel",onClick:gt},e.toDisplayString(e.unref(V)("textEditor.link.cancel")),1),e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-save",onClick:sl},e.toDisplayString(e.unref(V)("textEditor.link.save")),1)]),_:1},8,["showModal"]),e.createVNode(ma,{showModal:ht.value,width:"500px",height:"80vh",onCloseModal:Zn},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(yt.value?e.unref(V)("textEditor.image.editImage"):e.unref(V)("textEditor.image.addImage")),1)]),content:e.withCtx(()=>[e.createElementVNode("div",v1,[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-image-modal-tab",{"dss-image-modal-tab-active":Ne.value==="upload"}]),onClick:n[17]||(n[17]=s=>Ne.value="upload")},e.toDisplayString(e.unref(V)("textEditor.image.upload")),3),n[65]||(n[65]=e.createElementVNode("div",{class:"dss-image-modal-tab-separator"},null,-1)),e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-image-modal-tab",{"dss-image-modal-tab-active":Ne.value==="url"}]),onClick:n[18]||(n[18]=s=>Ne.value="url")},e.toDisplayString(e.unref(V)("textEditor.image.imageLink")),3)]),Ne.value==="upload"?(e.openBlock(),e.createElementBlock("div",h1,[e.createElementVNode("div",g1,[e.createElementVNode("div",y1,[on.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("label",k1,e.toDisplayString(e.unref(V)("textEditor.image.uploadImage")),1)),on.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-image-upload-preview",onClick:ho},[e.createElementVNode("img",{src:qt.value,alt:"Preview",class:"dss-image-preview-image"},null,8,C1),n[66]||(n[66]=e.createElementVNode("div",{class:"dss-image-preview-overlay"},[e.createElementVNode("svg",{width:"35",height:"35",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M14.06 9.02L14.98 9.94L5.92 19H5V18.08L14.06 9.02ZM17.66 3C17.41 3 17.15 3.1 16.96 3.29L15.13 5.12L18.88 8.87L20.71 7.04C21.1 6.65 21.1 6.02 20.71 5.63L18.37 3.29C18.17 3.1 17.92 3 17.66 3ZM14.06 6.19L3 17.25V21H6.75L17.81 9.94L14.06 6.19Z",fill:"white"})])],-1)),e.createElementVNode("input",{ref_key:"imageFileInput",ref:it,type:"file",accept:"image/*",class:"dss-image-file-input-hidden",onChange:Cn},null,544)])):(e.openBlock(),e.createElementBlock("input",{key:2,ref_key:"imageFileInput",ref:it,type:"file",accept:"image/*",class:"dss-link-modal-input dss-link-modal-input-image",onChange:Cn},null,544))]),e.createElementVNode("div",b1,[e.createElementVNode("label",x1,e.toDisplayString(e.unref(V)("textEditor.image.altText")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"imageAltInput",ref:Yt,type:"text","onUpdate:modelValue":n[19]||(n[19]=s=>dt.value=s),class:"dss-link-modal-input",placeholder:e.unref(V)("textEditor.image.enterAltText"),onKeyup:e.withKeys(Rl,["enter"])},null,40,w1),[[e.vModelText,dt.value]])]),e.createElementVNode("div",E1,[e.createElementVNode("label",S1,e.toDisplayString(e.unref(V)("textEditor.image.width")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":n[20]||(n[20]=s=>Ct.value=s),class:"dss-link-modal-input",placeholder:e.unref(V)("textEditor.image.auto"),onKeyup:e.withKeys(Rl,["enter"]),onInput:qn},null,40,V1),[[e.vModelText,Ct.value]])]),e.createElementVNode("div",N1,[e.createElementVNode("label",B1,e.toDisplayString(e.unref(V)("textEditor.image.height")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":n[21]||(n[21]=s=>wt.value=s),class:"dss-link-modal-input",placeholder:e.unref(V)("textEditor.image.auto"),onKeyup:e.withKeys(Rl,["enter"]),onInput:Bo},null,40,M1),[[e.vModelText,wt.value]])])])])):e.createCommentVNode("",!0),Ne.value==="url"?(e.openBlock(),e.createElementBlock("div",_1,[e.createElementVNode("div",$1,[e.createElementVNode("div",L1,[e.createElementVNode("label",A1,e.toDisplayString(e.unref(V)("textEditor.image.imageUrl")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"imageUrlInput",ref:Kt,type:"text","onUpdate:modelValue":n[22]||(n[22]=s=>Pe.value=s),class:"dss-link-modal-input",placeholder:e.unref(V)("textEditor.image.enterImageUrl"),onKeyup:e.withKeys(Rl,["enter"])},null,40,T1),[[e.vModelText,Pe.value]])]),e.createElementVNode("div",D1,[e.createElementVNode("label",H1,e.toDisplayString(e.unref(V)("textEditor.image.altText")),1),e.withDirectives(e.createElementVNode("input",{type:"text","onUpdate:modelValue":n[23]||(n[23]=s=>dt.value=s),class:"dss-link-modal-input",placeholder:e.unref(V)("textEditor.image.enterAltText"),onKeyup:e.withKeys(Rl,["enter"])},null,40,R1),[[e.vModelText,dt.value]])]),e.createElementVNode("div",F1,[e.createElementVNode("label",I1,e.toDisplayString(e.unref(V)("textEditor.image.width")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":n[24]||(n[24]=s=>Ct.value=s),class:"dss-link-modal-input",placeholder:e.unref(V)("textEditor.image.auto"),onKeyup:e.withKeys(Rl,["enter"]),onInput:qn},null,40,z1),[[e.vModelText,Ct.value]])]),e.createElementVNode("div",P1,[e.createElementVNode("label",O1,e.toDisplayString(e.unref(V)("textEditor.image.height")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":n[25]||(n[25]=s=>wt.value=s),class:"dss-link-modal-input",placeholder:e.unref(V)("textEditor.image.auto"),onKeyup:e.withKeys(Rl,["enter"]),onInput:Bo},null,40,W1),[[e.vModelText,wt.value]])])])])):e.createCommentVNode("",!0)]),actions:e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-cancel",onClick:Zn},e.toDisplayString(e.unref(V)("textEditor.image.cancel")),1),e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-save",onClick:Rl},e.toDisplayString(e.unref(V)("textEditor.image.save")),1)]),_:1},8,["showModal"]),E.showTitle?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(["dss-text-editor-title-wrapper",{"dss-text-editor-no-border-bottom":ql.value&&vl.value}])},[e.createElementVNode("p",null,e.toDisplayString(e.unref(V)("textEditor.labels.title")),1),e.createElementVNode("div",q1,[vl.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Z1,[E.title?(e.openBlock(),e.createElementBlock("span",U1,e.toDisplayString(E.title),1)):(e.openBlock(),e.createElementBlock("span",X1,e.toDisplayString(xl.value),1))])),e.createElementVNode("textarea",{ref_key:"titleInputRef",ref:xe,value:E.title,onInput:lt,onFocus:Te,onBlur:pt,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-title-input",{"dss-text-editor-title-input-blurred":!vl.value}]),placeholder:xl.value,disabled:E.disabled,rows:"1"},null,42,Y1)])],2)):e.createCommentVNode("",!0),E.showTitle&&ql.value&&vl.value?(e.openBlock(),e.createElementBlock("div",j1,[e.renderSlot(a.$slots,"title-slot")])):e.createCommentVNode("",!0),E.showDescription?(e.openBlock(),e.createElementBlock("div",{key:4,class:e.normalizeClass(["dss-text-editor-description-wrapper",{"dss-text-editor-no-border-bottom":rl.value&&M.value}])},[e.createElementVNode("p",null,e.toDisplayString(e.unref(V)("textEditor.labels.description")),1),e.createElementVNode("div",K1,[M.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",G1,[E.description?(e.openBlock(),e.createElementBlock("span",Q1,e.toDisplayString(E.description),1)):(e.openBlock(),e.createElementBlock("span",J1,e.toDisplayString(Fl.value),1))])),e.createElementVNode("textarea",{ref_key:"descriptionInputRef",ref:Ke,value:E.description,onInput:wl,onFocus:il,onBlur:kl,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-description-input",{"dss-text-editor-description-input-blurred":!M.value}]),placeholder:Fl.value,disabled:E.disabled,rows:"1"},null,42,em)])],2)):e.createCommentVNode("",!0),E.showDescription&&rl.value&&M.value?(e.openBlock(),e.createElementBlock("div",tm,[e.renderSlot(a.$slots,"description-slot")])):e.createCommentVNode("",!0),At.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:6},e.renderList(oe.value,s=>(e.openBlock(),e.createElementBlock("div",{key:s.id,class:e.normalizeClass(["editor-comment-marker-group",{"editor-comment-marker-active":Cl.value===s.id,"editor-comment-marker-group-out-of-view":s.opacity===0}]),"data-comment-id":s.id,style:e.normalizeStyle({top:s.top+"px"}),onMouseenter:i=>ta(s),onMouseleave:la},[s.firstUser?(e.openBlock(),e.createElementBlock("div",{key:0,class:"editor-comment-marker editor-comment-marker-first",onClick:e.withModifiers(i=>eo(s),["stop"])},[s.firstUser.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:s.firstUser.avatar,alt:s.firstUser.name||"avatar"},null,8,om)):(e.openBlock(),e.createElementBlock("span",am,e.toDisplayString(s.firstUser.initials||(s.firstUser.name?s.firstUser.name.charAt(0):"")),1))],8,nm)):e.createCommentVNode("",!0),s.secondUser?(e.openBlock(),e.createElementBlock("div",{key:1,class:"editor-comment-marker editor-comment-marker-second",onClick:e.withModifiers(i=>eo(s),["stop"])},[s.secondUser.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:s.secondUser.avatar,alt:s.secondUser.name||"avatar"},null,8,rm)):(e.openBlock(),e.createElementBlock("span",im,e.toDisplayString(s.secondUser.initials||(s.secondUser.name?s.secondUser.name.charAt(0):"")),1))],8,sm)):e.createCommentVNode("",!0),s.additionalCount>0?(e.openBlock(),e.createElementBlock("div",{key:2,class:"editor-comment-marker editor-comment-marker-additional",style:e.normalizeStyle({top:s.secondUser?"30px":"15px"}),"data-has-second-user":s.secondUser?"true":"false",onClick:e.withModifiers(i=>eo(s),["stop"])},[e.createElementVNode("span",um,"+"+e.toDisplayString(s.additionalCount),1)],12,cm)):e.createCommentVNode("",!0)],46,lm))),128)):e.createCommentVNode("",!0),E.richText?(e.openBlock(),e.createElementBlock("div",gm,[e.createElementVNode("div",{ref_key:"editorRef",ref:v,contenteditable:"true",spellcheck:"false",class:e.normalizeClass(["dss-text-editor-content",{"dss-text-editor-content-disabled":E.disabled,"dss-text-editor-fixed-height":E.fixedHeight}]),style:e.normalizeStyle(nn.value),onInput:_t,onBlur:vn,onClick:Vo,onMouseup:Kn,onKeyup:Kn,onKeydown:jo,onPaste:wo,onMousemove:Bl,onMouseleave:ul},null,38),e.createVNode(e.Transition,{name:"comment-overlay"},{default:e.withCtx(()=>[At.value&&Cl.value!==null?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-comment-overlay",style:e.normalizeStyle(y.value)},[Z.value||at.value.length>0?(e.openBlock(),e.createElementBlock("div",ym,[e.createElementVNode("div",km,[Z.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-comment-selection",innerHTML:Z.value},null,8,Cm)):e.createCommentVNode("",!0)]),e.createElementVNode("div",bm,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(at.value,(s,i)=>(e.openBlock(),e.createElementBlock("div",{key:i,class:"dss-comment-message"},[s.user&&(s.user.avatar||s.user.initials||s.user.name)?(e.openBlock(),e.createElementBlock("div",xm,[e.createElementVNode("div",wm,[s.user.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:s.user.avatar,alt:s.user.name||"avatar"},null,8,Em)):(e.openBlock(),e.createElementBlock("span",Sm,e.toDisplayString(s.user.initials||(s.user.name?s.user.name.charAt(0):"")),1))])])):e.createCommentVNode("",!0),e.createElementVNode("div",Vm,[e.createElementVNode("div",Nm,[e.createElementVNode("div",Bm,e.toDisplayString(s.user&&s.user.name||"Comment"),1),s.createdAt?(e.openBlock(),e.createElementBlock("div",Mm,e.toDisplayString(T(new Date(s.createdAt))),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:e.normalizeClass(["dss-comment-body-text",{"comment-started":z(s.text)||s.class==="comment-started"}])},e.toDisplayString(s.text||""),3)]),L.commentUser&&s.user&&s.user.id===L.commentUser.id&&!z(s.text)?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-comment-delete-button",onClick:e.withModifiers(c=>mo(s,i),["stop"]),title:e.unref(V)("textEditor.comment.delete")||"Delete comment"},[...n[68]||(n[68]=[e.createElementVNode("svg",{width:"22",height:"25",viewBox:"0 0 22 25",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M19.5986 21.3535C19.5985 23.3679 18.1282 25 16.2891 25H5.30957C3.48166 24.9997 2.00011 23.3702 2 21.3535V8H19.5986V21.3535ZM8 11C7.44772 11 7 11.4477 7 12V20C7 20.5523 7.44772 21 8 21C8.55229 21 9 20.5523 9 20V12C9 11.4477 8.55229 11 8 11ZM14 11C13.4477 11 13 11.4477 13 12V20C13 20.5523 13.4477 21 14 21C14.5523 21 15 20.5523 15 20V12C15 11.4477 14.5523 11 14 11ZM13.2002 0C15.0227 0.000104554 16.4999 1.46937 16.5 3.27246V4.36328H20.9092C21.5117 4.36348 21.9998 4.84789 22 5.4541C22 6.05615 21.4986 6.54569 20.9092 6.5459H1.09082C0.488195 6.54569 0 6.06052 0 5.4541C0.000246661 4.85225 0.50153 4.36349 1.09082 4.36328H5.5L5.50098 3.27246C5.50112 1.46505 6.98382 0.000171185 8.80078 0H13.2002ZM8.79004 2.18164C8.19615 2.18167 7.70034 2.67042 7.7002 3.27246C7.7002 3.87899 8.18837 4.36325 8.79004 4.36328H13.21C13.8039 4.36325 14.2998 3.87462 14.2998 3.27246C14.2997 2.66606 13.8115 2.18167 13.21 2.18164H8.79004Z",fill:"#323232"})],-1)])],8,_m)):e.createCommentVNode("",!0)]))),128))])])):e.createCommentVNode("",!0),e.createElementVNode("div",$m,[e.withDirectives(e.createElementVNode("textarea",{ref_key:"commentInputRef",ref:w,"onUpdate:modelValue":n[26]||(n[26]=s=>g.value=s),class:"dss-comment-input",rows:"1",placeholder:e.unref(V)("textEditor.comment.placeholder"),onKeydown:e.withKeys(e.withModifiers(gn,["prevent","stop"]),["enter"]),onInput:n[27]||(n[27]=()=>{if(w.value){const s=w.value;s.style.height="auto",s.style.height=`${s.scrollHeight}px`}})},null,40,Lm),[[e.vModelText,g.value]]),e.createElementVNode("button",{type:"button",class:"dss-comment-send-button",onClick:e.withModifiers(gn,["stop"])},[...n[69]||(n[69]=[e.createElementVNode("svg",{width:"21",height:"18",viewBox:"0 0 21 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M0.00999999 18L21 9L0.00999999 0L0 7L15 9L0 11L0.00999999 18Z",fill:"#31312F"})],-1)])])])],4)):e.createCommentVNode("",!0)]),_:1}),e.createElementVNode("div",Am,[e.createElementVNode("div",Tm,[e.createElementVNode("span",Dm,e.toDisplayString(tl.value)+" "+e.toDisplayString(tl.value===1?e.unref(V)("textEditor.footer.word"):e.unref(V)("textEditor.footer.words")),1),n[70]||(n[70]=e.createElementVNode("span",{class:"dss-text-editor-footer-separator"},"•",-1)),e.createElementVNode("span",Hm,e.toDisplayString(jl.value)+" "+e.toDisplayString(jl.value===1?e.unref(V)("textEditor.footer.character"):e.unref(V)("textEditor.footer.characters")),1)])])])):(e.openBlock(),e.createElementBlock("div",dm,[e.createElementVNode("textarea",{value:E.modelValue,onInput:_,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-textarea",{"dss-text-editor-fixed-height":E.fixedHeight}]),placeholder:dn.value,rows:E.rows,disabled:E.disabled,style:e.normalizeStyle(yl.value)},null,46,mm),e.createElementVNode("div",pm,[e.createElementVNode("div",fm,[e.createElementVNode("span",vm,e.toDisplayString(tl.value)+" "+e.toDisplayString(tl.value===1?e.unref(V)("textEditor.footer.word"):e.unref(V)("textEditor.footer.words")),1),n[67]||(n[67]=e.createElementVNode("span",{class:"dss-text-editor-footer-separator"},"•",-1)),e.createElementVNode("span",hm,e.toDisplayString(jl.value)+" "+e.toDisplayString(jl.value===1?e.unref(V)("textEditor.footer.character"):e.unref(V)("textEditor.footer.characters")),1)])])])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[Y.value&&me.value&&v.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-link-popup",style:e.normalizeStyle(F.value),onMouseenter:n[28]||(n[28]=s=>ue.value=!0),onMouseleave:Ol},[e.createElementVNode("span",{class:"dss-link-popup-url",onClick:e.withModifiers(Ut,["stop"]),title:me.value},e.toDisplayString(me.value),9,Rm),e.createElementVNode("button",{type:"button",class:"dss-link-popup-edit",onClick:e.withModifiers(Pt,["stop"]),title:e.unref(V)("textEditor.link.editLink")},[(e.openBlock(),e.createElementBlock("svg",Im,[...n[71]||(n[71]=[e.createElementVNode("g",null,[e.createElementVNode("path",{d:"M25.264 1.008c-.524 0-1.049.197-1.443.592l-2.248 2.248 6.58 6.578 2.246-2.248a2.058 2.058 0 0 0 0-2.887L26.707 1.6a2.032 2.032 0 0 0-1.443-.592zm-5.106 4.254L3.889 21.532a1.022 1.022 0 0 0-.242.391c-.729 2.187-2.035 5.759-2.6 7.803a1 1 0 0 0 1.188 1.24c2.432-.562 5.687-1.896 7.84-2.613a1.03 1.03 0 0 0 .392-.236l16.269-16.275z",fill:"hsl(0, 0%, 98%)",opacity:"1","data-original":"#000000",class:""})],-1)])]))],8,Fm)],36)):e.createCommentVNode("",!0)])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[X.value&&ge.value&&v.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-link-popup",style:e.normalizeStyle(W.value),onMouseenter:n[29]||(n[29]=s=>G.value=!0),onMouseleave:Xl},[e.createElementVNode("div",zm,[ge.value===e.unref(V)("textEditor.image.noAlt")?(e.openBlock(),e.createElementBlock("div",Pm,[...n[72]||(n[72]=[e.createElementVNode("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M10 0C4.5 0 0 4.5 0 10C0 15.5 4.5 20 10 20C15.5 20 20 15.5 20 10C20 4.5 15.5 0 10 0ZM2 10C2 5.6 5.6 2 10 2C11.8 2 13.5 2.6 14.9 3.7L3.7 14.9C2.6 13.5 2 11.8 2 10ZM10 18C8.2 18 6.5 17.4 5.1 16.3L16.3 5.1C17.4 6.5 18 8.2 18 10C18 14.4 14.4 18 10 18Z",fill:"#fafafa"})],-1)])])):e.createCommentVNode("",!0),e.createElementVNode("p",{class:"dss-image-popup-alt",title:ge.value},e.toDisplayString(ge.value),9,Om)]),e.createElementVNode("button",{type:"button",class:"dss-link-popup-edit",onClick:e.withModifiers(Mo,["stop"]),title:e.unref(V)("textEditor.image.editImage")},[(e.openBlock(),e.createElementBlock("svg",qm,[...n[73]||(n[73]=[e.createElementVNode("g",null,[e.createElementVNode("path",{d:"M25.264 1.008c-.524 0-1.049.197-1.443.592l-2.248 2.248 6.58 6.578 2.246-2.248a2.058 2.058 0 0 0 0-2.887L26.707 1.6a2.032 2.032 0 0 0-1.443-.592zm-5.106 4.254L3.889 21.532a1.022 1.022 0 0 0-.242.391c-.729 2.187-2.035 5.759-2.6 7.803a1 1 0 0 0 1.188 1.24c2.432-.562 5.687-1.896 7.84-2.613a1.03 1.03 0 0 0 .392-.236l16.269-16.275z",fill:"hsl(0, 0%, 98%)",opacity:"1","data-original":"#000000",class:""})],-1)])]))],8,Wm)],36)):e.createCommentVNode("",!0)])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[E.floatingToolbar&&E.richText&&Qe.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"floatingToolbarRef",ref:Je,class:"dss-floating-toolbar",style:e.normalizeStyle(Ce.value),onMousedown:n[44]||(n[44]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("div",Zm,[e.createElementVNode("div",{class:"dss-toolbar-button",onClick:e.withModifiers(hn,["stop"]),title:e.unref(V)("textEditor.toolbar.undo")},[...n[74]||(n[74]=[e.createElementVNode("svg",{viewBox:"0 0 18 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M9.23302 0.888889C6.90278 0.888889 4.79238 1.76889 3.16561 3.2L0 0V8H7.91402L4.73083 4.78222C5.9531 3.75111 7.50953 3.11111 9.23302 3.11111C12.3459 3.11111 14.9927 5.16444 15.916 8L18 7.30667C16.7777 3.58222 13.3219 0.888889 9.23302 0.888889Z",fill:"#323232"})],-1)])],8,Um),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-disabled":!Vl.value}]),onClick:e.withModifiers(An,["stop"]),title:e.unref(V)("textEditor.toolbar.redo")},[...n[75]||(n[75]=[e.createElementVNode("svg",{viewBox:"0 0 18 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M14.8328 3.2C13.2053 1.76889 11.0938 0.888889 8.76246 0.888889C4.67155 0.888889 1.21408 3.58222 0 7.30667L2.07625 8C3 5.16444 5.6393 3.11111 8.76246 3.11111C10.478 3.11111 12.044 3.75111 13.2669 4.78222L10.0821 8H18V0L14.8328 3.2Z",fill:"#323232"})],-1)])],10,Xm),n[89]||(n[89]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",Ym,[e.createElementVNode("div",{class:"dss-toolbar-button dss-toolbar-dropdown-toggle",onClick:n[30]||(n[30]=e.withModifiers(s=>Gn("paragraph"),["stop"])),title:e.unref(V)("textEditor.toolbar.paragraphFormat")},[A.value==="h1"?(e.openBlock(),e.createElementBlock("img",{key:0,src:O.h1,alt:"H1",class:"dss-toolbar-heading-icon"},null,8,Km)):A.value==="h2"?(e.openBlock(),e.createElementBlock("img",{key:1,src:O.h2,alt:"H2",class:"dss-toolbar-heading-icon"},null,8,Gm)):A.value==="h3"?(e.openBlock(),e.createElementBlock("img",{key:2,src:O.h3,alt:"H3",class:"dss-toolbar-heading-icon"},null,8,Qm)):A.value==="h4"?(e.openBlock(),e.createElementBlock("img",{key:3,src:O.h4,alt:"H4",class:"dss-toolbar-heading-icon"},null,8,Jm)):A.value==="h5"?(e.openBlock(),e.createElementBlock("img",{key:4,src:O.h5,alt:"H5",class:"dss-toolbar-heading-icon"},null,8,e2)):A.value==="h6"?(e.openBlock(),e.createElementBlock("img",{key:5,src:O.h6,alt:"H6",class:"dss-toolbar-heading-icon"},null,8,t2)):(e.openBlock(),e.createElementBlock("svg",l2,[...n[76]||(n[76]=[e.createElementVNode("path",{d:"M4.33333 8.61539V14H6.5V2.15385H8.66667V14H10.8333V2.15385H13V0H4.33333C1.93917 0 0 1.92769 0 4.30769C0 6.68769 1.93917 8.61539 4.33333 8.61539Z",fill:"#323232"},null,-1)])])),n[77]||(n[77]=e.createElementVNode("span",{class:"dss-toolbar-dropdown-arrow"},"˅",-1))],8,jm),ut.value==="paragraph"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:n[38]||(n[38]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[31]||(n[31]=s=>R("<h1>"))},[e.createElementVNode("h1",null,e.toDisplayString(e.unref(V)("textEditor.paragraph.heading1")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[32]||(n[32]=s=>R("<h2>"))},[e.createElementVNode("h2",null,e.toDisplayString(e.unref(V)("textEditor.paragraph.heading2")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[33]||(n[33]=s=>R("<h3>"))},[e.createElementVNode("h3",null,e.toDisplayString(e.unref(V)("textEditor.paragraph.heading3")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[34]||(n[34]=s=>R("<h4>"))},[e.createElementVNode("h4",null,e.toDisplayString(e.unref(V)("textEditor.paragraph.heading4")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[35]||(n[35]=s=>R("<h5>"))},[e.createElementVNode("h5",null,e.toDisplayString(e.unref(V)("textEditor.paragraph.heading5")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[36]||(n[36]=s=>R("<h6>"))},[e.createElementVNode("h6",null,e.toDisplayString(e.unref(V)("textEditor.paragraph.heading6")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[37]||(n[37]=s=>R("<p>"))},[e.createElementVNode("p",null,e.toDisplayString(e.unref(V)("textEditor.paragraph.paragraph")),1)])])):e.createCommentVNode("",!0)]),n[90]||(n[90]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Jt("bold")}]),onClick:n[39]||(n[39]=e.withModifiers(s=>Ql("bold"),["stop"])),title:e.unref(V)("textEditor.toolbar.bold")},[...n[78]||(n[78]=[e.createElementVNode("svg",{viewBox:"0 0 11 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M8.8 6.79C9.79256 6.12 10.4884 5.02 10.4884 4C10.4884 1.74 8.69767 0 6.39535 0H0V14H7.20372C9.34233 14 11 12.3 11 10.21C11 8.69 10.12 7.39 8.8 6.79ZM3.06977 2.5H6.13953C6.98884 2.5 7.67442 3.17 7.67442 4C7.67442 4.83 6.98884 5.5 6.13953 5.5H3.06977V2.5ZM6.65116 11.5H3.06977V8.5H6.65116C7.50047 8.5 8.18605 9.17 8.18605 10C8.18605 10.83 7.50047 11.5 6.65116 11.5Z",fill:"currentColor"})],-1)])],10,n2),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Jt("italic")}]),onClick:n[40]||(n[40]=e.withModifiers(s=>Ql("italic"),["stop"])),title:e.unref(V)("textEditor.toolbar.italic")},[...n[79]||(n[79]=[e.createElementVNode("svg",{viewBox:"0 0 12 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M4 0V3H6.21L2.79 11H0V14H8V11H5.79L9.21 3H12V0H4Z",fill:"#323232"})],-1)])],10,o2),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Jt("underline")}]),onClick:n[41]||(n[41]=e.withModifiers(s=>Ql("underline"),["stop"])),title:e.unref(V)("textEditor.toolbar.underline")},[...n[80]||(n[80]=[e.createElementVNode("svg",{viewBox:"0 0 11 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M5.5 10.8889C8.10071 10.8889 10.2143 8.79667 10.2143 6.22222V0H8.25V6.22222C8.25 7.72333 7.01643 8.94444 5.5 8.94444C3.98357 8.94444 2.75 7.72333 2.75 6.22222V0H0.785714V6.22222C0.785714 8.79667 2.89929 10.8889 5.5 10.8889ZM0 12.4444V14H11V12.4444H0Z",fill:"#323232"})],-1)])],10,a2),n[91]||(n[91]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":je.value}]),onClick:e.withModifiers(zt,["stop"]),title:e.unref(V)("textEditor.toolbar.citation")},[...n[81]||(n[81]=[e.createElementVNode("svg",{viewBox:"0 0 20 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.42857 14H5.71429L8.57143 8.4V0H0V8.4H4.28571L1.42857 14ZM12.8571 14H17.1429L20 8.4V0H11.4286V8.4H15.7143L12.8571 14Z",fill:"currentColor"})],-1)])],10,s2),n[92]||(n[92]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),ke.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-button",onClick:e.withModifiers(Ml,["stop"]),title:e.unref(V)("textEditor.toolbar.removeLink")},[...n[83]||(n[83]=[e.createElementVNode("svg",{width:"20",height:"20",viewBox:"0 0 24 22",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M18 4.88889H13.2V7.21111H18C20.052 7.21111 21.72 8.91 21.72 11C21.72 12.7478 20.544 14.2144 18.948 14.6422L20.7 16.4267C22.656 15.4122 24 13.3833 24 11C24 7.62667 21.312 4.88889 18 4.88889ZM16.8 9.77778H14.172L16.572 12.2222H16.8V9.77778ZM0 1.55222L3.732 5.35333C1.548 6.25778 0 8.44556 0 11C0 14.3733 2.688 17.1111 6 17.1111H10.8V14.7889H6C3.948 14.7889 2.28 13.09 2.28 11C2.28 9.05667 3.732 7.45556 5.592 7.24778L8.076 9.77778H7.2V12.2222H10.476L13.2 14.9967V17.1111H15.276L20.088 22L21.6 20.46L1.524 0L0 1.55222Z",fill:"#323232"})],-1)])],8,i2)):(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-button",onClick:e.withModifiers(kt,["stop"]),title:e.unref(V)("textEditor.toolbar.insertLink")},[...n[82]||(n[82]=[e.createElementVNode("svg",{width:"20",height:"14",viewBox:"0 0 27 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M2.565 7C2.565 4.606 4.4415 2.66 6.75 2.66H12.15V0H6.75C3.024 0 0 3.136 0 7C0 10.864 3.024 14 6.75 14H12.15V11.34H6.75C4.4415 11.34 2.565 9.394 2.565 7ZM8.1 8.4H18.9V5.6H8.1V8.4ZM20.25 0H14.85V2.66H20.25C22.5585 2.66 24.435 4.606 24.435 7C24.435 9.394 22.5585 11.34 20.25 11.34H14.85V14H20.25C23.976 14 27 10.864 27 7C27 3.136 23.976 0 20.25 0Z",fill:"#323232"})],-1)])],8,r2)),n[93]||(n[93]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Jt("insertUnorderedList")}]),onClick:e.withModifiers(nt,["stop"]),title:e.unref(V)("textEditor.toolbar.bulletList")},[...n[84]||(n[84]=[e.createElementVNode("svg",{viewBox:"0 0 17 13",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.37838 5.2C0.615676 5.2 0 5.78067 0 6.5C0 7.21933 0.615676 7.8 1.37838 7.8C2.14108 7.8 2.75676 7.21933 2.75676 6.5C2.75676 5.78067 2.14108 5.2 1.37838 5.2ZM1.37838 0C0.615676 0 0 0.580667 0 1.3C0 2.01933 0.615676 2.6 1.37838 2.6C2.14108 2.6 2.75676 2.01933 2.75676 1.3C2.75676 0.580667 2.14108 0 1.37838 0ZM1.37838 10.4C0.615676 10.4 0 10.9893 0 11.7C0 12.4107 0.624865 13 1.37838 13C2.13189 13 2.75676 12.4107 2.75676 11.7C2.75676 10.9893 2.14108 10.4 1.37838 10.4ZM4.13514 12.5667H17V10.8333H4.13514V12.5667ZM4.13514 7.36667H17V5.63333H4.13514V7.36667ZM4.13514 0.433333V2.16667H17V0.433333H4.13514Z",fill:"#323232"})],-1)])],10,c2),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Jt("insertOrderedList")}]),onClick:e.withModifiers(ft,["stop"]),title:e.unref(V)("textEditor.toolbar.numberList")},[...n[85]||(n[85]=[e.createElementVNode("svg",{viewBox:"0 0 18 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M0 12.1875H1.89474V12.6562H0.947368V13.5938H1.89474V14.0625H0V15H2.84211V11.25H0V12.1875ZM0.947368 3.75H1.89474V0H0V0.9375H0.947368V3.75ZM0 6.5625H1.70526L0 8.53125V9.375H2.84211V8.4375H1.13684L2.84211 6.46875V5.625H0V6.5625ZM4.73684 0.9375V2.8125H18V0.9375H4.73684ZM4.73684 14.0625H18V12.1875H4.73684V14.0625ZM4.73684 8.4375H18V6.5625H4.73684V8.4375Z",fill:"#323232"})],-1)])],10,u2),n[94]||(n[94]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:"dss-toolbar-button",onClick:e.withModifiers(Wn,["stop"]),title:e.unref(V)("textEditor.toolbar.image")},[...n[86]||(n[86]=[e.createElementVNode("svg",{viewBox:"1.5 1.5 17 17",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M2.15065 15.8414L2.13398 15.8581C1.90898 15.3664 1.76732 14.8081 1.70898 14.1914C1.76732 14.7997 1.92565 15.3497 2.15065 15.8414Z",fill:"#323232"}),e.createElementVNode("path",{d:"M7.50091 8.65026C8.59628 8.65026 9.48425 7.76229 9.48425 6.66693C9.48425 5.57156 8.59628 4.68359 7.50091 4.68359C6.40555 4.68359 5.51758 5.57156 5.51758 6.66693C5.51758 7.76229 6.40555 8.65026 7.50091 8.65026Z",fill:"#323232"}),e.createElementVNode("path",{d:"M13.491 1.66699H6.50768C3.47435 1.66699 1.66602 3.47533 1.66602 6.50866V13.492C1.66602 14.4003 1.82435 15.192 2.13268 15.8587C2.84935 17.442 4.38268 18.3337 6.50768 18.3337H13.491C16.5243 18.3337 18.3327 16.5253 18.3327 13.492V11.5837V6.50866C18.3327 3.47533 16.5243 1.66699 13.491 1.66699ZM16.9743 10.417C16.3243 9.85866 15.2743 9.85866 14.6243 10.417L11.1577 13.392C10.5077 13.9503 9.45768 13.9503 8.80768 13.392L8.52435 13.1587C7.93268 12.642 6.99102 12.592 6.32435 13.042L3.20768 15.1337C3.02435 14.667 2.91602 14.1253 2.91602 13.492V6.50866C2.91602 4.15866 4.15768 2.91699 6.50768 2.91699H13.491C15.841 2.91699 17.0827 4.15866 17.0827 6.50866V10.5087L16.9743 10.417Z",fill:"#323232"})],-1)])],8,d2),At.value?(e.openBlock(),e.createElementBlock("div",m2)):e.createCommentVNode("",!0),At.value?(e.openBlock(),e.createElementBlock("div",{key:3,class:"dss-toolbar-button",title:e.unref(V)("textEditor.toolbar.comment"),onClick:e.withModifiers(Ul,["stop"])},[...n[87]||(n[87]=[e.createElementVNode("svg",{viewBox:"2 2 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M13.19 6H6.79C6.53 6 6.28 6.01 6.04 6.04C3.35 6.27 2 7.86 2 10.79V14.79C2 18.79 3.6 19.58 6.79 19.58H7.19C7.41 19.58 7.7 19.73 7.83 19.9L9.03 21.5C9.56 22.21 10.42 22.21 10.95 21.5L12.15 19.9C12.3 19.7 12.54 19.58 12.79 19.58H13.19C16.12 19.58 17.71 18.24 17.94 15.54C17.97 15.3 17.98 15.05 17.98 14.79V10.79C17.98 7.6 16.38 6 13.19 6ZM6.5 14C5.94 14 5.5 13.55 5.5 13C5.5 12.45 5.95 12 6.5 12C7.05 12 7.5 12.45 7.5 13C7.5 13.55 7.05 14 6.5 14ZM9.99 14C9.43 14 8.99 13.55 8.99 13C8.99 12.45 9.44 12 9.99 12C10.54 12 10.99 12.45 10.99 13C10.99 13.55 10.55 14 9.99 14ZM13.49 14C12.93 14 12.49 13.55 12.49 13C12.49 12.45 12.94 12 13.49 12C14.04 12 14.49 12.45 14.49 13C14.49 13.55 14.04 14 13.49 14Z",fill:"#323232"}),e.createElementVNode("path",{d:"M21.9802 6.79V10.79C21.9802 12.79 21.3602 14.15 20.1202 14.9C19.8202 15.08 19.4702 14.84 19.4702 14.49L19.4802 10.79C19.4802 6.79 17.1902 4.5 13.1902 4.5L7.10025 4.51C6.75025 4.51 6.51025 4.16 6.69025 3.86C7.44025 2.62 8.80025 2 10.7902 2H17.1902C20.3802 2 21.9802 3.6 21.9802 6.79Z",fill:"#323232"})],-1)])],8,p2)):e.createCommentVNode("",!0),E.askAi?(e.openBlock(),e.createElementBlock("div",f2)):e.createCommentVNode("",!0),E.askAi?(e.openBlock(),e.createElementBlock("div",v2,[e.createElementVNode("div",{class:"dss-toolbar-ai-button dss-toolbar-ai-float dss-toolbar-dropdown-toggle",onClick:n[42]||(n[42]=e.withModifiers(s=>Gn("askAi"),["stop"])),title:e.unref(V)("textEditor.toolbar.askAi")},[n[88]||(n[88]=e.createElementVNode("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M3.97363 4.34473C5.4926 6.769 7.88838 8.45732 10.7598 9.01855C9.21102 10.2499 7.99851 11.8959 7.30762 13.8027C7.21982 14.066 6.82404 14.066 6.69238 13.8027C5.59521 10.7746 3.18158 8.40476 0.197266 7.30762C-0.0658032 7.21978 -0.0656958 6.82515 0.197266 6.69336C1.62341 6.17665 2.90369 5.36753 3.97363 4.34473Z",fill:"#9784ba"}),e.createElementVNode("path",{d:"M6.66895 0.197266C6.75687 -0.0657415 7.1515 -0.0657945 7.2832 0.197266C8.38035 3.22532 10.7941 5.5952 13.7783 6.69238C14.0416 6.78015 14.0416 7.17497 13.7783 7.30664C12.6735 7.71282 11.6469 8.29371 10.7363 9.01758C7.86425 8.45633 5.46822 6.76786 3.94922 4.34277C5.15088 3.1939 6.08858 1.77583 6.66895 0.197266Z",fill:"#cfbeed"})],-1)),e.createElementVNode("span",g2,e.toDisplayString(e.unref(V)("textEditor.toolbar.askAi")),1)],8,h2),ut.value==="askAi"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:n[43]||(n[43]=e.withModifiers(()=>{},["stop"]))},[e.renderSlot(a.$slots,"ask-ai-dropdown")])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),wn.value?(e.openBlock(),e.createElementBlock("div",y2,[E.askAi&&wn.value?(e.openBlock(),e.createElementBlock("div",k2)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(E.customToolbarSlots,(s,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:i},[Hl(s)&&pn(s)?(e.openBlock(),e.createElementBlock("div",C2,[e.renderSlot(a.$slots,s)])):e.createCommentVNode("",!0),Hl(s)&&pn(s)&&i<E.customToolbarSlots.length-1&&mn(i)?(e.openBlock(),e.createElementBlock("div",b2)):e.createCommentVNode("",!0)],64))),128))])):e.createCommentVNode("",!0)],36)):e.createCommentVNode("",!0)]))],6))}}),E2={class:"dss-color-picker__section-title"},S2={class:"dss-color-picker__presets-row"},V2=["title","onClick"],N2={key:1,class:"dss-color-picker__section"},B2={class:"dss-color-picker__presets-row"},M2=["title","onClick"],_2={key:2,class:"dss-color-picker__section"},$2={class:"dss-color-picker__section-header"},L2={class:"dss-color-picker__presets-row"},A2=["title","onClick"],T2=["onClick"],D2={key:1,class:"dss-color-picker__presets-row dss-color-picker__presets-row--standalone"},H2=["title","onClick"],R2={class:"dss-color-picker__input-row"},F2=["value"],I2={__name:"DSSColorPicker",props:{modelValue:{type:String,default:"#b8a5de"},disabled:{type:Boolean,default:!1},presetColors:{type:Array,default:()=>[]},presetGroups:{type:Array,default:null},max:{type:Number,default:12},initialPresetCount:{type:Number,default:null},disableCustomColors:{type:Boolean,default:!1}},emits:["update:modelValue","update:presetColors"],setup(E,{emit:te}){function $(ne){const j=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(ne);if(!j)return{h:0,s:0,l:50};const K=parseInt(j[1],16)/255,de=parseInt(j[2],16)/255,xe=parseInt(j[3],16)/255,Ke=Math.max(K,de,xe),Ht=Math.min(K,de,xe);let jt=0,et=0;const vl=(Ke+Ht)/2;if(Ke!==Ht){const M=Ke-Ht;switch(et=vl>.5?M/(2-Ke-Ht):M/(Ke+Ht),Ke){case K:jt=((de-xe)/M+(de<xe?6:0))/6;break;case de:jt=((xe-K)/M+2)/6;break;case xe:jt=((K-de)/M+4)/6;break}}return{h:jt*360,s:et*100,l:vl*100}}function V(ne,j,K){j/=100,K/=100;const de=j*Math.min(K,1-K),xe=Ke=>{const Ht=(Ke+ne/30)%12,jt=K-de*Math.max(Math.min(Ht-3,9-Ht,1),-1);return Math.round(255*jt).toString(16).padStart(2,"0")};return`#${xe(0)}${xe(8)}${xe(4)}`}function ce(ne){const j=ne.replace(/^#/,"").match(/^([a-f\d]{6}|[a-f\d]{3})$/i);if(!j)return null;let K=j[1];return K.length===3&&(K=K.split("").map(de=>de+de).join("")),"#"+K}function O(ne){const j=ne.match(/^rgba?\(\s*(\d{1,3})[\s,]+(\d{1,3})[\s,]+(\d{1,3})(?:[\s,\/]+[\d.]+)?\s*\)$/i);if(!j)return null;const K=Math.max(0,Math.min(255,Number.parseInt(j[1],10))),de=Math.max(0,Math.min(255,Number.parseInt(j[2],10))),xe=Math.max(0,Math.min(255,Number.parseInt(j[3],10)));return`#${K.toString(16).padStart(2,"0")}${de.toString(16).padStart(2,"0")}${xe.toString(16).padStart(2,"0")}`}function L(ne){if(typeof ne!="string")return null;const j=ne.trim();return ce(j)||O(j)}function fe(ne,j,K){j/=100,K/=100;const de=K+j*Math.min(K,1-K),xe=de===0?0:2-2*K/de;return{h:ne,s:xe*100,v:de*100}}function rt(ne,j,K){j/=100,K/=100;const de=K*(1-j/2),xe=de===0||de===1?0:(K-de)/Math.min(de,1-de);return{h:ne,s:xe*100,l:de*100}}const ee=E,v=te,be=e.ref(!1),ke=e.ref(!1),J=e.ref(!1),Y=e.ref(-1),me=e.ref(-1),F=e.ref(null),ue=e.ref(null),$e=e.ref(null),tt=e.ref(null),mt=e.ref({top:0,left:0}),U=e.ref($(ee.modelValue||"#b8a5de")),ze=e.computed(()=>Array.isArray(ee.presetGroups)&&ee.presetGroups.length>0),qe=e.computed(()=>!ee.disableCustomColors),Ve=e.computed(()=>ze.value?0:ee.initialPresetCount!=null?ee.initialPresetCount:me.value<0?null:me.value),Le=e.computed(()=>{const ne=Ve.value;return ne==null?!0:Math.max(0,ee.presetColors.length-ne)<ee.max}),je=e.computed(()=>!!(ke.value||Y.value>=0||!re.value&&ee.presetColors.length===0));e.computed(()=>{const ne=Ve.value;return ne!=null&&ee.presetColors.length>ne});const re=e.computed(()=>ze.value||Ve.value!=null),Qe=e.computed(()=>{const ne=Ve.value;return ne==null?[]:ee.presetColors.slice(0,ne)}),Ce=e.computed(()=>{const ne=Ve.value;return ne==null?[]:ee.presetColors.slice(ne)});function Je(ne){const j=Ve.value;return j!=null?j+ne:-1}function ut(ne){const j=Ve.value;return j!=null&&ne>=j}function ht(ne){ut(ne)&&(Y.value=ne,U.value=$(ee.presetColors[ne]),ke.value=!0,e.nextTick(()=>tt.value?.focus()))}function dt(ne){if(!ut(ne))return;const j=ee.presetColors.filter((xe,Ke)=>Ke!==ne);v("update:presetColors",j);const K=ce(ee.modelValue),de=ce(ee.presetColors[ne]);if(K&&de&&K.toLowerCase()===de.toLowerCase()){const xe=j[Math.max(0,ne-1)]||j[0];xe&&v("update:modelValue",xe)}}function Wt(){J.value=!J.value,J.value||(Y.value=-1,ke.value=!1)}function qt(){if(!qe.value||Y.value<0)return;const ne=it.value,j=ce(ne);if(j){const K=[...ee.presetColors];K[Y.value]=j,v("update:presetColors",K),v("update:modelValue",j),Y.value=-1,ke.value=!1}}function Ct(){ee.disabled||!qe.value||(Y.value=-1,ke.value=!ke.value,ke.value&&(G(),e.nextTick(()=>tt.value?.focus())))}function wt(ne){const j=L(ne),K=L(ee.modelValue);return j&&K&&j.toLowerCase()===K.toLowerCase()}function Yt(){if(ee.disabled||!qe.value||!Le.value)return;const ne=it.value,j=ce(ne);if(j){const K=[...ee.presetColors,j];v("update:presetColors",K),v("update:modelValue",j);const de=Ve.value??me.value;de>=0&&K.length-de>=ee.max&&(ke.value=!1)}}const it=e.computed(()=>{const{h:ne,s:j,l:K}=U.value;return V(ne,j,K)}),Kt=e.computed(()=>it.value.toLowerCase()),yt=e.computed(()=>({background:`linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, hsl(${U.value.h}, 100%, 50%))`})),el=e.computed(()=>{const ne=fe(U.value.h,U.value.s,U.value.l);return{left:`${ne.s}%`,bottom:`${ne.v}%`,transform:"translate(-50%, 50%)"}}),X=e.computed(()=>({left:`${U.value.h/360*100}%`,transform:"translateX(-50%)"})),ge=e.computed(()=>({position:"fixed",left:`${mt.value.left}px`,top:`${mt.value.top}px`,zIndex:1002}));function W(){if(!F.value||!be.value)return;const ne=F.value.getBoundingClientRect(),j=window.innerHeight||document.documentElement.clientHeight;let K=ne.bottom+4;const de=ue.value;de&&K+de.offsetHeight>j-8&&(K=ne.top-4-de.offsetHeight),mt.value={top:K,left:ne.left}}function G(){const ne=ee.modelValue||"#b8a5de",j=L(ne);j&&(U.value=$(j))}function Ne(){v("update:modelValue",it.value)}function Pe(){ee.disabled||(be.value=!be.value,be.value&&(G(),e.nextTick(()=>{W(),tt.value?.focus()})))}function Xe(){const ne=it.value,j=ce(ne);if(j){if(Y.value>=0){const K=[...ee.presetColors];K[Y.value]=j,v("update:presetColors",K),v("update:modelValue",j)}else if(qe.value&&(ee.presetColors.length>0||ze.value)&&ke.value&&Le.value&&!ee.presetColors.some(de=>ce(de)?.toLowerCase()===j.toLowerCase())){const de=[...ee.presetColors,j];v("update:presetColors",de),v("update:modelValue",j)}}be.value=!1,ke.value=!1,J.value=!1,Y.value=-1}function Et(ne){if(!$e.value)return;const j=$e.value.getBoundingClientRect(),K=de=>{const xe=Math.max(0,Math.min(1,(de.clientX-j.left)/j.width)),Ke=Math.max(0,Math.min(1,1-(de.clientY-j.top)/j.height)),Ht={h:U.value.h,s:xe*100,v:Ke*100};U.value=rt(Ht.h,Ht.s,Ht.v)};K(ne),document.addEventListener("mousemove",K),document.addEventListener("mouseup",()=>{document.removeEventListener("mousemove",K),Ne()},{once:!0})}function Ge(ne){if(!ne.currentTarget)return;const K=ne.currentTarget.getBoundingClientRect(),de=xe=>{const Ke=Math.max(0,Math.min(1,(xe.clientX-K.left)/K.width));U.value={...U.value,h:Ke*360}};de(ne),document.addEventListener("mousemove",de),document.addEventListener("mouseup",()=>{document.removeEventListener("mousemove",de),Ne()},{once:!0})}function Zt(ne){const j=ne.target.value,K=L(j);K&&(U.value=$(K),v("update:modelValue",K))}function Ue(ne){if(ee.disabled)return;const j=L(ne);j&&(U.value=$(j),v("update:modelValue",j))}let We=null,Dt=null;function Lt(){We&&(document.removeEventListener("keydown",We),We=null),Dt&&(window.removeEventListener("resize",Dt),Dt=null)}return e.watch(be,ne=>{if(Lt(),ne){if(!ze.value&&ee.initialPresetCount==null){const j=ee.presetColors.length;j>0&&(me.value<0||j<me.value)&&(me.value=j)}We=j=>{j.key==="Escape"&&Xe()},Dt=W,document.addEventListener("keydown",We),window.addEventListener("resize",Dt)}}),e.watch(()=>ee.modelValue,()=>{be.value&&G()},{immediate:!1}),e.watch(Ce,ne=>{ne.length===0&&(J.value=!1,Y.value=-1,ke.value=!1)}),e.onBeforeUnmount(Lt),(ne,j)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-color-picker",{"dss-color-picker--disabled":E.disabled}])},[e.createElementVNode("div",{ref_key:"triggerRef",ref:F,class:e.normalizeClass(["dss-color-picker__trigger",{"dss-color-picker__trigger--open":be.value}]),onClick:Pe},[e.createElementVNode("span",{class:"dss-color-picker__swatch",style:e.normalizeStyle({backgroundColor:it.value})},[...j[0]||(j[0]=[e.createElementVNode("span",{class:"dss-color-picker__hover-layer"},[e.createElementVNode("svg",{class:"dss-color-picker__pen-icon",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[e.createElementVNode("path",{d:"M0 9.64033V11.6667C0 11.8534 0.146646 12 0.333287 12H2.35967C2.44633 12 2.53298 11.9667 2.59297 11.9L9.87196 4.62769L7.37231 2.12804L0.0999862 9.40036C0.0333288 9.46702 0 9.54701 0 9.64033ZM11.805 2.69463C12.065 2.43466 12.065 2.01472 11.805 1.75476L10.2452 0.194973C9.98528 -0.064991 9.56534 -0.064991 9.30537 0.194973L8.08554 1.4148L10.5852 3.91446L11.805 2.69463Z",fill:"currentColor"})])],-1)])],4)],2),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[be.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-color-picker__overlay",onClick:e.withModifiers(Xe,["self"])},[e.createElementVNode("div",{ref_key:"dropdownRef",ref:ue,class:"dss-color-picker__dropdown",style:e.normalizeStyle(ge.value)},[re.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[ze.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(E.presetGroups,(K,de)=>(e.openBlock(),e.createElementBlock("div",{key:"g-"+de,class:"dss-color-picker__section"},[e.createElementVNode("span",E2,e.toDisplayString(K.title),1),e.createElementVNode("div",S2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(K.colors,(xe,Ke)=>(e.openBlock(),e.createElementBlock("button",{key:"g-"+de+"-"+Ke,type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":wt(xe)}]),style:e.normalizeStyle({backgroundColor:xe,"--dss-preset-color":xe}),title:xe,onClick:e.withModifiers(Ht=>Ue(xe),["stop"])},null,14,V2))),128))])]))),128)):Qe.value.length?(e.openBlock(),e.createElementBlock("div",N2,[j[1]||(j[1]=e.createElementVNode("span",{class:"dss-color-picker__section-title"},"Preset colors",-1)),e.createElementVNode("div",B2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Qe.value,(K,de)=>(e.openBlock(),e.createElementBlock("button",{key:"p-"+de,type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":wt(K)}]),style:e.normalizeStyle({backgroundColor:K,"--dss-preset-color":K}),title:K,onClick:e.withModifiers(xe=>Ue(K),["stop"])},null,14,M2))),128))])])):e.createCommentVNode("",!0),qe.value?(e.openBlock(),e.createElementBlock("div",_2,[e.createElementVNode("div",$2,[j[3]||(j[3]=e.createElementVNode("span",{class:"dss-color-picker__section-title"},"Custom Colors",-1)),Ce.value.length>0?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-color-picker__manage-icon",{"dss-color-picker__manage-icon--active":J.value}]),title:"Manage custom colors",onClick:e.withModifiers(Wt,["stop"])},[...j[2]||(j[2]=[e.createElementVNode("svg",{viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M0 9.64V11.67c0 .19.15.33.33.33h2.03c.09 0 .17-.03.23-.1l7.28-7.27-2.5-2.5L.1 9.4A.33.33 0 0 0 0 9.64ZM11.8 2.69c.26-.26.26-.68 0-.94L10.25.2a.66.66 0 0 0-.94 0L8.09 1.41l2.5 2.5 1.22-1.22Z",fill:"currentColor"})],-1)])],2)):e.createCommentVNode("",!0)]),e.createElementVNode("div",L2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ce.value,(K,de)=>(e.openBlock(),e.createElementBlock("div",{key:"c-"+de,class:e.normalizeClass(["dss-color-picker__preset-wrap",{"dss-color-picker__preset-wrap--manage":J.value}])},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":!J.value&&wt(K),"dss-color-picker__preset-bubble--editing":J.value&&Y.value===Je(de)}]),style:e.normalizeStyle({backgroundColor:Y.value===Je(de)?it.value:K,"--dss-preset-color":Y.value===Je(de)?it.value:K}),title:Y.value===Je(de)?it.value:K,onClick:e.withModifiers(xe=>J.value?ht(Je(de)):Ue(K),["stop"])},null,14,A2),J.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-color-picker__preset-action dss-color-picker__preset-action--delete",title:"Delete",onClick:e.withModifiers(xe=>dt(Je(de)),["stop"])},[...j[4]||(j[4]=[e.createElementVNode("svg",{viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M2 2l8 8M10 2L2 10",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round"})],-1)])],8,T2)):e.createCommentVNode("",!0)],2))),128)),Le.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-color-picker__add-bubble",{"dss-color-picker__add-bubble--active":ke.value}]),onClick:e.withModifiers(Ct,["stop"])}," + ",2)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)],64)):E.presetColors.length?(e.openBlock(),e.createElementBlock("div",D2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(E.presetColors,(K,de)=>(e.openBlock(),e.createElementBlock("button",{key:de,type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":wt(K)}]),style:e.normalizeStyle({backgroundColor:K,"--dss-preset-color":K}),title:K,onClick:e.withModifiers(xe=>Ue(K),["stop"])},null,14,H2))),128)),qe.value&&Le.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-color-picker__add-bubble",{"dss-color-picker__add-bubble--active":ke.value}]),onClick:e.withModifiers(Ct,["stop"])}," + ",2)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),je.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createElementVNode("div",{class:"dss-color-picker__sl-area",ref_key:"slAreaRef",ref:$e,onMousedown:Et},[e.createElementVNode("div",{class:"dss-color-picker__sl-bg",style:e.normalizeStyle(yt.value)},null,4),e.createElementVNode("div",{class:"dss-color-picker__sl-pointer",style:e.normalizeStyle(el.value)},null,4)],544),e.createElementVNode("div",{class:"dss-color-picker__hue-wrap",onMousedown:Ge},[j[5]||(j[5]=e.createElementVNode("div",{class:"dss-color-picker__hue-track"},null,-1)),e.createElementVNode("div",{class:"dss-color-picker__hue-pointer",style:e.normalizeStyle(X.value)},null,4)],32),e.createElementVNode("div",R2,[e.createElementVNode("input",{ref_key:"hexInputRef",ref:tt,type:"text",class:"dss-color-picker__hex-input",value:Kt.value,onInput:Zt},null,40,F2)]),qe.value&&re.value&&(E.presetColors.length||ze.value)&&Le.value&&Y.value<0?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-color-picker__add-btn",onClick:Yt}," Save color ")):e.createCommentVNode("",!0),qe.value&&re.value&&Y.value>=0?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-color-picker__add-btn",onClick:qt}," Save color ")):e.createCommentVNode("",!0),re.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:2,type:"button",class:"dss-color-picker__add-btn",onClick:Xe}," Save color "))],64)):e.createCommentVNode("",!0)],4)])):e.createCommentVNode("",!0)]))],2))}},z2={key:0,class:"dss-loader"},P2={key:0,class:"dss-loader-label"},O2={key:1,class:"dss-loader"},W2={key:0,class:"dss-loader-label"},q2={key:2,class:"dss-loader"},Z2={key:0,class:"dss-loader-label"},U2={key:3,class:"dss-loader"},X2={key:0,class:"dss-loader-label"},Y2={key:4,class:"dss-loader"},j2={key:0,class:"dss-loader-label"},K2={key:5,class:"dss-loader dss-loader--inline"},G2={class:"dss-loader-inline-text"},Q2={__name:"DSSLoaders",props:{type:{type:String,default:"spinner"},label:{type:String,default:""},size:{type:[String,Number],default:"medium"},color:{type:String,default:""}},setup(E){const te=E,$=e.computed(()=>te.size==="small"?"dss-loaders--size-small":te.size==="large"?"dss-loaders--size-large":te.size==="medium"||te.size==null?"dss-loaders--size-medium":null),V=e.computed(()=>{const ce={};if(!(te.size==="small"||te.size==="medium"||te.size==="large"||te.size==null)){const O=typeof te.size=="number"?`${te.size}px`:String(te.size);ce["--dss-loader-size"]=O}return te.color&&(ce["--dss-loader-accent"]=te.color,ce["--dss-loader-accent-soft"]=`color-mix(in srgb, ${te.color} 30%, white)`),ce});return(ce,O)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-loaders",$.value]),style:e.normalizeStyle(V.value)},[E.type==="spinner"?(e.openBlock(),e.createElementBlock("div",z2,[O[0]||(O[0]=e.createElementVNode("span",{class:"dss-loader-spinner","aria-hidden":"true"},null,-1)),E.label?(e.openBlock(),e.createElementBlock("span",P2,e.toDisplayString(E.label),1)):e.createCommentVNode("",!0)])):E.type==="dots"?(e.openBlock(),e.createElementBlock("div",O2,[O[1]||(O[1]=e.createElementVNode("span",{class:"dss-loader-dots","aria-hidden":"true"},[e.createElementVNode("span",{class:"dss-loader-dot"}),e.createElementVNode("span",{class:"dss-loader-dot"}),e.createElementVNode("span",{class:"dss-loader-dot"})],-1)),E.label?(e.openBlock(),e.createElementBlock("span",W2,e.toDisplayString(E.label),1)):e.createCommentVNode("",!0)])):E.type==="battery"?(e.openBlock(),e.createElementBlock("div",q2,[O[2]||(O[2]=e.createElementVNode("div",{class:"battery","aria-hidden":"true"},null,-1)),E.label?(e.openBlock(),e.createElementBlock("span",Z2,e.toDisplayString(E.label),1)):e.createCommentVNode("",!0)])):E.type==="double-circle"?(e.openBlock(),e.createElementBlock("div",U2,[O[3]||(O[3]=e.createElementVNode("span",{class:"dss-loader-double-circle","aria-hidden":"true"},[e.createElementVNode("span",{class:"dss-loader-double-circle-outer"}),e.createElementVNode("span",{class:"dss-loader-double-circle-inner"})],-1)),E.label?(e.openBlock(),e.createElementBlock("span",X2,e.toDisplayString(E.label),1)):e.createCommentVNode("",!0)])):E.type==="bars"?(e.openBlock(),e.createElementBlock("div",Y2,[O[4]||(O[4]=e.createElementVNode("span",{class:"dss-loader-bars","aria-hidden":"true"},[e.createElementVNode("span",{class:"dss-loader-bar"}),e.createElementVNode("span",{class:"dss-loader-bar"}),e.createElementVNode("span",{class:"dss-loader-bar"})],-1)),E.label?(e.openBlock(),e.createElementBlock("span",j2,e.toDisplayString(E.label),1)):e.createCommentVNode("",!0)])):E.type==="inline"?(e.openBlock(),e.createElementBlock("div",K2,[O[5]||(O[5]=e.createElementVNode("span",{class:"dss-loader-inline-spinner","aria-hidden":"true"},null,-1)),e.createElementVNode("span",G2,[e.renderSlot(ce.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(E.label),1)])])])):e.createCommentVNode("",!0)],6))}},Ba="dss-skeleton-item",J2={__name:"DSSSkeleton",props:{loading:{type:Boolean,default:!1},darkMode:{type:Boolean,default:!1},borderRadius:{type:String,default:"16px"},shimmer:{type:Boolean,default:!0},mode:{type:String,default:"single",validator:E=>["single","multiple"].includes(E)},targetClass:{type:String,default:Ba},bgColor:{type:String,default:null},shimmerColor:{type:String,default:null},bgDark:{type:String,default:null},shimmerDark:{type:String,default:null}},setup(E){const te=E,$=e.computed(()=>{const O={"dss-skeleton--loading":te.loading,"dss-skeleton--static":!te.shimmer,"dss-skeleton--multiple":te.mode==="multiple","dss-skeleton--dark":te.darkMode};return te.mode==="multiple"&&te.targetClass!==Ba&&(O[`dss-skeleton--target-${te.targetClass}`]=!0),O}),V=e.computed(()=>{const O={};return te.borderRadius&&(O.borderRadius=te.borderRadius),O}),ce=e.computed(()=>{const O={};return te.borderRadius&&(O["--dss-skeleton-border-radius"]=te.borderRadius),te.darkMode?(O["--dss-skeleton-bg"]=te.bgDark||"#322c3f",O["--dss-skeleton-shimmer"]=te.shimmerDark||"#3e3f41",O):(te.bgColor&&(O["--dss-skeleton-bg"]=te.bgColor),te.shimmerColor&&(O["--dss-skeleton-shimmer"]=te.shimmerColor),O)});return(O,L)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-skeleton",$.value]),style:e.normalizeStyle(ce.value)},[E.loading&&E.mode==="single"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-skeleton-overlay",style:e.normalizeStyle(V.value),"aria-hidden":"true"},null,4)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["dss-skeleton-content",{"dss-skeleton-content--hidden":E.loading&&E.mode==="single"}])},[e.renderSlot(O.$slots,"default")],2)],6))}},e0={key:0,class:"dss-dnd-column-header"},t0={class:"dss-dnd-column-title"},l0={class:"dss-dnd-column-count"},n0=["data-column"],o0={key:0,class:"dss-dnd-indicator"},a0=["onPointerdown"],s0=["onPointerdown"],r0={class:"dss-dnd-item-content"},i0={class:"dss-dnd-item-default"},c0={key:0,class:"dss-dnd-empty"},u0={name:"DSSDnd"},d0=Object.assign(u0,{props:{items:{type:Array,required:!0},columns:{type:Array,required:!0},columnKey:{type:String,default:"status"},positionKey:{type:String,default:"position"},itemKey:{type:String,default:"id"},options:{type:Object,default:()=>({})}},emits:["move","delete"],setup(E,{emit:te}){const $=E,V=te,ce=e.useSlots(),O=e.computed(()=>!!ce["delete-zone"]),L={columnMinWidth:"280px",columnMaxWidth:"none",columnGap:"12px",indicatorColor:"#7c6bc4",dragGhostOpacity:.75,dragSourceBackground:"#f5f5f5",dragSourceBorder:"#e0e0e0",useHandle:!1,columnBodyMaxHeight:"none",showHeader:!0,unstyled:!1,deleteZoneAlwaysVisible:!1,ColColor:!1},fe=e.computed(()=>({...L,...$.options})),rt=e.computed(()=>({"--dss-dnd-col-min-w":fe.value.columnMinWidth,"--dss-dnd-col-max-w":fe.value.columnMaxWidth,"--dss-dnd-col-gap":fe.value.columnGap,"--dss-dnd-indicator-color":fe.value.indicatorColor,"--dss-dnd-body-max-h":fe.value.columnBodyMaxHeight}));function ee(W){if(!fe.value.ColColor||!W)return{};const G=W.background||W.color;return G?{background:G}:{}}const v=e.ref(null),be=e.ref(null),ke=e.ref(!1),J=e.ref(-1),Y=e.ref(null);let me=null,F=null,ue=null,$e=null,tt=0,mt=0,U="",ze=null;const qe=5,Ve=e.computed(()=>{const W={};for(const G of $.columns)W[G.value]=$.items.filter(Ne=>Ne[$.columnKey]===G.value).sort((Ne,Pe)=>(Ne[$.positionKey]??0)-(Pe[$.positionKey]??0));return W}),Le=e.computed(()=>{const W={},G=!!v.value,Ne=v.value?.[$.itemKey],Pe=be.value,Xe=J.value;for(const Et of $.columns){const Ge=Ve.value[Et.value]||[],Zt=[],Ue=Pe==Et.value;let We=0;for(let Dt=0;Dt<Ge.length;Dt++){const Lt=Ge[Dt],ne=G&&Lt[$.itemKey]===Ne;!ne&&Ue&&Xe===We&&Zt.push({type:"indicator",key:`ind-${We}`}),ne||We++,Zt.push({type:"item",item:Lt,isDragged:ne,key:`item-${Lt[$.itemKey]}`})}Ue&&Xe>=We&&Zt.push({type:"indicator",key:"ind-end"}),W[Et.value]=Zt}return W});function je(W,G){const Pe=(Ve.value[W]||[]).filter(Ge=>Ge[$.itemKey]!==v.value?.[$.itemKey]);if(Pe.length===0)return 1;if(G<=0){const Ge=Pe[0][$.positionKey];return Ge!=null&&Ge>0?Ge/2:.5}if(G>=Pe.length){const Ge=Pe[Pe.length-1][$.positionKey];return(Ge??0)+1}const Xe=Pe[G-1][$.positionKey]??0,Et=Pe[G][$.positionKey]??0;return(Xe+Et)/2}function re(W,G,Ne){ue&&ue.remove();const Pe=W.getBoundingClientRect(),Xe=W.cloneNode(!0);Xe.classList.add("dss-dnd-ghost"),Xe.style.cssText=`
|
|
104
106
|
position: fixed;
|
|
105
|
-
left: ${
|
|
106
|
-
top: ${
|
|
107
|
-
width: ${
|
|
108
|
-
height: ${
|
|
107
|
+
left: ${G-tt}px;
|
|
108
|
+
top: ${Ne-mt}px;
|
|
109
|
+
width: ${Pe.width}px;
|
|
110
|
+
height: ${Pe.height}px;
|
|
109
111
|
z-index: 9999;
|
|
110
112
|
pointer-events: none;
|
|
111
|
-
opacity: ${
|
|
113
|
+
opacity: ${fe.value.dragGhostOpacity};
|
|
112
114
|
box-sizing: border-box;
|
|
113
115
|
box-shadow: 0 8px 24px rgba(0,0,0,0.15);
|
|
114
|
-
background-color: ${
|
|
116
|
+
background-color: ${fe.value.dragSourceBackground};
|
|
115
117
|
font-family: 'Work Sans', sans-serif;
|
|
116
118
|
cursor: grabbing;
|
|
117
|
-
`,document.body.appendChild(Ze),ue=Ze}function Je(P,K){ue&&(ue.style.left=`${P-tt}px`,ue.style.top=`${K-mt}px`)}function we(P){P.classList.add("dss-dnd-item--dragging"),P.style.background=pe.value.dragSourceBackground,P.style.borderColor=pe.value.dragSourceBorder,P.style.transform="scale(0.97)"}function et(P){P.classList.remove("dss-dnd-item--dragging"),P.style.background="",P.style.borderColor="",P.style.transform=""}function ct(P,K){return document.elementFromPoint(P,K)?.closest(".dss-dnd-column-body")??null}function vt(P,K){return!!document.elementFromPoint(P,K)?.closest("[data-dss-dnd-delete-zone]")}function ut(P,K){if(I.value&&vt(P,K)){ke.value=!0,Ce.value=null,Q.value=-1;return}ke.value=!1;const Se=ct(P,K),Re=Se?.getAttribute("data-column")??null;if(!Re){Ce.value=null,Q.value=-1;return}Ce.value=Re;const Ze=Se.querySelectorAll(".dss-dnd-item:not(.dss-dnd-item--dragging)");let xt=Ze.length;for(let Ke=0;Ke<Ze.length;Ke++){const zt=Ze[Ke].getBoundingClientRect();if(K<zt.top+zt.height/2){xt=Ke;break}}Q.value=xt}function Ft(P){P.preventDefault(),Je(P.clientX,P.clientY),!me&&(me=requestAnimationFrame(()=>{me=null,ut(P.clientX,P.clientY)}))}function It(P){window.removeEventListener("pointermove",Ft),window.removeEventListener("pointerup",It),window.removeEventListener("pointercancel",It),Me?.releasePointerCapture?.(P.pointerId),et(Me),Me=null;const K=I.value&&vt(P.clientX,P.clientY);if(v.value&&K)V("delete",{item:v.value});else{const Re=ct(P.clientX,P.clientY)?.getAttribute("data-column")??null;if(v.value&&Re){const Ze=v.value[$.columnKey],xt=Re,zt=(Ee.value[xt]||[]).filter($t=>$t[$.itemKey]!==v.value[$.itemKey]),qe=Math.max(0,Math.min(Q.value,zt.length)),ze=Ye(xt,qe),Lt=v.value[$.itemKey];V("move",{item:v.value,from:Ze,to:xt,position:ze,index:qe}),F&&clearTimeout(F),X.value={id:Lt,from:Ze,to:xt},F=setTimeout(()=>{X.value=null},3500)}}ue&&(ue.remove(),ue=null),Z!==null&&(document.body.style.cursor=Z,Z=""),ye()}function bt(P,K){P.preventDefault();const Se=P.target.closest(".dss-dnd-item");if(!Se)return;const Re=Se.getBoundingClientRect();tt=P.clientX-Re.left,mt=P.clientY-Re.top,Z=document.body.style.cursor,document.body.style.cursor="grabbing",v.value=K,Me=Se,ie(Se,P.clientX,P.clientY),requestAnimationFrame(()=>we(Se)),Se.setPointerCapture?.(P.pointerId),window.addEventListener("pointermove",Ft),window.addEventListener("pointerup",It,{once:!0}),window.addEventListener("pointercancel",It,{once:!0})}function wt(){Ae&&(window.removeEventListener("pointermove",Jt),window.removeEventListener("pointerup",pt),window.removeEventListener("pointercancel",pt),Ae=null)}function Jt(P){if(!Ae||P.pointerId!==Ae.pointerId)return;const K=P.clientX-Ae.startX,Se=P.clientY-Ae.startY;if(Math.abs(K)>=We||Math.abs(Se)>=We){const Re=Ae.item;wt(),bt(P,Re)}}function pt(P){!Ae||P.pointerId!==Ae.pointerId||wt()}function jt(P,K){wt(),Ae={item:K,startX:P.clientX,startY:P.clientY,pointerId:P.pointerId},window.addEventListener("pointermove",Jt),window.addEventListener("pointerup",pt),window.addEventListener("pointercancel",pt)}function kt(P,K){pe.value.useHandle||jt(P,K)}function tn(P,K){jt(P,K)}function U(){me&&(cancelAnimationFrame(me),me=null)}function ye(){U(),v.value=null,Ce.value=null,ke.value=!1,Q.value=-1}return e.onBeforeUnmount(()=>{U(),wt(),F&&clearTimeout(F),ue&&(ue.remove(),ue=null)}),(P,K)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-dnd",{"dss-dnd--unstyled":pe.value.unstyled}]),style:e.normalizeStyle(st.value)},[I.value?(e.openBlock(),e.createBlock(e.Teleport,{key:0,to:"body"},[e.withDirectives(e.createElementVNode("div",{class:e.normalizeClass(["dss-dnd-delete-zone",{"dss-dnd-delete-zone--drag-over":ke.value}]),"data-dss-dnd-delete-zone":""},[e.renderSlot(P.$slots,"delete-zone",{isDragging:!!v.value,isOver:ke.value})],2),[[e.vShow,!!v.value||pe.value.deleteZoneAlwaysVisible]])])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(E.columns,Se=>(e.openBlock(),e.createElementBlock("div",{key:Se.value,class:e.normalizeClass(["dss-dnd-column",[{"dss-dnd-column--drag-over":Ce.value==Se.value},Se.class||""]]),style:e.normalizeStyle(te(Se))},[pe.value.showHeader?(e.openBlock(),e.createElementBlock("div",h2,[e.renderSlot(P.$slots,"column-header",{column:Se,items:Ee.value[Se.value]||[]},()=>[e.createElementVNode("span",y2,e.toDisplayString(Se.title||Se.value),1),e.createElementVNode("span",k2,e.toDisplayString((Ee.value[Se.value]||[]).length),1)])])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"dss-dnd-column-body","data-column":Se.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_e.value[Se.value],Re=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:Re.key},[Re.type==="indicator"?(e.openBlock(),e.createElementBlock("div",b2)):(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["dss-dnd-item",{"dss-dnd-item--dragging":Re.isDragged,"dss-dnd-item--no-handle":!pe.value.useHandle}]),onPointerdown:Ze=>kt(Ze,Re.item)},[pe.value.useHandle?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-dnd-handle",onPointerdown:e.withModifiers(Ze=>tn(Ze,Re.item),["stop"])},[e.renderSlot(P.$slots,"handle",{},()=>[K[0]||(K[0]=e.createElementVNode("span",{class:"dss-dnd-handle-icon"},"⠿",-1))])],40,x2)):e.createCommentVNode("",!0),e.createElementVNode("div",E2,[e.renderSlot(P.$slots,"item",{item:Re.item,column:Se,justDropped:X.value?.id===Re.item[E.itemKey],droppedFrom:X.value?.id===Re.item[E.itemKey]?X.value.from:null,droppedTo:X.value?.id===Re.item[E.itemKey]?X.value.to:null},()=>[e.createElementVNode("div",S2,e.toDisplayString(Re.item[E.itemKey]),1)])])],42,w2))],64))),128)),(Ee.value[Se.value]||[]).length===0&&Ce.value!=Se.value?(e.openBlock(),e.createElementBlock("div",V2,[e.renderSlot(P.$slots,"empty",{column:Se},()=>[K[1]||(K[1]=e.createElementVNode("span",{class:"dss-dnd-empty-text"},"No items",-1))])])):e.createCommentVNode("",!0)],8,C2)],6))),128))],6))}}),M2={name:"DSSConfetti"},_2=Object.assign(M2,{props:{trigger:{type:Boolean,default:!1},duration:{type:Number,default:3e3},fadeStart:{type:Number,default:2e3},count:{type:Number,default:90},colors:{type:Array,default:()=>["#047395","#ffc230","#0897c1","#fe3b59","#11e1a2","#b3b2fb","#fadb8d","#ffa25b","#feaab1"]},delay:{type:Number,default:300}},setup(E){const ne=E,$=e.ref(null),V=e.ref(!1);let ce=[],I=null,_=null;function pe(Q,X){const me=[];for(let F=0;F<ne.count;F++)me.push(st(Q));return me}function st(Q,X){return{x:Math.random()*Q,y:-Math.random()*150-20,r:Math.random()*8+3,d:Math.random()*50,color:ne.colors[Math.floor(Math.random()*ne.colors.length)],tilt:Math.floor(Math.random()*10)-10,tiltInc:Math.random()*.08+.04,tiltAngle:0,opacity:Math.random()*.7+.3,speed:Math.random()*4+1.5}}function te(Q,X,me,F){Q.clearRect(0,0,X,me);for(const ue of ce)Q.save(),Q.globalAlpha=ue.opacity*F,Q.beginPath(),Q.lineWidth=ue.r,Q.strokeStyle=ue.color,Q.moveTo(ue.x+ue.tilt+ue.r/2,ue.y),Q.lineTo(ue.x+ue.tilt,ue.y+ue.tilt+ue.r/2),Q.stroke(),Q.restore()}function v(Q,X,me){const F=.3+me*.7;for(let ue=0;ue<ce.length;ue++){const Me=ce[ue];Me.tiltAngle+=Me.tiltInc,Me.y+=Me.speed*F,Me.x+=Math.sin(Me.d)*.5*F,Me.tilt=Math.sin(Me.tiltAngle)*15,me>=.99&&Me.y>X+20&&(ce[ue]=st(Q))}}function Ce(){V.value=!0,e.nextTick(()=>{const Q=$.value;if(!Q)return;const X=Q.getContext("2d"),me=Q.parentElement;if(!me)return;const F=me.getBoundingClientRect();Q.width=F.width,Q.height=F.height,ce=pe(Q.width,Q.height);const ue=Date.now(),Me=ue+ne.duration,tt=()=>{const mt=Date.now(),Z=mt-ue;if(mt<Me){let Ae=1;Z>ne.fadeStart&&(Ae=1-(Z-ne.fadeStart)/(ne.duration-ne.fadeStart)),te(X,Q.width,Q.height,Ae),v(Q.width,Q.height,Ae),I=requestAnimationFrame(tt)}else ke()};tt()})}function ke(){I&&(cancelAnimationFrame(I),I=null),ce=[],V.value=!1}return e.watch(()=>ne.trigger,Q=>{Q&&(_&&clearTimeout(_),_=setTimeout(Ce,ne.delay))},{immediate:!0}),e.onBeforeUnmount(()=>{ke(),_&&clearTimeout(_)}),(Q,X)=>V.value?(e.openBlock(),e.createElementBlock("canvas",{key:0,ref_key:"canvasRef",ref:$,class:"dss-confetti-canvas"},null,512)):e.createCommentVNode("",!0)}}),$2={class:"dss-filter-global-inner"},L2=["placeholder","value"],T2=["title"],A2={key:0,class:"dss-filter-funnel-badge"},D2={key:1,class:"dss-filter-sortby"},H2=["value"],R2=["value"],F2=["disabled","title"],I2={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"},z2={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"},P2={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"},O2={class:"dss-filter-panel"},W2={key:0,class:"dss-filter-empty"},q2={class:"dss-filter-row-prefix"},Z2={class:"dss-filter-cell"},U2=["onClick"],X2={class:"dss-filter-trigger-text"},Y2=["placeholder"],j2={class:"dss-filter-popup-list"},K2=["onClick"],G2={key:0,class:"dss-filter-popup-empty"},Q2={key:0,class:"dss-filter-cell"},J2=["onClick"],e0={class:"dss-filter-trigger-text"},t0={class:"dss-filter-popup-list"},n0=["onClick"],l0={key:1,class:"dss-filter-cell dss-filter-cell--value"},o0=["placeholder","onUpdate:modelValue"],a0={key:1,class:"dss-filter-date-wrap"},s0=["placeholder","onUpdate:modelValue"],r0=["placeholder","value","onInput","step"],i0={key:4,class:"dss-filter-between"},c0=["placeholder","value","onInput","step"],u0={class:"dss-filter-between-sep"},d0=["placeholder","value","onInput","step"],m0={key:5,class:"dss-filter-multiselect"},p0=["onClick"],f0={class:"dss-filter-trigger-text"},v0=["placeholder"],g0={class:"dss-filter-popup-list dss-filter-popup-list--check"},h0=["onClick"],y0=["checked"],k0={key:0,class:"dss-filter-popup-empty"},C0=["onClick"],b0={class:"dss-filter-foot"},w0={class:"dss-filter-cell"},x0=["placeholder"],E0={class:"dss-filter-popup-list"},S0=["onClick"],V0={key:0,class:"dss-filter-popup-divider"},N0=["onClick"],B0=["placeholder"],M0={class:"dss-filter-popup-list"},_0=["onClick"],$0={key:0,class:"dss-filter-popup-empty"},L0=["placeholder"],T0={class:"dss-filter-popup-list"},A0=["onClick"],D0={key:0,class:"dss-filter-popup-empty"},H0={name:"DSSFilter"},R0=Object.assign(H0,{props:{data:{type:Array,required:!0},modelValue:{type:Array,default:void 0},exclude:{type:Array,default:()=>[]},config:{type:Object,default:()=>({})},options:{type:Object,default:()=>({})},showSortBy:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(E,{expose:ne,emit:$}){const{t:V}=co.useI18n(),ce=E,I=$,_={unstyled:!1,maxUniqueForSelect:30,maxUniqueForEnum:15},pe=e.computed(()=>({..._,...ce.options})),st={text:[{value:"contains"},{value:"not_contains"},{value:"equals"},{value:"not_equals"},{value:"starts_with"},{value:"ends_with"},{value:"is_empty"},{value:"is_not_empty"}],select:[{value:"is_any_of"},{value:"is_none_of"},{value:"is_empty"},{value:"is_not_empty"}],range:[{value:"eq"},{value:"neq"},{value:"gt"},{value:"gte"},{value:"lt"},{value:"lte"},{value:"between"},{value:"is_empty"},{value:"is_not_empty"}],int:[{value:"eq"},{value:"neq"},{value:"gt"},{value:"gte"},{value:"lt"},{value:"lte"},{value:"between"},{value:"is_empty"},{value:"is_not_empty"}],arraySelect:[{value:"contains_any"},{value:"contains_all"},{value:"not_contains_any"},{value:"is_empty"},{value:"is_not_empty"}],arrayText:[{value:"contains"},{value:"not_contains"},{value:"is_empty"},{value:"is_not_empty"}],date:[{value:"eq"},{value:"before"},{value:"after"},{value:"is_empty"},{value:"is_not_empty"}],boolean:[{value:"is_true"},{value:"is_false"},{value:"is_empty"},{value:"is_not_empty"}]},te=new Set(["is_empty","is_not_empty","is_true","is_false"]),v=["label","name","title","keyword","full_name","value","text"],Ce=e.ref(""),ke=e.ref([]),Q=e.ref(null),X=e.ref(!1),me=e.ref(null),F=e.ref(""),ue=e.ref(null),Me=e.ref(""),tt=e.ref("asc");let mt=1;function Z(N){const b=N.find(B=>B&&typeof B=="object");if(!b)return null;for(const B of v)if(B in b&&typeof b[B]=="string")return B;return Object.keys(b).find(B=>typeof b[B]=="string")||null}function Ae(N,b){const B=b.filter(G=>G!=null&&G!=="NULL");if(B.length===0)return null;if(B.every(G=>Array.isArray(G))){const G=B.flatMap(De=>De).filter(De=>De!=null);return G.length===0?null:typeof G.find(De=>De!=null)=="object"?"arraySelect":"arrayText"}return B.every(G=>typeof G=="boolean")?"boolean":B.every(G=>typeof G=="number")?new Set(B).size<=pe.value.maxUniqueForEnum?"select":"range":B.every(G=>typeof G=="string")?new Set(B).size<=pe.value.maxUniqueForSelect?"select":"text":B.some(G=>typeof G=="object"&&!Array.isArray(G))?null:"text"}const We=e.computed(()=>{if(!ce.data?.length)return[];const N=new Set;for(const ae of ce.data)if(ae&&typeof ae=="object")for(const De of Object.keys(ae))N.add(De);const b=new Set(ce.exclude),B=[];for(const ae of N){if(b.has(ae))continue;const De=ce.config[ae]||{},Ct=ce.data.map(St=>St?.[ae]),lt=De.type||Ae(ae,Ct);if(!lt)continue;const Ie=De.filterMode||"contain",Et=Ie==="date"?"date":Ie==="string"?"text":lt,Bt={key:ae,label:De.label||nt(ae),type:Et,filterMode:Ie};if(lt==="select"){const St=Ct.filter(rt=>rt!=null&&rt!=="NULL");Bt.uniqueValues=[...new Set(St)].sort((rt,At)=>typeof rt=="number"&&typeof At=="number"?rt-At:String(rt).localeCompare(String(At)))}else if(lt==="range"||lt==="int"){const St=Ct.filter(rt=>typeof rt=="number");Bt.min=Math.min(...St),Bt.max=Math.max(...St)}else if(lt==="arraySelect"){const St=De.displayKey||Z(Ct.flatMap(rt=>Array.isArray(rt)?rt:[]));if(Bt.displayKey=St,Array.isArray(De.uniqueValues)&&De.uniqueValues.length>0)Bt.uniqueValues=De.uniqueValues.map(rt=>String(rt));else{const rt=Ct.flatMap(At=>Array.isArray(At)?At:[]).filter(At=>At!=null).map(At=>St&&typeof At=="object"?At[St]:String(At)).filter(At=>At!=null&&At!=="");Bt.uniqueValues=[...new Set(rt)].sort((At,Nt)=>String(At).localeCompare(String(Nt)))}}B.push(Bt)}const G=ce.config._order;return G&&B.sort((ae,De)=>{const Ct=G.indexOf(ae.key),lt=G.indexOf(De.key);return Ct===-1&<===-1?0:Ct===-1?1:lt===-1?-1:Ct-lt}),B}),Ee=e.computed(()=>{const N={};for(const b of We.value)N[b.key]=b;return N}),_e=e.computed(()=>Array.isArray(ce.config.groups)&&ce.config.groups.length>0),Ye=e.computed(()=>{if(!_e.value)return[];const N=new Set(We.value.map(b=>b.key));return ce.config.groups.map(b=>({...b,keys:b.keys.filter(B=>N.has(B))})).filter(b=>b.keys.length>0)}),ie=e.computed(()=>{if(!_e.value)return[];const N=new Set(ce.config.groups.flatMap(b=>b.keys));return We.value.filter(b=>!N.has(b.key))}),Je=e.computed(()=>{if(!ue.value)return[];const N=new Set(ue.value.keys),b=We.value.filter(G=>N.has(G.key));if(!F.value)return b;const B=F.value.toLowerCase();return b.filter(G=>G.label.toLowerCase().includes(B))}),we=e.computed(()=>{if(!F.value)return We.value;const N=F.value.toLowerCase();return We.value.filter(b=>b.label.toLowerCase().includes(N))}),et=e.computed(()=>We.value.filter(N=>!["arraySelect","arrayText"].includes(N.type))),ct=e.computed(()=>Me.value?tt.value==="asc"?"Ascending":"Descending":"No sort selected");function vt(N){Q.value===N?ut():(Q.value=N,F.value="",ue.value=null)}function ut(){Q.value=null,F.value="",ue.value=null}function Ft(N){const b=N.target.closest(".dss-datepicker__overlay, .dss-datepicker__dropdown");Q.value&&!b&&!N.target.closest(".dss-filter-popup")&&!N.target.closest(".dss-filter-trigger")&&!N.target.closest(".dss-filter-add-btn")&&ut(),X.value&&me.value&&!me.value.contains(N.target)&&(b||(X.value=!1))}e.onMounted(()=>document.addEventListener("click",Ft)),e.onBeforeUnmount(()=>document.removeEventListener("click",Ft));function It(N){return Ee.value[N]?.label||nt(N)}function bt(N){return Ee.value[N.key]?.filterMode||"contain"}function wt(N){return V(`filter.operators.${N}`)}function Jt(N){const b=Ee.value[N.key];return(st[b?.type]||st.text).map(B=>({...B,label:V(`filter.operators.${B.value}`)}))}function pt(N){return te.has(N)}function jt(N){const b=Ee.value[N.key];return b?b.type==="date"?"date":b.type==="boolean"?"boolean":b.type==="text"||b.type==="arrayText"?"text":b.type==="select"||b.type==="arraySelect"?"multiselect":b.type==="range"||b.type==="int"?N.operator==="between"?"between":"number":"text":"text"}function kt(N){return st[N]?.[0]?.value||"contains"}function tn(N,b){return te.has(b)||N==="date"?null:N==="select"||N==="arraySelect"?[]:(N==="range"||N==="int")&&b==="between"?{min:null,max:null}:N==="range"||N==="int"?null:""}function U(N){return Ee.value[N.key]?.uniqueValues||[]}function ye(N){const b=U(N);if(!F.value)return b;const B=F.value.toLowerCase();return b.filter(G=>String(G).toLowerCase().includes(B))}function P(N){const b=N.value;return!b||b.length===0?V("filter.select"):b.length<=2?b.join(", "):V("filter.selectedCount",{count:b.length})}function K(N){const b=Ee.value[N],B=b?.filterMode||"contain",G=b?.type||"text",ae=B==="string"?"contains":kt(G);ke.value.push(e.reactive({id:mt++,key:N,operator:ae,value:tn(G,ae)})),ut()}function Se(N){ke.value=ke.value.filter(b=>b.id!==N)}function Re(N,b){const G=Ee.value[b]?.type||"text";N.key=b,N.operator=kt(G),N.value=tn(G,N.operator),ut()}function Ze(N,b){const B=jt(N);N.operator=b;const G=jt(N);if(B!==G||te.has(b)){const ae=Ee.value[N.key];N.value=tn(ae?.type||"text",b)}ut()}function xt(N,b){const B=b.target.value;N.value=B===""?null:Number(B)}function Ke(N,b,B){const G=B.target.value,ae=G===""?null:Number(G);(!N.value||typeof N.value!="object")&&(N.value={min:null,max:null}),N.value={...N.value,[b]:isNaN(ae)?null:ae}}function zt(N,b){const B=N.value||[],G=B.indexOf(b);N.value=G>=0?B.filter(ae=>ae!==b):[...B,b]}function qe(){ke.value=[],Ce.value="",ut()}function ze(N){Ce.value=N.target.value}function Lt(N){Me.value=N.target.value}function $t(){tt.value=tt.value==="asc"?"desc":"asc"}const oe=e.computed(()=>{if(!ce.data)return[];let N=ce.data;if(Ce.value){const b=Ce.value.toLowerCase();N=N.filter(B=>{for(const G of Object.keys(B)){const ae=B[G];if(typeof ae=="string"&&ae.toLowerCase().includes(b)||typeof ae=="number"&&String(ae).includes(b)||Array.isArray(ae)&&ae.some(De=>De!=null&&(typeof De=="string"?De.toLowerCase().includes(b):typeof De=="object"?Object.values(De).some(Ct=>typeof Ct=="string"&&Ct.toLowerCase().includes(b)):!1)))return!0}return!1})}for(const b of ke.value){if(!de(b))continue;const B=Ee.value[b.key];B&&(N=N.filter(G=>be(G,b,B)))}if(ce.showSortBy&&Me.value){const b=Me.value,B=tt.value==="asc"?1:-1;N=[...N].sort((G,ae)=>Y(G?.[b],ae?.[b])*B)}return N});function Y(N,b){const B=j(N),G=j(b);return B==null&&G==null?0:B==null?1:G==null?-1:typeof B=="number"&&typeof G=="number"?B-G:String(B).localeCompare(String(G),void 0,{numeric:!0,sensitivity:"base"})}function j(N){return N==null||N==="NULL"?null:typeof N=="string"||typeof N=="number"||typeof N=="boolean"?N:N instanceof Date?N.getTime():null}function de(N){return te.has(N.operator)?!0:N.value==null||typeof N.value=="string"&&N.value===""||Array.isArray(N.value)&&N.value.length===0?!1:N.value instanceof Date?!isNaN(N.value.getTime()):!(typeof N.value=="object"&&!Array.isArray(N.value)&&N.value.min==null&&N.value.max==null)}function be(N,b,B){const G=N?.[b.key],ae=b.value,De=b.operator;if(De==="is_empty")return Xt(G);if(De==="is_not_empty")return!Xt(G);const Ct=B.type;if(Ct==="text"||Ct==="arrayText"){const lt=Ct==="arrayText"&&Array.isArray(G)?G.filter(Bt=>Bt!=null).map(String).join(" "):G!=null?String(G):"",Ie=String(ae).toLowerCase(),Et=lt.toLowerCase();switch(De){case"contains":return Et.includes(Ie);case"not_contains":return!Et.includes(Ie);case"equals":return Et===Ie;case"not_equals":return Et!==Ie;case"starts_with":return Et.startsWith(Ie);case"ends_with":return Et.endsWith(Ie);default:return!0}}if(Ct==="select")switch(De){case"is_any_of":return ae.includes(G);case"is_none_of":return!ae.includes(G);default:return!0}if(Ct==="range"||Ct==="int"){const lt=typeof G=="number"?G:Number(G);if(typeof lt!="number"||isNaN(lt))return!1;if(De==="between"){const Et=ae?.min!=null?Number(ae.min):null,Bt=ae?.max!=null?Number(ae.max):null,St=Et!=null&&!isNaN(Et)?Et:null,rt=Bt!=null&&!isNaN(Bt)?Bt:null;return(St==null||lt>=St)&&(rt==null||lt<=rt)}const Ie=typeof ae=="number"&&!isNaN(ae)?ae:Number(ae);if(De==="contains"||De==="not_contains"){const Et=String(lt),Bt=String(ae??"").toLowerCase(),St=Et.toLowerCase().includes(Bt);return De==="contains"?St:!St}if(typeof Ie!="number"||isNaN(Ie))return!1;switch(De){case"eq":return lt===Ie;case"neq":return lt!==Ie;case"gt":return lt>Ie;case"gte":return lt>=Ie;case"lt":return lt<Ie;case"lte":return lt<=Ie;default:return!0}}if(Ct==="arraySelect"){if(!Array.isArray(G))return!1;const lt=G.filter(Ie=>Ie!=null).map(Ie=>B.displayKey&&typeof Ie=="object"?Ie[B.displayKey]:String(Ie));switch(De){case"contains_any":return lt.some(Ie=>ae.includes(Ie));case"contains_all":return ae.every(Ie=>lt.includes(Ie));case"not_contains_any":return!lt.some(Ie=>ae.includes(Ie));default:return!0}}if(Ct==="date"){const lt=je(ae);if(!lt||isNaN(lt.getTime()))return!1;const Ie=je(G);if(!Ie||isNaN(Ie.getTime()))return!1;const Et=Tt(Ie),Bt=Tt(lt);switch(De){case"eq":return Et===Bt;case"before":return Et<Bt;case"after":return Et>Bt;default:return!0}}if(Ct==="boolean"){const lt=G===!0||G==="true"||G===1,Ie=G===!1||G==="false"||G===0;switch(De){case"is_true":return lt;case"is_false":return Ie;default:return!0}}return!0}function je(N){if(N==null)return null;if(N instanceof Date)return isNaN(N.getTime())?null:N;if(typeof N=="number")return new Date(N>1e10?N:N*1e3);if(typeof N=="string"){const b=new Date(N);return isNaN(b.getTime())?null:b}return null}function Tt(N){const b=N.getFullYear(),B=String(N.getMonth()+1).padStart(2,"0"),G=String(N.getDate()).padStart(2,"0");return`${b}-${B}-${G}`}function Xt(N){return!!(N==null||N===""||N==="NULL"||Array.isArray(N)&&N.length===0||Array.isArray(N)&&N.every(b=>b==null))}e.watch(oe,N=>I("update:modelValue",N),{immediate:!0}),e.watch(()=>ce.data,()=>{ke.value=[],Ce.value="",X.value=!1,Me.value="",tt.value="asc",ut()});function nt(N){return N.replace(/_/g," ").replace(/([a-z])([A-Z])/g,"$1 $2").replace(/\b\w/g,b=>b.toUpperCase())}function sn(){const N=b=>{if(b==null)return b;if(b instanceof Date)return{_type:"Date",value:b.toISOString(),local:b.toLocaleDateString()};if(Array.isArray(b))return b.map(N);if(typeof b=="object"&&!Array.isArray(b)){const B={};for(const G of Object.keys(b))B[G]=N(b[G]);return B}return b};return{globalSearch:Ce.value,rows:ke.value.map(b=>({key:b.key,operator:b.operator,value:N(b.value),defType:Ee.value[b.key]?.type,defFilterMode:Ee.value[b.key]?.filterMode})),filteredCount:oe.value?.length??0}}return ne({getDebugState:sn}),(N,b)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-filter",{"dss-filter--unstyled":pe.value.unstyled}])},[e.createElementVNode("div",{class:"dss-filter-global",ref_key:"globalRef",ref:me},[e.createElementVNode("div",$2,[b[20]||(b[20]=e.createElementVNode("svg",{class:"dss-filter-global-icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("circle",{cx:"11",cy:"11",r:"8"}),e.createElementVNode("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})],-1)),e.createElementVNode("input",{type:"text",class:"dss-filter-global-input",placeholder:e.unref(V)("filter.searchAcrossFields"),value:Ce.value,onInput:ze},null,40,L2),Ce.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-filter-global-clear",onClick:b[0]||(b[0]=B=>Ce.value="")},"×")):e.createCommentVNode("",!0),e.createElementVNode("button",{class:e.normalizeClass(["dss-filter-funnel-btn",{active:X.value||ke.value.length>0,"dss-filter-funnel-btn--with-sort":ce.showSortBy}]),onClick:b[1]||(b[1]=B=>X.value=!X.value),type:"button",title:X.value?e.unref(V)("filter.closeAdvancedFilter"):e.unref(V)("filter.openAdvancedFilter")},[b[14]||(b[14]=e.createElementVNode("svg",{class:"dss-filter-funnel-icon",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M11.7583 2.00407L11.7537 2.00926L7.84558 6.18223V9.38409C7.84581 9.53637 7.80836 9.68634 7.73658 9.82064C7.6648 9.95494 7.56091 10.0694 7.43417 10.1538L5.58772 11.3852C5.44858 11.4779 5.28688 11.531 5.11988 11.539C4.95288 11.5469 4.78685 11.5094 4.63952 11.4304C4.49219 11.3514 4.36908 11.2338 4.28334 11.0903C4.1976 10.9467 4.15244 10.7826 4.15269 10.6154V6.18223L0.244567 2.00926L0.239951 2.00407C0.119785 1.87182 0.0405781 1.70755 0.0119374 1.53118C-0.0167033 1.35481 0.00645342 1.17391 0.0785984 1.01044C0.150743 0.846967 0.268776 0.707944 0.418378 0.610235C0.56798 0.512525 0.742722 0.460328 0.921405 0.459976H11.0769C11.2557 0.459994 11.4307 0.511948 11.5805 0.609528C11.7304 0.707107 11.8487 0.846111 11.9211 1.00965C11.9934 1.17319 12.0167 1.35422 11.9881 1.53075C11.9596 1.70728 11.8803 1.87172 11.7601 2.00407H11.7583Z",fill:"currentColor"})],-1)),ke.value.length>0?(e.openBlock(),e.createElementBlock("span",A2,e.toDisplayString(ke.value.length),1)):e.createCommentVNode("",!0)],10,T2),ce.showSortBy?(e.openBlock(),e.createElementBlock("div",D2,[b[19]||(b[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:Me.value,onChange:Lt},[b[15]||(b[15]=e.createElementVNode("option",{value:""},"None",-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(et.value,B=>(e.openBlock(),e.createElementBlock("option",{key:B.key,value:B.key},e.toDisplayString(B.label),9,R2))),128))],40,H2),e.createElementVNode("button",{class:"dss-filter-sortby-order",type:"button",onClick:$t,disabled:!Me.value,title:ct.value},[Me.value?tt.value==="asc"?(e.openBlock(),e.createElementBlock("svg",z2,[...b[17]||(b[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",P2,[...b[18]||(b[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",I2,[...b[16]||(b[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,F2)])):e.createCommentVNode("",!0)]),X.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-advanced-popup",onClick:b[13]||(b[13]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",O2,[ke.value.length===0?(e.openBlock(),e.createElementBlock("div",W2,e.toDisplayString(e.unref(V)("filter.noConditionsApplied")),1)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ke.value,(B,G)=>(e.openBlock(),e.createElementBlock("div",{key:B.id,class:"dss-filter-row"},[e.createElementVNode("span",q2,e.toDisplayString(G===0?e.unref(V)("filter.where"):e.unref(V)("filter.and")),1),e.createElementVNode("div",Z2,[e.createElementVNode("button",{class:"dss-filter-trigger",onClick:e.withModifiers(ae=>vt(`${B.id}:field`),["stop"])},[e.createElementVNode("span",X2,e.toDisplayString(It(B.key)),1),b[21]||(b[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,U2),Q.value===`${B.id}:field`?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-popup",onClick:b[3]||(b[3]=e.withModifiers(()=>{},["stop"]))},[e.withDirectives(e.createElementVNode("input",{type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":b[2]||(b[2]=ae=>F.value=ae),placeholder:e.unref(V)("filter.searchAttributes")},null,8,Y2),[[e.vModelText,F.value]]),e.createElementVNode("ul",j2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(we.value,ae=>(e.openBlock(),e.createElementBlock("li",{key:ae.key,class:"dss-filter-popup-item",onClick:De=>Re(B,ae.key)},e.toDisplayString(ae.label),9,K2))),128)),we.value.length===0?(e.openBlock(),e.createElementBlock("li",G2,e.toDisplayString(e.unref(V)("filter.noMatch")),1)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)]),bt(B)==="contain"||bt(B)==="date"?(e.openBlock(),e.createElementBlock("div",Q2,[e.createElementVNode("button",{class:"dss-filter-trigger",onClick:e.withModifiers(ae=>vt(`${B.id}:op`),["stop"])},[e.createElementVNode("span",e0,e.toDisplayString(wt(B.operator)),1),b[22]||(b[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,J2),Q.value===`${B.id}:op`?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-popup",onClick:b[4]||(b[4]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("ul",t0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Jt(B),ae=>(e.openBlock(),e.createElementBlock("li",{key:ae.value,class:e.normalizeClass(["dss-filter-popup-item",{selected:B.operator===ae.value}]),onClick:De=>Ze(B,ae.value)},e.toDisplayString(ae.label),11,n0))),128))])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),pt(B.operator)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",l0,[bt(B)==="string"?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,type:"text",class:"dss-filter-value-input",placeholder:e.unref(V)("filter.enterValue"),"onUpdate:modelValue":ae=>B.value=ae},null,8,o0)),[[e.vModelText,B.value]]):bt(B)==="date"?(e.openBlock(),e.createElementBlock("div",a0,[e.createVNode(la,{mode:"single",modelValue:B.value,"onUpdate:modelValue":ae=>B.value=ae},null,8,["modelValue","onUpdate:modelValue"])])):jt(B)==="text"?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:2,type:"text",class:"dss-filter-value-input",placeholder:e.unref(V)("filter.enterValue"),"onUpdate:modelValue":ae=>B.value=ae},null,8,s0)),[[e.vModelText,B.value]]):jt(B)==="number"?(e.openBlock(),e.createElementBlock("input",{key:3,type:"number",class:"dss-filter-value-input",placeholder:e.unref(V)("filter.enterValue"),value:B.value,onInput:ae=>xt(B,ae),step:Ee.value[B.key]?.type==="int"?1:void 0},null,40,r0)):jt(B)==="between"?(e.openBlock(),e.createElementBlock("div",i0,[e.createElementVNode("input",{type:"number",class:"dss-filter-value-input",placeholder:e.unref(V)("filter.min"),value:B.value?.min,onInput:ae=>Ke(B,"min",ae),step:Ee.value[B.key]?.type==="int"?1:void 0},null,40,c0),e.createElementVNode("span",u0,e.toDisplayString(e.unref(V)("filter.and")),1),e.createElementVNode("input",{type:"number",class:"dss-filter-value-input",placeholder:e.unref(V)("filter.max"),value:B.value?.max,onInput:ae=>Ke(B,"max",ae),step:Ee.value[B.key]?.type==="int"?1:void 0},null,40,d0)])):jt(B)==="multiselect"?(e.openBlock(),e.createElementBlock("div",m0,[e.createElementVNode("button",{class:"dss-filter-trigger",onClick:e.withModifiers(ae=>vt(`${B.id}:val`),["stop"])},[e.createElementVNode("span",f0,e.toDisplayString(P(B)),1),b[23]||(b[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,p0),Q.value===`${B.id}:val`?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-popup",onClick:b[6]||(b[6]=e.withModifiers(()=>{},["stop"]))},[U(B).length>6?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":b[5]||(b[5]=ae=>F.value=ae),placeholder:e.unref(V)("filter.search")},null,8,v0)),[[e.vModelText,F.value]]):e.createCommentVNode("",!0),e.createElementVNode("ul",g0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ye(B),ae=>(e.openBlock(),e.createElementBlock("li",{key:ae,class:"dss-filter-popup-item",onClick:De=>zt(B,ae)},[e.createElementVNode("input",{type:"checkbox",checked:(B.value||[]).includes(ae),tabindex:"-1"},null,8,y0),e.createElementVNode("span",null,e.toDisplayString(ae),1)],8,h0))),128)),ye(B).length===0?(e.openBlock(),e.createElementBlock("li",k0,e.toDisplayString(e.unref(V)("filter.noMatch")),1)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)])),e.createElementVNode("button",{class:"dss-filter-row-remove",onClick:ae=>Se(B.id)},[...b[24]||(b[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,C0)]))),128)),e.createElementVNode("div",b0,[e.createElementVNode("div",w0,[e.createElementVNode("button",{class:"dss-filter-add-btn",onClick:b[7]||(b[7]=e.withModifiers(B=>vt("add"),["stop"]))},e.toDisplayString(e.unref(V)("filter.addFilter")),1),Q.value==="add"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-popup dss-filter-add-popup",onClick:b[12]||(b[12]=e.withModifiers(()=>{},["stop"]))},[_e.value&&!ue.value&&!F.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.withDirectives(e.createElementVNode("input",{type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":b[8]||(b[8]=B=>F.value=B),placeholder:e.unref(V)("filter.searchAttributes")},null,8,x0),[[e.vModelText,F.value]]),e.createElementVNode("ul",E0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ye.value,B=>(e.openBlock(),e.createElementBlock("li",{key:B.label,class:"dss-filter-popup-item dss-filter-popup-group",onClick:G=>ue.value=B},[e.createElementVNode("span",null,e.toDisplayString(B.label),1),b[25]||(b[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,S0))),128)),ie.value.length>0?(e.openBlock(),e.createElementBlock("li",V0)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ie.value,B=>(e.openBlock(),e.createElementBlock("li",{key:B.key,class:"dss-filter-popup-item",onClick:G=>K(B.key)},e.toDisplayString(B.label),9,N0))),128))])],64)):ue.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",{class:"dss-filter-popup-back",onClick:b[9]||(b[9]=B=>ue.value=null)},[b[26]||(b[26]=e.createElementVNode("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("polyline",{points:"15 18 9 12 15 6"})],-1)),e.createElementVNode("span",null,e.toDisplayString(ue.value.label),1)]),e.withDirectives(e.createElementVNode("input",{type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":b[10]||(b[10]=B=>F.value=B),placeholder:e.unref(V)("filter.searchAttributes")},null,8,B0),[[e.vModelText,F.value]]),e.createElementVNode("ul",M0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Je.value,B=>(e.openBlock(),e.createElementBlock("li",{key:B.key,class:"dss-filter-popup-item",onClick:G=>K(B.key)},e.toDisplayString(B.label),9,_0))),128)),Je.value.length===0?(e.openBlock(),e.createElementBlock("li",$0,e.toDisplayString(e.unref(V)("filter.noMatch")),1)):e.createCommentVNode("",!0)])],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.withDirectives(e.createElementVNode("input",{type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":b[11]||(b[11]=B=>F.value=B),placeholder:e.unref(V)("filter.searchAttributes")},null,8,L0),[[e.vModelText,F.value]]),e.createElementVNode("ul",T0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(we.value,B=>(e.openBlock(),e.createElementBlock("li",{key:B.key,class:"dss-filter-popup-item",onClick:G=>K(B.key)},e.toDisplayString(B.label),9,A0))),128)),we.value.length===0?(e.openBlock(),e.createElementBlock("li",D0,e.toDisplayString(e.unref(V)("filter.noMatch")),1)):e.createCommentVNode("",!0)])],64))])):e.createCommentVNode("",!0)]),ke.value.length>0?(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-filter-clear-all",onClick:qe},e.toDisplayString(e.unref(V)("filter.clearAllFilters")),1)):e.createCommentVNode("",!0)])])])):e.createCommentVNode("",!0)],512)],2))}}),F0={class:"dss-pill-field__pills"},I0=["data-value"],z0=["disabled"],P0={class:"dss-pill-field__pill-text"},O0={key:0,class:"dss-pill-field__pill-actions"},W0=["onClick"],q0=["onClick"],Z0=["placeholder","disabled"],U0=e.defineComponent({__name:"DSSPillField",props:{modelValue:{default:()=>[]},placeholder:{default:""},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(E,{emit:ne}){const $=E,V=ne,ce=e.ref(""),I=e.ref([...$.modelValue]),_=e.ref(null);let pe=null;const st=e.ref(null),te=e.ref(""),v=e.ref(null),Ce=e.ref(null),ke=e.computed(()=>{if(!Ce.value)return;const{width:_e,height:Ye}=Ce.value;return{minWidth:`${_e}px`,height:`${Ye}px`}});function Q(_e,Ye){st.value===Ye&&(v.value=_e)}function X(){st.value=null,te.value="",Ce.value=null,v.value=null}const me=e.computed(()=>new Set(I.value.map(_e=>_e.trim()).filter(Boolean)));function F(_e){_.value=_e,pe&&clearTimeout(pe),pe=setTimeout(()=>{_.value=null,pe=null},900)}function ue(_e){const Ye=_e.trim();return Ye?me.value.has(Ye)?(F(Ye),!1):(I.value=[...I.value,Ye],V("update:modelValue",[...I.value]),!0):!1}function Me(_e){const Ye=_e.split(/\r?\n/g).map(et=>et.trim()).filter(Boolean);if(!Ye.length)return;const ie=new Set(I.value.map(et=>et.trim()).filter(Boolean)),Je=[...I.value];let we=null;for(const et of Ye){if(ie.has(et)){we??=et;continue}ie.add(et),Je.push(et)}Je.length!==I.value.length&&(I.value=Je,V("update:modelValue",[...I.value])),we&&F(we)}function tt(_e){$.disabled||(st.value===_e&&X(),I.value=I.value.filter((Ye,ie)=>ie!==_e),V("update:modelValue",[...I.value]))}async function mt(_e,Ye){if($.disabled)return;const ie=Ye.currentTarget.closest(".dss-pill-field__pill");ie&&(Ce.value={width:ie.offsetWidth,height:ie.offsetHeight}),st.value=_e,te.value=I.value[_e]??"",await e.nextTick();const Je=v.value;if(!Je)return;Je.focus();const we=Je.value.length;Je.setSelectionRange(we,we)}function Z(){X()}function Ae(){if($.disabled||st.value===null)return;const _e=st.value,Ye=I.value[_e]??"",ie=te.value.trim();if(X(),ie!==Ye&&me.value.has(ie)){F(ie);return}if(!ie){I.value=I.value.filter((we,et)=>et!==_e),V("update:modelValue",[...I.value]);return}const Je=I.value.map((we,et)=>et===_e?ie:we);I.value=Je,V("update:modelValue",[...I.value])}function We(_e){_e.preventDefault(),!$.disabled&&(ue(ce.value),ce.value="")}function Ee(_e){if($.disabled)return;const Ye=_e.clipboardData?.getData("text")??"";!Ye.includes(`
|
|
118
|
-
`)&&!Ye.includes("\r")||(_e.preventDefault(),Me(Ye),ce.value="")}return e.watch(()=>$.modelValue,_e=>{I.value=Array.isArray(_e)?[..._e]:[]},{deep:!0}),e.onBeforeUnmount(()=>{pe&&clearTimeout(pe)}),(_e,Ye)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-pill-field",{"dss-pill-field--disabled":_e.disabled}])},[e.createElementVNode("div",F0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(I.value,(ie,Je)=>(e.openBlock(),e.createElementBlock("span",{key:ie,class:e.normalizeClass(["dss-pill-field__pill",{"dss-pill-field__pill--highlight":_.value===ie,"dss-pill-field__pill--editing":st.value===Je}]),style:e.normalizeStyle(st.value===Je&&Ce.value?ke.value:void 0)},[st.value===Je?(e.openBlock(),e.createElementBlock("span",{key:0,class:"dss-pill-field__pill-edit-wrap","data-value":te.value||" "},[e.withDirectives(e.createElementVNode("input",{ref_for:!0,ref:we=>Q(we,Je),"onUpdate:modelValue":Ye[0]||(Ye[0]=we=>te.value=we),class:"dss-pill-field__pill-edit",type:"text",disabled:_e.disabled,onKeydown:[e.withKeys(Ae,["enter"]),e.withKeys(Z,["esc"])],onBlur:Ae},null,40,z0),[[e.vModelText,te.value]])],8,I0)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("span",P0,e.toDisplayString(ie),1),_e.disabled?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",O0,[e.createElementVNode("button",{type:"button",class:"dss-pill-field__pill-action",onClick:we=>mt(Je,we)},[...Ye[2]||(Ye[2]=[e.createElementVNode("svg",{class:"dss-pill-field__pill-action-icon",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M0 9.64033V11.6667C0 11.8534 0.146646 12 0.333287 12H2.35967C2.44633 12 2.53298 11.9667 2.59297 11.9L9.87196 4.62769L7.37231 2.12804L0.0999862 9.40036C0.0333288 9.46702 0 9.54701 0 9.64033ZM11.805 2.69463C12.065 2.43466 12.065 2.01472 11.805 1.75476L10.2452 0.194973C9.98528 -0.064991 9.56534 -0.064991 9.30537 0.194973L8.08554 1.4148L10.5852 3.91446L11.805 2.69463Z",fill:"currentColor"})],-1)])],8,W0),e.createElementVNode("button",{type:"button",class:"dss-pill-field__pill-action dss-pill-field__pill-action--remove",onClick:we=>tt(Je)}," × ",8,q0)]))],64))],6))),128)),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":Ye[1]||(Ye[1]=ie=>ce.value=ie),class:"dss-pill-field__input",type:"text",placeholder:I.value.length?"":_e.placeholder,disabled:_e.disabled,onPaste:Ee,onKeydown:e.withKeys(We,["enter"])},null,40,Z0),[[e.vModelText,ce.value]])])],2))}}),X0={class:"dss-step-bar__layout"},Y0={class:"dss-step-bar__header"},j0={class:"dss-step-bar__label"},K0={key:0,class:"dss-step-bar__counter"},G0={class:"dss-step-bar__track-wrapper"},Q0=["aria-valuemax","aria-valuenow","aria-label"],J0=["onMouseenter"],ep={__name:"DSSStepBar",props:{label:{type:String,default:"Progress"},steps:{type:Number,default:5},currentStep:{type:Number,default:0},segments:{type:Array,default:()=>[]},segmentOrder:{type:String,default:"input",validator:E=>["input","desc","asc"].includes(E)},orientation:{type:String,default:"horizontal",validator:E=>["horizontal","vertical"].includes(E)},barHeight:{type:[Number,String],default:200},labelPosition:{type:String,default:"up",validator:E=>["up","down","left","right"].includes(E)},sideLabelMaxWidth:{type:[Number,String],default:null},sideLabelWrapWidth:{type:[Number,String],default:"18ch"},totalValue:{type:Number,default:null},activeColor:{type:String,default:"#34c759"},labelColor:{type:String,default:null},counterColor:{type:String,default:null},valueLabel:{type:String,default:""},counterAsPercentage:{type:Boolean,default:!1},showCounter:{type:Boolean,default:!0},inactiveColor:{type:String,default:"#e5e7eb"},remainderLabel:{type:String,default:"Unused"},remainderTooltipSummary:{type:Boolean,default:!1},options:{type:Object,default:()=>({})}},setup(E){const ne=E,$={segmentMarker:{color:null,width:null,height:null,backgroundColor:"transparent",borderColor:"transparent"},maxSegment:{marker:{enabled:!1,color:null,width:null,height:null,backgroundColor:"transparent",borderColor:"transparent"}}},V=U=>U&&typeof U=="object"&&!Array.isArray(U),ce=(U,ye)=>{const P=Object.assign({},U);return!V(U)||!V(ye)||Object.keys(ye).forEach(K=>{if(V(ye[K])){K in U?P[K]=ce(U[K],ye[K]):Object.assign(P,{[K]:ye[K]});return}Object.assign(P,{[K]:ye[K]})}),P},I=e.computed(()=>ce($,ne.options)),_=e.computed(()=>Math.max(1,Number(ne.steps)||1)),pe=e.computed(()=>Math.min(_.value,Math.max(0,Number(ne.currentStep)||0))),st=e.computed(()=>Array.isArray(ne.segments)&&ne.segments.length>0),te=e.computed(()=>{if(!st.value)return[];const U=ne.segments.map((ye,P)=>{const K=Number(ye?.value);return{label:ye?.label||`Step ${P+1}`,value:Number.isFinite(K)&&K>0?K:0,color:ye?.color||ne.activeColor,marker:ye?.marker}});return ne.segmentOrder==="desc"?[...U].sort((ye,P)=>P.value-ye.value):ne.segmentOrder==="asc"?[...U].sort((ye,P)=>ye.value-P.value):U}),v=e.computed(()=>st.value?te.value.reduce((U,ye)=>U+ye.value,0):pe.value),Ce=e.computed(()=>st.value?Number.isFinite(Number(ne.totalValue))&&Number(ne.totalValue)>0?Number(ne.totalValue):Math.max(1,v.value):_.value),ke=e.computed(()=>st.value&&Number.isFinite(Number(ne.totalValue))&&Number(ne.totalValue)>0),Q=e.computed(()=>ke.value?Math.max(0,Number(ne.totalValue)-v.value):0),X=e.computed(()=>typeof ne.remainderLabel=="string"&&ne.remainderLabel.trim().length>0),me=e.computed(()=>Q.value>0),F=e.computed(()=>te.value.reduce((U,ye)=>Math.max(U,Number(ye.value)||0),0)),ue=e.computed(()=>te.value.filter(U=>U.value>0).map(U=>`${U.label}: ${bt(U.value)}`).join(" | ")),Me=e.computed(()=>st.value?ke.value?te.value.filter(U=>U.value>0):te.value:[]),tt=e.computed(()=>{if(!ne.counterAsPercentage)return`${v.value} / ${Ce.value}`;const U=Number(Ce.value);if(!Number.isFinite(U)||U<=0)return"0%";const ye=Math.round(Number(v.value)/U*100);return`${Math.min(Math.max(ye,0),100)}%`}),mt=e.computed(()=>v.value),Z=e.computed(()=>Ce.value),Ae=e.reactive({visible:!1,x:0,y:0,content:""}),We=e.computed(()=>ne.orientation==="vertical"),Ee=e.computed(()=>{const U=ne.barHeight;return U==null||U===""?"200px":typeof U=="number"?`${U}px`:String(U)}),_e=e.computed(()=>{const U=ne.sideLabelMaxWidth;if(!(U==null||U===""))return typeof U=="number"?`${U}px`:String(U)}),Ye=e.computed(()=>{const U=ne.sideLabelWrapWidth;return U==null||U===""?"18ch":typeof U=="number"?`${U}ch`:String(U)}),ie=e.computed(()=>({left:`${Ae.x}px`,top:`${Ae.y}px`,transform:"translate(-50%, calc(-100% - 8px))"})),Je=U=>We.value?{flex:`${U} 0 0`,minHeight:U>0?"6px":"0",minWidth:"0"}:{flex:`${U} 0 0`,minWidth:U>0?"6px":"0"},we=U=>{const ye=U?.parentElement;if(!ye)return{x:0,y:0};const P=ye.getBoundingClientRect();return{x:P.left+P.width/2,y:P.top}},et=U=>{const ye=U.getBoundingClientRect();return{x:ye.left+ye.width/2,y:ye.top}},ct=U=>{if(ke.value){const K=Math.max(0,Number(U.value)||0);return{...Je(K),backgroundColor:U.color}}const ye=v.value,P=U.value>0?U.value:ye>0?1e-4:1;return{...Je(P),backgroundColor:U.color}},vt=U=>Number(U?.value||0)>0&&Number(U?.value||0)===F.value,ut=U=>{const ye=V(U?.marker)?U.marker:{},P=U?.marker===!0||ye.enabled===!0,K=vt(U)&&I.value.maxSegment?.marker?.enabled===!0;if(!(P||K))return{enabled:!1};const Re=ye.backgroundColor??(K?I.value.maxSegment?.marker?.backgroundColor:I.value.segmentMarker?.backgroundColor),Ze=ye.borderColor??(K?I.value.maxSegment?.marker?.borderColor:I.value.segmentMarker?.borderColor),xt=ye.color??(K?I.value.maxSegment?.marker?.color:I.value.segmentMarker?.color),Ke=ye.width??(K?I.value.maxSegment?.marker?.width:I.value.segmentMarker?.width),zt=ye.height??(K?I.value.maxSegment?.marker?.height:I.value.segmentMarker?.height);return{enabled:!0,backgroundColor:Re,borderColor:Ze,color:xt,width:Ke,height:zt,icon:ye.icon??null,...ye}},Ft=U=>{const ye=ut(U);return{backgroundColor:ye.backgroundColor??void 0,borderColor:ye.borderColor??void 0,color:ye.color??void 0}},It=U=>{const ye=ut(U);return{width:ye.width??void 0,height:ye.height??void 0}},bt=U=>`${U}${ne.valueLabel}`,wt=e.computed(()=>({...Je(Q.value),backgroundColor:ne.inactiveColor})),Jt=(U,ye)=>{if(!U||!ye?.currentTarget)return;const P=ye.currentTarget;if(ne.remainderTooltipSummary){const Se=we(P);Ae.x=Se.x,Ae.y=Se.y,Ae.content=ue.value,Ae.visible=!!Ae.content;return}const K=et(P);Ae.x=K.x,Ae.y=K.y,Ae.content=`${U.label}: ${bt(U.value)}`,Ae.visible=!0},pt=U=>{if(!Q.value||!U?.currentTarget)return;const ye=U.currentTarget;if(ne.remainderTooltipSummary){const K=we(ye);Ae.x=K.x,Ae.y=K.y,Ae.content=ue.value,Ae.visible=!!Ae.content;return}const P=et(ye);Ae.x=P.x,Ae.y=P.y,X.value&&(Ae.content=`${ne.remainderLabel}: ${bt(Q.value)}`,Ae.visible=!0)},jt=()=>{Ae.visible=!1},kt=()=>{Ae.visible&&jt()};e.onMounted(()=>{window.addEventListener("scroll",kt,!0)}),e.onBeforeUnmount(()=>{window.removeEventListener("scroll",kt,!0)});const tn=e.computed(()=>({"--dss-step-bar-label-color":ne.labelColor??void 0,"--dss-step-bar-counter-color":ne.counterColor??void 0,"--dss-step-bar-active-color":ne.activeColor,"--dss-step-bar-inactive-color":ne.inactiveColor,"--dss-step-bar-bar-height":We.value?Ee.value:void 0,"--dss-step-bar-side-label-max-width":_e.value,"--dss-step-bar-side-label-wrap-width":Ye.value}));return(U,ye)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-step-bar",[`dss-step-bar--${E.orientation}`,`dss-step-bar--label-${E.labelPosition}`]]),style:e.normalizeStyle(tn.value)},[e.createElementVNode("div",X0,[e.createElementVNode("div",Y0,[e.createElementVNode("span",j0,[e.renderSlot(U.$slots,"label",{label:E.label},()=>[e.createTextVNode(e.toDisplayString(E.label),1)])]),E.showCounter?(e.openBlock(),e.createElementBlock("span",K0,[e.renderSlot(U.$slots,"counter",{counterDisplay:tt.value},()=>[e.createTextVNode(e.toDisplayString(tt.value),1)])])):e.createCommentVNode("",!0)]),e.createElementVNode("div",G0,[e.createElementVNode("div",{class:"dss-step-bar__track",role:"progressbar","aria-valuemin":0,"aria-valuemax":Z.value,"aria-valuenow":mt.value,"aria-label":E.label},[st.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Me.value,(P,K)=>(e.openBlock(),e.createElementBlock("div",{key:`segment-${K}-${P.label}`,class:e.normalizeClass(["dss-step-bar__segment dss-step-bar__segment--interactive",{"dss-step-bar__segment--max":vt(P),"dss-step-bar__segment--marker-enabled":ut(P).enabled}]),style:e.normalizeStyle(ct(P)),onMouseenter:Se=>Jt(P,Se),onMouseleave:jt},[ut(P).enabled?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-step-bar__segment-marker",style:e.normalizeStyle(Ft(P)),"aria-hidden":"true"},[e.createElementVNode("span",{class:"dss-step-bar__segment-marker-icon",style:e.normalizeStyle(It(P))},[e.renderSlot(U.$slots,"segment-marker-icon",{segment:P,index:K,marker:ut(P)},()=>[e.renderSlot(U.$slots,"max-segment-icon",{segment:P,index:K,marker:ut(P)},()=>[e.createTextVNode(e.toDisplayString(ut(P).icon||""),1)])])],4)],4)):e.createCommentVNode("",!0)],46,J0))),128)),me.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-step-bar__segment dss-step-bar__segment--remainder",style:e.normalizeStyle(wt.value),onMouseenter:ye[0]||(ye[0]=P=>pt(P)),onMouseleave:jt},null,36)):e.createCommentVNode("",!0)],64)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(_.value,P=>(e.openBlock(),e.createElementBlock("div",{key:P,class:e.normalizeClass(["dss-step-bar__segment",{"dss-step-bar__segment--active":P<=pe.value}])},null,2))),128))],8,Q0)])]),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[Ae.visible?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-step-bar__tooltip dss-step-bar__tooltip--teleported",style:e.normalizeStyle(ie.value)},e.toDisplayString(Ae.content),5)):e.createCommentVNode("",!0)]))],6))}},tp={key:0,class:"dss-title dss-title--separator"},np={__name:"DSSTitle",props:{type:{type:String,default:"main",validator:E=>["main","separator","subtitle"].includes(E)},h:{type:Number,default:null,validator:E=>E===null||Number.isInteger(E)&&E>=1&&E<=6},size:{type:[String,Number],default:null},weight:{type:[String,Number],default:null},color:{type:String,default:null},editable:{type:Boolean,default:!1},modelValue:{type:String,default:""}},emits:["update:modelValue","change"],setup(E,{expose:ne,emit:$}){const V=E,ce=$,I=e.ref(null),_=e.computed(()=>`dss-title--${V.type}`),pe=e.computed(()=>V.h!=null?`dss-title--h${V.h}`:null),st={main:"div",subtitle:"p",separator:"span"},te=e.computed(()=>V.h!=null?`h${V.h}`:st[V.type]??"div"),v=e.computed(()=>V.editable?"plaintext-only":void 0),Ce=e.computed(()=>{const ue={};return V.size!=null&&(ue.fontSize=typeof V.size=="number"?`${V.size}px`:V.size),V.weight!=null&&(ue.fontWeight=V.weight),V.color!=null&&(ue.color=V.color),Object.keys(ue).length?ue:void 0}),ke=e.computed(()=>V.editable?{input:X,keydown:me,paste:F}:{}),Q=()=>{const ue=I.value;!V.editable||!ue||document.activeElement!==ue&&(ue.innerText=V.modelValue??"")},X=ue=>{const Me=ue.target.innerText;ce("update:modelValue",Me),ce("change",Me)},me=ue=>{ue.key==="Enter"&&ue.preventDefault()},F=ue=>{ue.preventDefault();const Me=(ue.clipboardData||window.clipboardData).getData("text/plain");document.execCommand("insertText",!1,Me)};return e.watch(()=>V.modelValue,()=>{Q()}),e.watch(()=>V.editable,()=>{e.nextTick(Q)}),e.onMounted(()=>{e.nextTick(Q)}),ne({focus:()=>I.value?.focus()}),(ue,Me)=>E.type==="separator"?(e.openBlock(),e.createElementBlock("div",tp,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(te.value),e.mergeProps({ref_key:"titleRef",ref:I,class:["dss-title__separator-label",pe.value,{"dss-title--editable":E.editable}],style:Ce.value,contenteditable:v.value,spellcheck:E.editable?!1:void 0},e.toHandlers(ke.value)),{default:e.withCtx(()=>[E.editable?e.createCommentVNode("",!0):e.renderSlot(ue.$slots,"default",{key:0},()=>[e.createTextVNode(e.toDisplayString(E.modelValue),1)])]),_:3},16,["class","style","contenteditable","spellcheck"]))])):(e.openBlock(),e.createBlock(e.resolveDynamicComponent(te.value),e.mergeProps({key:1,ref_key:"titleRef",ref:I,class:["dss-title",[_.value,pe.value,{"dss-title--editable":E.editable}]],style:Ce.value,contenteditable:v.value,spellcheck:E.editable?!1:void 0},e.toHandlers(ke.value)),{default:e.withCtx(()=>[E.editable?e.createCommentVNode("",!0):e.renderSlot(ue.$slots,"default",{key:0},()=>[e.createTextVNode(e.toDisplayString(E.modelValue),1)])]),_:3},16,["class","style","contenteditable","spellcheck"]))}},lp={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"}},op={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"},ap={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"}},sp={selectDate:"Select Date",selectRange:"Select range",selectFromList:"Select a date",noAvailableDates:"No dates available",startDate:"Start date",endDate:"End date",prevMonth:"Previous month",nextMonth:"Next month",quickSelect:{today:"Today",lastWeek:"Last week",last15Days:"Last 15 days",last30Days:"Last 30 days",thisMonth:"This month",last3Months:"Last 3 months",last6Months:"Last 6 months",last12Months:"Last 12 months",lastYear:"Last year",allDates:"All dates",last2Dates:"Last 2 dates",last3Dates:"Last 3 dates",last4Dates:"Last 4 dates",last5Dates:"Last 5 dates"}},rp={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"}},uo={chart:lp,table:op,filter:ap,datepicker:sp,textEditor:rp},ip={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"}},cp={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"},up={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"}},dp={selectDate:"Sélectionner une date",selectRange:"Sélectionner une plage",selectFromList:"Sélectionner une date",noAvailableDates:"Aucune date disponible",startDate:"Date de début",endDate:"Date de fin",prevMonth:"Mois précédent",nextMonth:"Mois suivant",quickSelect:{today:"Aujourd'hui",lastWeek:"Dernière semaine",last15Days:"15 derniers jours",last30Days:"30 derniers jours",thisMonth:"Ce mois",last3Months:"3 derniers mois",last6Months:"6 derniers mois",last12Months:"12 derniers mois",lastYear:"Dernière année",allDates:"Toutes les dates",last2Dates:"2 dernières dates",last3Dates:"3 dernières dates",last4Dates:"4 dernières dates",last5Dates:"5 dernières dates"}},mp={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"}},mo={chart:ip,table:cp,filter:up,datepicker:dp,textEditor:mp},pp={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"}},fp={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"},vp={searchAcrossFields:"Zoeken in alle velden...",openAdvancedFilter:"Geavanceerde filter openen",closeAdvancedFilter:"Geavanceerde filter sluiten",noConditionsApplied:"Er zijn geen filtervoorwaarden toegepast op deze weergave",where:"Waar",and:"En",searchAttributes:"Zoek attributen...",noMatch:"Geen overeenkomst",enterValue:"Voer waarde in...",min:"Min",max:"Max",search:"Zoeken...",addFilter:"Filter toevoegen",clearAllFilters:"Alle filters wissen",select:"Selecteren...",selectedCount:"{count} geselecteerd",operators:{contains:"bevat",not_contains:"bevat niet",equals:"is gelijk aan",not_equals:"is niet gelijk aan",starts_with:"begint met",ends_with:"eindigt op",is_empty:"is leeg",is_not_empty:"is niet leeg",is_any_of:"is een van",is_none_of:"is geen van",eq:"=",neq:"≠",gt:">",gte:"≥",lt:"<",lte:"≤",between:"tussen",contains_any:"bevat een van",contains_all:"bevat alle",not_contains_any:"bevat niet",before:"voor",after:"na",is_true:"is waar",is_false:"is onwaar"}},gp={selectDate:"Selecteer datum",selectRange:"Selecteer bereik",selectFromList:"Selecteer een datum",noAvailableDates:"Geen datums beschikbaar",startDate:"Startdatum",endDate:"Einddatum",prevMonth:"Vorige maand",nextMonth:"Volgende maand",quickSelect:{today:"Vandaag",lastWeek:"Afgelopen week",last15Days:"Laatste 15 dagen",last30Days:"Laatste 30 dagen",thisMonth:"Deze maand",last3Months:"Laatste 3 maanden",last6Months:"Laatste 6 maanden",last12Months:"Laatste 12 maanden",lastYear:"Afgelopen jaar",allDates:"Alle datums",last2Dates:"Laatste 2 datums",last3Dates:"Laatste 3 datums",last4Dates:"Laatste 4 datums",last5Dates:"Laatste 5 datums"}},hp={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"}},po={chart:pp,table:fp,filter:vp,datepicker:gp,textEditor:hp},Po={en:uo,fr:mo,nl:po};function ma(E){if(!E||!E.global)return;const ne=E.global.availableLocales||[];Object.keys(Po).forEach($=>{ne.includes($)&&E.global.mergeLocaleMessage($,Po[$])})}const Oo={en:{textEditor:uo.textEditor},fr:{textEditor:mo.textEditor},nl:{textEditor:po.textEditor}};function pa(E){if(!E||!E.global)return;const ne=E.global.availableLocales||[];Object.keys(Oo).forEach($=>{ne.includes($)&&E.global.mergeLocaleMessage($,Oo[$])})}const Wo={en:{table:uo.table},fr:{table:mo.table},nl:{table:po.table}};function fa(E){if(!E||!E.global)return;const ne=E.global.availableLocales||[];Object.keys(Wo).forEach($=>{ne.includes($)&&E.global.mergeLocaleMessage($,Wo[$])})}const qo={en:{datepicker:uo.datepicker},fr:{datepicker:mo.datepicker},nl:{datepicker:po.datepicker}};function va(E){if(!E||!E.global)return;const ne=E.global.availableLocales||[];Object.keys(qo).forEach($=>{ne.includes($)&&E.global.mergeLocaleMessage($,qo[$])})}const Zo={en:{filter:uo.filter},fr:{filter:mo.filter},nl:{filter:po.filter}};function ga(E){if(!E||!E.global)return;const ne=E.global.availableLocales||[];Object.keys(Zo).forEach($=>{ne.includes($)&&E.global.mergeLocaleMessage($,Zo[$])})}const yp={chart:Po,textEditor:Oo,table:Wo,datepicker:qo,filter:Zo};function kp(E){!E||!E.global||(ma(E),pa(E),fa(E),va(E),ga(E))}const Cp={en:{...uo},fr:{...mo},nl:{...po}};co.createI18n({legacy:!1,locale:"en",fallbackLocale:"en",messages:Cp});exports.DSSChart=fc;exports.DSSChartMessages=Po;exports.DSSColorPicker=n2;exports.DSSConfetti=_2;exports.DSSDatepicker=la;exports.DSSDatepickerMessages=qo;exports.DSSDnd=B2;exports.DSSFilter=R0;exports.DSSFilterMessages=Zo;exports.DSSLoader=v2;exports.DSSMessages=yp;exports.DSSModal=na;exports.DSSPillField=U0;exports.DSSSkeleton=g2;exports.DSSStepBar=ep;exports.DSSTable=Hu;exports.DSSTableMessages=Wo;exports.DSSTextEditor=zm;exports.DSSTextEditorMessages=Oo;exports.DSSTitle=np;exports.addDSSChartTranslations=ma;exports.addDSSDatepickerTranslations=va;exports.addDSSFilterTranslations=ga;exports.addDSSTableTranslations=fa;exports.addDSSTextEditorTranslations=pa;exports.addDSSTranslations=kp;
|
|
119
|
+
`,document.body.appendChild(Xe),ue=Xe}function Qe(W,G){ue&&(ue.style.left=`${W-tt}px`,ue.style.top=`${G-mt}px`)}function Ce(W){W.classList.add("dss-dnd-item--dragging"),W.style.background=fe.value.dragSourceBackground,W.style.borderColor=fe.value.dragSourceBorder,W.style.transform="scale(0.97)"}function Je(W){W.classList.remove("dss-dnd-item--dragging"),W.style.background="",W.style.borderColor="",W.style.transform=""}function ut(W,G){return document.elementFromPoint(W,G)?.closest(".dss-dnd-column-body")??null}function ht(W,G){return!!document.elementFromPoint(W,G)?.closest("[data-dss-dnd-delete-zone]")}function dt(W,G){if(O.value&&ht(W,G)){ke.value=!0,be.value=null,J.value=-1;return}ke.value=!1;const Ne=ut(W,G),Pe=Ne?.getAttribute("data-column")??null;if(!Pe){be.value=null,J.value=-1;return}be.value=Pe;const Xe=Ne.querySelectorAll(".dss-dnd-item:not(.dss-dnd-item--dragging)");let Et=Xe.length;for(let Ge=0;Ge<Xe.length;Ge++){const Zt=Xe[Ge].getBoundingClientRect();if(G<Zt.top+Zt.height/2){Et=Ge;break}}J.value=Et}function Wt(W){W.preventDefault(),Qe(W.clientX,W.clientY),!me&&(me=requestAnimationFrame(()=>{me=null,dt(W.clientX,W.clientY)}))}function qt(W){window.removeEventListener("pointermove",Wt),window.removeEventListener("pointerup",qt),window.removeEventListener("pointercancel",qt),$e?.releasePointerCapture?.(W.pointerId),Je($e),$e=null;const G=O.value&&ht(W.clientX,W.clientY);if(v.value&&G)V("delete",{item:v.value});else{const Pe=ut(W.clientX,W.clientY)?.getAttribute("data-column")??null;if(v.value&&Pe){const Xe=v.value[$.columnKey],Et=Pe,Zt=(Ve.value[Et]||[]).filter(Lt=>Lt[$.itemKey]!==v.value[$.itemKey]),Ue=Math.max(0,Math.min(J.value,Zt.length)),We=je(Et,Ue),Dt=v.value[$.itemKey];V("move",{item:v.value,from:Xe,to:Et,position:We,index:Ue}),F&&clearTimeout(F),Y.value={id:Dt,from:Xe,to:Et},F=setTimeout(()=>{Y.value=null},3500)}}ue&&(ue.remove(),ue=null),U!==null&&(document.body.style.cursor=U,U=""),ge()}function Ct(W,G){W.preventDefault();const Ne=W.target.closest(".dss-dnd-item");if(!Ne)return;const Pe=Ne.getBoundingClientRect();tt=W.clientX-Pe.left,mt=W.clientY-Pe.top,U=document.body.style.cursor,document.body.style.cursor="grabbing",v.value=G,$e=Ne,re(Ne,W.clientX,W.clientY),requestAnimationFrame(()=>Ce(Ne)),Ne.setPointerCapture?.(W.pointerId),window.addEventListener("pointermove",Wt),window.addEventListener("pointerup",qt,{once:!0}),window.addEventListener("pointercancel",qt,{once:!0})}function wt(){ze&&(window.removeEventListener("pointermove",Yt),window.removeEventListener("pointerup",it),window.removeEventListener("pointercancel",it),ze=null)}function Yt(W){if(!ze||W.pointerId!==ze.pointerId)return;const G=W.clientX-ze.startX,Ne=W.clientY-ze.startY;if(Math.abs(G)>=qe||Math.abs(Ne)>=qe){const Pe=ze.item;wt(),Ct(W,Pe)}}function it(W){!ze||W.pointerId!==ze.pointerId||wt()}function Kt(W,G){wt(),ze={item:G,startX:W.clientX,startY:W.clientY,pointerId:W.pointerId},window.addEventListener("pointermove",Yt),window.addEventListener("pointerup",it),window.addEventListener("pointercancel",it)}function yt(W,G){fe.value.useHandle||Kt(W,G)}function el(W,G){Kt(W,G)}function X(){me&&(cancelAnimationFrame(me),me=null)}function ge(){X(),v.value=null,be.value=null,ke.value=!1,J.value=-1}return e.onBeforeUnmount(()=>{X(),wt(),F&&clearTimeout(F),ue&&(ue.remove(),ue=null)}),(W,G)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-dnd",{"dss-dnd--unstyled":fe.value.unstyled}]),style:e.normalizeStyle(rt.value)},[O.value?(e.openBlock(),e.createBlock(e.Teleport,{key:0,to:"body"},[e.withDirectives(e.createElementVNode("div",{class:e.normalizeClass(["dss-dnd-delete-zone",{"dss-dnd-delete-zone--drag-over":ke.value}]),"data-dss-dnd-delete-zone":""},[e.renderSlot(W.$slots,"delete-zone",{isDragging:!!v.value,isOver:ke.value})],2),[[e.vShow,!!v.value||fe.value.deleteZoneAlwaysVisible]])])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(E.columns,Ne=>(e.openBlock(),e.createElementBlock("div",{key:Ne.value,class:e.normalizeClass(["dss-dnd-column",[{"dss-dnd-column--drag-over":be.value==Ne.value},Ne.class||""]]),style:e.normalizeStyle(ee(Ne))},[fe.value.showHeader?(e.openBlock(),e.createElementBlock("div",e0,[e.renderSlot(W.$slots,"column-header",{column:Ne,items:Ve.value[Ne.value]||[]},()=>[e.createElementVNode("span",t0,e.toDisplayString(Ne.title||Ne.value),1),e.createElementVNode("span",l0,e.toDisplayString((Ve.value[Ne.value]||[]).length),1)])])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"dss-dnd-column-body","data-column":Ne.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Le.value[Ne.value],Pe=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:Pe.key},[Pe.type==="indicator"?(e.openBlock(),e.createElementBlock("div",o0)):(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["dss-dnd-item",{"dss-dnd-item--dragging":Pe.isDragged,"dss-dnd-item--no-handle":!fe.value.useHandle}]),onPointerdown:Xe=>yt(Xe,Pe.item)},[fe.value.useHandle?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-dnd-handle",onPointerdown:e.withModifiers(Xe=>el(Xe,Pe.item),["stop"])},[e.renderSlot(W.$slots,"handle",{},()=>[G[0]||(G[0]=e.createElementVNode("span",{class:"dss-dnd-handle-icon"},"⠿",-1))])],40,s0)):e.createCommentVNode("",!0),e.createElementVNode("div",r0,[e.renderSlot(W.$slots,"item",{item:Pe.item,column:Ne,justDropped:Y.value?.id===Pe.item[E.itemKey],droppedFrom:Y.value?.id===Pe.item[E.itemKey]?Y.value.from:null,droppedTo:Y.value?.id===Pe.item[E.itemKey]?Y.value.to:null},()=>[e.createElementVNode("div",i0,e.toDisplayString(Pe.item[E.itemKey]),1)])])],42,a0))],64))),128)),(Ve.value[Ne.value]||[]).length===0&&be.value!=Ne.value?(e.openBlock(),e.createElementBlock("div",c0,[e.renderSlot(W.$slots,"empty",{column:Ne},()=>[G[1]||(G[1]=e.createElementVNode("span",{class:"dss-dnd-empty-text"},"No items",-1))])])):e.createCommentVNode("",!0)],8,n0)],6))),128))],6))}}),m0={name:"DSSConfetti"},p0=Object.assign(m0,{props:{trigger:{type:Boolean,default:!1},duration:{type:Number,default:3e3},fadeStart:{type:Number,default:2e3},count:{type:Number,default:90},colors:{type:Array,default:()=>["#047395","#ffc230","#0897c1","#fe3b59","#11e1a2","#b3b2fb","#fadb8d","#ffa25b","#feaab1"]},delay:{type:Number,default:300}},setup(E){const te=E,$=e.ref(null),V=e.ref(!1);let ce=[],O=null,L=null;function fe(J,Y){const me=[];for(let F=0;F<te.count;F++)me.push(rt(J));return me}function rt(J,Y){return{x:Math.random()*J,y:-Math.random()*150-20,r:Math.random()*8+3,d:Math.random()*50,color:te.colors[Math.floor(Math.random()*te.colors.length)],tilt:Math.floor(Math.random()*10)-10,tiltInc:Math.random()*.08+.04,tiltAngle:0,opacity:Math.random()*.7+.3,speed:Math.random()*4+1.5}}function ee(J,Y,me,F){J.clearRect(0,0,Y,me);for(const ue of ce)J.save(),J.globalAlpha=ue.opacity*F,J.beginPath(),J.lineWidth=ue.r,J.strokeStyle=ue.color,J.moveTo(ue.x+ue.tilt+ue.r/2,ue.y),J.lineTo(ue.x+ue.tilt,ue.y+ue.tilt+ue.r/2),J.stroke(),J.restore()}function v(J,Y,me){const F=.3+me*.7;for(let ue=0;ue<ce.length;ue++){const $e=ce[ue];$e.tiltAngle+=$e.tiltInc,$e.y+=$e.speed*F,$e.x+=Math.sin($e.d)*.5*F,$e.tilt=Math.sin($e.tiltAngle)*15,me>=.99&&$e.y>Y+20&&(ce[ue]=rt(J))}}function be(){V.value=!0,e.nextTick(()=>{const J=$.value;if(!J)return;const Y=J.getContext("2d"),me=J.parentElement;if(!me)return;const F=me.getBoundingClientRect();J.width=F.width,J.height=F.height,ce=fe(J.width,J.height);const ue=Date.now(),$e=ue+te.duration,tt=()=>{const mt=Date.now(),U=mt-ue;if(mt<$e){let ze=1;U>te.fadeStart&&(ze=1-(U-te.fadeStart)/(te.duration-te.fadeStart)),ee(Y,J.width,J.height,ze),v(J.width,J.height,ze),O=requestAnimationFrame(tt)}else ke()};tt()})}function ke(){O&&(cancelAnimationFrame(O),O=null),ce=[],V.value=!1}return e.watch(()=>te.trigger,J=>{J&&(L&&clearTimeout(L),L=setTimeout(be,te.delay))},{immediate:!0}),e.onBeforeUnmount(()=>{ke(),L&&clearTimeout(L)}),(J,Y)=>V.value?(e.openBlock(),e.createElementBlock("canvas",{key:0,ref_key:"canvasRef",ref:$,class:"dss-confetti-canvas"},null,512)):e.createCommentVNode("",!0)}}),f0={class:"dss-filter-global-inner"},v0=["placeholder","value"],h0=["title"],g0={key:0,class:"dss-filter-funnel-badge"},y0={key:1,class:"dss-filter-sortby"},k0=["value"],C0=["value"],b0=["disabled","title"],x0={key:0,class:"dss-filter-sortby-order-icon",width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},w0={key:1,class:"dss-filter-sortby-order-icon",width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},E0={key:2,class:"dss-filter-sortby-order-icon",width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},S0={class:"dss-filter-panel"},V0={key:0,class:"dss-filter-empty"},N0={class:"dss-filter-row-prefix"},B0={class:"dss-filter-cell"},M0=["onClick"],_0={class:"dss-filter-trigger-text"},$0=["placeholder"],L0={class:"dss-filter-popup-list"},A0=["onClick"],T0={key:0,class:"dss-filter-popup-empty"},D0={key:0,class:"dss-filter-cell"},H0=["onClick"],R0={class:"dss-filter-trigger-text"},F0={class:"dss-filter-popup-list"},I0=["onClick"],z0={key:1,class:"dss-filter-cell dss-filter-cell--value"},P0=["placeholder","onUpdate:modelValue"],O0={key:1,class:"dss-filter-date-wrap"},W0=["placeholder","onUpdate:modelValue"],q0=["placeholder","value","onInput","step"],Z0={key:4,class:"dss-filter-between"},U0=["placeholder","value","onInput","step"],X0={class:"dss-filter-between-sep"},Y0=["placeholder","value","onInput","step"],j0={key:5,class:"dss-filter-multiselect"},K0=["onClick"],G0={class:"dss-filter-trigger-text"},Q0=["placeholder"],J0={class:"dss-filter-popup-list dss-filter-popup-list--check"},ep=["onClick"],tp=["checked"],lp={key:0,class:"dss-filter-popup-empty"},np=["onClick"],op={class:"dss-filter-foot"},ap={class:"dss-filter-cell"},sp=["placeholder"],rp={class:"dss-filter-popup-list"},ip=["onClick"],cp={key:0,class:"dss-filter-popup-divider"},up=["onClick"],dp=["placeholder"],mp={class:"dss-filter-popup-list"},pp=["onClick"],fp={key:0,class:"dss-filter-popup-empty"},vp=["placeholder"],hp={class:"dss-filter-popup-list"},gp=["onClick"],yp={key:0,class:"dss-filter-popup-empty"},kp={name:"DSSFilter"},Cp=Object.assign(kp,{props:{data:{type:Array,required:!0},modelValue:{type:Array,default:void 0},exclude:{type:Array,default:()=>[]},config:{type:Object,default:()=>({})},options:{type:Object,default:()=>({})},showSortBy:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(E,{expose:te,emit:$}){const{t:V}=ro.useI18n(),ce=E,O=$,L={unstyled:!1,maxUniqueForSelect:30,maxUniqueForEnum:15},fe=e.computed(()=>({...L,...ce.options})),rt={text:[{value:"contains"},{value:"not_contains"},{value:"equals"},{value:"not_equals"},{value:"starts_with"},{value:"ends_with"},{value:"is_empty"},{value:"is_not_empty"}],select:[{value:"is_any_of"},{value:"is_none_of"},{value:"is_empty"},{value:"is_not_empty"}],range:[{value:"eq"},{value:"neq"},{value:"gt"},{value:"gte"},{value:"lt"},{value:"lte"},{value:"between"},{value:"is_empty"},{value:"is_not_empty"}],int:[{value:"eq"},{value:"neq"},{value:"gt"},{value:"gte"},{value:"lt"},{value:"lte"},{value:"between"},{value:"is_empty"},{value:"is_not_empty"}],arraySelect:[{value:"contains_any"},{value:"contains_all"},{value:"not_contains_any"},{value:"is_empty"},{value:"is_not_empty"}],arrayText:[{value:"contains"},{value:"not_contains"},{value:"is_empty"},{value:"is_not_empty"}],date:[{value:"eq"},{value:"before"},{value:"after"},{value:"is_empty"},{value:"is_not_empty"}],boolean:[{value:"is_true"},{value:"is_false"},{value:"is_empty"},{value:"is_not_empty"}]},ee=new Set(["is_empty","is_not_empty","is_true","is_false"]),v=["label","name","title","keyword","full_name","value","text"],be=e.ref(""),ke=e.ref([]),J=e.ref(null),Y=e.ref(!1),me=e.ref(null),F=e.ref(""),ue=e.ref(null),$e=e.ref(""),tt=e.ref("asc");let mt=1;function U(M){const x=M.find(A=>A&&typeof A=="object");if(!x)return null;for(const A of v)if(A in x&&typeof x[A]=="string")return A;return Object.keys(x).find(A=>typeof x[A]=="string")||null}function ze(M,x){const A=x.filter(ae=>ae!=null&&ae!=="NULL");if(A.length===0)return null;if(A.every(ae=>Array.isArray(ae))){const ae=A.flatMap(Fe=>Fe).filter(Fe=>Fe!=null);return ae.length===0?null:typeof ae.find(Fe=>Fe!=null)=="object"?"arraySelect":"arrayText"}return A.every(ae=>typeof ae=="boolean")?"boolean":A.every(ae=>typeof ae=="number")?new Set(A).size<=fe.value.maxUniqueForEnum?"select":"range":A.every(ae=>typeof ae=="string")?new Set(A).size<=fe.value.maxUniqueForSelect?"select":"text":A.some(ae=>typeof ae=="object"&&!Array.isArray(ae))?null:"text"}const qe=e.computed(()=>{if(!ce.data?.length)return[];const M=new Set;for(const oe of ce.data)if(oe&&typeof oe=="object")for(const Fe of Object.keys(oe))M.add(Fe);const x=new Set(ce.exclude),A=[];for(const oe of M){if(x.has(oe))continue;const Fe=ce.config[oe]||{},bt=ce.data.map(St=>St?.[oe]),ot=Fe.type||ze(oe,bt);if(!ot)continue;const Ie=Fe.filterMode||"contain",xt=Ie==="date"?"date":Ie==="string"?"text":ot,Mt={key:oe,label:Fe.label||et(oe),type:xt,filterMode:Ie};if(ot==="select"){const St=bt.filter(At=>At!=null&&At!=="NULL");Mt.uniqueValues=[...new Set(St)].sort((At,It)=>typeof At=="number"&&typeof It=="number"?At-It:String(At).localeCompare(String(It)))}else if(ot==="range"||ot==="int"){const St=bt.filter(At=>typeof At=="number");Mt.min=Math.min(...St),Mt.max=Math.max(...St)}else if(ot==="arraySelect"){const St=Fe.displayKey||U(bt.flatMap(At=>Array.isArray(At)?At:[]));if(Mt.displayKey=St,Array.isArray(Fe.uniqueValues)&&Fe.uniqueValues.length>0)Mt.uniqueValues=Fe.uniqueValues.map(At=>String(At));else{const At=bt.flatMap(It=>Array.isArray(It)?It:[]).filter(It=>It!=null).map(It=>St&&typeof It=="object"?It[St]:String(It)).filter(It=>It!=null&&It!=="");Mt.uniqueValues=[...new Set(At)].sort((It,Nt)=>String(It).localeCompare(String(Nt)))}}A.push(Mt)}const ae=ce.config._order;return ae&&A.sort((oe,Fe)=>{const bt=ae.indexOf(oe.key),ot=ae.indexOf(Fe.key);return bt===-1&&ot===-1?0:bt===-1?1:ot===-1?-1:bt-ot}),A}),Ve=e.computed(()=>{const M={};for(const x of qe.value)M[x.key]=x;return M}),Le=e.computed(()=>Array.isArray(ce.config.groups)&&ce.config.groups.length>0),je=e.computed(()=>{if(!Le.value)return[];const M=new Set(qe.value.map(x=>x.key));return ce.config.groups.map(x=>({...x,keys:x.keys.filter(A=>M.has(A))})).filter(x=>x.keys.length>0)}),re=e.computed(()=>{if(!Le.value)return[];const M=new Set(ce.config.groups.flatMap(x=>x.keys));return qe.value.filter(x=>!M.has(x.key))}),Qe=e.computed(()=>{if(!ue.value)return[];const M=new Set(ue.value.keys),x=qe.value.filter(ae=>M.has(ae.key));if(!F.value)return x;const A=F.value.toLowerCase();return x.filter(ae=>ae.label.toLowerCase().includes(A))}),Ce=e.computed(()=>{if(!F.value)return qe.value;const M=F.value.toLowerCase();return qe.value.filter(x=>x.label.toLowerCase().includes(M))}),Je=e.computed(()=>qe.value.filter(M=>!["arraySelect","arrayText"].includes(M.type))),ut=e.computed(()=>$e.value?tt.value==="asc"?"Ascending":"Descending":"No sort selected");function ht(M){J.value===M?dt():(J.value=M,F.value="",ue.value=null)}function dt(){J.value=null,F.value="",ue.value=null}function Wt(M){const x=M.target.closest(".dss-datepicker__overlay, .dss-datepicker__dropdown");J.value&&!x&&!M.target.closest(".dss-filter-popup")&&!M.target.closest(".dss-filter-trigger")&&!M.target.closest(".dss-filter-add-btn")&&dt(),Y.value&&me.value&&!me.value.contains(M.target)&&(x||(Y.value=!1))}e.onMounted(()=>document.addEventListener("click",Wt)),e.onBeforeUnmount(()=>document.removeEventListener("click",Wt));function qt(M){return Ve.value[M]?.label||et(M)}function Ct(M){return Ve.value[M.key]?.filterMode||"contain"}function wt(M){return V(`filter.operators.${M}`)}function Yt(M){const x=Ve.value[M.key];return(rt[x?.type]||rt.text).map(A=>({...A,label:V(`filter.operators.${A.value}`)}))}function it(M){return ee.has(M)}function Kt(M){const x=Ve.value[M.key];return x?x.type==="date"?"date":x.type==="boolean"?"boolean":x.type==="text"||x.type==="arrayText"?"text":x.type==="select"||x.type==="arraySelect"?"multiselect":x.type==="range"||x.type==="int"?M.operator==="between"?"between":"number":"text":"text"}function yt(M){return rt[M]?.[0]?.value||"contains"}function el(M,x){return ee.has(x)||M==="date"?null:M==="select"||M==="arraySelect"?[]:(M==="range"||M==="int")&&x==="between"?{min:null,max:null}:M==="range"||M==="int"?null:""}function X(M){return Ve.value[M.key]?.uniqueValues||[]}function ge(M){const x=X(M);if(!F.value)return x;const A=F.value.toLowerCase();return x.filter(ae=>String(ae).toLowerCase().includes(A))}function W(M){const x=M.value;return!x||x.length===0?V("filter.select"):x.length<=2?x.join(", "):V("filter.selectedCount",{count:x.length})}function G(M){const x=Ve.value[M],A=x?.filterMode||"contain",ae=x?.type||"text",oe=A==="string"?"contains":yt(ae);ke.value.push(e.reactive({id:mt++,key:M,operator:oe,value:el(ae,oe)})),dt()}function Ne(M){ke.value=ke.value.filter(x=>x.id!==M)}function Pe(M,x){const ae=Ve.value[x]?.type||"text";M.key=x,M.operator=yt(ae),M.value=el(ae,M.operator),dt()}function Xe(M,x){const A=Kt(M);M.operator=x;const ae=Kt(M);if(A!==ae||ee.has(x)){const oe=Ve.value[M.key];M.value=el(oe?.type||"text",x)}dt()}function Et(M,x){const A=x.target.value;M.value=A===""?null:Number(A)}function Ge(M,x,A){const ae=A.target.value,oe=ae===""?null:Number(ae);(!M.value||typeof M.value!="object")&&(M.value={min:null,max:null}),M.value={...M.value,[x]:isNaN(oe)?null:oe}}function Zt(M,x){const A=M.value||[],ae=A.indexOf(x);M.value=ae>=0?A.filter(oe=>oe!==x):[...A,x]}function Ue(){ke.value=[],be.value="",dt()}function We(M){be.value=M.target.value}function Dt(M){$e.value=M.target.value}function Lt(){tt.value=tt.value==="asc"?"desc":"asc"}const ne=e.computed(()=>{if(!ce.data)return[];let M=ce.data;if(be.value){const x=be.value.toLowerCase();M=M.filter(A=>{for(const ae of Object.keys(A)){const oe=A[ae];if(typeof oe=="string"&&oe.toLowerCase().includes(x)||typeof oe=="number"&&String(oe).includes(x)||Array.isArray(oe)&&oe.some(Fe=>Fe!=null&&(typeof Fe=="string"?Fe.toLowerCase().includes(x):typeof Fe=="object"?Object.values(Fe).some(bt=>typeof bt=="string"&&bt.toLowerCase().includes(x)):!1)))return!0}return!1})}for(const x of ke.value){if(!de(x))continue;const A=Ve.value[x.key];A&&(M=M.filter(ae=>xe(ae,x,A)))}if(ce.showSortBy&&$e.value){const x=$e.value,A=tt.value==="asc"?1:-1;M=[...M].sort((ae,oe)=>j(ae?.[x],oe?.[x])*A)}return M});function j(M,x){const A=K(M),ae=K(x);return A==null&&ae==null?0:A==null?1:ae==null?-1:typeof A=="number"&&typeof ae=="number"?A-ae:String(A).localeCompare(String(ae),void 0,{numeric:!0,sensitivity:"base"})}function K(M){return M==null||M==="NULL"?null:typeof M=="string"||typeof M=="number"||typeof M=="boolean"?M:M instanceof Date?M.getTime():null}function de(M){return ee.has(M.operator)?!0:M.value==null||typeof M.value=="string"&&M.value===""||Array.isArray(M.value)&&M.value.length===0?!1:M.value instanceof Date?!isNaN(M.value.getTime()):!(typeof M.value=="object"&&!Array.isArray(M.value)&&M.value.min==null&&M.value.max==null)}function xe(M,x,A){const ae=M?.[x.key],oe=x.value,Fe=x.operator;if(Fe==="is_empty")return jt(ae);if(Fe==="is_not_empty")return!jt(ae);const bt=A.type;if(bt==="text"||bt==="arrayText"){const ot=bt==="arrayText"&&Array.isArray(ae)?ae.filter(Mt=>Mt!=null).map(String).join(" "):ae!=null?String(ae):"",Ie=String(oe).toLowerCase(),xt=ot.toLowerCase();switch(Fe){case"contains":return xt.includes(Ie);case"not_contains":return!xt.includes(Ie);case"equals":return xt===Ie;case"not_equals":return xt!==Ie;case"starts_with":return xt.startsWith(Ie);case"ends_with":return xt.endsWith(Ie);default:return!0}}if(bt==="select")switch(Fe){case"is_any_of":return oe.includes(ae);case"is_none_of":return!oe.includes(ae);default:return!0}if(bt==="range"||bt==="int"){const ot=typeof ae=="number"?ae:Number(ae);if(typeof ot!="number"||isNaN(ot))return!1;if(Fe==="between"){const xt=oe?.min!=null?Number(oe.min):null,Mt=oe?.max!=null?Number(oe.max):null,St=xt!=null&&!isNaN(xt)?xt:null,At=Mt!=null&&!isNaN(Mt)?Mt:null;return(St==null||ot>=St)&&(At==null||ot<=At)}const Ie=typeof oe=="number"&&!isNaN(oe)?oe:Number(oe);if(Fe==="contains"||Fe==="not_contains"){const xt=String(ot),Mt=String(oe??"").toLowerCase(),St=xt.toLowerCase().includes(Mt);return Fe==="contains"?St:!St}if(typeof Ie!="number"||isNaN(Ie))return!1;switch(Fe){case"eq":return ot===Ie;case"neq":return ot!==Ie;case"gt":return ot>Ie;case"gte":return ot>=Ie;case"lt":return ot<Ie;case"lte":return ot<=Ie;default:return!0}}if(bt==="arraySelect"){if(!Array.isArray(ae))return!1;const ot=ae.filter(Ie=>Ie!=null).map(Ie=>A.displayKey&&typeof Ie=="object"?Ie[A.displayKey]:String(Ie));switch(Fe){case"contains_any":return ot.some(Ie=>oe.includes(Ie));case"contains_all":return oe.every(Ie=>ot.includes(Ie));case"not_contains_any":return!ot.some(Ie=>oe.includes(Ie));default:return!0}}if(bt==="date"){const ot=Ke(oe);if(!ot||isNaN(ot.getTime()))return!1;const Ie=Ke(ae);if(!Ie||isNaN(Ie.getTime()))return!1;const xt=Ht(Ie),Mt=Ht(ot);switch(Fe){case"eq":return xt===Mt;case"before":return xt<Mt;case"after":return xt>Mt;default:return!0}}if(bt==="boolean"){const ot=ae===!0||ae==="true"||ae===1,Ie=ae===!1||ae==="false"||ae===0;switch(Fe){case"is_true":return ot;case"is_false":return Ie;default:return!0}}return!0}function Ke(M){if(M==null)return null;if(M instanceof Date)return isNaN(M.getTime())?null:M;if(typeof M=="number")return new Date(M>1e10?M:M*1e3);if(typeof M=="string"){const x=new Date(M);return isNaN(x.getTime())?null:x}return null}function Ht(M){const x=M.getFullYear(),A=String(M.getMonth()+1).padStart(2,"0"),ae=String(M.getDate()).padStart(2,"0");return`${x}-${A}-${ae}`}function jt(M){return!!(M==null||M===""||M==="NULL"||Array.isArray(M)&&M.length===0||Array.isArray(M)&&M.every(x=>x==null))}e.watch(ne,M=>O("update:modelValue",M),{immediate:!0}),e.watch(()=>ce.data,()=>{ke.value=[],be.value="",Y.value=!1,$e.value="",tt.value="asc",dt()});function et(M){return M.replace(/_/g," ").replace(/([a-z])([A-Z])/g,"$1 $2").replace(/\b\w/g,x=>x.toUpperCase())}function vl(){const M=x=>{if(x==null)return x;if(x instanceof Date)return{_type:"Date",value:x.toISOString(),local:x.toLocaleDateString()};if(Array.isArray(x))return x.map(M);if(typeof x=="object"&&!Array.isArray(x)){const A={};for(const ae of Object.keys(x))A[ae]=M(x[ae]);return A}return x};return{globalSearch:be.value,rows:ke.value.map(x=>({key:x.key,operator:x.operator,value:M(x.value),defType:Ve.value[x.key]?.type,defFilterMode:Ve.value[x.key]?.filterMode})),filteredCount:ne.value?.length??0}}return te({getDebugState:vl}),(M,x)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-filter",{"dss-filter--unstyled":fe.value.unstyled}])},[e.createElementVNode("div",{class:"dss-filter-global",ref_key:"globalRef",ref:me},[e.createElementVNode("div",f0,[x[20]||(x[20]=e.createElementVNode("svg",{class:"dss-filter-global-icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("circle",{cx:"11",cy:"11",r:"8"}),e.createElementVNode("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})],-1)),e.createElementVNode("input",{type:"text",class:"dss-filter-global-input",placeholder:e.unref(V)("filter.searchAcrossFields"),value:be.value,onInput:We},null,40,v0),be.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-filter-global-clear",onClick:x[0]||(x[0]=A=>be.value="")},"×")):e.createCommentVNode("",!0),e.createElementVNode("button",{class:e.normalizeClass(["dss-filter-funnel-btn",{active:Y.value||ke.value.length>0,"dss-filter-funnel-btn--with-sort":ce.showSortBy}]),onClick:x[1]||(x[1]=A=>Y.value=!Y.value),type:"button",title:Y.value?e.unref(V)("filter.closeAdvancedFilter"):e.unref(V)("filter.openAdvancedFilter")},[x[14]||(x[14]=e.createElementVNode("svg",{class:"dss-filter-funnel-icon",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M11.7583 2.00407L11.7537 2.00926L7.84558 6.18223V9.38409C7.84581 9.53637 7.80836 9.68634 7.73658 9.82064C7.6648 9.95494 7.56091 10.0694 7.43417 10.1538L5.58772 11.3852C5.44858 11.4779 5.28688 11.531 5.11988 11.539C4.95288 11.5469 4.78685 11.5094 4.63952 11.4304C4.49219 11.3514 4.36908 11.2338 4.28334 11.0903C4.1976 10.9467 4.15244 10.7826 4.15269 10.6154V6.18223L0.244567 2.00926L0.239951 2.00407C0.119785 1.87182 0.0405781 1.70755 0.0119374 1.53118C-0.0167033 1.35481 0.00645342 1.17391 0.0785984 1.01044C0.150743 0.846967 0.268776 0.707944 0.418378 0.610235C0.56798 0.512525 0.742722 0.460328 0.921405 0.459976H11.0769C11.2557 0.459994 11.4307 0.511948 11.5805 0.609528C11.7304 0.707107 11.8487 0.846111 11.9211 1.00965C11.9934 1.17319 12.0167 1.35422 11.9881 1.53075C11.9596 1.70728 11.8803 1.87172 11.7601 2.00407H11.7583Z",fill:"currentColor"})],-1)),ke.value.length>0?(e.openBlock(),e.createElementBlock("span",g0,e.toDisplayString(ke.value.length),1)):e.createCommentVNode("",!0)],10,h0),ce.showSortBy?(e.openBlock(),e.createElementBlock("div",y0,[x[19]||(x[19]=e.createElementVNode("label",{class:"dss-filter-sortby-label",for:"dss-filter-sort-select"},"Sort by",-1)),e.createElementVNode("select",{id:"dss-filter-sort-select",class:"dss-filter-sortby-select",value:$e.value,onChange:Dt},[x[15]||(x[15]=e.createElementVNode("option",{value:""},"None",-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Je.value,A=>(e.openBlock(),e.createElementBlock("option",{key:A.key,value:A.key},e.toDisplayString(A.label),9,C0))),128))],40,k0),e.createElementVNode("button",{class:"dss-filter-sortby-order",type:"button",onClick:Lt,disabled:!$e.value,title:ut.value},[$e.value?tt.value==="asc"?(e.openBlock(),e.createElementBlock("svg",w0,[...x[17]||(x[17]=[e.createElementVNode("path",{d:"M6 12C6.36819 12 6.66667 11.7015 6.66667 11.3333L6.66667 2.55333L8.58967 4.47098C8.84953 4.73012 9.27017 4.72983 9.52967 4.47033C9.78943 4.21057 9.78943 3.78943 9.52967 3.52967L6.70711 0.707106C6.31658 0.316582 5.68342 0.316582 5.29289 0.707107L2.47033 3.52967C2.21057 3.78943 2.21057 4.21057 2.47033 4.47033C2.72983 4.72983 3.15047 4.73012 3.41033 4.47098L5.33333 2.55333L5.33333 11.3333C5.33333 11.7015 5.63181 12 6 12Z",fill:"currentColor"},null,-1)])])):(e.openBlock(),e.createElementBlock("svg",E0,[...x[18]||(x[18]=[e.createElementVNode("path",{d:"M6 -1.74846e-07C5.63181 -1.58751e-07 5.33333 0.298476 5.33333 0.666666L5.33333 9.44667L3.41033 7.52902C3.15047 7.26988 2.72983 7.27017 2.47033 7.52967C2.21057 7.78943 2.21057 8.21057 2.47033 8.47033L5.29289 11.2929C5.68342 11.6834 6.31658 11.6834 6.70711 11.2929L9.52967 8.47033C9.78943 8.21057 9.78943 7.78943 9.52967 7.52967C9.27017 7.27017 8.84953 7.26988 8.58967 7.52902L6.66667 9.44667L6.66667 0.666667C6.66667 0.298477 6.36819 -1.9094e-07 6 -1.74846e-07Z",fill:"currentColor"},null,-1)])])):(e.openBlock(),e.createElementBlock("svg",x0,[...x[16]||(x[16]=[e.createElementVNode("path",{d:"M5.413 9.06387C5.45434 9.16352 5.4652 9.27319 5.4442 9.37901C5.42321 9.48484 5.3713 9.58206 5.29505 9.65837L3.11339 11.84C3.06273 11.8907 3.00258 11.931 2.93637 11.9584C2.87016 11.9859 2.79918 12 2.72751 12C2.65583 12 2.58486 11.9859 2.51865 11.9584C2.45243 11.931 2.39228 11.8907 2.34163 11.84L0.159964 9.65837C0.0835992 9.58209 0.0315843 9.48487 0.0105038 9.37902C-0.0105768 9.27316 0.000224981 9.16343 0.0415416 9.06371C0.0828581 8.964 0.152832 8.87879 0.242604 8.81886C0.332376 8.75894 0.43791 8.72699 0.545845 8.72708H2.18209V0.545845C2.18209 0.401191 2.23955 0.262463 2.34184 0.160178C2.44413 0.0578925 2.58285 0.000429123 2.72751 0.000429123C2.87216 0.000429123 3.01089 0.0578925 3.11317 0.160178C3.21546 0.262463 3.27292 0.401191 3.27292 0.545845V8.72708H4.90917C5.01704 8.7271 5.12248 8.75911 5.21216 8.81906C5.30185 8.87901 5.37174 8.9642 5.413 9.06387ZM11.84 2.34162L9.65837 0.159963C9.60772 0.109252 9.54757 0.0690231 9.48135 0.0415755C9.41514 0.0141278 9.34417 0 9.27249 0C9.20082 0 9.12984 0.0141278 9.06363 0.0415755C8.99742 0.0690231 8.93727 0.109252 8.88661 0.159963L6.70495 2.34162C6.62858 2.4179 6.57657 2.51513 6.55549 2.62098C6.53441 2.72684 6.54521 2.83657 6.58653 2.93629C6.62784 3.036 6.69782 3.12121 6.78759 3.18114C6.87736 3.24107 6.9829 3.27301 7.09083 3.27292H8.72708V11.4542C8.72708 11.5988 8.78454 11.7375 8.88683 11.8398C8.98911 11.9421 9.12784 11.9996 9.27249 11.9996C9.41715 11.9996 9.55587 11.9421 9.65816 11.8398C9.76045 11.7375 9.81791 11.5988 9.81791 11.4542V3.27292H11.4542C11.5621 3.27301 11.6676 3.24107 11.7574 3.18114C11.8472 3.12121 11.9171 3.036 11.9585 2.93629C11.9998 2.83657 12.0106 2.72684 11.9895 2.62098C11.9684 2.51513 11.9164 2.4179 11.84 2.34162Z",fill:"currentColor"},null,-1)])]))],8,b0)])):e.createCommentVNode("",!0)]),Y.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-advanced-popup",onClick:x[13]||(x[13]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",S0,[ke.value.length===0?(e.openBlock(),e.createElementBlock("div",V0,e.toDisplayString(e.unref(V)("filter.noConditionsApplied")),1)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ke.value,(A,ae)=>(e.openBlock(),e.createElementBlock("div",{key:A.id,class:"dss-filter-row"},[e.createElementVNode("span",N0,e.toDisplayString(ae===0?e.unref(V)("filter.where"):e.unref(V)("filter.and")),1),e.createElementVNode("div",B0,[e.createElementVNode("button",{class:"dss-filter-trigger",onClick:e.withModifiers(oe=>ht(`${A.id}:field`),["stop"])},[e.createElementVNode("span",_0,e.toDisplayString(qt(A.key)),1),x[21]||(x[21]=e.createElementVNode("svg",{class:"dss-filter-chevron",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("polyline",{points:"6 9 12 15 18 9"})],-1))],8,M0),J.value===`${A.id}:field`?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-popup",onClick:x[3]||(x[3]=e.withModifiers(()=>{},["stop"]))},[e.withDirectives(e.createElementVNode("input",{type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":x[2]||(x[2]=oe=>F.value=oe),placeholder:e.unref(V)("filter.searchAttributes")},null,8,$0),[[e.vModelText,F.value]]),e.createElementVNode("ul",L0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ce.value,oe=>(e.openBlock(),e.createElementBlock("li",{key:oe.key,class:"dss-filter-popup-item",onClick:Fe=>Pe(A,oe.key)},e.toDisplayString(oe.label),9,A0))),128)),Ce.value.length===0?(e.openBlock(),e.createElementBlock("li",T0,e.toDisplayString(e.unref(V)("filter.noMatch")),1)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)]),Ct(A)==="contain"||Ct(A)==="date"?(e.openBlock(),e.createElementBlock("div",D0,[e.createElementVNode("button",{class:"dss-filter-trigger",onClick:e.withModifiers(oe=>ht(`${A.id}:op`),["stop"])},[e.createElementVNode("span",R0,e.toDisplayString(wt(A.operator)),1),x[22]||(x[22]=e.createElementVNode("svg",{class:"dss-filter-chevron",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("polyline",{points:"6 9 12 15 18 9"})],-1))],8,H0),J.value===`${A.id}:op`?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-popup",onClick:x[4]||(x[4]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("ul",F0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Yt(A),oe=>(e.openBlock(),e.createElementBlock("li",{key:oe.value,class:e.normalizeClass(["dss-filter-popup-item",{selected:A.operator===oe.value}]),onClick:Fe=>Xe(A,oe.value)},e.toDisplayString(oe.label),11,I0))),128))])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),it(A.operator)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",z0,[Ct(A)==="string"?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,type:"text",class:"dss-filter-value-input",placeholder:e.unref(V)("filter.enterValue"),"onUpdate:modelValue":oe=>A.value=oe},null,8,P0)),[[e.vModelText,A.value]]):Ct(A)==="date"?(e.openBlock(),e.createElementBlock("div",O0,[e.createVNode(pa,{mode:"single",modelValue:A.value,"onUpdate:modelValue":oe=>A.value=oe},null,8,["modelValue","onUpdate:modelValue"])])):Kt(A)==="text"?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:2,type:"text",class:"dss-filter-value-input",placeholder:e.unref(V)("filter.enterValue"),"onUpdate:modelValue":oe=>A.value=oe},null,8,W0)),[[e.vModelText,A.value]]):Kt(A)==="number"?(e.openBlock(),e.createElementBlock("input",{key:3,type:"number",class:"dss-filter-value-input",placeholder:e.unref(V)("filter.enterValue"),value:A.value,onInput:oe=>Et(A,oe),step:Ve.value[A.key]?.type==="int"?1:void 0},null,40,q0)):Kt(A)==="between"?(e.openBlock(),e.createElementBlock("div",Z0,[e.createElementVNode("input",{type:"number",class:"dss-filter-value-input",placeholder:e.unref(V)("filter.min"),value:A.value?.min,onInput:oe=>Ge(A,"min",oe),step:Ve.value[A.key]?.type==="int"?1:void 0},null,40,U0),e.createElementVNode("span",X0,e.toDisplayString(e.unref(V)("filter.and")),1),e.createElementVNode("input",{type:"number",class:"dss-filter-value-input",placeholder:e.unref(V)("filter.max"),value:A.value?.max,onInput:oe=>Ge(A,"max",oe),step:Ve.value[A.key]?.type==="int"?1:void 0},null,40,Y0)])):Kt(A)==="multiselect"?(e.openBlock(),e.createElementBlock("div",j0,[e.createElementVNode("button",{class:"dss-filter-trigger",onClick:e.withModifiers(oe=>ht(`${A.id}:val`),["stop"])},[e.createElementVNode("span",G0,e.toDisplayString(W(A)),1),x[23]||(x[23]=e.createElementVNode("svg",{class:"dss-filter-chevron",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("polyline",{points:"6 9 12 15 18 9"})],-1))],8,K0),J.value===`${A.id}:val`?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-popup",onClick:x[6]||(x[6]=e.withModifiers(()=>{},["stop"]))},[X(A).length>6?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":x[5]||(x[5]=oe=>F.value=oe),placeholder:e.unref(V)("filter.search")},null,8,Q0)),[[e.vModelText,F.value]]):e.createCommentVNode("",!0),e.createElementVNode("ul",J0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ge(A),oe=>(e.openBlock(),e.createElementBlock("li",{key:oe,class:"dss-filter-popup-item",onClick:Fe=>Zt(A,oe)},[e.createElementVNode("input",{type:"checkbox",checked:(A.value||[]).includes(oe),tabindex:"-1"},null,8,tp),e.createElementVNode("span",null,e.toDisplayString(oe),1)],8,ep))),128)),ge(A).length===0?(e.openBlock(),e.createElementBlock("li",lp,e.toDisplayString(e.unref(V)("filter.noMatch")),1)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)])),e.createElementVNode("button",{class:"dss-filter-row-remove",onClick:oe=>Ne(A.id)},[...x[24]||(x[24]=[e.createElementVNode("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.createElementVNode("line",{x1:"6",y1:"6",x2:"18",y2:"18"})],-1)])],8,np)]))),128)),e.createElementVNode("div",op,[e.createElementVNode("div",ap,[e.createElementVNode("button",{class:"dss-filter-add-btn",onClick:x[7]||(x[7]=e.withModifiers(A=>ht("add"),["stop"]))},e.toDisplayString(e.unref(V)("filter.addFilter")),1),J.value==="add"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-popup dss-filter-add-popup",onClick:x[12]||(x[12]=e.withModifiers(()=>{},["stop"]))},[Le.value&&!ue.value&&!F.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.withDirectives(e.createElementVNode("input",{type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":x[8]||(x[8]=A=>F.value=A),placeholder:e.unref(V)("filter.searchAttributes")},null,8,sp),[[e.vModelText,F.value]]),e.createElementVNode("ul",rp,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(je.value,A=>(e.openBlock(),e.createElementBlock("li",{key:A.label,class:"dss-filter-popup-item dss-filter-popup-group",onClick:ae=>ue.value=A},[e.createElementVNode("span",null,e.toDisplayString(A.label),1),x[25]||(x[25]=e.createElementVNode("svg",{class:"dss-filter-chevron-right",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("polyline",{points:"9 18 15 12 9 6"})],-1))],8,ip))),128)),re.value.length>0?(e.openBlock(),e.createElementBlock("li",cp)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(re.value,A=>(e.openBlock(),e.createElementBlock("li",{key:A.key,class:"dss-filter-popup-item",onClick:ae=>G(A.key)},e.toDisplayString(A.label),9,up))),128))])],64)):ue.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",{class:"dss-filter-popup-back",onClick:x[9]||(x[9]=A=>ue.value=null)},[x[26]||(x[26]=e.createElementVNode("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("polyline",{points:"15 18 9 12 15 6"})],-1)),e.createElementVNode("span",null,e.toDisplayString(ue.value.label),1)]),e.withDirectives(e.createElementVNode("input",{type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":x[10]||(x[10]=A=>F.value=A),placeholder:e.unref(V)("filter.searchAttributes")},null,8,dp),[[e.vModelText,F.value]]),e.createElementVNode("ul",mp,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Qe.value,A=>(e.openBlock(),e.createElementBlock("li",{key:A.key,class:"dss-filter-popup-item",onClick:ae=>G(A.key)},e.toDisplayString(A.label),9,pp))),128)),Qe.value.length===0?(e.openBlock(),e.createElementBlock("li",fp,e.toDisplayString(e.unref(V)("filter.noMatch")),1)):e.createCommentVNode("",!0)])],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.withDirectives(e.createElementVNode("input",{type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":x[11]||(x[11]=A=>F.value=A),placeholder:e.unref(V)("filter.searchAttributes")},null,8,vp),[[e.vModelText,F.value]]),e.createElementVNode("ul",hp,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ce.value,A=>(e.openBlock(),e.createElementBlock("li",{key:A.key,class:"dss-filter-popup-item",onClick:ae=>G(A.key)},e.toDisplayString(A.label),9,gp))),128)),Ce.value.length===0?(e.openBlock(),e.createElementBlock("li",yp,e.toDisplayString(e.unref(V)("filter.noMatch")),1)):e.createCommentVNode("",!0)])],64))])):e.createCommentVNode("",!0)]),ke.value.length>0?(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-filter-clear-all",onClick:Ue},e.toDisplayString(e.unref(V)("filter.clearAllFilters")),1)):e.createCommentVNode("",!0)])])])):e.createCommentVNode("",!0)],512)],2))}}),bp={class:"dss-pill-field__pills"},xp=["data-value"],wp=["disabled"],Ep={class:"dss-pill-field__pill-text"},Sp={key:0,class:"dss-pill-field__pill-actions"},Vp=["onClick"],Np=["onClick"],Bp=["placeholder","disabled"],Mp=e.defineComponent({__name:"DSSPillField",props:{modelValue:{default:()=>[]},placeholder:{default:""},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(E,{emit:te}){const $=E,V=te,ce=e.ref(""),O=e.ref([...$.modelValue]),L=e.ref(null);let fe=null;const rt=e.ref(null),ee=e.ref(""),v=e.ref(null),be=e.ref(null),ke=e.computed(()=>{if(!be.value)return;const{width:Le,height:je}=be.value;return{minWidth:`${Le}px`,height:`${je}px`}});function J(Le,je){rt.value===je&&(v.value=Le)}function Y(){rt.value=null,ee.value="",be.value=null,v.value=null}const me=e.computed(()=>new Set(O.value.map(Le=>Le.trim()).filter(Boolean)));function F(Le){L.value=Le,fe&&clearTimeout(fe),fe=setTimeout(()=>{L.value=null,fe=null},900)}function ue(Le){const je=Le.trim();return je?me.value.has(je)?(F(je),!1):(O.value=[...O.value,je],V("update:modelValue",[...O.value]),!0):!1}function $e(Le){const je=Le.split(/\r?\n/g).map(Je=>Je.trim()).filter(Boolean);if(!je.length)return;const re=new Set(O.value.map(Je=>Je.trim()).filter(Boolean)),Qe=[...O.value];let Ce=null;for(const Je of je){if(re.has(Je)){Ce??=Je;continue}re.add(Je),Qe.push(Je)}Qe.length!==O.value.length&&(O.value=Qe,V("update:modelValue",[...O.value])),Ce&&F(Ce)}function tt(Le){$.disabled||(rt.value===Le&&Y(),O.value=O.value.filter((je,re)=>re!==Le),V("update:modelValue",[...O.value]))}async function mt(Le,je){if($.disabled)return;const re=je.currentTarget.closest(".dss-pill-field__pill");re&&(be.value={width:re.offsetWidth,height:re.offsetHeight}),rt.value=Le,ee.value=O.value[Le]??"",await e.nextTick();const Qe=v.value;if(!Qe)return;Qe.focus();const Ce=Qe.value.length;Qe.setSelectionRange(Ce,Ce)}function U(){Y()}function ze(){if($.disabled||rt.value===null)return;const Le=rt.value,je=O.value[Le]??"",re=ee.value.trim();if(Y(),re!==je&&me.value.has(re)){F(re);return}if(!re){O.value=O.value.filter((Ce,Je)=>Je!==Le),V("update:modelValue",[...O.value]);return}const Qe=O.value.map((Ce,Je)=>Je===Le?re:Ce);O.value=Qe,V("update:modelValue",[...O.value])}function qe(Le){Le.preventDefault(),!$.disabled&&(ue(ce.value),ce.value="")}function Ve(Le){if($.disabled)return;const je=Le.clipboardData?.getData("text")??"";!je.includes(`
|
|
120
|
+
`)&&!je.includes("\r")||(Le.preventDefault(),$e(je),ce.value="")}return e.watch(()=>$.modelValue,Le=>{O.value=Array.isArray(Le)?[...Le]:[]},{deep:!0}),e.onBeforeUnmount(()=>{fe&&clearTimeout(fe)}),(Le,je)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-pill-field",{"dss-pill-field--disabled":Le.disabled}])},[e.createElementVNode("div",bp,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(O.value,(re,Qe)=>(e.openBlock(),e.createElementBlock("span",{key:re,class:e.normalizeClass(["dss-pill-field__pill",{"dss-pill-field__pill--highlight":L.value===re,"dss-pill-field__pill--editing":rt.value===Qe}]),style:e.normalizeStyle(rt.value===Qe&&be.value?ke.value:void 0)},[rt.value===Qe?(e.openBlock(),e.createElementBlock("span",{key:0,class:"dss-pill-field__pill-edit-wrap","data-value":ee.value||" "},[e.withDirectives(e.createElementVNode("input",{ref_for:!0,ref:Ce=>J(Ce,Qe),"onUpdate:modelValue":je[0]||(je[0]=Ce=>ee.value=Ce),class:"dss-pill-field__pill-edit",type:"text",disabled:Le.disabled,onKeydown:[e.withKeys(ze,["enter"]),e.withKeys(U,["esc"])],onBlur:ze},null,40,wp),[[e.vModelText,ee.value]])],8,xp)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("span",Ep,e.toDisplayString(re),1),Le.disabled?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",Sp,[e.createElementVNode("button",{type:"button",class:"dss-pill-field__pill-action",onClick:Ce=>mt(Qe,Ce)},[...je[2]||(je[2]=[e.createElementVNode("svg",{class:"dss-pill-field__pill-action-icon",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M0 9.64033V11.6667C0 11.8534 0.146646 12 0.333287 12H2.35967C2.44633 12 2.53298 11.9667 2.59297 11.9L9.87196 4.62769L7.37231 2.12804L0.0999862 9.40036C0.0333288 9.46702 0 9.54701 0 9.64033ZM11.805 2.69463C12.065 2.43466 12.065 2.01472 11.805 1.75476L10.2452 0.194973C9.98528 -0.064991 9.56534 -0.064991 9.30537 0.194973L8.08554 1.4148L10.5852 3.91446L11.805 2.69463Z",fill:"currentColor"})],-1)])],8,Vp),e.createElementVNode("button",{type:"button",class:"dss-pill-field__pill-action dss-pill-field__pill-action--remove",onClick:Ce=>tt(Qe)}," × ",8,Np)]))],64))],6))),128)),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":je[1]||(je[1]=re=>ce.value=re),class:"dss-pill-field__input",type:"text",placeholder:O.value.length?"":Le.placeholder,disabled:Le.disabled,onPaste:Ve,onKeydown:e.withKeys(qe,["enter"])},null,40,Bp),[[e.vModelText,ce.value]])])],2))}}),_p={class:"dss-step-bar__layout"},$p={class:"dss-step-bar__header"},Lp={class:"dss-step-bar__label"},Ap={key:0,class:"dss-step-bar__counter"},Tp={class:"dss-step-bar__track-wrapper"},Dp=["aria-valuemax","aria-valuenow","aria-label"],Hp=["onMouseenter"],Rp={__name:"DSSStepBar",props:{label:{type:String,default:"Progress"},steps:{type:Number,default:5},currentStep:{type:Number,default:0},segments:{type:Array,default:()=>[]},segmentOrder:{type:String,default:"input",validator:E=>["input","desc","asc"].includes(E)},orientation:{type:String,default:"horizontal",validator:E=>["horizontal","vertical"].includes(E)},barHeight:{type:[Number,String],default:200},labelPosition:{type:String,default:"up",validator:E=>["up","down","left","right"].includes(E)},sideLabelMaxWidth:{type:[Number,String],default:null},sideLabelWrapWidth:{type:[Number,String],default:"18ch"},totalValue:{type:Number,default:null},activeColor:{type:String,default:"#34c759"},labelColor:{type:String,default:null},counterColor:{type:String,default:null},valueLabel:{type:String,default:""},counterAsPercentage:{type:Boolean,default:!1},showCounter:{type:Boolean,default:!0},inactiveColor:{type:String,default:"#e5e7eb"},remainderLabel:{type:String,default:"Unused"},remainderTooltipSummary:{type:Boolean,default:!1},options:{type:Object,default:()=>({})}},setup(E){const te=E,$={segmentMarker:{color:null,width:null,height:null,backgroundColor:"transparent",borderColor:"transparent"},maxSegment:{marker:{enabled:!1,color:null,width:null,height:null,backgroundColor:"transparent",borderColor:"transparent"}}},V=X=>X&&typeof X=="object"&&!Array.isArray(X),ce=(X,ge)=>{const W=Object.assign({},X);return!V(X)||!V(ge)||Object.keys(ge).forEach(G=>{if(V(ge[G])){G in X?W[G]=ce(X[G],ge[G]):Object.assign(W,{[G]:ge[G]});return}Object.assign(W,{[G]:ge[G]})}),W},O=e.computed(()=>ce($,te.options)),L=e.computed(()=>Math.max(1,Number(te.steps)||1)),fe=e.computed(()=>Math.min(L.value,Math.max(0,Number(te.currentStep)||0))),rt=e.computed(()=>Array.isArray(te.segments)&&te.segments.length>0),ee=e.computed(()=>{if(!rt.value)return[];const X=te.segments.map((ge,W)=>{const G=Number(ge?.value);return{label:ge?.label||`Step ${W+1}`,value:Number.isFinite(G)&&G>0?G:0,color:ge?.color||te.activeColor,marker:ge?.marker}});return te.segmentOrder==="desc"?[...X].sort((ge,W)=>W.value-ge.value):te.segmentOrder==="asc"?[...X].sort((ge,W)=>ge.value-W.value):X}),v=e.computed(()=>rt.value?ee.value.reduce((X,ge)=>X+ge.value,0):fe.value),be=e.computed(()=>rt.value?Number.isFinite(Number(te.totalValue))&&Number(te.totalValue)>0?Number(te.totalValue):Math.max(1,v.value):L.value),ke=e.computed(()=>rt.value&&Number.isFinite(Number(te.totalValue))&&Number(te.totalValue)>0),J=e.computed(()=>ke.value?Math.max(0,Number(te.totalValue)-v.value):0),Y=e.computed(()=>typeof te.remainderLabel=="string"&&te.remainderLabel.trim().length>0),me=e.computed(()=>J.value>0),F=e.computed(()=>ee.value.reduce((X,ge)=>Math.max(X,Number(ge.value)||0),0)),ue=e.computed(()=>ee.value.filter(X=>X.value>0).map(X=>`${X.label}: ${Ct(X.value)}`).join(" | ")),$e=e.computed(()=>rt.value?ke.value?ee.value.filter(X=>X.value>0):ee.value:[]),tt=e.computed(()=>{if(!te.counterAsPercentage)return`${v.value} / ${be.value}`;const X=Number(be.value);if(!Number.isFinite(X)||X<=0)return"0%";const ge=Math.round(Number(v.value)/X*100);return`${Math.min(Math.max(ge,0),100)}%`}),mt=e.computed(()=>v.value),U=e.computed(()=>be.value),ze=e.reactive({visible:!1,x:0,y:0,content:""}),qe=e.computed(()=>te.orientation==="vertical"),Ve=e.computed(()=>{const X=te.barHeight;return X==null||X===""?"200px":typeof X=="number"?`${X}px`:String(X)}),Le=e.computed(()=>{const X=te.sideLabelMaxWidth;if(!(X==null||X===""))return typeof X=="number"?`${X}px`:String(X)}),je=e.computed(()=>{const X=te.sideLabelWrapWidth;return X==null||X===""?"18ch":typeof X=="number"?`${X}ch`:String(X)}),re=e.computed(()=>({left:`${ze.x}px`,top:`${ze.y}px`,transform:"translate(-50%, calc(-100% - 8px))"})),Qe=X=>qe.value?{flex:`${X} 0 0`,minHeight:X>0?"6px":"0",minWidth:"0"}:{flex:`${X} 0 0`,minWidth:X>0?"6px":"0"},Ce=X=>{const ge=X?.parentElement;if(!ge)return{x:0,y:0};const W=ge.getBoundingClientRect();return{x:W.left+W.width/2,y:W.top}},Je=X=>{const ge=X.getBoundingClientRect();return{x:ge.left+ge.width/2,y:ge.top}},ut=X=>{if(ke.value){const G=Math.max(0,Number(X.value)||0);return{...Qe(G),backgroundColor:X.color}}const ge=v.value,W=X.value>0?X.value:ge>0?1e-4:1;return{...Qe(W),backgroundColor:X.color}},ht=X=>Number(X?.value||0)>0&&Number(X?.value||0)===F.value,dt=X=>{const ge=V(X?.marker)?X.marker:{},W=X?.marker===!0||ge.enabled===!0,G=ht(X)&&O.value.maxSegment?.marker?.enabled===!0;if(!(W||G))return{enabled:!1};const Pe=ge.backgroundColor??(G?O.value.maxSegment?.marker?.backgroundColor:O.value.segmentMarker?.backgroundColor),Xe=ge.borderColor??(G?O.value.maxSegment?.marker?.borderColor:O.value.segmentMarker?.borderColor),Et=ge.color??(G?O.value.maxSegment?.marker?.color:O.value.segmentMarker?.color),Ge=ge.width??(G?O.value.maxSegment?.marker?.width:O.value.segmentMarker?.width),Zt=ge.height??(G?O.value.maxSegment?.marker?.height:O.value.segmentMarker?.height);return{enabled:!0,backgroundColor:Pe,borderColor:Xe,color:Et,width:Ge,height:Zt,icon:ge.icon??null,...ge}},Wt=X=>{const ge=dt(X);return{backgroundColor:ge.backgroundColor??void 0,borderColor:ge.borderColor??void 0,color:ge.color??void 0}},qt=X=>{const ge=dt(X);return{width:ge.width??void 0,height:ge.height??void 0}},Ct=X=>`${X}${te.valueLabel}`,wt=e.computed(()=>({...Qe(J.value),backgroundColor:te.inactiveColor})),Yt=(X,ge)=>{if(!X||!ge?.currentTarget)return;const W=ge.currentTarget;if(te.remainderTooltipSummary){const Ne=Ce(W);ze.x=Ne.x,ze.y=Ne.y,ze.content=ue.value,ze.visible=!!ze.content;return}const G=Je(W);ze.x=G.x,ze.y=G.y,ze.content=`${X.label}: ${Ct(X.value)}`,ze.visible=!0},it=X=>{if(!J.value||!X?.currentTarget)return;const ge=X.currentTarget;if(te.remainderTooltipSummary){const G=Ce(ge);ze.x=G.x,ze.y=G.y,ze.content=ue.value,ze.visible=!!ze.content;return}const W=Je(ge);ze.x=W.x,ze.y=W.y,Y.value&&(ze.content=`${te.remainderLabel}: ${Ct(J.value)}`,ze.visible=!0)},Kt=()=>{ze.visible=!1},yt=()=>{ze.visible&&Kt()};e.onMounted(()=>{window.addEventListener("scroll",yt,!0)}),e.onBeforeUnmount(()=>{window.removeEventListener("scroll",yt,!0)});const el=e.computed(()=>({"--dss-step-bar-label-color":te.labelColor??void 0,"--dss-step-bar-counter-color":te.counterColor??void 0,"--dss-step-bar-active-color":te.activeColor,"--dss-step-bar-inactive-color":te.inactiveColor,"--dss-step-bar-bar-height":qe.value?Ve.value:void 0,"--dss-step-bar-side-label-max-width":Le.value,"--dss-step-bar-side-label-wrap-width":je.value}));return(X,ge)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-step-bar",[`dss-step-bar--${E.orientation}`,`dss-step-bar--label-${E.labelPosition}`]]),style:e.normalizeStyle(el.value)},[e.createElementVNode("div",_p,[e.createElementVNode("div",$p,[e.createElementVNode("span",Lp,[e.renderSlot(X.$slots,"label",{label:E.label},()=>[e.createTextVNode(e.toDisplayString(E.label),1)])]),E.showCounter?(e.openBlock(),e.createElementBlock("span",Ap,[e.renderSlot(X.$slots,"counter",{counterDisplay:tt.value},()=>[e.createTextVNode(e.toDisplayString(tt.value),1)])])):e.createCommentVNode("",!0)]),e.createElementVNode("div",Tp,[e.createElementVNode("div",{class:"dss-step-bar__track",role:"progressbar","aria-valuemin":0,"aria-valuemax":U.value,"aria-valuenow":mt.value,"aria-label":E.label},[rt.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList($e.value,(W,G)=>(e.openBlock(),e.createElementBlock("div",{key:`segment-${G}-${W.label}`,class:e.normalizeClass(["dss-step-bar__segment dss-step-bar__segment--interactive",{"dss-step-bar__segment--max":ht(W),"dss-step-bar__segment--marker-enabled":dt(W).enabled}]),style:e.normalizeStyle(ut(W)),onMouseenter:Ne=>Yt(W,Ne),onMouseleave:Kt},[dt(W).enabled?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-step-bar__segment-marker",style:e.normalizeStyle(Wt(W)),"aria-hidden":"true"},[e.createElementVNode("span",{class:"dss-step-bar__segment-marker-icon",style:e.normalizeStyle(qt(W))},[e.renderSlot(X.$slots,"segment-marker-icon",{segment:W,index:G,marker:dt(W)},()=>[e.renderSlot(X.$slots,"max-segment-icon",{segment:W,index:G,marker:dt(W)},()=>[e.createTextVNode(e.toDisplayString(dt(W).icon||""),1)])])],4)],4)):e.createCommentVNode("",!0)],46,Hp))),128)),me.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-step-bar__segment dss-step-bar__segment--remainder",style:e.normalizeStyle(wt.value),onMouseenter:ge[0]||(ge[0]=W=>it(W)),onMouseleave:Kt},null,36)):e.createCommentVNode("",!0)],64)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(L.value,W=>(e.openBlock(),e.createElementBlock("div",{key:W,class:e.normalizeClass(["dss-step-bar__segment",{"dss-step-bar__segment--active":W<=fe.value}])},null,2))),128))],8,Dp)])]),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[ze.visible?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-step-bar__tooltip dss-step-bar__tooltip--teleported",style:e.normalizeStyle(re.value)},e.toDisplayString(ze.content),5)):e.createCommentVNode("",!0)]))],6))}},Fp={key:0,class:"dss-title dss-title--separator"},Ip={__name:"DSSTitle",props:{type:{type:String,default:"main",validator:E=>["main","separator","subtitle"].includes(E)},h:{type:Number,default:null,validator:E=>E===null||Number.isInteger(E)&&E>=1&&E<=6},size:{type:[String,Number],default:null},weight:{type:[String,Number],default:null},color:{type:String,default:null},editable:{type:Boolean,default:!1},modelValue:{type:String,default:""}},emits:["update:modelValue","change"],setup(E,{expose:te,emit:$}){const V=E,ce=$,O=e.ref(null),L=e.computed(()=>`dss-title--${V.type}`),fe=e.computed(()=>V.h!=null?`dss-title--h${V.h}`:null),rt={main:"div",subtitle:"p",separator:"span"},ee=e.computed(()=>V.h!=null?`h${V.h}`:rt[V.type]??"div"),v=e.computed(()=>V.editable?"plaintext-only":void 0),be=e.computed(()=>{const ue={};return V.size!=null&&(ue.fontSize=typeof V.size=="number"?`${V.size}px`:V.size),V.weight!=null&&(ue.fontWeight=V.weight),V.color!=null&&(ue.color=V.color),Object.keys(ue).length?ue:void 0}),ke=e.computed(()=>V.editable?{input:Y,keydown:me,paste:F}:{}),J=()=>{const ue=O.value;!V.editable||!ue||document.activeElement!==ue&&(ue.innerText=V.modelValue??"")},Y=ue=>{const $e=ue.target.innerText;ce("update:modelValue",$e),ce("change",$e)},me=ue=>{ue.key==="Enter"&&ue.preventDefault()},F=ue=>{ue.preventDefault();const $e=(ue.clipboardData||window.clipboardData).getData("text/plain");document.execCommand("insertText",!1,$e)};return e.watch(()=>V.modelValue,()=>{J()}),e.watch(()=>V.editable,()=>{e.nextTick(J)}),e.onMounted(()=>{e.nextTick(J)}),te({focus:()=>O.value?.focus()}),(ue,$e)=>E.type==="separator"?(e.openBlock(),e.createElementBlock("div",Fp,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(ee.value),e.mergeProps({ref_key:"titleRef",ref:O,class:["dss-title__separator-label",fe.value,{"dss-title--editable":E.editable}],style:be.value,contenteditable:v.value,spellcheck:E.editable?!1:void 0},e.toHandlers(ke.value)),{default:e.withCtx(()=>[E.editable?e.createCommentVNode("",!0):e.renderSlot(ue.$slots,"default",{key:0},()=>[e.createTextVNode(e.toDisplayString(E.modelValue),1)])]),_:3},16,["class","style","contenteditable","spellcheck"]))])):(e.openBlock(),e.createBlock(e.resolveDynamicComponent(ee.value),e.mergeProps({key:1,ref_key:"titleRef",ref:O,class:["dss-title",[L.value,fe.value,{"dss-title--editable":E.editable}]],style:be.value,contenteditable:v.value,spellcheck:E.editable?!1:void 0},e.toHandlers(ke.value)),{default:e.withCtx(()=>[E.editable?e.createCommentVNode("",!0):e.renderSlot(ue.$slots,"default",{key:0},()=>[e.createTextVNode(e.toDisplayString(E.modelValue),1)])]),_:3},16,["class","style","contenteditable","spellcheck"]))}},zp={contextMenu:{addMarker:"Add Marker",clearAllMarkers:"Clear All Markers",downloadSvg:"Download SVG",downloadPng:"Download PNG",downloadCsv:"Download CSV"},modalMarker:{editMarker:"Edit Marker",viewMarker:"View Marker",title:"Title",description:"Description",iconType:"Icon Type",defaultIcon:"Default Logo",iconPreview:"Icon Preview",deleteMarker:"Delete Marker",cancel:"Cancel",close:"Close",save:"Save",placeholderTitle:"Enter marker title",placeholderDescription:"Enter marker description (required)"},zoom:{doubleClickToReset:"(Double-click to reset)"},csv:{chartTitle:"Chart Title",chartSubtitle:"Chart Subtitle",generated:"Generated"},fallback:{item:"Item",axis:"Axis"},tooltip:{flags:"Flags",markers:"Markers",manualFlags:"Manual Flags",autoFlags:"Auto Flags"}},Pp={firstPage:"First page",previousPage:"Previous page",nextPage:"Next page",lastPage:"Last page",currentPageAriaLabel:"Current page",rowsPerPage:"Rows per page",searchPlaceholder:"Search...",searchAriaLabel:"Search",searchTableAriaLabel:"Search table",clearSearchAriaLabel:"Clear search",downloadPdf:"Download PDF",downloadExcel:"Download Excel",columnVisibility:"Columns Visibility",expandRowAriaLabel:"Expand row",collapseRowAriaLabel:"Collapse row",filterColumnAriaLabel:"Filter column",clearFilter:"Clear",search:"Search...",filterFrom:"From:",filterTo:"To:",dateFormat:"dd/mm/yyyy",showingRange:"Showing {start}-{end} from {total}",ofPages:"of {total}",emptyMessage:"No data available"},Op={searchAcrossFields:"Search across all fields...",openAdvancedFilter:"Open advanced filter",closeAdvancedFilter:"Close advanced filter",noConditionsApplied:"No filter conditions are applied to this view",where:"Where",and:"And",searchAttributes:"Search attributes...",noMatch:"No match",enterValue:"Enter value...",min:"Min",max:"Max",search:"Search...",addFilter:"Add filter",clearAllFilters:"Clear all filters",select:"Select...",selectedCount:"{count} selected",operators:{contains:"contains",not_contains:"does not contain",equals:"equals",not_equals:"does not equal",starts_with:"starts with",ends_with:"ends with",is_empty:"is empty",is_not_empty:"is not empty",is_any_of:"is any of",is_none_of:"is none of",eq:"=",neq:"≠",gt:">",gte:"≥",lt:"<",lte:"≤",between:"between",contains_any:"contains any of",contains_all:"contains all of",not_contains_any:"does not contain",before:"before",after:"after",is_true:"is true",is_false:"is false"}},Wp={selectDate:"Select Date",selectRange:"Select range",selectFromList:"Select a date",noAvailableDates:"No dates available",startDate:"Start date",endDate:"End date",prevMonth:"Previous month",nextMonth:"Next month",quickSelect:{today:"Today",lastWeek:"Last week",last15Days:"Last 15 days",last30Days:"Last 30 days",thisMonth:"This month",last3Months:"Last 3 months",last6Months:"Last 6 months",last12Months:"Last 12 months",lastYear:"Last year",allDates:"All dates",last2Dates:"Last 2 dates",last3Dates:"Last 3 dates",last4Dates:"Last 4 dates",last5Dates:"Last 5 dates"}},qp={toolbar:{undo:"Undo",redo:"Redo",paragraphFormat:"Paragraph Format",bold:"Bold",italic:"Italic",underline:"Underline",citation:"Citation",insertLink:"Insert Link",removeLink:"Remove Link",bulletList:"Bullet List",numberList:"Number List",image:"Image",comment:"Comment",askAi:"Ask AI"},paragraph:{heading1:"Heading 1",heading2:"Heading 2",heading3:"Heading 3",heading4:"Heading 4",heading5:"Heading 5",heading6:"Heading 6",paragraph:"Paragraph"},link:{editLink:"Edit Link",altText:"Alt text:",url:"URL:",enterAltText:"Enter alt text...",enterUrl:"Enter URL...",cancel:"Cancel",save:"Save"},image:{addImage:"Add Image",editImage:"Edit Image",upload:"Upload",imageLink:"Image Link",uploadImage:"Upload image:",imageUrl:"Image URL:",altText:"Alt text:",width:"Width (px):",height:"Height (px):",enterAltText:"Enter alt text...",enterImageUrl:"https://example.com/image.jpg",auto:"Auto",noAlt:"No alt",cancel:"Cancel",save:"Save"},comment:{placeholder:"Add a comment",send:"Send",delete:"Delete comment"},started_conversation:"Started conversation",labels:{title:"Title",description:"Description"},placeholders:{title:"Enter title...",description:"Enter description...",startTyping:"Start typing..."},footer:{word:"word",words:"words",character:"character",characters:"characters"}},io={chart:zp,table:Pp,filter:Op,datepicker:Wp,textEditor:qp},Zp={contextMenu:{addMarker:"Ajouter un marqueur",clearAllMarkers:"Effacer tous les marqueurs",downloadSvg:"Télécharger SVG",downloadPng:"Télécharger PNG",downloadCsv:"Télécharger CSV"},modalMarker:{editMarker:"Modifier le marqueur",viewMarker:"Voir le marqueur",title:"Titre",description:"Description",iconType:"Type d'icône",defaultIcon:"Logo par défaut",iconPreview:"Aperçu de l'icône",deleteMarker:"Supprimer le marqueur",cancel:"Annuler",close:"Fermer",save:"Enregistrer",placeholderTitle:"Entrez le titre du marqueur",placeholderDescription:"Entrez la description du marqueur (requise)"},zoom:{doubleClickToReset:"(Double-cliquez pour réinitialiser)"},csv:{chartTitle:"Titre du graphique",chartSubtitle:"Sous-titre du graphique",generated:"Généré"},fallback:{item:"Élément",axis:"Axe"},tooltip:{flags:"Drapeaux",markers:"Marqueurs",manualFlags:"Drapeaux manuels",autoFlags:"Drapeaux automatiques"}},Up={firstPage:"Première page",previousPage:"Page précédente",nextPage:"Page suivante",lastPage:"Dernière page",currentPageAriaLabel:"Page actuelle",rowsPerPage:"Lignes par page",searchPlaceholder:"Rechercher...",searchAriaLabel:"Rechercher",searchTableAriaLabel:"Rechercher dans le tableau",clearSearchAriaLabel:"Effacer la recherche",downloadPdf:"Télécharger PDF",downloadExcel:"Télécharger Excel",columnVisibility:"Visibilité des colonnes",expandRowAriaLabel:"Développer la ligne",collapseRowAriaLabel:"Réduire la ligne",filterColumnAriaLabel:"Filtrer la colonne",clearFilter:"Effacer",search:"Rechercher...",filterFrom:"Du :",filterTo:"Au :",dateFormat:"jj/mm/aaaa",showingRange:"Affichage de {start}-{end} sur {total}",ofPages:"sur {total}",emptyMessage:"Aucune donnée disponible"},Xp={searchAcrossFields:"Rechercher dans tous les champs...",openAdvancedFilter:"Ouvrir le filtre avancé",closeAdvancedFilter:"Fermer le filtre avancé",noConditionsApplied:"Aucune condition de filtre n'est appliquée à cette vue",where:"Où",and:"Et",searchAttributes:"Rechercher des attributs...",noMatch:"Aucun résultat",enterValue:"Saisir une valeur...",min:"Min",max:"Max",search:"Rechercher...",addFilter:"Ajouter un filtre",clearAllFilters:"Effacer tous les filtres",select:"Sélectionner...",selectedCount:"{count} sélectionnés",operators:{contains:"contient",not_contains:"ne contient pas",equals:"est égal à",not_equals:"est différent de",starts_with:"commence par",ends_with:"se termine par",is_empty:"est vide",is_not_empty:"n'est pas vide",is_any_of:"est l'un de",is_none_of:"n'est aucun de",eq:"=",neq:"≠",gt:">",gte:"≥",lt:"<",lte:"≤",between:"entre",contains_any:"contient l'un de",contains_all:"contient tous",not_contains_any:"ne contient pas",before:"avant",after:"après",is_true:"est vrai",is_false:"est faux"}},Yp={selectDate:"Sélectionner une date",selectRange:"Sélectionner une plage",selectFromList:"Sélectionner une date",noAvailableDates:"Aucune date disponible",startDate:"Date de début",endDate:"Date de fin",prevMonth:"Mois précédent",nextMonth:"Mois suivant",quickSelect:{today:"Aujourd'hui",lastWeek:"Dernière semaine",last15Days:"15 derniers jours",last30Days:"30 derniers jours",thisMonth:"Ce mois",last3Months:"3 derniers mois",last6Months:"6 derniers mois",last12Months:"12 derniers mois",lastYear:"Dernière année",allDates:"Toutes les dates",last2Dates:"2 dernières dates",last3Dates:"3 dernières dates",last4Dates:"4 dernières dates",last5Dates:"5 dernières dates"}},jp={toolbar:{undo:"Annuler",redo:"Rétablir",paragraphFormat:"Format de paragraphe",bold:"Gras",italic:"Italique",underline:"Souligné",citation:"Citation",insertLink:"Insérer un lien",removeLink:"Supprimer le lien",bulletList:"Liste à puces",numberList:"Liste numérotée",image:"Image",comment:"Commentaire",askAi:"Demander à l'IA"},paragraph:{heading1:"En-tête 1",heading2:"En-tête 2",heading3:"En-tête 3",heading4:"En-tête 4",heading5:"En-tête 5",heading6:"En-tête 6",paragraph:"Paragraphe"},link:{editLink:"Modifier le lien",altText:"Texte alternatif :",url:"URL :",enterAltText:"Entrez le texte alternatif...",enterUrl:"Entrez l'URL...",cancel:"Annuler",save:"Enregistrer"},image:{addImage:"Ajouter une image",editImage:"Modifier l'image",upload:"Télécharger",imageLink:"Lien de l'image",uploadImage:"Télécharger l'image :",imageUrl:"URL de l'image :",altText:"Texte alternatif :",width:"Largeur (px) :",height:"Hauteur (px) :",enterAltText:"Entrez le texte alternatif...",enterImageUrl:"https://exemple.com/image.jpg",auto:"Auto",noAlt:"Pas de texte alternatif",cancel:"Annuler",save:"Enregistrer"},comment:{placeholder:"Ajouter un commentaire",send:"Envoyer",delete:"Supprimer le commentaire"},started_conversation:"A démarré la conversation",labels:{title:"Titre",description:"Description"},placeholders:{title:"Entrez le titre...",description:"Entrez la description...",startTyping:"Commencez à taper..."},footer:{word:"mot",words:"mots",character:"caractère",characters:"caractères"}},co={chart:Zp,table:Up,filter:Xp,datepicker:Yp,textEditor:jp},Kp={contextMenu:{addMarker:"Markering toevoegen",clearAllMarkers:"Alle markeringen wissen",downloadSvg:"SVG downloaden",downloadPng:"PNG downloaden",downloadCsv:"CSV downloaden"},modalMarker:{editMarker:"Markering bewerken",viewMarker:"Markering bekijken",title:"Titel",description:"Beschrijving",iconType:"Pictogramtype",defaultIcon:"Standaard logo",iconPreview:"Pictogramvoorbeeld",deleteMarker:"Markering verwijderen",cancel:"Annuleren",close:"Sluiten",save:"Opslaan",placeholderTitle:"Voer markeringstitel in",placeholderDescription:"Voer markeringsbeschrijving in (optioneel)"},zoom:{doubleClickToReset:"(Dubbelklik om te resetten)"},csv:{chartTitle:"Grafiek titel",chartSubtitle:"Grafiek ondertitel",generated:"Gegenereerd"},fallback:{item:"Item",axis:"As"},tooltip:{flags:"Vlaggen",markers:"Markeringen",manualFlags:"Handmatige vlaggen",autoFlags:"Automatische vlaggen"}},Gp={firstPage:"Eerste pagina",previousPage:"Vorige pagina",nextPage:"Volgende pagina",lastPage:"Laatste pagina",currentPageAriaLabel:"Huidige pagina",rowsPerPage:"Rijen per pagina",searchPlaceholder:"Zoeken...",searchAriaLabel:"Zoeken",searchTableAriaLabel:"Zoeken in tabel",clearSearchAriaLabel:"Zoekopdracht wissen",downloadPdf:"PDF downloaden",downloadExcel:"Excel downloaden",columnVisibility:"Kolommen weer te geven",expandRowAriaLabel:"Rij uitklappen",collapseRowAriaLabel:"Rij inklappen",filterColumnAriaLabel:"Kolom filteren",clearFilter:"Wissen",search:"Zoeken...",filterFrom:"Van:",filterTo:"Tot:",dateFormat:"dd-mm-jjjj",showingRange:"{start}-{end} van {total} weergegeven",ofPages:"van {total}",emptyMessage:"Geen gegevens beschikbaar"},Qp={searchAcrossFields:"Zoeken in alle velden...",openAdvancedFilter:"Geavanceerde filter openen",closeAdvancedFilter:"Geavanceerde filter sluiten",noConditionsApplied:"Er zijn geen filtervoorwaarden toegepast op deze weergave",where:"Waar",and:"En",searchAttributes:"Zoek attributen...",noMatch:"Geen overeenkomst",enterValue:"Voer waarde in...",min:"Min",max:"Max",search:"Zoeken...",addFilter:"Filter toevoegen",clearAllFilters:"Alle filters wissen",select:"Selecteren...",selectedCount:"{count} geselecteerd",operators:{contains:"bevat",not_contains:"bevat niet",equals:"is gelijk aan",not_equals:"is niet gelijk aan",starts_with:"begint met",ends_with:"eindigt op",is_empty:"is leeg",is_not_empty:"is niet leeg",is_any_of:"is een van",is_none_of:"is geen van",eq:"=",neq:"≠",gt:">",gte:"≥",lt:"<",lte:"≤",between:"tussen",contains_any:"bevat een van",contains_all:"bevat alle",not_contains_any:"bevat niet",before:"voor",after:"na",is_true:"is waar",is_false:"is onwaar"}},Jp={selectDate:"Selecteer datum",selectRange:"Selecteer bereik",selectFromList:"Selecteer een datum",noAvailableDates:"Geen datums beschikbaar",startDate:"Startdatum",endDate:"Einddatum",prevMonth:"Vorige maand",nextMonth:"Volgende maand",quickSelect:{today:"Vandaag",lastWeek:"Afgelopen week",last15Days:"Laatste 15 dagen",last30Days:"Laatste 30 dagen",thisMonth:"Deze maand",last3Months:"Laatste 3 maanden",last6Months:"Laatste 6 maanden",last12Months:"Laatste 12 maanden",lastYear:"Afgelopen jaar",allDates:"Alle datums",last2Dates:"Laatste 2 datums",last3Dates:"Laatste 3 datums",last4Dates:"Laatste 4 datums",last5Dates:"Laatste 5 datums"}},e9={toolbar:{undo:"Ongedaan maken",redo:"Opnieuw",paragraphFormat:"Alineaopmaak",bold:"Vet",italic:"Cursief",underline:"Onderstreept",citation:"Citaat",insertLink:"Link invoegen",removeLink:"Link verwijderen",bulletList:"Lijst met opsommingstekens",numberList:"Genummerde lijst",image:"Afbeelding",comment:"Commentaar",askAi:"Vraag AI"},paragraph:{heading1:"Kop 1",heading2:"Kop 2",heading3:"Kop 3",heading4:"Kop 4",heading5:"Kop 5",heading6:"Kop 6",paragraph:"Alinea"},link:{editLink:"Link bewerken",altText:"Alt-tekst:",url:"URL:",enterAltText:"Voer alt-tekst in...",enterUrl:"Voer URL in...",cancel:"Annuleren",save:"Opslaan"},image:{addImage:"Afbeelding toevoegen",editImage:"Afbeelding bewerken",upload:"Uploaden",imageLink:"Afbeeldingslink",uploadImage:"Afbeelding uploaden:",imageUrl:"Afbeeldings-URL:",altText:"Alt-tekst:",width:"Breedte (px):",height:"Hoogte (px):",enterAltText:"Voer alt-tekst in...",enterImageUrl:"https://voorbeeld.com/afbeelding.jpg",auto:"Auto",noAlt:"Geen alt-tekst",cancel:"Annuleren",save:"Opslaan"},comment:{placeholder:"Voeg een opmerking toe",send:"Verzenden",delete:"Opmerking verwijderen"},started_conversation:"Gesprek gestart",labels:{title:"Titel",description:"Beschrijving"},placeholders:{title:"Voer titel in...",description:"Voer beschrijving in...",startTyping:"Begin met typen..."},footer:{word:"woord",words:"woorden",character:"teken",characters:"tekens"}},uo={chart:Kp,table:Gp,filter:Qp,datepicker:Jp,textEditor:e9},Oo={en:io,fr:co,nl:uo};function Ma(E){if(!E||!E.global)return;const te=E.global.availableLocales||[];Object.keys(Oo).forEach($=>{te.includes($)&&E.global.mergeLocaleMessage($,Oo[$])})}const Wo={en:{textEditor:io.textEditor},fr:{textEditor:co.textEditor},nl:{textEditor:uo.textEditor}};function _a(E){if(!E||!E.global)return;const te=E.global.availableLocales||[];Object.keys(Wo).forEach($=>{te.includes($)&&E.global.mergeLocaleMessage($,Wo[$])})}const qo={en:{table:io.table},fr:{table:co.table},nl:{table:uo.table}};function $a(E){if(!E||!E.global)return;const te=E.global.availableLocales||[];Object.keys(qo).forEach($=>{te.includes($)&&E.global.mergeLocaleMessage($,qo[$])})}const Zo={en:{datepicker:io.datepicker},fr:{datepicker:co.datepicker},nl:{datepicker:uo.datepicker}};function La(E){if(!E||!E.global)return;const te=E.global.availableLocales||[];Object.keys(Zo).forEach($=>{te.includes($)&&E.global.mergeLocaleMessage($,Zo[$])})}const Uo={en:{filter:io.filter},fr:{filter:co.filter},nl:{filter:uo.filter}};function Aa(E){if(!E||!E.global)return;const te=E.global.availableLocales||[];Object.keys(Uo).forEach($=>{te.includes($)&&E.global.mergeLocaleMessage($,Uo[$])})}const t9={chart:Oo,textEditor:Wo,table:qo,datepicker:Zo,filter:Uo};function l9(E){!E||!E.global||(Ma(E),_a(E),$a(E),La(E),Aa(E))}const n9={en:{...io},fr:{...co},nl:{...uo}};ro.createI18n({legacy:!1,locale:"en",fallbackLocale:"en",messages:n9});exports.DSSChart=Gc;exports.DSSChartMessages=Oo;exports.DSSColorPicker=I2;exports.DSSConfetti=p0;exports.DSSDatepicker=pa;exports.DSSDatepickerMessages=Zo;exports.DSSDnd=d0;exports.DSSFilter=Cp;exports.DSSFilterMessages=Uo;exports.DSSLoader=Q2;exports.DSSMessages=t9;exports.DSSModal=ma;exports.DSSPillField=Mp;exports.DSSSkeleton=J2;exports.DSSStepBar=Rp;exports.DSSTable=kd;exports.DSSTableMessages=qo;exports.DSSTextEditor=w2;exports.DSSTextEditorMessages=Wo;exports.DSSTitle=Ip;exports.addDSSChartTranslations=Ma;exports.addDSSDatepickerTranslations=La;exports.addDSSFilterTranslations=Aa;exports.addDSSTableTranslations=$a;exports.addDSSTextEditorTranslations=_a;exports.addDSSTranslations=l9;
|