dsp-semactic 0.6.23 → 0.6.24

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs.js CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),lo=require("vue-i18n"),ea={key:0,class:"dss-datepicker__input-wrap dss-datepicker__input-wrap--readonly"},ta=["value"],na=["placeholder","value","disabled"],la=["placeholder","value"],oa={key:0,class:"dss-datepicker__double-wrap"},aa={key:0,class:"dss-datepicker__quick-select","aria-label":"Quick range"},sa=["onClick"],ra={class:"dss-datepicker__double-calendars"},ia={class:"dss-datepicker__double-calendar"},ca={class:"dss-datepicker__calendar-header"},ua=["aria-label"],da={class:"dss-datepicker__month-year-row"},ma=["aria-label"],pa={class:"dss-datepicker__weekdays"},fa={class:"dss-datepicker__grid"},va=["disabled","onClick","onMouseenter"],ga={key:1,class:"dss-datepicker__day dss-datepicker__day--empty"},ha={class:"dss-datepicker__double-calendar"},ya={class:"dss-datepicker__calendar-header"},Ca=["aria-label"],ka={class:"dss-datepicker__month-year-row"},ba=["aria-label"],wa={class:"dss-datepicker__weekdays"},xa={class:"dss-datepicker__grid"},Ea=["disabled","onClick","onMouseenter"],Va={key:1,class:"dss-datepicker__day dss-datepicker__day--empty"},Na={class:"dss-datepicker__calendar-header"},Sa=["aria-label"],Ba={class:"dss-datepicker__month-year-row"},Ma=["aria-label"],_a={class:"dss-datepicker__weekdays"},$a={class:"dss-datepicker__grid"},Ta=["disabled","onClick","onMouseenter"],La={key:1,class:"dss-datepicker__day dss-datepicker__day--empty"},Ha={class:"dss-datepicker__calendar-header"},Aa={class:"dss-datepicker__month-year-row"},Da={class:"dss-datepicker__month-year dss-datepicker__month-year--static"},Ra={class:"dss-datepicker__months-grid"},Fa=["onClick"],Ia={class:"dss-datepicker__calendar-header dss-datepicker__calendar-header--center"},za={class:"dss-datepicker__month-year"},Pa={class:"dss-datepicker__years-grid"},Oa=["data-year","onClick"],Uo=27,zo={__name:"DSSDatepicker",props:{mode:{type:String,default:"single",validator:F=>["single","range","singleFromAvailable","rangeFromAvailable","readonly"].includes(F)},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}},emits:["update:modelValue"],setup(F,{emit:Ce}){const z=F,A=Ce,{t:_e,locale:k}=lo.useI18n(),Le=e.ref(!1),se=e.ref("days"),pt=new Date,p=e.computed(()=>z.minDate instanceof Date?z.minDate:pt),ue=e.ref(p.value.getMonth()),ve=e.ref(p.value.getFullYear()),de=e.ref(p.value.getMonth()),ee=e.ref(p.value.getFullYear()),S=e.ref(p.value.getMonth()),ne=e.ref(p.value.getFullYear()),He=e.ref("start"),Ae=e.ref(null),Ie=e.ref(null);function O(){const D=p.value,q=D.getMonth(),R=D.getFullYear(),le=q===11?0:q+1,Me=q===11?R+1:R;return{left:{month:q,year:R},right:{month:le,year:Me}}}const rt=e.ref(null),Oe=e.ref(null),we=e.ref(null),xt=e.ref(null),Tt=e.ref(null),ut=e.ref(null),Ze=new Date().getFullYear(),ge=e.computed(()=>["single","singleFromAvailable"].includes(z.mode)),yt=e.computed(()=>["range","rangeFromAvailable"].includes(z.mode)),St=e.computed(()=>{if(z.mode!=="single"&&z.mode!=="singleFromAvailable")return null;const D=z.modelValue;return D instanceof Date?D:null}),at=e.computed(()=>{if(!yt.value)return{start:null,end:null};const D=z.modelValue;return!D||typeof D!="object"?{start:null,end:null}:{start:D.start instanceof Date?D.start:null,end:D.end instanceof Date?D.end:null}});function $t(D){if(!D||!(D instanceof Date))return"";const q=D.getDate(),R=D.getMonth()+1,le=D.getFullYear(),Me=nt=>String(nt).padStart(2,"0");return`${Me(q)}/${Me(R)}/${le}`}const Ot=e.computed(()=>$t(St.value)),on=e.computed(()=>{const{start:D,end:q}=at.value;if(!D&&!q)return"";const R=!q||D&&D<=q?D:q,le=!D||q&&q>=D?q:D;return X(R,le)?$t(R):`${$t(R)} - ${$t(le)}`}),Et=e.computed(()=>{if(z.mode!=="readonly")return"—";const D=z.modelValue;if(D instanceof Date)return $t(D)||"—";if(D&&typeof D=="object"&&("start"in D||"end"in D)){const q=D.start instanceof Date?D.start:null,R=D.end instanceof Date?D.end:null;if(!q&&!R)return"—";const le=!R||q&&q<=R?q:R,Me=!q||R&&R>=q?R:q;return X(le,Me)?$t(le):`${$t(le)} - ${$t(Me)}`}return"—"});e.computed(()=>{const D=new Date(ve.value,ue.value,1);return new Intl.DateTimeFormat(k.value,{month:"long",year:"numeric"}).format(D)});const lt=e.computed(()=>Ie.value==="left"?de.value:Ie.value==="right"?S.value:ue.value),je=e.computed(()=>Ie.value==="left"?ee.value:Ie.value==="right"?ne.value:ve.value),Dt=e.computed(()=>{const D=new Date(ve.value,ue.value,1);return new Intl.DateTimeFormat(k.value,{month:"long"}).format(D)}),Lt=e.computed(()=>{const D=new Date(je.value,lt.value,1);return new Intl.DateTimeFormat(k.value,{month:"long"}).format(D)}),Bt=e.computed(()=>{const D=new Intl.DateTimeFormat(k.value,{month:"short"});return Array.from({length:12},(q,R)=>D.format(new Date(2024,R,1)))}),Xe=e.computed(()=>{const q=(Ie.value?je.value:ve.value)-Math.floor(Uo/2);return Array.from({length:Uo},(R,le)=>q+le)}),Zt=e.computed(()=>{const D=Xe.value;return D.length?`${D[0]} – ${D[D.length-1]}`:""}),Yt=e.computed(()=>{const D=new Intl.DateTimeFormat(k.value,{weekday:"short"}),q=new Date(2024,0,1),R=[];for(let le=0;le<7;le++){const Me=new Date(q);Me.setDate(q.getDate()+le),R.push(D.format(Me).slice(0,2))}return R});function Ct(D,q){const R=new Date(D,q,1),le=new Date(D,q+1,0),Me=R.getDay(),nt=le.getDate(),st=[];for(let Qe=0;Qe<Me;Qe++)st.push(null);for(let Qe=1;Qe<=nt;Qe++)st.push(new Date(D,q,Qe));return st}const te=e.computed(()=>Ct(ve.value,ue.value)),$e=e.computed(()=>Ct(ee.value,de.value)),fe=e.computed(()=>Ct(ne.value,S.value));e.computed(()=>{const D=new Date(ee.value,de.value,1);return new Intl.DateTimeFormat(k.value,{month:"long",year:"numeric"}).format(D)}),e.computed(()=>{const D=new Date(ne.value,S.value,1);return new Intl.DateTimeFormat(k.value,{month:"long",year:"numeric"}).format(D)});const Ne=e.computed(()=>{const D=new Date(ee.value,de.value,1);return new Intl.DateTimeFormat(k.value,{month:"long"}).format(D)}),We=e.computed(()=>{const D=new Date(ne.value,S.value,1);return new Intl.DateTimeFormat(k.value,{month:"long"}).format(D)}),ft=e.computed(()=>z.availableDates&&z.availableDates.length>0),qe=e.computed(()=>ft.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"}]),dt=e.ref({top:0,left:0});function xe(){if(!xt.value||!Le.value)return;const D=xt.value.getBoundingClientRect(),q=window.innerWidth||document.documentElement.clientWidth,R=window.innerHeight||document.documentElement.clientHeight;let le=D.left,Me=D.bottom+4;const nt=Tt.value;if(nt){const st=nt.offsetWidth,Qe=nt.offsetHeight;if(le+st>q-8&&(le=D.right-st,le<8&&(le=8)),Me+Qe>R-8){const Ke=D.top-4-Qe;Ke>=8?Me=Ke:Me=Math.max(8,R-Qe-8)}}dt.value={top:Me,left:le}}const Ue=e.computed(()=>!xt.value||!Le.value?{}:{position:"fixed",left:`${dt.value.left}px`,top:`${dt.value.top}px`,zIndex:1002});function X(D,q){return!D||!q?!1:D.getFullYear()===q.getFullYear()&&D.getMonth()===q.getMonth()&&D.getDate()===q.getDate()}function Z(D){return new Date(D.getFullYear(),D.getMonth(),D.getDate()).getTime()}function j(D){return!z.availableDates||!z.availableDates.length?!0:z.availableDates.some(q=>q instanceof Date&&X(q,D))}function ie(D){const q=Z(D);return!(z.minDate instanceof Date&&q<Z(z.minDate)||z.maxDate instanceof Date&&q>Z(z.maxDate))}function E(D){return!z.exceptDates||!z.exceptDates.length?!1:z.exceptDates.some(q=>q instanceof Date&&X(q,D))}function C(D){return E(D)?!1:["singleFromAvailable","rangeFromAvailable"].includes(z.mode)?j(D):ie(D)}function V(D){const q=St.value,R=at.value,le=Z(D),Me=yt.value&&R.start&&R.end&&le>Z(R.start)&&le<Z(R.end),nt=yt.value&&R.start&&X(D,R.start),st=yt.value&&R.end&&X(D,R.end),Qe=nt&&st,Ke=ge.value&&q&&X(D,q)||nt||st;let dn=!1;if(yt.value&&R.start&&!R.end&&Ae.value){const Ln=Z(R.start),tn=Z(Ae.value),Hn=Math.min(Ln,tn),wn=Math.max(Ln,tn);dn=le>Hn&&le<wn}return{"dss-datepicker__day--selected":Ke&&!Qe,"dss-datepicker__day--range-start":nt&&!Qe,"dss-datepicker__day--range-end":st&&!Qe,"dss-datepicker__day--range-single":Qe,"dss-datepicker__day--in-range":Me&&!nt&&!st,"dss-datepicker__day--in-range-preview":dn&&!nt&&!st&&!Me,"dss-datepicker__day--disabled":!C(D)}}function P(D){if(!yt.value)return;const q=at.value;if(!q.start||q.end){Ae.value=null;return}if(!C(D)){Ae.value=null;return}Ae.value=new Date(D.getFullYear(),D.getMonth(),D.getDate())}function U(){Ae.value=null}function ze(){if(!z.doubleCalendar||!yt.value)return;const D=at.value,{start:q,end:R}=D;if(q&&R){const nt=q<=R?q:R,st=q<=R?R:q,Qe=nt.getMonth(),Ke=nt.getFullYear(),dn=st.getMonth(),Ln=st.getFullYear();if(Qe!==dn||Ke!==Ln){const tn=de.value===Qe&&ee.value===Ke,Hn=S.value===dn&&ne.value===Ln;if(tn&&Hn)return;de.value=Qe,ee.value=Ke,S.value=dn,ne.value=Ln}else{const tn=Qe===0?11:Qe-1,Hn=Qe===0?Ke-1:Ke;de.value===tn&&ee.value===Hn&&S.value===Qe&&ne.value===Ke||(de.value=Qe,ee.value=Ke,Qe===11?(S.value=0,ne.value=Ke+1):(S.value=Qe+1,ne.value=Ke))}return}const le=q||R;if(le){const nt=le.getMonth(),st=le.getFullYear(),Qe=de.value===nt&&ee.value===st,Ke=S.value===nt&&ne.value===st;if(Qe||Ke)return;de.value=nt,ee.value=st,nt===11?(S.value=0,ne.value=st+1):(S.value=nt+1,ne.value=st);return}const Me=O();de.value=Me.left.month,ee.value=Me.left.year,S.value=Me.right.month,ne.value=Me.right.year}function Re(D="start"){if(z.mode==="readonly")return;He.value=D;const q=St.value,R=at.value;if(ge.value&&q)ue.value=q.getMonth(),ve.value=q.getFullYear();else if(yt.value)if(z.doubleCalendar)ze();else{const le=D==="start"&&R.start?R.start:R.end||R.start;le&&(ue.value=le.getMonth(),ve.value=le.getFullYear())}xt.value=ge.value?rt.value?.closest(".dss-datepicker__input-wrap"):Oe.value,se.value="days",Ie.value=null,Le.value=!0,e.nextTick(()=>{xe()})}function De(){se.value="days",Ie.value=null,Ae.value=null,Le.value=!1}function re(D,q){Ie.value=D,se.value=q}function Ge(){se.value="days",Ie.value=null}function tt(D){const q=new Date,R=q.getFullYear(),le=q.getMonth(),Me=q.getDate();let nt,st;if(ft.value){const Qe=[...z.availableDates].filter(Ke=>Ke instanceof Date).map(Ke=>new Date(Ke.getFullYear(),Ke.getMonth(),Ke.getDate()));if(Qe.sort((Ke,dn)=>Ke.getTime()-dn.getTime()),Qe.length===0)return;if(D==="all")nt=Qe[0],st=Qe[Qe.length-1];else{const Ke=parseInt(D.replace("last",""),10);if(Ke<2||Ke>5)return;const dn=Qe.slice(-Ke);nt=dn[0],st=dn[dn.length-1]}}else{const Qe=new Date(R,le,Me);switch(D){case"today":nt=Qe,st=Qe;break;case"lastWeek":nt=new Date(R,le,Me-6),st=Qe;break;case"last15Days":nt=new Date(R,le,Me-14),st=Qe;break;case"last30Days":nt=new Date(R,le,Me-29),st=Qe;break;case"thisMonth":nt=new Date(R,le,1),st=Qe;break;case"last3Months":nt=new Date(R,le-3,1),st=new Date(R,le,0);break;case"last6Months":nt=new Date(R,le-6,1),st=new Date(R,le,0);break;case"last12Months":nt=new Date(R,le-12,1),st=new Date(R,le,0);break;case"lastYear":nt=new Date(R-1,0,1),st=new Date(R-1,11,31);break;default:return}}A("update:modelValue",{start:nt,end:st}),ze()}function wt(D){Ie.value==="left"?de.value=D:Ie.value==="right"?S.value=D:ue.value=D,Ge()}function vt(D){Ie.value==="left"?ee.value=D:Ie.value==="right"?ne.value=D:ve.value=D,Ge()}function Je(){ue.value===0?(ue.value=11,ve.value--):ue.value--}function vn(){ue.value===11?(ue.value=0,ve.value++):ue.value++}function jt(){de.value===0?(de.value=11,ee.value--):de.value--}function Tn(){de.value===11?(de.value=0,ee.value++):de.value++}function bn(){S.value===0?(S.value=11,ne.value--):S.value--}function Fn(){S.value===11?(S.value=0,ne.value++):S.value++}function Wt(D){if(!C(D))return;const q=new Date(D.getFullYear(),D.getMonth(),D.getDate());if(ge.value){A("update:modelValue",q),De();return}const R=at.value;if(!R.start&&!R.end){A("update:modelValue",{start:q,end:null}),He.value="end";return}if(R.start&&R.end){A("update:modelValue",{start:q,end:null}),He.value="end";return}if(He.value==="start"){let le=q,Me=R.end;le&&Me&&le>Me&&([le,Me]=[Me,le]),A("update:modelValue",{start:le||Me,end:Me||le}),He.value="end"}else{let le=R.start,Me=q;le&&Me&&Me<le&&([le,Me]=[Me,le]),A("update:modelValue",{start:le||Me,end:Me||le}),He.value="start"}}e.watch(at,()=>{z.doubleCalendar&&yt.value&&Le.value&&ze()},{deep:!0});let In=null,an=null,qn=null;function cl(){In&&(document.removeEventListener("keydown",In),In=null),an&&(window.removeEventListener("resize",an),an=null),qn&&(window.removeEventListener("scroll",qn,!0),qn=null)}return e.watch(se,D=>{D==="years"&&e.nextTick(()=>{ut.value?.querySelector(`[data-year="${je.value}"]`)?.scrollIntoView({block:"center",behavior:"auto"})})}),e.watch(Le,D=>{cl(),D&&(In=q=>{q.key==="Escape"&&(se.value==="years"||se.value==="months"?Ge():De())},an=()=>{xe()},qn=()=>{xe()},document.addEventListener("keydown",In),window.addEventListener("resize",an),window.addEventListener("scroll",qn,!0))}),e.onBeforeUnmount(()=>{cl()}),(D,q)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-datepicker",{"dss-datepicker--readonly":F.mode==="readonly"}])},[F.mode==="readonly"?(e.openBlock(),e.createElementBlock("div",ea,[q[10]||(q[10]=e.createElementVNode("span",{class:"dss-datepicker__icon","aria-hidden":"true"},[e.createElementVNode("svg",{class:"dss-datepicker__icon-svg",width:"24",height:"24",viewBox:"0 0 256 256",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[e.createElementVNode("path",{d:"M208,32H184V24a8,8,0,0,0-16,0v8H88V24a8,8,0,0,0-16,0v8H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32Zm0,48H48V48H72v8a8,8,0,0,0,16,0V48h80v8a8,8,0,0,0,16,0V48h24Z"})])],-1)),e.createElementVNode("input",{type:"text",class:"dss-datepicker__input",value:Et.value,readonly:"",disabled:"",tabindex:"-1"},null,8,ta)])):ge.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-datepicker__input-wrap",onClick:q[0]||(q[0]=R=>Re("start"))},[q[11]||(q[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:rt,type:"text",class:"dss-datepicker__input",placeholder:e.unref(_e)("datepicker.selectDate"),value:Ot.value,readonly:"",disabled:F.mode==="readonly"},null,8,na)])):yt.value?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-datepicker__input-wrap",ref_key:"inputRangeWrapRef",ref:Oe,onClick:q[1]||(q[1]=R=>Re("start"))},[q[12]||(q[12]=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:we,type:"text",class:"dss-datepicker__input",placeholder:e.unref(_e)("datepicker.selectRange"),value:on.value,readonly:""},null,8,la)],512)):e.createCommentVNode("",!0),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[Le.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-datepicker__overlay",onClick:e.withModifiers(De,["self"])},[e.createElementVNode("div",{ref_key:"dropdownRef",ref:Tt,class:e.normalizeClass(["dss-datepicker__dropdown",{"dss-datepicker__dropdown--double":F.doubleCalendar&&yt.value&&se.value==="days","dss-datepicker__dropdown--quick-select":F.doubleCalendar&&yt.value&&se.value==="days"&&F.quickSelect}]),onClick:q[9]||(q[9]=e.withModifiers(()=>{},["stop"])),style:e.normalizeStyle(Ue.value)},[se.value==="days"&&F.doubleCalendar&&yt.value?(e.openBlock(),e.createElementBlock("div",oa,[F.quickSelect?(e.openBlock(),e.createElementBlock("nav",aa,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(qe.value,R=>(e.openBlock(),e.createElementBlock("button",{key:R.id,type:"button",class:"dss-datepicker__quick-select-btn",onClick:le=>tt(R.id)},e.toDisplayString(e.unref(_e)(R.labelKey)),9,sa))),128))])):e.createCommentVNode("",!0),e.createElementVNode("div",ra,[e.createElementVNode("div",ia,[e.createElementVNode("div",ca,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(_e)("datepicker.prevMonth"),onClick:jt}," ‹ ",8,ua),e.createElementVNode("div",da,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:q[2]||(q[2]=R=>re("left","months"))},e.toDisplayString(Ne.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:q[3]||(q[3]=R=>re("left","years"))},e.toDisplayString(ee.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(_e)("datepicker.nextMonth"),onClick:Tn}," › ",8,ma)]),e.createElementVNode("div",pa,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Yt.value,R=>(e.openBlock(),e.createElementBlock("span",{key:R,class:"dss-datepicker__weekday"},e.toDisplayString(R),1))),128))]),e.createElementVNode("div",fa,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList($e.value,(R,le)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"L-"+le},[R?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-datepicker__day",V(R)]),disabled:!C(R),onClick:Me=>Wt(R),onMouseenter:Me=>P(R),onMouseleave:U},e.toDisplayString(R.getDate()),43,va)):(e.openBlock(),e.createElementBlock("span",ga))],64))),128))])]),e.createElementVNode("div",ha,[e.createElementVNode("div",ya,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(_e)("datepicker.prevMonth"),onClick:bn}," ‹ ",8,Ca),e.createElementVNode("div",ka,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:q[4]||(q[4]=R=>re("right","months"))},e.toDisplayString(We.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:q[5]||(q[5]=R=>re("right","years"))},e.toDisplayString(ne.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(_e)("datepicker.nextMonth"),onClick:Fn}," › ",8,ba)]),e.createElementVNode("div",wa,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Yt.value,R=>(e.openBlock(),e.createElementBlock("span",{key:R,class:"dss-datepicker__weekday"},e.toDisplayString(R),1))),128))]),e.createElementVNode("div",xa,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(fe.value,(R,le)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"R-"+le},[R?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-datepicker__day",V(R)]),disabled:!C(R),onClick:Me=>Wt(R),onMouseenter:Me=>P(R),onMouseleave:U},e.toDisplayString(R.getDate()),43,Ea)):(e.openBlock(),e.createElementBlock("span",Va))],64))),128))])])])])):se.value==="days"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",Na,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(_e)("datepicker.prevMonth"),onClick:Je}," ‹ ",8,Sa),e.createElementVNode("div",Ba,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:q[6]||(q[6]=R=>se.value="months")},e.toDisplayString(Dt.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:q[7]||(q[7]=R=>se.value="years")},e.toDisplayString(ve.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(_e)("datepicker.nextMonth"),onClick:vn}," › ",8,Ma)]),e.createElementVNode("div",_a,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Yt.value,R=>(e.openBlock(),e.createElementBlock("span",{key:R,class:"dss-datepicker__weekday"},e.toDisplayString(R),1))),128))]),e.createElementVNode("div",$a,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(te.value,(R,le)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:le},[R?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-datepicker__day",V(R)]),disabled:!C(R),onClick:Me=>Wt(R),onMouseenter:Me=>P(R),onMouseleave:U},e.toDisplayString(R.getDate()),43,Ta)):(e.openBlock(),e.createElementBlock("span",La))],64))),128))])],64)):se.value==="months"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createElementVNode("div",Ha,[e.createElementVNode("div",Aa,[e.createElementVNode("span",Da,e.toDisplayString(Lt.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:q[8]||(q[8]=R=>se.value="years")},e.toDisplayString(je.value),1)])]),e.createElementVNode("div",Ra,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Bt.value,(R,le)=>(e.openBlock(),e.createElementBlock("button",{key:le,type:"button",class:e.normalizeClass(["dss-datepicker__month-cell",{"dss-datepicker__month-cell--selected":le===lt.value}]),onClick:Me=>wt(le)},e.toDisplayString(R),11,Fa))),128))])],64)):se.value==="years"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.createElementVNode("div",Ia,[e.createElementVNode("span",za,e.toDisplayString(Zt.value),1)]),e.createElementVNode("div",{class:"dss-datepicker__years-wrap",ref_key:"yearsWrapRef",ref:ut},[e.createElementVNode("div",Pa,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Xe.value,R=>(e.openBlock(),e.createElementBlock("button",{key:R,type:"button",class:e.normalizeClass(["dss-datepicker__year-cell",{"dss-datepicker__year-cell--selected":R===je.value,"dss-datepicker__year-cell--current":R===e.unref(Ze)}]),"data-year":R,onClick:le=>vt(R)},e.toDisplayString(R),11,Oa))),128))])],512)],64)):e.createCommentVNode("",!0)],6)])):e.createCommentVNode("",!0)]))],2))}},Za=["data-chart-type"],Wa={class:"dss-chart-header-titles"},qa={key:0,class:"dss-chart-title"},Ua={key:1,class:"dss-chart-subtitle"},Xa=["onClick","onMouseenter"],Ya={class:"dss-legend-text"},ja=["onClick","onMouseenter"],Ka={class:"dss-legend-text"},Ga=["title"],Qa=["src"],Ja={class:"dss-chart-area-wrapper"},es={key:0,class:"dss-chart-z-axis-label"},ts=["width","height","data-smooth","data-animated"],ns={id:"chart-clip"},ls=["y","width","height"],os=["id"],as=["d"],ss=["id"],rs=["d"],is={key:0},cs={key:0,class:"dss-grid-lines","clip-path":"url(#chart-clip)"},us=["x1","x2","y1","y2"],ds={class:"dss-axes"},ms=["x1","x2","y1","y2"],ps=["x1","x2","y1","y2"],fs={class:"dss-axis-labels"},vs=["x","y"],gs=["x","y"],hs=["x","y"],ys=["y","transform"],Cs={key:1,class:"dss-flag-markers"},ks={"clip-path":"url(#chart-clip)"},bs=["x1","x2","y1","y2","onMouseover"],ws=["x1","x2","y1","y2","onMouseover"],xs=["x1","x2","y1","y2","onMouseover"],Es=["cx","cy","onMouseover"],Vs=["cx","cy","fill","onMouseover"],Ns=["x","y"],Ss={class:"dss-chart-data","clip-path":"url(#chart-clip)"},Bs={key:0},Ms=["d","onMouseover"],_s=["x","y","width","height","fill","onMouseover"],$s={class:"dss-line-chart"},Ts=["d","stroke","stroke-width"],Ls=["d","stroke","stroke-width","opacity"],Hs=["cx","cy","r","fill","onMouseover"],As={key:1},Ds=["d","stroke","stroke-width"],Rs=["d","stroke","stroke-width"],Fs=["d","stroke","stroke-width","opacity"],Is=["cx","cy","r","fill","onMouseover"],zs={key:2},Ps=["id"],Os=["x","y","width","height"],Zs=["d","fill","fill-opacity","mask"],Ws=["d","stroke","stroke-width"],qs=["d","fill","onMouseover"],Us=["x","y","width","height","onMouseover"],Xs={key:2,class:"dss-crosshair","clip-path":"url(#chart-clip)"},Ys=["x1","x2","y1","y2","stroke"],js=["cx","cy","r","fill"],Ks={key:1,class:"dss-bubble-chart"},Gs={key:0,class:"dss-bubble-group"},Qs=["cx","cy","r","fill","fill-opacity","stroke","onMouseenter","onMouseleave","onClick"],Js=["x","y","width","height","xlink:href","clip-path","onLoad","onError","onMouseenter","onMouseleave","onClick"],er=["transform"],tr=["cx","cy","r"],nr=["data-chart-type","clip-path"],lr=["d","fill","fill-opacity","stroke","stroke-width","clip-path","onMouseover"],or={key:1,class:"dss-radial-segment-data-labels"},ar=["x","y"],sr=["x","y","font-size","fill"],rr=["x1","y1","x2","y2","stroke"],ir=["x1","y1","x2","y2","stroke"],cr=["x","y","text-anchor","font-size"],ur=["transform"],dr={key:0,class:"dss-spider-grid"},mr=["cx","cy","r"],pr={class:"dss-spider-grid-labels"},fr=["x","y"],vr=["x","y"],gr=["x1","x2","y1","y2"],hr={class:"dss-spider-labels"},yr=["x","y","text-anchor","dominant-baseline"],Cr=["points","fill","fill-opacity","stroke","stroke-width"],kr=["cx","cy","r","fill","onMouseover"],br={class:"dss-chart-logos"},wr=["cx","cy","r","fill"],xr=["x","y","width","height","xlink:href","onLoad","onError","clip-path"],Er=["onClick","onMouseenter"],Vr=["src"],Nr={class:"dss-marker-tooltip-category"},Sr={key:0,class:"dss-marker-tooltip-description"},Br={key:0,class:"dss-tooltip-section"},Mr={key:0,class:"dss-tooltip-title"},_r={class:"dss-tooltip-series-name"},$r={class:"dss-tooltip-series-value"},Tr={key:1,class:"dss-tooltip-section"},Lr={key:0,class:"dss-tooltip-title"},Hr={class:"dss-bubble-tooltip-data"},Ar={key:2,class:"dss-tooltip-section"},Dr={class:"dss-tooltip-title"},Rr={class:"dss-tooltip-value"},Fr={key:0,class:"dss-tooltip-section"},Ir={class:"dss-tooltip-section-title"},zr={class:"dss-tooltip-group-header"},Pr={class:"dss-tooltip-item-content"},Or={class:"dss-tooltip-item-text"},Zr={key:1,class:"dss-tooltip-section"},Wr={class:"dss-tooltip-section-title"},qr={class:"dss-tooltip-item-content"},Ur={class:"dss-tooltip-item-title"},Xr={key:0,class:"dss-tooltip-item-description"},Yr={class:"dss-tooltip-section"},jr={class:"dss-tooltip-title"},Kr={key:0,class:"dss-bubble-tooltip-data"},Gr={class:"dss-tooltip-series-name"},Qr={class:"dss-tooltip-series-value"},Jr={key:0,class:"dss-tooltip-section"},ei={class:"dss-tooltip-section-title"},ti={class:"dss-tooltip-group-header"},ni={class:"dss-tooltip-item-content"},li={class:"dss-tooltip-item-text"},oi={key:1,class:"dss-tooltip-section"},ai={class:"dss-tooltip-section-title"},si={class:"dss-tooltip-item-content"},ri={class:"dss-tooltip-item-title"},ii={key:0,class:"dss-tooltip-item-description"},ci=["onClick","onMouseenter"],ui={class:"dss-legend-text"},di={key:1,class:"dss-context-menu-separator"},mi={key:0,class:"dss-context-menu-separator"},pi={key:0,class:"dss-context-menu-separator"},fi=["onClick"],vi=["innerHTML"],gi={key:0,class:"dss-context-menu-icon"},hi={class:"dss-marker-modal-header"},yi={class:"dss-marker-modal-body"},Ci={class:"dss-form-group"},ki={class:"dss-form-group"},bi={for:"dss-marker-description"},wi={key:0,class:"dss-form-text-display"},xi=["placeholder"],Ei={class:"dss-marker-modal-footer"},Vi={class:"modal-footer-left"},Ni={class:"dss-modal-footer-right"},Si=["disabled"],Bi={name:"DSSChart"},Mi=Object.assign(Bi,{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:F=>typeof F=="object"&&F!==null},innerSize:{type:Number,default:null},old:{type:Boolean,default:!1}},emits:["add-marker","update-marker","delete-marker"],setup(F,{emit:Ce}){const{t:z,locale:A}=lo.useI18n(),_e=Ce,k=e.ref(null),Le=e.ref(null),se=e.ref(null),pt=e.ref(0),p=e.ref(0);let ue=null,ve=null;const de=20,ee=e.computed(()=>{if(p.value,pt.value,!k.value||!Le.value)return 0;try{const t=k.value.getBoundingClientRect();return Le.value.getBoundingClientRect().top-t.top}catch{return 0}}),S=F,ne={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}},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},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 He(t,s){const n=Object.assign({},t);return Ie(t)&&Ie(s)&&Object.keys(s).forEach(i=>{Ie(s[i])?i in t?n[i]=He(t[i],s[i]):Object.assign(n,{[i]:s[i]}):Object.assign(n,{[i]:s[i]})}),n}const Ae=()=>{let t=20,s=0,n=0;if(St.value&&(t+=30),at.value&&(t+=25),Bt.value&&S.series.length>0){const i=S.series.filter((f,g)=>!Vt.value.has(g)).length;if(Xe.value==="top"||Xe.value==="bottom"){if(Zt.value==="horizontal"){const g=Math.floor(we.value/100);s=Math.ceil(i/g)*25+10}else s=i*25+10;t+=s}else n=150}return{height:t,legendHeight:s,legendWidth:n}};function Ie(t){return t&&typeof t=="object"&&!Array.isArray(t)}const O=e.computed(()=>He(ne,S.options)),rt=e.computed(()=>{const t=O.value;return t&&t.chart&&t.chart.width==="auto"}),Oe=e.computed(()=>{const t=O.value;return t&&t.chart&&t.chart.height==="auto"}),we=e.computed(()=>{const t=O.value;return rt.value?pt.value||800:t&&t.chart&&typeof t.chart.width=="number"?t.chart.width:800}),xt=e.ref(de),Tt=e.computed(()=>{if(Oe.value){const t=Tt.value;return t??Math.max(0,(p.value||400)-xt.value*5)}}),ut=e.computed(()=>{const t=O.value;if(Oe.value){const s=Tt.value;return s??Math.max(0,(p.value||400)-xt.value)}return t&&t.chart&&typeof t.chart.height=="number"?t.chart.height:400}),Ze=e.computed(()=>{if(Oe.value&&ge.value==="semi-radial"&&Tt.value!=null)return xt.value+ut.value+"px";if(Oe.value)return"100%";if(cn.value)return xt.value+ut.value+"px";if(Bt.value&&Xe.value==="bottom"){const t=Ae();return ut.value+(t.legendHeight||35)+"px"}return ut.value+(Bt.value?20:0)+"px"}),ge=e.computed(()=>{const t=O.value;return t&&t.chart&&t.chart.type?t.chart.type:"line"}),yt=e.computed(()=>{const t=S.series.map(s=>s.type||ge.value);return new Set(t).size>1}),St=e.computed(()=>{const t=O.value;return t&&t.title&&t.title.text?t.title.text:""}),at=e.computed(()=>{const t=O.value;return t&&t.subtitle&&t.subtitle.text?t.subtitle.text:""}),$t=e.computed(()=>{const t=O.value;if(!t||!t.zAxis)return"";const s=t.zAxis;return typeof s=="string"?s:s&&typeof s.label=="string"?s.label:""}),Ot=e.computed(()=>{const t=O.value;return t&&t.xAxis&&t.xAxis.title&&t.xAxis.title.text?t.xAxis.title.text:""}),on=e.computed(()=>{const t=O.value;return t&&t.yAxis&&t.yAxis.title&&t.yAxis.title.text?t.yAxis.title.text:""}),Et=e.computed(()=>{const t=O.value;if(!t||!t.yAxis)return Yn;const s=t.yAxis.min;return typeof s=="number"||s===Yn?s:Yn}),lt=e.computed(()=>{const t=O.value;if(!t||!t.yAxis)return Yn;const s=t.yAxis.max;return typeof s=="number"||s===Yn?s:Yn}),je=e.computed(()=>{const t=O.value;return!t||!t.xAxis?null:typeof t.xAxis.min=="number"?t.xAxis.min:null}),Dt=e.computed(()=>{const t=O.value;return!t||!t.xAxis?null:typeof t.xAxis.max=="number"?t.xAxis.max:null}),Lt=e.computed(()=>{const t=O.value;return t&&t.grid&&t.grid.show!==!1}),Bt=e.computed(()=>{const t=O.value;return t&&t.legend&&t.legend.show!==!1}),Xe=e.computed(()=>{const t=O.value;return t&&t.legend&&t.legend.position?t.legend.position:"top"}),Zt=e.computed(()=>{const t=O.value;return t&&t.legend&&t.legend.orientation?t.legend.orientation:"horizontal"}),Yt=e.computed(()=>{const t=O.value;return!t||!t.tooltip?!0:t.tooltip.enabled!==!1}),Ct=e.computed(()=>{const t=O.value;if(!t||!t.crosshair)return!1;const s=t.crosshair.show;return s===!0||s==="true"}),te=e.computed(()=>{const t=O.value;return t&&t.crosshair&&t.crosshair.color?t.crosshair.color:"#666"}),$e=e.computed(()=>{const t=O.value;return!t||!t.zoom?!1:t.zoom.enabled===!0}),fe=e.computed(()=>{const t=O.value;return t&&t.zoom&&typeof t.zoom.minScale=="number"?t.zoom.minScale:1}),Ne=e.computed(()=>{const t=O.value;return t&&t.zoom&&typeof t.zoom.maxScale=="number"?t.zoom.maxScale:2.5}),We=e.computed(()=>{const t=O.value;return t&&t.stroke&&typeof t.stroke.width=="number"?t.stroke.width:2}),ft=e.computed(()=>{if(!cn.value)return 0;const t=O.value;return t&&t.stroke&&typeof t.stroke.width=="number"?t.stroke.width:0}),qe=e.computed(()=>{const t=O.value;return t&&t.bubbles&&typeof t.bubbles.size=="number"?t.bubbles.size:4}),dt=e.computed(()=>{const{maxX:t}=Ut.value;return t===0}),xe=(t,s)=>dt.value&&s===0?5:s,Ue=t=>{const s=Number(t);return!Number.isFinite(s)||s<=0?0:s},X=e.computed(()=>{const t=O.value;return t&&t.fill&&t.fill.area&&typeof t.fill.area.opacity=="number"?t.fill.area.opacity:.3}),Z=e.computed(()=>{const t=O.value;return t&&t.smoothing&&t.smoothing.enabled===!0}),j=e.computed(()=>{const t=O.value;return t&&t.smoothing&&typeof t.smoothing.factor=="number"?t.smoothing.factor:.3}),ie=e.computed(()=>{const t=O.value;return Z.value?t&&t.smoothing&&typeof t.smoothing.barRadius=="number"?t.smoothing.barRadius:4:0}),E=e.computed(()=>{const t=O.value,s=t&&t.colors&&Array.isArray(t.colors)?t.colors:[];return s.length>0?s:["#3B82F6","#EF4444","#10B981","#F59E0B","#8B5CF6","#F97316","#06B6D4","#84CC16"]}),C=e.computed(()=>{const t=O.value;return t&&t.animations&&t.animations.enabled!==!1}),V=e.computed(()=>{const t=O.value;return t&&t.animations&&t.animations.type?t.animations.type:"draw"}),P=e.computed(()=>{const t=O.value;return t&&t.animations&&typeof t.animations.duration=="number"?t.animations.duration:2500}),U=e.computed(()=>{const t=O.value;return t&&t.animations&&typeof t.animations.delay=="number"?t.animations.delay:0}),ze=e.computed(()=>{const t=O.value;return t&&t.animations&&t.animations.easing?t.animations.easing:"ease-out"}),Re=e.computed(()=>{const t=O.value;return t&&t.animations&&typeof t.animations.staggerDelay=="number"?t.animations.staggerDelay:200}),De=e.computed(()=>{const t=O.value;return t&&t.animations&&t.animations.onDataChange!==!1}),re=e.computed(()=>{const t=O.value;return t&&t.animations&&t.animations.respectReducedMotion!==!1}),Ge=e.computed(()=>{const t=O.value;return t&&t.fill&&t.fill.spider&&typeof t.fill.spider.opacity=="number"?t.fill.spider.opacity:.15}),tt=e.computed(()=>O.value?.spider?.gridSteps||5),wt=e.computed(()=>{const t=[],s=tt.value;for(let n=1;n<=s;n++)t.push(it.value/s*n);return t}),vt=t=>{const s=Je.value;if(s&&Array.isArray(s)&&s[t]!==void 0)return s[t].toString();const n=wt.value[t];return Math.round(n/it.value*100)+"%"},Je=e.computed(()=>O.value?.spider?.gridLabels||null),vn=e.computed(()=>{const t=O.value;return t&&t.contextMenu&&t.contextMenu.enabled===!0}),jt=e.computed(()=>{const t=O.value,s={addMarker:!0,downloadSvg:!0,downloadPng:!0,downloadCsv:!0};return t&&t.contextMenu&&t.contextMenu.items?{...s,...t.contextMenu.items}:s}),Tn=e.computed(()=>{const t=O.value;return t&&t.contextMenu&&Array.isArray(t.contextMenu.customItems)?t.contextMenu.customItems:[]}),bn=e.computed(()=>{const t=O.value;return t&&t.markers&&t.markers.icon?t.markers.icon:dn.value}),Fn=e.computed(()=>{const t=O.value;return t&&t.markers&&t.markers.customIcons?t.markers.customIcons:{}}),Wt=e.computed(()=>{const t=O.value;return t&&t.markers&&typeof t.markers.iconSize=="number"?t.markers.iconSize:20}),In=e.computed(()=>{const s=O.value?.valueFormat?.extension;return typeof s=="string"?s:""}),an=t=>{const s=In.value;if(t==null)return"";const n=String(t);return s?n+s:n},qn=e.computed(()=>!G.value.isZooming);e.computed(()=>Mt.value.map(t=>{if(t.categoryIndex!==void 0&&(fn.value||zt.value)){const s=Ft(t.categoryIndex),n=ee.value+I.value.bottom-Wt.value/2;return{...t,x:s,y:n}}return t}));function cl(t,s){let n;if(t instanceof Date)n=new Date(t.getFullYear(),t.getMonth(),t.getDate());else if(typeof t=="string"){const[g,x,b]=t.split("-"),L=Number(b?.length===2?`20${b}`:b);n=new Date(L,Number(x)-1,Number(g))}else return 0;let i=0,f=1/0;return s.forEach((g,x)=>{const[b,L,T]=g.split("-"),H=Number(T?.length===2?`20${T}`:T),M=new Date(H,Number(L)-1,Number(b)),K=Math.abs(M-n);K<f&&(f=K,i=x)}),i}const D=e.computed(()=>{const t=S.markers.map(n=>{const i=cl(n.marker_date,S.categories),f=Ft(i),g=ee.value+I.value.bottom-Wt.value/2;return{...n,x:f,y:g,categoryIndex:i,source:"props"}}),s=Mt.value.map(n=>{if(n.categoryIndex!==void 0&&(fn.value||zt.value)){const i=Ft(n.categoryIndex),f=ee.value+I.value.bottom-Wt.value/2;return{...n,x:i,y:f,source:"internal"}}return{...n,source:"internal"}});return[...t,...s]}),q=e.computed(()=>{const t=O.value;return t&&t.watermark&&t.watermark.enabled===!0}),R=e.computed(()=>{const t=O.value;return t&&t.watermark&&typeof t.watermark.opacity=="number"?t.watermark.opacity:.05}),le=e.computed(()=>{const t=O.value;return t&&t.watermark&&t.watermark.size?t.watermark.size:35}),Me=e.computed(()=>{const t=O.value;return t&&t.watermark&&t.watermark.position?t.watermark.position:"bottom-right"}),nt=e.computed(()=>{const t={left:I.value.left,top:I.value.top,width:I.value.width,height:I.value.height};let s,n;const i=String(le.value);if(i.includes("%")){const f=parseFloat(i)/100;s=t.width*f,n=s*(96/499)}else{const f=parseFloat(i)||25;s=Math.min(t.width*.25,200)*(f/25),n=s*(96/499)}return{width:s,height:n,area:t}}),st=e.computed(()=>{const{width:t,height:s}=nt.value,n=Me.value;let i,f;const g=I.value.left,x=I.value.right,b=I.value.top,L=I.value.bottom,T=I.value.width,H=I.value.height;switch(n){case"center":i=g+(T-t)/2,f=b+(H-s)/2;break;case"top-left":i=g+15,f=b+5;break;case"top-right":i=x-t-15,f=b+5;break;case"bottom-left":i=g+15,f=L-s-5;break;case"bottom-right":default:i=x-t-15,f=L-s-5;break}return{backgroundPositionX:i+"px",backgroundPositionY:f+"px",backgroundSize:`${t}px ${s}px`}}),Qe=t=>!S.flags||!S.flags.length?[]:S.flags.filter(s=>s.categoryIndex===t),Ke=t=>{const s=Qe(t),n=Vn(t),i=s.filter(x=>x.manual),f=s.filter(x=>!x.manual),g=[];return i.length>0&&g.push({type:z("chart.tooltip.manualFlags"),color:"#047395",flags:i.map(x=>({text:x.text,color:"#047395"}))}),f.length>0&&g.push({type:z("chart.tooltip.autoFlags"),color:"#0dbf89",flags:f.map(x=>({text:x.text,color:"#0dbf89"}))}),{flagGroups:g,markers:n.map(x=>({title:x.title,description:x.description,type:z("chart.tooltip.markers"),color:x.color||"#FF6B6B"}))}},dn=e.computed(()=>{const t=S.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"),lo=require("vue-i18n"),ea={key:0,class:"dss-datepicker__input-wrap dss-datepicker__input-wrap--readonly"},ta=["value"],na=["placeholder","value","disabled"],la=["placeholder","value"],oa={key:0,class:"dss-datepicker__double-wrap"},aa={key:0,class:"dss-datepicker__quick-select","aria-label":"Quick range"},sa=["onClick"],ra={class:"dss-datepicker__double-calendars"},ia={class:"dss-datepicker__double-calendar"},ca={class:"dss-datepicker__calendar-header"},ua=["aria-label"],da={class:"dss-datepicker__month-year-row"},ma=["aria-label"],pa={class:"dss-datepicker__weekdays"},fa={class:"dss-datepicker__grid"},va=["disabled","onClick","onMouseenter"],ga={key:1,class:"dss-datepicker__day dss-datepicker__day--empty"},ha={class:"dss-datepicker__double-calendar"},ya={class:"dss-datepicker__calendar-header"},Ca=["aria-label"],ka={class:"dss-datepicker__month-year-row"},ba=["aria-label"],wa={class:"dss-datepicker__weekdays"},xa={class:"dss-datepicker__grid"},Ea=["disabled","onClick","onMouseenter"],Va={key:1,class:"dss-datepicker__day dss-datepicker__day--empty"},Na={class:"dss-datepicker__calendar-header"},Sa=["aria-label"],Ba={class:"dss-datepicker__month-year-row"},Ma=["aria-label"],_a={class:"dss-datepicker__weekdays"},$a={class:"dss-datepicker__grid"},Ta=["disabled","onClick","onMouseenter"],La={key:1,class:"dss-datepicker__day dss-datepicker__day--empty"},Ha={class:"dss-datepicker__calendar-header"},Aa={class:"dss-datepicker__month-year-row"},Da={class:"dss-datepicker__month-year dss-datepicker__month-year--static"},Ra={class:"dss-datepicker__months-grid"},Fa=["onClick"],Ia={class:"dss-datepicker__calendar-header dss-datepicker__calendar-header--center"},za={class:"dss-datepicker__month-year"},Pa={class:"dss-datepicker__years-grid"},Oa=["data-year","onClick"],Uo=27,zo={__name:"DSSDatepicker",props:{mode:{type:String,default:"single",validator:F=>["single","range","singleFromAvailable","rangeFromAvailable","readonly"].includes(F)},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}},emits:["update:modelValue"],setup(F,{emit:Ce}){const z=F,A=Ce,{t:_e,locale:k}=lo.useI18n(),$e=e.ref(!1),se=e.ref("days"),pt=new Date,p=e.computed(()=>z.minDate instanceof Date?z.minDate:pt),ue=e.ref(p.value.getMonth()),ve=e.ref(p.value.getFullYear()),de=e.ref(p.value.getMonth()),ee=e.ref(p.value.getFullYear()),S=e.ref(p.value.getMonth()),ne=e.ref(p.value.getFullYear()),He=e.ref("start"),Ae=e.ref(null),Ie=e.ref(null);function O(){const D=p.value,q=D.getMonth(),R=D.getFullYear(),le=q===11?0:q+1,Me=q===11?R+1:R;return{left:{month:q,year:R},right:{month:le,year:Me}}}const rt=e.ref(null),Oe=e.ref(null),we=e.ref(null),xt=e.ref(null),Tt=e.ref(null),ut=e.ref(null),Ze=new Date().getFullYear(),ge=e.computed(()=>["single","singleFromAvailable"].includes(z.mode)),yt=e.computed(()=>["range","rangeFromAvailable"].includes(z.mode)),St=e.computed(()=>{if(z.mode!=="single"&&z.mode!=="singleFromAvailable")return null;const D=z.modelValue;return D instanceof Date?D:null}),at=e.computed(()=>{if(!yt.value)return{start:null,end:null};const D=z.modelValue;return!D||typeof D!="object"?{start:null,end:null}:{start:D.start instanceof Date?D.start:null,end:D.end instanceof Date?D.end:null}});function $t(D){if(!D||!(D instanceof Date))return"";const q=D.getDate(),R=D.getMonth()+1,le=D.getFullYear(),Me=nt=>String(nt).padStart(2,"0");return`${Me(q)}/${Me(R)}/${le}`}const Ot=e.computed(()=>$t(St.value)),on=e.computed(()=>{const{start:D,end:q}=at.value;if(!D&&!q)return"";const R=!q||D&&D<=q?D:q,le=!D||q&&q>=D?q:D;return X(R,le)?$t(R):`${$t(R)} - ${$t(le)}`}),Et=e.computed(()=>{if(z.mode!=="readonly")return"—";const D=z.modelValue;if(D instanceof Date)return $t(D)||"—";if(D&&typeof D=="object"&&("start"in D||"end"in D)){const q=D.start instanceof Date?D.start:null,R=D.end instanceof Date?D.end:null;if(!q&&!R)return"—";const le=!R||q&&q<=R?q:R,Me=!q||R&&R>=q?R:q;return X(le,Me)?$t(le):`${$t(le)} - ${$t(Me)}`}return"—"});e.computed(()=>{const D=new Date(ve.value,ue.value,1);return new Intl.DateTimeFormat(k.value,{month:"long",year:"numeric"}).format(D)});const lt=e.computed(()=>Ie.value==="left"?de.value:Ie.value==="right"?S.value:ue.value),je=e.computed(()=>Ie.value==="left"?ee.value:Ie.value==="right"?ne.value:ve.value),Dt=e.computed(()=>{const D=new Date(ve.value,ue.value,1);return new Intl.DateTimeFormat(k.value,{month:"long"}).format(D)}),Lt=e.computed(()=>{const D=new Date(je.value,lt.value,1);return new Intl.DateTimeFormat(k.value,{month:"long"}).format(D)}),Bt=e.computed(()=>{const D=new Intl.DateTimeFormat(k.value,{month:"short"});return Array.from({length:12},(q,R)=>D.format(new Date(2024,R,1)))}),Xe=e.computed(()=>{const q=(Ie.value?je.value:ve.value)-Math.floor(Uo/2);return Array.from({length:Uo},(R,le)=>q+le)}),Zt=e.computed(()=>{const D=Xe.value;return D.length?`${D[0]} – ${D[D.length-1]}`:""}),Yt=e.computed(()=>{const D=new Intl.DateTimeFormat(k.value,{weekday:"short"}),q=new Date(2024,0,1),R=[];for(let le=0;le<7;le++){const Me=new Date(q);Me.setDate(q.getDate()+le),R.push(D.format(Me).slice(0,2))}return R});function Ct(D,q){const R=new Date(D,q,1),le=new Date(D,q+1,0),Me=R.getDay(),nt=le.getDate(),st=[];for(let Qe=0;Qe<Me;Qe++)st.push(null);for(let Qe=1;Qe<=nt;Qe++)st.push(new Date(D,q,Qe));return st}const te=e.computed(()=>Ct(ve.value,ue.value)),Te=e.computed(()=>Ct(ee.value,de.value)),fe=e.computed(()=>Ct(ne.value,S.value));e.computed(()=>{const D=new Date(ee.value,de.value,1);return new Intl.DateTimeFormat(k.value,{month:"long",year:"numeric"}).format(D)}),e.computed(()=>{const D=new Date(ne.value,S.value,1);return new Intl.DateTimeFormat(k.value,{month:"long",year:"numeric"}).format(D)});const Ne=e.computed(()=>{const D=new Date(ee.value,de.value,1);return new Intl.DateTimeFormat(k.value,{month:"long"}).format(D)}),We=e.computed(()=>{const D=new Date(ne.value,S.value,1);return new Intl.DateTimeFormat(k.value,{month:"long"}).format(D)}),ft=e.computed(()=>z.availableDates&&z.availableDates.length>0),qe=e.computed(()=>ft.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"}]),dt=e.ref({top:0,left:0});function xe(){if(!xt.value||!$e.value)return;const D=xt.value.getBoundingClientRect(),q=window.innerWidth||document.documentElement.clientWidth,R=window.innerHeight||document.documentElement.clientHeight;let le=D.left,Me=D.bottom+4;const nt=Tt.value;if(nt){const st=nt.offsetWidth,Qe=nt.offsetHeight;if(le+st>q-8&&(le=D.right-st,le<8&&(le=8)),Me+Qe>R-8){const Ke=D.top-4-Qe;Ke>=8?Me=Ke:Me=Math.max(8,R-Qe-8)}}dt.value={top:Me,left:le}}const Ue=e.computed(()=>!xt.value||!$e.value?{}:{position:"fixed",left:`${dt.value.left}px`,top:`${dt.value.top}px`,zIndex:1002});function X(D,q){return!D||!q?!1:D.getFullYear()===q.getFullYear()&&D.getMonth()===q.getMonth()&&D.getDate()===q.getDate()}function Z(D){return new Date(D.getFullYear(),D.getMonth(),D.getDate()).getTime()}function j(D){return!z.availableDates||!z.availableDates.length?!0:z.availableDates.some(q=>q instanceof Date&&X(q,D))}function ie(D){const q=Z(D);return!(z.minDate instanceof Date&&q<Z(z.minDate)||z.maxDate instanceof Date&&q>Z(z.maxDate))}function E(D){return!z.exceptDates||!z.exceptDates.length?!1:z.exceptDates.some(q=>q instanceof Date&&X(q,D))}function C(D){return E(D)?!1:["singleFromAvailable","rangeFromAvailable"].includes(z.mode)?j(D):ie(D)}function V(D){const q=St.value,R=at.value,le=Z(D),Me=yt.value&&R.start&&R.end&&le>Z(R.start)&&le<Z(R.end),nt=yt.value&&R.start&&X(D,R.start),st=yt.value&&R.end&&X(D,R.end),Qe=nt&&st,Ke=ge.value&&q&&X(D,q)||nt||st;let dn=!1;if(yt.value&&R.start&&!R.end&&Ae.value){const Ln=Z(R.start),tn=Z(Ae.value),Hn=Math.min(Ln,tn),wn=Math.max(Ln,tn);dn=le>Hn&&le<wn}return{"dss-datepicker__day--selected":Ke&&!Qe,"dss-datepicker__day--range-start":nt&&!Qe,"dss-datepicker__day--range-end":st&&!Qe,"dss-datepicker__day--range-single":Qe,"dss-datepicker__day--in-range":Me&&!nt&&!st,"dss-datepicker__day--in-range-preview":dn&&!nt&&!st&&!Me,"dss-datepicker__day--disabled":!C(D)}}function P(D){if(!yt.value)return;const q=at.value;if(!q.start||q.end){Ae.value=null;return}if(!C(D)){Ae.value=null;return}Ae.value=new Date(D.getFullYear(),D.getMonth(),D.getDate())}function U(){Ae.value=null}function ze(){if(!z.doubleCalendar||!yt.value)return;const D=at.value,{start:q,end:R}=D;if(q&&R){const nt=q<=R?q:R,st=q<=R?R:q,Qe=nt.getMonth(),Ke=nt.getFullYear(),dn=st.getMonth(),Ln=st.getFullYear();if(Qe!==dn||Ke!==Ln){const tn=de.value===Qe&&ee.value===Ke,Hn=S.value===dn&&ne.value===Ln;if(tn&&Hn)return;de.value=Qe,ee.value=Ke,S.value=dn,ne.value=Ln}else{const tn=Qe===0?11:Qe-1,Hn=Qe===0?Ke-1:Ke;de.value===tn&&ee.value===Hn&&S.value===Qe&&ne.value===Ke||(de.value=Qe,ee.value=Ke,Qe===11?(S.value=0,ne.value=Ke+1):(S.value=Qe+1,ne.value=Ke))}return}const le=q||R;if(le){const nt=le.getMonth(),st=le.getFullYear(),Qe=de.value===nt&&ee.value===st,Ke=S.value===nt&&ne.value===st;if(Qe||Ke)return;de.value=nt,ee.value=st,nt===11?(S.value=0,ne.value=st+1):(S.value=nt+1,ne.value=st);return}const Me=O();de.value=Me.left.month,ee.value=Me.left.year,S.value=Me.right.month,ne.value=Me.right.year}function Re(D="start"){if(z.mode==="readonly")return;He.value=D;const q=St.value,R=at.value;if(ge.value&&q)ue.value=q.getMonth(),ve.value=q.getFullYear();else if(yt.value)if(z.doubleCalendar)ze();else{const le=D==="start"&&R.start?R.start:R.end||R.start;le&&(ue.value=le.getMonth(),ve.value=le.getFullYear())}xt.value=ge.value?rt.value?.closest(".dss-datepicker__input-wrap"):Oe.value,se.value="days",Ie.value=null,$e.value=!0,e.nextTick(()=>{xe()})}function De(){se.value="days",Ie.value=null,Ae.value=null,$e.value=!1}function re(D,q){Ie.value=D,se.value=q}function Ge(){se.value="days",Ie.value=null}function tt(D){const q=new Date,R=q.getFullYear(),le=q.getMonth(),Me=q.getDate();let nt,st;if(ft.value){const Qe=[...z.availableDates].filter(Ke=>Ke instanceof Date).map(Ke=>new Date(Ke.getFullYear(),Ke.getMonth(),Ke.getDate()));if(Qe.sort((Ke,dn)=>Ke.getTime()-dn.getTime()),Qe.length===0)return;if(D==="all")nt=Qe[0],st=Qe[Qe.length-1];else{const Ke=parseInt(D.replace("last",""),10);if(Ke<2||Ke>5)return;const dn=Qe.slice(-Ke);nt=dn[0],st=dn[dn.length-1]}}else{const Qe=new Date(R,le,Me);switch(D){case"today":nt=Qe,st=Qe;break;case"lastWeek":nt=new Date(R,le,Me-6),st=Qe;break;case"last15Days":nt=new Date(R,le,Me-14),st=Qe;break;case"last30Days":nt=new Date(R,le,Me-29),st=Qe;break;case"thisMonth":nt=new Date(R,le,1),st=Qe;break;case"last3Months":nt=new Date(R,le-3,1),st=new Date(R,le,0);break;case"last6Months":nt=new Date(R,le-6,1),st=new Date(R,le,0);break;case"last12Months":nt=new Date(R,le-12,1),st=new Date(R,le,0);break;case"lastYear":nt=new Date(R-1,0,1),st=new Date(R-1,11,31);break;default:return}}A("update:modelValue",{start:nt,end:st}),ze()}function wt(D){Ie.value==="left"?de.value=D:Ie.value==="right"?S.value=D:ue.value=D,Ge()}function vt(D){Ie.value==="left"?ee.value=D:Ie.value==="right"?ne.value=D:ve.value=D,Ge()}function Je(){ue.value===0?(ue.value=11,ve.value--):ue.value--}function vn(){ue.value===11?(ue.value=0,ve.value++):ue.value++}function jt(){de.value===0?(de.value=11,ee.value--):de.value--}function Tn(){de.value===11?(de.value=0,ee.value++):de.value++}function bn(){S.value===0?(S.value=11,ne.value--):S.value--}function Fn(){S.value===11?(S.value=0,ne.value++):S.value++}function Wt(D){if(!C(D))return;const q=new Date(D.getFullYear(),D.getMonth(),D.getDate());if(ge.value){A("update:modelValue",q),De();return}const R=at.value;if(!R.start&&!R.end){A("update:modelValue",{start:q,end:null}),He.value="end";return}if(R.start&&R.end){A("update:modelValue",{start:q,end:null}),He.value="end";return}if(He.value==="start"){let le=q,Me=R.end;le&&Me&&le>Me&&([le,Me]=[Me,le]),A("update:modelValue",{start:le||Me,end:Me||le}),He.value="end"}else{let le=R.start,Me=q;le&&Me&&Me<le&&([le,Me]=[Me,le]),A("update:modelValue",{start:le||Me,end:Me||le}),He.value="start"}}e.watch(at,()=>{z.doubleCalendar&&yt.value&&$e.value&&ze()},{deep:!0});let In=null,an=null,qn=null;function cl(){In&&(document.removeEventListener("keydown",In),In=null),an&&(window.removeEventListener("resize",an),an=null),qn&&(window.removeEventListener("scroll",qn,!0),qn=null)}return e.watch(se,D=>{D==="years"&&e.nextTick(()=>{ut.value?.querySelector(`[data-year="${je.value}"]`)?.scrollIntoView({block:"center",behavior:"auto"})})}),e.watch($e,D=>{cl(),D&&(In=q=>{q.key==="Escape"&&(se.value==="years"||se.value==="months"?Ge():De())},an=()=>{xe()},qn=()=>{xe()},document.addEventListener("keydown",In),window.addEventListener("resize",an),window.addEventListener("scroll",qn,!0))}),e.onBeforeUnmount(()=>{cl()}),(D,q)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-datepicker",{"dss-datepicker--readonly":F.mode==="readonly"}])},[F.mode==="readonly"?(e.openBlock(),e.createElementBlock("div",ea,[q[10]||(q[10]=e.createElementVNode("span",{class:"dss-datepicker__icon","aria-hidden":"true"},[e.createElementVNode("svg",{class:"dss-datepicker__icon-svg",width:"24",height:"24",viewBox:"0 0 256 256",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[e.createElementVNode("path",{d:"M208,32H184V24a8,8,0,0,0-16,0v8H88V24a8,8,0,0,0-16,0v8H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32Zm0,48H48V48H72v8a8,8,0,0,0,16,0V48h80v8a8,8,0,0,0,16,0V48h24Z"})])],-1)),e.createElementVNode("input",{type:"text",class:"dss-datepicker__input",value:Et.value,readonly:"",disabled:"",tabindex:"-1"},null,8,ta)])):ge.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-datepicker__input-wrap",onClick:q[0]||(q[0]=R=>Re("start"))},[q[11]||(q[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:rt,type:"text",class:"dss-datepicker__input",placeholder:e.unref(_e)("datepicker.selectDate"),value:Ot.value,readonly:"",disabled:F.mode==="readonly"},null,8,na)])):yt.value?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-datepicker__input-wrap",ref_key:"inputRangeWrapRef",ref:Oe,onClick:q[1]||(q[1]=R=>Re("start"))},[q[12]||(q[12]=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:we,type:"text",class:"dss-datepicker__input",placeholder:e.unref(_e)("datepicker.selectRange"),value:on.value,readonly:""},null,8,la)],512)):e.createCommentVNode("",!0),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[$e.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-datepicker__overlay",onClick:e.withModifiers(De,["self"])},[e.createElementVNode("div",{ref_key:"dropdownRef",ref:Tt,class:e.normalizeClass(["dss-datepicker__dropdown",{"dss-datepicker__dropdown--double":F.doubleCalendar&&yt.value&&se.value==="days","dss-datepicker__dropdown--quick-select":F.doubleCalendar&&yt.value&&se.value==="days"&&F.quickSelect}]),onClick:q[9]||(q[9]=e.withModifiers(()=>{},["stop"])),style:e.normalizeStyle(Ue.value)},[se.value==="days"&&F.doubleCalendar&&yt.value?(e.openBlock(),e.createElementBlock("div",oa,[F.quickSelect?(e.openBlock(),e.createElementBlock("nav",aa,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(qe.value,R=>(e.openBlock(),e.createElementBlock("button",{key:R.id,type:"button",class:"dss-datepicker__quick-select-btn",onClick:le=>tt(R.id)},e.toDisplayString(e.unref(_e)(R.labelKey)),9,sa))),128))])):e.createCommentVNode("",!0),e.createElementVNode("div",ra,[e.createElementVNode("div",ia,[e.createElementVNode("div",ca,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(_e)("datepicker.prevMonth"),onClick:jt}," ‹ ",8,ua),e.createElementVNode("div",da,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:q[2]||(q[2]=R=>re("left","months"))},e.toDisplayString(Ne.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:q[3]||(q[3]=R=>re("left","years"))},e.toDisplayString(ee.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(_e)("datepicker.nextMonth"),onClick:Tn}," › ",8,ma)]),e.createElementVNode("div",pa,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Yt.value,R=>(e.openBlock(),e.createElementBlock("span",{key:R,class:"dss-datepicker__weekday"},e.toDisplayString(R),1))),128))]),e.createElementVNode("div",fa,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Te.value,(R,le)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"L-"+le},[R?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-datepicker__day",V(R)]),disabled:!C(R),onClick:Me=>Wt(R),onMouseenter:Me=>P(R),onMouseleave:U},e.toDisplayString(R.getDate()),43,va)):(e.openBlock(),e.createElementBlock("span",ga))],64))),128))])]),e.createElementVNode("div",ha,[e.createElementVNode("div",ya,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(_e)("datepicker.prevMonth"),onClick:bn}," ‹ ",8,Ca),e.createElementVNode("div",ka,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:q[4]||(q[4]=R=>re("right","months"))},e.toDisplayString(We.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:q[5]||(q[5]=R=>re("right","years"))},e.toDisplayString(ne.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(_e)("datepicker.nextMonth"),onClick:Fn}," › ",8,ba)]),e.createElementVNode("div",wa,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Yt.value,R=>(e.openBlock(),e.createElementBlock("span",{key:R,class:"dss-datepicker__weekday"},e.toDisplayString(R),1))),128))]),e.createElementVNode("div",xa,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(fe.value,(R,le)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"R-"+le},[R?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-datepicker__day",V(R)]),disabled:!C(R),onClick:Me=>Wt(R),onMouseenter:Me=>P(R),onMouseleave:U},e.toDisplayString(R.getDate()),43,Ea)):(e.openBlock(),e.createElementBlock("span",Va))],64))),128))])])])])):se.value==="days"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",Na,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(_e)("datepicker.prevMonth"),onClick:Je}," ‹ ",8,Sa),e.createElementVNode("div",Ba,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:q[6]||(q[6]=R=>se.value="months")},e.toDisplayString(Dt.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:q[7]||(q[7]=R=>se.value="years")},e.toDisplayString(ve.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(_e)("datepicker.nextMonth"),onClick:vn}," › ",8,Ma)]),e.createElementVNode("div",_a,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Yt.value,R=>(e.openBlock(),e.createElementBlock("span",{key:R,class:"dss-datepicker__weekday"},e.toDisplayString(R),1))),128))]),e.createElementVNode("div",$a,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(te.value,(R,le)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:le},[R?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-datepicker__day",V(R)]),disabled:!C(R),onClick:Me=>Wt(R),onMouseenter:Me=>P(R),onMouseleave:U},e.toDisplayString(R.getDate()),43,Ta)):(e.openBlock(),e.createElementBlock("span",La))],64))),128))])],64)):se.value==="months"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createElementVNode("div",Ha,[e.createElementVNode("div",Aa,[e.createElementVNode("span",Da,e.toDisplayString(Lt.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:q[8]||(q[8]=R=>se.value="years")},e.toDisplayString(je.value),1)])]),e.createElementVNode("div",Ra,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Bt.value,(R,le)=>(e.openBlock(),e.createElementBlock("button",{key:le,type:"button",class:e.normalizeClass(["dss-datepicker__month-cell",{"dss-datepicker__month-cell--selected":le===lt.value}]),onClick:Me=>wt(le)},e.toDisplayString(R),11,Fa))),128))])],64)):se.value==="years"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.createElementVNode("div",Ia,[e.createElementVNode("span",za,e.toDisplayString(Zt.value),1)]),e.createElementVNode("div",{class:"dss-datepicker__years-wrap",ref_key:"yearsWrapRef",ref:ut},[e.createElementVNode("div",Pa,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Xe.value,R=>(e.openBlock(),e.createElementBlock("button",{key:R,type:"button",class:e.normalizeClass(["dss-datepicker__year-cell",{"dss-datepicker__year-cell--selected":R===je.value,"dss-datepicker__year-cell--current":R===e.unref(Ze)}]),"data-year":R,onClick:le=>vt(R)},e.toDisplayString(R),11,Oa))),128))])],512)],64)):e.createCommentVNode("",!0)],6)])):e.createCommentVNode("",!0)]))],2))}},Za=["data-chart-type"],Wa={class:"dss-chart-header-titles"},qa={key:0,class:"dss-chart-title"},Ua={key:1,class:"dss-chart-subtitle"},Xa=["onClick","onMouseenter"],Ya={class:"dss-legend-text"},ja=["onClick","onMouseenter"],Ka={class:"dss-legend-text"},Ga=["title"],Qa=["src"],Ja={class:"dss-chart-area-wrapper"},es={key:0,class:"dss-chart-z-axis-label"},ts=["width","height","data-smooth","data-animated"],ns={id:"chart-clip"},ls=["y","width","height"],os=["id"],as=["d"],ss=["id"],rs=["d"],is={key:0},cs={key:0,class:"dss-grid-lines","clip-path":"url(#chart-clip)"},us=["x1","x2","y1","y2"],ds={class:"dss-axes"},ms=["x1","x2","y1","y2"],ps=["x1","x2","y1","y2"],fs={class:"dss-axis-labels"},vs=["x","y"],gs=["x","y"],hs=["x","y"],ys=["y","transform"],Cs={key:1,class:"dss-flag-markers"},ks={"clip-path":"url(#chart-clip)"},bs=["x1","x2","y1","y2","onMouseover"],ws=["x1","x2","y1","y2","onMouseover"],xs=["x1","x2","y1","y2","onMouseover"],Es=["cx","cy","onMouseover"],Vs=["cx","cy","fill","onMouseover"],Ns=["x","y"],Ss={class:"dss-chart-data","clip-path":"url(#chart-clip)"},Bs={key:0},Ms=["d","onMouseover"],_s=["x","y","width","height","fill","onMouseover"],$s={class:"dss-line-chart"},Ts=["d","stroke","stroke-width"],Ls=["d","stroke","stroke-width","opacity"],Hs=["cx","cy","r","fill","onMouseover"],As={key:1},Ds=["d","stroke","stroke-width"],Rs=["d","stroke","stroke-width"],Fs=["d","stroke","stroke-width","opacity"],Is=["cx","cy","r","fill","onMouseover"],zs={key:2},Ps=["id"],Os=["x","y","width","height"],Zs=["d","fill","fill-opacity","mask"],Ws=["d","stroke","stroke-width"],qs=["d","fill","onMouseover"],Us=["x","y","width","height","onMouseover"],Xs={key:2,class:"dss-crosshair","clip-path":"url(#chart-clip)"},Ys=["x1","x2","y1","y2","stroke"],js=["cx","cy","r","fill"],Ks={key:1,class:"dss-bubble-chart"},Gs={key:0,class:"dss-bubble-group"},Qs=["cx","cy","r","fill","fill-opacity","stroke","onMouseenter","onMouseleave","onClick"],Js=["x","y","width","height","xlink:href","clip-path","onLoad","onError","onMouseenter","onMouseleave","onClick"],er=["transform"],tr=["cx","cy","r"],nr=["data-chart-type","clip-path"],lr=["d","fill","fill-opacity","stroke","stroke-width","clip-path","onMouseover"],or={key:1,class:"dss-radial-segment-data-labels"},ar=["x","y"],sr=["x","y","font-size","fill"],rr=["x1","y1","x2","y2","stroke"],ir=["x1","y1","x2","y2","stroke"],cr=["x","y","text-anchor","font-size"],ur=["transform"],dr={key:0,class:"dss-spider-grid"},mr=["cx","cy","r"],pr={class:"dss-spider-grid-labels"},fr=["x","y"],vr=["x","y"],gr=["x1","x2","y1","y2"],hr={class:"dss-spider-labels"},yr=["x","y","text-anchor","dominant-baseline"],Cr=["points","fill","fill-opacity","stroke","stroke-width"],kr=["cx","cy","r","fill","onMouseover"],br={class:"dss-chart-logos"},wr=["cx","cy","r","fill"],xr=["x","y","width","height","xlink:href","onLoad","onError","clip-path"],Er=["onClick","onMouseenter"],Vr=["src"],Nr={class:"dss-marker-tooltip-category"},Sr={key:0,class:"dss-marker-tooltip-description"},Br={key:0,class:"dss-tooltip-section"},Mr={key:0,class:"dss-tooltip-title"},_r={class:"dss-tooltip-series-name"},$r={class:"dss-tooltip-series-value"},Tr={key:1,class:"dss-tooltip-section"},Lr={key:0,class:"dss-tooltip-title"},Hr={class:"dss-bubble-tooltip-data"},Ar={key:2,class:"dss-tooltip-section"},Dr={class:"dss-tooltip-title"},Rr={class:"dss-tooltip-value"},Fr={key:0,class:"dss-tooltip-section"},Ir={class:"dss-tooltip-section-title"},zr={class:"dss-tooltip-group-header"},Pr={class:"dss-tooltip-item-content"},Or={class:"dss-tooltip-item-text"},Zr={key:1,class:"dss-tooltip-section"},Wr={class:"dss-tooltip-section-title"},qr={class:"dss-tooltip-item-content"},Ur={class:"dss-tooltip-item-title"},Xr={key:0,class:"dss-tooltip-item-description"},Yr={class:"dss-tooltip-section"},jr={class:"dss-tooltip-title"},Kr={key:0,class:"dss-bubble-tooltip-data"},Gr={class:"dss-tooltip-series-name"},Qr={class:"dss-tooltip-series-value"},Jr={key:0,class:"dss-tooltip-section"},ei={class:"dss-tooltip-section-title"},ti={class:"dss-tooltip-group-header"},ni={class:"dss-tooltip-item-content"},li={class:"dss-tooltip-item-text"},oi={key:1,class:"dss-tooltip-section"},ai={class:"dss-tooltip-section-title"},si={class:"dss-tooltip-item-content"},ri={class:"dss-tooltip-item-title"},ii={key:0,class:"dss-tooltip-item-description"},ci=["onClick","onMouseenter"],ui={class:"dss-legend-text"},di={key:1,class:"dss-context-menu-separator"},mi={key:0,class:"dss-context-menu-separator"},pi={key:0,class:"dss-context-menu-separator"},fi=["onClick"],vi=["innerHTML"],gi={key:0,class:"dss-context-menu-icon"},hi={class:"dss-marker-modal-header"},yi={class:"dss-marker-modal-body"},Ci={class:"dss-form-group"},ki={class:"dss-form-group"},bi={for:"dss-marker-description"},wi={key:0,class:"dss-form-text-display"},xi=["placeholder"],Ei={class:"dss-marker-modal-footer"},Vi={class:"modal-footer-left"},Ni={class:"dss-modal-footer-right"},Si=["disabled"],Bi={name:"DSSChart"},Mi=Object.assign(Bi,{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:F=>typeof F=="object"&&F!==null},innerSize:{type:Number,default:null},old:{type:Boolean,default:!1}},emits:["add-marker","update-marker","delete-marker"],setup(F,{emit:Ce}){const{t:z,locale:A}=lo.useI18n(),_e=Ce,k=e.ref(null),$e=e.ref(null),se=e.ref(null),pt=e.ref(0),p=e.ref(0);let ue=null,ve=null;const de=20,ee=e.computed(()=>{if(p.value,pt.value,!k.value||!$e.value)return 0;try{const t=k.value.getBoundingClientRect();return $e.value.getBoundingClientRect().top-t.top}catch{return 0}}),S=F,ne={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}},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},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 He(t,s){const n=Object.assign({},t);return Ie(t)&&Ie(s)&&Object.keys(s).forEach(i=>{Ie(s[i])?i in t?n[i]=He(t[i],s[i]):Object.assign(n,{[i]:s[i]}):Object.assign(n,{[i]:s[i]})}),n}const Ae=()=>{let t=20,s=0,n=0;if(St.value&&(t+=30),at.value&&(t+=25),Bt.value&&S.series.length>0){const i=S.series.filter((f,g)=>!Vt.value.has(g)).length;if(Xe.value==="top"||Xe.value==="bottom"){if(Zt.value==="horizontal"){const g=Math.floor(we.value/100);s=Math.ceil(i/g)*25+10}else s=i*25+10;t+=s}else n=150}return{height:t,legendHeight:s,legendWidth:n}};function Ie(t){return t&&typeof t=="object"&&!Array.isArray(t)}const O=e.computed(()=>He(ne,S.options)),rt=e.computed(()=>{const t=O.value;return t&&t.chart&&t.chart.width==="auto"}),Oe=e.computed(()=>{const t=O.value;return t&&t.chart&&t.chart.height==="auto"}),we=e.computed(()=>{const t=O.value;return rt.value?pt.value||800:t&&t.chart&&typeof t.chart.width=="number"?t.chart.width:800}),xt=e.ref(de),Tt=e.computed(()=>{if(Oe.value){const t=Tt.value;return t??Math.max(0,(p.value||400)-xt.value*5)}}),ut=e.computed(()=>{const t=O.value;if(Oe.value){const s=Tt.value;return s??Math.max(0,(p.value||400)-xt.value)}return t&&t.chart&&typeof t.chart.height=="number"?t.chart.height:400}),Ze=e.computed(()=>{if(Oe.value&&ge.value==="semi-radial"&&Tt.value!=null)return xt.value+ut.value+"px";if(Oe.value)return"100%";if(cn.value)return xt.value+ut.value+"px";if(Bt.value&&Xe.value==="bottom"){const t=Ae();return ut.value+(t.legendHeight||35)+"px"}return ut.value+(Bt.value?20:0)+"px"}),ge=e.computed(()=>{const t=O.value;return t&&t.chart&&t.chart.type?t.chart.type:"line"}),yt=e.computed(()=>{const t=S.series.map(s=>s.type||ge.value);return new Set(t).size>1}),St=e.computed(()=>{const t=O.value;return t&&t.title&&t.title.text?t.title.text:""}),at=e.computed(()=>{const t=O.value;return t&&t.subtitle&&t.subtitle.text?t.subtitle.text:""}),$t=e.computed(()=>{const t=O.value;if(!t||!t.zAxis)return"";const s=t.zAxis;return typeof s=="string"?s:s&&typeof s.label=="string"?s.label:""}),Ot=e.computed(()=>{const t=O.value;return t&&t.xAxis&&t.xAxis.title&&t.xAxis.title.text?t.xAxis.title.text:""}),on=e.computed(()=>{const t=O.value;return t&&t.yAxis&&t.yAxis.title&&t.yAxis.title.text?t.yAxis.title.text:""}),Et=e.computed(()=>{const t=O.value;if(!t||!t.yAxis)return Yn;const s=t.yAxis.min;return typeof s=="number"||s===Yn?s:Yn}),lt=e.computed(()=>{const t=O.value;if(!t||!t.yAxis)return Yn;const s=t.yAxis.max;return typeof s=="number"||s===Yn?s:Yn}),je=e.computed(()=>{const t=O.value;return!t||!t.xAxis?null:typeof t.xAxis.min=="number"?t.xAxis.min:null}),Dt=e.computed(()=>{const t=O.value;return!t||!t.xAxis?null:typeof t.xAxis.max=="number"?t.xAxis.max:null}),Lt=e.computed(()=>{const t=O.value;return t&&t.grid&&t.grid.show!==!1}),Bt=e.computed(()=>{const t=O.value;return t&&t.legend&&t.legend.show!==!1}),Xe=e.computed(()=>{const t=O.value;return t&&t.legend&&t.legend.position?t.legend.position:"top"}),Zt=e.computed(()=>{const t=O.value;return t&&t.legend&&t.legend.orientation?t.legend.orientation:"horizontal"}),Yt=e.computed(()=>{const t=O.value;return!t||!t.tooltip?!0:t.tooltip.enabled!==!1}),Ct=e.computed(()=>{const t=O.value;if(!t||!t.crosshair)return!1;const s=t.crosshair.show;return s===!0||s==="true"}),te=e.computed(()=>{const t=O.value;return t&&t.crosshair&&t.crosshair.color?t.crosshair.color:"#666"}),Te=e.computed(()=>{const t=O.value;return!t||!t.zoom?!1:t.zoom.enabled===!0}),fe=e.computed(()=>{const t=O.value;return t&&t.zoom&&typeof t.zoom.minScale=="number"?t.zoom.minScale:1}),Ne=e.computed(()=>{const t=O.value;return t&&t.zoom&&typeof t.zoom.maxScale=="number"?t.zoom.maxScale:2.5}),We=e.computed(()=>{const t=O.value;return t&&t.stroke&&typeof t.stroke.width=="number"?t.stroke.width:2}),ft=e.computed(()=>{if(!cn.value)return 0;const t=O.value;return t&&t.stroke&&typeof t.stroke.width=="number"?t.stroke.width:0}),qe=e.computed(()=>{const t=O.value;return t&&t.bubbles&&typeof t.bubbles.size=="number"?t.bubbles.size:4}),dt=e.computed(()=>{const{maxX:t}=Ut.value;return t===0}),xe=(t,s)=>dt.value&&s===0?5:s,Ue=t=>{const s=Number(t);return!Number.isFinite(s)||s<=0?0:s},X=e.computed(()=>{const t=O.value;return t&&t.fill&&t.fill.area&&typeof t.fill.area.opacity=="number"?t.fill.area.opacity:.3}),Z=e.computed(()=>{const t=O.value;return t&&t.smoothing&&t.smoothing.enabled===!0}),j=e.computed(()=>{const t=O.value;return t&&t.smoothing&&typeof t.smoothing.factor=="number"?t.smoothing.factor:.3}),ie=e.computed(()=>{const t=O.value;return Z.value?t&&t.smoothing&&typeof t.smoothing.barRadius=="number"?t.smoothing.barRadius:4:0}),E=e.computed(()=>{const t=O.value,s=t&&t.colors&&Array.isArray(t.colors)?t.colors:[];return s.length>0?s:["#3B82F6","#EF4444","#10B981","#F59E0B","#8B5CF6","#F97316","#06B6D4","#84CC16"]}),C=e.computed(()=>{const t=O.value;return t&&t.animations&&t.animations.enabled!==!1}),V=e.computed(()=>{const t=O.value;return t&&t.animations&&t.animations.type?t.animations.type:"draw"}),P=e.computed(()=>{const t=O.value;return t&&t.animations&&typeof t.animations.duration=="number"?t.animations.duration:2500}),U=e.computed(()=>{const t=O.value;return t&&t.animations&&typeof t.animations.delay=="number"?t.animations.delay:0}),ze=e.computed(()=>{const t=O.value;return t&&t.animations&&t.animations.easing?t.animations.easing:"ease-out"}),Re=e.computed(()=>{const t=O.value;return t&&t.animations&&typeof t.animations.staggerDelay=="number"?t.animations.staggerDelay:200}),De=e.computed(()=>{const t=O.value;return t&&t.animations&&t.animations.onDataChange!==!1}),re=e.computed(()=>{const t=O.value;return t&&t.animations&&t.animations.respectReducedMotion!==!1}),Ge=e.computed(()=>{const t=O.value;return t&&t.fill&&t.fill.spider&&typeof t.fill.spider.opacity=="number"?t.fill.spider.opacity:.15}),tt=e.computed(()=>O.value?.spider?.gridSteps||5),wt=e.computed(()=>{const t=[],s=tt.value;for(let n=1;n<=s;n++)t.push(it.value/s*n);return t}),vt=t=>{const s=Je.value;if(s&&Array.isArray(s)&&s[t]!==void 0)return s[t].toString();const n=wt.value[t];return Math.round(n/it.value*100)+"%"},Je=e.computed(()=>O.value?.spider?.gridLabels||null),vn=e.computed(()=>{const t=O.value;return t&&t.contextMenu&&t.contextMenu.enabled===!0}),jt=e.computed(()=>{const t=O.value,s={addMarker:!0,downloadSvg:!0,downloadPng:!0,downloadCsv:!0};return t&&t.contextMenu&&t.contextMenu.items?{...s,...t.contextMenu.items}:s}),Tn=e.computed(()=>{const t=O.value;return t&&t.contextMenu&&Array.isArray(t.contextMenu.customItems)?t.contextMenu.customItems:[]}),bn=e.computed(()=>{const t=O.value;return t&&t.markers&&t.markers.icon?t.markers.icon:dn.value}),Fn=e.computed(()=>{const t=O.value;return t&&t.markers&&t.markers.customIcons?t.markers.customIcons:{}}),Wt=e.computed(()=>{const t=O.value;return t&&t.markers&&typeof t.markers.iconSize=="number"?t.markers.iconSize:20}),In=e.computed(()=>{const s=O.value?.valueFormat?.extension;return typeof s=="string"?s:""}),an=t=>{const s=In.value;if(t==null)return"";const n=String(t);return s?n+s:n},qn=e.computed(()=>!G.value.isZooming);e.computed(()=>Mt.value.map(t=>{if(t.categoryIndex!==void 0&&(fn.value||zt.value)){const s=Ft(t.categoryIndex),n=ee.value+I.value.bottom-Wt.value/2;return{...t,x:s,y:n}}return t}));function cl(t,s){let n;if(t instanceof Date)n=new Date(t.getFullYear(),t.getMonth(),t.getDate());else if(typeof t=="string"){const[g,x,b]=t.split("-"),L=Number(b?.length===2?`20${b}`:b);n=new Date(L,Number(x)-1,Number(g))}else return 0;let i=0,f=1/0;return s.forEach((g,x)=>{const[b,L,T]=g.split("-"),H=Number(T?.length===2?`20${T}`:T),M=new Date(H,Number(L)-1,Number(b)),K=Math.abs(M-n);K<f&&(f=K,i=x)}),i}const D=e.computed(()=>{const t=S.markers.map(n=>{const i=cl(n.marker_date,S.categories),f=Ft(i),g=ee.value+I.value.bottom-Wt.value/2;return{...n,x:f,y:g,categoryIndex:i,source:"props"}}),s=Mt.value.map(n=>{if(n.categoryIndex!==void 0&&(fn.value||zt.value)){const i=Ft(n.categoryIndex),f=ee.value+I.value.bottom-Wt.value/2;return{...n,x:i,y:f,source:"internal"}}return{...n,source:"internal"}});return[...t,...s]}),q=e.computed(()=>{const t=O.value;return t&&t.watermark&&t.watermark.enabled===!0}),R=e.computed(()=>{const t=O.value;return t&&t.watermark&&typeof t.watermark.opacity=="number"?t.watermark.opacity:.05}),le=e.computed(()=>{const t=O.value;return t&&t.watermark&&t.watermark.size?t.watermark.size:35}),Me=e.computed(()=>{const t=O.value;return t&&t.watermark&&t.watermark.position?t.watermark.position:"bottom-right"}),nt=e.computed(()=>{const t={left:I.value.left,top:I.value.top,width:I.value.width,height:I.value.height};let s,n;const i=String(le.value);if(i.includes("%")){const f=parseFloat(i)/100;s=t.width*f,n=s*(96/499)}else{const f=parseFloat(i)||25;s=Math.min(t.width*.25,200)*(f/25),n=s*(96/499)}return{width:s,height:n,area:t}}),st=e.computed(()=>{const{width:t,height:s}=nt.value,n=Me.value;let i,f;const g=I.value.left,x=I.value.right,b=I.value.top,L=I.value.bottom,T=I.value.width,H=I.value.height;switch(n){case"center":i=g+(T-t)/2,f=b+(H-s)/2;break;case"top-left":i=g+15,f=b+5;break;case"top-right":i=x-t-15,f=b+5;break;case"bottom-left":i=g+15,f=L-s-5;break;case"bottom-right":default:i=x-t-15,f=L-s-5;break}return{backgroundPositionX:i+"px",backgroundPositionY:f+"px",backgroundSize:`${t}px ${s}px`}}),Qe=t=>!S.flags||!S.flags.length?[]:S.flags.filter(s=>s.categoryIndex===t),Ke=t=>{const s=Qe(t),n=Vn(t),i=s.filter(x=>x.manual),f=s.filter(x=>!x.manual),g=[];return i.length>0&&g.push({type:z("chart.tooltip.manualFlags"),color:"#047395",flags:i.map(x=>({text:x.text,color:"#047395"}))}),f.length>0&&g.push({type:z("chart.tooltip.autoFlags"),color:"#0dbf89",flags:f.map(x=>({text:x.text,color:"#0dbf89"}))}),{flagGroups:g,markers:n.map(x=>({title:x.title,description:x.description,type:z("chart.tooltip.markers"),color:x.color||"#FF6B6B"}))}},dn=e.computed(()=>{const t=S.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"/>
@@ -42,7 +42,7 @@
42
42
  </clipPath>
43
43
  </defs>
44
44
  </svg>`;return`data:image/svg+xml;base64,${btoa(t)}`}),tn=e.computed(()=>{const t=O.value;return t&&t.radialLabels&&t.radialLabels.show===!0}),Hn=e.computed(()=>{const t=O.value;return t&&t.radialLabels&&typeof t.radialLabels.fontSize=="number"?t.radialLabels.fontSize:12});e.computed(()=>{const t=O.value;return t&&t.radialLabels&&t.radialLabels.color?t.radialLabels.color:"#000"});const wn=e.computed(()=>{const t=O.value;return t&&t.radialLabels&&typeof t.radialLabels.pointerLength=="number"?t.radialLabels.pointerLength:25}),sn=e.computed(()=>{const t=O.value;return t&&t.radialLabels&&typeof t.radialLabels.horizontalLength=="number"?t.radialLabels.horizontalLength:40}),xn=e.computed(()=>{const t=O.value;return t&&t.radialLabels&&typeof t.radialLabels.textOffset=="number"?t.radialLabels.textOffset:8}),zn=e.computed(()=>{const s=O.value?.radialBar?.dataLabels;return s&&(s.show===!0||s.enabled===!0)}),Nl=e.computed(()=>{const s=O.value?.radialBar?.dataLabels?.minAngleDegrees;return typeof s=="number"&&s>=0?s:20}),Tl=e.computed(()=>{const s=O.value?.radialBar?.dataCenter;return Nn.value&&s&&(s.show===!0||s.enabled===!0)}),Sl=e.computed(()=>{if(!Tl.value||!sl.value.length)return"";const n=O.value?.radialBar?.dataCenter?.showValueOnly===!0?sl.value[0]?.value??0:sl.value.reduce((i,f)=>i+(f.value??0),0);return an(n)}),gl=e.computed(()=>{const s=O.value?.radialBar?.dataCenter?.fontSize;return typeof s=="number"&&s>0?s:24}),gn=e.computed(()=>({x:_t.value,y:ht.value-gl.value/2})),hn=e.computed(()=>{const s=O.value?.radialBar?.dataCenter?.color;return typeof s=="string"&&s?s:"#333"}),Zl=e.computed(()=>{if(!zn.value||!cn.value||!sl.value.length)return[];const t=Nl.value*Math.PI/180,s=(Rt.value+it.value)/2;return sl.value.map(n=>{const f=n.endAngle-n.startAngle>=t&&!n.isHidden,g=_t.value+Math.cos(n.midAngle)*s,x=ht.value+Math.sin(n.midAngle)*s;return{value:an(n.value),x:g,y:x,show:f,color:n.color,contrastColor:Ql(n.color)}})}),ul=e.computed(()=>{if(!S.flags||!S.flags.length)return[];const t=new Map;return S.flags.forEach(s=>{const n=s.categoryIndex;t.has(n)||t.set(n,[]),t.get(n).push(s)}),Array.from(t.entries()).map(([s,n])=>{const i=Ft(s),f=n.filter(x=>x.manual),g=n.filter(x=>!x.manual);return{categoryIndex:parseInt(s),x:i,flags:n,manualCount:f.length,autoCount:g.length,totalCount:n.length,hasManual:f.length>0,hasAuto:g.length>0,texts:n.map(x=>x.text).join(`
45
- `)}})}),An=e.ref({show:!1,x:0,y:0,content:"",count:0}),dl=e.computed(()=>O.value?.bubbles?.tooltip?.fields||["x","y","size","label"]),hl=e.computed(()=>{const t=O.value;return{...{x:"X",y:"Y",size:"Size",label:"Label",seriesName:"Series"},...t?.bubbles?.tooltip?.labels||{}}}),Ll=e.computed(()=>O.value?.bubbles?.tooltip?.formatters||{}),Vt=e.ref(new Set),Ee=e.ref(null),yn=e.ref(!1),et=e.ref({show:!1,x:0,y:0,title:"",value:"",bubbleData:[],spiderSeries:[]}),rn=e.ref({show:!1,x:0,y:0,categoryValue:"",description:""}),Se=e.ref({show:!1,x:0,categoryIndex:-1,data:[]}),Be=e.ref({show:!1,x:0,y:0,mouseDataX:0,mouseDataY:0,categoryIndex:-1,chartX:0,chartY:0}),G=e.ref({scale:1,offsetX:0,minScale:1,maxScale:2.5,isDragging:!1,lastMouseX:0,lastMouseY:0,isZooming:!1,zoomTimeout:null}),Mt=e.ref([]),he=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 Fn.value&&t.push(...Object.keys(Fn.value)),t}),e.computed(()=>{if(!S.categories||S.categories.length===0){const{maxX:t}=Ut.value;return Array.from({length:t+1},(s,n)=>z("chart.fallback.item",{number:n+1}))}return S.categories});const Hl=e.computed(()=>{if(!S.categories||S.categories.length===0)return null;const t=S.categories[0],[s,n,i]=String(t).split("-"),f=Number(i?.length===2?`20${i}`:i),g=Number(s),x=Number(n)-1;return!g||!n||!f?null:new Date(f,x,g)}),w=e.computed(()=>{if(!S.categories||S.categories.length===0)return null;const t=S.categories[S.categories.length-1],[s,n,i]=String(t).split("-"),f=Number(i?.length===2?`20${i}`:i),g=Number(s),x=Number(n)-1;return!g||!n||!f?null:new Date(f,x,g)}),y=e.computed(()=>he.value.editingMarkerId!==null),B=e.computed(()=>he.value.readonly),W=t=>{Vt.value.has(t)||(Fl.value=!0,Ee.value=t)},ae=()=>{Fl.value=!1,Ee.value=null},mt=t=>{if(El.value||$l.value){Se.value.show=!1;return}const n=t.currentTarget.getBoundingClientRect(),i=t.clientX-n.left,f=t.clientY-n.top,g=zt.value?i>=I.value.left-50&&i<=I.value.right+50&&f>=I.value.top-50&&f<=I.value.bottom+100:i>=I.value.left&&i<=I.value.right&&f>=I.value.top&&f<=I.value.bottom;if(yn.value=g,zt.value){if(!Ct.value||!g||G.value.isDragging||G.value.isZooming){Se.value.show=!1;return}if(xl.value.find(J=>!J||J.isHidden?!1:Math.sqrt(Math.pow(J.x-i,2)+Math.pow(J.y-f,2))<=J.radius+3))Se.value.show=!1;else{const J=xl.value.filter(pe=>!pe||pe.isHidden?!1:Math.sqrt(Math.pow(pe.x-i,2)+Math.pow(pe.y-f,2))<=250);if(J.length>0){let pe=J[0],ye=Math.sqrt(Math.pow(pe.x-i,2)+Math.pow(pe.y-f,2));J.forEach(ke=>{const be=Math.sqrt(Math.pow(ke.x-i,2)+Math.pow(ke.y-f,2));be<ye&&(ye=be,pe=ke)});const oe=30,Ye=xl.value.filter(ke=>!ke||ke.isHidden?!1:Math.abs(ke.x-pe.x)<=oe).sort((ke,be)=>ke.y-be.y);Se.value={show:!0,x:pe.x,categoryIndex:Math.round(pe.originalX),data:(()=>{const ke=dl.value,be=hl.value,Pe=[];return Ye.forEach(Fe=>{ke.forEach(kt=>{const bt=be[kt]||kt,Bn=m(kt,Fe);Bn&&Pe.push({seriesName:Fe.seriesName,label:Fe.label,value:`${bt}: ${Bn}`,color:Fe.color,y:Fe.y})})}),Pe})()}}else Se.value.show=!1}return}if(G.value.isDragging&&G.value.scale>1&&fn.value&&$e.value){Se.value.show=!1;const Ve=t.clientX-G.value.lastMouseX,{minX:J,maxX:pe}=Ut.value,ye=pe-J||1,Ye=Ve*.8;G.value.offsetX+=Ye;const ke=ye/G.value.scale,be=ye-ke,Pe=0,Fe=-be/ye*I.value.width,kt=Pe;G.value.offsetX=Math.max(Fe,Math.min(kt,G.value.offsetX)),G.value.lastMouseX=t.clientX,G.value.lastMouseY=t.clientY;return}if(!Ct.value||!fn.value||G.value.isDragging||G.value.isZooming||!g){Se.value.show=!1;return}const{minX:x,maxX:b}=Ut.value,L=b-x||1,T=L/G.value.scale,H=x-G.value.offsetX/I.value.width*L,M=(i-I.value.left)/I.value.width,K=H+M*T,ce=Math.round(K);if(ce>=0&&ce<=b){const Ve=Ft(ce),J=Jn.value.map((pe,ye)=>{const oe=S.series.findIndex(ke=>ke===pe),Ye=pe.data[ce];return{seriesName:pe.name,value:Ye!==void 0?Ye:null,color:Nt(oe),y:Ye!==void 0?ln(Ye):null}}).filter(pe=>pe.value!==null);Se.value={show:!0,x:Ve,categoryIndex:ce,data:J}}},ot=()=>{Se.value.show=!1,yn.value=!1,$l.value=!1,El.value||(An.value.show=!1),G.value.isDragging&&(G.value.isDragging=!1),G.value.zoomTimeout&&(clearTimeout(G.value.zoomTimeout),G.value.zoomTimeout=null),G.value.isZooming=!1,setTimeout(()=>{Ee.value=null,et.value.show=!1},150)},Ht=t=>{if(t.preventDefault(),t.stopPropagation(),!vn.value)return;const s=t.currentTarget.getBoundingClientRect(),n=t.clientX-s.left,i=t.clientY-s.top;if(cn.value){Be.value.show=!1,e.nextTick(()=>{Be.value.show=!0,Be.value.x=t.clientX,Be.value.y=t.clientY,Be.value.categoryIndex=null});return}const f=Math.max(0,I.value.left-20),g=I.value.right,x=I.value.top,b=I.value.bottom+80;n>=f&&n<=g&&i>=x&&i<=b&&(Be.value.show=!1,e.nextTick(()=>{Be.value.show=!0,Be.value.x=t.clientX,Be.value.y=t.clientY,Be.value.categoryIndex=null;const L=Math.max(I.value.left,Math.min(n,I.value.right))-I.value.left,H=I.value.width/Dl.value.length,M=Math.floor(L/H);M>=0&&M<Dl.value.length&&(Be.value.categoryIndex=M)}))},It=t=>{if(!(t&&t.button===2)){if(Be.value.show&&t&&t.type==="click"){const s=document.querySelector(".dss-context-menu");if(s&&s.contains(t.target))return}Be.value.show=!1}},At=t=>{if(typeof t.template=="function"){const s={series:S.series,categories:S.categories,markers:Mt.value},n={chartX:Be.value.chartX,chartY:Be.value.chartY,dataX:Be.value.mouseDataX,dataY:Be.value.mouseDataY,categoryIndex:Be.value.categoryIndex};return t.template(s,n)}return t.template||t.label||""},En=t=>{const s=["dss-context-menu-item"];return t.cssClass&&s.push(t.cssClass),s},Wl=t=>t.style||{},ro=t=>t.type&&Fn.value[t.type]?Fn.value[t.type]:t.customIcon?t.customIcon:bn.value,io=t=>t==null?"":S.categories&&S.categories[t]?S.categories[t]:"",Vn=t=>Mt.value.length?Mt.value.filter(s=>s.categoryIndex===t):[],co=t=>{if(!fn.value&&!zt.value)return{x:0,y:0};const s=Ft(t),n=ee.value+I.value.bottom-Wt.value/2;return{x:s,y:n}},ql=()=>{Mt.value.forEach(t=>{if(t.categoryIndex!==void 0&&(fn.value||zt.value)){const s=co(t.categoryIndex);t.x=s.x,t.y=s.y}})},uo=()=>{if(he.value.description&&he.value.description.length&&he.value.date){if(y.value){const t=Mt.value.findIndex(s=>s.id===he.value.editingMarkerId);t!==-1?(Mt.value[t].description=he.value.description||"",Mt.value[t].color=he.value.color||"",Mt.value[t].type=he.value.type||"default",_e("update-marker",Mt.value[t])):_e("update-marker",{id:he.value.editingMarkerId,description:he.value.description||"",color:he.value.color||"",type:he.value.type||"default"})}else{const t="dss-marker-"+Date.now()+"-"+Math.random().toString(36).substring(2,9);let s=cl(he.value.date,S.categories||[]);if(zt.value){const{maxX:x}=Ut.value;s=Math.max(0,Math.min(s,Math.floor(x)))}else fn.value&&(s=Math.max(0,Math.min(s,Ut.value.maxX)));const n=Ft(s),i=ee.value+I.value.bottom-Wt.value/2,f=Array.isArray(S.categories)?S.categories[s]:null,g={id:t,title:"",description:he.value.description||"",color:he.value.color||"",type:he.value.type||"default",categoryIndex:s,x:n,y:i,marker_date:f||null};he.value.categoryIndex=s,Mt.value.push(g),_e("add-marker",g)}el(),fo()}},el=()=>{he.value.show=!1,he.value.title="",he.value.description="",he.value.color="#FF6B6B",he.value.type="default",he.value.editingMarkerId=null,he.value.readonly=!1,he.value.categoryIndex=null,he.value.fromButton=!1,he.value.date=null},mo=()=>{y.value&&(Mn(he.value.editingMarkerId),el())},Mn=t=>{const s=Mt.value.findIndex(n=>n.id===t);s!==-1&&(Mt.value.splice(s,1),fo()),_e("delete-marker",t)},po=t=>{if(he.value.show=!0,he.value.title=t?.title??t?.comment??"",he.value.description=t?.description??t?.comment??"",he.value.color=t?.color??"",he.value.type=t?.type??"default",he.value.editingMarkerId=t?.id??t?.marker_id??null,he.value.readonly=t?.readonly??!1,he.value.categoryIndex=t?.categoryIndex??null,t?.marker_date){const[s,n,i]=String(t.marker_date).split("-"),f=Number(i?.length===2?`20${i}`:i),g=Number(s),x=Number(n)-1;g&&n&&f?he.value.date=new Date(f,x,g):he.value.date=null}else he.value.date=null},fo=()=>{try{const t=`dss-chart-markers-${S.chartId}`;localStorage.setItem(t,JSON.stringify(Mt.value))}catch(t){console.warn("Could not save markers to localStorage:",t)}},mn=()=>{try{const t=`dss-chart-markers-${S.chartId}`,s=localStorage.getItem(t);if(s){const n=JSON.parse(s);Array.isArray(n)&&(Mt.value=n.map(i=>({...i,originalYOffset:i.originalYOffset!==void 0?i.originalYOffset:15})))}}catch(t){console.warn("Could not load markers from localStorage:",t),Mt.value=[]}},Pn=t=>{const s=St.value||"Chart",n=new Date().toLocaleDateString("en-GB",{day:"2-digit",month:"2-digit",year:"2-digit"}).replace(/\//g,"-");return`${s.replace(/[^a-zA-Z0-9\s]/g,"").replace(/\s+/g,"-").substring(0,50).replace(/^-|-$/g,"")||"Chart"}-${n}.${t}`},ml=()=>{const t=Se.value.show,s=et.value.show;return Se.value.show=!1,et.value.show=!1,{originalCrosshair:t,originalTooltip:s}},Cn=t=>{Se.value.show=t.originalCrosshair,et.value.show=t.originalTooltip},Gn=async(t,s=32,n=32)=>new Promise((i,f)=>{if(t.startsWith("data:")){i(t);return}const g=new Image;g.crossOrigin="anonymous";const x=setTimeout(()=>{console.warn("Image conversion timeout for:",t),i(t)},5e3);g.onload=()=>{clearTimeout(x);try{const b=document.createElement("canvas"),L=b.getContext("2d");b.width=s,b.height=n,L.fillStyle="#fafafa",L.fillRect(0,0,s,n),L.drawImage(g,0,0,s,n);const T=b.toDataURL("image/png");i(T)}catch(b){console.warn("Canvas conversion failed:",b),i(t)}},g.onerror=b=>{clearTimeout(x),console.warn("Failed to load image:",t,b),i(t)},g.src=t}),tl=async()=>{try{const t=ml();setTimeout(async()=>{try{const s=document.querySelector(".dss-chart-svg");if(!s){console.error("Chart SVG element not found"),Cn(t);return}const n=Ae(),i=we.value,f=ut.value+n.height,g=s.cloneNode(!0);g.querySelectorAll(".dss-flag-markers, .dss-flag-line, .dss-flag-extension-line, .dss-flag-count-indicator, .dss-flag-count-text").forEach(oe=>oe.remove());const b=g.querySelectorAll("image"),L=Array.from(b).map(async oe=>{const Ye=oe.getAttribute("xlink:href")||oe.getAttribute("href");if(Ye&&!Ye.startsWith("data:"))try{const ke=await Gn(Ye,32,32);oe.setAttribute("xlink:href",ke),oe.setAttribute("href",ke)}catch(ke){console.warn("Failed to convert logo to base64:",ke)}});await Promise.all(L);const H=new XMLSerializer().serializeToString(g).replace(/<svg[^>]*>/,"").replace("</svg>","");let M="",K=30;if(St.value&&(M+=`
45
+ `)}})}),An=e.ref({show:!1,x:0,y:0,content:"",count:0}),dl=e.computed(()=>O.value?.bubbles?.tooltip?.fields||["x","y","size","label"]),hl=e.computed(()=>{const t=O.value;return{...{x:"X",y:"Y",size:"Size",label:"Label",seriesName:"Series"},...t?.bubbles?.tooltip?.labels||{}}}),Ll=e.computed(()=>O.value?.bubbles?.tooltip?.formatters||{}),Vt=e.ref(new Set),Ee=e.ref(null),yn=e.ref(!1),et=e.ref({show:!1,x:0,y:0,title:"",value:"",bubbleData:[],spiderSeries:[]}),rn=e.ref({show:!1,x:0,y:0,categoryValue:"",description:""}),Se=e.ref({show:!1,x:0,categoryIndex:-1,data:[]}),Be=e.ref({show:!1,x:0,y:0,mouseDataX:0,mouseDataY:0,categoryIndex:-1,chartX:0,chartY:0}),G=e.ref({scale:1,offsetX:0,minScale:1,maxScale:2.5,isDragging:!1,lastMouseX:0,lastMouseY:0,isZooming:!1,zoomTimeout:null}),Mt=e.ref([]),he=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 Fn.value&&t.push(...Object.keys(Fn.value)),t}),e.computed(()=>{if(!S.categories||S.categories.length===0){const{maxX:t}=Ut.value;return Array.from({length:t+1},(s,n)=>z("chart.fallback.item",{number:n+1}))}return S.categories});const Hl=e.computed(()=>{if(!S.categories||S.categories.length===0)return null;const t=S.categories[0],[s,n,i]=String(t).split("-"),f=Number(i?.length===2?`20${i}`:i),g=Number(s),x=Number(n)-1;return!g||!n||!f?null:new Date(f,x,g)}),w=e.computed(()=>{if(!S.categories||S.categories.length===0)return null;const t=S.categories[S.categories.length-1],[s,n,i]=String(t).split("-"),f=Number(i?.length===2?`20${i}`:i),g=Number(s),x=Number(n)-1;return!g||!n||!f?null:new Date(f,x,g)}),y=e.computed(()=>he.value.editingMarkerId!==null),B=e.computed(()=>he.value.readonly),W=t=>{Vt.value.has(t)||(Fl.value=!0,Ee.value=t)},ae=()=>{Fl.value=!1,Ee.value=null},mt=t=>{if(El.value||$l.value){Se.value.show=!1;return}const n=t.currentTarget.getBoundingClientRect(),i=t.clientX-n.left,f=t.clientY-n.top,g=zt.value?i>=I.value.left-50&&i<=I.value.right+50&&f>=I.value.top-50&&f<=I.value.bottom+100:i>=I.value.left&&i<=I.value.right&&f>=I.value.top&&f<=I.value.bottom;if(yn.value=g,zt.value){if(!Ct.value||!g||G.value.isDragging||G.value.isZooming){Se.value.show=!1;return}if(xl.value.find(J=>!J||J.isHidden?!1:Math.sqrt(Math.pow(J.x-i,2)+Math.pow(J.y-f,2))<=J.radius+3))Se.value.show=!1;else{const J=xl.value.filter(pe=>!pe||pe.isHidden?!1:Math.sqrt(Math.pow(pe.x-i,2)+Math.pow(pe.y-f,2))<=250);if(J.length>0){let pe=J[0],ye=Math.sqrt(Math.pow(pe.x-i,2)+Math.pow(pe.y-f,2));J.forEach(ke=>{const be=Math.sqrt(Math.pow(ke.x-i,2)+Math.pow(ke.y-f,2));be<ye&&(ye=be,pe=ke)});const oe=30,Ye=xl.value.filter(ke=>!ke||ke.isHidden?!1:Math.abs(ke.x-pe.x)<=oe).sort((ke,be)=>ke.y-be.y);Se.value={show:!0,x:pe.x,categoryIndex:Math.round(pe.originalX),data:(()=>{const ke=dl.value,be=hl.value,Pe=[];return Ye.forEach(Fe=>{ke.forEach(kt=>{const bt=be[kt]||kt,Bn=m(kt,Fe);Bn&&Pe.push({seriesName:Fe.seriesName,label:Fe.label,value:`${bt}: ${Bn}`,color:Fe.color,y:Fe.y})})}),Pe})()}}else Se.value.show=!1}return}if(G.value.isDragging&&G.value.scale>1&&fn.value&&Te.value){Se.value.show=!1;const Ve=t.clientX-G.value.lastMouseX,{minX:J,maxX:pe}=Ut.value,ye=pe-J||1,Ye=Ve*.8;G.value.offsetX+=Ye;const ke=ye/G.value.scale,be=ye-ke,Pe=0,Fe=-be/ye*I.value.width,kt=Pe;G.value.offsetX=Math.max(Fe,Math.min(kt,G.value.offsetX)),G.value.lastMouseX=t.clientX,G.value.lastMouseY=t.clientY;return}if(!Ct.value||!fn.value||G.value.isDragging||G.value.isZooming||!g){Se.value.show=!1;return}const{minX:x,maxX:b}=Ut.value,L=b-x||1,T=L/G.value.scale,H=x-G.value.offsetX/I.value.width*L,M=(i-I.value.left)/I.value.width,K=H+M*T,ce=Math.round(K);if(ce>=0&&ce<=b){const Ve=Ft(ce),J=Jn.value.map((pe,ye)=>{const oe=S.series.findIndex(ke=>ke===pe),Ye=pe.data[ce];return{seriesName:pe.name,value:Ye!==void 0?Ye:null,color:Nt(oe),y:Ye!==void 0?ln(Ye):null}}).filter(pe=>pe.value!==null);Se.value={show:!0,x:Ve,categoryIndex:ce,data:J}}},ot=()=>{Se.value.show=!1,yn.value=!1,$l.value=!1,El.value||(An.value.show=!1),G.value.isDragging&&(G.value.isDragging=!1),G.value.zoomTimeout&&(clearTimeout(G.value.zoomTimeout),G.value.zoomTimeout=null),G.value.isZooming=!1,setTimeout(()=>{Ee.value=null,et.value.show=!1},150)},Ht=t=>{if(t.preventDefault(),t.stopPropagation(),!vn.value)return;const s=t.currentTarget.getBoundingClientRect(),n=t.clientX-s.left,i=t.clientY-s.top;if(cn.value){Be.value.show=!1,e.nextTick(()=>{Be.value.show=!0,Be.value.x=t.clientX,Be.value.y=t.clientY,Be.value.categoryIndex=null});return}const f=Math.max(0,I.value.left-20),g=I.value.right,x=I.value.top,b=I.value.bottom+80;n>=f&&n<=g&&i>=x&&i<=b&&(Be.value.show=!1,e.nextTick(()=>{Be.value.show=!0,Be.value.x=t.clientX,Be.value.y=t.clientY,Be.value.categoryIndex=null;const L=Math.max(I.value.left,Math.min(n,I.value.right))-I.value.left,H=I.value.width/Dl.value.length,M=Math.floor(L/H);M>=0&&M<Dl.value.length&&(Be.value.categoryIndex=M)}))},It=t=>{if(!(t&&t.button===2)){if(Be.value.show&&t&&t.type==="click"){const s=document.querySelector(".dss-context-menu");if(s&&s.contains(t.target))return}Be.value.show=!1}},At=t=>{if(typeof t.template=="function"){const s={series:S.series,categories:S.categories,markers:Mt.value},n={chartX:Be.value.chartX,chartY:Be.value.chartY,dataX:Be.value.mouseDataX,dataY:Be.value.mouseDataY,categoryIndex:Be.value.categoryIndex};return t.template(s,n)}return t.template||t.label||""},En=t=>{const s=["dss-context-menu-item"];return t.cssClass&&s.push(t.cssClass),s},Wl=t=>t.style||{},ro=t=>t.type&&Fn.value[t.type]?Fn.value[t.type]:t.customIcon?t.customIcon:bn.value,io=t=>t==null?"":S.categories&&S.categories[t]?S.categories[t]:"",Vn=t=>Mt.value.length?Mt.value.filter(s=>s.categoryIndex===t):[],co=t=>{if(!fn.value&&!zt.value)return{x:0,y:0};const s=Ft(t),n=ee.value+I.value.bottom-Wt.value/2;return{x:s,y:n}},ql=()=>{Mt.value.forEach(t=>{if(t.categoryIndex!==void 0&&(fn.value||zt.value)){const s=co(t.categoryIndex);t.x=s.x,t.y=s.y}})},uo=()=>{if(he.value.description&&he.value.description.length&&he.value.date){if(y.value){const t=Mt.value.findIndex(s=>s.id===he.value.editingMarkerId);t!==-1?(Mt.value[t].description=he.value.description||"",Mt.value[t].color=he.value.color||"",Mt.value[t].type=he.value.type||"default",_e("update-marker",Mt.value[t])):_e("update-marker",{id:he.value.editingMarkerId,description:he.value.description||"",color:he.value.color||"",type:he.value.type||"default"})}else{const t="dss-marker-"+Date.now()+"-"+Math.random().toString(36).substring(2,9);let s=cl(he.value.date,S.categories||[]);if(zt.value){const{maxX:x}=Ut.value;s=Math.max(0,Math.min(s,Math.floor(x)))}else fn.value&&(s=Math.max(0,Math.min(s,Ut.value.maxX)));const n=Ft(s),i=ee.value+I.value.bottom-Wt.value/2,f=Array.isArray(S.categories)?S.categories[s]:null,g={id:t,title:"",description:he.value.description||"",color:he.value.color||"",type:he.value.type||"default",categoryIndex:s,x:n,y:i,marker_date:f||null};he.value.categoryIndex=s,Mt.value.push(g),_e("add-marker",g)}el(),fo()}},el=()=>{he.value.show=!1,he.value.title="",he.value.description="",he.value.color="#FF6B6B",he.value.type="default",he.value.editingMarkerId=null,he.value.readonly=!1,he.value.categoryIndex=null,he.value.fromButton=!1,he.value.date=null},mo=()=>{y.value&&(Mn(he.value.editingMarkerId),el())},Mn=t=>{const s=Mt.value.findIndex(n=>n.id===t);s!==-1&&(Mt.value.splice(s,1),fo()),_e("delete-marker",t)},po=t=>{if(he.value.show=!0,he.value.title=t?.title??t?.comment??"",he.value.description=t?.description??t?.comment??"",he.value.color=t?.color??"",he.value.type=t?.type??"default",he.value.editingMarkerId=t?.id??t?.marker_id??null,he.value.readonly=t?.readonly??!1,he.value.categoryIndex=t?.categoryIndex??null,t?.marker_date){const[s,n,i]=String(t.marker_date).split("-"),f=Number(i?.length===2?`20${i}`:i),g=Number(s),x=Number(n)-1;g&&n&&f?he.value.date=new Date(f,x,g):he.value.date=null}else he.value.date=null},fo=()=>{try{const t=`dss-chart-markers-${S.chartId}`;localStorage.setItem(t,JSON.stringify(Mt.value))}catch(t){console.warn("Could not save markers to localStorage:",t)}},mn=()=>{try{const t=`dss-chart-markers-${S.chartId}`,s=localStorage.getItem(t);if(s){const n=JSON.parse(s);Array.isArray(n)&&(Mt.value=n.map(i=>({...i,originalYOffset:i.originalYOffset!==void 0?i.originalYOffset:15})))}}catch(t){console.warn("Could not load markers from localStorage:",t),Mt.value=[]}},Pn=t=>{const s=St.value||"Chart",n=new Date().toLocaleDateString("en-GB",{day:"2-digit",month:"2-digit",year:"2-digit"}).replace(/\//g,"-");return`${s.replace(/[^a-zA-Z0-9\s]/g,"").replace(/\s+/g,"-").substring(0,50).replace(/^-|-$/g,"")||"Chart"}-${n}.${t}`},ml=()=>{const t=Se.value.show,s=et.value.show;return Se.value.show=!1,et.value.show=!1,{originalCrosshair:t,originalTooltip:s}},Cn=t=>{Se.value.show=t.originalCrosshair,et.value.show=t.originalTooltip},Gn=async(t,s=32,n=32)=>new Promise((i,f)=>{if(t.startsWith("data:")){i(t);return}const g=new Image;g.crossOrigin="anonymous";const x=setTimeout(()=>{console.warn("Image conversion timeout for:",t),i(t)},5e3);g.onload=()=>{clearTimeout(x);try{const b=document.createElement("canvas"),L=b.getContext("2d");b.width=s,b.height=n,L.fillStyle="#fafafa",L.fillRect(0,0,s,n),L.drawImage(g,0,0,s,n);const T=b.toDataURL("image/png");i(T)}catch(b){console.warn("Canvas conversion failed:",b),i(t)}},g.onerror=b=>{clearTimeout(x),console.warn("Failed to load image:",t,b),i(t)},g.src=t}),tl=async()=>{try{const t=ml();setTimeout(async()=>{try{const s=$e.value;if(!s){console.error("Chart SVG element not found"),Cn(t);return}const n=Ae(),i=we.value,f=ut.value+n.height,g=s.cloneNode(!0);g.querySelectorAll(".dss-flag-markers, .dss-flag-line, .dss-flag-extension-line, .dss-flag-count-indicator, .dss-flag-count-text").forEach(oe=>oe.remove());const b=g.querySelectorAll("image"),L=Array.from(b).map(async oe=>{const Ye=oe.getAttribute("xlink:href")||oe.getAttribute("href");if(Ye&&!Ye.startsWith("data:"))try{const ke=await Gn(Ye,32,32);oe.setAttribute("xlink:href",ke),oe.setAttribute("href",ke)}catch(ke){console.warn("Failed to convert logo to base64:",ke)}});await Promise.all(L);const H=new XMLSerializer().serializeToString(g).replace(/<svg[^>]*>/,"").replace("</svg>","");let M="",K=30;if(St.value&&(M+=`
46
46
  <text x="24" y="${K}"
47
47
  font-family="Arial, sans-serif"
48
48
  font-size="18"
@@ -89,20 +89,20 @@
89
89
  ${H}
90
90
  ${ce}
91
91
  </g>
92
- </svg>`,J=new Blob([Ve],{type:"image/svg+xml;charset=utf-8"}),pe=URL.createObjectURL(J),ye=document.createElement("a");ye.href=pe,ye.download=Pn("svg"),document.body.appendChild(ye),ye.click(),document.body.removeChild(ye),URL.revokeObjectURL(pe),Cn(t),It()}catch(s){console.error("Error downloading SVG:",s),Cn(t)}},50)}catch(t){console.error("Error downloading SVG:",t)}},nl=async()=>{try{const t=ml();k.value&&k.value.offsetHeight,await new Promise(oe=>setTimeout(oe,300));const s=Ae(),n=we.value,i=ut.value+s.height,f=document.createElement("canvas"),g=f.getContext("2d"),x=2;f.width=n*x,f.height=i*x,f.style.width=n+"px",f.style.height=i+"px",g.scale(x,x),g.fillStyle="#fafafa",g.fillRect(0,0,n,i);let b=30;if(St.value&&(g.fillStyle="#333",g.font="bold 18px Arial, sans-serif",g.fillText(St.value,24,b),b+=30),at.value&&(g.fillStyle="#666",g.font="14px Arial, sans-serif",g.fillText(at.value,24,b),b+=25),Bt.value&&S.series.length>0){let oe=n-200,Ye=St.value||at.value?35:25;const ke=Math.floor((n-250)/120);let be=0;g.font="12px Arial, sans-serif",S.series.forEach((Pe,Fe)=>{if(!Vt.value.has(Fe)){const kt=Nt(Fe);g.beginPath(),g.arc(oe+6,Ye-4,6,0,2*Math.PI),g.fillStyle=kt,g.fill(),g.fillStyle="#333",g.fillText(Pe.name,oe+18,Ye),be++,be%ke===0?(oe=n-200,Ye+=20):oe+=Math.min(120,Pe.name.length*8+35)}})}const T=document.querySelector(".dss-chart-svg").cloneNode(!0),H=T.querySelectorAll(".dss-flag-markers, .dss-flag-line, .dss-flag-extension-line, .dss-flag-count-indicator, .dss-flag-count-text"),M=T.querySelectorAll(".dss-crosshair"),K=T.querySelectorAll('[class*="tooltip"]');H.forEach(oe=>oe.remove()),M.forEach(oe=>oe.remove()),K.forEach(oe=>oe.remove()),T.querySelectorAll("image").forEach((oe,Ye)=>{const ke=oe.getAttribute("xlink:href")||oe.getAttribute("href");if(ke&&!ke.startsWith("data:")){const be=Pt.value[Ye],Pe=be?Nt(be.seriesIndex):"#3B82F6",Fe=oe.getAttribute("x")||0,kt=oe.getAttribute("y")||0,bt=oe.getAttribute("width")||32,Bn=oe.getAttribute("height")||32,Gt=document.createElementNS("http://www.w3.org/2000/svg","circle");Gt.setAttribute("cx",parseFloat(Fe)+parseFloat(bt)/2),Gt.setAttribute("cy",parseFloat(kt)+parseFloat(Bn)/2),Gt.setAttribute("r",Math.min(parseFloat(bt),parseFloat(Bn))/2-1),Gt.setAttribute("fill",Pe),Gt.setAttribute("stroke","#fafafa"),Gt.setAttribute("stroke-width","2"),oe.parentNode.replaceChild(Gt,oe)}});const Ve=new XMLSerializer().serializeToString(T),J=new Blob([Ve],{type:"image/svg+xml;charset=utf-8"}),pe=URL.createObjectURL(J),ye=new Image;return new Promise((oe,Ye)=>{ye.onload=async()=>{try{if(g.drawImage(ye,0,s.height),Pt.value.forEach(ke=>{const be=ke.x,Pe=ke.y+s.height,Fe=(ke.width||32)/2,kt=Nt(ke.seriesIndex);g.save(),g.beginPath(),g.arc(be,Pe,Fe-1,0,2*Math.PI),g.fillStyle=kt,g.fill(),g.strokeStyle="#fafafa",g.lineWidth=2,g.stroke(),g.restore()}),q.value){const ke=new Image,be=()=>{const{width:Fe,height:kt}=nt.value,bt=Me.value,Bn=I.value.left,Gt=I.value.right,il=I.value.top,qo=I.value.bottom,Qo=I.value.width,Jo=I.value.height;let Pl,Ol;switch(bt){case"center":Pl=Bn+(Qo-Fe)/2,Ol=il+s.height+(Jo-kt)/2;break;case"top-left":Pl=Bn+15,Ol=il+s.height+10;break;case"top-right":Pl=Gt-Fe-5,Ol=il+s.height+10;break;case"bottom-left":Pl=Bn+15,Ol=qo+s.height-kt-5;break;case"bottom-right":default:Pl=Gt-Fe-5,Ol=qo+s.height-kt-5;break}g.globalAlpha=R.value,g.drawImage(ke,Pl,Ol,Fe,kt),g.globalAlpha=1,Pe()},Pe=()=>{f.toBlob(Fe=>{const kt=URL.createObjectURL(Fe),bt=document.createElement("a");bt.href=kt,bt.download=Pn("png"),document.body.appendChild(bt),bt.click(),document.body.removeChild(bt),URL.revokeObjectURL(kt),URL.revokeObjectURL(pe),Cn(t),It(),oe()},"image/png")};ke.onload=be,ke.onerror=Pe,ke.src=Ln.value}else f.toBlob(ke=>{const be=URL.createObjectURL(ke),Pe=document.createElement("a");Pe.href=be,Pe.download=Pn("png"),document.body.appendChild(Pe),Pe.click(),document.body.removeChild(Pe),URL.revokeObjectURL(be),URL.revokeObjectURL(pe),Cn(t),It(),oe()},"image/png")}catch(ke){URL.revokeObjectURL(pe),Cn(t),Ye(ke)}},ye.onerror=()=>{URL.revokeObjectURL(pe),Cn(t),Ye(new Error("Failed to load SVG image"))},ye.src=pe})}catch(t){console.error("Error downloading PNG:",t)}},_n=()=>{try{let t="";St.value&&(t+=`# ${z("chart.csv.chartTitle")}: ${St.value}
92
+ </svg>`,J=new Blob([Ve],{type:"image/svg+xml;charset=utf-8"}),pe=URL.createObjectURL(J),ye=document.createElement("a");ye.href=pe,ye.download=Pn("svg"),document.body.appendChild(ye),ye.click(),document.body.removeChild(ye),URL.revokeObjectURL(pe),Cn(t),It()}catch(s){console.error("Error downloading SVG:",s),Cn(t)}},50)}catch(t){console.error("Error downloading SVG:",t)}},nl=async()=>{try{const t=ml();k.value&&k.value.offsetHeight,await new Promise(oe=>setTimeout(oe,300));const s=Ae(),n=we.value,i=ut.value+s.height,f=document.createElement("canvas"),g=f.getContext("2d"),x=2;f.width=n*x,f.height=i*x,f.style.width=n+"px",f.style.height=i+"px",g.scale(x,x),g.fillStyle="#fafafa",g.fillRect(0,0,n,i);let b=30;if(St.value&&(g.fillStyle="#333",g.font="bold 18px Arial, sans-serif",g.fillText(St.value,24,b),b+=30),at.value&&(g.fillStyle="#666",g.font="14px Arial, sans-serif",g.fillText(at.value,24,b),b+=25),Bt.value&&S.series.length>0){let oe=n-200,Ye=St.value||at.value?35:25;const ke=Math.floor((n-250)/120);let be=0;g.font="12px Arial, sans-serif",S.series.forEach((Pe,Fe)=>{if(!Vt.value.has(Fe)){const kt=Nt(Fe);g.beginPath(),g.arc(oe+6,Ye-4,6,0,2*Math.PI),g.fillStyle=kt,g.fill(),g.fillStyle="#333",g.fillText(Pe.name,oe+18,Ye),be++,be%ke===0?(oe=n-200,Ye+=20):oe+=Math.min(120,Pe.name.length*8+35)}})}const T=$e.value.cloneNode(!0),H=T.querySelectorAll(".dss-flag-markers, .dss-flag-line, .dss-flag-extension-line, .dss-flag-count-indicator, .dss-flag-count-text"),M=T.querySelectorAll(".dss-crosshair"),K=T.querySelectorAll('[class*="tooltip"]');H.forEach(oe=>oe.remove()),M.forEach(oe=>oe.remove()),K.forEach(oe=>oe.remove()),T.querySelectorAll("image").forEach((oe,Ye)=>{const ke=oe.getAttribute("xlink:href")||oe.getAttribute("href");if(ke&&!ke.startsWith("data:")){const be=Pt.value[Ye],Pe=be?Nt(be.seriesIndex):"#3B82F6",Fe=oe.getAttribute("x")||0,kt=oe.getAttribute("y")||0,bt=oe.getAttribute("width")||32,Bn=oe.getAttribute("height")||32,Gt=document.createElementNS("http://www.w3.org/2000/svg","circle");Gt.setAttribute("cx",parseFloat(Fe)+parseFloat(bt)/2),Gt.setAttribute("cy",parseFloat(kt)+parseFloat(Bn)/2),Gt.setAttribute("r",Math.min(parseFloat(bt),parseFloat(Bn))/2-1),Gt.setAttribute("fill",Pe),Gt.setAttribute("stroke","#fafafa"),Gt.setAttribute("stroke-width","2"),oe.parentNode.replaceChild(Gt,oe)}});const Ve=new XMLSerializer().serializeToString(T),J=new Blob([Ve],{type:"image/svg+xml;charset=utf-8"}),pe=URL.createObjectURL(J),ye=new Image;return new Promise((oe,Ye)=>{ye.onload=async()=>{try{if(g.drawImage(ye,0,s.height),Pt.value.forEach(ke=>{const be=ke.x,Pe=ke.y+s.height,Fe=(ke.width||32)/2,kt=Nt(ke.seriesIndex);g.save(),g.beginPath(),g.arc(be,Pe,Fe-1,0,2*Math.PI),g.fillStyle=kt,g.fill(),g.strokeStyle="#fafafa",g.lineWidth=2,g.stroke(),g.restore()}),q.value){const ke=new Image,be=()=>{const{width:Fe,height:kt}=nt.value,bt=Me.value,Bn=I.value.left,Gt=I.value.right,il=I.value.top,qo=I.value.bottom,Qo=I.value.width,Jo=I.value.height;let Pl,Ol;switch(bt){case"center":Pl=Bn+(Qo-Fe)/2,Ol=il+s.height+(Jo-kt)/2;break;case"top-left":Pl=Bn+15,Ol=il+s.height+10;break;case"top-right":Pl=Gt-Fe-5,Ol=il+s.height+10;break;case"bottom-left":Pl=Bn+15,Ol=qo+s.height-kt-5;break;case"bottom-right":default:Pl=Gt-Fe-5,Ol=qo+s.height-kt-5;break}g.globalAlpha=R.value,g.drawImage(ke,Pl,Ol,Fe,kt),g.globalAlpha=1,Pe()},Pe=()=>{f.toBlob(Fe=>{const kt=URL.createObjectURL(Fe),bt=document.createElement("a");bt.href=kt,bt.download=Pn("png"),document.body.appendChild(bt),bt.click(),document.body.removeChild(bt),URL.revokeObjectURL(kt),URL.revokeObjectURL(pe),Cn(t),It(),oe()},"image/png")};ke.onload=be,ke.onerror=Pe,ke.src=Ln.value}else f.toBlob(ke=>{const be=URL.createObjectURL(ke),Pe=document.createElement("a");Pe.href=be,Pe.download=Pn("png"),document.body.appendChild(Pe),Pe.click(),document.body.removeChild(Pe),URL.revokeObjectURL(be),URL.revokeObjectURL(pe),Cn(t),It(),oe()},"image/png")}catch(ke){URL.revokeObjectURL(pe),Cn(t),Ye(ke)}},ye.onerror=()=>{URL.revokeObjectURL(pe),Cn(t),Ye(new Error("Failed to load SVG image"))},ye.src=pe})}catch(t){console.error("Error downloading PNG:",t)}},_n=()=>{try{let t="";St.value&&(t+=`# ${z("chart.csv.chartTitle")}: ${St.value}
93
93
  `),at.value&&(t+=`# ${z("chart.csv.chartSubtitle")}: ${at.value}
94
94
  `),t+=`# ${z("chart.csv.generated")}: ${new Date().toLocaleString()}
95
95
 
96
96
  `,t+="Category",S.series.forEach(g=>{const x=g.name.replace(/"/g,'""');t+=',"'+x+'"'}),t+=`
97
97
  `;const s=Math.max(...S.series.map(g=>g.data?.length||0));for(let g=0;g<s;g++){let L='"'+(S.categories[g]||z("chart.fallback.item",{number:g+1})).toString().replace(/"/g,'""')+'"';S.series.forEach(T=>{const H=T.data&&T.data[g]!==void 0?T.data[g]:"";L+=","+H}),t+=L+`
98
- `}const n=new Blob([t],{type:"text/csv;charset=utf-8;"}),i=URL.createObjectURL(n),f=document.createElement("a");f.href=i,f.download=Pn("csv"),document.body.appendChild(f),f.click(),document.body.removeChild(f),URL.revokeObjectURL(i),It()}catch(t){console.error("Error downloading CSV:",t)}},Ul=t=>{if(typeof t.action=="function"){const s={series:S.series,categories:S.categories,markers:Mt.value},n={chartX:Be.value.chartX,chartY:Be.value.chartY,dataX:Be.value.mouseDataX,dataY:Be.value.mouseDataY,categoryIndex:clampedCategoryIndex||Be.value.categoryIndex};t.action(s,n)}It()},Bl=()=>{el(),he.value.show=!0,he.value.categoryIndex=Be.value.categoryIndex,he.value.fromButton=!1,It()},Eo=()=>{el(),he.value.show=!0,he.value.categoryIndex=0,he.value.fromButton=!0},Xl=t=>{if(Be.value.show){const s=document.querySelector(".dss-context-menu");s&&!s.contains(t.target)&&(Be.value.show=!1)}},Al=t=>{Be.value.show&&!t.target.closest(".context-menu")&&(Be.value.show=!1)},vo=t=>{if(!fn.value||!$e.value)return;t.preventDefault(),t.stopPropagation(),G.value.isZooming=!0,Se.value.show=!1,G.value.zoomTimeout&&clearTimeout(G.value.zoomTimeout);const n=t.currentTarget.getBoundingClientRect(),i=t.clientX-n.left,f=t.clientY-n.top;if(i<I.value.left-50||i>I.value.right+50||f<I.value.top-50||f>I.value.bottom+100){G.value.isZooming=!1;return}const g=t.deltaY>0?.9:1.1,x=Math.max(G.value.minScale,Math.min(G.value.maxScale,G.value.scale*g));if(x!==G.value.scale){const{minX:b,maxX:L}=Ut.value,T=L-b||1,H=T/G.value.scale,M=b-G.value.offsetX/I.value.width*T,K=(i-I.value.left)/I.value.width,ce=M+K*H;G.value.scale=x;const Ve=T/G.value.scale,J=ce-K*Ve;G.value.offsetX=-(J-b)/T*I.value.width,G.value.scale<=1.01&&(G.value.scale=1,G.value.offsetX=0)}G.value.zoomTimeout=setTimeout(()=>{G.value.isZooming=!1,G.value.zoomTimeout=null},300)},Vo=t=>{if(!fn.value||!$e.value||G.value.scale<=1)return;Se.value.show=!1;const n=t.currentTarget.getBoundingClientRect();t.clientX-n.left,t.clientY-n.top,G.value.isDragging=!0,G.value.lastMouseX=t.clientX,G.value.lastMouseY=t.clientY,t.preventDefault()},go=()=>{G.value.isDragging=!1},Yl=()=>{!fn.value||!$e.value||(G.value.scale=1,G.value.offsetX=0,G.value.isDragging=!1,G.value.zoomTimeout&&(clearTimeout(G.value.zoomTimeout),G.value.zoomTimeout=null),G.value.isZooming=!1)},No=()=>!fn.value||!yn.value||!$e.value?"default":G.value.isDragging?"grabbing":G.value.scale>1?"grab":"dss-crosshair",jl=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 s=`M ${t[0].x} ${t[0].y}`;for(let n=0;n<t.length-1;n++){const i=t[Math.max(n-1,0)],f=t[n],g=t[n+1],x=t[Math.min(n+2,t.length-1)],b=f.x+(g.x-i.x)/6*j.value,L=f.y+(g.y-i.y)/6*j.value,T=g.x-(x.x-f.x)/6*j.value,H=g.y-(x.y-f.y)/6*j.value;s+=` C ${b} ${L} ${T} ${H} ${g.x} ${g.y}`}return s},pn=e.computed(()=>{const s=O.value?.chart?.padding,n=typeof s=="number"?s:null,i=s&&typeof s=="object"?s:null,f=50;let g=f+(Ot.value?30:0)+60;if(Un.value){const M={left:f+40,top:f+40,right:f+40,bottom:f+40};return n!=null?{left:n,top:n,right:n,bottom:n}:i?{left:i.left??M.left,top:i.top??M.top,right:i.right??M.right,bottom:i.bottom??M.bottom}:M}if(cn.value){const M=!Bt.value,K=tn.value,ce=K?wn.value+sn.value+Math.max(24,Hn.value+16):0,Ve=M?12:f;let J=0;St.value&&(J+=M?8:15),at.value&&(J+=M?6:10);const pe=Ae();let ye=Ve+(M?4:16)+(K?ce:0),oe=Ve+(K?ce:0);Bt.value&&Xe.value==="left"?ye+=pe.legendWidth||150:Bt.value&&Xe.value==="right"&&(oe+=pe.legendWidth||150);const ke=ge.value==="semi-radial"?K?ce:8:K?ce:M?8:f+80,be=K?14:0,Pe=Ve+J+be,Fe={left:ye,top:Pe,right:oe,bottom:ke};return n!=null?{left:n,top:n,right:n,bottom:n}:i?{left:i.left??Fe.left,top:i.top??Fe.top,right:i.right??Fe.right,bottom:i.bottom??Fe.bottom}:Fe}let x=0;St.value&&(x+=15),at.value&&(x+=10);const b=Ae();let L=f+16,T=f;Bt.value&&Xe.value==="left"?L+=b.legendWidth||150:Bt.value&&Xe.value==="right"&&(T+=b.legendWidth||150);const H={left:L,top:f+x,right:T,bottom:g};return n!=null?{left:n,top:n,right:n,bottom:n}:i?{left:i.left??H.left,top:i.top??H.top,right:i.right??H.right,bottom:i.bottom??H.bottom}:H}),I=e.computed(()=>({left:pn.value.left,top:pn.value.top,right:we.value-pn.value.right,bottom:ut.value-pn.value.bottom,width:we.value-(pn.value.left+pn.value.right),height:ut.value-(pn.value.top+pn.value.bottom)})),fn=e.computed(()=>["line","area","bar"].includes(ge.value)||yt.value),On=e.computed(()=>yt.value),cn=e.computed(()=>["radial","semi-radial"].includes(ge.value)),Un=e.computed(()=>ge.value==="spider"),zt=e.computed(()=>ge.value==="bubble"),nn=e.computed(()=>O.value?.chart?.orientation==="horizontal"&&(ge.value==="bar"||On.value)),ll=t=>{const{minY:s,maxY:n}=Ut.value,i=n-s||1;return I.value.left+(t-s)/i*I.value.width},pl=t=>{const{maxX:s}=Ut.value,n=s+1,f=I.value.height/n;return I.value.top+(t+.5)*f},_t=e.computed(()=>cn.value?pn.value.left+(we.value-pn.value.left-pn.value.right)/2:we.value/2),ht=e.computed(()=>Un.value?ut.value/2-40:cn.value?pn.value.top+(ut.value-pn.value.top-pn.value.bottom)/2:ut.value/2),it=e.computed(()=>{if(Un.value){const t=I.value.width-80,s=I.value.height-80;return Math.min(t,s)/2}return Math.min(I.value.width,I.value.height)/2}),Rt=e.computed(()=>{const t=O.value,s=t?.plotOptions?.radialBar?.innerRadiusRatio??t?.radialBar?.innerRadiusRatio,n=typeof s=="number"&&s>=0&&s<=1?s:.45;return it.value*n}),So=e.computed(()=>{const t=O.value,s=typeof S.innerSize=="number"?S.innerSize:t?.innerSize;return typeof s!="number"||s<=-100||!(cn.value||Un.value)?1:1+s/100}),ho=e.computed(()=>{const t=So.value;if(t===1||t<=0)return;const s=_t.value,n=ht.value;return`translate(${s}, ${n}) scale(${t}) translate(${-s}, ${-n})`}),yl=e.ref(0),Xn=e.computed(()=>`semi-radial-fill-clip-${S.chartId}`),Nn=e.computed(()=>ge.value==="semi-radial"),Qn=e.computed(()=>Nn.value&&C.value&&!un.value),ol=e.computed(()=>Nn.value&&C.value&&!un.value&&V.value==="fill"),qt=e.computed(()=>{const t=Qn.value?yl.value:1,s=_t.value,n=ht.value,i=Rt.value,f=it.value,g=Math.PI,x=Math.PI+t*Math.PI;if(t<=0)return`M ${s} ${n} L ${s} ${n} Z`;const b=s+f*Math.cos(g),L=n+f*Math.sin(g),T=s+f*Math.cos(x),H=n+f*Math.sin(x),M=s+i*Math.cos(x),K=n+i*Math.sin(x),ce=s+i*Math.cos(g),Ve=n+i*Math.sin(g),J=t>.5?1:0;return`M ${s} ${n} L ${b} ${L} A ${f} ${f} 0 ${J} 1 ${T} ${H} L ${M} ${K} A ${i} ${i} 0 ${J} 1 ${ce} ${Ve} Z`}),Kl=e.computed(()=>{if(!(!Nn.value||!Qn.value)&&!ol.value)return`url(#${Xn.value})`}),yo=t=>{if(!(!ol.value||t!==0))return`url(#${Xn.value})`},$n=e.ref(0),al=e.computed(()=>`radial-reveal-clip-${S.chartId}`),Sn=e.computed(()=>ge.value==="radial"),fl=e.computed(()=>{const t=Sn.value?$n.value:1,s=_t.value,n=ht.value,i=Math.max(it.value*1.5,we.value,ut.value);if(t<=0)return`M ${s} ${n} L ${s} ${n} Z`;if(t>=1){const M=s-i,K=s+i;return`M ${M} ${n} A ${i} ${i} 0 0 1 ${K} ${n} A ${i} ${i} 0 0 1 ${M} ${n} Z`}const f=-Math.PI/2,g=f+t*Math.PI*2,x=s+i*Math.cos(f),b=n+i*Math.sin(f),L=s+i*Math.cos(g),T=n+i*Math.sin(g),H=t>=.5?1:0;return`M ${s} ${n} L ${x} ${b} A ${i} ${i} 0 ${H} 1 ${L} ${T} Z`}),Cl=e.computed(()=>{if(Kl.value)return Kl.value;if(Sn.value)return`url(#${al.value})`});let Ml=null;const Bo=()=>{if(!Qn.value)return;yl.value=0;const t=P.value,s=performance.now(),n=i=>{const f=i-s,g=Math.min(1,f/t);yl.value=zl(ze.value,g),g<1&&(Ml=requestAnimationFrame(n))};Ml=requestAnimationFrame(n)},kl=e.computed(()=>O.value?.bubbles?.minSize||8),Co=e.computed(()=>O.value?.bubbles?.maxSize||50),bl=e.computed(()=>O.value?.bubbles?.opacity||.7),Gl=(t,s)=>{const n=[15,20,25,18,22],i=n[t%n.length]||20,f=1+Math.sin(s*.5)*.2;return Math.max(5,i*f)},Mo=t=>{const s=document.querySelector(`.dss-bubble-image-${t}`);s&&(s.style.opacity="1")},_o=t=>{const s=document.querySelector(`.dss-bubble-image-${t}`);s&&(s.style.display="none")},Dn=e.computed(()=>S.series),Jn=e.computed(()=>S.series.filter((t,s)=>!Vt.value.has(s))),Yn="auto",Ut=e.computed(()=>{if(zt.value)return ko();if(!Jn.value.length)return{minX:0,maxX:1,minY:0,maxY:1};let t=1/0,s=-1/0,n=0;Jn.value.forEach(b=>{b.data&&b.data.length&&(n=Math.max(n,b.data.length-1),b.data.forEach(L=>{typeof L=="number"&&(t=Math.min(t,L),s=Math.max(s,L))}))}),S.categories.length>0&&(n=Math.max(n,S.categories.length-1)),t===1/0&&(t=0,s=100);const i=Et.value,f=lt.value;let g,x;if(i===Yn){const b=s-t,L=b>0?b*.1:1;g=Math.max(0,t-L)}else if(typeof i=="number")g=i;else{const b=s-t,L=b>0?b*.1:1;g=Math.max(0,t-L)}if(f===Yn){const b=s-t,L=b>0?b*.1:2;x=s+L}else if(typeof f=="number")x=f;else{const b=s-t,L=b>0?b*.1:2;x=s+L}return{minX:0,maxX:n,minY:g,maxY:x}}),ko=()=>{if(!Jn.value.length)return{minX:0,maxX:8,minY:0,maxY:50,minSize:10,maxSize:30};let t=1/0,s=-1/0,n=1/0,i=-1/0,f=1/0,g=-1/0,x=!1;if(Jn.value.forEach((ce,Ve)=>{ce?.data?.length&&ce.data.forEach((J,pe)=>{let ye,oe,Ye;if(typeof J=="object"&&J!==null&&!Array.isArray(J))ye=typeof J.x=="number"?J.x:pe,oe=typeof J.y=="number"?J.y:0,Ye=typeof J.size=="number"?J.size:20;else if(Array.isArray(J)&&J.length>=3)ye=typeof J[0]=="number"?J[0]:pe,oe=typeof J[1]=="number"?J[1]:0,Ye=typeof J[2]=="number"?J[2]:20;else if(typeof J=="number")ye=pe,oe=J,Ye=Gl(Ve,pe);else return;isFinite(ye)&&isFinite(oe)&&isFinite(Ye)&&(t=Math.min(t,ye),s=Math.max(s,ye),n=Math.min(n,oe),i=Math.max(i,oe),f=Math.min(f,Ye),g=Math.max(g,Ye),x=!0)})}),!x)return{minX:0,maxX:8,minY:0,maxY:50,minSize:10,maxSize:30};t===s&&(t=Math.min(t,0),s=Math.max(s,S.categories?.length-1||8)),n===i&&(n=Math.max(0,n-10),i=n+20);const b=s-t,L=i-n;let T,H,M,K;return je.value!==null?T=je.value:T=t-b*.1,Dt.value!==null?H=Dt.value:H=s+b*.1,Et.value!==null&&typeof Et.value=="number"?M=Et.value:M=Math.max(0,n-L*.1),lt.value!==null&&typeof lt.value=="number"?K=lt.value:K=i+L*.1,{minX:T,maxX:H,minY:M,maxY:K,minSize:f,maxSize:g}},Ft=t=>{if(zt.value){const{minX:b,maxX:L}=Ut.value,T=L-b||1;return I.value.left+(t-b)/T*I.value.width}const{minX:s,maxX:n}=Ut.value,i=n-s;if(n===0||i===0)return I.value.left+I.value.width/2;const f=i/G.value.scale,g=s-G.value.offsetX/I.value.width*i,x=(t-g)/f;return I.value.left+x*I.value.width},ln=t=>{const{minY:s,maxY:n}=Ut.value,i=n-s||1;return I.value.bottom-(t-s)/i*I.value.height},$o=t=>{if(!zt.value)return qe.value||4;const{maxSize:s}=Ut.value,n=Math.max(1,s),i=Math.min(1,Math.max(0,t/n));return kl.value+i*(Co.value-kl.value)},bo=e.computed(()=>wl.value.map(t=>({y:t.y}))),Dl=e.computed(()=>{if(zt.value)return To();if(ge.value==="bar"){if(nn.value){const ke=[],{minY:be,maxY:Pe}=Ut.value,Fe=5,kt=Pe-be||1;for(let bt=0;bt<=Fe;bt++){const Bn=be+kt*(bt/Fe),Gt=ll(Bn);ke.push({x:Gt,y:I.value.bottom+20,text:an(Math.round(Bn))})}return ke}const Ve=[],{maxX:J}=Ut.value,pe=J+1,ye=5,Ye=(I.value.width-ye*2)/pe;for(let ke=0;ke<=J;ke++){const be=I.value.left+ye+(ke+.5)*Ye;Ve.push({x:be,y:I.value.bottom+20,text:S.categories[ke]||z("chart.fallback.item",{number:ke+1})})}return Ve}const t=[],{minX:s,maxX:n}=Ut.value,i=n-s||1,f=i/G.value.scale,g=s-G.value.offsetX/I.value.width*i,x=g+f,b=Math.max(0,Math.floor(g-2)),L=Math.min(n,Math.ceil(x+2)),T=L-b,H=I.value.width,K=Math.floor(H/60);let ce=1;T>K&&(ce=Math.ceil(T/K));for(let Ve=b;Ve<=L;Ve+=ce)if(Ve>=0&&Ve<=n){const J=Ft(Ve);J>=I.value.left-100&&J<=I.value.right+100&&t.push({x:J,y:I.value.bottom+20,text:S.categories[Ve]||`Item ${Ve+1}`})}return t}),To=()=>{const t=[],{minX:s,maxX:n}=Ut.value,i=n-s||1,f=Math.min(8,Math.max(4,Math.floor(I.value.width/80)));for(let g=0;g<=f;g++){const x=s+i*g/f,b=Ft(x);if(b>=I.value.left-10&&b<=I.value.right+10){const L=Math.round(x),T=S.categories?.[L];t.push({x:b,y:I.value.bottom+20,text:T||(Number.isInteger(x)?x.toString():x.toFixed(1))})}}return t},wl=e.computed(()=>{if(nn.value){const f=[],{maxX:g}=Ut.value;for(let x=0;x<=g;x++)f.push({x:I.value.left-10,y:pl(x),text:S.categories[x]||`Item ${x+1}`});return f}const t=[],{minY:s,maxY:n}=Ut.value,i=5;for(let f=0;f<=i;f++){const g=s+(n-s)*(f/i),x=Math.round(g);t.push({x:I.value.left-10,y:ln(g),text:an(x)})}return t}),Nt=t=>{const s=E.value;if(!s||s.length===0){const n=["#3B82F6","#EF4444","#10B981","#F59E0B","#8B5CF6","#F97316","#06B6D4","#84CC16"];return n[t%n.length]}return s[t%s.length]},Ql=t=>{if(!t||typeof t!="string")return"#3a3a3a";const s=t.trim();let n=0,i=0,f=0;const g=s.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i);if(g)n=Number(g[1])/255,i=Number(g[2])/255,f=Number(g[3])/255;else{const b=s.match(/^rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)\s*\)$/i);if(b)n=Number(b[1])/255,i=Number(b[2])/255,f=Number(b[3])/255;else{const L=s.match(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/);if(L){let T=L[1];T.length===3&&(T=T[0]+T[0]+T[1]+T[1]+T[2]+T[2]),n=parseInt(T.slice(0,2),16)/255,i=parseInt(T.slice(2,4),16)/255,f=parseInt(T.slice(4,6),16)/255}else if(typeof document<"u"){const T=document.createElement("span");T.style.color=s,T.style.display="none",document.body.appendChild(T);const H=getComputedStyle(T).color;document.body.removeChild(T);const M=H.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i);if(M)n=Number(M[1])/255,i=Number(M[2])/255,f=Number(M[3])/255;else return"#3a3a3a"}else return"#3a3a3a"}}return .2126*n+.7152*i+.0722*f>.5?"#3a3a3a":"#fafafa"},Rl=t=>{if(!t||typeof t!="string")return t;const s=t.trim(),n=s.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)),x=Math.max(0,Math.floor(Number(n[2])*.65)),b=Math.max(0,Math.floor(Number(n[3])*.65));return`rgb(${g}, ${x}, ${b})`}const i=s.match(/^rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)\s*\)$/i);if(i){const g=Math.max(0,Math.floor(Number(i[1])*.65)),x=Math.max(0,Math.floor(Number(i[2])*.65)),b=Math.max(0,Math.floor(Number(i[3])*.65));return`rgba(${g}, ${x}, ${b}, ${i[4]})`}const f=s.match(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/);if(f){let g=f[1];g.length===3&&(g=g[0]+g[0]+g[1]+g[1]+g[2]+g[2]);const x=Math.max(0,Math.min(255,Math.floor(parseInt(g.slice(0,2),16)*.65))),b=Math.max(0,Math.min(255,Math.floor(parseInt(g.slice(2,4),16)*.65))),L=Math.max(0,Math.min(255,Math.floor(parseInt(g.slice(4,6),16)*.65)));return`#${[x,b,L].map(T=>T.toString(16).padStart(2,"0")).join("")}`}return s},Jl=(t,s)=>{const i=O.value?.stroke?.color;return i==null?Rl(s):typeof i=="string"?i:Array.isArray(i)&&i.length?i[t%i.length]??Rl(s):Rl(s)},eo=t=>{let s=0;for(let n=1;n<t.length;n++){const i=t[n].x-t[n-1].x,f=t[n].y-t[n-1].y;s+=Math.sqrt(i*i+f*f)}return s},wo=e.computed(()=>ge.value==="line"||On.value?(On.value?S.series.filter(s=>(s.type||ge.value)==="line"):Dn.value).map((s,n)=>{const i=S.series.findIndex(M=>M===s),f=[];let g=[];s.data.forEach((M,K)=>{M==null?g.length>0&&(f.push([...g]),g=[]):g.push({x:nn.value?ll(M):Ft(K),y:nn.value?pl(K):ln(M),index:K})}),g.length>0&&f.push(g);let x="";f.forEach(M=>{if(M.length>0){let K="";Z.value?K=jl(M):K=`M ${M[0].x} ${M[0].y}`+M.slice(1).map(ce=>` L ${ce.x} ${ce.y}`).join(""),x+=(x?" ":"")+K}});const b=f.reduce((M,K)=>M+eo(K),0),L=Vt.value.has(i),T=Ee.value===i,H=Ee.value!==null&&Ee.value!==i;return{path:x,color:Nt(i),pathLength:b,seriesIndex:i,animationDelay:n*Re.value,isHighlighted:T,isDimmed:H,isHidden:L}}):[]),_l=e.computed(()=>{if(!(ge.value==="line"||On.value))return[];const t=On.value?S.series.filter(n=>(n.type||ge.value)==="line"):Dn.value,s=[];return t.forEach((n,i)=>{const f=S.series.findIndex(g=>g===n);for(let g=0;g<n.data.length-1;g++){const x=n.data[g];if(x!=null){let b=-1,L=0;for(let T=g+1;T<n.data.length;T++){const H=n.data[T];if(H==null)L++;else{b=T;break}}if(L>0&&b!==-1){const T=n.data[b],H=nn.value?ll(x):Ft(g),M=nn.value?pl(g):ln(x),K=nn.value?ll(T):Ft(b),ce=nn.value?pl(b):ln(T),Ve=Vt.value.has(f),J=Ee.value===f,pe=Ee.value!==null&&Ee.value!==f;s.push({path:`M ${H} ${M} L ${K} ${ce}`,color:Nt(f),seriesIndex:f,animationDelay:i*Re.value,isHighlighted:J,isDimmed:pe,isHidden:Ve,gapSize:L}),g=b-1}}}}),s}),Zn=e.computed(()=>ge.value==="line"||On.value?!C.value||un.value||gt.value.hasAnimated?[]:(On.value?S.series.filter(s=>(s.type||ge.value)==="line"):Dn.value).map((s,n)=>{const i=S.series.findIndex(L=>L===s);let f="",g=null;s.data.forEach((L,T)=>{if(L!=null){const H={x:nn.value?ll(L):Ft(T),y:nn.value?pl(T):ln(L)};g===null?f+=`M ${H.x} ${H.y}`:f+=` L ${H.x} ${H.y}`,g=H}else if(g!==null){const H=s.data.findIndex((M,K)=>K>T&&M!==null&&M!==void 0);if(H!==-1){const M={x:nn.value?ll(s.data[H]):Ft(H),y:nn.value?pl(H):ln(s.data[H])};f+=` L ${M.x} ${M.y}`,g=M}}});const x=s.data.map((L,T)=>L==null?null:{x:nn.value?ll(L):Ft(T),y:nn.value?pl(T):ln(L)}).filter(L=>L!==null),b=eo(x);return{path:f,pathLength:b,color:Nt(i),animationDelay:n*Re.value,seriesIndex:i}}):[]),Lo=e.computed(()=>{if(ge.value!=="line")return[];const t=[];return Dn.value.forEach((s,n)=>{const i=Ee.value===n,f=Ee.value!==null&&Ee.value!==n,g=Vt.value.has(n);s.data.forEach((x,b)=>{x!=null&&t.push({x:Ft(b),y:ln(x),color:Nt(n),value:x,label:S.categories[b]||b.toString(),seriesName:s.name,categoryIndex:b,dataIndex:b,animationDelay:(n*s.data.length+b)*(Re.value/8),isHighlighted:i,isDimmed:f,isHidden:g})})}),t}),vl=e.computed(()=>{if(!On.value)return[];const t=[];return S.series.filter(n=>(n.type||ge.value)==="line").forEach((n,i)=>{const f=S.series.findIndex(L=>L===n),g=Ee.value===f,x=Ee.value!==null&&Ee.value!==f,b=Vt.value.has(f);n.data.forEach((L,T)=>{L!=null&&t.push({x:Ft(T),y:ln(L),color:Nt(f),value:L,label:S.categories[T]||T.toString(),seriesName:n.name,categoryIndex:T,dataIndex:T,animationDelay:(i*n.data.length+T)*(Re.value/8),isHighlighted:g,isDimmed:x,isHidden:b})})}),t}),xl=e.computed(()=>{if(!zt.value)return[];const t=[];return Dn.value.forEach((s,n)=>{if(!s?.data?.length)return;const i=Ee.value,f=i!==null&&i===n,g=i!==null&&i!==n,x=Vt.value.has(n);s.data.forEach((b,L)=>{let T,H,M,K,ce;if(typeof b=="object"&&b!==null&&!Array.isArray(b))T=typeof b.x=="number"?b.x:L,H=typeof b.y=="number"?b.y:0,M=typeof b.size=="number"?b.size:20,K=b.label||S.categories?.[L]||`Point ${L+1}`,ce=b.image||b.imageUrl;else if(Array.isArray(b)&&b.length>=3)T=typeof b[0]=="number"?b[0]:L,H=typeof b[1]=="number"?b[1]:0,M=typeof b[2]=="number"?b[2]:20,K=b[3]||S.categories?.[L]||`Point ${L+1}`,ce=b[4];else if(typeof b=="number")T=L,H=b,M=Gl(n,L),K=S.categories?.[L]||`Point ${L+1}`;else return;!isFinite(T)||!isFinite(H)||!isFinite(M)||t.push({x:Ft(T),y:ln(H),radius:$o(M),originalX:T,originalY:H,originalSize:M,color:Nt(n),seriesName:s.name||`Series ${n+1}`,label:K,imageUrl:ce,seriesIndex:n,dataIndex:L,categoryIndex:Math.round(T),isHighlighted:f,isDimmed:g,isHidden:x,opacity:bl.value})})}),t}),to=e.computed(()=>ge.value!=="area"?[]:Dn.value.map((t,s)=>{const n=[];let i=[];if(t.data.forEach((M,K)=>{M==null?i.length>0&&(n.push([...i]),i=[]):i.push({x:Ft(K),y:ln(M),index:K})}),i.length>0&&n.push(i),n.length===0)return{linePath:"",areaPath:"",color:Nt(s),isHidden:Vt.value.has(s)};const f=I.value.bottom+1;let g="",x="";n.forEach((M,K)=>{if(M.length===0)return;let ce=`M ${M[0].x} ${M[0].y}`;Z.value&&M.length>1?ce=jl(M):M.slice(1).forEach(J=>{ce+=` L ${J.x} ${J.y}`}),g+=(g?" ":"")+ce;let Ve=`M ${M[0].x} ${f}`;if(Ve+=` L ${M[0].x} ${M[0].y}`,Z.value&&M.length>1){const J=jl(M),pe=J.substring(J.indexOf("C")||J.indexOf("Q")||J.indexOf("L"));pe?Ve+=" "+pe:M.slice(1).forEach(ye=>{Ve+=` L ${ye.x} ${ye.y}`})}else M.slice(1).forEach(J=>{Ve+=` L ${J.x} ${J.y}`});Ve+=` L ${M[M.length-1].x} ${f} Z`,x+=(x?" ":"")+Ve});const b=Ee.value===s,L=Ee.value!==null&&Ee.value!==s,T=Vt.value.has(s),H=n.reduce((M,K)=>M+eo(K),0);return{linePath:g,areaPath:x,color:Nt(s),pathLength:H,isHighlighted:b,isDimmed:L,isHidden:T}})),no=e.computed(()=>{if(!(["bar"].includes(ge.value)||On.value))return[];const t=[],{maxX:s}=Ut.value,n=On.value?S.series.filter(f=>(f.type||ge.value)==="bar"):Dn.value,i=n.length;if(nn.value){const f=s+1,x=I.value.height/f,b=x*(2/3),L=Math.min(4,b/i*.15),T=b-(i-1)*L,H=Math.max(4,T/i);n.forEach((M,K)=>{const ce=S.series.findIndex(ye=>ye===M),Ve=Ee.value===ce,J=Ee.value!==null&&Ee.value!==ce,pe=Vt.value.has(ce);M.data.forEach((ye,oe)=>{if(ye==null||typeof ye!="number"||!isFinite(ye))return;const be=I.value.top+(oe+.5)*x-b/2+K*(H+L),Pe=I.value.left,Fe=Math.abs(ll(ye)-I.value.left);let kt="";if(Z.value&&Fe>0){const bt=Math.min(ie.value,H/2,Fe/2);kt=[`M ${Pe} ${be}`,`L ${Pe+Fe-bt} ${be}`,`Q ${Pe+Fe} ${be} ${Pe+Fe} ${be+bt}`,`L ${Pe+Fe} ${be+H-bt}`,`Q ${Pe+Fe} ${be+H} ${Pe+Fe-bt} ${be+H}`,`L ${Pe} ${be+H}`,"Z"].join(" ")}t.push({x:Pe,y:be,width:Fe,height:H,color:Nt(i===1?oe:ce),value:ye,label:S.categories[oe]||oe.toString(),seriesName:M.name,animationDelay:(K*n.length+oe)*(Re.value/4),isHighlighted:Ve,isDimmed:J,isHidden:pe,barPath:kt,isSmooth:Z.value&&Fe>0})})})}else{const f=s+1,x=I.value.width/f,b=x*.8,L=b/i,T=L*.05,H=L-T;n.forEach((M,K)=>{const ce=S.series.findIndex(ye=>ye===M),Ve=Ee.value===ce,J=Ee.value!==null&&Ee.value!==ce,pe=Vt.value.has(ce);M.data.forEach((ye,oe)=>{if(ye==null||typeof ye!="number"||!isFinite(ye))return;const be=I.value.left+(oe+.5)*x-b/2+K*L+T/2,Pe=ln(Math.max(0,ye)),Fe=Math.abs(ln(0)-ln(ye));let kt="";if(Z.value&&Fe>0){const bt=Math.min(ie.value,H/2,Fe/2);kt=[`M ${be} ${Pe+Fe}`,`L ${be} ${Pe+bt}`,`Q ${be} ${Pe} ${be+bt} ${Pe}`,`L ${be+H-bt} ${Pe}`,`Q ${be+H} ${Pe} ${be+H} ${Pe+bt}`,`L ${be+H} ${Pe+Fe}`,"Z"].join(" ")}t.push({x:be,y:Pe,width:H,height:Fe,color:Nt(i===1?oe:ce),value:ye,label:S.categories[oe]||oe.toString(),seriesName:M.name,animationDelay:(K*n.length+oe)*(Re.value/4),isHighlighted:Ve,isDimmed:J,isHidden:pe,barPath:kt,isSmooth:Z.value&&Fe>0})})})}return t}),sl=e.computed(()=>{if(!cn.value)return[];const t=Dn.value.map((g,x)=>({series:g,originalIndex:x})).filter(({originalIndex:g})=>!Vt.value.has(g));if(t.length===0)return[];let s=ge.value==="semi-radial"?Math.PI:-Math.PI/2;const n=ge.value==="semi-radial"?Math.PI:Math.PI*2,i=[];if(t.length===1){const{series:g,originalIndex:x}=t[0],b=g.data[0]||0,L=s,T=s+n-.001,H=L+n/2,M=_t.value+Math.cos(L)*Rt.value,K=ht.value+Math.sin(L)*Rt.value,ce=_t.value+Math.cos(T)*Rt.value,Ve=ht.value+Math.sin(T)*Rt.value,J=_t.value+Math.cos(T)*it.value,pe=ht.value+Math.sin(T)*it.value,ye=_t.value+Math.cos(L)*it.value,oe=ht.value+Math.sin(L)*it.value,Ye=1,ke=[`M ${M} ${K}`,`A ${Rt.value} ${Rt.value} 0 ${Ye} 1 ${ce} ${Ve}`,`L ${J} ${pe}`,`A ${it.value} ${it.value} 0 ${Ye} 0 ${ye} ${oe}`,"Z"].join(" "),be=Nt(x);return i.push({path:ke,color:be,strokeWidth:ft.value,strokeColor:Jl(0,be),value:b,seriesName:g.name,opacity:.8,isHighlighted:Ee.value===x,isDimmed:!1,isHidden:!1,startAngle:L,endAngle:T,midAngle:H}),i}if(ol.value&&t.length===2){const g=t[0],x=t[1],b=Math.min(100,Math.max(0,g.series.data[0]||0)),L=b/100*n,T=(H,M,K,ce,Ve)=>{const J=H+(M-H)/2,pe=M-H,ye=_t.value+Math.cos(H)*Rt.value,oe=ht.value+Math.sin(H)*Rt.value,Ye=_t.value+Math.cos(M)*Rt.value,ke=ht.value+Math.sin(M)*Rt.value,be=_t.value+Math.cos(M)*it.value,Pe=ht.value+Math.sin(M)*it.value,Fe=_t.value+Math.cos(H)*it.value,kt=ht.value+Math.sin(H)*it.value,bt=pe>Math.PI?1:0,Bn=[`M ${ye} ${oe}`,`A ${Rt.value} ${Rt.value} 0 ${bt} 1 ${Ye} ${ke}`,`L ${be} ${Pe}`,`A ${it.value} ${it.value} 0 ${bt} 0 ${Fe} ${kt}`,"Z"].join(" "),Gt=Nt(ce);return{path:Bn,color:Gt,strokeWidth:ft.value,strokeColor:Jl(i.length,Gt),value:Ve,seriesName:K.name,opacity:.8,isHighlighted:Ee.value===ce,isDimmed:Ee.value!==null&&Ee.value!==ce,isHidden:!1,startAngle:H,endAngle:M,midAngle:J}};return i.push(T(s,s+L,g.series,g.originalIndex,b)),i.push(T(s,s+n,x.series,x.originalIndex,100)),i}const f=t.reduce((g,{series:x})=>g+(x.data[0]||0),0);return f===0?[]:(t.forEach(({series:g,originalIndex:x})=>{const b=g.data[0]||0,L=b/f*n,T=s,H=s+L,M=T+L/2,K=_t.value+Math.cos(T)*Rt.value,ce=ht.value+Math.sin(T)*Rt.value,Ve=_t.value+Math.cos(H)*Rt.value,J=ht.value+Math.sin(H)*Rt.value,pe=_t.value+Math.cos(H)*it.value,ye=ht.value+Math.sin(H)*it.value,oe=_t.value+Math.cos(T)*it.value,Ye=ht.value+Math.sin(T)*it.value,ke=L>Math.PI?1:0,be=[`M ${K} ${ce}`,`A ${Rt.value} ${Rt.value} 0 ${ke} 1 ${Ve} ${J}`,`L ${pe} ${ye}`,`A ${it.value} ${it.value} 0 ${ke} 0 ${oe} ${Ye}`,"Z"].join(" "),Pe=Nt(x);i.push({path:be,color:Pe,strokeWidth:ft.value,strokeColor:Jl(i.length,Pe),value:b,seriesName:g.name,opacity:.8,isHighlighted:Ee.value===x,isDimmed:Ee.value!==null&&Ee.value!==x,isHidden:!1,startAngle:T,endAngle:H,midAngle:M}),s=H}),i)}),o=e.computed(()=>{const t=sl.value;return ol.value&&t.length>=2?[{segment:t[1],originalIndex:1},{segment:t[0],originalIndex:0}]:t.map((s,n)=>({segment:s,originalIndex:n}))}),l=e.computed(()=>{if(!tn.value||!cn.value)return[];const t=Hn.value,s=wn.value,n=sn.value,i=xn.value,f=15,g=t*1.3,x=.55,b=(M,K)=>{const ce=_t.value+Math.cos(M.midAngle)*it.value,Ve=ht.value+Math.sin(M.midAngle)*it.value,J=_t.value+Math.cos(M.midAngle)*(it.value+s),pe=ht.value+Math.sin(M.midAngle)*(it.value+s),oe=J+n*(K?1:-1),Ye=K?J+f:J-f,ke=pe-i,be=`${M.seriesName}: ${an(M.value)}`,Pe=be.length*t*x;return{pointerStartX:ce,pointerStartY:Ve,pointerEndX:J,pointerEndY:pe,horizontalEndX:oe,horizontalEndY:pe,textX:Ye,textY:ke,text:be,textWidth:Pe,textAnchor:K?"start":"end",isRightSide:K,pointerLineLength:Math.hypot(J-ce,pe-Ve),horizontalLineLength:Math.hypot(oe-J,0)}},L=(M,K)=>{const ce=Math.abs(M.textY-K.textY)<g,Ve=M.isRightSide?M.textX:M.textX-M.textWidth,J=M.isRightSide?M.textX+M.textWidth:M.textX,pe=K.isRightSide?K.textX:K.textX-K.textWidth,ye=K.isRightSide?K.textX+K.textWidth:K.textX,oe=Ve<ye&&pe<J;return ce&&oe},T=sl.value.filter(M=>!M.isHidden),H=[];for(let M=0;M<T.length;M++){const K=T[M];let ce=Math.cos(K.midAngle)>=0;if(M>0){const J=H[M-1],pe=b(K,ce);L(J,pe)&&(ce=!ce)}const Ve=b(K,ce);H.push({...Ve,color:K.color,isHighlighted:K.isHighlighted,isDimmed:K.isDimmed})}return H}),a=t=>{if(!t||t.isHidden)return 0;const s=t.opacity||bl.value||.7;return Ee.value===null||Ee.value===void 0?s:Ee.value!==null?t.seriesIndex===Ee.value?Math.min(1,s+.1):Math.max(.5,s*.8):s},r=t=>{if(!t||t.isHidden)return 0;const s=t.radius>20?.9:.8;return Ee.value!==null?t.seriesIndex===Ee.value?Math.min(1,s+.1):s*.7:s},c=(t,s)=>{if(t)try{if(Ee.value===t.seriesIndex?Ee.value=null:Ee.value=t.seriesIndex,typeof window<"u"&&window.dispatchEvent){const n=new CustomEvent("dss-bubble-click",{detail:{bubble:t,originalEvent:s,chartId:S.chartId}});window.dispatchEvent(n)}}catch(n){console.error("Error in onBubbleClick:",n)}},d=(t,s)=>{const n=[`dss-bubble-fallback-${s}`];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(" ")},u=(t,s)=>{if(!t||(s.stopPropagation(),$l.value=!0,Ee.value=t.seriesIndex,Se.value.show=!1,!Yt.value))return;const n=s.target.closest(".dss-custom-chart-container");if(!n)return;const i=n.getBoundingClientRect();let f=s.clientX-i.left+10,g=s.clientY-i.top-10;const x=200,b=120;f+x>we.value&&(f=s.clientX-i.left-x-10),g+b>i.height&&(g=s.clientY-i.top-b-10),f<0&&(f=10),g<0&&(g=10);const L=dl.value,T=hl.value,H=L.map(M=>{const K=T[M]||M,ce=m(M,t);return ce?{seriesName:t.seriesName,label:t.label,value:`${K}: ${ce}`,color:t.color}:null}).filter(Boolean);et.value={show:!0,x:f,y:g,title:t.label||t.seriesName||"",value:"",bubbleData:H,categoryIndex:void 0,spiderSeries:[]}},m=(t,s)=>{let n;switch(t){case"x":n=s.originalX;break;case"y":n=s.originalY;break;case"size":n=s.originalSize;break;case"label":n=s.label;break;case"seriesName":n=s.seriesName;break;default:n=s[t]||""}const i=Ll.value[t];if(typeof i=="function")return i(n,s);if(typeof n=="number"){const f=n.toFixed(1);return In.value?f+In.value:f}return n?.toString()||""},v=()=>{if(!zt.value||!Se.value.data||Se.value.data.length===0)return"Bubbles";const t=[],s=new Set;return Se.value.data.forEach(n=>{if(n.seriesName&&n.label){const i=`${n.seriesName} - ${n.label}`;s.has(i)||(t.push(i),s.add(i))}else n.seriesName&&(s.has(n.seriesName)||(t.push(n.seriesName),s.add(n.seriesName)))}),t.length>0?t.join(" | "):"Bubbles"},h=(t,s)=>{t&&($l.value=!1,Ee.value=null,et.value.show=!1,et.value.bubbleData=[])},_=(t,s)=>{const n=s.target.closest(".dss-custom-chart-container");if(!n)return;const i=n.getBoundingClientRect(),f=io(t.categoryIndex),g=t.description||t.comment||"";let x=s.clientX-i.left+15,b=s.clientY-i.top-10;const L=200,T=g?80:50;x+L>we.value&&(x=s.clientX-i.left-L-15),b+T>ut.value&&(b=s.clientY-i.top-T-10),x<0&&(x=10),b<0&&(b=10),rn.value={show:!0,x,y:b,categoryValue:f,description:g}},$=()=>{rn.value.show=!1},N=e.computed(()=>S.categories.length||Math.max(...Jn.value.map(t=>t.data.length))),Q=e.computed(()=>{let t=0;return Jn.value.forEach(s=>{s.data.forEach(n=>{typeof n=="number"&&(t=Math.max(t,n))})}),t||100}),Y=e.computed(()=>{const t=[],s=N.value;for(let n=0;n<s;n++){const i=n*2*Math.PI/s-Math.PI/2,f=_t.value+Math.cos(i)*it.value,g=ht.value+Math.sin(i)*it.value;t.push({x:f,y:g,angle:i,index:n})}return t}),Te=e.computed(()=>{const t=[],s=N.value;return Y.value.forEach((n,i)=>{const f=it.value+15,g=i*2*Math.PI/s-Math.PI/2,x=_t.value+Math.cos(g)*f,b=ht.value+Math.sin(g)*f+5;let L="middle",T="middle";Math.abs(Math.cos(g))>.5&&(L=Math.cos(g)>0?"start":"end"),Math.abs(Math.sin(g))>.5&&(T=Math.sin(g)>0?"hanging":"auto"),t.push({x,y:b,text:S.categories[i]||`Axis ${i+1}`,anchor:L,baseline:T})}),t}),me=e.ref(new Set),ct=(t,s,n)=>{const i=`current-${n}`,f=me.value.has(i);return!f&&Ee.value===null?s.fillOpacity||Ge.value:s.isHighlighted||f?(s.fillOpacity||Ge.value)+.15:s.isDimmed?(s.fillOpacity||Ge.value)*.3:s.fillOpacity||Ge.value},Qt=e.computed(()=>{if(!Un.value)return[];const t=[],s=N.value;return Dn.value.forEach((n,i)=>{const f=[],g=[],x=[],b=Ee.value===i,L=Ee.value!==null&&Ee.value!==i,T=Vt.value.has(i);for(let H=0;H<s;H++){const M=n.data[H]||0,ce=M/Q.value*it.value,Ve=H*2*Math.PI/s-Math.PI/2,J=_t.value+Math.cos(Ve)*ce,pe=ht.value+Math.sin(Ve)*ce;f.push(`${J},${pe}`),g.push({x:J,y:pe}),x.push({x:J,y:pe,value:M,label:S.categories[H]||`Axis ${H+1}`,seriesName:n.name})}t.push({points:f.join(" "),polygonPoints:g,dataPoints:x,color:Nt(i),fillOpacity:Ge.value,seriesName:n.name,value:`${n.name}: ${n.data.join(", ")}`,isHighlighted:b,isDimmed:L,isHidden:T,seriesIndex:i})}),t}),Jt=(t,s)=>{if(!s||s.length<3)return!1;let n=!1;for(let i=0,f=s.length-1;i<s.length;f=i++){const g=s[i].x,x=s[i].y,b=s[f].x,L=s[f].y;x>t.y!=L>t.y&&t.x<(b-g)*(t.y-x)/(L-x)+g&&(n=!n)}return n},Xt=t=>{if(!Un.value)return;const s=t.currentTarget.closest(".dss-custom-chart-container");if(!s)return;const n=s.getBoundingClientRect(),i=Le.value?.getBoundingClientRect();if(!i)return;const f=t.clientX-i.left,g=t.clientY-i.top,x=Qt.value.filter(b=>b.isHidden?!1:Jt({x:f,y:g},b.polygonPoints));if(x.length>0){x.length,Ee.value=x[0].seriesIndex;const b=t.clientX-n.left+10,L=t.clientY-n.top-10,T=200,H=50+x.length*25;let M=b,K=L;M+T>we.value&&(M=t.clientX-n.left-T-10),K+H>ut.value&&(K=t.clientY-n.top-H-10),M<0&&(M=10),K<0&&(K=10);const ce=x.map(Ve=>{let J=Ve.dataPoints[0],pe=1/0;return Ve.dataPoints.forEach(ye=>{const oe=Math.sqrt(Math.pow(ye.x-f,2)+Math.pow(ye.y-g,2));oe<pe&&(pe=oe,J=ye)}),{seriesName:Ve.seriesName,color:Ve.color,value:an(J.value!==void 0?J.value:Ve.value)}});et.value={show:!0,x:M,y:K,title:x.length===1?x[0].seriesName:"",value:"",bubbleData:[],spiderSeries:ce}}else jn()},Pt=e.computed(()=>{const t=O.value;return t.logos.map((s,n)=>{const i=S.series[s.seriesIndex];if(!i||!i.data||i.data.length===0||Vt.value.has(s.seriesIndex))return null;let f,g;if(fn.value){let b=-1,L=null;for(let H=i.data.length-1;H>=0;H--)if(i.data[H]!==null&&i.data[H]!==void 0){b=H,L=i.data[H];break}if(b===-1||L===null)return null;const T=i.data.map((H,M)=>H==null?null:{x:Ft(M),y:ln(H),index:M}).filter(H=>H!==null);if(t.animations.enabled&&!un.value&&t.animations.type==="draw"&&t.chart.type==="line"&&(gt.value.isAnimating||!gt.value.hasAnimated))if(gt.value.isAnimating){const H=gt.value.currentFrame/gt.value.totalFrames,M=zl(t.animations.easing,Math.min(H,1)),K=Go(T,M);f=K.x+(s.offsetX||0),g=K.y+(s.offsetY||0)}else f=T[0].x+(s.offsetX||0),g=T[0].y+(s.offsetY||0);else f=Ft(b)+(s.offsetX||0),g=ln(L)+(s.offsetY||0)}else if(cn.value||Un.value){const b=Math.PI*2/t.logos.length*n;f=_t.value+Math.cos(b)*(it.value+30)+(s.offsetX||0),g=ht.value+Math.sin(b)*(it.value+30)+(s.offsetY||0)}return{...s,x:f,y:g,seriesIndex:s.seriesIndex}}).filter(Boolean)}),en=t=>{const s=document.querySelector(`.dss-logo-fallback-${t}`),n=document.querySelector(`.dss-logo-image-${t}`);s&&(s.style.opacity="0"),n&&(n.style.opacity="1")},Kt=t=>{console.warn(`Logo ${t} failed to load, keeping fallback circle`);const s=document.querySelector(`.dss-logo-image-${t}`);s&&(s.style.display="none")},Rn=t=>{Vt.value.has(t)?Vt.value.delete(t):Vt.value.add(t)},rl=e.computed(()=>{if(!et.value.show&&!(Ct.value&&Se.value.show&&!G.value.isZooming))return{display:"none"};let t,s;if(Ct.value&&Se.value.show&&!G.value.isZooming){t=Se.value.x+15,s=I.value.top;const n=zt.value?200:150;t+n>we.value&&(t=Se.value.x-n-15),t<0&&(t=10),s<10&&(s=10)}else t=et.value.x,s=et.value.y;return{left:t+"px",top:s+"px"}}),kn=(t,s)=>{if(!Yt.value||El.value)return;const i=s.target.closest(".dss-custom-chart-container").getBoundingClientRect();let f=s.clientX-i.left+10,g=s.clientY-i.top-10;const x=200,b=120,L=we.value,T=ut.value;f+x>L&&(f=s.clientX-i.left-x-10),g+b>T&&(g=s.clientY-i.top-b-10),f<0&&(f=10),g<0&&(g=10);let H;typeof t.categoryIndex=="number"?H=t.categoryIndex:typeof t.dataIndex=="number"?H=t.dataIndex:t.label&&S.categories.includes(t.label)&&(H=S.categories.indexOf(t.label));const M=(nn.value||ge.value==="bar")&&t.label?t.label:t.seriesName||t.label||"";et.value={show:!0,x:f,y:g,title:M,value:an(t.value)||"",categoryIndex:H,spiderSeries:[]}},Fl=e.ref(!1),$l=e.ref(!1),jn=()=>{et.value.show=!1,et.value.spiderSeries=[],et.value.bubbleData=[],Se.value.show=!1,Fl.value||(Ee.value=null)},El=e.ref(!1),Il=(t,s)=>{El.value=!0,et.value.show=!1,Se.value.show=!1;const i=s.target.closest(".dss-custom-chart-container").getBoundingClientRect();let f=s.clientX-i.left+15,g=s.clientY-i.top-10;const x=250;f+x>we.value&&(f=s.clientX-i.left-x-15),f<0&&(f=10),g<0&&(g=10),An.value={show:!0,x:f,y:g,content:t.texts,count:t.totalCount}},Vl=()=>{El.value=!1,An.value.show=!1},gt=e.ref({isAnimating:!1,currentFrame:0,totalFrames:0,animationId:null,hasAnimated:!1}),zl=(t,s)=>{switch(t){case"linear":return s;case"ease":return s<.5?2*s*s:-1+(4-2*s)*s;case"ease-in":return s*s;case"ease-out":return s*(2-s);case"ease-in-out":return s<.5?2*s*s:-1+(4-2*s)*s;default:return s}},un=e.computed(()=>re.value?window.matchMedia("(prefers-reduced-motion: reduce)").matches:!1),Kn=()=>{if(!C.value||un.value){gt.value.hasAnimated=!0,Sn.value&&($n.value=1);return}Sn.value&&($n.value=0),gt.value.isAnimating=!0,gt.value.currentFrame=0,gt.value.totalFrames=Math.ceil(P.value/16.67);const t=()=>{const s=gt.value.currentFrame/gt.value.totalFrames,n=zl(ze.value,Math.min(s,1));Wn(n),Sn.value&&($n.value=n),s<1?(gt.value.currentFrame++,gt.value.animationId=requestAnimationFrame(t)):Po()};gt.value.animationId=requestAnimationFrame(t)},Wn=t=>{const s=k.value;s&&s.style.setProperty("--dss-animation-progress",t)},Po=()=>{gt.value.isAnimating=!1,gt.value.hasAnimated=!0,Sn.value&&($n.value=1),gt.value.animationId&&(cancelAnimationFrame(gt.value.animationId),gt.value.animationId=null)},Ho=e.computed(()=>!cn.value||gt.value.hasAnimated?!0:Sn.value?$n.value>=1:Nn.value?yl.value>=1:!0),Oo=e.computed(()=>tn.value&&Ho.value),xo=e.ref(!1);e.watch(Oo,t=>{t?(xo.value=!1,e.nextTick(()=>{requestAnimationFrame(()=>{xo.value=!0})})):xo.value=!1},{immediate:!0});const Yo=e.computed(()=>{if(!C.value||un.value||gt.value.hasAnimated)return{};const t={};return t["--dss-animation-duration"]=`${P.value}ms`,t["--dss-animation-easing"]=jo(ze.value),t["--dss-stagger-delay"]=`${Re.value}ms`,t}),jo=t=>({linear:"linear",ease:"ease","ease-in":"ease-in","ease-out":"ease-out","ease-in-out":"ease-in-out"})[t]||"ease-out",Ko=()=>{if(!C.value||un.value)return"";const t=["dss-chart-animated"];return gt.value.hasAnimated||t.push(`dss-animate-${V.value}`),gt.value.hasAnimated||(cn.value&&ge.value!=="semi-radial"?t.push("dss-animate-fill"):cn.value||t.push(`dss-animate-${V.value}`)),gt.value.isAnimating&&t.push("dss-is-animating"),t.join(" ")};e.watch(()=>S.series,(t,s)=>{De.value&&s&&gt.value.hasAnimated&&(gt.value.hasAnimated=!1,e.nextTick(()=>{setTimeout(()=>Kn(),U.value)}))},{deep:!0}),e.watch(()=>G.value.isZooming,(t,s)=>{s&&!t&&setTimeout(()=>{ql()},50)}),e.watch(()=>[G.value.scale,G.value.offsetX],()=>{!G.value.isZooming&&!G.value.isDragging&&ql()},{flush:"post"}),e.watch([fe,Ne],([t,s])=>{G.value.minScale=t,G.value.maxScale=s,(G.value.scale<t||G.value.scale>s)&&Yl()},{immediate:!0}),e.watch(()=>S.locale,t=>{t&&t!==A.value&&(A.value=t)},{immediate:!0}),e.watch(()=>Be.value.show,t=>{t?e.nextTick(()=>{document.addEventListener("click",Al)}):document.removeEventListener("click",Al)}),e.onMounted(()=>{Ee.value=null,Sn.value&&(!C.value||un.value)&&($n.value=1),mn(),k.value&&typeof ResizeObserver<"u"&&(ue=new ResizeObserver(t=>{const s=t[0];!s||!s.contentRect||(ve&&cancelAnimationFrame(ve),ve=requestAnimationFrame(()=>{ve=null;const{width:n,height:i}=s.contentRect;pt.value=Math.round(n),p.value=Math.round(i),se.value&&(xt.value=se.value.offsetHeight||de)}))}),ue.observe(k.value)),C.value&&!un.value?ge.value==="semi-radial"?setTimeout(()=>Bo(),U.value):setTimeout(()=>Kn(),U.value):(gt.value.hasAnimated=!0,ge.value==="semi-radial"&&(yl.value=1)),document.addEventListener("mousemove",Zo),document.addEventListener("mouseup",Wo),document.addEventListener("click",Xl)}),e.onUnmounted(()=>{ve&&cancelAnimationFrame(ve),ue&&k.value&&(ue.unobserve(k.value),ue.disconnect(),ue=null),gt.value.animationId&&cancelAnimationFrame(gt.value.animationId),Ml&&(cancelAnimationFrame(Ml),Ml=null),G.value.zoomTimeout&&clearTimeout(G.value.zoomTimeout),document.removeEventListener("mousemove",Zo),document.removeEventListener("mouseup",Wo),document.removeEventListener("click",Xl),document.removeEventListener("click",Al)});const Zo=t=>{if(G.value.isDragging&&G.value.scale>1&&fn.value){Se.value.show=!1;const s=t.clientX-G.value.lastMouseX,{minX:n,maxX:i}=Ut.value,f=i-n||1,x=s*.8;G.value.offsetX+=x;const b=f/G.value.scale,L=f-b,T=0,H=-L/f*I.value.width,M=T;G.value.offsetX=Math.max(H,Math.min(M,G.value.offsetX)),G.value.lastMouseX=t.clientX,G.value.lastMouseY=t.clientY}},Wo=()=>{G.value.isDragging&&(G.value.isDragging=!1,setTimeout(()=>{!G.value.isDragging&&G.value.isZooming},100))},Go=(t,s)=>{const n=t.filter(b=>b!=null);if(!n||n.length===0)return{x:0,y:0};if(n.length===1||s<=0)return n[0];if(s>=1)return n[n.length-1];let i=0;const f=[];for(let b=1;b<n.length;b++){const L=n[b].x-n[b-1].x,T=n[b].y-n[b-1].y,H=Math.sqrt(L*L+T*T);f.push(H),i+=H}const g=i*s;let x=0;for(let b=0;b<f.length;b++){const L=x+f[b];if(g<=L){const T=(g-x)/f[b],H=n[b],M=n[b+1];return{x:H.x+(M.x-H.x)*T,y:H.y+(M.y-H.y)*T}}x=L}return n[n.length-1]};return(t,s)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{class:e.normalizeClass(["dss-custom-chart-container",[Ko(),{"dss-chart-fill-width":rt.value,"dss-chart-fill-height":Oe.value,"dss-chart-compact":cn.value&&!Bt.value}]]),style:e.normalizeStyle({width:rt.value?"100%":we.value+"px",height:Ze.value,...rt.value||Oe.value?{overflow:"hidden",maxWidth:"100%",maxHeight:"100%"}:{},...Yo.value,cursor:No()}),"data-chart-type":ge.value,ref_key:"containerEl",ref:k,onWheel:vo,onMousedown:Vo,onMousemove:mt,onMouseup:go,onMouseleave:ot,onDblclick:Yl,onContextmenu:e.withModifiers(Ht,["prevent"]),onClick:e.withModifiers(It,["left"]),onWheelCapture:vo},[e.createElementVNode("div",{class:"dss-chart-header",ref_key:"headerEl",ref:se},[e.createElementVNode("div",Wa,[St.value?(e.openBlock(),e.createElementBlock("div",qa,e.toDisplayString(St.value),1)):e.createCommentVNode("",!0),at.value?(e.openBlock(),e.createElementBlock("div",Ua,e.toDisplayString(at.value),1)):e.createCommentVNode("",!0)]),Bt.value&&Xe.value==="top"?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["dss-chart-legend",{"dss-legend-horizontal":Zt.value==="horizontal","dss-legend-vertical":Zt.value==="vertical","dss-legend-top":Xe.value==="top","dss-legend-bottom":Xe.value==="bottom"}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(S.series,(n,i)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-${i}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":Vt.value.has(i),"dss-legend-hovered":Ee.value===i,"dss-legend-dimmed":Ee.value!==null&&Ee.value!==i}]),onClick:f=>Rn(i),onMouseenter:f=>W(i),onMouseleave:ae,style:e.normalizeStyle({animationDelay:`${i*100}ms`})},[e.createElementVNode("div",{class:"dss-legend-color",style:e.normalizeStyle({backgroundColor:Nt(i)})},null,4),e.createElementVNode("span",Ya,e.toDisplayString(n.name),1)],46,Xa))),128))],2)):e.createCommentVNode("",!0),Bt.value&&(Xe.value==="left"||Xe.value==="right")?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["dss-chart-legend-side",{"dss-legend-left":Xe.value==="left","dss-legend-right":Xe.value==="right"}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(S.series,(n,i)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-${i}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":Vt.value.has(i),"dss-legend-hovered":Ee.value===i,"dss-legend-dimmed":Ee.value!==null&&Ee.value!==i}]),onClick:f=>Rn(i),onMouseenter:f=>W(i),onMouseleave:ae,style:e.normalizeStyle({animationDelay:`${i*100}ms`})},[e.createElementVNode("div",{class:"dss-legend-color",style:e.normalizeStyle({backgroundColor:Nt(i)})},null,4),e.createElementVNode("span",Ka,e.toDisplayString(n.name),1)],46,ja))),128))],2)):e.createCommentVNode("",!0)],512),F.showAddMarkerButton&&vn.value&&jt.value.addMarker&&(fn.value||zt.value)?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-add-marker-button",onClick:Eo,title:e.unref(z)("chart.contextMenu.addMarker")},[e.createElementVNode("img",{src:bn.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,Qa),s[4]||(s[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,Ga)):e.createCommentVNode("",!0),e.createElementVNode("div",Ja,[zt.value&&$t.value?(e.openBlock(),e.createElementBlock("div",es,"Bubble size: "+e.toDisplayString($t.value),1)):e.createCommentVNode("",!0),(e.openBlock(),e.createElementBlock("svg",{width:we.value,height:ut.value,class:"dss-chart-svg","data-smooth":Z.value,"data-animated":C.value,ref_key:"svgEl",ref:Le},[e.createElementVNode("defs",null,[e.createElementVNode("clipPath",ns,[e.createElementVNode("rect",{x:0,y:I.value.top,width:we.value,height:I.value.height*4},null,8,ls)]),Nn.value?(e.openBlock(),e.createElementBlock("clipPath",{key:0,id:Xn.value},[e.createElementVNode("path",{d:qt.value},null,8,as)],8,os)):e.createCommentVNode("",!0),Sn.value?(e.openBlock(),e.createElementBlock("clipPath",{key:1,id:al.value},[e.createElementVNode("path",{d:fl.value},null,8,rs)],8,ss)):e.createCommentVNode("",!0)]),fn.value||zt.value?(e.openBlock(),e.createElementBlock("g",is,[Lt.value?(e.openBlock(),e.createElementBlock("g",cs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(bo.value,(n,i)=>(e.openBlock(),e.createElementBlock("line",{key:`h-grid-${i}`,x1:I.value.left,x2:I.value.right,y1:n.y,y2:n.y,stroke:"#e0e0e0","stroke-width":"1","stroke-dasharray":"4,2",style:e.normalizeStyle({animationDelay:`${i*50}ms`})},null,12,us))),128))])):e.createCommentVNode("",!0),e.createElementVNode("g",ds,[e.createElementVNode("line",{x1:I.value.left,x2:I.value.right,y1:I.value.bottom,y2:I.value.bottom,stroke:"#ccc","stroke-width":"1"},null,8,ms),e.createElementVNode("line",{x1:I.value.left,x2:I.value.left,y1:I.value.top,y2:I.value.bottom,stroke:"#ccc","stroke-width":"1"},null,8,ps)]),e.createElementVNode("g",fs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Dl.value,(n,i)=>(e.openBlock(),e.createElementBlock("text",{key:`x-${i}`,x:n.x,y:n.y,"text-anchor":"middle","font-size":"12",fill:"#666",style:e.normalizeStyle({animationDelay:`${i*100}ms`})},e.toDisplayString(n.text),13,vs))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(wl.value,(n,i)=>(e.openBlock(),e.createElementBlock("text",{key:`y-${i}`,x:n.x,y:n.y,"text-anchor":"end","font-size":"12",fill:"#666","dominant-baseline":"middle",style:e.normalizeStyle({animationDelay:`${i*80}ms`})},e.toDisplayString(n.text),13,gs))),128)),Ot.value?(e.openBlock(),e.createElementBlock("text",{key:0,x:I.value.left+I.value.width/2,y:I.value.bottom+45,"text-anchor":"middle","font-size":"14","font-weight":"bold",fill:"#333"},e.toDisplayString(Ot.value),9,hs)):e.createCommentVNode("",!0),on.value?(e.openBlock(),e.createElementBlock("text",{key:1,x:15,y:I.value.top+12+I.value.height/2,"text-anchor":"middle","font-size":"14","font-weight":"bold",fill:"#333",transform:`rotate(-90, 15, ${I.value.top+I.value.height/2})`},e.toDisplayString(on.value),9,ys)):e.createCommentVNode("",!0)]),ul.value.length>0?(e.openBlock(),e.createElementBlock("g",Cs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ul.value,n=>(e.openBlock(),e.createElementBlock("g",{key:`flag-group-${n.categoryIndex}`},[e.createElementVNode("g",ks,[n.hasManual?(e.openBlock(),e.createElementBlock("line",{key:0,x1:n.x,x2:n.x,y1:I.value.bottom,y2:I.value.top,stroke:"#047395","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:i=>Il(n,i),onMouseleave:Vl},null,40,bs)):e.createCommentVNode("",!0),n.hasAuto&&!n.hasManual?(e.openBlock(),e.createElementBlock("line",{key:1,x1:n.x,x2:n.x,y1:I.value.bottom,y2:I.value.top,stroke:"#0dbf89","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:i=>Il(n,i),onMouseleave:Vl},null,40,ws)):e.createCommentVNode("",!0),n.hasAuto&&n.hasManual?(e.openBlock(),e.createElementBlock("line",{key:2,x1:n.x,x2:n.x,y1:I.value.bottom,y2:I.value.top,stroke:"#047395","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:i=>Il(n,i),onMouseleave:Vl},null,40,xs)):e.createCommentVNode("",!0)]),n.hasManual&&n.hasAuto?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:n.x+8,cy:Math.max(15,I.value.top-10),r:"14",fill:"#0dbf89",stroke:"#fafafa","stroke-width":"2",class:"flag-count-circle",onMouseover:i=>Il(n,i),onMouseleave:Vl},null,40,Es)):e.createCommentVNode("",!0),e.createElementVNode("circle",{cx:n.x,cy:Math.max(15,I.value.top-10),r:"14",fill:n.hasManual&&n.hasAuto||n.hasManual?"#047395":"#0dbf89",stroke:"#fafafa","stroke-width":"2",class:"dss-flag-count-indicator",onMouseover:i=>Il(n,i),onMouseleave:Vl},null,40,Vs),e.createElementVNode("text",{x:n.x,y:Math.max(15,I.value.top-5),"text-anchor":"middle","font-size":"12","font-weight":"bold",fill:"#fafafa",class:"dss-flag-count-text","pointer-events":"none"},e.toDisplayString(n.totalCount),9,Ns)]))),128))])):e.createCommentVNode("",!0),e.createElementVNode("g",Ss,[On.value?(e.openBlock(),e.createElementBlock("g",Bs,[e.createElementVNode("g",{class:e.normalizeClass(["dss-bar-chart",{"dss-horizontal-bars":nn.value}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(no.value,(n,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`mixed-bar-${i}`},[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:f=>kn(n,f),onMouseleave:jn},null,46,Ms)):(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:f=>kn(n,f),onMouseleave:jn},null,46,_s))],64))),128))],2),e.createElementVNode("g",$s,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(wo.value,(n,i)=>(e.openBlock(),e.createElementBlock("path",{key:`mixed-line-${i}`,d:n.path,stroke:n.color,"stroke-width":n.isHighlighted?We.value+2:We.value,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,Ts))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_l.value,(n,i)=>(e.openBlock(),e.createElementBlock("path",{key:`mixed-gap-connector-${i}`,d:n.path,stroke:n.color,"stroke-width":n.isHighlighted?We.value+2:We.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,Ls))),128)),qe.value>0||dt.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(vl.value,(n,i)=>(e.openBlock(),e.createElementBlock("circle",{key:`mixed-point-${i}`,cx:n.x,cy:n.y,r:Ue(n.isHighlighted?xe(n,qe.value)+2:xe(n,qe.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:f=>kn(n,f),onMouseleave:jn},null,46,Hs))),128)):e.createCommentVNode("",!0)])])):ge.value==="line"?(e.openBlock(),e.createElementBlock("g",As,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Zn.value,(n,i)=>(e.openBlock(),e.createElementBlock("path",{key:`anim-${i}`,d:n.path,stroke:n.color,"stroke-width":We.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass(["dss-line-animation-overlay",{"dss-animation-complete":gt.value.hasAnimated}]),style:e.normalizeStyle({"--dss-path-length":n.pathLength,animationDelay:`${n.animationDelay}ms`})},null,14,Ds))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(wo.value,(n,i)=>(e.openBlock(),e.createElementBlock("path",{key:`line-${i}`,d:n.path,stroke:n.color,"stroke-width":n.isHighlighted?We.value+2:We.value,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,Rs))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_l.value,(n,i)=>(e.openBlock(),e.createElementBlock("path",{key:`gap-connector-${i}`,d:n.path,stroke:n.color,"stroke-width":n.isHighlighted?We.value+2:We.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,Fs))),128)),qe.value>0||dt.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(Lo.value,(n,i)=>(e.openBlock(),e.createElementBlock("circle",{key:`point-${i}`,cx:n.x,cy:n.y,r:Ue(n.isHighlighted?xe(n,qe.value)+2:xe(n,qe.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:f=>kn(n,f),onMouseleave:jn},null,46,Is))),128)):e.createCommentVNode("",!0)])):ge.value==="area"?(e.openBlock(),e.createElementBlock("g",zs,[e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(to.value,(n,i)=>(e.openBlock(),e.createElementBlock("mask",{key:`mask-${i}`,id:`area-mask-${i}-${F.chartId}`},[e.createElementVNode("rect",{x:I.value.left-10,y:I.value.top-10,width:I.value.width+20,height:I.value.height+20,fill:"#fafafa",class:"dss-area-mask-rect",style:e.normalizeStyle({"--dss-mask-width":`${I.value.width+20}px`})},null,12,Os)],8,Ps))),128))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(to.value,(n,i)=>(e.openBlock(),e.createElementBlock("path",{key:`area-fill-${i}`,d:n.areaPath,fill:n.color,"fill-opacity":n.isHighlighted?X.value+.2:X.value,mask:`url(#area-mask-${i}-${F.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,Zs))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(to.value,(n,i)=>(e.openBlock(),e.createElementBlock("path",{key:`area-line-${i}`,d:n.linePath,stroke:n.color,"stroke-width":n.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":n.isHighlighted,"dss-series-dimmed":n.isDimmed,"dss-series-hidden":n.isHidden}),style:e.normalizeStyle({"--dss-path-length":n.pathLength,animationDelay:`${i*Re.value}ms`})},null,14,Ws))),128))])):ge.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(no.value,(n,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`bar-${i}`},[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:f=>kn(n,f),onMouseleave:jn},null,46,qs)):(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:f=>kn(n,f),onMouseleave:jn},null,46,Us))],64))),128))],2)):e.createCommentVNode("",!0)]),Ct.value&&Se.value.show&&!G.value.isZooming?(e.openBlock(),e.createElementBlock("g",Xs,[e.createElementVNode("line",{x1:Se.value.x,x2:Se.value.x,y1:I.value.top,y2:I.value.bottom,stroke:te.value,"stroke-width":"1","stroke-dasharray":"4,4",opacity:"0.8"},null,8,Ys),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Se.value.data,(n,i)=>(e.openBlock(),e.createElementBlock("circle",{key:`dss-crosshair-point-${i}`,cx:Se.value.x,cy:n.y,r:Ue(qe.value+2),fill:n.color,stroke:"none",opacity:"0.9"},null,8,js))),128))])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),zt.value?(e.openBlock(),e.createElementBlock("g",Ks,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(xl.value,(n,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`bubble-${i}`},[n?(e.openBlock(),e.createElementBlock("g",Gs,[e.createElementVNode("circle",{cx:n.x,cy:n.y,r:Ue(n.radius),fill:n.color,"fill-opacity":a(n),stroke:n.color,"stroke-width":"1","stroke-opacity":"0.8",class:e.normalizeClass(d(n,i)),style:{cursor:"pointer",transition:"all 0.3s ease"},onMouseenter:f=>u(n,f),onMouseleave:f=>h(n),onClick:f=>c(n,f)},null,42,Qs),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-${i} ${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:r(n)}),onLoad:f=>Mo(i),onError:f=>_o(i),onMouseenter:f=>u(n,f),onMouseleave:f=>h(n),onClick:f=>c(n,f)},null,46,Js)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],64))),128))])):e.createCommentVNode("",!0),cn.value?(e.openBlock(),e.createElementBlock("g",{key:2,class:"radial-chart",transform:ho.value},[ge.value==="radial"?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:_t.value,cy:ht.value,r:it.value,fill:"none",stroke:"#e0e0e0","stroke-width":"1"},null,8,tr)):e.createCommentVNode("",!0),e.createElementVNode("g",{class:"dss-radial-data","data-chart-type":ge.value,"clip-path":Cl.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value,(n,i)=>(e.openBlock(),e.createElementBlock("path",{key:`radial-${n.originalIndex}-${i}`,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":yo(n.originalIndex),class:e.normalizeClass({"dss-series-highlighted":n.segment.isHighlighted,"dss-series-dimmed":n.segment.isDimmed,"dss-series-hidden":n.segment.isHidden}),onMouseover:f=>kn(n.segment,f),onMouseleave:jn},null,42,lr))),128))],8,nr),zn.value&&Ho.value?(e.openBlock(),e.createElementBlock("g",or,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Zl.value,(n,i)=>e.withDirectives((e.openBlock(),e.createElementBlock("text",{key:`radial-segment-label-${i}`,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,ar)),[[e.vShow,n.show]])),128))])):e.createCommentVNode("",!0),Tl.value&&(Ho.value||Nn.value)?(e.openBlock(),e.createElementBlock("text",{key:2,x:gn.value.x,y:gn.value.y,"text-anchor":"middle","dominant-baseline":"middle","font-size":gl.value,fill:hn.value,class:"dss-radial-data-center"},e.toDisplayString(Sl.value),9,sr)):e.createCommentVNode("",!0),Oo.value?(e.openBlock(),e.createElementBlock("g",{key:3,class:e.normalizeClass(["dss-radial-labels dss-radial-labels-initial",{"dss-radial-labels-animated":xo.value}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.value,(n,i)=>(e.openBlock(),e.createElementBlock("g",{key:`radial-label-${i}`,class:e.normalizeClass(["dss-radial-label-group",{"dss-label-highlighted":n.isHighlighted,"dss-label-dimmed":n.isDimmed}]),style:e.normalizeStyle({"--label-delay":`${i*.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,rr),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,ir),e.createElementVNode("text",{class:"dss-radial-label-text",x:n.textX,y:n.textY,"text-anchor":n.textAnchor,"font-size":Hn.value,"dominant-baseline":"middle"},e.toDisplayString(n.text),9,cr)],6))),128))],2)):e.createCommentVNode("",!0)],8,er)):e.createCommentVNode("",!0),Un.value?(e.openBlock(),e.createElementBlock("g",{key:3,class:"dss-spider-chart",transform:ho.value},[Lt.value?(e.openBlock(),e.createElementBlock("g",dr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(wt.value,(n,i)=>(e.openBlock(),e.createElementBlock("circle",{key:`spider-grid-circle-${i}`,cx:_t.value,cy:ht.value,r:Ue(n),fill:"none",stroke:"#dedede","stroke-width":"1",style:e.normalizeStyle({animationDelay:`${i*150}ms`})},null,12,mr))),128)),e.createElementVNode("g",pr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(wt.value,(n,i)=>(e.openBlock(),e.createElementBlock("g",{key:`spider-grid-label-group-${i}`},[e.createElementVNode("rect",{x:_t.value-16,y:ht.value-n-7,width:"32",height:"16",fill:"transparent",stroke:"none"},null,8,fr),e.createElementVNode("text",{x:_t.value,y:ht.value-n+2,"text-anchor":"middle","dominant-baseline":"central",class:"dss-spider-grid-label",style:{fontSize:"10px",fill:"#999",fontWeight:"600"}},e.toDisplayString(vt(i)),9,vr)]))),128))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Y.value,(n,i)=>(e.openBlock(),e.createElementBlock("line",{key:`spider-axis-${i}`,x1:_t.value,x2:n.x,y1:ht.value,y2:n.y,stroke:"#dedede","stroke-width":"1",style:e.normalizeStyle({animationDelay:`${i*100}ms`})},null,12,gr))),128))])):e.createCommentVNode("",!0),e.createElementVNode("g",hr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Te.value,(n,i)=>(e.openBlock(),e.createElementBlock("text",{key:`spider-label-${i}`,x:n.x+Math.cos(i*2*Math.PI/N.value-Math.PI/2)*16,y:n.y+Math.sin(i*2*Math.PI/N.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:`${i*120}ms`})},e.toDisplayString(n.text.charAt(0).toUpperCase()+n.text.slice(1)),13,yr))),128))]),e.createElementVNode("g",{class:"dss-spider-data",onMousemove:Xt,onMouseleave:jn},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Qt.value,(n,i)=>(e.openBlock(),e.createElementBlock("g",{key:`spider-${i}`},[e.createElementVNode("polygon",{points:n.points,fill:n.color,"fill-opacity":ct("current",n,i),stroke:n.color,"stroke-width":n.isHighlighted?We.value+1:We.value,"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:`${i*Re.value}ms`,transition:"all 0.2s ease"})},null,14,Cr),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.dataPoints,(f,g)=>(e.openBlock(),e.createElementBlock("circle",{key:`spider-point-${i}-${g}`,cx:f.x,cy:f.y,r:Ue(n.isHighlighted?qe.value+1:qe.value>0?qe.value:0),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:`${i*Re.value+g*50}ms`,transition:"all 0.2s ease"}),onMouseover:x=>kn(f,x),onMouseleave:jn},null,46,kr))),128))]))),128))],32)],8,ur)):e.createCommentVNode("",!0),e.createElementVNode("g",br,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Pt.value,(n,i)=>(e.openBlock(),e.createElementBlock("circle",{key:`logo-fallback-${i}`,cx:n.x,cy:n.y,r:Ue(n.width/2),fill:Nt(n.seriesIndex),stroke:"#fafafa","stroke-width":"2",class:e.normalizeClass(`logo-fallback-${i}`),style:e.normalizeStyle({animationDelay:`${i*200}ms`})},null,14,wr))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Pt.value,(n,i)=>(e.openBlock(),e.createElementBlock("image",{key:`logo-${i}`,x:n.x-n.width/2,y:n.y-n.height/2,width:n.width,height:n.height,"xlink:href":n.url,onLoad:f=>en(i),onError:f=>Kt(i),preserveAspectRatio:"xMidYMid slice",class:e.normalizeClass(`dss-logo-image-${i}`),"clip-path":`circle(${n.width/2}px at ${n.width/2}px ${n.height/2}px)`,style:e.normalizeStyle({animationDelay:`${i*200}ms`})},null,46,xr))),128))])],8,ts))]),q.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-chart-watermark",style:e.normalizeStyle({position:"absolute",top:"0px",left:"0px",width:we.value+"px",height:ut.value+"px",backgroundImage:`url('${Ln.value}')`,backgroundRepeat:"no-repeat",...st.value,opacity:R.value,pointerEvents:"none",zIndex:10})},null,4)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(D.value,(n,i)=>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:Wt.value+"px",height:Wt.value+"px",backgroundColor:"#fafafa",borderRadius:"50%",border:"2px solid #ddd",cursor:"pointer",zIndex:500}),onClick:e.withModifiers(f=>po(n),["stop"]),onMouseenter:f=>_(n,f),onMouseleave:$},[e.createElementVNode("img",{src:ro(n),class:"dss-marker-icon",alt:"Marker Icon",style:{width:"100%",height:"100%","object-fit":"contain","border-radius":"50%","pointer-events":"none"}},null,8,Vr)],44,Er)),[[e.vShow,qn.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",Nr,e.toDisplayString(rn.value.categoryValue),1),rn.value.description?(e.openBlock(),e.createElementBlock("div",Sr,e.toDisplayString(rn.value.description),1)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),Yt.value&&(et.value.show||Ct.value&&Se.value.show&&!G.value.isZooming)?(e.openBlock(),e.createElementBlock("div",{key:3,class:e.normalizeClass(["dss-chart-tooltip",{"dss-crosshair-tooltip":Ct.value&&Se.value.show&&!G.value.isZooming}]),style:e.normalizeStyle(rl.value)},[!Ct.value||!Se.value.show||G.value.isZooming?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[Un.value&&et.value.spiderSeries&&et.value.spiderSeries.length>0?(e.openBlock(),e.createElementBlock("div",Br,[et.value.title?(e.openBlock(),e.createElementBlock("div",Mr,e.toDisplayString(et.value.title),1)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(et.value.spiderSeries,(n,i)=>(e.openBlock(),e.createElementBlock("div",{key:`spider-tooltip-${i}`,class:"dss-tooltip-series"},[e.createElementVNode("div",{class:"dss-tooltip-series-indicator",style:e.normalizeStyle({backgroundColor:n.color})},null,4),e.createElementVNode("span",_r,e.toDisplayString(n.seriesName)+":",1),e.createElementVNode("span",$r,e.toDisplayString(n.value),1)]))),128))])):zt.value&&et.value.bubbleData&&et.value.bubbleData.length>0?(e.openBlock(),e.createElementBlock("div",Tr,[et.value.title?(e.openBlock(),e.createElementBlock("div",Lr,e.toDisplayString(et.value.title),1)):e.createCommentVNode("",!0),e.createElementVNode("div",Hr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(et.value.bubbleData,(n,i)=>(e.openBlock(),e.createElementBlock("div",{key:`bubble-tooltip-${i}`,class:"dss-bubble-tooltip-item"},e.toDisplayString(n.value),1))),128))])])):(e.openBlock(),e.createElementBlock("div",Ar,[e.createElementVNode("div",Dr,e.toDisplayString(et.value.title),1),e.createElementVNode("div",Rr,e.toDisplayString(et.value.value),1)])),et.value.categoryIndex!==void 0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[Ke(et.value.categoryIndex).flagGroups.length>0?(e.openBlock(),e.createElementBlock("div",Fr,[s[5]||(s[5]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",Ir,e.toDisplayString(e.unref(z)("chart.tooltip.flags")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ke(et.value.categoryIndex).flagGroups,(n,i)=>(e.openBlock(),e.createElementBlock("div",{key:`tooltip-flag-group-${i}`},[e.createElementVNode("div",zr,[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,(f,g)=>(e.openBlock(),e.createElementBlock("div",{key:`tooltip-flag-${i}-${g}`,class:"dss-tooltip-item dss-tooltip-item-no-indicator"},[e.createElementVNode("div",Pr,[e.createElementVNode("div",Or,e.toDisplayString(f.text),1)])]))),128))]))),128))])):e.createCommentVNode("",!0),Ke(et.value.categoryIndex).markers.length>0?(e.openBlock(),e.createElementBlock("div",Zr,[s[6]||(s[6]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",Wr,e.toDisplayString(e.unref(z)("chart.tooltip.markers")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ke(et.value.categoryIndex).markers,(n,i)=>(e.openBlock(),e.createElementBlock("div",{key:`tooltip-marker-${i}`,class:"dss-tooltip-item"},[e.createElementVNode("div",{class:"dss-tooltip-item-indicator",style:e.normalizeStyle({backgroundColor:n.color})},null,4),e.createElementVNode("div",qr,[e.createElementVNode("div",Ur,e.toDisplayString(n.title),1),n.description?(e.openBlock(),e.createElementBlock("div",Xr,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",Yr,[e.createElementVNode("div",jr,e.toDisplayString(zt.value?v():F.categories[Se.value.categoryIndex]||`Category ${Se.value.categoryIndex+1}`),1),zt.value?(e.openBlock(),e.createElementBlock("div",Kr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Se.value.data,(n,i)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-tooltip-${i}`,class:"dss-bubble-tooltip-item"},e.toDisplayString(n.value),1))),128))])):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(Se.value.data,(n,i)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-tooltip-${i}`,class:"dss-tooltip-series"},[e.createElementVNode("div",{class:"dss-tooltip-series-indicator",style:e.normalizeStyle({backgroundColor:n.color})},null,4),e.createElementVNode("span",Gr,e.toDisplayString(n.seriesName)+":",1),e.createElementVNode("span",Qr,e.toDisplayString(an(n.value)),1)]))),128))]),Ke(Se.value.categoryIndex).flagGroups.length>0?(e.openBlock(),e.createElementBlock("div",Jr,[s[7]||(s[7]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",ei,e.toDisplayString(e.unref(z)("chart.tooltip.flags")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ke(Se.value.categoryIndex).flagGroups,(n,i)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-flag-group-${i}`},[e.createElementVNode("div",ti,[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,(f,g)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-flag-${i}-${g}`,class:"dss-tooltip-item dss-tooltip-item-no-indicator"},[e.createElementVNode("div",ni,[e.createElementVNode("div",li,e.toDisplayString(f.text),1)])]))),128))]))),128))])):e.createCommentVNode("",!0),Ke(Se.value.categoryIndex).markers.length>0?(e.openBlock(),e.createElementBlock("div",oi,[s[8]||(s[8]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",ai,e.toDisplayString(e.unref(z)("chart.tooltip.markers")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ke(Se.value.categoryIndex).markers,(n,i)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-dss-marker-${i}`,class:"dss-tooltip-item"},[e.createElementVNode("div",{class:"dss-tooltip-item-indicator",style:e.normalizeStyle({backgroundColor:n.color})},null,4),e.createElementVNode("div",si,[e.createElementVNode("div",ri,e.toDisplayString(n.title),1),n.description?(e.openBlock(),e.createElementBlock("div",ii,e.toDisplayString(n.description),1)):e.createCommentVNode("",!0)])]))),128))])):e.createCommentVNode("",!0)],64))],6)):e.createCommentVNode("",!0),fn.value&&$e.value&&G.value.scale>1?(e.openBlock(),e.createElementBlock("div",{key:4,class:"dss-zoom-indicator",onClick:Yl},[s[9]||(s[9]=e.createElementVNode("span",{style:{display:"inline-block",transform:"scaleX(-1)","font-size":"14px"}},"⌕",-1)),e.createTextVNode(" "+e.toDisplayString(Math.round(G.value.scale*100))+"% "+e.toDisplayString(e.unref(z)("chart.zoom.doubleClickToReset")),1)])):e.createCommentVNode("",!0)],46,Za),Bt.value&&Xe.value==="bottom"?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["dss-chart-legend",{"dss-legend-horizontal":Zt.value==="horizontal","dss-legend-vertical":Zt.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(S.series,(n,i)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-bottom-${i}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":Vt.value.has(i),"dss-legend-hovered":Ee.value===i,"dss-legend-dimmed":Ee.value!==null&&Ee.value!==i}]),onClick:f=>Rn(i),onMouseenter:f=>W(i),onMouseleave:ae,style:e.normalizeStyle({animationDelay:`${i*100}ms`})},[e.createElementVNode("div",{class:"dss-legend-color",style:e.normalizeStyle({backgroundColor:Nt(i)})},null,4),e.createElementVNode("span",ui,e.toDisplayString(n.name),1)],46,ci))),128))],2)):e.createCommentVNode("",!0),Be.value.show?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-chart-context-menu",style:e.normalizeStyle({left:Be.value.x+"px",top:Be.value.y+"px"}),onClick:s[0]||(s[0]=e.withModifiers(()=>{},["stop"]))},[jt.value.addMarker?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-context-menu-item",onClick:Bl},e.toDisplayString(e.unref(z)("chart.contextMenu.addMarker")),1)):e.createCommentVNode("",!0),jt.value.addMarker&&(jt.value.downloadSvg||jt.value.downloadPng||jt.value.downloadCsv||Tn.value.length>0)?(e.openBlock(),e.createElementBlock("div",di)):e.createCommentVNode("",!0),jt.value.downloadSvg?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-context-menu-item",onClick:tl},e.toDisplayString(e.unref(z)("chart.contextMenu.downloadSvg")),1)):e.createCommentVNode("",!0),jt.value.downloadPng?(e.openBlock(),e.createElementBlock("div",{key:3,class:"dss-context-menu-item",onClick:nl},e.toDisplayString(e.unref(z)("chart.contextMenu.downloadPng")),1)):e.createCommentVNode("",!0),jt.value.downloadCsv?(e.openBlock(),e.createElementBlock("div",{key:4,class:"dss-context-menu-item",onClick:_n},e.toDisplayString(e.unref(z)("chart.contextMenu.downloadCsv")),1)):e.createCommentVNode("",!0),Tn.value.length>0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:5},[jt.value.downloadSvg||jt.value.downloadPng||jt.value.downloadCsv?(e.openBlock(),e.createElementBlock("div",mi)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Tn.value,(n,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"custom-"+i},[n.separator?(e.openBlock(),e.createElementBlock("div",pi)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(En(n)),style:e.normalizeStyle(Wl(n)),onClick:f=>Ul(n)},[n.template?(e.openBlock(),e.createElementBlock("div",{key:0,innerHTML:At(n),class:"dss-custom-menu-content"},null,8,vi)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[n.icon?(e.openBlock(),e.createElementBlock("span",gi,e.toDisplayString(n.icon),1)):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(n.label),1)],64))],14,fi)],64))),128))],64)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),he.value.show?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-marker-modal-overlay",onClick:el},[e.createElementVNode("div",{class:"dss-marker-modal",onClick:s[3]||(s[3]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",hi,[e.createElementVNode("h3",null,e.toDisplayString(B.value?e.unref(z)("chart.modalMarker.viewMarker"):y.value?e.unref(z)("chart.modalMarker.editMarker"):e.unref(z)("chart.contextMenu.addMarker")),1),e.createElementVNode("button",{class:"dss-modal-close-btn",onClick:el},"×")]),e.createElementVNode("div",yi,[e.createElementVNode("div",Ci,[e.createVNode(zo,{id:"dss-marker-date",mode:"single",modelValue:he.value.date,"onUpdate:modelValue":s[1]||(s[1]=n=>he.value.date=n),"min-date":Hl.value,"max-date":w.value,disabled:B.value},null,8,["modelValue","min-date","max-date","disabled"])]),e.createElementVNode("div",ki,[e.createElementVNode("label",bi,e.toDisplayString(e.unref(z)("chart.modalMarker.description")),1),B.value?(e.openBlock(),e.createElementBlock("div",wi,e.toDisplayString(he.value.description),1)):e.withDirectives((e.openBlock(),e.createElementBlock("textarea",{key:1,id:"dss-marker-description","onUpdate:modelValue":s[2]||(s[2]=n=>he.value.description=n),placeholder:e.unref(z)("chart.modalMarker.placeholderDescription"),class:"dss-form-textarea",rows:"5"},null,8,xi)),[[e.vModelText,he.value.description]])])]),e.createElementVNode("div",Ei,[e.createElementVNode("div",Vi,[y.value&&!B.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-btn dss-btn-danger",onClick:mo},e.toDisplayString(e.unref(z)("chart.modalMarker.deleteMarker")),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",Ni,[e.createElementVNode("button",{class:"dss-btn dss-btn-secondary",onClick:el},e.toDisplayString(B.value?e.unref(z)("chart.modalMarker.close"):e.unref(z)("chart.modalMarker.cancel")),1),B.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-btn dss-btn-primary",onClick:uo,disabled:!(he.value.description&&he.value.description.length)},e.toDisplayString(y.value?e.unref(z)("chart.modalMarker.save"):e.unref(z)("chart.contextMenu.addMarker")),9,Si))])])])])):e.createCommentVNode("",!0)],64))}}),_i={class:"dss-modal-title"},$i={class:"dss-modal-actions"},Ao={__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(F,{emit:Ce}){const z=F,A=Ce,_e=e.ref(null),k=e.ref(null),Le=e.computed(()=>{const S={"max-width":z.width};return z.height!=="auto"&&(S.height=z.height,S["min-height"]="0"),S}),se=e.computed(()=>({}));function pt(){A("close-modal")}function p(){z.backDrop&&!_e.value&&A("close-modal")}function ue(S){S.target.tagName==="INPUT"&&(_e.value=S.target.tagName)}function ve(){setTimeout(()=>{_e.value=null},300)}function de(){const S=document.body,ne=document.documentElement;k.value={bodyOverflow:S.style.overflow,bodyPosition:S.style.position,bodyTop:S.style.top,bodyWidth:S.style.width,htmlOverflow:ne.style.overflow,scrollY:window.scrollY},S.style.overflow="hidden",S.style.position="fixed",S.style.top=`-${k.value.scrollY}px`,S.style.width="100%",S.style.left="0",ne.style.overflow="hidden"}function ee(){if(!k.value)return;const S=document.body,ne=document.documentElement,{bodyOverflow:He,bodyPosition:Ae,bodyTop:Ie,bodyWidth:O,htmlOverflow:rt,scrollY:Oe}=k.value;S.style.overflow=He||"",S.style.position=Ae||"",S.style.top=Ie||"",S.style.width=O||"",S.style.left="",ne.style.overflow=rt||"",window.scrollTo(0,Oe||0)}return e.watch(()=>z.showModal,S=>{if(S)de(),document.body.classList.add("dss-modal-open"),setTimeout(()=>{const ne=document.getElementById("dss-modal-backdrop");ne&&(ne.addEventListener("focusin",ue),ne.addEventListener("focusout",ve))},100);else{ee(),document.body.classList.remove("dss-modal-open");const ne=document.getElementById("dss-modal-backdrop");ne&&(ne.removeEventListener("focusin",ue),ne.removeEventListener("focusout",ve))}},{immediate:!0}),e.onUnmounted(()=>{z.showModal&&ee()}),(S,ne)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[F.showModal?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-modal-backdrop",onClick:p},[e.withDirectives(e.createElementVNode("div",{id:"dss-modal-backdrop",class:"dss-modal",style:e.normalizeStyle(Le.value)},[e.createElementVNode("div",{class:"dss-modal-content",onClick:ne[0]||(ne[0]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:"dss-modal-header",style:e.normalizeStyle({"justify-content":F.headerType,"font-size":F.titleSize})},[e.createElementVNode("h1",_i,[e.renderSlot(S.$slots,"title",{},()=>[ne[1]||(ne[1]=e.createTextVNode("Default Title",-1))])]),e.renderSlot(S.$slots,"title-data"),F.showCloseBtn?(e.openBlock(),e.createElementBlock("span",{key:0,class:"dss-modal-close",onClick:pt,title:"Close"},"×")):e.createCommentVNode("",!0)],4),e.createElementVNode("div",{class:"dss-modal-body",style:e.normalizeStyle(se.value)},[e.renderSlot(S.$slots,"content",{},()=>[ne[2]||(ne[2]=e.createTextVNode("Default Content",-1))])],4),e.createElementVNode("div",$i,[e.renderSlot(S.$slots,"actions")])])],4),[[e.vShow,F.showModal]])])):e.createCommentVNode("",!0)]))}},Ti={key:0,class:"dss-table-toolbar"},Li={class:"dss-table-toolbar-left"},Hi=["aria-expanded"],Ai={class:"dss-pagination-select-dropdown",role:"listbox"},Di={class:"dss-table-column-visibility-label"},Ri={class:"dss-table-checkbox-wrapper"},Fi=["checked","onChange"],Ii={key:0,class:"dss-table-checkbox__check","aria-hidden":"true"},zi={class:"dss-table-column-visibility-text"},Pi={class:"dss-table-toolbar-right"},Oi=["placeholder"],Zi=["aria-expanded"],Wi={key:1,class:"dss-table-toolbar-extra"},qi={class:"dss-table-thead"},Ui={key:0,class:"dss-table-th dss-table-selection-column"},Xi={key:0,class:"dss-table-checkbox-wrapper"},Yi=["checked","indeterminate"],ji={key:0,class:"dss-table-checkbox__indeterminate"},Ki={key:1,class:"dss-table-checkbox__check","aria-hidden":"true"},Gi={key:1,class:"dss-table-th dss-table-expansion-column","aria-label":"Expand row"},Qi=["onClick"],Ji={class:"dss-table-th-content"},ec={class:"dss-table-th-text"},tc={key:0},nc={key:1},lc={key:2},oc=["data-filter-column-key","aria-expanded","onClick"],ac={class:"dss-table-tbody"},sc=["onClick"],rc={class:"dss-table-checkbox-wrapper"},ic=["type","name","checked","onChange"],cc={key:0,class:"dss-table-checkbox__check","aria-hidden":"true"},uc={key:1,class:"dss-table-checkbox__dot"},dc=["onClick"],mc=["aria-expanded","aria-label"],pc={key:0,class:"dss-table-expansion-row"},fc=["colspan"],vc=["colspan"],gc={key:1,class:"dss-table-pagination"},hc={class:"dss-pagination-center"},yc={class:"dss-pagination-controls"},Cc=["disabled","title"],kc=["disabled","title"],bc={class:"dss-pagination-pages"},wc=["onClick"],xc={key:1,class:"dss-pagination-ellipsis"},Ec=["disabled","title"],Vc=["disabled","title"],Nc=["aria-expanded"],Sc={class:"dss-pagination-select-dropdown",role:"listbox"},Bc=["aria-selected","onClick"],Mc={key:0,class:"dss-table-filter-row"},_c=["value","placeholder"],$c=["min","max","value"],Tc=["min","max","value"],Lc={class:"dss-table-filter-double-range-values"},Hc={key:2,class:"dss-table-filter-daterange"},Ac={class:"dss-table-filter-daterange-row"},Dc={class:"dss-table-filter-daterange-label"},Rc=["value"],Fc={class:"dss-table-filter-daterange-row"},Ic={class:"dss-table-filter-daterange-label"},zc=["value"],Pc=["value","placeholder"],Oc={class:"dss-table-filter-list"},Zc=["checked","onChange"],Wc={class:"dss-table-filter-actions"},qc={name:"DSSTable"},Uc=Object.assign(qc,{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:F=>typeof F=="object"&&F!==null}},emits:["row-click","row-select","row-unselect","select-all","unselect-all","row-expand","row-collapse","sort","page","download-pdf","download-excel","search"],setup(F,{emit:Ce}){const{t:z,locale:A}=lo.useI18n(),_e=F,k=Ce,Le={table:{width:"auto",height:null,rowHeight:"auto",truncated:!1,expandable:!1,striped:!1,bordered:!1,hoverable:!0,size:"default",align:"left"},title:{text:""},subtitle:{text:""},selection:{enabled:!1,mode:"single"},sorting:{enabled:!0,mode:"single"},pagination:{enabled:!1,rows:10,rowsPerPageOptions:[5,10,25,50,100]},toolbar:{downloads:{pdf:!0,excel:!0},columnVisibility:!0,search:!0},scrollable:!1,emptyMessage:"No data available"};function se(w,y){const B=Object.assign({},w);return pt(w)&&pt(y)&&Object.keys(y).forEach(W=>{pt(y[W])?W in w?B[W]=se(w[W],y[W]):Object.assign(B,{[W]:y[W]}):Object.assign(B,{[W]:y[W]})}),B}function pt(w){return w&&typeof w=="object"&&!Array.isArray(w)}const p=e.computed(()=>se(Le,_e.options)),ue=e.computed(()=>{const w=p.value.table.width;return w==="auto"?null:typeof w=="number"?w:null}),ve=e.computed(()=>p.value.table.height),de=e.computed(()=>p.value.table.rowHeight??"auto"),ee=e.computed(()=>({height:de.value})),S=e.computed(()=>p.value.table.expandable===!0),ne=e.computed(()=>p.value.table.truncated===!0),He=e.computed(()=>p.value.table.striped),Ae=e.computed(()=>p.value.table.bordered),Ie=e.computed(()=>p.value.table.hoverable),O=e.computed(()=>p.value.table.size),rt=e.computed(()=>p.value.table.align||"left");e.computed(()=>p.value.title.text),e.computed(()=>p.value.subtitle.text);const Oe=e.computed(()=>p.value.selection.enabled),we=e.computed(()=>p.value.selection.mode),xt=e.computed(()=>p.value.sorting.enabled),Tt=e.computed(()=>p.value.sorting.mode),ut=e.computed(()=>p.value.pagination.enabled),Ze=e.computed(()=>p.value.pagination.rows),ge=e.computed(()=>p.value.pagination.rowsPerPageOptions),yt=e.computed(()=>p.value.scrollable),St=e.computed(()=>p.value.emptyMessage),at=e.computed(()=>p.value.toolbar?.downloads?.pdf!==!1),$t=e.computed(()=>p.value.toolbar?.downloads?.excel!==!1),Ot=e.computed(()=>p.value.toolbar?.search!==!1),on=e.computed(()=>at.value||$t.value||Ot.value||Et.value),Et=e.computed(()=>p.value.toolbar?.columnVisibility!==!1),lt=e.ref(""),je=e.ref(!1),Dt=e.ref(null);let Lt=null;function Bt(){je.value?(Lt&&(clearTimeout(Lt),Lt=null),je.value=!1,lt.value="",k("search",""),Dt.value?.blur()):(je.value=!0,Lt=setTimeout(()=>{Lt=null,Dt.value?.focus()},80))}function Xe(){lt.value||(je.value=!1)}function Zt(){lt.value="",k("search",""),Dt.value?.focus()}const Yt=e.computed(()=>({"dss-table-striped":He.value,"dss-table-bordered":Ae.value,"dss-table-hoverable":Ie.value,[`dss-table-${O.value}`]:O.value!=="default","dss-table-truncated":ne.value})),Ct=(w,y)=>w?.field??w?.key??y,te=e.ref(new Set);function $e(){const w=new Set;_e.columns.forEach((y,B)=>{y?.hidden!==!0&&w.add(Ct(y,B))}),te.value=w}const fe=e.computed(()=>_e.columns.filter((w,y)=>te.value.has(Ct(w,y)))),Ne=w=>{const y=_e.columns.findIndex(B=>B===w);return Ct(w,y>=0?y:0)},We=(w,y)=>te.value.has(Ct(w,y));function ft(w,y){const B=Ct(w,y),W=new Set(te.value);W.has(B)?W.delete(B):W.add(B),te.value=W}const qe=e.ref(null),dt=e.ref(!1);function xe(w){qe.value&&!qe.value.contains(w.target)&&(dt.value=!1)}const Ue=e.computed(()=>fe.value.length+(Oe.value?1:0)+(S.value?1:0)),X=(w,y)=>w?.id??w?.key??y,Z=e.ref(new Set),j=e.ref(null),ie=(w,y)=>Z.value.has(X(w,y)),E=(w,y,B)=>{B&&B.stopPropagation();const W=X(w,y),ae=new Set(Z.value);ae.has(W)?(ae.delete(W),k("row-collapse",{data:w,index:y})):(ae.add(W),k("row-expand",{data:w,index:y})),Z.value=ae},C=(w,y)=>{if(!ne.value)return;const B=X(w,y);j.value!==B&&(j.value=B)},V=e.ref(null),P=e.ref(0),U=e.ref([]),ze=w=>{if(Tt.value==="single")return V.value===w.field?P.value:0;{const y=U.value.find(B=>B.field===w.field);return y?y.order:0}},Re=w=>{const y=ze(w);return{"dss-sort-active":y!==0,"dss-sort-asc":y===1,"dss-sort-desc":y===-1}},De=e.ref({}),re=e.ref(null),Ge=e.ref(null),tt=220,wt=e.ref(null),vt=e.computed(()=>fe.value.find(w=>Ne(w)===re.value)??null),Je=e.computed(()=>{if(!vt.value||vt.value.filter!=="range")return null;const w=vt.value,y=re.value,{min:B,max:W}=R(w),ae=w.filterMin??B,mt=w.filterMax??W,ot=bn(y),Ht=ot.min??ae,It=ot.max??mt,At=mt-ae,En=At===0?0:(Ht-ae)/At*100,Wl=At===0?100:(It-ae)/At*100;return{rangeMin:ae,rangeMax:mt,currentMin:Ht,currentMax:It,minPct:En,maxPct:Wl}}),vn=e.ref(null),jt=e.ref("max");function Tn(w){const y=vn.value,B=Je.value;if(!y||!B)return;const W=y.getBoundingClientRect(),mt=(w.clientX-W.left)/W.width*100,ot=(B.minPct+B.maxPct)/2;jt.value=mt<ot?"min":"max"}function bn(w){return De.value[w]??{}}function Fn(w,y){De.value={...De.value,[w]:y}}function Wt(w){const y=De.value[w];return y?y.type==="string"?!!y.value?.trim():y.type==="range"?y.min!=null||y.max!=null:y.type==="dateRange"?!!(y.from||y.to):y.type==="list"?y.selected?.length>0:!1:!1}function In(w){const y={...De.value};delete y[w],De.value=y,re.value=null,Ge.value=null}function an(){if(!re.value){Ge.value=null;return}const w=wt.value;if(!w)return;const y=w.querySelector(`.dss-table-filter-trigger[data-filter-column-key="${re.value}"]`);if(!y)return;const B=y.getBoundingClientRect();Ge.value={top:B.bottom+6,left:Math.max(8,B.right-tt)}}const qn=e.computed(()=>{let w=[..._e.data];const y=(lt.value??"").trim().toLowerCase();return y&&(w=w.filter(B=>_e.columns.some(W=>{if(!W||!W.field)return!1;const ae=G(B,W);return String(ae??"").toLowerCase().includes(y)}))),fe.value.forEach(B=>{const W=Ne(B),ae=De.value[W];if(!ae)return;const mt=B.field;if(mt){if(ae.type==="string"&&ae.value?.trim()){const ot=ae.value.trim().toLowerCase();w=w.filter(Ht=>{const It=G(Ht,B);return String(It??"").toLowerCase().includes(ot)})}else if(ae.type==="range")w=w.filter(ot=>{const Ht=Mt(ot,mt),It=Number(Ht);return!(Number.isNaN(It)||ae.min!=null&&It<ae.min||ae.max!=null&&It>ae.max)});else if(ae.type==="dateRange"){const ot=ae.from?new Date(ae.from).getTime():null,Ht=ae.to?new Date(ae.to).getTime():null;w=w.filter(It=>{const At=Mt(It,mt),En=At?new Date(At).getTime():NaN;return!(Number.isNaN(En)||ot!=null&&En<ot||Ht!=null&&En>Ht)})}else if(ae.type==="list"&&ae.selected?.length){const ot=new Set(ae.selected);w=w.filter(Ht=>{const It=G(Ht,B);return ot.has(It!=null?String(It):"")})}}}),w});function cl(w){const y=new Set;return _e.data.forEach(B=>{const W=G(B,w);y.add(W!=null?String(W):"")}),Array.from(y).sort((B,W)=>String(B).localeCompare(String(W)))}function D(w,y){if(re.value===w){re.value=null,Ge.value=null;return}if(re.value=w,y?.currentTarget){const B=y.currentTarget.getBoundingClientRect();Ge.value={top:B.bottom+6,left:Math.max(8,B.right-tt)}}else an()}function q(w,y){Fn(w,{type:"string",value:y})}function R(w){const y=w.field;if(!y)return{min:0,max:100};let B=1/0,W=-1/0;return _e.data.forEach(ae=>{const mt=Mt(ae,y),ot=Number(mt);Number.isNaN(ot)||(B=Math.min(B,ot),W=Math.max(W,ot))}),{min:B===1/0?0:B,max:W===-1/0?100:W}}function le(w,y,B){const W={...bn(w),type:"range"},ae=B===""?null:Number(B),mt=ae===null||Number.isNaN(ae)?null:ae;W[y]=mt,mt!=null&&(y==="min"&&W.max!=null&&mt>W.max&&(W.max=mt),y==="max"&&W.min!=null&&mt<W.min&&(W.min=mt)),Fn(w,W)}function Me(w,y,B){const W={...bn(w),type:"dateRange"};W[y]=B||"",Fn(w,W)}const nt=e.reactive({});function st(w,y){nt[w]=y}function Qe(w){const y=Ne(w),B=(nt[y]??"").trim().toLowerCase(),W=cl(w);return B?W.filter(ae=>String(ae).toLowerCase().includes(B)):W}function Ke(w,y){return(bn(w).selected??[]).includes(y!=null?String(y):"")}function dn(w,y){const W=[...bn(w).selected??[]],ae=y!=null?String(y):"",mt=W.indexOf(ae);mt>=0?W.splice(mt,1):W.push(ae),Fn(w,{type:"list",selected:W})}function Ln(w){re.value&&!w.target.closest(".dss-table-filter-wrap")&&!w.target.closest(".dss-table-filter-dropdown")&&(re.value=null,Ge.value=null)}function tn(){an()}const Hn=w=>{if(!(w.sortable===!1||!xt.value))if(Tt.value==="single")V.value===w.field?P.value=P.value===1?-1:P.value===-1?0:1:(V.value=w.field,P.value=1),P.value===0&&(V.value=null),k("sort",{field:V.value,order:P.value});else{const y=U.value.findIndex(B=>B.field===w.field);y>=0?U.value[y].order===1?U.value[y].order=-1:U.value.splice(y,1):U.value.push({field:w.field,order:1}),k("sort",{multiSortMeta:U.value})}},wn=e.computed(()=>{if(!xt.value)return qn.value;let w=[...qn.value];return Tt.value==="single"&&V.value&&P.value!==0?w.sort((y,B)=>{const W=Mt(y,V.value),ae=Mt(B,V.value);return W===ae?0:W==null?1:ae==null?-1:(W<ae?-1:W>ae?1:0)*P.value}):Tt.value==="multiple"&&U.value.length>0&&w.sort((y,B)=>{for(const W of U.value){const ae=Mt(y,W.field),mt=Mt(B,W.field);if(ae===mt)continue;if(ae==null)return 1;if(mt==null)return-1;const ot=ae<mt?-1:ae>mt?1:0;if(ot!==0)return ot*W.order}return 0}),w}),sn=e.ref(0),xn=e.ref(Ze.value),zn=e.ref(!1),Nl=e.ref(null),Tl=w=>{xn.value=w,zn.value=!1,sn.value=0,k("page",{page:0,rows:xn.value})};function Sl(w){Nl.value&&!Nl.value.contains(w.target)&&(zn.value=!1)}const gl=e.computed(()=>wn.value.length),gn=e.computed(()=>Math.ceil(gl.value/xn.value)),hn=e.computed(()=>ut.value?sn.value*xn.value:0),Zl=e.computed(()=>ut.value?Math.min((sn.value+1)*xn.value,gl.value):gl.value),ul=e.computed(()=>{if(!ut.value)return wn.value;const w=hn.value,y=Zl.value;return wn.value.slice(w,y)}),An=e.ref(new Set),dl=e.computed(()=>wn.value.filter((w,y)=>An.value.has(X(w,y)))),hl=e.computed(()=>{const w=wn.value.length;return w>0&&An.value.size===w}),Ll=e.computed(()=>{const w=wn.value.length,y=An.value.size;return y>0&&y<w}),Vt=(w,y)=>An.value.has(X(w,y)),Ee=()=>{if(hl.value)An.value=new Set,k("unselect-all");else{const w=new Set;wn.value.forEach((y,B)=>w.add(X(y,B))),An.value=w,k("select-all",dl.value)}},yn=(w,y)=>{const B=X(w,y),W=new Set(An.value),ae=W.has(B);we.value==="single"?ae?(W.delete(B),k("row-unselect",w)):(W.clear(),W.add(B),k("row-select",w)):ae?(W.delete(B),k("row-unselect",w)):(W.add(B),k("row-select",w)),An.value=W},et=e.computed(()=>{const w=gn.value,y=sn.value+1,B=2,W=[],ae=[];let mt;for(let ot=1;ot<=w;ot++)(ot===1||ot===w||ot>=y-B&&ot<=y+B)&&W.push(ot);for(const ot of W)mt&&(ot-mt===2?ae.push(mt+1):ot-mt!==1&&ae.push("...")),ae.push(ot),mt=ot;return ae}),rn=w=>{w<0||w>=gn.value||(sn.value=w,k("page",{page:w,rows:xn.value}))},Se=(w,y,B)=>{k("row-click",{data:w,index:y,originalEvent:B}),C(w,hn.value+y)},Be=(w,y)=>{const B=hn.value+y;return{"dss-table-row-selected":Vt(w,B),"dss-table-row-even":y%2===0,"dss-table-row-odd":y%2!==0,"dss-table-row-truncated-clickable":ne.value,"dss-table-row-truncated-expanded":j.value===X(w,B)}},G=(w,y)=>y.field?Mt(w,y.field):"",Mt=(w,y)=>y.split(".").reduce((B,W)=>B&&B[W],w),he=w=>{const y=w.align??rt.value;return{"dss-table-sortable":w.sortable!==!1&&xt.value,"dss-table-align-left":y==="left","dss-table-align-center":y==="center","dss-table-align-right":y==="right",[w.className]:w.className}},Hl=w=>{const y={};return w.width&&(y.width=typeof w.width=="number"?`${w.width}px`:w.width),w.minWidth&&(y.minWidth=typeof w.minWidth=="number"?`${w.minWidth}px`:w.minWidth),w.maxWidth&&(y.maxWidth=typeof w.maxWidth=="number"?`${w.maxWidth}px`:w.maxWidth),y};return e.watch(()=>_e.locale,w=>{w&&w!==A.value&&(A.value=w)},{immediate:!0}),e.watch(Ze,w=>{xn.value=w,sn.value=0}),e.watch(lt,w=>{k("search",w??"")}),e.watch(()=>_e.columns,()=>{$e()},{immediate:!0,deep:!0}),e.onMounted(()=>{document.addEventListener("click",Sl),document.addEventListener("click",xe),document.addEventListener("click",Ln),window.addEventListener("resize",tn),window.addEventListener("scroll",tn,!0)}),e.onUnmounted(()=>{document.removeEventListener("click",Sl),document.removeEventListener("click",xe),document.removeEventListener("click",Ln),window.removeEventListener("resize",tn),window.removeEventListener("scroll",tn,!0)}),(w,y)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{class:"dss-table-container",ref_key:"tableContainerRef",ref:wt,style:e.normalizeStyle({width:ue.value+"px",height:ve.value?ve.value+"px":"auto"})},[on.value?(e.openBlock(),e.createElementBlock("div",Ti,[e.createElementVNode("div",Li,[at.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-table-toolbar-btn",onClick:y[0]||(y[0]=B=>k("download-pdf"))},[y[21]||(y[21]=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(z)("table.downloadPdf")),1)])):e.createCommentVNode("",!0),$t.value?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-table-toolbar-btn",onClick:y[1]||(y[1]=B=>k("download-excel"))},[y[22]||(y[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_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(z)("table.downloadExcel")),1)])):e.createCommentVNode("",!0),Et.value?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-table-toolbar-column-visibility",ref_key:"columnVisibilityDropdownRef",ref:qe},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-pagination-select-trigger",{"dss-pagination-select-open":dt.value}]),onClick:y[2]||(y[2]=B=>dt.value=!dt.value),"aria-expanded":dt.value,"aria-haspopup":"listbox"},[e.createTextVNode(e.toDisplayString(e.unref(z)("table.columnVisibility"))+" ",1),y[23]||(y[23]=e.createElementVNode("span",{class:"dss-pagination-select-chevron","aria-hidden":"true"},"▼",-1))],10,Hi),e.createVNode(e.Transition,{name:"dss-dropdown"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("ul",Ai,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(F.columns,(B,W)=>(e.openBlock(),e.createElementBlock("li",{key:Ct(B,W),role:"option",class:"dss-table-column-visibility-option",onClick:y[3]||(y[3]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("label",Di,[e.createElementVNode("span",Ri,[e.createElementVNode("input",{type:"checkbox",checked:We(B,W),onChange:ae=>ft(B,W),class:"dss-table-checkbox dss-table-checkbox--checkbox"},null,40,Fi),We(B,W)?(e.openBlock(),e.createElementBlock("span",Ii,[...y[24]||(y[24]=[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",zi,e.toDisplayString(B.header),1)])]))),128))],512),[[e.vShow,dt.value]])]),_:1})],512)):e.createCommentVNode("",!0)]),e.createElementVNode("div",Pi,[Ot.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["dss-table-toolbar-search",{"dss-table-toolbar-search--expanded":je.value||lt.value}])},[e.withDirectives(e.createElementVNode("input",{ref_key:"searchInputRef",ref:Dt,"onUpdate:modelValue":y[4]||(y[4]=B=>lt.value=B),type:"text",class:"dss-table-toolbar-search-input",placeholder:e.unref(z)("table.searchPlaceholder"),"aria-label":"Search table",onFocus:y[5]||(y[5]=B=>je.value=!0),onBlur:Xe},null,40,Oi),[[e.vModelText,lt.value]]),lt.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-table-toolbar-search-clear","aria-label":"Clear search",onClick:Zt},[...y[25]||(y[25]=[e.createElementVNode("span",{"aria-hidden":"true"},"×",-1)])])):e.createCommentVNode("",!0),e.createElementVNode("button",{type:"button",class:"dss-table-toolbar-search-trigger","aria-label":"Search","aria-expanded":je.value||!!lt.value,onMousedown:e.withModifiers(Bt,["prevent"])},[...y[26]||(y[26]=[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,Zi)],2)):e.createCommentVNode("",!0),w.$slots["toolbar-extra"]?(e.openBlock(),e.createElementBlock("div",Wi,[e.renderSlot(w.$slots,"toolbar-extra")])):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["dss-table-wrapper",{"dss-table-scrollable":yt.value}])},[e.createElementVNode("table",{class:e.normalizeClass(["dss-table",Yt.value])},[e.createElementVNode("thead",qi,[e.createElementVNode("tr",null,[Oe.value?(e.openBlock(),e.createElementBlock("th",Ui,[we.value==="multiple"?(e.openBlock(),e.createElementBlock("span",Xi,[e.createElementVNode("input",{type:"checkbox",checked:hl.value,indeterminate:Ll.value,onChange:Ee,class:"dss-table-checkbox dss-table-checkbox--checkbox"},null,40,Yi),Ll.value?(e.openBlock(),e.createElementBlock("span",ji)):hl.value?(e.openBlock(),e.createElementBlock("span",Ki,[...y[27]||(y[27]=[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),S.value?(e.openBlock(),e.createElementBlock("th",Gi)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(fe.value,(B,W)=>(e.openBlock(),e.createElementBlock("th",{key:Ne(B),class:e.normalizeClass(["dss-table-th",he(B)]),style:e.normalizeStyle(Hl(B)),onClick:ae=>Hn(B)},[e.createElementVNode("div",Ji,[e.createElementVNode("span",ec,e.toDisplayString(B.header),1),B.sortable!==!1&&xt.value?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["dss-table-sort-icon",Re(B)])},[ze(B)===0?(e.openBlock(),e.createElementBlock("span",tc,[...y[28]||(y[28]=[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)])])):ze(B)===1?(e.openBlock(),e.createElementBlock("span",nc,[...y[29]||(y[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:"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)])])):ze(B)===-1?(e.openBlock(),e.createElementBlock("span",lc,[...y[30]||(y[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 -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),B.filter?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["dss-table-filter-wrap",{"dss-table-filter-wrap--open":re.value===Ne(B)}]),onClick:y[6]||(y[6]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-table-filter-trigger",{"dss-table-filter-trigger--active":Wt(Ne(B))}]),"data-filter-column-key":Ne(B),"aria-expanded":re.value===Ne(B),"aria-label":"Filter column",onClick:ae=>D(Ne(B),ae)},[...y[31]||(y[31]=[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,oc)],2)):e.createCommentVNode("",!0)])],14,Qi))),128))])]),e.createElementVNode("tbody",ac,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ul.value,(B,W)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:X(B,hn.value+W)},[e.createElementVNode("tr",{class:e.normalizeClass(["dss-table-tr",Be(B,W)]),style:e.normalizeStyle(ee.value),onClick:ae=>Se(B,W,ae)},[Oe.value?(e.openBlock(),e.createElementBlock("td",{key:0,class:"dss-table-td dss-table-selection-cell",onClick:y[7]||(y[7]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("span",rc,[e.createElementVNode("input",{type:we.value==="multiple"?"checkbox":"radio",name:`dss-table-select-${F.tableId}`,checked:Vt(B,hn.value+W),onChange:ae=>yn(B,hn.value+W),class:e.normalizeClass(["dss-table-checkbox",we.value==="multiple"?"dss-table-checkbox--checkbox":"dss-table-checkbox--radio"])},null,42,ic),we.value==="multiple"&&Vt(B,hn.value+W)?(e.openBlock(),e.createElementBlock("span",cc,[...y[32]||(y[32]=[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)])])):we.value==="single"&&Vt(B,hn.value+W)?(e.openBlock(),e.createElementBlock("span",uc)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),S.value?(e.openBlock(),e.createElementBlock("td",{key:1,class:"dss-table-td dss-table-expansion-cell",onClick:e.withModifiers(ae=>E(B,hn.value+W,ae),["stop"])},[e.createElementVNode("button",{type:"button",class:"dss-table-expansion-trigger","aria-expanded":ie(B,hn.value+W),"aria-label":ie(B,hn.value+W)?"Collapse row":"Expand row"},[e.createElementVNode("span",{class:e.normalizeClass(["dss-table-expansion-icon",{"dss-table-expansion-icon--expanded":ie(B,hn.value+W)}]),"aria-hidden":"true"},[...y[33]||(y[33]=[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,mc)],8,dc)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(fe.value,(ae,mt)=>(e.openBlock(),e.createElementBlock("td",{key:Ne(ae),class:e.normalizeClass(["dss-table-td",he(ae)]),style:e.normalizeStyle(Hl(ae))},[e.renderSlot(w.$slots,`cell-${ae.field}`,{data:B,column:ae,rowIndex:W},()=>[e.createTextVNode(e.toDisplayString(G(B,ae)),1)])],6))),128))],14,sc),S.value&&ie(B,hn.value+W)?(e.openBlock(),e.createElementBlock("tr",pc,[e.createElementVNode("td",{colspan:Ue.value,class:"dss-table-expansion-content-cell"},[e.renderSlot(w.$slots,"expansion",{data:B,rowIndex:W})],8,fc)])):e.createCommentVNode("",!0)],64))),128)),ul.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("tr",{key:0,class:"dss-table-empty",style:e.normalizeStyle(ee.value)},[e.createElementVNode("td",{colspan:Ue.value,class:"dss-table-empty-cell"},[e.renderSlot(w.$slots,"empty",{},()=>[e.createTextVNode(e.toDisplayString(St.value),1)])],8,vc)],4))])],2)],2),ut.value?(e.openBlock(),e.createElementBlock("div",gc,[e.createElementVNode("div",hc,[e.createElementVNode("div",yc,[e.createElementVNode("button",{class:"dss-pagination-btn",disabled:sn.value===0,onClick:y[8]||(y[8]=B=>rn(0)),title:e.unref(z)("table.firstPage")},[...y[34]||(y[34]=[e.createElementVNode("span",{class:"dss-pagination-double-arrow"},[e.createElementVNode("span",null,"‹"),e.createElementVNode("span",null,"‹")],-1)])],8,Cc),e.createElementVNode("button",{class:"dss-pagination-btn",disabled:sn.value===0,onClick:y[9]||(y[9]=B=>rn(sn.value-1)),title:e.unref(z)("table.previousPage")}," ‹ ",8,kc),e.createElementVNode("span",bc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(et.value,B=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:B},[B!=="..."?(e.openBlock(),e.createElementBlock("button",{key:0,class:e.normalizeClass(["dss-pagination-page",{"dss-active":B===sn.value+1}]),onClick:W=>rn(B-1)},e.toDisplayString(B),11,wc)):(e.openBlock(),e.createElementBlock("span",xc,"..."))],64))),128))]),e.createElementVNode("button",{class:"dss-pagination-btn",disabled:sn.value>=gn.value-1,onClick:y[10]||(y[10]=B=>rn(sn.value+1)),title:e.unref(z)("table.nextPage")}," › ",8,Ec),e.createElementVNode("button",{class:"dss-pagination-btn",disabled:sn.value>=gn.value-1,onClick:y[11]||(y[11]=B=>rn(gn.value-1)),title:e.unref(z)("table.lastPage")},[...y[35]||(y[35]=[e.createElementVNode("span",{class:"dss-pagination-double-arrow"},[e.createElementVNode("span",null,"›"),e.createElementVNode("span",null,"›")],-1)])],8,Vc)]),e.createElementVNode("div",{class:"dss-pagination-rows-per-page",ref_key:"rowsPerPageDropdownRef",ref:Nl},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-pagination-select-trigger",{"dss-pagination-select-open":zn.value}]),onClick:y[12]||(y[12]=B=>zn.value=!zn.value),"aria-expanded":zn.value,"aria-haspopup":"listbox"},[e.createTextVNode(e.toDisplayString(xn.value)+" ",1),y[36]||(y[36]=e.createElementVNode("span",{class:"dss-pagination-select-chevron","aria-hidden":"true"},"▼",-1))],10,Nc),e.createVNode(e.Transition,{name:"dss-dropdown"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("ul",Sc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ge.value,B=>(e.openBlock(),e.createElementBlock("li",{key:B,role:"option","aria-selected":B===xn.value,class:e.normalizeClass(["dss-pagination-select-option",{"dss-pagination-select-option--selected":B===xn.value}]),onClick:W=>Tl(B)},e.toDisplayString(B),11,Bc))),128))],512),[[e.vShow,zn.value]])]),_:1})],512)])])):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(Ge.value?{top:Ge.value.top+"px",left:Ge.value.left+"px",width:tt+"px"}:void 0),onClick:y[20]||(y[20]=e.withModifiers(()=>{},["stop"]))},[vt.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[vt.value.filter==="string"?(e.openBlock(),e.createElementBlock("div",Mc,[e.createElementVNode("input",{type:"text",value:bn(re.value).value??"",onInput:y[13]||(y[13]=B=>q(re.value,B.target.value)),class:"dss-table-filter-input",placeholder:e.unref(z)("table.search")||"Search..."},null,40,_c)])):vt.value.filter==="range"&&Je.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-table-filter-double-range",style:e.normalizeStyle({"--range-min-pct":Je.value.minPct+"%","--range-max-pct":Je.value.maxPct+"%"})},[e.createElementVNode("div",{ref_key:"doubleRangeTrackRef",ref:vn,class:"dss-table-filter-double-range-track",onMousemove:Tn,onMouseenter:Tn},[e.createElementVNode("input",{type:"range",min:Je.value.rangeMin,max:Je.value.rangeMax,value:Je.value.currentMin,onInput:y[14]||(y[14]=B=>le(re.value,"min",B.target.value)),class:"dss-table-filter-double-range-input dss-table-filter-double-range-input--min",style:e.normalizeStyle({zIndex:jt.value==="min"?2:1})},null,44,$c),e.createElementVNode("input",{type:"range",min:Je.value.rangeMin,max:Je.value.rangeMax,value:Je.value.currentMax,onInput:y[15]||(y[15]=B=>le(re.value,"max",B.target.value)),class:"dss-table-filter-double-range-input dss-table-filter-double-range-input--max",style:e.normalizeStyle({zIndex:jt.value==="max"?2:1})},null,44,Tc)],544),e.createElementVNode("div",Lc,e.toDisplayString(Je.value.currentMin)+" – "+e.toDisplayString(Je.value.currentMax),1)],4)):vt.value.filter==="dateRange"?(e.openBlock(),e.createElementBlock("div",Hc,[e.createElementVNode("div",Ac,[e.createElementVNode("label",Dc,e.toDisplayString(e.unref(z)("table.filterFrom")||"From:"),1),e.createElementVNode("input",{type:"date",value:bn(re.value).from??"",onInput:y[16]||(y[16]=B=>Me(re.value,"from",B.target.value)),class:"dss-table-filter-input dss-table-filter-daterange-input"},null,40,Rc)]),e.createElementVNode("div",Fc,[e.createElementVNode("label",Ic,e.toDisplayString(e.unref(z)("table.filterTo")||"To:"),1),e.createElementVNode("input",{type:"date",value:bn(re.value).to??"",onInput:y[17]||(y[17]=B=>Me(re.value,"to",B.target.value)),class:"dss-table-filter-input dss-table-filter-daterange-input"},null,40,zc)])])):vt.value.filter==="list"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.createElementVNode("input",{type:"text",value:nt[re.value]??"",onInput:y[18]||(y[18]=B=>st(re.value,B.target.value)),class:"dss-table-filter-input dss-table-filter-list-search",placeholder:e.unref(z)("table.search")||"Search..."},null,40,Pc),e.createElementVNode("div",Oc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Qe(vt.value),B=>(e.openBlock(),e.createElementBlock("label",{key:B,class:"dss-table-filter-list-item"},[e.createElementVNode("input",{type:"checkbox",checked:Ke(re.value,B),onChange:W=>dn(re.value,B)},null,40,Zc),e.createElementVNode("span",null,e.toDisplayString(B),1)]))),128))])],64)):e.createCommentVNode("",!0),e.createElementVNode("div",Wc,[e.createElementVNode("button",{type:"button",class:"dss-table-filter-clear",onClick:y[19]||(y[19]=B=>In(re.value))},e.toDisplayString(e.unref(z)("table.clearFilter")||"Clear"),1)])],64)):e.createCommentVNode("",!0)],4),[[e.vShow,re.value&&vt.value&&Ge.value]])]),_:1})]))],64))}}),Xc={class:"dss-toolbar-left"},Yc=["title"],jc=["title"],Kc={class:"dss-toolbar-dropdown-wrapper"},Gc=["title"],Qc={key:0,class:"dss-toolbar-heading-icon",width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Jc={key:1,class:"dss-toolbar-heading-icon",width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},eu={key:2,class:"dss-toolbar-heading-icon",width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},tu={key:3,class:"dss-toolbar-heading-icon",width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},nu={key:4,class:"dss-toolbar-heading-icon",width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},lu={key:5,class:"dss-toolbar-heading-icon",width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},ou={key:6,width:"13",height:"14",viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"paragraph-icon"},au=["title"],su=["title"],ru=["title"],iu=["title"],cu=["title"],uu=["title"],du=["title"],mu=["title"],pu=["title"],fu={key:2,class:"dss-toolbar-separator"},vu=["title"],gu={key:4,class:"dss-toolbar-separator"},hu={key:5,class:"dss-toolbar-dropdown-wrapper"},yu=["title"],Cu={class:"dss-toolbar-dropdown-ai"},ku={class:"dss-toolbar-right"},bu={key:0,class:"dss-toolbar-custom-group"},wu={key:1,class:"dss-toolbar-separator"},xu={class:"dss-link-modal-content"},Eu={class:"dss-link-modal-field"},Vu={class:"dss-link-modal-label"},Nu=["placeholder"],Su={class:"dss-link-modal-field"},Bu={class:"dss-link-modal-label"},Mu=["placeholder"],_u={class:"dss-image-modal-tabs"},$u={key:0,class:"dss-image-tab-content"},Tu={class:"dss-link-modal-content"},Lu={class:"dss-link-modal-field"},Hu={key:0,class:"dss-link-modal-label"},Au=["src"],Du={class:"dss-link-modal-field"},Ru={class:"dss-link-modal-label"},Fu=["placeholder"],Iu={class:"dss-link-modal-field"},zu={class:"dss-link-modal-label"},Pu=["placeholder"],Ou={class:"dss-link-modal-field"},Zu={class:"dss-link-modal-label"},Wu=["placeholder"],qu={key:1,class:"dss-image-tab-content"},Uu={class:"dss-link-modal-content"},Xu={class:"dss-link-modal-field"},Yu={class:"dss-link-modal-label"},ju=["placeholder"],Ku={class:"dss-link-modal-field"},Gu={class:"dss-link-modal-label"},Qu=["placeholder"],Ju={class:"dss-link-modal-field"},ed={class:"dss-link-modal-label"},td=["placeholder"],nd={class:"dss-link-modal-field"},ld={class:"dss-link-modal-label"},od=["placeholder"],ad={class:"dss-text-editor-title-input-container"},sd={key:0,class:"dss-text-editor-title-preview"},rd={key:0},id={key:1,class:"dss-text-editor-preview-placeholder"},cd=["value","placeholder","disabled"],ud={key:2,class:"dss-text-editor-title-slot dss-text-editor-slot-last"},dd={class:"dss-text-editor-description-input-container"},md={key:0,class:"dss-text-editor-description-preview"},pd={key:0},fd={key:1,class:"dss-text-editor-preview-placeholder"},vd=["value","placeholder","disabled"],gd={key:3,class:"dss-text-editor-description-slot dss-text-editor-slot-last"},hd=["data-comment-id","onMouseenter"],yd=["onClick"],Cd=["src","alt"],kd={key:1},bd=["onClick"],wd=["src","alt"],xd={key:1},Ed=["data-has-second-user","onClick"],Vd={class:"editor-comment-marker-count"},Nd={key:4,class:"dss-text-editor-textarea-wrapper"},Sd=["value","placeholder","rows","disabled"],Bd={class:"dss-text-editor-footer"},Md={class:"dss-text-editor-footer-content"},_d={class:"dss-text-editor-footer-stat"},$d={class:"dss-text-editor-footer-stat"},Td={key:5,class:"dss-text-editor-content-wrapper"},Ld={key:0,class:"dss-comment-overlay-body"},Hd={class:"dss-comment-selection-wrapper"},Ad=["innerHTML"],Dd={class:"dss-comment-messages-wrapper"},Rd={key:0,class:"dss-comment-avatar-wrapper"},Fd={class:"dss-comment-avatar"},Id=["src","alt"],zd={key:1},Pd={class:"dss-comment-header"},Od={class:"dss-comment-header-text"},Zd={class:"dss-comment-author"},Wd={key:0,class:"dss-comment-date"},qd=["onClick","title"],Ud={class:"dss-comment-overlay-inner"},Xd=["placeholder","onKeydown"],Yd={class:"dss-text-editor-footer"},jd={class:"dss-text-editor-footer-content"},Kd={class:"dss-text-editor-footer-stat"},Gd={class:"dss-text-editor-footer-stat"},Qd=["title"],Jd=["title"],e1={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:""},t1={class:"dss-image-popup-content"},n1={key:0,class:"dss-image-popup-no-alt-icon"},l1=["title"],o1=["title"],a1={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:""},s1={class:"dss-toolbar-left"},r1=["title"],i1=["title"],c1={class:"dss-toolbar-dropdown-wrapper"},u1=["title"],d1={key:0,class:"dss-toolbar-heading-icon",width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},m1={key:1,class:"dss-toolbar-heading-icon",width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},p1={key:2,class:"dss-toolbar-heading-icon",width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},f1={key:3,class:"dss-toolbar-heading-icon",width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},v1={key:4,class:"dss-toolbar-heading-icon",width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},g1={key:5,class:"dss-toolbar-heading-icon",width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},h1={key:6,width:"13",height:"14",viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"paragraph-icon"},y1=["title"],C1=["title"],k1=["title"],b1=["title"],w1=["title"],x1=["title"],E1=["title"],V1=["title"],N1=["title"],S1=["title"],B1={key:2,class:"dss-toolbar-separator"},M1={key:3,class:"dss-toolbar-dropdown-wrapper"},_1=["title"],$1={class:"dss-toolbar-dropdown-ai"},T1={key:0,class:"dss-toolbar-right"},L1={key:0,class:"dss-toolbar-separator"},H1={key:0,class:"dss-toolbar-custom-group"},A1={key:1,class:"dss-toolbar-separator"},D1={name:"DSSTextEditor"},R1=Object.assign(D1,{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:F=>typeof F=="object"&&F!==null},floatingToolbar:{type:Boolean,default:!1},askAi:{type:Boolean,default:!1},commentUser:{type:Object,default:null},customToolbarSlots:{type:Array,default:()=>["custom-tool-1","custom-tool-2","custom-tool-3"]},customToolbarFloatingMap:{type:Object,default:()=>({}),validator:F=>typeof F=="object"&&F!==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(F,{expose:Ce,emit:z}){const{t:A,locale:_e}=lo.useI18n(),k=F,Le=z,se=e.useSlots(),pt=`<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
98
+ `}const n=new Blob([t],{type:"text/csv;charset=utf-8;"}),i=URL.createObjectURL(n),f=document.createElement("a");f.href=i,f.download=Pn("csv"),document.body.appendChild(f),f.click(),document.body.removeChild(f),URL.revokeObjectURL(i),It()}catch(t){console.error("Error downloading CSV:",t)}},Ul=t=>{if(typeof t.action=="function"){const s={series:S.series,categories:S.categories,markers:Mt.value},n={chartX:Be.value.chartX,chartY:Be.value.chartY,dataX:Be.value.mouseDataX,dataY:Be.value.mouseDataY,categoryIndex:clampedCategoryIndex||Be.value.categoryIndex};t.action(s,n)}It()},Bl=()=>{el(),he.value.show=!0,he.value.categoryIndex=Be.value.categoryIndex,he.value.fromButton=!1,It()},Eo=()=>{el(),he.value.show=!0,he.value.categoryIndex=0,he.value.fromButton=!0},Xl=t=>{if(Be.value.show){const s=document.querySelector(".dss-context-menu");s&&!s.contains(t.target)&&(Be.value.show=!1)}},Al=t=>{Be.value.show&&!t.target.closest(".context-menu")&&(Be.value.show=!1)},vo=t=>{if(!fn.value||!Te.value)return;t.preventDefault(),t.stopPropagation(),G.value.isZooming=!0,Se.value.show=!1,G.value.zoomTimeout&&clearTimeout(G.value.zoomTimeout);const n=t.currentTarget.getBoundingClientRect(),i=t.clientX-n.left,f=t.clientY-n.top;if(i<I.value.left-50||i>I.value.right+50||f<I.value.top-50||f>I.value.bottom+100){G.value.isZooming=!1;return}const g=t.deltaY>0?.9:1.1,x=Math.max(G.value.minScale,Math.min(G.value.maxScale,G.value.scale*g));if(x!==G.value.scale){const{minX:b,maxX:L}=Ut.value,T=L-b||1,H=T/G.value.scale,M=b-G.value.offsetX/I.value.width*T,K=(i-I.value.left)/I.value.width,ce=M+K*H;G.value.scale=x;const Ve=T/G.value.scale,J=ce-K*Ve;G.value.offsetX=-(J-b)/T*I.value.width,G.value.scale<=1.01&&(G.value.scale=1,G.value.offsetX=0)}G.value.zoomTimeout=setTimeout(()=>{G.value.isZooming=!1,G.value.zoomTimeout=null},300)},Vo=t=>{if(!fn.value||!Te.value||G.value.scale<=1)return;Se.value.show=!1;const n=t.currentTarget.getBoundingClientRect();t.clientX-n.left,t.clientY-n.top,G.value.isDragging=!0,G.value.lastMouseX=t.clientX,G.value.lastMouseY=t.clientY,t.preventDefault()},go=()=>{G.value.isDragging=!1},Yl=()=>{!fn.value||!Te.value||(G.value.scale=1,G.value.offsetX=0,G.value.isDragging=!1,G.value.zoomTimeout&&(clearTimeout(G.value.zoomTimeout),G.value.zoomTimeout=null),G.value.isZooming=!1)},No=()=>!fn.value||!yn.value||!Te.value?"default":G.value.isDragging?"grabbing":G.value.scale>1?"grab":"dss-crosshair",jl=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 s=`M ${t[0].x} ${t[0].y}`;for(let n=0;n<t.length-1;n++){const i=t[Math.max(n-1,0)],f=t[n],g=t[n+1],x=t[Math.min(n+2,t.length-1)],b=f.x+(g.x-i.x)/6*j.value,L=f.y+(g.y-i.y)/6*j.value,T=g.x-(x.x-f.x)/6*j.value,H=g.y-(x.y-f.y)/6*j.value;s+=` C ${b} ${L} ${T} ${H} ${g.x} ${g.y}`}return s},pn=e.computed(()=>{const s=O.value?.chart?.padding,n=typeof s=="number"?s:null,i=s&&typeof s=="object"?s:null,f=50;let g=f+(Ot.value?30:0)+60;if(Un.value){const M={left:f+40,top:f+40,right:f+40,bottom:f+40};return n!=null?{left:n,top:n,right:n,bottom:n}:i?{left:i.left??M.left,top:i.top??M.top,right:i.right??M.right,bottom:i.bottom??M.bottom}:M}if(cn.value){const M=!Bt.value,K=tn.value,ce=K?wn.value+sn.value+Math.max(24,Hn.value+16):0,Ve=M?12:f;let J=0;St.value&&(J+=M?8:15),at.value&&(J+=M?6:10);const pe=Ae();let ye=Ve+(M?4:16)+(K?ce:0),oe=Ve+(K?ce:0);Bt.value&&Xe.value==="left"?ye+=pe.legendWidth||150:Bt.value&&Xe.value==="right"&&(oe+=pe.legendWidth||150);const ke=ge.value==="semi-radial"?K?ce:8:K?ce:M?8:f+80,be=K?14:0,Pe=Ve+J+be,Fe={left:ye,top:Pe,right:oe,bottom:ke};return n!=null?{left:n,top:n,right:n,bottom:n}:i?{left:i.left??Fe.left,top:i.top??Fe.top,right:i.right??Fe.right,bottom:i.bottom??Fe.bottom}:Fe}let x=0;St.value&&(x+=15),at.value&&(x+=10);const b=Ae();let L=f+16,T=f;Bt.value&&Xe.value==="left"?L+=b.legendWidth||150:Bt.value&&Xe.value==="right"&&(T+=b.legendWidth||150);const H={left:L,top:f+x,right:T,bottom:g};return n!=null?{left:n,top:n,right:n,bottom:n}:i?{left:i.left??H.left,top:i.top??H.top,right:i.right??H.right,bottom:i.bottom??H.bottom}:H}),I=e.computed(()=>({left:pn.value.left,top:pn.value.top,right:we.value-pn.value.right,bottom:ut.value-pn.value.bottom,width:we.value-(pn.value.left+pn.value.right),height:ut.value-(pn.value.top+pn.value.bottom)})),fn=e.computed(()=>["line","area","bar"].includes(ge.value)||yt.value),On=e.computed(()=>yt.value),cn=e.computed(()=>["radial","semi-radial"].includes(ge.value)),Un=e.computed(()=>ge.value==="spider"),zt=e.computed(()=>ge.value==="bubble"),nn=e.computed(()=>O.value?.chart?.orientation==="horizontal"&&(ge.value==="bar"||On.value)),ll=t=>{const{minY:s,maxY:n}=Ut.value,i=n-s||1;return I.value.left+(t-s)/i*I.value.width},pl=t=>{const{maxX:s}=Ut.value,n=s+1,f=I.value.height/n;return I.value.top+(t+.5)*f},_t=e.computed(()=>cn.value?pn.value.left+(we.value-pn.value.left-pn.value.right)/2:we.value/2),ht=e.computed(()=>Un.value?ut.value/2-40:cn.value?pn.value.top+(ut.value-pn.value.top-pn.value.bottom)/2:ut.value/2),it=e.computed(()=>{if(Un.value){const t=I.value.width-80,s=I.value.height-80;return Math.min(t,s)/2}return Math.min(I.value.width,I.value.height)/2}),Rt=e.computed(()=>{const t=O.value,s=t?.plotOptions?.radialBar?.innerRadiusRatio??t?.radialBar?.innerRadiusRatio,n=typeof s=="number"&&s>=0&&s<=1?s:.45;return it.value*n}),So=e.computed(()=>{const t=O.value,s=typeof S.innerSize=="number"?S.innerSize:t?.innerSize;return typeof s!="number"||s<=-100||!(cn.value||Un.value)?1:1+s/100}),ho=e.computed(()=>{const t=So.value;if(t===1||t<=0)return;const s=_t.value,n=ht.value;return`translate(${s}, ${n}) scale(${t}) translate(${-s}, ${-n})`}),yl=e.ref(0),Xn=e.computed(()=>`semi-radial-fill-clip-${S.chartId}`),Nn=e.computed(()=>ge.value==="semi-radial"),Qn=e.computed(()=>Nn.value&&C.value&&!un.value),ol=e.computed(()=>Nn.value&&C.value&&!un.value&&V.value==="fill"),qt=e.computed(()=>{const t=Qn.value?yl.value:1,s=_t.value,n=ht.value,i=Rt.value,f=it.value,g=Math.PI,x=Math.PI+t*Math.PI;if(t<=0)return`M ${s} ${n} L ${s} ${n} Z`;const b=s+f*Math.cos(g),L=n+f*Math.sin(g),T=s+f*Math.cos(x),H=n+f*Math.sin(x),M=s+i*Math.cos(x),K=n+i*Math.sin(x),ce=s+i*Math.cos(g),Ve=n+i*Math.sin(g),J=t>.5?1:0;return`M ${s} ${n} L ${b} ${L} A ${f} ${f} 0 ${J} 1 ${T} ${H} L ${M} ${K} A ${i} ${i} 0 ${J} 1 ${ce} ${Ve} Z`}),Kl=e.computed(()=>{if(!(!Nn.value||!Qn.value)&&!ol.value)return`url(#${Xn.value})`}),yo=t=>{if(!(!ol.value||t!==0))return`url(#${Xn.value})`},$n=e.ref(0),al=e.computed(()=>`radial-reveal-clip-${S.chartId}`),Sn=e.computed(()=>ge.value==="radial"),fl=e.computed(()=>{const t=Sn.value?$n.value:1,s=_t.value,n=ht.value,i=Math.max(it.value*1.5,we.value,ut.value);if(t<=0)return`M ${s} ${n} L ${s} ${n} Z`;if(t>=1){const M=s-i,K=s+i;return`M ${M} ${n} A ${i} ${i} 0 0 1 ${K} ${n} A ${i} ${i} 0 0 1 ${M} ${n} Z`}const f=-Math.PI/2,g=f+t*Math.PI*2,x=s+i*Math.cos(f),b=n+i*Math.sin(f),L=s+i*Math.cos(g),T=n+i*Math.sin(g),H=t>=.5?1:0;return`M ${s} ${n} L ${x} ${b} A ${i} ${i} 0 ${H} 1 ${L} ${T} Z`}),Cl=e.computed(()=>{if(Kl.value)return Kl.value;if(Sn.value)return`url(#${al.value})`});let Ml=null;const Bo=()=>{if(!Qn.value)return;yl.value=0;const t=P.value,s=performance.now(),n=i=>{const f=i-s,g=Math.min(1,f/t);yl.value=zl(ze.value,g),g<1&&(Ml=requestAnimationFrame(n))};Ml=requestAnimationFrame(n)},kl=e.computed(()=>O.value?.bubbles?.minSize||8),Co=e.computed(()=>O.value?.bubbles?.maxSize||50),bl=e.computed(()=>O.value?.bubbles?.opacity||.7),Gl=(t,s)=>{const n=[15,20,25,18,22],i=n[t%n.length]||20,f=1+Math.sin(s*.5)*.2;return Math.max(5,i*f)},Mo=t=>{const s=document.querySelector(`.dss-bubble-image-${t}`);s&&(s.style.opacity="1")},_o=t=>{const s=document.querySelector(`.dss-bubble-image-${t}`);s&&(s.style.display="none")},Dn=e.computed(()=>S.series),Jn=e.computed(()=>S.series.filter((t,s)=>!Vt.value.has(s))),Yn="auto",Ut=e.computed(()=>{if(zt.value)return ko();if(!Jn.value.length)return{minX:0,maxX:1,minY:0,maxY:1};let t=1/0,s=-1/0,n=0;Jn.value.forEach(b=>{b.data&&b.data.length&&(n=Math.max(n,b.data.length-1),b.data.forEach(L=>{typeof L=="number"&&(t=Math.min(t,L),s=Math.max(s,L))}))}),S.categories.length>0&&(n=Math.max(n,S.categories.length-1)),t===1/0&&(t=0,s=100);const i=Et.value,f=lt.value;let g,x;if(i===Yn){const b=s-t,L=b>0?b*.1:1;g=Math.max(0,t-L)}else if(typeof i=="number")g=i;else{const b=s-t,L=b>0?b*.1:1;g=Math.max(0,t-L)}if(f===Yn){const b=s-t,L=b>0?b*.1:2;x=s+L}else if(typeof f=="number")x=f;else{const b=s-t,L=b>0?b*.1:2;x=s+L}return{minX:0,maxX:n,minY:g,maxY:x}}),ko=()=>{if(!Jn.value.length)return{minX:0,maxX:8,minY:0,maxY:50,minSize:10,maxSize:30};let t=1/0,s=-1/0,n=1/0,i=-1/0,f=1/0,g=-1/0,x=!1;if(Jn.value.forEach((ce,Ve)=>{ce?.data?.length&&ce.data.forEach((J,pe)=>{let ye,oe,Ye;if(typeof J=="object"&&J!==null&&!Array.isArray(J))ye=typeof J.x=="number"?J.x:pe,oe=typeof J.y=="number"?J.y:0,Ye=typeof J.size=="number"?J.size:20;else if(Array.isArray(J)&&J.length>=3)ye=typeof J[0]=="number"?J[0]:pe,oe=typeof J[1]=="number"?J[1]:0,Ye=typeof J[2]=="number"?J[2]:20;else if(typeof J=="number")ye=pe,oe=J,Ye=Gl(Ve,pe);else return;isFinite(ye)&&isFinite(oe)&&isFinite(Ye)&&(t=Math.min(t,ye),s=Math.max(s,ye),n=Math.min(n,oe),i=Math.max(i,oe),f=Math.min(f,Ye),g=Math.max(g,Ye),x=!0)})}),!x)return{minX:0,maxX:8,minY:0,maxY:50,minSize:10,maxSize:30};t===s&&(t=Math.min(t,0),s=Math.max(s,S.categories?.length-1||8)),n===i&&(n=Math.max(0,n-10),i=n+20);const b=s-t,L=i-n;let T,H,M,K;return je.value!==null?T=je.value:T=t-b*.1,Dt.value!==null?H=Dt.value:H=s+b*.1,Et.value!==null&&typeof Et.value=="number"?M=Et.value:M=Math.max(0,n-L*.1),lt.value!==null&&typeof lt.value=="number"?K=lt.value:K=i+L*.1,{minX:T,maxX:H,minY:M,maxY:K,minSize:f,maxSize:g}},Ft=t=>{if(zt.value){const{minX:b,maxX:L}=Ut.value,T=L-b||1;return I.value.left+(t-b)/T*I.value.width}const{minX:s,maxX:n}=Ut.value,i=n-s;if(n===0||i===0)return I.value.left+I.value.width/2;const f=i/G.value.scale,g=s-G.value.offsetX/I.value.width*i,x=(t-g)/f;return I.value.left+x*I.value.width},ln=t=>{const{minY:s,maxY:n}=Ut.value,i=n-s||1;return I.value.bottom-(t-s)/i*I.value.height},$o=t=>{if(!zt.value)return qe.value||4;const{maxSize:s}=Ut.value,n=Math.max(1,s),i=Math.min(1,Math.max(0,t/n));return kl.value+i*(Co.value-kl.value)},bo=e.computed(()=>wl.value.map(t=>({y:t.y}))),Dl=e.computed(()=>{if(zt.value)return To();if(ge.value==="bar"){if(nn.value){const ke=[],{minY:be,maxY:Pe}=Ut.value,Fe=5,kt=Pe-be||1;for(let bt=0;bt<=Fe;bt++){const Bn=be+kt*(bt/Fe),Gt=ll(Bn);ke.push({x:Gt,y:I.value.bottom+20,text:an(Math.round(Bn))})}return ke}const Ve=[],{maxX:J}=Ut.value,pe=J+1,ye=5,Ye=(I.value.width-ye*2)/pe;for(let ke=0;ke<=J;ke++){const be=I.value.left+ye+(ke+.5)*Ye;Ve.push({x:be,y:I.value.bottom+20,text:S.categories[ke]||z("chart.fallback.item",{number:ke+1})})}return Ve}const t=[],{minX:s,maxX:n}=Ut.value,i=n-s||1,f=i/G.value.scale,g=s-G.value.offsetX/I.value.width*i,x=g+f,b=Math.max(0,Math.floor(g-2)),L=Math.min(n,Math.ceil(x+2)),T=L-b,H=I.value.width,K=Math.floor(H/60);let ce=1;T>K&&(ce=Math.ceil(T/K));for(let Ve=b;Ve<=L;Ve+=ce)if(Ve>=0&&Ve<=n){const J=Ft(Ve);J>=I.value.left-100&&J<=I.value.right+100&&t.push({x:J,y:I.value.bottom+20,text:S.categories[Ve]||`Item ${Ve+1}`})}return t}),To=()=>{const t=[],{minX:s,maxX:n}=Ut.value,i=n-s||1,f=Math.min(8,Math.max(4,Math.floor(I.value.width/80)));for(let g=0;g<=f;g++){const x=s+i*g/f,b=Ft(x);if(b>=I.value.left-10&&b<=I.value.right+10){const L=Math.round(x),T=S.categories?.[L];t.push({x:b,y:I.value.bottom+20,text:T||(Number.isInteger(x)?x.toString():x.toFixed(1))})}}return t},wl=e.computed(()=>{if(nn.value){const f=[],{maxX:g}=Ut.value;for(let x=0;x<=g;x++)f.push({x:I.value.left-10,y:pl(x),text:S.categories[x]||`Item ${x+1}`});return f}const t=[],{minY:s,maxY:n}=Ut.value,i=5;for(let f=0;f<=i;f++){const g=s+(n-s)*(f/i),x=Math.round(g);t.push({x:I.value.left-10,y:ln(g),text:an(x)})}return t}),Nt=t=>{const s=E.value;if(!s||s.length===0){const n=["#3B82F6","#EF4444","#10B981","#F59E0B","#8B5CF6","#F97316","#06B6D4","#84CC16"];return n[t%n.length]}return s[t%s.length]},Ql=t=>{if(!t||typeof t!="string")return"#3a3a3a";const s=t.trim();let n=0,i=0,f=0;const g=s.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i);if(g)n=Number(g[1])/255,i=Number(g[2])/255,f=Number(g[3])/255;else{const b=s.match(/^rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)\s*\)$/i);if(b)n=Number(b[1])/255,i=Number(b[2])/255,f=Number(b[3])/255;else{const L=s.match(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/);if(L){let T=L[1];T.length===3&&(T=T[0]+T[0]+T[1]+T[1]+T[2]+T[2]),n=parseInt(T.slice(0,2),16)/255,i=parseInt(T.slice(2,4),16)/255,f=parseInt(T.slice(4,6),16)/255}else if(typeof document<"u"){const T=document.createElement("span");T.style.color=s,T.style.display="none",document.body.appendChild(T);const H=getComputedStyle(T).color;document.body.removeChild(T);const M=H.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i);if(M)n=Number(M[1])/255,i=Number(M[2])/255,f=Number(M[3])/255;else return"#3a3a3a"}else return"#3a3a3a"}}return .2126*n+.7152*i+.0722*f>.5?"#3a3a3a":"#fafafa"},Rl=t=>{if(!t||typeof t!="string")return t;const s=t.trim(),n=s.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)),x=Math.max(0,Math.floor(Number(n[2])*.65)),b=Math.max(0,Math.floor(Number(n[3])*.65));return`rgb(${g}, ${x}, ${b})`}const i=s.match(/^rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)\s*\)$/i);if(i){const g=Math.max(0,Math.floor(Number(i[1])*.65)),x=Math.max(0,Math.floor(Number(i[2])*.65)),b=Math.max(0,Math.floor(Number(i[3])*.65));return`rgba(${g}, ${x}, ${b}, ${i[4]})`}const f=s.match(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/);if(f){let g=f[1];g.length===3&&(g=g[0]+g[0]+g[1]+g[1]+g[2]+g[2]);const x=Math.max(0,Math.min(255,Math.floor(parseInt(g.slice(0,2),16)*.65))),b=Math.max(0,Math.min(255,Math.floor(parseInt(g.slice(2,4),16)*.65))),L=Math.max(0,Math.min(255,Math.floor(parseInt(g.slice(4,6),16)*.65)));return`#${[x,b,L].map(T=>T.toString(16).padStart(2,"0")).join("")}`}return s},Jl=(t,s)=>{const i=O.value?.stroke?.color;return i==null?Rl(s):typeof i=="string"?i:Array.isArray(i)&&i.length?i[t%i.length]??Rl(s):Rl(s)},eo=t=>{let s=0;for(let n=1;n<t.length;n++){const i=t[n].x-t[n-1].x,f=t[n].y-t[n-1].y;s+=Math.sqrt(i*i+f*f)}return s},wo=e.computed(()=>ge.value==="line"||On.value?(On.value?S.series.filter(s=>(s.type||ge.value)==="line"):Dn.value).map((s,n)=>{const i=S.series.findIndex(M=>M===s),f=[];let g=[];s.data.forEach((M,K)=>{M==null?g.length>0&&(f.push([...g]),g=[]):g.push({x:nn.value?ll(M):Ft(K),y:nn.value?pl(K):ln(M),index:K})}),g.length>0&&f.push(g);let x="";f.forEach(M=>{if(M.length>0){let K="";Z.value?K=jl(M):K=`M ${M[0].x} ${M[0].y}`+M.slice(1).map(ce=>` L ${ce.x} ${ce.y}`).join(""),x+=(x?" ":"")+K}});const b=f.reduce((M,K)=>M+eo(K),0),L=Vt.value.has(i),T=Ee.value===i,H=Ee.value!==null&&Ee.value!==i;return{path:x,color:Nt(i),pathLength:b,seriesIndex:i,animationDelay:n*Re.value,isHighlighted:T,isDimmed:H,isHidden:L}}):[]),_l=e.computed(()=>{if(!(ge.value==="line"||On.value))return[];const t=On.value?S.series.filter(n=>(n.type||ge.value)==="line"):Dn.value,s=[];return t.forEach((n,i)=>{const f=S.series.findIndex(g=>g===n);for(let g=0;g<n.data.length-1;g++){const x=n.data[g];if(x!=null){let b=-1,L=0;for(let T=g+1;T<n.data.length;T++){const H=n.data[T];if(H==null)L++;else{b=T;break}}if(L>0&&b!==-1){const T=n.data[b],H=nn.value?ll(x):Ft(g),M=nn.value?pl(g):ln(x),K=nn.value?ll(T):Ft(b),ce=nn.value?pl(b):ln(T),Ve=Vt.value.has(f),J=Ee.value===f,pe=Ee.value!==null&&Ee.value!==f;s.push({path:`M ${H} ${M} L ${K} ${ce}`,color:Nt(f),seriesIndex:f,animationDelay:i*Re.value,isHighlighted:J,isDimmed:pe,isHidden:Ve,gapSize:L}),g=b-1}}}}),s}),Zn=e.computed(()=>ge.value==="line"||On.value?!C.value||un.value||gt.value.hasAnimated?[]:(On.value?S.series.filter(s=>(s.type||ge.value)==="line"):Dn.value).map((s,n)=>{const i=S.series.findIndex(L=>L===s);let f="",g=null;s.data.forEach((L,T)=>{if(L!=null){const H={x:nn.value?ll(L):Ft(T),y:nn.value?pl(T):ln(L)};g===null?f+=`M ${H.x} ${H.y}`:f+=` L ${H.x} ${H.y}`,g=H}else if(g!==null){const H=s.data.findIndex((M,K)=>K>T&&M!==null&&M!==void 0);if(H!==-1){const M={x:nn.value?ll(s.data[H]):Ft(H),y:nn.value?pl(H):ln(s.data[H])};f+=` L ${M.x} ${M.y}`,g=M}}});const x=s.data.map((L,T)=>L==null?null:{x:nn.value?ll(L):Ft(T),y:nn.value?pl(T):ln(L)}).filter(L=>L!==null),b=eo(x);return{path:f,pathLength:b,color:Nt(i),animationDelay:n*Re.value,seriesIndex:i}}):[]),Lo=e.computed(()=>{if(ge.value!=="line")return[];const t=[];return Dn.value.forEach((s,n)=>{const i=Ee.value===n,f=Ee.value!==null&&Ee.value!==n,g=Vt.value.has(n);s.data.forEach((x,b)=>{x!=null&&t.push({x:Ft(b),y:ln(x),color:Nt(n),value:x,label:S.categories[b]||b.toString(),seriesName:s.name,categoryIndex:b,dataIndex:b,animationDelay:(n*s.data.length+b)*(Re.value/8),isHighlighted:i,isDimmed:f,isHidden:g})})}),t}),vl=e.computed(()=>{if(!On.value)return[];const t=[];return S.series.filter(n=>(n.type||ge.value)==="line").forEach((n,i)=>{const f=S.series.findIndex(L=>L===n),g=Ee.value===f,x=Ee.value!==null&&Ee.value!==f,b=Vt.value.has(f);n.data.forEach((L,T)=>{L!=null&&t.push({x:Ft(T),y:ln(L),color:Nt(f),value:L,label:S.categories[T]||T.toString(),seriesName:n.name,categoryIndex:T,dataIndex:T,animationDelay:(i*n.data.length+T)*(Re.value/8),isHighlighted:g,isDimmed:x,isHidden:b})})}),t}),xl=e.computed(()=>{if(!zt.value)return[];const t=[];return Dn.value.forEach((s,n)=>{if(!s?.data?.length)return;const i=Ee.value,f=i!==null&&i===n,g=i!==null&&i!==n,x=Vt.value.has(n);s.data.forEach((b,L)=>{let T,H,M,K,ce;if(typeof b=="object"&&b!==null&&!Array.isArray(b))T=typeof b.x=="number"?b.x:L,H=typeof b.y=="number"?b.y:0,M=typeof b.size=="number"?b.size:20,K=b.label||S.categories?.[L]||`Point ${L+1}`,ce=b.image||b.imageUrl;else if(Array.isArray(b)&&b.length>=3)T=typeof b[0]=="number"?b[0]:L,H=typeof b[1]=="number"?b[1]:0,M=typeof b[2]=="number"?b[2]:20,K=b[3]||S.categories?.[L]||`Point ${L+1}`,ce=b[4];else if(typeof b=="number")T=L,H=b,M=Gl(n,L),K=S.categories?.[L]||`Point ${L+1}`;else return;!isFinite(T)||!isFinite(H)||!isFinite(M)||t.push({x:Ft(T),y:ln(H),radius:$o(M),originalX:T,originalY:H,originalSize:M,color:Nt(n),seriesName:s.name||`Series ${n+1}`,label:K,imageUrl:ce,seriesIndex:n,dataIndex:L,categoryIndex:Math.round(T),isHighlighted:f,isDimmed:g,isHidden:x,opacity:bl.value})})}),t}),to=e.computed(()=>ge.value!=="area"?[]:Dn.value.map((t,s)=>{const n=[];let i=[];if(t.data.forEach((M,K)=>{M==null?i.length>0&&(n.push([...i]),i=[]):i.push({x:Ft(K),y:ln(M),index:K})}),i.length>0&&n.push(i),n.length===0)return{linePath:"",areaPath:"",color:Nt(s),isHidden:Vt.value.has(s)};const f=I.value.bottom+1;let g="",x="";n.forEach((M,K)=>{if(M.length===0)return;let ce=`M ${M[0].x} ${M[0].y}`;Z.value&&M.length>1?ce=jl(M):M.slice(1).forEach(J=>{ce+=` L ${J.x} ${J.y}`}),g+=(g?" ":"")+ce;let Ve=`M ${M[0].x} ${f}`;if(Ve+=` L ${M[0].x} ${M[0].y}`,Z.value&&M.length>1){const J=jl(M),pe=J.substring(J.indexOf("C")||J.indexOf("Q")||J.indexOf("L"));pe?Ve+=" "+pe:M.slice(1).forEach(ye=>{Ve+=` L ${ye.x} ${ye.y}`})}else M.slice(1).forEach(J=>{Ve+=` L ${J.x} ${J.y}`});Ve+=` L ${M[M.length-1].x} ${f} Z`,x+=(x?" ":"")+Ve});const b=Ee.value===s,L=Ee.value!==null&&Ee.value!==s,T=Vt.value.has(s),H=n.reduce((M,K)=>M+eo(K),0);return{linePath:g,areaPath:x,color:Nt(s),pathLength:H,isHighlighted:b,isDimmed:L,isHidden:T}})),no=e.computed(()=>{if(!(["bar"].includes(ge.value)||On.value))return[];const t=[],{maxX:s}=Ut.value,n=On.value?S.series.filter(f=>(f.type||ge.value)==="bar"):Dn.value,i=n.length;if(nn.value){const f=s+1,x=I.value.height/f,b=x*(2/3),L=Math.min(4,b/i*.15),T=b-(i-1)*L,H=Math.max(4,T/i);n.forEach((M,K)=>{const ce=S.series.findIndex(ye=>ye===M),Ve=Ee.value===ce,J=Ee.value!==null&&Ee.value!==ce,pe=Vt.value.has(ce);M.data.forEach((ye,oe)=>{if(ye==null||typeof ye!="number"||!isFinite(ye))return;const be=I.value.top+(oe+.5)*x-b/2+K*(H+L),Pe=I.value.left,Fe=Math.abs(ll(ye)-I.value.left);let kt="";if(Z.value&&Fe>0){const bt=Math.min(ie.value,H/2,Fe/2);kt=[`M ${Pe} ${be}`,`L ${Pe+Fe-bt} ${be}`,`Q ${Pe+Fe} ${be} ${Pe+Fe} ${be+bt}`,`L ${Pe+Fe} ${be+H-bt}`,`Q ${Pe+Fe} ${be+H} ${Pe+Fe-bt} ${be+H}`,`L ${Pe} ${be+H}`,"Z"].join(" ")}t.push({x:Pe,y:be,width:Fe,height:H,color:Nt(i===1?oe:ce),value:ye,label:S.categories[oe]||oe.toString(),seriesName:M.name,animationDelay:(K*n.length+oe)*(Re.value/4),isHighlighted:Ve,isDimmed:J,isHidden:pe,barPath:kt,isSmooth:Z.value&&Fe>0})})})}else{const f=s+1,x=I.value.width/f,b=x*.8,L=b/i,T=L*.05,H=L-T;n.forEach((M,K)=>{const ce=S.series.findIndex(ye=>ye===M),Ve=Ee.value===ce,J=Ee.value!==null&&Ee.value!==ce,pe=Vt.value.has(ce);M.data.forEach((ye,oe)=>{if(ye==null||typeof ye!="number"||!isFinite(ye))return;const be=I.value.left+(oe+.5)*x-b/2+K*L+T/2,Pe=ln(Math.max(0,ye)),Fe=Math.abs(ln(0)-ln(ye));let kt="";if(Z.value&&Fe>0){const bt=Math.min(ie.value,H/2,Fe/2);kt=[`M ${be} ${Pe+Fe}`,`L ${be} ${Pe+bt}`,`Q ${be} ${Pe} ${be+bt} ${Pe}`,`L ${be+H-bt} ${Pe}`,`Q ${be+H} ${Pe} ${be+H} ${Pe+bt}`,`L ${be+H} ${Pe+Fe}`,"Z"].join(" ")}t.push({x:be,y:Pe,width:H,height:Fe,color:Nt(i===1?oe:ce),value:ye,label:S.categories[oe]||oe.toString(),seriesName:M.name,animationDelay:(K*n.length+oe)*(Re.value/4),isHighlighted:Ve,isDimmed:J,isHidden:pe,barPath:kt,isSmooth:Z.value&&Fe>0})})})}return t}),sl=e.computed(()=>{if(!cn.value)return[];const t=Dn.value.map((g,x)=>({series:g,originalIndex:x})).filter(({originalIndex:g})=>!Vt.value.has(g));if(t.length===0)return[];let s=ge.value==="semi-radial"?Math.PI:-Math.PI/2;const n=ge.value==="semi-radial"?Math.PI:Math.PI*2,i=[];if(t.length===1){const{series:g,originalIndex:x}=t[0],b=g.data[0]||0,L=s,T=s+n-.001,H=L+n/2,M=_t.value+Math.cos(L)*Rt.value,K=ht.value+Math.sin(L)*Rt.value,ce=_t.value+Math.cos(T)*Rt.value,Ve=ht.value+Math.sin(T)*Rt.value,J=_t.value+Math.cos(T)*it.value,pe=ht.value+Math.sin(T)*it.value,ye=_t.value+Math.cos(L)*it.value,oe=ht.value+Math.sin(L)*it.value,Ye=1,ke=[`M ${M} ${K}`,`A ${Rt.value} ${Rt.value} 0 ${Ye} 1 ${ce} ${Ve}`,`L ${J} ${pe}`,`A ${it.value} ${it.value} 0 ${Ye} 0 ${ye} ${oe}`,"Z"].join(" "),be=Nt(x);return i.push({path:ke,color:be,strokeWidth:ft.value,strokeColor:Jl(0,be),value:b,seriesName:g.name,opacity:.8,isHighlighted:Ee.value===x,isDimmed:!1,isHidden:!1,startAngle:L,endAngle:T,midAngle:H}),i}if(ol.value&&t.length===2){const g=t[0],x=t[1],b=Math.min(100,Math.max(0,g.series.data[0]||0)),L=b/100*n,T=(H,M,K,ce,Ve)=>{const J=H+(M-H)/2,pe=M-H,ye=_t.value+Math.cos(H)*Rt.value,oe=ht.value+Math.sin(H)*Rt.value,Ye=_t.value+Math.cos(M)*Rt.value,ke=ht.value+Math.sin(M)*Rt.value,be=_t.value+Math.cos(M)*it.value,Pe=ht.value+Math.sin(M)*it.value,Fe=_t.value+Math.cos(H)*it.value,kt=ht.value+Math.sin(H)*it.value,bt=pe>Math.PI?1:0,Bn=[`M ${ye} ${oe}`,`A ${Rt.value} ${Rt.value} 0 ${bt} 1 ${Ye} ${ke}`,`L ${be} ${Pe}`,`A ${it.value} ${it.value} 0 ${bt} 0 ${Fe} ${kt}`,"Z"].join(" "),Gt=Nt(ce);return{path:Bn,color:Gt,strokeWidth:ft.value,strokeColor:Jl(i.length,Gt),value:Ve,seriesName:K.name,opacity:.8,isHighlighted:Ee.value===ce,isDimmed:Ee.value!==null&&Ee.value!==ce,isHidden:!1,startAngle:H,endAngle:M,midAngle:J}};return i.push(T(s,s+L,g.series,g.originalIndex,b)),i.push(T(s,s+n,x.series,x.originalIndex,100)),i}const f=t.reduce((g,{series:x})=>g+(x.data[0]||0),0);return f===0?[]:(t.forEach(({series:g,originalIndex:x})=>{const b=g.data[0]||0,L=b/f*n,T=s,H=s+L,M=T+L/2,K=_t.value+Math.cos(T)*Rt.value,ce=ht.value+Math.sin(T)*Rt.value,Ve=_t.value+Math.cos(H)*Rt.value,J=ht.value+Math.sin(H)*Rt.value,pe=_t.value+Math.cos(H)*it.value,ye=ht.value+Math.sin(H)*it.value,oe=_t.value+Math.cos(T)*it.value,Ye=ht.value+Math.sin(T)*it.value,ke=L>Math.PI?1:0,be=[`M ${K} ${ce}`,`A ${Rt.value} ${Rt.value} 0 ${ke} 1 ${Ve} ${J}`,`L ${pe} ${ye}`,`A ${it.value} ${it.value} 0 ${ke} 0 ${oe} ${Ye}`,"Z"].join(" "),Pe=Nt(x);i.push({path:be,color:Pe,strokeWidth:ft.value,strokeColor:Jl(i.length,Pe),value:b,seriesName:g.name,opacity:.8,isHighlighted:Ee.value===x,isDimmed:Ee.value!==null&&Ee.value!==x,isHidden:!1,startAngle:T,endAngle:H,midAngle:M}),s=H}),i)}),o=e.computed(()=>{const t=sl.value;return ol.value&&t.length>=2?[{segment:t[1],originalIndex:1},{segment:t[0],originalIndex:0}]:t.map((s,n)=>({segment:s,originalIndex:n}))}),l=e.computed(()=>{if(!tn.value||!cn.value)return[];const t=Hn.value,s=wn.value,n=sn.value,i=xn.value,f=15,g=t*1.3,x=.55,b=(M,K)=>{const ce=_t.value+Math.cos(M.midAngle)*it.value,Ve=ht.value+Math.sin(M.midAngle)*it.value,J=_t.value+Math.cos(M.midAngle)*(it.value+s),pe=ht.value+Math.sin(M.midAngle)*(it.value+s),oe=J+n*(K?1:-1),Ye=K?J+f:J-f,ke=pe-i,be=`${M.seriesName}: ${an(M.value)}`,Pe=be.length*t*x;return{pointerStartX:ce,pointerStartY:Ve,pointerEndX:J,pointerEndY:pe,horizontalEndX:oe,horizontalEndY:pe,textX:Ye,textY:ke,text:be,textWidth:Pe,textAnchor:K?"start":"end",isRightSide:K,pointerLineLength:Math.hypot(J-ce,pe-Ve),horizontalLineLength:Math.hypot(oe-J,0)}},L=(M,K)=>{const ce=Math.abs(M.textY-K.textY)<g,Ve=M.isRightSide?M.textX:M.textX-M.textWidth,J=M.isRightSide?M.textX+M.textWidth:M.textX,pe=K.isRightSide?K.textX:K.textX-K.textWidth,ye=K.isRightSide?K.textX+K.textWidth:K.textX,oe=Ve<ye&&pe<J;return ce&&oe},T=sl.value.filter(M=>!M.isHidden),H=[];for(let M=0;M<T.length;M++){const K=T[M];let ce=Math.cos(K.midAngle)>=0;if(M>0){const J=H[M-1],pe=b(K,ce);L(J,pe)&&(ce=!ce)}const Ve=b(K,ce);H.push({...Ve,color:K.color,isHighlighted:K.isHighlighted,isDimmed:K.isDimmed})}return H}),a=t=>{if(!t||t.isHidden)return 0;const s=t.opacity||bl.value||.7;return Ee.value===null||Ee.value===void 0?s:Ee.value!==null?t.seriesIndex===Ee.value?Math.min(1,s+.1):Math.max(.5,s*.8):s},r=t=>{if(!t||t.isHidden)return 0;const s=t.radius>20?.9:.8;return Ee.value!==null?t.seriesIndex===Ee.value?Math.min(1,s+.1):s*.7:s},c=(t,s)=>{if(t)try{if(Ee.value===t.seriesIndex?Ee.value=null:Ee.value=t.seriesIndex,typeof window<"u"&&window.dispatchEvent){const n=new CustomEvent("dss-bubble-click",{detail:{bubble:t,originalEvent:s,chartId:S.chartId}});window.dispatchEvent(n)}}catch(n){console.error("Error in onBubbleClick:",n)}},d=(t,s)=>{const n=[`dss-bubble-fallback-${s}`];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(" ")},u=(t,s)=>{if(!t||(s.stopPropagation(),$l.value=!0,Ee.value=t.seriesIndex,Se.value.show=!1,!Yt.value))return;const n=s.target.closest(".dss-custom-chart-container");if(!n)return;const i=n.getBoundingClientRect();let f=s.clientX-i.left+10,g=s.clientY-i.top-10;const x=200,b=120;f+x>we.value&&(f=s.clientX-i.left-x-10),g+b>i.height&&(g=s.clientY-i.top-b-10),f<0&&(f=10),g<0&&(g=10);const L=dl.value,T=hl.value,H=L.map(M=>{const K=T[M]||M,ce=m(M,t);return ce?{seriesName:t.seriesName,label:t.label,value:`${K}: ${ce}`,color:t.color}:null}).filter(Boolean);et.value={show:!0,x:f,y:g,title:t.label||t.seriesName||"",value:"",bubbleData:H,categoryIndex:void 0,spiderSeries:[]}},m=(t,s)=>{let n;switch(t){case"x":n=s.originalX;break;case"y":n=s.originalY;break;case"size":n=s.originalSize;break;case"label":n=s.label;break;case"seriesName":n=s.seriesName;break;default:n=s[t]||""}const i=Ll.value[t];if(typeof i=="function")return i(n,s);if(typeof n=="number"){const f=n.toFixed(1);return In.value?f+In.value:f}return n?.toString()||""},v=()=>{if(!zt.value||!Se.value.data||Se.value.data.length===0)return"Bubbles";const t=[],s=new Set;return Se.value.data.forEach(n=>{if(n.seriesName&&n.label){const i=`${n.seriesName} - ${n.label}`;s.has(i)||(t.push(i),s.add(i))}else n.seriesName&&(s.has(n.seriesName)||(t.push(n.seriesName),s.add(n.seriesName)))}),t.length>0?t.join(" | "):"Bubbles"},h=(t,s)=>{t&&($l.value=!1,Ee.value=null,et.value.show=!1,et.value.bubbleData=[])},_=(t,s)=>{const n=s.target.closest(".dss-custom-chart-container");if(!n)return;const i=n.getBoundingClientRect(),f=io(t.categoryIndex),g=t.description||t.comment||"";let x=s.clientX-i.left+15,b=s.clientY-i.top-10;const L=200,T=g?80:50;x+L>we.value&&(x=s.clientX-i.left-L-15),b+T>ut.value&&(b=s.clientY-i.top-T-10),x<0&&(x=10),b<0&&(b=10),rn.value={show:!0,x,y:b,categoryValue:f,description:g}},$=()=>{rn.value.show=!1},N=e.computed(()=>S.categories.length||Math.max(...Jn.value.map(t=>t.data.length))),Q=e.computed(()=>{let t=0;return Jn.value.forEach(s=>{s.data.forEach(n=>{typeof n=="number"&&(t=Math.max(t,n))})}),t||100}),Y=e.computed(()=>{const t=[],s=N.value;for(let n=0;n<s;n++){const i=n*2*Math.PI/s-Math.PI/2,f=_t.value+Math.cos(i)*it.value,g=ht.value+Math.sin(i)*it.value;t.push({x:f,y:g,angle:i,index:n})}return t}),Le=e.computed(()=>{const t=[],s=N.value;return Y.value.forEach((n,i)=>{const f=it.value+15,g=i*2*Math.PI/s-Math.PI/2,x=_t.value+Math.cos(g)*f,b=ht.value+Math.sin(g)*f+5;let L="middle",T="middle";Math.abs(Math.cos(g))>.5&&(L=Math.cos(g)>0?"start":"end"),Math.abs(Math.sin(g))>.5&&(T=Math.sin(g)>0?"hanging":"auto"),t.push({x,y:b,text:S.categories[i]||`Axis ${i+1}`,anchor:L,baseline:T})}),t}),me=e.ref(new Set),ct=(t,s,n)=>{const i=`current-${n}`,f=me.value.has(i);return!f&&Ee.value===null?s.fillOpacity||Ge.value:s.isHighlighted||f?(s.fillOpacity||Ge.value)+.15:s.isDimmed?(s.fillOpacity||Ge.value)*.3:s.fillOpacity||Ge.value},Qt=e.computed(()=>{if(!Un.value)return[];const t=[],s=N.value;return Dn.value.forEach((n,i)=>{const f=[],g=[],x=[],b=Ee.value===i,L=Ee.value!==null&&Ee.value!==i,T=Vt.value.has(i);for(let H=0;H<s;H++){const M=n.data[H]||0,ce=M/Q.value*it.value,Ve=H*2*Math.PI/s-Math.PI/2,J=_t.value+Math.cos(Ve)*ce,pe=ht.value+Math.sin(Ve)*ce;f.push(`${J},${pe}`),g.push({x:J,y:pe}),x.push({x:J,y:pe,value:M,label:S.categories[H]||`Axis ${H+1}`,seriesName:n.name})}t.push({points:f.join(" "),polygonPoints:g,dataPoints:x,color:Nt(i),fillOpacity:Ge.value,seriesName:n.name,value:`${n.name}: ${n.data.join(", ")}`,isHighlighted:b,isDimmed:L,isHidden:T,seriesIndex:i})}),t}),Jt=(t,s)=>{if(!s||s.length<3)return!1;let n=!1;for(let i=0,f=s.length-1;i<s.length;f=i++){const g=s[i].x,x=s[i].y,b=s[f].x,L=s[f].y;x>t.y!=L>t.y&&t.x<(b-g)*(t.y-x)/(L-x)+g&&(n=!n)}return n},Xt=t=>{if(!Un.value)return;const s=t.currentTarget.closest(".dss-custom-chart-container");if(!s)return;const n=s.getBoundingClientRect(),i=$e.value?.getBoundingClientRect();if(!i)return;const f=t.clientX-i.left,g=t.clientY-i.top,x=Qt.value.filter(b=>b.isHidden?!1:Jt({x:f,y:g},b.polygonPoints));if(x.length>0){x.length,Ee.value=x[0].seriesIndex;const b=t.clientX-n.left+10,L=t.clientY-n.top-10,T=200,H=50+x.length*25;let M=b,K=L;M+T>we.value&&(M=t.clientX-n.left-T-10),K+H>ut.value&&(K=t.clientY-n.top-H-10),M<0&&(M=10),K<0&&(K=10);const ce=x.map(Ve=>{let J=Ve.dataPoints[0],pe=1/0;return Ve.dataPoints.forEach(ye=>{const oe=Math.sqrt(Math.pow(ye.x-f,2)+Math.pow(ye.y-g,2));oe<pe&&(pe=oe,J=ye)}),{seriesName:Ve.seriesName,color:Ve.color,value:an(J.value!==void 0?J.value:Ve.value)}});et.value={show:!0,x:M,y:K,title:x.length===1?x[0].seriesName:"",value:"",bubbleData:[],spiderSeries:ce}}else jn()},Pt=e.computed(()=>{const t=O.value;return t.logos.map((s,n)=>{const i=S.series[s.seriesIndex];if(!i||!i.data||i.data.length===0||Vt.value.has(s.seriesIndex))return null;let f,g;if(fn.value){let b=-1,L=null;for(let H=i.data.length-1;H>=0;H--)if(i.data[H]!==null&&i.data[H]!==void 0){b=H,L=i.data[H];break}if(b===-1||L===null)return null;const T=i.data.map((H,M)=>H==null?null:{x:Ft(M),y:ln(H),index:M}).filter(H=>H!==null);if(t.animations.enabled&&!un.value&&t.animations.type==="draw"&&t.chart.type==="line"&&(gt.value.isAnimating||!gt.value.hasAnimated))if(gt.value.isAnimating){const H=gt.value.currentFrame/gt.value.totalFrames,M=zl(t.animations.easing,Math.min(H,1)),K=Go(T,M);f=K.x+(s.offsetX||0),g=K.y+(s.offsetY||0)}else f=T[0].x+(s.offsetX||0),g=T[0].y+(s.offsetY||0);else f=Ft(b)+(s.offsetX||0),g=ln(L)+(s.offsetY||0)}else if(cn.value||Un.value){const b=Math.PI*2/t.logos.length*n;f=_t.value+Math.cos(b)*(it.value+30)+(s.offsetX||0),g=ht.value+Math.sin(b)*(it.value+30)+(s.offsetY||0)}return{...s,x:f,y:g,seriesIndex:s.seriesIndex}}).filter(Boolean)}),en=t=>{const s=document.querySelector(`.dss-logo-fallback-${t}`),n=document.querySelector(`.dss-logo-image-${t}`);s&&(s.style.opacity="0"),n&&(n.style.opacity="1")},Kt=t=>{console.warn(`Logo ${t} failed to load, keeping fallback circle`);const s=document.querySelector(`.dss-logo-image-${t}`);s&&(s.style.display="none")},Rn=t=>{Vt.value.has(t)?Vt.value.delete(t):Vt.value.add(t)},rl=e.computed(()=>{if(!et.value.show&&!(Ct.value&&Se.value.show&&!G.value.isZooming))return{display:"none"};let t,s;if(Ct.value&&Se.value.show&&!G.value.isZooming){t=Se.value.x+15,s=I.value.top;const n=zt.value?200:150;t+n>we.value&&(t=Se.value.x-n-15),t<0&&(t=10),s<10&&(s=10)}else t=et.value.x,s=et.value.y;return{left:t+"px",top:s+"px"}}),kn=(t,s)=>{if(!Yt.value||El.value)return;const i=s.target.closest(".dss-custom-chart-container").getBoundingClientRect();let f=s.clientX-i.left+10,g=s.clientY-i.top-10;const x=200,b=120,L=we.value,T=ut.value;f+x>L&&(f=s.clientX-i.left-x-10),g+b>T&&(g=s.clientY-i.top-b-10),f<0&&(f=10),g<0&&(g=10);let H;typeof t.categoryIndex=="number"?H=t.categoryIndex:typeof t.dataIndex=="number"?H=t.dataIndex:t.label&&S.categories.includes(t.label)&&(H=S.categories.indexOf(t.label));const M=(nn.value||ge.value==="bar")&&t.label?t.label:t.seriesName||t.label||"";et.value={show:!0,x:f,y:g,title:M,value:an(t.value)||"",categoryIndex:H,spiderSeries:[]}},Fl=e.ref(!1),$l=e.ref(!1),jn=()=>{et.value.show=!1,et.value.spiderSeries=[],et.value.bubbleData=[],Se.value.show=!1,Fl.value||(Ee.value=null)},El=e.ref(!1),Il=(t,s)=>{El.value=!0,et.value.show=!1,Se.value.show=!1;const i=s.target.closest(".dss-custom-chart-container").getBoundingClientRect();let f=s.clientX-i.left+15,g=s.clientY-i.top-10;const x=250;f+x>we.value&&(f=s.clientX-i.left-x-15),f<0&&(f=10),g<0&&(g=10),An.value={show:!0,x:f,y:g,content:t.texts,count:t.totalCount}},Vl=()=>{El.value=!1,An.value.show=!1},gt=e.ref({isAnimating:!1,currentFrame:0,totalFrames:0,animationId:null,hasAnimated:!1}),zl=(t,s)=>{switch(t){case"linear":return s;case"ease":return s<.5?2*s*s:-1+(4-2*s)*s;case"ease-in":return s*s;case"ease-out":return s*(2-s);case"ease-in-out":return s<.5?2*s*s:-1+(4-2*s)*s;default:return s}},un=e.computed(()=>re.value?window.matchMedia("(prefers-reduced-motion: reduce)").matches:!1),Kn=()=>{if(!C.value||un.value){gt.value.hasAnimated=!0,Sn.value&&($n.value=1);return}Sn.value&&($n.value=0),gt.value.isAnimating=!0,gt.value.currentFrame=0,gt.value.totalFrames=Math.ceil(P.value/16.67);const t=()=>{const s=gt.value.currentFrame/gt.value.totalFrames,n=zl(ze.value,Math.min(s,1));Wn(n),Sn.value&&($n.value=n),s<1?(gt.value.currentFrame++,gt.value.animationId=requestAnimationFrame(t)):Po()};gt.value.animationId=requestAnimationFrame(t)},Wn=t=>{const s=k.value;s&&s.style.setProperty("--dss-animation-progress",t)},Po=()=>{gt.value.isAnimating=!1,gt.value.hasAnimated=!0,Sn.value&&($n.value=1),gt.value.animationId&&(cancelAnimationFrame(gt.value.animationId),gt.value.animationId=null)},Ho=e.computed(()=>!cn.value||gt.value.hasAnimated?!0:Sn.value?$n.value>=1:Nn.value?yl.value>=1:!0),Oo=e.computed(()=>tn.value&&Ho.value),xo=e.ref(!1);e.watch(Oo,t=>{t?(xo.value=!1,e.nextTick(()=>{requestAnimationFrame(()=>{xo.value=!0})})):xo.value=!1},{immediate:!0});const Yo=e.computed(()=>{if(!C.value||un.value||gt.value.hasAnimated)return{};const t={};return t["--dss-animation-duration"]=`${P.value}ms`,t["--dss-animation-easing"]=jo(ze.value),t["--dss-stagger-delay"]=`${Re.value}ms`,t}),jo=t=>({linear:"linear",ease:"ease","ease-in":"ease-in","ease-out":"ease-out","ease-in-out":"ease-in-out"})[t]||"ease-out",Ko=()=>{if(!C.value||un.value)return"";const t=["dss-chart-animated"];return gt.value.hasAnimated||t.push(`dss-animate-${V.value}`),gt.value.hasAnimated||(cn.value&&ge.value!=="semi-radial"?t.push("dss-animate-fill"):cn.value||t.push(`dss-animate-${V.value}`)),gt.value.isAnimating&&t.push("dss-is-animating"),t.join(" ")};e.watch(()=>S.series,(t,s)=>{De.value&&s&&gt.value.hasAnimated&&(gt.value.hasAnimated=!1,e.nextTick(()=>{setTimeout(()=>Kn(),U.value)}))},{deep:!0}),e.watch(()=>G.value.isZooming,(t,s)=>{s&&!t&&setTimeout(()=>{ql()},50)}),e.watch(()=>[G.value.scale,G.value.offsetX],()=>{!G.value.isZooming&&!G.value.isDragging&&ql()},{flush:"post"}),e.watch([fe,Ne],([t,s])=>{G.value.minScale=t,G.value.maxScale=s,(G.value.scale<t||G.value.scale>s)&&Yl()},{immediate:!0}),e.watch(()=>S.locale,t=>{t&&t!==A.value&&(A.value=t)},{immediate:!0}),e.watch(()=>Be.value.show,t=>{t?e.nextTick(()=>{document.addEventListener("click",Al)}):document.removeEventListener("click",Al)}),e.onMounted(()=>{Ee.value=null,Sn.value&&(!C.value||un.value)&&($n.value=1),mn(),k.value&&typeof ResizeObserver<"u"&&(ue=new ResizeObserver(t=>{const s=t[0];!s||!s.contentRect||(ve&&cancelAnimationFrame(ve),ve=requestAnimationFrame(()=>{ve=null;const{width:n,height:i}=s.contentRect;pt.value=Math.round(n),p.value=Math.round(i),se.value&&(xt.value=se.value.offsetHeight||de)}))}),ue.observe(k.value)),C.value&&!un.value?ge.value==="semi-radial"?setTimeout(()=>Bo(),U.value):setTimeout(()=>Kn(),U.value):(gt.value.hasAnimated=!0,ge.value==="semi-radial"&&(yl.value=1)),document.addEventListener("mousemove",Zo),document.addEventListener("mouseup",Wo),document.addEventListener("click",Xl)}),e.onUnmounted(()=>{ve&&cancelAnimationFrame(ve),ue&&k.value&&(ue.unobserve(k.value),ue.disconnect(),ue=null),gt.value.animationId&&cancelAnimationFrame(gt.value.animationId),Ml&&(cancelAnimationFrame(Ml),Ml=null),G.value.zoomTimeout&&clearTimeout(G.value.zoomTimeout),document.removeEventListener("mousemove",Zo),document.removeEventListener("mouseup",Wo),document.removeEventListener("click",Xl),document.removeEventListener("click",Al)});const Zo=t=>{if(G.value.isDragging&&G.value.scale>1&&fn.value){Se.value.show=!1;const s=t.clientX-G.value.lastMouseX,{minX:n,maxX:i}=Ut.value,f=i-n||1,x=s*.8;G.value.offsetX+=x;const b=f/G.value.scale,L=f-b,T=0,H=-L/f*I.value.width,M=T;G.value.offsetX=Math.max(H,Math.min(M,G.value.offsetX)),G.value.lastMouseX=t.clientX,G.value.lastMouseY=t.clientY}},Wo=()=>{G.value.isDragging&&(G.value.isDragging=!1,setTimeout(()=>{!G.value.isDragging&&G.value.isZooming},100))},Go=(t,s)=>{const n=t.filter(b=>b!=null);if(!n||n.length===0)return{x:0,y:0};if(n.length===1||s<=0)return n[0];if(s>=1)return n[n.length-1];let i=0;const f=[];for(let b=1;b<n.length;b++){const L=n[b].x-n[b-1].x,T=n[b].y-n[b-1].y,H=Math.sqrt(L*L+T*T);f.push(H),i+=H}const g=i*s;let x=0;for(let b=0;b<f.length;b++){const L=x+f[b];if(g<=L){const T=(g-x)/f[b],H=n[b],M=n[b+1];return{x:H.x+(M.x-H.x)*T,y:H.y+(M.y-H.y)*T}}x=L}return n[n.length-1]};return(t,s)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{class:e.normalizeClass(["dss-custom-chart-container",[Ko(),{"dss-chart-fill-width":rt.value,"dss-chart-fill-height":Oe.value,"dss-chart-compact":cn.value&&!Bt.value}]]),style:e.normalizeStyle({width:rt.value?"100%":we.value+"px",height:Ze.value,...rt.value||Oe.value?{overflow:"hidden",maxWidth:"100%",maxHeight:"100%"}:{},...Yo.value,cursor:No()}),"data-chart-type":ge.value,ref_key:"containerEl",ref:k,onWheel:vo,onMousedown:Vo,onMousemove:mt,onMouseup:go,onMouseleave:ot,onDblclick:Yl,onContextmenu:e.withModifiers(Ht,["prevent"]),onClick:e.withModifiers(It,["left"]),onWheelCapture:vo},[e.createElementVNode("div",{class:"dss-chart-header",ref_key:"headerEl",ref:se},[e.createElementVNode("div",Wa,[St.value?(e.openBlock(),e.createElementBlock("div",qa,e.toDisplayString(St.value),1)):e.createCommentVNode("",!0),at.value?(e.openBlock(),e.createElementBlock("div",Ua,e.toDisplayString(at.value),1)):e.createCommentVNode("",!0)]),Bt.value&&Xe.value==="top"?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["dss-chart-legend",{"dss-legend-horizontal":Zt.value==="horizontal","dss-legend-vertical":Zt.value==="vertical","dss-legend-top":Xe.value==="top","dss-legend-bottom":Xe.value==="bottom"}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(S.series,(n,i)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-${i}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":Vt.value.has(i),"dss-legend-hovered":Ee.value===i,"dss-legend-dimmed":Ee.value!==null&&Ee.value!==i}]),onClick:f=>Rn(i),onMouseenter:f=>W(i),onMouseleave:ae,style:e.normalizeStyle({animationDelay:`${i*100}ms`})},[e.createElementVNode("div",{class:"dss-legend-color",style:e.normalizeStyle({backgroundColor:Nt(i)})},null,4),e.createElementVNode("span",Ya,e.toDisplayString(n.name),1)],46,Xa))),128))],2)):e.createCommentVNode("",!0),Bt.value&&(Xe.value==="left"||Xe.value==="right")?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["dss-chart-legend-side",{"dss-legend-left":Xe.value==="left","dss-legend-right":Xe.value==="right"}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(S.series,(n,i)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-${i}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":Vt.value.has(i),"dss-legend-hovered":Ee.value===i,"dss-legend-dimmed":Ee.value!==null&&Ee.value!==i}]),onClick:f=>Rn(i),onMouseenter:f=>W(i),onMouseleave:ae,style:e.normalizeStyle({animationDelay:`${i*100}ms`})},[e.createElementVNode("div",{class:"dss-legend-color",style:e.normalizeStyle({backgroundColor:Nt(i)})},null,4),e.createElementVNode("span",Ka,e.toDisplayString(n.name),1)],46,ja))),128))],2)):e.createCommentVNode("",!0)],512),F.showAddMarkerButton&&vn.value&&jt.value.addMarker&&(fn.value||zt.value)?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-add-marker-button",onClick:Eo,title:e.unref(z)("chart.contextMenu.addMarker")},[e.createElementVNode("img",{src:bn.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,Qa),s[4]||(s[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,Ga)):e.createCommentVNode("",!0),e.createElementVNode("div",Ja,[zt.value&&$t.value?(e.openBlock(),e.createElementBlock("div",es,"Bubble size: "+e.toDisplayString($t.value),1)):e.createCommentVNode("",!0),(e.openBlock(),e.createElementBlock("svg",{width:we.value,height:ut.value,class:"dss-chart-svg","data-smooth":Z.value,"data-animated":C.value,ref_key:"svgEl",ref:$e},[e.createElementVNode("defs",null,[e.createElementVNode("clipPath",ns,[e.createElementVNode("rect",{x:0,y:I.value.top,width:we.value,height:I.value.height*4},null,8,ls)]),Nn.value?(e.openBlock(),e.createElementBlock("clipPath",{key:0,id:Xn.value},[e.createElementVNode("path",{d:qt.value},null,8,as)],8,os)):e.createCommentVNode("",!0),Sn.value?(e.openBlock(),e.createElementBlock("clipPath",{key:1,id:al.value},[e.createElementVNode("path",{d:fl.value},null,8,rs)],8,ss)):e.createCommentVNode("",!0)]),fn.value||zt.value?(e.openBlock(),e.createElementBlock("g",is,[Lt.value?(e.openBlock(),e.createElementBlock("g",cs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(bo.value,(n,i)=>(e.openBlock(),e.createElementBlock("line",{key:`h-grid-${i}`,x1:I.value.left,x2:I.value.right,y1:n.y,y2:n.y,stroke:"#e0e0e0","stroke-width":"1","stroke-dasharray":"4,2",style:e.normalizeStyle({animationDelay:`${i*50}ms`})},null,12,us))),128))])):e.createCommentVNode("",!0),e.createElementVNode("g",ds,[e.createElementVNode("line",{x1:I.value.left,x2:I.value.right,y1:I.value.bottom,y2:I.value.bottom,stroke:"#ccc","stroke-width":"1"},null,8,ms),e.createElementVNode("line",{x1:I.value.left,x2:I.value.left,y1:I.value.top,y2:I.value.bottom,stroke:"#ccc","stroke-width":"1"},null,8,ps)]),e.createElementVNode("g",fs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Dl.value,(n,i)=>(e.openBlock(),e.createElementBlock("text",{key:`x-${i}`,x:n.x,y:n.y,"text-anchor":"middle","font-size":"12",fill:"#666",style:e.normalizeStyle({animationDelay:`${i*100}ms`})},e.toDisplayString(n.text),13,vs))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(wl.value,(n,i)=>(e.openBlock(),e.createElementBlock("text",{key:`y-${i}`,x:n.x,y:n.y,"text-anchor":"end","font-size":"12",fill:"#666","dominant-baseline":"middle",style:e.normalizeStyle({animationDelay:`${i*80}ms`})},e.toDisplayString(n.text),13,gs))),128)),Ot.value?(e.openBlock(),e.createElementBlock("text",{key:0,x:I.value.left+I.value.width/2,y:I.value.bottom+45,"text-anchor":"middle","font-size":"14","font-weight":"bold",fill:"#333"},e.toDisplayString(Ot.value),9,hs)):e.createCommentVNode("",!0),on.value?(e.openBlock(),e.createElementBlock("text",{key:1,x:15,y:I.value.top+12+I.value.height/2,"text-anchor":"middle","font-size":"14","font-weight":"bold",fill:"#333",transform:`rotate(-90, 15, ${I.value.top+I.value.height/2})`},e.toDisplayString(on.value),9,ys)):e.createCommentVNode("",!0)]),ul.value.length>0?(e.openBlock(),e.createElementBlock("g",Cs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ul.value,n=>(e.openBlock(),e.createElementBlock("g",{key:`flag-group-${n.categoryIndex}`},[e.createElementVNode("g",ks,[n.hasManual?(e.openBlock(),e.createElementBlock("line",{key:0,x1:n.x,x2:n.x,y1:I.value.bottom,y2:I.value.top,stroke:"#047395","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:i=>Il(n,i),onMouseleave:Vl},null,40,bs)):e.createCommentVNode("",!0),n.hasAuto&&!n.hasManual?(e.openBlock(),e.createElementBlock("line",{key:1,x1:n.x,x2:n.x,y1:I.value.bottom,y2:I.value.top,stroke:"#0dbf89","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:i=>Il(n,i),onMouseleave:Vl},null,40,ws)):e.createCommentVNode("",!0),n.hasAuto&&n.hasManual?(e.openBlock(),e.createElementBlock("line",{key:2,x1:n.x,x2:n.x,y1:I.value.bottom,y2:I.value.top,stroke:"#047395","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:i=>Il(n,i),onMouseleave:Vl},null,40,xs)):e.createCommentVNode("",!0)]),n.hasManual&&n.hasAuto?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:n.x+8,cy:Math.max(15,I.value.top-10),r:"14",fill:"#0dbf89",stroke:"#fafafa","stroke-width":"2",class:"flag-count-circle",onMouseover:i=>Il(n,i),onMouseleave:Vl},null,40,Es)):e.createCommentVNode("",!0),e.createElementVNode("circle",{cx:n.x,cy:Math.max(15,I.value.top-10),r:"14",fill:n.hasManual&&n.hasAuto||n.hasManual?"#047395":"#0dbf89",stroke:"#fafafa","stroke-width":"2",class:"dss-flag-count-indicator",onMouseover:i=>Il(n,i),onMouseleave:Vl},null,40,Vs),e.createElementVNode("text",{x:n.x,y:Math.max(15,I.value.top-5),"text-anchor":"middle","font-size":"12","font-weight":"bold",fill:"#fafafa",class:"dss-flag-count-text","pointer-events":"none"},e.toDisplayString(n.totalCount),9,Ns)]))),128))])):e.createCommentVNode("",!0),e.createElementVNode("g",Ss,[On.value?(e.openBlock(),e.createElementBlock("g",Bs,[e.createElementVNode("g",{class:e.normalizeClass(["dss-bar-chart",{"dss-horizontal-bars":nn.value}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(no.value,(n,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`mixed-bar-${i}`},[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:f=>kn(n,f),onMouseleave:jn},null,46,Ms)):(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:f=>kn(n,f),onMouseleave:jn},null,46,_s))],64))),128))],2),e.createElementVNode("g",$s,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(wo.value,(n,i)=>(e.openBlock(),e.createElementBlock("path",{key:`mixed-line-${i}`,d:n.path,stroke:n.color,"stroke-width":n.isHighlighted?We.value+2:We.value,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,Ts))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_l.value,(n,i)=>(e.openBlock(),e.createElementBlock("path",{key:`mixed-gap-connector-${i}`,d:n.path,stroke:n.color,"stroke-width":n.isHighlighted?We.value+2:We.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,Ls))),128)),qe.value>0||dt.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(vl.value,(n,i)=>(e.openBlock(),e.createElementBlock("circle",{key:`mixed-point-${i}`,cx:n.x,cy:n.y,r:Ue(n.isHighlighted?xe(n,qe.value)+2:xe(n,qe.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:f=>kn(n,f),onMouseleave:jn},null,46,Hs))),128)):e.createCommentVNode("",!0)])])):ge.value==="line"?(e.openBlock(),e.createElementBlock("g",As,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Zn.value,(n,i)=>(e.openBlock(),e.createElementBlock("path",{key:`anim-${i}`,d:n.path,stroke:n.color,"stroke-width":We.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass(["dss-line-animation-overlay",{"dss-animation-complete":gt.value.hasAnimated}]),style:e.normalizeStyle({"--dss-path-length":n.pathLength,animationDelay:`${n.animationDelay}ms`})},null,14,Ds))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(wo.value,(n,i)=>(e.openBlock(),e.createElementBlock("path",{key:`line-${i}`,d:n.path,stroke:n.color,"stroke-width":n.isHighlighted?We.value+2:We.value,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,Rs))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_l.value,(n,i)=>(e.openBlock(),e.createElementBlock("path",{key:`gap-connector-${i}`,d:n.path,stroke:n.color,"stroke-width":n.isHighlighted?We.value+2:We.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,Fs))),128)),qe.value>0||dt.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(Lo.value,(n,i)=>(e.openBlock(),e.createElementBlock("circle",{key:`point-${i}`,cx:n.x,cy:n.y,r:Ue(n.isHighlighted?xe(n,qe.value)+2:xe(n,qe.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:f=>kn(n,f),onMouseleave:jn},null,46,Is))),128)):e.createCommentVNode("",!0)])):ge.value==="area"?(e.openBlock(),e.createElementBlock("g",zs,[e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(to.value,(n,i)=>(e.openBlock(),e.createElementBlock("mask",{key:`mask-${i}`,id:`area-mask-${i}-${F.chartId}`},[e.createElementVNode("rect",{x:I.value.left-10,y:I.value.top-10,width:I.value.width+20,height:I.value.height+20,fill:"#fafafa",class:"dss-area-mask-rect",style:e.normalizeStyle({"--dss-mask-width":`${I.value.width+20}px`})},null,12,Os)],8,Ps))),128))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(to.value,(n,i)=>(e.openBlock(),e.createElementBlock("path",{key:`area-fill-${i}`,d:n.areaPath,fill:n.color,"fill-opacity":n.isHighlighted?X.value+.2:X.value,mask:`url(#area-mask-${i}-${F.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,Zs))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(to.value,(n,i)=>(e.openBlock(),e.createElementBlock("path",{key:`area-line-${i}`,d:n.linePath,stroke:n.color,"stroke-width":n.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":n.isHighlighted,"dss-series-dimmed":n.isDimmed,"dss-series-hidden":n.isHidden}),style:e.normalizeStyle({"--dss-path-length":n.pathLength,animationDelay:`${i*Re.value}ms`})},null,14,Ws))),128))])):ge.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(no.value,(n,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`bar-${i}`},[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:f=>kn(n,f),onMouseleave:jn},null,46,qs)):(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:f=>kn(n,f),onMouseleave:jn},null,46,Us))],64))),128))],2)):e.createCommentVNode("",!0)]),Ct.value&&Se.value.show&&!G.value.isZooming?(e.openBlock(),e.createElementBlock("g",Xs,[e.createElementVNode("line",{x1:Se.value.x,x2:Se.value.x,y1:I.value.top,y2:I.value.bottom,stroke:te.value,"stroke-width":"1","stroke-dasharray":"4,4",opacity:"0.8"},null,8,Ys),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Se.value.data,(n,i)=>(e.openBlock(),e.createElementBlock("circle",{key:`dss-crosshair-point-${i}`,cx:Se.value.x,cy:n.y,r:Ue(qe.value+2),fill:n.color,stroke:"none",opacity:"0.9"},null,8,js))),128))])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),zt.value?(e.openBlock(),e.createElementBlock("g",Ks,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(xl.value,(n,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`bubble-${i}`},[n?(e.openBlock(),e.createElementBlock("g",Gs,[e.createElementVNode("circle",{cx:n.x,cy:n.y,r:Ue(n.radius),fill:n.color,"fill-opacity":a(n),stroke:n.color,"stroke-width":"1","stroke-opacity":"0.8",class:e.normalizeClass(d(n,i)),style:{cursor:"pointer",transition:"all 0.3s ease"},onMouseenter:f=>u(n,f),onMouseleave:f=>h(n),onClick:f=>c(n,f)},null,42,Qs),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-${i} ${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:r(n)}),onLoad:f=>Mo(i),onError:f=>_o(i),onMouseenter:f=>u(n,f),onMouseleave:f=>h(n),onClick:f=>c(n,f)},null,46,Js)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],64))),128))])):e.createCommentVNode("",!0),cn.value?(e.openBlock(),e.createElementBlock("g",{key:2,class:"radial-chart",transform:ho.value},[ge.value==="radial"?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:_t.value,cy:ht.value,r:it.value,fill:"none",stroke:"#e0e0e0","stroke-width":"1"},null,8,tr)):e.createCommentVNode("",!0),e.createElementVNode("g",{class:"dss-radial-data","data-chart-type":ge.value,"clip-path":Cl.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value,(n,i)=>(e.openBlock(),e.createElementBlock("path",{key:`radial-${n.originalIndex}-${i}`,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":yo(n.originalIndex),class:e.normalizeClass({"dss-series-highlighted":n.segment.isHighlighted,"dss-series-dimmed":n.segment.isDimmed,"dss-series-hidden":n.segment.isHidden}),onMouseover:f=>kn(n.segment,f),onMouseleave:jn},null,42,lr))),128))],8,nr),zn.value&&Ho.value?(e.openBlock(),e.createElementBlock("g",or,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Zl.value,(n,i)=>e.withDirectives((e.openBlock(),e.createElementBlock("text",{key:`radial-segment-label-${i}`,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,ar)),[[e.vShow,n.show]])),128))])):e.createCommentVNode("",!0),Tl.value&&(Ho.value||Nn.value)?(e.openBlock(),e.createElementBlock("text",{key:2,x:gn.value.x,y:gn.value.y,"text-anchor":"middle","dominant-baseline":"middle","font-size":gl.value,fill:hn.value,class:"dss-radial-data-center"},e.toDisplayString(Sl.value),9,sr)):e.createCommentVNode("",!0),Oo.value?(e.openBlock(),e.createElementBlock("g",{key:3,class:e.normalizeClass(["dss-radial-labels dss-radial-labels-initial",{"dss-radial-labels-animated":xo.value}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.value,(n,i)=>(e.openBlock(),e.createElementBlock("g",{key:`radial-label-${i}`,class:e.normalizeClass(["dss-radial-label-group",{"dss-label-highlighted":n.isHighlighted,"dss-label-dimmed":n.isDimmed}]),style:e.normalizeStyle({"--label-delay":`${i*.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,rr),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,ir),e.createElementVNode("text",{class:"dss-radial-label-text",x:n.textX,y:n.textY,"text-anchor":n.textAnchor,"font-size":Hn.value,"dominant-baseline":"middle"},e.toDisplayString(n.text),9,cr)],6))),128))],2)):e.createCommentVNode("",!0)],8,er)):e.createCommentVNode("",!0),Un.value?(e.openBlock(),e.createElementBlock("g",{key:3,class:"dss-spider-chart",transform:ho.value},[Lt.value?(e.openBlock(),e.createElementBlock("g",dr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(wt.value,(n,i)=>(e.openBlock(),e.createElementBlock("circle",{key:`spider-grid-circle-${i}`,cx:_t.value,cy:ht.value,r:Ue(n),fill:"none",stroke:"#dedede","stroke-width":"1",style:e.normalizeStyle({animationDelay:`${i*150}ms`})},null,12,mr))),128)),e.createElementVNode("g",pr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(wt.value,(n,i)=>(e.openBlock(),e.createElementBlock("g",{key:`spider-grid-label-group-${i}`},[e.createElementVNode("rect",{x:_t.value-16,y:ht.value-n-7,width:"32",height:"16",fill:"transparent",stroke:"none"},null,8,fr),e.createElementVNode("text",{x:_t.value,y:ht.value-n+2,"text-anchor":"middle","dominant-baseline":"central",class:"dss-spider-grid-label",style:{fontSize:"10px",fill:"#999",fontWeight:"600"}},e.toDisplayString(vt(i)),9,vr)]))),128))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Y.value,(n,i)=>(e.openBlock(),e.createElementBlock("line",{key:`spider-axis-${i}`,x1:_t.value,x2:n.x,y1:ht.value,y2:n.y,stroke:"#dedede","stroke-width":"1",style:e.normalizeStyle({animationDelay:`${i*100}ms`})},null,12,gr))),128))])):e.createCommentVNode("",!0),e.createElementVNode("g",hr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Le.value,(n,i)=>(e.openBlock(),e.createElementBlock("text",{key:`spider-label-${i}`,x:n.x+Math.cos(i*2*Math.PI/N.value-Math.PI/2)*16,y:n.y+Math.sin(i*2*Math.PI/N.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:`${i*120}ms`})},e.toDisplayString(n.text.charAt(0).toUpperCase()+n.text.slice(1)),13,yr))),128))]),e.createElementVNode("g",{class:"dss-spider-data",onMousemove:Xt,onMouseleave:jn},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Qt.value,(n,i)=>(e.openBlock(),e.createElementBlock("g",{key:`spider-${i}`},[e.createElementVNode("polygon",{points:n.points,fill:n.color,"fill-opacity":ct("current",n,i),stroke:n.color,"stroke-width":n.isHighlighted?We.value+1:We.value,"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:`${i*Re.value}ms`,transition:"all 0.2s ease"})},null,14,Cr),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.dataPoints,(f,g)=>(e.openBlock(),e.createElementBlock("circle",{key:`spider-point-${i}-${g}`,cx:f.x,cy:f.y,r:Ue(n.isHighlighted?qe.value+1:qe.value>0?qe.value:0),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:`${i*Re.value+g*50}ms`,transition:"all 0.2s ease"}),onMouseover:x=>kn(f,x),onMouseleave:jn},null,46,kr))),128))]))),128))],32)],8,ur)):e.createCommentVNode("",!0),e.createElementVNode("g",br,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Pt.value,(n,i)=>(e.openBlock(),e.createElementBlock("circle",{key:`logo-fallback-${i}`,cx:n.x,cy:n.y,r:Ue(n.width/2),fill:Nt(n.seriesIndex),stroke:"#fafafa","stroke-width":"2",class:e.normalizeClass(`logo-fallback-${i}`),style:e.normalizeStyle({animationDelay:`${i*200}ms`})},null,14,wr))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Pt.value,(n,i)=>(e.openBlock(),e.createElementBlock("image",{key:`logo-${i}`,x:n.x-n.width/2,y:n.y-n.height/2,width:n.width,height:n.height,"xlink:href":n.url,onLoad:f=>en(i),onError:f=>Kt(i),preserveAspectRatio:"xMidYMid slice",class:e.normalizeClass(`dss-logo-image-${i}`),"clip-path":`circle(${n.width/2}px at ${n.width/2}px ${n.height/2}px)`,style:e.normalizeStyle({animationDelay:`${i*200}ms`})},null,46,xr))),128))])],8,ts))]),q.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-chart-watermark",style:e.normalizeStyle({position:"absolute",top:"0px",left:"0px",width:we.value+"px",height:ut.value+"px",backgroundImage:`url('${Ln.value}')`,backgroundRepeat:"no-repeat",...st.value,opacity:R.value,pointerEvents:"none",zIndex:10})},null,4)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(D.value,(n,i)=>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:Wt.value+"px",height:Wt.value+"px",backgroundColor:"#fafafa",borderRadius:"50%",border:"2px solid #ddd",cursor:"pointer",zIndex:500}),onClick:e.withModifiers(f=>po(n),["stop"]),onMouseenter:f=>_(n,f),onMouseleave:$},[e.createElementVNode("img",{src:ro(n),class:"dss-marker-icon",alt:"Marker Icon",style:{width:"100%",height:"100%","object-fit":"contain","border-radius":"50%","pointer-events":"none"}},null,8,Vr)],44,Er)),[[e.vShow,qn.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",Nr,e.toDisplayString(rn.value.categoryValue),1),rn.value.description?(e.openBlock(),e.createElementBlock("div",Sr,e.toDisplayString(rn.value.description),1)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),Yt.value&&(et.value.show||Ct.value&&Se.value.show&&!G.value.isZooming)?(e.openBlock(),e.createElementBlock("div",{key:3,class:e.normalizeClass(["dss-chart-tooltip",{"dss-crosshair-tooltip":Ct.value&&Se.value.show&&!G.value.isZooming}]),style:e.normalizeStyle(rl.value)},[!Ct.value||!Se.value.show||G.value.isZooming?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[Un.value&&et.value.spiderSeries&&et.value.spiderSeries.length>0?(e.openBlock(),e.createElementBlock("div",Br,[et.value.title?(e.openBlock(),e.createElementBlock("div",Mr,e.toDisplayString(et.value.title),1)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(et.value.spiderSeries,(n,i)=>(e.openBlock(),e.createElementBlock("div",{key:`spider-tooltip-${i}`,class:"dss-tooltip-series"},[e.createElementVNode("div",{class:"dss-tooltip-series-indicator",style:e.normalizeStyle({backgroundColor:n.color})},null,4),e.createElementVNode("span",_r,e.toDisplayString(n.seriesName)+":",1),e.createElementVNode("span",$r,e.toDisplayString(n.value),1)]))),128))])):zt.value&&et.value.bubbleData&&et.value.bubbleData.length>0?(e.openBlock(),e.createElementBlock("div",Tr,[et.value.title?(e.openBlock(),e.createElementBlock("div",Lr,e.toDisplayString(et.value.title),1)):e.createCommentVNode("",!0),e.createElementVNode("div",Hr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(et.value.bubbleData,(n,i)=>(e.openBlock(),e.createElementBlock("div",{key:`bubble-tooltip-${i}`,class:"dss-bubble-tooltip-item"},e.toDisplayString(n.value),1))),128))])])):(e.openBlock(),e.createElementBlock("div",Ar,[e.createElementVNode("div",Dr,e.toDisplayString(et.value.title),1),e.createElementVNode("div",Rr,e.toDisplayString(et.value.value),1)])),et.value.categoryIndex!==void 0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[Ke(et.value.categoryIndex).flagGroups.length>0?(e.openBlock(),e.createElementBlock("div",Fr,[s[5]||(s[5]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",Ir,e.toDisplayString(e.unref(z)("chart.tooltip.flags")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ke(et.value.categoryIndex).flagGroups,(n,i)=>(e.openBlock(),e.createElementBlock("div",{key:`tooltip-flag-group-${i}`},[e.createElementVNode("div",zr,[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,(f,g)=>(e.openBlock(),e.createElementBlock("div",{key:`tooltip-flag-${i}-${g}`,class:"dss-tooltip-item dss-tooltip-item-no-indicator"},[e.createElementVNode("div",Pr,[e.createElementVNode("div",Or,e.toDisplayString(f.text),1)])]))),128))]))),128))])):e.createCommentVNode("",!0),Ke(et.value.categoryIndex).markers.length>0?(e.openBlock(),e.createElementBlock("div",Zr,[s[6]||(s[6]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",Wr,e.toDisplayString(e.unref(z)("chart.tooltip.markers")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ke(et.value.categoryIndex).markers,(n,i)=>(e.openBlock(),e.createElementBlock("div",{key:`tooltip-marker-${i}`,class:"dss-tooltip-item"},[e.createElementVNode("div",{class:"dss-tooltip-item-indicator",style:e.normalizeStyle({backgroundColor:n.color})},null,4),e.createElementVNode("div",qr,[e.createElementVNode("div",Ur,e.toDisplayString(n.title),1),n.description?(e.openBlock(),e.createElementBlock("div",Xr,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",Yr,[e.createElementVNode("div",jr,e.toDisplayString(zt.value?v():F.categories[Se.value.categoryIndex]||`Category ${Se.value.categoryIndex+1}`),1),zt.value?(e.openBlock(),e.createElementBlock("div",Kr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Se.value.data,(n,i)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-tooltip-${i}`,class:"dss-bubble-tooltip-item"},e.toDisplayString(n.value),1))),128))])):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(Se.value.data,(n,i)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-tooltip-${i}`,class:"dss-tooltip-series"},[e.createElementVNode("div",{class:"dss-tooltip-series-indicator",style:e.normalizeStyle({backgroundColor:n.color})},null,4),e.createElementVNode("span",Gr,e.toDisplayString(n.seriesName)+":",1),e.createElementVNode("span",Qr,e.toDisplayString(an(n.value)),1)]))),128))]),Ke(Se.value.categoryIndex).flagGroups.length>0?(e.openBlock(),e.createElementBlock("div",Jr,[s[7]||(s[7]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",ei,e.toDisplayString(e.unref(z)("chart.tooltip.flags")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ke(Se.value.categoryIndex).flagGroups,(n,i)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-flag-group-${i}`},[e.createElementVNode("div",ti,[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,(f,g)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-flag-${i}-${g}`,class:"dss-tooltip-item dss-tooltip-item-no-indicator"},[e.createElementVNode("div",ni,[e.createElementVNode("div",li,e.toDisplayString(f.text),1)])]))),128))]))),128))])):e.createCommentVNode("",!0),Ke(Se.value.categoryIndex).markers.length>0?(e.openBlock(),e.createElementBlock("div",oi,[s[8]||(s[8]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",ai,e.toDisplayString(e.unref(z)("chart.tooltip.markers")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ke(Se.value.categoryIndex).markers,(n,i)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-dss-marker-${i}`,class:"dss-tooltip-item"},[e.createElementVNode("div",{class:"dss-tooltip-item-indicator",style:e.normalizeStyle({backgroundColor:n.color})},null,4),e.createElementVNode("div",si,[e.createElementVNode("div",ri,e.toDisplayString(n.title),1),n.description?(e.openBlock(),e.createElementBlock("div",ii,e.toDisplayString(n.description),1)):e.createCommentVNode("",!0)])]))),128))])):e.createCommentVNode("",!0)],64))],6)):e.createCommentVNode("",!0),fn.value&&Te.value&&G.value.scale>1?(e.openBlock(),e.createElementBlock("div",{key:4,class:"dss-zoom-indicator",onClick:Yl},[s[9]||(s[9]=e.createElementVNode("span",{style:{display:"inline-block",transform:"scaleX(-1)","font-size":"14px"}},"⌕",-1)),e.createTextVNode(" "+e.toDisplayString(Math.round(G.value.scale*100))+"% "+e.toDisplayString(e.unref(z)("chart.zoom.doubleClickToReset")),1)])):e.createCommentVNode("",!0)],46,Za),Bt.value&&Xe.value==="bottom"?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["dss-chart-legend",{"dss-legend-horizontal":Zt.value==="horizontal","dss-legend-vertical":Zt.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(S.series,(n,i)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-bottom-${i}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":Vt.value.has(i),"dss-legend-hovered":Ee.value===i,"dss-legend-dimmed":Ee.value!==null&&Ee.value!==i}]),onClick:f=>Rn(i),onMouseenter:f=>W(i),onMouseleave:ae,style:e.normalizeStyle({animationDelay:`${i*100}ms`})},[e.createElementVNode("div",{class:"dss-legend-color",style:e.normalizeStyle({backgroundColor:Nt(i)})},null,4),e.createElementVNode("span",ui,e.toDisplayString(n.name),1)],46,ci))),128))],2)):e.createCommentVNode("",!0),Be.value.show?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-chart-context-menu",style:e.normalizeStyle({left:Be.value.x+"px",top:Be.value.y+"px"}),onClick:s[0]||(s[0]=e.withModifiers(()=>{},["stop"]))},[jt.value.addMarker?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-context-menu-item",onClick:Bl},e.toDisplayString(e.unref(z)("chart.contextMenu.addMarker")),1)):e.createCommentVNode("",!0),jt.value.addMarker&&(jt.value.downloadSvg||jt.value.downloadPng||jt.value.downloadCsv||Tn.value.length>0)?(e.openBlock(),e.createElementBlock("div",di)):e.createCommentVNode("",!0),jt.value.downloadSvg?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-context-menu-item",onClick:tl},e.toDisplayString(e.unref(z)("chart.contextMenu.downloadSvg")),1)):e.createCommentVNode("",!0),jt.value.downloadPng?(e.openBlock(),e.createElementBlock("div",{key:3,class:"dss-context-menu-item",onClick:nl},e.toDisplayString(e.unref(z)("chart.contextMenu.downloadPng")),1)):e.createCommentVNode("",!0),jt.value.downloadCsv?(e.openBlock(),e.createElementBlock("div",{key:4,class:"dss-context-menu-item",onClick:_n},e.toDisplayString(e.unref(z)("chart.contextMenu.downloadCsv")),1)):e.createCommentVNode("",!0),Tn.value.length>0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:5},[jt.value.downloadSvg||jt.value.downloadPng||jt.value.downloadCsv?(e.openBlock(),e.createElementBlock("div",mi)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Tn.value,(n,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"custom-"+i},[n.separator?(e.openBlock(),e.createElementBlock("div",pi)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(En(n)),style:e.normalizeStyle(Wl(n)),onClick:f=>Ul(n)},[n.template?(e.openBlock(),e.createElementBlock("div",{key:0,innerHTML:At(n),class:"dss-custom-menu-content"},null,8,vi)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[n.icon?(e.openBlock(),e.createElementBlock("span",gi,e.toDisplayString(n.icon),1)):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(n.label),1)],64))],14,fi)],64))),128))],64)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),he.value.show?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-marker-modal-overlay",onClick:el},[e.createElementVNode("div",{class:"dss-marker-modal",onClick:s[3]||(s[3]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",hi,[e.createElementVNode("h3",null,e.toDisplayString(B.value?e.unref(z)("chart.modalMarker.viewMarker"):y.value?e.unref(z)("chart.modalMarker.editMarker"):e.unref(z)("chart.contextMenu.addMarker")),1),e.createElementVNode("button",{class:"dss-modal-close-btn",onClick:el},"×")]),e.createElementVNode("div",yi,[e.createElementVNode("div",Ci,[e.createVNode(zo,{id:"dss-marker-date",mode:"single",modelValue:he.value.date,"onUpdate:modelValue":s[1]||(s[1]=n=>he.value.date=n),"min-date":Hl.value,"max-date":w.value,disabled:B.value},null,8,["modelValue","min-date","max-date","disabled"])]),e.createElementVNode("div",ki,[e.createElementVNode("label",bi,e.toDisplayString(e.unref(z)("chart.modalMarker.description")),1),B.value?(e.openBlock(),e.createElementBlock("div",wi,e.toDisplayString(he.value.description),1)):e.withDirectives((e.openBlock(),e.createElementBlock("textarea",{key:1,id:"dss-marker-description","onUpdate:modelValue":s[2]||(s[2]=n=>he.value.description=n),placeholder:e.unref(z)("chart.modalMarker.placeholderDescription"),class:"dss-form-textarea",rows:"5"},null,8,xi)),[[e.vModelText,he.value.description]])])]),e.createElementVNode("div",Ei,[e.createElementVNode("div",Vi,[y.value&&!B.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-btn dss-btn-danger",onClick:mo},e.toDisplayString(e.unref(z)("chart.modalMarker.deleteMarker")),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",Ni,[e.createElementVNode("button",{class:"dss-btn dss-btn-secondary",onClick:el},e.toDisplayString(B.value?e.unref(z)("chart.modalMarker.close"):e.unref(z)("chart.modalMarker.cancel")),1),B.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-btn dss-btn-primary",onClick:uo,disabled:!(he.value.description&&he.value.description.length)},e.toDisplayString(y.value?e.unref(z)("chart.modalMarker.save"):e.unref(z)("chart.contextMenu.addMarker")),9,Si))])])])])):e.createCommentVNode("",!0)],64))}}),_i={class:"dss-modal-title"},$i={class:"dss-modal-actions"},Ao={__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(F,{emit:Ce}){const z=F,A=Ce,_e=e.ref(null),k=e.ref(null),$e=e.computed(()=>{const S={"max-width":z.width};return z.height!=="auto"&&(S.height=z.height,S["min-height"]="0"),S}),se=e.computed(()=>({}));function pt(){A("close-modal")}function p(){z.backDrop&&!_e.value&&A("close-modal")}function ue(S){S.target.tagName==="INPUT"&&(_e.value=S.target.tagName)}function ve(){setTimeout(()=>{_e.value=null},300)}function de(){const S=document.body,ne=document.documentElement;k.value={bodyOverflow:S.style.overflow,bodyPosition:S.style.position,bodyTop:S.style.top,bodyWidth:S.style.width,htmlOverflow:ne.style.overflow,scrollY:window.scrollY},S.style.overflow="hidden",S.style.position="fixed",S.style.top=`-${k.value.scrollY}px`,S.style.width="100%",S.style.left="0",ne.style.overflow="hidden"}function ee(){if(!k.value)return;const S=document.body,ne=document.documentElement,{bodyOverflow:He,bodyPosition:Ae,bodyTop:Ie,bodyWidth:O,htmlOverflow:rt,scrollY:Oe}=k.value;S.style.overflow=He||"",S.style.position=Ae||"",S.style.top=Ie||"",S.style.width=O||"",S.style.left="",ne.style.overflow=rt||"",window.scrollTo(0,Oe||0)}return e.watch(()=>z.showModal,S=>{if(S)de(),document.body.classList.add("dss-modal-open"),setTimeout(()=>{const ne=document.getElementById("dss-modal-backdrop");ne&&(ne.addEventListener("focusin",ue),ne.addEventListener("focusout",ve))},100);else{ee(),document.body.classList.remove("dss-modal-open");const ne=document.getElementById("dss-modal-backdrop");ne&&(ne.removeEventListener("focusin",ue),ne.removeEventListener("focusout",ve))}},{immediate:!0}),e.onUnmounted(()=>{z.showModal&&ee()}),(S,ne)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[F.showModal?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-modal-backdrop",onClick:p},[e.withDirectives(e.createElementVNode("div",{id:"dss-modal-backdrop",class:"dss-modal",style:e.normalizeStyle($e.value)},[e.createElementVNode("div",{class:"dss-modal-content",onClick:ne[0]||(ne[0]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:"dss-modal-header",style:e.normalizeStyle({"justify-content":F.headerType,"font-size":F.titleSize})},[e.createElementVNode("h1",_i,[e.renderSlot(S.$slots,"title",{},()=>[ne[1]||(ne[1]=e.createTextVNode("Default Title",-1))])]),e.renderSlot(S.$slots,"title-data"),F.showCloseBtn?(e.openBlock(),e.createElementBlock("span",{key:0,class:"dss-modal-close",onClick:pt,title:"Close"},"×")):e.createCommentVNode("",!0)],4),e.createElementVNode("div",{class:"dss-modal-body",style:e.normalizeStyle(se.value)},[e.renderSlot(S.$slots,"content",{},()=>[ne[2]||(ne[2]=e.createTextVNode("Default Content",-1))])],4),e.createElementVNode("div",$i,[e.renderSlot(S.$slots,"actions")])])],4),[[e.vShow,F.showModal]])])):e.createCommentVNode("",!0)]))}},Ti={key:0,class:"dss-table-toolbar"},Li={class:"dss-table-toolbar-left"},Hi=["aria-expanded"],Ai={class:"dss-pagination-select-dropdown",role:"listbox"},Di={class:"dss-table-column-visibility-label"},Ri={class:"dss-table-checkbox-wrapper"},Fi=["checked","onChange"],Ii={key:0,class:"dss-table-checkbox__check","aria-hidden":"true"},zi={class:"dss-table-column-visibility-text"},Pi={class:"dss-table-toolbar-right"},Oi=["placeholder"],Zi=["aria-expanded"],Wi={key:1,class:"dss-table-toolbar-extra"},qi={class:"dss-table-thead"},Ui={key:0,class:"dss-table-th dss-table-selection-column"},Xi={key:0,class:"dss-table-checkbox-wrapper"},Yi=["checked","indeterminate"],ji={key:0,class:"dss-table-checkbox__indeterminate"},Ki={key:1,class:"dss-table-checkbox__check","aria-hidden":"true"},Gi={key:1,class:"dss-table-th dss-table-expansion-column","aria-label":"Expand row"},Qi=["onClick"],Ji={class:"dss-table-th-content"},ec={class:"dss-table-th-text"},tc={key:0},nc={key:1},lc={key:2},oc=["data-filter-column-key","aria-expanded","onClick"],ac={class:"dss-table-tbody"},sc=["onClick"],rc={class:"dss-table-checkbox-wrapper"},ic=["type","name","checked","onChange"],cc={key:0,class:"dss-table-checkbox__check","aria-hidden":"true"},uc={key:1,class:"dss-table-checkbox__dot"},dc=["onClick"],mc=["aria-expanded","aria-label"],pc={key:0,class:"dss-table-expansion-row"},fc=["colspan"],vc=["colspan"],gc={key:1,class:"dss-table-pagination"},hc={class:"dss-pagination-center"},yc={class:"dss-pagination-controls"},Cc=["disabled","title"],kc=["disabled","title"],bc={class:"dss-pagination-pages"},wc=["onClick"],xc={key:1,class:"dss-pagination-ellipsis"},Ec=["disabled","title"],Vc=["disabled","title"],Nc=["aria-expanded"],Sc={class:"dss-pagination-select-dropdown",role:"listbox"},Bc=["aria-selected","onClick"],Mc={key:0,class:"dss-table-filter-row"},_c=["value","placeholder"],$c=["min","max","value"],Tc=["min","max","value"],Lc={class:"dss-table-filter-double-range-values"},Hc={key:2,class:"dss-table-filter-daterange"},Ac={class:"dss-table-filter-daterange-row"},Dc={class:"dss-table-filter-daterange-label"},Rc=["value"],Fc={class:"dss-table-filter-daterange-row"},Ic={class:"dss-table-filter-daterange-label"},zc=["value"],Pc=["value","placeholder"],Oc={class:"dss-table-filter-list"},Zc=["checked","onChange"],Wc={class:"dss-table-filter-actions"},qc={name:"DSSTable"},Uc=Object.assign(qc,{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:F=>typeof F=="object"&&F!==null}},emits:["row-click","row-select","row-unselect","select-all","unselect-all","row-expand","row-collapse","sort","page","download-pdf","download-excel","search"],setup(F,{emit:Ce}){const{t:z,locale:A}=lo.useI18n(),_e=F,k=Ce,$e={table:{width:"auto",height:null,rowHeight:"auto",truncated:!1,expandable:!1,striped:!1,bordered:!1,hoverable:!0,size:"default",align:"left"},title:{text:""},subtitle:{text:""},selection:{enabled:!1,mode:"single"},sorting:{enabled:!0,mode:"single"},pagination:{enabled:!1,rows:10,rowsPerPageOptions:[5,10,25,50,100]},toolbar:{downloads:{pdf:!0,excel:!0},columnVisibility:!0,search:!0},scrollable:!1,emptyMessage:"No data available"};function se(w,y){const B=Object.assign({},w);return pt(w)&&pt(y)&&Object.keys(y).forEach(W=>{pt(y[W])?W in w?B[W]=se(w[W],y[W]):Object.assign(B,{[W]:y[W]}):Object.assign(B,{[W]:y[W]})}),B}function pt(w){return w&&typeof w=="object"&&!Array.isArray(w)}const p=e.computed(()=>se($e,_e.options)),ue=e.computed(()=>{const w=p.value.table.width;return w==="auto"?null:typeof w=="number"?w:null}),ve=e.computed(()=>p.value.table.height),de=e.computed(()=>p.value.table.rowHeight??"auto"),ee=e.computed(()=>({height:de.value})),S=e.computed(()=>p.value.table.expandable===!0),ne=e.computed(()=>p.value.table.truncated===!0),He=e.computed(()=>p.value.table.striped),Ae=e.computed(()=>p.value.table.bordered),Ie=e.computed(()=>p.value.table.hoverable),O=e.computed(()=>p.value.table.size),rt=e.computed(()=>p.value.table.align||"left");e.computed(()=>p.value.title.text),e.computed(()=>p.value.subtitle.text);const Oe=e.computed(()=>p.value.selection.enabled),we=e.computed(()=>p.value.selection.mode),xt=e.computed(()=>p.value.sorting.enabled),Tt=e.computed(()=>p.value.sorting.mode),ut=e.computed(()=>p.value.pagination.enabled),Ze=e.computed(()=>p.value.pagination.rows),ge=e.computed(()=>p.value.pagination.rowsPerPageOptions),yt=e.computed(()=>p.value.scrollable),St=e.computed(()=>p.value.emptyMessage),at=e.computed(()=>p.value.toolbar?.downloads?.pdf!==!1),$t=e.computed(()=>p.value.toolbar?.downloads?.excel!==!1),Ot=e.computed(()=>p.value.toolbar?.search!==!1),on=e.computed(()=>at.value||$t.value||Ot.value||Et.value),Et=e.computed(()=>p.value.toolbar?.columnVisibility!==!1),lt=e.ref(""),je=e.ref(!1),Dt=e.ref(null);let Lt=null;function Bt(){je.value?(Lt&&(clearTimeout(Lt),Lt=null),je.value=!1,lt.value="",k("search",""),Dt.value?.blur()):(je.value=!0,Lt=setTimeout(()=>{Lt=null,Dt.value?.focus()},80))}function Xe(){lt.value||(je.value=!1)}function Zt(){lt.value="",k("search",""),Dt.value?.focus()}const Yt=e.computed(()=>({"dss-table-striped":He.value,"dss-table-bordered":Ae.value,"dss-table-hoverable":Ie.value,[`dss-table-${O.value}`]:O.value!=="default","dss-table-truncated":ne.value})),Ct=(w,y)=>w?.field??w?.key??y,te=e.ref(new Set);function Te(){const w=new Set;_e.columns.forEach((y,B)=>{y?.hidden!==!0&&w.add(Ct(y,B))}),te.value=w}const fe=e.computed(()=>_e.columns.filter((w,y)=>te.value.has(Ct(w,y)))),Ne=w=>{const y=_e.columns.findIndex(B=>B===w);return Ct(w,y>=0?y:0)},We=(w,y)=>te.value.has(Ct(w,y));function ft(w,y){const B=Ct(w,y),W=new Set(te.value);W.has(B)?W.delete(B):W.add(B),te.value=W}const qe=e.ref(null),dt=e.ref(!1);function xe(w){qe.value&&!qe.value.contains(w.target)&&(dt.value=!1)}const Ue=e.computed(()=>fe.value.length+(Oe.value?1:0)+(S.value?1:0)),X=(w,y)=>w?.id??w?.key??y,Z=e.ref(new Set),j=e.ref(null),ie=(w,y)=>Z.value.has(X(w,y)),E=(w,y,B)=>{B&&B.stopPropagation();const W=X(w,y),ae=new Set(Z.value);ae.has(W)?(ae.delete(W),k("row-collapse",{data:w,index:y})):(ae.add(W),k("row-expand",{data:w,index:y})),Z.value=ae},C=(w,y)=>{if(!ne.value)return;const B=X(w,y);j.value!==B&&(j.value=B)},V=e.ref(null),P=e.ref(0),U=e.ref([]),ze=w=>{if(Tt.value==="single")return V.value===w.field?P.value:0;{const y=U.value.find(B=>B.field===w.field);return y?y.order:0}},Re=w=>{const y=ze(w);return{"dss-sort-active":y!==0,"dss-sort-asc":y===1,"dss-sort-desc":y===-1}},De=e.ref({}),re=e.ref(null),Ge=e.ref(null),tt=220,wt=e.ref(null),vt=e.computed(()=>fe.value.find(w=>Ne(w)===re.value)??null),Je=e.computed(()=>{if(!vt.value||vt.value.filter!=="range")return null;const w=vt.value,y=re.value,{min:B,max:W}=R(w),ae=w.filterMin??B,mt=w.filterMax??W,ot=bn(y),Ht=ot.min??ae,It=ot.max??mt,At=mt-ae,En=At===0?0:(Ht-ae)/At*100,Wl=At===0?100:(It-ae)/At*100;return{rangeMin:ae,rangeMax:mt,currentMin:Ht,currentMax:It,minPct:En,maxPct:Wl}}),vn=e.ref(null),jt=e.ref("max");function Tn(w){const y=vn.value,B=Je.value;if(!y||!B)return;const W=y.getBoundingClientRect(),mt=(w.clientX-W.left)/W.width*100,ot=(B.minPct+B.maxPct)/2;jt.value=mt<ot?"min":"max"}function bn(w){return De.value[w]??{}}function Fn(w,y){De.value={...De.value,[w]:y}}function Wt(w){const y=De.value[w];return y?y.type==="string"?!!y.value?.trim():y.type==="range"?y.min!=null||y.max!=null:y.type==="dateRange"?!!(y.from||y.to):y.type==="list"?y.selected?.length>0:!1:!1}function In(w){const y={...De.value};delete y[w],De.value=y,re.value=null,Ge.value=null}function an(){if(!re.value){Ge.value=null;return}const w=wt.value;if(!w)return;const y=w.querySelector(`.dss-table-filter-trigger[data-filter-column-key="${re.value}"]`);if(!y)return;const B=y.getBoundingClientRect();Ge.value={top:B.bottom+6,left:Math.max(8,B.right-tt)}}const qn=e.computed(()=>{let w=[..._e.data];const y=(lt.value??"").trim().toLowerCase();return y&&(w=w.filter(B=>_e.columns.some(W=>{if(!W||!W.field)return!1;const ae=G(B,W);return String(ae??"").toLowerCase().includes(y)}))),fe.value.forEach(B=>{const W=Ne(B),ae=De.value[W];if(!ae)return;const mt=B.field;if(mt){if(ae.type==="string"&&ae.value?.trim()){const ot=ae.value.trim().toLowerCase();w=w.filter(Ht=>{const It=G(Ht,B);return String(It??"").toLowerCase().includes(ot)})}else if(ae.type==="range")w=w.filter(ot=>{const Ht=Mt(ot,mt),It=Number(Ht);return!(Number.isNaN(It)||ae.min!=null&&It<ae.min||ae.max!=null&&It>ae.max)});else if(ae.type==="dateRange"){const ot=ae.from?new Date(ae.from).getTime():null,Ht=ae.to?new Date(ae.to).getTime():null;w=w.filter(It=>{const At=Mt(It,mt),En=At?new Date(At).getTime():NaN;return!(Number.isNaN(En)||ot!=null&&En<ot||Ht!=null&&En>Ht)})}else if(ae.type==="list"&&ae.selected?.length){const ot=new Set(ae.selected);w=w.filter(Ht=>{const It=G(Ht,B);return ot.has(It!=null?String(It):"")})}}}),w});function cl(w){const y=new Set;return _e.data.forEach(B=>{const W=G(B,w);y.add(W!=null?String(W):"")}),Array.from(y).sort((B,W)=>String(B).localeCompare(String(W)))}function D(w,y){if(re.value===w){re.value=null,Ge.value=null;return}if(re.value=w,y?.currentTarget){const B=y.currentTarget.getBoundingClientRect();Ge.value={top:B.bottom+6,left:Math.max(8,B.right-tt)}}else an()}function q(w,y){Fn(w,{type:"string",value:y})}function R(w){const y=w.field;if(!y)return{min:0,max:100};let B=1/0,W=-1/0;return _e.data.forEach(ae=>{const mt=Mt(ae,y),ot=Number(mt);Number.isNaN(ot)||(B=Math.min(B,ot),W=Math.max(W,ot))}),{min:B===1/0?0:B,max:W===-1/0?100:W}}function le(w,y,B){const W={...bn(w),type:"range"},ae=B===""?null:Number(B),mt=ae===null||Number.isNaN(ae)?null:ae;W[y]=mt,mt!=null&&(y==="min"&&W.max!=null&&mt>W.max&&(W.max=mt),y==="max"&&W.min!=null&&mt<W.min&&(W.min=mt)),Fn(w,W)}function Me(w,y,B){const W={...bn(w),type:"dateRange"};W[y]=B||"",Fn(w,W)}const nt=e.reactive({});function st(w,y){nt[w]=y}function Qe(w){const y=Ne(w),B=(nt[y]??"").trim().toLowerCase(),W=cl(w);return B?W.filter(ae=>String(ae).toLowerCase().includes(B)):W}function Ke(w,y){return(bn(w).selected??[]).includes(y!=null?String(y):"")}function dn(w,y){const W=[...bn(w).selected??[]],ae=y!=null?String(y):"",mt=W.indexOf(ae);mt>=0?W.splice(mt,1):W.push(ae),Fn(w,{type:"list",selected:W})}function Ln(w){re.value&&!w.target.closest(".dss-table-filter-wrap")&&!w.target.closest(".dss-table-filter-dropdown")&&(re.value=null,Ge.value=null)}function tn(){an()}const Hn=w=>{if(!(w.sortable===!1||!xt.value))if(Tt.value==="single")V.value===w.field?P.value=P.value===1?-1:P.value===-1?0:1:(V.value=w.field,P.value=1),P.value===0&&(V.value=null),k("sort",{field:V.value,order:P.value});else{const y=U.value.findIndex(B=>B.field===w.field);y>=0?U.value[y].order===1?U.value[y].order=-1:U.value.splice(y,1):U.value.push({field:w.field,order:1}),k("sort",{multiSortMeta:U.value})}},wn=e.computed(()=>{if(!xt.value)return qn.value;let w=[...qn.value];return Tt.value==="single"&&V.value&&P.value!==0?w.sort((y,B)=>{const W=Mt(y,V.value),ae=Mt(B,V.value);return W===ae?0:W==null?1:ae==null?-1:(W<ae?-1:W>ae?1:0)*P.value}):Tt.value==="multiple"&&U.value.length>0&&w.sort((y,B)=>{for(const W of U.value){const ae=Mt(y,W.field),mt=Mt(B,W.field);if(ae===mt)continue;if(ae==null)return 1;if(mt==null)return-1;const ot=ae<mt?-1:ae>mt?1:0;if(ot!==0)return ot*W.order}return 0}),w}),sn=e.ref(0),xn=e.ref(Ze.value),zn=e.ref(!1),Nl=e.ref(null),Tl=w=>{xn.value=w,zn.value=!1,sn.value=0,k("page",{page:0,rows:xn.value})};function Sl(w){Nl.value&&!Nl.value.contains(w.target)&&(zn.value=!1)}const gl=e.computed(()=>wn.value.length),gn=e.computed(()=>Math.ceil(gl.value/xn.value)),hn=e.computed(()=>ut.value?sn.value*xn.value:0),Zl=e.computed(()=>ut.value?Math.min((sn.value+1)*xn.value,gl.value):gl.value),ul=e.computed(()=>{if(!ut.value)return wn.value;const w=hn.value,y=Zl.value;return wn.value.slice(w,y)}),An=e.ref(new Set),dl=e.computed(()=>wn.value.filter((w,y)=>An.value.has(X(w,y)))),hl=e.computed(()=>{const w=wn.value.length;return w>0&&An.value.size===w}),Ll=e.computed(()=>{const w=wn.value.length,y=An.value.size;return y>0&&y<w}),Vt=(w,y)=>An.value.has(X(w,y)),Ee=()=>{if(hl.value)An.value=new Set,k("unselect-all");else{const w=new Set;wn.value.forEach((y,B)=>w.add(X(y,B))),An.value=w,k("select-all",dl.value)}},yn=(w,y)=>{const B=X(w,y),W=new Set(An.value),ae=W.has(B);we.value==="single"?ae?(W.delete(B),k("row-unselect",w)):(W.clear(),W.add(B),k("row-select",w)):ae?(W.delete(B),k("row-unselect",w)):(W.add(B),k("row-select",w)),An.value=W},et=e.computed(()=>{const w=gn.value,y=sn.value+1,B=2,W=[],ae=[];let mt;for(let ot=1;ot<=w;ot++)(ot===1||ot===w||ot>=y-B&&ot<=y+B)&&W.push(ot);for(const ot of W)mt&&(ot-mt===2?ae.push(mt+1):ot-mt!==1&&ae.push("...")),ae.push(ot),mt=ot;return ae}),rn=w=>{w<0||w>=gn.value||(sn.value=w,k("page",{page:w,rows:xn.value}))},Se=(w,y,B)=>{k("row-click",{data:w,index:y,originalEvent:B}),C(w,hn.value+y)},Be=(w,y)=>{const B=hn.value+y;return{"dss-table-row-selected":Vt(w,B),"dss-table-row-even":y%2===0,"dss-table-row-odd":y%2!==0,"dss-table-row-truncated-clickable":ne.value,"dss-table-row-truncated-expanded":j.value===X(w,B)}},G=(w,y)=>y.field?Mt(w,y.field):"",Mt=(w,y)=>y.split(".").reduce((B,W)=>B&&B[W],w),he=w=>{const y=w.align??rt.value;return{"dss-table-sortable":w.sortable!==!1&&xt.value,"dss-table-align-left":y==="left","dss-table-align-center":y==="center","dss-table-align-right":y==="right",[w.className]:w.className}},Hl=w=>{const y={};return w.width&&(y.width=typeof w.width=="number"?`${w.width}px`:w.width),w.minWidth&&(y.minWidth=typeof w.minWidth=="number"?`${w.minWidth}px`:w.minWidth),w.maxWidth&&(y.maxWidth=typeof w.maxWidth=="number"?`${w.maxWidth}px`:w.maxWidth),y};return e.watch(()=>_e.locale,w=>{w&&w!==A.value&&(A.value=w)},{immediate:!0}),e.watch(Ze,w=>{xn.value=w,sn.value=0}),e.watch(lt,w=>{k("search",w??"")}),e.watch(()=>_e.columns,()=>{Te()},{immediate:!0,deep:!0}),e.onMounted(()=>{document.addEventListener("click",Sl),document.addEventListener("click",xe),document.addEventListener("click",Ln),window.addEventListener("resize",tn),window.addEventListener("scroll",tn,!0)}),e.onUnmounted(()=>{document.removeEventListener("click",Sl),document.removeEventListener("click",xe),document.removeEventListener("click",Ln),window.removeEventListener("resize",tn),window.removeEventListener("scroll",tn,!0)}),(w,y)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{class:"dss-table-container",ref_key:"tableContainerRef",ref:wt,style:e.normalizeStyle({width:ue.value+"px",height:ve.value?ve.value+"px":"auto"})},[on.value?(e.openBlock(),e.createElementBlock("div",Ti,[e.createElementVNode("div",Li,[at.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-table-toolbar-btn",onClick:y[0]||(y[0]=B=>k("download-pdf"))},[y[21]||(y[21]=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(z)("table.downloadPdf")),1)])):e.createCommentVNode("",!0),$t.value?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-table-toolbar-btn",onClick:y[1]||(y[1]=B=>k("download-excel"))},[y[22]||(y[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_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(z)("table.downloadExcel")),1)])):e.createCommentVNode("",!0),Et.value?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-table-toolbar-column-visibility",ref_key:"columnVisibilityDropdownRef",ref:qe},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-pagination-select-trigger",{"dss-pagination-select-open":dt.value}]),onClick:y[2]||(y[2]=B=>dt.value=!dt.value),"aria-expanded":dt.value,"aria-haspopup":"listbox"},[e.createTextVNode(e.toDisplayString(e.unref(z)("table.columnVisibility"))+" ",1),y[23]||(y[23]=e.createElementVNode("span",{class:"dss-pagination-select-chevron","aria-hidden":"true"},"▼",-1))],10,Hi),e.createVNode(e.Transition,{name:"dss-dropdown"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("ul",Ai,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(F.columns,(B,W)=>(e.openBlock(),e.createElementBlock("li",{key:Ct(B,W),role:"option",class:"dss-table-column-visibility-option",onClick:y[3]||(y[3]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("label",Di,[e.createElementVNode("span",Ri,[e.createElementVNode("input",{type:"checkbox",checked:We(B,W),onChange:ae=>ft(B,W),class:"dss-table-checkbox dss-table-checkbox--checkbox"},null,40,Fi),We(B,W)?(e.openBlock(),e.createElementBlock("span",Ii,[...y[24]||(y[24]=[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",zi,e.toDisplayString(B.header),1)])]))),128))],512),[[e.vShow,dt.value]])]),_:1})],512)):e.createCommentVNode("",!0)]),e.createElementVNode("div",Pi,[Ot.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["dss-table-toolbar-search",{"dss-table-toolbar-search--expanded":je.value||lt.value}])},[e.withDirectives(e.createElementVNode("input",{ref_key:"searchInputRef",ref:Dt,"onUpdate:modelValue":y[4]||(y[4]=B=>lt.value=B),type:"text",class:"dss-table-toolbar-search-input",placeholder:e.unref(z)("table.searchPlaceholder"),"aria-label":"Search table",onFocus:y[5]||(y[5]=B=>je.value=!0),onBlur:Xe},null,40,Oi),[[e.vModelText,lt.value]]),lt.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-table-toolbar-search-clear","aria-label":"Clear search",onClick:Zt},[...y[25]||(y[25]=[e.createElementVNode("span",{"aria-hidden":"true"},"×",-1)])])):e.createCommentVNode("",!0),e.createElementVNode("button",{type:"button",class:"dss-table-toolbar-search-trigger","aria-label":"Search","aria-expanded":je.value||!!lt.value,onMousedown:e.withModifiers(Bt,["prevent"])},[...y[26]||(y[26]=[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,Zi)],2)):e.createCommentVNode("",!0),w.$slots["toolbar-extra"]?(e.openBlock(),e.createElementBlock("div",Wi,[e.renderSlot(w.$slots,"toolbar-extra")])):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["dss-table-wrapper",{"dss-table-scrollable":yt.value}])},[e.createElementVNode("table",{class:e.normalizeClass(["dss-table",Yt.value])},[e.createElementVNode("thead",qi,[e.createElementVNode("tr",null,[Oe.value?(e.openBlock(),e.createElementBlock("th",Ui,[we.value==="multiple"?(e.openBlock(),e.createElementBlock("span",Xi,[e.createElementVNode("input",{type:"checkbox",checked:hl.value,indeterminate:Ll.value,onChange:Ee,class:"dss-table-checkbox dss-table-checkbox--checkbox"},null,40,Yi),Ll.value?(e.openBlock(),e.createElementBlock("span",ji)):hl.value?(e.openBlock(),e.createElementBlock("span",Ki,[...y[27]||(y[27]=[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),S.value?(e.openBlock(),e.createElementBlock("th",Gi)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(fe.value,(B,W)=>(e.openBlock(),e.createElementBlock("th",{key:Ne(B),class:e.normalizeClass(["dss-table-th",he(B)]),style:e.normalizeStyle(Hl(B)),onClick:ae=>Hn(B)},[e.createElementVNode("div",Ji,[e.createElementVNode("span",ec,e.toDisplayString(B.header),1),B.sortable!==!1&&xt.value?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["dss-table-sort-icon",Re(B)])},[ze(B)===0?(e.openBlock(),e.createElementBlock("span",tc,[...y[28]||(y[28]=[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)])])):ze(B)===1?(e.openBlock(),e.createElementBlock("span",nc,[...y[29]||(y[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:"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)])])):ze(B)===-1?(e.openBlock(),e.createElementBlock("span",lc,[...y[30]||(y[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 -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),B.filter?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["dss-table-filter-wrap",{"dss-table-filter-wrap--open":re.value===Ne(B)}]),onClick:y[6]||(y[6]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-table-filter-trigger",{"dss-table-filter-trigger--active":Wt(Ne(B))}]),"data-filter-column-key":Ne(B),"aria-expanded":re.value===Ne(B),"aria-label":"Filter column",onClick:ae=>D(Ne(B),ae)},[...y[31]||(y[31]=[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,oc)],2)):e.createCommentVNode("",!0)])],14,Qi))),128))])]),e.createElementVNode("tbody",ac,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ul.value,(B,W)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:X(B,hn.value+W)},[e.createElementVNode("tr",{class:e.normalizeClass(["dss-table-tr",Be(B,W)]),style:e.normalizeStyle(ee.value),onClick:ae=>Se(B,W,ae)},[Oe.value?(e.openBlock(),e.createElementBlock("td",{key:0,class:"dss-table-td dss-table-selection-cell",onClick:y[7]||(y[7]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("span",rc,[e.createElementVNode("input",{type:we.value==="multiple"?"checkbox":"radio",name:`dss-table-select-${F.tableId}`,checked:Vt(B,hn.value+W),onChange:ae=>yn(B,hn.value+W),class:e.normalizeClass(["dss-table-checkbox",we.value==="multiple"?"dss-table-checkbox--checkbox":"dss-table-checkbox--radio"])},null,42,ic),we.value==="multiple"&&Vt(B,hn.value+W)?(e.openBlock(),e.createElementBlock("span",cc,[...y[32]||(y[32]=[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)])])):we.value==="single"&&Vt(B,hn.value+W)?(e.openBlock(),e.createElementBlock("span",uc)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),S.value?(e.openBlock(),e.createElementBlock("td",{key:1,class:"dss-table-td dss-table-expansion-cell",onClick:e.withModifiers(ae=>E(B,hn.value+W,ae),["stop"])},[e.createElementVNode("button",{type:"button",class:"dss-table-expansion-trigger","aria-expanded":ie(B,hn.value+W),"aria-label":ie(B,hn.value+W)?"Collapse row":"Expand row"},[e.createElementVNode("span",{class:e.normalizeClass(["dss-table-expansion-icon",{"dss-table-expansion-icon--expanded":ie(B,hn.value+W)}]),"aria-hidden":"true"},[...y[33]||(y[33]=[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,mc)],8,dc)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(fe.value,(ae,mt)=>(e.openBlock(),e.createElementBlock("td",{key:Ne(ae),class:e.normalizeClass(["dss-table-td",he(ae)]),style:e.normalizeStyle(Hl(ae))},[e.renderSlot(w.$slots,`cell-${ae.field}`,{data:B,column:ae,rowIndex:W},()=>[e.createTextVNode(e.toDisplayString(G(B,ae)),1)])],6))),128))],14,sc),S.value&&ie(B,hn.value+W)?(e.openBlock(),e.createElementBlock("tr",pc,[e.createElementVNode("td",{colspan:Ue.value,class:"dss-table-expansion-content-cell"},[e.renderSlot(w.$slots,"expansion",{data:B,rowIndex:W})],8,fc)])):e.createCommentVNode("",!0)],64))),128)),ul.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("tr",{key:0,class:"dss-table-empty",style:e.normalizeStyle(ee.value)},[e.createElementVNode("td",{colspan:Ue.value,class:"dss-table-empty-cell"},[e.renderSlot(w.$slots,"empty",{},()=>[e.createTextVNode(e.toDisplayString(St.value),1)])],8,vc)],4))])],2)],2),ut.value?(e.openBlock(),e.createElementBlock("div",gc,[e.createElementVNode("div",hc,[e.createElementVNode("div",yc,[e.createElementVNode("button",{class:"dss-pagination-btn",disabled:sn.value===0,onClick:y[8]||(y[8]=B=>rn(0)),title:e.unref(z)("table.firstPage")},[...y[34]||(y[34]=[e.createElementVNode("span",{class:"dss-pagination-double-arrow"},[e.createElementVNode("span",null,"‹"),e.createElementVNode("span",null,"‹")],-1)])],8,Cc),e.createElementVNode("button",{class:"dss-pagination-btn",disabled:sn.value===0,onClick:y[9]||(y[9]=B=>rn(sn.value-1)),title:e.unref(z)("table.previousPage")}," ‹ ",8,kc),e.createElementVNode("span",bc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(et.value,B=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:B},[B!=="..."?(e.openBlock(),e.createElementBlock("button",{key:0,class:e.normalizeClass(["dss-pagination-page",{"dss-active":B===sn.value+1}]),onClick:W=>rn(B-1)},e.toDisplayString(B),11,wc)):(e.openBlock(),e.createElementBlock("span",xc,"..."))],64))),128))]),e.createElementVNode("button",{class:"dss-pagination-btn",disabled:sn.value>=gn.value-1,onClick:y[10]||(y[10]=B=>rn(sn.value+1)),title:e.unref(z)("table.nextPage")}," › ",8,Ec),e.createElementVNode("button",{class:"dss-pagination-btn",disabled:sn.value>=gn.value-1,onClick:y[11]||(y[11]=B=>rn(gn.value-1)),title:e.unref(z)("table.lastPage")},[...y[35]||(y[35]=[e.createElementVNode("span",{class:"dss-pagination-double-arrow"},[e.createElementVNode("span",null,"›"),e.createElementVNode("span",null,"›")],-1)])],8,Vc)]),e.createElementVNode("div",{class:"dss-pagination-rows-per-page",ref_key:"rowsPerPageDropdownRef",ref:Nl},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-pagination-select-trigger",{"dss-pagination-select-open":zn.value}]),onClick:y[12]||(y[12]=B=>zn.value=!zn.value),"aria-expanded":zn.value,"aria-haspopup":"listbox"},[e.createTextVNode(e.toDisplayString(xn.value)+" ",1),y[36]||(y[36]=e.createElementVNode("span",{class:"dss-pagination-select-chevron","aria-hidden":"true"},"▼",-1))],10,Nc),e.createVNode(e.Transition,{name:"dss-dropdown"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("ul",Sc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ge.value,B=>(e.openBlock(),e.createElementBlock("li",{key:B,role:"option","aria-selected":B===xn.value,class:e.normalizeClass(["dss-pagination-select-option",{"dss-pagination-select-option--selected":B===xn.value}]),onClick:W=>Tl(B)},e.toDisplayString(B),11,Bc))),128))],512),[[e.vShow,zn.value]])]),_:1})],512)])])):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(Ge.value?{top:Ge.value.top+"px",left:Ge.value.left+"px",width:tt+"px"}:void 0),onClick:y[20]||(y[20]=e.withModifiers(()=>{},["stop"]))},[vt.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[vt.value.filter==="string"?(e.openBlock(),e.createElementBlock("div",Mc,[e.createElementVNode("input",{type:"text",value:bn(re.value).value??"",onInput:y[13]||(y[13]=B=>q(re.value,B.target.value)),class:"dss-table-filter-input",placeholder:e.unref(z)("table.search")||"Search..."},null,40,_c)])):vt.value.filter==="range"&&Je.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-table-filter-double-range",style:e.normalizeStyle({"--range-min-pct":Je.value.minPct+"%","--range-max-pct":Je.value.maxPct+"%"})},[e.createElementVNode("div",{ref_key:"doubleRangeTrackRef",ref:vn,class:"dss-table-filter-double-range-track",onMousemove:Tn,onMouseenter:Tn},[e.createElementVNode("input",{type:"range",min:Je.value.rangeMin,max:Je.value.rangeMax,value:Je.value.currentMin,onInput:y[14]||(y[14]=B=>le(re.value,"min",B.target.value)),class:"dss-table-filter-double-range-input dss-table-filter-double-range-input--min",style:e.normalizeStyle({zIndex:jt.value==="min"?2:1})},null,44,$c),e.createElementVNode("input",{type:"range",min:Je.value.rangeMin,max:Je.value.rangeMax,value:Je.value.currentMax,onInput:y[15]||(y[15]=B=>le(re.value,"max",B.target.value)),class:"dss-table-filter-double-range-input dss-table-filter-double-range-input--max",style:e.normalizeStyle({zIndex:jt.value==="max"?2:1})},null,44,Tc)],544),e.createElementVNode("div",Lc,e.toDisplayString(Je.value.currentMin)+" – "+e.toDisplayString(Je.value.currentMax),1)],4)):vt.value.filter==="dateRange"?(e.openBlock(),e.createElementBlock("div",Hc,[e.createElementVNode("div",Ac,[e.createElementVNode("label",Dc,e.toDisplayString(e.unref(z)("table.filterFrom")||"From:"),1),e.createElementVNode("input",{type:"date",value:bn(re.value).from??"",onInput:y[16]||(y[16]=B=>Me(re.value,"from",B.target.value)),class:"dss-table-filter-input dss-table-filter-daterange-input"},null,40,Rc)]),e.createElementVNode("div",Fc,[e.createElementVNode("label",Ic,e.toDisplayString(e.unref(z)("table.filterTo")||"To:"),1),e.createElementVNode("input",{type:"date",value:bn(re.value).to??"",onInput:y[17]||(y[17]=B=>Me(re.value,"to",B.target.value)),class:"dss-table-filter-input dss-table-filter-daterange-input"},null,40,zc)])])):vt.value.filter==="list"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.createElementVNode("input",{type:"text",value:nt[re.value]??"",onInput:y[18]||(y[18]=B=>st(re.value,B.target.value)),class:"dss-table-filter-input dss-table-filter-list-search",placeholder:e.unref(z)("table.search")||"Search..."},null,40,Pc),e.createElementVNode("div",Oc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Qe(vt.value),B=>(e.openBlock(),e.createElementBlock("label",{key:B,class:"dss-table-filter-list-item"},[e.createElementVNode("input",{type:"checkbox",checked:Ke(re.value,B),onChange:W=>dn(re.value,B)},null,40,Zc),e.createElementVNode("span",null,e.toDisplayString(B),1)]))),128))])],64)):e.createCommentVNode("",!0),e.createElementVNode("div",Wc,[e.createElementVNode("button",{type:"button",class:"dss-table-filter-clear",onClick:y[19]||(y[19]=B=>In(re.value))},e.toDisplayString(e.unref(z)("table.clearFilter")||"Clear"),1)])],64)):e.createCommentVNode("",!0)],4),[[e.vShow,re.value&&vt.value&&Ge.value]])]),_:1})]))],64))}}),Xc={class:"dss-toolbar-left"},Yc=["title"],jc=["title"],Kc={class:"dss-toolbar-dropdown-wrapper"},Gc=["title"],Qc={key:0,class:"dss-toolbar-heading-icon",width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Jc={key:1,class:"dss-toolbar-heading-icon",width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},eu={key:2,class:"dss-toolbar-heading-icon",width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},tu={key:3,class:"dss-toolbar-heading-icon",width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},nu={key:4,class:"dss-toolbar-heading-icon",width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},lu={key:5,class:"dss-toolbar-heading-icon",width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},ou={key:6,width:"13",height:"14",viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"paragraph-icon"},au=["title"],su=["title"],ru=["title"],iu=["title"],cu=["title"],uu=["title"],du=["title"],mu=["title"],pu=["title"],fu={key:2,class:"dss-toolbar-separator"},vu=["title"],gu={key:4,class:"dss-toolbar-separator"},hu={key:5,class:"dss-toolbar-dropdown-wrapper"},yu=["title"],Cu={class:"dss-toolbar-dropdown-ai"},ku={class:"dss-toolbar-right"},bu={key:0,class:"dss-toolbar-custom-group"},wu={key:1,class:"dss-toolbar-separator"},xu={class:"dss-link-modal-content"},Eu={class:"dss-link-modal-field"},Vu={class:"dss-link-modal-label"},Nu=["placeholder"],Su={class:"dss-link-modal-field"},Bu={class:"dss-link-modal-label"},Mu=["placeholder"],_u={class:"dss-image-modal-tabs"},$u={key:0,class:"dss-image-tab-content"},Tu={class:"dss-link-modal-content"},Lu={class:"dss-link-modal-field"},Hu={key:0,class:"dss-link-modal-label"},Au=["src"],Du={class:"dss-link-modal-field"},Ru={class:"dss-link-modal-label"},Fu=["placeholder"],Iu={class:"dss-link-modal-field"},zu={class:"dss-link-modal-label"},Pu=["placeholder"],Ou={class:"dss-link-modal-field"},Zu={class:"dss-link-modal-label"},Wu=["placeholder"],qu={key:1,class:"dss-image-tab-content"},Uu={class:"dss-link-modal-content"},Xu={class:"dss-link-modal-field"},Yu={class:"dss-link-modal-label"},ju=["placeholder"],Ku={class:"dss-link-modal-field"},Gu={class:"dss-link-modal-label"},Qu=["placeholder"],Ju={class:"dss-link-modal-field"},ed={class:"dss-link-modal-label"},td=["placeholder"],nd={class:"dss-link-modal-field"},ld={class:"dss-link-modal-label"},od=["placeholder"],ad={class:"dss-text-editor-title-input-container"},sd={key:0,class:"dss-text-editor-title-preview"},rd={key:0},id={key:1,class:"dss-text-editor-preview-placeholder"},cd=["value","placeholder","disabled"],ud={key:2,class:"dss-text-editor-title-slot dss-text-editor-slot-last"},dd={class:"dss-text-editor-description-input-container"},md={key:0,class:"dss-text-editor-description-preview"},pd={key:0},fd={key:1,class:"dss-text-editor-preview-placeholder"},vd=["value","placeholder","disabled"],gd={key:3,class:"dss-text-editor-description-slot dss-text-editor-slot-last"},hd=["data-comment-id","onMouseenter"],yd=["onClick"],Cd=["src","alt"],kd={key:1},bd=["onClick"],wd=["src","alt"],xd={key:1},Ed=["data-has-second-user","onClick"],Vd={class:"editor-comment-marker-count"},Nd={key:4,class:"dss-text-editor-textarea-wrapper"},Sd=["value","placeholder","rows","disabled"],Bd={class:"dss-text-editor-footer"},Md={class:"dss-text-editor-footer-content"},_d={class:"dss-text-editor-footer-stat"},$d={class:"dss-text-editor-footer-stat"},Td={key:5,class:"dss-text-editor-content-wrapper"},Ld={key:0,class:"dss-comment-overlay-body"},Hd={class:"dss-comment-selection-wrapper"},Ad=["innerHTML"],Dd={class:"dss-comment-messages-wrapper"},Rd={key:0,class:"dss-comment-avatar-wrapper"},Fd={class:"dss-comment-avatar"},Id=["src","alt"],zd={key:1},Pd={class:"dss-comment-header"},Od={class:"dss-comment-header-text"},Zd={class:"dss-comment-author"},Wd={key:0,class:"dss-comment-date"},qd=["onClick","title"],Ud={class:"dss-comment-overlay-inner"},Xd=["placeholder","onKeydown"],Yd={class:"dss-text-editor-footer"},jd={class:"dss-text-editor-footer-content"},Kd={class:"dss-text-editor-footer-stat"},Gd={class:"dss-text-editor-footer-stat"},Qd=["title"],Jd=["title"],e1={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:""},t1={class:"dss-image-popup-content"},n1={key:0,class:"dss-image-popup-no-alt-icon"},l1=["title"],o1=["title"],a1={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:""},s1={class:"dss-toolbar-left"},r1=["title"],i1=["title"],c1={class:"dss-toolbar-dropdown-wrapper"},u1=["title"],d1={key:0,class:"dss-toolbar-heading-icon",width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},m1={key:1,class:"dss-toolbar-heading-icon",width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},p1={key:2,class:"dss-toolbar-heading-icon",width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},f1={key:3,class:"dss-toolbar-heading-icon",width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},v1={key:4,class:"dss-toolbar-heading-icon",width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},g1={key:5,class:"dss-toolbar-heading-icon",width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},h1={key:6,width:"13",height:"14",viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"paragraph-icon"},y1=["title"],C1=["title"],k1=["title"],b1=["title"],w1=["title"],x1=["title"],E1=["title"],V1=["title"],N1=["title"],S1=["title"],B1={key:2,class:"dss-toolbar-separator"},M1={key:3,class:"dss-toolbar-dropdown-wrapper"},_1=["title"],$1={class:"dss-toolbar-dropdown-ai"},T1={key:0,class:"dss-toolbar-right"},L1={key:0,class:"dss-toolbar-separator"},H1={key:0,class:"dss-toolbar-custom-group"},A1={key:1,class:"dss-toolbar-separator"},D1={name:"DSSTextEditor"},R1=Object.assign(D1,{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:F=>typeof F=="object"&&F!==null},floatingToolbar:{type:Boolean,default:!1},askAi:{type:Boolean,default:!1},commentUser:{type:Object,default:null},customToolbarSlots:{type:Array,default:()=>["custom-tool-1","custom-tool-2","custom-tool-3"]},customToolbarFloatingMap:{type:Object,default:()=>({}),validator:F=>typeof F=="object"&&F!==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(F,{expose:Ce,emit:z}){const{t:A,locale:_e}=lo.useI18n(),k=F,$e=z,se=e.useSlots(),pt=`<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
99
99
  <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>`,p=e.ref(null),ue=e.ref(null),ve=e.ref(!1),de=e.ref(!1),ee=e.ref(!1),S=e.ref(""),ne=e.ref({}),He=e.ref(!1),Ae=e.ref(!1),Ie=e.ref(""),O=e.ref(""),rt=e.ref(null),Oe=e.ref(null),we=e.ref(null),xt=e.ref(null),Tt=e.ref(""),ut=e.ref(!1),Ze=e.ref({}),ge=e.ref(!1),yt=e.ref({}),St=e.ref(null),at=e.ref(null),$t=e.ref(!1),Ot=e.ref(""),on=e.ref(null),Et=e.ref(""),lt=e.ref(""),je=e.ref(""),Dt=e.ref(null),Lt=e.ref(null),Bt=e.ref(null),Xe=e.ref(null),Zt=e.ref(null),Yt=e.ref(!1),Ct=e.ref(""),te=e.ref({}),$e=e.ref(!1),fe=e.ref("upload"),Ne=e.ref(""),We=e.ref(null),ft=e.ref(null),qe=e.ref([]),dt=e.ref([]),xe=e.ref(null),Ue=e.ref(!1),X=e.ref(""),Z=e.ref(""),j=e.ref(""),ie=e.ref(""),E=e.ref(""),C=e.ref(""),V=e.ref(null),P=e.ref(null),U=e.ref(null),ze=e.ref(!1),Re=e.ref(null),De=e.ref(!1),re=e.ref(!1),Ge=e.ref(null),tt=e.ref("p"),wt=e.ref(!1),vt=e.ref([]),Je=e.ref(null),vn=e.ref(null),jt=e.ref(null),Tn=e.ref(!1),bn=e.ref(0),Fn=100,Wt=e.ref(null),In=e.computed(()=>({"dss-text-editor-no-border":!k.border,"dss-text-editor-rounded":k.rounded,"dss-text-editor-full-height":k.fullHeight,"dss-comment-overlay-open":mn.value!==null})),an=e.computed(()=>({})),qn=e.computed(()=>!k.fixedHeight||k.fullHeight?{}:{height:`${1.6*14*k.rows+24+2}px`,resize:"none",overflowY:"auto"}),cl=e.computed(()=>!k.fixedHeight||k.fullHeight?{}:{height:`${1.6*14*k.rows+32}px`,overflowY:"auto"}),D=e.computed(()=>k.richText&&dt.value.length>0),q=e.computed(()=>{if(!k.modelValue)return"";if(k.richText){let o=k.modelValue.replace(/<script[^>]*>[\s\S]*?<\/script>/gi,"");return o=o.replace(/<style[^>]*>[\s\S]*?<\/style>/gi,""),o=o.replace(/<[^>]+>/g,""),o=o.replace(/&nbsp;/g," "),o=o.replace(/&amp;/g,"&"),o=o.replace(/&lt;/g,"<"),o=o.replace(/&gt;/g,">"),o=o.replace(/&quot;/g,'"'),o=o.replace(/&#39;/g,"'"),o=o.replace(/\s+/g," ").trim(),o}return k.modelValue}),R=e.computed(()=>{const o=q.value.trim();return o?o.split(/\s+/).filter(l=>l.length>0).length:0}),le=e.computed(()=>q.value.length),Me=e.computed(()=>Xe.value!==null&&fe.value==="upload"&&Et.value&&Et.value.startsWith("data:")),nt=e.computed(()=>k.titlePlaceholder||A("textEditor.placeholders.title")),st=e.computed(()=>k.descriptionPlaceholder||A("textEditor.placeholders.description")),Qe=e.computed(()=>k.placeholder||A("textEditor.placeholders.startTyping")),Ke=o=>se&&se[o]!==void 0,dn=o=>{for(let l=o+1;l<k.customToolbarSlots.length;l++)if(Ke(k.customToolbarSlots[l]))return!0;return!1},Ln=o=>{for(let l=o+1;l<k.customToolbarSlots.length;l++){const a=k.customToolbarSlots[l];if(Ke(a)&&tn(a))return!0}return!1},tn=o=>k.customToolbarFloatingMap.hasOwnProperty(o)?k.customToolbarFloatingMap[o]===!0:!0,Hn=e.computed(()=>k.customToolbarSlots.some(o=>Ke(o)&&tn(o))),wn=e.computed(()=>Ke("title-slot")),sn=e.computed(()=>Ke("description-slot")),xn=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,""),a=l.trim();return a.startsWith("<html>")&&a.endsWith("</html>")?a.slice(6,-7).trim():l},Nl=o=>{if(!o)return;const l=document.createTreeWalker(o,NodeFilter.SHOW_COMMENT,null,!1),a=[];let r=l.nextNode();for(;r;)a.push(r),r=l.nextNode();a.forEach(c=>c.remove())},Tl=o=>{try{const l=String(o.getDate()).padStart(2,"0"),r=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][o.getMonth()],c=o.getFullYear();return`${l} ${r} ${c}`}catch{return""}},Sl=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=A("textEditor.started_conversation");if(c&&l===c)return!0}catch{}const r=l.toLowerCase();return r.includes("started conversation")||r.includes("démarré la conversation")||r==="started conversation"||r==="a démarré la conversation"},gl=o=>{const l=o.target.value;Le("update:modelValue",l),Le("change",l)},gn=()=>{if(!V.value)return;const o=V.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 r=o.value;o.value="M";const c=o.scrollHeight;o.value=r,o.style.setProperty("height",`${c}px`,"important"),o.style.setProperty("overflow-y","hidden","important");return}o.offsetHeight;const a=o.scrollHeight;o.style.setProperty("height",`${a}px`,"important"),o.style.setProperty("overflow-y","hidden","important")},hn=()=>{De.value=!0,gn()},Zl=()=>{De.value=!1,ul()},ul=()=>{if(!V.value)return;const o=V.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 a=o.scrollHeight;o.value=l,o.offsetHeight,o.style.setProperty("height",`${a}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")},An=o=>{const a=o.target.value;De.value&&gn(),Le("update:title",a),Le("title-change",a),U.value="title",k.richText&&(Ue.value||(Z.value=X.value,E.value=j.value,C.value=ie.value),xe.value&&clearTimeout(xe.value),Ue.value=!0,xe.value=setTimeout(()=>{Ue.value=!1,Se()},500))},dl=()=>{if(!P.value)return;const o=P.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 r=o.value;o.value="M";const c=o.scrollHeight;o.value=r,o.style.setProperty("height",`${c}px`,"important"),o.style.setProperty("overflow-y","hidden","important");return}o.offsetHeight;const a=o.scrollHeight;o.style.setProperty("height",`${a}px`,"important"),o.style.setProperty("overflow-y","hidden","important")},hl=()=>{re.value=!0,dl()},Ll=()=>{re.value=!1,Vt()},Vt=()=>{if(!P.value)return;const o=P.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 a=o.scrollHeight;o.value=l,o.offsetHeight,o.style.setProperty("height",`${a}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")},Ee=o=>{const a=o.target.value;re.value&&dl(),Le("update:description",a),Le("description-change",a),U.value="description",k.richText&&(Ue.value||(Z.value=X.value,E.value=j.value,C.value=ie.value),xe.value&&clearTimeout(xe.value),Ue.value=!0,xe.value=setTimeout(()=>{Ue.value=!1,Se()},500))},yn=()=>{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 a=l.cloneRange();return a.selectNodeContents(p.value),a.setEnd(l.startContainer,l.startOffset),{type:"text",start:a.toString().length,end:a.toString().length+l.toString().length}},et=o=>{if(!(!o||!p.value))try{const l=window.getSelection(),a=document.createRange();if(o.type==="element"&&o.element)if(p.value.contains(o.element)){a.setStart(o.element,o.offset),a.collapse(!0),l.removeAllRanges(),l.addRange(a);return}else{p.value.focus();return}let r=0;const c=[p.value];let d=null,u=!1,m=!1;for(;!m&&(d=c.pop());)if(d.nodeType===3){const v=r+d.length;!u&&o.start>=r&&o.start<=v&&(a.setStart(d,o.start-r),u=!0),u&&o.end>=r&&o.end<=v&&(a.setEnd(d,o.end-r),m=!0),r=v}else{let v=d.childNodes.length;for(;v--;)c.push(d.childNodes[v])}l.removeAllRanges(),l.addRange(a)}catch{p.value.focus()}},rn=()=>{if(!p.value)return;p.value.focus();const o=window.getSelection(),l=document.createRange(),a=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=a(u);if(m)return m}return c},r=a(p.value);if(r.nodeType===3)l.setStart(r,r.length),l.setEnd(r,r.length);else if(r.childNodes.length>0){const c=a(r);c&&c.nodeType===3?(l.setStart(c,c.length),l.setEnd(c,c.length)):(l.selectNodeContents(r),l.collapse(!1))}else l.setStart(r,0),l.setEnd(r,0);o.removeAllRanges(),o.addRange(l)},Se=(o=!1)=>{if(!p.value)return;const l=p.value.innerHTML,a=k.title||"",r=k.description||"";if(!o&&l===X.value&&a===j.value&&r===ie.value)return;const c={content:Z.value||X.value,title:E.value!==void 0?E.value:j.value,description:C.value!==void 0?C.value:ie.value},d=qe.value.length>0?qe.value[qe.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&&(qe.value.push(c),qe.value.length>50&&qe.value.shift(),dt.value=[]),X.value=l,j.value=a,ie.value=r,Z.value=l,E.value=a,C.value=r},Be=o=>{if(!p.value)return;G(),p.value&&Nl(p.value);let l=null;p.value&&(p.value.querySelector("p")||(l=yn(),Mt()));const a=o&&o.inputType&&(o.inputType==="insertText"||o.inputType==="insertCompositionText"||o.inputType==="deleteContentBackward"||o.inputType==="deleteContentForward");a&&Ge.value&&(Ge.value=null),de.value=!0;const r=p.value.innerHTML.replace(/<!--[\s\S]*?-->/g,"").replace(/&nbsp;|\u00A0/g," "),c=xn(r);Le("update:modelValue",c),Le("change",c),U.value="editor",Ue.value||(Z.value=X.value,E.value=j.value,C.value=ie.value),xe.value&&clearTimeout(xe.value),Ue.value=!0,xe.value=setTimeout(()=>{Ue.value=!1,Se(),Yn(),ko()},500),e.nextTick(()=>{l&&et(l),G();const d=["bold","italic","underline"],u=window.getSelection(),m=u.rangeCount>0?u.getRangeAt(0):null,v=m&&m.collapsed;if(d.forEach(h=>{try{if(v&&Ge.value?.command===h){Ze.value[h]=Ge.value.state;return}if(h==="bold")if(m){const _=m.commonAncestorContainer,$=_.nodeType===3?_.parentElement:_;let N=!1;if($&&(($.tagName==="STRONG"||$.tagName==="B"||$.closest&&$.closest("strong, b"))&&(N=!0),!N&&$.style&&parseInt($.style.fontWeight)>=600&&(N=!0),!N))try{const Q=window.getComputedStyle($);parseInt(Q.fontWeight)>=600&&(N=!0)}catch{}Ze.value[h]=N}else Ze.value.hasOwnProperty(h)||(Ze.value[h]=!1);else if(h==="italic")if(m){const _=m.commonAncestorContainer,$=_.nodeType===3?_.parentElement:_,N=$&&($.tagName==="EM"||$.tagName==="I"||$.closest&&$.closest("em, i"));Ze.value[h]=!!N}else{const _=document.queryCommandState(h);Ze.value[h]=_}else{const _=document.queryCommandState(h);Ze.value[h]=_}}catch{}}),Mn(),he(),W(),qt(),Xn(),Zn("handleRichTextInput"),a&&(o.inputType==="insertText"||o.inputType==="insertCompositionText")){const h=o.data||"";h&&h.length===1&&setTimeout(()=>ko(h),0),(h===" "||h===`
101
- `||/[.,;:!?]/.test(h))&&setTimeout(()=>{Yn()},100)}de.value=!1})},G=()=>{if(!p.value)return;const o=window.getSelection();if(!o||o.rangeCount===0)return;const l=o.getRangeAt(0),a=l.commonAncestorContainer,r=a.nodeType===3?a.parentElement:a;if(!r)return;const c=r.closest(".dss-image-wrapper");if(c){const d=c.querySelector("img");if(r!==d&&!d?.contains(r)){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 v=document.createRange();v.setStartAfter(c),v.collapse(!0),o.removeAllRanges(),o.addRange(v)}}}},Mt=()=>{if(!p.value)return;const o=p.value;if(o.querySelector&&o.querySelector("p"))return;const l=new Set(["P","H1","H2","H3","H4","H5","H6","BLOCKQUOTE","UL","OL","DIV"]),a=Array.from(o.childNodes);let r=null;a.forEach(c=>{if(c.nodeType===Node.TEXT_NODE){if((c.textContent||"").trim()===""){c.parentNode===o&&o.removeChild(c);return}r||(r=document.createElement("p"),o.insertBefore(r,c)),r.appendChild(c);return}if(c.nodeType===Node.ELEMENT_NODE){const d=c,u=d.tagName;if(u==="BR"){r=null;return}if(l.has(u)){r=null;return}r||(r=document.createElement("p"),o.insertBefore(r,d)),r.appendChild(d)}})},he=()=>{if(p.value&&!ze.value){ze.value=!0;try{p.value.querySelectorAll(".dss-image-wrapper").forEach(r=>{r.querySelector("img")||r.remove()}),p.value.querySelectorAll(".dss-image-no-alt-icon").forEach(r=>{const c=r.parentElement;!c||!c.classList.contains("dss-image-wrapper")?r.remove():c.querySelector("img")||r.remove()}),p.value.querySelectorAll("img").forEach(r=>{let c=r.getAttribute("alt");c===null&&(c=r.alt||"");const d=r.getAttribute("src")||r.src||"";if(c){const h=d.replace(/^https?:\/\//,"").replace(/^data:.*,/,""),_=c===d||c===h;(c.startsWith("http://")||c.startsWith("https://")||c.startsWith("data:")||_||_)&&(c="")}r.setAttribute("alt",c),r.setAttribute("data-alt",c);const u=!c||c.trim()==="";let m=r.parentElement;const v=m&&m.classList.contains("dss-image-wrapper");if(v){const h=m.querySelector(".dss-image-no-alt-icon");h&&h.remove()}else{const h=r.nextElementSibling?.classList.contains("dss-image-no-alt-icon")?r.nextElementSibling:null;h&&h.remove()}if(u){v?m.setAttribute("contenteditable","false"):(m=document.createElement("span"),m.className="dss-image-wrapper",m.setAttribute("contenteditable","false"),r.parentNode.insertBefore(m,r),m.appendChild(r));const h=document.createElement("div");h.className="dss-image-no-alt-icon",h.setAttribute("contenteditable","false"),h.innerHTML=pt,m.appendChild(h)}else if(v&&m.children.length===1){const h=m.parentNode;h.insertBefore(r,m),h.removeChild(m)}})}finally{ze.value=!1}}},Hl=o=>{Yn(),Le("blur",o),ol()},w=()=>{if(k.disabled||!k.richText||!p.value)return;At(),xe.value&&(clearTimeout(xe.value),xe.value=null),Ue.value&&(Se(),Ue.value=!1);const o=U.value==="title",l=U.value==="description",a=U.value==="editor";if(qe.value.length===0){o&&V.value?V.value.focus():l&&P.value?P.value.focus():p.value.focus(),document.execCommand("undo",!1),e.nextTick(()=>{Be()});return}const r={content:p.value.innerHTML,title:k.title||"",description:k.description||""};dt.value.push(r);const c=qe.value.pop();if(c!==void 0){de.value=!0;const d=typeof c=="string"?c:c.content,u=typeof c=="object"&&c.title||"",m=typeof c=="object"&&c.description||"";p.value.innerHTML=d,X.value=d,j.value=u,ie.value=m,Z.value=d,E.value=u,C.value=m,e.nextTick(()=>{Mn(),Vn(),Nn(),qt();const v=xn(d);Le("update:modelValue",v),Le("update:title",u),Le("update:description",m),Le("change",v),Le("title-change",u),Le("description-change",m),de.value=!1,e.nextTick(()=>{setTimeout(()=>{if(o){if(V.value){V.value.focus();const h=u.length;V.value.setSelectionRange&&V.value.setSelectionRange(h,h),gn()}}else if(l){if(P.value){P.value.focus();const h=m.length;P.value.setSelectionRange(h,h)}}else if(a)rn();else if(V.value&&document.activeElement===V.value){const h=u.length;V.value.setSelectionRange&&V.value.setSelectionRange(h,h),gn()}else if(P.value&&document.activeElement===P.value){const h=m.length;P.value.setSelectionRange(h,h)}else p.value&&rn()},10)})})}},y=()=>{if(k.disabled||!k.richText||!p.value)return;At();const o=U.value==="title",l=U.value==="description",a=U.value==="editor";if(dt.value.length===0){o&&V.value?V.value.focus():l&&P.value?P.value.focus():p.value.focus(),document.execCommand("redo",!1),e.nextTick(()=>{Be()});return}const r={content:p.value.innerHTML,title:k.title||"",description:k.description||""};qe.value.push(r);const c=dt.value.pop();if(c!==void 0){de.value=!0;const d=typeof c=="string"?c:c.content,u=typeof c=="object"&&c.title||"",m=typeof c=="object"&&c.description||"";p.value.innerHTML=d,X.value=d,j.value=u,ie.value=m,Z.value=d,E.value=u,C.value=m,e.nextTick(()=>{Mn(),Vn(),Nn(),qt();const v=xn(d);Le("update:modelValue",v),Le("update:title",u),Le("update:description",m),Le("change",v),Le("title-change",u),Le("description-change",m),de.value=!1,e.nextTick(()=>{setTimeout(()=>{if(o){if(V.value){V.value.focus();const h=u.length;V.value.setSelectionRange&&V.value.setSelectionRange(h,h),gn()}}else if(l){if(P.value){P.value.focus();const h=m.length;P.value.setSelectionRange(h,h)}}else if(a)rn();else if(V.value&&document.activeElement===V.value){const h=u.length;V.value.setSelectionRange&&V.value.setSelectionRange(h,h),gn()}else if(P.value&&document.activeElement===P.value){const h=m.length;P.value.setSelectionRange(h,h)}else p.value&&rn()},10)})})}},B=()=>{if(!p.value)return;p.value.querySelectorAll('span[style*="font-weight"]').forEach(r=>{const c=r.style.fontWeight;if(c==="normal"||c==="400"){const d=document.createDocumentFragment();for(;r.firstChild;)d.appendChild(r.firstChild);r.parentNode&&r.parentNode.replaceChild(d,r)}}),p.value.querySelectorAll('span[style*="font-weight"]').forEach(r=>{if(parseInt(r.style.fontWeight)>=600){const d=document.createElement("b");for(d.style.fontWeight="600";r.firstChild;)d.appendChild(r.firstChild);r.parentNode&&r.parentNode.replaceChild(d,r)}}),p.value.querySelectorAll("b, strong").forEach(r=>{r.style.fontWeight="600"})},W=()=>{if(!p.value)return;p.value.querySelectorAll("i, em").forEach(l=>{l.style.fontStyle="italic"})},ae=()=>{const o=window.getSelection();if(!o||o.rangeCount===0)return!1;const l=o.getRangeAt(0);let a=!1;if(l.collapsed){const r=l.startContainer;let c=r.nodeType===3?r.parentElement:r;for(;c&&c!==p.value;){if(c.tagName==="EM"||c.tagName==="I"){a=!0;break}if(c.style&&c.style.fontStyle==="italic"){a=!0;break}c=c.parentElement}}else{const r=l.commonAncestorContainer.nodeType===1?l.commonAncestorContainer:l.commonAncestorContainer.parentNode;if(r){const c=document.createTreeWalker(r,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!==p.value;){if(u.tagName==="EM"||u.tagName==="I"){a=!0;break}if(u.style&&u.style.fontStyle==="italic"){a=!0;break}u=u.parentElement}}else if(d.nodeType===1){const u=d;if(u.tagName==="EM"||u.tagName==="I"){a=!0;break}if(u.style&&u.style.fontStyle==="italic"){a=!0;break}}if(a)break}}}if(a)return document.execCommand("italic",!1),e.nextTick(()=>{W()}),!1;if(l.collapsed)document.execCommand("italic",!1),e.nextTick(()=>{W()});else try{const r=l.extractContents(),c=document.createElement("em");c.style.fontStyle="italic",c.appendChild(r),l.insertNode(c),l.setStartAfter(c),l.collapse(!0),o.removeAllRanges(),o.addRange(l),e.nextTick(()=>{W()})}catch{document.execCommand("italic",!1),e.nextTick(()=>{W()})}return!0},mt=()=>{const o=window.getSelection();if(!o||o.rangeCount===0)return!1;const l=o.getRangeAt(0);let a=!1;if(l.collapsed){const r=l.startContainer;let c=r.nodeType===3?r.parentElement:r;for(;c&&c!==p.value;){if(c.tagName==="STRONG"||c.tagName==="B"){a=!0;break}if(c.style&&parseInt(c.style.fontWeight)>=600){a=!0;break}c=c.parentElement}}else{const r=l.commonAncestorContainer.nodeType===1?l.commonAncestorContainer:l.commonAncestorContainer.parentNode;if(r){const c=document.createTreeWalker(r,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!==p.value;){if(u.tagName==="STRONG"||u.tagName==="B"){a=!0;break}if(u.style&&parseInt(u.style.fontWeight)>=600){a=!0;break}u=u.parentElement}}else if(d.nodeType===1){const u=d;if(u.tagName==="STRONG"||u.tagName==="B"){a=!0;break}if(u.style&&parseInt(u.style.fontWeight)>=600){a=!0;break}}if(a)break}}}if(a)return document.execCommand("bold",!1),e.nextTick(()=>{B()}),!1;if(l.collapsed)document.execCommand("bold",!1),e.nextTick(()=>{const r=window.getSelection();if(r.rangeCount>0){const c=r.getRangeAt(0),d=c.startContainer;let u=d.nodeType===3?d.parentElement:d;for(;u&&u!==p.value;){if(u.tagName==="SPAN"&&u.style.fontWeight){const m=u.style.fontWeight;if(m==="normal"||m==="400"){const v=document.createElement("b");v.style.fontWeight="600";const h=document.createDocumentFragment();for(;u.firstChild;)h.appendChild(u.firstChild);v.appendChild(h),u.parentNode&&u.parentNode.replaceChild(v,u),c.setStart(v,0),c.collapse(!0),r.removeAllRanges(),r.addRange(c);break}}else if(u.tagName==="STRONG"||u.tagName==="B"){u.style.fontWeight="600";break}u=u.parentElement}if(!u||u===p.value){const m=document.createElement("b");m.style.fontWeight="600",m.innerHTML="<br>",c.insertNode(m),c.setStart(m,0),c.collapse(!0),r.removeAllRanges(),r.addRange(c)}}B()});else try{const r=l.extractContents(),c=document.createElement("b");c.style.fontWeight="600",c.appendChild(r),l.insertNode(c),l.setStartAfter(c),l.collapse(!0),o.removeAllRanges(),o.addRange(l),e.nextTick(()=>{B()})}catch{document.execCommand("bold",!1),e.nextTick(()=>{B()})}return!0},ot=(o,l=null)=>{if(k.disabled||!k.richText||!p.value)return;Ue.value?(xe.value&&(clearTimeout(xe.value),xe.value=null),Se(),Ue.value=!1):Se(),At(),p.value.focus();const a=window.getSelection();let r=null;if(a&&a.rangeCount>0){const d=a.getRangeAt(0);!d.collapsed&&Qn(d)&&(r=yn())}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 v=document.createTextNode(l);u.insertNode(v),u.selectNodeContents(v)}}}if(o==="bold"){const d=mt();Ze.value.bold=d;const u=window.getSelection();u.rangeCount>0&&u.getRangeAt(0).collapsed&&(Ge.value={command:"bold",state:d}),e.nextTick(()=>{r&&(et(r),e.nextTick(()=>{const m=Ht("bold");Ze.value.bold=m})),Be(),Vn(),qt()});return}if(o==="italic"){const d=ae();Ze.value.italic=d;const u=window.getSelection();u.rangeCount>0&&u.getRangeAt(0).collapsed&&(Ge.value={command:"italic",state:d}),e.nextTick(()=>{r&&(et(r),e.nextTick(()=>{const m=Ht("italic");Ze.value.italic=m})),Be(),W(),Vn(),qt()});return}let c=!1;try{c=document.execCommand(o,!1,l)}catch{}e.nextTick(()=>{if(r&&et(r),["bold","italic","underline"].includes(o))try{if(o==="bold")r&&e.nextTick(()=>{const u=Ht("bold");Ze.value.bold=u});else if(o==="italic")if(r)e.nextTick(()=>{const u=Ht("italic");Ze.value.italic=u});else{const u=document.queryCommandState(o);Ze.value[o]=u}else{const u=document.queryCommandState(o);Ze.value[o]=u}}catch{Ze.value.hasOwnProperty(o)?Ze.value[o]=!Ze.value[o]:Ze.value[o]=!0}if(o==="createLink"&&l){const u=window.getSelection();if(u.rangeCount>0){const v=u.getRangeAt(0),h=v.commonAncestorContainer.nodeType===1?v.commonAncestorContainer.closest("a"):v.commonAncestorContainer.parentElement?.closest("a");h&&(!h.getAttribute("href")||h.getAttribute("href")==="")&&h.setAttribute("href",l)}p.value.querySelectorAll("a").forEach(v=>{const h=v.getAttribute("href");(!h||h===""||h==="#")&&v.setAttribute("href",l)})}Be(),Vn(),qt()})},Ht=(o,l=null)=>{if(k.disabled||!p.value)return!1;try{if(o==="formatBlock"&&l){const r=document.queryCommandValue("formatBlock");if(l==="<blockquote>"){const c=r.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 r===l||r.toLowerCase()===l.toLowerCase()}if(["bold","italic","underline"].includes(o))try{const r=window.getSelection();if(r.rangeCount>0){const c=r.getRangeAt(0);if(o==="bold"){let u=!1;if(c.collapsed){const m=c.commonAncestorContainer,v=m.nodeType===3?m.parentElement:m;if(v&&((v.tagName==="STRONG"||v.tagName==="B"||v.closest&&v.closest("strong, b"))&&(u=!0),!u&&v.style&&parseInt(v.style.fontWeight)>=600&&(u=!0),!u))try{const h=window.getComputedStyle(v);parseInt(h.fontWeight)>=600&&(u=!0)}catch{}return Ze.value.hasOwnProperty(o)?Ze.value[o]:(Ze.value[o]=u,u)}else{const m=c.commonAncestorContainer.nodeType===1?c.commonAncestorContainer:c.commonAncestorContainer.parentNode;let v=!1;if(m){const h=document.createTreeWalker(m,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let _;for(;_=h.nextNode();)if(!(typeof c.intersectsNode=="function"&&!c.intersectsNode(_))){if(_.nodeType===3){if(!(_.textContent||"").trim())continue;v=!0;let N=_.parentElement;for(;N&&N!==p.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(_.nodeType===1){const $=_;if($.tagName==="STRONG"||$.tagName==="B"){u=!0;break}if($.style&&parseInt($.style.fontWeight)>=600){u=!0;break}}if(u)break}}return Ze.value[o]=u&&v,u&&v}}if(o==="italic"){let u=!1;if(c.collapsed){const m=c.commonAncestorContainer,v=m.nodeType===3?m.parentElement:m;if(v&&((v.tagName==="EM"||v.tagName==="I"||v.closest&&v.closest("em, i"))&&(u=!0),!u&&v.style&&v.style.fontStyle==="italic"&&(u=!0),!u))try{window.getComputedStyle(v).fontStyle==="italic"&&(u=!0)}catch{}return Ze.value.hasOwnProperty(o)?Ze.value[o]:(Ze.value[o]=u,u)}else{const m=c.commonAncestorContainer.nodeType===1?c.commonAncestorContainer:c.commonAncestorContainer.parentNode;let v=!1;if(m){const h=document.createTreeWalker(m,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let _;for(;_=h.nextNode();)if(!(typeof c.intersectsNode=="function"&&!c.intersectsNode(_))){if(_.nodeType===3){if(!(_.textContent||"").trim())continue;v=!0;let N=_.parentElement;for(;N&&N!==p.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(_.nodeType===1){const $=_;if($.tagName==="EM"||$.tagName==="I"){u=!0;break}if($.style&&$.style.fontStyle==="italic"){u=!0;break}}if(u)break}}return Ze.value[o]=u&&v,u&&v}}const d=document.queryCommandState(o);return c.collapsed&&Ze.value.hasOwnProperty(o)?Ze.value[o]:(Ze.value[o]=d,d)}return Ze.value.hasOwnProperty(o)?Ze.value[o]:!1}catch{return Ze.value.hasOwnProperty(o)?Ze.value[o]:!1}try{return document.queryCommandState(o)}catch{return!1}}catch{return!1}},It=o=>{k.disabled||!k.richText||(ue.value=ue.value===o?null:o,o==="askAi"&&(at.value=null))},At=()=>{ue.value=null,We.value=null},En=o=>{ot("formatBlock",o),At()},Wl=o=>{if(!o||!p.value)return o;const l=Te=>{let me=Te.nodeType===Node.TEXT_NODE?Te.parentElement:Te;for(;me&&me!==p.value;){const ct=me.tagName;if(ct==="P"){const Qt=me.parentElement;if(Qt===p.value||Qt.tagName==="BLOCKQUOTE")return me}if(ct==="BLOCKQUOTE")break;me=me.parentElement}return null},a=l(o.startContainer),r=l(o.endContainer);if(!a||!r)return o;const c=[],d=document.createTreeWalker(p.value,NodeFilter.SHOW_ELEMENT,{acceptNode:Te=>{const me=Te.tagName;if(me==="P"){const ct=Te.parentElement;if(ct===p.value||ct.tagName==="BLOCKQUOTE")return NodeFilter.FILTER_ACCEPT}return me==="BLOCKQUOTE"?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_SKIP}});let u;for(;u=d.nextNode();)c.push(u);const m=c.indexOf(a),v=c.indexOf(r);if(m===-1||v===-1)return o;const h=Math.min(m,v),_=Math.max(m,v),$=c.slice(h,_+1);if($.length===0)return o;const N=$[0],Q=$[$.length-1],Y=document.createRange();return Y.setStartBefore(N),Y.setEndAfter(Q),Y},ro=()=>{if(k.disabled||!k.richText||!p.value)return;Ue.value?(xe.value&&(clearTimeout(xe.value),xe.value=null),Se(),Ue.value=!1):Se(),At(),p.value.focus();const o=window.getSelection();if(o.rangeCount===0)return;let l=o.getRangeAt(0);!l.collapsed&&Qn(l)&&(l=Wl(l),o.removeAllRanges(),o.addRange(l));let a=null;!l.collapsed&&Qn(l)&&(a=yn());const r=l.commonAncestorContainer,c=r.nodeType===1?r.tagName==="BLOCKQUOTE"?r:r.closest("blockquote"):r.parentElement?.closest("blockquote");if(!!(c&&p.value.contains(c))){if(c){const u=c.parentNode;Array.from(c.childNodes).forEach(v=>{if(v.nodeType===Node.ELEMENT_NODE)if(v.tagName==="P"||v.tagName==="DIV")u.insertBefore(v,c);else{const h=document.createElement("p");h.appendChild(v.cloneNode(!0)),u.insertBefore(h,c)}else if(v.nodeType===Node.TEXT_NODE&&v.textContent.trim()){const h=document.createElement("p");h.appendChild(v.cloneNode(!0)),u.insertBefore(h,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 v=[],h=document.createTreeWalker(u,NodeFilter.SHOW_TEXT,{acceptNode:N=>N.parentNode===u&&N.textContent.trim()?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});let _;for(;_=h.nextNode();)v.push(_);if(v.forEach(N=>{const Q=document.createElement("p");N.parentNode.insertBefore(Q,N),Q.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(()=>{a&&et(a),Nn(),Be(),qt()})},io=()=>{if(!p.value)return;const o=window.getSelection();if(o.rangeCount===0)return;const a=o.getRangeAt(0).commonAncestorContainer,r=a.nodeType===1?a.tagName==="BLOCKQUOTE"?a:a.closest("blockquote"):a.parentElement?.closest("blockquote");if(!r||!p.value.contains(r))return;const c=_=>{if(!_)return!1;const $=_.textContent||"",Q=(_.innerHTML||"").trim();return $.trim()===""||Q===""||Q==="<br>"||Q==="<br/>"||Q==="<p></p>"||Q==="<p><br></p>"||Q==="<p><br/></p>"||Q==="<p> </p>"||Q==="<p><br> </p>"||Q==="<div></div>"||Q==="<div><br></div>"||Q==="<div><br/></div>"};let d=null;for(a.nodeType===3?d=a.parentElement:a.tagName==="P"||a.tagName==="DIV"?d=a:d=a.closest("p, div"),d&&r.contains(d)&&c(d)&&d.remove();r.lastChild;){const _=r.lastChild;if(_.nodeType===1&&_.tagName==="BR")_.remove();else if(_.nodeType===3)if((_.textContent||"").trim()==="")_.remove();else break;else break}if(r.children.length>0)for(let _=r.children.length-1;_>=0;_--){const $=r.children[_];if(($.tagName==="P"||$.tagName==="DIV")&&c($))$.remove();else break}let u=r.innerHTML;const m=u;u=u.replace(/(<br\s*\/?>)+$/gi,""),u!==m&&(r.innerHTML=u);const v=document.createElement("p");v.innerHTML="<br>",r.parentNode?r.nextSibling?r.parentNode.insertBefore(v,r.nextSibling):r.parentNode.appendChild(v):p.value&&p.value.appendChild(v);const h=document.createRange();h.selectNodeContents(v),h.collapse(!0),o.removeAllRanges(),o.addRange(h),e.nextTick(()=>{Nn(),Be()})},Vn=()=>{if(!p.value){ve.value=!1;return}try{const o=window.getSelection();if(o.rangeCount>0){const a=o.getRangeAt(0).commonAncestorContainer,r=a.nodeType===1?a.closest("a"):a.parentElement?.closest("a");ve.value=!!r}else ve.value=!1}catch{ve.value=!1}},co=()=>{if(!p.value)return;const o=window.getSelection();o&&o.rangeCount>0&&o.getRangeAt(0),xt.value=yn();const l=window.getSelection();let a="";l.rangeCount>0&&(a=l.getRangeAt(0).toString()),Ie.value="",O.value=a,Tt.value="",we.value=null,Ae.value=!0,At(),e.nextTick(()=>{rt.value&&rt.value.focus()})},ql=()=>{if(!p.value)return;Ue.value?(xe.value&&(clearTimeout(xe.value),xe.value=null),Se(),Ue.value=!1):Se();const o=window.getSelection();let l=null;if(o.rangeCount>0){const r=o.getRangeAt(0).commonAncestorContainer;l=r.nodeType===1?r.closest("a"):r.parentElement?.closest("a")}if(!l&&we.value&&(l=we.value),l&&l.parentNode){const a=document.createDocumentFragment();for(;l.firstChild;)a.appendChild(l.firstChild);if(l.parentNode.replaceChild(a,l),a.firstChild){const r=document.createRange();r.setStartBefore(a.firstChild),r.setEndAfter(a.lastChild||a.firstChild),o.removeAllRanges(),o.addRange(r),document.execCommand("removeFormat",!1),r.collapse(!1),o.removeAllRanges(),o.addRange(r)}we.value=null}else ot("unlink");ve.value=!1,At(),e.nextTick(()=>{Be(),Vn()})},uo=()=>{k.disabled||!k.richText||p.value&&(Ue.value?(xe.value&&(clearTimeout(xe.value),xe.value=null),Se(),Ue.value=!1):Se(),At(),p.value.focus(),document.execCommand("insertUnorderedList",!1),e.nextTick(()=>{Mn(),Be(),qt()}))},el=()=>{k.disabled||!k.richText||p.value&&(Ue.value?(xe.value&&(clearTimeout(xe.value),xe.value=null),Se(),Ue.value=!1):Se(),At(),p.value.focus(),document.execCommand("insertOrderedList",!1),e.nextTick(()=>{Mn(),Be(),qt()}))},mo=o=>{const l=o.parentElement;if(!l||l.tagName!=="OL")return null;let a=0,r=o.previousElementSibling;for(;r;)r.tagName==="LI"&&a++,r=r.previousElementSibling;return a+1},Mn=()=>{if(!p.value)return;p.value.querySelectorAll("li > ol").forEach(l=>{const a=l.parentElement;if(a&&a.tagName==="LI"){const r=mo(a);r!==null&&Array.from(l.children).filter(d=>d.tagName==="LI").forEach(d=>{d.setAttribute("data-parent-num",String(r))})}})},po=()=>{if(k.disabled||!k.richText||!p.value)return;At(),p.value.focus();const o=window.getSelection();if(o.rangeCount===0)return;const l=o.getRangeAt(0),a=l.commonAncestorContainer.nodeType===1?l.commonAncestorContainer.closest("li"):l.commonAncestorContainer.parentElement?.closest("li");if(!a){document.execCommand("indent",!1),e.nextTick(()=>{Mn(),Be()});return}const r=a.parentElement;if(!r||r.tagName!=="OL"&&r.tagName!=="UL")return;const c=a.previousElementSibling;if(c&&c.tagName==="LI"){const d=r.tagName.toLowerCase();let u=c.querySelector(`:scope > ${d}`);u||(u=document.createElement(d),c.appendChild(u));const m=mo(c);u.appendChild(a),m!==null&&r.tagName==="OL"&&a.setAttribute("data-parent-num",String(m)),Mn();const v=document.createRange();v.selectNodeContents(a),v.collapse(!1),o.removeAllRanges(),o.addRange(v),e.nextTick(()=>{Be(),qt()})}else document.execCommand("indent",!1),e.nextTick(()=>{Mn(),Be(),qt()})},fo=()=>{if(k.disabled||!k.richText||!p.value)return;At(),p.value.focus();const o=window.getSelection();if(o.rangeCount===0)return;const l=o.getRangeAt(0),a=l.commonAncestorContainer.nodeType===1?l.commonAncestorContainer.closest("li"):l.commonAncestorContainer.parentElement?.closest("li");if(!a){document.execCommand("outdent",!1),e.nextTick(()=>{Mn(),Be()});return}const r=a.parentElement;if(!r||r.tagName!=="OL"&&r.tagName!=="UL")return;const c=r.parentElement;if(c&&c.tagName==="LI"){const d=c.parentElement;if(d&&(d.tagName==="OL"||d.tagName==="UL")){r.tagName==="OL"&&a.removeAttribute("data-parent-num"),d.insertBefore(a,c.nextSibling),r.children.length===0&&r.remove(),Mn();const u=document.createRange();u.selectNodeContents(a),u.collapse(!1),o.removeAllRanges(),o.addRange(u),e.nextTick(()=>{Be(),qt()});return}}document.execCommand("outdent",!1),e.nextTick(()=>{Mn(),Be(),qt()})},mn=e.ref(null),Pn=e.ref(null),ml=e.ref({}),Cn=e.ref(""),Gn=e.ref(null),tl=e.ref("");e.ref("");const nl=e.ref(null);e.ref("");const _n=e.ref([]),Ul=e.ref(!1),Bl=e.ref(!1),Eo=o=>{if(!o)return"";const l=o.cloneRange(),a=document.createElement("div");return a.appendChild(l.cloneContents()),a.innerHTML},Xl=()=>{if(k.disabled||!k.richText||!p.value)return;if(mn.value!==null){mn.value=null,Cn.value="",tl.value="",nl.value=null,_n.value=[],vl(!0);return}At(),p.value.focus();const o=window.getSelection();if(!o||o.rangeCount===0)return;const l=o.getRangeAt(0);if(l.collapsed||!Qn(l))return;tl.value=Eo(l)||"",nl.value=yn();const a=l.getBoundingClientRect(),r=p.value.parentElement;if(!r)return;const c=r.getBoundingClientRect(),d=a.bottom-c.top,m=Math.max(d+8,0);ml.value={top:`${m}px`,bottom:"auto"},mn.value=Date.now(),e.nextTick(()=>{if(Cn.value="",Gn.value){const h=Gn.value;h.style.height="auto",h.style.height=`${h.scrollHeight}px`,h.focus()}const v=r.querySelector(".dss-comment-overlay");if(v&&r){const h=r.querySelector(".dss-text-editor-footer");if(h){const _=r.getBoundingClientRect(),$=v.getBoundingClientRect(),N=h.getBoundingClientRect(),Q=$.bottom-_.top,Y=N.top-_.top,Te=8;if(Q>Y-Te){const me=N.height;ml.value={bottom:`${me+Te}px`,top:"auto"}}else ml.value={top:`${m}px`,bottom:"auto"}}}})},Al=()=>{if(!Cn.value.trim())return;const o=Cn.value.trim(),l=new Date,a={text:o,selectionText:tl.value,selectionRange:nl.value,commentId:mn.value,user:k.commentUser||null,createdAt:l.toISOString()};_n.value=[..._n.value,a],Le("comment-submitted",a),No(a),nl.value&&!Vo(nl.value)&&Yl(mn.value,nl.value),Cn.value="",e.nextTick(()=>{if(Gn.value){const r=Gn.value;r.style.height="auto",r.style.height=`${r.scrollHeight}px`,r.focus()}Zn("sendComment")})},vo=(o,l)=>{if(!(!k.commentUser||!o.user||o.user.id!==k.commentUser.id)){if(_n.value=_n.value.filter((a,r)=>r!==l),mn.value!==null&&p.value){const a=String(mn.value),r=p.value.querySelector(`[data-comment="${a}"], [data-fake-comment="${a}"]`);if(r&&_n.value.length>0){const c=[],d=new Set;_n.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?r.setAttribute("data-comment-user",JSON.stringify(c[0])):r.removeAttribute("data-comment-user"),c.length>1?r.setAttribute("data-comment-user-2",JSON.stringify(c[1])):r.removeAttribute("data-comment-user-2"),r.setAttribute("data-comment-count",String(_n.value.length))}else r&&_n.value.length===0&&(r.removeAttribute("data-comment-user"),r.removeAttribute("data-comment-user-2"),r.setAttribute("data-comment-count","0"))}if(Le("comment-deleted",{comment:o,index:l,commentId:mn.value}),k.comments&&Array.isArray(k.comments)){const a=k.comments.filter(r=>!(r.commentId===o.commentId&&r.text===o.text&&r.user?.id===o.user?.id));Le("update:comments",a)}e.nextTick(()=>{Zn("deleteComment")})}},Vo=o=>{if(!o||!p.value)return!1;try{const l=go(o);if(!l)return!1;const a=l.commonAncestorContainer,r=a.nodeType===3?a.parentElement:a;if(r)return!!r.closest("[data-comment], [data-fake-comment]")}catch{}return!1},go=o=>{if(!o||!p.value)return null;try{const l=document.createRange();if(o.type==="element"&&o.element)return p.value.contains(o.element)?(l.setStart(o.element,o.offset),l.collapse(!0),l):null;let a=0;const r=[p.value];let c=null,d=!1,u=!1;for(;!u&&(c=r.pop());)if(c.nodeType===3){const m=a+c.length;!d&&o.start>=a&&o.start<=m&&(l.setStart(c,o.start-a),d=!0),d&&o.end>=a&&o.end<=m&&(l.setEnd(c,o.end-a),u=!0),a=m}else{let m=c.childNodes.length;for(;m--;)r.push(c.childNodes[m])}return d?l:null}catch{return null}},Yl=(o,l)=>{if(!(!o||!l||!p.value))try{const a=go(l);if(!a||a.collapsed)return;const r=a.commonAncestorContainer,c=r.nodeType===3?r.parentElement:r;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=a.startContainer,v=a.endContainer,h=a.startOffset,_=a.endOffset,$=m.nodeType===3?m.parentNode:m,N=v.nodeType===3?v.parentNode:v;if($===N&&h===0&&_===(v.nodeType===3?v.length:N.childNodes.length)&&($.tagName==="P"||$.tagName==="DIV"||$.tagName==="H1"||$.tagName==="H2"||$.tagName==="H3"||$.tagName==="H4"||$.tagName==="H5"||$.tagName==="H6")){const Y=a.extractContents();d.appendChild(Y),a.insertNode(d)}else a.surroundContents(d)}catch{const v=a.extractContents();d.appendChild(v),a.insertNode(d)}const u=p.value.querySelector(`[data-comment="${String(o)}"]`);e.nextTick(()=>{Zn("wrapSelectionWithCommentMarker"),Be()})}catch{}},No=o=>{if(!o||!o.commentId)return;const l=Array.isArray(k.comments)?[...k.comments]:[],a=typeof o.commentId=="string"&&o.commentId.startsWith("comment-")?Date.now():Number(o.commentId)||o.commentId;let r=l.findIndex(d=>typeof d.conversation_id=="string"&&d.conversation_id.startsWith("comment-")?null:Number(d.conversation_id)===Number(a)||d.conversation_id===a);const c={text:o.text,user:o.user,createdAt:o.createdAt,created_at:o.createdAt,updated_at:o.createdAt};if(r>=0){const d=l[r];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(v=>v.article_id)?.article_id||null,m={conversation_id:a,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)}Ul.value=!0,Le("update:comments",l)},jl=(o,l=[])=>{if(k.disabled||!k.richText||!p.value)return;const a=p.value;let r=null;try{r=a.querySelector(o)}catch{return}if(!r)return;At(),a.focus();const c=document.createRange();c.selectNodeContents(r);const d=window.getSelection();d&&(d.removeAllRanges(),d.addRange(c)),tl.value=r.innerHTML||"",nl.value=yn();const u=c.getBoundingClientRect(),m=a.parentElement;if(m){const _=m.getBoundingClientRect(),$=u.bottom-_.top,Q=Math.max($+8,0);ml.value={top:`${Q}px`,bottom:"auto"}}const v=r.getAttribute("data-comment")||r.getAttribute("data-fake-comment");let h=[];if(v&&k.comments&&Array.isArray(k.comments)){const _=k.comments.find($=>String($.conversation_id)===String(v));if(_&&_.conversation&&Array.isArray(_.conversation)){const $=_.conversation.map(N=>({id:N.id||N.commentary_id,commentary_id:N.id||N.commentary_id,conversation_id:_.id||_.conversation_id,text:N.text,user:N.user,createdAt:N.created_at||N.createdAt,updated_at:N.updated_at||N.updatedAt}));h.push(...$)}}h.length===0&&Array.isArray(l)&&l.length>0&&(h=l.slice()),h.sort((_,$)=>{const N=Te=>{if(!Te)return 0;const me=new Date(Te).getTime();return isNaN(me)?0:me},Q=N(_.createdAt),Y=N($.createdAt);return Q===Y?0:Q-Y}),_n.value=h,vl(!0),mn.value=v||null,r&&(Pn.value=r,r.classList.add("editor-comment-highlighted")),e.nextTick(()=>{if(Cn.value="",Gn.value){const _=Gn.value;_.style.height="auto",_.style.height=`${_.scrollHeight}px`,_.focus()}if(m){const _=m.querySelector(".dss-comment-overlay");if(_){const $=m.querySelector(".dss-text-editor-footer");if($){const N=m.getBoundingClientRect(),Q=_.getBoundingClientRect(),Y=$.getBoundingClientRect(),Te=Q.bottom-N.top,me=Y.top-N.top,ct=8;if(Te>me-ct){const Qt=Y.height;ml.value={bottom:`${Qt+ct}px`,top:"auto"}}}}}Zn("openCommentOverlayForSelector")})},pn=e.ref(null),I=e.ref(0),fn=o=>{if(!(k.disabled||!k.richText)){if(o.key==="Escape"){const l=window.getSelection();if(l.rangeCount>0){const r=l.getRangeAt(0).commonAncestorContainer,c=r.nodeType===1?r.tagName==="BLOCKQUOTE"?r:r.closest("blockquote"):r.parentElement?.closest("blockquote");if(!!(c&&p.value&&p.value.contains(c))){o.preventDefault();let u=null;r.nodeType===3?u=r.parentElement:r.tagName==="P"||r.tagName==="DIV"?u=r:u=r.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(()=>{io()},50);return}}}if(o.key.length===1||o.key==="Enter"){const l=window.getSelection();if(l&&l.rangeCount>0){const a=l.getRangeAt(0),r=a.commonAncestorContainer,c=r.nodeType===3?r.parentElement:r;if(c){const d=c.closest(".dss-image-wrapper");if(d){const u=d.querySelector("img");if(c!==u&&!u?.contains(c)){const m=a.startContainer.nodeType===3?a.startContainer.parentElement:a.startContainer,v=a.endContainer.nodeType===3?a.endContainer.parentElement:a.endContainer;if(d.contains(m)&&m!==u||d.contains(v)&&v!==u){o.preventDefault();const h=document.createRange();h.setStartAfter(d),h.collapse(!0),l.removeAllRanges(),l.addRange(h);return}}}}}}if(o.key==="Backspace"||o.key==="Delete"){const l=window.getSelection();if(l.rangeCount>0){const a=l.getRangeAt(0);let r=null,c=null;if(a.collapsed)if(o.key==="Backspace"){const d=a.startContainer;let u=d;d.nodeType===3&&(a.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"&&(r=m,c=r.closest(".dss-image-wrapper"))),c||(c=u.closest(".dss-image-wrapper"),c&&(r=c.querySelector("img")))}else{const d=a.startContainer;let u=d;d.nodeType===3&&(a.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"&&(r=m,c=r.closest(".dss-image-wrapper"))),c||(c=u.closest(".dss-image-wrapper"),c&&(r=c.querySelector("img")))}else{const d=a.commonAncestorContainer,u=a.startContainer.nodeType===3?a.startContainer.parentElement:a.startContainer,m=a.endContainer.nodeType===3?a.endContainer.parentElement:a.endContainer;if(d.nodeType===1&&d.tagName==="IMG"?(r=d,c=r.closest(".dss-image-wrapper")):(r=d.querySelector("img"),r&&(c=r.closest(".dss-image-wrapper"))),c){const v=c.contains(u)||u===c,h=c.contains(m)||m===c,$=a.cloneContents().textContent?.trim()||"",N=c.textContent?.trim()||"";(!v||!h||$.length>N.length)&&(c=null,r=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(()=>{Be()});return}}}}if(o.key==="Tab"){o.preventDefault(),o.shiftKey?fo():po();return}if(o.key==="Enter"){const l=window.getSelection();if(l.rangeCount>0){const a=l.getRangeAt(0);if(a.collapsed){const u=a.startContainer,m=v=>{if(!v)return!1;let h=v.previousSibling;for(;h;){if(h.classList&&h.classList.contains("dss-image-wrapper")||h.tagName==="IMG"||h.querySelector&&h.querySelector(".dss-image-wrapper")||h.querySelector&&h.querySelector("img"))return!0;h=h.previousSibling}const _=v.parentElement;return _&&_!==p.value?m(_):!1};if(u.nodeType===3){const v=u.parentElement;if(v&&(m(v)||m(u))){const h=v.closest("p, div");if(h&&h!==p.value){o.preventDefault(),o.stopPropagation();let _=null;const $=a.startOffset;$<u.length&&(_=u.splitText($));const N=document.createElement("p");if(_?N.appendChild(_):N.innerHTML="<br>",u.length===0){const Y=u.parentElement;Y&&(Y.removeChild(u),Y.childNodes.length===0&&Y.appendChild(document.createElement("br")))}h.nextSibling?h.parentNode.insertBefore(N,h.nextSibling):h.parentNode.appendChild(N);const Q=document.createRange();_?Q.setStart(_,0):Q.setStart(N,0),Q.collapse(!0),l.removeAllRanges(),l.addRange(Q),e.nextTick(()=>{Be()});return}}}}const r=a.commonAncestorContainer,c=r.nodeType===1?r.tagName==="BLOCKQUOTE"?r:r.closest("blockquote"):r.parentElement?.closest("blockquote");if(!!(c&&p.value&&p.value.contains(c))){let u=null;r.nodeType===3?u=r.parentElement:r.tagName==="P"||r.tagName==="DIV"?u=r:u=r.closest("p, div");const m=Y=>{if(!Y)return!1;const Te=Y.textContent||"",ct=(Y.innerHTML||"").trim(),Qt=ct.replace(/<br\s*\/?>/gi,"").trim();return Te.trim()===""||ct===""||Qt===""||ct==="<br>"||ct==="<br/>"||ct==="<p></p>"||ct==="<p><br></p>"||ct==="<p><br/></p>"||ct==="<p> </p>"||ct==="<p><br> </p>"||ct==="<div></div>"||ct==="<div><br></div>"||ct==="<div><br/></div>"},v=c.lastChild,h=v&&v.nodeType===1&&v.tagName==="BR",_=a.startContainer,$=_.nodeType===3?_.parentElement:_,N=$===c||$&&$.parentElement===c;if(u&&m(u)||h&&N){o.preventDefault(),setTimeout(()=>{io()},50);return}}}}if(o.key===" "){const l=Date.now(),a=l-I.value;if(pn.value===" "&&a<300){const r=window.getSelection();if(r.rangeCount>0){const c=r.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(),po();return}}}}pn.value=" ",I.value=l}else pn.value=o.key}},On=o=>{if(k.disabled||!k.richText)return;o.preventDefault();let l=o.clipboardData.getData("text/html"),a=o.clipboardData.getData("text/plain");l&&(l=l.replace(/<!--[\s\S]*?-->/g,"")),a&&(a=a.replace(/<!--[\s\S]*?-->/g,"")),Se();const r=window.getSelection();let c=null;if(r&&r.rangeCount>0){let m=r.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 v=new DOMParser().parseFromString(u,"text/html");let h=p.value.querySelector("h1")?1:0;if(v.querySelectorAll("h1").forEach($=>{if(h>0){const N=v.createElement("p");N.innerHTML=$.innerHTML,$.parentNode.replaceChild(N,$)}else h++}),c){const $=["P","H1","H2","H3","H4","H5","H6","DIV","BLOCKQUOTE","UL","OL","LI"],N=Array.from(v.body.children).filter(Q=>$.includes(Q.tagName));if(N.length===1){const Q=N[0].tagName,Y=c.tagName,Te=c.textContent.trim()===""&&!c.querySelector("img");let me=!1;if(["H1","H2","H3","H4","H5","H6"].includes(Y)?me=!0:Te||(Q===Y||Q==="P")&&(me=!0),me)return N[0].innerHTML.trim()}}return v.body.innerHTML.trim()};if(l){const u=d(l);document.execCommand("insertHTML",!1,u)}else if(a)if(/<[a-z][\s\S]*>/i.test(a)){const m=d(a);document.execCommand("insertHTML",!1,m)}else document.execCommand("insertText",!1,a);Be()},cn=o=>{if(ue.value){const a=o.target;!a.closest(".dss-toolbar-dropdown")&&!a.closest(".dss-toolbar-dropdown-toggle")&&At()}if(ge.value){const a=o.target,r=a.closest(".dss-floating-toolbar"),c=p.value&&a.closest(".dss-text-editor-content");!r&&!c&&ol()}if(at.value){const a=o.target,r=a.closest(".dss-floating-toolbar"),c=a.closest(".dss-toolbar-dropdown");!r&&!c&&yo()}const l=o.target;if(!l.closest(".dss-toolbar-dropdown")&&!l.closest(".dss-toolbar-dropdown-submenu")&&(We.value=null),!p.value||!l.closest(".dss-text-editor-content")){const a=window.getSelection();if(a&&a.rangeCount>0){const r=a.getRangeAt(0);wt.value=!r.collapsed&&Qn(r)}else wt.value=!1}if(mn.value!==null){const a=document.querySelector(".dss-comment-overlay");let r=!1;if(a){const u=a.getBoundingClientRect(),m=o.clientX,v=o.clientY;r=m>=u.left&&m<=u.right&&v>=u.top&&v<=u.bottom}const c=l.closest(".dss-toolbar-button"),d=c&&c.getAttribute("title")==="Comment";!r&&!d&&(mn.value=null,Cn.value="",tl.value="",nl.value=null,_n.value=[],vl(!0))}},Un=(o,l)=>{o&&o.stopPropagation&&o.stopPropagation(),ft.value&&(clearTimeout(ft.value),ft.value=null),We.value=l},zt=o=>{const l=o.relatedTarget;if(l){const a=l.closest(".dss-toolbar-dropdown-submenu"),r=l.closest(".dss-toolbar-dropdown-item-has-submenu");if(a||r)return}ft.value&&clearTimeout(ft.value),ft.value=setTimeout(()=>{We.value=null,ft.value=null},150)},nn=o=>{We.value=null};let ll=0;const pl=o=>{if(!o)return;const l=Array.from(o.children);l.forEach(a=>{a.classList.contains("dss-toolbar-dropdown-submenu")||a.classList.contains("dss-toolbar-dropdown-item-has-submenu")||(a.tagName==="BUTTON"||a.tagName==="DIV")&&!a.classList.contains("dss-toolbar-dropdown-item")&&a.classList.add("dss-toolbar-dropdown-item")}),l.forEach((a,r)=>{if(a.classList.contains("dss-toolbar-dropdown-item-has-submenu")||a.classList.contains("dss-toolbar-dropdown-submenu")||!a.classList.contains("dss-toolbar-dropdown-item"))return;const c=Array.from(a.children).find(m=>m.tagName==="DIV"?m.classList.contains("dss-toolbar-dropdown-item")?!1:Array.from(m.children).filter(h=>h.tagName==="BUTTON"||h.tagName==="DIV").length>0:!1),d=a.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-${++ll}`;a.classList.add("dss-toolbar-dropdown-item-has-submenu"),a.setAttribute("data-submenu-id",m);let v=null;c?(a.tagName==="BUTTON"&&a.parentNode.insertBefore(c,a.nextSibling),c.classList.add("dss-toolbar-dropdown-submenu"),v=c):u&&(d.classList.add("dss-toolbar-dropdown-submenu"),v=d),v&&(v.setAttribute("data-submenu-id",m),v.setAttribute("data-processed","true"),c&&a.tagName!=="BUTTON"?v.dataset.originalParentRef="inside":v.dataset.originalParentRef="sibling",Array.from(v.children).forEach(_=>{(_.tagName==="BUTTON"||_.tagName==="DIV")&&!_.classList.contains("dss-toolbar-dropdown-item")&&_.classList.add("dss-toolbar-dropdown-item")}))}})},_t=()=>{document.querySelectorAll(".dss-toolbar-dropdown").forEach(l=>{pl(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=v=>{const h=c.getAttribute("data-submenu-id");h&&Un(v,h)},m=zt;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=h=>{const _=c.getAttribute("data-submenu-id");_&&Un(h,_)},m=zt;c.addEventListener("mouseenter",u),c.addEventListener("mouseleave",m),c._subMenuHandlers={enter:u,leave:m},c.querySelectorAll(".dss-toolbar-dropdown-item").forEach(h=>{h.addEventListener("click",nn)})})})};let ht=null;const it=()=>{if(We.value){const o=document.querySelector(`.dss-toolbar-dropdown-submenu[data-submenu-id="${We.value}"]`),l=document.querySelector(`.dss-toolbar-dropdown-item-has-submenu[data-submenu-id="${We.value}"]`);o&&l&&sl(o,l)}if(ge.value&&qt(),k.richText){if(ht!==null)return;ht=setTimeout(()=>{ht=null,Zn("handleWindowResize")},150)}},Rt=()=>{if(!k.richText)return;document.querySelectorAll(".dss-toolbar-custom-group").forEach(l=>{Array.from(l.children).filter(r=>r.tagName==="DIV"&&!r.classList.contains("dss-toolbar-button")).forEach(r=>{r.classList.add("dss-toolbar-button")})})},So=()=>{const o=document.querySelectorAll(".dss-text-editor-footer, .dss-text-editor-footer-content, .dss-text-editor-footer-stat, .dss-text-editor-footer-separator"),l=a=>{if(a.preventDefault(),a.stopPropagation(),window.getSelection){const r=window.getSelection();r.removeAllRanges?r.removeAllRanges():r.empty&&r.empty()}return!1};o.forEach(a=>{a.addEventListener("selectstart",l),a.addEventListener("mousedown",l),a.addEventListener("dragstart",l),a.addEventListener("contextmenu",l),a.addEventListener("click",r=>{if(window.getSelection){const c=window.getSelection();c.removeAllRanges&&c.removeAllRanges()}})})};e.onMounted(()=>{if(e.nextTick(()=>{requestAnimationFrame(()=>{De.value?gn():ul(),re.value?dl():Vt()})}),e.nextTick(()=>{So()}),k.richText&&p.value){try{document.execCommand("defaultParagraphSeparator",!1,"p")}catch{}document.addEventListener("click",cn),window.addEventListener("resize",it);let o=null;const l=()=>{o===null&&(o=setTimeout(()=>{o=null,it()},150))};window.addEventListener("scroll",l,!0),p.value._windowScrollHandler=l,p.value._windowScrollTimeout=o,p.value.closest(".editor-with-comments"),p.value.closest(".dss-text-editor-content-wrapper");const a=p.value.closest(".dss-text-editor-content");let r=null;const c=()=>{r===null&&(r=setTimeout(()=>{r=null,it()},150))};a&&(a.addEventListener("scroll",c),p.value._scrollHandlers={wrapper:null,content:a,handler:c}),e.nextTick(()=>{_t(),Rt()}),p.value.addEventListener("click",m=>{const v=m.target;v.closest("a")&&!k.disabled&&m.preventDefault();const _=v.closest(".dss-image-no-alt-icon"),$=v.closest(".dss-image-wrapper");if(_||$&&v===$){m.preventDefault(),m.stopPropagation();const N=window.getSelection(),Q=document.createRange();Q.setStartAfter($),Q.collapse(!0),N.removeAllRanges(),N.addRange(Q)}else $&&v.tagName!=="IMG"&&(m.preventDefault(),e.nextTick(()=>{const N=window.getSelection();if(N.rangeCount>0){const Y=N.getRangeAt(0).commonAncestorContainer,Te=Y.nodeType===3?Y.parentElement:Y;if($.contains(Te)&&Te!==$.querySelector("img")){const me=document.createRange();me.setStartAfter($),me.collapse(!0),N.removeAllRanges(),N.addRange(me)}}else{const Q=document.createRange();Q.setStartAfter($),Q.collapse(!0),N.addRange(Q)}}))},!0),p.value.addEventListener("mousedown",m=>{const v=m.target,h=v.closest(".dss-image-no-alt-icon"),_=v.closest(".dss-image-wrapper");if(h||_&&v.tagName!=="IMG"){m.preventDefault();const $=window.getSelection(),N=document.createRange();_&&(N.setStartAfter(_),N.collapse(!0),$.removeAllRanges(),$.addRange(N))}},!0),p.value.addEventListener("paste",m=>{e.nextTick(()=>{if(!p.value)return;p.value.querySelectorAll("img").forEach(h=>{if(!h.closest(".dss-image-wrapper"))h.removeAttribute("alt"),h.removeAttribute("data-alt"),h.setAttribute("alt",""),h.setAttribute("data-alt",""),h.alt="";else{const $=h.getAttribute("alt")||h.alt||"";if($){const N=h.getAttribute("src")||h.src||"",Q=N.replace(/^https?:\/\//,"").replace(/^data:.*,/,""),Y=$===N||$===Q;($.startsWith("http://")||$.startsWith("https://")||$.startsWith("data:")||Y||Y)&&(h.setAttribute("alt",""),h.setAttribute("data-alt",""),h.alt="")}}}),he()})}),p.value.addEventListener("dragstart",m=>{const v=m.target,h=v.tagName==="IMG"?v:v.closest("img"),_=h?.closest(".dss-image-wrapper");h&&p.value.contains(h)&&(Re.value=_||h,m.dataTransfer.effectAllowed="move",m.dataTransfer.setData("text/html","image-drag"))}),p.value.addEventListener("dragover",m=>{Re.value&&(m.preventDefault(),m.stopPropagation(),m.dataTransfer.dropEffect="move")}),p.value.addEventListener("dragenter",m=>{Re.value&&(m.preventDefault(),m.stopPropagation())}),p.value.addEventListener("drop",m=>{if(!Re.value||!p.value)return;m.preventDefault(),m.stopPropagation();const v=Re.value,h=v.classList?.contains("dss-image-wrapper"),_=h?v.querySelector("img"):v,$=h?v:_?.closest(".dss-image-wrapper");if(!_||!p.value.contains(_)){Re.value=null;return}let N=null;const Q=m.clientX,Y=m.clientY;if(document.caretRangeFromPoint)N=document.caretRangeFromPoint(Q,Y);else{const Xt=window.getSelection();Xt.rangeCount>0?N=Xt.getRangeAt(0).cloneRange():(N=document.createRange(),N.selectNodeContents(p.value),N.collapse(!1))}if(!N){Re.value=null;return}const Te=N.commonAncestorContainer,me=Te.nodeType===3?Te.parentElement:Te;if(me?.closest(".dss-image-wrapper")===$||$&&$.contains(me)){Re.value=null;return}if($&&(me===$||$.contains(me))){Re.value=null;return}const Qt=_.getAttribute("src");let Jt=null;$?Jt=$.cloneNode(!0):Jt=_.cloneNode(!0);try{let Xt=N.startContainer;if(Xt.nodeType===3&&(Xt=Xt.parentElement),$&&(Xt===$||$.contains(Xt))){const Kt=document.createRange();Kt.setStartAfter($),Kt.collapse(!0),N=Kt}N.insertNode(Jt);const Pt=document.createRange();Pt.setStartAfter(Jt),Pt.collapse(!0);const en=window.getSelection();en.removeAllRanges(),en.addRange(Pt)}catch{if(p.value.childNodes.length===0){const Pt=document.createElement("p");Pt.appendChild(Jt),p.value.appendChild(Pt)}else{const Pt=p.value.lastChild;if(Pt&&Pt.nodeType===1)Pt.appendChild(Jt);else{const en=document.createElement("p");en.appendChild(Jt),p.value.appendChild(en)}}}$?$.remove():_.remove(),Re.value=null,e.nextTick(()=>{const Xt=p.value.querySelectorAll("img");let Pt=!1;Xt.forEach(en=>{if(en.getAttribute("src")===Qt)if(!Pt)Pt=!0;else{const Kt=en.closest(".dss-image-wrapper");Kt?Kt.remove():en.remove()}}),he(),Be()})}),p.value.addEventListener("dragend",m=>{Re.value=null});let d=null;const u=new MutationObserver(m=>{m.forEach(v=>{v.addedNodes.forEach(h=>{if(h.nodeType===1){h.tagName==="IMG"&&(h.removeAttribute("alt"),h.removeAttribute("data-alt"),h.setAttribute("alt",""),h.setAttribute("data-alt",""),h.alt="");const _=h.querySelectorAll&&h.querySelectorAll("img");_&&_.forEach($=>{$.removeAttribute("alt"),$.removeAttribute("data-alt"),$.setAttribute("alt",""),$.setAttribute("data-alt",""),$.alt=""})}})}),d&&clearTimeout(d),d=setTimeout(()=>{he(),Rt(),d=null},100)});if(u.observe(p.value,{childList:!0,subtree:!0}),e.nextTick(()=>{const m=document.querySelector(".dss-text-editor-toolbar");if(m){const v=new MutationObserver(()=>{e.nextTick(()=>{Rt()})});v.observe(m,{childList:!0,subtree:!0}),m._toolbarMutationObserver=v}}),k.modelValue){const m=zn(k.modelValue);p.value.innerHTML=m,Mt()}e.nextTick(()=>{const m=p.value.innerHTML||"",v=k.title||"",h=k.description||"";X.value=m,j.value=v,ie.value=h,E.value=v,C.value=h,Mn(),he(),W(),Xn(),no(),Ql()}),Vn(),Nn(),p.value._mutationObserver=u}}),e.onUnmounted(()=>{if(document.removeEventListener("click",cn),window.removeEventListener("resize",it),p.value&&p.value._windowScrollHandler&&window.removeEventListener("scroll",p.value._windowScrollHandler,!0),ht!==null&&(clearTimeout(ht),ht=null),p.value&&p.value._windowScrollTimeout!==null&&clearTimeout(p.value._windowScrollTimeout),xe.value&&clearTimeout(xe.value),ft.value&&clearTimeout(ft.value),p.value&&p.value._mutationObserver&&p.value._mutationObserver.disconnect(),Je.value&&Je.value.disconnect(),vn.value!==null&&(cancelAnimationFrame(vn.value),vn.value=null),jt.value!==null&&(clearTimeout(jt.value),jt.value=null),Wt.value!==null&&(clearTimeout(Wt.value),Wt.value=null),vl(!0),p.value&&p.value._scrollHandlers){const{wrapper:l,content:a,handler:r}=p.value._scrollHandlers;l&&l.removeEventListener("scroll",r),a&&a.removeEventListener("scroll",r)}const o=document.querySelector(".dss-text-editor-toolbar");o&&o._toolbarMutationObserver&&o._toolbarMutationObserver.disconnect()});const ho=o=>{const l=o.target,a=l.closest("a");if(a&&!k.disabled){o.preventDefault();const c=document.createRange();c.selectNodeContents(a);const d=window.getSelection();d.removeAllRanges(),d.addRange(c)}const r=l.closest(".dss-image-wrapper");r&&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(r.contains(m)&&m!==r.querySelector("img")){const v=document.createRange();v.setStartAfter(r),v.collapse(!0),c.removeAllRanges(),c.addRange(v)}}he(),Vn(),Nn(),qt(),Xn()}):e.nextTick(()=>{he(),Vn(),Nn(),qt(),Xn()})},yl=()=>{G();const o=window.getSelection();if(o&&o.rangeCount>0){const a=o.getRangeAt(0);wt.value=!a.collapsed&&Qn(a),!a.collapsed&&Ge.value&&(Ge.value=null)}else wt.value=!1;if(he(),Vn(),Nn(),qt(),Xn(),o&&o.rangeCount>0){const r=o.getRangeAt(0).commonAncestorContainer,c=r.nodeType===3?r.parentElement:r;if(c&&c.closest(".dss-text-editor-footer")){o.removeAllRanges(),wt.value=!1;return}}["bold","italic","underline"].forEach(a=>{try{const r=window.getSelection();if(r.rangeCount>0){const c=r.getRangeAt(0);if(!c.collapsed)if(a==="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 v=window.getComputedStyle(u);parseInt(v.fontWeight)>=600&&(m=!0)}catch{}Ze.value[a]=m}else{const d=document.queryCommandState(a);Ze.value[a]=d}}}catch{}})},Xn=()=>{if(!k.richText||k.disabled||!p.value){tt.value="p";return}try{const o=window.getSelection();if(!o||o.rangeCount===0){tt.value="p";return}const a=o.getRangeAt(0).commonAncestorContainer,r=a.nodeType===3?a.parentElement:a;if(!r||!p.value.contains(r)){tt.value="p";return}const c=r.closest("h1, h2, h3, h4, h5, h6, p");if(!c){tt.value="p";return}const d=c.tagName.toLowerCase();["h1","h2","h3","h4","h5","h6","p"].includes(d)?tt.value=d:tt.value="p"}catch{tt.value="p"}},Nn=()=>{if(!p.value){ut.value=!1;return}try{const o=window.getSelection();let l=!1;if(o.rangeCount>0){const r=o.getRangeAt(0).commonAncestorContainer,c=r.nodeType===1?r.tagName==="BLOCKQUOTE"?r:r.closest("blockquote"):r.parentElement?.closest("blockquote");l=!!(c&&p.value.contains(c))}ut.value=l}catch{ut.value=!1}},Qn=o=>{if(!o||!p.value)return!1;const l=o.commonAncestorContainer;if(!l)return!1;const a=l.nodeType===3?l.parentElement:l;return a?p.value.contains(a):!1},ol=()=>{ge.value=!1},qt=()=>{if(!k.floatingToolbar||!k.richText||k.disabled){ge.value=!1;return}const o=window.getSelection();if(!o||o.rangeCount===0){ge.value=!1;return}const l=o.getRangeAt(0);if(l.collapsed||!Qn(l)){ge.value=!1;return}const a=l.getBoundingClientRect();if(!a||a.width===0&&a.height===0){ge.value=!1;return}const r=p.value;if(!r){ge.value=!1;return}const c=r.getBoundingClientRect();if(!c||c.width===0){ge.value=!1;return}const d=40,u=8,m=a.top-d/2+15;let v=a.left+a.width/2;const h=window.innerWidth||document.documentElement.clientWidth||0;let _=0;St.value&&(_=St.value.getBoundingClientRect().width);const $=(_||320)/2;let N=c.left+$,Q=c.right-$;if(Q<N){const Y=c.left+c.width/2;N=Y,Q=Y}if(h>0){const Y=$+u,Te=h-$-u;if(N=Math.max(N,Y),Q=Math.min(Q,Te),Q<N){const me=h/2;N=me,Q=me}}v<N?v=N:v>Q&&(v=Q),yt.value={position:"fixed",top:`${Math.max(m,8)}px`,left:`${v}px`,transform:"translate(-50%, -100%)",zIndex:10003},ge.value=!0},Kl=o=>{k.disabled||!k.richText||(at.value=at.value===o?null:o,o==="askAi"&&(ue.value=null))},yo=()=>{at.value=null,We.value=null},$n=o=>{En(o),yo()};let al=null,Sn=null,fl=null,Cl=null;const Ml=o=>{if(k.disabled||!k.richText){kl(),bl();return}const l=o.target,a=l.closest("a"),r=l.closest("img");if(al&&(clearTimeout(al),al=null),fl&&(clearTimeout(fl),fl=null),a&&a!==Sn){bl(),Sn=a;let c=a.getAttribute("href")||"";(!c||c==="#"||c==="")&&(c=a.textContent||""),we.value=a,S.value=c,ee.value=!0,He.value=!0,Co(a)}else!a&&Sn?(Sn=null,al=setTimeout(()=>{He.value||kl()},150)):a&&a===Sn&&Co(a);if(r&&r!==Cl){kl(),Cl=r;let c=r.getAttribute("alt");c===null&&(c=r.alt||"");let d=r.getAttribute("data-alt");d===null&&(d=c),r.hasAttribute("alt")||r.setAttribute("alt",c),r.hasAttribute("data-alt")||r.setAttribute("data-alt",d),Xe.value=r,Ct.value=c.trim()||A("textEditor.image.noAlt"),Yt.value=!0,$e.value=!0,Gl(r)}else!r&&Cl?(Cl=null,fl=setTimeout(()=>{$e.value||bl()},150)):r&&r===Cl&&Gl(r)},Bo=o=>{const l=o.relatedTarget;(!l||!l.closest(".dss-text-editor-content")&&!l.closest(".dss-link-popup"))&&(Sn=null,Cl=null,al&&(clearTimeout(al),al=null),fl&&(clearTimeout(fl),fl=null),kl(),bl())},kl=()=>{He.value=!1,setTimeout(()=>{He.value||(ee.value=!1,S.value="",Ae.value||(we.value=null))},100)},Co=o=>{if(!o||!p.value)return;const l=o.getBoundingClientRect(),c=l.top-32-8,d=l.left+l.width/2;ne.value={position:"fixed",top:`${c}px`,left:`${d}px`,transform:"translateX(-50%)",zIndex:10002}},bl=()=>{$e.value=!1,setTimeout(()=>{$e.value||(Yt.value=!1,Ct.value="",$t.value||(Xe.value=null))},100)},Gl=o=>{if(!o||!p.value)return;const l=o.getBoundingClientRect(),c=l.top-32-8,d=l.left+l.width/2;te.value={position:"fixed",top:`${c}px`,left:`${d}px`,transform:"translateX(-50%)",zIndex:10002}},Mo=()=>{if(!S.value||!we.value)return;let l=we.value.getAttribute("href")||S.value;!l.startsWith("http://")&&!l.startsWith("https://")&&!l.startsWith("mailto:")&&(l="https://"+l),window.open(l,"_blank","noopener,noreferrer")},_o=()=>{if(we.value){const o=we.value.textContent||"",l=we.value.getAttribute("href")||"",a=we.value;Ie.value=l,O.value=o,Tt.value=o,He.value=!1,ee.value=!1,S.value="",we.value=a,Ae.value=!0}else if(ve.value){const o=window.getSelection();if(o.rangeCount>0){const a=o.getRangeAt(0).commonAncestorContainer,r=a.nodeType===1?a.closest("a"):a.parentElement?.closest("a");if(r){const c=r.textContent||"",d=r.getAttribute("href")||"";Ie.value=d,O.value=c,Tt.value=c,we.value=r,Ae.value=!0}}}else{xt.value=yn();const o=window.getSelection();let l="";o.rangeCount>0&&(l=o.getRangeAt(0).toString()),Ie.value="",O.value=l,Tt.value="",we.value=null,Ae.value=!0}e.nextTick(()=>{rt.value&&(rt.value.focus(),rt.value.select())})},Dn=()=>{Ae.value=!1,Ie.value="",O.value="",Tt.value="",we.value=null,xt.value=null},Jn=()=>{if(!Ie.value.trim()){Dn();return}if(Ue.value?(xe.value&&(clearTimeout(xe.value),xe.value=null),Se(),Ue.value=!1):Se(),O.value.trim()||(O.value=Ie.value.trim()),we.value&&p.value&&p.value.contains(we.value)){const o=window.getSelection();o.rangeCount>0&&o.removeAllRanges();const l=we.value;if(l.setAttribute("href",Ie.value.trim()),O.value.trim()!==Tt.value.trim()){for(;l.firstChild;)l.removeChild(l.firstChild);l.textContent=O.value.trim()}l.style.color="#60afdf",l.style.textDecoration="underline";const a=document.createRange();a.selectNodeContents(l),a.collapse(!1),o.removeAllRanges(),o.addRange(a),Be()}else if(p.value){p.value.focus();const o=window.getSelection();o.removeAllRanges(),xt.value&&et(xt.value);let l=null;if(o.rangeCount>0&&(l=o.getRangeAt(0)),l&&!l.collapsed){l.toString();const a=document.createElement("a");a.href=Ie.value.trim(),a.textContent=O.value.trim(),a.style.color="#60afdf",a.style.textDecoration="underline",l.deleteContents(),l.insertNode(a);const r=document.createTextNode(" ");l.setStartAfter(a),l.insertNode(r),l.setStartAfter(r),l.collapse(!0),o.removeAllRanges(),o.addRange(l)}else{l||(l=document.createRange(),l.selectNodeContents(p.value),l.collapse(!1));const a=l.startContainer,r=a.nodeType===3,c=r&&l.startOffset===a.textContent.length,d=document.createElement("a");if(d.href=Ie.value.trim(),d.textContent=O.value.trim(),d.style.color="#60afdf",d.style.textDecoration="underline",c){let u=a.parentElement;for(;u&&u!==p.value&&!["P","DIV","H1","H2","H3","H4","H5","H6"].includes(u.tagName);)u=u.parentElement;if(u&&u!==p.value){let m=u.nextElementSibling;if(m&&(m.innerHTML==="<br>"||m.innerHTML==="<br/>"||m.textContent.trim()==="")){m.textContent="",m.appendChild(d);const v=document.createTextNode(" ");m.appendChild(v);const h=document.createRange();h.setStartAfter(d),h.collapse(!0),o.removeAllRanges(),o.addRange(h)}else{if(l.startOffset>0){const h=a.textContent.substring(0,l.startOffset),_=h[h.length-1];if(_&&_!==" "&&_!==" "&&_!==`
100
+ </svg>`,p=e.ref(null),ue=e.ref(null),ve=e.ref(!1),de=e.ref(!1),ee=e.ref(!1),S=e.ref(""),ne=e.ref({}),He=e.ref(!1),Ae=e.ref(!1),Ie=e.ref(""),O=e.ref(""),rt=e.ref(null),Oe=e.ref(null),we=e.ref(null),xt=e.ref(null),Tt=e.ref(""),ut=e.ref(!1),Ze=e.ref({}),ge=e.ref(!1),yt=e.ref({}),St=e.ref(null),at=e.ref(null),$t=e.ref(!1),Ot=e.ref(""),on=e.ref(null),Et=e.ref(""),lt=e.ref(""),je=e.ref(""),Dt=e.ref(null),Lt=e.ref(null),Bt=e.ref(null),Xe=e.ref(null),Zt=e.ref(null),Yt=e.ref(!1),Ct=e.ref(""),te=e.ref({}),Te=e.ref(!1),fe=e.ref("upload"),Ne=e.ref(""),We=e.ref(null),ft=e.ref(null),qe=e.ref([]),dt=e.ref([]),xe=e.ref(null),Ue=e.ref(!1),X=e.ref(""),Z=e.ref(""),j=e.ref(""),ie=e.ref(""),E=e.ref(""),C=e.ref(""),V=e.ref(null),P=e.ref(null),U=e.ref(null),ze=e.ref(!1),Re=e.ref(null),De=e.ref(!1),re=e.ref(!1),Ge=e.ref(null),tt=e.ref("p"),wt=e.ref(!1),vt=e.ref([]),Je=e.ref(null),vn=e.ref(null),jt=e.ref(null),Tn=e.ref(!1),bn=e.ref(0),Fn=100,Wt=e.ref(null),In=e.computed(()=>({"dss-text-editor-no-border":!k.border,"dss-text-editor-rounded":k.rounded,"dss-text-editor-full-height":k.fullHeight,"dss-comment-overlay-open":mn.value!==null})),an=e.computed(()=>({})),qn=e.computed(()=>!k.fixedHeight||k.fullHeight?{}:{height:`${1.6*14*k.rows+24+2}px`,resize:"none",overflowY:"auto"}),cl=e.computed(()=>!k.fixedHeight||k.fullHeight?{}:{height:`${1.6*14*k.rows+32}px`,overflowY:"auto"}),D=e.computed(()=>k.richText&&dt.value.length>0),q=e.computed(()=>{if(!k.modelValue)return"";if(k.richText){let o=k.modelValue.replace(/<script[^>]*>[\s\S]*?<\/script>/gi,"");return o=o.replace(/<style[^>]*>[\s\S]*?<\/style>/gi,""),o=o.replace(/<[^>]+>/g,""),o=o.replace(/&nbsp;/g," "),o=o.replace(/&amp;/g,"&"),o=o.replace(/&lt;/g,"<"),o=o.replace(/&gt;/g,">"),o=o.replace(/&quot;/g,'"'),o=o.replace(/&#39;/g,"'"),o=o.replace(/\s+/g," ").trim(),o}return k.modelValue}),R=e.computed(()=>{const o=q.value.trim();return o?o.split(/\s+/).filter(l=>l.length>0).length:0}),le=e.computed(()=>q.value.length),Me=e.computed(()=>Xe.value!==null&&fe.value==="upload"&&Et.value&&Et.value.startsWith("data:")),nt=e.computed(()=>k.titlePlaceholder||A("textEditor.placeholders.title")),st=e.computed(()=>k.descriptionPlaceholder||A("textEditor.placeholders.description")),Qe=e.computed(()=>k.placeholder||A("textEditor.placeholders.startTyping")),Ke=o=>se&&se[o]!==void 0,dn=o=>{for(let l=o+1;l<k.customToolbarSlots.length;l++)if(Ke(k.customToolbarSlots[l]))return!0;return!1},Ln=o=>{for(let l=o+1;l<k.customToolbarSlots.length;l++){const a=k.customToolbarSlots[l];if(Ke(a)&&tn(a))return!0}return!1},tn=o=>k.customToolbarFloatingMap.hasOwnProperty(o)?k.customToolbarFloatingMap[o]===!0:!0,Hn=e.computed(()=>k.customToolbarSlots.some(o=>Ke(o)&&tn(o))),wn=e.computed(()=>Ke("title-slot")),sn=e.computed(()=>Ke("description-slot")),xn=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,""),a=l.trim();return a.startsWith("<html>")&&a.endsWith("</html>")?a.slice(6,-7).trim():l},Nl=o=>{if(!o)return;const l=document.createTreeWalker(o,NodeFilter.SHOW_COMMENT,null,!1),a=[];let r=l.nextNode();for(;r;)a.push(r),r=l.nextNode();a.forEach(c=>c.remove())},Tl=o=>{try{const l=String(o.getDate()).padStart(2,"0"),r=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][o.getMonth()],c=o.getFullYear();return`${l} ${r} ${c}`}catch{return""}},Sl=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=A("textEditor.started_conversation");if(c&&l===c)return!0}catch{}const r=l.toLowerCase();return r.includes("started conversation")||r.includes("démarré la conversation")||r==="started conversation"||r==="a démarré la conversation"},gl=o=>{const l=o.target.value;$e("update:modelValue",l),$e("change",l)},gn=()=>{if(!V.value)return;const o=V.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 r=o.value;o.value="M";const c=o.scrollHeight;o.value=r,o.style.setProperty("height",`${c}px`,"important"),o.style.setProperty("overflow-y","hidden","important");return}o.offsetHeight;const a=o.scrollHeight;o.style.setProperty("height",`${a}px`,"important"),o.style.setProperty("overflow-y","hidden","important")},hn=()=>{De.value=!0,gn()},Zl=()=>{De.value=!1,ul()},ul=()=>{if(!V.value)return;const o=V.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 a=o.scrollHeight;o.value=l,o.offsetHeight,o.style.setProperty("height",`${a}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")},An=o=>{const a=o.target.value;De.value&&gn(),$e("update:title",a),$e("title-change",a),U.value="title",k.richText&&(Ue.value||(Z.value=X.value,E.value=j.value,C.value=ie.value),xe.value&&clearTimeout(xe.value),Ue.value=!0,xe.value=setTimeout(()=>{Ue.value=!1,Se()},500))},dl=()=>{if(!P.value)return;const o=P.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 r=o.value;o.value="M";const c=o.scrollHeight;o.value=r,o.style.setProperty("height",`${c}px`,"important"),o.style.setProperty("overflow-y","hidden","important");return}o.offsetHeight;const a=o.scrollHeight;o.style.setProperty("height",`${a}px`,"important"),o.style.setProperty("overflow-y","hidden","important")},hl=()=>{re.value=!0,dl()},Ll=()=>{re.value=!1,Vt()},Vt=()=>{if(!P.value)return;const o=P.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 a=o.scrollHeight;o.value=l,o.offsetHeight,o.style.setProperty("height",`${a}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")},Ee=o=>{const a=o.target.value;re.value&&dl(),$e("update:description",a),$e("description-change",a),U.value="description",k.richText&&(Ue.value||(Z.value=X.value,E.value=j.value,C.value=ie.value),xe.value&&clearTimeout(xe.value),Ue.value=!0,xe.value=setTimeout(()=>{Ue.value=!1,Se()},500))},yn=()=>{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 a=l.cloneRange();return a.selectNodeContents(p.value),a.setEnd(l.startContainer,l.startOffset),{type:"text",start:a.toString().length,end:a.toString().length+l.toString().length}},et=o=>{if(!(!o||!p.value))try{const l=window.getSelection(),a=document.createRange();if(o.type==="element"&&o.element)if(p.value.contains(o.element)){a.setStart(o.element,o.offset),a.collapse(!0),l.removeAllRanges(),l.addRange(a);return}else{p.value.focus();return}let r=0;const c=[p.value];let d=null,u=!1,m=!1;for(;!m&&(d=c.pop());)if(d.nodeType===3){const v=r+d.length;!u&&o.start>=r&&o.start<=v&&(a.setStart(d,o.start-r),u=!0),u&&o.end>=r&&o.end<=v&&(a.setEnd(d,o.end-r),m=!0),r=v}else{let v=d.childNodes.length;for(;v--;)c.push(d.childNodes[v])}l.removeAllRanges(),l.addRange(a)}catch{p.value.focus()}},rn=()=>{if(!p.value)return;p.value.focus();const o=window.getSelection(),l=document.createRange(),a=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=a(u);if(m)return m}return c},r=a(p.value);if(r.nodeType===3)l.setStart(r,r.length),l.setEnd(r,r.length);else if(r.childNodes.length>0){const c=a(r);c&&c.nodeType===3?(l.setStart(c,c.length),l.setEnd(c,c.length)):(l.selectNodeContents(r),l.collapse(!1))}else l.setStart(r,0),l.setEnd(r,0);o.removeAllRanges(),o.addRange(l)},Se=(o=!1)=>{if(!p.value)return;const l=p.value.innerHTML,a=k.title||"",r=k.description||"";if(!o&&l===X.value&&a===j.value&&r===ie.value)return;const c={content:Z.value||X.value,title:E.value!==void 0?E.value:j.value,description:C.value!==void 0?C.value:ie.value},d=qe.value.length>0?qe.value[qe.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&&(qe.value.push(c),qe.value.length>50&&qe.value.shift(),dt.value=[]),X.value=l,j.value=a,ie.value=r,Z.value=l,E.value=a,C.value=r},Be=o=>{if(!p.value)return;G(),p.value&&Nl(p.value);let l=null;p.value&&(p.value.querySelector("p")||(l=yn(),Mt()));const a=o&&o.inputType&&(o.inputType==="insertText"||o.inputType==="insertCompositionText"||o.inputType==="deleteContentBackward"||o.inputType==="deleteContentForward");a&&Ge.value&&(Ge.value=null),de.value=!0;const r=p.value.innerHTML.replace(/<!--[\s\S]*?-->/g,"").replace(/&nbsp;|\u00A0/g," "),c=xn(r);$e("update:modelValue",c),$e("change",c),U.value="editor",Ue.value||(Z.value=X.value,E.value=j.value,C.value=ie.value),xe.value&&clearTimeout(xe.value),Ue.value=!0,xe.value=setTimeout(()=>{Ue.value=!1,Se(),Yn(),ko()},500),e.nextTick(()=>{l&&et(l),G();const d=["bold","italic","underline"],u=window.getSelection(),m=u.rangeCount>0?u.getRangeAt(0):null,v=m&&m.collapsed;if(d.forEach(h=>{try{if(v&&Ge.value?.command===h){Ze.value[h]=Ge.value.state;return}if(h==="bold")if(m){const _=m.commonAncestorContainer,$=_.nodeType===3?_.parentElement:_;let N=!1;if($&&(($.tagName==="STRONG"||$.tagName==="B"||$.closest&&$.closest("strong, b"))&&(N=!0),!N&&$.style&&parseInt($.style.fontWeight)>=600&&(N=!0),!N))try{const Q=window.getComputedStyle($);parseInt(Q.fontWeight)>=600&&(N=!0)}catch{}Ze.value[h]=N}else Ze.value.hasOwnProperty(h)||(Ze.value[h]=!1);else if(h==="italic")if(m){const _=m.commonAncestorContainer,$=_.nodeType===3?_.parentElement:_,N=$&&($.tagName==="EM"||$.tagName==="I"||$.closest&&$.closest("em, i"));Ze.value[h]=!!N}else{const _=document.queryCommandState(h);Ze.value[h]=_}else{const _=document.queryCommandState(h);Ze.value[h]=_}}catch{}}),Mn(),he(),W(),qt(),Xn(),Zn("handleRichTextInput"),a&&(o.inputType==="insertText"||o.inputType==="insertCompositionText")){const h=o.data||"";h&&h.length===1&&setTimeout(()=>ko(h),0),(h===" "||h===`
101
+ `||/[.,;:!?]/.test(h))&&setTimeout(()=>{Yn()},100)}de.value=!1})},G=()=>{if(!p.value)return;const o=window.getSelection();if(!o||o.rangeCount===0)return;const l=o.getRangeAt(0),a=l.commonAncestorContainer,r=a.nodeType===3?a.parentElement:a;if(!r)return;const c=r.closest(".dss-image-wrapper");if(c){const d=c.querySelector("img");if(r!==d&&!d?.contains(r)){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 v=document.createRange();v.setStartAfter(c),v.collapse(!0),o.removeAllRanges(),o.addRange(v)}}}},Mt=()=>{if(!p.value)return;const o=p.value;if(o.querySelector&&o.querySelector("p"))return;const l=new Set(["P","H1","H2","H3","H4","H5","H6","BLOCKQUOTE","UL","OL","DIV"]),a=Array.from(o.childNodes);let r=null;a.forEach(c=>{if(c.nodeType===Node.TEXT_NODE){if((c.textContent||"").trim()===""){c.parentNode===o&&o.removeChild(c);return}r||(r=document.createElement("p"),o.insertBefore(r,c)),r.appendChild(c);return}if(c.nodeType===Node.ELEMENT_NODE){const d=c,u=d.tagName;if(u==="BR"){r=null;return}if(l.has(u)){r=null;return}r||(r=document.createElement("p"),o.insertBefore(r,d)),r.appendChild(d)}})},he=()=>{if(p.value&&!ze.value){ze.value=!0;try{p.value.querySelectorAll(".dss-image-wrapper").forEach(r=>{r.querySelector("img")||r.remove()}),p.value.querySelectorAll(".dss-image-no-alt-icon").forEach(r=>{const c=r.parentElement;!c||!c.classList.contains("dss-image-wrapper")?r.remove():c.querySelector("img")||r.remove()}),p.value.querySelectorAll("img").forEach(r=>{let c=r.getAttribute("alt");c===null&&(c=r.alt||"");const d=r.getAttribute("src")||r.src||"";if(c){const h=d.replace(/^https?:\/\//,"").replace(/^data:.*,/,""),_=c===d||c===h;(c.startsWith("http://")||c.startsWith("https://")||c.startsWith("data:")||_||_)&&(c="")}r.setAttribute("alt",c),r.setAttribute("data-alt",c);const u=!c||c.trim()==="";let m=r.parentElement;const v=m&&m.classList.contains("dss-image-wrapper");if(v){const h=m.querySelector(".dss-image-no-alt-icon");h&&h.remove()}else{const h=r.nextElementSibling?.classList.contains("dss-image-no-alt-icon")?r.nextElementSibling:null;h&&h.remove()}if(u){v?m.setAttribute("contenteditable","false"):(m=document.createElement("span"),m.className="dss-image-wrapper",m.setAttribute("contenteditable","false"),r.parentNode.insertBefore(m,r),m.appendChild(r));const h=document.createElement("div");h.className="dss-image-no-alt-icon",h.setAttribute("contenteditable","false"),h.innerHTML=pt,m.appendChild(h)}else if(v&&m.children.length===1){const h=m.parentNode;h.insertBefore(r,m),h.removeChild(m)}})}finally{ze.value=!1}}},Hl=o=>{Yn(),$e("blur",o),ol()},w=()=>{if(k.disabled||!k.richText||!p.value)return;At(),xe.value&&(clearTimeout(xe.value),xe.value=null),Ue.value&&(Se(),Ue.value=!1);const o=U.value==="title",l=U.value==="description",a=U.value==="editor";if(qe.value.length===0){o&&V.value?V.value.focus():l&&P.value?P.value.focus():p.value.focus(),document.execCommand("undo",!1),e.nextTick(()=>{Be()});return}const r={content:p.value.innerHTML,title:k.title||"",description:k.description||""};dt.value.push(r);const c=qe.value.pop();if(c!==void 0){de.value=!0;const d=typeof c=="string"?c:c.content,u=typeof c=="object"&&c.title||"",m=typeof c=="object"&&c.description||"";p.value.innerHTML=d,X.value=d,j.value=u,ie.value=m,Z.value=d,E.value=u,C.value=m,e.nextTick(()=>{Mn(),Vn(),Nn(),qt();const v=xn(d);$e("update:modelValue",v),$e("update:title",u),$e("update:description",m),$e("change",v),$e("title-change",u),$e("description-change",m),de.value=!1,e.nextTick(()=>{setTimeout(()=>{if(o){if(V.value){V.value.focus();const h=u.length;V.value.setSelectionRange&&V.value.setSelectionRange(h,h),gn()}}else if(l){if(P.value){P.value.focus();const h=m.length;P.value.setSelectionRange(h,h)}}else if(a)rn();else if(V.value&&document.activeElement===V.value){const h=u.length;V.value.setSelectionRange&&V.value.setSelectionRange(h,h),gn()}else if(P.value&&document.activeElement===P.value){const h=m.length;P.value.setSelectionRange(h,h)}else p.value&&rn()},10)})})}},y=()=>{if(k.disabled||!k.richText||!p.value)return;At();const o=U.value==="title",l=U.value==="description",a=U.value==="editor";if(dt.value.length===0){o&&V.value?V.value.focus():l&&P.value?P.value.focus():p.value.focus(),document.execCommand("redo",!1),e.nextTick(()=>{Be()});return}const r={content:p.value.innerHTML,title:k.title||"",description:k.description||""};qe.value.push(r);const c=dt.value.pop();if(c!==void 0){de.value=!0;const d=typeof c=="string"?c:c.content,u=typeof c=="object"&&c.title||"",m=typeof c=="object"&&c.description||"";p.value.innerHTML=d,X.value=d,j.value=u,ie.value=m,Z.value=d,E.value=u,C.value=m,e.nextTick(()=>{Mn(),Vn(),Nn(),qt();const v=xn(d);$e("update:modelValue",v),$e("update:title",u),$e("update:description",m),$e("change",v),$e("title-change",u),$e("description-change",m),de.value=!1,e.nextTick(()=>{setTimeout(()=>{if(o){if(V.value){V.value.focus();const h=u.length;V.value.setSelectionRange&&V.value.setSelectionRange(h,h),gn()}}else if(l){if(P.value){P.value.focus();const h=m.length;P.value.setSelectionRange(h,h)}}else if(a)rn();else if(V.value&&document.activeElement===V.value){const h=u.length;V.value.setSelectionRange&&V.value.setSelectionRange(h,h),gn()}else if(P.value&&document.activeElement===P.value){const h=m.length;P.value.setSelectionRange(h,h)}else p.value&&rn()},10)})})}},B=()=>{if(!p.value)return;p.value.querySelectorAll('span[style*="font-weight"]').forEach(r=>{const c=r.style.fontWeight;if(c==="normal"||c==="400"){const d=document.createDocumentFragment();for(;r.firstChild;)d.appendChild(r.firstChild);r.parentNode&&r.parentNode.replaceChild(d,r)}}),p.value.querySelectorAll('span[style*="font-weight"]').forEach(r=>{if(parseInt(r.style.fontWeight)>=600){const d=document.createElement("b");for(d.style.fontWeight="600";r.firstChild;)d.appendChild(r.firstChild);r.parentNode&&r.parentNode.replaceChild(d,r)}}),p.value.querySelectorAll("b, strong").forEach(r=>{r.style.fontWeight="600"})},W=()=>{if(!p.value)return;p.value.querySelectorAll("i, em").forEach(l=>{l.style.fontStyle="italic"})},ae=()=>{const o=window.getSelection();if(!o||o.rangeCount===0)return!1;const l=o.getRangeAt(0);let a=!1;if(l.collapsed){const r=l.startContainer;let c=r.nodeType===3?r.parentElement:r;for(;c&&c!==p.value;){if(c.tagName==="EM"||c.tagName==="I"){a=!0;break}if(c.style&&c.style.fontStyle==="italic"){a=!0;break}c=c.parentElement}}else{const r=l.commonAncestorContainer.nodeType===1?l.commonAncestorContainer:l.commonAncestorContainer.parentNode;if(r){const c=document.createTreeWalker(r,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!==p.value;){if(u.tagName==="EM"||u.tagName==="I"){a=!0;break}if(u.style&&u.style.fontStyle==="italic"){a=!0;break}u=u.parentElement}}else if(d.nodeType===1){const u=d;if(u.tagName==="EM"||u.tagName==="I"){a=!0;break}if(u.style&&u.style.fontStyle==="italic"){a=!0;break}}if(a)break}}}if(a)return document.execCommand("italic",!1),e.nextTick(()=>{W()}),!1;if(l.collapsed)document.execCommand("italic",!1),e.nextTick(()=>{W()});else try{const r=l.extractContents(),c=document.createElement("em");c.style.fontStyle="italic",c.appendChild(r),l.insertNode(c),l.setStartAfter(c),l.collapse(!0),o.removeAllRanges(),o.addRange(l),e.nextTick(()=>{W()})}catch{document.execCommand("italic",!1),e.nextTick(()=>{W()})}return!0},mt=()=>{const o=window.getSelection();if(!o||o.rangeCount===0)return!1;const l=o.getRangeAt(0);let a=!1;if(l.collapsed){const r=l.startContainer;let c=r.nodeType===3?r.parentElement:r;for(;c&&c!==p.value;){if(c.tagName==="STRONG"||c.tagName==="B"){a=!0;break}if(c.style&&parseInt(c.style.fontWeight)>=600){a=!0;break}c=c.parentElement}}else{const r=l.commonAncestorContainer.nodeType===1?l.commonAncestorContainer:l.commonAncestorContainer.parentNode;if(r){const c=document.createTreeWalker(r,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!==p.value;){if(u.tagName==="STRONG"||u.tagName==="B"){a=!0;break}if(u.style&&parseInt(u.style.fontWeight)>=600){a=!0;break}u=u.parentElement}}else if(d.nodeType===1){const u=d;if(u.tagName==="STRONG"||u.tagName==="B"){a=!0;break}if(u.style&&parseInt(u.style.fontWeight)>=600){a=!0;break}}if(a)break}}}if(a)return document.execCommand("bold",!1),e.nextTick(()=>{B()}),!1;if(l.collapsed)document.execCommand("bold",!1),e.nextTick(()=>{const r=window.getSelection();if(r.rangeCount>0){const c=r.getRangeAt(0),d=c.startContainer;let u=d.nodeType===3?d.parentElement:d;for(;u&&u!==p.value;){if(u.tagName==="SPAN"&&u.style.fontWeight){const m=u.style.fontWeight;if(m==="normal"||m==="400"){const v=document.createElement("b");v.style.fontWeight="600";const h=document.createDocumentFragment();for(;u.firstChild;)h.appendChild(u.firstChild);v.appendChild(h),u.parentNode&&u.parentNode.replaceChild(v,u),c.setStart(v,0),c.collapse(!0),r.removeAllRanges(),r.addRange(c);break}}else if(u.tagName==="STRONG"||u.tagName==="B"){u.style.fontWeight="600";break}u=u.parentElement}if(!u||u===p.value){const m=document.createElement("b");m.style.fontWeight="600",m.innerHTML="<br>",c.insertNode(m),c.setStart(m,0),c.collapse(!0),r.removeAllRanges(),r.addRange(c)}}B()});else try{const r=l.extractContents(),c=document.createElement("b");c.style.fontWeight="600",c.appendChild(r),l.insertNode(c),l.setStartAfter(c),l.collapse(!0),o.removeAllRanges(),o.addRange(l),e.nextTick(()=>{B()})}catch{document.execCommand("bold",!1),e.nextTick(()=>{B()})}return!0},ot=(o,l=null)=>{if(k.disabled||!k.richText||!p.value)return;Ue.value?(xe.value&&(clearTimeout(xe.value),xe.value=null),Se(),Ue.value=!1):Se(),At(),p.value.focus();const a=window.getSelection();let r=null;if(a&&a.rangeCount>0){const d=a.getRangeAt(0);!d.collapsed&&Qn(d)&&(r=yn())}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 v=document.createTextNode(l);u.insertNode(v),u.selectNodeContents(v)}}}if(o==="bold"){const d=mt();Ze.value.bold=d;const u=window.getSelection();u.rangeCount>0&&u.getRangeAt(0).collapsed&&(Ge.value={command:"bold",state:d}),e.nextTick(()=>{r&&(et(r),e.nextTick(()=>{const m=Ht("bold");Ze.value.bold=m})),Be(),Vn(),qt()});return}if(o==="italic"){const d=ae();Ze.value.italic=d;const u=window.getSelection();u.rangeCount>0&&u.getRangeAt(0).collapsed&&(Ge.value={command:"italic",state:d}),e.nextTick(()=>{r&&(et(r),e.nextTick(()=>{const m=Ht("italic");Ze.value.italic=m})),Be(),W(),Vn(),qt()});return}let c=!1;try{c=document.execCommand(o,!1,l)}catch{}e.nextTick(()=>{if(r&&et(r),["bold","italic","underline"].includes(o))try{if(o==="bold")r&&e.nextTick(()=>{const u=Ht("bold");Ze.value.bold=u});else if(o==="italic")if(r)e.nextTick(()=>{const u=Ht("italic");Ze.value.italic=u});else{const u=document.queryCommandState(o);Ze.value[o]=u}else{const u=document.queryCommandState(o);Ze.value[o]=u}}catch{Ze.value.hasOwnProperty(o)?Ze.value[o]=!Ze.value[o]:Ze.value[o]=!0}if(o==="createLink"&&l){const u=window.getSelection();if(u.rangeCount>0){const v=u.getRangeAt(0),h=v.commonAncestorContainer.nodeType===1?v.commonAncestorContainer.closest("a"):v.commonAncestorContainer.parentElement?.closest("a");h&&(!h.getAttribute("href")||h.getAttribute("href")==="")&&h.setAttribute("href",l)}p.value.querySelectorAll("a").forEach(v=>{const h=v.getAttribute("href");(!h||h===""||h==="#")&&v.setAttribute("href",l)})}Be(),Vn(),qt()})},Ht=(o,l=null)=>{if(k.disabled||!p.value)return!1;try{if(o==="formatBlock"&&l){const r=document.queryCommandValue("formatBlock");if(l==="<blockquote>"){const c=r.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 r===l||r.toLowerCase()===l.toLowerCase()}if(["bold","italic","underline"].includes(o))try{const r=window.getSelection();if(r.rangeCount>0){const c=r.getRangeAt(0);if(o==="bold"){let u=!1;if(c.collapsed){const m=c.commonAncestorContainer,v=m.nodeType===3?m.parentElement:m;if(v&&((v.tagName==="STRONG"||v.tagName==="B"||v.closest&&v.closest("strong, b"))&&(u=!0),!u&&v.style&&parseInt(v.style.fontWeight)>=600&&(u=!0),!u))try{const h=window.getComputedStyle(v);parseInt(h.fontWeight)>=600&&(u=!0)}catch{}return Ze.value.hasOwnProperty(o)?Ze.value[o]:(Ze.value[o]=u,u)}else{const m=c.commonAncestorContainer.nodeType===1?c.commonAncestorContainer:c.commonAncestorContainer.parentNode;let v=!1;if(m){const h=document.createTreeWalker(m,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let _;for(;_=h.nextNode();)if(!(typeof c.intersectsNode=="function"&&!c.intersectsNode(_))){if(_.nodeType===3){if(!(_.textContent||"").trim())continue;v=!0;let N=_.parentElement;for(;N&&N!==p.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(_.nodeType===1){const $=_;if($.tagName==="STRONG"||$.tagName==="B"){u=!0;break}if($.style&&parseInt($.style.fontWeight)>=600){u=!0;break}}if(u)break}}return Ze.value[o]=u&&v,u&&v}}if(o==="italic"){let u=!1;if(c.collapsed){const m=c.commonAncestorContainer,v=m.nodeType===3?m.parentElement:m;if(v&&((v.tagName==="EM"||v.tagName==="I"||v.closest&&v.closest("em, i"))&&(u=!0),!u&&v.style&&v.style.fontStyle==="italic"&&(u=!0),!u))try{window.getComputedStyle(v).fontStyle==="italic"&&(u=!0)}catch{}return Ze.value.hasOwnProperty(o)?Ze.value[o]:(Ze.value[o]=u,u)}else{const m=c.commonAncestorContainer.nodeType===1?c.commonAncestorContainer:c.commonAncestorContainer.parentNode;let v=!1;if(m){const h=document.createTreeWalker(m,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let _;for(;_=h.nextNode();)if(!(typeof c.intersectsNode=="function"&&!c.intersectsNode(_))){if(_.nodeType===3){if(!(_.textContent||"").trim())continue;v=!0;let N=_.parentElement;for(;N&&N!==p.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(_.nodeType===1){const $=_;if($.tagName==="EM"||$.tagName==="I"){u=!0;break}if($.style&&$.style.fontStyle==="italic"){u=!0;break}}if(u)break}}return Ze.value[o]=u&&v,u&&v}}const d=document.queryCommandState(o);return c.collapsed&&Ze.value.hasOwnProperty(o)?Ze.value[o]:(Ze.value[o]=d,d)}return Ze.value.hasOwnProperty(o)?Ze.value[o]:!1}catch{return Ze.value.hasOwnProperty(o)?Ze.value[o]:!1}try{return document.queryCommandState(o)}catch{return!1}}catch{return!1}},It=o=>{k.disabled||!k.richText||(ue.value=ue.value===o?null:o,o==="askAi"&&(at.value=null))},At=()=>{ue.value=null,We.value=null},En=o=>{ot("formatBlock",o),At()},Wl=o=>{if(!o||!p.value)return o;const l=Le=>{let me=Le.nodeType===Node.TEXT_NODE?Le.parentElement:Le;for(;me&&me!==p.value;){const ct=me.tagName;if(ct==="P"){const Qt=me.parentElement;if(Qt===p.value||Qt.tagName==="BLOCKQUOTE")return me}if(ct==="BLOCKQUOTE")break;me=me.parentElement}return null},a=l(o.startContainer),r=l(o.endContainer);if(!a||!r)return o;const c=[],d=document.createTreeWalker(p.value,NodeFilter.SHOW_ELEMENT,{acceptNode:Le=>{const me=Le.tagName;if(me==="P"){const ct=Le.parentElement;if(ct===p.value||ct.tagName==="BLOCKQUOTE")return NodeFilter.FILTER_ACCEPT}return me==="BLOCKQUOTE"?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_SKIP}});let u;for(;u=d.nextNode();)c.push(u);const m=c.indexOf(a),v=c.indexOf(r);if(m===-1||v===-1)return o;const h=Math.min(m,v),_=Math.max(m,v),$=c.slice(h,_+1);if($.length===0)return o;const N=$[0],Q=$[$.length-1],Y=document.createRange();return Y.setStartBefore(N),Y.setEndAfter(Q),Y},ro=()=>{if(k.disabled||!k.richText||!p.value)return;Ue.value?(xe.value&&(clearTimeout(xe.value),xe.value=null),Se(),Ue.value=!1):Se(),At(),p.value.focus();const o=window.getSelection();if(o.rangeCount===0)return;let l=o.getRangeAt(0);!l.collapsed&&Qn(l)&&(l=Wl(l),o.removeAllRanges(),o.addRange(l));let a=null;!l.collapsed&&Qn(l)&&(a=yn());const r=l.commonAncestorContainer,c=r.nodeType===1?r.tagName==="BLOCKQUOTE"?r:r.closest("blockquote"):r.parentElement?.closest("blockquote");if(!!(c&&p.value.contains(c))){if(c){const u=c.parentNode;Array.from(c.childNodes).forEach(v=>{if(v.nodeType===Node.ELEMENT_NODE)if(v.tagName==="P"||v.tagName==="DIV")u.insertBefore(v,c);else{const h=document.createElement("p");h.appendChild(v.cloneNode(!0)),u.insertBefore(h,c)}else if(v.nodeType===Node.TEXT_NODE&&v.textContent.trim()){const h=document.createElement("p");h.appendChild(v.cloneNode(!0)),u.insertBefore(h,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 v=[],h=document.createTreeWalker(u,NodeFilter.SHOW_TEXT,{acceptNode:N=>N.parentNode===u&&N.textContent.trim()?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});let _;for(;_=h.nextNode();)v.push(_);if(v.forEach(N=>{const Q=document.createElement("p");N.parentNode.insertBefore(Q,N),Q.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(()=>{a&&et(a),Nn(),Be(),qt()})},io=()=>{if(!p.value)return;const o=window.getSelection();if(o.rangeCount===0)return;const a=o.getRangeAt(0).commonAncestorContainer,r=a.nodeType===1?a.tagName==="BLOCKQUOTE"?a:a.closest("blockquote"):a.parentElement?.closest("blockquote");if(!r||!p.value.contains(r))return;const c=_=>{if(!_)return!1;const $=_.textContent||"",Q=(_.innerHTML||"").trim();return $.trim()===""||Q===""||Q==="<br>"||Q==="<br/>"||Q==="<p></p>"||Q==="<p><br></p>"||Q==="<p><br/></p>"||Q==="<p> </p>"||Q==="<p><br> </p>"||Q==="<div></div>"||Q==="<div><br></div>"||Q==="<div><br/></div>"};let d=null;for(a.nodeType===3?d=a.parentElement:a.tagName==="P"||a.tagName==="DIV"?d=a:d=a.closest("p, div"),d&&r.contains(d)&&c(d)&&d.remove();r.lastChild;){const _=r.lastChild;if(_.nodeType===1&&_.tagName==="BR")_.remove();else if(_.nodeType===3)if((_.textContent||"").trim()==="")_.remove();else break;else break}if(r.children.length>0)for(let _=r.children.length-1;_>=0;_--){const $=r.children[_];if(($.tagName==="P"||$.tagName==="DIV")&&c($))$.remove();else break}let u=r.innerHTML;const m=u;u=u.replace(/(<br\s*\/?>)+$/gi,""),u!==m&&(r.innerHTML=u);const v=document.createElement("p");v.innerHTML="<br>",r.parentNode?r.nextSibling?r.parentNode.insertBefore(v,r.nextSibling):r.parentNode.appendChild(v):p.value&&p.value.appendChild(v);const h=document.createRange();h.selectNodeContents(v),h.collapse(!0),o.removeAllRanges(),o.addRange(h),e.nextTick(()=>{Nn(),Be()})},Vn=()=>{if(!p.value){ve.value=!1;return}try{const o=window.getSelection();if(o.rangeCount>0){const a=o.getRangeAt(0).commonAncestorContainer,r=a.nodeType===1?a.closest("a"):a.parentElement?.closest("a");ve.value=!!r}else ve.value=!1}catch{ve.value=!1}},co=()=>{if(!p.value)return;const o=window.getSelection();o&&o.rangeCount>0&&o.getRangeAt(0),xt.value=yn();const l=window.getSelection();let a="";l.rangeCount>0&&(a=l.getRangeAt(0).toString()),Ie.value="",O.value=a,Tt.value="",we.value=null,Ae.value=!0,At(),e.nextTick(()=>{rt.value&&rt.value.focus()})},ql=()=>{if(!p.value)return;Ue.value?(xe.value&&(clearTimeout(xe.value),xe.value=null),Se(),Ue.value=!1):Se();const o=window.getSelection();let l=null;if(o.rangeCount>0){const r=o.getRangeAt(0).commonAncestorContainer;l=r.nodeType===1?r.closest("a"):r.parentElement?.closest("a")}if(!l&&we.value&&(l=we.value),l&&l.parentNode){const a=document.createDocumentFragment();for(;l.firstChild;)a.appendChild(l.firstChild);if(l.parentNode.replaceChild(a,l),a.firstChild){const r=document.createRange();r.setStartBefore(a.firstChild),r.setEndAfter(a.lastChild||a.firstChild),o.removeAllRanges(),o.addRange(r),document.execCommand("removeFormat",!1),r.collapse(!1),o.removeAllRanges(),o.addRange(r)}we.value=null}else ot("unlink");ve.value=!1,At(),e.nextTick(()=>{Be(),Vn()})},uo=()=>{k.disabled||!k.richText||p.value&&(Ue.value?(xe.value&&(clearTimeout(xe.value),xe.value=null),Se(),Ue.value=!1):Se(),At(),p.value.focus(),document.execCommand("insertUnorderedList",!1),e.nextTick(()=>{Mn(),Be(),qt()}))},el=()=>{k.disabled||!k.richText||p.value&&(Ue.value?(xe.value&&(clearTimeout(xe.value),xe.value=null),Se(),Ue.value=!1):Se(),At(),p.value.focus(),document.execCommand("insertOrderedList",!1),e.nextTick(()=>{Mn(),Be(),qt()}))},mo=o=>{const l=o.parentElement;if(!l||l.tagName!=="OL")return null;let a=0,r=o.previousElementSibling;for(;r;)r.tagName==="LI"&&a++,r=r.previousElementSibling;return a+1},Mn=()=>{if(!p.value)return;p.value.querySelectorAll("li > ol").forEach(l=>{const a=l.parentElement;if(a&&a.tagName==="LI"){const r=mo(a);r!==null&&Array.from(l.children).filter(d=>d.tagName==="LI").forEach(d=>{d.setAttribute("data-parent-num",String(r))})}})},po=()=>{if(k.disabled||!k.richText||!p.value)return;At(),p.value.focus();const o=window.getSelection();if(o.rangeCount===0)return;const l=o.getRangeAt(0),a=l.commonAncestorContainer.nodeType===1?l.commonAncestorContainer.closest("li"):l.commonAncestorContainer.parentElement?.closest("li");if(!a){document.execCommand("indent",!1),e.nextTick(()=>{Mn(),Be()});return}const r=a.parentElement;if(!r||r.tagName!=="OL"&&r.tagName!=="UL")return;const c=a.previousElementSibling;if(c&&c.tagName==="LI"){const d=r.tagName.toLowerCase();let u=c.querySelector(`:scope > ${d}`);u||(u=document.createElement(d),c.appendChild(u));const m=mo(c);u.appendChild(a),m!==null&&r.tagName==="OL"&&a.setAttribute("data-parent-num",String(m)),Mn();const v=document.createRange();v.selectNodeContents(a),v.collapse(!1),o.removeAllRanges(),o.addRange(v),e.nextTick(()=>{Be(),qt()})}else document.execCommand("indent",!1),e.nextTick(()=>{Mn(),Be(),qt()})},fo=()=>{if(k.disabled||!k.richText||!p.value)return;At(),p.value.focus();const o=window.getSelection();if(o.rangeCount===0)return;const l=o.getRangeAt(0),a=l.commonAncestorContainer.nodeType===1?l.commonAncestorContainer.closest("li"):l.commonAncestorContainer.parentElement?.closest("li");if(!a){document.execCommand("outdent",!1),e.nextTick(()=>{Mn(),Be()});return}const r=a.parentElement;if(!r||r.tagName!=="OL"&&r.tagName!=="UL")return;const c=r.parentElement;if(c&&c.tagName==="LI"){const d=c.parentElement;if(d&&(d.tagName==="OL"||d.tagName==="UL")){r.tagName==="OL"&&a.removeAttribute("data-parent-num"),d.insertBefore(a,c.nextSibling),r.children.length===0&&r.remove(),Mn();const u=document.createRange();u.selectNodeContents(a),u.collapse(!1),o.removeAllRanges(),o.addRange(u),e.nextTick(()=>{Be(),qt()});return}}document.execCommand("outdent",!1),e.nextTick(()=>{Mn(),Be(),qt()})},mn=e.ref(null),Pn=e.ref(null),ml=e.ref({}),Cn=e.ref(""),Gn=e.ref(null),tl=e.ref("");e.ref("");const nl=e.ref(null);e.ref("");const _n=e.ref([]),Ul=e.ref(!1),Bl=e.ref(!1),Eo=o=>{if(!o)return"";const l=o.cloneRange(),a=document.createElement("div");return a.appendChild(l.cloneContents()),a.innerHTML},Xl=()=>{if(k.disabled||!k.richText||!p.value)return;if(mn.value!==null){mn.value=null,Cn.value="",tl.value="",nl.value=null,_n.value=[],vl(!0);return}At(),p.value.focus();const o=window.getSelection();if(!o||o.rangeCount===0)return;const l=o.getRangeAt(0);if(l.collapsed||!Qn(l))return;tl.value=Eo(l)||"",nl.value=yn();const a=l.getBoundingClientRect(),r=p.value.parentElement;if(!r)return;const c=r.getBoundingClientRect(),d=a.bottom-c.top,m=Math.max(d+8,0);ml.value={top:`${m}px`,bottom:"auto"},mn.value=Date.now(),e.nextTick(()=>{if(Cn.value="",Gn.value){const h=Gn.value;h.style.height="auto",h.style.height=`${h.scrollHeight}px`,h.focus()}const v=r.querySelector(".dss-comment-overlay");if(v&&r){const h=r.querySelector(".dss-text-editor-footer");if(h){const _=r.getBoundingClientRect(),$=v.getBoundingClientRect(),N=h.getBoundingClientRect(),Q=$.bottom-_.top,Y=N.top-_.top,Le=8;if(Q>Y-Le){const me=N.height;ml.value={bottom:`${me+Le}px`,top:"auto"}}else ml.value={top:`${m}px`,bottom:"auto"}}}})},Al=()=>{if(!Cn.value.trim())return;const o=Cn.value.trim(),l=new Date,a={text:o,selectionText:tl.value,selectionRange:nl.value,commentId:mn.value,user:k.commentUser||null,createdAt:l.toISOString()};_n.value=[..._n.value,a],$e("comment-submitted",a),No(a),nl.value&&!Vo(nl.value)&&Yl(mn.value,nl.value),Cn.value="",e.nextTick(()=>{if(Gn.value){const r=Gn.value;r.style.height="auto",r.style.height=`${r.scrollHeight}px`,r.focus()}Zn("sendComment")})},vo=(o,l)=>{if(!(!k.commentUser||!o.user||o.user.id!==k.commentUser.id)){if(_n.value=_n.value.filter((a,r)=>r!==l),mn.value!==null&&p.value){const a=String(mn.value),r=p.value.querySelector(`[data-comment="${a}"], [data-fake-comment="${a}"]`);if(r&&_n.value.length>0){const c=[],d=new Set;_n.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?r.setAttribute("data-comment-user",JSON.stringify(c[0])):r.removeAttribute("data-comment-user"),c.length>1?r.setAttribute("data-comment-user-2",JSON.stringify(c[1])):r.removeAttribute("data-comment-user-2"),r.setAttribute("data-comment-count",String(_n.value.length))}else r&&_n.value.length===0&&(r.removeAttribute("data-comment-user"),r.removeAttribute("data-comment-user-2"),r.setAttribute("data-comment-count","0"))}if($e("comment-deleted",{comment:o,index:l,commentId:mn.value}),k.comments&&Array.isArray(k.comments)){const a=k.comments.filter(r=>!(r.commentId===o.commentId&&r.text===o.text&&r.user?.id===o.user?.id));$e("update:comments",a)}e.nextTick(()=>{Zn("deleteComment")})}},Vo=o=>{if(!o||!p.value)return!1;try{const l=go(o);if(!l)return!1;const a=l.commonAncestorContainer,r=a.nodeType===3?a.parentElement:a;if(r)return!!r.closest("[data-comment], [data-fake-comment]")}catch{}return!1},go=o=>{if(!o||!p.value)return null;try{const l=document.createRange();if(o.type==="element"&&o.element)return p.value.contains(o.element)?(l.setStart(o.element,o.offset),l.collapse(!0),l):null;let a=0;const r=[p.value];let c=null,d=!1,u=!1;for(;!u&&(c=r.pop());)if(c.nodeType===3){const m=a+c.length;!d&&o.start>=a&&o.start<=m&&(l.setStart(c,o.start-a),d=!0),d&&o.end>=a&&o.end<=m&&(l.setEnd(c,o.end-a),u=!0),a=m}else{let m=c.childNodes.length;for(;m--;)r.push(c.childNodes[m])}return d?l:null}catch{return null}},Yl=(o,l)=>{if(!(!o||!l||!p.value))try{const a=go(l);if(!a||a.collapsed)return;const r=a.commonAncestorContainer,c=r.nodeType===3?r.parentElement:r;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=a.startContainer,v=a.endContainer,h=a.startOffset,_=a.endOffset,$=m.nodeType===3?m.parentNode:m,N=v.nodeType===3?v.parentNode:v;if($===N&&h===0&&_===(v.nodeType===3?v.length:N.childNodes.length)&&($.tagName==="P"||$.tagName==="DIV"||$.tagName==="H1"||$.tagName==="H2"||$.tagName==="H3"||$.tagName==="H4"||$.tagName==="H5"||$.tagName==="H6")){const Y=a.extractContents();d.appendChild(Y),a.insertNode(d)}else a.surroundContents(d)}catch{const v=a.extractContents();d.appendChild(v),a.insertNode(d)}const u=p.value.querySelector(`[data-comment="${String(o)}"]`);e.nextTick(()=>{Zn("wrapSelectionWithCommentMarker"),Be()})}catch{}},No=o=>{if(!o||!o.commentId)return;const l=Array.isArray(k.comments)?[...k.comments]:[],a=typeof o.commentId=="string"&&o.commentId.startsWith("comment-")?Date.now():Number(o.commentId)||o.commentId;let r=l.findIndex(d=>typeof d.conversation_id=="string"&&d.conversation_id.startsWith("comment-")?null:Number(d.conversation_id)===Number(a)||d.conversation_id===a);const c={text:o.text,user:o.user,createdAt:o.createdAt,created_at:o.createdAt,updated_at:o.createdAt};if(r>=0){const d=l[r];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(v=>v.article_id)?.article_id||null,m={conversation_id:a,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)}Ul.value=!0,$e("update:comments",l)},jl=(o,l=[])=>{if(k.disabled||!k.richText||!p.value)return;const a=p.value;let r=null;try{r=a.querySelector(o)}catch{return}if(!r)return;At(),a.focus();const c=document.createRange();c.selectNodeContents(r);const d=window.getSelection();d&&(d.removeAllRanges(),d.addRange(c)),tl.value=r.innerHTML||"",nl.value=yn();const u=c.getBoundingClientRect(),m=a.parentElement;if(m){const _=m.getBoundingClientRect(),$=u.bottom-_.top,Q=Math.max($+8,0);ml.value={top:`${Q}px`,bottom:"auto"}}const v=r.getAttribute("data-comment")||r.getAttribute("data-fake-comment");let h=[];if(v&&k.comments&&Array.isArray(k.comments)){const _=k.comments.find($=>String($.conversation_id)===String(v));if(_&&_.conversation&&Array.isArray(_.conversation)){const $=_.conversation.map(N=>({id:N.id||N.commentary_id,commentary_id:N.id||N.commentary_id,conversation_id:_.id||_.conversation_id,text:N.text,user:N.user,createdAt:N.created_at||N.createdAt,updated_at:N.updated_at||N.updatedAt}));h.push(...$)}}h.length===0&&Array.isArray(l)&&l.length>0&&(h=l.slice()),h.sort((_,$)=>{const N=Le=>{if(!Le)return 0;const me=new Date(Le).getTime();return isNaN(me)?0:me},Q=N(_.createdAt),Y=N($.createdAt);return Q===Y?0:Q-Y}),_n.value=h,vl(!0),mn.value=v||null,r&&(Pn.value=r,r.classList.add("editor-comment-highlighted")),e.nextTick(()=>{if(Cn.value="",Gn.value){const _=Gn.value;_.style.height="auto",_.style.height=`${_.scrollHeight}px`,_.focus()}if(m){const _=m.querySelector(".dss-comment-overlay");if(_){const $=m.querySelector(".dss-text-editor-footer");if($){const N=m.getBoundingClientRect(),Q=_.getBoundingClientRect(),Y=$.getBoundingClientRect(),Le=Q.bottom-N.top,me=Y.top-N.top,ct=8;if(Le>me-ct){const Qt=Y.height;ml.value={bottom:`${Qt+ct}px`,top:"auto"}}}}}Zn("openCommentOverlayForSelector")})},pn=e.ref(null),I=e.ref(0),fn=o=>{if(!(k.disabled||!k.richText)){if(o.key==="Escape"){const l=window.getSelection();if(l.rangeCount>0){const r=l.getRangeAt(0).commonAncestorContainer,c=r.nodeType===1?r.tagName==="BLOCKQUOTE"?r:r.closest("blockquote"):r.parentElement?.closest("blockquote");if(!!(c&&p.value&&p.value.contains(c))){o.preventDefault();let u=null;r.nodeType===3?u=r.parentElement:r.tagName==="P"||r.tagName==="DIV"?u=r:u=r.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(()=>{io()},50);return}}}if(o.key.length===1||o.key==="Enter"){const l=window.getSelection();if(l&&l.rangeCount>0){const a=l.getRangeAt(0),r=a.commonAncestorContainer,c=r.nodeType===3?r.parentElement:r;if(c){const d=c.closest(".dss-image-wrapper");if(d){const u=d.querySelector("img");if(c!==u&&!u?.contains(c)){const m=a.startContainer.nodeType===3?a.startContainer.parentElement:a.startContainer,v=a.endContainer.nodeType===3?a.endContainer.parentElement:a.endContainer;if(d.contains(m)&&m!==u||d.contains(v)&&v!==u){o.preventDefault();const h=document.createRange();h.setStartAfter(d),h.collapse(!0),l.removeAllRanges(),l.addRange(h);return}}}}}}if(o.key==="Backspace"||o.key==="Delete"){const l=window.getSelection();if(l.rangeCount>0){const a=l.getRangeAt(0);let r=null,c=null;if(a.collapsed)if(o.key==="Backspace"){const d=a.startContainer;let u=d;d.nodeType===3&&(a.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"&&(r=m,c=r.closest(".dss-image-wrapper"))),c||(c=u.closest(".dss-image-wrapper"),c&&(r=c.querySelector("img")))}else{const d=a.startContainer;let u=d;d.nodeType===3&&(a.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"&&(r=m,c=r.closest(".dss-image-wrapper"))),c||(c=u.closest(".dss-image-wrapper"),c&&(r=c.querySelector("img")))}else{const d=a.commonAncestorContainer,u=a.startContainer.nodeType===3?a.startContainer.parentElement:a.startContainer,m=a.endContainer.nodeType===3?a.endContainer.parentElement:a.endContainer;if(d.nodeType===1&&d.tagName==="IMG"?(r=d,c=r.closest(".dss-image-wrapper")):(r=d.querySelector("img"),r&&(c=r.closest(".dss-image-wrapper"))),c){const v=c.contains(u)||u===c,h=c.contains(m)||m===c,$=a.cloneContents().textContent?.trim()||"",N=c.textContent?.trim()||"";(!v||!h||$.length>N.length)&&(c=null,r=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(()=>{Be()});return}}}}if(o.key==="Tab"){o.preventDefault(),o.shiftKey?fo():po();return}if(o.key==="Enter"){const l=window.getSelection();if(l.rangeCount>0){const a=l.getRangeAt(0);if(a.collapsed){const u=a.startContainer,m=v=>{if(!v)return!1;let h=v.previousSibling;for(;h;){if(h.classList&&h.classList.contains("dss-image-wrapper")||h.tagName==="IMG"||h.querySelector&&h.querySelector(".dss-image-wrapper")||h.querySelector&&h.querySelector("img"))return!0;h=h.previousSibling}const _=v.parentElement;return _&&_!==p.value?m(_):!1};if(u.nodeType===3){const v=u.parentElement;if(v&&(m(v)||m(u))){const h=v.closest("p, div");if(h&&h!==p.value){o.preventDefault(),o.stopPropagation();let _=null;const $=a.startOffset;$<u.length&&(_=u.splitText($));const N=document.createElement("p");if(_?N.appendChild(_):N.innerHTML="<br>",u.length===0){const Y=u.parentElement;Y&&(Y.removeChild(u),Y.childNodes.length===0&&Y.appendChild(document.createElement("br")))}h.nextSibling?h.parentNode.insertBefore(N,h.nextSibling):h.parentNode.appendChild(N);const Q=document.createRange();_?Q.setStart(_,0):Q.setStart(N,0),Q.collapse(!0),l.removeAllRanges(),l.addRange(Q),e.nextTick(()=>{Be()});return}}}}const r=a.commonAncestorContainer,c=r.nodeType===1?r.tagName==="BLOCKQUOTE"?r:r.closest("blockquote"):r.parentElement?.closest("blockquote");if(!!(c&&p.value&&p.value.contains(c))){let u=null;r.nodeType===3?u=r.parentElement:r.tagName==="P"||r.tagName==="DIV"?u=r:u=r.closest("p, div");const m=Y=>{if(!Y)return!1;const Le=Y.textContent||"",ct=(Y.innerHTML||"").trim(),Qt=ct.replace(/<br\s*\/?>/gi,"").trim();return Le.trim()===""||ct===""||Qt===""||ct==="<br>"||ct==="<br/>"||ct==="<p></p>"||ct==="<p><br></p>"||ct==="<p><br/></p>"||ct==="<p> </p>"||ct==="<p><br> </p>"||ct==="<div></div>"||ct==="<div><br></div>"||ct==="<div><br/></div>"},v=c.lastChild,h=v&&v.nodeType===1&&v.tagName==="BR",_=a.startContainer,$=_.nodeType===3?_.parentElement:_,N=$===c||$&&$.parentElement===c;if(u&&m(u)||h&&N){o.preventDefault(),setTimeout(()=>{io()},50);return}}}}if(o.key===" "){const l=Date.now(),a=l-I.value;if(pn.value===" "&&a<300){const r=window.getSelection();if(r.rangeCount>0){const c=r.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(),po();return}}}}pn.value=" ",I.value=l}else pn.value=o.key}},On=o=>{if(k.disabled||!k.richText)return;o.preventDefault();let l=o.clipboardData.getData("text/html"),a=o.clipboardData.getData("text/plain");l&&(l=l.replace(/<!--[\s\S]*?-->/g,"")),a&&(a=a.replace(/<!--[\s\S]*?-->/g,"")),Se();const r=window.getSelection();let c=null;if(r&&r.rangeCount>0){let m=r.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 v=new DOMParser().parseFromString(u,"text/html");let h=p.value.querySelector("h1")?1:0;if(v.querySelectorAll("h1").forEach($=>{if(h>0){const N=v.createElement("p");N.innerHTML=$.innerHTML,$.parentNode.replaceChild(N,$)}else h++}),c){const $=["P","H1","H2","H3","H4","H5","H6","DIV","BLOCKQUOTE","UL","OL","LI"],N=Array.from(v.body.children).filter(Q=>$.includes(Q.tagName));if(N.length===1){const Q=N[0].tagName,Y=c.tagName,Le=c.textContent.trim()===""&&!c.querySelector("img");let me=!1;if(["H1","H2","H3","H4","H5","H6"].includes(Y)?me=!0:Le||(Q===Y||Q==="P")&&(me=!0),me)return N[0].innerHTML.trim()}}return v.body.innerHTML.trim()};if(l){const u=d(l);document.execCommand("insertHTML",!1,u)}else if(a)if(/<[a-z][\s\S]*>/i.test(a)){const m=d(a);document.execCommand("insertHTML",!1,m)}else document.execCommand("insertText",!1,a);Be()},cn=o=>{if(ue.value){const a=o.target;!a.closest(".dss-toolbar-dropdown")&&!a.closest(".dss-toolbar-dropdown-toggle")&&At()}if(ge.value){const a=o.target,r=a.closest(".dss-floating-toolbar"),c=p.value&&a.closest(".dss-text-editor-content");!r&&!c&&ol()}if(at.value){const a=o.target,r=a.closest(".dss-floating-toolbar"),c=a.closest(".dss-toolbar-dropdown");!r&&!c&&yo()}const l=o.target;if(!l.closest(".dss-toolbar-dropdown")&&!l.closest(".dss-toolbar-dropdown-submenu")&&(We.value=null),!p.value||!l.closest(".dss-text-editor-content")){const a=window.getSelection();if(a&&a.rangeCount>0){const r=a.getRangeAt(0);wt.value=!r.collapsed&&Qn(r)}else wt.value=!1}if(mn.value!==null){const a=document.querySelector(".dss-comment-overlay");let r=!1;if(a){const u=a.getBoundingClientRect(),m=o.clientX,v=o.clientY;r=m>=u.left&&m<=u.right&&v>=u.top&&v<=u.bottom}const c=l.closest(".dss-toolbar-button"),d=c&&c.getAttribute("title")==="Comment";!r&&!d&&(mn.value=null,Cn.value="",tl.value="",nl.value=null,_n.value=[],vl(!0))}},Un=(o,l)=>{o&&o.stopPropagation&&o.stopPropagation(),ft.value&&(clearTimeout(ft.value),ft.value=null),We.value=l},zt=o=>{const l=o.relatedTarget;if(l){const a=l.closest(".dss-toolbar-dropdown-submenu"),r=l.closest(".dss-toolbar-dropdown-item-has-submenu");if(a||r)return}ft.value&&clearTimeout(ft.value),ft.value=setTimeout(()=>{We.value=null,ft.value=null},150)},nn=o=>{We.value=null};let ll=0;const pl=o=>{if(!o)return;const l=Array.from(o.children);l.forEach(a=>{a.classList.contains("dss-toolbar-dropdown-submenu")||a.classList.contains("dss-toolbar-dropdown-item-has-submenu")||(a.tagName==="BUTTON"||a.tagName==="DIV")&&!a.classList.contains("dss-toolbar-dropdown-item")&&a.classList.add("dss-toolbar-dropdown-item")}),l.forEach((a,r)=>{if(a.classList.contains("dss-toolbar-dropdown-item-has-submenu")||a.classList.contains("dss-toolbar-dropdown-submenu")||!a.classList.contains("dss-toolbar-dropdown-item"))return;const c=Array.from(a.children).find(m=>m.tagName==="DIV"?m.classList.contains("dss-toolbar-dropdown-item")?!1:Array.from(m.children).filter(h=>h.tagName==="BUTTON"||h.tagName==="DIV").length>0:!1),d=a.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-${++ll}`;a.classList.add("dss-toolbar-dropdown-item-has-submenu"),a.setAttribute("data-submenu-id",m);let v=null;c?(a.tagName==="BUTTON"&&a.parentNode.insertBefore(c,a.nextSibling),c.classList.add("dss-toolbar-dropdown-submenu"),v=c):u&&(d.classList.add("dss-toolbar-dropdown-submenu"),v=d),v&&(v.setAttribute("data-submenu-id",m),v.setAttribute("data-processed","true"),c&&a.tagName!=="BUTTON"?v.dataset.originalParentRef="inside":v.dataset.originalParentRef="sibling",Array.from(v.children).forEach(_=>{(_.tagName==="BUTTON"||_.tagName==="DIV")&&!_.classList.contains("dss-toolbar-dropdown-item")&&_.classList.add("dss-toolbar-dropdown-item")}))}})},_t=()=>{document.querySelectorAll(".dss-toolbar-dropdown").forEach(l=>{pl(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=v=>{const h=c.getAttribute("data-submenu-id");h&&Un(v,h)},m=zt;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=h=>{const _=c.getAttribute("data-submenu-id");_&&Un(h,_)},m=zt;c.addEventListener("mouseenter",u),c.addEventListener("mouseleave",m),c._subMenuHandlers={enter:u,leave:m},c.querySelectorAll(".dss-toolbar-dropdown-item").forEach(h=>{h.addEventListener("click",nn)})})})};let ht=null;const it=()=>{if(We.value){const o=document.querySelector(`.dss-toolbar-dropdown-submenu[data-submenu-id="${We.value}"]`),l=document.querySelector(`.dss-toolbar-dropdown-item-has-submenu[data-submenu-id="${We.value}"]`);o&&l&&sl(o,l)}if(ge.value&&qt(),k.richText){if(ht!==null)return;ht=setTimeout(()=>{ht=null,Zn("handleWindowResize")},150)}},Rt=()=>{if(!k.richText)return;document.querySelectorAll(".dss-toolbar-custom-group").forEach(l=>{Array.from(l.children).filter(r=>r.tagName==="DIV"&&!r.classList.contains("dss-toolbar-button")).forEach(r=>{r.classList.add("dss-toolbar-button")})})},So=()=>{const o=document.querySelectorAll(".dss-text-editor-footer, .dss-text-editor-footer-content, .dss-text-editor-footer-stat, .dss-text-editor-footer-separator"),l=a=>{if(a.preventDefault(),a.stopPropagation(),window.getSelection){const r=window.getSelection();r.removeAllRanges?r.removeAllRanges():r.empty&&r.empty()}return!1};o.forEach(a=>{a.addEventListener("selectstart",l),a.addEventListener("mousedown",l),a.addEventListener("dragstart",l),a.addEventListener("contextmenu",l),a.addEventListener("click",r=>{if(window.getSelection){const c=window.getSelection();c.removeAllRanges&&c.removeAllRanges()}})})};e.onMounted(()=>{if(e.nextTick(()=>{requestAnimationFrame(()=>{De.value?gn():ul(),re.value?dl():Vt()})}),e.nextTick(()=>{So()}),k.richText&&p.value){try{document.execCommand("defaultParagraphSeparator",!1,"p")}catch{}document.addEventListener("click",cn),window.addEventListener("resize",it);let o=null;const l=()=>{o===null&&(o=setTimeout(()=>{o=null,it()},150))};window.addEventListener("scroll",l,!0),p.value._windowScrollHandler=l,p.value._windowScrollTimeout=o,p.value.closest(".editor-with-comments"),p.value.closest(".dss-text-editor-content-wrapper");const a=p.value.closest(".dss-text-editor-content");let r=null;const c=()=>{r===null&&(r=setTimeout(()=>{r=null,it()},150))};a&&(a.addEventListener("scroll",c),p.value._scrollHandlers={wrapper:null,content:a,handler:c}),e.nextTick(()=>{_t(),Rt()}),p.value.addEventListener("click",m=>{const v=m.target;v.closest("a")&&!k.disabled&&m.preventDefault();const _=v.closest(".dss-image-no-alt-icon"),$=v.closest(".dss-image-wrapper");if(_||$&&v===$){m.preventDefault(),m.stopPropagation();const N=window.getSelection(),Q=document.createRange();Q.setStartAfter($),Q.collapse(!0),N.removeAllRanges(),N.addRange(Q)}else $&&v.tagName!=="IMG"&&(m.preventDefault(),e.nextTick(()=>{const N=window.getSelection();if(N.rangeCount>0){const Y=N.getRangeAt(0).commonAncestorContainer,Le=Y.nodeType===3?Y.parentElement:Y;if($.contains(Le)&&Le!==$.querySelector("img")){const me=document.createRange();me.setStartAfter($),me.collapse(!0),N.removeAllRanges(),N.addRange(me)}}else{const Q=document.createRange();Q.setStartAfter($),Q.collapse(!0),N.addRange(Q)}}))},!0),p.value.addEventListener("mousedown",m=>{const v=m.target,h=v.closest(".dss-image-no-alt-icon"),_=v.closest(".dss-image-wrapper");if(h||_&&v.tagName!=="IMG"){m.preventDefault();const $=window.getSelection(),N=document.createRange();_&&(N.setStartAfter(_),N.collapse(!0),$.removeAllRanges(),$.addRange(N))}},!0),p.value.addEventListener("paste",m=>{e.nextTick(()=>{if(!p.value)return;p.value.querySelectorAll("img").forEach(h=>{if(!h.closest(".dss-image-wrapper"))h.removeAttribute("alt"),h.removeAttribute("data-alt"),h.setAttribute("alt",""),h.setAttribute("data-alt",""),h.alt="";else{const $=h.getAttribute("alt")||h.alt||"";if($){const N=h.getAttribute("src")||h.src||"",Q=N.replace(/^https?:\/\//,"").replace(/^data:.*,/,""),Y=$===N||$===Q;($.startsWith("http://")||$.startsWith("https://")||$.startsWith("data:")||Y||Y)&&(h.setAttribute("alt",""),h.setAttribute("data-alt",""),h.alt="")}}}),he()})}),p.value.addEventListener("dragstart",m=>{const v=m.target,h=v.tagName==="IMG"?v:v.closest("img"),_=h?.closest(".dss-image-wrapper");h&&p.value.contains(h)&&(Re.value=_||h,m.dataTransfer.effectAllowed="move",m.dataTransfer.setData("text/html","image-drag"))}),p.value.addEventListener("dragover",m=>{Re.value&&(m.preventDefault(),m.stopPropagation(),m.dataTransfer.dropEffect="move")}),p.value.addEventListener("dragenter",m=>{Re.value&&(m.preventDefault(),m.stopPropagation())}),p.value.addEventListener("drop",m=>{if(!Re.value||!p.value)return;m.preventDefault(),m.stopPropagation();const v=Re.value,h=v.classList?.contains("dss-image-wrapper"),_=h?v.querySelector("img"):v,$=h?v:_?.closest(".dss-image-wrapper");if(!_||!p.value.contains(_)){Re.value=null;return}let N=null;const Q=m.clientX,Y=m.clientY;if(document.caretRangeFromPoint)N=document.caretRangeFromPoint(Q,Y);else{const Xt=window.getSelection();Xt.rangeCount>0?N=Xt.getRangeAt(0).cloneRange():(N=document.createRange(),N.selectNodeContents(p.value),N.collapse(!1))}if(!N){Re.value=null;return}const Le=N.commonAncestorContainer,me=Le.nodeType===3?Le.parentElement:Le;if(me?.closest(".dss-image-wrapper")===$||$&&$.contains(me)){Re.value=null;return}if($&&(me===$||$.contains(me))){Re.value=null;return}const Qt=_.getAttribute("src");let Jt=null;$?Jt=$.cloneNode(!0):Jt=_.cloneNode(!0);try{let Xt=N.startContainer;if(Xt.nodeType===3&&(Xt=Xt.parentElement),$&&(Xt===$||$.contains(Xt))){const Kt=document.createRange();Kt.setStartAfter($),Kt.collapse(!0),N=Kt}N.insertNode(Jt);const Pt=document.createRange();Pt.setStartAfter(Jt),Pt.collapse(!0);const en=window.getSelection();en.removeAllRanges(),en.addRange(Pt)}catch{if(p.value.childNodes.length===0){const Pt=document.createElement("p");Pt.appendChild(Jt),p.value.appendChild(Pt)}else{const Pt=p.value.lastChild;if(Pt&&Pt.nodeType===1)Pt.appendChild(Jt);else{const en=document.createElement("p");en.appendChild(Jt),p.value.appendChild(en)}}}$?$.remove():_.remove(),Re.value=null,e.nextTick(()=>{const Xt=p.value.querySelectorAll("img");let Pt=!1;Xt.forEach(en=>{if(en.getAttribute("src")===Qt)if(!Pt)Pt=!0;else{const Kt=en.closest(".dss-image-wrapper");Kt?Kt.remove():en.remove()}}),he(),Be()})}),p.value.addEventListener("dragend",m=>{Re.value=null});let d=null;const u=new MutationObserver(m=>{m.forEach(v=>{v.addedNodes.forEach(h=>{if(h.nodeType===1){h.tagName==="IMG"&&(h.removeAttribute("alt"),h.removeAttribute("data-alt"),h.setAttribute("alt",""),h.setAttribute("data-alt",""),h.alt="");const _=h.querySelectorAll&&h.querySelectorAll("img");_&&_.forEach($=>{$.removeAttribute("alt"),$.removeAttribute("data-alt"),$.setAttribute("alt",""),$.setAttribute("data-alt",""),$.alt=""})}})}),d&&clearTimeout(d),d=setTimeout(()=>{he(),Rt(),d=null},100)});if(u.observe(p.value,{childList:!0,subtree:!0}),e.nextTick(()=>{const m=document.querySelector(".dss-text-editor-toolbar");if(m){const v=new MutationObserver(()=>{e.nextTick(()=>{Rt()})});v.observe(m,{childList:!0,subtree:!0}),m._toolbarMutationObserver=v}}),k.modelValue){const m=zn(k.modelValue);p.value.innerHTML=m,Mt()}e.nextTick(()=>{const m=p.value.innerHTML||"",v=k.title||"",h=k.description||"";X.value=m,j.value=v,ie.value=h,E.value=v,C.value=h,Mn(),he(),W(),Xn(),no(),Ql()}),Vn(),Nn(),p.value._mutationObserver=u}}),e.onUnmounted(()=>{if(document.removeEventListener("click",cn),window.removeEventListener("resize",it),p.value&&p.value._windowScrollHandler&&window.removeEventListener("scroll",p.value._windowScrollHandler,!0),ht!==null&&(clearTimeout(ht),ht=null),p.value&&p.value._windowScrollTimeout!==null&&clearTimeout(p.value._windowScrollTimeout),xe.value&&clearTimeout(xe.value),ft.value&&clearTimeout(ft.value),p.value&&p.value._mutationObserver&&p.value._mutationObserver.disconnect(),Je.value&&Je.value.disconnect(),vn.value!==null&&(cancelAnimationFrame(vn.value),vn.value=null),jt.value!==null&&(clearTimeout(jt.value),jt.value=null),Wt.value!==null&&(clearTimeout(Wt.value),Wt.value=null),vl(!0),p.value&&p.value._scrollHandlers){const{wrapper:l,content:a,handler:r}=p.value._scrollHandlers;l&&l.removeEventListener("scroll",r),a&&a.removeEventListener("scroll",r)}const o=document.querySelector(".dss-text-editor-toolbar");o&&o._toolbarMutationObserver&&o._toolbarMutationObserver.disconnect()});const ho=o=>{const l=o.target,a=l.closest("a");if(a&&!k.disabled){o.preventDefault();const c=document.createRange();c.selectNodeContents(a);const d=window.getSelection();d.removeAllRanges(),d.addRange(c)}const r=l.closest(".dss-image-wrapper");r&&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(r.contains(m)&&m!==r.querySelector("img")){const v=document.createRange();v.setStartAfter(r),v.collapse(!0),c.removeAllRanges(),c.addRange(v)}}he(),Vn(),Nn(),qt(),Xn()}):e.nextTick(()=>{he(),Vn(),Nn(),qt(),Xn()})},yl=()=>{G();const o=window.getSelection();if(o&&o.rangeCount>0){const a=o.getRangeAt(0);wt.value=!a.collapsed&&Qn(a),!a.collapsed&&Ge.value&&(Ge.value=null)}else wt.value=!1;if(he(),Vn(),Nn(),qt(),Xn(),o&&o.rangeCount>0){const r=o.getRangeAt(0).commonAncestorContainer,c=r.nodeType===3?r.parentElement:r;if(c&&c.closest(".dss-text-editor-footer")){o.removeAllRanges(),wt.value=!1;return}}["bold","italic","underline"].forEach(a=>{try{const r=window.getSelection();if(r.rangeCount>0){const c=r.getRangeAt(0);if(!c.collapsed)if(a==="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 v=window.getComputedStyle(u);parseInt(v.fontWeight)>=600&&(m=!0)}catch{}Ze.value[a]=m}else{const d=document.queryCommandState(a);Ze.value[a]=d}}}catch{}})},Xn=()=>{if(!k.richText||k.disabled||!p.value){tt.value="p";return}try{const o=window.getSelection();if(!o||o.rangeCount===0){tt.value="p";return}const a=o.getRangeAt(0).commonAncestorContainer,r=a.nodeType===3?a.parentElement:a;if(!r||!p.value.contains(r)){tt.value="p";return}const c=r.closest("h1, h2, h3, h4, h5, h6, p");if(!c){tt.value="p";return}const d=c.tagName.toLowerCase();["h1","h2","h3","h4","h5","h6","p"].includes(d)?tt.value=d:tt.value="p"}catch{tt.value="p"}},Nn=()=>{if(!p.value){ut.value=!1;return}try{const o=window.getSelection();let l=!1;if(o.rangeCount>0){const r=o.getRangeAt(0).commonAncestorContainer,c=r.nodeType===1?r.tagName==="BLOCKQUOTE"?r:r.closest("blockquote"):r.parentElement?.closest("blockquote");l=!!(c&&p.value.contains(c))}ut.value=l}catch{ut.value=!1}},Qn=o=>{if(!o||!p.value)return!1;const l=o.commonAncestorContainer;if(!l)return!1;const a=l.nodeType===3?l.parentElement:l;return a?p.value.contains(a):!1},ol=()=>{ge.value=!1},qt=()=>{if(!k.floatingToolbar||!k.richText||k.disabled){ge.value=!1;return}const o=window.getSelection();if(!o||o.rangeCount===0){ge.value=!1;return}const l=o.getRangeAt(0);if(l.collapsed||!Qn(l)){ge.value=!1;return}const a=l.getBoundingClientRect();if(!a||a.width===0&&a.height===0){ge.value=!1;return}const r=p.value;if(!r){ge.value=!1;return}const c=r.getBoundingClientRect();if(!c||c.width===0){ge.value=!1;return}const d=40,u=8,m=a.top-d/2+15;let v=a.left+a.width/2;const h=window.innerWidth||document.documentElement.clientWidth||0;let _=0;St.value&&(_=St.value.getBoundingClientRect().width);const $=(_||320)/2;let N=c.left+$,Q=c.right-$;if(Q<N){const Y=c.left+c.width/2;N=Y,Q=Y}if(h>0){const Y=$+u,Le=h-$-u;if(N=Math.max(N,Y),Q=Math.min(Q,Le),Q<N){const me=h/2;N=me,Q=me}}v<N?v=N:v>Q&&(v=Q),yt.value={position:"fixed",top:`${Math.max(m,8)}px`,left:`${v}px`,transform:"translate(-50%, -100%)",zIndex:10003},ge.value=!0},Kl=o=>{k.disabled||!k.richText||(at.value=at.value===o?null:o,o==="askAi"&&(ue.value=null))},yo=()=>{at.value=null,We.value=null},$n=o=>{En(o),yo()};let al=null,Sn=null,fl=null,Cl=null;const Ml=o=>{if(k.disabled||!k.richText){kl(),bl();return}const l=o.target,a=l.closest("a"),r=l.closest("img");if(al&&(clearTimeout(al),al=null),fl&&(clearTimeout(fl),fl=null),a&&a!==Sn){bl(),Sn=a;let c=a.getAttribute("href")||"";(!c||c==="#"||c==="")&&(c=a.textContent||""),we.value=a,S.value=c,ee.value=!0,He.value=!0,Co(a)}else!a&&Sn?(Sn=null,al=setTimeout(()=>{He.value||kl()},150)):a&&a===Sn&&Co(a);if(r&&r!==Cl){kl(),Cl=r;let c=r.getAttribute("alt");c===null&&(c=r.alt||"");let d=r.getAttribute("data-alt");d===null&&(d=c),r.hasAttribute("alt")||r.setAttribute("alt",c),r.hasAttribute("data-alt")||r.setAttribute("data-alt",d),Xe.value=r,Ct.value=c.trim()||A("textEditor.image.noAlt"),Yt.value=!0,Te.value=!0,Gl(r)}else!r&&Cl?(Cl=null,fl=setTimeout(()=>{Te.value||bl()},150)):r&&r===Cl&&Gl(r)},Bo=o=>{const l=o.relatedTarget;(!l||!l.closest(".dss-text-editor-content")&&!l.closest(".dss-link-popup"))&&(Sn=null,Cl=null,al&&(clearTimeout(al),al=null),fl&&(clearTimeout(fl),fl=null),kl(),bl())},kl=()=>{He.value=!1,setTimeout(()=>{He.value||(ee.value=!1,S.value="",Ae.value||(we.value=null))},100)},Co=o=>{if(!o||!p.value)return;const l=o.getBoundingClientRect(),c=l.top-32-8,d=l.left+l.width/2;ne.value={position:"fixed",top:`${c}px`,left:`${d}px`,transform:"translateX(-50%)",zIndex:10002}},bl=()=>{Te.value=!1,setTimeout(()=>{Te.value||(Yt.value=!1,Ct.value="",$t.value||(Xe.value=null))},100)},Gl=o=>{if(!o||!p.value)return;const l=o.getBoundingClientRect(),c=l.top-32-8,d=l.left+l.width/2;te.value={position:"fixed",top:`${c}px`,left:`${d}px`,transform:"translateX(-50%)",zIndex:10002}},Mo=()=>{if(!S.value||!we.value)return;let l=we.value.getAttribute("href")||S.value;!l.startsWith("http://")&&!l.startsWith("https://")&&!l.startsWith("mailto:")&&(l="https://"+l),window.open(l,"_blank","noopener,noreferrer")},_o=()=>{if(we.value){const o=we.value.textContent||"",l=we.value.getAttribute("href")||"",a=we.value;Ie.value=l,O.value=o,Tt.value=o,He.value=!1,ee.value=!1,S.value="",we.value=a,Ae.value=!0}else if(ve.value){const o=window.getSelection();if(o.rangeCount>0){const a=o.getRangeAt(0).commonAncestorContainer,r=a.nodeType===1?a.closest("a"):a.parentElement?.closest("a");if(r){const c=r.textContent||"",d=r.getAttribute("href")||"";Ie.value=d,O.value=c,Tt.value=c,we.value=r,Ae.value=!0}}}else{xt.value=yn();const o=window.getSelection();let l="";o.rangeCount>0&&(l=o.getRangeAt(0).toString()),Ie.value="",O.value=l,Tt.value="",we.value=null,Ae.value=!0}e.nextTick(()=>{rt.value&&(rt.value.focus(),rt.value.select())})},Dn=()=>{Ae.value=!1,Ie.value="",O.value="",Tt.value="",we.value=null,xt.value=null},Jn=()=>{if(!Ie.value.trim()){Dn();return}if(Ue.value?(xe.value&&(clearTimeout(xe.value),xe.value=null),Se(),Ue.value=!1):Se(),O.value.trim()||(O.value=Ie.value.trim()),we.value&&p.value&&p.value.contains(we.value)){const o=window.getSelection();o.rangeCount>0&&o.removeAllRanges();const l=we.value;if(l.setAttribute("href",Ie.value.trim()),O.value.trim()!==Tt.value.trim()){for(;l.firstChild;)l.removeChild(l.firstChild);l.textContent=O.value.trim()}l.style.color="#60afdf",l.style.textDecoration="underline";const a=document.createRange();a.selectNodeContents(l),a.collapse(!1),o.removeAllRanges(),o.addRange(a),Be()}else if(p.value){p.value.focus();const o=window.getSelection();o.removeAllRanges(),xt.value&&et(xt.value);let l=null;if(o.rangeCount>0&&(l=o.getRangeAt(0)),l&&!l.collapsed){l.toString();const a=document.createElement("a");a.href=Ie.value.trim(),a.textContent=O.value.trim(),a.style.color="#60afdf",a.style.textDecoration="underline",l.deleteContents(),l.insertNode(a);const r=document.createTextNode(" ");l.setStartAfter(a),l.insertNode(r),l.setStartAfter(r),l.collapse(!0),o.removeAllRanges(),o.addRange(l)}else{l||(l=document.createRange(),l.selectNodeContents(p.value),l.collapse(!1));const a=l.startContainer,r=a.nodeType===3,c=r&&l.startOffset===a.textContent.length,d=document.createElement("a");if(d.href=Ie.value.trim(),d.textContent=O.value.trim(),d.style.color="#60afdf",d.style.textDecoration="underline",c){let u=a.parentElement;for(;u&&u!==p.value&&!["P","DIV","H1","H2","H3","H4","H5","H6"].includes(u.tagName);)u=u.parentElement;if(u&&u!==p.value){let m=u.nextElementSibling;if(m&&(m.innerHTML==="<br>"||m.innerHTML==="<br/>"||m.textContent.trim()==="")){m.textContent="",m.appendChild(d);const v=document.createTextNode(" ");m.appendChild(v);const h=document.createRange();h.setStartAfter(d),h.collapse(!0),o.removeAllRanges(),o.addRange(h)}else{if(l.startOffset>0){const h=a.textContent.substring(0,l.startOffset),_=h[h.length-1];if(_&&_!==" "&&_!==" "&&_!==`
102
102
  `){const $=document.createTextNode(" ");l.insertNode($),l.setStartAfter($)}}l.insertNode(d);const v=document.createTextNode(" ");l.setStartAfter(d),l.insertNode(v),l.setStartAfter(v),l.collapse(!0),o.removeAllRanges(),o.addRange(l)}}}else{if(r&&l.startOffset>0){const m=a.textContent.substring(0,l.startOffset),v=m[m.length-1];if(v&&v!==" "&&v!==" "&&v!==`
103
- `){const h=document.createTextNode(" ");l.insertNode(h),l.setStartAfter(h)}}l.insertNode(d);const u=document.createTextNode(" ");l.setStartAfter(d),l.insertNode(u),l.setStartAfter(u),l.collapse(!0),o.removeAllRanges(),o.addRange(l)}}Be()}e.nextTick(()=>{Vn(),Dn()})},Yn=()=>{if(!p.value||de.value)return;const o=window.getSelection();let l=null;o&&o.rangeCount>0&&(l=yn());const a=/(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,r=document.createTreeWalker(p.value,NodeFilter.SHOW_TEXT,{acceptNode:m=>{const v=m.parentElement;return!v||v.closest("a")||v.closest(".dss-image-wrapper")||!m.textContent||m.textContent.trim()===""?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}}),c=[];let d;for(;d=r.nextNode();)c.push(d);let u=!1;for(let m=c.length-1;m>=0;m--){const v=c[m],h=v.textContent;a.lastIndex=0;const _=[...h.matchAll(a)];if(_.length===0)continue;const $=_.filter(Y=>{const Te=Y[0],me=Y.index;if(me>0&&h[me-1]==="@"||me+Te.length<h.length&&h[me+Te.length]==="@")return!1;const ct=v.parentElement;return!(ct&&ct.closest("a"))});if($.length===0)continue;if($.length===1&&$[0][0]===h.trim()){const Y=$[0][0],Te=Y.startsWith("http://")||Y.startsWith("https://")?Y:`https://${Y}`,me=document.createElement("a");me.href=Te,me.textContent=Y,me.style.color="#60afdf",me.style.textDecoration="underline",v.parentNode&&(v.parentNode.replaceChild(me,v),u=!0);continue}let N=0;const Q=document.createDocumentFragment();if($.forEach(Y=>{const Te=Y.index,me=Y[0];if(Te>N){const Jt=h.substring(N,Te);Jt&&Q.appendChild(document.createTextNode(Jt))}const ct=me.startsWith("http://")||me.startsWith("https://")?me:`https://${me}`,Qt=document.createElement("a");Qt.href=ct,Qt.textContent=me,Qt.style.color="#60afdf",Qt.style.textDecoration="underline",Q.appendChild(Qt),N=Te+me.length}),N<h.length){const Y=h.substring(N);Y&&Q.appendChild(document.createTextNode(Y))}v.parentNode&&Q.childNodes.length>0&&(v.parentNode.replaceChild(Q,v),u=!0)}u&&l&&e.nextTick(()=>{et(l),Vn()})},Ut=()=>{if(!p.value)return;const o=/<u>([\s\S]*?)<\/u>|<ins>([\s\S]*?)<\/ins>/gi,l=document.createTreeWalker(p.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}}),a=[];let r;for(;r=l.nextNode();)a.push(r);for(let c=a.length-1;c>=0;c--){const d=a[c],u=d.textContent,m=[...u.matchAll(o)];if(m.length===0)continue;let v=0;const h=document.createDocumentFragment();m.forEach(_=>{const $=_.index,N=_[0].startsWith("<u>")?"u":"ins",Q=_[1]||_[2]||"";$>v&&h.appendChild(document.createTextNode(u.substring(v,$)));const Y=document.createElement(N);Y.textContent=Q,h.appendChild(Y),v=$+_[0].length}),v<u.length&&h.appendChild(document.createTextNode(u.substring(v))),d.parentNode&&h.childNodes.length>0&&d.parentNode.replaceChild(h,d)}},ko=o=>{if(!p.value||de.value)return;if(!o){Ut();return}if(!["*","_",">"].includes(o))return;const a=window.getSelection();if(!a||a.rangeCount===0)return;const r=a.getRangeAt(0);if(!r.collapsed)return;const c=r.startContainer.nodeType===Node.TEXT_NODE?r.startContainer.parentElement?.closest("p, h1, h2, h3, h4, h5, h6, li, td, th, blockquote, div"):r.startContainer.closest?.("p, h1, h2, h3, h4, h5, h6, li, td, th, blockquote, div");if(!c||c===p.value||!p.value.contains(c))return;const d=()=>{let Jt="",Xt=0,Pt=!1;const en=document.createTreeWalker(c,NodeFilter.SHOW_TEXT,{acceptNode:Rn=>Rn.parentElement?.closest("a, code, pre")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT});document.createTreeWalker(c,NodeFilter.SHOW_TEXT,null);let Kt=0;for(;en.nextNode();){const Rn=en.currentNode,rl=Rn.textContent||"",kn=Kt;if(Kt+=rl.length,Rn===r.startContainer){Jt+=rl.substring(0,r.startOffset),Xt=kn+r.startOffset,Pt=!0;break}Jt+=rl}return Pt||(Xt=Jt.length),{textBeforeCursor:Jt,cursorCharOffset:Xt}},{textBeforeCursor:u}=d();if(!u.length)return;let m=null,v=null;if(u.endsWith("**")&&(m=u.match(/\*\*(.+?)\*\*$/s))||u.endsWith("__")&&(m=u.match(/__(.+?)__$/s))?v="strong":u.endsWith("*")&&!u.endsWith("**")&&(m=u.match(new RegExp("(?<!\\*)\\*([^*]+)\\*$")))||u.endsWith("_")&&!u.endsWith("__")&&(m=u.match(new RegExp("(?<!_)_([^_]+)_$")))?v="em":o===">"&&((m=u.match(/<u>(.+?)<\/u>$/s))||(m=u.match(/<ins>(.+?)<\/ins>$/s)))&&(v=m[0].startsWith("<u>")?"u":"ins",m[0].startsWith("<u>"),m[0].startsWith("<u>")),!m||!m[1])return;const h=m[0],_=m[1],$=u.length-h.length,Q=(Jt=>{let Xt=0;const Pt=document.createTreeWalker(c,NodeFilter.SHOW_TEXT,{acceptNode:Kt=>Kt.parentElement?.closest("a, code, pre")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT});let en;for(;en=Pt.nextNode();){const Kt=(en.textContent||"").length;if(Xt+Kt>=Jt)return{node:en,offset:Jt-Xt};Xt+=Kt}return null})($);if(!Q)return;const Y=document.createRange();Y.setStart(Q.node,Q.offset),Y.setEnd(r.endContainer,r.endOffset);const Te=document.createElement(v);Te.textContent=_,Y.deleteContents(),Y.insertNode(Te);const me=window.getSelection(),ct=document.createRange();ct.setStartAfter(Te),ct.collapse(!0),me.removeAllRanges(),me.addRange(ct);const Qt=yn();e.nextTick(()=>{Be(),Qt&&et(Qt)})},Ft=()=>{p.value&&(Zt.value=yn(),Ot.value="",Et.value="",Ne.value="",lt.value="",je.value="",on.value=null,Xe.value=null,fe.value="upload",$t.value=!0,At(),e.nextTick(()=>{Dt.value&&Dt.value.focus(),Lt.value&&(Lt.value.value="")}))},ln=o=>{const l=o.target?.files?.[0];if(!l){on.value=null,Et.value="";return}on.value=l;const a=new FileReader;a.onload=r=>{Et.value=r.target?.result||""},a.readAsDataURL(l)},$o=()=>{Lt.value&&Lt.value.click()},bo=()=>{lt.value&&(je.value="")},Dl=()=>{je.value&&(lt.value="")},To=()=>{let o=Xe.value;if(!o){const l=window.getSelection();if(l&&l.rangeCount>0){const r=l.getRangeAt(0).commonAncestorContainer;o=r.nodeType===1?r.closest("img"):r.parentElement?.closest("img")}}if(o){const l=o.getAttribute("data-alt")||o.getAttribute("alt")||"";Xe.value=o,Ot.value=l.trim()===""||l.trim()==="Image"?"":l;const a=o.getAttribute("src")||o.src||"";a.startsWith("http://")||a.startsWith("https://")?(Ne.value=a,Et.value="",fe.value="url"):(Et.value=a,Ne.value="",fe.value="upload");const c=o.style.width||o.getAttribute("width")||"",d=o.style.height||o.getAttribute("height")||"";lt.value=c.endsWith("px")?c.replace("px",""):c,je.value=d.endsWith("px")?d.replace("px",""):d,Zt.value=null}else{Ft();return}$t.value=!0,$e.value=!1,Yt.value=!1,e.nextTick(()=>{fe.value==="url"&&Bt.value?(Bt.value.focus(),Bt.value.select()):Dt.value&&(Dt.value.focus(),Dt.value.select()),Lt.value&&(Lt.value.value="")})},wl=()=>{$t.value=!1,Ot.value="",Et.value="",Ne.value="",lt.value="",je.value="",on.value=null,Xe.value=null,Zt.value=null,fe.value="upload"},Nt=()=>{const o=(Ot.value||"").trim(),l=p.value?._mutationObserver;l&&l.disconnect(),Ue.value?(xe.value&&(clearTimeout(xe.value),xe.value=null),Se(),Ue.value=!1):Se();const a=fe.value==="url"?Ne.value.trim():Et.value;if(Xe.value&&p.value&&p.value.contains(Xe.value)){a&&(Xe.value.src=a),Xe.value.setAttribute("alt",o),Xe.value.setAttribute("data-alt",o),lt.value?(Xe.value.style.width=`${lt.value}px`,Xe.value.setAttribute("width",lt.value)):(Xe.value.style.removeProperty("width"),Xe.value.removeAttribute("width")),je.value?(Xe.value.style.height=`${je.value}px`,Xe.value.setAttribute("height",je.value)):(Xe.value.style.removeProperty("height"),Xe.value.removeAttribute("height"));const r=window.getSelection();if(r){r.removeAllRanges();const c=document.createRange();c.setStartAfter(Xe.value),c.collapse(!0),r.addRange(c)}Be()}else{if(!a){l&&p.value&&l.observe(p.value,{childList:!0,subtree:!0}),wl();return}if(p.value){p.value.focus();const r=window.getSelection();r&&r.rangeCount>0&&r.removeAllRanges();const c=window.getSelection();let d=null;if(Zt.value&&(et(Zt.value),c&&c.rangeCount>0&&(d=c.getRangeAt(0))),!d&&c&&c.rangeCount>0&&(d=c.getRangeAt(0)),!d&&p.value){if(d=document.createRange(),p.value.childNodes.length===0){const h=document.createElement("p");h.innerHTML="<br>",p.value.appendChild(h),d.setStart(h,0),d.collapse(!0)}else d.selectNodeContents(p.value),d.collapse(!1);c&&(c.removeAllRanges(),c.addRange(d))}if(!d){wl();return}const u=d.commonAncestorContainer,m=u.nodeType===3?u.parentElement:u;if(!p.value.contains(m)){if(d=document.createRange(),p.value.childNodes.length===0){const h=document.createElement("p");h.innerHTML="<br>",p.value.appendChild(h),d.setStart(h,0),d.collapse(!0)}else d.selectNodeContents(p.value),d.collapse(!1);c&&(c.removeAllRanges(),c.addRange(d))}const v=document.createElement("img");v.src=a,v.setAttribute("alt",o),v.setAttribute("data-alt",o),lt.value&&(v.style.width=`${lt.value}px`,v.setAttribute("width",lt.value)),je.value&&(v.style.height=`${je.value}px`,v.setAttribute("height",je.value));try{d.insertNode(v),d.setStartAfter(v),d.collapse(!0),c&&(c.removeAllRanges(),c.addRange(d))}catch{if(p.value){if(p.value.childNodes.length===0){const $=document.createElement("p");p.value.appendChild($),$.appendChild(v)}else{const $=p.value.lastChild;if($&&$.nodeType===1)$.appendChild(v);else{const N=document.createElement("p");p.value.appendChild(N),N.appendChild(v)}}const _=document.createRange();_.setStartAfter(v),_.collapse(!0),c&&(c.removeAllRanges(),c.addRange(_))}}Xe.value=v,Be()}}e.nextTick(()=>{l&&p.value&&l.observe(p.value,{childList:!0,subtree:!0}),Vn(),qt(),wl()})};e.watch(()=>k.modelValue,o=>{if(k.richText&&p.value&&!de.value){const l=zn(o||""),r=p.value.innerHTML.replace(/&nbsp;|\u00A0/g," "),c=l.replace(/&nbsp;|\u00A0/g," ");if(r!==c){const d=yn();p.value.innerHTML=l,e.nextTick(()=>{Mt();const u=p.value.innerHTML||"",m=k.title||"",v=k.description||"";X.value=u,j.value=m,ie.value=v,Z.value=u,E.value=m,C.value=v,qe.value=[],dt.value=[],xe.value&&(clearTimeout(xe.value),xe.value=null),Ue.value=!1,d&&et(d),Mn(),he(),W(),Vn(),qt(),Xn(),Zn("watch-modelValue")})}}},{immediate:!0}),e.watch(()=>k.richText,o=>{o?(qt(),e.nextTick(()=>{no()})):(ol(),vt.value=[],Je.value&&(Je.value.disconnect(),Je.value=null)),Xn()}),e.watch(()=>k.floatingToolbar,o=>{o?qt():ol()}),e.watch(()=>k.disabled,o=>{o&&ol(),Xn()}),e.watch(()=>k.description,()=>{e.nextTick(()=>{re.value?dl():Vt()})}),e.watch(()=>k.title,()=>{e.nextTick(()=>{De.value?gn():ul()})}),e.watch(()=>k.customToolbarSlots,()=>{e.nextTick(()=>{Rt()})},{deep:!0}),e.watch(()=>k.comments,(o,l)=>{if(Ul.value){Ul.value=!1;return}Bl.value||k.richText&&p.value&&e.nextTick(()=>{Ql()})},{deep:!0,immediate:!1});const Ql=()=>{if(!Bl.value&&!(!k.comments||!Array.isArray(k.comments)||k.comments.length===0)&&!(!k.richText||!p.value)){Bl.value=!0;try{const o=new Set,l=k.comments.filter(u=>{const m=String(u.conversation_id||u.id);return o.has(m)?!1:(o.add(m),!0)}),a=p.value.querySelectorAll("[data-comment], [data-fake-comment]"),r=a.length;a.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 v=String(m);if(d.has(v))return;const h=p.value.querySelector(`[data-comment="${v}"]`);if(h){_l(h,u),d.add(v);return}try{const _=wo(u.selection_range,u.selection_text);if(_&&!_.collapsed){const $=_.commonAncestorContainer,N=$.nodeType===3?$.parentElement:$;if(N){const Te=N.closest("[data-comment], [data-fake-comment]");if(Te){const me=Te.getAttribute("data-comment")||Te.getAttribute("data-fake-comment");if(String(me)===String(m)){Te.setAttribute("data-comment",v),Te.removeAttribute("data-fake-comment"),_l(Te,u),d.add(v);return}else return}}const Q=p.value.querySelector(`[data-comment="${v}"]`);if(Q){_l(Q,u),d.add(v);return}const Y=document.createElement("span");Y.setAttribute("data-comment",v),_l(Y,u);try{_.surroundContents(Y),c++,d.add(v)}catch{try{const me=document.createRange();me.setStart(_.startContainer,_.startOffset),me.setEnd(_.endContainer,_.endOffset),Rl(me),me.surroundContents(Y),c++,d.add(v)}catch{try{const ct=_.extractContents();Y.appendChild(ct),_.insertNode(Y),c++,d.add(v)}catch(ct){console.warn("Failed to create comment marker:",ct)}}}}}catch{}}),e.nextTick(()=>{Zn("restoreCommentsFromModel"),Be(),Bl.value=!1})}catch{Bl.value=!1}}},Rl=o=>{if(!o||!p.value)return o;try{const l=["P","DIV","H1","H2","H3","H4","H5","H6","LI","BLOCKQUOTE","PRE"];let a=o.startContainer,r=o.startOffset;if(a.nodeType===3){const u=a.parentElement;u&&l.includes(u.tagName)&&(r===0&&!Jl(a)||o.setStartBefore(u))}else a.nodeType===1&&l.includes(a.tagName)&&r>0&&o.setStartBefore(a);let c=o.endContainer,d=o.endOffset;if(c.nodeType===3){const u=c.parentElement;u&&l.includes(u.tagName)&&(d===c.length&&!eo(c)||o.setEndAfter(u))}else c.nodeType===1&&l.includes(c.tagName)&&d<c.childNodes.length&&o.setEndAfter(c);return o}catch{return o}},Jl=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},eo=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},wo=(o,l)=>{if(!o||!p.value)return null;try{const a=document.createRange();if(o.type==="text"&&typeof o.start=="number"&&typeof o.end=="number"){let r=0;const c=[p.value];let d=null,u=!1,m=!1;for(;!m&&(d=c.pop());)if(d.nodeType===3){const v=r+d.length;!u&&o.start>=r&&o.start<=v&&(a.setStart(d,o.start-r),u=!0),u&&o.end>=r&&o.end<=v&&(a.setEnd(d,o.end-r),m=!0),r=v}else{let v=d.childNodes.length;for(;v--;)c.push(d.childNodes[v])}return u?Rl(a):null}}catch{return null}return null},_l=(o,l)=>{if(!o||!l)return;const a=l.conversation||[],r=new Set,c=[],d=m=>{m&&m.id&&!r.has(m.id)&&(r.add(m.id),c.push(m))};a.length>0&&a.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=a.length;u>0?o.setAttribute("data-comment-count",String(u)):o.removeAttribute("data-comment-count")},Zn=(o="unknown")=>{if(!k.richText||!p.value){vt.value=[];return}Date.now()-bn.value<Fn&&vn.value!==null||vn.value===null&&(vn.value=requestAnimationFrame(()=>{if(vn.value=null,bn.value=Date.now(),Tn.value)return;Tn.value=!0;const a={},r=p.value;if(!r){Tn.value=!1;return}const c=r.closest(".editor-with-comments");if(!c){Tn.value=!1;return}const d=r.querySelectorAll("[data-comment], [data-fake-comment]"),u=[],m=new Set;d.forEach(N=>{const Q=N.getAttribute("data-comment")||N.getAttribute("data-fake-comment");Q&&N.tagName==="SPAN"&&(m.has(Q)||(u.push(N),m.add(Q)))}),d.forEach(N=>{const Q=N.getAttribute("data-comment")||N.getAttribute("data-fake-comment");!Q||m.has(Q)||(["P","DIV","H1","H2","H3","H4","H5","H6"].includes(N.tagName)?N.querySelector(`span[data-comment="${Q}"], span[data-fake-comment="${Q}"]`)||(u.push(N),m.add(Q)):N.tagName!=="SPAN"&&(u.push(N),m.add(Q)))});const v=c.getBoundingClientRect(),h=r.getBoundingClientRect();u.forEach((N,Q)=>{let Y=N.getAttribute("data-comment")||N.getAttribute("data-fake-comment");if(!Y)return;if(typeof Y=="string"&&Y.startsWith("comment-")){const un=N.textContent?.trim(),Kn=k.comments?.find(Wn=>(typeof Wn.conversation_id=="string"&&Wn.conversation_id.startsWith("comment-")?null:Wn.conversation_id)&&Wn.selection_text?.trim()===un);Kn?(Y=String(Kn.conversation_id),N.setAttribute("data-comment",Y),N.removeAttribute("data-fake-comment")):(Y=String(Date.now()),N.setAttribute("data-comment",Y),N.removeAttribute("data-fake-comment"))}const Te=N.getBoundingClientRect(),me=window.getComputedStyle(N),ct=parseFloat(me.lineHeight)||parseFloat(me.fontSize)*1.2,Xt=Te.top-h.top+ct/2-15,en=h.top-v.top+Xt;let Kt=null,Rn=null,rl=0;const kn=[],Fl=new Set;if(Y&&k.comments){const un=k.comments.find(Kn=>String(Kn.conversation_id||Kn.id)===String(Y));if(un){const Kn=un.conversation||[];Kn.length>0?(Kn.forEach(Wn=>{Wn.user&&Wn.user.id&&!Fl.has(Wn.user.id)&&(Fl.add(Wn.user.id),kn.push(Wn.user))}),rl=Kn.length):(rl=0,Kt=null,Rn=null),kn.length>0?Kt=kn[0]:Kt=null,kn.length>1?Rn=kn[1]:Rn=null}}const $l=Te.top+ct/2-15,jn=$l+30,El=5,Vl=jn>h.top+El&&$l<h.bottom-El?1:0;vt.value.find(un=>un.id===Y);let gt=N;if(!gt&&Y&&p.value){const un=String(Y);gt=p.value.querySelector(`[data-comment="${un}"], [data-fake-comment="${un}"]`)}const zl=kn.length;a[Y]?(a[Y].top=en,a[Y].opacity=Vl,a[Y].element=gt,a[Y].firstUser=Kt,a[Y].secondUser=Rn,a[Y].totalCount=rl,a[Y].uniqueUserCount=zl):a[Y]={id:Y,top:en,opacity:Vl,element:gt,firstUser:Kt,secondUser:Rn,totalCount:rl,uniqueUserCount:zl}});const _=Object.values(a).map(N=>{const Q=Math.max(0,(N.uniqueUserCount??0)-2);if(!N.element&&N.id&&p.value){const Te=String(N.id);N.element=p.value.querySelector(`[data-comment="${Te}"], [data-fake-comment="${Te}"]`)}return{...N,firstUser:N.firstUser||null,secondUser:N.secondUser||null,totalCount:N.totalCount,additionalCount:Q}});(vt.value.length!==_.length||_.some((N,Q)=>{const Y=vt.value[Q];if(!Y)return!0;const Te=(Y.firstUser?.id||null)!==(N.firstUser?.id||null),me=(Y.secondUser?.id||null)!==(N.secondUser?.id||null);return Y.id!==N.id||Math.abs(Y.top-N.top)>1||Y.opacity!==N.opacity||Y.totalCount!==N.totalCount||Y.additionalCount!==N.additionalCount||Te||me||Y.element!==N.element}))&&(vt.value=_),Tn.value=!1}))},Lo=o=>{if(!o)return;let l=o.element;if(!l&&o.id&&p.value){const a=String(o.id);l=p.value.querySelector(`[data-comment="${a}"], [data-fake-comment="${a}"]`)}l&&(vl(),Pn.value=l,l.classList.add("editor-comment-highlighted"))},vl=(o=!1)=>{!o&&mn.value!==null&&Pn.value&&(Pn.value.getAttribute("data-comment")||Pn.value.getAttribute("data-fake-comment"))===mn.value||(p.value&&p.value.querySelectorAll(".editor-comment-highlighted").forEach(a=>{a.classList.remove("editor-comment-highlighted")}),Pn.value&&(Pn.value.classList.remove("editor-comment-highlighted"),Pn.value=null))},xl=o=>{if(!o||!o.element)return;vl(!0);const l=o.element.getAttribute("data-comment")||o.element.getAttribute("data-fake-comment");if(!l)return;const a=`[data-comment="${l}"], [data-fake-comment="${l}"]`;Le("comment-marker-clicked",{commentId:l,selector:a,element:o.element})},to=()=>{vl()},no=()=>{!k.richText||!p.value||(Je.value&&Je.value.disconnect(),Wt.value!==null&&(clearTimeout(Wt.value),Wt.value=null),Je.value=new MutationObserver(()=>{Wt.value===null&&(Wt.value=setTimeout(()=>{Wt.value=null,e.nextTick(()=>{Zn("MutationObserver")})},200))}),Je.value.observe(p.value,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-comment","data-fake-comment","data-comment-user","data-comment-user-2","data-comment-count"]}),Zn("setupCommentMarkersObserver-initial"))},sl=(o,l)=>{if(!o||!l)return;const a=l.getBoundingClientRect();let r=a.top,c=a.right+4;o.style.top=`${r}px`,o.style.left=`${c}px`,o.offsetHeight;const d=o.getBoundingClientRect(),u=window.innerWidth,m=window.innerHeight;if(d.right>u){const v=a.left-d.width-4;o.style.left=`${v}px`}if(d.bottom>m){const v=Math.max(8,m-d.height-8);o.style.top=`${v}px`}d.top<0&&(o.style.top="8px")};return e.watch(()=>We.value,o=>{e.nextTick(()=>{document.querySelectorAll(".dss-toolbar-dropdown-submenu").forEach(a=>{const r=a.getAttribute("data-submenu-id");if(r===o&&o){const c=document.querySelector(`.dss-toolbar-dropdown-item-has-submenu[data-submenu-id="${r}"]`);if(c){if(a.parentNode!==document.body){const d=a.parentNode;a.dataset.originalParentRef=d===c?"inside":"sibling",document.body.appendChild(a)}a.style.display="block",a.style.visibility="hidden",a.style.opacity="0",requestAnimationFrame(()=>{requestAnimationFrame(()=>{sl(a,c),a.offsetHeight,a.setAttribute("data-active","true"),a.style.visibility="visible",a.style.opacity="1"})})}else a.setAttribute("data-active","true")}else a.setAttribute("data-active","false"),a.style.display="none",a.style.top="",a.style.left="",a.style.visibility="",a.style.opacity=""})})}),e.watch(()=>[ue.value,at.value],()=>{ue.value==="askAi"||at.value==="askAi"?e.nextTick(()=>{_t()}):(We.value=null,e.nextTick(()=>{document.querySelectorAll(".dss-toolbar-dropdown-submenu").forEach(l=>{if(l.parentNode===document.body){const a=l.getAttribute("data-submenu-id");if(a){const r=document.querySelector(`.dss-toolbar-dropdown-item-has-submenu[data-submenu-id="${a}"]`);if(r)if(l.dataset.originalParentRef==="inside")r.appendChild(l);else{const d=r.closest(".dss-toolbar-dropdown");d&&d.insertBefore(l,r.nextSibling)}}}})}))}),e.watch(()=>k.locale,o=>{o&&o!==_e.value&&(_e.value=o)},{immediate:!0}),Ce({openCommentOverlayForSelector:jl,updateCommentMarkers:Zn,restoreCommentsFromModel:Ql}),(o,l)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-text-editor-container editor-with-comments",In.value]),style:e.normalizeStyle(an.value)},[F.richText?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-text-editor-toolbar",onMousedown:l[14]||(l[14]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("div",Xc,[e.createElementVNode("div",{class:"dss-toolbar-button",onClick:w,title:e.unref(A)("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,Yc),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-disabled":!D.value}]),onClick:y,title:e.unref(A)("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,jc),l[73]||(l[73]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",Kc,[e.createElementVNode("div",{class:"dss-toolbar-button dss-toolbar-dropdown-toggle",onClick:l[0]||(l[0]=a=>It("paragraph")),title:e.unref(A)("textEditor.toolbar.paragraphFormat")},[tt.value==="h1"?(e.openBlock(),e.createElementBlock("svg",Qc,[...l[47]||(l[47]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M6.2 13V11.836H8.456V7.12H6.548V6.16C8.312 6.04 8.648 5.44 8.804 4.84H9.884V11.836H11.96V13H6.2Z",fill:"#FFC230"},null,-1)])])):tt.value==="h2"?(e.openBlock(),e.createElementBlock("svg",Jc,[...l[48]||(l[48]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M6.02 13V11.8L8.732 9.388C9.644 8.584 10.208 8.08 10.208 7.288C10.208 6.64 9.764 6.04 8.84 6.04C7.904 6.04 7.424 6.676 7.412 7.852H5.972C5.852 5.872 7.16 4.72 8.948 4.72C10.736 4.72 11.672 5.86 11.672 7.12C11.672 8.464 10.916 9.364 9.92 10.168L8.192 11.56H11.708V13H6.02Z",fill:"#FFC230"},null,-1)])])):tt.value==="h3"?(e.openBlock(),e.createElementBlock("svg",eu,[...l[49]||(l[49]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M8.156 8.188H8.828C9.56 8.188 10.064 7.696 10.064 7.072C10.064 6.508 9.74 6.04 8.792 6.04C7.748 6.04 7.472 6.688 7.388 7.612H5.948C5.828 6.232 6.896 4.72 8.924 4.72C10.712 4.72 11.6 5.896 11.6 6.892C11.6 7.648 11.3 8.356 10.568 8.704C11.42 9.112 11.768 9.7 11.768 10.48C11.768 11.86 10.712 13.12 8.804 13.12C6.776 13.12 5.708 11.608 5.828 10.228H7.268C7.232 11.068 7.736 11.8 8.792 11.8C9.74 11.8 10.184 11.248 10.184 10.48C10.184 9.808 9.752 9.268 8.828 9.268H8.156V8.188Z",fill:"#FFC230"},null,-1)])])):tt.value==="h4"?(e.openBlock(),e.createElementBlock("svg",tu,[...l[50]||(l[50]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M5.72 11.056V9.856L9.284 4.84H10.832V9.856H12.272V11.056H10.832V13H9.284V11.056H5.72ZM7.076 9.856H9.284V6.832L7.076 9.856Z",fill:"#FFC230"},null,-1)])])):tt.value==="h5"?(e.openBlock(),e.createElementBlock("svg",nu,[...l[51]||(l[51]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M7.652 9.436H6.164C6.416 7.84 6.56 6.64 6.596 4.852L11.516 4.84V6.28H7.82L7.676 7.972C8.084 7.684 8.6 7.516 9.308 7.516C10.832 7.516 11.804 8.644 11.804 10.24C11.804 11.86 10.58 13.12 8.804 13.12C7.328 13.12 5.864 11.968 6.164 10.156H7.484C7.388 11.224 7.964 11.8 8.876 11.8C9.812 11.8 10.316 11.092 10.316 10.252C10.316 9.412 9.908 8.632 8.9 8.632C8.132 8.632 7.748 9.112 7.652 9.436Z",fill:"#FFC230"},null,-1)])])):tt.value==="h6"?(e.openBlock(),e.createElementBlock("svg",lu,[...l[52]||(l[52]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M11.912 10.24C11.912 11.86 10.808 13.12 9.056 13.12C7.16 13.12 5.96 11.5 5.96 9.04C5.96 6.34 7.316 4.72 9.344 4.72C11 4.72 11.84 5.872 11.84 7.012H10.4C10.328 6.628 10.088 6.028 9.104 6.028C8.06 6.028 7.388 6.748 7.316 8.392C7.784 7.84 8.396 7.444 9.416 7.444C10.94 7.444 11.912 8.644 11.912 10.24ZM9.08 8.848C8.12 8.848 7.736 9.556 7.736 10.396C7.736 11.236 8.12 11.944 9.08 11.944C10.04 11.944 10.424 11.236 10.424 10.396C10.424 9.556 10.04 8.848 9.08 8.848Z",fill:"#FFC230"},null,-1)])])):(e.openBlock(),e.createElementBlock("svg",ou,[...l[53]||(l[53]=[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[54]||(l[54]=e.createElementVNode("span",{class:"dss-toolbar-dropdown-arrow"},"˅",-1))],8,Gc),ue.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]=a=>En("<h1>"))},[l[55]||(l[55]=e.createElementVNode("svg",{width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"}),e.createElementVNode("path",{d:"M6.2 13V11.836H8.456V7.12H6.548V6.16C8.312 6.04 8.648 5.44 8.804 4.84H9.884V11.836H11.96V13H6.2Z",fill:"#FFC230"})],-1)),e.createElementVNode("h1",null,e.toDisplayString(e.unref(A)("textEditor.paragraph.heading1")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[2]||(l[2]=a=>En("<h2>"))},[l[56]||(l[56]=e.createElementVNode("svg",{width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"}),e.createElementVNode("path",{d:"M6.02 13V11.8L8.732 9.388C9.644 8.584 10.208 8.08 10.208 7.288C10.208 6.64 9.764 6.04 8.84 6.04C7.904 6.04 7.424 6.676 7.412 7.852H5.972C5.852 5.872 7.16 4.72 8.948 4.72C10.736 4.72 11.672 5.86 11.672 7.12C11.672 8.464 10.916 9.364 9.92 10.168L8.192 11.56H11.708V13H6.02Z",fill:"#FFC230"})],-1)),e.createElementVNode("h2",null,e.toDisplayString(e.unref(A)("textEditor.paragraph.heading2")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[3]||(l[3]=a=>En("<h3>"))},[l[57]||(l[57]=e.createElementVNode("svg",{width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"}),e.createElementVNode("path",{d:"M8.156 8.188H8.828C9.56 8.188 10.064 7.696 10.064 7.072C10.064 6.508 9.74 6.04 8.792 6.04C7.748 6.04 7.472 6.688 7.388 7.612H5.948C5.828 6.232 6.896 4.72 8.924 4.72C10.712 4.72 11.6 5.896 11.6 6.892C11.6 7.648 11.3 8.356 10.568 8.704C11.42 9.112 11.768 9.7 11.768 10.48C11.768 11.86 10.712 13.12 8.804 13.12C6.776 13.12 5.708 11.608 5.828 10.228H7.268C7.232 11.068 7.736 11.8 8.792 11.8C9.74 11.8 10.184 11.248 10.184 10.48C10.184 9.808 9.752 9.268 8.828 9.268H8.156V8.188Z",fill:"#FFC230"})],-1)),e.createElementVNode("h3",null,e.toDisplayString(e.unref(A)("textEditor.paragraph.heading3")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[4]||(l[4]=a=>En("<h4>"))},[l[58]||(l[58]=e.createElementVNode("svg",{width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"}),e.createElementVNode("path",{d:"M5.72 11.056V9.856L9.284 4.84H10.832V9.856H12.272V11.056H10.832V13H9.284V11.056H5.72ZM7.076 9.856H9.284V6.832L7.076 9.856Z",fill:"#FFC230"})],-1)),e.createElementVNode("h4",null,e.toDisplayString(e.unref(A)("textEditor.paragraph.heading4")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[5]||(l[5]=a=>En("<h5>"))},[l[59]||(l[59]=e.createElementVNode("svg",{width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"}),e.createElementVNode("path",{d:"M7.652 9.436H6.164C6.416 7.84 6.56 6.64 6.596 4.852L11.516 4.84V6.28H7.82L7.676 7.972C8.084 7.684 8.6 7.516 9.308 7.516C10.832 7.516 11.804 8.644 11.804 10.24C11.804 11.86 10.58 13.12 8.804 13.12C7.328 13.12 5.864 11.968 6.164 10.156H7.484C7.388 11.224 7.964 11.8 8.876 11.8C9.812 11.8 10.316 11.092 10.316 10.252C10.316 9.412 9.908 8.632 8.9 8.632C8.132 8.632 7.748 9.112 7.652 9.436Z",fill:"#FFC230"})],-1)),e.createElementVNode("h5",null,e.toDisplayString(e.unref(A)("textEditor.paragraph.heading5")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[6]||(l[6]=a=>En("<h6>"))},[l[60]||(l[60]=e.createElementVNode("svg",{width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"}),e.createElementVNode("path",{d:"M11.912 10.24C11.912 11.86 10.808 13.12 9.056 13.12C7.16 13.12 5.96 11.5 5.96 9.04C5.96 6.34 7.316 4.72 9.344 4.72C11 4.72 11.84 5.872 11.84 7.012H10.4C10.328 6.628 10.088 6.028 9.104 6.028C8.06 6.028 7.388 6.748 7.316 8.392C7.784 7.84 8.396 7.444 9.416 7.444C10.94 7.444 11.912 8.644 11.912 10.24ZM9.08 8.848C8.12 8.848 7.736 9.556 7.736 10.396C7.736 11.236 8.12 11.944 9.08 11.944C10.04 11.944 10.424 11.236 10.424 10.396C10.424 9.556 10.04 8.848 9.08 8.848Z",fill:"#FFC230"})],-1)),e.createElementVNode("h6",null,e.toDisplayString(e.unref(A)("textEditor.paragraph.heading6")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[7]||(l[7]=a=>En("<p>"))},[l[61]||(l[61]=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(A)("textEditor.paragraph.paragraph")),1)])])):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Ht("bold")}]),onClick:l[9]||(l[9]=a=>ot("bold")),title:e.unref(A)("textEditor.toolbar.bold")},[...l[62]||(l[62]=[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,au),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Ht("italic")}]),onClick:l[10]||(l[10]=a=>ot("italic")),title:e.unref(A)("textEditor.toolbar.italic")},[...l[63]||(l[63]=[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,su),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Ht("underline")}]),onClick:l[11]||(l[11]=a=>ot("underline")),title:e.unref(A)("textEditor.toolbar.underline")},[...l[64]||(l[64]=[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,ru),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":ut.value}]),onClick:ro,title:e.unref(A)("textEditor.toolbar.citation")},[...l[65]||(l[65]=[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,iu),l[74]||(l[74]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),ve.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-button",onClick:ql,title:e.unref(A)("textEditor.toolbar.removeLink")},[...l[67]||(l[67]=[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,uu)):(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-button",onClick:co,title:e.unref(A)("textEditor.toolbar.insertLink")},[...l[66]||(l[66]=[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,cu)),l[75]||(l[75]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Ht("insertUnorderedList")}]),onClick:uo,title:e.unref(A)("textEditor.toolbar.bulletList")},[...l[68]||(l[68]=[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,du),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Ht("insertOrderedList")}]),onClick:el,title:e.unref(A)("textEditor.toolbar.numberList")},[...l[69]||(l[69]=[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,mu),l[76]||(l[76]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:"dss-toolbar-button",onClick:Ft,title:e.unref(A)("textEditor.toolbar.image")},[...l[70]||(l[70]=[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,pu),wt.value?(e.openBlock(),e.createElementBlock("div",fu)):e.createCommentVNode("",!0),wt.value?(e.openBlock(),e.createElementBlock("div",{key:3,class:"dss-toolbar-button",title:e.unref(A)("textEditor.toolbar.comment"),onClick:Xl},[...l[71]||(l[71]=[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,vu)):e.createCommentVNode("",!0),F.askAi?(e.openBlock(),e.createElementBlock("div",gu)):e.createCommentVNode("",!0),F.askAi?(e.openBlock(),e.createElementBlock("div",hu,[e.createElementVNode("div",{class:"dss-toolbar-ai-button dss-toolbar-dropdown-toggle",onClick:l[12]||(l[12]=a=>It("askAi")),title:e.unref(A)("textEditor.toolbar.askAi")},[l[72]||(l[72]=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:"#FFAF54"}),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:"#FFC963"})],-1)),e.createElementVNode("span",Cu,e.toDisplayString(e.unref(A)("textEditor.toolbar.askAi")),1)],8,yu),ue.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",ku,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(F.customToolbarSlots,(a,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:r},[Ke(a)?(e.openBlock(),e.createElementBlock("div",bu,[e.renderSlot(o.$slots,a)])):e.createCommentVNode("",!0),Ke(a)&&r<F.customToolbarSlots.length-1&&dn(r)?(e.openBlock(),e.createElementBlock("div",wu)):e.createCommentVNode("",!0)],64))),128))])],32)):e.createCommentVNode("",!0),(ue.value==="paragraph"||ue.value==="askAi")&&F.richText?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-dropdown-overlay",onClick:At})):e.createCommentVNode("",!0),e.createVNode(Ao,{showModal:Ae.value,width:"500px",height:"55vh",onCloseModal:Dn},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(A)("textEditor.link.editLink")),1)]),content:e.withCtx(()=>[e.createElementVNode("div",xu,[e.createElementVNode("div",Eu,[e.createElementVNode("label",Vu,e.toDisplayString(e.unref(A)("textEditor.link.altText")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"linkAltInput",ref:Oe,type:"text","onUpdate:modelValue":l[15]||(l[15]=a=>O.value=a),class:"dss-link-modal-input",placeholder:e.unref(A)("textEditor.link.enterAltText"),onKeyup:e.withKeys(Jn,["enter"])},null,40,Nu),[[e.vModelText,O.value]])]),e.createElementVNode("div",Su,[e.createElementVNode("label",Bu,e.toDisplayString(e.unref(A)("textEditor.link.url")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"linkUrlInput",ref:rt,type:"text","onUpdate:modelValue":l[16]||(l[16]=a=>Ie.value=a),class:"dss-link-modal-input",placeholder:e.unref(A)("textEditor.link.enterUrl"),onKeyup:e.withKeys(Jn,["enter"])},null,40,Mu),[[e.vModelText,Ie.value]])])])]),actions:e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-cancel",onClick:Dn},e.toDisplayString(e.unref(A)("textEditor.link.cancel")),1),e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-save",onClick:Jn},e.toDisplayString(e.unref(A)("textEditor.link.save")),1)]),_:1},8,["showModal"]),e.createVNode(Ao,{showModal:$t.value,width:"500px",height:"80vh",onCloseModal:wl},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(Xe.value?e.unref(A)("textEditor.image.editImage"):e.unref(A)("textEditor.image.addImage")),1)]),content:e.withCtx(()=>[e.createElementVNode("div",_u,[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-image-modal-tab",{"dss-image-modal-tab-active":fe.value==="upload"}]),onClick:l[17]||(l[17]=a=>fe.value="upload")},e.toDisplayString(e.unref(A)("textEditor.image.upload")),3),l[77]||(l[77]=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":fe.value==="url"}]),onClick:l[18]||(l[18]=a=>fe.value="url")},e.toDisplayString(e.unref(A)("textEditor.image.imageLink")),3)]),fe.value==="upload"?(e.openBlock(),e.createElementBlock("div",$u,[e.createElementVNode("div",Tu,[e.createElementVNode("div",Lu,[Me.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("label",Hu,e.toDisplayString(e.unref(A)("textEditor.image.uploadImage")),1)),Me.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-image-upload-preview",onClick:$o},[e.createElementVNode("img",{src:Et.value,alt:"Preview",class:"dss-image-preview-image"},null,8,Au),l[78]||(l[78]=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:Lt,type:"file",accept:"image/*",class:"dss-image-file-input-hidden",onChange:ln},null,544)])):(e.openBlock(),e.createElementBlock("input",{key:2,ref_key:"imageFileInput",ref:Lt,type:"file",accept:"image/*",class:"dss-link-modal-input dss-link-modal-input-image",onChange:ln},null,544))]),e.createElementVNode("div",Du,[e.createElementVNode("label",Ru,e.toDisplayString(e.unref(A)("textEditor.image.altText")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"imageAltInput",ref:Dt,type:"text","onUpdate:modelValue":l[19]||(l[19]=a=>Ot.value=a),class:"dss-link-modal-input",placeholder:e.unref(A)("textEditor.image.enterAltText"),onKeyup:e.withKeys(Nt,["enter"])},null,40,Fu),[[e.vModelText,Ot.value]])]),e.createElementVNode("div",Iu,[e.createElementVNode("label",zu,e.toDisplayString(e.unref(A)("textEditor.image.width")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":l[20]||(l[20]=a=>lt.value=a),class:"dss-link-modal-input",placeholder:e.unref(A)("textEditor.image.auto"),onKeyup:e.withKeys(Nt,["enter"]),onInput:bo},null,40,Pu),[[e.vModelText,lt.value]])]),e.createElementVNode("div",Ou,[e.createElementVNode("label",Zu,e.toDisplayString(e.unref(A)("textEditor.image.height")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":l[21]||(l[21]=a=>je.value=a),class:"dss-link-modal-input",placeholder:e.unref(A)("textEditor.image.auto"),onKeyup:e.withKeys(Nt,["enter"]),onInput:Dl},null,40,Wu),[[e.vModelText,je.value]])])])])):e.createCommentVNode("",!0),fe.value==="url"?(e.openBlock(),e.createElementBlock("div",qu,[e.createElementVNode("div",Uu,[e.createElementVNode("div",Xu,[e.createElementVNode("label",Yu,e.toDisplayString(e.unref(A)("textEditor.image.imageUrl")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"imageUrlInput",ref:Bt,type:"text","onUpdate:modelValue":l[22]||(l[22]=a=>Ne.value=a),class:"dss-link-modal-input",placeholder:e.unref(A)("textEditor.image.enterImageUrl"),onKeyup:e.withKeys(Nt,["enter"])},null,40,ju),[[e.vModelText,Ne.value]])]),e.createElementVNode("div",Ku,[e.createElementVNode("label",Gu,e.toDisplayString(e.unref(A)("textEditor.image.altText")),1),e.withDirectives(e.createElementVNode("input",{type:"text","onUpdate:modelValue":l[23]||(l[23]=a=>Ot.value=a),class:"dss-link-modal-input",placeholder:e.unref(A)("textEditor.image.enterAltText"),onKeyup:e.withKeys(Nt,["enter"])},null,40,Qu),[[e.vModelText,Ot.value]])]),e.createElementVNode("div",Ju,[e.createElementVNode("label",ed,e.toDisplayString(e.unref(A)("textEditor.image.width")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":l[24]||(l[24]=a=>lt.value=a),class:"dss-link-modal-input",placeholder:e.unref(A)("textEditor.image.auto"),onKeyup:e.withKeys(Nt,["enter"]),onInput:bo},null,40,td),[[e.vModelText,lt.value]])]),e.createElementVNode("div",nd,[e.createElementVNode("label",ld,e.toDisplayString(e.unref(A)("textEditor.image.height")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":l[25]||(l[25]=a=>je.value=a),class:"dss-link-modal-input",placeholder:e.unref(A)("textEditor.image.auto"),onKeyup:e.withKeys(Nt,["enter"]),onInput:Dl},null,40,od),[[e.vModelText,je.value]])])])])):e.createCommentVNode("",!0)]),actions:e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-cancel",onClick:wl},e.toDisplayString(e.unref(A)("textEditor.image.cancel")),1),e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-save",onClick:Nt},e.toDisplayString(e.unref(A)("textEditor.image.save")),1)]),_:1},8,["showModal"]),e.createElementVNode("div",{class:e.normalizeClass(["dss-text-editor-title-wrapper",{"dss-text-editor-no-border-bottom":wn.value&&De.value}])},[e.createElementVNode("p",null,e.toDisplayString(e.unref(A)("textEditor.labels.title")),1),e.createElementVNode("div",ad,[De.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",sd,[F.title?(e.openBlock(),e.createElementBlock("span",rd,e.toDisplayString(F.title),1)):(e.openBlock(),e.createElementBlock("span",id,e.toDisplayString(nt.value),1))])),e.createElementVNode("textarea",{ref_key:"titleInputRef",ref:V,value:F.title,onInput:An,onFocus:hn,onBlur:Zl,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-title-input",{"dss-text-editor-title-input-blurred":!De.value}]),placeholder:nt.value,disabled:F.disabled,rows:"1"},null,42,cd)])],2),wn.value&&De.value?(e.openBlock(),e.createElementBlock("div",ud,[e.renderSlot(o.$slots,"title-slot")])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["dss-text-editor-description-wrapper",{"dss-text-editor-no-border-bottom":sn.value&&re.value}])},[e.createElementVNode("p",null,e.toDisplayString(e.unref(A)("textEditor.labels.description")),1),e.createElementVNode("div",dd,[re.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",md,[F.description?(e.openBlock(),e.createElementBlock("span",pd,e.toDisplayString(F.description),1)):(e.openBlock(),e.createElementBlock("span",fd,e.toDisplayString(st.value),1))])),e.createElementVNode("textarea",{ref_key:"descriptionInputRef",ref:P,value:F.description,onInput:Ee,onFocus:hl,onBlur:Ll,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-description-input",{"dss-text-editor-description-input-blurred":!re.value}]),placeholder:st.value,disabled:F.disabled,rows:"1"},null,42,vd)])],2),sn.value&&re.value?(e.openBlock(),e.createElementBlock("div",gd,[e.renderSlot(o.$slots,"description-slot")])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(vt.value,a=>(e.openBlock(),e.createElementBlock("div",{key:a.id,class:e.normalizeClass(["editor-comment-marker-group",{"editor-comment-marker-active":mn.value===a.id,"editor-comment-marker-group-out-of-view":a.opacity===0}]),"data-comment-id":a.id,style:e.normalizeStyle({top:a.top+"px"}),onMouseenter:r=>Lo(a),onMouseleave:to},[a.firstUser?(e.openBlock(),e.createElementBlock("div",{key:0,class:"editor-comment-marker editor-comment-marker-first",onClick:e.withModifiers(r=>xl(a),["stop"])},[a.firstUser.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:a.firstUser.avatar,alt:a.firstUser.name||"avatar"},null,8,Cd)):(e.openBlock(),e.createElementBlock("span",kd,e.toDisplayString(a.firstUser.initials||(a.firstUser.name?a.firstUser.name.charAt(0):"")),1))],8,yd)):e.createCommentVNode("",!0),a.secondUser?(e.openBlock(),e.createElementBlock("div",{key:1,class:"editor-comment-marker editor-comment-marker-second",onClick:e.withModifiers(r=>xl(a),["stop"])},[a.secondUser.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:a.secondUser.avatar,alt:a.secondUser.name||"avatar"},null,8,wd)):(e.openBlock(),e.createElementBlock("span",xd,e.toDisplayString(a.secondUser.initials||(a.secondUser.name?a.secondUser.name.charAt(0):"")),1))],8,bd)):e.createCommentVNode("",!0),a.additionalCount>0?(e.openBlock(),e.createElementBlock("div",{key:2,class:"editor-comment-marker editor-comment-marker-additional",style:e.normalizeStyle({top:a.secondUser?"30px":"15px"}),"data-has-second-user":a.secondUser?"true":"false",onClick:e.withModifiers(r=>xl(a),["stop"])},[e.createElementVNode("span",Vd,"+"+e.toDisplayString(a.additionalCount),1)],12,Ed)):e.createCommentVNode("",!0)],46,hd))),128)),F.richText?(e.openBlock(),e.createElementBlock("div",Td,[e.createElementVNode("div",{ref_key:"editorRef",ref:p,contenteditable:"true",spellcheck:"false",class:e.normalizeClass(["dss-text-editor-content",{"dss-text-editor-content-disabled":F.disabled,"dss-text-editor-fixed-height":F.fixedHeight}]),style:e.normalizeStyle(cl.value),onInput:Be,onBlur:Hl,onClick:ho,onMouseup:yl,onKeyup:yl,onKeydown:fn,onPaste:On,onMousemove:Ml,onMouseleave:Bo},null,38),e.createVNode(e.Transition,{name:"comment-overlay"},{default:e.withCtx(()=>[mn.value!==null?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-comment-overlay",style:e.normalizeStyle(ml.value)},[tl.value||_n.value.length>0?(e.openBlock(),e.createElementBlock("div",Ld,[e.createElementVNode("div",Hd,[tl.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-comment-selection",innerHTML:tl.value},null,8,Ad)):e.createCommentVNode("",!0)]),e.createElementVNode("div",Dd,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_n.value,(a,r)=>(e.openBlock(),e.createElementBlock("div",{key:r,class:"dss-comment-message"},[a.user&&(a.user.avatar||a.user.initials||a.user.name)?(e.openBlock(),e.createElementBlock("div",Rd,[e.createElementVNode("div",Fd,[a.user.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:a.user.avatar,alt:a.user.name||"avatar"},null,8,Id)):(e.openBlock(),e.createElementBlock("span",zd,e.toDisplayString(a.user.initials||(a.user.name?a.user.name.charAt(0):"")),1))])])):e.createCommentVNode("",!0),e.createElementVNode("div",Pd,[e.createElementVNode("div",Od,[e.createElementVNode("div",Zd,e.toDisplayString(a.user&&a.user.name||"Comment"),1),a.createdAt?(e.openBlock(),e.createElementBlock("div",Wd,e.toDisplayString(Tl(new Date(a.createdAt))),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:e.normalizeClass(["dss-comment-body-text",{"comment-started":Sl(a.text)||a.class==="comment-started"}])},e.toDisplayString(a.text||""),3)]),k.commentUser&&a.user&&a.user.id===k.commentUser.id&&!Sl(a.text)?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-comment-delete-button",onClick:e.withModifiers(c=>vo(a,r),["stop"]),title:e.unref(A)("textEditor.comment.delete")||"Delete comment"},[...l[80]||(l[80]=[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,qd)):e.createCommentVNode("",!0)]))),128))])])):e.createCommentVNode("",!0),e.createElementVNode("div",Ud,[e.withDirectives(e.createElementVNode("textarea",{ref_key:"commentInputRef",ref:Gn,"onUpdate:modelValue":l[26]||(l[26]=a=>Cn.value=a),class:"dss-comment-input",rows:"1",placeholder:e.unref(A)("textEditor.comment.placeholder"),onKeydown:e.withKeys(e.withModifiers(Al,["prevent","stop"]),["enter"]),onInput:l[27]||(l[27]=()=>{if(Gn.value){const a=Gn.value;a.style.height="auto",a.style.height=`${a.scrollHeight}px`}})},null,40,Xd),[[e.vModelText,Cn.value]]),e.createElementVNode("button",{type:"button",class:"dss-comment-send-button",onClick:e.withModifiers(Al,["stop"])},[...l[81]||(l[81]=[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",Yd,[e.createElementVNode("div",jd,[e.createElementVNode("span",Kd,e.toDisplayString(R.value)+" "+e.toDisplayString(R.value===1?e.unref(A)("textEditor.footer.word"):e.unref(A)("textEditor.footer.words")),1),l[82]||(l[82]=e.createElementVNode("span",{class:"dss-text-editor-footer-separator"},"•",-1)),e.createElementVNode("span",Gd,e.toDisplayString(le.value)+" "+e.toDisplayString(le.value===1?e.unref(A)("textEditor.footer.character"):e.unref(A)("textEditor.footer.characters")),1)])])])):(e.openBlock(),e.createElementBlock("div",Nd,[e.createElementVNode("textarea",{value:F.modelValue,onInput:gl,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-textarea",{"dss-text-editor-fixed-height":F.fixedHeight}]),placeholder:Qe.value,rows:F.rows,disabled:F.disabled,style:e.normalizeStyle(qn.value)},null,46,Sd),e.createElementVNode("div",Bd,[e.createElementVNode("div",Md,[e.createElementVNode("span",_d,e.toDisplayString(R.value)+" "+e.toDisplayString(R.value===1?e.unref(A)("textEditor.footer.word"):e.unref(A)("textEditor.footer.words")),1),l[79]||(l[79]=e.createElementVNode("span",{class:"dss-text-editor-footer-separator"},"•",-1)),e.createElementVNode("span",$d,e.toDisplayString(le.value)+" "+e.toDisplayString(le.value===1?e.unref(A)("textEditor.footer.character"):e.unref(A)("textEditor.footer.characters")),1)])])])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[ee.value&&S.value&&p.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-link-popup",style:e.normalizeStyle(ne.value),onMouseenter:l[28]||(l[28]=a=>He.value=!0),onMouseleave:kl},[e.createElementVNode("span",{class:"dss-link-popup-url",onClick:e.withModifiers(Mo,["stop"]),title:S.value},e.toDisplayString(S.value),9,Qd),e.createElementVNode("button",{type:"button",class:"dss-link-popup-edit",onClick:e.withModifiers(_o,["stop"]),title:e.unref(A)("textEditor.link.editLink")},[(e.openBlock(),e.createElementBlock("svg",e1,[...l[83]||(l[83]=[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,Jd)],36)):e.createCommentVNode("",!0)])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[Yt.value&&Ct.value&&p.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-link-popup",style:e.normalizeStyle(te.value),onMouseenter:l[29]||(l[29]=a=>$e.value=!0),onMouseleave:bl},[e.createElementVNode("div",t1,[Ct.value===e.unref(A)("textEditor.image.noAlt")?(e.openBlock(),e.createElementBlock("div",n1,[...l[84]||(l[84]=[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:Ct.value},e.toDisplayString(Ct.value),9,l1)]),e.createElementVNode("button",{type:"button",class:"dss-link-popup-edit",onClick:e.withModifiers(To,["stop"]),title:e.unref(A)("textEditor.image.editImage")},[(e.openBlock(),e.createElementBlock("svg",a1,[...l[85]||(l[85]=[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,o1)],36)):e.createCommentVNode("",!0)])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[F.floatingToolbar&&F.richText&&ge.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"floatingToolbarRef",ref:St,class:"dss-floating-toolbar",style:e.normalizeStyle(yt.value),onMousedown:l[44]||(l[44]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("div",s1,[e.createElementVNode("div",{class:"dss-toolbar-button",onClick:e.withModifiers(w,["stop"]),title:e.unref(A)("textEditor.toolbar.undo")},[...l[86]||(l[86]=[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,r1),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-disabled":!D.value}]),onClick:e.withModifiers(y,["stop"]),title:e.unref(A)("textEditor.toolbar.redo")},[...l[87]||(l[87]=[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,i1),l[107]||(l[107]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",c1,[e.createElementVNode("div",{class:"dss-toolbar-button dss-toolbar-dropdown-toggle",onClick:l[30]||(l[30]=e.withModifiers(a=>Kl("paragraph"),["stop"])),title:e.unref(A)("textEditor.toolbar.paragraphFormat")},[tt.value==="h1"?(e.openBlock(),e.createElementBlock("svg",d1,[...l[88]||(l[88]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M6.2 13V11.836H8.456V7.12H6.548V6.16C8.312 6.04 8.648 5.44 8.804 4.84H9.884V11.836H11.96V13H6.2Z",fill:"#FFC230"},null,-1)])])):tt.value==="h2"?(e.openBlock(),e.createElementBlock("svg",m1,[...l[89]||(l[89]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M6.02 13V11.8L8.732 9.388C9.644 8.584 10.208 8.08 10.208 7.288C10.208 6.64 9.764 6.04 8.84 6.04C7.904 6.04 7.424 6.676 7.412 7.852H5.972C5.852 5.872 7.16 4.72 8.948 4.72C10.736 4.72 11.672 5.86 11.672 7.12C11.672 8.464 10.916 9.364 9.92 10.168L8.192 11.56H11.708V13H6.02Z",fill:"#FFC230"},null,-1)])])):tt.value==="h3"?(e.openBlock(),e.createElementBlock("svg",p1,[...l[90]||(l[90]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M8.156 8.188H8.828C9.56 8.188 10.064 7.696 10.064 7.072C10.064 6.508 9.74 6.04 8.792 6.04C7.748 6.04 7.472 6.688 7.388 7.612H5.948C5.828 6.232 6.896 4.72 8.924 4.72C10.712 4.72 11.6 5.896 11.6 6.892C11.6 7.648 11.3 8.356 10.568 8.704C11.42 9.112 11.768 9.7 11.768 10.48C11.768 11.86 10.712 13.12 8.804 13.12C6.776 13.12 5.708 11.608 5.828 10.228H7.268C7.232 11.068 7.736 11.8 8.792 11.8C9.74 11.8 10.184 11.248 10.184 10.48C10.184 9.808 9.752 9.268 8.828 9.268H8.156V8.188Z",fill:"#FFC230"},null,-1)])])):tt.value==="h4"?(e.openBlock(),e.createElementBlock("svg",f1,[...l[91]||(l[91]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M5.72 11.056V9.856L9.284 4.84H10.832V9.856H12.272V11.056H10.832V13H9.284V11.056H5.72ZM7.076 9.856H9.284V6.832L7.076 9.856Z",fill:"#FFC230"},null,-1)])])):tt.value==="h5"?(e.openBlock(),e.createElementBlock("svg",v1,[...l[92]||(l[92]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M7.652 9.436H6.164C6.416 7.84 6.56 6.64 6.596 4.852L11.516 4.84V6.28H7.82L7.676 7.972C8.084 7.684 8.6 7.516 9.308 7.516C10.832 7.516 11.804 8.644 11.804 10.24C11.804 11.86 10.58 13.12 8.804 13.12C7.328 13.12 5.864 11.968 6.164 10.156H7.484C7.388 11.224 7.964 11.8 8.876 11.8C9.812 11.8 10.316 11.092 10.316 10.252C10.316 9.412 9.908 8.632 8.9 8.632C8.132 8.632 7.748 9.112 7.652 9.436Z",fill:"#FFC230"},null,-1)])])):tt.value==="h6"?(e.openBlock(),e.createElementBlock("svg",g1,[...l[93]||(l[93]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M11.912 10.24C11.912 11.86 10.808 13.12 9.056 13.12C7.16 13.12 5.96 11.5 5.96 9.04C5.96 6.34 7.316 4.72 9.344 4.72C11 4.72 11.84 5.872 11.84 7.012H10.4C10.328 6.628 10.088 6.028 9.104 6.028C8.06 6.028 7.388 6.748 7.316 8.392C7.784 7.84 8.396 7.444 9.416 7.444C10.94 7.444 11.912 8.644 11.912 10.24ZM9.08 8.848C8.12 8.848 7.736 9.556 7.736 10.396C7.736 11.236 8.12 11.944 9.08 11.944C10.04 11.944 10.424 11.236 10.424 10.396C10.424 9.556 10.04 8.848 9.08 8.848Z",fill:"#FFC230"},null,-1)])])):(e.openBlock(),e.createElementBlock("svg",h1,[...l[94]||(l[94]=[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[95]||(l[95]=e.createElementVNode("span",{class:"dss-toolbar-dropdown-arrow"},"˅",-1))],8,u1),at.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]=a=>$n("<h1>"))},[e.createElementVNode("h1",null,e.toDisplayString(e.unref(A)("textEditor.paragraph.heading1")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[32]||(l[32]=a=>$n("<h2>"))},[e.createElementVNode("h2",null,e.toDisplayString(e.unref(A)("textEditor.paragraph.heading2")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[33]||(l[33]=a=>$n("<h3>"))},[e.createElementVNode("h3",null,e.toDisplayString(e.unref(A)("textEditor.paragraph.heading3")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[34]||(l[34]=a=>$n("<h4>"))},[e.createElementVNode("h4",null,e.toDisplayString(e.unref(A)("textEditor.paragraph.heading4")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[35]||(l[35]=a=>$n("<h5>"))},[e.createElementVNode("h5",null,e.toDisplayString(e.unref(A)("textEditor.paragraph.heading5")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[36]||(l[36]=a=>$n("<h6>"))},[e.createElementVNode("h6",null,e.toDisplayString(e.unref(A)("textEditor.paragraph.heading6")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[37]||(l[37]=a=>$n("<p>"))},[e.createElementVNode("p",null,e.toDisplayString(e.unref(A)("textEditor.paragraph.paragraph")),1)])])):e.createCommentVNode("",!0)]),l[108]||(l[108]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Ht("bold")}]),onClick:l[39]||(l[39]=e.withModifiers(a=>ot("bold"),["stop"])),title:e.unref(A)("textEditor.toolbar.bold")},[...l[96]||(l[96]=[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,y1),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Ht("italic")}]),onClick:l[40]||(l[40]=e.withModifiers(a=>ot("italic"),["stop"])),title:e.unref(A)("textEditor.toolbar.italic")},[...l[97]||(l[97]=[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,C1),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Ht("underline")}]),onClick:l[41]||(l[41]=e.withModifiers(a=>ot("underline"),["stop"])),title:e.unref(A)("textEditor.toolbar.underline")},[...l[98]||(l[98]=[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,k1),l[109]||(l[109]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":ut.value}]),onClick:e.withModifiers(ro,["stop"]),title:e.unref(A)("textEditor.toolbar.citation")},[...l[99]||(l[99]=[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,b1),l[110]||(l[110]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),ve.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-button",onClick:e.withModifiers(ql,["stop"]),title:e.unref(A)("textEditor.toolbar.removeLink")},[...l[101]||(l[101]=[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,x1)):(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-button",onClick:e.withModifiers(co,["stop"]),title:e.unref(A)("textEditor.toolbar.insertLink")},[...l[100]||(l[100]=[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,w1)),l[111]||(l[111]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Ht("insertUnorderedList")}]),onClick:e.withModifiers(uo,["stop"]),title:e.unref(A)("textEditor.toolbar.bulletList")},[...l[102]||(l[102]=[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,E1),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Ht("insertOrderedList")}]),onClick:e.withModifiers(el,["stop"]),title:e.unref(A)("textEditor.toolbar.numberList")},[...l[103]||(l[103]=[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,V1),l[112]||(l[112]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:"dss-toolbar-button",onClick:e.withModifiers(Ft,["stop"]),title:e.unref(A)("textEditor.toolbar.image")},[...l[104]||(l[104]=[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,N1),l[113]||(l[113]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:"dss-toolbar-button",title:e.unref(A)("textEditor.toolbar.comment"),onClick:e.withModifiers(Xl,["stop"])},[...l[105]||(l[105]=[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,S1),F.askAi?(e.openBlock(),e.createElementBlock("div",B1)):e.createCommentVNode("",!0),F.askAi?(e.openBlock(),e.createElementBlock("div",M1,[e.createElementVNode("div",{class:"dss-toolbar-ai-button dss-toolbar-ai-float dss-toolbar-dropdown-toggle",onClick:l[42]||(l[42]=e.withModifiers(a=>Kl("askAi"),["stop"])),title:e.unref(A)("textEditor.toolbar.askAi")},[l[106]||(l[106]=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:"#FFAF54"}),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:"#FFC963"})],-1)),e.createElementVNode("span",$1,e.toDisplayString(e.unref(A)("textEditor.toolbar.askAi")),1)],8,_1),at.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)]),Hn.value?(e.openBlock(),e.createElementBlock("div",T1,[F.askAi&&Hn.value?(e.openBlock(),e.createElementBlock("div",L1)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(F.customToolbarSlots,(a,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:r},[Ke(a)&&tn(a)?(e.openBlock(),e.createElementBlock("div",H1,[e.renderSlot(o.$slots,a)])):e.createCommentVNode("",!0),Ke(a)&&tn(a)&&r<F.customToolbarSlots.length-1&&Ln(r)?(e.openBlock(),e.createElementBlock("div",A1)):e.createCommentVNode("",!0)],64))),128))])):e.createCommentVNode("",!0)],36)):e.createCommentVNode("",!0)]))],6))}}),F1={class:"dss-color-picker__section-title"},I1={class:"dss-color-picker__presets-row"},z1=["title","onClick"],P1={key:1,class:"dss-color-picker__section"},O1={class:"dss-color-picker__presets-row"},Z1=["title","onClick"],W1={class:"dss-color-picker__section"},q1={class:"dss-color-picker__section-header"},U1={class:"dss-color-picker__presets-row"},X1=["title","onClick"],Y1=["onClick"],j1={key:1,class:"dss-color-picker__presets-row dss-color-picker__presets-row--standalone"},K1=["title","onClick"],G1={class:"dss-color-picker__input-row"},Q1=["value"],J1={__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}},emits:["update:modelValue","update:presetColors"],setup(F,{emit:Ce}){function z(X){const Z=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(X);if(!Z)return{h:0,s:0,l:50};const j=parseInt(Z[1],16)/255,ie=parseInt(Z[2],16)/255,E=parseInt(Z[3],16)/255,C=Math.max(j,ie,E),V=Math.min(j,ie,E);let P=0,U=0;const ze=(C+V)/2;if(C!==V){const Re=C-V;switch(U=ze>.5?Re/(2-C-V):Re/(C+V),C){case j:P=((ie-E)/Re+(ie<E?6:0))/6;break;case ie:P=((E-j)/Re+2)/6;break;case E:P=((j-ie)/Re+4)/6;break}}return{h:P*360,s:U*100,l:ze*100}}function A(X,Z,j){Z/=100,j/=100;const ie=Z*Math.min(j,1-j),E=C=>{const V=(C+X/30)%12,P=j-ie*Math.max(Math.min(V-3,9-V,1),-1);return Math.round(255*P).toString(16).padStart(2,"0")};return`#${E(0)}${E(8)}${E(4)}`}function _e(X){const Z=X.replace(/^#/,"").match(/^([a-f\d]{6}|[a-f\d]{3})$/i);if(!Z)return null;let j=Z[1];return j.length===3&&(j=j.split("").map(ie=>ie+ie).join("")),"#"+j}function k(X,Z,j){Z/=100,j/=100;const ie=j+Z*Math.min(j,1-j),E=ie===0?0:2-2*j/ie;return{h:X,s:E*100,v:ie*100}}function Le(X,Z,j){Z/=100,j/=100;const ie=j*(1-Z/2),E=ie===0||ie===1?0:(j-ie)/Math.min(ie,1-ie);return{h:X,s:E*100,l:ie*100}}const se=F,pt=Ce,p=e.ref(!1),ue=e.ref(!1),ve=e.ref(!1),de=e.ref(-1),ee=e.ref(-1),S=e.ref(null),ne=e.ref(null),He=e.ref(null),Ae=e.ref(null),Ie=e.ref({top:0,left:0}),O=e.ref(z(se.modelValue||"#b8a5de")),rt=e.computed(()=>Array.isArray(se.presetGroups)&&se.presetGroups.length>0),Oe=e.computed(()=>rt.value?0:se.initialPresetCount!=null?se.initialPresetCount:ee.value<0?null:ee.value),we=e.computed(()=>{const X=Oe.value;return X==null?!0:Math.max(0,se.presetColors.length-X)<se.max}),xt=e.computed(()=>!!(ue.value||de.value>=0||!Tt.value&&se.presetColors.length===0));e.computed(()=>{const X=Oe.value;return X!=null&&se.presetColors.length>X});const Tt=e.computed(()=>rt.value||Oe.value!=null),ut=e.computed(()=>{const X=Oe.value;return X==null?[]:se.presetColors.slice(0,X)}),Ze=e.computed(()=>{const X=Oe.value;return X==null?[]:se.presetColors.slice(X)});function ge(X){const Z=Oe.value;return Z!=null?Z+X:-1}function yt(X){const Z=Oe.value;return Z!=null&&X>=Z}function St(X){yt(X)&&(de.value=X,O.value=z(se.presetColors[X]),ue.value=!0,e.nextTick(()=>Ae.value?.focus()))}function at(X){if(!yt(X))return;const Z=se.presetColors.filter((E,C)=>C!==X);pt("update:presetColors",Z);const j=_e(se.modelValue),ie=_e(se.presetColors[X]);if(j&&ie&&j.toLowerCase()===ie.toLowerCase()){const E=Z[Math.max(0,X-1)]||Z[0];E&&pt("update:modelValue",E)}}function $t(){ve.value=!ve.value,ve.value||(de.value=-1,ue.value=!1)}function Ot(){if(de.value<0)return;const X=je.value,Z=_e(X);if(Z){const j=[...se.presetColors];j[de.value]=Z,pt("update:presetColors",j),pt("update:modelValue",Z),de.value=-1,ue.value=!1}}function on(){se.disabled||(de.value=-1,ue.value=!ue.value,ue.value&&(Ct(),e.nextTick(()=>Ae.value?.focus())))}function Et(X){const Z=_e(X),j=_e(se.modelValue);return Z&&j&&Z.toLowerCase()===j.toLowerCase()}function lt(){if(se.disabled||!we.value)return;const X=je.value,Z=_e(X);if(Z){const j=[...se.presetColors,Z];pt("update:presetColors",j),pt("update:modelValue",Z);const ie=Oe.value??ee.value;ie>=0&&j.length-ie>=se.max&&(ue.value=!1)}}const je=e.computed(()=>{const{h:X,s:Z,l:j}=O.value;return A(X,Z,j)}),Dt=e.computed(()=>je.value.toLowerCase()),Lt=e.computed(()=>({background:`linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, hsl(${O.value.h}, 100%, 50%))`})),Bt=e.computed(()=>{const X=k(O.value.h,O.value.s,O.value.l);return{left:`${X.s}%`,bottom:`${X.v}%`,transform:"translate(-50%, 50%)"}}),Xe=e.computed(()=>({left:`${O.value.h/360*100}%`,transform:"translateX(-50%)"})),Zt=e.computed(()=>({position:"fixed",left:`${Ie.value.left}px`,top:`${Ie.value.top}px`,zIndex:1002}));function Yt(){if(!S.value||!p.value)return;const X=S.value.getBoundingClientRect(),Z=window.innerHeight||document.documentElement.clientHeight;let j=X.bottom+4;const ie=ne.value;ie&&j+ie.offsetHeight>Z-8&&(j=X.top-4-ie.offsetHeight),Ie.value={top:j,left:X.left}}function Ct(){const X=se.modelValue||"#b8a5de";_e(X)&&(O.value=z(X))}function te(){pt("update:modelValue",je.value)}function $e(){se.disabled||(p.value=!p.value,p.value&&(Ct(),e.nextTick(()=>{Yt(),Ae.value?.focus()})))}function fe(){const X=je.value,Z=_e(X);if(Z){if(de.value>=0){const j=[...se.presetColors];j[de.value]=Z,pt("update:presetColors",j),pt("update:modelValue",Z)}else if((se.presetColors.length>0||rt.value)&&ue.value&&we.value&&!se.presetColors.some(ie=>_e(ie)?.toLowerCase()===Z.toLowerCase())){const ie=[...se.presetColors,Z];pt("update:presetColors",ie),pt("update:modelValue",Z)}}p.value=!1,ue.value=!1,ve.value=!1,de.value=-1}function Ne(X){if(!He.value)return;const Z=He.value.getBoundingClientRect(),j=ie=>{const E=Math.max(0,Math.min(1,(ie.clientX-Z.left)/Z.width)),C=Math.max(0,Math.min(1,1-(ie.clientY-Z.top)/Z.height)),V={h:O.value.h,s:E*100,v:C*100};O.value=Le(V.h,V.s,V.v)};j(X),document.addEventListener("mousemove",j),document.addEventListener("mouseup",()=>{document.removeEventListener("mousemove",j),te()},{once:!0})}function We(X){if(!X.currentTarget)return;const j=X.currentTarget.getBoundingClientRect(),ie=E=>{const C=Math.max(0,Math.min(1,(E.clientX-j.left)/j.width));O.value={...O.value,h:C*360}};ie(X),document.addEventListener("mousemove",ie),document.addEventListener("mouseup",()=>{document.removeEventListener("mousemove",ie),te()},{once:!0})}function ft(X){const Z=X.target.value,j=_e(Z);j&&(O.value=z(j),pt("update:modelValue",j))}function qe(X){if(se.disabled)return;const Z=_e(X);Z&&(O.value=z(Z),pt("update:modelValue",Z))}let dt=null,xe=null;function Ue(){dt&&(document.removeEventListener("keydown",dt),dt=null),xe&&(window.removeEventListener("resize",xe),xe=null)}return e.watch(p,X=>{if(Ue(),X){if(!rt.value&&se.initialPresetCount==null){const Z=se.presetColors.length;Z>0&&(ee.value<0||Z<ee.value)&&(ee.value=Z)}dt=Z=>{Z.key==="Escape"&&fe()},xe=Yt,document.addEventListener("keydown",dt),window.addEventListener("resize",xe)}}),e.watch(()=>se.modelValue,()=>{p.value&&Ct()},{immediate:!1}),e.watch(Ze,X=>{X.length===0&&(ve.value=!1,de.value=-1,ue.value=!1)}),e.onBeforeUnmount(Ue),(X,Z)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-color-picker",{"dss-color-picker--disabled":F.disabled}])},[e.createElementVNode("div",{ref_key:"triggerRef",ref:S,class:e.normalizeClass(["dss-color-picker__trigger",{"dss-color-picker__trigger--open":p.value}]),onClick:$e},[e.createElementVNode("span",{class:"dss-color-picker__swatch",style:e.normalizeStyle({backgroundColor:je.value})},[...Z[0]||(Z[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"},[p.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-color-picker__overlay",onClick:e.withModifiers(fe,["self"])},[e.createElementVNode("div",{ref_key:"dropdownRef",ref:ne,class:"dss-color-picker__dropdown",style:e.normalizeStyle(Zt.value)},[Tt.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[rt.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(F.presetGroups,(j,ie)=>(e.openBlock(),e.createElementBlock("div",{key:"g-"+ie,class:"dss-color-picker__section"},[e.createElementVNode("span",F1,e.toDisplayString(j.title),1),e.createElementVNode("div",I1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(j.colors,(E,C)=>(e.openBlock(),e.createElementBlock("button",{key:"g-"+ie+"-"+C,type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":Et(E)}]),style:e.normalizeStyle({backgroundColor:E}),title:E,onClick:e.withModifiers(V=>qe(E),["stop"])},null,14,z1))),128))])]))),128)):ut.value.length?(e.openBlock(),e.createElementBlock("div",P1,[Z[1]||(Z[1]=e.createElementVNode("span",{class:"dss-color-picker__section-title"},"Preset colors",-1)),e.createElementVNode("div",O1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ut.value,(j,ie)=>(e.openBlock(),e.createElementBlock("button",{key:"p-"+ie,type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":Et(j)}]),style:e.normalizeStyle({backgroundColor:j}),title:j,onClick:e.withModifiers(E=>qe(j),["stop"])},null,14,Z1))),128))])])):e.createCommentVNode("",!0),e.createElementVNode("div",W1,[e.createElementVNode("div",q1,[Z[3]||(Z[3]=e.createElementVNode("span",{class:"dss-color-picker__section-title"},"Custom Colors",-1)),Ze.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":ve.value}]),title:"Manage custom colors",onClick:e.withModifiers($t,["stop"])},[...Z[2]||(Z[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",U1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ze.value,(j,ie)=>(e.openBlock(),e.createElementBlock("div",{key:"c-"+ie,class:e.normalizeClass(["dss-color-picker__preset-wrap",{"dss-color-picker__preset-wrap--manage":ve.value}])},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":!ve.value&&Et(j),"dss-color-picker__preset-bubble--editing":ve.value&&de.value===ge(ie)}]),style:e.normalizeStyle({backgroundColor:de.value===ge(ie)?je.value:j}),title:de.value===ge(ie)?je.value:j,onClick:e.withModifiers(E=>ve.value?St(ge(ie)):qe(j),["stop"])},null,14,X1),ve.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(E=>at(ge(ie)),["stop"])},[...Z[4]||(Z[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,Y1)):e.createCommentVNode("",!0)],2))),128)),we.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-color-picker__add-bubble",{"dss-color-picker__add-bubble--active":ue.value}]),onClick:e.withModifiers(on,["stop"])}," + ",2)):e.createCommentVNode("",!0)])])],64)):F.presetColors.length?(e.openBlock(),e.createElementBlock("div",j1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(F.presetColors,(j,ie)=>(e.openBlock(),e.createElementBlock("button",{key:ie,type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":Et(j)}]),style:e.normalizeStyle({backgroundColor:j}),title:j,onClick:e.withModifiers(E=>qe(j),["stop"])},null,14,K1))),128)),we.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-color-picker__add-bubble",{"dss-color-picker__add-bubble--active":ue.value}]),onClick:e.withModifiers(on,["stop"])}," + ",2)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),xt.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createElementVNode("div",{class:"dss-color-picker__sl-area",ref_key:"slAreaRef",ref:He,onMousedown:Ne},[e.createElementVNode("div",{class:"dss-color-picker__sl-bg",style:e.normalizeStyle(Lt.value)},null,4),e.createElementVNode("div",{class:"dss-color-picker__sl-pointer",style:e.normalizeStyle(Bt.value)},null,4)],544),e.createElementVNode("div",{class:"dss-color-picker__hue-wrap",onMousedown:We},[Z[5]||(Z[5]=e.createElementVNode("div",{class:"dss-color-picker__hue-track"},null,-1)),e.createElementVNode("div",{class:"dss-color-picker__hue-pointer",style:e.normalizeStyle(Xe.value)},null,4)],32),e.createElementVNode("div",G1,[e.createElementVNode("input",{ref_key:"hexInputRef",ref:Ae,type:"text",class:"dss-color-picker__hex-input",value:Dt.value,onInput:ft},null,40,Q1)]),Tt.value&&(F.presetColors.length||rt.value)&&we.value&&de.value<0?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-color-picker__add-btn",onClick:lt}," Save color ")):e.createCommentVNode("",!0),Tt.value&&de.value>=0?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-color-picker__add-btn",onClick:Ot}," Save color ")):e.createCommentVNode("",!0),Tt.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:2,type:"button",class:"dss-color-picker__add-btn",onClick:fe}," Save color "))],64)):e.createCommentVNode("",!0)],4)])):e.createCommentVNode("",!0)]))],2))}},em={key:0,class:"dss-loader"},tm={key:0,class:"dss-loader-label"},nm={key:1,class:"dss-loader"},lm={key:0,class:"dss-loader-label"},om={key:2,class:"dss-loader"},am={key:0,class:"dss-loader-label"},sm={key:3,class:"dss-loader"},rm={key:0,class:"dss-loader-label"},im={key:4,class:"dss-loader"},cm={key:0,class:"dss-loader-label"},um={key:5,class:"dss-loader dss-loader--inline"},dm={class:"dss-loader-inline-text"},mm={__name:"DSSLoaders",props:{type:{type:String,default:"spinner"},label:{type:String,default:""},size:{type:[String,Number],default:"medium"}},setup(F){const Ce=F,z=e.computed(()=>Ce.size==="small"?"dss-loaders--size-small":Ce.size==="large"?"dss-loaders--size-large":Ce.size==="medium"||Ce.size==null?"dss-loaders--size-medium":null),A=e.computed(()=>Ce.size==="small"||Ce.size==="medium"||Ce.size==="large"||Ce.size==null?{}:{"--dss-loader-size":typeof Ce.size=="number"?`${Ce.size}px`:String(Ce.size)});return(_e,k)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-loaders",z.value]),style:e.normalizeStyle(A.value)},[F.type==="spinner"?(e.openBlock(),e.createElementBlock("div",em,[k[0]||(k[0]=e.createElementVNode("span",{class:"dss-loader-spinner","aria-hidden":"true"},null,-1)),F.label?(e.openBlock(),e.createElementBlock("span",tm,e.toDisplayString(F.label),1)):e.createCommentVNode("",!0)])):F.type==="dots"?(e.openBlock(),e.createElementBlock("div",nm,[k[1]||(k[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)),F.label?(e.openBlock(),e.createElementBlock("span",lm,e.toDisplayString(F.label),1)):e.createCommentVNode("",!0)])):F.type==="battery"?(e.openBlock(),e.createElementBlock("div",om,[k[2]||(k[2]=e.createElementVNode("div",{class:"battery","aria-hidden":"true"},null,-1)),F.label?(e.openBlock(),e.createElementBlock("span",am,e.toDisplayString(F.label),1)):e.createCommentVNode("",!0)])):F.type==="double-circle"?(e.openBlock(),e.createElementBlock("div",sm,[k[3]||(k[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)),F.label?(e.openBlock(),e.createElementBlock("span",rm,e.toDisplayString(F.label),1)):e.createCommentVNode("",!0)])):F.type==="bars"?(e.openBlock(),e.createElementBlock("div",im,[k[4]||(k[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)),F.label?(e.openBlock(),e.createElementBlock("span",cm,e.toDisplayString(F.label),1)):e.createCommentVNode("",!0)])):F.type==="inline"?(e.openBlock(),e.createElementBlock("div",um,[k[5]||(k[5]=e.createElementVNode("span",{class:"dss-loader-inline-spinner","aria-hidden":"true"},null,-1)),e.createElementVNode("span",dm,[e.renderSlot(_e.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(F.label),1)])])])):e.createCommentVNode("",!0)],6))}},Xo="dss-skeleton-item",pm={__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:F=>["single","multiple"].includes(F)},targetClass:{type:String,default:Xo},bgColor:{type:String,default:null},shimmerColor:{type:String,default:null},bgDark:{type:String,default:null},shimmerDark:{type:String,default:null}},setup(F){const Ce=F,z=e.computed(()=>{const k={"dss-skeleton--loading":Ce.loading,"dss-skeleton--static":!Ce.shimmer,"dss-skeleton--multiple":Ce.mode==="multiple","dss-skeleton--dark":Ce.darkMode};return Ce.mode==="multiple"&&Ce.targetClass!==Xo&&(k[`dss-skeleton--target-${Ce.targetClass}`]=!0),k}),A=e.computed(()=>{const k={};return Ce.borderRadius&&(k.borderRadius=Ce.borderRadius),k}),_e=e.computed(()=>{const k={};return Ce.borderRadius&&(k["--dss-skeleton-border-radius"]=Ce.borderRadius),Ce.darkMode?(k["--dss-skeleton-bg"]=Ce.bgDark||"#322c3f",k["--dss-skeleton-shimmer"]=Ce.shimmerDark||"#3e3f41",k):(Ce.bgColor&&(k["--dss-skeleton-bg"]=Ce.bgColor),Ce.shimmerColor&&(k["--dss-skeleton-shimmer"]=Ce.shimmerColor),k)});return(k,Le)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-skeleton",z.value]),style:e.normalizeStyle(_e.value)},[F.loading&&F.mode==="single"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-skeleton-overlay",style:e.normalizeStyle(A.value),"aria-hidden":"true"},null,4)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["dss-skeleton-content",{"dss-skeleton-content--hidden":F.loading&&F.mode==="single"}])},[e.renderSlot(k.$slots,"default")],2)],6))}},fm={key:0,class:"dss-dnd-column-header"},vm={class:"dss-dnd-column-title"},gm={class:"dss-dnd-column-count"},hm=["data-column"],ym={key:0,class:"dss-dnd-indicator"},Cm=["onPointerdown"],km=["onPointerdown"],bm={class:"dss-dnd-item-content"},wm={class:"dss-dnd-item-default"},xm={key:0,class:"dss-dnd-empty"},Em={name:"DSSDnd"},Vm=Object.assign(Em,{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(F,{emit:Ce}){const z=F,A=Ce,_e=e.useSlots(),k=e.computed(()=>!!_e["delete-zone"]),Le={columnMinWidth:"280px",columnMaxWidth:"none",columnGap:"12px",indicatorColor:"#7c6bc4",dragGhostOpacity:.75,dragSourceBackground:"#f5f5f5",dragSourceBorder:"#e0e0e0",useHandle:!1,columnBodyMaxHeight:"none",showHeader:!0,unstyled:!1,deleteZoneAlwaysVisible:!1},se=e.computed(()=>({...Le,...z.options})),pt=e.computed(()=>({"--dss-dnd-col-min-w":se.value.columnMinWidth,"--dss-dnd-col-max-w":se.value.columnMaxWidth,"--dss-dnd-col-gap":se.value.columnGap,"--dss-dnd-indicator-color":se.value.indicatorColor,"--dss-dnd-body-max-h":se.value.columnBodyMaxHeight})),p=e.ref(null),ue=e.ref(null),ve=e.ref(!1),de=e.ref(-1),ee=e.ref(null);let S=null,ne=null,He=null,Ae=null,Ie=0,O=0,rt="",Oe=null;const we=5,xt=e.computed(()=>{const te={};for(const $e of z.columns)te[$e.value]=z.items.filter(fe=>fe[z.columnKey]===$e.value).sort((fe,Ne)=>(fe[z.positionKey]??0)-(Ne[z.positionKey]??0));return te}),Tt=e.computed(()=>{const te={},$e=!!p.value,fe=p.value?.[z.itemKey],Ne=ue.value,We=de.value;for(const ft of z.columns){const qe=xt.value[ft.value]||[],dt=[],xe=Ne==ft.value;let Ue=0;for(let X=0;X<qe.length;X++){const Z=qe[X],j=$e&&Z[z.itemKey]===fe;!j&&xe&&We===Ue&&dt.push({type:"indicator",key:`ind-${Ue}`}),j||Ue++,dt.push({type:"item",item:Z,isDragged:j,key:`item-${Z[z.itemKey]}`})}xe&&We>=Ue&&dt.push({type:"indicator",key:"ind-end"}),te[ft.value]=dt}return te});function ut(te,$e){const Ne=(xt.value[te]||[]).filter(qe=>qe[z.itemKey]!==p.value?.[z.itemKey]);if(Ne.length===0)return 1;if($e<=0){const qe=Ne[0][z.positionKey];return qe!=null&&qe>0?qe/2:.5}if($e>=Ne.length){const qe=Ne[Ne.length-1][z.positionKey];return(qe??0)+1}const We=Ne[$e-1][z.positionKey]??0,ft=Ne[$e][z.positionKey]??0;return(We+ft)/2}function Ze(te,$e,fe){He&&He.remove();const Ne=te.getBoundingClientRect(),We=te.cloneNode(!0);We.classList.add("dss-dnd-ghost"),We.style.cssText=`
103
+ `){const h=document.createTextNode(" ");l.insertNode(h),l.setStartAfter(h)}}l.insertNode(d);const u=document.createTextNode(" ");l.setStartAfter(d),l.insertNode(u),l.setStartAfter(u),l.collapse(!0),o.removeAllRanges(),o.addRange(l)}}Be()}e.nextTick(()=>{Vn(),Dn()})},Yn=()=>{if(!p.value||de.value)return;const o=window.getSelection();let l=null;o&&o.rangeCount>0&&(l=yn());const a=/(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,r=document.createTreeWalker(p.value,NodeFilter.SHOW_TEXT,{acceptNode:m=>{const v=m.parentElement;return!v||v.closest("a")||v.closest(".dss-image-wrapper")||!m.textContent||m.textContent.trim()===""?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}}),c=[];let d;for(;d=r.nextNode();)c.push(d);let u=!1;for(let m=c.length-1;m>=0;m--){const v=c[m],h=v.textContent;a.lastIndex=0;const _=[...h.matchAll(a)];if(_.length===0)continue;const $=_.filter(Y=>{const Le=Y[0],me=Y.index;if(me>0&&h[me-1]==="@"||me+Le.length<h.length&&h[me+Le.length]==="@")return!1;const ct=v.parentElement;return!(ct&&ct.closest("a"))});if($.length===0)continue;if($.length===1&&$[0][0]===h.trim()){const Y=$[0][0],Le=Y.startsWith("http://")||Y.startsWith("https://")?Y:`https://${Y}`,me=document.createElement("a");me.href=Le,me.textContent=Y,me.style.color="#60afdf",me.style.textDecoration="underline",v.parentNode&&(v.parentNode.replaceChild(me,v),u=!0);continue}let N=0;const Q=document.createDocumentFragment();if($.forEach(Y=>{const Le=Y.index,me=Y[0];if(Le>N){const Jt=h.substring(N,Le);Jt&&Q.appendChild(document.createTextNode(Jt))}const ct=me.startsWith("http://")||me.startsWith("https://")?me:`https://${me}`,Qt=document.createElement("a");Qt.href=ct,Qt.textContent=me,Qt.style.color="#60afdf",Qt.style.textDecoration="underline",Q.appendChild(Qt),N=Le+me.length}),N<h.length){const Y=h.substring(N);Y&&Q.appendChild(document.createTextNode(Y))}v.parentNode&&Q.childNodes.length>0&&(v.parentNode.replaceChild(Q,v),u=!0)}u&&l&&e.nextTick(()=>{et(l),Vn()})},Ut=()=>{if(!p.value)return;const o=/<u>([\s\S]*?)<\/u>|<ins>([\s\S]*?)<\/ins>/gi,l=document.createTreeWalker(p.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}}),a=[];let r;for(;r=l.nextNode();)a.push(r);for(let c=a.length-1;c>=0;c--){const d=a[c],u=d.textContent,m=[...u.matchAll(o)];if(m.length===0)continue;let v=0;const h=document.createDocumentFragment();m.forEach(_=>{const $=_.index,N=_[0].startsWith("<u>")?"u":"ins",Q=_[1]||_[2]||"";$>v&&h.appendChild(document.createTextNode(u.substring(v,$)));const Y=document.createElement(N);Y.textContent=Q,h.appendChild(Y),v=$+_[0].length}),v<u.length&&h.appendChild(document.createTextNode(u.substring(v))),d.parentNode&&h.childNodes.length>0&&d.parentNode.replaceChild(h,d)}},ko=o=>{if(!p.value||de.value)return;if(!o){Ut();return}if(!["*","_",">"].includes(o))return;const a=window.getSelection();if(!a||a.rangeCount===0)return;const r=a.getRangeAt(0);if(!r.collapsed)return;const c=r.startContainer.nodeType===Node.TEXT_NODE?r.startContainer.parentElement?.closest("p, h1, h2, h3, h4, h5, h6, li, td, th, blockquote, div"):r.startContainer.closest?.("p, h1, h2, h3, h4, h5, h6, li, td, th, blockquote, div");if(!c||c===p.value||!p.value.contains(c))return;const d=()=>{let Jt="",Xt=0,Pt=!1;const en=document.createTreeWalker(c,NodeFilter.SHOW_TEXT,{acceptNode:Rn=>Rn.parentElement?.closest("a, code, pre")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT});document.createTreeWalker(c,NodeFilter.SHOW_TEXT,null);let Kt=0;for(;en.nextNode();){const Rn=en.currentNode,rl=Rn.textContent||"",kn=Kt;if(Kt+=rl.length,Rn===r.startContainer){Jt+=rl.substring(0,r.startOffset),Xt=kn+r.startOffset,Pt=!0;break}Jt+=rl}return Pt||(Xt=Jt.length),{textBeforeCursor:Jt,cursorCharOffset:Xt}},{textBeforeCursor:u}=d();if(!u.length)return;let m=null,v=null;if(u.endsWith("**")&&(m=u.match(/\*\*(.+?)\*\*$/s))||u.endsWith("__")&&(m=u.match(/__(.+?)__$/s))?v="strong":u.endsWith("*")&&!u.endsWith("**")&&(m=u.match(new RegExp("(?<!\\*)\\*([^*]+)\\*$")))||u.endsWith("_")&&!u.endsWith("__")&&(m=u.match(new RegExp("(?<!_)_([^_]+)_$")))?v="em":o===">"&&((m=u.match(/<u>(.+?)<\/u>$/s))||(m=u.match(/<ins>(.+?)<\/ins>$/s)))&&(v=m[0].startsWith("<u>")?"u":"ins",m[0].startsWith("<u>"),m[0].startsWith("<u>")),!m||!m[1])return;const h=m[0],_=m[1],$=u.length-h.length,Q=(Jt=>{let Xt=0;const Pt=document.createTreeWalker(c,NodeFilter.SHOW_TEXT,{acceptNode:Kt=>Kt.parentElement?.closest("a, code, pre")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT});let en;for(;en=Pt.nextNode();){const Kt=(en.textContent||"").length;if(Xt+Kt>=Jt)return{node:en,offset:Jt-Xt};Xt+=Kt}return null})($);if(!Q)return;const Y=document.createRange();Y.setStart(Q.node,Q.offset),Y.setEnd(r.endContainer,r.endOffset);const Le=document.createElement(v);Le.textContent=_,Y.deleteContents(),Y.insertNode(Le);const me=window.getSelection(),ct=document.createRange();ct.setStartAfter(Le),ct.collapse(!0),me.removeAllRanges(),me.addRange(ct);const Qt=yn();e.nextTick(()=>{Be(),Qt&&et(Qt)})},Ft=()=>{p.value&&(Zt.value=yn(),Ot.value="",Et.value="",Ne.value="",lt.value="",je.value="",on.value=null,Xe.value=null,fe.value="upload",$t.value=!0,At(),e.nextTick(()=>{Dt.value&&Dt.value.focus(),Lt.value&&(Lt.value.value="")}))},ln=o=>{const l=o.target?.files?.[0];if(!l){on.value=null,Et.value="";return}on.value=l;const a=new FileReader;a.onload=r=>{Et.value=r.target?.result||""},a.readAsDataURL(l)},$o=()=>{Lt.value&&Lt.value.click()},bo=()=>{lt.value&&(je.value="")},Dl=()=>{je.value&&(lt.value="")},To=()=>{let o=Xe.value;if(!o){const l=window.getSelection();if(l&&l.rangeCount>0){const r=l.getRangeAt(0).commonAncestorContainer;o=r.nodeType===1?r.closest("img"):r.parentElement?.closest("img")}}if(o){const l=o.getAttribute("data-alt")||o.getAttribute("alt")||"";Xe.value=o,Ot.value=l.trim()===""||l.trim()==="Image"?"":l;const a=o.getAttribute("src")||o.src||"";a.startsWith("http://")||a.startsWith("https://")?(Ne.value=a,Et.value="",fe.value="url"):(Et.value=a,Ne.value="",fe.value="upload");const c=o.style.width||o.getAttribute("width")||"",d=o.style.height||o.getAttribute("height")||"";lt.value=c.endsWith("px")?c.replace("px",""):c,je.value=d.endsWith("px")?d.replace("px",""):d,Zt.value=null}else{Ft();return}$t.value=!0,Te.value=!1,Yt.value=!1,e.nextTick(()=>{fe.value==="url"&&Bt.value?(Bt.value.focus(),Bt.value.select()):Dt.value&&(Dt.value.focus(),Dt.value.select()),Lt.value&&(Lt.value.value="")})},wl=()=>{$t.value=!1,Ot.value="",Et.value="",Ne.value="",lt.value="",je.value="",on.value=null,Xe.value=null,Zt.value=null,fe.value="upload"},Nt=()=>{const o=(Ot.value||"").trim(),l=p.value?._mutationObserver;l&&l.disconnect(),Ue.value?(xe.value&&(clearTimeout(xe.value),xe.value=null),Se(),Ue.value=!1):Se();const a=fe.value==="url"?Ne.value.trim():Et.value;if(Xe.value&&p.value&&p.value.contains(Xe.value)){a&&(Xe.value.src=a),Xe.value.setAttribute("alt",o),Xe.value.setAttribute("data-alt",o),lt.value?(Xe.value.style.width=`${lt.value}px`,Xe.value.setAttribute("width",lt.value)):(Xe.value.style.removeProperty("width"),Xe.value.removeAttribute("width")),je.value?(Xe.value.style.height=`${je.value}px`,Xe.value.setAttribute("height",je.value)):(Xe.value.style.removeProperty("height"),Xe.value.removeAttribute("height"));const r=window.getSelection();if(r){r.removeAllRanges();const c=document.createRange();c.setStartAfter(Xe.value),c.collapse(!0),r.addRange(c)}Be()}else{if(!a){l&&p.value&&l.observe(p.value,{childList:!0,subtree:!0}),wl();return}if(p.value){p.value.focus();const r=window.getSelection();r&&r.rangeCount>0&&r.removeAllRanges();const c=window.getSelection();let d=null;if(Zt.value&&(et(Zt.value),c&&c.rangeCount>0&&(d=c.getRangeAt(0))),!d&&c&&c.rangeCount>0&&(d=c.getRangeAt(0)),!d&&p.value){if(d=document.createRange(),p.value.childNodes.length===0){const h=document.createElement("p");h.innerHTML="<br>",p.value.appendChild(h),d.setStart(h,0),d.collapse(!0)}else d.selectNodeContents(p.value),d.collapse(!1);c&&(c.removeAllRanges(),c.addRange(d))}if(!d){wl();return}const u=d.commonAncestorContainer,m=u.nodeType===3?u.parentElement:u;if(!p.value.contains(m)){if(d=document.createRange(),p.value.childNodes.length===0){const h=document.createElement("p");h.innerHTML="<br>",p.value.appendChild(h),d.setStart(h,0),d.collapse(!0)}else d.selectNodeContents(p.value),d.collapse(!1);c&&(c.removeAllRanges(),c.addRange(d))}const v=document.createElement("img");v.src=a,v.setAttribute("alt",o),v.setAttribute("data-alt",o),lt.value&&(v.style.width=`${lt.value}px`,v.setAttribute("width",lt.value)),je.value&&(v.style.height=`${je.value}px`,v.setAttribute("height",je.value));try{d.insertNode(v),d.setStartAfter(v),d.collapse(!0),c&&(c.removeAllRanges(),c.addRange(d))}catch{if(p.value){if(p.value.childNodes.length===0){const $=document.createElement("p");p.value.appendChild($),$.appendChild(v)}else{const $=p.value.lastChild;if($&&$.nodeType===1)$.appendChild(v);else{const N=document.createElement("p");p.value.appendChild(N),N.appendChild(v)}}const _=document.createRange();_.setStartAfter(v),_.collapse(!0),c&&(c.removeAllRanges(),c.addRange(_))}}Xe.value=v,Be()}}e.nextTick(()=>{l&&p.value&&l.observe(p.value,{childList:!0,subtree:!0}),Vn(),qt(),wl()})};e.watch(()=>k.modelValue,o=>{if(k.richText&&p.value&&!de.value){const l=zn(o||""),r=p.value.innerHTML.replace(/&nbsp;|\u00A0/g," "),c=l.replace(/&nbsp;|\u00A0/g," ");if(r!==c){const d=yn();p.value.innerHTML=l,e.nextTick(()=>{Mt();const u=p.value.innerHTML||"",m=k.title||"",v=k.description||"";X.value=u,j.value=m,ie.value=v,Z.value=u,E.value=m,C.value=v,qe.value=[],dt.value=[],xe.value&&(clearTimeout(xe.value),xe.value=null),Ue.value=!1,d&&et(d),Mn(),he(),W(),Vn(),qt(),Xn(),Zn("watch-modelValue")})}}},{immediate:!0}),e.watch(()=>k.richText,o=>{o?(qt(),e.nextTick(()=>{no()})):(ol(),vt.value=[],Je.value&&(Je.value.disconnect(),Je.value=null)),Xn()}),e.watch(()=>k.floatingToolbar,o=>{o?qt():ol()}),e.watch(()=>k.disabled,o=>{o&&ol(),Xn()}),e.watch(()=>k.description,()=>{e.nextTick(()=>{re.value?dl():Vt()})}),e.watch(()=>k.title,()=>{e.nextTick(()=>{De.value?gn():ul()})}),e.watch(()=>k.customToolbarSlots,()=>{e.nextTick(()=>{Rt()})},{deep:!0}),e.watch(()=>k.comments,(o,l)=>{if(Ul.value){Ul.value=!1;return}Bl.value||k.richText&&p.value&&e.nextTick(()=>{Ql()})},{deep:!0,immediate:!1});const Ql=()=>{if(!Bl.value&&!(!k.comments||!Array.isArray(k.comments)||k.comments.length===0)&&!(!k.richText||!p.value)){Bl.value=!0;try{const o=new Set,l=k.comments.filter(u=>{const m=String(u.conversation_id||u.id);return o.has(m)?!1:(o.add(m),!0)}),a=p.value.querySelectorAll("[data-comment], [data-fake-comment]"),r=a.length;a.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 v=String(m);if(d.has(v))return;const h=p.value.querySelector(`[data-comment="${v}"]`);if(h){_l(h,u),d.add(v);return}try{const _=wo(u.selection_range,u.selection_text);if(_&&!_.collapsed){const $=_.commonAncestorContainer,N=$.nodeType===3?$.parentElement:$;if(N){const Le=N.closest("[data-comment], [data-fake-comment]");if(Le){const me=Le.getAttribute("data-comment")||Le.getAttribute("data-fake-comment");if(String(me)===String(m)){Le.setAttribute("data-comment",v),Le.removeAttribute("data-fake-comment"),_l(Le,u),d.add(v);return}else return}}const Q=p.value.querySelector(`[data-comment="${v}"]`);if(Q){_l(Q,u),d.add(v);return}const Y=document.createElement("span");Y.setAttribute("data-comment",v),_l(Y,u);try{_.surroundContents(Y),c++,d.add(v)}catch{try{const me=document.createRange();me.setStart(_.startContainer,_.startOffset),me.setEnd(_.endContainer,_.endOffset),Rl(me),me.surroundContents(Y),c++,d.add(v)}catch{try{const ct=_.extractContents();Y.appendChild(ct),_.insertNode(Y),c++,d.add(v)}catch(ct){console.warn("Failed to create comment marker:",ct)}}}}}catch{}}),e.nextTick(()=>{Zn("restoreCommentsFromModel"),Be(),Bl.value=!1})}catch{Bl.value=!1}}},Rl=o=>{if(!o||!p.value)return o;try{const l=["P","DIV","H1","H2","H3","H4","H5","H6","LI","BLOCKQUOTE","PRE"];let a=o.startContainer,r=o.startOffset;if(a.nodeType===3){const u=a.parentElement;u&&l.includes(u.tagName)&&(r===0&&!Jl(a)||o.setStartBefore(u))}else a.nodeType===1&&l.includes(a.tagName)&&r>0&&o.setStartBefore(a);let c=o.endContainer,d=o.endOffset;if(c.nodeType===3){const u=c.parentElement;u&&l.includes(u.tagName)&&(d===c.length&&!eo(c)||o.setEndAfter(u))}else c.nodeType===1&&l.includes(c.tagName)&&d<c.childNodes.length&&o.setEndAfter(c);return o}catch{return o}},Jl=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},eo=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},wo=(o,l)=>{if(!o||!p.value)return null;try{const a=document.createRange();if(o.type==="text"&&typeof o.start=="number"&&typeof o.end=="number"){let r=0;const c=[p.value];let d=null,u=!1,m=!1;for(;!m&&(d=c.pop());)if(d.nodeType===3){const v=r+d.length;!u&&o.start>=r&&o.start<=v&&(a.setStart(d,o.start-r),u=!0),u&&o.end>=r&&o.end<=v&&(a.setEnd(d,o.end-r),m=!0),r=v}else{let v=d.childNodes.length;for(;v--;)c.push(d.childNodes[v])}return u?Rl(a):null}}catch{return null}return null},_l=(o,l)=>{if(!o||!l)return;const a=l.conversation||[],r=new Set,c=[],d=m=>{m&&m.id&&!r.has(m.id)&&(r.add(m.id),c.push(m))};a.length>0&&a.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=a.length;u>0?o.setAttribute("data-comment-count",String(u)):o.removeAttribute("data-comment-count")},Zn=(o="unknown")=>{if(!k.richText||!p.value){vt.value=[];return}Date.now()-bn.value<Fn&&vn.value!==null||vn.value===null&&(vn.value=requestAnimationFrame(()=>{if(vn.value=null,bn.value=Date.now(),Tn.value)return;Tn.value=!0;const a={},r=p.value;if(!r){Tn.value=!1;return}const c=r.closest(".editor-with-comments");if(!c){Tn.value=!1;return}const d=r.querySelectorAll("[data-comment], [data-fake-comment]"),u=[],m=new Set;d.forEach(N=>{const Q=N.getAttribute("data-comment")||N.getAttribute("data-fake-comment");Q&&N.tagName==="SPAN"&&(m.has(Q)||(u.push(N),m.add(Q)))}),d.forEach(N=>{const Q=N.getAttribute("data-comment")||N.getAttribute("data-fake-comment");!Q||m.has(Q)||(["P","DIV","H1","H2","H3","H4","H5","H6"].includes(N.tagName)?N.querySelector(`span[data-comment="${Q}"], span[data-fake-comment="${Q}"]`)||(u.push(N),m.add(Q)):N.tagName!=="SPAN"&&(u.push(N),m.add(Q)))});const v=c.getBoundingClientRect(),h=r.getBoundingClientRect();u.forEach((N,Q)=>{let Y=N.getAttribute("data-comment")||N.getAttribute("data-fake-comment");if(!Y)return;if(typeof Y=="string"&&Y.startsWith("comment-")){const un=N.textContent?.trim(),Kn=k.comments?.find(Wn=>(typeof Wn.conversation_id=="string"&&Wn.conversation_id.startsWith("comment-")?null:Wn.conversation_id)&&Wn.selection_text?.trim()===un);Kn?(Y=String(Kn.conversation_id),N.setAttribute("data-comment",Y),N.removeAttribute("data-fake-comment")):(Y=String(Date.now()),N.setAttribute("data-comment",Y),N.removeAttribute("data-fake-comment"))}const Le=N.getBoundingClientRect(),me=window.getComputedStyle(N),ct=parseFloat(me.lineHeight)||parseFloat(me.fontSize)*1.2,Xt=Le.top-h.top+ct/2-15,en=h.top-v.top+Xt;let Kt=null,Rn=null,rl=0;const kn=[],Fl=new Set;if(Y&&k.comments){const un=k.comments.find(Kn=>String(Kn.conversation_id||Kn.id)===String(Y));if(un){const Kn=un.conversation||[];Kn.length>0?(Kn.forEach(Wn=>{Wn.user&&Wn.user.id&&!Fl.has(Wn.user.id)&&(Fl.add(Wn.user.id),kn.push(Wn.user))}),rl=Kn.length):(rl=0,Kt=null,Rn=null),kn.length>0?Kt=kn[0]:Kt=null,kn.length>1?Rn=kn[1]:Rn=null}}const $l=Le.top+ct/2-15,jn=$l+30,El=5,Vl=jn>h.top+El&&$l<h.bottom-El?1:0;vt.value.find(un=>un.id===Y);let gt=N;if(!gt&&Y&&p.value){const un=String(Y);gt=p.value.querySelector(`[data-comment="${un}"], [data-fake-comment="${un}"]`)}const zl=kn.length;a[Y]?(a[Y].top=en,a[Y].opacity=Vl,a[Y].element=gt,a[Y].firstUser=Kt,a[Y].secondUser=Rn,a[Y].totalCount=rl,a[Y].uniqueUserCount=zl):a[Y]={id:Y,top:en,opacity:Vl,element:gt,firstUser:Kt,secondUser:Rn,totalCount:rl,uniqueUserCount:zl}});const _=Object.values(a).map(N=>{const Q=Math.max(0,(N.uniqueUserCount??0)-2);if(!N.element&&N.id&&p.value){const Le=String(N.id);N.element=p.value.querySelector(`[data-comment="${Le}"], [data-fake-comment="${Le}"]`)}return{...N,firstUser:N.firstUser||null,secondUser:N.secondUser||null,totalCount:N.totalCount,additionalCount:Q}});(vt.value.length!==_.length||_.some((N,Q)=>{const Y=vt.value[Q];if(!Y)return!0;const Le=(Y.firstUser?.id||null)!==(N.firstUser?.id||null),me=(Y.secondUser?.id||null)!==(N.secondUser?.id||null);return Y.id!==N.id||Math.abs(Y.top-N.top)>1||Y.opacity!==N.opacity||Y.totalCount!==N.totalCount||Y.additionalCount!==N.additionalCount||Le||me||Y.element!==N.element}))&&(vt.value=_),Tn.value=!1}))},Lo=o=>{if(!o)return;let l=o.element;if(!l&&o.id&&p.value){const a=String(o.id);l=p.value.querySelector(`[data-comment="${a}"], [data-fake-comment="${a}"]`)}l&&(vl(),Pn.value=l,l.classList.add("editor-comment-highlighted"))},vl=(o=!1)=>{!o&&mn.value!==null&&Pn.value&&(Pn.value.getAttribute("data-comment")||Pn.value.getAttribute("data-fake-comment"))===mn.value||(p.value&&p.value.querySelectorAll(".editor-comment-highlighted").forEach(a=>{a.classList.remove("editor-comment-highlighted")}),Pn.value&&(Pn.value.classList.remove("editor-comment-highlighted"),Pn.value=null))},xl=o=>{if(!o||!o.element)return;vl(!0);const l=o.element.getAttribute("data-comment")||o.element.getAttribute("data-fake-comment");if(!l)return;const a=`[data-comment="${l}"], [data-fake-comment="${l}"]`;$e("comment-marker-clicked",{commentId:l,selector:a,element:o.element})},to=()=>{vl()},no=()=>{!k.richText||!p.value||(Je.value&&Je.value.disconnect(),Wt.value!==null&&(clearTimeout(Wt.value),Wt.value=null),Je.value=new MutationObserver(()=>{Wt.value===null&&(Wt.value=setTimeout(()=>{Wt.value=null,e.nextTick(()=>{Zn("MutationObserver")})},200))}),Je.value.observe(p.value,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-comment","data-fake-comment","data-comment-user","data-comment-user-2","data-comment-count"]}),Zn("setupCommentMarkersObserver-initial"))},sl=(o,l)=>{if(!o||!l)return;const a=l.getBoundingClientRect();let r=a.top,c=a.right+4;o.style.top=`${r}px`,o.style.left=`${c}px`,o.offsetHeight;const d=o.getBoundingClientRect(),u=window.innerWidth,m=window.innerHeight;if(d.right>u){const v=a.left-d.width-4;o.style.left=`${v}px`}if(d.bottom>m){const v=Math.max(8,m-d.height-8);o.style.top=`${v}px`}d.top<0&&(o.style.top="8px")};return e.watch(()=>We.value,o=>{e.nextTick(()=>{document.querySelectorAll(".dss-toolbar-dropdown-submenu").forEach(a=>{const r=a.getAttribute("data-submenu-id");if(r===o&&o){const c=document.querySelector(`.dss-toolbar-dropdown-item-has-submenu[data-submenu-id="${r}"]`);if(c){if(a.parentNode!==document.body){const d=a.parentNode;a.dataset.originalParentRef=d===c?"inside":"sibling",document.body.appendChild(a)}a.style.display="block",a.style.visibility="hidden",a.style.opacity="0",requestAnimationFrame(()=>{requestAnimationFrame(()=>{sl(a,c),a.offsetHeight,a.setAttribute("data-active","true"),a.style.visibility="visible",a.style.opacity="1"})})}else a.setAttribute("data-active","true")}else a.setAttribute("data-active","false"),a.style.display="none",a.style.top="",a.style.left="",a.style.visibility="",a.style.opacity=""})})}),e.watch(()=>[ue.value,at.value],()=>{ue.value==="askAi"||at.value==="askAi"?e.nextTick(()=>{_t()}):(We.value=null,e.nextTick(()=>{document.querySelectorAll(".dss-toolbar-dropdown-submenu").forEach(l=>{if(l.parentNode===document.body){const a=l.getAttribute("data-submenu-id");if(a){const r=document.querySelector(`.dss-toolbar-dropdown-item-has-submenu[data-submenu-id="${a}"]`);if(r)if(l.dataset.originalParentRef==="inside")r.appendChild(l);else{const d=r.closest(".dss-toolbar-dropdown");d&&d.insertBefore(l,r.nextSibling)}}}})}))}),e.watch(()=>k.locale,o=>{o&&o!==_e.value&&(_e.value=o)},{immediate:!0}),Ce({openCommentOverlayForSelector:jl,updateCommentMarkers:Zn,restoreCommentsFromModel:Ql}),(o,l)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-text-editor-container editor-with-comments",In.value]),style:e.normalizeStyle(an.value)},[F.richText?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-text-editor-toolbar",onMousedown:l[14]||(l[14]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("div",Xc,[e.createElementVNode("div",{class:"dss-toolbar-button",onClick:w,title:e.unref(A)("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,Yc),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-disabled":!D.value}]),onClick:y,title:e.unref(A)("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,jc),l[73]||(l[73]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",Kc,[e.createElementVNode("div",{class:"dss-toolbar-button dss-toolbar-dropdown-toggle",onClick:l[0]||(l[0]=a=>It("paragraph")),title:e.unref(A)("textEditor.toolbar.paragraphFormat")},[tt.value==="h1"?(e.openBlock(),e.createElementBlock("svg",Qc,[...l[47]||(l[47]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M6.2 13V11.836H8.456V7.12H6.548V6.16C8.312 6.04 8.648 5.44 8.804 4.84H9.884V11.836H11.96V13H6.2Z",fill:"#FFC230"},null,-1)])])):tt.value==="h2"?(e.openBlock(),e.createElementBlock("svg",Jc,[...l[48]||(l[48]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M6.02 13V11.8L8.732 9.388C9.644 8.584 10.208 8.08 10.208 7.288C10.208 6.64 9.764 6.04 8.84 6.04C7.904 6.04 7.424 6.676 7.412 7.852H5.972C5.852 5.872 7.16 4.72 8.948 4.72C10.736 4.72 11.672 5.86 11.672 7.12C11.672 8.464 10.916 9.364 9.92 10.168L8.192 11.56H11.708V13H6.02Z",fill:"#FFC230"},null,-1)])])):tt.value==="h3"?(e.openBlock(),e.createElementBlock("svg",eu,[...l[49]||(l[49]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M8.156 8.188H8.828C9.56 8.188 10.064 7.696 10.064 7.072C10.064 6.508 9.74 6.04 8.792 6.04C7.748 6.04 7.472 6.688 7.388 7.612H5.948C5.828 6.232 6.896 4.72 8.924 4.72C10.712 4.72 11.6 5.896 11.6 6.892C11.6 7.648 11.3 8.356 10.568 8.704C11.42 9.112 11.768 9.7 11.768 10.48C11.768 11.86 10.712 13.12 8.804 13.12C6.776 13.12 5.708 11.608 5.828 10.228H7.268C7.232 11.068 7.736 11.8 8.792 11.8C9.74 11.8 10.184 11.248 10.184 10.48C10.184 9.808 9.752 9.268 8.828 9.268H8.156V8.188Z",fill:"#FFC230"},null,-1)])])):tt.value==="h4"?(e.openBlock(),e.createElementBlock("svg",tu,[...l[50]||(l[50]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M5.72 11.056V9.856L9.284 4.84H10.832V9.856H12.272V11.056H10.832V13H9.284V11.056H5.72ZM7.076 9.856H9.284V6.832L7.076 9.856Z",fill:"#FFC230"},null,-1)])])):tt.value==="h5"?(e.openBlock(),e.createElementBlock("svg",nu,[...l[51]||(l[51]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M7.652 9.436H6.164C6.416 7.84 6.56 6.64 6.596 4.852L11.516 4.84V6.28H7.82L7.676 7.972C8.084 7.684 8.6 7.516 9.308 7.516C10.832 7.516 11.804 8.644 11.804 10.24C11.804 11.86 10.58 13.12 8.804 13.12C7.328 13.12 5.864 11.968 6.164 10.156H7.484C7.388 11.224 7.964 11.8 8.876 11.8C9.812 11.8 10.316 11.092 10.316 10.252C10.316 9.412 9.908 8.632 8.9 8.632C8.132 8.632 7.748 9.112 7.652 9.436Z",fill:"#FFC230"},null,-1)])])):tt.value==="h6"?(e.openBlock(),e.createElementBlock("svg",lu,[...l[52]||(l[52]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M11.912 10.24C11.912 11.86 10.808 13.12 9.056 13.12C7.16 13.12 5.96 11.5 5.96 9.04C5.96 6.34 7.316 4.72 9.344 4.72C11 4.72 11.84 5.872 11.84 7.012H10.4C10.328 6.628 10.088 6.028 9.104 6.028C8.06 6.028 7.388 6.748 7.316 8.392C7.784 7.84 8.396 7.444 9.416 7.444C10.94 7.444 11.912 8.644 11.912 10.24ZM9.08 8.848C8.12 8.848 7.736 9.556 7.736 10.396C7.736 11.236 8.12 11.944 9.08 11.944C10.04 11.944 10.424 11.236 10.424 10.396C10.424 9.556 10.04 8.848 9.08 8.848Z",fill:"#FFC230"},null,-1)])])):(e.openBlock(),e.createElementBlock("svg",ou,[...l[53]||(l[53]=[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[54]||(l[54]=e.createElementVNode("span",{class:"dss-toolbar-dropdown-arrow"},"˅",-1))],8,Gc),ue.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]=a=>En("<h1>"))},[l[55]||(l[55]=e.createElementVNode("svg",{width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"}),e.createElementVNode("path",{d:"M6.2 13V11.836H8.456V7.12H6.548V6.16C8.312 6.04 8.648 5.44 8.804 4.84H9.884V11.836H11.96V13H6.2Z",fill:"#FFC230"})],-1)),e.createElementVNode("h1",null,e.toDisplayString(e.unref(A)("textEditor.paragraph.heading1")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[2]||(l[2]=a=>En("<h2>"))},[l[56]||(l[56]=e.createElementVNode("svg",{width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"}),e.createElementVNode("path",{d:"M6.02 13V11.8L8.732 9.388C9.644 8.584 10.208 8.08 10.208 7.288C10.208 6.64 9.764 6.04 8.84 6.04C7.904 6.04 7.424 6.676 7.412 7.852H5.972C5.852 5.872 7.16 4.72 8.948 4.72C10.736 4.72 11.672 5.86 11.672 7.12C11.672 8.464 10.916 9.364 9.92 10.168L8.192 11.56H11.708V13H6.02Z",fill:"#FFC230"})],-1)),e.createElementVNode("h2",null,e.toDisplayString(e.unref(A)("textEditor.paragraph.heading2")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[3]||(l[3]=a=>En("<h3>"))},[l[57]||(l[57]=e.createElementVNode("svg",{width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"}),e.createElementVNode("path",{d:"M8.156 8.188H8.828C9.56 8.188 10.064 7.696 10.064 7.072C10.064 6.508 9.74 6.04 8.792 6.04C7.748 6.04 7.472 6.688 7.388 7.612H5.948C5.828 6.232 6.896 4.72 8.924 4.72C10.712 4.72 11.6 5.896 11.6 6.892C11.6 7.648 11.3 8.356 10.568 8.704C11.42 9.112 11.768 9.7 11.768 10.48C11.768 11.86 10.712 13.12 8.804 13.12C6.776 13.12 5.708 11.608 5.828 10.228H7.268C7.232 11.068 7.736 11.8 8.792 11.8C9.74 11.8 10.184 11.248 10.184 10.48C10.184 9.808 9.752 9.268 8.828 9.268H8.156V8.188Z",fill:"#FFC230"})],-1)),e.createElementVNode("h3",null,e.toDisplayString(e.unref(A)("textEditor.paragraph.heading3")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[4]||(l[4]=a=>En("<h4>"))},[l[58]||(l[58]=e.createElementVNode("svg",{width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"}),e.createElementVNode("path",{d:"M5.72 11.056V9.856L9.284 4.84H10.832V9.856H12.272V11.056H10.832V13H9.284V11.056H5.72ZM7.076 9.856H9.284V6.832L7.076 9.856Z",fill:"#FFC230"})],-1)),e.createElementVNode("h4",null,e.toDisplayString(e.unref(A)("textEditor.paragraph.heading4")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[5]||(l[5]=a=>En("<h5>"))},[l[59]||(l[59]=e.createElementVNode("svg",{width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"}),e.createElementVNode("path",{d:"M7.652 9.436H6.164C6.416 7.84 6.56 6.64 6.596 4.852L11.516 4.84V6.28H7.82L7.676 7.972C8.084 7.684 8.6 7.516 9.308 7.516C10.832 7.516 11.804 8.644 11.804 10.24C11.804 11.86 10.58 13.12 8.804 13.12C7.328 13.12 5.864 11.968 6.164 10.156H7.484C7.388 11.224 7.964 11.8 8.876 11.8C9.812 11.8 10.316 11.092 10.316 10.252C10.316 9.412 9.908 8.632 8.9 8.632C8.132 8.632 7.748 9.112 7.652 9.436Z",fill:"#FFC230"})],-1)),e.createElementVNode("h5",null,e.toDisplayString(e.unref(A)("textEditor.paragraph.heading5")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[6]||(l[6]=a=>En("<h6>"))},[l[60]||(l[60]=e.createElementVNode("svg",{width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"}),e.createElementVNode("path",{d:"M11.912 10.24C11.912 11.86 10.808 13.12 9.056 13.12C7.16 13.12 5.96 11.5 5.96 9.04C5.96 6.34 7.316 4.72 9.344 4.72C11 4.72 11.84 5.872 11.84 7.012H10.4C10.328 6.628 10.088 6.028 9.104 6.028C8.06 6.028 7.388 6.748 7.316 8.392C7.784 7.84 8.396 7.444 9.416 7.444C10.94 7.444 11.912 8.644 11.912 10.24ZM9.08 8.848C8.12 8.848 7.736 9.556 7.736 10.396C7.736 11.236 8.12 11.944 9.08 11.944C10.04 11.944 10.424 11.236 10.424 10.396C10.424 9.556 10.04 8.848 9.08 8.848Z",fill:"#FFC230"})],-1)),e.createElementVNode("h6",null,e.toDisplayString(e.unref(A)("textEditor.paragraph.heading6")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[7]||(l[7]=a=>En("<p>"))},[l[61]||(l[61]=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(A)("textEditor.paragraph.paragraph")),1)])])):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Ht("bold")}]),onClick:l[9]||(l[9]=a=>ot("bold")),title:e.unref(A)("textEditor.toolbar.bold")},[...l[62]||(l[62]=[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,au),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Ht("italic")}]),onClick:l[10]||(l[10]=a=>ot("italic")),title:e.unref(A)("textEditor.toolbar.italic")},[...l[63]||(l[63]=[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,su),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Ht("underline")}]),onClick:l[11]||(l[11]=a=>ot("underline")),title:e.unref(A)("textEditor.toolbar.underline")},[...l[64]||(l[64]=[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,ru),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":ut.value}]),onClick:ro,title:e.unref(A)("textEditor.toolbar.citation")},[...l[65]||(l[65]=[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,iu),l[74]||(l[74]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),ve.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-button",onClick:ql,title:e.unref(A)("textEditor.toolbar.removeLink")},[...l[67]||(l[67]=[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,uu)):(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-button",onClick:co,title:e.unref(A)("textEditor.toolbar.insertLink")},[...l[66]||(l[66]=[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,cu)),l[75]||(l[75]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Ht("insertUnorderedList")}]),onClick:uo,title:e.unref(A)("textEditor.toolbar.bulletList")},[...l[68]||(l[68]=[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,du),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Ht("insertOrderedList")}]),onClick:el,title:e.unref(A)("textEditor.toolbar.numberList")},[...l[69]||(l[69]=[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,mu),l[76]||(l[76]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:"dss-toolbar-button",onClick:Ft,title:e.unref(A)("textEditor.toolbar.image")},[...l[70]||(l[70]=[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,pu),wt.value?(e.openBlock(),e.createElementBlock("div",fu)):e.createCommentVNode("",!0),wt.value?(e.openBlock(),e.createElementBlock("div",{key:3,class:"dss-toolbar-button",title:e.unref(A)("textEditor.toolbar.comment"),onClick:Xl},[...l[71]||(l[71]=[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,vu)):e.createCommentVNode("",!0),F.askAi?(e.openBlock(),e.createElementBlock("div",gu)):e.createCommentVNode("",!0),F.askAi?(e.openBlock(),e.createElementBlock("div",hu,[e.createElementVNode("div",{class:"dss-toolbar-ai-button dss-toolbar-dropdown-toggle",onClick:l[12]||(l[12]=a=>It("askAi")),title:e.unref(A)("textEditor.toolbar.askAi")},[l[72]||(l[72]=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:"#FFAF54"}),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:"#FFC963"})],-1)),e.createElementVNode("span",Cu,e.toDisplayString(e.unref(A)("textEditor.toolbar.askAi")),1)],8,yu),ue.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",ku,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(F.customToolbarSlots,(a,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:r},[Ke(a)?(e.openBlock(),e.createElementBlock("div",bu,[e.renderSlot(o.$slots,a)])):e.createCommentVNode("",!0),Ke(a)&&r<F.customToolbarSlots.length-1&&dn(r)?(e.openBlock(),e.createElementBlock("div",wu)):e.createCommentVNode("",!0)],64))),128))])],32)):e.createCommentVNode("",!0),(ue.value==="paragraph"||ue.value==="askAi")&&F.richText?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-dropdown-overlay",onClick:At})):e.createCommentVNode("",!0),e.createVNode(Ao,{showModal:Ae.value,width:"500px",height:"55vh",onCloseModal:Dn},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(A)("textEditor.link.editLink")),1)]),content:e.withCtx(()=>[e.createElementVNode("div",xu,[e.createElementVNode("div",Eu,[e.createElementVNode("label",Vu,e.toDisplayString(e.unref(A)("textEditor.link.altText")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"linkAltInput",ref:Oe,type:"text","onUpdate:modelValue":l[15]||(l[15]=a=>O.value=a),class:"dss-link-modal-input",placeholder:e.unref(A)("textEditor.link.enterAltText"),onKeyup:e.withKeys(Jn,["enter"])},null,40,Nu),[[e.vModelText,O.value]])]),e.createElementVNode("div",Su,[e.createElementVNode("label",Bu,e.toDisplayString(e.unref(A)("textEditor.link.url")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"linkUrlInput",ref:rt,type:"text","onUpdate:modelValue":l[16]||(l[16]=a=>Ie.value=a),class:"dss-link-modal-input",placeholder:e.unref(A)("textEditor.link.enterUrl"),onKeyup:e.withKeys(Jn,["enter"])},null,40,Mu),[[e.vModelText,Ie.value]])])])]),actions:e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-cancel",onClick:Dn},e.toDisplayString(e.unref(A)("textEditor.link.cancel")),1),e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-save",onClick:Jn},e.toDisplayString(e.unref(A)("textEditor.link.save")),1)]),_:1},8,["showModal"]),e.createVNode(Ao,{showModal:$t.value,width:"500px",height:"80vh",onCloseModal:wl},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(Xe.value?e.unref(A)("textEditor.image.editImage"):e.unref(A)("textEditor.image.addImage")),1)]),content:e.withCtx(()=>[e.createElementVNode("div",_u,[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-image-modal-tab",{"dss-image-modal-tab-active":fe.value==="upload"}]),onClick:l[17]||(l[17]=a=>fe.value="upload")},e.toDisplayString(e.unref(A)("textEditor.image.upload")),3),l[77]||(l[77]=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":fe.value==="url"}]),onClick:l[18]||(l[18]=a=>fe.value="url")},e.toDisplayString(e.unref(A)("textEditor.image.imageLink")),3)]),fe.value==="upload"?(e.openBlock(),e.createElementBlock("div",$u,[e.createElementVNode("div",Tu,[e.createElementVNode("div",Lu,[Me.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("label",Hu,e.toDisplayString(e.unref(A)("textEditor.image.uploadImage")),1)),Me.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-image-upload-preview",onClick:$o},[e.createElementVNode("img",{src:Et.value,alt:"Preview",class:"dss-image-preview-image"},null,8,Au),l[78]||(l[78]=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:Lt,type:"file",accept:"image/*",class:"dss-image-file-input-hidden",onChange:ln},null,544)])):(e.openBlock(),e.createElementBlock("input",{key:2,ref_key:"imageFileInput",ref:Lt,type:"file",accept:"image/*",class:"dss-link-modal-input dss-link-modal-input-image",onChange:ln},null,544))]),e.createElementVNode("div",Du,[e.createElementVNode("label",Ru,e.toDisplayString(e.unref(A)("textEditor.image.altText")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"imageAltInput",ref:Dt,type:"text","onUpdate:modelValue":l[19]||(l[19]=a=>Ot.value=a),class:"dss-link-modal-input",placeholder:e.unref(A)("textEditor.image.enterAltText"),onKeyup:e.withKeys(Nt,["enter"])},null,40,Fu),[[e.vModelText,Ot.value]])]),e.createElementVNode("div",Iu,[e.createElementVNode("label",zu,e.toDisplayString(e.unref(A)("textEditor.image.width")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":l[20]||(l[20]=a=>lt.value=a),class:"dss-link-modal-input",placeholder:e.unref(A)("textEditor.image.auto"),onKeyup:e.withKeys(Nt,["enter"]),onInput:bo},null,40,Pu),[[e.vModelText,lt.value]])]),e.createElementVNode("div",Ou,[e.createElementVNode("label",Zu,e.toDisplayString(e.unref(A)("textEditor.image.height")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":l[21]||(l[21]=a=>je.value=a),class:"dss-link-modal-input",placeholder:e.unref(A)("textEditor.image.auto"),onKeyup:e.withKeys(Nt,["enter"]),onInput:Dl},null,40,Wu),[[e.vModelText,je.value]])])])])):e.createCommentVNode("",!0),fe.value==="url"?(e.openBlock(),e.createElementBlock("div",qu,[e.createElementVNode("div",Uu,[e.createElementVNode("div",Xu,[e.createElementVNode("label",Yu,e.toDisplayString(e.unref(A)("textEditor.image.imageUrl")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"imageUrlInput",ref:Bt,type:"text","onUpdate:modelValue":l[22]||(l[22]=a=>Ne.value=a),class:"dss-link-modal-input",placeholder:e.unref(A)("textEditor.image.enterImageUrl"),onKeyup:e.withKeys(Nt,["enter"])},null,40,ju),[[e.vModelText,Ne.value]])]),e.createElementVNode("div",Ku,[e.createElementVNode("label",Gu,e.toDisplayString(e.unref(A)("textEditor.image.altText")),1),e.withDirectives(e.createElementVNode("input",{type:"text","onUpdate:modelValue":l[23]||(l[23]=a=>Ot.value=a),class:"dss-link-modal-input",placeholder:e.unref(A)("textEditor.image.enterAltText"),onKeyup:e.withKeys(Nt,["enter"])},null,40,Qu),[[e.vModelText,Ot.value]])]),e.createElementVNode("div",Ju,[e.createElementVNode("label",ed,e.toDisplayString(e.unref(A)("textEditor.image.width")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":l[24]||(l[24]=a=>lt.value=a),class:"dss-link-modal-input",placeholder:e.unref(A)("textEditor.image.auto"),onKeyup:e.withKeys(Nt,["enter"]),onInput:bo},null,40,td),[[e.vModelText,lt.value]])]),e.createElementVNode("div",nd,[e.createElementVNode("label",ld,e.toDisplayString(e.unref(A)("textEditor.image.height")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":l[25]||(l[25]=a=>je.value=a),class:"dss-link-modal-input",placeholder:e.unref(A)("textEditor.image.auto"),onKeyup:e.withKeys(Nt,["enter"]),onInput:Dl},null,40,od),[[e.vModelText,je.value]])])])])):e.createCommentVNode("",!0)]),actions:e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-cancel",onClick:wl},e.toDisplayString(e.unref(A)("textEditor.image.cancel")),1),e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-save",onClick:Nt},e.toDisplayString(e.unref(A)("textEditor.image.save")),1)]),_:1},8,["showModal"]),e.createElementVNode("div",{class:e.normalizeClass(["dss-text-editor-title-wrapper",{"dss-text-editor-no-border-bottom":wn.value&&De.value}])},[e.createElementVNode("p",null,e.toDisplayString(e.unref(A)("textEditor.labels.title")),1),e.createElementVNode("div",ad,[De.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",sd,[F.title?(e.openBlock(),e.createElementBlock("span",rd,e.toDisplayString(F.title),1)):(e.openBlock(),e.createElementBlock("span",id,e.toDisplayString(nt.value),1))])),e.createElementVNode("textarea",{ref_key:"titleInputRef",ref:V,value:F.title,onInput:An,onFocus:hn,onBlur:Zl,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-title-input",{"dss-text-editor-title-input-blurred":!De.value}]),placeholder:nt.value,disabled:F.disabled,rows:"1"},null,42,cd)])],2),wn.value&&De.value?(e.openBlock(),e.createElementBlock("div",ud,[e.renderSlot(o.$slots,"title-slot")])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["dss-text-editor-description-wrapper",{"dss-text-editor-no-border-bottom":sn.value&&re.value}])},[e.createElementVNode("p",null,e.toDisplayString(e.unref(A)("textEditor.labels.description")),1),e.createElementVNode("div",dd,[re.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",md,[F.description?(e.openBlock(),e.createElementBlock("span",pd,e.toDisplayString(F.description),1)):(e.openBlock(),e.createElementBlock("span",fd,e.toDisplayString(st.value),1))])),e.createElementVNode("textarea",{ref_key:"descriptionInputRef",ref:P,value:F.description,onInput:Ee,onFocus:hl,onBlur:Ll,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-description-input",{"dss-text-editor-description-input-blurred":!re.value}]),placeholder:st.value,disabled:F.disabled,rows:"1"},null,42,vd)])],2),sn.value&&re.value?(e.openBlock(),e.createElementBlock("div",gd,[e.renderSlot(o.$slots,"description-slot")])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(vt.value,a=>(e.openBlock(),e.createElementBlock("div",{key:a.id,class:e.normalizeClass(["editor-comment-marker-group",{"editor-comment-marker-active":mn.value===a.id,"editor-comment-marker-group-out-of-view":a.opacity===0}]),"data-comment-id":a.id,style:e.normalizeStyle({top:a.top+"px"}),onMouseenter:r=>Lo(a),onMouseleave:to},[a.firstUser?(e.openBlock(),e.createElementBlock("div",{key:0,class:"editor-comment-marker editor-comment-marker-first",onClick:e.withModifiers(r=>xl(a),["stop"])},[a.firstUser.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:a.firstUser.avatar,alt:a.firstUser.name||"avatar"},null,8,Cd)):(e.openBlock(),e.createElementBlock("span",kd,e.toDisplayString(a.firstUser.initials||(a.firstUser.name?a.firstUser.name.charAt(0):"")),1))],8,yd)):e.createCommentVNode("",!0),a.secondUser?(e.openBlock(),e.createElementBlock("div",{key:1,class:"editor-comment-marker editor-comment-marker-second",onClick:e.withModifiers(r=>xl(a),["stop"])},[a.secondUser.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:a.secondUser.avatar,alt:a.secondUser.name||"avatar"},null,8,wd)):(e.openBlock(),e.createElementBlock("span",xd,e.toDisplayString(a.secondUser.initials||(a.secondUser.name?a.secondUser.name.charAt(0):"")),1))],8,bd)):e.createCommentVNode("",!0),a.additionalCount>0?(e.openBlock(),e.createElementBlock("div",{key:2,class:"editor-comment-marker editor-comment-marker-additional",style:e.normalizeStyle({top:a.secondUser?"30px":"15px"}),"data-has-second-user":a.secondUser?"true":"false",onClick:e.withModifiers(r=>xl(a),["stop"])},[e.createElementVNode("span",Vd,"+"+e.toDisplayString(a.additionalCount),1)],12,Ed)):e.createCommentVNode("",!0)],46,hd))),128)),F.richText?(e.openBlock(),e.createElementBlock("div",Td,[e.createElementVNode("div",{ref_key:"editorRef",ref:p,contenteditable:"true",spellcheck:"false",class:e.normalizeClass(["dss-text-editor-content",{"dss-text-editor-content-disabled":F.disabled,"dss-text-editor-fixed-height":F.fixedHeight}]),style:e.normalizeStyle(cl.value),onInput:Be,onBlur:Hl,onClick:ho,onMouseup:yl,onKeyup:yl,onKeydown:fn,onPaste:On,onMousemove:Ml,onMouseleave:Bo},null,38),e.createVNode(e.Transition,{name:"comment-overlay"},{default:e.withCtx(()=>[mn.value!==null?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-comment-overlay",style:e.normalizeStyle(ml.value)},[tl.value||_n.value.length>0?(e.openBlock(),e.createElementBlock("div",Ld,[e.createElementVNode("div",Hd,[tl.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-comment-selection",innerHTML:tl.value},null,8,Ad)):e.createCommentVNode("",!0)]),e.createElementVNode("div",Dd,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_n.value,(a,r)=>(e.openBlock(),e.createElementBlock("div",{key:r,class:"dss-comment-message"},[a.user&&(a.user.avatar||a.user.initials||a.user.name)?(e.openBlock(),e.createElementBlock("div",Rd,[e.createElementVNode("div",Fd,[a.user.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:a.user.avatar,alt:a.user.name||"avatar"},null,8,Id)):(e.openBlock(),e.createElementBlock("span",zd,e.toDisplayString(a.user.initials||(a.user.name?a.user.name.charAt(0):"")),1))])])):e.createCommentVNode("",!0),e.createElementVNode("div",Pd,[e.createElementVNode("div",Od,[e.createElementVNode("div",Zd,e.toDisplayString(a.user&&a.user.name||"Comment"),1),a.createdAt?(e.openBlock(),e.createElementBlock("div",Wd,e.toDisplayString(Tl(new Date(a.createdAt))),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:e.normalizeClass(["dss-comment-body-text",{"comment-started":Sl(a.text)||a.class==="comment-started"}])},e.toDisplayString(a.text||""),3)]),k.commentUser&&a.user&&a.user.id===k.commentUser.id&&!Sl(a.text)?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-comment-delete-button",onClick:e.withModifiers(c=>vo(a,r),["stop"]),title:e.unref(A)("textEditor.comment.delete")||"Delete comment"},[...l[80]||(l[80]=[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,qd)):e.createCommentVNode("",!0)]))),128))])])):e.createCommentVNode("",!0),e.createElementVNode("div",Ud,[e.withDirectives(e.createElementVNode("textarea",{ref_key:"commentInputRef",ref:Gn,"onUpdate:modelValue":l[26]||(l[26]=a=>Cn.value=a),class:"dss-comment-input",rows:"1",placeholder:e.unref(A)("textEditor.comment.placeholder"),onKeydown:e.withKeys(e.withModifiers(Al,["prevent","stop"]),["enter"]),onInput:l[27]||(l[27]=()=>{if(Gn.value){const a=Gn.value;a.style.height="auto",a.style.height=`${a.scrollHeight}px`}})},null,40,Xd),[[e.vModelText,Cn.value]]),e.createElementVNode("button",{type:"button",class:"dss-comment-send-button",onClick:e.withModifiers(Al,["stop"])},[...l[81]||(l[81]=[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",Yd,[e.createElementVNode("div",jd,[e.createElementVNode("span",Kd,e.toDisplayString(R.value)+" "+e.toDisplayString(R.value===1?e.unref(A)("textEditor.footer.word"):e.unref(A)("textEditor.footer.words")),1),l[82]||(l[82]=e.createElementVNode("span",{class:"dss-text-editor-footer-separator"},"•",-1)),e.createElementVNode("span",Gd,e.toDisplayString(le.value)+" "+e.toDisplayString(le.value===1?e.unref(A)("textEditor.footer.character"):e.unref(A)("textEditor.footer.characters")),1)])])])):(e.openBlock(),e.createElementBlock("div",Nd,[e.createElementVNode("textarea",{value:F.modelValue,onInput:gl,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-textarea",{"dss-text-editor-fixed-height":F.fixedHeight}]),placeholder:Qe.value,rows:F.rows,disabled:F.disabled,style:e.normalizeStyle(qn.value)},null,46,Sd),e.createElementVNode("div",Bd,[e.createElementVNode("div",Md,[e.createElementVNode("span",_d,e.toDisplayString(R.value)+" "+e.toDisplayString(R.value===1?e.unref(A)("textEditor.footer.word"):e.unref(A)("textEditor.footer.words")),1),l[79]||(l[79]=e.createElementVNode("span",{class:"dss-text-editor-footer-separator"},"•",-1)),e.createElementVNode("span",$d,e.toDisplayString(le.value)+" "+e.toDisplayString(le.value===1?e.unref(A)("textEditor.footer.character"):e.unref(A)("textEditor.footer.characters")),1)])])])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[ee.value&&S.value&&p.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-link-popup",style:e.normalizeStyle(ne.value),onMouseenter:l[28]||(l[28]=a=>He.value=!0),onMouseleave:kl},[e.createElementVNode("span",{class:"dss-link-popup-url",onClick:e.withModifiers(Mo,["stop"]),title:S.value},e.toDisplayString(S.value),9,Qd),e.createElementVNode("button",{type:"button",class:"dss-link-popup-edit",onClick:e.withModifiers(_o,["stop"]),title:e.unref(A)("textEditor.link.editLink")},[(e.openBlock(),e.createElementBlock("svg",e1,[...l[83]||(l[83]=[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,Jd)],36)):e.createCommentVNode("",!0)])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[Yt.value&&Ct.value&&p.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-link-popup",style:e.normalizeStyle(te.value),onMouseenter:l[29]||(l[29]=a=>Te.value=!0),onMouseleave:bl},[e.createElementVNode("div",t1,[Ct.value===e.unref(A)("textEditor.image.noAlt")?(e.openBlock(),e.createElementBlock("div",n1,[...l[84]||(l[84]=[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:Ct.value},e.toDisplayString(Ct.value),9,l1)]),e.createElementVNode("button",{type:"button",class:"dss-link-popup-edit",onClick:e.withModifiers(To,["stop"]),title:e.unref(A)("textEditor.image.editImage")},[(e.openBlock(),e.createElementBlock("svg",a1,[...l[85]||(l[85]=[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,o1)],36)):e.createCommentVNode("",!0)])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[F.floatingToolbar&&F.richText&&ge.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"floatingToolbarRef",ref:St,class:"dss-floating-toolbar",style:e.normalizeStyle(yt.value),onMousedown:l[44]||(l[44]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("div",s1,[e.createElementVNode("div",{class:"dss-toolbar-button",onClick:e.withModifiers(w,["stop"]),title:e.unref(A)("textEditor.toolbar.undo")},[...l[86]||(l[86]=[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,r1),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-disabled":!D.value}]),onClick:e.withModifiers(y,["stop"]),title:e.unref(A)("textEditor.toolbar.redo")},[...l[87]||(l[87]=[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,i1),l[107]||(l[107]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",c1,[e.createElementVNode("div",{class:"dss-toolbar-button dss-toolbar-dropdown-toggle",onClick:l[30]||(l[30]=e.withModifiers(a=>Kl("paragraph"),["stop"])),title:e.unref(A)("textEditor.toolbar.paragraphFormat")},[tt.value==="h1"?(e.openBlock(),e.createElementBlock("svg",d1,[...l[88]||(l[88]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M6.2 13V11.836H8.456V7.12H6.548V6.16C8.312 6.04 8.648 5.44 8.804 4.84H9.884V11.836H11.96V13H6.2Z",fill:"#FFC230"},null,-1)])])):tt.value==="h2"?(e.openBlock(),e.createElementBlock("svg",m1,[...l[89]||(l[89]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M6.02 13V11.8L8.732 9.388C9.644 8.584 10.208 8.08 10.208 7.288C10.208 6.64 9.764 6.04 8.84 6.04C7.904 6.04 7.424 6.676 7.412 7.852H5.972C5.852 5.872 7.16 4.72 8.948 4.72C10.736 4.72 11.672 5.86 11.672 7.12C11.672 8.464 10.916 9.364 9.92 10.168L8.192 11.56H11.708V13H6.02Z",fill:"#FFC230"},null,-1)])])):tt.value==="h3"?(e.openBlock(),e.createElementBlock("svg",p1,[...l[90]||(l[90]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M8.156 8.188H8.828C9.56 8.188 10.064 7.696 10.064 7.072C10.064 6.508 9.74 6.04 8.792 6.04C7.748 6.04 7.472 6.688 7.388 7.612H5.948C5.828 6.232 6.896 4.72 8.924 4.72C10.712 4.72 11.6 5.896 11.6 6.892C11.6 7.648 11.3 8.356 10.568 8.704C11.42 9.112 11.768 9.7 11.768 10.48C11.768 11.86 10.712 13.12 8.804 13.12C6.776 13.12 5.708 11.608 5.828 10.228H7.268C7.232 11.068 7.736 11.8 8.792 11.8C9.74 11.8 10.184 11.248 10.184 10.48C10.184 9.808 9.752 9.268 8.828 9.268H8.156V8.188Z",fill:"#FFC230"},null,-1)])])):tt.value==="h4"?(e.openBlock(),e.createElementBlock("svg",f1,[...l[91]||(l[91]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M5.72 11.056V9.856L9.284 4.84H10.832V9.856H12.272V11.056H10.832V13H9.284V11.056H5.72ZM7.076 9.856H9.284V6.832L7.076 9.856Z",fill:"#FFC230"},null,-1)])])):tt.value==="h5"?(e.openBlock(),e.createElementBlock("svg",v1,[...l[92]||(l[92]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M7.652 9.436H6.164C6.416 7.84 6.56 6.64 6.596 4.852L11.516 4.84V6.28H7.82L7.676 7.972C8.084 7.684 8.6 7.516 9.308 7.516C10.832 7.516 11.804 8.644 11.804 10.24C11.804 11.86 10.58 13.12 8.804 13.12C7.328 13.12 5.864 11.968 6.164 10.156H7.484C7.388 11.224 7.964 11.8 8.876 11.8C9.812 11.8 10.316 11.092 10.316 10.252C10.316 9.412 9.908 8.632 8.9 8.632C8.132 8.632 7.748 9.112 7.652 9.436Z",fill:"#FFC230"},null,-1)])])):tt.value==="h6"?(e.openBlock(),e.createElementBlock("svg",g1,[...l[93]||(l[93]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M11.912 10.24C11.912 11.86 10.808 13.12 9.056 13.12C7.16 13.12 5.96 11.5 5.96 9.04C5.96 6.34 7.316 4.72 9.344 4.72C11 4.72 11.84 5.872 11.84 7.012H10.4C10.328 6.628 10.088 6.028 9.104 6.028C8.06 6.028 7.388 6.748 7.316 8.392C7.784 7.84 8.396 7.444 9.416 7.444C10.94 7.444 11.912 8.644 11.912 10.24ZM9.08 8.848C8.12 8.848 7.736 9.556 7.736 10.396C7.736 11.236 8.12 11.944 9.08 11.944C10.04 11.944 10.424 11.236 10.424 10.396C10.424 9.556 10.04 8.848 9.08 8.848Z",fill:"#FFC230"},null,-1)])])):(e.openBlock(),e.createElementBlock("svg",h1,[...l[94]||(l[94]=[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[95]||(l[95]=e.createElementVNode("span",{class:"dss-toolbar-dropdown-arrow"},"˅",-1))],8,u1),at.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]=a=>$n("<h1>"))},[e.createElementVNode("h1",null,e.toDisplayString(e.unref(A)("textEditor.paragraph.heading1")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[32]||(l[32]=a=>$n("<h2>"))},[e.createElementVNode("h2",null,e.toDisplayString(e.unref(A)("textEditor.paragraph.heading2")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[33]||(l[33]=a=>$n("<h3>"))},[e.createElementVNode("h3",null,e.toDisplayString(e.unref(A)("textEditor.paragraph.heading3")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[34]||(l[34]=a=>$n("<h4>"))},[e.createElementVNode("h4",null,e.toDisplayString(e.unref(A)("textEditor.paragraph.heading4")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[35]||(l[35]=a=>$n("<h5>"))},[e.createElementVNode("h5",null,e.toDisplayString(e.unref(A)("textEditor.paragraph.heading5")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[36]||(l[36]=a=>$n("<h6>"))},[e.createElementVNode("h6",null,e.toDisplayString(e.unref(A)("textEditor.paragraph.heading6")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[37]||(l[37]=a=>$n("<p>"))},[e.createElementVNode("p",null,e.toDisplayString(e.unref(A)("textEditor.paragraph.paragraph")),1)])])):e.createCommentVNode("",!0)]),l[108]||(l[108]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Ht("bold")}]),onClick:l[39]||(l[39]=e.withModifiers(a=>ot("bold"),["stop"])),title:e.unref(A)("textEditor.toolbar.bold")},[...l[96]||(l[96]=[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,y1),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Ht("italic")}]),onClick:l[40]||(l[40]=e.withModifiers(a=>ot("italic"),["stop"])),title:e.unref(A)("textEditor.toolbar.italic")},[...l[97]||(l[97]=[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,C1),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Ht("underline")}]),onClick:l[41]||(l[41]=e.withModifiers(a=>ot("underline"),["stop"])),title:e.unref(A)("textEditor.toolbar.underline")},[...l[98]||(l[98]=[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,k1),l[109]||(l[109]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":ut.value}]),onClick:e.withModifiers(ro,["stop"]),title:e.unref(A)("textEditor.toolbar.citation")},[...l[99]||(l[99]=[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,b1),l[110]||(l[110]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),ve.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-button",onClick:e.withModifiers(ql,["stop"]),title:e.unref(A)("textEditor.toolbar.removeLink")},[...l[101]||(l[101]=[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,x1)):(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-button",onClick:e.withModifiers(co,["stop"]),title:e.unref(A)("textEditor.toolbar.insertLink")},[...l[100]||(l[100]=[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,w1)),l[111]||(l[111]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Ht("insertUnorderedList")}]),onClick:e.withModifiers(uo,["stop"]),title:e.unref(A)("textEditor.toolbar.bulletList")},[...l[102]||(l[102]=[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,E1),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Ht("insertOrderedList")}]),onClick:e.withModifiers(el,["stop"]),title:e.unref(A)("textEditor.toolbar.numberList")},[...l[103]||(l[103]=[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,V1),l[112]||(l[112]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:"dss-toolbar-button",onClick:e.withModifiers(Ft,["stop"]),title:e.unref(A)("textEditor.toolbar.image")},[...l[104]||(l[104]=[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,N1),l[113]||(l[113]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:"dss-toolbar-button",title:e.unref(A)("textEditor.toolbar.comment"),onClick:e.withModifiers(Xl,["stop"])},[...l[105]||(l[105]=[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,S1),F.askAi?(e.openBlock(),e.createElementBlock("div",B1)):e.createCommentVNode("",!0),F.askAi?(e.openBlock(),e.createElementBlock("div",M1,[e.createElementVNode("div",{class:"dss-toolbar-ai-button dss-toolbar-ai-float dss-toolbar-dropdown-toggle",onClick:l[42]||(l[42]=e.withModifiers(a=>Kl("askAi"),["stop"])),title:e.unref(A)("textEditor.toolbar.askAi")},[l[106]||(l[106]=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:"#FFAF54"}),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:"#FFC963"})],-1)),e.createElementVNode("span",$1,e.toDisplayString(e.unref(A)("textEditor.toolbar.askAi")),1)],8,_1),at.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)]),Hn.value?(e.openBlock(),e.createElementBlock("div",T1,[F.askAi&&Hn.value?(e.openBlock(),e.createElementBlock("div",L1)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(F.customToolbarSlots,(a,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:r},[Ke(a)&&tn(a)?(e.openBlock(),e.createElementBlock("div",H1,[e.renderSlot(o.$slots,a)])):e.createCommentVNode("",!0),Ke(a)&&tn(a)&&r<F.customToolbarSlots.length-1&&Ln(r)?(e.openBlock(),e.createElementBlock("div",A1)):e.createCommentVNode("",!0)],64))),128))])):e.createCommentVNode("",!0)],36)):e.createCommentVNode("",!0)]))],6))}}),F1={class:"dss-color-picker__section-title"},I1={class:"dss-color-picker__presets-row"},z1=["title","onClick"],P1={key:1,class:"dss-color-picker__section"},O1={class:"dss-color-picker__presets-row"},Z1=["title","onClick"],W1={class:"dss-color-picker__section"},q1={class:"dss-color-picker__section-header"},U1={class:"dss-color-picker__presets-row"},X1=["title","onClick"],Y1=["onClick"],j1={key:1,class:"dss-color-picker__presets-row dss-color-picker__presets-row--standalone"},K1=["title","onClick"],G1={class:"dss-color-picker__input-row"},Q1=["value"],J1={__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}},emits:["update:modelValue","update:presetColors"],setup(F,{emit:Ce}){function z(X){const Z=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(X);if(!Z)return{h:0,s:0,l:50};const j=parseInt(Z[1],16)/255,ie=parseInt(Z[2],16)/255,E=parseInt(Z[3],16)/255,C=Math.max(j,ie,E),V=Math.min(j,ie,E);let P=0,U=0;const ze=(C+V)/2;if(C!==V){const Re=C-V;switch(U=ze>.5?Re/(2-C-V):Re/(C+V),C){case j:P=((ie-E)/Re+(ie<E?6:0))/6;break;case ie:P=((E-j)/Re+2)/6;break;case E:P=((j-ie)/Re+4)/6;break}}return{h:P*360,s:U*100,l:ze*100}}function A(X,Z,j){Z/=100,j/=100;const ie=Z*Math.min(j,1-j),E=C=>{const V=(C+X/30)%12,P=j-ie*Math.max(Math.min(V-3,9-V,1),-1);return Math.round(255*P).toString(16).padStart(2,"0")};return`#${E(0)}${E(8)}${E(4)}`}function _e(X){const Z=X.replace(/^#/,"").match(/^([a-f\d]{6}|[a-f\d]{3})$/i);if(!Z)return null;let j=Z[1];return j.length===3&&(j=j.split("").map(ie=>ie+ie).join("")),"#"+j}function k(X,Z,j){Z/=100,j/=100;const ie=j+Z*Math.min(j,1-j),E=ie===0?0:2-2*j/ie;return{h:X,s:E*100,v:ie*100}}function $e(X,Z,j){Z/=100,j/=100;const ie=j*(1-Z/2),E=ie===0||ie===1?0:(j-ie)/Math.min(ie,1-ie);return{h:X,s:E*100,l:ie*100}}const se=F,pt=Ce,p=e.ref(!1),ue=e.ref(!1),ve=e.ref(!1),de=e.ref(-1),ee=e.ref(-1),S=e.ref(null),ne=e.ref(null),He=e.ref(null),Ae=e.ref(null),Ie=e.ref({top:0,left:0}),O=e.ref(z(se.modelValue||"#b8a5de")),rt=e.computed(()=>Array.isArray(se.presetGroups)&&se.presetGroups.length>0),Oe=e.computed(()=>rt.value?0:se.initialPresetCount!=null?se.initialPresetCount:ee.value<0?null:ee.value),we=e.computed(()=>{const X=Oe.value;return X==null?!0:Math.max(0,se.presetColors.length-X)<se.max}),xt=e.computed(()=>!!(ue.value||de.value>=0||!Tt.value&&se.presetColors.length===0));e.computed(()=>{const X=Oe.value;return X!=null&&se.presetColors.length>X});const Tt=e.computed(()=>rt.value||Oe.value!=null),ut=e.computed(()=>{const X=Oe.value;return X==null?[]:se.presetColors.slice(0,X)}),Ze=e.computed(()=>{const X=Oe.value;return X==null?[]:se.presetColors.slice(X)});function ge(X){const Z=Oe.value;return Z!=null?Z+X:-1}function yt(X){const Z=Oe.value;return Z!=null&&X>=Z}function St(X){yt(X)&&(de.value=X,O.value=z(se.presetColors[X]),ue.value=!0,e.nextTick(()=>Ae.value?.focus()))}function at(X){if(!yt(X))return;const Z=se.presetColors.filter((E,C)=>C!==X);pt("update:presetColors",Z);const j=_e(se.modelValue),ie=_e(se.presetColors[X]);if(j&&ie&&j.toLowerCase()===ie.toLowerCase()){const E=Z[Math.max(0,X-1)]||Z[0];E&&pt("update:modelValue",E)}}function $t(){ve.value=!ve.value,ve.value||(de.value=-1,ue.value=!1)}function Ot(){if(de.value<0)return;const X=je.value,Z=_e(X);if(Z){const j=[...se.presetColors];j[de.value]=Z,pt("update:presetColors",j),pt("update:modelValue",Z),de.value=-1,ue.value=!1}}function on(){se.disabled||(de.value=-1,ue.value=!ue.value,ue.value&&(Ct(),e.nextTick(()=>Ae.value?.focus())))}function Et(X){const Z=_e(X),j=_e(se.modelValue);return Z&&j&&Z.toLowerCase()===j.toLowerCase()}function lt(){if(se.disabled||!we.value)return;const X=je.value,Z=_e(X);if(Z){const j=[...se.presetColors,Z];pt("update:presetColors",j),pt("update:modelValue",Z);const ie=Oe.value??ee.value;ie>=0&&j.length-ie>=se.max&&(ue.value=!1)}}const je=e.computed(()=>{const{h:X,s:Z,l:j}=O.value;return A(X,Z,j)}),Dt=e.computed(()=>je.value.toLowerCase()),Lt=e.computed(()=>({background:`linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, hsl(${O.value.h}, 100%, 50%))`})),Bt=e.computed(()=>{const X=k(O.value.h,O.value.s,O.value.l);return{left:`${X.s}%`,bottom:`${X.v}%`,transform:"translate(-50%, 50%)"}}),Xe=e.computed(()=>({left:`${O.value.h/360*100}%`,transform:"translateX(-50%)"})),Zt=e.computed(()=>({position:"fixed",left:`${Ie.value.left}px`,top:`${Ie.value.top}px`,zIndex:1002}));function Yt(){if(!S.value||!p.value)return;const X=S.value.getBoundingClientRect(),Z=window.innerHeight||document.documentElement.clientHeight;let j=X.bottom+4;const ie=ne.value;ie&&j+ie.offsetHeight>Z-8&&(j=X.top-4-ie.offsetHeight),Ie.value={top:j,left:X.left}}function Ct(){const X=se.modelValue||"#b8a5de";_e(X)&&(O.value=z(X))}function te(){pt("update:modelValue",je.value)}function Te(){se.disabled||(p.value=!p.value,p.value&&(Ct(),e.nextTick(()=>{Yt(),Ae.value?.focus()})))}function fe(){const X=je.value,Z=_e(X);if(Z){if(de.value>=0){const j=[...se.presetColors];j[de.value]=Z,pt("update:presetColors",j),pt("update:modelValue",Z)}else if((se.presetColors.length>0||rt.value)&&ue.value&&we.value&&!se.presetColors.some(ie=>_e(ie)?.toLowerCase()===Z.toLowerCase())){const ie=[...se.presetColors,Z];pt("update:presetColors",ie),pt("update:modelValue",Z)}}p.value=!1,ue.value=!1,ve.value=!1,de.value=-1}function Ne(X){if(!He.value)return;const Z=He.value.getBoundingClientRect(),j=ie=>{const E=Math.max(0,Math.min(1,(ie.clientX-Z.left)/Z.width)),C=Math.max(0,Math.min(1,1-(ie.clientY-Z.top)/Z.height)),V={h:O.value.h,s:E*100,v:C*100};O.value=$e(V.h,V.s,V.v)};j(X),document.addEventListener("mousemove",j),document.addEventListener("mouseup",()=>{document.removeEventListener("mousemove",j),te()},{once:!0})}function We(X){if(!X.currentTarget)return;const j=X.currentTarget.getBoundingClientRect(),ie=E=>{const C=Math.max(0,Math.min(1,(E.clientX-j.left)/j.width));O.value={...O.value,h:C*360}};ie(X),document.addEventListener("mousemove",ie),document.addEventListener("mouseup",()=>{document.removeEventListener("mousemove",ie),te()},{once:!0})}function ft(X){const Z=X.target.value,j=_e(Z);j&&(O.value=z(j),pt("update:modelValue",j))}function qe(X){if(se.disabled)return;const Z=_e(X);Z&&(O.value=z(Z),pt("update:modelValue",Z))}let dt=null,xe=null;function Ue(){dt&&(document.removeEventListener("keydown",dt),dt=null),xe&&(window.removeEventListener("resize",xe),xe=null)}return e.watch(p,X=>{if(Ue(),X){if(!rt.value&&se.initialPresetCount==null){const Z=se.presetColors.length;Z>0&&(ee.value<0||Z<ee.value)&&(ee.value=Z)}dt=Z=>{Z.key==="Escape"&&fe()},xe=Yt,document.addEventListener("keydown",dt),window.addEventListener("resize",xe)}}),e.watch(()=>se.modelValue,()=>{p.value&&Ct()},{immediate:!1}),e.watch(Ze,X=>{X.length===0&&(ve.value=!1,de.value=-1,ue.value=!1)}),e.onBeforeUnmount(Ue),(X,Z)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-color-picker",{"dss-color-picker--disabled":F.disabled}])},[e.createElementVNode("div",{ref_key:"triggerRef",ref:S,class:e.normalizeClass(["dss-color-picker__trigger",{"dss-color-picker__trigger--open":p.value}]),onClick:Te},[e.createElementVNode("span",{class:"dss-color-picker__swatch",style:e.normalizeStyle({backgroundColor:je.value})},[...Z[0]||(Z[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"},[p.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-color-picker__overlay",onClick:e.withModifiers(fe,["self"])},[e.createElementVNode("div",{ref_key:"dropdownRef",ref:ne,class:"dss-color-picker__dropdown",style:e.normalizeStyle(Zt.value)},[Tt.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[rt.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(F.presetGroups,(j,ie)=>(e.openBlock(),e.createElementBlock("div",{key:"g-"+ie,class:"dss-color-picker__section"},[e.createElementVNode("span",F1,e.toDisplayString(j.title),1),e.createElementVNode("div",I1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(j.colors,(E,C)=>(e.openBlock(),e.createElementBlock("button",{key:"g-"+ie+"-"+C,type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":Et(E)}]),style:e.normalizeStyle({backgroundColor:E}),title:E,onClick:e.withModifiers(V=>qe(E),["stop"])},null,14,z1))),128))])]))),128)):ut.value.length?(e.openBlock(),e.createElementBlock("div",P1,[Z[1]||(Z[1]=e.createElementVNode("span",{class:"dss-color-picker__section-title"},"Preset colors",-1)),e.createElementVNode("div",O1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ut.value,(j,ie)=>(e.openBlock(),e.createElementBlock("button",{key:"p-"+ie,type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":Et(j)}]),style:e.normalizeStyle({backgroundColor:j}),title:j,onClick:e.withModifiers(E=>qe(j),["stop"])},null,14,Z1))),128))])])):e.createCommentVNode("",!0),e.createElementVNode("div",W1,[e.createElementVNode("div",q1,[Z[3]||(Z[3]=e.createElementVNode("span",{class:"dss-color-picker__section-title"},"Custom Colors",-1)),Ze.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":ve.value}]),title:"Manage custom colors",onClick:e.withModifiers($t,["stop"])},[...Z[2]||(Z[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",U1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ze.value,(j,ie)=>(e.openBlock(),e.createElementBlock("div",{key:"c-"+ie,class:e.normalizeClass(["dss-color-picker__preset-wrap",{"dss-color-picker__preset-wrap--manage":ve.value}])},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":!ve.value&&Et(j),"dss-color-picker__preset-bubble--editing":ve.value&&de.value===ge(ie)}]),style:e.normalizeStyle({backgroundColor:de.value===ge(ie)?je.value:j}),title:de.value===ge(ie)?je.value:j,onClick:e.withModifiers(E=>ve.value?St(ge(ie)):qe(j),["stop"])},null,14,X1),ve.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(E=>at(ge(ie)),["stop"])},[...Z[4]||(Z[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,Y1)):e.createCommentVNode("",!0)],2))),128)),we.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-color-picker__add-bubble",{"dss-color-picker__add-bubble--active":ue.value}]),onClick:e.withModifiers(on,["stop"])}," + ",2)):e.createCommentVNode("",!0)])])],64)):F.presetColors.length?(e.openBlock(),e.createElementBlock("div",j1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(F.presetColors,(j,ie)=>(e.openBlock(),e.createElementBlock("button",{key:ie,type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":Et(j)}]),style:e.normalizeStyle({backgroundColor:j}),title:j,onClick:e.withModifiers(E=>qe(j),["stop"])},null,14,K1))),128)),we.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-color-picker__add-bubble",{"dss-color-picker__add-bubble--active":ue.value}]),onClick:e.withModifiers(on,["stop"])}," + ",2)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),xt.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createElementVNode("div",{class:"dss-color-picker__sl-area",ref_key:"slAreaRef",ref:He,onMousedown:Ne},[e.createElementVNode("div",{class:"dss-color-picker__sl-bg",style:e.normalizeStyle(Lt.value)},null,4),e.createElementVNode("div",{class:"dss-color-picker__sl-pointer",style:e.normalizeStyle(Bt.value)},null,4)],544),e.createElementVNode("div",{class:"dss-color-picker__hue-wrap",onMousedown:We},[Z[5]||(Z[5]=e.createElementVNode("div",{class:"dss-color-picker__hue-track"},null,-1)),e.createElementVNode("div",{class:"dss-color-picker__hue-pointer",style:e.normalizeStyle(Xe.value)},null,4)],32),e.createElementVNode("div",G1,[e.createElementVNode("input",{ref_key:"hexInputRef",ref:Ae,type:"text",class:"dss-color-picker__hex-input",value:Dt.value,onInput:ft},null,40,Q1)]),Tt.value&&(F.presetColors.length||rt.value)&&we.value&&de.value<0?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-color-picker__add-btn",onClick:lt}," Save color ")):e.createCommentVNode("",!0),Tt.value&&de.value>=0?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-color-picker__add-btn",onClick:Ot}," Save color ")):e.createCommentVNode("",!0),Tt.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:2,type:"button",class:"dss-color-picker__add-btn",onClick:fe}," Save color "))],64)):e.createCommentVNode("",!0)],4)])):e.createCommentVNode("",!0)]))],2))}},em={key:0,class:"dss-loader"},tm={key:0,class:"dss-loader-label"},nm={key:1,class:"dss-loader"},lm={key:0,class:"dss-loader-label"},om={key:2,class:"dss-loader"},am={key:0,class:"dss-loader-label"},sm={key:3,class:"dss-loader"},rm={key:0,class:"dss-loader-label"},im={key:4,class:"dss-loader"},cm={key:0,class:"dss-loader-label"},um={key:5,class:"dss-loader dss-loader--inline"},dm={class:"dss-loader-inline-text"},mm={__name:"DSSLoaders",props:{type:{type:String,default:"spinner"},label:{type:String,default:""},size:{type:[String,Number],default:"medium"}},setup(F){const Ce=F,z=e.computed(()=>Ce.size==="small"?"dss-loaders--size-small":Ce.size==="large"?"dss-loaders--size-large":Ce.size==="medium"||Ce.size==null?"dss-loaders--size-medium":null),A=e.computed(()=>Ce.size==="small"||Ce.size==="medium"||Ce.size==="large"||Ce.size==null?{}:{"--dss-loader-size":typeof Ce.size=="number"?`${Ce.size}px`:String(Ce.size)});return(_e,k)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-loaders",z.value]),style:e.normalizeStyle(A.value)},[F.type==="spinner"?(e.openBlock(),e.createElementBlock("div",em,[k[0]||(k[0]=e.createElementVNode("span",{class:"dss-loader-spinner","aria-hidden":"true"},null,-1)),F.label?(e.openBlock(),e.createElementBlock("span",tm,e.toDisplayString(F.label),1)):e.createCommentVNode("",!0)])):F.type==="dots"?(e.openBlock(),e.createElementBlock("div",nm,[k[1]||(k[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)),F.label?(e.openBlock(),e.createElementBlock("span",lm,e.toDisplayString(F.label),1)):e.createCommentVNode("",!0)])):F.type==="battery"?(e.openBlock(),e.createElementBlock("div",om,[k[2]||(k[2]=e.createElementVNode("div",{class:"battery","aria-hidden":"true"},null,-1)),F.label?(e.openBlock(),e.createElementBlock("span",am,e.toDisplayString(F.label),1)):e.createCommentVNode("",!0)])):F.type==="double-circle"?(e.openBlock(),e.createElementBlock("div",sm,[k[3]||(k[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)),F.label?(e.openBlock(),e.createElementBlock("span",rm,e.toDisplayString(F.label),1)):e.createCommentVNode("",!0)])):F.type==="bars"?(e.openBlock(),e.createElementBlock("div",im,[k[4]||(k[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)),F.label?(e.openBlock(),e.createElementBlock("span",cm,e.toDisplayString(F.label),1)):e.createCommentVNode("",!0)])):F.type==="inline"?(e.openBlock(),e.createElementBlock("div",um,[k[5]||(k[5]=e.createElementVNode("span",{class:"dss-loader-inline-spinner","aria-hidden":"true"},null,-1)),e.createElementVNode("span",dm,[e.renderSlot(_e.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(F.label),1)])])])):e.createCommentVNode("",!0)],6))}},Xo="dss-skeleton-item",pm={__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:F=>["single","multiple"].includes(F)},targetClass:{type:String,default:Xo},bgColor:{type:String,default:null},shimmerColor:{type:String,default:null},bgDark:{type:String,default:null},shimmerDark:{type:String,default:null}},setup(F){const Ce=F,z=e.computed(()=>{const k={"dss-skeleton--loading":Ce.loading,"dss-skeleton--static":!Ce.shimmer,"dss-skeleton--multiple":Ce.mode==="multiple","dss-skeleton--dark":Ce.darkMode};return Ce.mode==="multiple"&&Ce.targetClass!==Xo&&(k[`dss-skeleton--target-${Ce.targetClass}`]=!0),k}),A=e.computed(()=>{const k={};return Ce.borderRadius&&(k.borderRadius=Ce.borderRadius),k}),_e=e.computed(()=>{const k={};return Ce.borderRadius&&(k["--dss-skeleton-border-radius"]=Ce.borderRadius),Ce.darkMode?(k["--dss-skeleton-bg"]=Ce.bgDark||"#322c3f",k["--dss-skeleton-shimmer"]=Ce.shimmerDark||"#3e3f41",k):(Ce.bgColor&&(k["--dss-skeleton-bg"]=Ce.bgColor),Ce.shimmerColor&&(k["--dss-skeleton-shimmer"]=Ce.shimmerColor),k)});return(k,$e)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-skeleton",z.value]),style:e.normalizeStyle(_e.value)},[F.loading&&F.mode==="single"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-skeleton-overlay",style:e.normalizeStyle(A.value),"aria-hidden":"true"},null,4)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["dss-skeleton-content",{"dss-skeleton-content--hidden":F.loading&&F.mode==="single"}])},[e.renderSlot(k.$slots,"default")],2)],6))}},fm={key:0,class:"dss-dnd-column-header"},vm={class:"dss-dnd-column-title"},gm={class:"dss-dnd-column-count"},hm=["data-column"],ym={key:0,class:"dss-dnd-indicator"},Cm=["onPointerdown"],km=["onPointerdown"],bm={class:"dss-dnd-item-content"},wm={class:"dss-dnd-item-default"},xm={key:0,class:"dss-dnd-empty"},Em={name:"DSSDnd"},Vm=Object.assign(Em,{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(F,{emit:Ce}){const z=F,A=Ce,_e=e.useSlots(),k=e.computed(()=>!!_e["delete-zone"]),$e={columnMinWidth:"280px",columnMaxWidth:"none",columnGap:"12px",indicatorColor:"#7c6bc4",dragGhostOpacity:.75,dragSourceBackground:"#f5f5f5",dragSourceBorder:"#e0e0e0",useHandle:!1,columnBodyMaxHeight:"none",showHeader:!0,unstyled:!1,deleteZoneAlwaysVisible:!1},se=e.computed(()=>({...$e,...z.options})),pt=e.computed(()=>({"--dss-dnd-col-min-w":se.value.columnMinWidth,"--dss-dnd-col-max-w":se.value.columnMaxWidth,"--dss-dnd-col-gap":se.value.columnGap,"--dss-dnd-indicator-color":se.value.indicatorColor,"--dss-dnd-body-max-h":se.value.columnBodyMaxHeight})),p=e.ref(null),ue=e.ref(null),ve=e.ref(!1),de=e.ref(-1),ee=e.ref(null);let S=null,ne=null,He=null,Ae=null,Ie=0,O=0,rt="",Oe=null;const we=5,xt=e.computed(()=>{const te={};for(const Te of z.columns)te[Te.value]=z.items.filter(fe=>fe[z.columnKey]===Te.value).sort((fe,Ne)=>(fe[z.positionKey]??0)-(Ne[z.positionKey]??0));return te}),Tt=e.computed(()=>{const te={},Te=!!p.value,fe=p.value?.[z.itemKey],Ne=ue.value,We=de.value;for(const ft of z.columns){const qe=xt.value[ft.value]||[],dt=[],xe=Ne==ft.value;let Ue=0;for(let X=0;X<qe.length;X++){const Z=qe[X],j=Te&&Z[z.itemKey]===fe;!j&&xe&&We===Ue&&dt.push({type:"indicator",key:`ind-${Ue}`}),j||Ue++,dt.push({type:"item",item:Z,isDragged:j,key:`item-${Z[z.itemKey]}`})}xe&&We>=Ue&&dt.push({type:"indicator",key:"ind-end"}),te[ft.value]=dt}return te});function ut(te,Te){const Ne=(xt.value[te]||[]).filter(qe=>qe[z.itemKey]!==p.value?.[z.itemKey]);if(Ne.length===0)return 1;if(Te<=0){const qe=Ne[0][z.positionKey];return qe!=null&&qe>0?qe/2:.5}if(Te>=Ne.length){const qe=Ne[Ne.length-1][z.positionKey];return(qe??0)+1}const We=Ne[Te-1][z.positionKey]??0,ft=Ne[Te][z.positionKey]??0;return(We+ft)/2}function Ze(te,Te,fe){He&&He.remove();const Ne=te.getBoundingClientRect(),We=te.cloneNode(!0);We.classList.add("dss-dnd-ghost"),We.style.cssText=`
104
104
  position: fixed;
105
- left: ${$e-Ie}px;
105
+ left: ${Te-Ie}px;
106
106
  top: ${fe-O}px;
107
107
  width: ${Ne.width}px;
108
108
  height: ${Ne.height}px;
@@ -114,4 +114,4 @@
114
114
  background-color: ${se.value.dragSourceBackground};
115
115
  font-family: 'Work Sans', sans-serif;
116
116
  cursor: grabbing;
117
- `,document.body.appendChild(We),He=We}function ge(te,$e){He&&(He.style.left=`${te-Ie}px`,He.style.top=`${$e-O}px`)}function yt(te){te.classList.add("dss-dnd-item--dragging"),te.style.background=se.value.dragSourceBackground,te.style.borderColor=se.value.dragSourceBorder,te.style.transform="scale(0.97)"}function St(te){te.classList.remove("dss-dnd-item--dragging"),te.style.background="",te.style.borderColor="",te.style.transform=""}function at(te,$e){return document.elementFromPoint(te,$e)?.closest(".dss-dnd-column-body")??null}function $t(te,$e){return!!document.elementFromPoint(te,$e)?.closest("[data-dss-dnd-delete-zone]")}function Ot(te,$e){if(k.value&&$t(te,$e)){ve.value=!0,ue.value=null,de.value=-1;return}ve.value=!1;const fe=at(te,$e),Ne=fe?.getAttribute("data-column")??null;if(!Ne){ue.value=null,de.value=-1;return}ue.value=Ne;const We=fe.querySelectorAll(".dss-dnd-item:not(.dss-dnd-item--dragging)");let ft=We.length;for(let qe=0;qe<We.length;qe++){const dt=We[qe].getBoundingClientRect();if($e<dt.top+dt.height/2){ft=qe;break}}de.value=ft}function on(te){te.preventDefault(),ge(te.clientX,te.clientY),!S&&(S=requestAnimationFrame(()=>{S=null,Ot(te.clientX,te.clientY)}))}function Et(te){window.removeEventListener("pointermove",on),window.removeEventListener("pointerup",Et),window.removeEventListener("pointercancel",Et),Ae?.releasePointerCapture?.(te.pointerId),St(Ae),Ae=null;const $e=k.value&&$t(te.clientX,te.clientY);if(p.value&&$e)A("delete",{item:p.value});else{const Ne=at(te.clientX,te.clientY)?.getAttribute("data-column")??null;if(p.value&&Ne){const We=p.value[z.columnKey],ft=Ne,dt=(xt.value[ft]||[]).filter(Z=>Z[z.itemKey]!==p.value[z.itemKey]),xe=Math.max(0,Math.min(de.value,dt.length)),Ue=ut(ft,xe),X=p.value[z.itemKey];A("move",{item:p.value,from:We,to:ft,position:Ue,index:xe}),ne&&clearTimeout(ne),ee.value={id:X,from:We,to:ft},ne=setTimeout(()=>{ee.value=null},3500)}}He&&(He.remove(),He=null),rt!==null&&(document.body.style.cursor=rt,rt=""),Ct()}function lt(te,$e){te.preventDefault();const fe=te.target.closest(".dss-dnd-item");if(!fe)return;const Ne=fe.getBoundingClientRect();Ie=te.clientX-Ne.left,O=te.clientY-Ne.top,rt=document.body.style.cursor,document.body.style.cursor="grabbing",p.value=$e,Ae=fe,Ze(fe,te.clientX,te.clientY),requestAnimationFrame(()=>yt(fe)),fe.setPointerCapture?.(te.pointerId),window.addEventListener("pointermove",on),window.addEventListener("pointerup",Et,{once:!0}),window.addEventListener("pointercancel",Et,{once:!0})}function je(){Oe&&(window.removeEventListener("pointermove",Dt),window.removeEventListener("pointerup",Lt),window.removeEventListener("pointercancel",Lt),Oe=null)}function Dt(te){if(!Oe||te.pointerId!==Oe.pointerId)return;const $e=te.clientX-Oe.startX,fe=te.clientY-Oe.startY;if(Math.abs($e)>=we||Math.abs(fe)>=we){const Ne=Oe.item;je(),lt(te,Ne)}}function Lt(te){!Oe||te.pointerId!==Oe.pointerId||je()}function Bt(te,$e){je(),Oe={item:$e,startX:te.clientX,startY:te.clientY,pointerId:te.pointerId},window.addEventListener("pointermove",Dt),window.addEventListener("pointerup",Lt),window.addEventListener("pointercancel",Lt)}function Xe(te,$e){se.value.useHandle||Bt(te,$e)}function Zt(te,$e){Bt(te,$e)}function Yt(){S&&(cancelAnimationFrame(S),S=null)}function Ct(){Yt(),p.value=null,ue.value=null,ve.value=!1,de.value=-1}return e.onBeforeUnmount(()=>{Yt(),je(),ne&&clearTimeout(ne),He&&(He.remove(),He=null)}),(te,$e)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-dnd",{"dss-dnd--unstyled":se.value.unstyled}]),style:e.normalizeStyle(pt.value)},[k.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":ve.value}]),"data-dss-dnd-delete-zone":""},[e.renderSlot(te.$slots,"delete-zone",{isDragging:!!p.value,isOver:ve.value})],2),[[e.vShow,!!p.value||se.value.deleteZoneAlwaysVisible]])])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(F.columns,fe=>(e.openBlock(),e.createElementBlock("div",{key:fe.value,class:e.normalizeClass(["dss-dnd-column",[{"dss-dnd-column--drag-over":ue.value==fe.value},fe.class||""]])},[se.value.showHeader?(e.openBlock(),e.createElementBlock("div",fm,[e.renderSlot(te.$slots,"column-header",{column:fe,items:xt.value[fe.value]||[]},()=>[e.createElementVNode("span",vm,e.toDisplayString(fe.title||fe.value),1),e.createElementVNode("span",gm,e.toDisplayString((xt.value[fe.value]||[]).length),1)])])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"dss-dnd-column-body","data-column":fe.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Tt.value[fe.value],Ne=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:Ne.key},[Ne.type==="indicator"?(e.openBlock(),e.createElementBlock("div",ym)):(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["dss-dnd-item",{"dss-dnd-item--dragging":Ne.isDragged,"dss-dnd-item--no-handle":!se.value.useHandle}]),onPointerdown:We=>Xe(We,Ne.item)},[se.value.useHandle?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-dnd-handle",onPointerdown:e.withModifiers(We=>Zt(We,Ne.item),["stop"])},[e.renderSlot(te.$slots,"handle",{},()=>[$e[0]||($e[0]=e.createElementVNode("span",{class:"dss-dnd-handle-icon"},"⠿",-1))])],40,km)):e.createCommentVNode("",!0),e.createElementVNode("div",bm,[e.renderSlot(te.$slots,"item",{item:Ne.item,column:fe,justDropped:ee.value?.id===Ne.item[F.itemKey],droppedFrom:ee.value?.id===Ne.item[F.itemKey]?ee.value.from:null,droppedTo:ee.value?.id===Ne.item[F.itemKey]?ee.value.to:null},()=>[e.createElementVNode("div",wm,e.toDisplayString(Ne.item[F.itemKey]),1)])])],42,Cm))],64))),128)),(xt.value[fe.value]||[]).length===0&&ue.value!=fe.value?(e.openBlock(),e.createElementBlock("div",xm,[e.renderSlot(te.$slots,"empty",{column:fe},()=>[$e[1]||($e[1]=e.createElementVNode("span",{class:"dss-dnd-empty-text"},"No items",-1))])])):e.createCommentVNode("",!0)],8,hm)],2))),128))],6))}}),Nm={name:"DSSConfetti"},Sm=Object.assign(Nm,{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(F){const Ce=F,z=e.ref(null),A=e.ref(!1);let _e=[],k=null,Le=null;function se(ee,S){const ne=[];for(let He=0;He<Ce.count;He++)ne.push(pt(ee));return ne}function pt(ee,S){return{x:Math.random()*ee,y:-Math.random()*150-20,r:Math.random()*8+3,d:Math.random()*50,color:Ce.colors[Math.floor(Math.random()*Ce.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 p(ee,S,ne,He){ee.clearRect(0,0,S,ne);for(const Ae of _e)ee.save(),ee.globalAlpha=Ae.opacity*He,ee.beginPath(),ee.lineWidth=Ae.r,ee.strokeStyle=Ae.color,ee.moveTo(Ae.x+Ae.tilt+Ae.r/2,Ae.y),ee.lineTo(Ae.x+Ae.tilt,Ae.y+Ae.tilt+Ae.r/2),ee.stroke(),ee.restore()}function ue(ee,S,ne){const He=.3+ne*.7;for(let Ae=0;Ae<_e.length;Ae++){const Ie=_e[Ae];Ie.tiltAngle+=Ie.tiltInc,Ie.y+=Ie.speed*He,Ie.x+=Math.sin(Ie.d)*.5*He,Ie.tilt=Math.sin(Ie.tiltAngle)*15,ne>=.99&&Ie.y>S+20&&(_e[Ae]=pt(ee))}}function ve(){A.value=!0,e.nextTick(()=>{const ee=z.value;if(!ee)return;const S=ee.getContext("2d"),ne=ee.parentElement;if(!ne)return;const He=ne.getBoundingClientRect();ee.width=He.width,ee.height=He.height,_e=se(ee.width,ee.height);const Ae=Date.now(),Ie=Ae+Ce.duration,O=()=>{const rt=Date.now(),Oe=rt-Ae;if(rt<Ie){let we=1;Oe>Ce.fadeStart&&(we=1-(Oe-Ce.fadeStart)/(Ce.duration-Ce.fadeStart)),p(S,ee.width,ee.height,we),ue(ee.width,ee.height,we),k=requestAnimationFrame(O)}else de()};O()})}function de(){k&&(cancelAnimationFrame(k),k=null),_e=[],A.value=!1}return e.watch(()=>Ce.trigger,ee=>{ee&&(Le&&clearTimeout(Le),Le=setTimeout(ve,Ce.delay))},{immediate:!0}),e.onBeforeUnmount(()=>{de(),Le&&clearTimeout(Le)}),(ee,S)=>A.value?(e.openBlock(),e.createElementBlock("canvas",{key:0,ref_key:"canvasRef",ref:z,class:"dss-confetti-canvas"},null,512)):e.createCommentVNode("",!0)}}),Bm={class:"dss-filter-global-inner"},Mm=["value"],_m=["title"],$m={key:0,class:"dss-filter-funnel-badge"},Tm={class:"dss-filter-panel"},Lm={key:0,class:"dss-filter-empty"},Hm={class:"dss-filter-row-prefix"},Am={class:"dss-filter-cell"},Dm=["onClick"],Rm={class:"dss-filter-trigger-text"},Fm={class:"dss-filter-popup-list"},Im=["onClick"],zm={key:0,class:"dss-filter-popup-empty"},Pm={key:0,class:"dss-filter-cell"},Om=["onClick"],Zm={class:"dss-filter-trigger-text"},Wm={class:"dss-filter-popup-list"},qm=["onClick"],Um={key:1,class:"dss-filter-cell dss-filter-cell--value"},Xm=["onUpdate:modelValue"],Ym={key:1,class:"dss-filter-date-wrap"},jm=["onUpdate:modelValue"],Km=["value","onInput","step"],Gm={key:4,class:"dss-filter-between"},Qm=["value","onInput","step"],Jm=["value","onInput","step"],e2={key:5,class:"dss-filter-multiselect"},t2=["onClick"],n2={class:"dss-filter-trigger-text"},l2={class:"dss-filter-popup-list dss-filter-popup-list--check"},o2=["onClick"],a2=["checked"],s2={key:0,class:"dss-filter-popup-empty"},r2=["onClick"],i2={class:"dss-filter-foot"},c2={class:"dss-filter-cell"},u2={class:"dss-filter-popup-list"},d2=["onClick"],m2={key:0,class:"dss-filter-popup-divider"},p2=["onClick"],f2={class:"dss-filter-popup-list"},v2=["onClick"],g2={key:0,class:"dss-filter-popup-empty"},h2={class:"dss-filter-popup-list"},y2=["onClick"],C2={key:0,class:"dss-filter-popup-empty"},k2={name:"DSSFilter"},b2=Object.assign(k2,{props:{data:{type:Array,required:!0},modelValue:{type:Array,default:void 0},exclude:{type:Array,default:()=>[]},config:{type:Object,default:()=>({})},options:{type:Object,default:()=>({})}},emits:["update:modelValue"],setup(F,{expose:Ce,emit:z}){const A=F,_e=z,k={unstyled:!1,maxUniqueForSelect:30,maxUniqueForEnum:15},Le=e.computed(()=>({...k,...A.options})),se={text:[{value:"contains",label:"contains"},{value:"not_contains",label:"does not contain"},{value:"equals",label:"equals"},{value:"not_equals",label:"does not equal"},{value:"starts_with",label:"starts with"},{value:"ends_with",label:"ends with"},{value:"is_empty",label:"is empty"},{value:"is_not_empty",label:"is not empty"}],select:[{value:"is_any_of",label:"is any of"},{value:"is_none_of",label:"is none of"},{value:"is_empty",label:"is empty"},{value:"is_not_empty",label:"is not empty"}],range:[{value:"eq",label:"="},{value:"neq",label:"≠"},{value:"gt",label:">"},{value:"gte",label:"≥"},{value:"lt",label:"<"},{value:"lte",label:"≤"},{value:"between",label:"between"},{value:"is_empty",label:"is empty"},{value:"is_not_empty",label:"is not empty"}],int:[{value:"eq",label:"="},{value:"neq",label:"≠"},{value:"gt",label:">"},{value:"gte",label:"≥"},{value:"lt",label:"<"},{value:"lte",label:"≤"},{value:"between",label:"between"},{value:"is_empty",label:"is empty"},{value:"is_not_empty",label:"is not empty"}],arraySelect:[{value:"contains_any",label:"contains any of"},{value:"contains_all",label:"contains all of"},{value:"not_contains_any",label:"does not contain"},{value:"is_empty",label:"is empty"},{value:"is_not_empty",label:"is not empty"}],arrayText:[{value:"contains",label:"contains"},{value:"not_contains",label:"does not contain"},{value:"is_empty",label:"is empty"},{value:"is_not_empty",label:"is not empty"}],date:[{value:"eq",label:"on"},{value:"before",label:"before"},{value:"after",label:"after"},{value:"is_empty",label:"is empty"},{value:"is_not_empty",label:"is not empty"}],boolean:[{value:"is_true",label:"is true"},{value:"is_false",label:"is false"},{value:"is_empty",label:"is empty"},{value:"is_not_empty",label:"is not empty"}]},pt=new Set(["is_empty","is_not_empty","is_true","is_false"]),p=["label","name","title","keyword","full_name","value","text"],ue=e.ref(""),ve=e.ref([]),de=e.ref(null),ee=e.ref(!1),S=e.ref(null),ne=e.ref(""),He=e.ref(null);let Ae=1;function Ie(E){const C=E.find(V=>V&&typeof V=="object");if(!C)return null;for(const V of p)if(V in C&&typeof C[V]=="string")return V;return Object.keys(C).find(V=>typeof C[V]=="string")||null}function O(E,C){const V=C.filter(P=>P!=null&&P!=="NULL");if(V.length===0)return null;if(V.every(P=>Array.isArray(P))){const P=V.flatMap(ze=>ze).filter(ze=>ze!=null);return P.length===0?null:typeof P.find(ze=>ze!=null)=="object"?"arraySelect":"arrayText"}return V.every(P=>typeof P=="boolean")?"boolean":V.every(P=>typeof P=="number")?new Set(V).size<=Le.value.maxUniqueForEnum?"select":"range":V.every(P=>typeof P=="string")?new Set(V).size<=Le.value.maxUniqueForSelect?"select":"text":V.some(P=>typeof P=="object"&&!Array.isArray(P))?null:"text"}const rt=e.computed(()=>{if(!A.data?.length)return[];const E=new Set;for(const U of A.data)if(U&&typeof U=="object")for(const ze of Object.keys(U))E.add(ze);const C=new Set(A.exclude),V=[];for(const U of E){if(C.has(U))continue;const ze=A.config[U]||{},Re=A.data.map(wt=>wt?.[U]),De=ze.type||O(U,Re);if(!De)continue;const re=ze.filterMode||"contain",Ge=re==="date"?"date":re==="string"?"text":De,tt={key:U,label:ze.label||j(U),type:Ge,filterMode:re};if(De==="select"){const wt=Re.filter(vt=>vt!=null&&vt!=="NULL");tt.uniqueValues=[...new Set(wt)].sort((vt,Je)=>typeof vt=="number"&&typeof Je=="number"?vt-Je:String(vt).localeCompare(String(Je)))}else if(De==="range"||De==="int"){const wt=Re.filter(vt=>typeof vt=="number");tt.min=Math.min(...wt),tt.max=Math.max(...wt)}else if(De==="arraySelect"){const wt=ze.displayKey||Ie(Re.flatMap(Je=>Array.isArray(Je)?Je:[]));tt.displayKey=wt;const vt=Re.flatMap(Je=>Array.isArray(Je)?Je:[]).filter(Je=>Je!=null).map(Je=>wt&&typeof Je=="object"?Je[wt]:String(Je)).filter(Je=>Je!=null&&Je!=="");tt.uniqueValues=[...new Set(vt)].sort((Je,vn)=>String(Je).localeCompare(String(vn)))}V.push(tt)}const P=A.config._order;return P&&V.sort((U,ze)=>{const Re=P.indexOf(U.key),De=P.indexOf(ze.key);return Re===-1&&De===-1?0:Re===-1?1:De===-1?-1:Re-De}),V}),Oe=e.computed(()=>{const E={};for(const C of rt.value)E[C.key]=C;return E}),we=e.computed(()=>Array.isArray(A.config.groups)&&A.config.groups.length>0),xt=e.computed(()=>{if(!we.value)return[];const E=new Set(rt.value.map(C=>C.key));return A.config.groups.map(C=>({...C,keys:C.keys.filter(V=>E.has(V))})).filter(C=>C.keys.length>0)}),Tt=e.computed(()=>{if(!we.value)return[];const E=new Set(A.config.groups.flatMap(C=>C.keys));return rt.value.filter(C=>!E.has(C.key))}),ut=e.computed(()=>{if(!He.value)return[];const E=new Set(He.value.keys),C=rt.value.filter(P=>E.has(P.key));if(!ne.value)return C;const V=ne.value.toLowerCase();return C.filter(P=>P.label.toLowerCase().includes(V))}),Ze=e.computed(()=>{if(!ne.value)return rt.value;const E=ne.value.toLowerCase();return rt.value.filter(C=>C.label.toLowerCase().includes(E))});function ge(E){de.value===E?yt():(de.value=E,ne.value="",He.value=null)}function yt(){de.value=null,ne.value="",He.value=null}function St(E){const C=E.target.closest(".dss-datepicker__overlay, .dss-datepicker__dropdown");de.value&&!C&&!E.target.closest(".dss-filter-popup")&&!E.target.closest(".dss-filter-trigger")&&!E.target.closest(".dss-filter-add-btn")&&yt(),ee.value&&S.value&&!S.value.contains(E.target)&&(C||(ee.value=!1))}e.onMounted(()=>document.addEventListener("click",St)),e.onBeforeUnmount(()=>document.removeEventListener("click",St));function at(E){return Oe.value[E]?.label||j(E)}function $t(E){return Oe.value[E.key]?.filterMode||"contain"}function Ot(E){for(const C of Object.values(se)){const V=C.find(P=>P.value===E);if(V)return V.label}return E}function on(E){const C=Oe.value[E.key];return se[C?.type]||se.text}function Et(E){return pt.has(E)}function lt(E){const C=Oe.value[E.key];return C?C.type==="date"?"date":C.type==="boolean"?"boolean":C.type==="text"||C.type==="arrayText"?"text":C.type==="select"||C.type==="arraySelect"?"multiselect":C.type==="range"||C.type==="int"?E.operator==="between"?"between":"number":"text":"text"}function je(E){return se[E]?.[0]?.value||"contains"}function Dt(E,C){return pt.has(C)||E==="date"?null:E==="select"||E==="arraySelect"?[]:(E==="range"||E==="int")&&C==="between"?{min:null,max:null}:E==="range"||E==="int"?null:""}function Lt(E){return Oe.value[E.key]?.uniqueValues||[]}function Bt(E){const C=Lt(E);if(!ne.value)return C;const V=ne.value.toLowerCase();return C.filter(P=>String(P).toLowerCase().includes(V))}function Xe(E){const C=E.value;return!C||C.length===0?"Select...":C.length<=2?C.join(", "):`${C.length} selected`}function Zt(E){const C=Oe.value[E],V=C?.filterMode||"contain",P=C?.type||"text",U=V==="string"?"contains":je(P);ve.value.push(e.reactive({id:Ae++,key:E,operator:U,value:Dt(P,U)})),yt()}function Yt(E){ve.value=ve.value.filter(C=>C.id!==E)}function Ct(E,C){const P=Oe.value[C]?.type||"text";E.key=C,E.operator=je(P),E.value=Dt(P,E.operator),yt()}function te(E,C){const V=lt(E);E.operator=C;const P=lt(E);if(V!==P||pt.has(C)){const U=Oe.value[E.key];E.value=Dt(U?.type||"text",C)}yt()}function $e(E,C){const V=C.target.value;E.value=V===""?null:Number(V)}function fe(E,C,V){const P=V.target.value,U=P===""?null:Number(P);(!E.value||typeof E.value!="object")&&(E.value={min:null,max:null}),E.value={...E.value,[C]:isNaN(U)?null:U}}function Ne(E,C){const V=E.value||[],P=V.indexOf(C);E.value=P>=0?V.filter(U=>U!==C):[...V,C]}function We(){ve.value=[],ue.value="",yt()}function ft(E){ue.value=E.target.value}const qe=e.computed(()=>{if(!A.data)return[];let E=A.data;if(ue.value){const C=ue.value.toLowerCase();E=E.filter(V=>{for(const P of Object.keys(V)){const U=V[P];if(typeof U=="string"&&U.toLowerCase().includes(C)||typeof U=="number"&&String(U).includes(C)||Array.isArray(U)&&U.some(ze=>ze!=null&&(typeof ze=="string"?ze.toLowerCase().includes(C):typeof ze=="object"?Object.values(ze).some(Re=>typeof Re=="string"&&Re.toLowerCase().includes(C)):!1)))return!0}return!1})}for(const C of ve.value){if(!dt(C))continue;const V=Oe.value[C.key];V&&(E=E.filter(P=>xe(P,C,V)))}return E});function dt(E){return pt.has(E.operator)?!0:E.value==null||typeof E.value=="string"&&E.value===""||Array.isArray(E.value)&&E.value.length===0?!1:E.value instanceof Date?!isNaN(E.value.getTime()):!(typeof E.value=="object"&&!Array.isArray(E.value)&&E.value.min==null&&E.value.max==null)}function xe(E,C,V){const P=E?.[C.key],U=C.value,ze=C.operator;if(ze==="is_empty")return Z(P);if(ze==="is_not_empty")return!Z(P);const Re=V.type;if(Re==="text"||Re==="arrayText"){const De=Re==="arrayText"&&Array.isArray(P)?P.filter(tt=>tt!=null).map(String).join(" "):P!=null?String(P):"",re=String(U).toLowerCase(),Ge=De.toLowerCase();switch(ze){case"contains":return Ge.includes(re);case"not_contains":return!Ge.includes(re);case"equals":return Ge===re;case"not_equals":return Ge!==re;case"starts_with":return Ge.startsWith(re);case"ends_with":return Ge.endsWith(re);default:return!0}}if(Re==="select")switch(ze){case"is_any_of":return U.includes(P);case"is_none_of":return!U.includes(P);default:return!0}if(Re==="range"||Re==="int"){const De=typeof P=="number"?P:Number(P);if(typeof De!="number"||isNaN(De))return!1;if(ze==="between"){const Ge=U?.min!=null?Number(U.min):null,tt=U?.max!=null?Number(U.max):null,wt=Ge!=null&&!isNaN(Ge)?Ge:null,vt=tt!=null&&!isNaN(tt)?tt:null;return(wt==null||De>=wt)&&(vt==null||De<=vt)}const re=typeof U=="number"&&!isNaN(U)?U:Number(U);if(ze==="contains"||ze==="not_contains"){const Ge=String(De),tt=String(U??"").toLowerCase(),wt=Ge.toLowerCase().includes(tt);return ze==="contains"?wt:!wt}if(typeof re!="number"||isNaN(re))return!1;switch(ze){case"eq":return De===re;case"neq":return De!==re;case"gt":return De>re;case"gte":return De>=re;case"lt":return De<re;case"lte":return De<=re;default:return!0}}if(Re==="arraySelect"){if(!Array.isArray(P))return!1;const De=P.filter(re=>re!=null).map(re=>V.displayKey&&typeof re=="object"?re[V.displayKey]:String(re));switch(ze){case"contains_any":return De.some(re=>U.includes(re));case"contains_all":return U.every(re=>De.includes(re));case"not_contains_any":return!De.some(re=>U.includes(re));default:return!0}}if(Re==="date"){const De=Ue(U);if(!De||isNaN(De.getTime()))return!1;const re=Ue(P);if(!re||isNaN(re.getTime()))return!1;const Ge=X(re),tt=X(De);switch(ze){case"eq":return Ge===tt;case"before":return Ge<tt;case"after":return Ge>tt;default:return!0}}if(Re==="boolean"){const De=P===!0||P==="true"||P===1,re=P===!1||P==="false"||P===0;switch(ze){case"is_true":return De;case"is_false":return re;default:return!0}}return!0}function Ue(E){if(E==null)return null;if(E instanceof Date)return isNaN(E.getTime())?null:E;if(typeof E=="number")return new Date(E>1e10?E:E*1e3);if(typeof E=="string"){const C=new Date(E);return isNaN(C.getTime())?null:C}return null}function X(E){const C=E.getFullYear(),V=String(E.getMonth()+1).padStart(2,"0"),P=String(E.getDate()).padStart(2,"0");return`${C}-${V}-${P}`}function Z(E){return!!(E==null||E===""||E==="NULL"||Array.isArray(E)&&E.length===0||Array.isArray(E)&&E.every(C=>C==null))}e.watch(qe,E=>_e("update:modelValue",E),{immediate:!0}),e.watch(()=>A.data,()=>{ve.value=[],ue.value="",ee.value=!1,yt()});function j(E){return E.replace(/_/g," ").replace(/([a-z])([A-Z])/g,"$1 $2").replace(/\b\w/g,C=>C.toUpperCase())}function ie(){const E=C=>{if(C==null)return C;if(C instanceof Date)return{_type:"Date",value:C.toISOString(),local:C.toLocaleDateString()};if(Array.isArray(C))return C.map(E);if(typeof C=="object"&&!Array.isArray(C)){const V={};for(const P of Object.keys(C))V[P]=E(C[P]);return V}return C};return{globalSearch:ue.value,rows:ve.value.map(C=>({key:C.key,operator:C.operator,value:E(C.value),defType:Oe.value[C.key]?.type,defFilterMode:Oe.value[C.key]?.filterMode})),filteredCount:qe.value?.length??0}}return Ce({getDebugState:ie}),(E,C)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-filter",{"dss-filter--unstyled":Le.value.unstyled}])},[e.createElementVNode("div",{class:"dss-filter-global",ref_key:"globalRef",ref:S},[e.createElementVNode("div",Bm,[C[15]||(C[15]=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:"Search across all fields...",value:ue.value,onInput:ft},null,40,Mm),ue.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-filter-global-clear",onClick:C[0]||(C[0]=V=>ue.value="")},"×")):e.createCommentVNode("",!0),e.createElementVNode("button",{class:e.normalizeClass(["dss-filter-funnel-btn",{active:ee.value||ve.value.length>0}]),onClick:C[1]||(C[1]=V=>ee.value=!ee.value),type:"button",title:ee.value?"Close advanced filter":"Open advanced filter"},[C[14]||(C[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)),ve.value.length>0?(e.openBlock(),e.createElementBlock("span",$m,e.toDisplayString(ve.value.length),1)):e.createCommentVNode("",!0)],10,_m)]),ee.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-advanced-popup",onClick:C[13]||(C[13]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",Tm,[ve.value.length===0?(e.openBlock(),e.createElementBlock("div",Lm," No filter conditions are applied to this view ")):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ve.value,(V,P)=>(e.openBlock(),e.createElementBlock("div",{key:V.id,class:"dss-filter-row"},[e.createElementVNode("span",Hm,e.toDisplayString(P===0?"Where":"And"),1),e.createElementVNode("div",Am,[e.createElementVNode("button",{class:"dss-filter-trigger",onClick:e.withModifiers(U=>ge(`${V.id}:field`),["stop"])},[e.createElementVNode("span",Rm,e.toDisplayString(at(V.key)),1),C[16]||(C[16]=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,Dm),de.value===`${V.id}:field`?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-popup",onClick:C[3]||(C[3]=e.withModifiers(()=>{},["stop"]))},[e.withDirectives(e.createElementVNode("input",{type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":C[2]||(C[2]=U=>ne.value=U),placeholder:"Search attributes..."},null,512),[[e.vModelText,ne.value]]),e.createElementVNode("ul",Fm,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ze.value,U=>(e.openBlock(),e.createElementBlock("li",{key:U.key,class:"dss-filter-popup-item",onClick:ze=>Ct(V,U.key)},e.toDisplayString(U.label),9,Im))),128)),Ze.value.length===0?(e.openBlock(),e.createElementBlock("li",zm,"No match")):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)]),$t(V)==="contain"||$t(V)==="date"?(e.openBlock(),e.createElementBlock("div",Pm,[e.createElementVNode("button",{class:"dss-filter-trigger",onClick:e.withModifiers(U=>ge(`${V.id}:op`),["stop"])},[e.createElementVNode("span",Zm,e.toDisplayString(Ot(V.operator)),1),C[17]||(C[17]=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,Om),de.value===`${V.id}:op`?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-popup",onClick:C[4]||(C[4]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("ul",Wm,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(on(V),U=>(e.openBlock(),e.createElementBlock("li",{key:U.value,class:e.normalizeClass(["dss-filter-popup-item",{selected:V.operator===U.value}]),onClick:ze=>te(V,U.value)},e.toDisplayString(U.label),11,qm))),128))])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),Et(V.operator)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Um,[$t(V)==="string"?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,type:"text",class:"dss-filter-value-input",placeholder:"Enter value...","onUpdate:modelValue":U=>V.value=U},null,8,Xm)),[[e.vModelText,V.value]]):$t(V)==="date"?(e.openBlock(),e.createElementBlock("div",Ym,[e.createVNode(zo,{mode:"single",modelValue:V.value,"onUpdate:modelValue":U=>V.value=U},null,8,["modelValue","onUpdate:modelValue"])])):lt(V)==="text"?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:2,type:"text",class:"dss-filter-value-input",placeholder:"Enter value...","onUpdate:modelValue":U=>V.value=U},null,8,jm)),[[e.vModelText,V.value]]):lt(V)==="number"?(e.openBlock(),e.createElementBlock("input",{key:3,type:"number",class:"dss-filter-value-input",placeholder:"Enter value...",value:V.value,onInput:U=>$e(V,U),step:Oe.value[V.key]?.type==="int"?1:void 0},null,40,Km)):lt(V)==="between"?(e.openBlock(),e.createElementBlock("div",Gm,[e.createElementVNode("input",{type:"number",class:"dss-filter-value-input",placeholder:"Min",value:V.value?.min,onInput:U=>fe(V,"min",U),step:Oe.value[V.key]?.type==="int"?1:void 0},null,40,Qm),C[18]||(C[18]=e.createElementVNode("span",{class:"dss-filter-between-sep"},"and",-1)),e.createElementVNode("input",{type:"number",class:"dss-filter-value-input",placeholder:"Max",value:V.value?.max,onInput:U=>fe(V,"max",U),step:Oe.value[V.key]?.type==="int"?1:void 0},null,40,Jm)])):lt(V)==="multiselect"?(e.openBlock(),e.createElementBlock("div",e2,[e.createElementVNode("button",{class:"dss-filter-trigger",onClick:e.withModifiers(U=>ge(`${V.id}:val`),["stop"])},[e.createElementVNode("span",n2,e.toDisplayString(Xe(V)),1),C[19]||(C[19]=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,t2),de.value===`${V.id}:val`?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-popup",onClick:C[6]||(C[6]=e.withModifiers(()=>{},["stop"]))},[Lt(V).length>6?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":C[5]||(C[5]=U=>ne.value=U),placeholder:"Search..."},null,512)),[[e.vModelText,ne.value]]):e.createCommentVNode("",!0),e.createElementVNode("ul",l2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Bt(V),U=>(e.openBlock(),e.createElementBlock("li",{key:U,class:"dss-filter-popup-item",onClick:ze=>Ne(V,U)},[e.createElementVNode("input",{type:"checkbox",checked:(V.value||[]).includes(U),tabindex:"-1"},null,8,a2),e.createElementVNode("span",null,e.toDisplayString(U),1)],8,o2))),128)),Bt(V).length===0?(e.openBlock(),e.createElementBlock("li",s2," No match ")):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)])),e.createElementVNode("button",{class:"dss-filter-row-remove",onClick:U=>Yt(V.id)},[...C[20]||(C[20]=[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,r2)]))),128)),e.createElementVNode("div",i2,[e.createElementVNode("div",c2,[e.createElementVNode("button",{class:"dss-filter-add-btn",onClick:C[7]||(C[7]=e.withModifiers(V=>ge("add"),["stop"]))}," Add filter "),de.value==="add"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-popup dss-filter-add-popup",onClick:C[12]||(C[12]=e.withModifiers(()=>{},["stop"]))},[we.value&&!He.value&&!ne.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.withDirectives(e.createElementVNode("input",{type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":C[8]||(C[8]=V=>ne.value=V),placeholder:"Search attributes..."},null,512),[[e.vModelText,ne.value]]),e.createElementVNode("ul",u2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(xt.value,V=>(e.openBlock(),e.createElementBlock("li",{key:V.label,class:"dss-filter-popup-item dss-filter-popup-group",onClick:P=>He.value=V},[e.createElementVNode("span",null,e.toDisplayString(V.label),1),C[21]||(C[21]=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,d2))),128)),Tt.value.length>0?(e.openBlock(),e.createElementBlock("li",m2)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Tt.value,V=>(e.openBlock(),e.createElementBlock("li",{key:V.key,class:"dss-filter-popup-item",onClick:P=>Zt(V.key)},e.toDisplayString(V.label),9,p2))),128))])],64)):He.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",{class:"dss-filter-popup-back",onClick:C[9]||(C[9]=V=>He.value=null)},[C[22]||(C[22]=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(He.value.label),1)]),e.withDirectives(e.createElementVNode("input",{type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":C[10]||(C[10]=V=>ne.value=V),placeholder:"Search attributes..."},null,512),[[e.vModelText,ne.value]]),e.createElementVNode("ul",f2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ut.value,V=>(e.openBlock(),e.createElementBlock("li",{key:V.key,class:"dss-filter-popup-item",onClick:P=>Zt(V.key)},e.toDisplayString(V.label),9,v2))),128)),ut.value.length===0?(e.openBlock(),e.createElementBlock("li",g2,"No match")):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":C[11]||(C[11]=V=>ne.value=V),placeholder:"Search attributes..."},null,512),[[e.vModelText,ne.value]]),e.createElementVNode("ul",h2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ze.value,V=>(e.openBlock(),e.createElementBlock("li",{key:V.key,class:"dss-filter-popup-item",onClick:P=>Zt(V.key)},e.toDisplayString(V.label),9,y2))),128)),Ze.value.length===0?(e.openBlock(),e.createElementBlock("li",C2,"No match ")):e.createCommentVNode("",!0)])],64))])):e.createCommentVNode("",!0)]),ve.value.length>0?(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-filter-clear-all",onClick:We}," Clear all filters ")):e.createCommentVNode("",!0)])])])):e.createCommentVNode("",!0)],512)],2))}}),w2={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"}},x2={firstPage:"First page",previousPage:"Previous page",nextPage:"Next page",lastPage:"Last page",rowsPerPage:"Rows per page",searchPlaceholder:"Search...",downloadPdf:"Download PDF",downloadExcel:"Download Excel",columnVisibility:"Columns Visibility",clearFilter:"Clear",search:"Search...",filterFrom:"From:",filterTo:"To:",dateFormat:"dd/mm/yyyy"},E2={selectDate:"Select Date",selectRange:"Select range",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"}},V2={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"}},oo={chart:w2,table:x2,datepicker:E2,textEditor:V2},N2={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"}},S2={firstPage:"Première page",previousPage:"Page précédente",nextPage:"Page suivante",lastPage:"Dernière page",rowsPerPage:"Lignes par page",searchPlaceholder:"Rechercher...",downloadPdf:"Télécharger PDF",downloadExcel:"Télécharger Excel",columnVisibility:"Visibilité des colonnes",clearFilter:"Effacer",search:"Rechercher...",filterFrom:"Du :",filterTo:"Au :",dateFormat:"jj/mm/aaaa"},B2={selectDate:"Sélectionner une date",selectRange:"Sélectionner une plage",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"}},M2={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"}},ao={chart:N2,table:S2,datepicker:B2,textEditor:M2},_2={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"}},$2={firstPage:"Eerste pagina",previousPage:"Vorige pagina",nextPage:"Volgende pagina",lastPage:"Laatste pagina",rowsPerPage:"Rijen per pagina",searchPlaceholder:"Zoeken...",downloadPdf:"PDF downloaden",downloadExcel:"Excel downloaden",columnVisibility:"Kolommen weer te geven",clearFilter:"Wissen",search:"Zoeken...",filterFrom:"Van:",filterTo:"Tot:",dateFormat:"dd-mm-jjjj"},T2={selectDate:"Selecteer datum",selectRange:"Selecteer bereik",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"}},L2={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"}},so={chart:_2,table:$2,datepicker:T2,textEditor:L2},Do={en:oo,fr:ao,nl:so};function H2(F){if(!F||!F.global)return;const Ce=F.global.availableLocales||[];Object.keys(Do).forEach(z=>{Ce.includes(z)&&F.global.mergeLocaleMessage(z,Do[z])})}const Ro={en:{textEditor:oo.textEditor},fr:{textEditor:ao.textEditor},nl:{textEditor:so.textEditor}};function A2(F){if(!F||!F.global)return;const Ce=F.global.availableLocales||[];Object.keys(Ro).forEach(z=>{Ce.includes(z)&&F.global.mergeLocaleMessage(z,Ro[z])})}const Fo={en:{table:oo.table},fr:{table:ao.table},nl:{table:so.table}};function D2(F){if(!F||!F.global)return;const Ce=F.global.availableLocales||[];Object.keys(Fo).forEach(z=>{Ce.includes(z)&&F.global.mergeLocaleMessage(z,Fo[z])})}const Io={en:{datepicker:oo.datepicker},fr:{datepicker:ao.datepicker},nl:{datepicker:so.datepicker}};function R2(F){if(!F||!F.global)return;const Ce=F.global.availableLocales||[];Object.keys(Io).forEach(z=>{Ce.includes(z)&&F.global.mergeLocaleMessage(z,Io[z])})}const F2={en:{...oo},fr:{...ao},nl:{...so}};lo.createI18n({legacy:!1,locale:"en",fallbackLocale:"en",messages:F2});exports.DSSChart=Mi;exports.DSSChartMessages=Do;exports.DSSColorPicker=J1;exports.DSSConfetti=Sm;exports.DSSDatepicker=zo;exports.DSSDatepickerMessages=Io;exports.DSSDnd=Vm;exports.DSSFilter=b2;exports.DSSLoader=mm;exports.DSSModal=Ao;exports.DSSSkeleton=pm;exports.DSSTable=Uc;exports.DSSTableMessages=Fo;exports.DSSTextEditor=R1;exports.DSSTextEditorMessages=Ro;exports.addDSSChartTranslations=H2;exports.addDSSDatepickerTranslations=R2;exports.addDSSTableTranslations=D2;exports.addDSSTextEditorTranslations=A2;
117
+ `,document.body.appendChild(We),He=We}function ge(te,Te){He&&(He.style.left=`${te-Ie}px`,He.style.top=`${Te-O}px`)}function yt(te){te.classList.add("dss-dnd-item--dragging"),te.style.background=se.value.dragSourceBackground,te.style.borderColor=se.value.dragSourceBorder,te.style.transform="scale(0.97)"}function St(te){te.classList.remove("dss-dnd-item--dragging"),te.style.background="",te.style.borderColor="",te.style.transform=""}function at(te,Te){return document.elementFromPoint(te,Te)?.closest(".dss-dnd-column-body")??null}function $t(te,Te){return!!document.elementFromPoint(te,Te)?.closest("[data-dss-dnd-delete-zone]")}function Ot(te,Te){if(k.value&&$t(te,Te)){ve.value=!0,ue.value=null,de.value=-1;return}ve.value=!1;const fe=at(te,Te),Ne=fe?.getAttribute("data-column")??null;if(!Ne){ue.value=null,de.value=-1;return}ue.value=Ne;const We=fe.querySelectorAll(".dss-dnd-item:not(.dss-dnd-item--dragging)");let ft=We.length;for(let qe=0;qe<We.length;qe++){const dt=We[qe].getBoundingClientRect();if(Te<dt.top+dt.height/2){ft=qe;break}}de.value=ft}function on(te){te.preventDefault(),ge(te.clientX,te.clientY),!S&&(S=requestAnimationFrame(()=>{S=null,Ot(te.clientX,te.clientY)}))}function Et(te){window.removeEventListener("pointermove",on),window.removeEventListener("pointerup",Et),window.removeEventListener("pointercancel",Et),Ae?.releasePointerCapture?.(te.pointerId),St(Ae),Ae=null;const Te=k.value&&$t(te.clientX,te.clientY);if(p.value&&Te)A("delete",{item:p.value});else{const Ne=at(te.clientX,te.clientY)?.getAttribute("data-column")??null;if(p.value&&Ne){const We=p.value[z.columnKey],ft=Ne,dt=(xt.value[ft]||[]).filter(Z=>Z[z.itemKey]!==p.value[z.itemKey]),xe=Math.max(0,Math.min(de.value,dt.length)),Ue=ut(ft,xe),X=p.value[z.itemKey];A("move",{item:p.value,from:We,to:ft,position:Ue,index:xe}),ne&&clearTimeout(ne),ee.value={id:X,from:We,to:ft},ne=setTimeout(()=>{ee.value=null},3500)}}He&&(He.remove(),He=null),rt!==null&&(document.body.style.cursor=rt,rt=""),Ct()}function lt(te,Te){te.preventDefault();const fe=te.target.closest(".dss-dnd-item");if(!fe)return;const Ne=fe.getBoundingClientRect();Ie=te.clientX-Ne.left,O=te.clientY-Ne.top,rt=document.body.style.cursor,document.body.style.cursor="grabbing",p.value=Te,Ae=fe,Ze(fe,te.clientX,te.clientY),requestAnimationFrame(()=>yt(fe)),fe.setPointerCapture?.(te.pointerId),window.addEventListener("pointermove",on),window.addEventListener("pointerup",Et,{once:!0}),window.addEventListener("pointercancel",Et,{once:!0})}function je(){Oe&&(window.removeEventListener("pointermove",Dt),window.removeEventListener("pointerup",Lt),window.removeEventListener("pointercancel",Lt),Oe=null)}function Dt(te){if(!Oe||te.pointerId!==Oe.pointerId)return;const Te=te.clientX-Oe.startX,fe=te.clientY-Oe.startY;if(Math.abs(Te)>=we||Math.abs(fe)>=we){const Ne=Oe.item;je(),lt(te,Ne)}}function Lt(te){!Oe||te.pointerId!==Oe.pointerId||je()}function Bt(te,Te){je(),Oe={item:Te,startX:te.clientX,startY:te.clientY,pointerId:te.pointerId},window.addEventListener("pointermove",Dt),window.addEventListener("pointerup",Lt),window.addEventListener("pointercancel",Lt)}function Xe(te,Te){se.value.useHandle||Bt(te,Te)}function Zt(te,Te){Bt(te,Te)}function Yt(){S&&(cancelAnimationFrame(S),S=null)}function Ct(){Yt(),p.value=null,ue.value=null,ve.value=!1,de.value=-1}return e.onBeforeUnmount(()=>{Yt(),je(),ne&&clearTimeout(ne),He&&(He.remove(),He=null)}),(te,Te)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-dnd",{"dss-dnd--unstyled":se.value.unstyled}]),style:e.normalizeStyle(pt.value)},[k.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":ve.value}]),"data-dss-dnd-delete-zone":""},[e.renderSlot(te.$slots,"delete-zone",{isDragging:!!p.value,isOver:ve.value})],2),[[e.vShow,!!p.value||se.value.deleteZoneAlwaysVisible]])])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(F.columns,fe=>(e.openBlock(),e.createElementBlock("div",{key:fe.value,class:e.normalizeClass(["dss-dnd-column",[{"dss-dnd-column--drag-over":ue.value==fe.value},fe.class||""]])},[se.value.showHeader?(e.openBlock(),e.createElementBlock("div",fm,[e.renderSlot(te.$slots,"column-header",{column:fe,items:xt.value[fe.value]||[]},()=>[e.createElementVNode("span",vm,e.toDisplayString(fe.title||fe.value),1),e.createElementVNode("span",gm,e.toDisplayString((xt.value[fe.value]||[]).length),1)])])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"dss-dnd-column-body","data-column":fe.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Tt.value[fe.value],Ne=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:Ne.key},[Ne.type==="indicator"?(e.openBlock(),e.createElementBlock("div",ym)):(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["dss-dnd-item",{"dss-dnd-item--dragging":Ne.isDragged,"dss-dnd-item--no-handle":!se.value.useHandle}]),onPointerdown:We=>Xe(We,Ne.item)},[se.value.useHandle?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-dnd-handle",onPointerdown:e.withModifiers(We=>Zt(We,Ne.item),["stop"])},[e.renderSlot(te.$slots,"handle",{},()=>[Te[0]||(Te[0]=e.createElementVNode("span",{class:"dss-dnd-handle-icon"},"⠿",-1))])],40,km)):e.createCommentVNode("",!0),e.createElementVNode("div",bm,[e.renderSlot(te.$slots,"item",{item:Ne.item,column:fe,justDropped:ee.value?.id===Ne.item[F.itemKey],droppedFrom:ee.value?.id===Ne.item[F.itemKey]?ee.value.from:null,droppedTo:ee.value?.id===Ne.item[F.itemKey]?ee.value.to:null},()=>[e.createElementVNode("div",wm,e.toDisplayString(Ne.item[F.itemKey]),1)])])],42,Cm))],64))),128)),(xt.value[fe.value]||[]).length===0&&ue.value!=fe.value?(e.openBlock(),e.createElementBlock("div",xm,[e.renderSlot(te.$slots,"empty",{column:fe},()=>[Te[1]||(Te[1]=e.createElementVNode("span",{class:"dss-dnd-empty-text"},"No items",-1))])])):e.createCommentVNode("",!0)],8,hm)],2))),128))],6))}}),Nm={name:"DSSConfetti"},Sm=Object.assign(Nm,{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(F){const Ce=F,z=e.ref(null),A=e.ref(!1);let _e=[],k=null,$e=null;function se(ee,S){const ne=[];for(let He=0;He<Ce.count;He++)ne.push(pt(ee));return ne}function pt(ee,S){return{x:Math.random()*ee,y:-Math.random()*150-20,r:Math.random()*8+3,d:Math.random()*50,color:Ce.colors[Math.floor(Math.random()*Ce.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 p(ee,S,ne,He){ee.clearRect(0,0,S,ne);for(const Ae of _e)ee.save(),ee.globalAlpha=Ae.opacity*He,ee.beginPath(),ee.lineWidth=Ae.r,ee.strokeStyle=Ae.color,ee.moveTo(Ae.x+Ae.tilt+Ae.r/2,Ae.y),ee.lineTo(Ae.x+Ae.tilt,Ae.y+Ae.tilt+Ae.r/2),ee.stroke(),ee.restore()}function ue(ee,S,ne){const He=.3+ne*.7;for(let Ae=0;Ae<_e.length;Ae++){const Ie=_e[Ae];Ie.tiltAngle+=Ie.tiltInc,Ie.y+=Ie.speed*He,Ie.x+=Math.sin(Ie.d)*.5*He,Ie.tilt=Math.sin(Ie.tiltAngle)*15,ne>=.99&&Ie.y>S+20&&(_e[Ae]=pt(ee))}}function ve(){A.value=!0,e.nextTick(()=>{const ee=z.value;if(!ee)return;const S=ee.getContext("2d"),ne=ee.parentElement;if(!ne)return;const He=ne.getBoundingClientRect();ee.width=He.width,ee.height=He.height,_e=se(ee.width,ee.height);const Ae=Date.now(),Ie=Ae+Ce.duration,O=()=>{const rt=Date.now(),Oe=rt-Ae;if(rt<Ie){let we=1;Oe>Ce.fadeStart&&(we=1-(Oe-Ce.fadeStart)/(Ce.duration-Ce.fadeStart)),p(S,ee.width,ee.height,we),ue(ee.width,ee.height,we),k=requestAnimationFrame(O)}else de()};O()})}function de(){k&&(cancelAnimationFrame(k),k=null),_e=[],A.value=!1}return e.watch(()=>Ce.trigger,ee=>{ee&&($e&&clearTimeout($e),$e=setTimeout(ve,Ce.delay))},{immediate:!0}),e.onBeforeUnmount(()=>{de(),$e&&clearTimeout($e)}),(ee,S)=>A.value?(e.openBlock(),e.createElementBlock("canvas",{key:0,ref_key:"canvasRef",ref:z,class:"dss-confetti-canvas"},null,512)):e.createCommentVNode("",!0)}}),Bm={class:"dss-filter-global-inner"},Mm=["value"],_m=["title"],$m={key:0,class:"dss-filter-funnel-badge"},Tm={class:"dss-filter-panel"},Lm={key:0,class:"dss-filter-empty"},Hm={class:"dss-filter-row-prefix"},Am={class:"dss-filter-cell"},Dm=["onClick"],Rm={class:"dss-filter-trigger-text"},Fm={class:"dss-filter-popup-list"},Im=["onClick"],zm={key:0,class:"dss-filter-popup-empty"},Pm={key:0,class:"dss-filter-cell"},Om=["onClick"],Zm={class:"dss-filter-trigger-text"},Wm={class:"dss-filter-popup-list"},qm=["onClick"],Um={key:1,class:"dss-filter-cell dss-filter-cell--value"},Xm=["onUpdate:modelValue"],Ym={key:1,class:"dss-filter-date-wrap"},jm=["onUpdate:modelValue"],Km=["value","onInput","step"],Gm={key:4,class:"dss-filter-between"},Qm=["value","onInput","step"],Jm=["value","onInput","step"],e2={key:5,class:"dss-filter-multiselect"},t2=["onClick"],n2={class:"dss-filter-trigger-text"},l2={class:"dss-filter-popup-list dss-filter-popup-list--check"},o2=["onClick"],a2=["checked"],s2={key:0,class:"dss-filter-popup-empty"},r2=["onClick"],i2={class:"dss-filter-foot"},c2={class:"dss-filter-cell"},u2={class:"dss-filter-popup-list"},d2=["onClick"],m2={key:0,class:"dss-filter-popup-divider"},p2=["onClick"],f2={class:"dss-filter-popup-list"},v2=["onClick"],g2={key:0,class:"dss-filter-popup-empty"},h2={class:"dss-filter-popup-list"},y2=["onClick"],C2={key:0,class:"dss-filter-popup-empty"},k2={name:"DSSFilter"},b2=Object.assign(k2,{props:{data:{type:Array,required:!0},modelValue:{type:Array,default:void 0},exclude:{type:Array,default:()=>[]},config:{type:Object,default:()=>({})},options:{type:Object,default:()=>({})}},emits:["update:modelValue"],setup(F,{expose:Ce,emit:z}){const A=F,_e=z,k={unstyled:!1,maxUniqueForSelect:30,maxUniqueForEnum:15},$e=e.computed(()=>({...k,...A.options})),se={text:[{value:"contains",label:"contains"},{value:"not_contains",label:"does not contain"},{value:"equals",label:"equals"},{value:"not_equals",label:"does not equal"},{value:"starts_with",label:"starts with"},{value:"ends_with",label:"ends with"},{value:"is_empty",label:"is empty"},{value:"is_not_empty",label:"is not empty"}],select:[{value:"is_any_of",label:"is any of"},{value:"is_none_of",label:"is none of"},{value:"is_empty",label:"is empty"},{value:"is_not_empty",label:"is not empty"}],range:[{value:"eq",label:"="},{value:"neq",label:"≠"},{value:"gt",label:">"},{value:"gte",label:"≥"},{value:"lt",label:"<"},{value:"lte",label:"≤"},{value:"between",label:"between"},{value:"is_empty",label:"is empty"},{value:"is_not_empty",label:"is not empty"}],int:[{value:"eq",label:"="},{value:"neq",label:"≠"},{value:"gt",label:">"},{value:"gte",label:"≥"},{value:"lt",label:"<"},{value:"lte",label:"≤"},{value:"between",label:"between"},{value:"is_empty",label:"is empty"},{value:"is_not_empty",label:"is not empty"}],arraySelect:[{value:"contains_any",label:"contains any of"},{value:"contains_all",label:"contains all of"},{value:"not_contains_any",label:"does not contain"},{value:"is_empty",label:"is empty"},{value:"is_not_empty",label:"is not empty"}],arrayText:[{value:"contains",label:"contains"},{value:"not_contains",label:"does not contain"},{value:"is_empty",label:"is empty"},{value:"is_not_empty",label:"is not empty"}],date:[{value:"eq",label:"on"},{value:"before",label:"before"},{value:"after",label:"after"},{value:"is_empty",label:"is empty"},{value:"is_not_empty",label:"is not empty"}],boolean:[{value:"is_true",label:"is true"},{value:"is_false",label:"is false"},{value:"is_empty",label:"is empty"},{value:"is_not_empty",label:"is not empty"}]},pt=new Set(["is_empty","is_not_empty","is_true","is_false"]),p=["label","name","title","keyword","full_name","value","text"],ue=e.ref(""),ve=e.ref([]),de=e.ref(null),ee=e.ref(!1),S=e.ref(null),ne=e.ref(""),He=e.ref(null);let Ae=1;function Ie(E){const C=E.find(V=>V&&typeof V=="object");if(!C)return null;for(const V of p)if(V in C&&typeof C[V]=="string")return V;return Object.keys(C).find(V=>typeof C[V]=="string")||null}function O(E,C){const V=C.filter(P=>P!=null&&P!=="NULL");if(V.length===0)return null;if(V.every(P=>Array.isArray(P))){const P=V.flatMap(ze=>ze).filter(ze=>ze!=null);return P.length===0?null:typeof P.find(ze=>ze!=null)=="object"?"arraySelect":"arrayText"}return V.every(P=>typeof P=="boolean")?"boolean":V.every(P=>typeof P=="number")?new Set(V).size<=$e.value.maxUniqueForEnum?"select":"range":V.every(P=>typeof P=="string")?new Set(V).size<=$e.value.maxUniqueForSelect?"select":"text":V.some(P=>typeof P=="object"&&!Array.isArray(P))?null:"text"}const rt=e.computed(()=>{if(!A.data?.length)return[];const E=new Set;for(const U of A.data)if(U&&typeof U=="object")for(const ze of Object.keys(U))E.add(ze);const C=new Set(A.exclude),V=[];for(const U of E){if(C.has(U))continue;const ze=A.config[U]||{},Re=A.data.map(wt=>wt?.[U]),De=ze.type||O(U,Re);if(!De)continue;const re=ze.filterMode||"contain",Ge=re==="date"?"date":re==="string"?"text":De,tt={key:U,label:ze.label||j(U),type:Ge,filterMode:re};if(De==="select"){const wt=Re.filter(vt=>vt!=null&&vt!=="NULL");tt.uniqueValues=[...new Set(wt)].sort((vt,Je)=>typeof vt=="number"&&typeof Je=="number"?vt-Je:String(vt).localeCompare(String(Je)))}else if(De==="range"||De==="int"){const wt=Re.filter(vt=>typeof vt=="number");tt.min=Math.min(...wt),tt.max=Math.max(...wt)}else if(De==="arraySelect"){const wt=ze.displayKey||Ie(Re.flatMap(Je=>Array.isArray(Je)?Je:[]));tt.displayKey=wt;const vt=Re.flatMap(Je=>Array.isArray(Je)?Je:[]).filter(Je=>Je!=null).map(Je=>wt&&typeof Je=="object"?Je[wt]:String(Je)).filter(Je=>Je!=null&&Je!=="");tt.uniqueValues=[...new Set(vt)].sort((Je,vn)=>String(Je).localeCompare(String(vn)))}V.push(tt)}const P=A.config._order;return P&&V.sort((U,ze)=>{const Re=P.indexOf(U.key),De=P.indexOf(ze.key);return Re===-1&&De===-1?0:Re===-1?1:De===-1?-1:Re-De}),V}),Oe=e.computed(()=>{const E={};for(const C of rt.value)E[C.key]=C;return E}),we=e.computed(()=>Array.isArray(A.config.groups)&&A.config.groups.length>0),xt=e.computed(()=>{if(!we.value)return[];const E=new Set(rt.value.map(C=>C.key));return A.config.groups.map(C=>({...C,keys:C.keys.filter(V=>E.has(V))})).filter(C=>C.keys.length>0)}),Tt=e.computed(()=>{if(!we.value)return[];const E=new Set(A.config.groups.flatMap(C=>C.keys));return rt.value.filter(C=>!E.has(C.key))}),ut=e.computed(()=>{if(!He.value)return[];const E=new Set(He.value.keys),C=rt.value.filter(P=>E.has(P.key));if(!ne.value)return C;const V=ne.value.toLowerCase();return C.filter(P=>P.label.toLowerCase().includes(V))}),Ze=e.computed(()=>{if(!ne.value)return rt.value;const E=ne.value.toLowerCase();return rt.value.filter(C=>C.label.toLowerCase().includes(E))});function ge(E){de.value===E?yt():(de.value=E,ne.value="",He.value=null)}function yt(){de.value=null,ne.value="",He.value=null}function St(E){const C=E.target.closest(".dss-datepicker__overlay, .dss-datepicker__dropdown");de.value&&!C&&!E.target.closest(".dss-filter-popup")&&!E.target.closest(".dss-filter-trigger")&&!E.target.closest(".dss-filter-add-btn")&&yt(),ee.value&&S.value&&!S.value.contains(E.target)&&(C||(ee.value=!1))}e.onMounted(()=>document.addEventListener("click",St)),e.onBeforeUnmount(()=>document.removeEventListener("click",St));function at(E){return Oe.value[E]?.label||j(E)}function $t(E){return Oe.value[E.key]?.filterMode||"contain"}function Ot(E){for(const C of Object.values(se)){const V=C.find(P=>P.value===E);if(V)return V.label}return E}function on(E){const C=Oe.value[E.key];return se[C?.type]||se.text}function Et(E){return pt.has(E)}function lt(E){const C=Oe.value[E.key];return C?C.type==="date"?"date":C.type==="boolean"?"boolean":C.type==="text"||C.type==="arrayText"?"text":C.type==="select"||C.type==="arraySelect"?"multiselect":C.type==="range"||C.type==="int"?E.operator==="between"?"between":"number":"text":"text"}function je(E){return se[E]?.[0]?.value||"contains"}function Dt(E,C){return pt.has(C)||E==="date"?null:E==="select"||E==="arraySelect"?[]:(E==="range"||E==="int")&&C==="between"?{min:null,max:null}:E==="range"||E==="int"?null:""}function Lt(E){return Oe.value[E.key]?.uniqueValues||[]}function Bt(E){const C=Lt(E);if(!ne.value)return C;const V=ne.value.toLowerCase();return C.filter(P=>String(P).toLowerCase().includes(V))}function Xe(E){const C=E.value;return!C||C.length===0?"Select...":C.length<=2?C.join(", "):`${C.length} selected`}function Zt(E){const C=Oe.value[E],V=C?.filterMode||"contain",P=C?.type||"text",U=V==="string"?"contains":je(P);ve.value.push(e.reactive({id:Ae++,key:E,operator:U,value:Dt(P,U)})),yt()}function Yt(E){ve.value=ve.value.filter(C=>C.id!==E)}function Ct(E,C){const P=Oe.value[C]?.type||"text";E.key=C,E.operator=je(P),E.value=Dt(P,E.operator),yt()}function te(E,C){const V=lt(E);E.operator=C;const P=lt(E);if(V!==P||pt.has(C)){const U=Oe.value[E.key];E.value=Dt(U?.type||"text",C)}yt()}function Te(E,C){const V=C.target.value;E.value=V===""?null:Number(V)}function fe(E,C,V){const P=V.target.value,U=P===""?null:Number(P);(!E.value||typeof E.value!="object")&&(E.value={min:null,max:null}),E.value={...E.value,[C]:isNaN(U)?null:U}}function Ne(E,C){const V=E.value||[],P=V.indexOf(C);E.value=P>=0?V.filter(U=>U!==C):[...V,C]}function We(){ve.value=[],ue.value="",yt()}function ft(E){ue.value=E.target.value}const qe=e.computed(()=>{if(!A.data)return[];let E=A.data;if(ue.value){const C=ue.value.toLowerCase();E=E.filter(V=>{for(const P of Object.keys(V)){const U=V[P];if(typeof U=="string"&&U.toLowerCase().includes(C)||typeof U=="number"&&String(U).includes(C)||Array.isArray(U)&&U.some(ze=>ze!=null&&(typeof ze=="string"?ze.toLowerCase().includes(C):typeof ze=="object"?Object.values(ze).some(Re=>typeof Re=="string"&&Re.toLowerCase().includes(C)):!1)))return!0}return!1})}for(const C of ve.value){if(!dt(C))continue;const V=Oe.value[C.key];V&&(E=E.filter(P=>xe(P,C,V)))}return E});function dt(E){return pt.has(E.operator)?!0:E.value==null||typeof E.value=="string"&&E.value===""||Array.isArray(E.value)&&E.value.length===0?!1:E.value instanceof Date?!isNaN(E.value.getTime()):!(typeof E.value=="object"&&!Array.isArray(E.value)&&E.value.min==null&&E.value.max==null)}function xe(E,C,V){const P=E?.[C.key],U=C.value,ze=C.operator;if(ze==="is_empty")return Z(P);if(ze==="is_not_empty")return!Z(P);const Re=V.type;if(Re==="text"||Re==="arrayText"){const De=Re==="arrayText"&&Array.isArray(P)?P.filter(tt=>tt!=null).map(String).join(" "):P!=null?String(P):"",re=String(U).toLowerCase(),Ge=De.toLowerCase();switch(ze){case"contains":return Ge.includes(re);case"not_contains":return!Ge.includes(re);case"equals":return Ge===re;case"not_equals":return Ge!==re;case"starts_with":return Ge.startsWith(re);case"ends_with":return Ge.endsWith(re);default:return!0}}if(Re==="select")switch(ze){case"is_any_of":return U.includes(P);case"is_none_of":return!U.includes(P);default:return!0}if(Re==="range"||Re==="int"){const De=typeof P=="number"?P:Number(P);if(typeof De!="number"||isNaN(De))return!1;if(ze==="between"){const Ge=U?.min!=null?Number(U.min):null,tt=U?.max!=null?Number(U.max):null,wt=Ge!=null&&!isNaN(Ge)?Ge:null,vt=tt!=null&&!isNaN(tt)?tt:null;return(wt==null||De>=wt)&&(vt==null||De<=vt)}const re=typeof U=="number"&&!isNaN(U)?U:Number(U);if(ze==="contains"||ze==="not_contains"){const Ge=String(De),tt=String(U??"").toLowerCase(),wt=Ge.toLowerCase().includes(tt);return ze==="contains"?wt:!wt}if(typeof re!="number"||isNaN(re))return!1;switch(ze){case"eq":return De===re;case"neq":return De!==re;case"gt":return De>re;case"gte":return De>=re;case"lt":return De<re;case"lte":return De<=re;default:return!0}}if(Re==="arraySelect"){if(!Array.isArray(P))return!1;const De=P.filter(re=>re!=null).map(re=>V.displayKey&&typeof re=="object"?re[V.displayKey]:String(re));switch(ze){case"contains_any":return De.some(re=>U.includes(re));case"contains_all":return U.every(re=>De.includes(re));case"not_contains_any":return!De.some(re=>U.includes(re));default:return!0}}if(Re==="date"){const De=Ue(U);if(!De||isNaN(De.getTime()))return!1;const re=Ue(P);if(!re||isNaN(re.getTime()))return!1;const Ge=X(re),tt=X(De);switch(ze){case"eq":return Ge===tt;case"before":return Ge<tt;case"after":return Ge>tt;default:return!0}}if(Re==="boolean"){const De=P===!0||P==="true"||P===1,re=P===!1||P==="false"||P===0;switch(ze){case"is_true":return De;case"is_false":return re;default:return!0}}return!0}function Ue(E){if(E==null)return null;if(E instanceof Date)return isNaN(E.getTime())?null:E;if(typeof E=="number")return new Date(E>1e10?E:E*1e3);if(typeof E=="string"){const C=new Date(E);return isNaN(C.getTime())?null:C}return null}function X(E){const C=E.getFullYear(),V=String(E.getMonth()+1).padStart(2,"0"),P=String(E.getDate()).padStart(2,"0");return`${C}-${V}-${P}`}function Z(E){return!!(E==null||E===""||E==="NULL"||Array.isArray(E)&&E.length===0||Array.isArray(E)&&E.every(C=>C==null))}e.watch(qe,E=>_e("update:modelValue",E),{immediate:!0}),e.watch(()=>A.data,()=>{ve.value=[],ue.value="",ee.value=!1,yt()});function j(E){return E.replace(/_/g," ").replace(/([a-z])([A-Z])/g,"$1 $2").replace(/\b\w/g,C=>C.toUpperCase())}function ie(){const E=C=>{if(C==null)return C;if(C instanceof Date)return{_type:"Date",value:C.toISOString(),local:C.toLocaleDateString()};if(Array.isArray(C))return C.map(E);if(typeof C=="object"&&!Array.isArray(C)){const V={};for(const P of Object.keys(C))V[P]=E(C[P]);return V}return C};return{globalSearch:ue.value,rows:ve.value.map(C=>({key:C.key,operator:C.operator,value:E(C.value),defType:Oe.value[C.key]?.type,defFilterMode:Oe.value[C.key]?.filterMode})),filteredCount:qe.value?.length??0}}return Ce({getDebugState:ie}),(E,C)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-filter",{"dss-filter--unstyled":$e.value.unstyled}])},[e.createElementVNode("div",{class:"dss-filter-global",ref_key:"globalRef",ref:S},[e.createElementVNode("div",Bm,[C[15]||(C[15]=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:"Search across all fields...",value:ue.value,onInput:ft},null,40,Mm),ue.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-filter-global-clear",onClick:C[0]||(C[0]=V=>ue.value="")},"×")):e.createCommentVNode("",!0),e.createElementVNode("button",{class:e.normalizeClass(["dss-filter-funnel-btn",{active:ee.value||ve.value.length>0}]),onClick:C[1]||(C[1]=V=>ee.value=!ee.value),type:"button",title:ee.value?"Close advanced filter":"Open advanced filter"},[C[14]||(C[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)),ve.value.length>0?(e.openBlock(),e.createElementBlock("span",$m,e.toDisplayString(ve.value.length),1)):e.createCommentVNode("",!0)],10,_m)]),ee.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-advanced-popup",onClick:C[13]||(C[13]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",Tm,[ve.value.length===0?(e.openBlock(),e.createElementBlock("div",Lm," No filter conditions are applied to this view ")):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ve.value,(V,P)=>(e.openBlock(),e.createElementBlock("div",{key:V.id,class:"dss-filter-row"},[e.createElementVNode("span",Hm,e.toDisplayString(P===0?"Where":"And"),1),e.createElementVNode("div",Am,[e.createElementVNode("button",{class:"dss-filter-trigger",onClick:e.withModifiers(U=>ge(`${V.id}:field`),["stop"])},[e.createElementVNode("span",Rm,e.toDisplayString(at(V.key)),1),C[16]||(C[16]=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,Dm),de.value===`${V.id}:field`?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-popup",onClick:C[3]||(C[3]=e.withModifiers(()=>{},["stop"]))},[e.withDirectives(e.createElementVNode("input",{type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":C[2]||(C[2]=U=>ne.value=U),placeholder:"Search attributes..."},null,512),[[e.vModelText,ne.value]]),e.createElementVNode("ul",Fm,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ze.value,U=>(e.openBlock(),e.createElementBlock("li",{key:U.key,class:"dss-filter-popup-item",onClick:ze=>Ct(V,U.key)},e.toDisplayString(U.label),9,Im))),128)),Ze.value.length===0?(e.openBlock(),e.createElementBlock("li",zm,"No match")):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)]),$t(V)==="contain"||$t(V)==="date"?(e.openBlock(),e.createElementBlock("div",Pm,[e.createElementVNode("button",{class:"dss-filter-trigger",onClick:e.withModifiers(U=>ge(`${V.id}:op`),["stop"])},[e.createElementVNode("span",Zm,e.toDisplayString(Ot(V.operator)),1),C[17]||(C[17]=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,Om),de.value===`${V.id}:op`?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-popup",onClick:C[4]||(C[4]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("ul",Wm,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(on(V),U=>(e.openBlock(),e.createElementBlock("li",{key:U.value,class:e.normalizeClass(["dss-filter-popup-item",{selected:V.operator===U.value}]),onClick:ze=>te(V,U.value)},e.toDisplayString(U.label),11,qm))),128))])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),Et(V.operator)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Um,[$t(V)==="string"?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,type:"text",class:"dss-filter-value-input",placeholder:"Enter value...","onUpdate:modelValue":U=>V.value=U},null,8,Xm)),[[e.vModelText,V.value]]):$t(V)==="date"?(e.openBlock(),e.createElementBlock("div",Ym,[e.createVNode(zo,{mode:"single",modelValue:V.value,"onUpdate:modelValue":U=>V.value=U},null,8,["modelValue","onUpdate:modelValue"])])):lt(V)==="text"?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:2,type:"text",class:"dss-filter-value-input",placeholder:"Enter value...","onUpdate:modelValue":U=>V.value=U},null,8,jm)),[[e.vModelText,V.value]]):lt(V)==="number"?(e.openBlock(),e.createElementBlock("input",{key:3,type:"number",class:"dss-filter-value-input",placeholder:"Enter value...",value:V.value,onInput:U=>Te(V,U),step:Oe.value[V.key]?.type==="int"?1:void 0},null,40,Km)):lt(V)==="between"?(e.openBlock(),e.createElementBlock("div",Gm,[e.createElementVNode("input",{type:"number",class:"dss-filter-value-input",placeholder:"Min",value:V.value?.min,onInput:U=>fe(V,"min",U),step:Oe.value[V.key]?.type==="int"?1:void 0},null,40,Qm),C[18]||(C[18]=e.createElementVNode("span",{class:"dss-filter-between-sep"},"and",-1)),e.createElementVNode("input",{type:"number",class:"dss-filter-value-input",placeholder:"Max",value:V.value?.max,onInput:U=>fe(V,"max",U),step:Oe.value[V.key]?.type==="int"?1:void 0},null,40,Jm)])):lt(V)==="multiselect"?(e.openBlock(),e.createElementBlock("div",e2,[e.createElementVNode("button",{class:"dss-filter-trigger",onClick:e.withModifiers(U=>ge(`${V.id}:val`),["stop"])},[e.createElementVNode("span",n2,e.toDisplayString(Xe(V)),1),C[19]||(C[19]=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,t2),de.value===`${V.id}:val`?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-popup",onClick:C[6]||(C[6]=e.withModifiers(()=>{},["stop"]))},[Lt(V).length>6?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":C[5]||(C[5]=U=>ne.value=U),placeholder:"Search..."},null,512)),[[e.vModelText,ne.value]]):e.createCommentVNode("",!0),e.createElementVNode("ul",l2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Bt(V),U=>(e.openBlock(),e.createElementBlock("li",{key:U,class:"dss-filter-popup-item",onClick:ze=>Ne(V,U)},[e.createElementVNode("input",{type:"checkbox",checked:(V.value||[]).includes(U),tabindex:"-1"},null,8,a2),e.createElementVNode("span",null,e.toDisplayString(U),1)],8,o2))),128)),Bt(V).length===0?(e.openBlock(),e.createElementBlock("li",s2," No match ")):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)])),e.createElementVNode("button",{class:"dss-filter-row-remove",onClick:U=>Yt(V.id)},[...C[20]||(C[20]=[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,r2)]))),128)),e.createElementVNode("div",i2,[e.createElementVNode("div",c2,[e.createElementVNode("button",{class:"dss-filter-add-btn",onClick:C[7]||(C[7]=e.withModifiers(V=>ge("add"),["stop"]))}," Add filter "),de.value==="add"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-popup dss-filter-add-popup",onClick:C[12]||(C[12]=e.withModifiers(()=>{},["stop"]))},[we.value&&!He.value&&!ne.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.withDirectives(e.createElementVNode("input",{type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":C[8]||(C[8]=V=>ne.value=V),placeholder:"Search attributes..."},null,512),[[e.vModelText,ne.value]]),e.createElementVNode("ul",u2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(xt.value,V=>(e.openBlock(),e.createElementBlock("li",{key:V.label,class:"dss-filter-popup-item dss-filter-popup-group",onClick:P=>He.value=V},[e.createElementVNode("span",null,e.toDisplayString(V.label),1),C[21]||(C[21]=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,d2))),128)),Tt.value.length>0?(e.openBlock(),e.createElementBlock("li",m2)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Tt.value,V=>(e.openBlock(),e.createElementBlock("li",{key:V.key,class:"dss-filter-popup-item",onClick:P=>Zt(V.key)},e.toDisplayString(V.label),9,p2))),128))])],64)):He.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",{class:"dss-filter-popup-back",onClick:C[9]||(C[9]=V=>He.value=null)},[C[22]||(C[22]=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(He.value.label),1)]),e.withDirectives(e.createElementVNode("input",{type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":C[10]||(C[10]=V=>ne.value=V),placeholder:"Search attributes..."},null,512),[[e.vModelText,ne.value]]),e.createElementVNode("ul",f2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ut.value,V=>(e.openBlock(),e.createElementBlock("li",{key:V.key,class:"dss-filter-popup-item",onClick:P=>Zt(V.key)},e.toDisplayString(V.label),9,v2))),128)),ut.value.length===0?(e.openBlock(),e.createElementBlock("li",g2,"No match")):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":C[11]||(C[11]=V=>ne.value=V),placeholder:"Search attributes..."},null,512),[[e.vModelText,ne.value]]),e.createElementVNode("ul",h2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ze.value,V=>(e.openBlock(),e.createElementBlock("li",{key:V.key,class:"dss-filter-popup-item",onClick:P=>Zt(V.key)},e.toDisplayString(V.label),9,y2))),128)),Ze.value.length===0?(e.openBlock(),e.createElementBlock("li",C2,"No match ")):e.createCommentVNode("",!0)])],64))])):e.createCommentVNode("",!0)]),ve.value.length>0?(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-filter-clear-all",onClick:We}," Clear all filters ")):e.createCommentVNode("",!0)])])])):e.createCommentVNode("",!0)],512)],2))}}),w2={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"}},x2={firstPage:"First page",previousPage:"Previous page",nextPage:"Next page",lastPage:"Last page",rowsPerPage:"Rows per page",searchPlaceholder:"Search...",downloadPdf:"Download PDF",downloadExcel:"Download Excel",columnVisibility:"Columns Visibility",clearFilter:"Clear",search:"Search...",filterFrom:"From:",filterTo:"To:",dateFormat:"dd/mm/yyyy"},E2={selectDate:"Select Date",selectRange:"Select range",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"}},V2={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"}},oo={chart:w2,table:x2,datepicker:E2,textEditor:V2},N2={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"}},S2={firstPage:"Première page",previousPage:"Page précédente",nextPage:"Page suivante",lastPage:"Dernière page",rowsPerPage:"Lignes par page",searchPlaceholder:"Rechercher...",downloadPdf:"Télécharger PDF",downloadExcel:"Télécharger Excel",columnVisibility:"Visibilité des colonnes",clearFilter:"Effacer",search:"Rechercher...",filterFrom:"Du :",filterTo:"Au :",dateFormat:"jj/mm/aaaa"},B2={selectDate:"Sélectionner une date",selectRange:"Sélectionner une plage",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"}},M2={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"}},ao={chart:N2,table:S2,datepicker:B2,textEditor:M2},_2={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"}},$2={firstPage:"Eerste pagina",previousPage:"Vorige pagina",nextPage:"Volgende pagina",lastPage:"Laatste pagina",rowsPerPage:"Rijen per pagina",searchPlaceholder:"Zoeken...",downloadPdf:"PDF downloaden",downloadExcel:"Excel downloaden",columnVisibility:"Kolommen weer te geven",clearFilter:"Wissen",search:"Zoeken...",filterFrom:"Van:",filterTo:"Tot:",dateFormat:"dd-mm-jjjj"},T2={selectDate:"Selecteer datum",selectRange:"Selecteer bereik",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"}},L2={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"}},so={chart:_2,table:$2,datepicker:T2,textEditor:L2},Do={en:oo,fr:ao,nl:so};function H2(F){if(!F||!F.global)return;const Ce=F.global.availableLocales||[];Object.keys(Do).forEach(z=>{Ce.includes(z)&&F.global.mergeLocaleMessage(z,Do[z])})}const Ro={en:{textEditor:oo.textEditor},fr:{textEditor:ao.textEditor},nl:{textEditor:so.textEditor}};function A2(F){if(!F||!F.global)return;const Ce=F.global.availableLocales||[];Object.keys(Ro).forEach(z=>{Ce.includes(z)&&F.global.mergeLocaleMessage(z,Ro[z])})}const Fo={en:{table:oo.table},fr:{table:ao.table},nl:{table:so.table}};function D2(F){if(!F||!F.global)return;const Ce=F.global.availableLocales||[];Object.keys(Fo).forEach(z=>{Ce.includes(z)&&F.global.mergeLocaleMessage(z,Fo[z])})}const Io={en:{datepicker:oo.datepicker},fr:{datepicker:ao.datepicker},nl:{datepicker:so.datepicker}};function R2(F){if(!F||!F.global)return;const Ce=F.global.availableLocales||[];Object.keys(Io).forEach(z=>{Ce.includes(z)&&F.global.mergeLocaleMessage(z,Io[z])})}const F2={en:{...oo},fr:{...ao},nl:{...so}};lo.createI18n({legacy:!1,locale:"en",fallbackLocale:"en",messages:F2});exports.DSSChart=Mi;exports.DSSChartMessages=Do;exports.DSSColorPicker=J1;exports.DSSConfetti=Sm;exports.DSSDatepicker=zo;exports.DSSDatepickerMessages=Io;exports.DSSDnd=Vm;exports.DSSFilter=b2;exports.DSSLoader=mm;exports.DSSModal=Ao;exports.DSSSkeleton=pm;exports.DSSTable=Uc;exports.DSSTableMessages=Fo;exports.DSSTextEditor=R1;exports.DSSTextEditorMessages=Ro;exports.addDSSChartTranslations=H2;exports.addDSSDatepickerTranslations=R2;exports.addDSSTableTranslations=D2;exports.addDSSTextEditorTranslations=A2;