dsp-semactic 0.6.6 → 0.6.7

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,10 +1,10 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),al=require("vue-i18n"),Wl=["data-chart-type"],ql={class:"dss-chart-header-titles"},Ul={key:0,class:"dss-chart-title"},Xl={key:1,class:"dss-chart-subtitle"},Yl=["onClick","onMouseenter"],jl={class:"dss-legend-text"},Kl=["onClick","onMouseenter"],Gl={class:"dss-legend-text"},Ql=["title"],Jl=["src"],ea={class:"dss-chart-area-wrapper"},ta={key:0,class:"dss-chart-z-axis-label"},na=["width","height","data-smooth","data-animated"],oa={id:"chart-clip"},la=["x","y","width","height"],aa=["id"],sa=["d"],ra=["id"],ia=["d"],ca={key:0},da={key:0,class:"dss-grid-lines","clip-path":"url(#chart-clip)"},ua=["x1","x2","y1","y2"],ma={class:"dss-axes"},pa=["x1","x2","y1","y2"],va=["x1","x2","y1","y2"],fa={class:"dss-axis-labels"},ga=["x","y"],ha=["x","y"],ya=["x","y"],ka=["y","transform"],Ca={key:1,class:"dss-flag-markers"},ba={"clip-path":"url(#chart-clip)"},wa=["x1","x2","y1","y2","onMouseover"],xa=["x1","x2","y1","y2","onMouseover"],Ea=["x1","x2","y1","y2","onMouseover"],Va=["cx","cy","onMouseover"],Na=["cx","cy","fill","onMouseover"],Sa=["x","y"],Ma={class:"dss-chart-data","clip-path":"url(#chart-clip)"},Ba={key:0},Ta=["d","onMouseover"],Ha=["x","y","width","height","fill","onMouseover"],$a={class:"dss-line-chart"},La=["d","stroke","stroke-width"],_a=["d","stroke","stroke-width","opacity"],Aa=["cx","cy","r","fill","onMouseover"],Da={key:1},Ra=["d","stroke","stroke-width"],Ia=["d","stroke","stroke-width"],Fa=["d","stroke","stroke-width","opacity"],za=["cx","cy","r","fill","onMouseover"],Pa={key:2},Oa=["id"],Za=["x","y","width","height"],Wa=["d","fill","fill-opacity","mask"],qa=["d","stroke","stroke-width"],Ua=["d","fill","onMouseover"],Xa=["x","y","width","height","onMouseover"],Ya={key:2,class:"dss-crosshair","clip-path":"url(#chart-clip)"},ja=["x1","x2","y1","y2","stroke"],Ka=["cx","cy","r","fill"],Ga={key:1,class:"dss-bubble-chart"},Qa={key:0,class:"dss-bubble-group"},Ja=["cx","cy","r","fill","fill-opacity","stroke","onMouseenter","onMouseleave","onClick"],es=["x","y","width","height","xlink:href","clip-path","onLoad","onError","onMouseenter","onMouseleave","onClick"],ts=["transform"],ns=["cx","cy","r"],os=["data-chart-type","clip-path"],ls=["d","fill","fill-opacity","stroke","stroke-width","onMouseover"],as={key:1,class:"dss-radial-segment-data-labels"},ss=["x","y"],rs=["x","y","font-size","fill"],is=["x1","y1","x2","y2","stroke"],cs=["x1","y1","x2","y2","stroke"],ds=["x","y","text-anchor","font-size"],us=["transform"],ms={key:0,class:"dss-spider-grid"},ps=["cx","cy","r"],vs={class:"dss-spider-grid-labels"},fs=["x","y"],gs=["x","y"],hs=["x1","x2","y1","y2"],ys={class:"dss-spider-labels"},ks=["x","y","text-anchor","dominant-baseline"],Cs=["points","fill","fill-opacity","stroke","stroke-width"],bs=["cx","cy","r","fill","onMouseover"],ws={class:"dss-chart-logos"},xs=["cx","cy","r","fill"],Es=["x","y","width","height","xlink:href","onLoad","onError","clip-path"],Vs=["onClick","onMouseenter"],Ns=["src"],Ss={class:"dss-marker-tooltip-category"},Ms={key:0,class:"dss-marker-tooltip-description"},Bs={key:0,class:"dss-tooltip-section"},Ts={key:0,class:"dss-tooltip-title"},Hs={class:"dss-tooltip-series-name"},$s={class:"dss-tooltip-series-value"},Ls={key:1,class:"dss-tooltip-section"},_s={key:0,class:"dss-tooltip-title"},As={class:"dss-bubble-tooltip-data"},Ds={key:2,class:"dss-tooltip-section"},Rs={class:"dss-tooltip-title"},Is={class:"dss-tooltip-value"},Fs={key:0,class:"dss-tooltip-section"},zs={class:"dss-tooltip-section-title"},Ps={class:"dss-tooltip-group-header"},Os={class:"dss-tooltip-item-content"},Zs={class:"dss-tooltip-item-text"},Ws={key:1,class:"dss-tooltip-section"},qs={class:"dss-tooltip-section-title"},Us={class:"dss-tooltip-item-content"},Xs={class:"dss-tooltip-item-title"},Ys={key:0,class:"dss-tooltip-item-description"},js={class:"dss-tooltip-section"},Ks={class:"dss-tooltip-title"},Gs={key:0,class:"dss-bubble-tooltip-data"},Qs={class:"dss-tooltip-series-name"},Js={class:"dss-tooltip-series-value"},er={key:0,class:"dss-tooltip-section"},tr={class:"dss-tooltip-section-title"},nr={class:"dss-tooltip-group-header"},or={class:"dss-tooltip-item-content"},lr={class:"dss-tooltip-item-text"},ar={key:1,class:"dss-tooltip-section"},sr={class:"dss-tooltip-section-title"},rr={class:"dss-tooltip-item-content"},ir={class:"dss-tooltip-item-title"},cr={key:0,class:"dss-tooltip-item-description"},dr={key:1,class:"dss-context-menu-separator"},ur={key:0,class:"dss-context-menu-separator"},mr={key:0,class:"dss-context-menu-separator"},pr=["onClick"],vr=["innerHTML"],fr={key:0,class:"dss-context-menu-icon"},gr={class:"dss-marker-modal-header"},hr={class:"dss-marker-modal-body"},yr={class:"dss-form-group"},kr={key:0},Cr={key:1},br=["disabled"],wr=["value"],xr={class:"dss-form-group"},Er={for:"dss-marker-description"},Vr={key:0,class:"dss-form-text-display"},Nr=["placeholder"],Sr={class:"dss-form-group"},Mr={class:"icon-preview"},Br=["src"],Tr={class:"dss-marker-modal-footer"},Hr={class:"modal-footer-left"},$r={class:"dss-modal-footer-right"},Lr=["disabled"],_r={name:"DSSChart"},Ar=Object.assign(_r,{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:Z=>typeof Z=="object"&&Z!==null},innerSize:{type:Number,default:null}},emits:["add-marker","update-marker","delete-marker"],setup(Z,{emit:Ut}){const{t:O,locale:R}=al.useI18n(),Ie=Ut,E=e.ref(null),he=e.ref(null),Ke=e.ref(null),vt=e.ref(0),f=e.ref(0);let ke=null,He=null;const $e=20,Le=e.computed(()=>{if(!E.value||!he.value)return 0;try{const t=E.value.getBoundingClientRect();return he.value.getBoundingClientRect().top-t.top}catch{return 0}}),L=Z,_e={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:"25%",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:!0,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 Ge(t,s){const o=Object.assign({},t);return kt(t)&&kt(s)&&Object.keys(s).forEach(c=>{kt(s[c])?c in t?o[c]=Ge(t[c],s[c]):Object.assign(o,{[c]:s[c]}):Object.assign(o,{[c]:s[c]})}),o}const _t=()=>{let t=20,s=0,o=0;if(Ce.value&&(t+=30),Nt.value&&(t+=25),dt.value&&L.series.length>0){const c=L.series.filter((g,h)=>!Ue.value.has(h)).length;if(Xe.value==="top"||Xe.value==="bottom"){if(En.value==="horizontal"){const h=Math.floor(pe.value/100);s=Math.ceil(c/h)*25+10}else s=c*25+10;t+=s}else o=150}return{height:t,legendHeight:s,legendWidth:o}};function kt(t){return t&&typeof t=="object"&&!Array.isArray(t)}const P=e.computed(()=>Ge(_e,L.options)),Ht=e.computed(()=>{const t=P.value;return t&&t.chart&&t.chart.width==="auto"}),Xt=e.computed(()=>{const t=P.value;return t&&t.chart&&t.chart.height==="auto"}),pe=e.computed(()=>{const t=P.value;return Ht.value?vt.value||800:t&&t.chart&&typeof t.chart.width=="number"?t.chart.width:800}),tn=e.ref($e),Qe=e.computed(()=>{const t=P.value;return Xt.value?Math.max(0,(f.value||400)-tn.value):t&&t.chart&&typeof t.chart.height=="number"?t.chart.height:400}),ye=e.computed(()=>{const t=P.value;return t&&t.chart&&t.chart.type?t.chart.type:"line"}),ue=e.computed(()=>{const t=L.series.map(s=>s.type||ye.value);return new Set(t).size>1}),Ce=e.computed(()=>{const t=P.value;return t&&t.title&&t.title.text?t.title.text:""}),Nt=e.computed(()=>{const t=P.value;return t&&t.subtitle&&t.subtitle.text?t.subtitle.text:""}),Yt=e.computed(()=>{const t=P.value;if(!t||!t.zAxis)return"";const s=t.zAxis;return typeof s=="string"?s:s&&typeof s.label=="string"?s.label:""}),it=e.computed(()=>{const t=P.value;return t&&t.xAxis&&t.xAxis.title&&t.xAxis.title.text?t.xAxis.title.text:""}),xn=e.computed(()=>{const t=P.value;return t&&t.yAxis&&t.yAxis.title&&t.yAxis.title.text?t.yAxis.title.text:""}),jt=e.computed(()=>{const t=P.value;if(!t||!t.yAxis)return Cn;const s=t.yAxis.min;return typeof s=="number"||s===Cn?s:Cn}),kn=e.computed(()=>{const t=P.value;if(!t||!t.yAxis)return Cn;const s=t.yAxis.max;return typeof s=="number"||s===Cn?s:Cn}),tt=e.computed(()=>{const t=P.value;return!t||!t.xAxis?null:typeof t.xAxis.min=="number"?t.xAxis.min:null}),Fe=e.computed(()=>{const t=P.value;return!t||!t.xAxis?null:typeof t.xAxis.max=="number"?t.xAxis.max:null}),ct=e.computed(()=>{const t=P.value;return t&&t.grid&&t.grid.show!==!1}),dt=e.computed(()=>{const t=P.value;return t&&t.legend&&t.legend.show!==!1}),Xe=e.computed(()=>{const t=P.value;return t&&t.legend&&t.legend.position?t.legend.position:"top"}),En=e.computed(()=>{const t=P.value;return t&&t.legend&&t.legend.orientation?t.legend.orientation:"horizontal"}),ze=e.computed(()=>{const t=P.value;return!t||!t.tooltip?!0:t.tooltip.enabled!==!1}),$t=e.computed(()=>{const t=P.value;if(!t||!t.crosshair)return!1;const s=t.crosshair.show;return s===!0||s==="true"}),Kt=e.computed(()=>{const t=P.value;return t&&t.crosshair&&t.crosshair.color?t.crosshair.color:"#666"}),Bt=e.computed(()=>{const t=P.value;return t&&t.zoom&&t.zoom.enabled!==!1}),fo=e.computed(()=>{const t=P.value;return t&&t.zoom&&typeof t.zoom.minScale=="number"?t.zoom.minScale:1}),nn=e.computed(()=>{const t=P.value;return t&&t.zoom&&typeof t.zoom.maxScale=="number"?t.zoom.maxScale:2.5}),Ne=e.computed(()=>{const t=P.value;return t&&t.stroke&&typeof t.stroke.width=="number"?t.stroke.width:2}),pn=e.computed(()=>{if(!cn.value)return 0;const t=P.value;return t&&t.stroke&&typeof t.stroke.width=="number"?t.stroke.width:0}),Ye=e.computed(()=>{const t=P.value;return t&&t.bubbles&&typeof t.bubbles.size=="number"?t.bubbles.size:4}),At=e.computed(()=>{const{maxX:t}=ht.value;return t===0}),nt=(t,s)=>At.value&&s===0?5:s,on=e.computed(()=>{const t=P.value;return t&&t.fill&&t.fill.area&&typeof t.fill.area.opacity=="number"?t.fill.area.opacity:.3}),ae=e.computed(()=>{const t=P.value;return t&&t.smoothing&&t.smoothing.enabled===!0}),me=e.computed(()=>{const t=P.value;return t&&t.smoothing&&typeof t.smoothing.factor=="number"?t.smoothing.factor:.3}),ot=e.computed(()=>{const t=P.value;return ae.value?t&&t.smoothing&&typeof t.smoothing.barRadius=="number"?t.smoothing.barRadius:4:0}),Gt=e.computed(()=>{const t=P.value,s=t&&t.colors&&Array.isArray(t.colors)?t.colors:[];return s.length>0?s:["#3B82F6","#EF4444","#10B981","#F59E0B","#8B5CF6","#F97316","#06B6D4","#84CC16"]}),Ct=e.computed(()=>{const t=P.value;return t&&t.animations&&t.animations.enabled!==!1}),ft=e.computed(()=>{const t=P.value;return t&&t.animations&&t.animations.type?t.animations.type:"draw"}),Pe=e.computed(()=>{const t=P.value;return t&&t.animations&&typeof t.animations.duration=="number"?t.animations.duration:2500}),je=e.computed(()=>{const t=P.value;return t&&t.animations&&typeof t.animations.delay=="number"?t.animations.delay:0}),Te=e.computed(()=>{const t=P.value;return t&&t.animations&&t.animations.easing?t.animations.easing:"ease-out"}),Se=e.computed(()=>{const t=P.value;return t&&t.animations&&typeof t.animations.staggerDelay=="number"?t.animations.staggerDelay:200}),bt=e.computed(()=>{const t=P.value;return t&&t.animations&&t.animations.onDataChange!==!1}),Ae=e.computed(()=>{const t=P.value;return t&&t.animations&&t.animations.respectReducedMotion!==!1}),We=e.computed(()=>{const t=P.value;return t&&t.fill&&t.fill.spider&&typeof t.fill.spider.opacity=="number"?t.fill.spider.opacity:.15}),Dt=e.computed(()=>P.value?.spider?.gridSteps||5),De=e.computed(()=>{const t=[],s=Dt.value;for(let o=1;o<=s;o++)t.push(Oe.value/s*o);return t}),ut=t=>{const s=lt.value;if(s&&Array.isArray(s)&&s[t]!==void 0)return s[t].toString();const o=De.value[t];return Math.round(o/Oe.value*100)+"%"},lt=e.computed(()=>P.value?.spider?.gridLabels||null),vn=e.computed(()=>{const t=P.value;return t&&t.contextMenu&&t.contextMenu.enabled===!0}),mt=e.computed(()=>{const t=P.value,s={addMarker:!0,downloadSvg:!0,downloadPng:!0,downloadCsv:!0};return t&&t.contextMenu&&t.contextMenu.items?{...s,...t.contextMenu.items}:s}),gt=e.computed(()=>{const t=P.value;return t&&t.contextMenu&&Array.isArray(t.contextMenu.customItems)?t.contextMenu.customItems:[]}),Qt=e.computed(()=>{const t=P.value;return t&&t.markers&&t.markers.icon?t.markers.icon:ce.value}),Mn=e.computed(()=>{const t=P.value;return t&&t.markers&&t.markers.customIcons?t.markers.customIcons:{}}),Jt=e.computed(()=>{const t=P.value;return t&&t.markers&&typeof t.markers.iconSize=="number"?t.markers.iconSize:20}),Ln=e.computed(()=>{const s=P.value?.valueFormat?.extension;return typeof s=="string"?s:""}),ln=t=>{const s=Ln.value;if(t==null)return"";const o=String(t);return s?o+s:o},Rt=e.computed(()=>!z.value.isZooming);e.computed(()=>k.value.map(t=>{if(t.categoryIndex!==void 0&&(qt.value||wt.value)){const s=Et(t.categoryIndex),o=Le.value+B.value.bottom-Jt.value/2;return{...t,x:s,y:o}}return t}));function _n(t,s){const o=new Date(t);let c=0,g=1/0;return s.forEach((h,w)=>{const[C,S,H]=h.split("-"),_=new Date(`20${H}`,S-1,C),A=Math.abs(_-o);A<g&&(g=A,c=w)}),c}const An=e.computed(()=>{const t=L.markers.map(o=>{const c=_n(o.marker_date,L.categories),g=Et(c),h=Le.value+B.value.bottom-Jt.value/2;return{...o,x:g,y:h,categoryIndex:c,source:"props"}}),s=k.value.map(o=>{if(o.categoryIndex!==void 0&&(qt.value||wt.value)){const c=Et(o.categoryIndex),g=Le.value+B.value.bottom-Jt.value/2;return{...o,x:c,y:g,source:"internal"}}return{...o,source:"internal"}});return[...t,...s]}),Dn=e.computed(()=>{const t=P.value;return t&&t.watermark&&t.watermark.enabled===!0}),M=e.computed(()=>{const t=P.value;return t&&t.watermark&&typeof t.watermark.opacity=="number"?t.watermark.opacity:.05}),D=e.computed(()=>{const t=P.value;return t&&t.watermark&&t.watermark.size?t.watermark.size:"25%"}),T=e.computed(()=>{const t=P.value;return t&&t.watermark&&t.watermark.position?t.watermark.position:"bottom-right"}),W=e.computed(()=>{const t={left:B.value.left,top:B.value.top,width:B.value.width,height:B.value.height};let s,o;const c=String(D.value);if(c.includes("%")){const g=parseFloat(c)/100;s=t.width*g,o=s*(96/499)}else{const g=parseFloat(c)||25;s=Math.min(t.width*.25,200)*(g/25),o=s*(96/499)}return{width:s,height:o,area:t}}),te=e.computed(()=>{const{width:t,height:s}=W.value,o=T.value;let c,g;const h=B.value.left,w=B.value.right,C=B.value.top,S=B.value.bottom,H=B.value.width,_=B.value.height;switch(o){case"center":c=h+(H-t)/2,g=C+(_-s)/2;break;case"top-left":c=h+15,g=C+90;break;case"top-right":c=w-t-15,g=C+90;break;case"bottom-left":c=h+15,g=S-s+75;break;case"bottom-right":default:c=w-t-15,g=S-s+75;break}return{backgroundPositionX:c+"px",backgroundPositionY:g+"px",backgroundSize:`${t}px ${s}px`}}),be=t=>!L.flags||!L.flags.length?[]:L.flags.filter(s=>s.categoryIndex===t),ie=t=>{const s=be(t),o=Yn(t),c=s.filter(w=>w.manual),g=s.filter(w=>!w.manual),h=[];return c.length>0&&h.push({type:O("chart.tooltip.manualFlags"),color:"#047395",flags:c.map(w=>({text:w.text,color:"#047395"}))}),g.length>0&&h.push({type:O("chart.tooltip.autoFlags"),color:"#0dbf89",flags:g.map(w=>({text:w.text,color:"#0dbf89"}))}),{flagGroups:h,markers:o.map(w=>({title:w.title,description:w.description,type:O("chart.tooltip.markers"),color:w.color||"#FF6B6B"}))}},ce=e.computed(()=>`data:image/svg+xml;base64,${btoa(`<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"),al=require("vue-i18n"),jl=["data-chart-type"],Kl={class:"dss-chart-header-titles"},Gl={key:0,class:"dss-chart-title"},Ql={key:1,class:"dss-chart-subtitle"},Jl=["onClick","onMouseenter"],ea={class:"dss-legend-text"},ta=["onClick","onMouseenter"],na={class:"dss-legend-text"},oa=["title"],la=["src"],aa={class:"dss-chart-area-wrapper"},sa={key:0,class:"dss-chart-z-axis-label"},ra=["width","height","data-smooth","data-animated"],ia={id:"chart-clip"},ca=["x","y","width","height"],da=["id"],ua=["d"],ma=["id"],pa=["d"],va={key:0},fa={key:0,class:"dss-grid-lines","clip-path":"url(#chart-clip)"},ga=["x1","x2","y1","y2"],ha={class:"dss-axes"},ya=["x1","x2","y1","y2"],ka=["x1","x2","y1","y2"],Ca={class:"dss-axis-labels"},ba=["x","y"],wa=["x","y"],xa=["x","y"],Ea=["y","transform"],Va={key:1,class:"dss-flag-markers"},Sa={"clip-path":"url(#chart-clip)"},Na=["x1","x2","y1","y2","onMouseover"],Ma=["x1","x2","y1","y2","onMouseover"],Ba=["x1","x2","y1","y2","onMouseover"],Ta=["cx","cy","onMouseover"],$a=["cx","cy","fill","onMouseover"],Ha=["x","y"],La={class:"dss-chart-data","clip-path":"url(#chart-clip)"},_a={key:0},Aa=["d","onMouseover"],Da=["x","y","width","height","fill","onMouseover"],Ra={class:"dss-line-chart"},Ia=["d","stroke","stroke-width"],Fa=["d","stroke","stroke-width","opacity"],za=["cx","cy","r","fill","onMouseover"],Pa={key:1},Oa=["d","stroke","stroke-width"],Za=["d","stroke","stroke-width"],Wa=["d","stroke","stroke-width","opacity"],qa=["cx","cy","r","fill","onMouseover"],Ua={key:2},Xa=["id"],Ya=["x","y","width","height"],ja=["d","fill","fill-opacity","mask"],Ka=["d","stroke","stroke-width"],Ga=["d","fill","onMouseover"],Qa=["x","y","width","height","onMouseover"],Ja={key:2,class:"dss-crosshair","clip-path":"url(#chart-clip)"},es=["x1","x2","y1","y2","stroke"],ts=["cx","cy","r","fill"],ns={key:1,class:"dss-bubble-chart"},os={key:0,class:"dss-bubble-group"},ls=["cx","cy","r","fill","fill-opacity","stroke","onMouseenter","onMouseleave","onClick"],as=["x","y","width","height","xlink:href","clip-path","onLoad","onError","onMouseenter","onMouseleave","onClick"],ss=["transform"],rs=["cx","cy","r"],is=["data-chart-type","clip-path"],cs=["d","fill","fill-opacity","stroke","stroke-width","clip-path","onMouseover"],ds={key:1,class:"dss-radial-segment-data-labels"},us=["x","y"],ms=["x","y","font-size","fill"],ps=["x1","y1","x2","y2","stroke"],vs=["x1","y1","x2","y2","stroke"],fs=["x","y","text-anchor","font-size"],gs=["transform"],hs={key:0,class:"dss-spider-grid"},ys=["cx","cy","r"],ks={class:"dss-spider-grid-labels"},Cs=["x","y"],bs=["x","y"],ws=["x1","x2","y1","y2"],xs={class:"dss-spider-labels"},Es=["x","y","text-anchor","dominant-baseline"],Vs=["points","fill","fill-opacity","stroke","stroke-width"],Ss=["cx","cy","r","fill","onMouseover"],Ns={class:"dss-chart-logos"},Ms=["cx","cy","r","fill"],Bs=["x","y","width","height","xlink:href","onLoad","onError","clip-path"],Ts=["onClick","onMouseenter"],$s=["src"],Hs={class:"dss-marker-tooltip-category"},Ls={key:0,class:"dss-marker-tooltip-description"},_s={key:0,class:"dss-tooltip-section"},As={key:0,class:"dss-tooltip-title"},Ds={class:"dss-tooltip-series-name"},Rs={class:"dss-tooltip-series-value"},Is={key:1,class:"dss-tooltip-section"},Fs={key:0,class:"dss-tooltip-title"},zs={class:"dss-bubble-tooltip-data"},Ps={key:2,class:"dss-tooltip-section"},Os={class:"dss-tooltip-title"},Zs={class:"dss-tooltip-value"},Ws={key:0,class:"dss-tooltip-section"},qs={class:"dss-tooltip-section-title"},Us={class:"dss-tooltip-group-header"},Xs={class:"dss-tooltip-item-content"},Ys={class:"dss-tooltip-item-text"},js={key:1,class:"dss-tooltip-section"},Ks={class:"dss-tooltip-section-title"},Gs={class:"dss-tooltip-item-content"},Qs={class:"dss-tooltip-item-title"},Js={key:0,class:"dss-tooltip-item-description"},er={class:"dss-tooltip-section"},tr={class:"dss-tooltip-title"},nr={key:0,class:"dss-bubble-tooltip-data"},or={class:"dss-tooltip-series-name"},lr={class:"dss-tooltip-series-value"},ar={key:0,class:"dss-tooltip-section"},sr={class:"dss-tooltip-section-title"},rr={class:"dss-tooltip-group-header"},ir={class:"dss-tooltip-item-content"},cr={class:"dss-tooltip-item-text"},dr={key:1,class:"dss-tooltip-section"},ur={class:"dss-tooltip-section-title"},mr={class:"dss-tooltip-item-content"},pr={class:"dss-tooltip-item-title"},vr={key:0,class:"dss-tooltip-item-description"},fr={key:1,class:"dss-context-menu-separator"},gr={key:0,class:"dss-context-menu-separator"},hr={key:0,class:"dss-context-menu-separator"},yr=["onClick"],kr=["innerHTML"],Cr={key:0,class:"dss-context-menu-icon"},br={class:"dss-marker-modal-header"},wr={class:"dss-marker-modal-body"},xr={class:"dss-form-group"},Er={key:0},Vr={key:1},Sr=["disabled"],Nr=["value"],Mr={class:"dss-form-group"},Br={for:"dss-marker-description"},Tr={key:0,class:"dss-form-text-display"},$r=["placeholder"],Hr={class:"dss-form-group"},Lr={class:"icon-preview"},_r=["src"],Ar={class:"dss-marker-modal-footer"},Dr={class:"modal-footer-left"},Rr={class:"dss-modal-footer-right"},Ir=["disabled"],Fr={name:"DSSChart"},zr=Object.assign(Fr,{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:O=>typeof O=="object"&&O!==null},innerSize:{type:Number,default:null}},emits:["add-marker","update-marker","delete-marker"],setup(O,{emit:Ut}){const{t:P,locale:R}=al.useI18n(),Pe=Ut,S=e.ref(null),ye=e.ref(null),Ge=e.ref(null),ct=e.ref(0),g=e.ref(0);let we=null,Me=null;const Be=20,He=e.computed(()=>{if(!S.value||!ye.value)return 0;try{const t=S.value.getBoundingClientRect();return ye.value.getBoundingClientRect().top-t.top}catch{return 0}}),A=O,Le={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:"25%",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:!0,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 Qe(t,s){const n=Object.assign({},t);return mt(t)&&mt(s)&&Object.keys(s).forEach(c=>{mt(s[c])?c in t?n[c]=Qe(t[c],s[c]):Object.assign(n,{[c]:s[c]}):Object.assign(n,{[c]:s[c]})}),n}const At=()=>{let t=20,s=0,n=0;if(Ue.value&&(t+=30),$e.value&&(t+=25),pt.value&&A.series.length>0){const c=A.series.filter((f,h)=>!ot.value.has(h)).length;if(ke.value==="top"||ke.value==="bottom"){if(mn.value==="horizontal"){const h=Math.floor(pe.value/100);s=Math.ceil(c/h)*25+10}else s=c*25+10;t+=s}else n=150}return{height:t,legendHeight:s,legendWidth:n}};function mt(t){return t&&typeof t=="object"&&!Array.isArray(t)}const F=e.computed(()=>Qe(Le,A.options)),Tt=e.computed(()=>{const t=F.value;return t&&t.chart&&t.chart.width==="auto"}),Dt=e.computed(()=>{const t=F.value;return t&&t.chart&&t.chart.height==="auto"}),pe=e.computed(()=>{const t=F.value;return Tt.value?ct.value||800:t&&t.chart&&typeof t.chart.width=="number"?t.chart.width:800}),Xt=e.ref(Be),en=e.computed(()=>{if(Q.value!=="semi-radial"||!Dt.value)return null;const t=pe.value,s=Zn.value,n=t-s.left-s.right;return n<=0?null:n+s.top+s.bottom}),lt=e.computed(()=>{const t=F.value;if(Dt.value){const s=en.value;return s??Math.max(0,(g.value||400)-Xt.value)}return t&&t.chart&&typeof t.chart.height=="number"?t.chart.height:400}),ve=e.computed(()=>Dt.value&&Q.value==="semi-radial"&&en.value!=null?Xt.value+lt.value+"px":Dt.value?"100%":lt.value+(rn.value&&!pt.value?0:20)+"px"),Q=e.computed(()=>{const t=F.value;return t&&t.chart&&t.chart.type?t.chart.type:"line"}),Rn=e.computed(()=>{const t=A.series.map(s=>s.type||Q.value);return new Set(t).size>1}),Ue=e.computed(()=>{const t=F.value;return t&&t.title&&t.title.text?t.title.text:""}),$e=e.computed(()=>{const t=F.value;return t&&t.subtitle&&t.subtitle.text?t.subtitle.text:""}),xn=e.computed(()=>{const t=F.value;if(!t||!t.zAxis)return"";const s=t.zAxis;return typeof s=="string"?s:s&&typeof s.label=="string"?s.label:""}),tn=e.computed(()=>{const t=F.value;return t&&t.xAxis&&t.xAxis.title&&t.xAxis.title.text?t.xAxis.title.text:""}),Tn=e.computed(()=>{const t=F.value;return t&&t.yAxis&&t.yAxis.title&&t.yAxis.title.text?t.yAxis.title.text:""}),Ye=e.computed(()=>{const t=F.value;if(!t||!t.yAxis)return Nn;const s=t.yAxis.min;return typeof s=="number"||s===Nn?s:Nn}),Ie=e.computed(()=>{const t=F.value;if(!t||!t.yAxis)return Nn;const s=t.yAxis.max;return typeof s=="number"||s===Nn?s:Nn}),at=e.computed(()=>{const t=F.value;return!t||!t.xAxis?null:typeof t.xAxis.min=="number"?t.xAxis.min:null}),Yt=e.computed(()=>{const t=F.value;return!t||!t.xAxis?null:typeof t.xAxis.max=="number"?t.xAxis.max:null}),un=e.computed(()=>{const t=F.value;return t&&t.grid&&t.grid.show!==!1}),pt=e.computed(()=>{const t=F.value;return t&&t.legend&&t.legend.show!==!1}),ke=e.computed(()=>{const t=F.value;return t&&t.legend&&t.legend.position?t.legend.position:"top"}),mn=e.computed(()=>{const t=F.value;return t&&t.legend&&t.legend.orientation?t.legend.orientation:"horizontal"}),Rt=e.computed(()=>{const t=F.value;return!t||!t.tooltip?!0:t.tooltip.enabled!==!1}),vt=e.computed(()=>{const t=F.value;if(!t||!t.crosshair)return!1;const s=t.crosshair.show;return s===!0||s==="true"}),fo=e.computed(()=>{const t=F.value;return t&&t.crosshair&&t.crosshair.color?t.crosshair.color:"#666"}),Vt=e.computed(()=>{const t=F.value;return t&&t.zoom&&t.zoom.enabled!==!1}),Je=e.computed(()=>{const t=F.value;return t&&t.zoom&&typeof t.zoom.minScale=="number"?t.zoom.minScale:1}),gn=e.computed(()=>{const t=F.value;return t&&t.zoom&&typeof t.zoom.maxScale=="number"?t.zoom.maxScale:2.5}),Ze=e.computed(()=>{const t=F.value;return t&&t.stroke&&typeof t.stroke.width=="number"?t.stroke.width:2}),It=e.computed(()=>{if(!rn.value)return 0;const t=F.value;return t&&t.stroke&&typeof t.stroke.width=="number"?t.stroke.width:0}),Fe=e.computed(()=>{const t=F.value;return t&&t.bubbles&&typeof t.bubbles.size=="number"?t.bubbles.size:4}),jt=e.computed(()=>{const{maxX:t}=it.value;return t===0}),de=(t,s)=>jt.value&&s===0?5:s,ge=e.computed(()=>{const t=F.value;return t&&t.fill&&t.fill.area&&typeof t.fill.area.opacity=="number"?t.fill.area.opacity:.3}),ze=e.computed(()=>{const t=F.value;return t&&t.smoothing&&t.smoothing.enabled===!0}),$t=e.computed(()=>{const t=F.value;return t&&t.smoothing&&typeof t.smoothing.factor=="number"?t.smoothing.factor:.3}),Kt=e.computed(()=>{const t=F.value;return ze.value?t&&t.smoothing&&typeof t.smoothing.barRadius=="number"?t.smoothing.barRadius:4:0}),ft=e.computed(()=>{const t=F.value,s=t&&t.colors&&Array.isArray(t.colors)?t.colors:[];return s.length>0?s:["#3B82F6","#EF4444","#10B981","#F59E0B","#8B5CF6","#F97316","#06B6D4","#84CC16"]}),Te=e.computed(()=>{const t=F.value;return t&&t.animations&&t.animations.enabled!==!1}),je=e.computed(()=>{const t=F.value;return t&&t.animations&&t.animations.type?t.animations.type:"draw"}),Ve=e.computed(()=>{const t=F.value;return t&&t.animations&&typeof t.animations.duration=="number"?t.animations.duration:2500}),Oe=e.computed(()=>{const t=F.value;return t&&t.animations&&typeof t.animations.delay=="number"?t.animations.delay:0}),st=e.computed(()=>{const t=F.value;return t&&t.animations&&t.animations.easing?t.animations.easing:"ease-out"}),Ce=e.computed(()=>{const t=F.value;return t&&t.animations&&typeof t.animations.staggerDelay=="number"?t.animations.staggerDelay:200}),nt=e.computed(()=>{const t=F.value;return t&&t.animations&&t.animations.onDataChange!==!1}),Ft=e.computed(()=>{const t=F.value;return t&&t.animations&&t.animations.respectReducedMotion!==!1}),_e=e.computed(()=>{const t=F.value;return t&&t.fill&&t.fill.spider&&typeof t.fill.spider.opacity=="number"?t.fill.spider.opacity:.15}),rt=e.computed(()=>F.value?.spider?.gridSteps||5),Ke=e.computed(()=>{const t=[],s=rt.value;for(let n=1;n<=s;n++)t.push(Ne.value/s*n);return t}),pn=t=>{const s=hn.value;if(s&&Array.isArray(s)&&s[t]!==void 0)return s[t].toString();const n=Ke.value[t];return Math.round(n/Ne.value*100)+"%"},hn=e.computed(()=>F.value?.spider?.gridLabels||null),Ct=e.computed(()=>{const t=F.value;return t&&t.contextMenu&&t.contextMenu.enabled===!0}),et=e.computed(()=>{const t=F.value,s={addMarker:!0,downloadSvg:!0,downloadPng:!0,downloadCsv:!0};return t&&t.contextMenu&&t.contextMenu.items?{...s,...t.contextMenu.items}:s}),In=e.computed(()=>{const t=F.value;return t&&t.contextMenu&&Array.isArray(t.contextMenu.customItems)?t.contextMenu.customItems:[]}),$n=e.computed(()=>{const t=F.value;return t&&t.markers&&t.markers.icon?t.markers.icon:Se.value}),Hn=e.computed(()=>{const t=F.value;return t&&t.markers&&t.markers.customIcons?t.markers.customIcons:{}}),vn=e.computed(()=>{const t=F.value;return t&&t.markers&&typeof t.markers.iconSize=="number"?t.markers.iconSize:20}),St=e.computed(()=>{const s=F.value?.valueFormat?.extension;return typeof s=="string"?s:""}),Wt=t=>{const s=St.value;if(t==null)return"";const n=String(t);return s?n+s:n},Fn=e.computed(()=>!m.value.isZooming);e.computed(()=>E.value.map(t=>{if(t.categoryIndex!==void 0&&(Lt.value||dt.value)){const s=ht(t.categoryIndex),n=He.value+H.value.bottom-vn.value/2;return{...t,x:s,y:n}}return t}));function lo(t,s){const n=new Date(t);let c=0,f=1/0;return s.forEach((h,w)=>{const[C,M,L]=h.split("-"),T=new Date(`20${L}`,M-1,C),B=Math.abs(T-n);B<f&&(f=B,c=w)}),c}const $=e.computed(()=>{const t=A.markers.map(n=>{const c=lo(n.marker_date,A.categories),f=ht(c),h=He.value+H.value.bottom-vn.value/2;return{...n,x:f,y:h,categoryIndex:c,source:"props"}}),s=E.value.map(n=>{if(n.categoryIndex!==void 0&&(Lt.value||dt.value)){const c=ht(n.categoryIndex),f=He.value+H.value.bottom-vn.value/2;return{...n,x:c,y:f,source:"internal"}}return{...n,source:"internal"}});return[...t,...s]}),D=e.computed(()=>{const t=F.value;return t&&t.watermark&&t.watermark.enabled===!0}),_=e.computed(()=>{const t=F.value;return t&&t.watermark&&typeof t.watermark.opacity=="number"?t.watermark.opacity:.05}),W=e.computed(()=>{const t=F.value;return t&&t.watermark&&t.watermark.size?t.watermark.size:"25%"}),ne=e.computed(()=>{const t=F.value;return t&&t.watermark&&t.watermark.position?t.watermark.position:"bottom-right"}),he=e.computed(()=>{const t={left:H.value.left,top:H.value.top,width:H.value.width,height:H.value.height};let s,n;const c=String(W.value);if(c.includes("%")){const f=parseFloat(c)/100;s=t.width*f,n=s*(96/499)}else{const f=parseFloat(c)||25;s=Math.min(t.width*.25,200)*(f/25),n=s*(96/499)}return{width:s,height:n,area:t}}),xe=e.computed(()=>{const{width:t,height:s}=he.value,n=ne.value;let c,f;const h=H.value.left,w=H.value.right,C=H.value.top,M=H.value.bottom,L=H.value.width,T=H.value.height;switch(n){case"center":c=h+(L-t)/2,f=C+(T-s)/2;break;case"top-left":c=h+15,f=C+90;break;case"top-right":c=w-t-15,f=C+90;break;case"bottom-left":c=h+15,f=M-s+75;break;case"bottom-right":default:c=w-t-15,f=M-s+75;break}return{backgroundPositionX:c+"px",backgroundPositionY:f+"px",backgroundSize:`${t}px ${s}px`}}),ie=t=>!A.flags||!A.flags.length?[]:A.flags.filter(s=>s.categoryIndex===t),fe=t=>{const s=ie(t),n=ul(t),c=s.filter(w=>w.manual),f=s.filter(w=>!w.manual),h=[];return c.length>0&&h.push({type:P("chart.tooltip.manualFlags"),color:"#047395",flags:c.map(w=>({text:w.text,color:"#047395"}))}),f.length>0&&h.push({type:P("chart.tooltip.autoFlags"),color:"#0dbf89",flags:f.map(w=>({text:w.text,color:"#0dbf89"}))}),{flagGroups:h,markers:n.map(w=>({title:w.title,description:w.description,type:P("chart.tooltip.markers"),color:w.color||"#FF6B6B"}))}},Se=e.computed(()=>`data:image/svg+xml;base64,${btoa(`<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="#fafafa"/>
5
5
  <path d="M27.2846 45.1083H38.04C42.2352 45.1083 45.6368 41.6468 45.6368 37.3776C45.6368 33.1084 42.2352 29.6469 38.04 29.6469H27.1955C26.6366 29.6469 26.1831 30.1084 26.1831 30.6854L26.2803 44.0863C26.2803 44.655 26.7338 45.1083 27.2927 45.1083H27.2846Z" fill="#07A9DA"/>
6
6
  <path d="M16.3198 44.4813C20.1575 44.4813 23.2687 41.3153 23.2687 37.4099C23.2687 33.5045 20.1575 30.3386 16.3198 30.3386C12.482 30.3386 9.37085 33.5045 9.37085 37.4099C9.37085 41.3153 12.482 44.4813 16.3198 44.4813Z" fill="#fafafa"/>
7
- </svg>`)}`),we=e.computed(()=>`data:image/svg+xml;base64,${btoa(`<svg width="499" height="96" viewBox="0 0 499 96" fill="none" xmlns="http://www.w3.org/2000/svg">
7
+ </svg>`)}`),bt=e.computed(()=>`data:image/svg+xml;base64,${btoa(`<svg width="499" height="96" viewBox="0 0 499 96" fill="none" xmlns="http://www.w3.org/2000/svg">
8
8
  <path d="M171.52 37.8399H160.38C160.26 36.4799 160.02 35.0599 159.68 33.5699C159.34 32.0799 158.77 30.7399 157.96 29.5299C157.16 28.3199 156 27.3199 154.48 26.5099C152.96 25.7099 150.94 25.2999 148.4 25.2999C144.69 25.2999 141.93 26.1299 140.14 27.8099C138.34 29.4799 137.45 31.5499 137.45 34.0299C137.45 37.7999 139.29 40.0799 142.97 40.8499C146.65 41.6299 150.67 42.3799 155.03 43.1199C159.39 43.8599 163.41 45.3899 167.09 47.7099C170.77 50.0299 172.61 54.6199 172.61 61.4899C172.61 64.6499 172.02 67.5099 170.85 70.0699C169.67 72.6399 168.02 74.7899 165.89 76.5199C163.76 78.2499 161.19 79.5799 158.19 80.5099C155.19 81.4399 151.93 81.8999 148.4 81.8999C143.95 81.8999 140.12 81.2699 136.94 79.9999C133.75 78.7299 131.19 77.0799 129.24 75.0399C127.29 72.9999 125.93 70.6899 125.16 68.1299C124.39 65.5599 124.19 62.9499 124.56 60.2899H136.25C136.37 62.0799 136.58 63.7899 136.85 65.3899C137.13 66.9999 137.68 68.4099 138.52 69.6099C139.35 70.8199 140.58 71.7799 142.19 72.4899C143.8 73.1999 145.99 73.5599 148.78 73.5599C153.3 73.5599 156.47 72.6199 158.29 70.7299C160.11 68.8399 161.03 66.6899 161.03 64.2799C161.03 60.2599 159.19 57.7799 155.51 56.8599C151.83 55.9299 147.79 55.0499 143.4 54.2099C139.01 53.3799 134.97 51.7699 131.29 49.3799C127.61 46.9999 125.77 42.3699 125.77 35.5099C125.77 32.8499 126.3 30.3899 127.35 28.1299C128.4 25.8699 129.9 23.9199 131.85 22.2799C133.8 20.6399 136.16 19.3399 138.95 18.3799C141.73 17.4199 144.8 16.9399 148.14 16.9399C152.41 16.9399 156.07 17.4699 159.14 18.5199C162.2 19.5699 164.69 21.0299 166.61 22.8799C168.53 24.7399 169.89 26.9499 170.69 29.5199C171.49 32.0899 171.77 34.8599 171.52 37.8199V37.8399Z" fill="#020203"/>
9
9
  <path d="M179.04 58.1699C179.04 55.0799 179.55 52.0499 180.57 49.0699C181.59 46.0999 183.04 43.4899 184.93 41.2299C186.82 38.9699 189.09 37.1499 191.75 35.7499C194.41 34.3599 197.35 33.6599 200.57 33.6599C207 33.6599 212.15 35.9299 216.02 40.4799C219.89 45.0299 221.97 51.5999 222.28 60.1999H189.34C189.77 64.2199 191.09 67.1499 193.28 68.9699C195.48 70.7999 198.12 71.7099 201.21 71.7099C203 71.7099 204.5 71.4599 205.71 70.9699C206.92 70.4799 207.91 69.8899 208.68 69.2099C209.45 68.5299 210.06 67.8199 210.49 67.0799C210.92 66.3399 211.26 65.7199 211.51 65.2199H221.72C221.6 66.7699 221.1 68.5099 220.24 70.4599C219.37 72.4099 218.14 74.2299 216.53 75.9399C214.92 77.6399 212.85 79.0599 210.31 80.2099C207.77 81.3499 204.77 81.9299 201.31 81.9299C197.85 81.9299 194.91 81.2799 192.12 79.9799C189.34 78.6799 186.98 76.9499 185.07 74.7799C183.15 72.6099 181.67 70.0899 180.61 67.2199C179.56 64.3399 179.03 61.3299 179.03 58.1699H179.04ZM200.94 42.0199C198.47 42.0199 196.24 42.7299 194.26 44.1499C192.28 45.5699 190.89 47.8299 190.08 50.9199H211.33C211.02 48.0799 209.95 45.8799 208.13 44.3299C206.3 42.7899 203.91 42.0099 200.94 42.0099V42.0199Z" fill="#020203"/>
10
10
  <path d="M268.59 80.9999H258.01V50.3799C258.01 48.2099 257.3 46.5099 255.88 45.2799C254.46 44.0399 252.6 43.4199 250.31 43.4199C248.45 43.4199 246.94 43.8399 245.76 44.6699C244.58 45.4999 243.67 46.5399 243.02 47.7799C242.37 49.0199 241.94 50.3799 241.72 51.8599C241.5 53.3399 241.4 54.7099 241.4 55.9399V80.9999H230.82V34.5999H241.03V38.3099C241.83 37.6899 243.27 36.7599 245.34 35.5199C247.41 34.2799 250.3 33.6599 254.02 33.6599C256.68 33.6599 259.12 34.1599 261.35 35.1399C263.58 36.1299 265.31 37.6799 266.55 39.7799C267.04 39.2899 267.71 38.6799 268.55 37.9699C269.38 37.2599 270.41 36.5799 271.61 35.9299C272.82 35.2799 274.22 34.7399 275.83 34.3099C277.44 33.8799 279.23 33.6599 281.21 33.6599C285.23 33.6599 288.67 34.8099 291.51 37.0899C294.36 39.3799 295.78 43.0599 295.78 48.1299V80.9799H285.2V50.3599C285.2 48.1899 284.49 46.4899 283.07 45.2599C281.65 44.0199 279.79 43.3999 277.5 43.3999C275.64 43.3999 274.13 43.8199 272.95 44.6499C271.77 45.4799 270.86 46.5199 270.21 47.7599C269.56 48.9999 269.13 50.3599 268.91 51.8399C268.69 53.3199 268.59 54.6899 268.59 55.9199V80.9799V80.9999Z" fill="#020203"/>
@@ -18,23 +18,23 @@
18
18
  <path d="M67.37 43.9C74.0582 43.9 79.48 38.4782 79.48 31.79C79.48 25.1018 74.0582 19.68 67.37 19.68C60.6818 19.68 55.26 25.1018 55.26 31.79C55.26 38.4782 60.6818 43.9 67.37 43.9Z" fill="#fafafa"/>
19
19
  <path d="M47.5201 77.18H66.2501C73.5601 77.18 79.4801 71.26 79.4801 63.95C79.4801 56.64 73.5601 50.72 66.2501 50.72H47.3601C46.3801 50.72 45.5901 51.52 45.6001 52.5L45.7601 75.44C45.7601 76.41 46.5501 77.19 47.5201 77.19V77.18Z" fill="#07ACDD"/>
20
20
  <path d="M28.4201 76.12C35.1082 76.12 40.5301 70.6982 40.5301 64.01C40.5301 57.3218 35.1082 51.9 28.4201 51.9C21.7319 51.9 16.3101 57.3218 16.3101 64.01C16.3101 70.6982 21.7319 76.12 28.4201 76.12Z" fill="#fafafa"/>
21
- </svg>`)}`),Me=e.computed(()=>{const t=P.value;return t&&t.radialLabels&&t.radialLabels.show===!0}),Tt=e.computed(()=>{const t=P.value;return t&&t.radialLabels&&typeof t.radialLabels.fontSize=="number"?t.radialLabels.fontSize:12});e.computed(()=>{const t=P.value;return t&&t.radialLabels&&t.radialLabels.color?t.radialLabels.color:"#000"});const Pt=e.computed(()=>{const t=P.value;return t&&t.radialLabels&&typeof t.radialLabels.pointerLength=="number"?t.radialLabels.pointerLength:25}),an=e.computed(()=>{const t=P.value;return t&&t.radialLabels&&typeof t.radialLabels.horizontalLength=="number"?t.radialLabels.horizontalLength:40}),so=e.computed(()=>{const t=P.value;return t&&t.radialLabels&&typeof t.radialLabels.textOffset=="number"?t.radialLabels.textOffset:8}),go=e.computed(()=>{const s=P.value?.radialBar?.dataLabels;return s&&(s.show===!0||s.enabled===!0)}),ho=e.computed(()=>{const s=P.value?.radialBar?.dataLabels?.minAngleDegrees;return typeof s=="number"&&s>=0?s:20}),Bn=e.computed(()=>{const s=P.value?.radialBar?.dataCenter;return Bo.value&&s&&(s.show===!0||s.enabled===!0)}),en=e.computed(()=>{if(!Bn.value||!Zn.value.length)return"";const t=Zn.value.reduce((s,o)=>s+(o.value??0),0);return ln(t)}),To=e.computed(()=>{const s=P.value?.radialBar?.dataCenter?.fontSize;return typeof s=="number"&&s>0?s:24}),Vo=e.computed(()=>({x:Je.value,y:at.value-To.value/2})),Vn=e.computed(()=>{const s=P.value?.radialBar?.dataCenter?.color;return typeof s=="string"&&s?s:"#333"}),Io=e.computed(()=>{if(!go.value||!cn.value||!Zn.value.length)return[];const t=ho.value*Math.PI/180,s=(dn.value+Oe.value)/2;return Zn.value.map(o=>{const g=o.endAngle-o.startAngle>=t&&!o.isHidden,h=Je.value+Math.cos(o.midAngle)*s,w=at.value+Math.sin(o.midAngle)*s;return{value:ln(o.value),x:h,y:w,show:g,color:o.color}})}),fn=e.computed(()=>{if(!L.flags||!L.flags.length)return[];const t=new Map;return L.flags.forEach(s=>{const o=s.categoryIndex;t.has(o)||t.set(o,[]),t.get(o).push(s)}),Array.from(t.entries()).map(([s,o])=>{const c=Et(s),g=o.filter(w=>w.manual),h=o.filter(w=>!w.manual);return{categoryIndex:parseInt(s),x:c,flags:o,manualCount:g.length,autoCount:h.length,totalCount:o.length,hasManual:g.length>0,hasAuto:h.length>0,texts:o.map(w=>w.text).join(`
22
- `)}})}),yo=e.ref({show:!1,x:0,y:0,content:"",count:0}),ro=e.computed(()=>P.value?.bubbles?.tooltip?.fields||["x","y","size","label"]),ko=e.computed(()=>{const t=P.value;return{...{x:"X",y:"Y",size:"Size",label:"Label",seriesName:"Series"},...t?.bubbles?.tooltip?.labels||{}}}),Fo=e.computed(()=>P.value?.bubbles?.tooltip?.formatters||{}),Ue=e.ref(new Set),K=e.ref(null),No=e.ref(!1),xe=e.ref({show:!1,x:0,y:0,title:"",value:"",bubbleData:[],spiderSeries:[]}),gn=e.ref({show:!1,x:0,y:0,categoryValue:"",description:""}),G=e.ref({show:!1,x:0,categoryIndex:-1,data:[]}),ve=e.ref({show:!1,x:0,y:0,mouseDataX:0,mouseDataY:0,categoryIndex:-1,chartX:0,chartY:0}),z=e.ref({scale:1,offsetX:0,minScale:1,maxScale:2.5,isDragging:!1,lastMouseX:0,lastMouseY:0,isZooming:!1,zoomTimeout:null}),k=e.ref([]),p=e.ref({show:!1,title:"",description:"",color:"#FF6B6B",type:"default",editingMarkerId:null,readonly:!1,categoryIndex:null,fromButton:!1});e.computed(()=>{const t=["default"];return Mn.value&&t.push(...Object.keys(Mn.value)),t});const V=e.computed(()=>{if(!L.categories||L.categories.length===0){const{maxX:t}=ht.value;return Array.from({length:t+1},(s,o)=>O("chart.fallback.item",{number:o+1}))}return L.categories}),$=e.computed(()=>p.value.editingMarkerId!==null),U=e.computed(()=>p.value.readonly),fe=t=>{Ue.value.has(t)||(Vt.value=!0,K.value=t)},Be=()=>{Vt.value=!1,K.value=null},Ot=t=>{if(pt.value||st.value){G.value.show=!1;return}const o=t.currentTarget.getBoundingClientRect(),c=t.clientX-o.left,g=t.clientY-o.top,h=wt.value?c>=B.value.left-50&&c<=B.value.right+50&&g>=B.value.top-50&&g<=B.value.bottom+100:c>=B.value.left&&c<=B.value.right&&g>=B.value.top&&g<=B.value.bottom;if(No.value=h,wt.value){if(!$t.value||!h||z.value.isDragging||z.value.isZooming){G.value.show=!1;return}if(_o.value.find(q=>!q||q.isHidden?!1:Math.sqrt(Math.pow(q.x-c,2)+Math.pow(q.y-g,2))<=q.radius+3))G.value.show=!1;else{const q=_o.value.filter(ne=>!ne||ne.isHidden?!1:Math.sqrt(Math.pow(ne.x-c,2)+Math.pow(ne.y-g,2))<=250);if(q.length>0){let ne=q[0],Q=Math.sqrt(Math.pow(ne.x-c,2)+Math.pow(ne.y-g,2));q.forEach(ee=>{const oe=Math.sqrt(Math.pow(ee.x-c,2)+Math.pow(ee.y-g,2));oe<Q&&(Q=oe,ne=ee)});const X=30,ge=_o.value.filter(ee=>!ee||ee.isHidden?!1:Math.abs(ee.x-ne.x)<=X).sort((ee,oe)=>ee.y-oe.y);G.value={show:!0,x:ne.x,categoryIndex:Math.round(ne.originalX),data:(()=>{const ee=ro.value,oe=ko.value,re=[];return ge.forEach(de=>{ee.forEach(Re=>{const Ze=oe[Re]||Re,wn=nl(Re,de);wn&&re.push({seriesName:de.seriesName,label:de.label,value:`${Ze}: ${wn}`,color:de.color,y:de.y})})}),re})()}}else G.value.show=!1}return}if(z.value.isDragging&&z.value.scale>1&&qt.value&&Bt.value){G.value.show=!1;const se=t.clientX-z.value.lastMouseX,{minX:q,maxX:ne}=ht.value,Q=ne-q||1,ge=se*.8;z.value.offsetX+=ge;const ee=Q/z.value.scale,oe=Q-ee,re=0,de=-oe/Q*B.value.width,Re=re;z.value.offsetX=Math.max(de,Math.min(Re,z.value.offsetX)),z.value.lastMouseX=t.clientX,z.value.lastMouseY=t.clientY;return}if(!$t.value||!qt.value||z.value.isDragging||z.value.isZooming||!h){G.value.show=!1;return}const{minX:w,maxX:C}=ht.value,S=C-w||1,H=S/z.value.scale,_=w-z.value.offsetX/B.value.width*S,A=(c-B.value.left)/B.value.width,Y=_+A*H,le=Math.round(Y);if(le>=0&&le<=C){const se=Et(le),q=oo.value.map((ne,Q)=>{const X=L.series.findIndex(ee=>ee===ne),ge=ne.data[le];return{seriesName:ne.name,value:ge!==void 0?ge:null,color:yt(X),y:ge!==void 0?Mt(ge):null}}).filter(ne=>ne.value!==null);G.value={show:!0,x:se,categoryIndex:le,data:q}}},Tn=()=>{G.value.show=!1,No.value=!1,st.value=!1,pt.value||(yo.value.show=!1),z.value.isDragging&&(z.value.isDragging=!1),z.value.zoomTimeout&&(clearTimeout(z.value.zoomTimeout),z.value.zoomTimeout=null),z.value.isZooming=!1,setTimeout(()=>{K.value=null,xe.value.show=!1},150)},It=t=>{if(t.preventDefault(),t.stopPropagation(),!vn.value)return;const s=t.currentTarget.getBoundingClientRect(),o=t.clientX-s.left,c=t.clientY-s.top;if(cn.value){ve.value.show=!1,e.nextTick(()=>{ve.value.show=!0,ve.value.x=t.clientX,ve.value.y=t.clientY,ve.value.categoryIndex=null});return}const g=Math.max(0,B.value.left-20),h=B.value.right,w=B.value.top,C=B.value.bottom+80;o>=g&&o<=h&&c>=w&&c<=C&&(ve.value.show=!1,e.nextTick(()=>{ve.value.show=!0,ve.value.x=t.clientX,ve.value.y=t.clientY,ve.value.categoryIndex=null;const S=Math.max(B.value.left,Math.min(o,B.value.right))-B.value.left,_=B.value.width/Ko.value.length,A=Math.floor(S/_);A>=0&&A<Ko.value.length&&(ve.value.categoryIndex=A)}))},Rn=t=>{if(!(t&&t.button===2)){if(ve.value.show&&t&&t.type==="click"){const s=document.querySelector(".dss-context-menu");if(s&&s.contains(t.target))return}ve.value.show=!1}},zo=t=>{if(typeof t.template=="function"){const s={series:L.series,categories:L.categories,markers:k.value},o={chartX:ve.value.chartX,chartY:ve.value.chartY,dataX:ve.value.mouseDataX,dataY:ve.value.mouseDataY,categoryIndex:ve.value.categoryIndex};return t.template(s,o)}return t.template||t.label||""},Xn=t=>{const s=["dss-context-menu-item"];return t.cssClass&&s.push(t.cssClass),s},sn=t=>t.style||{},Po=t=>t.type&&Mn.value[t.type]?Mn.value[t.type]:t.customIcon?t.customIcon:Qt.value,Ft=t=>t==null?"":L.categories&&L.categories[t]?L.categories[t]:"",Yn=t=>k.value.length?k.value.filter(s=>s.categoryIndex===t):[],El=t=>{if(!qt.value&&!wt.value)return{x:0,y:0};const s=Et(t),o=Le.value+B.value.bottom-Jt.value/2;return{x:s,y:o}},Oo=()=>{k.value.forEach(t=>{if(t.categoryIndex!==void 0&&(qt.value||wt.value)){const s=El(t.categoryIndex);t.x=s.x,t.y=s.y}})},cl=()=>{if(p.value.description&&p.value.description.length){if($.value){const t=k.value.findIndex(s=>s.id===p.value.editingMarkerId);t!==-1?(k.value[t].description=p.value.description||"",k.value[t].color=p.value.color||"",k.value[t].type=p.value.type||"default",Ie("update-marker",k.value[t])):Ie("update-marker",{id:p.value.editingMarkerId,description:p.value.description||"",color:p.value.color||"",type:p.value.type||"default"})}else{const t="dss-marker-"+Date.now()+"-"+Math.random().toString(36).substring(2,9);let s=Math.max(0,p.value.categoryIndex);if(wt.value){const{maxX:w}=ht.value;s=Math.max(0,Math.min(s,Math.floor(w)))}else qt.value&&(s=Math.max(0,Math.min(s,ht.value.maxX)));const o=Et(s),c=Le.value+B.value.bottom-Jt.value/2,g=Array.isArray(L.categories)?L.categories[s]:null,h={id:t,title:"",description:p.value.description||"",color:p.value.color||"",type:p.value.type||"default",categoryIndex:s,x:o,y:c,marker_date:g||null};p.value.categoryIndex=s,k.value.push(h),Ie("add-marker",h)}St(),Zo()}},St=()=>{p.value.show=!1,p.value.title="",p.value.description="",p.value.color="#FF6B6B",p.value.type="default",p.value.editingMarkerId=null,p.value.readonly=!1,p.value.categoryIndex=null,p.value.fromButton=!1},dl=()=>{$.value&&(ul(p.value.editingMarkerId),St())},ul=t=>{const s=k.value.findIndex(o=>o.id===t);s!==-1&&(k.value.splice(s,1),Zo()),Ie("delete-marker",t)},ml=t=>{p.value.show=!0,p.value.title=t?.title??t?.comment??"",p.value.description=t?.description??t?.comment??"",p.value.color=t?.color??"",p.value.type=t?.type??"default",p.value.editingMarkerId=t?.id??t?.marker_id??null,p.value.readonly=t?.readonly??!1,p.value.categoryIndex=t?.categoryIndex??null},Zo=()=>{try{const t=`dss-chart-markers-${L.chartId}`;localStorage.setItem(t,JSON.stringify(k.value))}catch(t){console.warn("Could not save markers to localStorage:",t)}},pl=()=>{try{const t=`dss-chart-markers-${L.chartId}`,s=localStorage.getItem(t);if(s){const o=JSON.parse(s);Array.isArray(o)&&(k.value=o.map(c=>({...c,originalYOffset:c.originalYOffset!==void 0?c.originalYOffset:15})))}}catch(t){console.warn("Could not load markers from localStorage:",t),k.value=[]}},Zt=t=>{const s=Ce.value||"Chart",o=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"}-${o}.${t}`},Wo=()=>{const t=G.value.show,s=xe.value.show;return G.value.show=!1,xe.value.show=!1,{originalCrosshair:t,originalTooltip:s}},io=t=>{G.value.show=t.originalCrosshair,xe.value.show=t.originalTooltip},Wt=async(t,s=32,o=32)=>new Promise((c,g)=>{if(t.startsWith("data:")){c(t);return}const h=new Image;h.crossOrigin="anonymous";const w=setTimeout(()=>{console.warn("Image conversion timeout for:",t),c(t)},5e3);h.onload=()=>{clearTimeout(w);try{const C=document.createElement("canvas"),S=C.getContext("2d");C.width=s,C.height=o,S.fillStyle="#fafafa",S.fillRect(0,0,s,o),S.drawImage(h,0,0,s,o);const H=C.toDataURL("image/png");c(H)}catch(C){console.warn("Canvas conversion failed:",C),c(t)}},h.onerror=C=>{clearTimeout(w),console.warn("Failed to load image:",t,C),c(t)},h.src=t}),jn=async()=>{try{const t=Wo();setTimeout(async()=>{try{const s=document.querySelector(".dss-chart-svg");if(!s){console.error("Chart SVG element not found"),io(t);return}const o=_t(),c=pe.value,g=Qe.value+o.height,h=s.cloneNode(!0);h.querySelectorAll(".dss-flag-markers, .dss-flag-line, .dss-flag-extension-line, .dss-flag-count-indicator, .dss-flag-count-text").forEach(X=>X.remove());const C=h.querySelectorAll("image"),S=Array.from(C).map(async X=>{const ge=X.getAttribute("xlink:href")||X.getAttribute("href");if(ge&&!ge.startsWith("data:"))try{const ee=await Wt(ge,32,32);X.setAttribute("xlink:href",ee),X.setAttribute("href",ee)}catch(ee){console.warn("Failed to convert logo to base64:",ee)}});await Promise.all(S);const _=new XMLSerializer().serializeToString(h).replace(/<svg[^>]*>/,"").replace("</svg>","");let A="",Y=30;if(Ce.value&&(A+=`
23
- <text x="24" y="${Y}"
21
+ </svg>`)}`),Ht=e.computed(()=>{const t=F.value;return t&&t.radialLabels&&t.radialLabels.show===!0}),nn=e.computed(()=>{const t=F.value;return t&&t.radialLabels&&typeof t.radialLabels.fontSize=="number"?t.radialLabels.fontSize:12});e.computed(()=>{const t=F.value;return t&&t.radialLabels&&t.radialLabels.color?t.radialLabels.color:"#000"});const jn=e.computed(()=>{const t=F.value;return t&&t.radialLabels&&typeof t.radialLabels.pointerLength=="number"?t.radialLabels.pointerLength:25}),go=e.computed(()=>{const t=F.value;return t&&t.radialLabels&&typeof t.radialLabels.horizontalLength=="number"?t.radialLabels.horizontalLength:40}),ho=e.computed(()=>{const t=F.value;return t&&t.radialLabels&&typeof t.radialLabels.textOffset=="number"?t.radialLabels.textOffset:8}),Ln=e.computed(()=>{const s=F.value?.radialBar?.dataLabels;return s&&(s.show===!0||s.enabled===!0)}),Gt=e.computed(()=>{const s=F.value?.radialBar?.dataLabels?.minAngleDegrees;return typeof s=="number"&&s>=0?s:20}),Lo=e.computed(()=>{const s=F.value?.radialBar?.dataCenter;return eo.value&&s&&(s.show===!0||s.enabled===!0)}),_o=e.computed(()=>{if(!Lo.value||!Xn.value.length)return"";const n=F.value?.radialBar?.dataCenter?.showValueOnly===!0?Xn.value[0]?.value??0:Xn.value.reduce((c,f)=>c+(f.value??0),0);return Wt(n)}),yn=e.computed(()=>{const s=F.value?.radialBar?.dataCenter?.fontSize;return typeof s=="number"&&s>0?s:24}),Ao=e.computed(()=>({x:We.value,y:qe.value-yn.value/2})),kn=e.computed(()=>{const s=F.value?.radialBar?.dataCenter?.color;return typeof s=="string"&&s?s:"#333"}),Do=e.computed(()=>{if(!Ln.value||!rn.value||!Xn.value.length)return[];const t=Gt.value*Math.PI/180,s=(tt.value+Ne.value)/2;return Xn.value.map(n=>{const f=n.endAngle-n.startAngle>=t&&!n.isHidden,h=We.value+Math.cos(n.midAngle)*s,w=qe.value+Math.sin(n.midAngle)*s;return{value:Wt(n.value),x:h,y:w,show:f,color:n.color}})}),ao=e.computed(()=>{if(!A.flags||!A.flags.length)return[];const t=new Map;return A.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 c=ht(s),f=n.filter(w=>w.manual),h=n.filter(w=>!w.manual);return{categoryIndex:parseInt(s),x:c,flags:n,manualCount:f.length,autoCount:h.length,totalCount:n.length,hasManual:f.length>0,hasAuto:h.length>0,texts:n.map(w=>w.text).join(`
22
+ `)}})}),so=e.ref({show:!1,x:0,y:0,content:"",count:0}),Ro=e.computed(()=>F.value?.bubbles?.tooltip?.fields||["x","y","size","label"]),ro=e.computed(()=>{const t=F.value;return{...{x:"X",y:"Y",size:"Size",label:"Label",seriesName:"Series"},...t?.bubbles?.tooltip?.labels||{}}}),io=e.computed(()=>F.value?.bubbles?.tooltip?.formatters||{}),ot=e.ref(new Set),J=e.ref(null),Kn=e.ref(!1),ae=e.ref({show:!1,x:0,y:0,title:"",value:"",bubbleData:[],spiderSeries:[]}),wt=e.ref({show:!1,x:0,y:0,categoryValue:"",description:""}),ce=e.ref({show:!1,x:0,categoryIndex:-1,data:[]}),k=e.ref({show:!1,x:0,y:0,mouseDataX:0,mouseDataY:0,categoryIndex:-1,chartX:0,chartY:0}),m=e.ref({scale:1,offsetX:0,minScale:1,maxScale:2.5,isDragging:!1,lastMouseX:0,lastMouseY:0,isZooming:!1,zoomTimeout:null}),E=e.ref([]),x=e.ref({show:!1,title:"",description:"",color:"#FF6B6B",type:"default",editingMarkerId:null,readonly:!1,categoryIndex:null,fromButton:!1});e.computed(()=>{const t=["default"];return Hn.value&&t.push(...Object.keys(Hn.value)),t});const X=e.computed(()=>{if(!A.categories||A.categories.length===0){const{maxX:t}=it.value;return Array.from({length:t+1},(s,n)=>P("chart.fallback.item",{number:n+1}))}return A.categories}),ue=e.computed(()=>x.value.editingMarkerId!==null),be=e.computed(()=>x.value.readonly),zt=t=>{ot.value.has(t)||(bn.value=!0,J.value=t)},En=()=>{bn.value=!1,J.value=null},Pt=t=>{if(Eo.value||Mn.value){ce.value.show=!1;return}const n=t.currentTarget.getBoundingClientRect(),c=t.clientX-n.left,f=t.clientY-n.top,h=dt.value?c>=H.value.left-50&&c<=H.value.right+50&&f>=H.value.top-50&&f<=H.value.bottom+100:c>=H.value.left&&c<=H.value.right&&f>=H.value.top&&f<=H.value.bottom;if(Kn.value=h,dt.value){if(!vt.value||!h||m.value.isDragging||m.value.isZooming){ce.value.show=!1;return}if(cn.value.find(Z=>!Z||Z.isHidden?!1:Math.sqrt(Math.pow(Z.x-c,2)+Math.pow(Z.y-f,2))<=Z.radius+3))ce.value.show=!1;else{const Z=cn.value.filter(ee=>!ee||ee.isHidden?!1:Math.sqrt(Math.pow(ee.x-c,2)+Math.pow(ee.y-f,2))<=250);if(Z.length>0){let ee=Z[0],K=Math.sqrt(Math.pow(ee.x-c,2)+Math.pow(ee.y-f,2));Z.forEach(te=>{const G=Math.sqrt(Math.pow(te.x-c,2)+Math.pow(te.y-f,2));G<K&&(K=G,ee=te)});const U=30,me=cn.value.filter(te=>!te||te.isHidden?!1:Math.abs(te.x-ee.x)<=U).sort((te,G)=>te.y-G.y);ce.value={show:!0,x:ee.x,categoryIndex:Math.round(ee.originalX),data:(()=>{const te=Ro.value,G=ro.value,se=[];return me.forEach(re=>{te.forEach(De=>{const Re=G[De]||De,dn=i(De,re);dn&&se.push({seriesName:re.seriesName,label:re.label,value:`${Re}: ${dn}`,color:re.color,y:re.y})})}),se})()}}else ce.value.show=!1}return}if(m.value.isDragging&&m.value.scale>1&&Lt.value&&Vt.value){ce.value.show=!1;const le=t.clientX-m.value.lastMouseX,{minX:Z,maxX:ee}=it.value,K=ee-Z||1,me=le*.8;m.value.offsetX+=me;const te=K/m.value.scale,G=K-te,se=0,re=-G/K*H.value.width,De=se;m.value.offsetX=Math.max(re,Math.min(De,m.value.offsetX)),m.value.lastMouseX=t.clientX,m.value.lastMouseY=t.clientY;return}if(!vt.value||!Lt.value||m.value.isDragging||m.value.isZooming||!h){ce.value.show=!1;return}const{minX:w,maxX:C}=it.value,M=C-w||1,L=M/m.value.scale,T=w-m.value.offsetX/H.value.width*M,B=(c-H.value.left)/H.value.width,q=T+B*L,j=Math.round(q);if(j>=0&&j<=C){const le=ht(j),Z=po.value.map((ee,K)=>{const U=A.series.findIndex(te=>te===ee),me=ee.data[j];return{seriesName:ee.name,value:me!==void 0?me:null,color:ut(U),y:me!==void 0?_t(me):null}}).filter(ee=>ee.value!==null);ce.value={show:!0,x:le,categoryIndex:j,data:Z}}},Oo=()=>{ce.value.show=!1,Kn.value=!1,Mn.value=!1,Eo.value||(so.value.show=!1),m.value.isDragging&&(m.value.isDragging=!1),m.value.zoomTimeout&&(clearTimeout(m.value.zoomTimeout),m.value.zoomTimeout=null),m.value.isZooming=!1,setTimeout(()=>{J.value=null,ae.value.show=!1},150)},Zo=t=>{if(t.preventDefault(),t.stopPropagation(),!Ct.value)return;const s=t.currentTarget.getBoundingClientRect(),n=t.clientX-s.left,c=t.clientY-s.top;if(rn.value){k.value.show=!1,e.nextTick(()=>{k.value.show=!0,k.value.x=t.clientX,k.value.y=t.clientY,k.value.categoryIndex=null});return}const f=Math.max(0,H.value.left-20),h=H.value.right,w=H.value.top,C=H.value.bottom+80;n>=f&&n<=h&&c>=w&&c<=C&&(k.value.show=!1,e.nextTick(()=>{k.value.show=!0,k.value.x=t.clientX,k.value.y=t.clientY,k.value.categoryIndex=null;const M=Math.max(H.value.left,Math.min(n,H.value.right))-H.value.left,T=H.value.width/el.value.length,B=Math.floor(M/T);B>=0&&B<el.value.length&&(k.value.categoryIndex=B)}))},on=t=>{if(!(t&&t.button===2)){if(k.value.show&&t&&t.type==="click"){const s=document.querySelector(".dss-context-menu");if(s&&s.contains(t.target))return}k.value.show=!1}},ln=t=>{if(typeof t.template=="function"){const s={series:A.series,categories:A.categories,markers:E.value},n={chartX:k.value.chartX,chartY:k.value.chartY,dataX:k.value.mouseDataX,dataY:k.value.mouseDataY,categoryIndex:k.value.categoryIndex};return t.template(s,n)}return t.template||t.label||""},cl=t=>{const s=["dss-context-menu-item"];return t.cssClass&&s.push(t.cssClass),s},qt=t=>t.style||{},zn=t=>t.type&&Hn.value[t.type]?Hn.value[t.type]:t.customIcon?t.customIcon:$n.value,dl=t=>t==null?"":A.categories&&A.categories[t]?A.categories[t]:"",ul=t=>E.value.length?E.value.filter(s=>s.categoryIndex===t):[],ml=t=>{if(!Lt.value&&!dt.value)return{x:0,y:0};const s=ht(t),n=He.value+H.value.bottom-vn.value/2;return{x:s,y:n}},Qt=()=>{E.value.forEach(t=>{if(t.categoryIndex!==void 0&&(Lt.value||dt.value)){const s=ml(t.categoryIndex);t.x=s.x,t.y=s.y}})},pl=()=>{if(x.value.description&&x.value.description.length){if(ue.value){const t=E.value.findIndex(s=>s.id===x.value.editingMarkerId);t!==-1?(E.value[t].description=x.value.description||"",E.value[t].color=x.value.color||"",E.value[t].type=x.value.type||"default",Pe("update-marker",E.value[t])):Pe("update-marker",{id:x.value.editingMarkerId,description:x.value.description||"",color:x.value.color||"",type:x.value.type||"default"})}else{const t="dss-marker-"+Date.now()+"-"+Math.random().toString(36).substring(2,9);let s=Math.max(0,x.value.categoryIndex);if(dt.value){const{maxX:w}=it.value;s=Math.max(0,Math.min(s,Math.floor(w)))}else Lt.value&&(s=Math.max(0,Math.min(s,it.value.maxX)));const n=ht(s),c=He.value+H.value.bottom-vn.value/2,f=Array.isArray(A.categories)?A.categories[s]:null,h={id:t,title:"",description:x.value.description||"",color:x.value.color||"",type:x.value.type||"default",categoryIndex:s,x:n,y:c,marker_date:f||null};x.value.categoryIndex=s,E.value.push(h),Pe("add-marker",h)}Gn(),an()}},Gn=()=>{x.value.show=!1,x.value.title="",x.value.description="",x.value.color="#FF6B6B",x.value.type="default",x.value.editingMarkerId=null,x.value.readonly=!1,x.value.categoryIndex=null,x.value.fromButton=!1},vl=()=>{ue.value&&(fl(x.value.editingMarkerId),Gn())},fl=t=>{const s=E.value.findIndex(n=>n.id===t);s!==-1&&(E.value.splice(s,1),an()),Pe("delete-marker",t)},gl=t=>{x.value.show=!0,x.value.title=t?.title??t?.comment??"",x.value.description=t?.description??t?.comment??"",x.value.color=t?.color??"",x.value.type=t?.type??"default",x.value.editingMarkerId=t?.id??t?.marker_id??null,x.value.readonly=t?.readonly??!1,x.value.categoryIndex=t?.categoryIndex??null},an=()=>{try{const t=`dss-chart-markers-${A.chartId}`;localStorage.setItem(t,JSON.stringify(E.value))}catch(t){console.warn("Could not save markers to localStorage:",t)}},hl=()=>{try{const t=`dss-chart-markers-${A.chartId}`,s=localStorage.getItem(t);if(s){const n=JSON.parse(s);Array.isArray(n)&&(E.value=n.map(c=>({...c,originalYOffset:c.originalYOffset!==void 0?c.originalYOffset:15})))}}catch(t){console.warn("Could not load markers from localStorage:",t),E.value=[]}},Io=t=>{const s=Ue.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}`},Ot=()=>{const t=ce.value.show,s=ae.value.show;return ce.value.show=!1,ae.value.show=!1,{originalCrosshair:t,originalTooltip:s}},sn=t=>{ce.value.show=t.originalCrosshair,ae.value.show=t.originalTooltip},yo=async(t,s=32,n=32)=>new Promise((c,f)=>{if(t.startsWith("data:")){c(t);return}const h=new Image;h.crossOrigin="anonymous";const w=setTimeout(()=>{console.warn("Image conversion timeout for:",t),c(t)},5e3);h.onload=()=>{clearTimeout(w);try{const C=document.createElement("canvas"),M=C.getContext("2d");C.width=s,C.height=n,M.fillStyle="#fafafa",M.fillRect(0,0,s,n),M.drawImage(h,0,0,s,n);const L=C.toDataURL("image/png");c(L)}catch(C){console.warn("Canvas conversion failed:",C),c(t)}},h.onerror=C=>{clearTimeout(w),console.warn("Failed to load image:",t,C),c(t)},h.src=t}),Pn=async()=>{try{const t=Ot();setTimeout(async()=>{try{const s=document.querySelector(".dss-chart-svg");if(!s){console.error("Chart SVG element not found"),sn(t);return}const n=At(),c=pe.value,f=lt.value+n.height,h=s.cloneNode(!0);h.querySelectorAll(".dss-flag-markers, .dss-flag-line, .dss-flag-extension-line, .dss-flag-count-indicator, .dss-flag-count-text").forEach(U=>U.remove());const C=h.querySelectorAll("image"),M=Array.from(C).map(async U=>{const me=U.getAttribute("xlink:href")||U.getAttribute("href");if(me&&!me.startsWith("data:"))try{const te=await yo(me,32,32);U.setAttribute("xlink:href",te),U.setAttribute("href",te)}catch(te){console.warn("Failed to convert logo to base64:",te)}});await Promise.all(M);const T=new XMLSerializer().serializeToString(h).replace(/<svg[^>]*>/,"").replace("</svg>","");let B="",q=30;if(Ue.value&&(B+=`
23
+ <text x="24" y="${q}"
24
24
  font-family="Arial, sans-serif"
25
25
  font-size="18"
26
26
  font-weight="bold"
27
27
  fill="#333">
28
- ${Ce.value.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}
29
- </text>`,Y+=30),Nt.value&&(A+=`
30
- <text x="24" y="${Y}"
28
+ ${Ue.value.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}
29
+ </text>`,q+=30),$e.value&&(B+=`
30
+ <text x="24" y="${q}"
31
31
  font-family="Arial, sans-serif"
32
32
  font-size="14"
33
33
  fill="#666">
34
- ${Nt.value.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}
35
- </text>`,Y+=25),dt.value&&L.series.length>0){let X=c-200,ge=Ce.value||Nt.value?35:25;const ee=Math.floor((c-250)/120);let oe=0;L.series.forEach((re,de)=>{if(!Ue.value.has(de)){const Re=yt(de),Ze=re.name.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;");A+=`<circle cx="${X+6}" cy="${ge-4}" r="6" fill="${Re}"/>`,A+=`<text x="${X+18}" y="${ge}" font-family="Arial, sans-serif" font-size="12" fill="#333">${Ze}</text>`,oe++,oe%ee===0?(X=c-200,ge+=20):X+=Math.min(120,Ze.length*8+35)}})}let le="";if(Dn.value)try{const{width:X,height:ge}=W.value,ee=T.value,oe=B.value.left,re=B.value.right,de=B.value.top,Re=B.value.bottom,Ze=B.value.width,wn=B.value.height;let zt,ao;switch(ee){case"center":zt=oe+(Ze-X)/2,ao=de+(wn-ge)/2;break;case"top-left":zt=oe+15,ao=de+5;break;case"top-right":zt=re-X-5,ao=de+5;break;case"bottom-left":zt=oe+15,ao=Re-ge-5;break;case"bottom-right":default:zt=re-X-5,ao=Re-ge-5;break}le=`
36
- <g opacity="${M.value}">
37
- <g transform="translate(${zt}, ${ao}) scale(${X/499})">
34
+ ${$e.value.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}
35
+ </text>`,q+=25),pt.value&&A.series.length>0){let U=c-200,me=Ue.value||$e.value?35:25;const te=Math.floor((c-250)/120);let G=0;A.series.forEach((se,re)=>{if(!ot.value.has(re)){const De=ut(re),Re=se.name.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;");B+=`<circle cx="${U+6}" cy="${me-4}" r="6" fill="${De}"/>`,B+=`<text x="${U+18}" y="${me}" font-family="Arial, sans-serif" font-size="12" fill="#333">${Re}</text>`,G++,G%te===0?(U=c-200,me+=20):U+=Math.min(120,Re.length*8+35)}})}let j="";if(D.value)try{const{width:U,height:me}=he.value,te=ne.value,G=H.value.left,se=H.value.right,re=H.value.top,De=H.value.bottom,Re=H.value.width,dn=H.value.height;let Et,oo;switch(te){case"center":Et=G+(Re-U)/2,oo=re+(dn-me)/2;break;case"top-left":Et=G+15,oo=re+5;break;case"top-right":Et=se-U-5,oo=re+5;break;case"bottom-left":Et=G+15,oo=De-me-5;break;case"bottom-right":default:Et=se-U-5,oo=De-me-5;break}j=`
36
+ <g opacity="${_.value}">
37
+ <g transform="translate(${Et}, ${oo}) scale(${U/499})">
38
38
  <path d="M171.52 37.8399H160.38C160.26 36.4799 160.02 35.0599 159.68 33.5699C159.34 32.0799 158.77 30.7399 157.96 29.5299C157.16 28.3199 156 27.3199 154.48 26.5099C152.96 25.7099 150.94 25.2999 148.4 25.2999C144.69 25.2999 141.93 26.1299 140.14 27.8099C138.34 29.4799 137.45 31.5499 137.45 34.0299C137.45 37.7999 139.29 40.0799 142.97 40.8499C146.65 41.6299 150.67 42.3799 155.03 43.1199C159.39 43.8599 163.41 45.3899 167.09 47.7099C170.77 50.0299 172.61 54.6199 172.61 61.4899C172.61 64.6499 172.02 67.5099 170.85 70.0699C169.67 72.6399 168.02 74.7899 165.89 76.5199C163.76 78.2499 161.19 79.5799 158.19 80.5099C155.19 81.4399 151.93 81.8999 148.4 81.8999C143.95 81.8999 140.12 81.2699 136.94 79.9999C133.75 78.7299 131.19 77.0799 129.24 75.0399C127.29 72.9999 125.93 70.6899 125.16 68.1299C124.39 65.5599 124.19 62.9499 124.56 60.2899H136.25C136.37 62.0799 136.58 63.7899 136.85 65.3899C137.13 66.9999 137.68 68.4099 138.52 69.6099C139.35 70.8199 140.58 71.7799 142.19 72.4899C143.8 73.1999 145.99 73.5599 148.78 73.5599C153.3 73.5599 156.47 72.6199 158.29 70.7299C160.11 68.8399 161.03 66.6899 161.03 64.2799C161.03 60.2599 159.19 57.7799 155.51 56.8599C151.83 55.9299 147.79 55.0499 143.4 54.2099C139.01 53.3799 134.97 51.7699 131.29 49.3799C127.61 46.9999 125.77 42.3699 125.77 35.5099C125.77 32.8499 126.3 30.3899 127.35 28.1299C128.4 25.8699 129.9 23.9199 131.85 22.2799C133.8 20.6399 136.16 19.3399 138.95 18.3799C141.73 17.4199 144.8 16.9399 148.14 16.9399C152.41 16.9399 156.07 17.4699 159.14 18.5199C162.2 19.5699 164.69 21.0299 166.61 22.8799C168.53 24.7399 169.89 26.9499 170.69 29.5199C171.49 32.0899 171.77 34.8599 171.52 37.8199V37.8399Z" fill="#020203"/>
39
39
  <path d="M179.04 58.1699C179.04 55.0799 179.55 52.0499 180.57 49.0699C181.59 46.0999 183.04 43.4899 184.93 41.2299C186.82 38.9699 189.09 37.1499 191.75 35.7499C194.41 34.3599 197.35 33.6599 200.57 33.6599C207 33.6599 212.15 35.9299 216.02 40.4799C219.89 45.0299 221.97 51.5999 222.28 60.1999H189.34C189.77 64.2199 191.09 67.1499 193.28 68.9699C195.48 70.7999 198.12 71.7099 201.21 71.7099C203 71.7099 204.5 71.4599 205.71 70.9699C206.92 70.4799 207.91 69.8899 208.68 69.2099C209.45 68.5299 210.06 67.8199 210.49 67.0799C210.92 66.3399 211.26 65.7199 211.51 65.2199H221.72C221.6 66.7699 221.1 68.5099 220.24 70.4599C219.37 72.4099 218.14 74.2299 216.53 75.9399C214.92 77.6399 212.85 79.0599 210.31 80.2099C207.77 81.3499 204.77 81.9299 201.31 81.9299C197.85 81.9299 194.91 81.2799 192.12 79.9799C189.34 78.6799 186.98 76.9499 185.07 74.7799C183.15 72.6099 181.67 70.0899 180.61 67.2199C179.56 64.3399 179.03 61.3299 179.03 58.1699H179.04ZM200.94 42.0199C198.47 42.0199 196.24 42.7299 194.26 44.1499C192.28 45.5699 190.89 47.8299 190.08 50.9199H211.33C211.02 48.0799 209.95 45.8799 208.13 44.3299C206.3 42.7899 203.91 42.0099 200.94 42.0099V42.0199Z" fill="#020203"/>
40
40
  <path d="M268.59 80.9999H258.01V50.3799C258.01 48.2099 257.3 46.5099 255.88 45.2799C254.46 44.0399 252.6 43.4199 250.31 43.4199C248.45 43.4199 246.94 43.8399 245.76 44.6699C244.58 45.4999 243.67 46.5399 243.02 47.7799C242.37 49.0199 241.94 50.3799 241.72 51.8599C241.5 53.3399 241.4 54.7099 241.4 55.9399V80.9999H230.82V34.5999H241.03V38.3099C241.83 37.6899 243.27 36.7599 245.34 35.5199C247.41 34.2799 250.3 33.6599 254.02 33.6599C256.68 33.6599 259.12 34.1599 261.35 35.1399C263.58 36.1299 265.31 37.6799 266.55 39.7799C267.04 39.2899 267.71 38.6799 268.55 37.9699C269.38 37.2599 270.41 36.5799 271.61 35.9299C272.82 35.2799 274.22 34.7399 275.83 34.3099C277.44 33.8799 279.23 33.6599 281.21 33.6599C285.23 33.6599 288.67 34.8099 291.51 37.0899C294.36 39.3799 295.78 43.0599 295.78 48.1299V80.9799H285.2V50.3599C285.2 48.1899 284.49 46.4899 283.07 45.2599C281.65 44.0199 279.79 43.3999 277.5 43.3999C275.64 43.3999 274.13 43.8199 272.95 44.6499C271.77 45.4799 270.86 46.5199 270.21 47.7599C269.56 48.9999 269.13 50.3599 268.91 51.8399C268.69 53.3199 268.59 54.6899 268.59 55.9199V80.9799V80.9999Z" fill="#020203"/>
@@ -49,8 +49,8 @@
49
49
  <path d="M47.5201 77.18H66.2501C73.5601 77.18 79.4801 71.26 79.4801 63.95C79.4801 56.64 73.5601 50.72 66.2501 50.72H47.3601C46.3801 50.72 45.5901 51.52 45.6001 52.5L45.7601 75.44C45.7601 76.41 46.5501 77.19 47.5201 77.19V77.18Z" fill="#07ACDD"/>
50
50
  <path d="M28.4201 76.12C35.1082 76.12 40.5301 70.6982 40.5301 64.01C40.5301 57.3218 35.1082 51.9 28.4201 51.9C21.7319 51.9 16.3101 57.3218 16.3101 64.01C16.3101 70.6982 21.7319 76.12 28.4201 76.12Z" fill="#fafafa"/>
51
51
  </g>
52
- </g>`}catch(X){console.warn("Watermark processing failed, skipping watermark in SVG:",X),le=""}const se=`<?xml version="1.0" encoding="UTF-8"?>
53
- <svg width="${c}" height="${g}"
52
+ </g>`}catch(U){console.warn("Watermark processing failed, skipping watermark in SVG:",U),j=""}const le=`<?xml version="1.0" encoding="UTF-8"?>
53
+ <svg width="${c}" height="${f}"
54
54
  xmlns="http://www.w3.org/2000/svg"
55
55
  xmlns:xlink="http://www.w3.org/1999/xlink">
56
56
  <defs>
@@ -61,20 +61,20 @@
61
61
  </style>
62
62
  </defs>
63
63
  <rect width="100%" height="100%" fill="#fafafa"/>
64
- ${A}
65
- <g transform="translate(0, ${o.height})">
66
- ${_}
67
- ${le}
64
+ ${B}
65
+ <g transform="translate(0, ${n.height})">
66
+ ${T}
67
+ ${j}
68
68
  </g>
69
- </svg>`,q=new Blob([se],{type:"image/svg+xml;charset=utf-8"}),ne=URL.createObjectURL(q),Q=document.createElement("a");Q.href=ne,Q.download=Zt("svg"),document.body.appendChild(Q),Q.click(),document.body.removeChild(Q),URL.revokeObjectURL(ne),io(t),Rn()}catch(s){console.error("Error downloading SVG:",s),io(t)}},50)}catch(t){console.error("Error downloading SVG:",t)}},Co=async()=>{try{const t=Wo();document.querySelector(".dss-custom-chart-container").offsetHeight,await new Promise(X=>setTimeout(X,300));const s=_t(),o=pe.value,c=Qe.value+s.height,g=document.createElement("canvas"),h=g.getContext("2d"),w=2;g.width=o*w,g.height=c*w,g.style.width=o+"px",g.style.height=c+"px",h.scale(w,w),h.fillStyle="#fafafa",h.fillRect(0,0,o,c);let C=30;if(Ce.value&&(h.fillStyle="#333",h.font="bold 18px Arial, sans-serif",h.fillText(Ce.value,24,C),C+=30),Nt.value&&(h.fillStyle="#666",h.font="14px Arial, sans-serif",h.fillText(Nt.value,24,C),C+=25),dt.value&&L.series.length>0){let X=o-200,ge=Ce.value||Nt.value?35:25;const ee=Math.floor((o-250)/120);let oe=0;h.font="12px Arial, sans-serif",L.series.forEach((re,de)=>{if(!Ue.value.has(de)){const Re=yt(de);h.beginPath(),h.arc(X+6,ge-4,6,0,2*Math.PI),h.fillStyle=Re,h.fill(),h.fillStyle="#333",h.fillText(re.name,X+18,ge),oe++,oe%ee===0?(X=o-200,ge+=20):X+=Math.min(120,re.name.length*8+35)}})}const H=document.querySelector(".dss-chart-svg").cloneNode(!0),_=H.querySelectorAll(".dss-flag-markers, .dss-flag-line, .dss-flag-extension-line, .dss-flag-count-indicator, .dss-flag-count-text"),A=H.querySelectorAll(".dss-crosshair"),Y=H.querySelectorAll('[class*="tooltip"]');_.forEach(X=>X.remove()),A.forEach(X=>X.remove()),Y.forEach(X=>X.remove()),H.querySelectorAll("image").forEach((X,ge)=>{const ee=X.getAttribute("xlink:href")||X.getAttribute("href");if(ee&&!ee.startsWith("data:")){const oe=F.value[ge],re=oe?yt(oe.seriesIndex):"#3B82F6",de=X.getAttribute("x")||0,Re=X.getAttribute("y")||0,Ze=X.getAttribute("width")||32,wn=X.getAttribute("height")||32,zt=document.createElementNS("http://www.w3.org/2000/svg","circle");zt.setAttribute("cx",parseFloat(de)+parseFloat(Ze)/2),zt.setAttribute("cy",parseFloat(Re)+parseFloat(wn)/2),zt.setAttribute("r",Math.min(parseFloat(Ze),parseFloat(wn))/2-1),zt.setAttribute("fill",re),zt.setAttribute("stroke","#fafafa"),zt.setAttribute("stroke-width","2"),X.parentNode.replaceChild(zt,X)}});const se=new XMLSerializer().serializeToString(H),q=new Blob([se],{type:"image/svg+xml;charset=utf-8"}),ne=URL.createObjectURL(q),Q=new Image;return new Promise((X,ge)=>{Q.onload=async()=>{try{if(h.drawImage(Q,0,s.height),F.value.forEach(ee=>{const oe=ee.x,re=ee.y+s.height,de=(ee.width||32)/2,Re=yt(ee.seriesIndex);h.save(),h.beginPath(),h.arc(oe,re,de-1,0,2*Math.PI),h.fillStyle=Re,h.fill(),h.strokeStyle="#fafafa",h.lineWidth=2,h.stroke(),h.restore()}),Dn.value){const ee=new Image,oe=()=>{const{width:de,height:Re}=W.value,Ze=T.value,wn=B.value.left,zt=B.value.right,ao=B.value.top,Fl=B.value.bottom,Ol=B.value.width,Zl=B.value.height;let Do,Ro;switch(Ze){case"center":Do=wn+(Ol-de)/2,Ro=ao+s.height+(Zl-Re)/2;break;case"top-left":Do=wn+15,Ro=ao+s.height+10;break;case"top-right":Do=zt-de-5,Ro=ao+s.height+10;break;case"bottom-left":Do=wn+15,Ro=Fl+s.height-Re-5;break;case"bottom-right":default:Do=zt-de-5,Ro=Fl+s.height-Re-5;break}h.globalAlpha=M.value,h.drawImage(ee,Do,Ro,de,Re),h.globalAlpha=1,re()},re=()=>{g.toBlob(de=>{const Re=URL.createObjectURL(de),Ze=document.createElement("a");Ze.href=Re,Ze.download=Zt("png"),document.body.appendChild(Ze),Ze.click(),document.body.removeChild(Ze),URL.revokeObjectURL(Re),URL.revokeObjectURL(ne),io(t),Rn(),X()},"image/png")};ee.onload=oe,ee.onerror=re,ee.src=we.value}else g.toBlob(ee=>{const oe=URL.createObjectURL(ee),re=document.createElement("a");re.href=oe,re.download=Zt("png"),document.body.appendChild(re),re.click(),document.body.removeChild(re),URL.revokeObjectURL(oe),URL.revokeObjectURL(ne),io(t),Rn(),X()},"image/png")}catch(ee){URL.revokeObjectURL(ne),io(t),ge(ee)}},Q.onerror=()=>{URL.revokeObjectURL(ne),io(t),ge(new Error("Failed to load SVG image"))},Q.src=ne})}catch(t){console.error("Error downloading PNG:",t)}},In=()=>{try{let t="";Ce.value&&(t+=`# ${O("chart.csv.chartTitle")}: ${Ce.value}
70
- `),Nt.value&&(t+=`# ${O("chart.csv.chartSubtitle")}: ${Nt.value}
71
- `),t+=`# ${O("chart.csv.generated")}: ${new Date().toLocaleString()}
69
+ </svg>`,Z=new Blob([le],{type:"image/svg+xml;charset=utf-8"}),ee=URL.createObjectURL(Z),K=document.createElement("a");K.href=ee,K.download=Io("svg"),document.body.appendChild(K),K.click(),document.body.removeChild(K),URL.revokeObjectURL(ee),sn(t),on()}catch(s){console.error("Error downloading SVG:",s),sn(t)}},50)}catch(t){console.error("Error downloading SVG:",t)}},On=async()=>{try{const t=Ot();document.querySelector(".dss-custom-chart-container").offsetHeight,await new Promise(U=>setTimeout(U,300));const s=At(),n=pe.value,c=lt.value+s.height,f=document.createElement("canvas"),h=f.getContext("2d"),w=2;f.width=n*w,f.height=c*w,f.style.width=n+"px",f.style.height=c+"px",h.scale(w,w),h.fillStyle="#fafafa",h.fillRect(0,0,n,c);let C=30;if(Ue.value&&(h.fillStyle="#333",h.font="bold 18px Arial, sans-serif",h.fillText(Ue.value,24,C),C+=30),$e.value&&(h.fillStyle="#666",h.font="14px Arial, sans-serif",h.fillText($e.value,24,C),C+=25),pt.value&&A.series.length>0){let U=n-200,me=Ue.value||$e.value?35:25;const te=Math.floor((n-250)/120);let G=0;h.font="12px Arial, sans-serif",A.series.forEach((se,re)=>{if(!ot.value.has(re)){const De=ut(re);h.beginPath(),h.arc(U+6,me-4,6,0,2*Math.PI),h.fillStyle=De,h.fill(),h.fillStyle="#333",h.fillText(se.name,U+18,me),G++,G%te===0?(U=n-200,me+=20):U+=Math.min(120,se.name.length*8+35)}})}const L=document.querySelector(".dss-chart-svg").cloneNode(!0),T=L.querySelectorAll(".dss-flag-markers, .dss-flag-line, .dss-flag-extension-line, .dss-flag-count-indicator, .dss-flag-count-text"),B=L.querySelectorAll(".dss-crosshair"),q=L.querySelectorAll('[class*="tooltip"]');T.forEach(U=>U.remove()),B.forEach(U=>U.remove()),q.forEach(U=>U.remove()),L.querySelectorAll("image").forEach((U,me)=>{const te=U.getAttribute("xlink:href")||U.getAttribute("href");if(te&&!te.startsWith("data:")){const G=yt.value[me],se=G?ut(G.seriesIndex):"#3B82F6",re=U.getAttribute("x")||0,De=U.getAttribute("y")||0,Re=U.getAttribute("width")||32,dn=U.getAttribute("height")||32,Et=document.createElementNS("http://www.w3.org/2000/svg","circle");Et.setAttribute("cx",parseFloat(re)+parseFloat(Re)/2),Et.setAttribute("cy",parseFloat(De)+parseFloat(dn)/2),Et.setAttribute("r",Math.min(parseFloat(Re),parseFloat(dn))/2-1),Et.setAttribute("fill",se),Et.setAttribute("stroke","#fafafa"),Et.setAttribute("stroke-width","2"),U.parentNode.replaceChild(Et,U)}});const le=new XMLSerializer().serializeToString(L),Z=new Blob([le],{type:"image/svg+xml;charset=utf-8"}),ee=URL.createObjectURL(Z),K=new Image;return new Promise((U,me)=>{K.onload=async()=>{try{if(h.drawImage(K,0,s.height),yt.value.forEach(te=>{const G=te.x,se=te.y+s.height,re=(te.width||32)/2,De=ut(te.seriesIndex);h.save(),h.beginPath(),h.arc(G,se,re-1,0,2*Math.PI),h.fillStyle=De,h.fill(),h.strokeStyle="#fafafa",h.lineWidth=2,h.stroke(),h.restore()}),D.value){const te=new Image,G=()=>{const{width:re,height:De}=he.value,Re=ne.value,dn=H.value.left,Et=H.value.right,oo=H.value.top,Pl=H.value.bottom,Xl=H.value.width,Yl=H.value.height;let zo,Po;switch(Re){case"center":zo=dn+(Xl-re)/2,Po=oo+s.height+(Yl-De)/2;break;case"top-left":zo=dn+15,Po=oo+s.height+10;break;case"top-right":zo=Et-re-5,Po=oo+s.height+10;break;case"bottom-left":zo=dn+15,Po=Pl+s.height-De-5;break;case"bottom-right":default:zo=Et-re-5,Po=Pl+s.height-De-5;break}h.globalAlpha=_.value,h.drawImage(te,zo,Po,re,De),h.globalAlpha=1,se()},se=()=>{f.toBlob(re=>{const De=URL.createObjectURL(re),Re=document.createElement("a");Re.href=De,Re.download=Io("png"),document.body.appendChild(Re),Re.click(),document.body.removeChild(Re),URL.revokeObjectURL(De),URL.revokeObjectURL(ee),sn(t),on(),U()},"image/png")};te.onload=G,te.onerror=se,te.src=bt.value}else f.toBlob(te=>{const G=URL.createObjectURL(te),se=document.createElement("a");se.href=G,se.download=Io("png"),document.body.appendChild(se),se.click(),document.body.removeChild(se),URL.revokeObjectURL(G),URL.revokeObjectURL(ee),sn(t),on(),U()},"image/png")}catch(te){URL.revokeObjectURL(ee),sn(t),me(te)}},K.onerror=()=>{URL.revokeObjectURL(ee),sn(t),me(new Error("Failed to load SVG image"))},K.src=ee})}catch(t){console.error("Error downloading PNG:",t)}},Qn=()=>{try{let t="";Ue.value&&(t+=`# ${P("chart.csv.chartTitle")}: ${Ue.value}
70
+ `),$e.value&&(t+=`# ${P("chart.csv.chartSubtitle")}: ${$e.value}
71
+ `),t+=`# ${P("chart.csv.generated")}: ${new Date().toLocaleString()}
72
72
 
73
- `,t+="Category",L.series.forEach(h=>{const w=h.name.replace(/"/g,'""');t+=',"'+w+'"'}),t+=`
74
- `;const s=Math.max(...L.series.map(h=>h.data?.length||0));for(let h=0;h<s;h++){let S='"'+(L.categories[h]||O("chart.fallback.item",{number:h+1})).toString().replace(/"/g,'""')+'"';L.series.forEach(H=>{const _=H.data&&H.data[h]!==void 0?H.data[h]:"";S+=","+_}),t+=S+`
75
- `}const o=new Blob([t],{type:"text/csv;charset=utf-8;"}),c=URL.createObjectURL(o),g=document.createElement("a");g.href=c,g.download=Zt("csv"),document.body.appendChild(g),g.click(),document.body.removeChild(g),URL.revokeObjectURL(c),Rn()}catch(t){console.error("Error downloading CSV:",t)}},Fn=t=>{if(typeof t.action=="function"){const s={series:L.series,categories:L.categories,markers:k.value},o={chartX:ve.value.chartX,chartY:ve.value.chartY,dataX:ve.value.mouseDataX,dataY:ve.value.mouseDataY,categoryIndex:clampedCategoryIndex||ve.value.categoryIndex};t.action(s,o)}Rn()},Kn=()=>{St(),p.value.show=!0,p.value.categoryIndex=ve.value.categoryIndex,p.value.fromButton=!1,Rn()},Gn=()=>{St(),p.value.show=!0,p.value.categoryIndex=0,p.value.fromButton=!0},rn=t=>{if(ve.value.show){const s=document.querySelector(".dss-context-menu");s&&!s.contains(t.target)&&(ve.value.show=!1)}},So=t=>{ve.value.show&&!t.target.closest(".context-menu")&&(ve.value.show=!1)},bo=t=>{if(!qt.value||!Bt.value)return;t.preventDefault(),t.stopPropagation(),z.value.isZooming=!0,G.value.show=!1,z.value.zoomTimeout&&clearTimeout(z.value.zoomTimeout);const o=t.currentTarget.getBoundingClientRect(),c=t.clientX-o.left,g=t.clientY-o.top;if(c<B.value.left-50||c>B.value.right+50||g<B.value.top-50||g>B.value.bottom+100){z.value.isZooming=!1;return}const h=t.deltaY>0?.9:1.1,w=Math.max(z.value.minScale,Math.min(z.value.maxScale,z.value.scale*h));if(w!==z.value.scale){const{minX:C,maxX:S}=ht.value,H=S-C||1,_=H/z.value.scale,A=C-z.value.offsetX/B.value.width*H,Y=(c-B.value.left)/B.value.width,le=A+Y*_;z.value.scale=w;const se=H/z.value.scale,q=le-Y*se;z.value.offsetX=-(q-C)/H*B.value.width,z.value.scale<=1.01&&(z.value.scale=1,z.value.offsetX=0)}z.value.zoomTimeout=setTimeout(()=>{z.value.isZooming=!1,z.value.zoomTimeout=null},300)},Vl=t=>{if(!qt.value||!Bt.value||z.value.scale<=1)return;G.value.show=!1;const o=t.currentTarget.getBoundingClientRect();t.clientX-o.left,t.clientY-o.top,z.value.isDragging=!0,z.value.lastMouseX=t.clientX,z.value.lastMouseY=t.clientY,t.preventDefault()},vl=()=>{z.value.isDragging=!1},Ho=()=>{!qt.value||!Bt.value||(z.value.scale=1,z.value.offsetX=0,z.value.isDragging=!1,z.value.zoomTimeout&&(clearTimeout(z.value.zoomTimeout),z.value.zoomTimeout=null),z.value.isZooming=!1)},Nl=()=>!qt.value||!No.value||!Bt.value?"default":z.value.isDragging?"grabbing":z.value.scale>1?"grab":"dss-crosshair",qo=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 o=0;o<t.length-1;o++){const c=t[Math.max(o-1,0)],g=t[o],h=t[o+1],w=t[Math.min(o+2,t.length-1)],C=g.x+(h.x-c.x)/6*me.value,S=g.y+(h.y-c.y)/6*me.value,H=h.x-(w.x-g.x)/6*me.value,_=h.y-(w.y-g.y)/6*me.value;s+=` C ${C} ${S} ${H} ${_} ${h.x} ${h.y}`}return s},zn=e.computed(()=>{let s=50+(it.value?30:0)+60;if(Hn.value)return{left:90,top:90,right:90,bottom:90};if(cn.value){let w=0;Ce.value&&(w+=15),Nt.value&&(w+=10);const C=_t();let S=66,H=50;return dt.value&&Xe.value==="left"?S+=C.legendWidth||150:dt.value&&Xe.value==="right"&&(H+=C.legendWidth||150),{left:S,top:50+w,right:H,bottom:130}}let o=0;Ce.value&&(o+=15),Nt.value&&(o+=10);const c=_t();let g=66,h=50;return dt.value&&Xe.value==="left"?g+=c.legendWidth||150:dt.value&&Xe.value==="right"&&(h+=c.legendWidth||150),dt.value&&Xe.value==="bottom"&&(s+=c.legendHeight||0),{left:g,top:50+o,right:h,bottom:s}}),B=e.computed(()=>({left:zn.value.left,top:zn.value.top,right:pe.value-zn.value.right,bottom:Qe.value-zn.value.bottom,width:pe.value-(zn.value.left+zn.value.right),height:Qe.value-(zn.value.top+zn.value.bottom)})),qt=e.computed(()=>["line","area","bar"].includes(ye.value)||ue.value),Nn=e.computed(()=>ue.value),cn=e.computed(()=>["radial","semi-radial"].includes(ye.value)),Hn=e.computed(()=>ye.value==="spider"),wt=e.computed(()=>ye.value==="bubble"),Lt=e.computed(()=>P.value?.chart?.orientation==="horizontal"&&(ye.value==="bar"||Nn.value)),Pn=t=>{const{minY:s,maxY:o}=ht.value,c=o-s||1;return B.value.left+(t-s)/c*B.value.width},Qn=t=>{const{maxX:s}=ht.value,o=s+1,g=B.value.height/o;return B.value.top+(t+.5)*g},Je=e.computed(()=>pe.value/2),at=e.computed(()=>Hn.value?Qe.value/2-40:Qe.value/2),Oe=e.computed(()=>{if(Hn.value){const t=B.value.width-80,s=B.value.height-80;return Math.min(t,s)/2}return Math.min(B.value.width,B.value.height)/2}),dn=e.computed(()=>{const t=P.value,s=t?.plotOptions?.radialBar?.innerRadiusRatio??t?.radialBar?.innerRadiusRatio,o=typeof s=="number"&&s>=0&&s<=1?s:.45;return Oe.value*o}),Uo=e.computed(()=>{const t=P.value,s=typeof L.innerSize=="number"?L.innerSize:t?.innerSize;return typeof s!="number"||s<=0||!(cn.value||Hn.value)?1:1+s/100}),co=e.computed(()=>{if(Uo.value<=1)return;const t=Je.value,s=at.value,o=Uo.value;return`translate(${t}, ${s}) scale(${o}) translate(${-t}, ${-s})`}),Jn=e.ref(0),Mo=e.computed(()=>`semi-radial-fill-clip-${L.chartId}`),Bo=e.computed(()=>ye.value==="semi-radial"),Xo=e.computed(()=>Bo.value&&Ct.value&&!Wn.value),fl=e.computed(()=>{const t=Xo.value?Jn.value:1,s=Je.value,o=at.value,c=dn.value,g=Oe.value,h=Math.PI,w=Math.PI+t*Math.PI;if(t<=0)return`M ${s} ${o} L ${s} ${o} Z`;const C=s+g*Math.cos(h),S=o+g*Math.sin(h),H=s+g*Math.cos(w),_=o+g*Math.sin(w),A=s+c*Math.cos(w),Y=o+c*Math.sin(w),le=s+c*Math.cos(h),se=o+c*Math.sin(h),q=t>.5?1:0;return`M ${s} ${o} L ${C} ${S} A ${g} ${g} 0 ${q} 1 ${H} ${_} L ${A} ${Y} A ${c} ${c} 0 ${q} 1 ${le} ${se} Z`}),On=e.computed(()=>Bo.value&&Xo.value?`url(#${Mo.value})`:void 0),un=e.ref(0),eo=e.computed(()=>`radial-reveal-clip-${L.chartId}`),hn=e.computed(()=>ye.value==="radial"),xt=e.computed(()=>{const t=hn.value?un.value:1,s=Je.value,o=at.value,c=Math.max(Oe.value*1.5,pe.value,Qe.value);if(t<=0)return`M ${s} ${o} L ${s} ${o} Z`;if(t>=1){const A=s-c,Y=s+c;return`M ${A} ${o} A ${c} ${c} 0 0 1 ${Y} ${o} A ${c} ${c} 0 0 1 ${A} ${o} Z`}const g=-Math.PI/2,h=g+t*Math.PI*2,w=s+c*Math.cos(g),C=o+c*Math.sin(g),S=s+c*Math.cos(h),H=o+c*Math.sin(h),_=t>=.5?1:0;return`M ${s} ${o} L ${w} ${C} A ${c} ${c} 0 ${_} 1 ${S} ${H} Z`}),gl=e.computed(()=>{if(On.value)return On.value;if(hn.value)return`url(#${eo.value})`});let wo=null;const uo=()=>{if(!Xo.value)return;Jn.value=0;const t=Pe.value,s=performance.now(),o=c=>{const g=c-s,h=Math.min(1,g/t);Jn.value=$n(Te.value,h),h<1&&(wo=requestAnimationFrame(o))};wo=requestAnimationFrame(o)},to=e.computed(()=>P.value?.bubbles?.minSize||8),xo=e.computed(()=>P.value?.bubbles?.maxSize||50),no=e.computed(()=>P.value?.bubbles?.opacity||.7),mo=(t,s)=>{const o=[15,20,25,18,22],c=o[t%o.length]||20,g=1+Math.sin(s*.5)*.2;return Math.max(5,c*g)},Sl=t=>{const s=document.querySelector(`.dss-bubble-image-${t}`);s&&(s.style.opacity="1")},Ml=t=>{const s=document.querySelector(`.dss-bubble-image-${t}`);s&&(s.style.display="none")},yn=e.computed(()=>L.series),oo=e.computed(()=>L.series.filter((t,s)=>!Ue.value.has(s))),Cn="auto",ht=e.computed(()=>{if(wt.value)return Bl();if(!oo.value.length)return{minX:0,maxX:1,minY:0,maxY:1};let t=1/0,s=-1/0,o=0;oo.value.forEach(C=>{C.data&&C.data.length&&(o=Math.max(o,C.data.length-1),C.data.forEach(S=>{typeof S=="number"&&(t=Math.min(t,S),s=Math.max(s,S))}))}),L.categories.length>0&&(o=Math.max(o,L.categories.length-1)),t===1/0&&(t=0,s=100);const c=jt.value,g=kn.value;let h,w;if(c===Cn){const C=s-t,S=C>0?C*.1:1;h=Math.max(0,t-S)}else if(typeof c=="number")h=c;else{const C=s-t,S=C>0?C*.1:1;h=Math.max(0,t-S)}if(g===Cn){const C=s-t,S=C>0?C*.1:2;w=s+S}else if(typeof g=="number")w=g;else{const C=s-t,S=C>0?C*.1:2;w=s+S}return{minX:0,maxX:o,minY:h,maxY:w}}),Bl=()=>{if(!oo.value.length)return{minX:0,maxX:8,minY:0,maxY:50,minSize:10,maxSize:30};let t=1/0,s=-1/0,o=1/0,c=-1/0,g=1/0,h=-1/0,w=!1;if(oo.value.forEach((le,se)=>{le?.data?.length&&le.data.forEach((q,ne)=>{let Q,X,ge;if(typeof q=="object"&&q!==null&&!Array.isArray(q))Q=typeof q.x=="number"?q.x:ne,X=typeof q.y=="number"?q.y:0,ge=typeof q.size=="number"?q.size:20;else if(Array.isArray(q)&&q.length>=3)Q=typeof q[0]=="number"?q[0]:ne,X=typeof q[1]=="number"?q[1]:0,ge=typeof q[2]=="number"?q[2]:20;else if(typeof q=="number")Q=ne,X=q,ge=mo(se,ne);else return;isFinite(Q)&&isFinite(X)&&isFinite(ge)&&(t=Math.min(t,Q),s=Math.max(s,Q),o=Math.min(o,X),c=Math.max(c,X),g=Math.min(g,ge),h=Math.max(h,ge),w=!0)})}),!w)return{minX:0,maxX:8,minY:0,maxY:50,minSize:10,maxSize:30};t===s&&(t=Math.min(t,0),s=Math.max(s,L.categories?.length-1||8)),o===c&&(o=Math.max(0,o-10),c=o+20);const C=s-t,S=c-o;let H,_,A,Y;return tt.value!==null?H=tt.value:H=t-C*.1,Fe.value!==null?_=Fe.value:_=s+C*.1,jt.value!==null&&typeof jt.value=="number"?A=jt.value:A=Math.max(0,o-S*.1),kn.value!==null&&typeof kn.value=="number"?Y=kn.value:Y=c+S*.1,{minX:H,maxX:_,minY:A,maxY:Y,minSize:g,maxSize:h}},Et=t=>{if(wt.value){const{minX:C,maxX:S}=ht.value,H=S-C||1;return B.value.left+(t-C)/H*B.value.width}const{minX:s,maxX:o}=ht.value,c=o-s;if(o===0||c===0)return B.value.left+B.value.width/2;const g=c/z.value.scale,h=s-z.value.offsetX/B.value.width*c,w=(t-h)/g;return B.value.left+w*B.value.width},Mt=t=>{const{minY:s,maxY:o}=ht.value,c=o-s||1;return B.value.bottom-(t-s)/c*B.value.height},Yo=t=>{if(!wt.value)return Ye.value||4;const{maxSize:s}=ht.value,o=Math.max(1,s),c=Math.min(1,Math.max(0,t/o));return to.value+c*(xo.value-to.value)},jo=e.computed(()=>$o.value.map(t=>({y:t.y}))),Ko=e.computed(()=>{if(wt.value)return hl();if(ye.value==="bar"){if(Lt.value){const ee=[],{minY:oe,maxY:re}=ht.value,de=5,Re=re-oe||1;for(let Ze=0;Ze<=de;Ze++){const wn=oe+Re*(Ze/de),zt=Pn(wn);ee.push({x:zt,y:B.value.bottom+20,text:ln(Math.round(wn))})}return ee}const se=[],{maxX:q}=ht.value,ne=q+1,Q=5,ge=(B.value.width-Q*2)/ne;for(let ee=0;ee<=q;ee++){const oe=B.value.left+Q+(ee+.5)*ge;se.push({x:oe,y:B.value.bottom+20,text:L.categories[ee]||O("chart.fallback.item",{number:ee+1})})}return se}const t=[],{minX:s,maxX:o}=ht.value,c=o-s||1,g=c/z.value.scale,h=s-z.value.offsetX/B.value.width*c,w=h+g,C=Math.max(0,Math.floor(h-2)),S=Math.min(o,Math.ceil(w+2)),H=S-C,_=B.value.width,Y=Math.floor(_/60);let le=1;H>Y&&(le=Math.ceil(H/Y));for(let se=C;se<=S;se+=le)if(se>=0&&se<=o){const q=Et(se);q>=B.value.left-100&&q<=B.value.right+100&&t.push({x:q,y:B.value.bottom+20,text:L.categories[se]||`Item ${se+1}`})}return t}),hl=()=>{const t=[],{minX:s,maxX:o}=ht.value,c=o-s||1,g=Math.min(8,Math.max(4,Math.floor(B.value.width/80)));for(let h=0;h<=g;h++){const w=s+c*h/g,C=Et(w);if(C>=B.value.left-10&&C<=B.value.right+10){const S=Math.round(w),H=L.categories?.[S];t.push({x:C,y:B.value.bottom+20,text:H||(Number.isInteger(w)?w.toString():w.toFixed(1))})}}return t},$o=e.computed(()=>{if(Lt.value){const g=[],{maxX:h}=ht.value;for(let w=0;w<=h;w++)g.push({x:B.value.left-10,y:Qn(w),text:L.categories[w]||`Item ${w+1}`});return g}const t=[],{minY:s,maxY:o}=ht.value,c=5;for(let g=0;g<=c;g++){const h=s+(o-s)*(g/c),w=Math.round(h);t.push({x:B.value.left-10,y:Mt(h),text:ln(w)})}return t}),yt=t=>{const s=Gt.value;if(!s||s.length===0){const o=["#3B82F6","#EF4444","#10B981","#F59E0B","#8B5CF6","#F97316","#06B6D4","#84CC16"];return o[t%o.length]}return s[t%s.length]},Go=t=>{if(!t||typeof t!="string")return t;const s=t.trim(),o=s.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i);if(o){const h=Math.max(0,Math.floor(Number(o[1])*.65)),w=Math.max(0,Math.floor(Number(o[2])*.65)),C=Math.max(0,Math.floor(Number(o[3])*.65));return`rgb(${h}, ${w}, ${C})`}const c=s.match(/^rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)\s*\)$/i);if(c){const h=Math.max(0,Math.floor(Number(c[1])*.65)),w=Math.max(0,Math.floor(Number(c[2])*.65)),C=Math.max(0,Math.floor(Number(c[3])*.65));return`rgba(${h}, ${w}, ${C}, ${c[4]})`}const g=s.match(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/);if(g){let h=g[1];h.length===3&&(h=h[0]+h[0]+h[1]+h[1]+h[2]+h[2]);const w=Math.max(0,Math.min(255,Math.floor(parseInt(h.slice(0,2),16)*.65))),C=Math.max(0,Math.min(255,Math.floor(parseInt(h.slice(2,4),16)*.65))),S=Math.max(0,Math.min(255,Math.floor(parseInt(h.slice(4,6),16)*.65)));return`#${[w,C,S].map(H=>H.toString(16).padStart(2,"0")).join("")}`}return s},Qo=(t,s)=>{const c=P.value?.stroke?.color;return c==null?Go(s):typeof c=="string"?c:Array.isArray(c)&&c.length?c[t%c.length]??Go(s):Go(s)},Lo=t=>{let s=0;for(let o=1;o<t.length;o++){const c=t[o].x-t[o-1].x,g=t[o].y-t[o-1].y;s+=Math.sqrt(c*c+g*g)}return s},yl=e.computed(()=>ye.value==="line"||Nn.value?(Nn.value?L.series.filter(s=>(s.type||ye.value)==="line"):yn.value).map((s,o)=>{const c=L.series.findIndex(A=>A===s),g=[];let h=[];s.data.forEach((A,Y)=>{A==null?h.length>0&&(g.push([...h]),h=[]):h.push({x:Lt.value?Pn(A):Et(Y),y:Lt.value?Qn(Y):Mt(A),index:Y})}),h.length>0&&g.push(h);let w="";g.forEach(A=>{if(A.length>0){let Y="";ae.value?Y=qo(A):Y=`M ${A[0].x} ${A[0].y}`+A.slice(1).map(le=>` L ${le.x} ${le.y}`).join(""),w+=(w?" ":"")+Y}});const C=g.reduce((A,Y)=>A+Lo(Y),0),S=Ue.value.has(c),H=K.value===c,_=K.value!==null&&K.value!==c;return{path:w,color:yt(c),pathLength:C,seriesIndex:c,animationDelay:o*Se.value,isHighlighted:H,isDimmed:_,isHidden:S}}):[]),Eo=e.computed(()=>{if(!(ye.value==="line"||Nn.value))return[];const t=Nn.value?L.series.filter(o=>(o.type||ye.value)==="line"):yn.value,s=[];return t.forEach((o,c)=>{const g=L.series.findIndex(h=>h===o);for(let h=0;h<o.data.length-1;h++){const w=o.data[h];if(w!=null){let C=-1,S=0;for(let H=h+1;H<o.data.length;H++){const _=o.data[H];if(_==null)S++;else{C=H;break}}if(S>0&&C!==-1){const H=o.data[C],_=Lt.value?Pn(w):Et(h),A=Lt.value?Qn(h):Mt(w),Y=Lt.value?Pn(H):Et(C),le=Lt.value?Qn(C):Mt(H),se=Ue.value.has(g),q=K.value===g,ne=K.value!==null&&K.value!==g;s.push({path:`M ${_} ${A} L ${Y} ${le}`,color:yt(g),seriesIndex:g,animationDelay:c*Se.value,isHighlighted:q,isDimmed:ne,isHidden:se,gapSize:S}),h=C-1}}}}),s}),lo=e.computed(()=>ye.value==="line"||Nn.value?!Ct.value||Wn.value||Ve.value.hasAnimated?[]:(Nn.value?L.series.filter(s=>(s.type||ye.value)==="line"):yn.value).map((s,o)=>{const c=L.series.findIndex(S=>S===s);let g="",h=null;s.data.forEach((S,H)=>{if(S!=null){const _={x:Lt.value?Pn(S):Et(H),y:Lt.value?Qn(H):Mt(S)};h===null?g+=`M ${_.x} ${_.y}`:g+=` L ${_.x} ${_.y}`,h=_}else if(h!==null){const _=s.data.findIndex((A,Y)=>Y>H&&A!==null&&A!==void 0);if(_!==-1){const A={x:Lt.value?Pn(s.data[_]):Et(_),y:Lt.value?Qn(_):Mt(s.data[_])};g+=` L ${A.x} ${A.y}`,h=A}}});const w=s.data.map((S,H)=>S==null?null:{x:Lt.value?Pn(S):Et(H),y:Lt.value?Qn(H):Mt(S)}).filter(S=>S!==null),C=Lo(w);return{path:g,pathLength:C,color:yt(c),animationDelay:o*Se.value,seriesIndex:c}}):[]),Jo=e.computed(()=>{if(ye.value!=="line")return[];const t=[];return yn.value.forEach((s,o)=>{const c=K.value===o,g=K.value!==null&&K.value!==o,h=Ue.value.has(o);s.data.forEach((w,C)=>{w!=null&&t.push({x:Et(C),y:Mt(w),color:yt(o),value:w,label:L.categories[C]||C.toString(),seriesName:s.name,categoryIndex:C,dataIndex:C,animationDelay:(o*s.data.length+C)*(Se.value/8),isHighlighted:c,isDimmed:g,isHidden:h})})}),t}),kl=e.computed(()=>{if(!Nn.value)return[];const t=[];return L.series.filter(o=>(o.type||ye.value)==="line").forEach((o,c)=>{const g=L.series.findIndex(S=>S===o),h=K.value===g,w=K.value!==null&&K.value!==g,C=Ue.value.has(g);o.data.forEach((S,H)=>{S!=null&&t.push({x:Et(H),y:Mt(S),color:yt(g),value:S,label:L.categories[H]||H.toString(),seriesName:o.name,categoryIndex:H,dataIndex:H,animationDelay:(c*o.data.length+H)*(Se.value/8),isHighlighted:h,isDimmed:w,isHidden:C})})}),t}),_o=e.computed(()=>{if(!wt.value)return[];const t=[];return yn.value.forEach((s,o)=>{if(!s?.data?.length)return;const c=K.value,g=c!==null&&c===o,h=c!==null&&c!==o,w=Ue.value.has(o);s.data.forEach((C,S)=>{let H,_,A,Y,le;if(typeof C=="object"&&C!==null&&!Array.isArray(C))H=typeof C.x=="number"?C.x:S,_=typeof C.y=="number"?C.y:0,A=typeof C.size=="number"?C.size:20,Y=C.label||L.categories?.[S]||`Point ${S+1}`,le=C.image||C.imageUrl;else if(Array.isArray(C)&&C.length>=3)H=typeof C[0]=="number"?C[0]:S,_=typeof C[1]=="number"?C[1]:0,A=typeof C[2]=="number"?C[2]:20,Y=C[3]||L.categories?.[S]||`Point ${S+1}`,le=C[4];else if(typeof C=="number")H=S,_=C,A=mo(o,S),Y=L.categories?.[S]||`Point ${S+1}`;else return;!isFinite(H)||!isFinite(_)||!isFinite(A)||t.push({x:Et(H),y:Mt(_),radius:Yo(A),originalX:H,originalY:_,originalSize:A,color:yt(o),seriesName:s.name||`Series ${o+1}`,label:Y,imageUrl:le,seriesIndex:o,dataIndex:S,categoryIndex:Math.round(H),isHighlighted:g,isDimmed:h,isHidden:w,opacity:no.value})})}),t}),el=e.computed(()=>ye.value!=="area"?[]:yn.value.map((t,s)=>{const o=[];let c=[];if(t.data.forEach((A,Y)=>{A==null?c.length>0&&(o.push([...c]),c=[]):c.push({x:Et(Y),y:Mt(A),index:Y})}),c.length>0&&o.push(c),o.length===0)return{linePath:"",areaPath:"",color:yt(s),isHidden:Ue.value.has(s)};const g=B.value.bottom+1;let h="",w="";o.forEach((A,Y)=>{if(A.length===0)return;let le=`M ${A[0].x} ${A[0].y}`;ae.value&&A.length>1?le=qo(A):A.slice(1).forEach(q=>{le+=` L ${q.x} ${q.y}`}),h+=(h?" ":"")+le;let se=`M ${A[0].x} ${g}`;if(se+=` L ${A[0].x} ${A[0].y}`,ae.value&&A.length>1){const q=qo(A),ne=q.substring(q.indexOf("C")||q.indexOf("Q")||q.indexOf("L"));ne?se+=" "+ne:A.slice(1).forEach(Q=>{se+=` L ${Q.x} ${Q.y}`})}else A.slice(1).forEach(q=>{se+=` L ${q.x} ${q.y}`});se+=` L ${A[A.length-1].x} ${g} Z`,w+=(w?" ":"")+se});const C=K.value===s,S=K.value!==null&&K.value!==s,H=Ue.value.has(s),_=o.reduce((A,Y)=>A+Lo(Y),0);return{linePath:h,areaPath:w,color:yt(s),pathLength:_,isHighlighted:C,isDimmed:S,isHidden:H}})),Cl=e.computed(()=>{if(!(["bar"].includes(ye.value)||Nn.value))return[];const t=[],{maxX:s}=ht.value,o=Nn.value?L.series.filter(g=>(g.type||ye.value)==="bar"):yn.value,c=o.length;if(Lt.value){const g=s+1,w=B.value.height/g,C=w*(2/3),S=Math.min(4,C/c*.15),H=C-(c-1)*S,_=Math.max(4,H/c);o.forEach((A,Y)=>{const le=L.series.findIndex(Q=>Q===A),se=K.value===le,q=K.value!==null&&K.value!==le,ne=Ue.value.has(le);A.data.forEach((Q,X)=>{if(Q==null||typeof Q!="number"||!isFinite(Q))return;const oe=B.value.top+(X+.5)*w-C/2+Y*(_+S),re=B.value.left,de=Math.abs(Pn(Q)-B.value.left);let Re="";if(ae.value&&de>0){const Ze=Math.min(ot.value,_/2,de/2);Re=[`M ${re} ${oe}`,`L ${re+de-Ze} ${oe}`,`Q ${re+de} ${oe} ${re+de} ${oe+Ze}`,`L ${re+de} ${oe+_-Ze}`,`Q ${re+de} ${oe+_} ${re+de-Ze} ${oe+_}`,`L ${re} ${oe+_}`,"Z"].join(" ")}t.push({x:re,y:oe,width:de,height:_,color:yt(c===1?X:le),value:Q,label:L.categories[X]||X.toString(),seriesName:A.name,animationDelay:(Y*o.length+X)*(Se.value/4),isHighlighted:se,isDimmed:q,isHidden:ne,barPath:Re,isSmooth:ae.value&&de>0})})})}else{const g=s+1,w=B.value.width/g,C=w*.8,S=C/c,H=S*.05,_=S-H;o.forEach((A,Y)=>{const le=L.series.findIndex(Q=>Q===A),se=K.value===le,q=K.value!==null&&K.value!==le,ne=Ue.value.has(le);A.data.forEach((Q,X)=>{if(Q==null||typeof Q!="number"||!isFinite(Q))return;const oe=B.value.left+(X+.5)*w-C/2+Y*S+H/2,re=Mt(Math.max(0,Q)),de=Math.abs(Mt(0)-Mt(Q));let Re="";if(ae.value&&de>0){const Ze=Math.min(ot.value,_/2,de/2);Re=[`M ${oe} ${re+de}`,`L ${oe} ${re+Ze}`,`Q ${oe} ${re} ${oe+Ze} ${re}`,`L ${oe+_-Ze} ${re}`,`Q ${oe+_} ${re} ${oe+_} ${re+Ze}`,`L ${oe+_} ${re+de}`,"Z"].join(" ")}t.push({x:oe,y:re,width:_,height:de,color:yt(c===1?X:le),value:Q,label:L.categories[X]||X.toString(),seriesName:A.name,animationDelay:(Y*o.length+X)*(Se.value/4),isHighlighted:se,isDimmed:q,isHidden:ne,barPath:Re,isSmooth:ae.value&&de>0})})})}return t}),Zn=e.computed(()=>{if(!cn.value)return[];const t=yn.value.map((h,w)=>({series:h,originalIndex:w})).filter(({originalIndex:h})=>!Ue.value.has(h));if(t.length===0)return[];let s=ye.value==="semi-radial"?Math.PI:-Math.PI/2;const o=ye.value==="semi-radial"?Math.PI:Math.PI*2,c=[];if(t.length===1){const{series:h,originalIndex:w}=t[0],C=h.data[0]||0,S=s,H=s+o-.001,_=S+o/2,A=Je.value+Math.cos(S)*dn.value,Y=at.value+Math.sin(S)*dn.value,le=Je.value+Math.cos(H)*dn.value,se=at.value+Math.sin(H)*dn.value,q=Je.value+Math.cos(H)*Oe.value,ne=at.value+Math.sin(H)*Oe.value,Q=Je.value+Math.cos(S)*Oe.value,X=at.value+Math.sin(S)*Oe.value,ge=1,ee=[`M ${A} ${Y}`,`A ${dn.value} ${dn.value} 0 ${ge} 1 ${le} ${se}`,`L ${q} ${ne}`,`A ${Oe.value} ${Oe.value} 0 ${ge} 0 ${Q} ${X}`,"Z"].join(" "),oe=yt(w);return c.push({path:ee,color:oe,strokeWidth:pn.value,strokeColor:Qo(0,oe),value:C,seriesName:h.name,opacity:.8,isHighlighted:K.value===w,isDimmed:!1,isHidden:!1,startAngle:S,endAngle:H,midAngle:_}),c}const g=t.reduce((h,{series:w})=>h+(w.data[0]||0),0);return g===0?[]:(t.forEach(({series:h,originalIndex:w})=>{const C=h.data[0]||0,S=C/g*o,H=s,_=s+S,A=H+S/2,Y=Je.value+Math.cos(H)*dn.value,le=at.value+Math.sin(H)*dn.value,se=Je.value+Math.cos(_)*dn.value,q=at.value+Math.sin(_)*dn.value,ne=Je.value+Math.cos(_)*Oe.value,Q=at.value+Math.sin(_)*Oe.value,X=Je.value+Math.cos(H)*Oe.value,ge=at.value+Math.sin(H)*Oe.value,ee=S>Math.PI?1:0,oe=[`M ${Y} ${le}`,`A ${dn.value} ${dn.value} 0 ${ee} 1 ${se} ${q}`,`L ${ne} ${Q}`,`A ${Oe.value} ${Oe.value} 0 ${ee} 0 ${X} ${ge}`,"Z"].join(" "),re=yt(w);c.push({path:oe,color:re,strokeWidth:pn.value,strokeColor:Qo(c.length,re),value:C,seriesName:h.name,opacity:.8,isHighlighted:K.value===w,isDimmed:K.value!==null&&K.value!==w,isHidden:!1,startAngle:H,endAngle:_,midAngle:A}),s=_}),c)}),Sn=e.computed(()=>!Me.value||!cn.value?[]:Zn.value.map((t,s)=>{if(t.isHidden)return null;const o=Pt.value,c=an.value,g=so.value,h=Je.value+Math.cos(t.midAngle)*Oe.value,w=at.value+Math.sin(t.midAngle)*Oe.value,C=Je.value+Math.cos(t.midAngle)*(Oe.value+o),S=at.value+Math.sin(t.midAngle)*(Oe.value+o),H=Math.cos(t.midAngle)>=0,A=C+c*(H?1:-1),Y=S,le=H?C+15:C-15,se=Y-g,q=H?"start":"end",ne=Math.hypot(C-h,S-w),Q=Math.hypot(A-C,Y-S);return{pointerStartX:h,pointerStartY:w,pointerEndX:C,pointerEndY:S,horizontalEndX:A,horizontalEndY:Y,textX:le,textY:se,text:`${t.seriesName}: ${ln(t.value)}`,color:t.color,textAnchor:q,isRightSide:H,isHighlighted:t.isHighlighted,isDimmed:t.isDimmed,pointerLineLength:ne,horizontalLineLength:Q}}).filter(Boolean)),Tl=t=>{if(!t||t.isHidden)return 0;const s=t.opacity||no.value||.7;return K.value===null||K.value===void 0?s:K.value!==null?t.seriesIndex===K.value?Math.min(1,s+.1):Math.max(.5,s*.8):s},po=t=>{if(!t||t.isHidden)return 0;const s=t.radius>20?.9:.8;return K.value!==null?t.seriesIndex===K.value?Math.min(1,s+.1):s*.7:s},Ao=(t,s)=>{if(t)try{if(K.value===t.seriesIndex?K.value=null:K.value=t.seriesIndex,typeof window<"u"&&window.dispatchEvent){const o=new CustomEvent("dss-bubble-click",{detail:{bubble:t,originalEvent:s,chartId:L.chartId}});window.dispatchEvent(o)}}catch(o){console.error("Error in onBubbleClick:",o)}},Hl=(t,s)=>{const o=[`dss-bubble-fallback-${s}`];return t.isHighlighted&&o.push("dss-bubble-highlighted"),t.isDimmed&&o.push("dss-bubble-dimmed"),t.isHidden&&o.push("dss-bubble-hidden"),o.push(`dss-bubble-series-${t.seriesIndex}`),o.join(" ")},tl=(t,s)=>{if(!t||(s.stopPropagation(),st.value=!0,K.value=t.seriesIndex,G.value.show=!1,!ze.value))return;const o=s.target.closest(".dss-custom-chart-container");if(!o)return;const c=o.getBoundingClientRect();let g=s.clientX-c.left+10,h=s.clientY-c.top-10;const w=200,C=120;g+w>pe.value&&(g=s.clientX-c.left-w-10),h+C>c.height&&(h=s.clientY-c.top-C-10),g<0&&(g=10),h<0&&(h=10);const S=ro.value,H=ko.value,_=S.map(A=>{const Y=H[A]||A,le=nl(A,t);return le?{seriesName:t.seriesName,label:t.label,value:`${Y}: ${le}`,color:t.color}:null}).filter(Boolean);xe.value={show:!0,x:g,y:h,title:t.label||t.seriesName||"",value:"",bubbleData:_,categoryIndex:void 0,spiderSeries:[]}},nl=(t,s)=>{let o;switch(t){case"x":o=s.originalX;break;case"y":o=s.originalY;break;case"size":o=s.originalSize;break;case"label":o=s.label;break;case"seriesName":o=s.seriesName;break;default:o=s[t]||""}const c=Fo.value[t];if(typeof c=="function")return c(o,s);if(typeof o=="number"){const g=o.toFixed(1);return Ln.value?g+Ln.value:g}return o?.toString()||""},l=()=>{if(!wt.value||!G.value.data||G.value.data.length===0)return"Bubbles";const t=[],s=new Set;return G.value.data.forEach(o=>{if(o.seriesName&&o.label){const c=`${o.seriesName} - ${o.label}`;s.has(c)||(t.push(c),s.add(c))}else o.seriesName&&(s.has(o.seriesName)||(t.push(o.seriesName),s.add(o.seriesName)))}),t.length>0?t.join(" | "):"Bubbles"},n=(t,s)=>{t&&(st.value=!1,K.value=null,xe.value.show=!1,xe.value.bubbleData=[])},a=(t,s)=>{const o=s.target.closest(".dss-custom-chart-container");if(!o)return;const c=o.getBoundingClientRect(),g=Ft(t.categoryIndex),h=t.description||t.comment||"";let w=s.clientX-c.left+15,C=s.clientY-c.top-10;const S=200,H=h?80:50;w+S>pe.value&&(w=s.clientX-c.left-S-15),C+H>Qe.value&&(C=s.clientY-c.top-H-10),w<0&&(w=10),C<0&&(C=10),gn.value={show:!0,x:w,y:C,categoryValue:g,description:h}},r=()=>{gn.value.show=!1},i=e.computed(()=>L.categories.length||Math.max(...oo.value.map(t=>t.data.length))),u=e.computed(()=>{let t=0;return oo.value.forEach(s=>{s.data.forEach(o=>{typeof o=="number"&&(t=Math.max(t,o))})}),t||100}),d=e.computed(()=>{const t=[],s=i.value;for(let o=0;o<s;o++){const c=o*2*Math.PI/s-Math.PI/2,g=Je.value+Math.cos(c)*Oe.value,h=at.value+Math.sin(c)*Oe.value;t.push({x:g,y:h,angle:c,index:o})}return t}),m=e.computed(()=>{const t=[],s=i.value;return d.value.forEach((o,c)=>{const g=Oe.value+15,h=c*2*Math.PI/s-Math.PI/2,w=Je.value+Math.cos(h)*g,C=at.value+Math.sin(h)*g+5;let S="middle",H="middle";Math.abs(Math.cos(h))>.5&&(S=Math.cos(h)>0?"start":"end"),Math.abs(Math.sin(h))>.5&&(H=Math.sin(h)>0?"hanging":"auto"),t.push({x:w,y:C,text:L.categories[c]||`Axis ${c+1}`,anchor:S,baseline:H})}),t}),v=e.ref(new Set),y=(t,s,o)=>{const c=`current-${o}`,g=v.value.has(c);return!g&&K.value===null?s.fillOpacity||We.value:s.isHighlighted||g?(s.fillOpacity||We.value)+.15:s.isDimmed?(s.fillOpacity||We.value)*.3:s.fillOpacity||We.value},x=e.computed(()=>{if(!Hn.value)return[];const t=[],s=i.value;return yn.value.forEach((o,c)=>{const g=[],h=[],w=[],C=K.value===c,S=K.value!==null&&K.value!==c,H=Ue.value.has(c);for(let _=0;_<s;_++){const A=o.data[_]||0,le=A/u.value*Oe.value,se=_*2*Math.PI/s-Math.PI/2,q=Je.value+Math.cos(se)*le,ne=at.value+Math.sin(se)*le;g.push(`${q},${ne}`),h.push({x:q,y:ne}),w.push({x:q,y:ne,value:A,label:L.categories[_]||`Axis ${_+1}`,seriesName:o.name})}t.push({points:g.join(" "),polygonPoints:h,dataPoints:w,color:yt(c),fillOpacity:We.value,seriesName:o.name,value:`${o.name}: ${o.data.join(", ")}`,isHighlighted:C,isDimmed:S,isHidden:H,seriesIndex:c})}),t}),N=(t,s)=>{if(!s||s.length<3)return!1;let o=!1;for(let c=0,g=s.length-1;c<s.length;g=c++){const h=s[c].x,w=s[c].y,C=s[g].x,S=s[g].y;w>t.y!=S>t.y&&t.x<(C-h)*(t.y-w)/(S-w)+h&&(o=!o)}return o},b=t=>{if(!Hn.value)return;const s=t.currentTarget.closest(".dss-custom-chart-container");if(!s)return;const o=s.getBoundingClientRect(),c=he.value?.getBoundingClientRect();if(!c)return;const g=t.clientX-c.left,h=t.clientY-c.top,w=x.value.filter(C=>C.isHidden?!1:N({x:g,y:h},C.polygonPoints));if(w.length>0){w.length,K.value=w[0].seriesIndex;const C=t.clientX-o.left+10,S=t.clientY-o.top-10,H=200,_=50+w.length*25;let A=C,Y=S;A+H>pe.value&&(A=t.clientX-o.left-H-10),Y+_>Qe.value&&(Y=t.clientY-o.top-_-10),A<0&&(A=10),Y<0&&(Y=10);const le=w.map(se=>{let q=se.dataPoints[0],ne=1/0;return se.dataPoints.forEach(Q=>{const X=Math.sqrt(Math.pow(Q.x-g,2)+Math.pow(Q.y-h,2));X<ne&&(ne=X,q=Q)}),{seriesName:se.seriesName,color:se.color,value:ln(q.value!==void 0?q.value:se.value)}});xe.value={show:!0,x:A,y:Y,title:w.length===1?w[0].seriesName:"",value:"",bubbleData:[],spiderSeries:le}}else qe()},F=e.computed(()=>{const t=P.value;return t.logos.map((s,o)=>{const c=L.series[s.seriesIndex];if(!c||!c.data||c.data.length===0||Ue.value.has(s.seriesIndex))return null;let g,h;if(qt.value){let C=-1,S=null;for(let _=c.data.length-1;_>=0;_--)if(c.data[_]!==null&&c.data[_]!==void 0){C=_,S=c.data[_];break}if(C===-1||S===null)return null;const H=c.data.map((_,A)=>_==null?null:{x:Et(A),y:Mt(_),index:A}).filter(_=>_!==null);if(t.animations.enabled&&!Wn.value&&t.animations.type==="draw"&&t.chart.type==="line"&&(Ve.value.isAnimating||!Ve.value.hasAnimated))if(Ve.value.isAnimating){const _=Ve.value.currentFrame/Ve.value.totalFrames,A=$n(t.animations.easing,Math.min(_,1)),Y=Pl(H,A);g=Y.x+(s.offsetX||0),h=Y.y+(s.offsetY||0)}else g=H[0].x+(s.offsetX||0),h=H[0].y+(s.offsetY||0);else g=Et(C)+(s.offsetX||0),h=Mt(S)+(s.offsetY||0)}else if(cn.value||Hn.value){const C=Math.PI*2/t.logos.length*o;g=Je.value+Math.cos(C)*(Oe.value+30)+(s.offsetX||0),h=at.value+Math.sin(C)*(Oe.value+30)+(s.offsetY||0)}return{...s,x:g,y:h,seriesIndex:s.seriesIndex}}).filter(Boolean)}),I=t=>{const s=document.querySelector(`.dss-logo-fallback-${t}`),o=document.querySelector(`.dss-logo-image-${t}`);s&&(s.style.opacity="0"),o&&(o.style.opacity="1")},J=t=>{console.warn(`Logo ${t} failed to load, keeping fallback circle`);const s=document.querySelector(`.dss-logo-image-${t}`);s&&(s.style.display="none")},j=t=>{Ue.value.has(t)?Ue.value.delete(t):Ue.value.add(t)},Ee=e.computed(()=>{if(!xe.value.show&&!($t.value&&G.value.show&&!z.value.isZooming))return{display:"none"};let t,s;if($t.value&&G.value.show&&!z.value.isZooming){t=G.value.x+15,s=B.value.top;const o=wt.value?200:150;t+o>pe.value&&(t=G.value.x-o-15),t<0&&(t=10),s<10&&(s=10)}else t=xe.value.x,s=xe.value.y;return{left:t+"px",top:s+"px"}}),et=(t,s)=>{if(!ze.value||pt.value)return;const c=s.target.closest(".dss-custom-chart-container").getBoundingClientRect();let g=s.clientX-c.left+10,h=s.clientY-c.top-10;const w=200,C=120,S=pe.value,H=Qe.value;g+w>S&&(g=s.clientX-c.left-w-10),h+C>H&&(h=s.clientY-c.top-C-10),g<0&&(g=10),h<0&&(h=10);let _;typeof t.categoryIndex=="number"?_=t.categoryIndex:typeof t.dataIndex=="number"?_=t.dataIndex:t.label&&L.categories.includes(t.label)&&(_=L.categories.indexOf(t.label));const A=(Lt.value||ye.value==="bar")&&t.label?t.label:t.seriesName||t.label||"";xe.value={show:!0,x:g,y:h,title:A,value:ln(t.value)||"",categoryIndex:_,spiderSeries:[]}},Vt=e.ref(!1),st=e.ref(!1),qe=()=>{xe.value.show=!1,xe.value.spiderSeries=[],xe.value.bubbleData=[],G.value.show=!1,Vt.value||(K.value=null)},pt=e.ref(!1),rt=(t,s)=>{pt.value=!0,xe.value.show=!1,G.value.show=!1;const c=s.target.closest(".dss-custom-chart-container").getBoundingClientRect();let g=s.clientX-c.left+15,h=s.clientY-c.top-10;const w=250;g+w>pe.value&&(g=s.clientX-c.left-w-15),g<0&&(g=10),h<0&&(h=10),yo.value={show:!0,x:g,y:h,content:t.texts,count:t.totalCount}},mn=()=>{pt.value=!1,yo.value.show=!1},Ve=e.ref({isAnimating:!1,currentFrame:0,totalFrames:0,animationId:null,hasAnimated:!1}),$n=(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}},Wn=e.computed(()=>Ae.value?window.matchMedia("(prefers-reduced-motion: reduce)").matches:!1),ol=()=>{if(!Ct.value||Wn.value){Ve.value.hasAnimated=!0,hn.value&&(un.value=1);return}hn.value&&(un.value=0),Ve.value.isAnimating=!0,Ve.value.currentFrame=0,Ve.value.totalFrames=Math.ceil(Pe.value/16.67);const t=()=>{const s=Ve.value.currentFrame/Ve.value.totalFrames,o=$n(Te.value,Math.min(s,1));$l(o),hn.value&&(un.value=o),s<1?(Ve.value.currentFrame++,Ve.value.animationId=requestAnimationFrame(t)):bl()};Ve.value.animationId=requestAnimationFrame(t)},$l=t=>{const s=document.querySelector(".dss-custom-chart-container");s&&s.style.setProperty("--dss-animation-progress",t)},bl=()=>{Ve.value.isAnimating=!1,Ve.value.hasAnimated=!0,hn.value&&(un.value=1),Ve.value.animationId&&(cancelAnimationFrame(Ve.value.animationId),Ve.value.animationId=null)},wl=e.computed(()=>!cn.value||Ve.value.hasAnimated?!0:hn.value?un.value>=1:Bo.value?Jn.value>=1:!0),ll=e.computed(()=>Me.value&&wl.value),vo=e.ref(!1);e.watch(ll,t=>{t?(vo.value=!1,e.nextTick(()=>{requestAnimationFrame(()=>{vo.value=!0})})):vo.value=!1},{immediate:!0});const xl=e.computed(()=>{if(!Ct.value||Wn.value||Ve.value.hasAnimated)return{};const t={};return t["--dss-animation-duration"]=`${Pe.value}ms`,t["--dss-animation-easing"]=qn(Te.value),t["--dss-stagger-delay"]=`${Se.value}ms`,t}),qn=t=>({linear:"linear",ease:"ease","ease-in":"ease-in","ease-out":"ease-out","ease-in-out":"ease-in-out"})[t]||"ease-out",Un=()=>{if(!Ct.value||Wn.value)return"";const t=["dss-chart-animated"];return Ve.value.hasAnimated||t.push(`dss-animate-${ft.value}`),Ve.value.hasAnimated||(cn.value&&ye.value!=="semi-radial"?t.push("dss-animate-fill"):cn.value||t.push(`dss-animate-${ft.value}`)),Ve.value.isAnimating&&t.push("dss-is-animating"),t.join(" ")};e.watch(()=>L.series,(t,s)=>{bt.value&&s&&Ve.value.hasAnimated&&(Ve.value.hasAnimated=!1,e.nextTick(()=>{setTimeout(()=>ol(),je.value)}))},{deep:!0}),e.watch(()=>z.value.isZooming,(t,s)=>{s&&!t&&setTimeout(()=>{Oo()},50)}),e.watch(()=>[z.value.scale,z.value.offsetX],()=>{!z.value.isZooming&&!z.value.isDragging&&Oo()},{flush:"post"}),e.watch([fo,nn],([t,s])=>{z.value.minScale=t,z.value.maxScale=s,(z.value.scale<t||z.value.scale>s)&&Ho()},{immediate:!0}),e.watch(()=>L.locale,t=>{t&&t!==R.value&&(R.value=t)},{immediate:!0}),e.watch(()=>ve.value.show,t=>{t?e.nextTick(()=>{document.addEventListener("click",So)}):document.removeEventListener("click",So)}),e.onMounted(()=>{K.value=null,hn.value&&(!Ct.value||Wn.value)&&(un.value=1),pl(),E.value&&typeof ResizeObserver<"u"&&(ke=new ResizeObserver(t=>{const s=t[0];!s||!s.contentRect||(He&&cancelAnimationFrame(He),He=requestAnimationFrame(()=>{He=null;const{width:o,height:c}=s.contentRect;vt.value=Math.round(o),f.value=Math.round(c),Ke.value&&(tn.value=Ke.value.offsetHeight||$e)}))}),ke.observe(E.value)),Ct.value&&!Wn.value?ye.value==="semi-radial"?setTimeout(()=>uo(),je.value):setTimeout(()=>ol(),je.value):(Ve.value.hasAnimated=!0,ye.value==="semi-radial"&&(Jn.value=1)),document.addEventListener("mousemove",bn),document.addEventListener("mouseup",Ll),document.addEventListener("click",rn)}),e.onUnmounted(()=>{He&&cancelAnimationFrame(He),ke&&E.value&&(ke.unobserve(E.value),ke.disconnect(),ke=null),Ve.value.animationId&&cancelAnimationFrame(Ve.value.animationId),wo&&(cancelAnimationFrame(wo),wo=null),z.value.zoomTimeout&&clearTimeout(z.value.zoomTimeout),document.removeEventListener("mousemove",bn),document.removeEventListener("mouseup",Ll),document.removeEventListener("click",rn),document.removeEventListener("click",So)});const bn=t=>{if(z.value.isDragging&&z.value.scale>1&&qt.value){G.value.show=!1;const s=t.clientX-z.value.lastMouseX,{minX:o,maxX:c}=ht.value,g=c-o||1,w=s*.8;z.value.offsetX+=w;const C=g/z.value.scale,S=g-C,H=0,_=-S/g*B.value.width,A=H;z.value.offsetX=Math.max(_,Math.min(A,z.value.offsetX)),z.value.lastMouseX=t.clientX,z.value.lastMouseY=t.clientY}},Ll=()=>{z.value.isDragging&&(z.value.isDragging=!1,setTimeout(()=>{!z.value.isDragging&&z.value.isZooming},100))},Pl=(t,s)=>{const o=t.filter(C=>C!=null);if(!o||o.length===0)return{x:0,y:0};if(o.length===1||s<=0)return o[0];if(s>=1)return o[o.length-1];let c=0;const g=[];for(let C=1;C<o.length;C++){const S=o[C].x-o[C-1].x,H=o[C].y-o[C-1].y,_=Math.sqrt(S*S+H*H);g.push(_),c+=_}const h=c*s;let w=0;for(let C=0;C<g.length;C++){const S=w+g[C];if(h<=S){const H=(h-w)/g[C],_=o[C],A=o[C+1];return{x:_.x+(A.x-_.x)*H,y:_.y+(A.y-_.y)*H}}w=S}return o[o.length-1]};return(t,s)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{class:e.normalizeClass(["dss-custom-chart-container",[Un(),{"dss-chart-fill-width":Ht.value,"dss-chart-fill-height":Xt.value}]]),style:e.normalizeStyle({width:Ht.value?"100%":pe.value+"px",height:Xt.value?"100%":Qe.value+20+"px",...Ht.value||Xt.value?{overflow:"hidden",maxWidth:"100%",maxHeight:"100%"}:{},...xl.value,cursor:Nl()}),"data-chart-type":ye.value,ref_key:"containerEl",ref:E,onWheel:bo,onMousedown:Vl,onMousemove:Ot,onMouseup:vl,onMouseleave:Tn,onDblclick:Ho,onContextmenu:e.withModifiers(It,["prevent"]),onClick:e.withModifiers(Rn,["left"]),onWheelCapture:bo},[e.createElementVNode("div",{class:"dss-chart-header",ref_key:"headerEl",ref:Ke},[e.createElementVNode("div",ql,[Ce.value?(e.openBlock(),e.createElementBlock("div",Ul,e.toDisplayString(Ce.value),1)):e.createCommentVNode("",!0),Nt.value?(e.openBlock(),e.createElementBlock("div",Xl,e.toDisplayString(Nt.value),1)):e.createCommentVNode("",!0)]),dt.value&&(Xe.value==="top"||Xe.value==="bottom")?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["dss-chart-legend",{"dss-legend-horizontal":En.value==="horizontal","dss-legend-vertical":En.value==="vertical","dss-legend-top":Xe.value==="top","dss-legend-bottom":Xe.value==="bottom"}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(L.series,(o,c)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-${c}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":Ue.value.has(c),"dss-legend-hovered":K.value===c,"dss-legend-dimmed":K.value!==null&&K.value!==c}]),onClick:g=>j(c),onMouseenter:g=>fe(c),onMouseleave:Be,style:e.normalizeStyle({animationDelay:`${c*100}ms`})},[e.createElementVNode("div",{class:"dss-legend-color",style:e.normalizeStyle({backgroundColor:yt(c)})},null,4),e.createElementVNode("span",jl,e.toDisplayString(o.name),1)],46,Yl))),128))],2)):e.createCommentVNode("",!0),dt.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(L.series,(o,c)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-${c}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":Ue.value.has(c),"dss-legend-hovered":K.value===c,"dss-legend-dimmed":K.value!==null&&K.value!==c}]),onClick:g=>j(c),onMouseenter:g=>fe(c),onMouseleave:Be,style:e.normalizeStyle({animationDelay:`${c*100}ms`})},[e.createElementVNode("div",{class:"dss-legend-color",style:e.normalizeStyle({backgroundColor:yt(c)})},null,4),e.createElementVNode("span",Gl,e.toDisplayString(o.name),1)],46,Kl))),128))],2)):e.createCommentVNode("",!0)],512),Z.showAddMarkerButton&&mt.value.addMarker&&(qt.value||wt.value)?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-add-marker-button",onClick:Gn,title:e.unref(O)("chart.contextMenu.addMarker")},[e.createElementVNode("img",{src:Qt.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,Jl),s[5]||(s[5]=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,Ql)):e.createCommentVNode("",!0),e.createElementVNode("div",ea,[wt.value&&Yt.value?(e.openBlock(),e.createElementBlock("div",ta,"Bubble size: "+e.toDisplayString(Yt.value),1)):e.createCommentVNode("",!0),(e.openBlock(),e.createElementBlock("svg",{width:pe.value,height:Qe.value,class:"dss-chart-svg","data-smooth":ae.value,"data-animated":Ct.value,ref_key:"svgEl",ref:he},[e.createElementVNode("defs",null,[e.createElementVNode("clipPath",oa,[e.createElementVNode("rect",{x:B.value.left,y:B.value.top,width:B.value.width,height:B.value.height*4},null,8,la)]),Bo.value?(e.openBlock(),e.createElementBlock("clipPath",{key:0,id:Mo.value},[e.createElementVNode("path",{d:fl.value},null,8,sa)],8,aa)):e.createCommentVNode("",!0),hn.value?(e.openBlock(),e.createElementBlock("clipPath",{key:1,id:eo.value},[e.createElementVNode("path",{d:xt.value},null,8,ia)],8,ra)):e.createCommentVNode("",!0)]),qt.value||wt.value?(e.openBlock(),e.createElementBlock("g",ca,[ct.value?(e.openBlock(),e.createElementBlock("g",da,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(jo.value,(o,c)=>(e.openBlock(),e.createElementBlock("line",{key:`h-grid-${c}`,x1:B.value.left,x2:B.value.right,y1:o.y,y2:o.y,stroke:"#e0e0e0","stroke-width":"1","stroke-dasharray":"4,2",style:e.normalizeStyle({animationDelay:`${c*50}ms`})},null,12,ua))),128))])):e.createCommentVNode("",!0),e.createElementVNode("g",ma,[e.createElementVNode("line",{x1:B.value.left,x2:B.value.right,y1:B.value.bottom,y2:B.value.bottom,stroke:"#ccc","stroke-width":"1"},null,8,pa),e.createElementVNode("line",{x1:B.value.left,x2:B.value.left,y1:B.value.top,y2:B.value.bottom,stroke:"#ccc","stroke-width":"1"},null,8,va)]),e.createElementVNode("g",fa,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ko.value,(o,c)=>(e.openBlock(),e.createElementBlock("text",{key:`x-${c}`,x:o.x,y:o.y,"text-anchor":"middle","font-size":"12",fill:"#666",style:e.normalizeStyle({animationDelay:`${c*100}ms`})},e.toDisplayString(o.text),13,ga))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList($o.value,(o,c)=>(e.openBlock(),e.createElementBlock("text",{key:`y-${c}`,x:o.x,y:o.y,"text-anchor":"end","font-size":"12",fill:"#666","dominant-baseline":"middle",style:e.normalizeStyle({animationDelay:`${c*80}ms`})},e.toDisplayString(o.text),13,ha))),128)),it.value?(e.openBlock(),e.createElementBlock("text",{key:0,x:B.value.left+B.value.width/2,y:B.value.bottom+45,"text-anchor":"middle","font-size":"14","font-weight":"bold",fill:"#333"},e.toDisplayString(it.value),9,ya)):e.createCommentVNode("",!0),xn.value?(e.openBlock(),e.createElementBlock("text",{key:1,x:15,y:B.value.top+12+B.value.height/2,"text-anchor":"middle","font-size":"14","font-weight":"bold",fill:"#333",transform:`rotate(-90, 15, ${B.value.top+B.value.height/2})`},e.toDisplayString(xn.value),9,ka)):e.createCommentVNode("",!0)]),fn.value.length>0?(e.openBlock(),e.createElementBlock("g",Ca,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(fn.value,o=>(e.openBlock(),e.createElementBlock("g",{key:`flag-group-${o.categoryIndex}`},[e.createElementVNode("g",ba,[o.hasManual?(e.openBlock(),e.createElementBlock("line",{key:0,x1:o.x,x2:o.x,y1:B.value.bottom,y2:B.value.top,stroke:"#047395","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:c=>rt(o,c),onMouseleave:mn},null,40,wa)):e.createCommentVNode("",!0),o.hasAuto&&!o.hasManual?(e.openBlock(),e.createElementBlock("line",{key:1,x1:o.x,x2:o.x,y1:B.value.bottom,y2:B.value.top,stroke:"#0dbf89","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:c=>rt(o,c),onMouseleave:mn},null,40,xa)):e.createCommentVNode("",!0),o.hasAuto&&o.hasManual?(e.openBlock(),e.createElementBlock("line",{key:2,x1:o.x,x2:o.x,y1:B.value.bottom,y2:B.value.top,stroke:"#047395","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:c=>rt(o,c),onMouseleave:mn},null,40,Ea)):e.createCommentVNode("",!0)]),o.hasManual&&o.hasAuto?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:o.x+8,cy:Math.max(15,B.value.top-10),r:"14",fill:"#0dbf89",stroke:"#fafafa","stroke-width":"2",class:"flag-count-circle",onMouseover:c=>rt(o,c),onMouseleave:mn},null,40,Va)):e.createCommentVNode("",!0),e.createElementVNode("circle",{cx:o.x,cy:Math.max(15,B.value.top-10),r:"14",fill:o.hasManual&&o.hasAuto||o.hasManual?"#047395":"#0dbf89",stroke:"#fafafa","stroke-width":"2",class:"dss-flag-count-indicator",onMouseover:c=>rt(o,c),onMouseleave:mn},null,40,Na),e.createElementVNode("text",{x:o.x,y:Math.max(15,B.value.top-5),"text-anchor":"middle","font-size":"12","font-weight":"bold",fill:"#fafafa",class:"dss-flag-count-text","pointer-events":"none"},e.toDisplayString(o.totalCount),9,Sa)]))),128))])):e.createCommentVNode("",!0),e.createElementVNode("g",Ma,[Nn.value?(e.openBlock(),e.createElementBlock("g",Ba,[e.createElementVNode("g",{class:e.normalizeClass(["dss-bar-chart",{"dss-horizontal-bars":Lt.value}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Cl.value,(o,c)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`mixed-bar-${c}`},[o.isSmooth?(e.openBlock(),e.createElementBlock("path",{key:0,d:o.barPath,stroke:"#fafafa","stroke-width":"1",class:e.normalizeClass({"dss-bar-highlighted":o.isHighlighted,"dss-bar-dimmed":o.isDimmed,"dss-bar-hidden":o.isHidden}),style:e.normalizeStyle({fill:o.color,fillOpacity:o.isDimmed?.4:1,animationDelay:`${o.animationDelay}ms`}),onMouseover:g=>et(o,g),onMouseleave:qe},null,46,Ta)):(e.openBlock(),e.createElementBlock("rect",{key:1,x:o.x,y:o.y,width:o.width,height:o.height,fill:o.color,stroke:"#fafafa","stroke-width":"1",class:e.normalizeClass({"dss-bar-highlighted":o.isHighlighted,"dss-bar-dimmed":o.isDimmed,"dss-bar-hidden":o.isHidden}),style:e.normalizeStyle({animationDelay:`${o.animationDelay}ms`}),onMouseover:g=>et(o,g),onMouseleave:qe},null,46,Ha))],64))),128))],2),e.createElementVNode("g",$a,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(yl.value,(o,c)=>(e.openBlock(),e.createElementBlock("path",{key:`mixed-line-${c}`,d:o.path,stroke:o.color,"stroke-width":o.isHighlighted?Ne.value+2:Ne.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass({"dss-series-highlighted":o.isHighlighted,"dss-series-dimmed":o.isDimmed,"dss-series-hidden":o.isHidden}),style:e.normalizeStyle({"--dss-path-length":o.pathLength,animationDelay:`${o.animationDelay}ms`})},null,14,La))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Eo.value,(o,c)=>(e.openBlock(),e.createElementBlock("path",{key:`mixed-gap-connector-${c}`,d:o.path,stroke:o.color,"stroke-width":o.isHighlighted?Ne.value+2:Ne.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round","stroke-dasharray":"15, 10, 5, 10",opacity:o.isHighlighted?0:.5,class:e.normalizeClass({"dss-gap-connector":!0,"dss-series-dimmed":o.isDimmed,"dss-series-hidden":o.isHidden}),style:e.normalizeStyle({animationDelay:`${o.animationDelay}ms`,transition:"opacity 0.2s ease"})},null,14,_a))),128)),Ye.value>0||At.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(kl.value,(o,c)=>(e.openBlock(),e.createElementBlock("circle",{key:`mixed-point-${c}`,cx:o.x,cy:o.y,r:o.isHighlighted?nt(o,Ye.value)+2:nt(o,Ye.value),fill:o.color,stroke:"none",class:e.normalizeClass({"dss-point-highlighted":o.isHighlighted,"dss-point-dimmed":o.isDimmed,"dss-point-hidden":o.isHidden}),style:e.normalizeStyle({animationDelay:`${o.animationDelay}ms`}),onMouseover:g=>et(o,g),onMouseleave:qe},null,46,Aa))),128)):e.createCommentVNode("",!0)])])):ye.value==="line"?(e.openBlock(),e.createElementBlock("g",Da,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(lo.value,(o,c)=>(e.openBlock(),e.createElementBlock("path",{key:`anim-${c}`,d:o.path,stroke:o.color,"stroke-width":Ne.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass(["dss-line-animation-overlay",{"dss-animation-complete":Ve.value.hasAnimated}]),style:e.normalizeStyle({"--dss-path-length":o.pathLength,animationDelay:`${o.animationDelay}ms`})},null,14,Ra))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(yl.value,(o,c)=>(e.openBlock(),e.createElementBlock("path",{key:`line-${c}`,d:o.path,stroke:o.color,"stroke-width":o.isHighlighted?Ne.value+2:Ne.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass({"dss-series-highlighted":o.isHighlighted,"dss-series-dimmed":o.isDimmed,"dss-series-hidden":o.isHidden}),style:e.normalizeStyle({"--dss-path-length":o.pathLength,animationDelay:`${o.animationDelay}ms`})},null,14,Ia))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Eo.value,(o,c)=>(e.openBlock(),e.createElementBlock("path",{key:`gap-connector-${c}`,d:o.path,stroke:o.color,"stroke-width":o.isHighlighted?Ne.value+2:Ne.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round","stroke-dasharray":"15, 10, 5, 10",opacity:o.isHighlighted?0:.5,class:e.normalizeClass({"dss-gap-connector":!0,"dss-series-dimmed":o.isDimmed,"dss-series-hidden":o.isHidden}),style:e.normalizeStyle({animationDelay:`${o.animationDelay}ms`,transition:"opacity 0.2s ease"})},null,14,Fa))),128)),Ye.value>0||At.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(Jo.value,(o,c)=>(e.openBlock(),e.createElementBlock("circle",{key:`point-${c}`,cx:o.x,cy:o.y,r:o.isHighlighted?nt(o,Ye.value)+2:nt(o,Ye.value),fill:o.color,stroke:"none",class:e.normalizeClass({"dss-point-highlighted":o.isHighlighted,"dss-point-dimmed":o.isDimmed,"dss-point-hidden":o.isHidden}),style:e.normalizeStyle({animationDelay:`${o.animationDelay}ms`}),onMouseover:g=>et(o,g),onMouseleave:qe},null,46,za))),128)):e.createCommentVNode("",!0)])):ye.value==="area"?(e.openBlock(),e.createElementBlock("g",Pa,[e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(el.value,(o,c)=>(e.openBlock(),e.createElementBlock("mask",{key:`mask-${c}`,id:`area-mask-${c}-${Z.chartId}`},[e.createElementVNode("rect",{x:B.value.left-10,y:B.value.top-10,width:B.value.width+20,height:B.value.height+20,fill:"#fafafa",class:"dss-area-mask-rect",style:e.normalizeStyle({"--dss-mask-width":`${B.value.width+20}px`})},null,12,Za)],8,Oa))),128))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(el.value,(o,c)=>(e.openBlock(),e.createElementBlock("path",{key:`area-fill-${c}`,d:o.areaPath,fill:o.color,"fill-opacity":o.isHighlighted?on.value+.2:on.value,mask:`url(#area-mask-${c}-${Z.chartId})`,class:e.normalizeClass({"dss-area-fill-smooth":!0,"dss-series-highlighted":o.isHighlighted,"dss-series-dimmed":o.isDimmed,"dss-series-hidden":o.isHidden})},null,10,Wa))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(el.value,(o,c)=>(e.openBlock(),e.createElementBlock("path",{key:`area-line-${c}`,d:o.linePath,stroke:o.color,"stroke-width":o.isHighlighted?Ne.value+1:Ne.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass({"dss-area-line-animated":!0,"dss-series-highlighted":o.isHighlighted,"dss-series-dimmed":o.isDimmed,"dss-series-hidden":o.isHidden}),style:e.normalizeStyle({"--dss-path-length":o.pathLength,animationDelay:`${c*Se.value}ms`})},null,14,qa))),128))])):ye.value==="bar"?(e.openBlock(),e.createElementBlock("g",{key:3,class:e.normalizeClass({"dss-horizontal-bars":Lt.value})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Cl.value,(o,c)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`bar-${c}`},[o.isSmooth?(e.openBlock(),e.createElementBlock("path",{key:0,d:o.barPath,fill:o.color,stroke:"#fafafa","stroke-width":"1",class:e.normalizeClass({"dss-bar-highlighted":o.isHighlighted,"dss-bar-dimmed":o.isDimmed,"dss-bar-hidden":o.isHidden}),style:e.normalizeStyle({animationDelay:`${o.animationDelay}ms`}),onMouseover:g=>et(o,g),onMouseleave:qe},null,46,Ua)):(e.openBlock(),e.createElementBlock("rect",{key:1,x:o.x,y:o.y,width:o.width,height:o.height,stroke:"#fafafa","stroke-width":"1",class:e.normalizeClass({"dss-bar-highlighted":o.isHighlighted,"dss-bar-dimmed":o.isDimmed,"dss-bar-hidden":o.isHidden}),style:e.normalizeStyle({fill:o.color,fillOpacity:o.isDimmed?.4:1,animationDelay:`${o.animationDelay}ms`}),onMouseover:g=>et(o,g),onMouseleave:qe},null,46,Xa))],64))),128))],2)):e.createCommentVNode("",!0)]),$t.value&&G.value.show&&!z.value.isZooming?(e.openBlock(),e.createElementBlock("g",Ya,[e.createElementVNode("line",{x1:G.value.x,x2:G.value.x,y1:B.value.top,y2:B.value.bottom,stroke:Kt.value,"stroke-width":"1","stroke-dasharray":"4,4",opacity:"0.8"},null,8,ja),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(G.value.data,(o,c)=>(e.openBlock(),e.createElementBlock("circle",{key:`dss-crosshair-point-${c}`,cx:G.value.x,cy:o.y,r:Ye.value+2,fill:o.color,stroke:"none",opacity:"0.9"},null,8,Ka))),128))])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),wt.value?(e.openBlock(),e.createElementBlock("g",Ga,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_o.value,(o,c)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`bubble-${c}`},[o?(e.openBlock(),e.createElementBlock("g",Qa,[e.createElementVNode("circle",{cx:o.x,cy:o.y,r:o.radius,fill:o.color,"fill-opacity":Tl(o),stroke:o.color,"stroke-width":"1","stroke-opacity":"0.8",class:e.normalizeClass(Hl(o,c)),style:{cursor:"pointer",transition:"all 0.3s ease"},onMouseenter:g=>tl(o,g),onMouseleave:g=>n(o),onClick:g=>Ao(o,g)},null,42,Ja),o.imageUrl?(e.openBlock(),e.createElementBlock("image",{key:0,x:o.x-o.radius*.65,y:o.y-o.radius*.65,width:o.radius*1.3,height:o.radius*1.3,"xlink:href":o.imageUrl,class:e.normalizeClass(`dss-bubble-image-${c} ${o.isHighlighted?"dss-bubble-highlighted":""} ${o.isDimmed?"dss-bubble-dimmed":""} ${o.isHidden?"dss-bubble-hidden":""}`),"clip-path":`circle(${o.radius*.65}px at ${o.radius*.65}px ${o.radius*.65}px)`,style:e.normalizeStyle({cursor:"pointer",transition:"all 0.3s ease",opacity:po(o)}),onLoad:g=>Sl(c),onError:g=>Ml(c),onMouseenter:g=>tl(o,g),onMouseleave:g=>n(o),onClick:g=>Ao(o,g)},null,46,es)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],64))),128))])):e.createCommentVNode("",!0),cn.value?(e.openBlock(),e.createElementBlock("g",{key:2,class:"radial-chart",transform:co.value},[ye.value==="radial"?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:Je.value,cy:at.value,r:Oe.value,fill:"none",stroke:"#e0e0e0","stroke-width":"1"},null,8,ns)):e.createCommentVNode("",!0),e.createElementVNode("g",{class:"dss-radial-data","data-chart-type":ye.value,"clip-path":gl.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Zn.value,(o,c)=>(e.openBlock(),e.createElementBlock("path",{key:`radial-${c}`,d:o.path,fill:o.color,"fill-opacity":o.isHighlighted?(o.opacity||.8)+.2:o.opacity||.8,stroke:o.strokeWidth?o.strokeColor||o.color:"none","stroke-width":o.strokeWidth||0,class:e.normalizeClass({"dss-series-highlighted":o.isHighlighted,"dss-series-dimmed":o.isDimmed,"dss-series-hidden":o.isHidden}),onMouseover:g=>et(o,g),onMouseleave:qe},null,42,ls))),128))],8,os),go.value&&wl.value?(e.openBlock(),e.createElementBlock("g",as,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Io.value,(o,c)=>e.withDirectives((e.openBlock(),e.createElementBlock("text",{key:`radial-segment-label-${c}`,x:o.x,y:o.y,"text-anchor":"middle","dominant-baseline":"middle",class:"dss-radial-segment-data-label"},e.toDisplayString(o.value),9,ss)),[[e.vShow,o.show]])),128))])):e.createCommentVNode("",!0),Bn.value&&wl.value?(e.openBlock(),e.createElementBlock("text",{key:2,x:Vo.value.x,y:Vo.value.y,"text-anchor":"middle","dominant-baseline":"middle","font-size":To.value,fill:Vn.value,class:"dss-radial-data-center"},e.toDisplayString(en.value),9,rs)):e.createCommentVNode("",!0),ll.value?(e.openBlock(),e.createElementBlock("g",{key:3,class:e.normalizeClass(["dss-radial-labels dss-radial-labels-initial",{"dss-radial-labels-animated":vo.value}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Sn.value,(o,c)=>(e.openBlock(),e.createElementBlock("g",{key:`radial-label-${c}`,class:e.normalizeClass(["dss-radial-label-group",{"dss-label-highlighted":o.isHighlighted,"dss-label-dimmed":o.isDimmed}]),style:e.normalizeStyle({"--label-delay":`${c*.08}s`})},[e.createElementVNode("line",{class:"dss-radial-label-line dss-radial-label-line-pointer",x1:o.pointerStartX,y1:o.pointerStartY,x2:o.pointerEndX,y2:o.pointerEndY,stroke:o.color,"stroke-width":"1.5",opacity:"0.8",style:e.normalizeStyle({"--line-length":o.pointerLineLength})},null,12,is),e.createElementVNode("line",{class:"dss-radial-label-line dss-radial-label-line-horizontal",x1:o.pointerEndX,y1:o.pointerEndY,x2:o.horizontalEndX,y2:o.horizontalEndY,stroke:o.color,"stroke-width":"1.5",opacity:"0.8",style:e.normalizeStyle({"--line-length":o.horizontalLineLength})},null,12,cs),e.createElementVNode("text",{class:"dss-radial-label-text",x:o.textX,y:o.textY,"text-anchor":o.textAnchor,"font-size":Tt.value,"dominant-baseline":"middle"},e.toDisplayString(o.text),9,ds)],6))),128))],2)):e.createCommentVNode("",!0)],8,ts)):e.createCommentVNode("",!0),Hn.value?(e.openBlock(),e.createElementBlock("g",{key:3,class:"dss-spider-chart",transform:co.value},[ct.value?(e.openBlock(),e.createElementBlock("g",ms,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(De.value,(o,c)=>(e.openBlock(),e.createElementBlock("circle",{key:`spider-grid-circle-${c}`,cx:Je.value,cy:at.value,r:o,fill:"none",stroke:"#dedede","stroke-width":"1",style:e.normalizeStyle({animationDelay:`${c*150}ms`})},null,12,ps))),128)),e.createElementVNode("g",vs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(De.value,(o,c)=>(e.openBlock(),e.createElementBlock("g",{key:`spider-grid-label-group-${c}`},[e.createElementVNode("rect",{x:Je.value-16,y:at.value-o-7,width:"32",height:"16",fill:"#fafafa",stroke:"none"},null,8,fs),e.createElementVNode("text",{x:Je.value,y:at.value-o+2,"text-anchor":"middle","dominant-baseline":"central",class:"dss-spider-grid-label",style:{fontSize:"10px",fill:"#999",fontWeight:"600"}},e.toDisplayString(ut(c)),9,gs)]))),128))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,(o,c)=>(e.openBlock(),e.createElementBlock("line",{key:`spider-axis-${c}`,x1:Je.value,x2:o.x,y1:at.value,y2:o.y,stroke:"#dedede","stroke-width":"1",style:e.normalizeStyle({animationDelay:`${c*100}ms`})},null,12,hs))),128))])):e.createCommentVNode("",!0),e.createElementVNode("g",ys,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,(o,c)=>(e.openBlock(),e.createElementBlock("text",{key:`spider-label-${c}`,x:o.x+Math.cos(c*2*Math.PI/i.value-Math.PI/2)*16,y:o.y+Math.sin(c*2*Math.PI/i.value-Math.PI/2)*16,"text-anchor":o.anchor,"dominant-baseline":o.baseline,"font-size":"14px",fill:"#666","font-weight":"500",style:e.normalizeStyle({animationDelay:`${c*120}ms`})},e.toDisplayString(o.text.charAt(0).toUpperCase()+o.text.slice(1)),13,ks))),128))]),e.createElementVNode("g",{class:"dss-spider-data",onMousemove:b,onMouseleave:qe},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(x.value,(o,c)=>(e.openBlock(),e.createElementBlock("g",{key:`spider-${c}`},[e.createElementVNode("polygon",{points:o.points,fill:o.color,"fill-opacity":y("current",o,c),stroke:o.color,"stroke-width":o.isHighlighted?Ne.value+1:Ne.value,"stroke-linejoin":"round",class:e.normalizeClass({"dss-series-highlighted":o.isHighlighted,"dss-series-dimmed":o.isDimmed,"dss-series-hidden":o.isHidden}),style:e.normalizeStyle({animationDelay:`${c*Se.value}ms`,transition:"all 0.2s ease"})},null,14,Cs),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.dataPoints,(g,h)=>(e.openBlock(),e.createElementBlock("circle",{key:`spider-point-${c}-${h}`,cx:g.x,cy:g.y,r:o.isHighlighted?Ye.value+1:Ye.value>0?Ye.value:0,fill:o.color,stroke:"none",class:e.normalizeClass({"dss-point-highlighted":o.isHighlighted,"dss-point-dimmed":o.isDimmed,"dss-point-hidden":o.isHidden}),style:e.normalizeStyle({animationDelay:`${c*Se.value+h*50}ms`,transition:"all 0.2s ease"}),onMouseover:w=>et(g,w),onMouseleave:qe},null,46,bs))),128))]))),128))],32)],8,us)):e.createCommentVNode("",!0),e.createElementVNode("g",ws,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(F.value,(o,c)=>(e.openBlock(),e.createElementBlock("circle",{key:`logo-fallback-${c}`,cx:o.x,cy:o.y,r:o.width/2,fill:yt(o.seriesIndex),stroke:"#fafafa","stroke-width":"2",class:e.normalizeClass(`logo-fallback-${c}`),style:e.normalizeStyle({animationDelay:`${c*200}ms`})},null,14,xs))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(F.value,(o,c)=>(e.openBlock(),e.createElementBlock("image",{key:`logo-${c}`,x:o.x-o.width/2,y:o.y-o.height/2,width:o.width,height:o.height,"xlink:href":o.url,onLoad:g=>I(c),onError:g=>J(c),preserveAspectRatio:"xMidYMid slice",class:e.normalizeClass(`dss-logo-image-${c}`),"clip-path":`circle(${o.width/2}px at ${o.width/2}px ${o.height/2}px)`,style:e.normalizeStyle({animationDelay:`${c*200}ms`})},null,46,Es))),128))])],8,na))]),Dn.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-chart-watermark",style:e.normalizeStyle({position:"absolute",top:"0px",left:"0px",width:pe.value+"px",height:Qe.value+"px",backgroundImage:`url('${we.value}')`,backgroundRepeat:"no-repeat",...te.value,opacity:M.value,pointerEvents:"none",zIndex:10})},null,4)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(An.value,(o,c)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{key:"marker-"+o.id,class:"dss-chart-marker",style:e.normalizeStyle({position:"absolute",left:o.x+"px",top:o.y+"px",width:Jt.value+"px",height:Jt.value+"px",backgroundColor:"#fafafa",borderRadius:"50%",border:"2px solid #ddd",cursor:"pointer",zIndex:500}),onClick:e.withModifiers(g=>ml(o),["stop"]),onMouseenter:g=>a(o,g),onMouseleave:r},[e.createElementVNode("img",{src:Po(o),class:"dss-marker-icon",alt:"Marker Icon",style:{width:"100%",height:"100%","object-fit":"contain","border-radius":"50%","pointer-events":"none"}},null,8,Ns)],44,Vs)),[[e.vShow,Rt.value]])),128)),gn.value.show?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-marker-tooltip",style:e.normalizeStyle({left:gn.value.x+"px",top:gn.value.y+"px"})},[e.createElementVNode("div",Ss,e.toDisplayString(gn.value.categoryValue),1),gn.value.description?(e.openBlock(),e.createElementBlock("div",Ms,e.toDisplayString(gn.value.description),1)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),ze.value&&(xe.value.show||$t.value&&G.value.show&&!z.value.isZooming)?(e.openBlock(),e.createElementBlock("div",{key:3,class:e.normalizeClass(["dss-chart-tooltip",{"dss-crosshair-tooltip":$t.value&&G.value.show&&!z.value.isZooming}]),style:e.normalizeStyle(Ee.value)},[!$t.value||!G.value.show||z.value.isZooming?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[Hn.value&&xe.value.spiderSeries&&xe.value.spiderSeries.length>0?(e.openBlock(),e.createElementBlock("div",Bs,[xe.value.title?(e.openBlock(),e.createElementBlock("div",Ts,e.toDisplayString(xe.value.title),1)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(xe.value.spiderSeries,(o,c)=>(e.openBlock(),e.createElementBlock("div",{key:`spider-tooltip-${c}`,class:"dss-tooltip-series"},[e.createElementVNode("div",{class:"dss-tooltip-series-indicator",style:e.normalizeStyle({backgroundColor:o.color})},null,4),e.createElementVNode("span",Hs,e.toDisplayString(o.seriesName)+":",1),e.createElementVNode("span",$s,e.toDisplayString(o.value),1)]))),128))])):wt.value&&xe.value.bubbleData&&xe.value.bubbleData.length>0?(e.openBlock(),e.createElementBlock("div",Ls,[xe.value.title?(e.openBlock(),e.createElementBlock("div",_s,e.toDisplayString(xe.value.title),1)):e.createCommentVNode("",!0),e.createElementVNode("div",As,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(xe.value.bubbleData,(o,c)=>(e.openBlock(),e.createElementBlock("div",{key:`bubble-tooltip-${c}`,class:"dss-bubble-tooltip-item"},e.toDisplayString(o.value),1))),128))])])):(e.openBlock(),e.createElementBlock("div",Ds,[e.createElementVNode("div",Rs,e.toDisplayString(xe.value.title),1),e.createElementVNode("div",Is,e.toDisplayString(xe.value.value),1)])),xe.value.categoryIndex!==void 0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[ie(xe.value.categoryIndex).flagGroups.length>0?(e.openBlock(),e.createElementBlock("div",Fs,[s[6]||(s[6]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",zs,e.toDisplayString(e.unref(O)("chart.tooltip.flags")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ie(xe.value.categoryIndex).flagGroups,(o,c)=>(e.openBlock(),e.createElementBlock("div",{key:`tooltip-flag-group-${c}`},[e.createElementVNode("div",Ps,[e.createElementVNode("div",{class:"dss-tooltip-item-indicator",style:e.normalizeStyle({backgroundColor:o.color})},null,4),e.createElementVNode("span",null,e.toDisplayString(o.type),1)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.flags,(g,h)=>(e.openBlock(),e.createElementBlock("div",{key:`tooltip-flag-${c}-${h}`,class:"dss-tooltip-item dss-tooltip-item-no-indicator"},[e.createElementVNode("div",Os,[e.createElementVNode("div",Zs,e.toDisplayString(g.text),1)])]))),128))]))),128))])):e.createCommentVNode("",!0),ie(xe.value.categoryIndex).markers.length>0?(e.openBlock(),e.createElementBlock("div",Ws,[s[7]||(s[7]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",qs,e.toDisplayString(e.unref(O)("chart.tooltip.markers")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ie(xe.value.categoryIndex).markers,(o,c)=>(e.openBlock(),e.createElementBlock("div",{key:`tooltip-marker-${c}`,class:"dss-tooltip-item"},[e.createElementVNode("div",{class:"dss-tooltip-item-indicator",style:e.normalizeStyle({backgroundColor:o.color})},null,4),e.createElementVNode("div",Us,[e.createElementVNode("div",Xs,e.toDisplayString(o.title),1),o.description?(e.openBlock(),e.createElementBlock("div",Ys,e.toDisplayString(o.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",js,[e.createElementVNode("div",Ks,e.toDisplayString(wt.value?l():Z.categories[G.value.categoryIndex]||`Category ${G.value.categoryIndex+1}`),1),wt.value?(e.openBlock(),e.createElementBlock("div",Gs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(G.value.data,(o,c)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-tooltip-${c}`,class:"dss-bubble-tooltip-item"},e.toDisplayString(o.value),1))),128))])):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(G.value.data,(o,c)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-tooltip-${c}`,class:"dss-tooltip-series"},[e.createElementVNode("div",{class:"dss-tooltip-series-indicator",style:e.normalizeStyle({backgroundColor:o.color})},null,4),e.createElementVNode("span",Qs,e.toDisplayString(o.seriesName)+":",1),e.createElementVNode("span",Js,e.toDisplayString(ln(o.value)),1)]))),128))]),ie(G.value.categoryIndex).flagGroups.length>0?(e.openBlock(),e.createElementBlock("div",er,[s[8]||(s[8]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",tr,e.toDisplayString(e.unref(O)("chart.tooltip.flags")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ie(G.value.categoryIndex).flagGroups,(o,c)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-flag-group-${c}`},[e.createElementVNode("div",nr,[e.createElementVNode("div",{class:"dss-tooltip-item-indicator",style:e.normalizeStyle({backgroundColor:o.color})},null,4),e.createElementVNode("span",null,e.toDisplayString(o.type),1)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.flags,(g,h)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-flag-${c}-${h}`,class:"dss-tooltip-item dss-tooltip-item-no-indicator"},[e.createElementVNode("div",or,[e.createElementVNode("div",lr,e.toDisplayString(g.text),1)])]))),128))]))),128))])):e.createCommentVNode("",!0),ie(G.value.categoryIndex).markers.length>0?(e.openBlock(),e.createElementBlock("div",ar,[s[9]||(s[9]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",sr,e.toDisplayString(e.unref(O)("chart.tooltip.markers")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ie(G.value.categoryIndex).markers,(o,c)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-dss-marker-${c}`,class:"dss-tooltip-item"},[e.createElementVNode("div",{class:"dss-tooltip-item-indicator",style:e.normalizeStyle({backgroundColor:o.color})},null,4),e.createElementVNode("div",rr,[e.createElementVNode("div",ir,e.toDisplayString(o.title),1),o.description?(e.openBlock(),e.createElementBlock("div",cr,e.toDisplayString(o.description),1)):e.createCommentVNode("",!0)])]))),128))])):e.createCommentVNode("",!0)],64))],6)):e.createCommentVNode("",!0),qt.value&&Bt.value&&z.value.scale>1?(e.openBlock(),e.createElementBlock("div",{key:4,class:"dss-zoom-indicator",onClick:Ho},[s[10]||(s[10]=e.createElementVNode("span",{style:{display:"inline-block",transform:"scaleX(-1)","font-size":"14px"}},"⌕",-1)),e.createTextVNode(" "+e.toDisplayString(Math.round(z.value.scale*100))+"% "+e.toDisplayString(e.unref(O)("chart.zoom.doubleClickToReset")),1)])):e.createCommentVNode("",!0)],46,Wl),ve.value.show?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-chart-context-menu",style:e.normalizeStyle({left:ve.value.x+"px",top:ve.value.y+"px"}),onClick:s[0]||(s[0]=e.withModifiers(()=>{},["stop"]))},[mt.value.addMarker?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-context-menu-item",onClick:Kn},e.toDisplayString(e.unref(O)("chart.contextMenu.addMarker")),1)):e.createCommentVNode("",!0),mt.value.addMarker&&(mt.value.downloadSvg||mt.value.downloadPng||mt.value.downloadCsv||gt.value.length>0)?(e.openBlock(),e.createElementBlock("div",dr)):e.createCommentVNode("",!0),mt.value.downloadSvg?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-context-menu-item",onClick:jn},e.toDisplayString(e.unref(O)("chart.contextMenu.downloadSvg")),1)):e.createCommentVNode("",!0),mt.value.downloadPng?(e.openBlock(),e.createElementBlock("div",{key:3,class:"dss-context-menu-item",onClick:Co},e.toDisplayString(e.unref(O)("chart.contextMenu.downloadPng")),1)):e.createCommentVNode("",!0),mt.value.downloadCsv?(e.openBlock(),e.createElementBlock("div",{key:4,class:"dss-context-menu-item",onClick:In},e.toDisplayString(e.unref(O)("chart.contextMenu.downloadCsv")),1)):e.createCommentVNode("",!0),gt.value.length>0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:5},[mt.value.downloadSvg||mt.value.downloadPng||mt.value.downloadCsv?(e.openBlock(),e.createElementBlock("div",ur)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(gt.value,(o,c)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"custom-"+c},[o.separator?(e.openBlock(),e.createElementBlock("div",mr)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(Xn(o)),style:e.normalizeStyle(sn(o)),onClick:g=>Fn(o)},[o.template?(e.openBlock(),e.createElementBlock("div",{key:0,innerHTML:zo(o),class:"dss-custom-menu-content"},null,8,vr)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[o.icon?(e.openBlock(),e.createElementBlock("span",fr,e.toDisplayString(o.icon),1)):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(o.label),1)],64))],14,pr)],64))),128))],64)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),p.value.show?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-marker-modal-overlay",onClick:St},[e.createElementVNode("div",{class:"dss-marker-modal",onClick:s[4]||(s[4]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",gr,[e.createElementVNode("h3",null,e.toDisplayString(U.value?e.unref(O)("chart.modalMarker.viewMarker"):$.value?e.unref(O)("chart.modalMarker.editMarker"):e.unref(O)("chart.contextMenu.addMarker")),1),e.createElementVNode("button",{class:"dss-modal-close-btn",onClick:St},"×")]),e.createElementVNode("div",hr,[e.createElementVNode("div",yr,[p.value.fromButton?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("label",kr,e.toDisplayString(Ft(p.value.categoryIndex)||""),1)),p.value.fromButton?(e.openBlock(),e.createElementBlock("div",Cr,[e.withDirectives(e.createElementVNode("select",{id:"dss-marker-category","onUpdate:modelValue":s[1]||(s[1]=o=>p.value.categoryIndex=o),class:"dss-form-select",disabled:U.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(V.value,(o,c)=>(e.openBlock(),e.createElementBlock("option",{key:`category-option-${c}`,value:c},e.toDisplayString(o),9,wr))),128))],8,br),[[e.vModelSelect,p.value.categoryIndex]])])):e.createCommentVNode("",!0)]),e.createElementVNode("div",xr,[e.createElementVNode("label",Er,e.toDisplayString(e.unref(O)("chart.modalMarker.description")),1),U.value?(e.openBlock(),e.createElementBlock("div",Vr,e.toDisplayString(p.value.description),1)):e.withDirectives((e.openBlock(),e.createElementBlock("textarea",{key:1,id:"dss-marker-description","onUpdate:modelValue":s[2]||(s[2]=o=>p.value.description=o),placeholder:e.unref(O)("chart.modalMarker.placeholderDescription"),class:"dss-form-textarea",rows:"3"},null,8,Nr)),[[e.vModelText,p.value.description]])]),e.createElementVNode("div",Sr,[e.createElementVNode("label",null,e.toDisplayString(e.unref(O)("chart.modalMarker.iconPreview")),1),e.createElementVNode("div",Mr,[e.createElementVNode("img",{src:Po({type:p.value.type}),alt:"Marker Icon Preview",class:"preview-icon",style:{width:"32px",height:"32px","border-radius":"50%",border:"2px solid #ddd"},onError:s[3]||(s[3]=o=>o.target.style.display="none")},null,40,Br)])])]),e.createElementVNode("div",Tr,[e.createElementVNode("div",Hr,[$.value&&!U.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-btn dss-btn-danger",onClick:dl},e.toDisplayString(e.unref(O)("chart.modalMarker.deleteMarker")),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",$r,[e.createElementVNode("button",{class:"dss-btn dss-btn-secondary",onClick:St},e.toDisplayString(U.value?e.unref(O)("chart.modalMarker.close"):e.unref(O)("chart.modalMarker.cancel")),1),U.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-btn dss-btn-primary",onClick:cl,disabled:!(p.value.description&&p.value.description.length)},e.toDisplayString($.value?e.unref(O)("chart.modalMarker.save"):e.unref(O)("chart.contextMenu.addMarker")),9,Lr))])])])])):e.createCommentVNode("",!0)],64))}}),Dr={class:"dss-modal-title"},Rr={class:"dss-modal-actions"},_l={__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(Z,{emit:Ut}){const O=Z,R=Ut,Ie=e.ref(null),E=e.ref(null),he=e.computed(()=>{const L={"max-width":O.width};return O.height!=="auto"&&(L.height=O.height,L["min-height"]="0"),L}),Ke=e.computed(()=>({}));function vt(){R("close-modal")}function f(){O.backDrop&&!Ie.value&&R("close-modal")}function ke(L){L.target.tagName==="INPUT"&&(Ie.value=L.target.tagName)}function He(){setTimeout(()=>{Ie.value=null},300)}function $e(){const L=document.body,_e=document.documentElement;E.value={bodyOverflow:L.style.overflow,bodyPosition:L.style.position,bodyTop:L.style.top,bodyWidth:L.style.width,htmlOverflow:_e.style.overflow,scrollY:window.scrollY},L.style.overflow="hidden",L.style.position="fixed",L.style.top=`-${E.value.scrollY}px`,L.style.width="100%",L.style.left="0",_e.style.overflow="hidden"}function Le(){if(!E.value)return;const L=document.body,_e=document.documentElement,{bodyOverflow:Ge,bodyPosition:_t,bodyTop:kt,bodyWidth:P,htmlOverflow:Ht,scrollY:Xt}=E.value;L.style.overflow=Ge||"",L.style.position=_t||"",L.style.top=kt||"",L.style.width=P||"",L.style.left="",_e.style.overflow=Ht||"",window.scrollTo(0,Xt||0)}return e.watch(()=>O.showModal,L=>{if(L)$e(),document.body.classList.add("dss-modal-open"),setTimeout(()=>{const _e=document.getElementById("dss-modal-backdrop");_e&&(_e.addEventListener("focusin",ke),_e.addEventListener("focusout",He))},100);else{Le(),document.body.classList.remove("dss-modal-open");const _e=document.getElementById("dss-modal-backdrop");_e&&(_e.removeEventListener("focusin",ke),_e.removeEventListener("focusout",He))}},{immediate:!0}),e.onUnmounted(()=>{O.showModal&&Le()}),(L,_e)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[Z.showModal?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-modal-backdrop",onClick:f},[e.withDirectives(e.createElementVNode("div",{id:"dss-modal-backdrop",class:"dss-modal",style:e.normalizeStyle(he.value)},[e.createElementVNode("div",{class:"dss-modal-content",onClick:_e[0]||(_e[0]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:"dss-modal-header",style:e.normalizeStyle({"justify-content":Z.headerType,"font-size":Z.titleSize})},[e.createElementVNode("h1",Dr,[e.renderSlot(L.$slots,"title",{},()=>[_e[1]||(_e[1]=e.createTextVNode("Default Title",-1))])]),e.renderSlot(L.$slots,"title-data"),Z.showCloseBtn?(e.openBlock(),e.createElementBlock("span",{key:0,class:"dss-modal-close",onClick:vt,title:"Close"},"×")):e.createCommentVNode("",!0)],4),e.createElementVNode("div",{class:"dss-modal-body",style:e.normalizeStyle(Ke.value)},[e.renderSlot(L.$slots,"content",{},()=>[_e[2]||(_e[2]=e.createTextVNode("Default Content",-1))])],4),e.createElementVNode("div",Rr,[e.renderSlot(L.$slots,"actions")])])],4),[[e.vShow,Z.showModal]])])):e.createCommentVNode("",!0)]))}},Ir={key:0,class:"dss-table-toolbar"},Fr={class:"dss-table-toolbar-left"},zr=["aria-expanded"],Pr={class:"dss-pagination-select-dropdown",role:"listbox"},Or={class:"dss-table-column-visibility-label"},Zr={class:"dss-table-checkbox-wrapper"},Wr=["checked","onChange"],qr={key:0,class:"dss-table-checkbox__check","aria-hidden":"true"},Ur={class:"dss-table-column-visibility-text"},Xr={class:"dss-table-toolbar-right"},Yr=["placeholder"],jr=["aria-expanded"],Kr={key:1,class:"dss-table-toolbar-extra"},Gr={class:"dss-table-thead"},Qr={key:0,class:"dss-table-th dss-table-selection-column"},Jr={key:0,class:"dss-table-checkbox-wrapper"},ei=["checked","indeterminate"],ti={key:0,class:"dss-table-checkbox__indeterminate"},ni={key:1,class:"dss-table-checkbox__check","aria-hidden":"true"},oi={key:1,class:"dss-table-th dss-table-expansion-column","aria-label":"Expand row"},li=["onClick"],ai={class:"dss-table-th-content"},si={class:"dss-table-th-text"},ri={key:0},ii={key:1},ci={key:2},di=["aria-expanded","onClick"],ui={class:"dss-table-tbody"},mi=["onClick"],pi={class:"dss-table-checkbox-wrapper"},vi=["type","name","checked","onChange"],fi={key:0,class:"dss-table-checkbox__check","aria-hidden":"true"},gi={key:1,class:"dss-table-checkbox__dot"},hi=["onClick"],yi=["aria-expanded","aria-label"],ki={key:0,class:"dss-table-expansion-row"},Ci=["colspan"],bi=["colspan"],wi={key:1,class:"dss-table-pagination"},xi={class:"dss-pagination-center"},Ei={class:"dss-pagination-controls"},Vi=["disabled","title"],Ni=["disabled","title"],Si={class:"dss-pagination-pages"},Mi=["onClick"],Bi={key:1,class:"dss-pagination-ellipsis"},Ti=["disabled","title"],Hi=["disabled","title"],$i=["aria-expanded"],Li={class:"dss-pagination-select-dropdown",role:"listbox"},_i=["aria-selected","onClick"],Ai={key:0,class:"dss-table-filter-row"},Di=["value","placeholder"],Ri=["min","max","value"],Ii=["min","max","value"],Fi={class:"dss-table-filter-double-range-values"},zi={key:2,class:"dss-table-filter-daterange"},Pi={class:"dss-table-filter-daterange-row"},Oi={class:"dss-table-filter-daterange-label"},Zi=["value"],Wi={class:"dss-table-filter-daterange-row"},qi={class:"dss-table-filter-daterange-label"},Ui=["value"],Xi=["value","placeholder"],Yi={class:"dss-table-filter-list"},ji=["checked","onChange"],Ki={class:"dss-table-filter-actions"},Gi={name:"DSSTable"},Qi=Object.assign(Gi,{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:Z=>typeof Z=="object"&&Z!==null}},emits:["row-click","row-select","row-unselect","select-all","unselect-all","row-expand","row-collapse","sort","page","download-pdf","download-excel","search"],setup(Z,{emit:Ut}){const{t:O,locale:R}=al.useI18n(),Ie=Z,E=Ut,he={table:{width:"auto",height:null,rowHeight:"auto",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 Ke(k,p){const V=Object.assign({},k);return vt(k)&&vt(p)&&Object.keys(p).forEach($=>{vt(p[$])?$ in k?V[$]=Ke(k[$],p[$]):Object.assign(V,{[$]:p[$]}):Object.assign(V,{[$]:p[$]})}),V}function vt(k){return k&&typeof k=="object"&&!Array.isArray(k)}const f=e.computed(()=>Ke(he,Ie.options)),ke=e.computed(()=>{const k=f.value.table.width;return k==="auto"?null:typeof k=="number"?k:null}),He=e.computed(()=>f.value.table.height),$e=e.computed(()=>f.value.table.rowHeight??"auto"),Le=e.computed(()=>({height:$e.value})),L=e.computed(()=>f.value.table.expandable===!0),_e=e.computed(()=>f.value.table.striped),Ge=e.computed(()=>f.value.table.bordered),_t=e.computed(()=>f.value.table.hoverable),kt=e.computed(()=>f.value.table.size),P=e.computed(()=>f.value.table.align||"left");e.computed(()=>f.value.title.text),e.computed(()=>f.value.subtitle.text);const Ht=e.computed(()=>f.value.selection.enabled),Xt=e.computed(()=>f.value.selection.mode),pe=e.computed(()=>f.value.sorting.enabled),tn=e.computed(()=>f.value.sorting.mode),Qe=e.computed(()=>f.value.pagination.enabled),ye=e.computed(()=>f.value.pagination.rows),ue=e.computed(()=>f.value.pagination.rowsPerPageOptions),Ce=e.computed(()=>f.value.scrollable),Nt=e.computed(()=>f.value.emptyMessage),Yt=e.computed(()=>f.value.toolbar?.downloads?.pdf!==!1),it=e.computed(()=>f.value.toolbar?.downloads?.excel!==!1),xn=e.computed(()=>f.value.toolbar?.search!==!1),jt=e.computed(()=>Yt.value||it.value||xn.value||kn.value),kn=e.computed(()=>f.value.toolbar?.columnVisibility!==!1),tt=e.ref(""),Fe=e.ref(!1),ct=e.ref(null);let dt=null;function Xe(){Fe.value?(dt&&(clearTimeout(dt),dt=null),Fe.value=!1,tt.value="",E("search",""),ct.value?.blur()):(Fe.value=!0,dt=setTimeout(()=>{dt=null,ct.value?.focus()},80))}function En(){tt.value||(Fe.value=!1)}function ze(){tt.value="",E("search",""),ct.value?.focus()}const $t=e.computed(()=>({"dss-table-striped":_e.value,"dss-table-bordered":Ge.value,"dss-table-hoverable":_t.value,[`dss-table-${kt.value}`]:kt.value!=="default"})),Kt=(k,p)=>k?.field??k?.key??p,Bt=e.ref(new Set);function fo(){const k=new Set;Ie.columns.forEach((p,V)=>{p?.hidden!==!0&&k.add(Kt(p,V))}),Bt.value=k}const nn=e.computed(()=>Ie.columns.filter((k,p)=>Bt.value.has(Kt(k,p)))),Ne=k=>{const p=Ie.columns.findIndex(V=>V===k);return Kt(k,p>=0?p:0)},pn=(k,p)=>Bt.value.has(Kt(k,p));function Ye(k,p){const V=Kt(k,p),$=new Set(Bt.value);$.has(V)?$.delete(V):$.add(V),Bt.value=$}const At=e.ref(null),nt=e.ref(!1);function on(k){At.value&&!At.value.contains(k.target)&&(nt.value=!1)}const ae=e.computed(()=>nn.value.length+(Ht.value?1:0)+(L.value?1:0)),me=(k,p)=>k?.id??k?.key??p,ot=e.ref(new Set),Gt=(k,p)=>ot.value.has(me(k,p)),Ct=(k,p,V)=>{V&&V.stopPropagation();const $=me(k,p),U=new Set(ot.value);U.has($)?(U.delete($),E("row-collapse",{data:k,index:p})):(U.add($),E("row-expand",{data:k,index:p})),ot.value=U},ft=e.ref(null),Pe=e.ref(0),je=e.ref([]),Te=k=>{if(tn.value==="single")return ft.value===k.field?Pe.value:0;{const p=je.value.find(V=>V.field===k.field);return p?p.order:0}},Se=k=>{const p=Te(k);return{"dss-sort-active":p!==0,"dss-sort-asc":p===1,"dss-sort-desc":p===-1}},bt=e.ref({}),Ae=e.ref(null),We=e.ref(null),Dt=220,De=e.computed(()=>nn.value.find(k=>Ne(k)===Ae.value)??null),ut=e.computed(()=>{if(!De.value||De.value.filter!=="range")return null;const k=De.value,p=Ae.value,{min:V,max:$}=An(k),U=k.filterMin??V,fe=k.filterMax??$,Be=gt(p),Ot=Be.min??U,Tn=Be.max??fe,It=fe-U,Rn=It===0?0:(Ot-U)/It*100,zo=It===0?100:(Tn-U)/It*100;return{rangeMin:U,rangeMax:fe,currentMin:Ot,currentMax:Tn,minPct:Rn,maxPct:zo}}),lt=e.ref(null),vn=e.ref("max");function mt(k){const p=lt.value,V=ut.value;if(!p||!V)return;const $=p.getBoundingClientRect(),fe=(k.clientX-$.left)/$.width*100,Be=(V.minPct+V.maxPct)/2;vn.value=fe<Be?"min":"max"}function gt(k){return bt.value[k]??{}}function Qt(k,p){bt.value={...bt.value,[k]:p}}function Mn(k){const p=bt.value[k];return p?p.type==="string"?!!p.value?.trim():p.type==="range"?p.min!=null||p.max!=null:p.type==="dateRange"?!!(p.from||p.to):p.type==="list"?p.selected?.length>0:!1:!1}function Jt(k){const p={...bt.value};delete p[k],bt.value=p,Ae.value=null,We.value=null}const Ln=e.computed(()=>{let k=[...Ie.data];return nn.value.forEach(p=>{const V=Ne(p),$=bt.value[V];if(!$)return;const U=p.field;if(U){if($.type==="string"&&$.value?.trim()){const fe=$.value.trim().toLowerCase();k=k.filter(Be=>{const Ot=gn(Be,p);return String(Ot??"").toLowerCase().includes(fe)})}else if($.type==="range")k=k.filter(fe=>{const Be=G(fe,U),Ot=Number(Be);return!(Number.isNaN(Ot)||$.min!=null&&Ot<$.min||$.max!=null&&Ot>$.max)});else if($.type==="dateRange"){const fe=$.from?new Date($.from).getTime():null,Be=$.to?new Date($.to).getTime():null;k=k.filter(Ot=>{const Tn=G(Ot,U),It=Tn?new Date(Tn).getTime():NaN;return!(Number.isNaN(It)||fe!=null&&It<fe||Be!=null&&It>Be)})}else if($.type==="list"&&$.selected?.length){const fe=new Set($.selected);k=k.filter(Be=>{const Ot=gn(Be,p);return fe.has(Ot!=null?String(Ot):"")})}}}),k});function ln(k){const p=new Set;return Ie.data.forEach(V=>{const $=gn(V,k);p.add($!=null?String($):"")}),Array.from(p).sort((V,$)=>String(V).localeCompare(String($)))}function Rt(k,p){if(Ae.value===k){Ae.value=null,We.value=null;return}if(p?.currentTarget){const V=p.currentTarget.getBoundingClientRect();We.value={top:V.bottom+6,left:Math.max(8,V.right-Dt)}}Ae.value=k}function _n(k,p){Qt(k,{type:"string",value:p})}function An(k){const p=k.field;if(!p)return{min:0,max:100};let V=1/0,$=-1/0;return Ie.data.forEach(U=>{const fe=G(U,p),Be=Number(fe);Number.isNaN(Be)||(V=Math.min(V,Be),$=Math.max($,Be))}),{min:V===1/0?0:V,max:$===-1/0?100:$}}function Dn(k,p,V){const $={...gt(k),type:"range"},U=V===""?null:Number(V),fe=U===null||Number.isNaN(U)?null:U;$[p]=fe,fe!=null&&(p==="min"&&$.max!=null&&fe>$.max&&($.max=fe),p==="max"&&$.min!=null&&fe<$.min&&($.min=fe)),Qt(k,$)}function M(k,p,V){const $={...gt(k),type:"dateRange"};$[p]=V||"",Qt(k,$)}const D=e.reactive({});function T(k,p){D[k]=p}function W(k){const p=Ne(k),V=(D[p]??"").trim().toLowerCase(),$=ln(k);return V?$.filter(U=>String(U).toLowerCase().includes(V)):$}function te(k,p){return(gt(k).selected??[]).includes(p!=null?String(p):"")}function be(k,p){const $=[...gt(k).selected??[]],U=p!=null?String(p):"",fe=$.indexOf(U);fe>=0?$.splice(fe,1):$.push(U),Qt(k,{type:"list",selected:$})}function ie(k){Ae.value&&!k.target.closest(".dss-table-filter-wrap")&&!k.target.closest(".dss-table-filter-dropdown")&&(Ae.value=null,We.value=null)}const ce=k=>{if(!(k.sortable===!1||!pe.value))if(tn.value==="single")ft.value===k.field?Pe.value=Pe.value===1?-1:Pe.value===-1?0:1:(ft.value=k.field,Pe.value=1),Pe.value===0&&(ft.value=null),E("sort",{field:ft.value,order:Pe.value});else{const p=je.value.findIndex(V=>V.field===k.field);p>=0?je.value[p].order===1?je.value[p].order=-1:je.value.splice(p,1):je.value.push({field:k.field,order:1}),E("sort",{multiSortMeta:je.value})}},we=e.computed(()=>{if(!pe.value)return Ln.value;let k=[...Ln.value];return tn.value==="single"&&ft.value&&Pe.value!==0?k.sort((p,V)=>{const $=G(p,ft.value),U=G(V,ft.value);return $===U?0:$==null?1:U==null?-1:($<U?-1:$>U?1:0)*Pe.value}):tn.value==="multiple"&&je.value.length>0&&k.sort((p,V)=>{for(const $ of je.value){const U=G(p,$.field),fe=G(V,$.field);if(U===fe)continue;if(U==null)return 1;if(fe==null)return-1;const Be=U<fe?-1:U>fe?1:0;if(Be!==0)return Be*$.order}return 0}),k}),Me=e.ref(0),Tt=e.ref(ye.value),Pt=e.ref(!1),an=e.ref(null),so=k=>{Tt.value=k,Pt.value=!1,Me.value=0,E("page",{page:0,rows:Tt.value})};function go(k){an.value&&!an.value.contains(k.target)&&(Pt.value=!1)}const ho=e.computed(()=>we.value.length),Bn=e.computed(()=>Math.ceil(ho.value/Tt.value)),en=e.computed(()=>Qe.value?Me.value*Tt.value:0),To=e.computed(()=>Qe.value?Math.min((Me.value+1)*Tt.value,ho.value):ho.value),Vo=e.computed(()=>{if(!Qe.value)return we.value;const k=en.value,p=To.value;return we.value.slice(k,p)}),Vn=e.ref(new Set),Io=e.computed(()=>we.value.filter((k,p)=>Vn.value.has(me(k,p)))),fn=e.computed(()=>{const k=we.value.length;return k>0&&Vn.value.size===k}),yo=e.computed(()=>{const k=we.value.length,p=Vn.value.size;return p>0&&p<k}),ro=(k,p)=>Vn.value.has(me(k,p)),ko=()=>{if(fn.value)Vn.value=new Set,E("unselect-all");else{const k=new Set;we.value.forEach((p,V)=>k.add(me(p,V))),Vn.value=k,E("select-all",Io.value)}},Fo=(k,p)=>{const V=me(k,p),$=new Set(Vn.value),U=$.has(V);Xt.value==="single"?U?($.delete(V),E("row-unselect",k)):($.clear(),$.add(V),E("row-select",k)):U?($.delete(V),E("row-unselect",k)):($.add(V),E("row-select",k)),Vn.value=$},Ue=e.computed(()=>{const k=Bn.value,p=Me.value+1,V=2,$=[],U=[];let fe;for(let Be=1;Be<=k;Be++)(Be===1||Be===k||Be>=p-V&&Be<=p+V)&&$.push(Be);for(const Be of $)fe&&(Be-fe===2?U.push(fe+1):Be-fe!==1&&U.push("...")),U.push(Be),fe=Be;return U}),K=k=>{k<0||k>=Bn.value||(Me.value=k,E("page",{page:k,rows:Tt.value}))},No=(k,p,V)=>{E("row-click",{data:k,index:p,originalEvent:V})},xe=(k,p)=>({"dss-table-row-selected":ro(k,en.value+p),"dss-table-row-even":p%2===0,"dss-table-row-odd":p%2!==0}),gn=(k,p)=>p.field?G(k,p.field):"",G=(k,p)=>p.split(".").reduce((V,$)=>V&&V[$],k),ve=k=>{const p=k.align??P.value;return{"dss-table-sortable":k.sortable!==!1&&pe.value,"dss-table-align-left":p==="left","dss-table-align-center":p==="center","dss-table-align-right":p==="right",[k.className]:k.className}},z=k=>{const p={};return k.width&&(p.width=typeof k.width=="number"?`${k.width}px`:k.width),k.minWidth&&(p.minWidth=typeof k.minWidth=="number"?`${k.minWidth}px`:k.minWidth),k.maxWidth&&(p.maxWidth=typeof k.maxWidth=="number"?`${k.maxWidth}px`:k.maxWidth),p};return e.watch(()=>Ie.locale,k=>{k&&k!==R.value&&(R.value=k)},{immediate:!0}),e.watch(ye,k=>{Tt.value=k,Me.value=0}),e.watch(tt,k=>{E("search",k??"")}),e.watch(()=>Ie.columns,()=>{fo()},{immediate:!0,deep:!0}),e.onMounted(()=>{document.addEventListener("click",go),document.addEventListener("click",on),document.addEventListener("click",ie)}),e.onUnmounted(()=>{document.removeEventListener("click",go),document.removeEventListener("click",on),document.removeEventListener("click",ie)}),(k,p)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{class:"dss-table-container",style:e.normalizeStyle({width:ke.value+"px",height:He.value?He.value+"px":"auto"})},[jt.value?(e.openBlock(),e.createElementBlock("div",Ir,[e.createElementVNode("div",Fr,[Yt.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-table-toolbar-btn",onClick:p[0]||(p[0]=V=>E("download-pdf"))},[p[21]||(p[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(O)("table.downloadPdf")),1)])):e.createCommentVNode("",!0),it.value?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-table-toolbar-btn",onClick:p[1]||(p[1]=V=>E("download-excel"))},[p[22]||(p[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(O)("table.downloadExcel")),1)])):e.createCommentVNode("",!0),kn.value?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-table-toolbar-column-visibility",ref_key:"columnVisibilityDropdownRef",ref:At},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-pagination-select-trigger",{"dss-pagination-select-open":nt.value}]),onClick:p[2]||(p[2]=V=>nt.value=!nt.value),"aria-expanded":nt.value,"aria-haspopup":"listbox"},[e.createTextVNode(e.toDisplayString(e.unref(O)("table.columnVisibility"))+" ",1),p[23]||(p[23]=e.createElementVNode("span",{class:"dss-pagination-select-chevron","aria-hidden":"true"},"▼",-1))],10,zr),e.createVNode(e.Transition,{name:"dss-dropdown"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("ul",Pr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Z.columns,(V,$)=>(e.openBlock(),e.createElementBlock("li",{key:Kt(V,$),role:"option",class:"dss-table-column-visibility-option",onClick:p[3]||(p[3]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("label",Or,[e.createElementVNode("span",Zr,[e.createElementVNode("input",{type:"checkbox",checked:pn(V,$),onChange:U=>Ye(V,$),class:"dss-table-checkbox dss-table-checkbox--checkbox"},null,40,Wr),pn(V,$)?(e.openBlock(),e.createElementBlock("span",qr,[...p[24]||(p[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",Ur,e.toDisplayString(V.header),1)])]))),128))],512),[[e.vShow,nt.value]])]),_:1})],512)):e.createCommentVNode("",!0)]),e.createElementVNode("div",Xr,[xn.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["dss-table-toolbar-search",{"dss-table-toolbar-search--expanded":Fe.value||tt.value}])},[e.withDirectives(e.createElementVNode("input",{ref_key:"searchInputRef",ref:ct,"onUpdate:modelValue":p[4]||(p[4]=V=>tt.value=V),type:"text",class:"dss-table-toolbar-search-input",placeholder:e.unref(O)("table.searchPlaceholder"),"aria-label":"Search table",onFocus:p[5]||(p[5]=V=>Fe.value=!0),onBlur:En},null,40,Yr),[[e.vModelText,tt.value]]),tt.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-table-toolbar-search-clear","aria-label":"Clear search",onClick:ze},[...p[25]||(p[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":Fe.value||!!tt.value,onMousedown:e.withModifiers(Xe,["prevent"])},[...p[26]||(p[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,jr)],2)):e.createCommentVNode("",!0),k.$slots["toolbar-extra"]?(e.openBlock(),e.createElementBlock("div",Kr,[e.renderSlot(k.$slots,"toolbar-extra")])):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["dss-table-wrapper",{"dss-table-scrollable":Ce.value}])},[e.createElementVNode("table",{class:e.normalizeClass(["dss-table",$t.value])},[e.createElementVNode("thead",Gr,[e.createElementVNode("tr",null,[Ht.value?(e.openBlock(),e.createElementBlock("th",Qr,[Xt.value==="multiple"?(e.openBlock(),e.createElementBlock("span",Jr,[e.createElementVNode("input",{type:"checkbox",checked:fn.value,indeterminate:yo.value,onChange:ko,class:"dss-table-checkbox dss-table-checkbox--checkbox"},null,40,ei),yo.value?(e.openBlock(),e.createElementBlock("span",ti)):fn.value?(e.openBlock(),e.createElementBlock("span",ni,[...p[27]||(p[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),L.value?(e.openBlock(),e.createElementBlock("th",oi)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(nn.value,(V,$)=>(e.openBlock(),e.createElementBlock("th",{key:Ne(V),class:e.normalizeClass(["dss-table-th",ve(V)]),style:e.normalizeStyle(z(V)),onClick:U=>ce(V)},[e.createElementVNode("div",ai,[e.createElementVNode("span",si,e.toDisplayString(V.header),1),V.sortable!==!1&&pe.value?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["dss-table-sort-icon",Se(V)])},[Te(V)===0?(e.openBlock(),e.createElementBlock("span",ri,[...p[28]||(p[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)])])):Te(V)===1?(e.openBlock(),e.createElementBlock("span",ii,[...p[29]||(p[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)])])):Te(V)===-1?(e.openBlock(),e.createElementBlock("span",ci,[...p[30]||(p[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),V.filter?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["dss-table-filter-wrap",{"dss-table-filter-wrap--open":Ae.value===Ne(V)}]),onClick:p[6]||(p[6]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-table-filter-trigger",{"dss-table-filter-trigger--active":Mn(Ne(V))}]),"aria-expanded":Ae.value===Ne(V),"aria-label":"Filter column",onClick:U=>Rt(Ne(V),U)},[...p[31]||(p[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,di)],2)):e.createCommentVNode("",!0)])],14,li))),128))])]),e.createElementVNode("tbody",ui,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Vo.value,(V,$)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:me(V,en.value+$)},[e.createElementVNode("tr",{class:e.normalizeClass(["dss-table-tr",xe(V,$)]),style:e.normalizeStyle(Le.value),onClick:U=>No(V,$,U)},[Ht.value?(e.openBlock(),e.createElementBlock("td",{key:0,class:"dss-table-td dss-table-selection-cell",onClick:p[7]||(p[7]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("span",pi,[e.createElementVNode("input",{type:Xt.value==="multiple"?"checkbox":"radio",name:`dss-table-select-${Z.tableId}`,checked:ro(V,en.value+$),onChange:U=>Fo(V,en.value+$),class:e.normalizeClass(["dss-table-checkbox",Xt.value==="multiple"?"dss-table-checkbox--checkbox":"dss-table-checkbox--radio"])},null,42,vi),Xt.value==="multiple"&&ro(V,en.value+$)?(e.openBlock(),e.createElementBlock("span",fi,[...p[32]||(p[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)])])):Xt.value==="single"&&ro(V,en.value+$)?(e.openBlock(),e.createElementBlock("span",gi)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),L.value?(e.openBlock(),e.createElementBlock("td",{key:1,class:"dss-table-td dss-table-expansion-cell",onClick:e.withModifiers(U=>Ct(V,en.value+$,U),["stop"])},[e.createElementVNode("button",{type:"button",class:"dss-table-expansion-trigger","aria-expanded":Gt(V,en.value+$),"aria-label":Gt(V,en.value+$)?"Collapse row":"Expand row"},[e.createElementVNode("span",{class:e.normalizeClass(["dss-table-expansion-icon",{"dss-table-expansion-icon--expanded":Gt(V,en.value+$)}]),"aria-hidden":"true"},[...p[33]||(p[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,yi)],8,hi)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(nn.value,(U,fe)=>(e.openBlock(),e.createElementBlock("td",{key:Ne(U),class:e.normalizeClass(["dss-table-td",ve(U)]),style:e.normalizeStyle(z(U))},[e.renderSlot(k.$slots,`cell-${U.field}`,{data:V,column:U,rowIndex:$},()=>[e.createTextVNode(e.toDisplayString(gn(V,U)),1)])],6))),128))],14,mi),L.value&&Gt(V,en.value+$)?(e.openBlock(),e.createElementBlock("tr",ki,[e.createElementVNode("td",{colspan:ae.value,class:"dss-table-expansion-content-cell"},[e.renderSlot(k.$slots,"expansion",{data:V,rowIndex:$})],8,Ci)])):e.createCommentVNode("",!0)],64))),128)),Vo.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("tr",{key:0,class:"dss-table-empty",style:e.normalizeStyle(Le.value)},[e.createElementVNode("td",{colspan:ae.value,class:"dss-table-empty-cell"},[e.renderSlot(k.$slots,"empty",{},()=>[e.createTextVNode(e.toDisplayString(Nt.value),1)])],8,bi)],4))])],2)],2),Qe.value?(e.openBlock(),e.createElementBlock("div",wi,[e.createElementVNode("div",xi,[e.createElementVNode("div",Ei,[e.createElementVNode("button",{class:"dss-pagination-btn",disabled:Me.value===0,onClick:p[8]||(p[8]=V=>K(0)),title:e.unref(O)("table.firstPage")},[...p[34]||(p[34]=[e.createElementVNode("span",{class:"dss-pagination-double-arrow"},[e.createElementVNode("span",null,"‹"),e.createElementVNode("span",null,"‹")],-1)])],8,Vi),e.createElementVNode("button",{class:"dss-pagination-btn",disabled:Me.value===0,onClick:p[9]||(p[9]=V=>K(Me.value-1)),title:e.unref(O)("table.previousPage")}," ‹ ",8,Ni),e.createElementVNode("span",Si,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ue.value,V=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:V},[V!=="..."?(e.openBlock(),e.createElementBlock("button",{key:0,class:e.normalizeClass(["dss-pagination-page",{"dss-active":V===Me.value+1}]),onClick:$=>K(V-1)},e.toDisplayString(V),11,Mi)):(e.openBlock(),e.createElementBlock("span",Bi,"..."))],64))),128))]),e.createElementVNode("button",{class:"dss-pagination-btn",disabled:Me.value>=Bn.value-1,onClick:p[10]||(p[10]=V=>K(Me.value+1)),title:e.unref(O)("table.nextPage")}," › ",8,Ti),e.createElementVNode("button",{class:"dss-pagination-btn",disabled:Me.value>=Bn.value-1,onClick:p[11]||(p[11]=V=>K(Bn.value-1)),title:e.unref(O)("table.lastPage")},[...p[35]||(p[35]=[e.createElementVNode("span",{class:"dss-pagination-double-arrow"},[e.createElementVNode("span",null,"›"),e.createElementVNode("span",null,"›")],-1)])],8,Hi)]),e.createElementVNode("div",{class:"dss-pagination-rows-per-page",ref_key:"rowsPerPageDropdownRef",ref:an},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-pagination-select-trigger",{"dss-pagination-select-open":Pt.value}]),onClick:p[12]||(p[12]=V=>Pt.value=!Pt.value),"aria-expanded":Pt.value,"aria-haspopup":"listbox"},[e.createTextVNode(e.toDisplayString(Tt.value)+" ",1),p[36]||(p[36]=e.createElementVNode("span",{class:"dss-pagination-select-chevron","aria-hidden":"true"},"▼",-1))],10,$i),e.createVNode(e.Transition,{name:"dss-dropdown"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("ul",Li,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ue.value,V=>(e.openBlock(),e.createElementBlock("li",{key:V,role:"option","aria-selected":V===Tt.value,class:e.normalizeClass(["dss-pagination-select-option",{"dss-pagination-select-option--selected":V===Tt.value}]),onClick:$=>so(V)},e.toDisplayString(V),11,_i))),128))],512),[[e.vShow,Pt.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(We.value?{top:We.value.top+"px",left:We.value.left+"px",width:Dt+"px"}:void 0),onClick:p[20]||(p[20]=e.withModifiers(()=>{},["stop"]))},[De.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[De.value.filter==="string"?(e.openBlock(),e.createElementBlock("div",Ai,[e.createElementVNode("input",{type:"text",value:gt(Ae.value).value??"",onInput:p[13]||(p[13]=V=>_n(Ae.value,V.target.value)),class:"dss-table-filter-input",placeholder:e.unref(O)("table.search")||"Search..."},null,40,Di)])):De.value.filter==="range"&&ut.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-table-filter-double-range",style:e.normalizeStyle({"--range-min-pct":ut.value.minPct+"%","--range-max-pct":ut.value.maxPct+"%"})},[e.createElementVNode("div",{ref_key:"doubleRangeTrackRef",ref:lt,class:"dss-table-filter-double-range-track",onMousemove:mt,onMouseenter:mt},[e.createElementVNode("input",{type:"range",min:ut.value.rangeMin,max:ut.value.rangeMax,value:ut.value.currentMin,onInput:p[14]||(p[14]=V=>Dn(Ae.value,"min",V.target.value)),class:"dss-table-filter-double-range-input dss-table-filter-double-range-input--min",style:e.normalizeStyle({zIndex:vn.value==="min"?2:1})},null,44,Ri),e.createElementVNode("input",{type:"range",min:ut.value.rangeMin,max:ut.value.rangeMax,value:ut.value.currentMax,onInput:p[15]||(p[15]=V=>Dn(Ae.value,"max",V.target.value)),class:"dss-table-filter-double-range-input dss-table-filter-double-range-input--max",style:e.normalizeStyle({zIndex:vn.value==="max"?2:1})},null,44,Ii)],544),e.createElementVNode("div",Fi,e.toDisplayString(ut.value.currentMin)+" – "+e.toDisplayString(ut.value.currentMax),1)],4)):De.value.filter==="dateRange"?(e.openBlock(),e.createElementBlock("div",zi,[e.createElementVNode("div",Pi,[e.createElementVNode("label",Oi,e.toDisplayString(e.unref(O)("table.filterFrom")||"From:"),1),e.createElementVNode("input",{type:"date",value:gt(Ae.value).from??"",onInput:p[16]||(p[16]=V=>M(Ae.value,"from",V.target.value)),class:"dss-table-filter-input dss-table-filter-daterange-input"},null,40,Zi)]),e.createElementVNode("div",Wi,[e.createElementVNode("label",qi,e.toDisplayString(e.unref(O)("table.filterTo")||"To:"),1),e.createElementVNode("input",{type:"date",value:gt(Ae.value).to??"",onInput:p[17]||(p[17]=V=>M(Ae.value,"to",V.target.value)),class:"dss-table-filter-input dss-table-filter-daterange-input"},null,40,Ui)])])):De.value.filter==="list"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.createElementVNode("input",{type:"text",value:D[Ae.value]??"",onInput:p[18]||(p[18]=V=>T(Ae.value,V.target.value)),class:"dss-table-filter-input dss-table-filter-list-search",placeholder:e.unref(O)("table.search")||"Search..."},null,40,Xi),e.createElementVNode("div",Yi,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(W(De.value),V=>(e.openBlock(),e.createElementBlock("label",{key:V,class:"dss-table-filter-list-item"},[e.createElementVNode("input",{type:"checkbox",checked:te(Ae.value,V),onChange:$=>be(Ae.value,V)},null,40,ji),e.createElementVNode("span",null,e.toDisplayString(V),1)]))),128))])],64)):e.createCommentVNode("",!0),e.createElementVNode("div",Ki,[e.createElementVNode("button",{type:"button",class:"dss-table-filter-clear",onClick:p[19]||(p[19]=V=>Jt(Ae.value))},e.toDisplayString(e.unref(O)("table.clearFilter")||"Clear"),1)])],64)):e.createCommentVNode("",!0)],4),[[e.vShow,Ae.value&&De.value&&We.value]])]),_:1})]))],64))}}),Ji={class:"dss-toolbar-left"},ec=["title"],tc=["title"],nc={class:"dss-toolbar-dropdown-wrapper"},oc=["title"],lc={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"},ac={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"},sc={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"},rc={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"},ic={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"},cc={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"},dc={key:6,width:"13",height:"14",viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"paragraph-icon"},uc=["title"],mc=["title"],pc=["title"],vc=["title"],fc=["title"],gc=["title"],hc=["title"],yc=["title"],kc=["title"],Cc={key:2,class:"dss-toolbar-separator"},bc=["title"],wc={key:4,class:"dss-toolbar-separator"},xc={key:5,class:"dss-toolbar-dropdown-wrapper"},Ec=["title"],Vc={class:"dss-toolbar-dropdown-ai"},Nc={class:"dss-toolbar-right"},Sc={key:0,class:"dss-toolbar-custom-group"},Mc={key:1,class:"dss-toolbar-separator"},Bc={class:"dss-link-modal-content"},Tc={class:"dss-link-modal-field"},Hc={class:"dss-link-modal-label"},$c=["placeholder"],Lc={class:"dss-link-modal-field"},_c={class:"dss-link-modal-label"},Ac=["placeholder"],Dc={class:"dss-image-modal-tabs"},Rc={key:0,class:"dss-image-tab-content"},Ic={class:"dss-link-modal-content"},Fc={class:"dss-link-modal-field"},zc={key:0,class:"dss-link-modal-label"},Pc=["src"],Oc={class:"dss-link-modal-field"},Zc={class:"dss-link-modal-label"},Wc=["placeholder"],qc={class:"dss-link-modal-field"},Uc={class:"dss-link-modal-label"},Xc=["placeholder"],Yc={class:"dss-link-modal-field"},jc={class:"dss-link-modal-label"},Kc=["placeholder"],Gc={key:1,class:"dss-image-tab-content"},Qc={class:"dss-link-modal-content"},Jc={class:"dss-link-modal-field"},ed={class:"dss-link-modal-label"},td=["placeholder"],nd={class:"dss-link-modal-field"},od={class:"dss-link-modal-label"},ld=["placeholder"],ad={class:"dss-link-modal-field"},sd={class:"dss-link-modal-label"},rd=["placeholder"],id={class:"dss-link-modal-field"},cd={class:"dss-link-modal-label"},dd=["placeholder"],ud={class:"dss-text-editor-title-input-container"},md={key:0,class:"dss-text-editor-title-preview"},pd={key:0},vd={key:1,class:"dss-text-editor-preview-placeholder"},fd=["value","placeholder","disabled"],gd={key:2,class:"dss-text-editor-title-slot dss-text-editor-slot-last"},hd={class:"dss-text-editor-description-input-container"},yd={key:0,class:"dss-text-editor-description-preview"},kd={key:0},Cd={key:1,class:"dss-text-editor-preview-placeholder"},bd=["value","placeholder","disabled"],wd={key:3,class:"dss-text-editor-description-slot dss-text-editor-slot-last"},xd=["data-comment-id","onMouseenter"],Ed=["onClick"],Vd=["src","alt"],Nd={key:1},Sd=["onClick"],Md=["src","alt"],Bd={key:1},Td=["data-has-second-user","onClick"],Hd={class:"editor-comment-marker-count"},$d={key:4,class:"dss-text-editor-textarea-wrapper"},Ld=["value","placeholder","rows","disabled"],_d={class:"dss-text-editor-footer"},Ad={class:"dss-text-editor-footer-content"},Dd={class:"dss-text-editor-footer-stat"},Rd={class:"dss-text-editor-footer-stat"},Id={key:5,class:"dss-text-editor-content-wrapper"},Fd={key:0,class:"dss-comment-overlay-body"},zd={class:"dss-comment-selection-wrapper"},Pd=["innerHTML"],Od={class:"dss-comment-messages-wrapper"},Zd={key:0,class:"dss-comment-avatar-wrapper"},Wd={class:"dss-comment-avatar"},qd=["src","alt"],Ud={key:1},Xd={class:"dss-comment-header"},Yd={class:"dss-comment-header-text"},jd={class:"dss-comment-author"},Kd={key:0,class:"dss-comment-date"},Gd=["onClick","title"],Qd={class:"dss-comment-overlay-inner"},Jd=["placeholder","onKeydown"],eu={class:"dss-text-editor-footer"},tu={class:"dss-text-editor-footer-content"},nu={class:"dss-text-editor-footer-stat"},ou={class:"dss-text-editor-footer-stat"},lu=["title"],au=["title"],su={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:""},ru={class:"dss-image-popup-content"},iu={key:0,class:"dss-image-popup-no-alt-icon"},cu=["title"],du=["title"],uu={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:""},mu={class:"dss-toolbar-left"},pu=["title"],vu=["title"],fu={class:"dss-toolbar-dropdown-wrapper"},gu=["title"],hu={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"},yu={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"},ku={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"},Cu={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"},bu={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"},wu={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"},xu={key:6,width:"13",height:"14",viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"paragraph-icon"},Eu=["title"],Vu=["title"],Nu=["title"],Su=["title"],Mu=["title"],Bu=["title"],Tu=["title"],Hu=["title"],$u=["title"],Lu=["title"],_u={key:2,class:"dss-toolbar-separator"},Au={key:3,class:"dss-toolbar-dropdown-wrapper"},Du=["title"],Ru={class:"dss-toolbar-dropdown-ai"},Iu={key:0,class:"dss-toolbar-right"},Fu={key:0,class:"dss-toolbar-separator"},zu={key:0,class:"dss-toolbar-custom-group"},Pu={key:1,class:"dss-toolbar-separator"},Ou={name:"DSSTextEditor"},Zu=Object.assign(Ou,{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:Z=>typeof Z=="object"&&Z!==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:Z=>typeof Z=="object"&&Z!==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(Z,{expose:Ut,emit:O}){const{t:R,locale:Ie}=al.useI18n(),E=Z,he=O,Ke=e.useSlots(),vt=`<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
73
+ `,t+="Category",A.series.forEach(h=>{const w=h.name.replace(/"/g,'""');t+=',"'+w+'"'}),t+=`
74
+ `;const s=Math.max(...A.series.map(h=>h.data?.length||0));for(let h=0;h<s;h++){let M='"'+(A.categories[h]||P("chart.fallback.item",{number:h+1})).toString().replace(/"/g,'""')+'"';A.series.forEach(L=>{const T=L.data&&L.data[h]!==void 0?L.data[h]:"";M+=","+T}),t+=M+`
75
+ `}const n=new Blob([t],{type:"text/csv;charset=utf-8;"}),c=URL.createObjectURL(n),f=document.createElement("a");f.href=c,f.download=Io("csv"),document.body.appendChild(f),f.click(),document.body.removeChild(f),URL.revokeObjectURL(c),on()}catch(t){console.error("Error downloading CSV:",t)}},Jn=t=>{if(typeof t.action=="function"){const s={series:A.series,categories:A.categories,markers:E.value},n={chartX:k.value.chartX,chartY:k.value.chartY,dataX:k.value.mouseDataX,dataY:k.value.mouseDataY,categoryIndex:clampedCategoryIndex||k.value.categoryIndex};t.action(s,n)}on()},fn=()=>{Gn(),x.value.show=!0,x.value.categoryIndex=k.value.categoryIndex,x.value.fromButton=!1,on()},Wo=()=>{Gn(),x.value.show=!0,x.value.categoryIndex=0,x.value.fromButton=!0},ko=t=>{if(k.value.show){const s=document.querySelector(".dss-context-menu");s&&!s.contains(t.target)&&(k.value.show=!1)}},qo=t=>{k.value.show&&!t.target.closest(".context-menu")&&(k.value.show=!1)},Uo=t=>{if(!Lt.value||!Vt.value)return;t.preventDefault(),t.stopPropagation(),m.value.isZooming=!0,ce.value.show=!1,m.value.zoomTimeout&&clearTimeout(m.value.zoomTimeout);const n=t.currentTarget.getBoundingClientRect(),c=t.clientX-n.left,f=t.clientY-n.top;if(c<H.value.left-50||c>H.value.right+50||f<H.value.top-50||f>H.value.bottom+100){m.value.isZooming=!1;return}const h=t.deltaY>0?.9:1.1,w=Math.max(m.value.minScale,Math.min(m.value.maxScale,m.value.scale*h));if(w!==m.value.scale){const{minX:C,maxX:M}=it.value,L=M-C||1,T=L/m.value.scale,B=C-m.value.offsetX/H.value.width*L,q=(c-H.value.left)/H.value.width,j=B+q*T;m.value.scale=w;const le=L/m.value.scale,Z=j-q*le;m.value.offsetX=-(Z-C)/L*H.value.width,m.value.scale<=1.01&&(m.value.scale=1,m.value.offsetX=0)}m.value.zoomTimeout=setTimeout(()=>{m.value.isZooming=!1,m.value.zoomTimeout=null},300)},yl=t=>{if(!Lt.value||!Vt.value||m.value.scale<=1)return;ce.value.show=!1;const n=t.currentTarget.getBoundingClientRect();t.clientX-n.left,t.clientY-n.top,m.value.isDragging=!0,m.value.lastMouseX=t.clientX,m.value.lastMouseY=t.clientY,t.preventDefault()},Bl=()=>{m.value.isDragging=!1},Xo=()=>{!Lt.value||!Vt.value||(m.value.scale=1,m.value.offsetX=0,m.value.isDragging=!1,m.value.zoomTimeout&&(clearTimeout(m.value.zoomTimeout),m.value.zoomTimeout=null),m.value.isZooming=!1)},kl=()=>!Lt.value||!Kn.value||!Vt.value?"default":m.value.isDragging?"grabbing":m.value.scale>1?"grab":"dss-crosshair",Yo=t=>{if(t.length<2)return"";if(t.length===2)return`M ${t[0].x} ${t[0].y} L ${t[1].x} ${t[1].y}`;let s=`M ${t[0].x} ${t[0].y}`;for(let n=0;n<t.length-1;n++){const c=t[Math.max(n-1,0)],f=t[n],h=t[n+1],w=t[Math.min(n+2,t.length-1)],C=f.x+(h.x-c.x)/6*$t.value,M=f.y+(h.y-c.y)/6*$t.value,L=h.x-(w.x-f.x)/6*$t.value,T=h.y-(w.y-f.y)/6*$t.value;s+=` C ${C} ${M} ${L} ${T} ${h.x} ${h.y}`}return s},Zn=e.computed(()=>{const s=F.value?.chart?.padding,n=typeof s=="number"?s:null,c=s&&typeof s=="object"?s:null,f=50;let h=f+(tn.value?30:0)+60;if(Wn.value){const B={left:f+40,top:f+40,right:f+40,bottom:f+40};return n!=null?{left:n,top:n,right:n,bottom:n}:c?{left:c.left??B.left,top:c.top??B.top,right:c.right??B.right,bottom:c.bottom??B.bottom}:B}if(rn.value){const B=!pt.value,q=Ht.value,j=q?jn.value+go.value+24:0,le=B?12:f;let Z=0;Ue.value&&(Z+=B?8:15),$e.value&&(Z+=B?6:10);const ee=At();let K=le+(B?4:16)+(q?j:0),U=le+(q?j:0);pt.value&&ke.value==="left"?K+=ee.legendWidth||150:pt.value&&ke.value==="right"&&(U+=ee.legendWidth||150);const te=Q.value==="semi-radial"?q?j:8:q?j:B?8:f+80,G={left:K,top:le+Z,right:U,bottom:te};return n!=null?{left:n,top:n,right:n,bottom:n}:c?{left:c.left??G.left,top:c.top??G.top,right:c.right??G.right,bottom:c.bottom??G.bottom}:G}let w=0;Ue.value&&(w+=15),$e.value&&(w+=10);const C=At();let M=f+16,L=f;pt.value&&ke.value==="left"?M+=C.legendWidth||150:pt.value&&ke.value==="right"&&(L+=C.legendWidth||150),pt.value&&ke.value==="bottom"&&(h+=C.legendHeight||0);const T={left:M,top:f+w,right:L,bottom:h};return n!=null?{left:n,top:n,right:n,bottom:n}:c?{left:c.left??T.left,top:c.top??T.top,right:c.right??T.right,bottom:c.bottom??T.bottom}:T}),H=e.computed(()=>({left:Zn.value.left,top:Zn.value.top,right:pe.value-Zn.value.right,bottom:lt.value-Zn.value.bottom,width:pe.value-(Zn.value.left+Zn.value.right),height:lt.value-(Zn.value.top+Zn.value.bottom)})),Lt=e.computed(()=>["line","area","bar"].includes(Q.value)||Rn.value),Cn=e.computed(()=>Rn.value),rn=e.computed(()=>["radial","semi-radial"].includes(Q.value)),Wn=e.computed(()=>Q.value==="spider"),dt=e.computed(()=>Q.value==="bubble"),Nt=e.computed(()=>F.value?.chart?.orientation==="horizontal"&&(Q.value==="bar"||Cn.value)),qn=t=>{const{minY:s,maxY:n}=it.value,c=n-s||1;return H.value.left+(t-s)/c*H.value.width},co=t=>{const{maxX:s}=it.value,n=s+1,f=H.value.height/n;return H.value.top+(t+.5)*f},We=e.computed(()=>pe.value/2),qe=e.computed(()=>Wn.value?lt.value/2-40:lt.value/2),Ne=e.computed(()=>{if(Wn.value){const t=H.value.width-80,s=H.value.height-80;return Math.min(t,s)/2}return Math.min(H.value.width,H.value.height)/2}),tt=e.computed(()=>{const t=F.value,s=t?.plotOptions?.radialBar?.innerRadiusRatio??t?.radialBar?.innerRadiusRatio,n=typeof s=="number"&&s>=0&&s<=1?s:.45;return Ne.value*n}),So=e.computed(()=>{const t=F.value,s=typeof A.innerSize=="number"?A.innerSize:t?.innerSize;return typeof s!="number"||s<=0||!(rn.value||Wn.value)?1:1+s/100}),No=e.computed(()=>{if(So.value<=1)return;const t=We.value,s=qe.value,n=So.value;return`translate(${t}, ${s}) scale(${n}) translate(${-t}, ${-s})`}),Mo=e.ref(0),jo=e.computed(()=>`semi-radial-fill-clip-${A.chartId}`),eo=e.computed(()=>Q.value==="semi-radial"),_n=e.computed(()=>eo.value&&Te.value&&!Dn.value),Vn=e.computed(()=>eo.value&&Te.value&&!Dn.value&&je.value==="fill"),uo=e.computed(()=>{const t=_n.value?Mo.value:1,s=We.value,n=qe.value,c=tt.value,f=Ne.value,h=Math.PI,w=Math.PI+t*Math.PI;if(t<=0)return`M ${s} ${n} L ${s} ${n} Z`;const C=s+f*Math.cos(h),M=n+f*Math.sin(h),L=s+f*Math.cos(w),T=n+f*Math.sin(w),B=s+c*Math.cos(w),q=n+c*Math.sin(w),j=s+c*Math.cos(h),le=n+c*Math.sin(h),Z=t>.5?1:0;return`M ${s} ${n} L ${C} ${M} A ${f} ${f} 0 ${Z} 1 ${L} ${T} L ${B} ${q} A ${c} ${c} 0 ${Z} 1 ${j} ${le} Z`}),Co=e.computed(()=>{if(!(!eo.value||!_n.value)&&!Vn.value)return`url(#${jo.value})`}),gt=t=>{if(!(!Vn.value||t!==0))return`url(#${jo.value})`},to=e.ref(0),Ko=e.computed(()=>`radial-reveal-clip-${A.chartId}`),Jt=e.computed(()=>Q.value==="radial"),mo=e.computed(()=>{const t=Jt.value?to.value:1,s=We.value,n=qe.value,c=Math.max(Ne.value*1.5,pe.value,lt.value);if(t<=0)return`M ${s} ${n} L ${s} ${n} Z`;if(t>=1){const B=s-c,q=s+c;return`M ${B} ${n} A ${c} ${c} 0 0 1 ${q} ${n} A ${c} ${c} 0 0 1 ${B} ${n} Z`}const f=-Math.PI/2,h=f+t*Math.PI*2,w=s+c*Math.cos(f),C=n+c*Math.sin(f),M=s+c*Math.cos(h),L=n+c*Math.sin(h),T=t>=.5?1:0;return`M ${s} ${n} L ${w} ${C} A ${c} ${c} 0 ${T} 1 ${M} ${L} Z`}),bo=e.computed(()=>{if(Co.value)return Co.value;if(Jt.value)return`url(#${Ko.value})`});let Sn=null;const wo=()=>{if(!_n.value)return;Mo.value=0;const t=Ve.value,s=performance.now(),n=c=>{const f=c-s,h=Math.min(1,f/t);Mo.value=Nl(st.value,h),h<1&&(Sn=requestAnimationFrame(n))};Sn=requestAnimationFrame(n)},Cl=e.computed(()=>F.value?.bubbles?.minSize||8),Tl=e.computed(()=>F.value?.bubbles?.maxSize||50),xo=e.computed(()=>F.value?.bubbles?.opacity||.7),Go=(t,s)=>{const n=[15,20,25,18,22],c=n[t%n.length]||20,f=1+Math.sin(s*.5)*.2;return Math.max(5,c*f)},Bo=t=>{const s=document.querySelector(`.dss-bubble-image-${t}`);s&&(s.style.opacity="1")},bl=t=>{const s=document.querySelector(`.dss-bubble-image-${t}`);s&&(s.style.display="none")},Un=e.computed(()=>A.series),po=e.computed(()=>A.series.filter((t,s)=>!ot.value.has(s))),Nn="auto",it=e.computed(()=>{if(dt.value)return Qo();if(!po.value.length)return{minX:0,maxX:1,minY:0,maxY:1};let t=1/0,s=-1/0,n=0;po.value.forEach(C=>{C.data&&C.data.length&&(n=Math.max(n,C.data.length-1),C.data.forEach(M=>{typeof M=="number"&&(t=Math.min(t,M),s=Math.max(s,M))}))}),A.categories.length>0&&(n=Math.max(n,A.categories.length-1)),t===1/0&&(t=0,s=100);const c=Ye.value,f=Ie.value;let h,w;if(c===Nn){const C=s-t,M=C>0?C*.1:1;h=Math.max(0,t-M)}else if(typeof c=="number")h=c;else{const C=s-t,M=C>0?C*.1:1;h=Math.max(0,t-M)}if(f===Nn){const C=s-t,M=C>0?C*.1:2;w=s+M}else if(typeof f=="number")w=f;else{const C=s-t,M=C>0?C*.1:2;w=s+M}return{minX:0,maxX:n,minY:h,maxY:w}}),Qo=()=>{if(!po.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,c=-1/0,f=1/0,h=-1/0,w=!1;if(po.value.forEach((j,le)=>{j?.data?.length&&j.data.forEach((Z,ee)=>{let K,U,me;if(typeof Z=="object"&&Z!==null&&!Array.isArray(Z))K=typeof Z.x=="number"?Z.x:ee,U=typeof Z.y=="number"?Z.y:0,me=typeof Z.size=="number"?Z.size:20;else if(Array.isArray(Z)&&Z.length>=3)K=typeof Z[0]=="number"?Z[0]:ee,U=typeof Z[1]=="number"?Z[1]:0,me=typeof Z[2]=="number"?Z[2]:20;else if(typeof Z=="number")K=ee,U=Z,me=Go(le,ee);else return;isFinite(K)&&isFinite(U)&&isFinite(me)&&(t=Math.min(t,K),s=Math.max(s,K),n=Math.min(n,U),c=Math.max(c,U),f=Math.min(f,me),h=Math.max(h,me),w=!0)})}),!w)return{minX:0,maxX:8,minY:0,maxY:50,minSize:10,maxSize:30};t===s&&(t=Math.min(t,0),s=Math.max(s,A.categories?.length-1||8)),n===c&&(n=Math.max(0,n-10),c=n+20);const C=s-t,M=c-n;let L,T,B,q;return at.value!==null?L=at.value:L=t-C*.1,Yt.value!==null?T=Yt.value:T=s+C*.1,Ye.value!==null&&typeof Ye.value=="number"?B=Ye.value:B=Math.max(0,n-M*.1),Ie.value!==null&&typeof Ie.value=="number"?q=Ie.value:q=c+M*.1,{minX:L,maxX:T,minY:B,maxY:q,minSize:f,maxSize:h}},ht=t=>{if(dt.value){const{minX:C,maxX:M}=it.value,L=M-C||1;return H.value.left+(t-C)/L*H.value.width}const{minX:s,maxX:n}=it.value,c=n-s;if(n===0||c===0)return H.value.left+H.value.width/2;const f=c/m.value.scale,h=s-m.value.offsetX/H.value.width*c,w=(t-h)/f;return H.value.left+w*H.value.width},_t=t=>{const{minY:s,maxY:n}=it.value,c=n-s||1;return H.value.bottom-(t-s)/c*H.value.height},Jo=t=>{if(!dt.value)return Fe.value||4;const{maxSize:s}=it.value,n=Math.max(1,s),c=Math.min(1,Math.max(0,t/n));return Cl.value+c*(Tl.value-Cl.value)},wl=e.computed(()=>tl.value.map(t=>({y:t.y}))),el=e.computed(()=>{if(dt.value)return xl();if(Q.value==="bar"){if(Nt.value){const te=[],{minY:G,maxY:se}=it.value,re=5,De=se-G||1;for(let Re=0;Re<=re;Re++){const dn=G+De*(Re/re),Et=qn(dn);te.push({x:Et,y:H.value.bottom+20,text:Wt(Math.round(dn))})}return te}const le=[],{maxX:Z}=it.value,ee=Z+1,K=5,me=(H.value.width-K*2)/ee;for(let te=0;te<=Z;te++){const G=H.value.left+K+(te+.5)*me;le.push({x:G,y:H.value.bottom+20,text:A.categories[te]||P("chart.fallback.item",{number:te+1})})}return le}const t=[],{minX:s,maxX:n}=it.value,c=n-s||1,f=c/m.value.scale,h=s-m.value.offsetX/H.value.width*c,w=h+f,C=Math.max(0,Math.floor(h-2)),M=Math.min(n,Math.ceil(w+2)),L=M-C,T=H.value.width,q=Math.floor(T/60);let j=1;L>q&&(j=Math.ceil(L/q));for(let le=C;le<=M;le+=j)if(le>=0&&le<=n){const Z=ht(le);Z>=H.value.left-100&&Z<=H.value.right+100&&t.push({x:Z,y:H.value.bottom+20,text:A.categories[le]||`Item ${le+1}`})}return t}),xl=()=>{const t=[],{minX:s,maxX:n}=it.value,c=n-s||1,f=Math.min(8,Math.max(4,Math.floor(H.value.width/80)));for(let h=0;h<=f;h++){const w=s+c*h/f,C=ht(w);if(C>=H.value.left-10&&C<=H.value.right+10){const M=Math.round(w),L=A.categories?.[M];t.push({x:C,y:H.value.bottom+20,text:L||(Number.isInteger(w)?w.toString():w.toFixed(1))})}}return t},tl=e.computed(()=>{if(Nt.value){const f=[],{maxX:h}=it.value;for(let w=0;w<=h;w++)f.push({x:H.value.left-10,y:co(w),text:A.categories[w]||`Item ${w+1}`});return f}const t=[],{minY:s,maxY:n}=it.value,c=5;for(let f=0;f<=c;f++){const h=s+(n-s)*(f/c),w=Math.round(h);t.push({x:H.value.left-10,y:_t(h),text:Wt(w)})}return t}),ut=t=>{const s=ft.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]},vo=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 h=Math.max(0,Math.floor(Number(n[1])*.65)),w=Math.max(0,Math.floor(Number(n[2])*.65)),C=Math.max(0,Math.floor(Number(n[3])*.65));return`rgb(${h}, ${w}, ${C})`}const c=s.match(/^rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)\s*\)$/i);if(c){const h=Math.max(0,Math.floor(Number(c[1])*.65)),w=Math.max(0,Math.floor(Number(c[2])*.65)),C=Math.max(0,Math.floor(Number(c[3])*.65));return`rgba(${h}, ${w}, ${C}, ${c[4]})`}const f=s.match(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/);if(f){let h=f[1];h.length===3&&(h=h[0]+h[0]+h[1]+h[1]+h[2]+h[2]);const w=Math.max(0,Math.min(255,Math.floor(parseInt(h.slice(0,2),16)*.65))),C=Math.max(0,Math.min(255,Math.floor(parseInt(h.slice(2,4),16)*.65))),M=Math.max(0,Math.min(255,Math.floor(parseInt(h.slice(4,6),16)*.65)));return`#${[w,C,M].map(L=>L.toString(16).padStart(2,"0")).join("")}`}return s},An=(t,s)=>{const c=F.value?.stroke?.color;return c==null?vo(s):typeof c=="string"?c:Array.isArray(c)&&c.length?c[t%c.length]??vo(s):vo(s)},To=t=>{let s=0;for(let n=1;n<t.length;n++){const c=t[n].x-t[n-1].x,f=t[n].y-t[n-1].y;s+=Math.sqrt(c*c+f*f)}return s},nl=e.computed(()=>Q.value==="line"||Cn.value?(Cn.value?A.series.filter(s=>(s.type||Q.value)==="line"):Un.value).map((s,n)=>{const c=A.series.findIndex(B=>B===s),f=[];let h=[];s.data.forEach((B,q)=>{B==null?h.length>0&&(f.push([...h]),h=[]):h.push({x:Nt.value?qn(B):ht(q),y:Nt.value?co(q):_t(B),index:q})}),h.length>0&&f.push(h);let w="";f.forEach(B=>{if(B.length>0){let q="";ze.value?q=Yo(B):q=`M ${B[0].x} ${B[0].y}`+B.slice(1).map(j=>` L ${j.x} ${j.y}`).join(""),w+=(w?" ":"")+q}});const C=f.reduce((B,q)=>B+To(q),0),M=ot.value.has(c),L=J.value===c,T=J.value!==null&&J.value!==c;return{path:w,color:ut(c),pathLength:C,seriesIndex:c,animationDelay:n*Ce.value,isHighlighted:L,isDimmed:T,isHidden:M}}):[]),El=e.computed(()=>{if(!(Q.value==="line"||Cn.value))return[];const t=Cn.value?A.series.filter(n=>(n.type||Q.value)==="line"):Un.value,s=[];return t.forEach((n,c)=>{const f=A.series.findIndex(h=>h===n);for(let h=0;h<n.data.length-1;h++){const w=n.data[h];if(w!=null){let C=-1,M=0;for(let L=h+1;L<n.data.length;L++){const T=n.data[L];if(T==null)M++;else{C=L;break}}if(M>0&&C!==-1){const L=n.data[C],T=Nt.value?qn(w):ht(h),B=Nt.value?co(h):_t(w),q=Nt.value?qn(L):ht(C),j=Nt.value?co(C):_t(L),le=ot.value.has(f),Z=J.value===f,ee=J.value!==null&&J.value!==f;s.push({path:`M ${T} ${B} L ${q} ${j}`,color:ut(f),seriesIndex:f,animationDelay:c*Ce.value,isHighlighted:Z,isDimmed:ee,isHidden:le,gapSize:M}),h=C-1}}}}),s}),$l=e.computed(()=>Q.value==="line"||Cn.value?!Te.value||Dn.value||Ae.value.hasAnimated?[]:(Cn.value?A.series.filter(s=>(s.type||Q.value)==="line"):Un.value).map((s,n)=>{const c=A.series.findIndex(M=>M===s);let f="",h=null;s.data.forEach((M,L)=>{if(M!=null){const T={x:Nt.value?qn(M):ht(L),y:Nt.value?co(L):_t(M)};h===null?f+=`M ${T.x} ${T.y}`:f+=` L ${T.x} ${T.y}`,h=T}else if(h!==null){const T=s.data.findIndex((B,q)=>q>L&&B!==null&&B!==void 0);if(T!==-1){const B={x:Nt.value?qn(s.data[T]):ht(T),y:Nt.value?co(T):_t(s.data[T])};f+=` L ${B.x} ${B.y}`,h=B}}});const w=s.data.map((M,L)=>M==null?null:{x:Nt.value?qn(M):ht(L),y:Nt.value?co(L):_t(M)}).filter(M=>M!==null),C=To(w);return{path:f,pathLength:C,color:ut(c),animationDelay:n*Ce.value,seriesIndex:c}}):[]),Hl=e.computed(()=>{if(Q.value!=="line")return[];const t=[];return Un.value.forEach((s,n)=>{const c=J.value===n,f=J.value!==null&&J.value!==n,h=ot.value.has(n);s.data.forEach((w,C)=>{w!=null&&t.push({x:ht(C),y:_t(w),color:ut(n),value:w,label:A.categories[C]||C.toString(),seriesName:s.name,categoryIndex:C,dataIndex:C,animationDelay:(n*s.data.length+C)*(Ce.value/8),isHighlighted:c,isDimmed:f,isHidden:h})})}),t}),Fo=e.computed(()=>{if(!Cn.value)return[];const t=[];return A.series.filter(n=>(n.type||Q.value)==="line").forEach((n,c)=>{const f=A.series.findIndex(M=>M===n),h=J.value===f,w=J.value!==null&&J.value!==f,C=ot.value.has(f);n.data.forEach((M,L)=>{M!=null&&t.push({x:ht(L),y:_t(M),color:ut(f),value:M,label:A.categories[L]||L.toString(),seriesName:n.name,categoryIndex:L,dataIndex:L,animationDelay:(c*n.data.length+L)*(Ce.value/8),isHighlighted:h,isDimmed:w,isHidden:C})})}),t}),cn=e.computed(()=>{if(!dt.value)return[];const t=[];return Un.value.forEach((s,n)=>{if(!s?.data?.length)return;const c=J.value,f=c!==null&&c===n,h=c!==null&&c!==n,w=ot.value.has(n);s.data.forEach((C,M)=>{let L,T,B,q,j;if(typeof C=="object"&&C!==null&&!Array.isArray(C))L=typeof C.x=="number"?C.x:M,T=typeof C.y=="number"?C.y:0,B=typeof C.size=="number"?C.size:20,q=C.label||A.categories?.[M]||`Point ${M+1}`,j=C.image||C.imageUrl;else if(Array.isArray(C)&&C.length>=3)L=typeof C[0]=="number"?C[0]:M,T=typeof C[1]=="number"?C[1]:0,B=typeof C[2]=="number"?C[2]:20,q=C[3]||A.categories?.[M]||`Point ${M+1}`,j=C[4];else if(typeof C=="number")L=M,T=C,B=Go(n,M),q=A.categories?.[M]||`Point ${M+1}`;else return;!isFinite(L)||!isFinite(T)||!isFinite(B)||t.push({x:ht(L),y:_t(T),radius:Jo(B),originalX:L,originalY:T,originalSize:B,color:ut(n),seriesName:s.name||`Series ${n+1}`,label:q,imageUrl:j,seriesIndex:n,dataIndex:M,categoryIndex:Math.round(L),isHighlighted:f,isDimmed:h,isHidden:w,opacity:xo.value})})}),t}),ol=e.computed(()=>Q.value!=="area"?[]:Un.value.map((t,s)=>{const n=[];let c=[];if(t.data.forEach((B,q)=>{B==null?c.length>0&&(n.push([...c]),c=[]):c.push({x:ht(q),y:_t(B),index:q})}),c.length>0&&n.push(c),n.length===0)return{linePath:"",areaPath:"",color:ut(s),isHidden:ot.value.has(s)};const f=H.value.bottom+1;let h="",w="";n.forEach((B,q)=>{if(B.length===0)return;let j=`M ${B[0].x} ${B[0].y}`;ze.value&&B.length>1?j=Yo(B):B.slice(1).forEach(Z=>{j+=` L ${Z.x} ${Z.y}`}),h+=(h?" ":"")+j;let le=`M ${B[0].x} ${f}`;if(le+=` L ${B[0].x} ${B[0].y}`,ze.value&&B.length>1){const Z=Yo(B),ee=Z.substring(Z.indexOf("C")||Z.indexOf("Q")||Z.indexOf("L"));ee?le+=" "+ee:B.slice(1).forEach(K=>{le+=` L ${K.x} ${K.y}`})}else B.slice(1).forEach(Z=>{le+=` L ${Z.x} ${Z.y}`});le+=` L ${B[B.length-1].x} ${f} Z`,w+=(w?" ":"")+le});const C=J.value===s,M=J.value!==null&&J.value!==s,L=ot.value.has(s),T=n.reduce((B,q)=>B+To(q),0);return{linePath:h,areaPath:w,color:ut(s),pathLength:T,isHighlighted:C,isDimmed:M,isHidden:L}})),no=e.computed(()=>{if(!(["bar"].includes(Q.value)||Cn.value))return[];const t=[],{maxX:s}=it.value,n=Cn.value?A.series.filter(f=>(f.type||Q.value)==="bar"):Un.value,c=n.length;if(Nt.value){const f=s+1,w=H.value.height/f,C=w*(2/3),M=Math.min(4,C/c*.15),L=C-(c-1)*M,T=Math.max(4,L/c);n.forEach((B,q)=>{const j=A.series.findIndex(K=>K===B),le=J.value===j,Z=J.value!==null&&J.value!==j,ee=ot.value.has(j);B.data.forEach((K,U)=>{if(K==null||typeof K!="number"||!isFinite(K))return;const G=H.value.top+(U+.5)*w-C/2+q*(T+M),se=H.value.left,re=Math.abs(qn(K)-H.value.left);let De="";if(ze.value&&re>0){const Re=Math.min(Kt.value,T/2,re/2);De=[`M ${se} ${G}`,`L ${se+re-Re} ${G}`,`Q ${se+re} ${G} ${se+re} ${G+Re}`,`L ${se+re} ${G+T-Re}`,`Q ${se+re} ${G+T} ${se+re-Re} ${G+T}`,`L ${se} ${G+T}`,"Z"].join(" ")}t.push({x:se,y:G,width:re,height:T,color:ut(c===1?U:j),value:K,label:A.categories[U]||U.toString(),seriesName:B.name,animationDelay:(q*n.length+U)*(Ce.value/4),isHighlighted:le,isDimmed:Z,isHidden:ee,barPath:De,isSmooth:ze.value&&re>0})})})}else{const f=s+1,w=H.value.width/f,C=w*.8,M=C/c,L=M*.05,T=M-L;n.forEach((B,q)=>{const j=A.series.findIndex(K=>K===B),le=J.value===j,Z=J.value!==null&&J.value!==j,ee=ot.value.has(j);B.data.forEach((K,U)=>{if(K==null||typeof K!="number"||!isFinite(K))return;const G=H.value.left+(U+.5)*w-C/2+q*M+L/2,se=_t(Math.max(0,K)),re=Math.abs(_t(0)-_t(K));let De="";if(ze.value&&re>0){const Re=Math.min(Kt.value,T/2,re/2);De=[`M ${G} ${se+re}`,`L ${G} ${se+Re}`,`Q ${G} ${se} ${G+Re} ${se}`,`L ${G+T-Re} ${se}`,`Q ${G+T} ${se} ${G+T} ${se+Re}`,`L ${G+T} ${se+re}`,"Z"].join(" ")}t.push({x:G,y:se,width:T,height:re,color:ut(c===1?U:j),value:K,label:A.categories[U]||U.toString(),seriesName:B.name,animationDelay:(q*n.length+U)*(Ce.value/4),isHighlighted:le,isDimmed:Z,isHidden:ee,barPath:De,isSmooth:ze.value&&re>0})})})}return t}),Xn=e.computed(()=>{if(!rn.value)return[];const t=Un.value.map((h,w)=>({series:h,originalIndex:w})).filter(({originalIndex:h})=>!ot.value.has(h));if(t.length===0)return[];let s=Q.value==="semi-radial"?Math.PI:-Math.PI/2;const n=Q.value==="semi-radial"?Math.PI:Math.PI*2,c=[];if(t.length===1){const{series:h,originalIndex:w}=t[0],C=h.data[0]||0,M=s,L=s+n-.001,T=M+n/2,B=We.value+Math.cos(M)*tt.value,q=qe.value+Math.sin(M)*tt.value,j=We.value+Math.cos(L)*tt.value,le=qe.value+Math.sin(L)*tt.value,Z=We.value+Math.cos(L)*Ne.value,ee=qe.value+Math.sin(L)*Ne.value,K=We.value+Math.cos(M)*Ne.value,U=qe.value+Math.sin(M)*Ne.value,me=1,te=[`M ${B} ${q}`,`A ${tt.value} ${tt.value} 0 ${me} 1 ${j} ${le}`,`L ${Z} ${ee}`,`A ${Ne.value} ${Ne.value} 0 ${me} 0 ${K} ${U}`,"Z"].join(" "),G=ut(w);return c.push({path:te,color:G,strokeWidth:It.value,strokeColor:An(0,G),value:C,seriesName:h.name,opacity:.8,isHighlighted:J.value===w,isDimmed:!1,isHidden:!1,startAngle:M,endAngle:L,midAngle:T}),c}if(Vn.value&&t.length===2){const h=t[0],w=t[1],C=Math.min(100,Math.max(0,h.series.data[0]||0)),M=C/100*n,L=(T,B,q,j,le)=>{const Z=T+(B-T)/2,ee=B-T,K=We.value+Math.cos(T)*tt.value,U=qe.value+Math.sin(T)*tt.value,me=We.value+Math.cos(B)*tt.value,te=qe.value+Math.sin(B)*tt.value,G=We.value+Math.cos(B)*Ne.value,se=qe.value+Math.sin(B)*Ne.value,re=We.value+Math.cos(T)*Ne.value,De=qe.value+Math.sin(T)*Ne.value,Re=ee>Math.PI?1:0,dn=[`M ${K} ${U}`,`A ${tt.value} ${tt.value} 0 ${Re} 1 ${me} ${te}`,`L ${G} ${se}`,`A ${Ne.value} ${Ne.value} 0 ${Re} 0 ${re} ${De}`,"Z"].join(" "),Et=ut(j);return{path:dn,color:Et,strokeWidth:It.value,strokeColor:An(c.length,Et),value:le,seriesName:q.name,opacity:.8,isHighlighted:J.value===j,isDimmed:J.value!==null&&J.value!==j,isHidden:!1,startAngle:T,endAngle:B,midAngle:Z}};return c.push(L(s,s+M,h.series,h.originalIndex,C)),c.push(L(s,s+n,w.series,w.originalIndex,100)),c}const f=t.reduce((h,{series:w})=>h+(w.data[0]||0),0);return f===0?[]:(t.forEach(({series:h,originalIndex:w})=>{const C=h.data[0]||0,M=C/f*n,L=s,T=s+M,B=L+M/2,q=We.value+Math.cos(L)*tt.value,j=qe.value+Math.sin(L)*tt.value,le=We.value+Math.cos(T)*tt.value,Z=qe.value+Math.sin(T)*tt.value,ee=We.value+Math.cos(T)*Ne.value,K=qe.value+Math.sin(T)*Ne.value,U=We.value+Math.cos(L)*Ne.value,me=qe.value+Math.sin(L)*Ne.value,te=M>Math.PI?1:0,G=[`M ${q} ${j}`,`A ${tt.value} ${tt.value} 0 ${te} 1 ${le} ${Z}`,`L ${ee} ${K}`,`A ${Ne.value} ${Ne.value} 0 ${te} 0 ${U} ${me}`,"Z"].join(" "),se=ut(w);c.push({path:G,color:se,strokeWidth:It.value,strokeColor:An(c.length,se),value:C,seriesName:h.name,opacity:.8,isHighlighted:J.value===w,isDimmed:J.value!==null&&J.value!==w,isHidden:!1,startAngle:L,endAngle:T,midAngle:B}),s=T}),c)}),Ll=e.computed(()=>{const t=Xn.value;return Vn.value&&t.length>=2?[{segment:t[1],originalIndex:1},{segment:t[0],originalIndex:0}]:t.map((s,n)=>({segment:s,originalIndex:n}))}),Vl=e.computed(()=>!Ht.value||!rn.value?[]:Xn.value.map((t,s)=>{if(t.isHidden)return null;const n=jn.value,c=go.value,f=ho.value,h=We.value+Math.cos(t.midAngle)*Ne.value,w=qe.value+Math.sin(t.midAngle)*Ne.value,C=We.value+Math.cos(t.midAngle)*(Ne.value+n),M=qe.value+Math.sin(t.midAngle)*(Ne.value+n),L=Math.cos(t.midAngle)>=0,B=C+c*(L?1:-1),q=M,j=L?C+15:C-15,le=q-f,Z=L?"start":"end",ee=Math.hypot(C-h,M-w),K=Math.hypot(B-C,q-M);return{pointerStartX:h,pointerStartY:w,pointerEndX:C,pointerEndY:M,horizontalEndX:B,horizontalEndY:q,textX:j,textY:le,text:`${t.seriesName}: ${Wt(t.value)}`,color:t.color,textAnchor:Z,isRightSide:L,isHighlighted:t.isHighlighted,isDimmed:t.isDimmed,pointerLineLength:ee,horizontalLineLength:K}}).filter(Boolean)),Sl=t=>{if(!t||t.isHidden)return 0;const s=t.opacity||xo.value||.7;return J.value===null||J.value===void 0?s:J.value!==null?t.seriesIndex===J.value?Math.min(1,s+.1):Math.max(.5,s*.8):s},l=t=>{if(!t||t.isHidden)return 0;const s=t.radius>20?.9:.8;return J.value!==null?t.seriesIndex===J.value?Math.min(1,s+.1):s*.7:s},o=(t,s)=>{if(t)try{if(J.value===t.seriesIndex?J.value=null:J.value=t.seriesIndex,typeof window<"u"&&window.dispatchEvent){const n=new CustomEvent("dss-bubble-click",{detail:{bubble:t,originalEvent:s,chartId:A.chartId}});window.dispatchEvent(n)}}catch(n){console.error("Error in onBubbleClick:",n)}},a=(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(" ")},r=(t,s)=>{if(!t||(s.stopPropagation(),Mn.value=!0,J.value=t.seriesIndex,ce.value.show=!1,!Rt.value))return;const n=s.target.closest(".dss-custom-chart-container");if(!n)return;const c=n.getBoundingClientRect();let f=s.clientX-c.left+10,h=s.clientY-c.top-10;const w=200,C=120;f+w>pe.value&&(f=s.clientX-c.left-w-10),h+C>c.height&&(h=s.clientY-c.top-C-10),f<0&&(f=10),h<0&&(h=10);const M=Ro.value,L=ro.value,T=M.map(B=>{const q=L[B]||B,j=i(B,t);return j?{seriesName:t.seriesName,label:t.label,value:`${q}: ${j}`,color:t.color}:null}).filter(Boolean);ae.value={show:!0,x:f,y:h,title:t.label||t.seriesName||"",value:"",bubbleData:T,categoryIndex:void 0,spiderSeries:[]}},i=(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 c=io.value[t];if(typeof c=="function")return c(n,s);if(typeof n=="number"){const f=n.toFixed(1);return St.value?f+St.value:f}return n?.toString()||""},u=()=>{if(!dt.value||!ce.value.data||ce.value.data.length===0)return"Bubbles";const t=[],s=new Set;return ce.value.data.forEach(n=>{if(n.seriesName&&n.label){const c=`${n.seriesName} - ${n.label}`;s.has(c)||(t.push(c),s.add(c))}else n.seriesName&&(s.has(n.seriesName)||(t.push(n.seriesName),s.add(n.seriesName)))}),t.length>0?t.join(" | "):"Bubbles"},d=(t,s)=>{t&&(Mn.value=!1,J.value=null,ae.value.show=!1,ae.value.bubbleData=[])},p=(t,s)=>{const n=s.target.closest(".dss-custom-chart-container");if(!n)return;const c=n.getBoundingClientRect(),f=dl(t.categoryIndex),h=t.description||t.comment||"";let w=s.clientX-c.left+15,C=s.clientY-c.top-10;const M=200,L=h?80:50;w+M>pe.value&&(w=s.clientX-c.left-M-15),C+L>lt.value&&(C=s.clientY-c.top-L-10),w<0&&(w=10),C<0&&(C=10),wt.value={show:!0,x:w,y:C,categoryValue:f,description:h}},v=()=>{wt.value.show=!1},y=e.computed(()=>A.categories.length||Math.max(...po.value.map(t=>t.data.length))),V=e.computed(()=>{let t=0;return po.value.forEach(s=>{s.data.forEach(n=>{typeof n=="number"&&(t=Math.max(t,n))})}),t||100}),N=e.computed(()=>{const t=[],s=y.value;for(let n=0;n<s;n++){const c=n*2*Math.PI/s-Math.PI/2,f=We.value+Math.cos(c)*Ne.value,h=qe.value+Math.sin(c)*Ne.value;t.push({x:f,y:h,angle:c,index:n})}return t}),b=e.computed(()=>{const t=[],s=y.value;return N.value.forEach((n,c)=>{const f=Ne.value+15,h=c*2*Math.PI/s-Math.PI/2,w=We.value+Math.cos(h)*f,C=qe.value+Math.sin(h)*f+5;let M="middle",L="middle";Math.abs(Math.cos(h))>.5&&(M=Math.cos(h)>0?"start":"end"),Math.abs(Math.sin(h))>.5&&(L=Math.sin(h)>0?"hanging":"auto"),t.push({x:w,y:C,text:A.categories[c]||`Axis ${c+1}`,anchor:M,baseline:L})}),t}),z=e.ref(new Set),I=(t,s,n)=>{const c=`current-${n}`,f=z.value.has(c);return!f&&J.value===null?s.fillOpacity||_e.value:s.isHighlighted||f?(s.fillOpacity||_e.value)+.15:s.isDimmed?(s.fillOpacity||_e.value)*.3:s.fillOpacity||_e.value},oe=e.computed(()=>{if(!Wn.value)return[];const t=[],s=y.value;return Un.value.forEach((n,c)=>{const f=[],h=[],w=[],C=J.value===c,M=J.value!==null&&J.value!==c,L=ot.value.has(c);for(let T=0;T<s;T++){const B=n.data[T]||0,j=B/V.value*Ne.value,le=T*2*Math.PI/s-Math.PI/2,Z=We.value+Math.cos(le)*j,ee=qe.value+Math.sin(le)*j;f.push(`${Z},${ee}`),h.push({x:Z,y:ee}),w.push({x:Z,y:ee,value:B,label:A.categories[T]||`Axis ${T+1}`,seriesName:n.name})}t.push({points:f.join(" "),polygonPoints:h,dataPoints:w,color:ut(c),fillOpacity:_e.value,seriesName:n.name,value:`${n.name}: ${n.data.join(", ")}`,isHighlighted:C,isDimmed:M,isHidden:L,seriesIndex:c})}),t}),Y=(t,s)=>{if(!s||s.length<3)return!1;let n=!1;for(let c=0,f=s.length-1;c<s.length;f=c++){const h=s[c].x,w=s[c].y,C=s[f].x,M=s[f].y;w>t.y!=M>t.y&&t.x<(C-h)*(t.y-w)/(M-w)+h&&(n=!n)}return n},Ee=t=>{if(!Wn.value)return;const s=t.currentTarget.closest(".dss-custom-chart-container");if(!s)return;const n=s.getBoundingClientRect(),c=ye.value?.getBoundingClientRect();if(!c)return;const f=t.clientX-c.left,h=t.clientY-c.top,w=oe.value.filter(C=>C.isHidden?!1:Y({x:f,y:h},C.polygonPoints));if(w.length>0){w.length,J.value=w[0].seriesIndex;const C=t.clientX-n.left+10,M=t.clientY-n.top-10,L=200,T=50+w.length*25;let B=C,q=M;B+L>pe.value&&(B=t.clientX-n.left-L-10),q+T>lt.value&&(q=t.clientY-n.top-T-10),B<0&&(B=10),q<0&&(q=10);const j=w.map(le=>{let Z=le.dataPoints[0],ee=1/0;return le.dataPoints.forEach(K=>{const U=Math.sqrt(Math.pow(K.x-f,2)+Math.pow(K.y-h,2));U<ee&&(ee=U,Z=K)}),{seriesName:le.seriesName,color:le.color,value:Wt(Z.value!==void 0?Z.value:le.value)}});ae.value={show:!0,x:B,y:q,title:w.length===1?w[0].seriesName:"",value:"",bubbleData:[],spiderSeries:j}}else Zt()},yt=e.computed(()=>{const t=F.value;return t.logos.map((s,n)=>{const c=A.series[s.seriesIndex];if(!c||!c.data||c.data.length===0||ot.value.has(s.seriesIndex))return null;let f,h;if(Lt.value){let C=-1,M=null;for(let T=c.data.length-1;T>=0;T--)if(c.data[T]!==null&&c.data[T]!==void 0){C=T,M=c.data[T];break}if(C===-1||M===null)return null;const L=c.data.map((T,B)=>T==null?null:{x:ht(B),y:_t(T),index:B}).filter(T=>T!==null);if(t.animations.enabled&&!Dn.value&&t.animations.type==="draw"&&t.chart.type==="line"&&(Ae.value.isAnimating||!Ae.value.hasAnimated))if(Ae.value.isAnimating){const T=Ae.value.currentFrame/Ae.value.totalFrames,B=Nl(t.animations.easing,Math.min(T,1)),q=Ul(L,B);f=q.x+(s.offsetX||0),h=q.y+(s.offsetY||0)}else f=L[0].x+(s.offsetX||0),h=L[0].y+(s.offsetY||0);else f=ht(C)+(s.offsetX||0),h=_t(M)+(s.offsetY||0)}else if(rn.value||Wn.value){const C=Math.PI*2/t.logos.length*n;f=We.value+Math.cos(C)*(Ne.value+30)+(s.offsetX||0),h=qe.value+Math.sin(C)*(Ne.value+30)+(s.offsetY||0)}return{...s,x:f,y:h,seriesIndex:s.seriesIndex}}).filter(Boolean)}),Mt=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")},xt=t=>{ot.value.has(t)?ot.value.delete(t):ot.value.add(t)},Bt=e.computed(()=>{if(!ae.value.show&&!(vt.value&&ce.value.show&&!m.value.isZooming))return{display:"none"};let t,s;if(vt.value&&ce.value.show&&!m.value.isZooming){t=ce.value.x+15,s=H.value.top;const n=dt.value?200:150;t+n>pe.value&&(t=ce.value.x-n-15),t<0&&(t=10),s<10&&(s=10)}else t=ae.value.x,s=ae.value.y;return{left:t+"px",top:s+"px"}}),Xe=(t,s)=>{if(!Rt.value||Eo.value)return;const c=s.target.closest(".dss-custom-chart-container").getBoundingClientRect();let f=s.clientX-c.left+10,h=s.clientY-c.top-10;const w=200,C=120,M=pe.value,L=lt.value;f+w>M&&(f=s.clientX-c.left-w-10),h+C>L&&(h=s.clientY-c.top-C-10),f<0&&(f=10),h<0&&(h=10);let T;typeof t.categoryIndex=="number"?T=t.categoryIndex:typeof t.dataIndex=="number"?T=t.dataIndex:t.label&&A.categories.includes(t.label)&&(T=A.categories.indexOf(t.label));const B=(Nt.value||Q.value==="bar")&&t.label?t.label:t.seriesName||t.label||"";ae.value={show:!0,x:f,y:h,title:B,value:Wt(t.value)||"",categoryIndex:T,spiderSeries:[]}},bn=e.ref(!1),Mn=e.ref(!1),Zt=()=>{ae.value.show=!1,ae.value.spiderSeries=[],ae.value.bubbleData=[],ce.value.show=!1,bn.value||(J.value=null)},Eo=e.ref(!1),Vo=(t,s)=>{Eo.value=!0,ae.value.show=!1,ce.value.show=!1;const c=s.target.closest(".dss-custom-chart-container").getBoundingClientRect();let f=s.clientX-c.left+15,h=s.clientY-c.top-10;const w=250;f+w>pe.value&&(f=s.clientX-c.left-w-15),f<0&&(f=10),h<0&&(h=10),so.value={show:!0,x:f,y:h,content:t.texts,count:t.totalCount}},$o=()=>{Eo.value=!1,so.value.show=!1},Ae=e.ref({isAnimating:!1,currentFrame:0,totalFrames:0,animationId:null,hasAnimated:!1}),Nl=(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}},Dn=e.computed(()=>Ft.value?window.matchMedia("(prefers-reduced-motion: reduce)").matches:!1),Ho=()=>{if(!Te.value||Dn.value){Ae.value.hasAnimated=!0,Jt.value&&(to.value=1);return}Jt.value&&(to.value=0),Ae.value.isAnimating=!0,Ae.value.currentFrame=0,Ae.value.totalFrames=Math.ceil(Ve.value/16.67);const t=()=>{const s=Ae.value.currentFrame/Ae.value.totalFrames,n=Nl(st.value,Math.min(s,1));Ml(n),Jt.value&&(to.value=n),s<1?(Ae.value.currentFrame++,Ae.value.animationId=requestAnimationFrame(t)):Yn()};Ae.value.animationId=requestAnimationFrame(t)},Ml=t=>{const s=document.querySelector(".dss-custom-chart-container");s&&s.style.setProperty("--dss-animation-progress",t)},Yn=()=>{Ae.value.isAnimating=!1,Ae.value.hasAnimated=!0,Jt.value&&(to.value=1),Ae.value.animationId&&(cancelAnimationFrame(Ae.value.animationId),Ae.value.animationId=null)},Bn=e.computed(()=>!rn.value||Ae.value.hasAnimated?!0:Jt.value?to.value>=1:eo.value?Mo.value>=1:!0),wn=e.computed(()=>Ht.value&&Bn.value),ll=e.ref(!1);e.watch(wn,t=>{t?(ll.value=!1,e.nextTick(()=>{requestAnimationFrame(()=>{ll.value=!0})})):ll.value=!1},{immediate:!0});const Zl=e.computed(()=>{if(!Te.value||Dn.value||Ae.value.hasAnimated)return{};const t={};return t["--dss-animation-duration"]=`${Ve.value}ms`,t["--dss-animation-easing"]=Wl(st.value),t["--dss-stagger-delay"]=`${Ce.value}ms`,t}),Wl=t=>({linear:"linear",ease:"ease","ease-in":"ease-in","ease-out":"ease-out","ease-in-out":"ease-in-out"})[t]||"ease-out",ql=()=>{if(!Te.value||Dn.value)return"";const t=["dss-chart-animated"];return Ae.value.hasAnimated||t.push(`dss-animate-${je.value}`),Ae.value.hasAnimated||(rn.value&&Q.value!=="semi-radial"?t.push("dss-animate-fill"):rn.value||t.push(`dss-animate-${je.value}`)),Ae.value.isAnimating&&t.push("dss-is-animating"),t.join(" ")};e.watch(()=>A.series,(t,s)=>{nt.value&&s&&Ae.value.hasAnimated&&(Ae.value.hasAnimated=!1,e.nextTick(()=>{setTimeout(()=>Ho(),Oe.value)}))},{deep:!0}),e.watch(()=>m.value.isZooming,(t,s)=>{s&&!t&&setTimeout(()=>{Qt()},50)}),e.watch(()=>[m.value.scale,m.value.offsetX],()=>{!m.value.isZooming&&!m.value.isDragging&&Qt()},{flush:"post"}),e.watch([Je,gn],([t,s])=>{m.value.minScale=t,m.value.maxScale=s,(m.value.scale<t||m.value.scale>s)&&Xo()},{immediate:!0}),e.watch(()=>A.locale,t=>{t&&t!==R.value&&(R.value=t)},{immediate:!0}),e.watch(()=>k.value.show,t=>{t?e.nextTick(()=>{document.addEventListener("click",qo)}):document.removeEventListener("click",qo)}),e.onMounted(()=>{J.value=null,Jt.value&&(!Te.value||Dn.value)&&(to.value=1),hl(),S.value&&typeof ResizeObserver<"u"&&(we=new ResizeObserver(t=>{const s=t[0];!s||!s.contentRect||(Me&&cancelAnimationFrame(Me),Me=requestAnimationFrame(()=>{Me=null;const{width:n,height:c}=s.contentRect;ct.value=Math.round(n),g.value=Math.round(c),Ge.value&&(Xt.value=Ge.value.offsetHeight||Be)}))}),we.observe(S.value)),Te.value&&!Dn.value?Q.value==="semi-radial"?setTimeout(()=>wo(),Oe.value):setTimeout(()=>Ho(),Oe.value):(Ae.value.hasAnimated=!0,Q.value==="semi-radial"&&(Mo.value=1)),document.addEventListener("mousemove",Fl),document.addEventListener("mouseup",zl),document.addEventListener("click",ko)}),e.onUnmounted(()=>{Me&&cancelAnimationFrame(Me),we&&S.value&&(we.unobserve(S.value),we.disconnect(),we=null),Ae.value.animationId&&cancelAnimationFrame(Ae.value.animationId),Sn&&(cancelAnimationFrame(Sn),Sn=null),m.value.zoomTimeout&&clearTimeout(m.value.zoomTimeout),document.removeEventListener("mousemove",Fl),document.removeEventListener("mouseup",zl),document.removeEventListener("click",ko),document.removeEventListener("click",qo)});const Fl=t=>{if(m.value.isDragging&&m.value.scale>1&&Lt.value){ce.value.show=!1;const s=t.clientX-m.value.lastMouseX,{minX:n,maxX:c}=it.value,f=c-n||1,w=s*.8;m.value.offsetX+=w;const C=f/m.value.scale,M=f-C,L=0,T=-M/f*H.value.width,B=L;m.value.offsetX=Math.max(T,Math.min(B,m.value.offsetX)),m.value.lastMouseX=t.clientX,m.value.lastMouseY=t.clientY}},zl=()=>{m.value.isDragging&&(m.value.isDragging=!1,setTimeout(()=>{!m.value.isDragging&&m.value.isZooming},100))},Ul=(t,s)=>{const n=t.filter(C=>C!=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 c=0;const f=[];for(let C=1;C<n.length;C++){const M=n[C].x-n[C-1].x,L=n[C].y-n[C-1].y,T=Math.sqrt(M*M+L*L);f.push(T),c+=T}const h=c*s;let w=0;for(let C=0;C<f.length;C++){const M=w+f[C];if(h<=M){const L=(h-w)/f[C],T=n[C],B=n[C+1];return{x:T.x+(B.x-T.x)*L,y:T.y+(B.y-T.y)*L}}w=M}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",[ql(),{"dss-chart-fill-width":Tt.value,"dss-chart-fill-height":Dt.value,"dss-chart-compact":rn.value&&!pt.value}]]),style:e.normalizeStyle({width:Tt.value?"100%":pe.value+"px",height:ve.value,...Tt.value||Dt.value?{overflow:"hidden",maxWidth:"100%",maxHeight:"100%"}:{},...Zl.value,cursor:kl()}),"data-chart-type":Q.value,ref_key:"containerEl",ref:S,onWheel:Uo,onMousedown:yl,onMousemove:Pt,onMouseup:Bl,onMouseleave:Oo,onDblclick:Xo,onContextmenu:e.withModifiers(Zo,["prevent"]),onClick:e.withModifiers(on,["left"]),onWheelCapture:Uo},[e.createElementVNode("div",{class:"dss-chart-header",ref_key:"headerEl",ref:Ge},[e.createElementVNode("div",Kl,[Ue.value?(e.openBlock(),e.createElementBlock("div",Gl,e.toDisplayString(Ue.value),1)):e.createCommentVNode("",!0),$e.value?(e.openBlock(),e.createElementBlock("div",Ql,e.toDisplayString($e.value),1)):e.createCommentVNode("",!0)]),pt.value&&(ke.value==="top"||ke.value==="bottom")?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["dss-chart-legend",{"dss-legend-horizontal":mn.value==="horizontal","dss-legend-vertical":mn.value==="vertical","dss-legend-top":ke.value==="top","dss-legend-bottom":ke.value==="bottom"}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(A.series,(n,c)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-${c}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":ot.value.has(c),"dss-legend-hovered":J.value===c,"dss-legend-dimmed":J.value!==null&&J.value!==c}]),onClick:f=>xt(c),onMouseenter:f=>zt(c),onMouseleave:En,style:e.normalizeStyle({animationDelay:`${c*100}ms`})},[e.createElementVNode("div",{class:"dss-legend-color",style:e.normalizeStyle({backgroundColor:ut(c)})},null,4),e.createElementVNode("span",ea,e.toDisplayString(n.name),1)],46,Jl))),128))],2)):e.createCommentVNode("",!0),pt.value&&(ke.value==="left"||ke.value==="right")?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["dss-chart-legend-side",{"dss-legend-left":ke.value==="left","dss-legend-right":ke.value==="right"}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(A.series,(n,c)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-${c}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":ot.value.has(c),"dss-legend-hovered":J.value===c,"dss-legend-dimmed":J.value!==null&&J.value!==c}]),onClick:f=>xt(c),onMouseenter:f=>zt(c),onMouseleave:En,style:e.normalizeStyle({animationDelay:`${c*100}ms`})},[e.createElementVNode("div",{class:"dss-legend-color",style:e.normalizeStyle({backgroundColor:ut(c)})},null,4),e.createElementVNode("span",na,e.toDisplayString(n.name),1)],46,ta))),128))],2)):e.createCommentVNode("",!0)],512),O.showAddMarkerButton&&et.value.addMarker&&(Lt.value||dt.value)?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-add-marker-button",onClick:Wo,title:e.unref(P)("chart.contextMenu.addMarker")},[e.createElementVNode("img",{src:$n.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,la),s[5]||(s[5]=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,oa)):e.createCommentVNode("",!0),e.createElementVNode("div",aa,[dt.value&&xn.value?(e.openBlock(),e.createElementBlock("div",sa,"Bubble size: "+e.toDisplayString(xn.value),1)):e.createCommentVNode("",!0),(e.openBlock(),e.createElementBlock("svg",{width:pe.value,height:lt.value,class:"dss-chart-svg","data-smooth":ze.value,"data-animated":Te.value,ref_key:"svgEl",ref:ye},[e.createElementVNode("defs",null,[e.createElementVNode("clipPath",ia,[e.createElementVNode("rect",{x:H.value.left,y:H.value.top,width:H.value.width,height:H.value.height*4},null,8,ca)]),eo.value?(e.openBlock(),e.createElementBlock("clipPath",{key:0,id:jo.value},[e.createElementVNode("path",{d:uo.value},null,8,ua)],8,da)):e.createCommentVNode("",!0),Jt.value?(e.openBlock(),e.createElementBlock("clipPath",{key:1,id:Ko.value},[e.createElementVNode("path",{d:mo.value},null,8,pa)],8,ma)):e.createCommentVNode("",!0)]),Lt.value||dt.value?(e.openBlock(),e.createElementBlock("g",va,[un.value?(e.openBlock(),e.createElementBlock("g",fa,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(wl.value,(n,c)=>(e.openBlock(),e.createElementBlock("line",{key:`h-grid-${c}`,x1:H.value.left,x2:H.value.right,y1:n.y,y2:n.y,stroke:"#e0e0e0","stroke-width":"1","stroke-dasharray":"4,2",style:e.normalizeStyle({animationDelay:`${c*50}ms`})},null,12,ga))),128))])):e.createCommentVNode("",!0),e.createElementVNode("g",ha,[e.createElementVNode("line",{x1:H.value.left,x2:H.value.right,y1:H.value.bottom,y2:H.value.bottom,stroke:"#ccc","stroke-width":"1"},null,8,ya),e.createElementVNode("line",{x1:H.value.left,x2:H.value.left,y1:H.value.top,y2:H.value.bottom,stroke:"#ccc","stroke-width":"1"},null,8,ka)]),e.createElementVNode("g",Ca,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(el.value,(n,c)=>(e.openBlock(),e.createElementBlock("text",{key:`x-${c}`,x:n.x,y:n.y,"text-anchor":"middle","font-size":"12",fill:"#666",style:e.normalizeStyle({animationDelay:`${c*100}ms`})},e.toDisplayString(n.text),13,ba))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(tl.value,(n,c)=>(e.openBlock(),e.createElementBlock("text",{key:`y-${c}`,x:n.x,y:n.y,"text-anchor":"end","font-size":"12",fill:"#666","dominant-baseline":"middle",style:e.normalizeStyle({animationDelay:`${c*80}ms`})},e.toDisplayString(n.text),13,wa))),128)),tn.value?(e.openBlock(),e.createElementBlock("text",{key:0,x:H.value.left+H.value.width/2,y:H.value.bottom+45,"text-anchor":"middle","font-size":"14","font-weight":"bold",fill:"#333"},e.toDisplayString(tn.value),9,xa)):e.createCommentVNode("",!0),Tn.value?(e.openBlock(),e.createElementBlock("text",{key:1,x:15,y:H.value.top+12+H.value.height/2,"text-anchor":"middle","font-size":"14","font-weight":"bold",fill:"#333",transform:`rotate(-90, 15, ${H.value.top+H.value.height/2})`},e.toDisplayString(Tn.value),9,Ea)):e.createCommentVNode("",!0)]),ao.value.length>0?(e.openBlock(),e.createElementBlock("g",Va,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ao.value,n=>(e.openBlock(),e.createElementBlock("g",{key:`flag-group-${n.categoryIndex}`},[e.createElementVNode("g",Sa,[n.hasManual?(e.openBlock(),e.createElementBlock("line",{key:0,x1:n.x,x2:n.x,y1:H.value.bottom,y2:H.value.top,stroke:"#047395","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:c=>Vo(n,c),onMouseleave:$o},null,40,Na)):e.createCommentVNode("",!0),n.hasAuto&&!n.hasManual?(e.openBlock(),e.createElementBlock("line",{key:1,x1:n.x,x2:n.x,y1:H.value.bottom,y2:H.value.top,stroke:"#0dbf89","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:c=>Vo(n,c),onMouseleave:$o},null,40,Ma)):e.createCommentVNode("",!0),n.hasAuto&&n.hasManual?(e.openBlock(),e.createElementBlock("line",{key:2,x1:n.x,x2:n.x,y1:H.value.bottom,y2:H.value.top,stroke:"#047395","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:c=>Vo(n,c),onMouseleave:$o},null,40,Ba)):e.createCommentVNode("",!0)]),n.hasManual&&n.hasAuto?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:n.x+8,cy:Math.max(15,H.value.top-10),r:"14",fill:"#0dbf89",stroke:"#fafafa","stroke-width":"2",class:"flag-count-circle",onMouseover:c=>Vo(n,c),onMouseleave:$o},null,40,Ta)):e.createCommentVNode("",!0),e.createElementVNode("circle",{cx:n.x,cy:Math.max(15,H.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:c=>Vo(n,c),onMouseleave:$o},null,40,$a),e.createElementVNode("text",{x:n.x,y:Math.max(15,H.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,Ha)]))),128))])):e.createCommentVNode("",!0),e.createElementVNode("g",La,[Cn.value?(e.openBlock(),e.createElementBlock("g",_a,[e.createElementVNode("g",{class:e.normalizeClass(["dss-bar-chart",{"dss-horizontal-bars":Nt.value}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(no.value,(n,c)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`mixed-bar-${c}`},[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=>Xe(n,f),onMouseleave:Zt},null,46,Aa)):(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=>Xe(n,f),onMouseleave:Zt},null,46,Da))],64))),128))],2),e.createElementVNode("g",Ra,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(nl.value,(n,c)=>(e.openBlock(),e.createElementBlock("path",{key:`mixed-line-${c}`,d:n.path,stroke:n.color,"stroke-width":n.isHighlighted?Ze.value+2:Ze.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,Ia))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(El.value,(n,c)=>(e.openBlock(),e.createElementBlock("path",{key:`mixed-gap-connector-${c}`,d:n.path,stroke:n.color,"stroke-width":n.isHighlighted?Ze.value+2:Ze.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round","stroke-dasharray":"15, 10, 5, 10",opacity:n.isHighlighted?0:.5,class:e.normalizeClass({"dss-gap-connector":!0,"dss-series-dimmed":n.isDimmed,"dss-series-hidden":n.isHidden}),style:e.normalizeStyle({animationDelay:`${n.animationDelay}ms`,transition:"opacity 0.2s ease"})},null,14,Fa))),128)),Fe.value>0||jt.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(Fo.value,(n,c)=>(e.openBlock(),e.createElementBlock("circle",{key:`mixed-point-${c}`,cx:n.x,cy:n.y,r:n.isHighlighted?de(n,Fe.value)+2:de(n,Fe.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=>Xe(n,f),onMouseleave:Zt},null,46,za))),128)):e.createCommentVNode("",!0)])])):Q.value==="line"?(e.openBlock(),e.createElementBlock("g",Pa,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList($l.value,(n,c)=>(e.openBlock(),e.createElementBlock("path",{key:`anim-${c}`,d:n.path,stroke:n.color,"stroke-width":Ze.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass(["dss-line-animation-overlay",{"dss-animation-complete":Ae.value.hasAnimated}]),style:e.normalizeStyle({"--dss-path-length":n.pathLength,animationDelay:`${n.animationDelay}ms`})},null,14,Oa))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(nl.value,(n,c)=>(e.openBlock(),e.createElementBlock("path",{key:`line-${c}`,d:n.path,stroke:n.color,"stroke-width":n.isHighlighted?Ze.value+2:Ze.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,Za))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(El.value,(n,c)=>(e.openBlock(),e.createElementBlock("path",{key:`gap-connector-${c}`,d:n.path,stroke:n.color,"stroke-width":n.isHighlighted?Ze.value+2:Ze.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round","stroke-dasharray":"15, 10, 5, 10",opacity:n.isHighlighted?0:.5,class:e.normalizeClass({"dss-gap-connector":!0,"dss-series-dimmed":n.isDimmed,"dss-series-hidden":n.isHidden}),style:e.normalizeStyle({animationDelay:`${n.animationDelay}ms`,transition:"opacity 0.2s ease"})},null,14,Wa))),128)),Fe.value>0||jt.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(Hl.value,(n,c)=>(e.openBlock(),e.createElementBlock("circle",{key:`point-${c}`,cx:n.x,cy:n.y,r:n.isHighlighted?de(n,Fe.value)+2:de(n,Fe.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=>Xe(n,f),onMouseleave:Zt},null,46,qa))),128)):e.createCommentVNode("",!0)])):Q.value==="area"?(e.openBlock(),e.createElementBlock("g",Ua,[e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ol.value,(n,c)=>(e.openBlock(),e.createElementBlock("mask",{key:`mask-${c}`,id:`area-mask-${c}-${O.chartId}`},[e.createElementVNode("rect",{x:H.value.left-10,y:H.value.top-10,width:H.value.width+20,height:H.value.height+20,fill:"#fafafa",class:"dss-area-mask-rect",style:e.normalizeStyle({"--dss-mask-width":`${H.value.width+20}px`})},null,12,Ya)],8,Xa))),128))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ol.value,(n,c)=>(e.openBlock(),e.createElementBlock("path",{key:`area-fill-${c}`,d:n.areaPath,fill:n.color,"fill-opacity":n.isHighlighted?ge.value+.2:ge.value,mask:`url(#area-mask-${c}-${O.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,ja))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ol.value,(n,c)=>(e.openBlock(),e.createElementBlock("path",{key:`area-line-${c}`,d:n.linePath,stroke:n.color,"stroke-width":n.isHighlighted?Ze.value+1:Ze.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass({"dss-area-line-animated":!0,"dss-series-highlighted":n.isHighlighted,"dss-series-dimmed":n.isDimmed,"dss-series-hidden":n.isHidden}),style:e.normalizeStyle({"--dss-path-length":n.pathLength,animationDelay:`${c*Ce.value}ms`})},null,14,Ka))),128))])):Q.value==="bar"?(e.openBlock(),e.createElementBlock("g",{key:3,class:e.normalizeClass({"dss-horizontal-bars":Nt.value})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(no.value,(n,c)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`bar-${c}`},[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=>Xe(n,f),onMouseleave:Zt},null,46,Ga)):(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=>Xe(n,f),onMouseleave:Zt},null,46,Qa))],64))),128))],2)):e.createCommentVNode("",!0)]),vt.value&&ce.value.show&&!m.value.isZooming?(e.openBlock(),e.createElementBlock("g",Ja,[e.createElementVNode("line",{x1:ce.value.x,x2:ce.value.x,y1:H.value.top,y2:H.value.bottom,stroke:fo.value,"stroke-width":"1","stroke-dasharray":"4,4",opacity:"0.8"},null,8,es),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ce.value.data,(n,c)=>(e.openBlock(),e.createElementBlock("circle",{key:`dss-crosshair-point-${c}`,cx:ce.value.x,cy:n.y,r:Fe.value+2,fill:n.color,stroke:"none",opacity:"0.9"},null,8,ts))),128))])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),dt.value?(e.openBlock(),e.createElementBlock("g",ns,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(cn.value,(n,c)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`bubble-${c}`},[n?(e.openBlock(),e.createElementBlock("g",os,[e.createElementVNode("circle",{cx:n.x,cy:n.y,r:n.radius,fill:n.color,"fill-opacity":Sl(n),stroke:n.color,"stroke-width":"1","stroke-opacity":"0.8",class:e.normalizeClass(a(n,c)),style:{cursor:"pointer",transition:"all 0.3s ease"},onMouseenter:f=>r(n,f),onMouseleave:f=>d(n),onClick:f=>o(n,f)},null,42,ls),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-${c} ${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:l(n)}),onLoad:f=>Bo(c),onError:f=>bl(c),onMouseenter:f=>r(n,f),onMouseleave:f=>d(n),onClick:f=>o(n,f)},null,46,as)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],64))),128))])):e.createCommentVNode("",!0),rn.value?(e.openBlock(),e.createElementBlock("g",{key:2,class:"radial-chart",transform:No.value},[Q.value==="radial"?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:We.value,cy:qe.value,r:Ne.value,fill:"none",stroke:"#e0e0e0","stroke-width":"1"},null,8,rs)):e.createCommentVNode("",!0),e.createElementVNode("g",{class:"dss-radial-data","data-chart-type":Q.value,"clip-path":bo.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ll.value,(n,c)=>(e.openBlock(),e.createElementBlock("path",{key:`radial-${n.originalIndex}-${c}`,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":gt(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=>Xe(n.segment,f),onMouseleave:Zt},null,42,cs))),128))],8,is),Ln.value&&Bn.value?(e.openBlock(),e.createElementBlock("g",ds,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Do.value,(n,c)=>e.withDirectives((e.openBlock(),e.createElementBlock("text",{key:`radial-segment-label-${c}`,x:n.x,y:n.y,"text-anchor":"middle","dominant-baseline":"middle",class:"dss-radial-segment-data-label"},e.toDisplayString(n.value),9,us)),[[e.vShow,n.show]])),128))])):e.createCommentVNode("",!0),Lo.value&&(Bn.value||eo.value)?(e.openBlock(),e.createElementBlock("text",{key:2,x:Ao.value.x,y:Ao.value.y,"text-anchor":"middle","dominant-baseline":"middle","font-size":yn.value,fill:kn.value,class:"dss-radial-data-center"},e.toDisplayString(_o.value),9,ms)):e.createCommentVNode("",!0),wn.value?(e.openBlock(),e.createElementBlock("g",{key:3,class:e.normalizeClass(["dss-radial-labels dss-radial-labels-initial",{"dss-radial-labels-animated":ll.value}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Vl.value,(n,c)=>(e.openBlock(),e.createElementBlock("g",{key:`radial-label-${c}`,class:e.normalizeClass(["dss-radial-label-group",{"dss-label-highlighted":n.isHighlighted,"dss-label-dimmed":n.isDimmed}]),style:e.normalizeStyle({"--label-delay":`${c*.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,ps),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,vs),e.createElementVNode("text",{class:"dss-radial-label-text",x:n.textX,y:n.textY,"text-anchor":n.textAnchor,"font-size":nn.value,"dominant-baseline":"middle"},e.toDisplayString(n.text),9,fs)],6))),128))],2)):e.createCommentVNode("",!0)],8,ss)):e.createCommentVNode("",!0),Wn.value?(e.openBlock(),e.createElementBlock("g",{key:3,class:"dss-spider-chart",transform:No.value},[un.value?(e.openBlock(),e.createElementBlock("g",hs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ke.value,(n,c)=>(e.openBlock(),e.createElementBlock("circle",{key:`spider-grid-circle-${c}`,cx:We.value,cy:qe.value,r:n,fill:"none",stroke:"#dedede","stroke-width":"1",style:e.normalizeStyle({animationDelay:`${c*150}ms`})},null,12,ys))),128)),e.createElementVNode("g",ks,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ke.value,(n,c)=>(e.openBlock(),e.createElementBlock("g",{key:`spider-grid-label-group-${c}`},[e.createElementVNode("rect",{x:We.value-16,y:qe.value-n-7,width:"32",height:"16",fill:"#fafafa",stroke:"none"},null,8,Cs),e.createElementVNode("text",{x:We.value,y:qe.value-n+2,"text-anchor":"middle","dominant-baseline":"central",class:"dss-spider-grid-label",style:{fontSize:"10px",fill:"#999",fontWeight:"600"}},e.toDisplayString(pn(c)),9,bs)]))),128))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(N.value,(n,c)=>(e.openBlock(),e.createElementBlock("line",{key:`spider-axis-${c}`,x1:We.value,x2:n.x,y1:qe.value,y2:n.y,stroke:"#dedede","stroke-width":"1",style:e.normalizeStyle({animationDelay:`${c*100}ms`})},null,12,ws))),128))])):e.createCommentVNode("",!0),e.createElementVNode("g",xs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(b.value,(n,c)=>(e.openBlock(),e.createElementBlock("text",{key:`spider-label-${c}`,x:n.x+Math.cos(c*2*Math.PI/y.value-Math.PI/2)*16,y:n.y+Math.sin(c*2*Math.PI/y.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:`${c*120}ms`})},e.toDisplayString(n.text.charAt(0).toUpperCase()+n.text.slice(1)),13,Es))),128))]),e.createElementVNode("g",{class:"dss-spider-data",onMousemove:Ee,onMouseleave:Zt},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(oe.value,(n,c)=>(e.openBlock(),e.createElementBlock("g",{key:`spider-${c}`},[e.createElementVNode("polygon",{points:n.points,fill:n.color,"fill-opacity":I("current",n,c),stroke:n.color,"stroke-width":n.isHighlighted?Ze.value+1:Ze.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:`${c*Ce.value}ms`,transition:"all 0.2s ease"})},null,14,Vs),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.dataPoints,(f,h)=>(e.openBlock(),e.createElementBlock("circle",{key:`spider-point-${c}-${h}`,cx:f.x,cy:f.y,r:n.isHighlighted?Fe.value+1:Fe.value>0?Fe.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:`${c*Ce.value+h*50}ms`,transition:"all 0.2s ease"}),onMouseover:w=>Xe(f,w),onMouseleave:Zt},null,46,Ss))),128))]))),128))],32)],8,gs)):e.createCommentVNode("",!0),e.createElementVNode("g",Ns,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(yt.value,(n,c)=>(e.openBlock(),e.createElementBlock("circle",{key:`logo-fallback-${c}`,cx:n.x,cy:n.y,r:n.width/2,fill:ut(n.seriesIndex),stroke:"#fafafa","stroke-width":"2",class:e.normalizeClass(`logo-fallback-${c}`),style:e.normalizeStyle({animationDelay:`${c*200}ms`})},null,14,Ms))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(yt.value,(n,c)=>(e.openBlock(),e.createElementBlock("image",{key:`logo-${c}`,x:n.x-n.width/2,y:n.y-n.height/2,width:n.width,height:n.height,"xlink:href":n.url,onLoad:f=>Mt(c),onError:f=>kt(c),preserveAspectRatio:"xMidYMid slice",class:e.normalizeClass(`dss-logo-image-${c}`),"clip-path":`circle(${n.width/2}px at ${n.width/2}px ${n.height/2}px)`,style:e.normalizeStyle({animationDelay:`${c*200}ms`})},null,46,Bs))),128))])],8,ra))]),D.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-chart-watermark",style:e.normalizeStyle({position:"absolute",top:"0px",left:"0px",width:pe.value+"px",height:lt.value+"px",backgroundImage:`url('${bt.value}')`,backgroundRepeat:"no-repeat",...xe.value,opacity:_.value,pointerEvents:"none",zIndex:10})},null,4)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList($.value,(n,c)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{key:"marker-"+n.id,class:"dss-chart-marker",style:e.normalizeStyle({position:"absolute",left:n.x+"px",top:n.y+"px",width:vn.value+"px",height:vn.value+"px",backgroundColor:"#fafafa",borderRadius:"50%",border:"2px solid #ddd",cursor:"pointer",zIndex:500}),onClick:e.withModifiers(f=>gl(n),["stop"]),onMouseenter:f=>p(n,f),onMouseleave:v},[e.createElementVNode("img",{src:zn(n),class:"dss-marker-icon",alt:"Marker Icon",style:{width:"100%",height:"100%","object-fit":"contain","border-radius":"50%","pointer-events":"none"}},null,8,$s)],44,Ts)),[[e.vShow,Fn.value]])),128)),wt.value.show?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-marker-tooltip",style:e.normalizeStyle({left:wt.value.x+"px",top:wt.value.y+"px"})},[e.createElementVNode("div",Hs,e.toDisplayString(wt.value.categoryValue),1),wt.value.description?(e.openBlock(),e.createElementBlock("div",Ls,e.toDisplayString(wt.value.description),1)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),Rt.value&&(ae.value.show||vt.value&&ce.value.show&&!m.value.isZooming)?(e.openBlock(),e.createElementBlock("div",{key:3,class:e.normalizeClass(["dss-chart-tooltip",{"dss-crosshair-tooltip":vt.value&&ce.value.show&&!m.value.isZooming}]),style:e.normalizeStyle(Bt.value)},[!vt.value||!ce.value.show||m.value.isZooming?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[Wn.value&&ae.value.spiderSeries&&ae.value.spiderSeries.length>0?(e.openBlock(),e.createElementBlock("div",_s,[ae.value.title?(e.openBlock(),e.createElementBlock("div",As,e.toDisplayString(ae.value.title),1)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ae.value.spiderSeries,(n,c)=>(e.openBlock(),e.createElementBlock("div",{key:`spider-tooltip-${c}`,class:"dss-tooltip-series"},[e.createElementVNode("div",{class:"dss-tooltip-series-indicator",style:e.normalizeStyle({backgroundColor:n.color})},null,4),e.createElementVNode("span",Ds,e.toDisplayString(n.seriesName)+":",1),e.createElementVNode("span",Rs,e.toDisplayString(n.value),1)]))),128))])):dt.value&&ae.value.bubbleData&&ae.value.bubbleData.length>0?(e.openBlock(),e.createElementBlock("div",Is,[ae.value.title?(e.openBlock(),e.createElementBlock("div",Fs,e.toDisplayString(ae.value.title),1)):e.createCommentVNode("",!0),e.createElementVNode("div",zs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ae.value.bubbleData,(n,c)=>(e.openBlock(),e.createElementBlock("div",{key:`bubble-tooltip-${c}`,class:"dss-bubble-tooltip-item"},e.toDisplayString(n.value),1))),128))])])):(e.openBlock(),e.createElementBlock("div",Ps,[e.createElementVNode("div",Os,e.toDisplayString(ae.value.title),1),e.createElementVNode("div",Zs,e.toDisplayString(ae.value.value),1)])),ae.value.categoryIndex!==void 0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[fe(ae.value.categoryIndex).flagGroups.length>0?(e.openBlock(),e.createElementBlock("div",Ws,[s[6]||(s[6]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",qs,e.toDisplayString(e.unref(P)("chart.tooltip.flags")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(fe(ae.value.categoryIndex).flagGroups,(n,c)=>(e.openBlock(),e.createElementBlock("div",{key:`tooltip-flag-group-${c}`},[e.createElementVNode("div",Us,[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,h)=>(e.openBlock(),e.createElementBlock("div",{key:`tooltip-flag-${c}-${h}`,class:"dss-tooltip-item dss-tooltip-item-no-indicator"},[e.createElementVNode("div",Xs,[e.createElementVNode("div",Ys,e.toDisplayString(f.text),1)])]))),128))]))),128))])):e.createCommentVNode("",!0),fe(ae.value.categoryIndex).markers.length>0?(e.openBlock(),e.createElementBlock("div",js,[s[7]||(s[7]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",Ks,e.toDisplayString(e.unref(P)("chart.tooltip.markers")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(fe(ae.value.categoryIndex).markers,(n,c)=>(e.openBlock(),e.createElementBlock("div",{key:`tooltip-marker-${c}`,class:"dss-tooltip-item"},[e.createElementVNode("div",{class:"dss-tooltip-item-indicator",style:e.normalizeStyle({backgroundColor:n.color})},null,4),e.createElementVNode("div",Gs,[e.createElementVNode("div",Qs,e.toDisplayString(n.title),1),n.description?(e.openBlock(),e.createElementBlock("div",Js,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",er,[e.createElementVNode("div",tr,e.toDisplayString(dt.value?u():O.categories[ce.value.categoryIndex]||`Category ${ce.value.categoryIndex+1}`),1),dt.value?(e.openBlock(),e.createElementBlock("div",nr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ce.value.data,(n,c)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-tooltip-${c}`,class:"dss-bubble-tooltip-item"},e.toDisplayString(n.value),1))),128))])):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(ce.value.data,(n,c)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-tooltip-${c}`,class:"dss-tooltip-series"},[e.createElementVNode("div",{class:"dss-tooltip-series-indicator",style:e.normalizeStyle({backgroundColor:n.color})},null,4),e.createElementVNode("span",or,e.toDisplayString(n.seriesName)+":",1),e.createElementVNode("span",lr,e.toDisplayString(Wt(n.value)),1)]))),128))]),fe(ce.value.categoryIndex).flagGroups.length>0?(e.openBlock(),e.createElementBlock("div",ar,[s[8]||(s[8]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",sr,e.toDisplayString(e.unref(P)("chart.tooltip.flags")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(fe(ce.value.categoryIndex).flagGroups,(n,c)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-flag-group-${c}`},[e.createElementVNode("div",rr,[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,h)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-flag-${c}-${h}`,class:"dss-tooltip-item dss-tooltip-item-no-indicator"},[e.createElementVNode("div",ir,[e.createElementVNode("div",cr,e.toDisplayString(f.text),1)])]))),128))]))),128))])):e.createCommentVNode("",!0),fe(ce.value.categoryIndex).markers.length>0?(e.openBlock(),e.createElementBlock("div",dr,[s[9]||(s[9]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",ur,e.toDisplayString(e.unref(P)("chart.tooltip.markers")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(fe(ce.value.categoryIndex).markers,(n,c)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-dss-marker-${c}`,class:"dss-tooltip-item"},[e.createElementVNode("div",{class:"dss-tooltip-item-indicator",style:e.normalizeStyle({backgroundColor:n.color})},null,4),e.createElementVNode("div",mr,[e.createElementVNode("div",pr,e.toDisplayString(n.title),1),n.description?(e.openBlock(),e.createElementBlock("div",vr,e.toDisplayString(n.description),1)):e.createCommentVNode("",!0)])]))),128))])):e.createCommentVNode("",!0)],64))],6)):e.createCommentVNode("",!0),Lt.value&&Vt.value&&m.value.scale>1?(e.openBlock(),e.createElementBlock("div",{key:4,class:"dss-zoom-indicator",onClick:Xo},[s[10]||(s[10]=e.createElementVNode("span",{style:{display:"inline-block",transform:"scaleX(-1)","font-size":"14px"}},"⌕",-1)),e.createTextVNode(" "+e.toDisplayString(Math.round(m.value.scale*100))+"% "+e.toDisplayString(e.unref(P)("chart.zoom.doubleClickToReset")),1)])):e.createCommentVNode("",!0)],46,jl),k.value.show?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-chart-context-menu",style:e.normalizeStyle({left:k.value.x+"px",top:k.value.y+"px"}),onClick:s[0]||(s[0]=e.withModifiers(()=>{},["stop"]))},[et.value.addMarker?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-context-menu-item",onClick:fn},e.toDisplayString(e.unref(P)("chart.contextMenu.addMarker")),1)):e.createCommentVNode("",!0),et.value.addMarker&&(et.value.downloadSvg||et.value.downloadPng||et.value.downloadCsv||In.value.length>0)?(e.openBlock(),e.createElementBlock("div",fr)):e.createCommentVNode("",!0),et.value.downloadSvg?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-context-menu-item",onClick:Pn},e.toDisplayString(e.unref(P)("chart.contextMenu.downloadSvg")),1)):e.createCommentVNode("",!0),et.value.downloadPng?(e.openBlock(),e.createElementBlock("div",{key:3,class:"dss-context-menu-item",onClick:On},e.toDisplayString(e.unref(P)("chart.contextMenu.downloadPng")),1)):e.createCommentVNode("",!0),et.value.downloadCsv?(e.openBlock(),e.createElementBlock("div",{key:4,class:"dss-context-menu-item",onClick:Qn},e.toDisplayString(e.unref(P)("chart.contextMenu.downloadCsv")),1)):e.createCommentVNode("",!0),In.value.length>0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:5},[et.value.downloadSvg||et.value.downloadPng||et.value.downloadCsv?(e.openBlock(),e.createElementBlock("div",gr)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(In.value,(n,c)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"custom-"+c},[n.separator?(e.openBlock(),e.createElementBlock("div",hr)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(cl(n)),style:e.normalizeStyle(qt(n)),onClick:f=>Jn(n)},[n.template?(e.openBlock(),e.createElementBlock("div",{key:0,innerHTML:ln(n),class:"dss-custom-menu-content"},null,8,kr)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[n.icon?(e.openBlock(),e.createElementBlock("span",Cr,e.toDisplayString(n.icon),1)):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(n.label),1)],64))],14,yr)],64))),128))],64)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),x.value.show?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-marker-modal-overlay",onClick:Gn},[e.createElementVNode("div",{class:"dss-marker-modal",onClick:s[4]||(s[4]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",br,[e.createElementVNode("h3",null,e.toDisplayString(be.value?e.unref(P)("chart.modalMarker.viewMarker"):ue.value?e.unref(P)("chart.modalMarker.editMarker"):e.unref(P)("chart.contextMenu.addMarker")),1),e.createElementVNode("button",{class:"dss-modal-close-btn",onClick:Gn},"×")]),e.createElementVNode("div",wr,[e.createElementVNode("div",xr,[x.value.fromButton?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("label",Er,e.toDisplayString(dl(x.value.categoryIndex)||""),1)),x.value.fromButton?(e.openBlock(),e.createElementBlock("div",Vr,[e.withDirectives(e.createElementVNode("select",{id:"dss-marker-category","onUpdate:modelValue":s[1]||(s[1]=n=>x.value.categoryIndex=n),class:"dss-form-select",disabled:be.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(X.value,(n,c)=>(e.openBlock(),e.createElementBlock("option",{key:`category-option-${c}`,value:c},e.toDisplayString(n),9,Nr))),128))],8,Sr),[[e.vModelSelect,x.value.categoryIndex]])])):e.createCommentVNode("",!0)]),e.createElementVNode("div",Mr,[e.createElementVNode("label",Br,e.toDisplayString(e.unref(P)("chart.modalMarker.description")),1),be.value?(e.openBlock(),e.createElementBlock("div",Tr,e.toDisplayString(x.value.description),1)):e.withDirectives((e.openBlock(),e.createElementBlock("textarea",{key:1,id:"dss-marker-description","onUpdate:modelValue":s[2]||(s[2]=n=>x.value.description=n),placeholder:e.unref(P)("chart.modalMarker.placeholderDescription"),class:"dss-form-textarea",rows:"3"},null,8,$r)),[[e.vModelText,x.value.description]])]),e.createElementVNode("div",Hr,[e.createElementVNode("label",null,e.toDisplayString(e.unref(P)("chart.modalMarker.iconPreview")),1),e.createElementVNode("div",Lr,[e.createElementVNode("img",{src:zn({type:x.value.type}),alt:"Marker Icon Preview",class:"preview-icon",style:{width:"32px",height:"32px","border-radius":"50%",border:"2px solid #ddd"},onError:s[3]||(s[3]=n=>n.target.style.display="none")},null,40,_r)])])]),e.createElementVNode("div",Ar,[e.createElementVNode("div",Dr,[ue.value&&!be.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-btn dss-btn-danger",onClick:vl},e.toDisplayString(e.unref(P)("chart.modalMarker.deleteMarker")),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",Rr,[e.createElementVNode("button",{class:"dss-btn dss-btn-secondary",onClick:Gn},e.toDisplayString(be.value?e.unref(P)("chart.modalMarker.close"):e.unref(P)("chart.modalMarker.cancel")),1),be.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-btn dss-btn-primary",onClick:pl,disabled:!(x.value.description&&x.value.description.length)},e.toDisplayString(ue.value?e.unref(P)("chart.modalMarker.save"):e.unref(P)("chart.contextMenu.addMarker")),9,Ir))])])])])):e.createCommentVNode("",!0)],64))}}),Pr={class:"dss-modal-title"},Or={class:"dss-modal-actions"},_l={__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(O,{emit:Ut}){const P=O,R=Ut,Pe=e.ref(null),S=e.ref(null),ye=e.computed(()=>{const A={"max-width":P.width};return P.height!=="auto"&&(A.height=P.height,A["min-height"]="0"),A}),Ge=e.computed(()=>({}));function ct(){R("close-modal")}function g(){P.backDrop&&!Pe.value&&R("close-modal")}function we(A){A.target.tagName==="INPUT"&&(Pe.value=A.target.tagName)}function Me(){setTimeout(()=>{Pe.value=null},300)}function Be(){const A=document.body,Le=document.documentElement;S.value={bodyOverflow:A.style.overflow,bodyPosition:A.style.position,bodyTop:A.style.top,bodyWidth:A.style.width,htmlOverflow:Le.style.overflow,scrollY:window.scrollY},A.style.overflow="hidden",A.style.position="fixed",A.style.top=`-${S.value.scrollY}px`,A.style.width="100%",A.style.left="0",Le.style.overflow="hidden"}function He(){if(!S.value)return;const A=document.body,Le=document.documentElement,{bodyOverflow:Qe,bodyPosition:At,bodyTop:mt,bodyWidth:F,htmlOverflow:Tt,scrollY:Dt}=S.value;A.style.overflow=Qe||"",A.style.position=At||"",A.style.top=mt||"",A.style.width=F||"",A.style.left="",Le.style.overflow=Tt||"",window.scrollTo(0,Dt||0)}return e.watch(()=>P.showModal,A=>{if(A)Be(),document.body.classList.add("dss-modal-open"),setTimeout(()=>{const Le=document.getElementById("dss-modal-backdrop");Le&&(Le.addEventListener("focusin",we),Le.addEventListener("focusout",Me))},100);else{He(),document.body.classList.remove("dss-modal-open");const Le=document.getElementById("dss-modal-backdrop");Le&&(Le.removeEventListener("focusin",we),Le.removeEventListener("focusout",Me))}},{immediate:!0}),e.onUnmounted(()=>{P.showModal&&He()}),(A,Le)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[O.showModal?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-modal-backdrop",onClick:g},[e.withDirectives(e.createElementVNode("div",{id:"dss-modal-backdrop",class:"dss-modal",style:e.normalizeStyle(ye.value)},[e.createElementVNode("div",{class:"dss-modal-content",onClick:Le[0]||(Le[0]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:"dss-modal-header",style:e.normalizeStyle({"justify-content":O.headerType,"font-size":O.titleSize})},[e.createElementVNode("h1",Pr,[e.renderSlot(A.$slots,"title",{},()=>[Le[1]||(Le[1]=e.createTextVNode("Default Title",-1))])]),e.renderSlot(A.$slots,"title-data"),O.showCloseBtn?(e.openBlock(),e.createElementBlock("span",{key:0,class:"dss-modal-close",onClick:ct,title:"Close"},"×")):e.createCommentVNode("",!0)],4),e.createElementVNode("div",{class:"dss-modal-body",style:e.normalizeStyle(Ge.value)},[e.renderSlot(A.$slots,"content",{},()=>[Le[2]||(Le[2]=e.createTextVNode("Default Content",-1))])],4),e.createElementVNode("div",Or,[e.renderSlot(A.$slots,"actions")])])],4),[[e.vShow,O.showModal]])])):e.createCommentVNode("",!0)]))}},Zr={key:0,class:"dss-table-toolbar"},Wr={class:"dss-table-toolbar-left"},qr=["aria-expanded"],Ur={class:"dss-pagination-select-dropdown",role:"listbox"},Xr={class:"dss-table-column-visibility-label"},Yr={class:"dss-table-checkbox-wrapper"},jr=["checked","onChange"],Kr={key:0,class:"dss-table-checkbox__check","aria-hidden":"true"},Gr={class:"dss-table-column-visibility-text"},Qr={class:"dss-table-toolbar-right"},Jr=["placeholder"],ei=["aria-expanded"],ti={key:1,class:"dss-table-toolbar-extra"},ni={class:"dss-table-thead"},oi={key:0,class:"dss-table-th dss-table-selection-column"},li={key:0,class:"dss-table-checkbox-wrapper"},ai=["checked","indeterminate"],si={key:0,class:"dss-table-checkbox__indeterminate"},ri={key:1,class:"dss-table-checkbox__check","aria-hidden":"true"},ii={key:1,class:"dss-table-th dss-table-expansion-column","aria-label":"Expand row"},ci=["onClick"],di={class:"dss-table-th-content"},ui={class:"dss-table-th-text"},mi={key:0},pi={key:1},vi={key:2},fi=["aria-expanded","onClick"],gi={class:"dss-table-tbody"},hi=["onClick"],yi={class:"dss-table-checkbox-wrapper"},ki=["type","name","checked","onChange"],Ci={key:0,class:"dss-table-checkbox__check","aria-hidden":"true"},bi={key:1,class:"dss-table-checkbox__dot"},wi=["onClick"],xi=["aria-expanded","aria-label"],Ei={key:0,class:"dss-table-expansion-row"},Vi=["colspan"],Si=["colspan"],Ni={key:1,class:"dss-table-pagination"},Mi={class:"dss-pagination-center"},Bi={class:"dss-pagination-controls"},Ti=["disabled","title"],$i=["disabled","title"],Hi={class:"dss-pagination-pages"},Li=["onClick"],_i={key:1,class:"dss-pagination-ellipsis"},Ai=["disabled","title"],Di=["disabled","title"],Ri=["aria-expanded"],Ii={class:"dss-pagination-select-dropdown",role:"listbox"},Fi=["aria-selected","onClick"],zi={key:0,class:"dss-table-filter-row"},Pi=["value","placeholder"],Oi=["min","max","value"],Zi=["min","max","value"],Wi={class:"dss-table-filter-double-range-values"},qi={key:2,class:"dss-table-filter-daterange"},Ui={class:"dss-table-filter-daterange-row"},Xi={class:"dss-table-filter-daterange-label"},Yi=["value"],ji={class:"dss-table-filter-daterange-row"},Ki={class:"dss-table-filter-daterange-label"},Gi=["value"],Qi=["value","placeholder"],Ji={class:"dss-table-filter-list"},ec=["checked","onChange"],tc={class:"dss-table-filter-actions"},nc={name:"DSSTable"},oc=Object.assign(nc,{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:O=>typeof O=="object"&&O!==null}},emits:["row-click","row-select","row-unselect","select-all","unselect-all","row-expand","row-collapse","sort","page","download-pdf","download-excel","search"],setup(O,{emit:Ut}){const{t:P,locale:R}=al.useI18n(),Pe=O,S=Ut,ye={table:{width:"auto",height:null,rowHeight:"auto",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 Ge(k,m){const E=Object.assign({},k);return ct(k)&&ct(m)&&Object.keys(m).forEach(x=>{ct(m[x])?x in k?E[x]=Ge(k[x],m[x]):Object.assign(E,{[x]:m[x]}):Object.assign(E,{[x]:m[x]})}),E}function ct(k){return k&&typeof k=="object"&&!Array.isArray(k)}const g=e.computed(()=>Ge(ye,Pe.options)),we=e.computed(()=>{const k=g.value.table.width;return k==="auto"?null:typeof k=="number"?k:null}),Me=e.computed(()=>g.value.table.height),Be=e.computed(()=>g.value.table.rowHeight??"auto"),He=e.computed(()=>({height:Be.value})),A=e.computed(()=>g.value.table.expandable===!0),Le=e.computed(()=>g.value.table.striped),Qe=e.computed(()=>g.value.table.bordered),At=e.computed(()=>g.value.table.hoverable),mt=e.computed(()=>g.value.table.size),F=e.computed(()=>g.value.table.align||"left");e.computed(()=>g.value.title.text),e.computed(()=>g.value.subtitle.text);const Tt=e.computed(()=>g.value.selection.enabled),Dt=e.computed(()=>g.value.selection.mode),pe=e.computed(()=>g.value.sorting.enabled),Xt=e.computed(()=>g.value.sorting.mode),en=e.computed(()=>g.value.pagination.enabled),lt=e.computed(()=>g.value.pagination.rows),ve=e.computed(()=>g.value.pagination.rowsPerPageOptions),Q=e.computed(()=>g.value.scrollable),Rn=e.computed(()=>g.value.emptyMessage),Ue=e.computed(()=>g.value.toolbar?.downloads?.pdf!==!1),$e=e.computed(()=>g.value.toolbar?.downloads?.excel!==!1),xn=e.computed(()=>g.value.toolbar?.search!==!1),tn=e.computed(()=>Ue.value||$e.value||xn.value||Tn.value),Tn=e.computed(()=>g.value.toolbar?.columnVisibility!==!1),Ye=e.ref(""),Ie=e.ref(!1),at=e.ref(null);let Yt=null;function un(){Ie.value?(Yt&&(clearTimeout(Yt),Yt=null),Ie.value=!1,Ye.value="",S("search",""),at.value?.blur()):(Ie.value=!0,Yt=setTimeout(()=>{Yt=null,at.value?.focus()},80))}function pt(){Ye.value||(Ie.value=!1)}function ke(){Ye.value="",S("search",""),at.value?.focus()}const mn=e.computed(()=>({"dss-table-striped":Le.value,"dss-table-bordered":Qe.value,"dss-table-hoverable":At.value,[`dss-table-${mt.value}`]:mt.value!=="default"})),Rt=(k,m)=>k?.field??k?.key??m,vt=e.ref(new Set);function fo(){const k=new Set;Pe.columns.forEach((m,E)=>{m?.hidden!==!0&&k.add(Rt(m,E))}),vt.value=k}const Vt=e.computed(()=>Pe.columns.filter((k,m)=>vt.value.has(Rt(k,m)))),Je=k=>{const m=Pe.columns.findIndex(E=>E===k);return Rt(k,m>=0?m:0)},gn=(k,m)=>vt.value.has(Rt(k,m));function Ze(k,m){const E=Rt(k,m),x=new Set(vt.value);x.has(E)?x.delete(E):x.add(E),vt.value=x}const It=e.ref(null),Fe=e.ref(!1);function jt(k){It.value&&!It.value.contains(k.target)&&(Fe.value=!1)}const de=e.computed(()=>Vt.value.length+(Tt.value?1:0)+(A.value?1:0)),ge=(k,m)=>k?.id??k?.key??m,ze=e.ref(new Set),$t=(k,m)=>ze.value.has(ge(k,m)),Kt=(k,m,E)=>{E&&E.stopPropagation();const x=ge(k,m),X=new Set(ze.value);X.has(x)?(X.delete(x),S("row-collapse",{data:k,index:m})):(X.add(x),S("row-expand",{data:k,index:m})),ze.value=X},ft=e.ref(null),Te=e.ref(0),je=e.ref([]),Ve=k=>{if(Xt.value==="single")return ft.value===k.field?Te.value:0;{const m=je.value.find(E=>E.field===k.field);return m?m.order:0}},Oe=k=>{const m=Ve(k);return{"dss-sort-active":m!==0,"dss-sort-asc":m===1,"dss-sort-desc":m===-1}},st=e.ref({}),Ce=e.ref(null),nt=e.ref(null),Ft=220,_e=e.computed(()=>Vt.value.find(k=>Je(k)===Ce.value)??null),rt=e.computed(()=>{if(!_e.value||_e.value.filter!=="range")return null;const k=_e.value,m=Ce.value,{min:E,max:x}=Fn(k),X=k.filterMin??E,ue=k.filterMax??x,be=Ct(m),zt=be.min??X,En=be.max??ue,Pt=ue-X,Oo=Pt===0?0:(zt-X)/Pt*100,Zo=Pt===0?100:(En-X)/Pt*100;return{rangeMin:X,rangeMax:ue,currentMin:zt,currentMax:En,minPct:Oo,maxPct:Zo}}),Ke=e.ref(null),pn=e.ref("max");function hn(k){const m=Ke.value,E=rt.value;if(!m||!E)return;const x=m.getBoundingClientRect(),ue=(k.clientX-x.left)/x.width*100,be=(E.minPct+E.maxPct)/2;pn.value=ue<be?"min":"max"}function Ct(k){return st.value[k]??{}}function et(k,m){st.value={...st.value,[k]:m}}function In(k){const m=st.value[k];return m?m.type==="string"?!!m.value?.trim():m.type==="range"?m.min!=null||m.max!=null:m.type==="dateRange"?!!(m.from||m.to):m.type==="list"?m.selected?.length>0:!1:!1}function $n(k){const m={...st.value};delete m[k],st.value=m,Ce.value=null,nt.value=null}const Hn=e.computed(()=>{let k=[...Pe.data];return Vt.value.forEach(m=>{const E=Je(m),x=st.value[E];if(!x)return;const X=m.field;if(X){if(x.type==="string"&&x.value?.trim()){const ue=x.value.trim().toLowerCase();k=k.filter(be=>{const zt=Kn(be,m);return String(zt??"").toLowerCase().includes(ue)})}else if(x.type==="range")k=k.filter(ue=>{const be=ae(ue,X),zt=Number(be);return!(Number.isNaN(zt)||x.min!=null&&zt<x.min||x.max!=null&&zt>x.max)});else if(x.type==="dateRange"){const ue=x.from?new Date(x.from).getTime():null,be=x.to?new Date(x.to).getTime():null;k=k.filter(zt=>{const En=ae(zt,X),Pt=En?new Date(En).getTime():NaN;return!(Number.isNaN(Pt)||ue!=null&&Pt<ue||be!=null&&Pt>be)})}else if(x.type==="list"&&x.selected?.length){const ue=new Set(x.selected);k=k.filter(be=>{const zt=Kn(be,m);return ue.has(zt!=null?String(zt):"")})}}}),k});function vn(k){const m=new Set;return Pe.data.forEach(E=>{const x=Kn(E,k);m.add(x!=null?String(x):"")}),Array.from(m).sort((E,x)=>String(E).localeCompare(String(x)))}function St(k,m){if(Ce.value===k){Ce.value=null,nt.value=null;return}if(m?.currentTarget){const E=m.currentTarget.getBoundingClientRect();nt.value={top:E.bottom+6,left:Math.max(8,E.right-Ft)}}Ce.value=k}function Wt(k,m){et(k,{type:"string",value:m})}function Fn(k){const m=k.field;if(!m)return{min:0,max:100};let E=1/0,x=-1/0;return Pe.data.forEach(X=>{const ue=ae(X,m),be=Number(ue);Number.isNaN(be)||(E=Math.min(E,be),x=Math.max(x,be))}),{min:E===1/0?0:E,max:x===-1/0?100:x}}function lo(k,m,E){const x={...Ct(k),type:"range"},X=E===""?null:Number(E),ue=X===null||Number.isNaN(X)?null:X;x[m]=ue,ue!=null&&(m==="min"&&x.max!=null&&ue>x.max&&(x.max=ue),m==="max"&&x.min!=null&&ue<x.min&&(x.min=ue)),et(k,x)}function $(k,m,E){const x={...Ct(k),type:"dateRange"};x[m]=E||"",et(k,x)}const D=e.reactive({});function _(k,m){D[k]=m}function W(k){const m=Je(k),E=(D[m]??"").trim().toLowerCase(),x=vn(k);return E?x.filter(X=>String(X).toLowerCase().includes(E)):x}function ne(k,m){return(Ct(k).selected??[]).includes(m!=null?String(m):"")}function he(k,m){const x=[...Ct(k).selected??[]],X=m!=null?String(m):"",ue=x.indexOf(X);ue>=0?x.splice(ue,1):x.push(X),et(k,{type:"list",selected:x})}function xe(k){Ce.value&&!k.target.closest(".dss-table-filter-wrap")&&!k.target.closest(".dss-table-filter-dropdown")&&(Ce.value=null,nt.value=null)}const ie=k=>{if(!(k.sortable===!1||!pe.value))if(Xt.value==="single")ft.value===k.field?Te.value=Te.value===1?-1:Te.value===-1?0:1:(ft.value=k.field,Te.value=1),Te.value===0&&(ft.value=null),S("sort",{field:ft.value,order:Te.value});else{const m=je.value.findIndex(E=>E.field===k.field);m>=0?je.value[m].order===1?je.value[m].order=-1:je.value.splice(m,1):je.value.push({field:k.field,order:1}),S("sort",{multiSortMeta:je.value})}},fe=e.computed(()=>{if(!pe.value)return Hn.value;let k=[...Hn.value];return Xt.value==="single"&&ft.value&&Te.value!==0?k.sort((m,E)=>{const x=ae(m,ft.value),X=ae(E,ft.value);return x===X?0:x==null?1:X==null?-1:(x<X?-1:x>X?1:0)*Te.value}):Xt.value==="multiple"&&je.value.length>0&&k.sort((m,E)=>{for(const x of je.value){const X=ae(m,x.field),ue=ae(E,x.field);if(X===ue)continue;if(X==null)return 1;if(ue==null)return-1;const be=X<ue?-1:X>ue?1:0;if(be!==0)return be*x.order}return 0}),k}),Se=e.ref(0),bt=e.ref(lt.value),Ht=e.ref(!1),nn=e.ref(null),jn=k=>{bt.value=k,Ht.value=!1,Se.value=0,S("page",{page:0,rows:bt.value})};function go(k){nn.value&&!nn.value.contains(k.target)&&(Ht.value=!1)}const ho=e.computed(()=>fe.value.length),Ln=e.computed(()=>Math.ceil(ho.value/bt.value)),Gt=e.computed(()=>en.value?Se.value*bt.value:0),Lo=e.computed(()=>en.value?Math.min((Se.value+1)*bt.value,ho.value):ho.value),_o=e.computed(()=>{if(!en.value)return fe.value;const k=Gt.value,m=Lo.value;return fe.value.slice(k,m)}),yn=e.ref(new Set),Ao=e.computed(()=>fe.value.filter((k,m)=>yn.value.has(ge(k,m)))),kn=e.computed(()=>{const k=fe.value.length;return k>0&&yn.value.size===k}),Do=e.computed(()=>{const k=fe.value.length,m=yn.value.size;return m>0&&m<k}),ao=(k,m)=>yn.value.has(ge(k,m)),so=()=>{if(kn.value)yn.value=new Set,S("unselect-all");else{const k=new Set;fe.value.forEach((m,E)=>k.add(ge(m,E))),yn.value=k,S("select-all",Ao.value)}},Ro=(k,m)=>{const E=ge(k,m),x=new Set(yn.value),X=x.has(E);Dt.value==="single"?X?(x.delete(E),S("row-unselect",k)):(x.clear(),x.add(E),S("row-select",k)):X?(x.delete(E),S("row-unselect",k)):(x.add(E),S("row-select",k)),yn.value=x},ro=e.computed(()=>{const k=Ln.value,m=Se.value+1,E=2,x=[],X=[];let ue;for(let be=1;be<=k;be++)(be===1||be===k||be>=m-E&&be<=m+E)&&x.push(be);for(const be of x)ue&&(be-ue===2?X.push(ue+1):be-ue!==1&&X.push("...")),X.push(be),ue=be;return X}),io=k=>{k<0||k>=Ln.value||(Se.value=k,S("page",{page:k,rows:bt.value}))},ot=(k,m,E)=>{S("row-click",{data:k,index:m,originalEvent:E})},J=(k,m)=>({"dss-table-row-selected":ao(k,Gt.value+m),"dss-table-row-even":m%2===0,"dss-table-row-odd":m%2!==0}),Kn=(k,m)=>m.field?ae(k,m.field):"",ae=(k,m)=>m.split(".").reduce((E,x)=>E&&E[x],k),wt=k=>{const m=k.align??F.value;return{"dss-table-sortable":k.sortable!==!1&&pe.value,"dss-table-align-left":m==="left","dss-table-align-center":m==="center","dss-table-align-right":m==="right",[k.className]:k.className}},ce=k=>{const m={};return k.width&&(m.width=typeof k.width=="number"?`${k.width}px`:k.width),k.minWidth&&(m.minWidth=typeof k.minWidth=="number"?`${k.minWidth}px`:k.minWidth),k.maxWidth&&(m.maxWidth=typeof k.maxWidth=="number"?`${k.maxWidth}px`:k.maxWidth),m};return e.watch(()=>Pe.locale,k=>{k&&k!==R.value&&(R.value=k)},{immediate:!0}),e.watch(lt,k=>{bt.value=k,Se.value=0}),e.watch(Ye,k=>{S("search",k??"")}),e.watch(()=>Pe.columns,()=>{fo()},{immediate:!0,deep:!0}),e.onMounted(()=>{document.addEventListener("click",go),document.addEventListener("click",jt),document.addEventListener("click",xe)}),e.onUnmounted(()=>{document.removeEventListener("click",go),document.removeEventListener("click",jt),document.removeEventListener("click",xe)}),(k,m)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{class:"dss-table-container",style:e.normalizeStyle({width:we.value+"px",height:Me.value?Me.value+"px":"auto"})},[tn.value?(e.openBlock(),e.createElementBlock("div",Zr,[e.createElementVNode("div",Wr,[Ue.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-table-toolbar-btn",onClick:m[0]||(m[0]=E=>S("download-pdf"))},[m[21]||(m[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(P)("table.downloadPdf")),1)])):e.createCommentVNode("",!0),$e.value?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-table-toolbar-btn",onClick:m[1]||(m[1]=E=>S("download-excel"))},[m[22]||(m[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(P)("table.downloadExcel")),1)])):e.createCommentVNode("",!0),Tn.value?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-table-toolbar-column-visibility",ref_key:"columnVisibilityDropdownRef",ref:It},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-pagination-select-trigger",{"dss-pagination-select-open":Fe.value}]),onClick:m[2]||(m[2]=E=>Fe.value=!Fe.value),"aria-expanded":Fe.value,"aria-haspopup":"listbox"},[e.createTextVNode(e.toDisplayString(e.unref(P)("table.columnVisibility"))+" ",1),m[23]||(m[23]=e.createElementVNode("span",{class:"dss-pagination-select-chevron","aria-hidden":"true"},"▼",-1))],10,qr),e.createVNode(e.Transition,{name:"dss-dropdown"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("ul",Ur,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(O.columns,(E,x)=>(e.openBlock(),e.createElementBlock("li",{key:Rt(E,x),role:"option",class:"dss-table-column-visibility-option",onClick:m[3]||(m[3]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("label",Xr,[e.createElementVNode("span",Yr,[e.createElementVNode("input",{type:"checkbox",checked:gn(E,x),onChange:X=>Ze(E,x),class:"dss-table-checkbox dss-table-checkbox--checkbox"},null,40,jr),gn(E,x)?(e.openBlock(),e.createElementBlock("span",Kr,[...m[24]||(m[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",Gr,e.toDisplayString(E.header),1)])]))),128))],512),[[e.vShow,Fe.value]])]),_:1})],512)):e.createCommentVNode("",!0)]),e.createElementVNode("div",Qr,[xn.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["dss-table-toolbar-search",{"dss-table-toolbar-search--expanded":Ie.value||Ye.value}])},[e.withDirectives(e.createElementVNode("input",{ref_key:"searchInputRef",ref:at,"onUpdate:modelValue":m[4]||(m[4]=E=>Ye.value=E),type:"text",class:"dss-table-toolbar-search-input",placeholder:e.unref(P)("table.searchPlaceholder"),"aria-label":"Search table",onFocus:m[5]||(m[5]=E=>Ie.value=!0),onBlur:pt},null,40,Jr),[[e.vModelText,Ye.value]]),Ye.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-table-toolbar-search-clear","aria-label":"Clear search",onClick:ke},[...m[25]||(m[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":Ie.value||!!Ye.value,onMousedown:e.withModifiers(un,["prevent"])},[...m[26]||(m[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,ei)],2)):e.createCommentVNode("",!0),k.$slots["toolbar-extra"]?(e.openBlock(),e.createElementBlock("div",ti,[e.renderSlot(k.$slots,"toolbar-extra")])):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["dss-table-wrapper",{"dss-table-scrollable":Q.value}])},[e.createElementVNode("table",{class:e.normalizeClass(["dss-table",mn.value])},[e.createElementVNode("thead",ni,[e.createElementVNode("tr",null,[Tt.value?(e.openBlock(),e.createElementBlock("th",oi,[Dt.value==="multiple"?(e.openBlock(),e.createElementBlock("span",li,[e.createElementVNode("input",{type:"checkbox",checked:kn.value,indeterminate:Do.value,onChange:so,class:"dss-table-checkbox dss-table-checkbox--checkbox"},null,40,ai),Do.value?(e.openBlock(),e.createElementBlock("span",si)):kn.value?(e.openBlock(),e.createElementBlock("span",ri,[...m[27]||(m[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),A.value?(e.openBlock(),e.createElementBlock("th",ii)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Vt.value,(E,x)=>(e.openBlock(),e.createElementBlock("th",{key:Je(E),class:e.normalizeClass(["dss-table-th",wt(E)]),style:e.normalizeStyle(ce(E)),onClick:X=>ie(E)},[e.createElementVNode("div",di,[e.createElementVNode("span",ui,e.toDisplayString(E.header),1),E.sortable!==!1&&pe.value?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["dss-table-sort-icon",Oe(E)])},[Ve(E)===0?(e.openBlock(),e.createElementBlock("span",mi,[...m[28]||(m[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)])])):Ve(E)===1?(e.openBlock(),e.createElementBlock("span",pi,[...m[29]||(m[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)])])):Ve(E)===-1?(e.openBlock(),e.createElementBlock("span",vi,[...m[30]||(m[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),E.filter?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["dss-table-filter-wrap",{"dss-table-filter-wrap--open":Ce.value===Je(E)}]),onClick:m[6]||(m[6]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-table-filter-trigger",{"dss-table-filter-trigger--active":In(Je(E))}]),"aria-expanded":Ce.value===Je(E),"aria-label":"Filter column",onClick:X=>St(Je(E),X)},[...m[31]||(m[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,fi)],2)):e.createCommentVNode("",!0)])],14,ci))),128))])]),e.createElementVNode("tbody",gi,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_o.value,(E,x)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:ge(E,Gt.value+x)},[e.createElementVNode("tr",{class:e.normalizeClass(["dss-table-tr",J(E,x)]),style:e.normalizeStyle(He.value),onClick:X=>ot(E,x,X)},[Tt.value?(e.openBlock(),e.createElementBlock("td",{key:0,class:"dss-table-td dss-table-selection-cell",onClick:m[7]||(m[7]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("span",yi,[e.createElementVNode("input",{type:Dt.value==="multiple"?"checkbox":"radio",name:`dss-table-select-${O.tableId}`,checked:ao(E,Gt.value+x),onChange:X=>Ro(E,Gt.value+x),class:e.normalizeClass(["dss-table-checkbox",Dt.value==="multiple"?"dss-table-checkbox--checkbox":"dss-table-checkbox--radio"])},null,42,ki),Dt.value==="multiple"&&ao(E,Gt.value+x)?(e.openBlock(),e.createElementBlock("span",Ci,[...m[32]||(m[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)])])):Dt.value==="single"&&ao(E,Gt.value+x)?(e.openBlock(),e.createElementBlock("span",bi)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),A.value?(e.openBlock(),e.createElementBlock("td",{key:1,class:"dss-table-td dss-table-expansion-cell",onClick:e.withModifiers(X=>Kt(E,Gt.value+x,X),["stop"])},[e.createElementVNode("button",{type:"button",class:"dss-table-expansion-trigger","aria-expanded":$t(E,Gt.value+x),"aria-label":$t(E,Gt.value+x)?"Collapse row":"Expand row"},[e.createElementVNode("span",{class:e.normalizeClass(["dss-table-expansion-icon",{"dss-table-expansion-icon--expanded":$t(E,Gt.value+x)}]),"aria-hidden":"true"},[...m[33]||(m[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,xi)],8,wi)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Vt.value,(X,ue)=>(e.openBlock(),e.createElementBlock("td",{key:Je(X),class:e.normalizeClass(["dss-table-td",wt(X)]),style:e.normalizeStyle(ce(X))},[e.renderSlot(k.$slots,`cell-${X.field}`,{data:E,column:X,rowIndex:x},()=>[e.createTextVNode(e.toDisplayString(Kn(E,X)),1)])],6))),128))],14,hi),A.value&&$t(E,Gt.value+x)?(e.openBlock(),e.createElementBlock("tr",Ei,[e.createElementVNode("td",{colspan:de.value,class:"dss-table-expansion-content-cell"},[e.renderSlot(k.$slots,"expansion",{data:E,rowIndex:x})],8,Vi)])):e.createCommentVNode("",!0)],64))),128)),_o.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("tr",{key:0,class:"dss-table-empty",style:e.normalizeStyle(He.value)},[e.createElementVNode("td",{colspan:de.value,class:"dss-table-empty-cell"},[e.renderSlot(k.$slots,"empty",{},()=>[e.createTextVNode(e.toDisplayString(Rn.value),1)])],8,Si)],4))])],2)],2),en.value?(e.openBlock(),e.createElementBlock("div",Ni,[e.createElementVNode("div",Mi,[e.createElementVNode("div",Bi,[e.createElementVNode("button",{class:"dss-pagination-btn",disabled:Se.value===0,onClick:m[8]||(m[8]=E=>io(0)),title:e.unref(P)("table.firstPage")},[...m[34]||(m[34]=[e.createElementVNode("span",{class:"dss-pagination-double-arrow"},[e.createElementVNode("span",null,"‹"),e.createElementVNode("span",null,"‹")],-1)])],8,Ti),e.createElementVNode("button",{class:"dss-pagination-btn",disabled:Se.value===0,onClick:m[9]||(m[9]=E=>io(Se.value-1)),title:e.unref(P)("table.previousPage")}," ‹ ",8,$i),e.createElementVNode("span",Hi,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ro.value,E=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:E},[E!=="..."?(e.openBlock(),e.createElementBlock("button",{key:0,class:e.normalizeClass(["dss-pagination-page",{"dss-active":E===Se.value+1}]),onClick:x=>io(E-1)},e.toDisplayString(E),11,Li)):(e.openBlock(),e.createElementBlock("span",_i,"..."))],64))),128))]),e.createElementVNode("button",{class:"dss-pagination-btn",disabled:Se.value>=Ln.value-1,onClick:m[10]||(m[10]=E=>io(Se.value+1)),title:e.unref(P)("table.nextPage")}," › ",8,Ai),e.createElementVNode("button",{class:"dss-pagination-btn",disabled:Se.value>=Ln.value-1,onClick:m[11]||(m[11]=E=>io(Ln.value-1)),title:e.unref(P)("table.lastPage")},[...m[35]||(m[35]=[e.createElementVNode("span",{class:"dss-pagination-double-arrow"},[e.createElementVNode("span",null,"›"),e.createElementVNode("span",null,"›")],-1)])],8,Di)]),e.createElementVNode("div",{class:"dss-pagination-rows-per-page",ref_key:"rowsPerPageDropdownRef",ref:nn},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-pagination-select-trigger",{"dss-pagination-select-open":Ht.value}]),onClick:m[12]||(m[12]=E=>Ht.value=!Ht.value),"aria-expanded":Ht.value,"aria-haspopup":"listbox"},[e.createTextVNode(e.toDisplayString(bt.value)+" ",1),m[36]||(m[36]=e.createElementVNode("span",{class:"dss-pagination-select-chevron","aria-hidden":"true"},"▼",-1))],10,Ri),e.createVNode(e.Transition,{name:"dss-dropdown"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("ul",Ii,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ve.value,E=>(e.openBlock(),e.createElementBlock("li",{key:E,role:"option","aria-selected":E===bt.value,class:e.normalizeClass(["dss-pagination-select-option",{"dss-pagination-select-option--selected":E===bt.value}]),onClick:x=>jn(E)},e.toDisplayString(E),11,Fi))),128))],512),[[e.vShow,Ht.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(nt.value?{top:nt.value.top+"px",left:nt.value.left+"px",width:Ft+"px"}:void 0),onClick:m[20]||(m[20]=e.withModifiers(()=>{},["stop"]))},[_e.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[_e.value.filter==="string"?(e.openBlock(),e.createElementBlock("div",zi,[e.createElementVNode("input",{type:"text",value:Ct(Ce.value).value??"",onInput:m[13]||(m[13]=E=>Wt(Ce.value,E.target.value)),class:"dss-table-filter-input",placeholder:e.unref(P)("table.search")||"Search..."},null,40,Pi)])):_e.value.filter==="range"&&rt.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-table-filter-double-range",style:e.normalizeStyle({"--range-min-pct":rt.value.minPct+"%","--range-max-pct":rt.value.maxPct+"%"})},[e.createElementVNode("div",{ref_key:"doubleRangeTrackRef",ref:Ke,class:"dss-table-filter-double-range-track",onMousemove:hn,onMouseenter:hn},[e.createElementVNode("input",{type:"range",min:rt.value.rangeMin,max:rt.value.rangeMax,value:rt.value.currentMin,onInput:m[14]||(m[14]=E=>lo(Ce.value,"min",E.target.value)),class:"dss-table-filter-double-range-input dss-table-filter-double-range-input--min",style:e.normalizeStyle({zIndex:pn.value==="min"?2:1})},null,44,Oi),e.createElementVNode("input",{type:"range",min:rt.value.rangeMin,max:rt.value.rangeMax,value:rt.value.currentMax,onInput:m[15]||(m[15]=E=>lo(Ce.value,"max",E.target.value)),class:"dss-table-filter-double-range-input dss-table-filter-double-range-input--max",style:e.normalizeStyle({zIndex:pn.value==="max"?2:1})},null,44,Zi)],544),e.createElementVNode("div",Wi,e.toDisplayString(rt.value.currentMin)+" – "+e.toDisplayString(rt.value.currentMax),1)],4)):_e.value.filter==="dateRange"?(e.openBlock(),e.createElementBlock("div",qi,[e.createElementVNode("div",Ui,[e.createElementVNode("label",Xi,e.toDisplayString(e.unref(P)("table.filterFrom")||"From:"),1),e.createElementVNode("input",{type:"date",value:Ct(Ce.value).from??"",onInput:m[16]||(m[16]=E=>$(Ce.value,"from",E.target.value)),class:"dss-table-filter-input dss-table-filter-daterange-input"},null,40,Yi)]),e.createElementVNode("div",ji,[e.createElementVNode("label",Ki,e.toDisplayString(e.unref(P)("table.filterTo")||"To:"),1),e.createElementVNode("input",{type:"date",value:Ct(Ce.value).to??"",onInput:m[17]||(m[17]=E=>$(Ce.value,"to",E.target.value)),class:"dss-table-filter-input dss-table-filter-daterange-input"},null,40,Gi)])])):_e.value.filter==="list"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.createElementVNode("input",{type:"text",value:D[Ce.value]??"",onInput:m[18]||(m[18]=E=>_(Ce.value,E.target.value)),class:"dss-table-filter-input dss-table-filter-list-search",placeholder:e.unref(P)("table.search")||"Search..."},null,40,Qi),e.createElementVNode("div",Ji,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(W(_e.value),E=>(e.openBlock(),e.createElementBlock("label",{key:E,class:"dss-table-filter-list-item"},[e.createElementVNode("input",{type:"checkbox",checked:ne(Ce.value,E),onChange:x=>he(Ce.value,E)},null,40,ec),e.createElementVNode("span",null,e.toDisplayString(E),1)]))),128))])],64)):e.createCommentVNode("",!0),e.createElementVNode("div",tc,[e.createElementVNode("button",{type:"button",class:"dss-table-filter-clear",onClick:m[19]||(m[19]=E=>$n(Ce.value))},e.toDisplayString(e.unref(P)("table.clearFilter")||"Clear"),1)])],64)):e.createCommentVNode("",!0)],4),[[e.vShow,Ce.value&&_e.value&&nt.value]])]),_:1})]))],64))}}),lc={class:"dss-toolbar-left"},ac=["title"],sc=["title"],rc={class:"dss-toolbar-dropdown-wrapper"},ic=["title"],cc={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"},dc={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"},uc={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"},mc={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"},pc={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"},vc={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"},fc={key:6,width:"13",height:"14",viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"paragraph-icon"},gc=["title"],hc=["title"],yc=["title"],kc=["title"],Cc=["title"],bc=["title"],wc=["title"],xc=["title"],Ec=["title"],Vc={key:2,class:"dss-toolbar-separator"},Sc=["title"],Nc={key:4,class:"dss-toolbar-separator"},Mc={key:5,class:"dss-toolbar-dropdown-wrapper"},Bc=["title"],Tc={class:"dss-toolbar-dropdown-ai"},$c={class:"dss-toolbar-right"},Hc={key:0,class:"dss-toolbar-custom-group"},Lc={key:1,class:"dss-toolbar-separator"},_c={class:"dss-link-modal-content"},Ac={class:"dss-link-modal-field"},Dc={class:"dss-link-modal-label"},Rc=["placeholder"],Ic={class:"dss-link-modal-field"},Fc={class:"dss-link-modal-label"},zc=["placeholder"],Pc={class:"dss-image-modal-tabs"},Oc={key:0,class:"dss-image-tab-content"},Zc={class:"dss-link-modal-content"},Wc={class:"dss-link-modal-field"},qc={key:0,class:"dss-link-modal-label"},Uc=["src"],Xc={class:"dss-link-modal-field"},Yc={class:"dss-link-modal-label"},jc=["placeholder"],Kc={class:"dss-link-modal-field"},Gc={class:"dss-link-modal-label"},Qc=["placeholder"],Jc={class:"dss-link-modal-field"},ed={class:"dss-link-modal-label"},td=["placeholder"],nd={key:1,class:"dss-image-tab-content"},od={class:"dss-link-modal-content"},ld={class:"dss-link-modal-field"},ad={class:"dss-link-modal-label"},sd=["placeholder"],rd={class:"dss-link-modal-field"},id={class:"dss-link-modal-label"},cd=["placeholder"],dd={class:"dss-link-modal-field"},ud={class:"dss-link-modal-label"},md=["placeholder"],pd={class:"dss-link-modal-field"},vd={class:"dss-link-modal-label"},fd=["placeholder"],gd={class:"dss-text-editor-title-input-container"},hd={key:0,class:"dss-text-editor-title-preview"},yd={key:0},kd={key:1,class:"dss-text-editor-preview-placeholder"},Cd=["value","placeholder","disabled"],bd={key:2,class:"dss-text-editor-title-slot dss-text-editor-slot-last"},wd={class:"dss-text-editor-description-input-container"},xd={key:0,class:"dss-text-editor-description-preview"},Ed={key:0},Vd={key:1,class:"dss-text-editor-preview-placeholder"},Sd=["value","placeholder","disabled"],Nd={key:3,class:"dss-text-editor-description-slot dss-text-editor-slot-last"},Md=["data-comment-id","onMouseenter"],Bd=["onClick"],Td=["src","alt"],$d={key:1},Hd=["onClick"],Ld=["src","alt"],_d={key:1},Ad=["data-has-second-user","onClick"],Dd={class:"editor-comment-marker-count"},Rd={key:4,class:"dss-text-editor-textarea-wrapper"},Id=["value","placeholder","rows","disabled"],Fd={class:"dss-text-editor-footer"},zd={class:"dss-text-editor-footer-content"},Pd={class:"dss-text-editor-footer-stat"},Od={class:"dss-text-editor-footer-stat"},Zd={key:5,class:"dss-text-editor-content-wrapper"},Wd={key:0,class:"dss-comment-overlay-body"},qd={class:"dss-comment-selection-wrapper"},Ud=["innerHTML"],Xd={class:"dss-comment-messages-wrapper"},Yd={key:0,class:"dss-comment-avatar-wrapper"},jd={class:"dss-comment-avatar"},Kd=["src","alt"],Gd={key:1},Qd={class:"dss-comment-header"},Jd={class:"dss-comment-header-text"},eu={class:"dss-comment-author"},tu={key:0,class:"dss-comment-date"},nu=["onClick","title"],ou={class:"dss-comment-overlay-inner"},lu=["placeholder","onKeydown"],au={class:"dss-text-editor-footer"},su={class:"dss-text-editor-footer-content"},ru={class:"dss-text-editor-footer-stat"},iu={class:"dss-text-editor-footer-stat"},cu=["title"],du=["title"],uu={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:""},mu={class:"dss-image-popup-content"},pu={key:0,class:"dss-image-popup-no-alt-icon"},vu=["title"],fu=["title"],gu={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:""},hu={class:"dss-toolbar-left"},yu=["title"],ku=["title"],Cu={class:"dss-toolbar-dropdown-wrapper"},bu=["title"],wu={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"},xu={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"},Vu={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"},Su={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"},Nu={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"},Mu={key:6,width:"13",height:"14",viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"paragraph-icon"},Bu=["title"],Tu=["title"],$u=["title"],Hu=["title"],Lu=["title"],_u=["title"],Au=["title"],Du=["title"],Ru=["title"],Iu=["title"],Fu={key:2,class:"dss-toolbar-separator"},zu={key:3,class:"dss-toolbar-dropdown-wrapper"},Pu=["title"],Ou={class:"dss-toolbar-dropdown-ai"},Zu={key:0,class:"dss-toolbar-right"},Wu={key:0,class:"dss-toolbar-separator"},qu={key:0,class:"dss-toolbar-custom-group"},Uu={key:1,class:"dss-toolbar-separator"},Xu={name:"DSSTextEditor"},Yu=Object.assign(Xu,{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:O=>typeof O=="object"&&O!==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:O=>typeof O=="object"&&O!==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(O,{expose:Ut,emit:P}){const{t:R,locale:Pe}=al.useI18n(),S=O,ye=P,Ge=e.useSlots(),ct=`<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
76
76
  <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"/>
77
- </svg>`,f=e.ref(null),ke=e.ref(null),He=e.ref(!1),$e=e.ref(!1),Le=e.ref(!1),L=e.ref(""),_e=e.ref({}),Ge=e.ref(!1),_t=e.ref(!1),kt=e.ref(""),P=e.ref(""),Ht=e.ref(null),Xt=e.ref(null),pe=e.ref(null),tn=e.ref(null),Qe=e.ref(""),ye=e.ref(!1),ue=e.ref({}),Ce=e.ref(!1),Nt=e.ref({}),Yt=e.ref(null),it=e.ref(null),xn=e.ref(!1),jt=e.ref(""),kn=e.ref(null),tt=e.ref(""),Fe=e.ref(""),ct=e.ref(""),dt=e.ref(null),Xe=e.ref(null),En=e.ref(null),ze=e.ref(null),$t=e.ref(null),Kt=e.ref(!1),Bt=e.ref(""),fo=e.ref({}),nn=e.ref(!1),Ne=e.ref("upload"),pn=e.ref(""),Ye=e.ref(null),At=e.ref(null),nt=e.ref([]),on=e.ref([]),ae=e.ref(null),me=e.ref(!1),ot=e.ref(""),Gt=e.ref(""),Ct=e.ref(""),ft=e.ref(""),Pe=e.ref(""),je=e.ref(""),Te=e.ref(null),Se=e.ref(null),bt=e.ref(null),Ae=e.ref(!1),We=e.ref(null),Dt=e.ref(!1),De=e.ref(!1),ut=e.ref(null),lt=e.ref("p"),vn=e.ref(!1),mt=e.ref([]),gt=e.ref(null),Qt=e.ref(null),Mn=e.ref(null),Jt=e.ref(!1),Ln=e.ref(0),ln=100,Rt=e.ref(null),_n=e.computed(()=>({"dss-text-editor-no-border":!E.border,"dss-text-editor-rounded":E.rounded,"dss-text-editor-full-height":E.fullHeight,"dss-comment-overlay-open":Wt.value!==null})),An=e.computed(()=>({})),Dn=e.computed(()=>!E.fixedHeight||E.fullHeight?{}:{height:`${1.6*14*E.rows+24+2}px`,resize:"none",overflowY:"auto"}),M=e.computed(()=>!E.fixedHeight||E.fullHeight?{}:{height:`${1.6*14*E.rows+32}px`,overflowY:"auto"}),D=e.computed(()=>E.richText&&on.value.length>0),T=e.computed(()=>{if(!E.modelValue)return"";if(E.richText){let l=E.modelValue.replace(/<script[^>]*>[\s\S]*?<\/script>/gi,"");return l=l.replace(/<style[^>]*>[\s\S]*?<\/style>/gi,""),l=l.replace(/<[^>]+>/g,""),l=l.replace(/&nbsp;/g," "),l=l.replace(/&amp;/g,"&"),l=l.replace(/&lt;/g,"<"),l=l.replace(/&gt;/g,">"),l=l.replace(/&quot;/g,'"'),l=l.replace(/&#39;/g,"'"),l=l.replace(/\s+/g," ").trim(),l}return E.modelValue}),W=e.computed(()=>{const l=T.value.trim();return l?l.split(/\s+/).filter(n=>n.length>0).length:0}),te=e.computed(()=>T.value.length),be=e.computed(()=>ze.value!==null&&Ne.value==="upload"&&tt.value&&tt.value.startsWith("data:")),ie=e.computed(()=>E.titlePlaceholder||R("textEditor.placeholders.title")),ce=e.computed(()=>E.descriptionPlaceholder||R("textEditor.placeholders.description")),we=e.computed(()=>E.placeholder||R("textEditor.placeholders.startTyping")),Me=l=>Ke&&Ke[l]!==void 0,Tt=l=>{for(let n=l+1;n<E.customToolbarSlots.length;n++)if(Me(E.customToolbarSlots[n]))return!0;return!1},Pt=l=>{for(let n=l+1;n<E.customToolbarSlots.length;n++){const a=E.customToolbarSlots[n];if(Me(a)&&an(a))return!0}return!1},an=l=>E.customToolbarFloatingMap.hasOwnProperty(l)?E.customToolbarFloatingMap[l]===!0:!0,so=e.computed(()=>E.customToolbarSlots.some(l=>Me(l)&&an(l))),go=e.computed(()=>Me("title-slot")),ho=e.computed(()=>Me("description-slot")),Bn=l=>{if(!l||l.trim()==="")return"<html></html>";const n=l.trim();return n.startsWith("<html>")&&n.endsWith("</html>")?l:`<html>${l}</html>`},en=l=>{if(!l||l.trim()==="")return"";const n=l.replace(/<!--[\s\S]*?-->/g,""),a=n.trim();return a.startsWith("<html>")&&a.endsWith("</html>")?a.slice(6,-7).trim():n},To=l=>{if(!l)return;const n=document.createTreeWalker(l,NodeFilter.SHOW_COMMENT,null,!1),a=[];let r=n.nextNode();for(;r;)a.push(r),r=n.nextNode();a.forEach(i=>i.remove())},Vo=l=>{try{const n=String(l.getDate()).padStart(2,"0"),r=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][l.getMonth()],i=l.getFullYear();return`${n} ${r} ${i}`}catch{return""}},Vn=l=>{if(!l||typeof l!="string")return!1;const n=l.trim();if(!n)return!1;if(["Started conversation","A démarré la conversation","started_conversation","conv_started"].includes(n))return!0;try{const i=R("textEditor.started_conversation");if(i&&n===i)return!0}catch{}const r=n.toLowerCase();return r.includes("started conversation")||r.includes("démarré la conversation")||r==="started conversation"||r==="a démarré la conversation"},Io=l=>{const n=l.target.value;he("update:modelValue",n),he("change",n)},fn=()=>{if(!Te.value)return;const l=Te.value;if(l.style.setProperty("text-overflow","","important"),l.style.setProperty("white-space","","important"),l.style.setProperty("overflow-x","","important"),l.style.setProperty("height","auto","important"),l.value.trim()===""){const r=l.value;l.value="M";const i=l.scrollHeight;l.value=r,l.style.setProperty("height",`${i}px`,"important"),l.style.setProperty("overflow-y","hidden","important");return}l.offsetHeight;const a=l.scrollHeight;l.style.setProperty("height",`${a}px`,"important"),l.style.setProperty("overflow-y","hidden","important")},yo=()=>{Dt.value=!0,fn()},ro=()=>{Dt.value=!1,ko()},ko=()=>{if(!Te.value)return;const l=Te.value;l.style.setProperty("text-overflow","","important"),l.style.setProperty("white-space","","important"),l.style.setProperty("overflow-x","","important"),l.style.setProperty("height","auto","important");const n=l.value;l.value="M";const a=l.scrollHeight;l.value=n,l.offsetHeight,l.style.setProperty("height",`${a}px`,"important"),l.style.setProperty("overflow-y","hidden","important"),l.style.setProperty("overflow-x","hidden","important"),l.style.setProperty("text-overflow","ellipsis","important"),l.style.setProperty("white-space","nowrap","important")},Fo=l=>{const a=l.target.value;Dt.value&&fn(),he("update:title",a),he("title-change",a),bt.value="title",E.richText&&(me.value||(Gt.value=ot.value,Pe.value=Ct.value,je.value=ft.value),ae.value&&clearTimeout(ae.value),me.value=!0,ae.value=setTimeout(()=>{me.value=!1,k()},500))},Ue=()=>{if(!Se.value)return;const l=Se.value;if(l.style.setProperty("text-overflow","","important"),l.style.setProperty("white-space","","important"),l.style.setProperty("overflow-x","","important"),l.style.setProperty("height","auto","important"),l.value.trim()===""){const r=l.value;l.value="M";const i=l.scrollHeight;l.value=r,l.style.setProperty("height",`${i}px`,"important"),l.style.setProperty("overflow-y","hidden","important");return}l.offsetHeight;const a=l.scrollHeight;l.style.setProperty("height",`${a}px`,"important"),l.style.setProperty("overflow-y","hidden","important")},K=()=>{De.value=!0,Ue()},No=()=>{De.value=!1,xe()},xe=()=>{if(!Se.value)return;const l=Se.value;l.style.setProperty("text-overflow","","important"),l.style.setProperty("white-space","","important"),l.style.setProperty("overflow-x","","important"),l.style.setProperty("height","auto","important");const n=l.value;l.value="M";const a=l.scrollHeight;l.value=n,l.offsetHeight,l.style.setProperty("height",`${a}px`,"important"),l.style.setProperty("overflow-y","hidden","important"),l.style.setProperty("overflow-x","hidden","important"),l.style.setProperty("text-overflow","ellipsis","important"),l.style.setProperty("white-space","nowrap","important")},gn=l=>{const a=l.target.value;De.value&&Ue(),he("update:description",a),he("description-change",a),bt.value="description",E.richText&&(me.value||(Gt.value=ot.value,Pe.value=Ct.value,je.value=ft.value),ae.value&&clearTimeout(ae.value),me.value=!0,ae.value=setTimeout(()=>{me.value=!1,k()},500))},G=()=>{const l=window.getSelection();if(l.rangeCount===0)return null;const n=l.getRangeAt(0);if(n.startContainer.nodeType===1)return{type:"element",element:n.startContainer,offset:n.startOffset};const a=n.cloneRange();return a.selectNodeContents(f.value),a.setEnd(n.startContainer,n.startOffset),{type:"text",start:a.toString().length,end:a.toString().length+n.toString().length}},ve=l=>{if(!(!l||!f.value))try{const n=window.getSelection(),a=document.createRange();if(l.type==="element"&&l.element)if(f.value.contains(l.element)){a.setStart(l.element,l.offset),a.collapse(!0),n.removeAllRanges(),n.addRange(a);return}else{f.value.focus();return}let r=0;const i=[f.value];let u=null,d=!1,m=!1;for(;!m&&(u=i.pop());)if(u.nodeType===3){const v=r+u.length;!d&&l.start>=r&&l.start<=v&&(a.setStart(u,l.start-r),d=!0),d&&l.end>=r&&l.end<=v&&(a.setEnd(u,l.end-r),m=!0),r=v}else{let v=u.childNodes.length;for(;v--;)i.push(u.childNodes[v])}n.removeAllRanges(),n.addRange(a)}catch{f.value.focus()}},z=()=>{if(!f.value)return;f.value.focus();const l=window.getSelection(),n=document.createRange(),a=i=>{if(i.nodeType===3||i.childNodes.length===0)return i;for(let u=i.childNodes.length-1;u>=0;u--){const d=i.childNodes[u],m=a(d);if(m)return m}return i},r=a(f.value);if(r.nodeType===3)n.setStart(r,r.length),n.setEnd(r,r.length);else if(r.childNodes.length>0){const i=a(r);i&&i.nodeType===3?(n.setStart(i,i.length),n.setEnd(i,i.length)):(n.selectNodeContents(r),n.collapse(!1))}else n.setStart(r,0),n.setEnd(r,0);l.removeAllRanges(),l.addRange(n)},k=(l=!1)=>{if(!f.value)return;const n=f.value.innerHTML,a=E.title||"",r=E.description||"";if(!l&&n===ot.value&&a===Ct.value&&r===ft.value)return;const i={content:Gt.value||ot.value,title:Pe.value!==void 0?Pe.value:Ct.value,description:je.value!==void 0?je.value:ft.value},u=nt.value.length>0?nt.value[nt.value.length-1]:null;let d=!0;u&&(typeof u=="string"?d=i.content!==u:d=i.content!==u.content||i.title!==u.title||i.description!==u.description),d&&(nt.value.push(i),nt.value.length>50&&nt.value.shift(),on.value=[]),ot.value=n,Ct.value=a,ft.value=r,Gt.value=n,Pe.value=a,je.value=r},p=l=>{if(!f.value)return;V(),f.value&&To(f.value);let n=null;f.value&&(f.value.querySelector("p")||(n=G(),$()));const a=l&&l.inputType&&(l.inputType==="insertText"||l.inputType==="insertCompositionText"||l.inputType==="deleteContentBackward"||l.inputType==="deleteContentForward");a&&ut.value&&(ut.value=null),$e.value=!0;const r=f.value.innerHTML.replace(/<!--[\s\S]*?-->/g,"").replace(/&nbsp;|\u00A0/g," "),i=Bn(r);he("update:modelValue",i),he("change",i),bt.value="editor",me.value||(Gt.value=ot.value,Pe.value=Ct.value,je.value=ft.value),ae.value&&clearTimeout(ae.value),me.value=!0,ae.value=setTimeout(()=>{me.value=!1,k(),jo(),hl()},500),e.nextTick(()=>{n&&ve(n),V();const u=["bold","italic","underline"],d=window.getSelection(),m=d.rangeCount>0?d.getRangeAt(0):null,v=m&&m.collapsed;if(u.forEach(y=>{try{if(v&&ut.value?.command===y){ue.value[y]=ut.value.state;return}if(y==="bold")if(m){const x=m.commonAncestorContainer,N=x.nodeType===3?x.parentElement:x;let b=!1;if(N&&((N.tagName==="STRONG"||N.tagName==="B"||N.closest&&N.closest("strong, b"))&&(b=!0),!b&&N.style&&parseInt(N.style.fontWeight)>=600&&(b=!0),!b))try{const F=window.getComputedStyle(N);parseInt(F.fontWeight)>=600&&(b=!0)}catch{}ue.value[y]=b}else ue.value.hasOwnProperty(y)||(ue.value[y]=!1);else if(y==="italic")if(m){const x=m.commonAncestorContainer,N=x.nodeType===3?x.parentElement:x,b=N&&(N.tagName==="EM"||N.tagName==="I"||N.closest&&N.closest("em, i"));ue.value[y]=!!b}else{const x=document.queryCommandState(y);ue.value[y]=x}else{const x=document.queryCommandState(y);ue.value[y]=x}}catch{}}),Zt(),U(),It(),xt(),On(),Sn("handleRichTextInput"),a&&(l.inputType==="insertText"||l.inputType==="insertCompositionText")){const y=l.data||"";y&&y.length===1&&setTimeout(()=>hl(y),0),(y===" "||y===`
78
- `||/[.,;:!?]/.test(y))&&setTimeout(()=>{jo()},100)}$e.value=!1})},V=()=>{if(!f.value)return;const l=window.getSelection();if(!l||l.rangeCount===0)return;const n=l.getRangeAt(0),a=n.commonAncestorContainer,r=a.nodeType===3?a.parentElement:a;if(!r)return;const i=r.closest(".dss-image-wrapper");if(i){const u=i.querySelector("img");if(r!==u&&!u?.contains(r)){const d=n.startContainer.nodeType===3?n.startContainer.parentElement:n.startContainer,m=n.endContainer.nodeType===3?n.endContainer.parentElement:n.endContainer;if(i.contains(d)&&d!==u||i.contains(m)&&m!==u){const v=document.createRange();v.setStartAfter(i),v.collapse(!0),l.removeAllRanges(),l.addRange(v)}}}},$=()=>{if(!f.value)return;const l=f.value;if(l.querySelector&&l.querySelector("p"))return;const n=new Set(["P","H1","H2","H3","H4","H5","H6","BLOCKQUOTE","UL","OL","DIV"]),a=Array.from(l.childNodes);let r=null;a.forEach(i=>{if(i.nodeType===Node.TEXT_NODE){if((i.textContent||"").trim()===""){i.parentNode===l&&l.removeChild(i);return}r||(r=document.createElement("p"),l.insertBefore(r,i)),r.appendChild(i);return}if(i.nodeType===Node.ELEMENT_NODE){const u=i,d=u.tagName;if(d==="BR"){r=null;return}if(n.has(d)){r=null;return}r||(r=document.createElement("p"),l.insertBefore(r,u)),r.appendChild(u)}})},U=()=>{if(f.value&&!Ae.value){Ae.value=!0;try{f.value.querySelectorAll(".dss-image-wrapper").forEach(r=>{r.querySelector("img")||r.remove()}),f.value.querySelectorAll(".dss-image-no-alt-icon").forEach(r=>{const i=r.parentElement;!i||!i.classList.contains("dss-image-wrapper")?r.remove():i.querySelector("img")||r.remove()}),f.value.querySelectorAll("img").forEach(r=>{let i=r.getAttribute("alt");i===null&&(i=r.alt||"");const u=r.getAttribute("src")||r.src||"";if(i){const y=u.replace(/^https?:\/\//,"").replace(/^data:.*,/,""),x=i===u||i===y;(i.startsWith("http://")||i.startsWith("https://")||i.startsWith("data:")||x||x)&&(i="")}r.setAttribute("alt",i),r.setAttribute("data-alt",i);const d=!i||i.trim()==="";let m=r.parentElement;const v=m&&m.classList.contains("dss-image-wrapper");if(v){const y=m.querySelector(".dss-image-no-alt-icon");y&&y.remove()}else{const y=r.nextElementSibling?.classList.contains("dss-image-no-alt-icon")?r.nextElementSibling:null;y&&y.remove()}if(d){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 y=document.createElement("div");y.className="dss-image-no-alt-icon",y.setAttribute("contenteditable","false"),y.innerHTML=vt,m.appendChild(y)}else if(v&&m.children.length===1){const y=m.parentNode;y.insertBefore(r,m),y.removeChild(m)}})}finally{Ae.value=!1}}},fe=l=>{jo(),he("blur",l),hn()},Be=()=>{if(E.disabled||!E.richText||!f.value)return;Ft(),ae.value&&(clearTimeout(ae.value),ae.value=null),me.value&&(k(),me.value=!1);const l=bt.value==="title",n=bt.value==="description",a=bt.value==="editor";if(nt.value.length===0){l&&Te.value?Te.value.focus():n&&Se.value?Se.value.focus():f.value.focus(),document.execCommand("undo",!1),e.nextTick(()=>{p()});return}const r={content:f.value.innerHTML,title:E.title||"",description:E.description||""};on.value.push(r);const i=nt.value.pop();if(i!==void 0){$e.value=!0;const u=typeof i=="string"?i:i.content,d=typeof i=="object"&&i.title||"",m=typeof i=="object"&&i.description||"";f.value.innerHTML=u,ot.value=u,Ct.value=d,ft.value=m,Gt.value=u,Pe.value=d,je.value=m,e.nextTick(()=>{Zt(),St(),un(),xt();const v=Bn(u);he("update:modelValue",v),he("update:title",d),he("update:description",m),he("change",v),he("title-change",d),he("description-change",m),$e.value=!1,e.nextTick(()=>{setTimeout(()=>{if(l){if(Te.value){Te.value.focus();const y=d.length;Te.value.setSelectionRange&&Te.value.setSelectionRange(y,y),fn()}}else if(n){if(Se.value){Se.value.focus();const y=m.length;Se.value.setSelectionRange(y,y)}}else if(a)z();else if(Te.value&&document.activeElement===Te.value){const y=d.length;Te.value.setSelectionRange&&Te.value.setSelectionRange(y,y),fn()}else if(Se.value&&document.activeElement===Se.value){const y=m.length;Se.value.setSelectionRange(y,y)}else f.value&&z()},10)})})}},Ot=()=>{if(E.disabled||!E.richText||!f.value)return;Ft();const l=bt.value==="title",n=bt.value==="description",a=bt.value==="editor";if(on.value.length===0){l&&Te.value?Te.value.focus():n&&Se.value?Se.value.focus():f.value.focus(),document.execCommand("redo",!1),e.nextTick(()=>{p()});return}const r={content:f.value.innerHTML,title:E.title||"",description:E.description||""};nt.value.push(r);const i=on.value.pop();if(i!==void 0){$e.value=!0;const u=typeof i=="string"?i:i.content,d=typeof i=="object"&&i.title||"",m=typeof i=="object"&&i.description||"";f.value.innerHTML=u,ot.value=u,Ct.value=d,ft.value=m,Gt.value=u,Pe.value=d,je.value=m,e.nextTick(()=>{Zt(),St(),un(),xt();const v=Bn(u);he("update:modelValue",v),he("update:title",d),he("update:description",m),he("change",v),he("title-change",d),he("description-change",m),$e.value=!1,e.nextTick(()=>{setTimeout(()=>{if(l){if(Te.value){Te.value.focus();const y=d.length;Te.value.setSelectionRange&&Te.value.setSelectionRange(y,y),fn()}}else if(n){if(Se.value){Se.value.focus();const y=m.length;Se.value.setSelectionRange(y,y)}}else if(a)z();else if(Te.value&&document.activeElement===Te.value){const y=d.length;Te.value.setSelectionRange&&Te.value.setSelectionRange(y,y),fn()}else if(Se.value&&document.activeElement===Se.value){const y=m.length;Se.value.setSelectionRange(y,y)}else f.value&&z()},10)})})}},Tn=()=>{if(!f.value)return;f.value.querySelectorAll('span[style*="font-weight"]').forEach(r=>{const i=r.style.fontWeight;if(i==="normal"||i==="400"){const u=document.createDocumentFragment();for(;r.firstChild;)u.appendChild(r.firstChild);r.parentNode&&r.parentNode.replaceChild(u,r)}}),f.value.querySelectorAll('span[style*="font-weight"]').forEach(r=>{if(parseInt(r.style.fontWeight)>=600){const u=document.createElement("b");for(u.style.fontWeight="600";r.firstChild;)u.appendChild(r.firstChild);r.parentNode&&r.parentNode.replaceChild(u,r)}}),f.value.querySelectorAll("b, strong").forEach(r=>{r.style.fontWeight="600"})},It=()=>{if(!f.value)return;f.value.querySelectorAll("i, em").forEach(n=>{n.style.fontStyle="italic"})},Rn=()=>{const l=window.getSelection();if(!l||l.rangeCount===0)return!1;const n=l.getRangeAt(0);let a=!1;if(n.collapsed){const r=n.startContainer;let i=r.nodeType===3?r.parentElement:r;for(;i&&i!==f.value;){if(i.tagName==="EM"||i.tagName==="I"){a=!0;break}if(i.style&&i.style.fontStyle==="italic"){a=!0;break}i=i.parentElement}}else{const r=n.commonAncestorContainer.nodeType===1?n.commonAncestorContainer:n.commonAncestorContainer.parentNode;if(r){const i=document.createTreeWalker(r,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let u;for(;u=i.nextNode();)if(!(typeof n.intersectsNode=="function"&&!n.intersectsNode(u))){if(u.nodeType===3){let d=u.parentElement;for(;d&&d!==f.value;){if(d.tagName==="EM"||d.tagName==="I"){a=!0;break}if(d.style&&d.style.fontStyle==="italic"){a=!0;break}d=d.parentElement}}else if(u.nodeType===1){const d=u;if(d.tagName==="EM"||d.tagName==="I"){a=!0;break}if(d.style&&d.style.fontStyle==="italic"){a=!0;break}}if(a)break}}}if(a)return document.execCommand("italic",!1),e.nextTick(()=>{It()}),!1;if(n.collapsed)document.execCommand("italic",!1),e.nextTick(()=>{It()});else try{const r=n.extractContents(),i=document.createElement("em");i.style.fontStyle="italic",i.appendChild(r),n.insertNode(i),n.setStartAfter(i),n.collapse(!0),l.removeAllRanges(),l.addRange(n),e.nextTick(()=>{It()})}catch{document.execCommand("italic",!1),e.nextTick(()=>{It()})}return!0},zo=()=>{const l=window.getSelection();if(!l||l.rangeCount===0)return!1;const n=l.getRangeAt(0);let a=!1;if(n.collapsed){const r=n.startContainer;let i=r.nodeType===3?r.parentElement:r;for(;i&&i!==f.value;){if(i.tagName==="STRONG"||i.tagName==="B"){a=!0;break}if(i.style&&parseInt(i.style.fontWeight)>=600){a=!0;break}i=i.parentElement}}else{const r=n.commonAncestorContainer.nodeType===1?n.commonAncestorContainer:n.commonAncestorContainer.parentNode;if(r){const i=document.createTreeWalker(r,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let u;for(;u=i.nextNode();)if(!(typeof n.intersectsNode=="function"&&!n.intersectsNode(u))){if(u.nodeType===3){let d=u.parentElement;for(;d&&d!==f.value;){if(d.tagName==="STRONG"||d.tagName==="B"){a=!0;break}if(d.style&&parseInt(d.style.fontWeight)>=600){a=!0;break}d=d.parentElement}}else if(u.nodeType===1){const d=u;if(d.tagName==="STRONG"||d.tagName==="B"){a=!0;break}if(d.style&&parseInt(d.style.fontWeight)>=600){a=!0;break}}if(a)break}}}if(a)return document.execCommand("bold",!1),e.nextTick(()=>{Tn()}),!1;if(n.collapsed)document.execCommand("bold",!1),e.nextTick(()=>{const r=window.getSelection();if(r.rangeCount>0){const i=r.getRangeAt(0),u=i.startContainer;let d=u.nodeType===3?u.parentElement:u;for(;d&&d!==f.value;){if(d.tagName==="SPAN"&&d.style.fontWeight){const m=d.style.fontWeight;if(m==="normal"||m==="400"){const v=document.createElement("b");v.style.fontWeight="600";const y=document.createDocumentFragment();for(;d.firstChild;)y.appendChild(d.firstChild);v.appendChild(y),d.parentNode&&d.parentNode.replaceChild(v,d),i.setStart(v,0),i.collapse(!0),r.removeAllRanges(),r.addRange(i);break}}else if(d.tagName==="STRONG"||d.tagName==="B"){d.style.fontWeight="600";break}d=d.parentElement}if(!d||d===f.value){const m=document.createElement("b");m.style.fontWeight="600",m.innerHTML="<br>",i.insertNode(m),i.setStart(m,0),i.collapse(!0),r.removeAllRanges(),r.addRange(i)}}Tn()});else try{const r=n.extractContents(),i=document.createElement("b");i.style.fontWeight="600",i.appendChild(r),n.insertNode(i),n.setStartAfter(i),n.collapse(!0),l.removeAllRanges(),l.addRange(n),e.nextTick(()=>{Tn()})}catch{document.execCommand("bold",!1),e.nextTick(()=>{Tn()})}return!0},Xn=(l,n=null)=>{if(E.disabled||!E.richText||!f.value)return;me.value?(ae.value&&(clearTimeout(ae.value),ae.value=null),k(),me.value=!1):k(),Ft(),f.value.focus();const a=window.getSelection();let r=null;if(a&&a.rangeCount>0){const u=a.getRangeAt(0);!u.collapsed&&eo(u)&&(r=G())}if(l==="createLink"&&n){const u=window.getSelection();if(u.rangeCount>0){const d=u.getRangeAt(0);if(d.collapsed)try{d.expand("word")}catch{const v=document.createTextNode(n);d.insertNode(v),d.selectNodeContents(v)}}}if(l==="bold"){const u=zo();ue.value.bold=u;const d=window.getSelection();d.rangeCount>0&&d.getRangeAt(0).collapsed&&(ut.value={command:"bold",state:u}),e.nextTick(()=>{r&&(ve(r),e.nextTick(()=>{const m=sn("bold");ue.value.bold=m})),p(),St(),xt()});return}if(l==="italic"){const u=Rn();ue.value.italic=u;const d=window.getSelection();d.rangeCount>0&&d.getRangeAt(0).collapsed&&(ut.value={command:"italic",state:u}),e.nextTick(()=>{r&&(ve(r),e.nextTick(()=>{const m=sn("italic");ue.value.italic=m})),p(),It(),St(),xt()});return}let i=!1;try{i=document.execCommand(l,!1,n)}catch{}e.nextTick(()=>{if(r&&ve(r),["bold","italic","underline"].includes(l))try{if(l==="bold")r&&e.nextTick(()=>{const d=sn("bold");ue.value.bold=d});else if(l==="italic")if(r)e.nextTick(()=>{const d=sn("italic");ue.value.italic=d});else{const d=document.queryCommandState(l);ue.value[l]=d}else{const d=document.queryCommandState(l);ue.value[l]=d}}catch{ue.value.hasOwnProperty(l)?ue.value[l]=!ue.value[l]:ue.value[l]=!0}if(l==="createLink"&&n){const d=window.getSelection();if(d.rangeCount>0){const v=d.getRangeAt(0),y=v.commonAncestorContainer.nodeType===1?v.commonAncestorContainer.closest("a"):v.commonAncestorContainer.parentElement?.closest("a");y&&(!y.getAttribute("href")||y.getAttribute("href")==="")&&y.setAttribute("href",n)}f.value.querySelectorAll("a").forEach(v=>{const y=v.getAttribute("href");(!y||y===""||y==="#")&&v.setAttribute("href",n)})}p(),St(),xt()})},sn=(l,n=null)=>{if(E.disabled||!f.value)return!1;try{if(l==="formatBlock"&&n){const r=document.queryCommandValue("formatBlock");if(n==="<blockquote>"){const i=r.toLowerCase();if(i==="blockquote"||i==="<blockquote>")return!0;const u=window.getSelection();if(u.rangeCount>0){const m=u.getRangeAt(0).commonAncestorContainer;return!!(m.nodeType===1?m.tagName==="BLOCKQUOTE"?m:m.closest("blockquote"):m.parentElement?.closest("blockquote"))}}return r===n||r.toLowerCase()===n.toLowerCase()}if(["bold","italic","underline"].includes(l))try{const r=window.getSelection();if(r.rangeCount>0){const i=r.getRangeAt(0);if(l==="bold"){let d=!1;if(i.collapsed){const m=i.commonAncestorContainer,v=m.nodeType===3?m.parentElement:m;if(v&&((v.tagName==="STRONG"||v.tagName==="B"||v.closest&&v.closest("strong, b"))&&(d=!0),!d&&v.style&&parseInt(v.style.fontWeight)>=600&&(d=!0),!d))try{const y=window.getComputedStyle(v);parseInt(y.fontWeight)>=600&&(d=!0)}catch{}return ue.value.hasOwnProperty(l)?ue.value[l]:(ue.value[l]=d,d)}else{const m=i.commonAncestorContainer.nodeType===1?i.commonAncestorContainer:i.commonAncestorContainer.parentNode;let v=!1;if(m){const y=document.createTreeWalker(m,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let x;for(;x=y.nextNode();)if(!(typeof i.intersectsNode=="function"&&!i.intersectsNode(x))){if(x.nodeType===3){if(!(x.textContent||"").trim())continue;v=!0;let b=x.parentElement;for(;b&&b!==f.value;){if(b.tagName==="STRONG"||b.tagName==="B"){d=!0;break}if(b.style&&parseInt(b.style.fontWeight)>=600){d=!0;break}b=b.parentElement}}else if(x.nodeType===1){const N=x;if(N.tagName==="STRONG"||N.tagName==="B"){d=!0;break}if(N.style&&parseInt(N.style.fontWeight)>=600){d=!0;break}}if(d)break}}return ue.value[l]=d&&v,d&&v}}if(l==="italic"){let d=!1;if(i.collapsed){const m=i.commonAncestorContainer,v=m.nodeType===3?m.parentElement:m;if(v&&((v.tagName==="EM"||v.tagName==="I"||v.closest&&v.closest("em, i"))&&(d=!0),!d&&v.style&&v.style.fontStyle==="italic"&&(d=!0),!d))try{window.getComputedStyle(v).fontStyle==="italic"&&(d=!0)}catch{}return ue.value.hasOwnProperty(l)?ue.value[l]:(ue.value[l]=d,d)}else{const m=i.commonAncestorContainer.nodeType===1?i.commonAncestorContainer:i.commonAncestorContainer.parentNode;let v=!1;if(m){const y=document.createTreeWalker(m,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let x;for(;x=y.nextNode();)if(!(typeof i.intersectsNode=="function"&&!i.intersectsNode(x))){if(x.nodeType===3){if(!(x.textContent||"").trim())continue;v=!0;let b=x.parentElement;for(;b&&b!==f.value;){if(b.tagName==="EM"||b.tagName==="I"){d=!0;break}if(b.style&&b.style.fontStyle==="italic"){d=!0;break}b=b.parentElement}}else if(x.nodeType===1){const N=x;if(N.tagName==="EM"||N.tagName==="I"){d=!0;break}if(N.style&&N.style.fontStyle==="italic"){d=!0;break}}if(d)break}}return ue.value[l]=d&&v,d&&v}}const u=document.queryCommandState(l);return i.collapsed&&ue.value.hasOwnProperty(l)?ue.value[l]:(ue.value[l]=u,u)}return ue.value.hasOwnProperty(l)?ue.value[l]:!1}catch{return ue.value.hasOwnProperty(l)?ue.value[l]:!1}try{return document.queryCommandState(l)}catch{return!1}}catch{return!1}},Po=l=>{E.disabled||!E.richText||(ke.value=ke.value===l?null:l,l==="askAi"&&(it.value=null))},Ft=()=>{ke.value=null,Ye.value=null},Yn=l=>{Xn("formatBlock",l),Ft()},El=l=>{if(!l||!f.value)return l;const n=J=>{let j=J.nodeType===Node.TEXT_NODE?J.parentElement:J;for(;j&&j!==f.value;){const Ee=j.tagName;if(Ee==="P"){const et=j.parentElement;if(et===f.value||et.tagName==="BLOCKQUOTE")return j}if(Ee==="BLOCKQUOTE")break;j=j.parentElement}return null},a=n(l.startContainer),r=n(l.endContainer);if(!a||!r)return l;const i=[],u=document.createTreeWalker(f.value,NodeFilter.SHOW_ELEMENT,{acceptNode:J=>{const j=J.tagName;if(j==="P"){const Ee=J.parentElement;if(Ee===f.value||Ee.tagName==="BLOCKQUOTE")return NodeFilter.FILTER_ACCEPT}return j==="BLOCKQUOTE"?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_SKIP}});let d;for(;d=u.nextNode();)i.push(d);const m=i.indexOf(a),v=i.indexOf(r);if(m===-1||v===-1)return l;const y=Math.min(m,v),x=Math.max(m,v),N=i.slice(y,x+1);if(N.length===0)return l;const b=N[0],F=N[N.length-1],I=document.createRange();return I.setStartBefore(b),I.setEndAfter(F),I},Oo=()=>{if(E.disabled||!E.richText||!f.value)return;me.value?(ae.value&&(clearTimeout(ae.value),ae.value=null),k(),me.value=!1):k(),Ft(),f.value.focus();const l=window.getSelection();if(l.rangeCount===0)return;let n=l.getRangeAt(0);!n.collapsed&&eo(n)&&(n=El(n),l.removeAllRanges(),l.addRange(n));let a=null;!n.collapsed&&eo(n)&&(a=G());const r=n.commonAncestorContainer,i=r.nodeType===1?r.tagName==="BLOCKQUOTE"?r:r.closest("blockquote"):r.parentElement?.closest("blockquote");if(!!(i&&f.value.contains(i))){if(i){const d=i.parentNode;Array.from(i.childNodes).forEach(v=>{if(v.nodeType===Node.ELEMENT_NODE)if(v.tagName==="P"||v.tagName==="DIV")d.insertBefore(v,i);else{const y=document.createElement("p");y.appendChild(v.cloneNode(!0)),d.insertBefore(y,i)}else if(v.nodeType===Node.TEXT_NODE&&v.textContent.trim()){const y=document.createElement("p");y.appendChild(v.cloneNode(!0)),d.insertBefore(y,i)}}),i.remove()}}else if(n.collapsed)document.execCommand("formatBlock",!1,"<blockquote>");else{const d=document.createElement("blockquote"),m=n.extractContents();d.appendChild(m),n.insertNode(d);const v=[],y=document.createTreeWalker(d,NodeFilter.SHOW_TEXT,{acceptNode:b=>b.parentNode===d&&b.textContent.trim()?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});let x;for(;x=y.nextNode();)v.push(x);if(v.forEach(b=>{const F=document.createElement("p");b.parentNode.insertBefore(F,b),F.appendChild(b)}),d.querySelectorAll("p, div").forEach(b=>{b.textContent.trim()===""&&!b.querySelector("img")&&(b.innerHTML="<br>")}),d.children.length===0&&d.textContent.trim()===""){const b=document.createElement("p");b.innerHTML="<br>",d.appendChild(b)}}e.nextTick(()=>{a&&ve(a),un(),p(),xt()})},cl=()=>{if(!f.value)return;const l=window.getSelection();if(l.rangeCount===0)return;const a=l.getRangeAt(0).commonAncestorContainer,r=a.nodeType===1?a.tagName==="BLOCKQUOTE"?a:a.closest("blockquote"):a.parentElement?.closest("blockquote");if(!r||!f.value.contains(r))return;const i=x=>{if(!x)return!1;const N=x.textContent||"",F=(x.innerHTML||"").trim();return N.trim()===""||F===""||F==="<br>"||F==="<br/>"||F==="<p></p>"||F==="<p><br></p>"||F==="<p><br/></p>"||F==="<p> </p>"||F==="<p><br> </p>"||F==="<div></div>"||F==="<div><br></div>"||F==="<div><br/></div>"};let u=null;for(a.nodeType===3?u=a.parentElement:a.tagName==="P"||a.tagName==="DIV"?u=a:u=a.closest("p, div"),u&&r.contains(u)&&i(u)&&u.remove();r.lastChild;){const x=r.lastChild;if(x.nodeType===1&&x.tagName==="BR")x.remove();else if(x.nodeType===3)if((x.textContent||"").trim()==="")x.remove();else break;else break}if(r.children.length>0)for(let x=r.children.length-1;x>=0;x--){const N=r.children[x];if((N.tagName==="P"||N.tagName==="DIV")&&i(N))N.remove();else break}let d=r.innerHTML;const m=d;d=d.replace(/(<br\s*\/?>)+$/gi,""),d!==m&&(r.innerHTML=d);const v=document.createElement("p");v.innerHTML="<br>",r.parentNode?r.nextSibling?r.parentNode.insertBefore(v,r.nextSibling):r.parentNode.appendChild(v):f.value&&f.value.appendChild(v);const y=document.createRange();y.selectNodeContents(v),y.collapse(!0),l.removeAllRanges(),l.addRange(y),e.nextTick(()=>{un(),p()})},St=()=>{if(!f.value){He.value=!1;return}try{const l=window.getSelection();if(l.rangeCount>0){const a=l.getRangeAt(0).commonAncestorContainer,r=a.nodeType===1?a.closest("a"):a.parentElement?.closest("a");He.value=!!r}else He.value=!1}catch{He.value=!1}},dl=()=>{if(!f.value)return;const l=window.getSelection();l&&l.rangeCount>0&&l.getRangeAt(0),tn.value=G();const n=window.getSelection();let a="";n.rangeCount>0&&(a=n.getRangeAt(0).toString()),kt.value="",P.value=a,Qe.value="",pe.value=null,_t.value=!0,Ft(),e.nextTick(()=>{Ht.value&&Ht.value.focus()})},ul=()=>{if(!f.value)return;me.value?(ae.value&&(clearTimeout(ae.value),ae.value=null),k(),me.value=!1):k();const l=window.getSelection();let n=null;if(l.rangeCount>0){const r=l.getRangeAt(0).commonAncestorContainer;n=r.nodeType===1?r.closest("a"):r.parentElement?.closest("a")}if(!n&&pe.value&&(n=pe.value),n&&n.parentNode){const a=document.createDocumentFragment();for(;n.firstChild;)a.appendChild(n.firstChild);if(n.parentNode.replaceChild(a,n),a.firstChild){const r=document.createRange();r.setStartBefore(a.firstChild),r.setEndAfter(a.lastChild||a.firstChild),l.removeAllRanges(),l.addRange(r),document.execCommand("removeFormat",!1),r.collapse(!1),l.removeAllRanges(),l.addRange(r)}pe.value=null}else Xn("unlink");He.value=!1,Ft(),e.nextTick(()=>{p(),St()})},ml=()=>{E.disabled||!E.richText||f.value&&(me.value?(ae.value&&(clearTimeout(ae.value),ae.value=null),k(),me.value=!1):k(),Ft(),f.value.focus(),document.execCommand("insertUnorderedList",!1),e.nextTick(()=>{Zt(),p(),xt()}))},Zo=()=>{E.disabled||!E.richText||f.value&&(me.value?(ae.value&&(clearTimeout(ae.value),ae.value=null),k(),me.value=!1):k(),Ft(),f.value.focus(),document.execCommand("insertOrderedList",!1),e.nextTick(()=>{Zt(),p(),xt()}))},pl=l=>{const n=l.parentElement;if(!n||n.tagName!=="OL")return null;let a=0,r=l.previousElementSibling;for(;r;)r.tagName==="LI"&&a++,r=r.previousElementSibling;return a+1},Zt=()=>{if(!f.value)return;f.value.querySelectorAll("li > ol").forEach(n=>{const a=n.parentElement;if(a&&a.tagName==="LI"){const r=pl(a);r!==null&&Array.from(n.children).filter(u=>u.tagName==="LI").forEach(u=>{u.setAttribute("data-parent-num",String(r))})}})},Wo=()=>{if(E.disabled||!E.richText||!f.value)return;Ft(),f.value.focus();const l=window.getSelection();if(l.rangeCount===0)return;const n=l.getRangeAt(0),a=n.commonAncestorContainer.nodeType===1?n.commonAncestorContainer.closest("li"):n.commonAncestorContainer.parentElement?.closest("li");if(!a){document.execCommand("indent",!1),e.nextTick(()=>{Zt(),p()});return}const r=a.parentElement;if(!r||r.tagName!=="OL"&&r.tagName!=="UL")return;const i=a.previousElementSibling;if(i&&i.tagName==="LI"){const u=r.tagName.toLowerCase();let d=i.querySelector(`:scope > ${u}`);d||(d=document.createElement(u),i.appendChild(d));const m=pl(i);d.appendChild(a),m!==null&&r.tagName==="OL"&&a.setAttribute("data-parent-num",String(m)),Zt();const v=document.createRange();v.selectNodeContents(a),v.collapse(!1),l.removeAllRanges(),l.addRange(v),e.nextTick(()=>{p(),xt()})}else document.execCommand("indent",!1),e.nextTick(()=>{Zt(),p(),xt()})},io=()=>{if(E.disabled||!E.richText||!f.value)return;Ft(),f.value.focus();const l=window.getSelection();if(l.rangeCount===0)return;const n=l.getRangeAt(0),a=n.commonAncestorContainer.nodeType===1?n.commonAncestorContainer.closest("li"):n.commonAncestorContainer.parentElement?.closest("li");if(!a){document.execCommand("outdent",!1),e.nextTick(()=>{Zt(),p()});return}const r=a.parentElement;if(!r||r.tagName!=="OL"&&r.tagName!=="UL")return;const i=r.parentElement;if(i&&i.tagName==="LI"){const u=i.parentElement;if(u&&(u.tagName==="OL"||u.tagName==="UL")){r.tagName==="OL"&&a.removeAttribute("data-parent-num"),u.insertBefore(a,i.nextSibling),r.children.length===0&&r.remove(),Zt();const d=document.createRange();d.selectNodeContents(a),d.collapse(!1),l.removeAllRanges(),l.addRange(d),e.nextTick(()=>{p(),xt()});return}}document.execCommand("outdent",!1),e.nextTick(()=>{Zt(),p(),xt()})},Wt=e.ref(null),jn=e.ref(null),Co=e.ref({}),In=e.ref(""),Fn=e.ref(null),Kn=e.ref("");e.ref("");const Gn=e.ref(null);e.ref("");const rn=e.ref([]),So=e.ref(!1),bo=e.ref(!1),Vl=l=>{if(!l)return"";const n=l.cloneRange(),a=document.createElement("div");return a.appendChild(n.cloneContents()),a.innerHTML},vl=()=>{if(E.disabled||!E.richText||!f.value)return;if(Wt.value!==null){Wt.value=null,In.value="",Kn.value="",Gn.value=null,rn.value=[],po(!0);return}Ft(),f.value.focus();const l=window.getSelection();if(!l||l.rangeCount===0)return;const n=l.getRangeAt(0);if(n.collapsed||!eo(n))return;Kn.value=Vl(n)||"",Gn.value=G();const a=n.getBoundingClientRect(),r=f.value.parentElement;if(!r)return;const i=r.getBoundingClientRect(),u=a.bottom-i.top,m=Math.max(u+8,0);Co.value={top:`${m}px`,bottom:"auto"},Wt.value=Date.now(),e.nextTick(()=>{if(In.value="",Fn.value){const y=Fn.value;y.style.height="auto",y.style.height=`${y.scrollHeight}px`,y.focus()}const v=r.querySelector(".dss-comment-overlay");if(v&&r){const y=r.querySelector(".dss-text-editor-footer");if(y){const x=r.getBoundingClientRect(),N=v.getBoundingClientRect(),b=y.getBoundingClientRect(),F=N.bottom-x.top,I=b.top-x.top,J=8;if(F>I-J){const j=b.height;Co.value={bottom:`${j+J}px`,top:"auto"}}else Co.value={top:`${m}px`,bottom:"auto"}}}})},Ho=()=>{if(!In.value.trim())return;const l=In.value.trim(),n=new Date,a={text:l,selectionText:Kn.value,selectionRange:Gn.value,commentId:Wt.value,user:E.commentUser||null,createdAt:n.toISOString()};rn.value=[...rn.value,a],he("comment-submitted",a),qt(a),Gn.value&&!qo(Gn.value)&&B(Wt.value,Gn.value),In.value="",e.nextTick(()=>{if(Fn.value){const r=Fn.value;r.style.height="auto",r.style.height=`${r.scrollHeight}px`,r.focus()}Sn("sendComment")})},Nl=(l,n)=>{if(!(!E.commentUser||!l.user||l.user.id!==E.commentUser.id)){if(rn.value=rn.value.filter((a,r)=>r!==n),Wt.value!==null&&f.value){const a=String(Wt.value),r=f.value.querySelector(`[data-comment="${a}"], [data-fake-comment="${a}"]`);if(r&&rn.value.length>0){const i=[],u=new Set;rn.value.forEach(d=>{d.user&&d.user.id&&!u.has(d.user.id)&&(u.add(d.user.id),i.push(d.user))}),i.length>0?r.setAttribute("data-comment-user",JSON.stringify(i[0])):r.removeAttribute("data-comment-user"),i.length>1?r.setAttribute("data-comment-user-2",JSON.stringify(i[1])):r.removeAttribute("data-comment-user-2"),r.setAttribute("data-comment-count",String(rn.value.length))}else r&&rn.value.length===0&&(r.removeAttribute("data-comment-user"),r.removeAttribute("data-comment-user-2"),r.setAttribute("data-comment-count","0"))}if(he("comment-deleted",{comment:l,index:n,commentId:Wt.value}),E.comments&&Array.isArray(E.comments)){const a=E.comments.filter(r=>!(r.commentId===l.commentId&&r.text===l.text&&r.user?.id===l.user?.id));he("update:comments",a)}e.nextTick(()=>{Sn("deleteComment")})}},qo=l=>{if(!l||!f.value)return!1;try{const n=zn(l);if(!n)return!1;const a=n.commonAncestorContainer,r=a.nodeType===3?a.parentElement:a;if(r)return!!r.closest("[data-comment], [data-fake-comment]")}catch{}return!1},zn=l=>{if(!l||!f.value)return null;try{const n=document.createRange();if(l.type==="element"&&l.element)return f.value.contains(l.element)?(n.setStart(l.element,l.offset),n.collapse(!0),n):null;let a=0;const r=[f.value];let i=null,u=!1,d=!1;for(;!d&&(i=r.pop());)if(i.nodeType===3){const m=a+i.length;!u&&l.start>=a&&l.start<=m&&(n.setStart(i,l.start-a),u=!0),u&&l.end>=a&&l.end<=m&&(n.setEnd(i,l.end-a),d=!0),a=m}else{let m=i.childNodes.length;for(;m--;)r.push(i.childNodes[m])}return u?n:null}catch{return null}},B=(l,n)=>{if(!(!l||!n||!f.value))try{const a=zn(n);if(!a||a.collapsed)return;const r=a.commonAncestorContainer,i=r.nodeType===3?r.parentElement:r;if(i){const m=i.closest("[data-comment], [data-fake-comment]");if(m){m.getAttribute("data-comment")!==String(l)&&m.getAttribute("data-fake-comment")!==String(l)&&m.setAttribute("data-comment",String(l));return}}const u=document.createElement("span");u.setAttribute("data-comment",String(l));try{const m=a.startContainer,v=a.endContainer,y=a.startOffset,x=a.endOffset,N=m.nodeType===3?m.parentNode:m,b=v.nodeType===3?v.parentNode:v;if(N===b&&y===0&&x===(v.nodeType===3?v.length:b.childNodes.length)&&(N.tagName==="P"||N.tagName==="DIV"||N.tagName==="H1"||N.tagName==="H2"||N.tagName==="H3"||N.tagName==="H4"||N.tagName==="H5"||N.tagName==="H6")){const I=a.extractContents();u.appendChild(I),a.insertNode(u)}else a.surroundContents(u)}catch{const v=a.extractContents();u.appendChild(v),a.insertNode(u)}const d=f.value.querySelector(`[data-comment="${String(l)}"]`);e.nextTick(()=>{Sn("wrapSelectionWithCommentMarker"),p()})}catch{}},qt=l=>{if(!l||!l.commentId)return;const n=Array.isArray(E.comments)?[...E.comments]:[],a=typeof l.commentId=="string"&&l.commentId.startsWith("comment-")?Date.now():Number(l.commentId)||l.commentId;let r=n.findIndex(u=>typeof u.conversation_id=="string"&&u.conversation_id.startsWith("comment-")?null:Number(u.conversation_id)===Number(a)||u.conversation_id===a);const i={text:l.text,user:l.user,createdAt:l.createdAt,created_at:l.createdAt,updated_at:l.createdAt};if(r>=0){const u=n[r];if(u.conversation||(u.conversation=[]),u.conversation.push(i),u.updated_at=l.createdAt,!u.article_id&&n.length>0){const d=n.find(m=>m.article_id);d&&(u.article_id=d.article_id)}}else{const u=l.selectionRange,d=n.length>0&&n.find(v=>v.article_id)?.article_id||null,m={conversation_id:a,article_id:d,selection_range:u?{start:u.start||0,end:u.end||0,type:u.type||"text"}:null,selection_text:l.selectionText||"",conversation:[i],created_by_user:l.user,created_at:l.createdAt,updated_at:l.createdAt,status:"active"};n.push(m)}So.value=!0,he("update:comments",n)},Nn=(l,n=[])=>{if(E.disabled||!E.richText||!f.value)return;const a=f.value;let r=null;try{r=a.querySelector(l)}catch{return}if(!r)return;Ft(),a.focus();const i=document.createRange();i.selectNodeContents(r);const u=window.getSelection();u&&(u.removeAllRanges(),u.addRange(i)),Kn.value=r.innerHTML||"",Gn.value=G();const d=i.getBoundingClientRect(),m=a.parentElement;if(m){const x=m.getBoundingClientRect(),N=d.bottom-x.top,F=Math.max(N+8,0);Co.value={top:`${F}px`,bottom:"auto"}}const v=r.getAttribute("data-comment")||r.getAttribute("data-fake-comment");let y=[];if(v&&E.comments&&Array.isArray(E.comments)){const x=E.comments.find(N=>String(N.conversation_id)===String(v));if(x&&x.conversation&&Array.isArray(x.conversation)){const N=x.conversation.map(b=>({id:b.id||b.commentary_id,commentary_id:b.id||b.commentary_id,conversation_id:x.id||x.conversation_id,text:b.text,user:b.user,createdAt:b.created_at||b.createdAt,updated_at:b.updated_at||b.updatedAt}));y.push(...N)}}y.length===0&&Array.isArray(n)&&n.length>0&&(y=n.slice()),y.sort((x,N)=>{const b=J=>{if(!J)return 0;const j=new Date(J).getTime();return isNaN(j)?0:j},F=b(x.createdAt),I=b(N.createdAt);return F===I?0:F-I}),rn.value=y,po(!0),Wt.value=v||null,r&&(jn.value=r,r.classList.add("editor-comment-highlighted")),e.nextTick(()=>{if(In.value="",Fn.value){const x=Fn.value;x.style.height="auto",x.style.height=`${x.scrollHeight}px`,x.focus()}if(m){const x=m.querySelector(".dss-comment-overlay");if(x){const N=m.querySelector(".dss-text-editor-footer");if(N){const b=m.getBoundingClientRect(),F=x.getBoundingClientRect(),I=N.getBoundingClientRect(),J=F.bottom-b.top,j=I.top-b.top,Ee=8;if(J>j-Ee){const et=I.height;Co.value={bottom:`${et+Ee}px`,top:"auto"}}}}}Sn("openCommentOverlayForSelector")})},cn=e.ref(null),Hn=e.ref(0),wt=l=>{if(!(E.disabled||!E.richText)){if(l.key==="Escape"){const n=window.getSelection();if(n.rangeCount>0){const r=n.getRangeAt(0).commonAncestorContainer,i=r.nodeType===1?r.tagName==="BLOCKQUOTE"?r:r.closest("blockquote"):r.parentElement?.closest("blockquote");if(!!(i&&f.value&&f.value.contains(i))){l.preventDefault();let d=null;r.nodeType===3?d=r.parentElement:r.tagName==="P"||r.tagName==="DIV"?d=r:d=r.closest("p, div");const m=document.createElement("p");m.innerHTML="<br>",d&&i.contains(d)&&d.nextSibling?i.insertBefore(m,d.nextSibling):i.appendChild(m),setTimeout(()=>{cl()},50);return}}}if(l.key.length===1||l.key==="Enter"){const n=window.getSelection();if(n&&n.rangeCount>0){const a=n.getRangeAt(0),r=a.commonAncestorContainer,i=r.nodeType===3?r.parentElement:r;if(i){const u=i.closest(".dss-image-wrapper");if(u){const d=u.querySelector("img");if(i!==d&&!d?.contains(i)){const m=a.startContainer.nodeType===3?a.startContainer.parentElement:a.startContainer,v=a.endContainer.nodeType===3?a.endContainer.parentElement:a.endContainer;if(u.contains(m)&&m!==d||u.contains(v)&&v!==d){l.preventDefault();const y=document.createRange();y.setStartAfter(u),y.collapse(!0),n.removeAllRanges(),n.addRange(y);return}}}}}}if(l.key==="Backspace"||l.key==="Delete"){const n=window.getSelection();if(n.rangeCount>0){const a=n.getRangeAt(0);let r=null,i=null;if(a.collapsed)if(l.key==="Backspace"){const u=a.startContainer;let d=u;u.nodeType===3&&(a.startOffset===0?d=u.previousSibling||u.parentNode:d=u.parentNode);const m=d.previousSibling;m&&(m.classList&&m.classList.contains("dss-image-wrapper")?i=m:m.tagName==="IMG"&&(r=m,i=r.closest(".dss-image-wrapper"))),i||(i=d.closest(".dss-image-wrapper"),i&&(r=i.querySelector("img")))}else{const u=a.startContainer;let d=u;u.nodeType===3&&(a.startOffset===u.length?d=u.nextSibling||u.parentNode:d=u.parentNode);const m=d.nextSibling;m&&(m.classList&&m.classList.contains("dss-image-wrapper")?i=m:m.tagName==="IMG"&&(r=m,i=r.closest(".dss-image-wrapper"))),i||(i=d.closest(".dss-image-wrapper"),i&&(r=i.querySelector("img")))}else{const u=a.commonAncestorContainer,d=a.startContainer.nodeType===3?a.startContainer.parentElement:a.startContainer,m=a.endContainer.nodeType===3?a.endContainer.parentElement:a.endContainer;if(u.nodeType===1&&u.tagName==="IMG"?(r=u,i=r.closest(".dss-image-wrapper")):(r=u.querySelector("img"),r&&(i=r.closest(".dss-image-wrapper"))),i){const v=i.contains(d)||d===i,y=i.contains(m)||m===i,N=a.cloneContents().textContent?.trim()||"",b=i.textContent?.trim()||"";(!v||!y||N.length>b.length)&&(i=null,r=null)}}if(i){l.preventDefault(),l.stopPropagation();const u=i.parentNode;if(u){const d=document.createTextNode("");u.insertBefore(d,i),i.remove();const m=document.createRange();m.setStartAfter(d),m.collapse(!0),n.removeAllRanges(),n.addRange(m),e.nextTick(()=>{p()});return}}}}if(l.key==="Tab"){l.preventDefault(),l.shiftKey?io():Wo();return}if(l.key==="Enter"){const n=window.getSelection();if(n.rangeCount>0){const a=n.getRangeAt(0);if(a.collapsed){const d=a.startContainer,m=v=>{if(!v)return!1;let y=v.previousSibling;for(;y;){if(y.classList&&y.classList.contains("dss-image-wrapper")||y.tagName==="IMG"||y.querySelector&&y.querySelector(".dss-image-wrapper")||y.querySelector&&y.querySelector("img"))return!0;y=y.previousSibling}const x=v.parentElement;return x&&x!==f.value?m(x):!1};if(d.nodeType===3){const v=d.parentElement;if(v&&(m(v)||m(d))){const y=v.closest("p, div");if(y&&y!==f.value){l.preventDefault(),l.stopPropagation();let x=null;const N=a.startOffset;N<d.length&&(x=d.splitText(N));const b=document.createElement("p");if(x?b.appendChild(x):b.innerHTML="<br>",d.length===0){const I=d.parentElement;I&&(I.removeChild(d),I.childNodes.length===0&&I.appendChild(document.createElement("br")))}y.nextSibling?y.parentNode.insertBefore(b,y.nextSibling):y.parentNode.appendChild(b);const F=document.createRange();x?F.setStart(x,0):F.setStart(b,0),F.collapse(!0),n.removeAllRanges(),n.addRange(F),e.nextTick(()=>{p()});return}}}}const r=a.commonAncestorContainer,i=r.nodeType===1?r.tagName==="BLOCKQUOTE"?r:r.closest("blockquote"):r.parentElement?.closest("blockquote");if(!!(i&&f.value&&f.value.contains(i))){let d=null;r.nodeType===3?d=r.parentElement:r.tagName==="P"||r.tagName==="DIV"?d=r:d=r.closest("p, div");const m=I=>{if(!I)return!1;const J=I.textContent||"",Ee=(I.innerHTML||"").trim(),et=Ee.replace(/<br\s*\/?>/gi,"").trim();return J.trim()===""||Ee===""||et===""||Ee==="<br>"||Ee==="<br/>"||Ee==="<p></p>"||Ee==="<p><br></p>"||Ee==="<p><br/></p>"||Ee==="<p> </p>"||Ee==="<p><br> </p>"||Ee==="<div></div>"||Ee==="<div><br></div>"||Ee==="<div><br/></div>"},v=i.lastChild,y=v&&v.nodeType===1&&v.tagName==="BR",x=a.startContainer,N=x.nodeType===3?x.parentElement:x,b=N===i||N&&N.parentElement===i;if(d&&m(d)||y&&b){l.preventDefault(),setTimeout(()=>{cl()},50);return}}}}if(l.key===" "){const n=Date.now(),a=n-Hn.value;if(cn.value===" "&&a<300){const r=window.getSelection();if(r.rangeCount>0){const i=r.getRangeAt(0),u=i.commonAncestorContainer.nodeType===1?i.commonAncestorContainer.closest("li"):i.commonAncestorContainer.parentElement?.closest("li");if(u){const d=i.startContainer.textContent?.substring(0,i.startOffset)||"";if((u.textContent||"").indexOf(d.trim())<=10||d.trim().length<=2){l.preventDefault(),Wo();return}}}}cn.value=" ",Hn.value=n}else cn.value=l.key}},Lt=l=>{if(E.disabled||!E.richText)return;l.preventDefault();let n=l.clipboardData.getData("text/html"),a=l.clipboardData.getData("text/plain");n&&(n=n.replace(/<!--[\s\S]*?-->/g,"")),a&&(a=a.replace(/<!--[\s\S]*?-->/g,"")),k();const r=window.getSelection();let i=null;if(r&&r.rangeCount>0){let m=r.getRangeAt(0).commonAncestorContainer;m.nodeType===3&&(m=m.parentNode),i=m.closest("p, h1, h2, h3, h4, h5, h6, li, blockquote")}const u=d=>{const v=new DOMParser().parseFromString(d,"text/html");let y=f.value.querySelector("h1")?1:0;if(v.querySelectorAll("h1").forEach(N=>{if(y>0){const b=v.createElement("p");b.innerHTML=N.innerHTML,N.parentNode.replaceChild(b,N)}else y++}),i){const N=["P","H1","H2","H3","H4","H5","H6","DIV","BLOCKQUOTE","UL","OL","LI"],b=Array.from(v.body.children).filter(F=>N.includes(F.tagName));if(b.length===1){const F=b[0].tagName,I=i.tagName,J=i.textContent.trim()===""&&!i.querySelector("img");let j=!1;if(["H1","H2","H3","H4","H5","H6"].includes(I)?j=!0:J||(F===I||F==="P")&&(j=!0),j)return b[0].innerHTML.trim()}}return v.body.innerHTML.trim()};if(n){const d=u(n);document.execCommand("insertHTML",!1,d)}else if(a)if(/<[a-z][\s\S]*>/i.test(a)){const m=u(a);document.execCommand("insertHTML",!1,m)}else document.execCommand("insertText",!1,a);p()},Pn=l=>{if(ke.value){const a=l.target;!a.closest(".dss-toolbar-dropdown")&&!a.closest(".dss-toolbar-dropdown-toggle")&&Ft()}if(Ce.value){const a=l.target,r=a.closest(".dss-floating-toolbar"),i=f.value&&a.closest(".dss-text-editor-content");!r&&!i&&hn()}if(it.value){const a=l.target,r=a.closest(".dss-floating-toolbar"),i=a.closest(".dss-toolbar-dropdown");!r&&!i&&wo()}const n=l.target;if(!n.closest(".dss-toolbar-dropdown")&&!n.closest(".dss-toolbar-dropdown-submenu")&&(Ye.value=null),!f.value||!n.closest(".dss-text-editor-content")){const a=window.getSelection();if(a&&a.rangeCount>0){const r=a.getRangeAt(0);vn.value=!r.collapsed&&eo(r)}else vn.value=!1}if(Wt.value!==null){const a=document.querySelector(".dss-comment-overlay");let r=!1;if(a){const d=a.getBoundingClientRect(),m=l.clientX,v=l.clientY;r=m>=d.left&&m<=d.right&&v>=d.top&&v<=d.bottom}const i=n.closest(".dss-toolbar-button"),u=i&&i.getAttribute("title")==="Comment";!r&&!u&&(Wt.value=null,In.value="",Kn.value="",Gn.value=null,rn.value=[],po(!0))}},Qn=(l,n)=>{l&&l.stopPropagation&&l.stopPropagation(),At.value&&(clearTimeout(At.value),At.value=null),Ye.value=n},Je=l=>{const n=l.relatedTarget;if(n){const a=n.closest(".dss-toolbar-dropdown-submenu"),r=n.closest(".dss-toolbar-dropdown-item-has-submenu");if(a||r)return}At.value&&clearTimeout(At.value),At.value=setTimeout(()=>{Ye.value=null,At.value=null},150)},at=l=>{Ye.value=null};let Oe=0;const dn=l=>{if(!l)return;const n=Array.from(l.children);n.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")}),n.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 i=Array.from(a.children).find(m=>m.tagName==="DIV"?m.classList.contains("dss-toolbar-dropdown-item")?!1:Array.from(m.children).filter(y=>y.tagName==="BUTTON"||y.tagName==="DIV").length>0:!1),u=a.nextElementSibling,d=u&&!u.classList.contains("dss-toolbar-dropdown-submenu")&&!u.classList.contains("dss-toolbar-dropdown-item-has-submenu")&&u.tagName==="DIV"&&!u.classList.contains("dss-toolbar-dropdown-item")&&Array.from(u.children).some(m=>m.tagName==="BUTTON"||m.tagName==="DIV");if(i||d){const m=`submenu-auto-${++Oe}`;a.classList.add("dss-toolbar-dropdown-item-has-submenu"),a.setAttribute("data-submenu-id",m);let v=null;i?(a.tagName==="BUTTON"&&a.parentNode.insertBefore(i,a.nextSibling),i.classList.add("dss-toolbar-dropdown-submenu"),v=i):d&&(u.classList.add("dss-toolbar-dropdown-submenu"),v=u),v&&(v.setAttribute("data-submenu-id",m),v.setAttribute("data-processed","true"),i&&a.tagName!=="BUTTON"?v.dataset.originalParentRef="inside":v.dataset.originalParentRef="sibling",Array.from(v.children).forEach(x=>{(x.tagName==="BUTTON"||x.tagName==="DIV")&&!x.classList.contains("dss-toolbar-dropdown-item")&&x.classList.add("dss-toolbar-dropdown-item")}))}})},Uo=()=>{document.querySelectorAll(".dss-toolbar-dropdown").forEach(n=>{dn(n),n.querySelectorAll(".dss-toolbar-dropdown-item-has-submenu").forEach(i=>{const u=i._subMenuHandlers;u&&(i.removeEventListener("mouseenter",u.enter),i.removeEventListener("mouseleave",u.leave));const d=v=>{const y=i.getAttribute("data-submenu-id");y&&Qn(v,y)},m=Je;i.addEventListener("mouseenter",d),i.addEventListener("mouseleave",m),i._subMenuHandlers={enter:d,leave:m}}),n.querySelectorAll(".dss-toolbar-dropdown-submenu").forEach(i=>{const u=i._subMenuHandlers;u&&(i.removeEventListener("mouseenter",u.enter),i.removeEventListener("mouseleave",u.leave));const d=y=>{const x=i.getAttribute("data-submenu-id");x&&Qn(y,x)},m=Je;i.addEventListener("mouseenter",d),i.addEventListener("mouseleave",m),i._subMenuHandlers={enter:d,leave:m},i.querySelectorAll(".dss-toolbar-dropdown-item").forEach(y=>{y.addEventListener("click",at)})})})};let co=null;const Jn=()=>{if(Ye.value){const l=document.querySelector(`.dss-toolbar-dropdown-submenu[data-submenu-id="${Ye.value}"]`),n=document.querySelector(`.dss-toolbar-dropdown-item-has-submenu[data-submenu-id="${Ye.value}"]`);l&&n&&nl(l,n)}if(Ce.value&&xt(),E.richText){if(co!==null)return;co=setTimeout(()=>{co=null,Sn("handleWindowResize")},150)}},Mo=()=>{if(!E.richText)return;document.querySelectorAll(".dss-toolbar-custom-group").forEach(n=>{Array.from(n.children).filter(r=>r.tagName==="DIV"&&!r.classList.contains("dss-toolbar-button")).forEach(r=>{r.classList.add("dss-toolbar-button")})})},Bo=()=>{const l=document.querySelectorAll(".dss-text-editor-footer, .dss-text-editor-footer-content, .dss-text-editor-footer-stat, .dss-text-editor-footer-separator"),n=a=>{if(a.preventDefault(),a.stopPropagation(),window.getSelection){const r=window.getSelection();r.removeAllRanges?r.removeAllRanges():r.empty&&r.empty()}return!1};l.forEach(a=>{a.addEventListener("selectstart",n),a.addEventListener("mousedown",n),a.addEventListener("dragstart",n),a.addEventListener("contextmenu",n),a.addEventListener("click",r=>{if(window.getSelection){const i=window.getSelection();i.removeAllRanges&&i.removeAllRanges()}})})};e.onMounted(()=>{if(e.nextTick(()=>{requestAnimationFrame(()=>{Dt.value?fn():ko(),De.value?Ue():xe()})}),e.nextTick(()=>{Bo()}),E.richText&&f.value){try{document.execCommand("defaultParagraphSeparator",!1,"p")}catch{}document.addEventListener("click",Pn),window.addEventListener("resize",Jn);let l=null;const n=()=>{l===null&&(l=setTimeout(()=>{l=null,Jn()},150))};window.addEventListener("scroll",n,!0),f.value._windowScrollHandler=n,f.value._windowScrollTimeout=l,f.value.closest(".editor-with-comments"),f.value.closest(".dss-text-editor-content-wrapper");const a=f.value.closest(".dss-text-editor-content");let r=null;const i=()=>{r===null&&(r=setTimeout(()=>{r=null,Jn()},150))};a&&(a.addEventListener("scroll",i),f.value._scrollHandlers={wrapper:null,content:a,handler:i}),e.nextTick(()=>{Uo(),Mo()}),f.value.addEventListener("click",m=>{const v=m.target;v.closest("a")&&!E.disabled&&m.preventDefault();const x=v.closest(".dss-image-no-alt-icon"),N=v.closest(".dss-image-wrapper");if(x||N&&v===N){m.preventDefault(),m.stopPropagation();const b=window.getSelection(),F=document.createRange();F.setStartAfter(N),F.collapse(!0),b.removeAllRanges(),b.addRange(F)}else N&&v.tagName!=="IMG"&&(m.preventDefault(),e.nextTick(()=>{const b=window.getSelection();if(b.rangeCount>0){const I=b.getRangeAt(0).commonAncestorContainer,J=I.nodeType===3?I.parentElement:I;if(N.contains(J)&&J!==N.querySelector("img")){const j=document.createRange();j.setStartAfter(N),j.collapse(!0),b.removeAllRanges(),b.addRange(j)}}else{const F=document.createRange();F.setStartAfter(N),F.collapse(!0),b.addRange(F)}}))},!0),f.value.addEventListener("mousedown",m=>{const v=m.target,y=v.closest(".dss-image-no-alt-icon"),x=v.closest(".dss-image-wrapper");if(y||x&&v.tagName!=="IMG"){m.preventDefault();const N=window.getSelection(),b=document.createRange();x&&(b.setStartAfter(x),b.collapse(!0),N.removeAllRanges(),N.addRange(b))}},!0),f.value.addEventListener("paste",m=>{e.nextTick(()=>{if(!f.value)return;f.value.querySelectorAll("img").forEach(y=>{if(!y.closest(".dss-image-wrapper"))y.removeAttribute("alt"),y.removeAttribute("data-alt"),y.setAttribute("alt",""),y.setAttribute("data-alt",""),y.alt="";else{const N=y.getAttribute("alt")||y.alt||"";if(N){const b=y.getAttribute("src")||y.src||"",F=b.replace(/^https?:\/\//,"").replace(/^data:.*,/,""),I=N===b||N===F;(N.startsWith("http://")||N.startsWith("https://")||N.startsWith("data:")||I||I)&&(y.setAttribute("alt",""),y.setAttribute("data-alt",""),y.alt="")}}}),U()})}),f.value.addEventListener("dragstart",m=>{const v=m.target,y=v.tagName==="IMG"?v:v.closest("img"),x=y?.closest(".dss-image-wrapper");y&&f.value.contains(y)&&(We.value=x||y,m.dataTransfer.effectAllowed="move",m.dataTransfer.setData("text/html","image-drag"))}),f.value.addEventListener("dragover",m=>{We.value&&(m.preventDefault(),m.stopPropagation(),m.dataTransfer.dropEffect="move")}),f.value.addEventListener("dragenter",m=>{We.value&&(m.preventDefault(),m.stopPropagation())}),f.value.addEventListener("drop",m=>{if(!We.value||!f.value)return;m.preventDefault(),m.stopPropagation();const v=We.value,y=v.classList?.contains("dss-image-wrapper"),x=y?v.querySelector("img"):v,N=y?v:x?.closest(".dss-image-wrapper");if(!x||!f.value.contains(x)){We.value=null;return}let b=null;const F=m.clientX,I=m.clientY;if(document.caretRangeFromPoint)b=document.caretRangeFromPoint(F,I);else{const st=window.getSelection();st.rangeCount>0?b=st.getRangeAt(0).cloneRange():(b=document.createRange(),b.selectNodeContents(f.value),b.collapse(!1))}if(!b){We.value=null;return}const J=b.commonAncestorContainer,j=J.nodeType===3?J.parentElement:J;if(j?.closest(".dss-image-wrapper")===N||N&&N.contains(j)){We.value=null;return}if(N&&(j===N||N.contains(j))){We.value=null;return}const et=x.getAttribute("src");let Vt=null;N?Vt=N.cloneNode(!0):Vt=x.cloneNode(!0);try{let st=b.startContainer;if(st.nodeType===3&&(st=st.parentElement),N&&(st===N||N.contains(st))){const rt=document.createRange();rt.setStartAfter(N),rt.collapse(!0),b=rt}b.insertNode(Vt);const qe=document.createRange();qe.setStartAfter(Vt),qe.collapse(!0);const pt=window.getSelection();pt.removeAllRanges(),pt.addRange(qe)}catch{if(f.value.childNodes.length===0){const qe=document.createElement("p");qe.appendChild(Vt),f.value.appendChild(qe)}else{const qe=f.value.lastChild;if(qe&&qe.nodeType===1)qe.appendChild(Vt);else{const pt=document.createElement("p");pt.appendChild(Vt),f.value.appendChild(pt)}}}N?N.remove():x.remove(),We.value=null,e.nextTick(()=>{const st=f.value.querySelectorAll("img");let qe=!1;st.forEach(pt=>{if(pt.getAttribute("src")===et)if(!qe)qe=!0;else{const rt=pt.closest(".dss-image-wrapper");rt?rt.remove():pt.remove()}}),U(),p()})}),f.value.addEventListener("dragend",m=>{We.value=null});let u=null;const d=new MutationObserver(m=>{m.forEach(v=>{v.addedNodes.forEach(y=>{if(y.nodeType===1){y.tagName==="IMG"&&(y.removeAttribute("alt"),y.removeAttribute("data-alt"),y.setAttribute("alt",""),y.setAttribute("data-alt",""),y.alt="");const x=y.querySelectorAll&&y.querySelectorAll("img");x&&x.forEach(N=>{N.removeAttribute("alt"),N.removeAttribute("data-alt"),N.setAttribute("alt",""),N.setAttribute("data-alt",""),N.alt=""})}})}),u&&clearTimeout(u),u=setTimeout(()=>{U(),Mo(),u=null},100)});if(d.observe(f.value,{childList:!0,subtree:!0}),e.nextTick(()=>{const m=document.querySelector(".dss-text-editor-toolbar");if(m){const v=new MutationObserver(()=>{e.nextTick(()=>{Mo()})});v.observe(m,{childList:!0,subtree:!0}),m._toolbarMutationObserver=v}}),E.modelValue){const m=en(E.modelValue);f.value.innerHTML=m,$()}e.nextTick(()=>{const m=f.value.innerHTML||"",v=E.title||"",y=E.description||"";ot.value=m,Ct.value=v,ft.value=y,Pe.value=v,je.value=y,Zt(),U(),It(),On(),tl(),Jo()}),St(),un(),f.value._mutationObserver=d}}),e.onUnmounted(()=>{if(document.removeEventListener("click",Pn),window.removeEventListener("resize",Jn),f.value&&f.value._windowScrollHandler&&window.removeEventListener("scroll",f.value._windowScrollHandler,!0),co!==null&&(clearTimeout(co),co=null),f.value&&f.value._windowScrollTimeout!==null&&clearTimeout(f.value._windowScrollTimeout),ae.value&&clearTimeout(ae.value),At.value&&clearTimeout(At.value),f.value&&f.value._mutationObserver&&f.value._mutationObserver.disconnect(),gt.value&&gt.value.disconnect(),Qt.value!==null&&(cancelAnimationFrame(Qt.value),Qt.value=null),Mn.value!==null&&(clearTimeout(Mn.value),Mn.value=null),Rt.value!==null&&(clearTimeout(Rt.value),Rt.value=null),po(!0),f.value&&f.value._scrollHandlers){const{wrapper:n,content:a,handler:r}=f.value._scrollHandlers;n&&n.removeEventListener("scroll",r),a&&a.removeEventListener("scroll",r)}const l=document.querySelector(".dss-text-editor-toolbar");l&&l._toolbarMutationObserver&&l._toolbarMutationObserver.disconnect()});const Xo=l=>{const n=l.target,a=n.closest("a");if(a&&!E.disabled){l.preventDefault();const i=document.createRange();i.selectNodeContents(a);const u=window.getSelection();u.removeAllRanges(),u.addRange(i)}const r=n.closest(".dss-image-wrapper");r&&n.tagName!=="IMG"?e.nextTick(()=>{const i=window.getSelection();if(i.rangeCount>0){const d=i.getRangeAt(0).commonAncestorContainer,m=d.nodeType===3?d.parentElement:d;if(r.contains(m)&&m!==r.querySelector("img")){const v=document.createRange();v.setStartAfter(r),v.collapse(!0),i.removeAllRanges(),i.addRange(v)}}U(),St(),un(),xt(),On()}):e.nextTick(()=>{U(),St(),un(),xt(),On()})},fl=()=>{V();const l=window.getSelection();if(l&&l.rangeCount>0){const a=l.getRangeAt(0);vn.value=!a.collapsed&&eo(a),!a.collapsed&&ut.value&&(ut.value=null)}else vn.value=!1;if(U(),St(),un(),xt(),On(),l&&l.rangeCount>0){const r=l.getRangeAt(0).commonAncestorContainer,i=r.nodeType===3?r.parentElement:r;if(i&&i.closest(".dss-text-editor-footer")){l.removeAllRanges(),vn.value=!1;return}}["bold","italic","underline"].forEach(a=>{try{const r=window.getSelection();if(r.rangeCount>0){const i=r.getRangeAt(0);if(!i.collapsed)if(a==="bold"){const u=i.commonAncestorContainer,d=u.nodeType===3?u.parentElement:u;let m=!1;if(d&&((d.tagName==="STRONG"||d.tagName==="B"||d.closest&&d.closest("strong, b"))&&(m=!0),!m&&d.style&&parseInt(d.style.fontWeight)>=600&&(m=!0),!m))try{const v=window.getComputedStyle(d);parseInt(v.fontWeight)>=600&&(m=!0)}catch{}ue.value[a]=m}else{const u=document.queryCommandState(a);ue.value[a]=u}}}catch{}})},On=()=>{if(!E.richText||E.disabled||!f.value){lt.value="p";return}try{const l=window.getSelection();if(!l||l.rangeCount===0){lt.value="p";return}const a=l.getRangeAt(0).commonAncestorContainer,r=a.nodeType===3?a.parentElement:a;if(!r||!f.value.contains(r)){lt.value="p";return}const i=r.closest("h1, h2, h3, h4, h5, h6, p");if(!i){lt.value="p";return}const u=i.tagName.toLowerCase();["h1","h2","h3","h4","h5","h6","p"].includes(u)?lt.value=u:lt.value="p"}catch{lt.value="p"}},un=()=>{if(!f.value){ye.value=!1;return}try{const l=window.getSelection();let n=!1;if(l.rangeCount>0){const r=l.getRangeAt(0).commonAncestorContainer,i=r.nodeType===1?r.tagName==="BLOCKQUOTE"?r:r.closest("blockquote"):r.parentElement?.closest("blockquote");n=!!(i&&f.value.contains(i))}ye.value=n}catch{ye.value=!1}},eo=l=>{if(!l||!f.value)return!1;const n=l.commonAncestorContainer;if(!n)return!1;const a=n.nodeType===3?n.parentElement:n;return a?f.value.contains(a):!1},hn=()=>{Ce.value=!1},xt=()=>{if(!E.floatingToolbar||!E.richText||E.disabled){Ce.value=!1;return}const l=window.getSelection();if(!l||l.rangeCount===0){Ce.value=!1;return}const n=l.getRangeAt(0);if(n.collapsed||!eo(n)){Ce.value=!1;return}const a=n.getBoundingClientRect();if(!a||a.width===0&&a.height===0){Ce.value=!1;return}const r=f.value;if(!r){Ce.value=!1;return}const i=r.getBoundingClientRect();if(!i||i.width===0){Ce.value=!1;return}const u=40,d=8,m=a.top-u/2+15;let v=a.left+a.width/2;const y=window.innerWidth||document.documentElement.clientWidth||0;let x=0;Yt.value&&(x=Yt.value.getBoundingClientRect().width);const N=(x||320)/2;let b=i.left+N,F=i.right-N;if(F<b){const I=i.left+i.width/2;b=I,F=I}if(y>0){const I=N+d,J=y-N-d;if(b=Math.max(b,I),F=Math.min(F,J),F<b){const j=y/2;b=j,F=j}}v<b?v=b:v>F&&(v=F),Nt.value={position:"fixed",top:`${Math.max(m,8)}px`,left:`${v}px`,transform:"translate(-50%, -100%)",zIndex:10003},Ce.value=!0},gl=l=>{E.disabled||!E.richText||(it.value=it.value===l?null:l,l==="askAi"&&(ke.value=null))},wo=()=>{it.value=null,Ye.value=null},uo=l=>{Yn(l),wo()};let to=null,xo=null,no=null,mo=null;const Sl=l=>{if(E.disabled||!E.richText){yn(),Cn();return}const n=l.target,a=n.closest("a"),r=n.closest("img");if(to&&(clearTimeout(to),to=null),no&&(clearTimeout(no),no=null),a&&a!==xo){Cn(),xo=a;let i=a.getAttribute("href")||"";(!i||i==="#"||i==="")&&(i=a.textContent||""),pe.value=a,L.value=i,Le.value=!0,Ge.value=!0,oo(a)}else!a&&xo?(xo=null,to=setTimeout(()=>{Ge.value||yn()},150)):a&&a===xo&&oo(a);if(r&&r!==mo){yn(),mo=r;let i=r.getAttribute("alt");i===null&&(i=r.alt||"");let u=r.getAttribute("data-alt");u===null&&(u=i),r.hasAttribute("alt")||r.setAttribute("alt",i),r.hasAttribute("data-alt")||r.setAttribute("data-alt",u),ze.value=r,Bt.value=i.trim()||R("textEditor.image.noAlt"),Kt.value=!0,nn.value=!0,ht(r)}else!r&&mo?(mo=null,no=setTimeout(()=>{nn.value||Cn()},150)):r&&r===mo&&ht(r)},Ml=l=>{const n=l.relatedTarget;(!n||!n.closest(".dss-text-editor-content")&&!n.closest(".dss-link-popup"))&&(xo=null,mo=null,to&&(clearTimeout(to),to=null),no&&(clearTimeout(no),no=null),yn(),Cn())},yn=()=>{Ge.value=!1,setTimeout(()=>{Ge.value||(Le.value=!1,L.value="",_t.value||(pe.value=null))},100)},oo=l=>{if(!l||!f.value)return;const n=l.getBoundingClientRect(),i=n.top-32-8,u=n.left+n.width/2;_e.value={position:"fixed",top:`${i}px`,left:`${u}px`,transform:"translateX(-50%)",zIndex:10002}},Cn=()=>{nn.value=!1,setTimeout(()=>{nn.value||(Kt.value=!1,Bt.value="",xn.value||(ze.value=null))},100)},ht=l=>{if(!l||!f.value)return;const n=l.getBoundingClientRect(),i=n.top-32-8,u=n.left+n.width/2;fo.value={position:"fixed",top:`${i}px`,left:`${u}px`,transform:"translateX(-50%)",zIndex:10002}},Bl=()=>{if(!L.value||!pe.value)return;let n=pe.value.getAttribute("href")||L.value;!n.startsWith("http://")&&!n.startsWith("https://")&&!n.startsWith("mailto:")&&(n="https://"+n),window.open(n,"_blank","noopener,noreferrer")},Et=()=>{if(pe.value){const l=pe.value.textContent||"",n=pe.value.getAttribute("href")||"",a=pe.value;kt.value=n,P.value=l,Qe.value=l,Ge.value=!1,Le.value=!1,L.value="",pe.value=a,_t.value=!0}else if(He.value){const l=window.getSelection();if(l.rangeCount>0){const a=l.getRangeAt(0).commonAncestorContainer,r=a.nodeType===1?a.closest("a"):a.parentElement?.closest("a");if(r){const i=r.textContent||"",u=r.getAttribute("href")||"";kt.value=u,P.value=i,Qe.value=i,pe.value=r,_t.value=!0}}}else{tn.value=G();const l=window.getSelection();let n="";l.rangeCount>0&&(n=l.getRangeAt(0).toString()),kt.value="",P.value=n,Qe.value="",pe.value=null,_t.value=!0}e.nextTick(()=>{Ht.value&&(Ht.value.focus(),Ht.value.select())})},Mt=()=>{_t.value=!1,kt.value="",P.value="",Qe.value="",pe.value=null,tn.value=null},Yo=()=>{if(!kt.value.trim()){Mt();return}if(me.value?(ae.value&&(clearTimeout(ae.value),ae.value=null),k(),me.value=!1):k(),P.value.trim()||(P.value=kt.value.trim()),pe.value&&f.value&&f.value.contains(pe.value)){const l=window.getSelection();l.rangeCount>0&&l.removeAllRanges();const n=pe.value;if(n.setAttribute("href",kt.value.trim()),P.value.trim()!==Qe.value.trim()){for(;n.firstChild;)n.removeChild(n.firstChild);n.textContent=P.value.trim()}n.style.color="#60afdf",n.style.textDecoration="underline";const a=document.createRange();a.selectNodeContents(n),a.collapse(!1),l.removeAllRanges(),l.addRange(a),p()}else if(f.value){f.value.focus();const l=window.getSelection();l.removeAllRanges(),tn.value&&ve(tn.value);let n=null;if(l.rangeCount>0&&(n=l.getRangeAt(0)),n&&!n.collapsed){n.toString();const a=document.createElement("a");a.href=kt.value.trim(),a.textContent=P.value.trim(),a.style.color="#60afdf",a.style.textDecoration="underline",n.deleteContents(),n.insertNode(a);const r=document.createTextNode(" ");n.setStartAfter(a),n.insertNode(r),n.setStartAfter(r),n.collapse(!0),l.removeAllRanges(),l.addRange(n)}else{n||(n=document.createRange(),n.selectNodeContents(f.value),n.collapse(!1));const a=n.startContainer,r=a.nodeType===3,i=r&&n.startOffset===a.textContent.length,u=document.createElement("a");if(u.href=kt.value.trim(),u.textContent=P.value.trim(),u.style.color="#60afdf",u.style.textDecoration="underline",i){let d=a.parentElement;for(;d&&d!==f.value&&!["P","DIV","H1","H2","H3","H4","H5","H6"].includes(d.tagName);)d=d.parentElement;if(d&&d!==f.value){let m=d.nextElementSibling;if(m&&(m.innerHTML==="<br>"||m.innerHTML==="<br/>"||m.textContent.trim()==="")){m.textContent="",m.appendChild(u);const v=document.createTextNode(" ");m.appendChild(v);const y=document.createRange();y.setStartAfter(u),y.collapse(!0),l.removeAllRanges(),l.addRange(y)}else{if(n.startOffset>0){const y=a.textContent.substring(0,n.startOffset),x=y[y.length-1];if(x&&x!==" "&&x!==" "&&x!==`
79
- `){const N=document.createTextNode(" ");n.insertNode(N),n.setStartAfter(N)}}n.insertNode(u);const v=document.createTextNode(" ");n.setStartAfter(u),n.insertNode(v),n.setStartAfter(v),n.collapse(!0),l.removeAllRanges(),l.addRange(n)}}}else{if(r&&n.startOffset>0){const m=a.textContent.substring(0,n.startOffset),v=m[m.length-1];if(v&&v!==" "&&v!==" "&&v!==`
80
- `){const y=document.createTextNode(" ");n.insertNode(y),n.setStartAfter(y)}}n.insertNode(u);const d=document.createTextNode(" ");n.setStartAfter(u),n.insertNode(d),n.setStartAfter(d),n.collapse(!0),l.removeAllRanges(),l.addRange(n)}}p()}e.nextTick(()=>{St(),Mt()})},jo=()=>{if(!f.value||$e.value)return;const l=window.getSelection();let n=null;l&&l.rangeCount>0&&(n=G());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(f.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}}),i=[];let u;for(;u=r.nextNode();)i.push(u);let d=!1;for(let m=i.length-1;m>=0;m--){const v=i[m],y=v.textContent;a.lastIndex=0;const x=[...y.matchAll(a)];if(x.length===0)continue;const N=x.filter(I=>{const J=I[0],j=I.index;if(j>0&&y[j-1]==="@"||j+J.length<y.length&&y[j+J.length]==="@")return!1;const Ee=v.parentElement;return!(Ee&&Ee.closest("a"))});if(N.length===0)continue;if(N.length===1&&N[0][0]===y.trim()){const I=N[0][0],J=I.startsWith("http://")||I.startsWith("https://")?I:`https://${I}`,j=document.createElement("a");j.href=J,j.textContent=I,j.style.color="#60afdf",j.style.textDecoration="underline",v.parentNode&&(v.parentNode.replaceChild(j,v),d=!0);continue}let b=0;const F=document.createDocumentFragment();if(N.forEach(I=>{const J=I.index,j=I[0];if(J>b){const Vt=y.substring(b,J);Vt&&F.appendChild(document.createTextNode(Vt))}const Ee=j.startsWith("http://")||j.startsWith("https://")?j:`https://${j}`,et=document.createElement("a");et.href=Ee,et.textContent=j,et.style.color="#60afdf",et.style.textDecoration="underline",F.appendChild(et),b=J+j.length}),b<y.length){const I=y.substring(b);I&&F.appendChild(document.createTextNode(I))}v.parentNode&&F.childNodes.length>0&&(v.parentNode.replaceChild(F,v),d=!0)}d&&n&&e.nextTick(()=>{ve(n),St()})},Ko=()=>{if(!f.value)return;const l=/<u>([\s\S]*?)<\/u>|<ins>([\s\S]*?)<\/ins>/gi,n=document.createTreeWalker(f.value,NodeFilter.SHOW_TEXT,{acceptNode:i=>{const u=i.parentElement;return!u||u.closest("a, code, pre, u, ins")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}}),a=[];let r;for(;r=n.nextNode();)a.push(r);for(let i=a.length-1;i>=0;i--){const u=a[i],d=u.textContent,m=[...d.matchAll(l)];if(m.length===0)continue;let v=0;const y=document.createDocumentFragment();m.forEach(x=>{const N=x.index,b=x[0].startsWith("<u>")?"u":"ins",F=x[1]||x[2]||"";N>v&&y.appendChild(document.createTextNode(d.substring(v,N)));const I=document.createElement(b);I.textContent=F,y.appendChild(I),v=N+x[0].length}),v<d.length&&y.appendChild(document.createTextNode(d.substring(v))),u.parentNode&&y.childNodes.length>0&&u.parentNode.replaceChild(y,u)}},hl=l=>{if(!f.value||$e.value)return;if(!l){Ko();return}if(!["*","_",">"].includes(l))return;const a=window.getSelection();if(!a||a.rangeCount===0)return;const r=a.getRangeAt(0);if(!r.collapsed)return;const i=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(!i||i===f.value||!f.value.contains(i))return;const u=()=>{let Vt="",st=0,qe=!1;const pt=document.createTreeWalker(i,NodeFilter.SHOW_TEXT,{acceptNode:mn=>mn.parentElement?.closest("a, code, pre")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT});document.createTreeWalker(i,NodeFilter.SHOW_TEXT,null);let rt=0;for(;pt.nextNode();){const mn=pt.currentNode,Ve=mn.textContent||"",$n=rt;if(rt+=Ve.length,mn===r.startContainer){Vt+=Ve.substring(0,r.startOffset),st=$n+r.startOffset,qe=!0;break}Vt+=Ve}return qe||(st=Vt.length),{textBeforeCursor:Vt,cursorCharOffset:st}},{textBeforeCursor:d}=u();if(!d.length)return;let m=null,v=null;if(d.endsWith("**")&&(m=d.match(/\*\*(.+?)\*\*$/s))||d.endsWith("__")&&(m=d.match(/__(.+?)__$/s))?v="strong":d.endsWith("*")&&!d.endsWith("**")&&(m=d.match(new RegExp("(?<!\\*)\\*([^*]+)\\*$")))||d.endsWith("_")&&!d.endsWith("__")&&(m=d.match(new RegExp("(?<!_)_([^_]+)_$")))?v="em":l===">"&&((m=d.match(/<u>(.+?)<\/u>$/s))||(m=d.match(/<ins>(.+?)<\/ins>$/s)))&&(v=m[0].startsWith("<u>")?"u":"ins",m[0].startsWith("<u>"),m[0].startsWith("<u>")),!m||!m[1])return;const y=m[0],x=m[1],N=d.length-y.length,F=(Vt=>{let st=0;const qe=document.createTreeWalker(i,NodeFilter.SHOW_TEXT,{acceptNode:rt=>rt.parentElement?.closest("a, code, pre")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT});let pt;for(;pt=qe.nextNode();){const rt=(pt.textContent||"").length;if(st+rt>=Vt)return{node:pt,offset:Vt-st};st+=rt}return null})(N);if(!F)return;const I=document.createRange();I.setStart(F.node,F.offset),I.setEnd(r.endContainer,r.endOffset);const J=document.createElement(v);J.textContent=x,I.deleteContents(),I.insertNode(J);const j=window.getSelection(),Ee=document.createRange();Ee.setStartAfter(J),Ee.collapse(!0),j.removeAllRanges(),j.addRange(Ee);const et=G();e.nextTick(()=>{p(),et&&ve(et)})},$o=()=>{f.value&&($t.value=G(),jt.value="",tt.value="",pn.value="",Fe.value="",ct.value="",kn.value=null,ze.value=null,Ne.value="upload",xn.value=!0,Ft(),e.nextTick(()=>{dt.value&&dt.value.focus(),Xe.value&&(Xe.value.value="")}))},yt=l=>{const n=l.target?.files?.[0];if(!n){kn.value=null,tt.value="";return}kn.value=n;const a=new FileReader;a.onload=r=>{tt.value=r.target?.result||""},a.readAsDataURL(n)},Go=()=>{Xe.value&&Xe.value.click()},Qo=()=>{Fe.value&&(ct.value="")},Lo=()=>{ct.value&&(Fe.value="")},yl=()=>{let l=ze.value;if(!l){const n=window.getSelection();if(n&&n.rangeCount>0){const r=n.getRangeAt(0).commonAncestorContainer;l=r.nodeType===1?r.closest("img"):r.parentElement?.closest("img")}}if(l){const n=l.getAttribute("data-alt")||l.getAttribute("alt")||"";ze.value=l,jt.value=n.trim()===""||n.trim()==="Image"?"":n;const a=l.getAttribute("src")||l.src||"";a.startsWith("http://")||a.startsWith("https://")?(pn.value=a,tt.value="",Ne.value="url"):(tt.value=a,pn.value="",Ne.value="upload");const i=l.style.width||l.getAttribute("width")||"",u=l.style.height||l.getAttribute("height")||"";Fe.value=i.endsWith("px")?i.replace("px",""):i,ct.value=u.endsWith("px")?u.replace("px",""):u,$t.value=null}else{$o();return}xn.value=!0,nn.value=!1,Kt.value=!1,e.nextTick(()=>{Ne.value==="url"&&En.value?(En.value.focus(),En.value.select()):dt.value&&(dt.value.focus(),dt.value.select()),Xe.value&&(Xe.value.value="")})},Eo=()=>{xn.value=!1,jt.value="",tt.value="",pn.value="",Fe.value="",ct.value="",kn.value=null,ze.value=null,$t.value=null,Ne.value="upload"},lo=()=>{const l=(jt.value||"").trim(),n=f.value?._mutationObserver;n&&n.disconnect(),me.value?(ae.value&&(clearTimeout(ae.value),ae.value=null),k(),me.value=!1):k();const a=Ne.value==="url"?pn.value.trim():tt.value;if(ze.value&&f.value&&f.value.contains(ze.value)){a&&(ze.value.src=a),ze.value.setAttribute("alt",l),ze.value.setAttribute("data-alt",l),Fe.value?(ze.value.style.width=`${Fe.value}px`,ze.value.setAttribute("width",Fe.value)):(ze.value.style.removeProperty("width"),ze.value.removeAttribute("width")),ct.value?(ze.value.style.height=`${ct.value}px`,ze.value.setAttribute("height",ct.value)):(ze.value.style.removeProperty("height"),ze.value.removeAttribute("height"));const r=window.getSelection();if(r){r.removeAllRanges();const i=document.createRange();i.setStartAfter(ze.value),i.collapse(!0),r.addRange(i)}p()}else{if(!a){n&&f.value&&n.observe(f.value,{childList:!0,subtree:!0}),Eo();return}if(f.value){f.value.focus();const r=window.getSelection();r&&r.rangeCount>0&&r.removeAllRanges();const i=window.getSelection();let u=null;if($t.value&&(ve($t.value),i&&i.rangeCount>0&&(u=i.getRangeAt(0))),!u&&i&&i.rangeCount>0&&(u=i.getRangeAt(0)),!u&&f.value){if(u=document.createRange(),f.value.childNodes.length===0){const y=document.createElement("p");y.innerHTML="<br>",f.value.appendChild(y),u.setStart(y,0),u.collapse(!0)}else u.selectNodeContents(f.value),u.collapse(!1);i&&(i.removeAllRanges(),i.addRange(u))}if(!u){Eo();return}const d=u.commonAncestorContainer,m=d.nodeType===3?d.parentElement:d;if(!f.value.contains(m)){if(u=document.createRange(),f.value.childNodes.length===0){const y=document.createElement("p");y.innerHTML="<br>",f.value.appendChild(y),u.setStart(y,0),u.collapse(!0)}else u.selectNodeContents(f.value),u.collapse(!1);i&&(i.removeAllRanges(),i.addRange(u))}const v=document.createElement("img");v.src=a,v.setAttribute("alt",l),v.setAttribute("data-alt",l),Fe.value&&(v.style.width=`${Fe.value}px`,v.setAttribute("width",Fe.value)),ct.value&&(v.style.height=`${ct.value}px`,v.setAttribute("height",ct.value));try{u.insertNode(v),u.setStartAfter(v),u.collapse(!0),i&&(i.removeAllRanges(),i.addRange(u))}catch{if(f.value){if(f.value.childNodes.length===0){const N=document.createElement("p");f.value.appendChild(N),N.appendChild(v)}else{const N=f.value.lastChild;if(N&&N.nodeType===1)N.appendChild(v);else{const b=document.createElement("p");f.value.appendChild(b),b.appendChild(v)}}const x=document.createRange();x.setStartAfter(v),x.collapse(!0),i&&(i.removeAllRanges(),i.addRange(x))}}ze.value=v,p()}}e.nextTick(()=>{n&&f.value&&n.observe(f.value,{childList:!0,subtree:!0}),St(),xt(),Eo()})};e.watch(()=>E.modelValue,l=>{if(E.richText&&f.value&&!$e.value){const n=en(l||""),r=f.value.innerHTML.replace(/&nbsp;|\u00A0/g," "),i=n.replace(/&nbsp;|\u00A0/g," ");if(r!==i){const u=G();f.value.innerHTML=n,e.nextTick(()=>{$();const d=f.value.innerHTML||"",m=E.title||"",v=E.description||"";ot.value=d,Ct.value=m,ft.value=v,Gt.value=d,Pe.value=m,je.value=v,nt.value=[],on.value=[],ae.value&&(clearTimeout(ae.value),ae.value=null),me.value=!1,u&&ve(u),Zt(),U(),It(),St(),xt(),On(),Sn("watch-modelValue")})}}},{immediate:!0}),e.watch(()=>E.richText,l=>{l?(xt(),e.nextTick(()=>{tl()})):(hn(),mt.value=[],gt.value&&(gt.value.disconnect(),gt.value=null)),On()}),e.watch(()=>E.floatingToolbar,l=>{l?xt():hn()}),e.watch(()=>E.disabled,l=>{l&&hn(),On()}),e.watch(()=>E.description,()=>{e.nextTick(()=>{De.value?Ue():xe()})}),e.watch(()=>E.title,()=>{e.nextTick(()=>{Dt.value?fn():ko()})}),e.watch(()=>E.customToolbarSlots,()=>{e.nextTick(()=>{Mo()})},{deep:!0}),e.watch(()=>E.comments,(l,n)=>{if(So.value){So.value=!1;return}bo.value||E.richText&&f.value&&e.nextTick(()=>{Jo()})},{deep:!0,immediate:!1});const Jo=()=>{if(!bo.value&&!(!E.comments||!Array.isArray(E.comments)||E.comments.length===0)&&!(!E.richText||!f.value)){bo.value=!0;try{const l=new Set,n=E.comments.filter(d=>{const m=String(d.conversation_id||d.id);return l.has(m)?!1:(l.add(m),!0)}),a=f.value.querySelectorAll("[data-comment], [data-fake-comment]"),r=a.length;a.forEach(d=>{const m=d.parentNode;if(m){for(;d.firstChild;)m.insertBefore(d.firstChild,d);m.removeChild(d)}});let i=0;const u=new Set;n.forEach(d=>{if(!d.conversation_id||!d.selection_range)return;const m=typeof d.conversation_id=="string"&&d.conversation_id.startsWith("comment-")?null:Number(d.conversation_id)||d.conversation_id;if(!m)return;const v=String(m);if(u.has(v))return;const y=f.value.querySelector(`[data-comment="${v}"]`);if(y){Zn(y,d),u.add(v);return}try{const x=Cl(d.selection_range,d.selection_text);if(x&&!x.collapsed){const N=x.commonAncestorContainer,b=N.nodeType===3?N.parentElement:N;if(b){const J=b.closest("[data-comment], [data-fake-comment]");if(J){const j=J.getAttribute("data-comment")||J.getAttribute("data-fake-comment");if(String(j)===String(m)){J.setAttribute("data-comment",v),J.removeAttribute("data-fake-comment"),Zn(J,d),u.add(v);return}else return}}const F=f.value.querySelector(`[data-comment="${v}"]`);if(F){Zn(F,d),u.add(v);return}const I=document.createElement("span");I.setAttribute("data-comment",v),Zn(I,d);try{x.surroundContents(I),i++,u.add(v)}catch{try{const j=document.createRange();j.setStart(x.startContainer,x.startOffset),j.setEnd(x.endContainer,x.endOffset),kl(j),j.surroundContents(I),i++,u.add(v)}catch{try{const Ee=x.extractContents();I.appendChild(Ee),x.insertNode(I),i++,u.add(v)}catch(Ee){console.warn("Failed to create comment marker:",Ee)}}}}}catch{}}),e.nextTick(()=>{Sn("restoreCommentsFromModel"),p(),bo.value=!1})}catch{bo.value=!1}}},kl=l=>{if(!l||!f.value)return l;try{const n=["P","DIV","H1","H2","H3","H4","H5","H6","LI","BLOCKQUOTE","PRE"];let a=l.startContainer,r=l.startOffset;if(a.nodeType===3){const d=a.parentElement;d&&n.includes(d.tagName)&&(r===0&&!_o(a)||l.setStartBefore(d))}else a.nodeType===1&&n.includes(a.tagName)&&r>0&&l.setStartBefore(a);let i=l.endContainer,u=l.endOffset;if(i.nodeType===3){const d=i.parentElement;d&&n.includes(d.tagName)&&(u===i.length&&!el(i)||l.setEndAfter(d))}else i.nodeType===1&&n.includes(i.tagName)&&u<i.childNodes.length&&l.setEndAfter(i);return l}catch{return l}},_o=l=>{let n=l.previousSibling;for(;n;){if(n.nodeType===3&&n.textContent.trim().length>0||n.nodeType===1&&n.textContent.trim().length>0)return!0;n=n.previousSibling}return!1},el=l=>{let n=l.nextSibling;for(;n;){if(n.nodeType===3&&n.textContent.trim().length>0||n.nodeType===1&&n.textContent.trim().length>0)return!0;n=n.nextSibling}return!1},Cl=(l,n)=>{if(!l||!f.value)return null;try{const a=document.createRange();if(l.type==="text"&&typeof l.start=="number"&&typeof l.end=="number"){let r=0;const i=[f.value];let u=null,d=!1,m=!1;for(;!m&&(u=i.pop());)if(u.nodeType===3){const v=r+u.length;!d&&l.start>=r&&l.start<=v&&(a.setStart(u,l.start-r),d=!0),d&&l.end>=r&&l.end<=v&&(a.setEnd(u,l.end-r),m=!0),r=v}else{let v=u.childNodes.length;for(;v--;)i.push(u.childNodes[v])}return d?kl(a):null}}catch{return null}return null},Zn=(l,n)=>{if(!l||!n)return;const a=n.conversation||[],r=new Set,i=[],u=m=>{m&&m.id&&!r.has(m.id)&&(r.add(m.id),i.push(m))};a.length>0&&a.forEach(m=>{m.user&&u(m.user)}),i.length>0?l.setAttribute("data-comment-user",JSON.stringify(i[0])):l.removeAttribute("data-comment-user"),i.length>1?l.setAttribute("data-comment-user-2",JSON.stringify(i[1])):l.removeAttribute("data-comment-user-2");const d=a.length;d>0?l.setAttribute("data-comment-count",String(d)):l.removeAttribute("data-comment-count")},Sn=(l="unknown")=>{if(!E.richText||!f.value){mt.value=[];return}Date.now()-Ln.value<ln&&Qt.value!==null||Qt.value===null&&(Qt.value=requestAnimationFrame(()=>{if(Qt.value=null,Ln.value=Date.now(),Jt.value)return;Jt.value=!0;const a={},r=f.value;if(!r){Jt.value=!1;return}const i=r.closest(".editor-with-comments");if(!i){Jt.value=!1;return}const u=r.querySelectorAll("[data-comment], [data-fake-comment]"),d=[],m=new Set;u.forEach(b=>{const F=b.getAttribute("data-comment")||b.getAttribute("data-fake-comment");F&&b.tagName==="SPAN"&&(m.has(F)||(d.push(b),m.add(F)))}),u.forEach(b=>{const F=b.getAttribute("data-comment")||b.getAttribute("data-fake-comment");!F||m.has(F)||(["P","DIV","H1","H2","H3","H4","H5","H6"].includes(b.tagName)?b.querySelector(`span[data-comment="${F}"], span[data-fake-comment="${F}"]`)||(d.push(b),m.add(F)):b.tagName!=="SPAN"&&(d.push(b),m.add(F)))});const v=i.getBoundingClientRect(),y=r.getBoundingClientRect();d.forEach((b,F)=>{let I=b.getAttribute("data-comment")||b.getAttribute("data-fake-comment");if(!I)return;if(typeof I=="string"&&I.startsWith("comment-")){const qn=b.textContent?.trim(),Un=E.comments?.find(bn=>(typeof bn.conversation_id=="string"&&bn.conversation_id.startsWith("comment-")?null:bn.conversation_id)&&bn.selection_text?.trim()===qn);Un?(I=String(Un.conversation_id),b.setAttribute("data-comment",I),b.removeAttribute("data-fake-comment")):(I=String(Date.now()),b.setAttribute("data-comment",I),b.removeAttribute("data-fake-comment"))}const J=b.getBoundingClientRect(),j=window.getComputedStyle(b),Ee=parseFloat(j.lineHeight)||parseFloat(j.fontSize)*1.2,st=J.top-y.top+Ee/2-15,pt=y.top-v.top+st;let rt=null,mn=null,Ve=0;const $n=[],Wn=new Set;if(I&&E.comments){const qn=E.comments.find(Un=>String(Un.conversation_id||Un.id)===String(I));if(qn){const Un=qn.conversation||[];Un.length>0?(Un.forEach(bn=>{bn.user&&bn.user.id&&!Wn.has(bn.user.id)&&(Wn.add(bn.user.id),$n.push(bn.user))}),Ve=Un.length):(Ve=0,rt=null,mn=null),$n.length>0?rt=$n[0]:rt=null,$n.length>1?mn=$n[1]:mn=null}}const ol=J.top+Ee/2-15,$l=ol+30,bl=5,ll=$l>y.top+bl&&ol<y.bottom-bl?1:0;mt.value.find(qn=>qn.id===I);let vo=b;if(!vo&&I&&f.value){const qn=String(I);vo=f.value.querySelector(`[data-comment="${qn}"], [data-fake-comment="${qn}"]`)}const xl=$n.length;a[I]?(a[I].top=pt,a[I].opacity=ll,a[I].element=vo,a[I].firstUser=rt,a[I].secondUser=mn,a[I].totalCount=Ve,a[I].uniqueUserCount=xl):a[I]={id:I,top:pt,opacity:ll,element:vo,firstUser:rt,secondUser:mn,totalCount:Ve,uniqueUserCount:xl}});const x=Object.values(a).map(b=>{const F=Math.max(0,(b.uniqueUserCount??0)-2);if(!b.element&&b.id&&f.value){const J=String(b.id);b.element=f.value.querySelector(`[data-comment="${J}"], [data-fake-comment="${J}"]`)}return{...b,firstUser:b.firstUser||null,secondUser:b.secondUser||null,totalCount:b.totalCount,additionalCount:F}});(mt.value.length!==x.length||x.some((b,F)=>{const I=mt.value[F];if(!I)return!0;const J=(I.firstUser?.id||null)!==(b.firstUser?.id||null),j=(I.secondUser?.id||null)!==(b.secondUser?.id||null);return I.id!==b.id||Math.abs(I.top-b.top)>1||I.opacity!==b.opacity||I.totalCount!==b.totalCount||I.additionalCount!==b.additionalCount||J||j||I.element!==b.element}))&&(mt.value=x),Jt.value=!1}))},Tl=l=>{if(!l)return;let n=l.element;if(!n&&l.id&&f.value){const a=String(l.id);n=f.value.querySelector(`[data-comment="${a}"], [data-fake-comment="${a}"]`)}n&&(po(),jn.value=n,n.classList.add("editor-comment-highlighted"))},po=(l=!1)=>{!l&&Wt.value!==null&&jn.value&&(jn.value.getAttribute("data-comment")||jn.value.getAttribute("data-fake-comment"))===Wt.value||(f.value&&f.value.querySelectorAll(".editor-comment-highlighted").forEach(a=>{a.classList.remove("editor-comment-highlighted")}),jn.value&&(jn.value.classList.remove("editor-comment-highlighted"),jn.value=null))},Ao=l=>{if(!l||!l.element)return;po(!0);const n=l.element.getAttribute("data-comment")||l.element.getAttribute("data-fake-comment");if(!n)return;const a=`[data-comment="${n}"], [data-fake-comment="${n}"]`;he("comment-marker-clicked",{commentId:n,selector:a,element:l.element})},Hl=()=>{po()},tl=()=>{!E.richText||!f.value||(gt.value&&gt.value.disconnect(),Rt.value!==null&&(clearTimeout(Rt.value),Rt.value=null),gt.value=new MutationObserver(()=>{Rt.value===null&&(Rt.value=setTimeout(()=>{Rt.value=null,e.nextTick(()=>{Sn("MutationObserver")})},200))}),gt.value.observe(f.value,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-comment","data-fake-comment","data-comment-user","data-comment-user-2","data-comment-count"]}),Sn("setupCommentMarkersObserver-initial"))},nl=(l,n)=>{if(!l||!n)return;const a=n.getBoundingClientRect();let r=a.top,i=a.right+4;l.style.top=`${r}px`,l.style.left=`${i}px`,l.offsetHeight;const u=l.getBoundingClientRect(),d=window.innerWidth,m=window.innerHeight;if(u.right>d){const v=a.left-u.width-4;l.style.left=`${v}px`}if(u.bottom>m){const v=Math.max(8,m-u.height-8);l.style.top=`${v}px`}u.top<0&&(l.style.top="8px")};return e.watch(()=>Ye.value,l=>{e.nextTick(()=>{document.querySelectorAll(".dss-toolbar-dropdown-submenu").forEach(a=>{const r=a.getAttribute("data-submenu-id");if(r===l&&l){const i=document.querySelector(`.dss-toolbar-dropdown-item-has-submenu[data-submenu-id="${r}"]`);if(i){if(a.parentNode!==document.body){const u=a.parentNode;a.dataset.originalParentRef=u===i?"inside":"sibling",document.body.appendChild(a)}a.style.display="block",a.style.visibility="hidden",a.style.opacity="0",requestAnimationFrame(()=>{requestAnimationFrame(()=>{nl(a,i),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(()=>[ke.value,it.value],()=>{ke.value==="askAi"||it.value==="askAi"?e.nextTick(()=>{Uo()}):(Ye.value=null,e.nextTick(()=>{document.querySelectorAll(".dss-toolbar-dropdown-submenu").forEach(n=>{if(n.parentNode===document.body){const a=n.getAttribute("data-submenu-id");if(a){const r=document.querySelector(`.dss-toolbar-dropdown-item-has-submenu[data-submenu-id="${a}"]`);if(r)if(n.dataset.originalParentRef==="inside")r.appendChild(n);else{const u=r.closest(".dss-toolbar-dropdown");u&&u.insertBefore(n,r.nextSibling)}}}})}))}),e.watch(()=>E.locale,l=>{l&&l!==Ie.value&&(Ie.value=l)},{immediate:!0}),Ut({openCommentOverlayForSelector:Nn,updateCommentMarkers:Sn,restoreCommentsFromModel:Jo}),(l,n)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-text-editor-container editor-with-comments",_n.value]),style:e.normalizeStyle(An.value)},[Z.richText?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-text-editor-toolbar",onMousedown:n[14]||(n[14]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("div",Ji,[e.createElementVNode("div",{class:"dss-toolbar-button",onClick:Be,title:e.unref(R)("textEditor.toolbar.undo")},[...n[45]||(n[45]=[e.createElementVNode("svg",{viewBox:"0 0 18 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M9.23302 0.888889C6.90278 0.888889 4.79238 1.76889 3.16561 3.2L0 0V8H7.91402L4.73083 4.78222C5.9531 3.75111 7.50953 3.11111 9.23302 3.11111C12.3459 3.11111 14.9927 5.16444 15.916 8L18 7.30667C16.7777 3.58222 13.3219 0.888889 9.23302 0.888889Z",fill:"#323232"})],-1)])],8,ec),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-disabled":!D.value}]),onClick:Ot,title:e.unref(R)("textEditor.toolbar.redo")},[...n[46]||(n[46]=[e.createElementVNode("svg",{viewBox:"0 0 18 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M14.8328 3.2C13.2053 1.76889 11.0938 0.888889 8.76246 0.888889C4.67155 0.888889 1.21408 3.58222 0 7.30667L2.07625 8C3 5.16444 5.6393 3.11111 8.76246 3.11111C10.478 3.11111 12.044 3.75111 13.2669 4.78222L10.0821 8H18V0L14.8328 3.2Z",fill:"#323232"})],-1)])],10,tc),n[73]||(n[73]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",nc,[e.createElementVNode("div",{class:"dss-toolbar-button dss-toolbar-dropdown-toggle",onClick:n[0]||(n[0]=a=>Po("paragraph")),title:e.unref(R)("textEditor.toolbar.paragraphFormat")},[lt.value==="h1"?(e.openBlock(),e.createElementBlock("svg",lc,[...n[47]||(n[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)])])):lt.value==="h2"?(e.openBlock(),e.createElementBlock("svg",ac,[...n[48]||(n[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)])])):lt.value==="h3"?(e.openBlock(),e.createElementBlock("svg",sc,[...n[49]||(n[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)])])):lt.value==="h4"?(e.openBlock(),e.createElementBlock("svg",rc,[...n[50]||(n[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)])])):lt.value==="h5"?(e.openBlock(),e.createElementBlock("svg",ic,[...n[51]||(n[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)])])):lt.value==="h6"?(e.openBlock(),e.createElementBlock("svg",cc,[...n[52]||(n[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",dc,[...n[53]||(n[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)])])),n[54]||(n[54]=e.createElementVNode("span",{class:"dss-toolbar-dropdown-arrow"},"˅",-1))],8,oc),ke.value==="paragraph"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:n[8]||(n[8]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[1]||(n[1]=a=>Yn("<h1>"))},[n[55]||(n[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(R)("textEditor.paragraph.heading1")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[2]||(n[2]=a=>Yn("<h2>"))},[n[56]||(n[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(R)("textEditor.paragraph.heading2")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[3]||(n[3]=a=>Yn("<h3>"))},[n[57]||(n[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(R)("textEditor.paragraph.heading3")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[4]||(n[4]=a=>Yn("<h4>"))},[n[58]||(n[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(R)("textEditor.paragraph.heading4")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[5]||(n[5]=a=>Yn("<h5>"))},[n[59]||(n[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(R)("textEditor.paragraph.heading5")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[6]||(n[6]=a=>Yn("<h6>"))},[n[60]||(n[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(R)("textEditor.paragraph.heading6")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[7]||(n[7]=a=>Yn("<p>"))},[n[61]||(n[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(R)("textEditor.paragraph.paragraph")),1)])])):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":sn("bold")}]),onClick:n[9]||(n[9]=a=>Xn("bold")),title:e.unref(R)("textEditor.toolbar.bold")},[...n[62]||(n[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,uc),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":sn("italic")}]),onClick:n[10]||(n[10]=a=>Xn("italic")),title:e.unref(R)("textEditor.toolbar.italic")},[...n[63]||(n[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,mc),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":sn("underline")}]),onClick:n[11]||(n[11]=a=>Xn("underline")),title:e.unref(R)("textEditor.toolbar.underline")},[...n[64]||(n[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,pc),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":ye.value}]),onClick:Oo,title:e.unref(R)("textEditor.toolbar.citation")},[...n[65]||(n[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,vc),n[74]||(n[74]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),He.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-button",onClick:ul,title:e.unref(R)("textEditor.toolbar.removeLink")},[...n[67]||(n[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,gc)):(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-button",onClick:dl,title:e.unref(R)("textEditor.toolbar.insertLink")},[...n[66]||(n[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,fc)),n[75]||(n[75]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":sn("insertUnorderedList")}]),onClick:ml,title:e.unref(R)("textEditor.toolbar.bulletList")},[...n[68]||(n[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,hc),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":sn("insertOrderedList")}]),onClick:Zo,title:e.unref(R)("textEditor.toolbar.numberList")},[...n[69]||(n[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,yc),n[76]||(n[76]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:"dss-toolbar-button",onClick:$o,title:e.unref(R)("textEditor.toolbar.image")},[...n[70]||(n[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,kc),vn.value?(e.openBlock(),e.createElementBlock("div",Cc)):e.createCommentVNode("",!0),vn.value?(e.openBlock(),e.createElementBlock("div",{key:3,class:"dss-toolbar-button",title:e.unref(R)("textEditor.toolbar.comment"),onClick:vl},[...n[71]||(n[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,bc)):e.createCommentVNode("",!0),Z.askAi?(e.openBlock(),e.createElementBlock("div",wc)):e.createCommentVNode("",!0),Z.askAi?(e.openBlock(),e.createElementBlock("div",xc,[e.createElementVNode("div",{class:"dss-toolbar-ai-button dss-toolbar-dropdown-toggle",onClick:n[12]||(n[12]=a=>Po("askAi")),title:e.unref(R)("textEditor.toolbar.askAi")},[n[72]||(n[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",Vc,e.toDisplayString(e.unref(R)("textEditor.toolbar.askAi")),1)],8,Ec),ke.value==="askAi"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:n[13]||(n[13]=e.withModifiers(()=>{},["stop"]))},[e.renderSlot(l.$slots,"ask-ai-dropdown")])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),e.createElementVNode("div",Nc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Z.customToolbarSlots,(a,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:r},[Me(a)?(e.openBlock(),e.createElementBlock("div",Sc,[e.renderSlot(l.$slots,a)])):e.createCommentVNode("",!0),Me(a)&&r<Z.customToolbarSlots.length-1&&Tt(r)?(e.openBlock(),e.createElementBlock("div",Mc)):e.createCommentVNode("",!0)],64))),128))])],32)):e.createCommentVNode("",!0),(ke.value==="paragraph"||ke.value==="askAi")&&Z.richText?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-dropdown-overlay",onClick:Ft})):e.createCommentVNode("",!0),e.createVNode(_l,{showModal:_t.value,width:"500px",height:"55vh",onCloseModal:Mt},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(R)("textEditor.link.editLink")),1)]),content:e.withCtx(()=>[e.createElementVNode("div",Bc,[e.createElementVNode("div",Tc,[e.createElementVNode("label",Hc,e.toDisplayString(e.unref(R)("textEditor.link.altText")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"linkAltInput",ref:Xt,type:"text","onUpdate:modelValue":n[15]||(n[15]=a=>P.value=a),class:"dss-link-modal-input",placeholder:e.unref(R)("textEditor.link.enterAltText"),onKeyup:e.withKeys(Yo,["enter"])},null,40,$c),[[e.vModelText,P.value]])]),e.createElementVNode("div",Lc,[e.createElementVNode("label",_c,e.toDisplayString(e.unref(R)("textEditor.link.url")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"linkUrlInput",ref:Ht,type:"text","onUpdate:modelValue":n[16]||(n[16]=a=>kt.value=a),class:"dss-link-modal-input",placeholder:e.unref(R)("textEditor.link.enterUrl"),onKeyup:e.withKeys(Yo,["enter"])},null,40,Ac),[[e.vModelText,kt.value]])])])]),actions:e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-cancel",onClick:Mt},e.toDisplayString(e.unref(R)("textEditor.link.cancel")),1),e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-save",onClick:Yo},e.toDisplayString(e.unref(R)("textEditor.link.save")),1)]),_:1},8,["showModal"]),e.createVNode(_l,{showModal:xn.value,width:"500px",height:"80vh",onCloseModal:Eo},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(ze.value?e.unref(R)("textEditor.image.editImage"):e.unref(R)("textEditor.image.addImage")),1)]),content:e.withCtx(()=>[e.createElementVNode("div",Dc,[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-image-modal-tab",{"dss-image-modal-tab-active":Ne.value==="upload"}]),onClick:n[17]||(n[17]=a=>Ne.value="upload")},e.toDisplayString(e.unref(R)("textEditor.image.upload")),3),n[77]||(n[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":Ne.value==="url"}]),onClick:n[18]||(n[18]=a=>Ne.value="url")},e.toDisplayString(e.unref(R)("textEditor.image.imageLink")),3)]),Ne.value==="upload"?(e.openBlock(),e.createElementBlock("div",Rc,[e.createElementVNode("div",Ic,[e.createElementVNode("div",Fc,[be.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("label",zc,e.toDisplayString(e.unref(R)("textEditor.image.uploadImage")),1)),be.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-image-upload-preview",onClick:Go},[e.createElementVNode("img",{src:tt.value,alt:"Preview",class:"dss-image-preview-image"},null,8,Pc),n[78]||(n[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:Xe,type:"file",accept:"image/*",class:"dss-image-file-input-hidden",onChange:yt},null,544)])):(e.openBlock(),e.createElementBlock("input",{key:2,ref_key:"imageFileInput",ref:Xe,type:"file",accept:"image/*",class:"dss-link-modal-input dss-link-modal-input-image",onChange:yt},null,544))]),e.createElementVNode("div",Oc,[e.createElementVNode("label",Zc,e.toDisplayString(e.unref(R)("textEditor.image.altText")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"imageAltInput",ref:dt,type:"text","onUpdate:modelValue":n[19]||(n[19]=a=>jt.value=a),class:"dss-link-modal-input",placeholder:e.unref(R)("textEditor.image.enterAltText"),onKeyup:e.withKeys(lo,["enter"])},null,40,Wc),[[e.vModelText,jt.value]])]),e.createElementVNode("div",qc,[e.createElementVNode("label",Uc,e.toDisplayString(e.unref(R)("textEditor.image.width")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":n[20]||(n[20]=a=>Fe.value=a),class:"dss-link-modal-input",placeholder:e.unref(R)("textEditor.image.auto"),onKeyup:e.withKeys(lo,["enter"]),onInput:Qo},null,40,Xc),[[e.vModelText,Fe.value]])]),e.createElementVNode("div",Yc,[e.createElementVNode("label",jc,e.toDisplayString(e.unref(R)("textEditor.image.height")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":n[21]||(n[21]=a=>ct.value=a),class:"dss-link-modal-input",placeholder:e.unref(R)("textEditor.image.auto"),onKeyup:e.withKeys(lo,["enter"]),onInput:Lo},null,40,Kc),[[e.vModelText,ct.value]])])])])):e.createCommentVNode("",!0),Ne.value==="url"?(e.openBlock(),e.createElementBlock("div",Gc,[e.createElementVNode("div",Qc,[e.createElementVNode("div",Jc,[e.createElementVNode("label",ed,e.toDisplayString(e.unref(R)("textEditor.image.imageUrl")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"imageUrlInput",ref:En,type:"text","onUpdate:modelValue":n[22]||(n[22]=a=>pn.value=a),class:"dss-link-modal-input",placeholder:e.unref(R)("textEditor.image.enterImageUrl"),onKeyup:e.withKeys(lo,["enter"])},null,40,td),[[e.vModelText,pn.value]])]),e.createElementVNode("div",nd,[e.createElementVNode("label",od,e.toDisplayString(e.unref(R)("textEditor.image.altText")),1),e.withDirectives(e.createElementVNode("input",{type:"text","onUpdate:modelValue":n[23]||(n[23]=a=>jt.value=a),class:"dss-link-modal-input",placeholder:e.unref(R)("textEditor.image.enterAltText"),onKeyup:e.withKeys(lo,["enter"])},null,40,ld),[[e.vModelText,jt.value]])]),e.createElementVNode("div",ad,[e.createElementVNode("label",sd,e.toDisplayString(e.unref(R)("textEditor.image.width")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":n[24]||(n[24]=a=>Fe.value=a),class:"dss-link-modal-input",placeholder:e.unref(R)("textEditor.image.auto"),onKeyup:e.withKeys(lo,["enter"]),onInput:Qo},null,40,rd),[[e.vModelText,Fe.value]])]),e.createElementVNode("div",id,[e.createElementVNode("label",cd,e.toDisplayString(e.unref(R)("textEditor.image.height")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":n[25]||(n[25]=a=>ct.value=a),class:"dss-link-modal-input",placeholder:e.unref(R)("textEditor.image.auto"),onKeyup:e.withKeys(lo,["enter"]),onInput:Lo},null,40,dd),[[e.vModelText,ct.value]])])])])):e.createCommentVNode("",!0)]),actions:e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-cancel",onClick:Eo},e.toDisplayString(e.unref(R)("textEditor.image.cancel")),1),e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-save",onClick:lo},e.toDisplayString(e.unref(R)("textEditor.image.save")),1)]),_:1},8,["showModal"]),e.createElementVNode("div",{class:e.normalizeClass(["dss-text-editor-title-wrapper",{"dss-text-editor-no-border-bottom":go.value&&Dt.value}])},[e.createElementVNode("p",null,e.toDisplayString(e.unref(R)("textEditor.labels.title")),1),e.createElementVNode("div",ud,[Dt.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",md,[Z.title?(e.openBlock(),e.createElementBlock("span",pd,e.toDisplayString(Z.title),1)):(e.openBlock(),e.createElementBlock("span",vd,e.toDisplayString(ie.value),1))])),e.createElementVNode("textarea",{ref_key:"titleInputRef",ref:Te,value:Z.title,onInput:Fo,onFocus:yo,onBlur:ro,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-title-input",{"dss-text-editor-title-input-blurred":!Dt.value}]),placeholder:ie.value,disabled:Z.disabled,rows:"1"},null,42,fd)])],2),go.value&&Dt.value?(e.openBlock(),e.createElementBlock("div",gd,[e.renderSlot(l.$slots,"title-slot")])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["dss-text-editor-description-wrapper",{"dss-text-editor-no-border-bottom":ho.value&&De.value}])},[e.createElementVNode("p",null,e.toDisplayString(e.unref(R)("textEditor.labels.description")),1),e.createElementVNode("div",hd,[De.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",yd,[Z.description?(e.openBlock(),e.createElementBlock("span",kd,e.toDisplayString(Z.description),1)):(e.openBlock(),e.createElementBlock("span",Cd,e.toDisplayString(ce.value),1))])),e.createElementVNode("textarea",{ref_key:"descriptionInputRef",ref:Se,value:Z.description,onInput:gn,onFocus:K,onBlur:No,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-description-input",{"dss-text-editor-description-input-blurred":!De.value}]),placeholder:ce.value,disabled:Z.disabled,rows:"1"},null,42,bd)])],2),ho.value&&De.value?(e.openBlock(),e.createElementBlock("div",wd,[e.renderSlot(l.$slots,"description-slot")])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(mt.value,a=>(e.openBlock(),e.createElementBlock("div",{key:a.id,class:e.normalizeClass(["editor-comment-marker-group",{"editor-comment-marker-active":Wt.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=>Tl(a),onMouseleave:Hl},[a.firstUser?(e.openBlock(),e.createElementBlock("div",{key:0,class:"editor-comment-marker editor-comment-marker-first",onClick:e.withModifiers(r=>Ao(a),["stop"])},[a.firstUser.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:a.firstUser.avatar,alt:a.firstUser.name||"avatar"},null,8,Vd)):(e.openBlock(),e.createElementBlock("span",Nd,e.toDisplayString(a.firstUser.initials||(a.firstUser.name?a.firstUser.name.charAt(0):"")),1))],8,Ed)):e.createCommentVNode("",!0),a.secondUser?(e.openBlock(),e.createElementBlock("div",{key:1,class:"editor-comment-marker editor-comment-marker-second",onClick:e.withModifiers(r=>Ao(a),["stop"])},[a.secondUser.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:a.secondUser.avatar,alt:a.secondUser.name||"avatar"},null,8,Md)):(e.openBlock(),e.createElementBlock("span",Bd,e.toDisplayString(a.secondUser.initials||(a.secondUser.name?a.secondUser.name.charAt(0):"")),1))],8,Sd)):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=>Ao(a),["stop"])},[e.createElementVNode("span",Hd,"+"+e.toDisplayString(a.additionalCount),1)],12,Td)):e.createCommentVNode("",!0)],46,xd))),128)),Z.richText?(e.openBlock(),e.createElementBlock("div",Id,[e.createElementVNode("div",{ref_key:"editorRef",ref:f,contenteditable:"true",spellcheck:"false",class:e.normalizeClass(["dss-text-editor-content",{"dss-text-editor-content-disabled":Z.disabled,"dss-text-editor-fixed-height":Z.fixedHeight}]),style:e.normalizeStyle(M.value),onInput:p,onBlur:fe,onClick:Xo,onMouseup:fl,onKeyup:fl,onKeydown:wt,onPaste:Lt,onMousemove:Sl,onMouseleave:Ml},null,38),e.createVNode(e.Transition,{name:"comment-overlay"},{default:e.withCtx(()=>[Wt.value!==null?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-comment-overlay",style:e.normalizeStyle(Co.value)},[Kn.value||rn.value.length>0?(e.openBlock(),e.createElementBlock("div",Fd,[e.createElementVNode("div",zd,[Kn.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-comment-selection",innerHTML:Kn.value},null,8,Pd)):e.createCommentVNode("",!0)]),e.createElementVNode("div",Od,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(rn.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",Zd,[e.createElementVNode("div",Wd,[a.user.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:a.user.avatar,alt:a.user.name||"avatar"},null,8,qd)):(e.openBlock(),e.createElementBlock("span",Ud,e.toDisplayString(a.user.initials||(a.user.name?a.user.name.charAt(0):"")),1))])])):e.createCommentVNode("",!0),e.createElementVNode("div",Xd,[e.createElementVNode("div",Yd,[e.createElementVNode("div",jd,e.toDisplayString(a.user&&a.user.name||"Comment"),1),a.createdAt?(e.openBlock(),e.createElementBlock("div",Kd,e.toDisplayString(Vo(new Date(a.createdAt))),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:e.normalizeClass(["dss-comment-body-text",{"comment-started":Vn(a.text)||a.class==="comment-started"}])},e.toDisplayString(a.text||""),3)]),E.commentUser&&a.user&&a.user.id===E.commentUser.id&&!Vn(a.text)?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-comment-delete-button",onClick:e.withModifiers(i=>Nl(a,r),["stop"]),title:e.unref(R)("textEditor.comment.delete")||"Delete comment"},[...n[80]||(n[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,Gd)):e.createCommentVNode("",!0)]))),128))])])):e.createCommentVNode("",!0),e.createElementVNode("div",Qd,[e.withDirectives(e.createElementVNode("textarea",{ref_key:"commentInputRef",ref:Fn,"onUpdate:modelValue":n[26]||(n[26]=a=>In.value=a),class:"dss-comment-input",rows:"1",placeholder:e.unref(R)("textEditor.comment.placeholder"),onKeydown:e.withKeys(e.withModifiers(Ho,["prevent","stop"]),["enter"]),onInput:n[27]||(n[27]=()=>{if(Fn.value){const a=Fn.value;a.style.height="auto",a.style.height=`${a.scrollHeight}px`}})},null,40,Jd),[[e.vModelText,In.value]]),e.createElementVNode("button",{type:"button",class:"dss-comment-send-button",onClick:e.withModifiers(Ho,["stop"])},[...n[81]||(n[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",eu,[e.createElementVNode("div",tu,[e.createElementVNode("span",nu,e.toDisplayString(W.value)+" "+e.toDisplayString(W.value===1?e.unref(R)("textEditor.footer.word"):e.unref(R)("textEditor.footer.words")),1),n[82]||(n[82]=e.createElementVNode("span",{class:"dss-text-editor-footer-separator"},"•",-1)),e.createElementVNode("span",ou,e.toDisplayString(te.value)+" "+e.toDisplayString(te.value===1?e.unref(R)("textEditor.footer.character"):e.unref(R)("textEditor.footer.characters")),1)])])])):(e.openBlock(),e.createElementBlock("div",$d,[e.createElementVNode("textarea",{value:Z.modelValue,onInput:Io,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-textarea",{"dss-text-editor-fixed-height":Z.fixedHeight}]),placeholder:we.value,rows:Z.rows,disabled:Z.disabled,style:e.normalizeStyle(Dn.value)},null,46,Ld),e.createElementVNode("div",_d,[e.createElementVNode("div",Ad,[e.createElementVNode("span",Dd,e.toDisplayString(W.value)+" "+e.toDisplayString(W.value===1?e.unref(R)("textEditor.footer.word"):e.unref(R)("textEditor.footer.words")),1),n[79]||(n[79]=e.createElementVNode("span",{class:"dss-text-editor-footer-separator"},"•",-1)),e.createElementVNode("span",Rd,e.toDisplayString(te.value)+" "+e.toDisplayString(te.value===1?e.unref(R)("textEditor.footer.character"):e.unref(R)("textEditor.footer.characters")),1)])])])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[Le.value&&L.value&&f.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-link-popup",style:e.normalizeStyle(_e.value),onMouseenter:n[28]||(n[28]=a=>Ge.value=!0),onMouseleave:yn},[e.createElementVNode("span",{class:"dss-link-popup-url",onClick:e.withModifiers(Bl,["stop"]),title:L.value},e.toDisplayString(L.value),9,lu),e.createElementVNode("button",{type:"button",class:"dss-link-popup-edit",onClick:e.withModifiers(Et,["stop"]),title:e.unref(R)("textEditor.link.editLink")},[(e.openBlock(),e.createElementBlock("svg",su,[...n[83]||(n[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,au)],36)):e.createCommentVNode("",!0)])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[Kt.value&&Bt.value&&f.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-link-popup",style:e.normalizeStyle(fo.value),onMouseenter:n[29]||(n[29]=a=>nn.value=!0),onMouseleave:Cn},[e.createElementVNode("div",ru,[Bt.value===e.unref(R)("textEditor.image.noAlt")?(e.openBlock(),e.createElementBlock("div",iu,[...n[84]||(n[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:Bt.value},e.toDisplayString(Bt.value),9,cu)]),e.createElementVNode("button",{type:"button",class:"dss-link-popup-edit",onClick:e.withModifiers(yl,["stop"]),title:e.unref(R)("textEditor.image.editImage")},[(e.openBlock(),e.createElementBlock("svg",uu,[...n[85]||(n[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,du)],36)):e.createCommentVNode("",!0)])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[Z.floatingToolbar&&Z.richText&&Ce.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"floatingToolbarRef",ref:Yt,class:"dss-floating-toolbar",style:e.normalizeStyle(Nt.value),onMousedown:n[44]||(n[44]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("div",mu,[e.createElementVNode("div",{class:"dss-toolbar-button",onClick:e.withModifiers(Be,["stop"]),title:e.unref(R)("textEditor.toolbar.undo")},[...n[86]||(n[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,pu),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-disabled":!D.value}]),onClick:e.withModifiers(Ot,["stop"]),title:e.unref(R)("textEditor.toolbar.redo")},[...n[87]||(n[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,vu),n[107]||(n[107]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",fu,[e.createElementVNode("div",{class:"dss-toolbar-button dss-toolbar-dropdown-toggle",onClick:n[30]||(n[30]=e.withModifiers(a=>gl("paragraph"),["stop"])),title:e.unref(R)("textEditor.toolbar.paragraphFormat")},[lt.value==="h1"?(e.openBlock(),e.createElementBlock("svg",hu,[...n[88]||(n[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)])])):lt.value==="h2"?(e.openBlock(),e.createElementBlock("svg",yu,[...n[89]||(n[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)])])):lt.value==="h3"?(e.openBlock(),e.createElementBlock("svg",ku,[...n[90]||(n[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)])])):lt.value==="h4"?(e.openBlock(),e.createElementBlock("svg",Cu,[...n[91]||(n[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)])])):lt.value==="h5"?(e.openBlock(),e.createElementBlock("svg",bu,[...n[92]||(n[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)])])):lt.value==="h6"?(e.openBlock(),e.createElementBlock("svg",wu,[...n[93]||(n[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",xu,[...n[94]||(n[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)])])),n[95]||(n[95]=e.createElementVNode("span",{class:"dss-toolbar-dropdown-arrow"},"˅",-1))],8,gu),it.value==="paragraph"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:n[38]||(n[38]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[31]||(n[31]=a=>uo("<h1>"))},[e.createElementVNode("h1",null,e.toDisplayString(e.unref(R)("textEditor.paragraph.heading1")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[32]||(n[32]=a=>uo("<h2>"))},[e.createElementVNode("h2",null,e.toDisplayString(e.unref(R)("textEditor.paragraph.heading2")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[33]||(n[33]=a=>uo("<h3>"))},[e.createElementVNode("h3",null,e.toDisplayString(e.unref(R)("textEditor.paragraph.heading3")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[34]||(n[34]=a=>uo("<h4>"))},[e.createElementVNode("h4",null,e.toDisplayString(e.unref(R)("textEditor.paragraph.heading4")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[35]||(n[35]=a=>uo("<h5>"))},[e.createElementVNode("h5",null,e.toDisplayString(e.unref(R)("textEditor.paragraph.heading5")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[36]||(n[36]=a=>uo("<h6>"))},[e.createElementVNode("h6",null,e.toDisplayString(e.unref(R)("textEditor.paragraph.heading6")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[37]||(n[37]=a=>uo("<p>"))},[e.createElementVNode("p",null,e.toDisplayString(e.unref(R)("textEditor.paragraph.paragraph")),1)])])):e.createCommentVNode("",!0)]),n[108]||(n[108]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":sn("bold")}]),onClick:n[39]||(n[39]=e.withModifiers(a=>Xn("bold"),["stop"])),title:e.unref(R)("textEditor.toolbar.bold")},[...n[96]||(n[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,Eu),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":sn("italic")}]),onClick:n[40]||(n[40]=e.withModifiers(a=>Xn("italic"),["stop"])),title:e.unref(R)("textEditor.toolbar.italic")},[...n[97]||(n[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,Vu),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":sn("underline")}]),onClick:n[41]||(n[41]=e.withModifiers(a=>Xn("underline"),["stop"])),title:e.unref(R)("textEditor.toolbar.underline")},[...n[98]||(n[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,Nu),n[109]||(n[109]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":ye.value}]),onClick:e.withModifiers(Oo,["stop"]),title:e.unref(R)("textEditor.toolbar.citation")},[...n[99]||(n[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,Su),n[110]||(n[110]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),He.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-button",onClick:e.withModifiers(ul,["stop"]),title:e.unref(R)("textEditor.toolbar.removeLink")},[...n[101]||(n[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,Bu)):(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-button",onClick:e.withModifiers(dl,["stop"]),title:e.unref(R)("textEditor.toolbar.insertLink")},[...n[100]||(n[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,Mu)),n[111]||(n[111]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":sn("insertUnorderedList")}]),onClick:e.withModifiers(ml,["stop"]),title:e.unref(R)("textEditor.toolbar.bulletList")},[...n[102]||(n[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,Tu),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":sn("insertOrderedList")}]),onClick:e.withModifiers(Zo,["stop"]),title:e.unref(R)("textEditor.toolbar.numberList")},[...n[103]||(n[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,Hu),n[112]||(n[112]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:"dss-toolbar-button",onClick:e.withModifiers($o,["stop"]),title:e.unref(R)("textEditor.toolbar.image")},[...n[104]||(n[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,$u),n[113]||(n[113]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:"dss-toolbar-button",title:e.unref(R)("textEditor.toolbar.comment"),onClick:e.withModifiers(vl,["stop"])},[...n[105]||(n[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,Lu),Z.askAi?(e.openBlock(),e.createElementBlock("div",_u)):e.createCommentVNode("",!0),Z.askAi?(e.openBlock(),e.createElementBlock("div",Au,[e.createElementVNode("div",{class:"dss-toolbar-ai-button dss-toolbar-ai-float dss-toolbar-dropdown-toggle",onClick:n[42]||(n[42]=e.withModifiers(a=>gl("askAi"),["stop"])),title:e.unref(R)("textEditor.toolbar.askAi")},[n[106]||(n[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",Ru,e.toDisplayString(e.unref(R)("textEditor.toolbar.askAi")),1)],8,Du),it.value==="askAi"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:n[43]||(n[43]=e.withModifiers(()=>{},["stop"]))},[e.renderSlot(l.$slots,"ask-ai-dropdown")])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),so.value?(e.openBlock(),e.createElementBlock("div",Iu,[Z.askAi&&so.value?(e.openBlock(),e.createElementBlock("div",Fu)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Z.customToolbarSlots,(a,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:r},[Me(a)&&an(a)?(e.openBlock(),e.createElementBlock("div",zu,[e.renderSlot(l.$slots,a)])):e.createCommentVNode("",!0),Me(a)&&an(a)&&r<Z.customToolbarSlots.length-1&&Pt(r)?(e.openBlock(),e.createElementBlock("div",Pu)):e.createCommentVNode("",!0)],64))),128))])):e.createCommentVNode("",!0)],36)):e.createCommentVNode("",!0)]))],6))}}),Wu={key:0,class:"dss-datepicker__input-wrap dss-datepicker__input-wrap--readonly"},qu=["value"],Uu=["placeholder","value","disabled"],Xu=["placeholder","value"],Yu={key:0,class:"dss-datepicker__double-wrap"},ju={key:0,class:"dss-datepicker__quick-select","aria-label":"Quick range"},Ku=["onClick"],Gu={class:"dss-datepicker__double-calendars"},Qu={class:"dss-datepicker__double-calendar"},Ju={class:"dss-datepicker__calendar-header"},e1=["aria-label"],t1={class:"dss-datepicker__month-year-row"},n1=["aria-label"],o1={class:"dss-datepicker__weekdays"},l1={class:"dss-datepicker__grid"},a1=["disabled","onClick","onMouseenter"],s1={key:1,class:"dss-datepicker__day dss-datepicker__day--empty"},r1={class:"dss-datepicker__double-calendar"},i1={class:"dss-datepicker__calendar-header"},c1=["aria-label"],d1={class:"dss-datepicker__month-year-row"},u1=["aria-label"],m1={class:"dss-datepicker__weekdays"},p1={class:"dss-datepicker__grid"},v1=["disabled","onClick","onMouseenter"],f1={key:1,class:"dss-datepicker__day dss-datepicker__day--empty"},g1={class:"dss-datepicker__calendar-header"},h1=["aria-label"],y1={class:"dss-datepicker__month-year-row"},k1=["aria-label"],C1={class:"dss-datepicker__weekdays"},b1={class:"dss-datepicker__grid"},w1=["disabled","onClick","onMouseenter"],x1={key:1,class:"dss-datepicker__day dss-datepicker__day--empty"},E1={class:"dss-datepicker__calendar-header"},V1={class:"dss-datepicker__month-year-row"},N1={class:"dss-datepicker__month-year dss-datepicker__month-year--static"},S1={class:"dss-datepicker__months-grid"},M1=["onClick"],B1={class:"dss-datepicker__calendar-header dss-datepicker__calendar-header--center"},T1={class:"dss-datepicker__month-year"},H1={class:"dss-datepicker__years-grid"},$1=["onClick"],zl=15,L1={__name:"DSSDatepicker",props:{mode:{type:String,default:"single",validator:Z=>["single","range","singleFromAvailable","rangeFromAvailable","readonly"].includes(Z)},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(Z,{emit:Ut}){const O=Z,R=Ut,{t:Ie,locale:E}=al.useI18n(),he=e.ref(!1),Ke=e.ref("days"),vt=e.ref(new Date().getMonth()),f=e.ref(new Date().getFullYear()),ke=e.ref(new Date().getMonth()),He=e.ref(new Date().getFullYear()),$e=e.ref(new Date().getMonth()),Le=e.ref(new Date().getFullYear()),L=e.ref("start"),_e=e.ref(null),Ge=e.ref(null),_t=new Date;function kt(){const M=_t.getMonth(),D=_t.getFullYear(),T=M===11?0:M+1,W=M===11?D+1:D;return{left:{month:M,year:D},right:{month:T,year:W}}}const P=e.ref(null),Ht=e.ref(null),Xt=e.ref(null),pe=e.ref(null),tn=e.ref(null),Qe=e.ref(null),ye=new Date().getFullYear(),ue=e.computed(()=>["single","singleFromAvailable"].includes(O.mode)),Ce=e.computed(()=>["range","rangeFromAvailable"].includes(O.mode)),Nt=e.computed(()=>{if(O.mode!=="single"&&O.mode!=="singleFromAvailable")return null;const M=O.modelValue;return M instanceof Date?M:null}),Yt=e.computed(()=>{if(!Ce.value)return{start:null,end:null};const M=O.modelValue;return!M||typeof M!="object"?{start:null,end:null}:{start:M.start instanceof Date?M.start:null,end:M.end instanceof Date?M.end:null}});function it(M){if(!M||!(M instanceof Date))return"";const D=M.getDate(),T=M.getMonth()+1,W=M.getFullYear(),te=be=>String(be).padStart(2,"0");return`${te(D)}/${te(T)}/${W}`}const xn=e.computed(()=>it(Nt.value)),jt=e.computed(()=>{const{start:M,end:D}=Yt.value;if(!M&&!D)return"";const T=!D||M&&M<=D?M:D,W=!M||D&&D>=M?D:M;return me(T,W)?it(T):`${it(T)} - ${it(W)}`}),kn=e.computed(()=>{if(O.mode!=="readonly")return"—";const M=O.modelValue;if(M instanceof Date)return it(M)||"—";if(M&&typeof M=="object"&&("start"in M||"end"in M)){const D=M.start instanceof Date?M.start:null,T=M.end instanceof Date?M.end:null;if(!D&&!T)return"—";const W=!T||D&&D<=T?D:T,te=!D||T&&T>=D?T:D;return me(W,te)?it(W):`${it(W)} - ${it(te)}`}return"—"});e.computed(()=>{const M=new Date(f.value,vt.value,1);return new Intl.DateTimeFormat(E.value,{month:"long",year:"numeric"}).format(M)});const tt=e.computed(()=>Ge.value==="left"?ke.value:Ge.value==="right"?$e.value:vt.value),Fe=e.computed(()=>Ge.value==="left"?He.value:Ge.value==="right"?Le.value:f.value),ct=e.computed(()=>{const M=new Date(f.value,vt.value,1);return new Intl.DateTimeFormat(E.value,{month:"long"}).format(M)}),dt=e.computed(()=>{const M=new Date(Fe.value,tt.value,1);return new Intl.DateTimeFormat(E.value,{month:"long"}).format(M)}),Xe=e.computed(()=>{const M=new Intl.DateTimeFormat(E.value,{month:"short"});return Array.from({length:12},(D,T)=>M.format(new Date(2024,T,1)))}),En=e.computed(()=>{const D=(Ge.value?Fe.value:f.value)-Math.floor(zl/2);return Array.from({length:zl},(T,W)=>D+W)}),ze=e.computed(()=>{const M=En.value;return M.length?`${M[0]} – ${M[M.length-1]}`:""}),$t=e.computed(()=>{const M=new Intl.DateTimeFormat(E.value,{weekday:"short"}),D=new Date(2024,0,1),T=[];for(let W=0;W<7;W++){const te=new Date(D);te.setDate(D.getDate()+W),T.push(M.format(te).slice(0,2))}return T});function Kt(M,D){const T=new Date(M,D,1),W=new Date(M,D+1,0),te=T.getDay(),be=W.getDate(),ie=[];for(let ce=0;ce<te;ce++)ie.push(null);for(let ce=1;ce<=be;ce++)ie.push(new Date(M,D,ce));return ie}const Bt=e.computed(()=>Kt(f.value,vt.value)),fo=e.computed(()=>Kt(He.value,ke.value)),nn=e.computed(()=>Kt(Le.value,$e.value));e.computed(()=>{const M=new Date(He.value,ke.value,1);return new Intl.DateTimeFormat(E.value,{month:"long",year:"numeric"}).format(M)}),e.computed(()=>{const M=new Date(Le.value,$e.value,1);return new Intl.DateTimeFormat(E.value,{month:"long",year:"numeric"}).format(M)});const Ne=e.computed(()=>{const M=new Date(He.value,ke.value,1);return new Intl.DateTimeFormat(E.value,{month:"long"}).format(M)}),pn=e.computed(()=>{const M=new Date(Le.value,$e.value,1);return new Intl.DateTimeFormat(E.value,{month:"long"}).format(M)}),Ye=e.computed(()=>O.availableDates&&O.availableDates.length>0),At=e.computed(()=>Ye.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"}]),nt=e.ref({top:0,left:0});function on(){if(!pe.value||!he.value)return;const M=pe.value.getBoundingClientRect(),D=window.innerWidth||document.documentElement.clientWidth,T=window.innerHeight||document.documentElement.clientHeight;let W=M.left,te=M.bottom+4;const be=tn.value;if(be){const ie=be.offsetWidth,ce=be.offsetHeight;if(W+ie>D-8&&(W=M.right-ie,W<8&&(W=8)),te+ce>T-8){const we=M.top-4-ce;we>=8?te=we:te=Math.max(8,T-ce-8)}}nt.value={top:te,left:W}}const ae=e.computed(()=>!pe.value||!he.value?{}:{position:"fixed",left:`${nt.value.left}px`,top:`${nt.value.top}px`,zIndex:1002});function me(M,D){return!M||!D?!1:M.getFullYear()===D.getFullYear()&&M.getMonth()===D.getMonth()&&M.getDate()===D.getDate()}function ot(M){return new Date(M.getFullYear(),M.getMonth(),M.getDate()).getTime()}function Gt(M){return!O.availableDates||!O.availableDates.length?!0:O.availableDates.some(D=>D instanceof Date&&me(D,M))}function Ct(M){const D=ot(M);return!(O.minDate instanceof Date&&D<ot(O.minDate)||O.maxDate instanceof Date&&D>ot(O.maxDate))}function ft(M){return!O.exceptDates||!O.exceptDates.length?!1:O.exceptDates.some(D=>D instanceof Date&&me(D,M))}function Pe(M){return ft(M)?!1:["singleFromAvailable","rangeFromAvailable"].includes(O.mode)?Gt(M):Ct(M)}function je(M){const D=Nt.value,T=Yt.value,W=ot(M),te=Ce.value&&T.start&&T.end&&W>ot(T.start)&&W<ot(T.end),be=Ce.value&&T.start&&me(M,T.start),ie=Ce.value&&T.end&&me(M,T.end),ce=be&&ie,we=ue.value&&D&&me(M,D)||be||ie;let Me=!1;if(Ce.value&&T.start&&!T.end&&_e.value){const Tt=ot(T.start),Pt=ot(_e.value),an=Math.min(Tt,Pt),so=Math.max(Tt,Pt);Me=W>an&&W<so}return{"dss-datepicker__day--selected":we&&!ce,"dss-datepicker__day--range-start":be&&!ce,"dss-datepicker__day--range-end":ie&&!ce,"dss-datepicker__day--range-single":ce,"dss-datepicker__day--in-range":te&&!be&&!ie,"dss-datepicker__day--in-range-preview":Me&&!be&&!ie&&!te,"dss-datepicker__day--disabled":!Pe(M)}}function Te(M){if(!Ce.value)return;const D=Yt.value;if(!D.start||D.end){_e.value=null;return}if(!Pe(M)){_e.value=null;return}_e.value=new Date(M.getFullYear(),M.getMonth(),M.getDate())}function Se(){_e.value=null}function bt(){if(!O.doubleCalendar||!Ce.value)return;const M=Yt.value,{start:D,end:T}=M;if(D&&T){const be=D<=T?D:T,ie=D<=T?T:D,ce=be.getMonth(),we=be.getFullYear(),Me=ie.getMonth(),Tt=ie.getFullYear();if(ce!==Me||we!==Tt){const Pt=ke.value===ce&&He.value===we,an=$e.value===Me&&Le.value===Tt;if(Pt&&an)return;ke.value=ce,He.value=we,$e.value=Me,Le.value=Tt}else{const Pt=ce===0?11:ce-1,an=ce===0?we-1:we;ke.value===Pt&&He.value===an&&$e.value===ce&&Le.value===we||(ke.value=ce,He.value=we,ce===11?($e.value=0,Le.value=we+1):($e.value=ce+1,Le.value=we))}return}const W=D||T;if(W){const be=W.getMonth(),ie=W.getFullYear(),ce=ke.value===be&&He.value===ie,we=$e.value===be&&Le.value===ie;if(ce||we)return;ke.value=be,He.value=ie,be===11?($e.value=0,Le.value=ie+1):($e.value=be+1,Le.value=ie);return}const te=kt();ke.value=te.left.month,He.value=te.left.year,$e.value=te.right.month,Le.value=te.right.year}function Ae(M="start"){if(O.mode==="readonly")return;L.value=M;const D=Nt.value,T=Yt.value;if(ue.value&&D)vt.value=D.getMonth(),f.value=D.getFullYear();else if(Ce.value)if(O.doubleCalendar)bt();else{const W=M==="start"&&T.start?T.start:T.end||T.start;W&&(vt.value=W.getMonth(),f.value=W.getFullYear())}pe.value=ue.value?P.value?.closest(".dss-datepicker__input-wrap"):Ht.value,Ke.value="days",Ge.value=null,he.value=!0,e.nextTick(()=>{on()})}function We(){Ke.value="days",Ge.value=null,_e.value=null,he.value=!1}function Dt(M,D){Ge.value=M,Ke.value=D}function De(){Ke.value="days",Ge.value=null}function ut(M){const D=new Date,T=D.getFullYear(),W=D.getMonth(),te=D.getDate();let be,ie;if(Ye.value){const ce=[...O.availableDates].filter(we=>we instanceof Date).map(we=>new Date(we.getFullYear(),we.getMonth(),we.getDate()));if(ce.sort((we,Me)=>we.getTime()-Me.getTime()),ce.length===0)return;if(M==="all")be=ce[0],ie=ce[ce.length-1];else{const we=parseInt(M.replace("last",""),10);if(we<2||we>5)return;const Me=ce.slice(-we);be=Me[0],ie=Me[Me.length-1]}}else{const ce=new Date(T,W,te);switch(M){case"today":be=ce,ie=ce;break;case"lastWeek":be=new Date(T,W,te-6),ie=ce;break;case"last15Days":be=new Date(T,W,te-14),ie=ce;break;case"last30Days":be=new Date(T,W,te-29),ie=ce;break;case"thisMonth":be=new Date(T,W,1),ie=ce;break;case"last3Months":be=new Date(T,W-3,1),ie=new Date(T,W,0);break;case"last6Months":be=new Date(T,W-6,1),ie=new Date(T,W,0);break;case"last12Months":be=new Date(T,W-12,1),ie=new Date(T,W,0);break;case"lastYear":be=new Date(T-1,0,1),ie=new Date(T-1,11,31);break;default:return}}R("update:modelValue",{start:be,end:ie}),bt()}function lt(M){Ge.value==="left"?ke.value=M:Ge.value==="right"?$e.value=M:vt.value=M,De()}function vn(M){Ge.value==="left"?He.value=M:Ge.value==="right"?Le.value=M:f.value=M,De()}function mt(){vt.value===0?(vt.value=11,f.value--):vt.value--}function gt(){vt.value===11?(vt.value=0,f.value++):vt.value++}function Qt(){ke.value===0?(ke.value=11,He.value--):ke.value--}function Mn(){ke.value===11?(ke.value=0,He.value++):ke.value++}function Jt(){$e.value===0?($e.value=11,Le.value--):$e.value--}function Ln(){$e.value===11?($e.value=0,Le.value++):$e.value++}function ln(M){if(!Pe(M))return;const D=new Date(M.getFullYear(),M.getMonth(),M.getDate());if(ue.value){R("update:modelValue",D),We();return}const T=Yt.value;if(!T.start&&!T.end){R("update:modelValue",{start:D,end:null}),L.value="end";return}if(T.start&&T.end){R("update:modelValue",{start:D,end:null}),L.value="end";return}if(L.value==="start"){let W=D,te=T.end;W&&te&&W>te&&([W,te]=[te,W]),R("update:modelValue",{start:W||te,end:te||W}),L.value="end"}else{let W=T.start,te=D;W&&te&&te<W&&([W,te]=[te,W]),R("update:modelValue",{start:W||te,end:te||W}),L.value="start"}}e.watch(Yt,()=>{O.doubleCalendar&&Ce.value&&he.value&&bt()},{deep:!0});let Rt=null,_n=null,An=null;function Dn(){Rt&&(document.removeEventListener("keydown",Rt),Rt=null),_n&&(window.removeEventListener("resize",_n),_n=null),An&&(window.removeEventListener("scroll",An,!0),An=null)}return e.watch(he,M=>{Dn(),M&&(Rt=D=>{D.key==="Escape"&&(Ke.value==="years"||Ke.value==="months"?De():We())},_n=()=>{on()},An=()=>{on()},document.addEventListener("keydown",Rt),window.addEventListener("resize",_n),window.addEventListener("scroll",An,!0))}),e.onBeforeUnmount(()=>{Dn()}),(M,D)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-datepicker",{"dss-datepicker--readonly":Z.mode==="readonly"}])},[Z.mode==="readonly"?(e.openBlock(),e.createElementBlock("div",Wu,[D[9]||(D[9]=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:kn.value,readonly:"",disabled:"",tabindex:"-1"},null,8,qu)])):ue.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-datepicker__input-wrap",onClick:D[0]||(D[0]=T=>Ae("start"))},[D[10]||(D[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",{ref_key:"inputSingleRef",ref:P,type:"text",class:"dss-datepicker__input",placeholder:e.unref(Ie)("datepicker.selectDate"),value:xn.value,readonly:"",disabled:Z.mode==="readonly"},null,8,Uu)])):Ce.value?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-datepicker__input-wrap",ref_key:"inputRangeWrapRef",ref:Ht,onClick:D[1]||(D[1]=T=>Ae("start"))},[D[11]||(D[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:"inputRangeRef",ref:Xt,type:"text",class:"dss-datepicker__input",placeholder:e.unref(Ie)("datepicker.selectRange"),value:jt.value,readonly:""},null,8,Xu)],512)):e.createCommentVNode("",!0),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[he.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-datepicker__overlay",onClick:e.withModifiers(We,["self"])},[e.createElementVNode("div",{ref_key:"dropdownRef",ref:tn,class:e.normalizeClass(["dss-datepicker__dropdown",{"dss-datepicker__dropdown--double":Z.doubleCalendar&&Ce.value&&Ke.value==="days","dss-datepicker__dropdown--quick-select":Z.doubleCalendar&&Ce.value&&Ke.value==="days"&&Z.quickSelect}]),style:e.normalizeStyle(ae.value)},[Ke.value==="days"&&Z.doubleCalendar&&Ce.value?(e.openBlock(),e.createElementBlock("div",Yu,[Z.quickSelect?(e.openBlock(),e.createElementBlock("nav",ju,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(At.value,T=>(e.openBlock(),e.createElementBlock("button",{key:T.id,type:"button",class:"dss-datepicker__quick-select-btn",onClick:W=>ut(T.id)},e.toDisplayString(e.unref(Ie)(T.labelKey)),9,Ku))),128))])):e.createCommentVNode("",!0),e.createElementVNode("div",Gu,[e.createElementVNode("div",Qu,[e.createElementVNode("div",Ju,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(Ie)("datepicker.prevMonth"),onClick:Qt}," ‹ ",8,e1),e.createElementVNode("div",t1,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:D[2]||(D[2]=T=>Dt("left","months"))},e.toDisplayString(Ne.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:D[3]||(D[3]=T=>Dt("left","years"))},e.toDisplayString(He.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(Ie)("datepicker.nextMonth"),onClick:Mn}," › ",8,n1)]),e.createElementVNode("div",o1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList($t.value,T=>(e.openBlock(),e.createElementBlock("span",{key:T,class:"dss-datepicker__weekday"},e.toDisplayString(T),1))),128))]),e.createElementVNode("div",l1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(fo.value,(T,W)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"L-"+W},[T?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-datepicker__day",je(T)]),disabled:!Pe(T),onClick:te=>ln(T),onMouseenter:te=>Te(T),onMouseleave:Se},e.toDisplayString(T.getDate()),43,a1)):(e.openBlock(),e.createElementBlock("span",s1))],64))),128))])]),e.createElementVNode("div",r1,[e.createElementVNode("div",i1,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(Ie)("datepicker.prevMonth"),onClick:Jt}," ‹ ",8,c1),e.createElementVNode("div",d1,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:D[4]||(D[4]=T=>Dt("right","months"))},e.toDisplayString(pn.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:D[5]||(D[5]=T=>Dt("right","years"))},e.toDisplayString(Le.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(Ie)("datepicker.nextMonth"),onClick:Ln}," › ",8,u1)]),e.createElementVNode("div",m1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList($t.value,T=>(e.openBlock(),e.createElementBlock("span",{key:T,class:"dss-datepicker__weekday"},e.toDisplayString(T),1))),128))]),e.createElementVNode("div",p1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(nn.value,(T,W)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"R-"+W},[T?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-datepicker__day",je(T)]),disabled:!Pe(T),onClick:te=>ln(T),onMouseenter:te=>Te(T),onMouseleave:Se},e.toDisplayString(T.getDate()),43,v1)):(e.openBlock(),e.createElementBlock("span",f1))],64))),128))])])])])):Ke.value==="days"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",g1,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(Ie)("datepicker.prevMonth"),onClick:mt}," ‹ ",8,h1),e.createElementVNode("div",y1,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:D[6]||(D[6]=T=>Ke.value="months")},e.toDisplayString(ct.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:D[7]||(D[7]=T=>Ke.value="years")},e.toDisplayString(f.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(Ie)("datepicker.nextMonth"),onClick:gt}," › ",8,k1)]),e.createElementVNode("div",C1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList($t.value,T=>(e.openBlock(),e.createElementBlock("span",{key:T,class:"dss-datepicker__weekday"},e.toDisplayString(T),1))),128))]),e.createElementVNode("div",b1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Bt.value,(T,W)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:W},[T?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-datepicker__day",je(T)]),disabled:!Pe(T),onClick:te=>ln(T),onMouseenter:te=>Te(T),onMouseleave:Se},e.toDisplayString(T.getDate()),43,w1)):(e.openBlock(),e.createElementBlock("span",x1))],64))),128))])],64)):Ke.value==="months"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createElementVNode("div",E1,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav",onClick:De}," ‹ "),e.createElementVNode("div",V1,[e.createElementVNode("span",N1,e.toDisplayString(dt.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:D[8]||(D[8]=T=>Ke.value="years")},e.toDisplayString(Fe.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav",onClick:De}," › ")]),e.createElementVNode("div",S1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Xe.value,(T,W)=>(e.openBlock(),e.createElementBlock("button",{key:W,type:"button",class:e.normalizeClass(["dss-datepicker__month-cell",{"dss-datepicker__month-cell--selected":W===tt.value}]),onClick:te=>lt(W)},e.toDisplayString(T),11,M1))),128))])],64)):Ke.value==="years"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.createElementVNode("div",B1,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav",onClick:De}," ‹ "),e.createElementVNode("span",T1,e.toDisplayString(ze.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav",onClick:De}," › ")]),e.createElementVNode("div",{class:"dss-datepicker__years-wrap",ref_key:"yearsWrapRef",ref:Qe},[e.createElementVNode("div",H1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(En.value,T=>(e.openBlock(),e.createElementBlock("button",{key:T,type:"button",class:e.normalizeClass(["dss-datepicker__year-cell",{"dss-datepicker__year-cell--selected":T===Fe.value,"dss-datepicker__year-cell--current":T===e.unref(ye)}]),onClick:W=>vn(T)},e.toDisplayString(T),11,$1))),128))])],512)],64)):e.createCommentVNode("",!0)],6)])):e.createCommentVNode("",!0)]))],2))}},_1={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 (optional)"},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"}},A1={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"},D1={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"}},R1={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"}},sl={chart:_1,table:A1,datepicker:D1,textEditor:R1},I1={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 (optionnel)"},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"}},F1={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"},z1={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"}},P1={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"}},rl={chart:I1,table:F1,datepicker:z1,textEditor:P1},O1={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"}},Z1={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"},W1={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"}},q1={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"}},il={chart:O1,table:Z1,datepicker:W1,textEditor:q1},Al={en:sl,fr:rl,nl:il};function U1(Z){if(!Z||!Z.global)return;const Ut=Z.global.availableLocales||[];Object.keys(Al).forEach(O=>{Ut.includes(O)&&Z.global.mergeLocaleMessage(O,Al[O])})}const Dl={en:{textEditor:sl.textEditor},fr:{textEditor:rl.textEditor},nl:{textEditor:il.textEditor}};function X1(Z){if(!Z||!Z.global)return;const Ut=Z.global.availableLocales||[];Object.keys(Dl).forEach(O=>{Ut.includes(O)&&Z.global.mergeLocaleMessage(O,Dl[O])})}const Rl={en:{table:sl.table},fr:{table:rl.table},nl:{table:il.table}};function Y1(Z){if(!Z||!Z.global)return;const Ut=Z.global.availableLocales||[];Object.keys(Rl).forEach(O=>{Ut.includes(O)&&Z.global.mergeLocaleMessage(O,Rl[O])})}const Il={en:{datepicker:sl.datepicker},fr:{datepicker:rl.datepicker},nl:{datepicker:il.datepicker}};function j1(Z){if(!Z||!Z.global)return;const Ut=Z.global.availableLocales||[];Object.keys(Il).forEach(O=>{Ut.includes(O)&&Z.global.mergeLocaleMessage(O,Il[O])})}const K1={en:{...sl},fr:{...rl},nl:{...il}};al.createI18n({legacy:!1,locale:"en",fallbackLocale:"en",messages:K1});exports.DSSChart=Ar;exports.DSSChartMessages=Al;exports.DSSDatepicker=L1;exports.DSSDatepickerMessages=Il;exports.DSSModal=_l;exports.DSSTable=Qi;exports.DSSTableMessages=Rl;exports.DSSTextEditor=Zu;exports.DSSTextEditorMessages=Dl;exports.addDSSChartTranslations=U1;exports.addDSSDatepickerTranslations=j1;exports.addDSSTableTranslations=Y1;exports.addDSSTextEditorTranslations=X1;
77
+ </svg>`,g=e.ref(null),we=e.ref(null),Me=e.ref(!1),Be=e.ref(!1),He=e.ref(!1),A=e.ref(""),Le=e.ref({}),Qe=e.ref(!1),At=e.ref(!1),mt=e.ref(""),F=e.ref(""),Tt=e.ref(null),Dt=e.ref(null),pe=e.ref(null),Xt=e.ref(null),en=e.ref(""),lt=e.ref(!1),ve=e.ref({}),Q=e.ref(!1),Rn=e.ref({}),Ue=e.ref(null),$e=e.ref(null),xn=e.ref(!1),tn=e.ref(""),Tn=e.ref(null),Ye=e.ref(""),Ie=e.ref(""),at=e.ref(""),Yt=e.ref(null),un=e.ref(null),pt=e.ref(null),ke=e.ref(null),mn=e.ref(null),Rt=e.ref(!1),vt=e.ref(""),fo=e.ref({}),Vt=e.ref(!1),Je=e.ref("upload"),gn=e.ref(""),Ze=e.ref(null),It=e.ref(null),Fe=e.ref([]),jt=e.ref([]),de=e.ref(null),ge=e.ref(!1),ze=e.ref(""),$t=e.ref(""),Kt=e.ref(""),ft=e.ref(""),Te=e.ref(""),je=e.ref(""),Ve=e.ref(null),Oe=e.ref(null),st=e.ref(null),Ce=e.ref(!1),nt=e.ref(null),Ft=e.ref(!1),_e=e.ref(!1),rt=e.ref(null),Ke=e.ref("p"),pn=e.ref(!1),hn=e.ref([]),Ct=e.ref(null),et=e.ref(null),In=e.ref(null),$n=e.ref(!1),Hn=e.ref(0),vn=100,St=e.ref(null),Wt=e.computed(()=>({"dss-text-editor-no-border":!S.border,"dss-text-editor-rounded":S.rounded,"dss-text-editor-full-height":S.fullHeight,"dss-comment-overlay-open":Ot.value!==null})),Fn=e.computed(()=>({})),lo=e.computed(()=>!S.fixedHeight||S.fullHeight?{}:{height:`${1.6*14*S.rows+24+2}px`,resize:"none",overflowY:"auto"}),$=e.computed(()=>!S.fixedHeight||S.fullHeight?{}:{height:`${1.6*14*S.rows+32}px`,overflowY:"auto"}),D=e.computed(()=>S.richText&&jt.value.length>0),_=e.computed(()=>{if(!S.modelValue)return"";if(S.richText){let l=S.modelValue.replace(/<script[^>]*>[\s\S]*?<\/script>/gi,"");return l=l.replace(/<style[^>]*>[\s\S]*?<\/style>/gi,""),l=l.replace(/<[^>]+>/g,""),l=l.replace(/&nbsp;/g," "),l=l.replace(/&amp;/g,"&"),l=l.replace(/&lt;/g,"<"),l=l.replace(/&gt;/g,">"),l=l.replace(/&quot;/g,'"'),l=l.replace(/&#39;/g,"'"),l=l.replace(/\s+/g," ").trim(),l}return S.modelValue}),W=e.computed(()=>{const l=_.value.trim();return l?l.split(/\s+/).filter(o=>o.length>0).length:0}),ne=e.computed(()=>_.value.length),he=e.computed(()=>ke.value!==null&&Je.value==="upload"&&Ye.value&&Ye.value.startsWith("data:")),xe=e.computed(()=>S.titlePlaceholder||R("textEditor.placeholders.title")),ie=e.computed(()=>S.descriptionPlaceholder||R("textEditor.placeholders.description")),fe=e.computed(()=>S.placeholder||R("textEditor.placeholders.startTyping")),Se=l=>Ge&&Ge[l]!==void 0,bt=l=>{for(let o=l+1;o<S.customToolbarSlots.length;o++)if(Se(S.customToolbarSlots[o]))return!0;return!1},Ht=l=>{for(let o=l+1;o<S.customToolbarSlots.length;o++){const a=S.customToolbarSlots[o];if(Se(a)&&nn(a))return!0}return!1},nn=l=>S.customToolbarFloatingMap.hasOwnProperty(l)?S.customToolbarFloatingMap[l]===!0:!0,jn=e.computed(()=>S.customToolbarSlots.some(l=>Se(l)&&nn(l))),go=e.computed(()=>Se("title-slot")),ho=e.computed(()=>Se("description-slot")),Ln=l=>{if(!l||l.trim()==="")return"<html></html>";const o=l.trim();return o.startsWith("<html>")&&o.endsWith("</html>")?l:`<html>${l}</html>`},Gt=l=>{if(!l||l.trim()==="")return"";const o=l.replace(/<!--[\s\S]*?-->/g,""),a=o.trim();return a.startsWith("<html>")&&a.endsWith("</html>")?a.slice(6,-7).trim():o},Lo=l=>{if(!l)return;const o=document.createTreeWalker(l,NodeFilter.SHOW_COMMENT,null,!1),a=[];let r=o.nextNode();for(;r;)a.push(r),r=o.nextNode();a.forEach(i=>i.remove())},_o=l=>{try{const o=String(l.getDate()).padStart(2,"0"),r=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][l.getMonth()],i=l.getFullYear();return`${o} ${r} ${i}`}catch{return""}},yn=l=>{if(!l||typeof l!="string")return!1;const o=l.trim();if(!o)return!1;if(["Started conversation","A démarré la conversation","started_conversation","conv_started"].includes(o))return!0;try{const i=R("textEditor.started_conversation");if(i&&o===i)return!0}catch{}const r=o.toLowerCase();return r.includes("started conversation")||r.includes("démarré la conversation")||r==="started conversation"||r==="a démarré la conversation"},Ao=l=>{const o=l.target.value;ye("update:modelValue",o),ye("change",o)},kn=()=>{if(!Ve.value)return;const l=Ve.value;if(l.style.setProperty("text-overflow","","important"),l.style.setProperty("white-space","","important"),l.style.setProperty("overflow-x","","important"),l.style.setProperty("height","auto","important"),l.value.trim()===""){const r=l.value;l.value="M";const i=l.scrollHeight;l.value=r,l.style.setProperty("height",`${i}px`,"important"),l.style.setProperty("overflow-y","hidden","important");return}l.offsetHeight;const a=l.scrollHeight;l.style.setProperty("height",`${a}px`,"important"),l.style.setProperty("overflow-y","hidden","important")},Do=()=>{Ft.value=!0,kn()},ao=()=>{Ft.value=!1,so()},so=()=>{if(!Ve.value)return;const l=Ve.value;l.style.setProperty("text-overflow","","important"),l.style.setProperty("white-space","","important"),l.style.setProperty("overflow-x","","important"),l.style.setProperty("height","auto","important");const o=l.value;l.value="M";const a=l.scrollHeight;l.value=o,l.offsetHeight,l.style.setProperty("height",`${a}px`,"important"),l.style.setProperty("overflow-y","hidden","important"),l.style.setProperty("overflow-x","hidden","important"),l.style.setProperty("text-overflow","ellipsis","important"),l.style.setProperty("white-space","nowrap","important")},Ro=l=>{const a=l.target.value;Ft.value&&kn(),ye("update:title",a),ye("title-change",a),st.value="title",S.richText&&(ge.value||($t.value=ze.value,Te.value=Kt.value,je.value=ft.value),de.value&&clearTimeout(de.value),ge.value=!0,de.value=setTimeout(()=>{ge.value=!1,k()},500))},ro=()=>{if(!Oe.value)return;const l=Oe.value;if(l.style.setProperty("text-overflow","","important"),l.style.setProperty("white-space","","important"),l.style.setProperty("overflow-x","","important"),l.style.setProperty("height","auto","important"),l.value.trim()===""){const r=l.value;l.value="M";const i=l.scrollHeight;l.value=r,l.style.setProperty("height",`${i}px`,"important"),l.style.setProperty("overflow-y","hidden","important");return}l.offsetHeight;const a=l.scrollHeight;l.style.setProperty("height",`${a}px`,"important"),l.style.setProperty("overflow-y","hidden","important")},io=()=>{_e.value=!0,ro()},ot=()=>{_e.value=!1,J()},J=()=>{if(!Oe.value)return;const l=Oe.value;l.style.setProperty("text-overflow","","important"),l.style.setProperty("white-space","","important"),l.style.setProperty("overflow-x","","important"),l.style.setProperty("height","auto","important");const o=l.value;l.value="M";const a=l.scrollHeight;l.value=o,l.offsetHeight,l.style.setProperty("height",`${a}px`,"important"),l.style.setProperty("overflow-y","hidden","important"),l.style.setProperty("overflow-x","hidden","important"),l.style.setProperty("text-overflow","ellipsis","important"),l.style.setProperty("white-space","nowrap","important")},Kn=l=>{const a=l.target.value;_e.value&&ro(),ye("update:description",a),ye("description-change",a),st.value="description",S.richText&&(ge.value||($t.value=ze.value,Te.value=Kt.value,je.value=ft.value),de.value&&clearTimeout(de.value),ge.value=!0,de.value=setTimeout(()=>{ge.value=!1,k()},500))},ae=()=>{const l=window.getSelection();if(l.rangeCount===0)return null;const o=l.getRangeAt(0);if(o.startContainer.nodeType===1)return{type:"element",element:o.startContainer,offset:o.startOffset};const a=o.cloneRange();return a.selectNodeContents(g.value),a.setEnd(o.startContainer,o.startOffset),{type:"text",start:a.toString().length,end:a.toString().length+o.toString().length}},wt=l=>{if(!(!l||!g.value))try{const o=window.getSelection(),a=document.createRange();if(l.type==="element"&&l.element)if(g.value.contains(l.element)){a.setStart(l.element,l.offset),a.collapse(!0),o.removeAllRanges(),o.addRange(a);return}else{g.value.focus();return}let r=0;const i=[g.value];let u=null,d=!1,p=!1;for(;!p&&(u=i.pop());)if(u.nodeType===3){const v=r+u.length;!d&&l.start>=r&&l.start<=v&&(a.setStart(u,l.start-r),d=!0),d&&l.end>=r&&l.end<=v&&(a.setEnd(u,l.end-r),p=!0),r=v}else{let v=u.childNodes.length;for(;v--;)i.push(u.childNodes[v])}o.removeAllRanges(),o.addRange(a)}catch{g.value.focus()}},ce=()=>{if(!g.value)return;g.value.focus();const l=window.getSelection(),o=document.createRange(),a=i=>{if(i.nodeType===3||i.childNodes.length===0)return i;for(let u=i.childNodes.length-1;u>=0;u--){const d=i.childNodes[u],p=a(d);if(p)return p}return i},r=a(g.value);if(r.nodeType===3)o.setStart(r,r.length),o.setEnd(r,r.length);else if(r.childNodes.length>0){const i=a(r);i&&i.nodeType===3?(o.setStart(i,i.length),o.setEnd(i,i.length)):(o.selectNodeContents(r),o.collapse(!1))}else o.setStart(r,0),o.setEnd(r,0);l.removeAllRanges(),l.addRange(o)},k=(l=!1)=>{if(!g.value)return;const o=g.value.innerHTML,a=S.title||"",r=S.description||"";if(!l&&o===ze.value&&a===Kt.value&&r===ft.value)return;const i={content:$t.value||ze.value,title:Te.value!==void 0?Te.value:Kt.value,description:je.value!==void 0?je.value:ft.value},u=Fe.value.length>0?Fe.value[Fe.value.length-1]:null;let d=!0;u&&(typeof u=="string"?d=i.content!==u:d=i.content!==u.content||i.title!==u.title||i.description!==u.description),d&&(Fe.value.push(i),Fe.value.length>50&&Fe.value.shift(),jt.value=[]),ze.value=o,Kt.value=a,ft.value=r,$t.value=o,Te.value=a,je.value=r},m=l=>{if(!g.value)return;E(),g.value&&Lo(g.value);let o=null;g.value&&(g.value.querySelector("p")||(o=ae(),x()));const a=l&&l.inputType&&(l.inputType==="insertText"||l.inputType==="insertCompositionText"||l.inputType==="deleteContentBackward"||l.inputType==="deleteContentForward");a&&rt.value&&(rt.value=null),Be.value=!0;const r=g.value.innerHTML.replace(/<!--[\s\S]*?-->/g,"").replace(/&nbsp;|\u00A0/g," "),i=Ln(r);ye("update:modelValue",i),ye("change",i),st.value="editor",ge.value||($t.value=ze.value,Te.value=Kt.value,je.value=ft.value),de.value&&clearTimeout(de.value),ge.value=!0,de.value=setTimeout(()=>{ge.value=!1,k(),Qo(),_t()},500),e.nextTick(()=>{o&&wt(o),E();const u=["bold","italic","underline"],d=window.getSelection(),p=d.rangeCount>0?d.getRangeAt(0):null,v=p&&p.collapsed;if(u.forEach(y=>{try{if(v&&rt.value?.command===y){ve.value[y]=rt.value.state;return}if(y==="bold")if(p){const V=p.commonAncestorContainer,N=V.nodeType===3?V.parentElement:V;let b=!1;if(N&&((N.tagName==="STRONG"||N.tagName==="B"||N.closest&&N.closest("strong, b"))&&(b=!0),!b&&N.style&&parseInt(N.style.fontWeight)>=600&&(b=!0),!b))try{const z=window.getComputedStyle(N);parseInt(z.fontWeight)>=600&&(b=!0)}catch{}ve.value[y]=b}else ve.value.hasOwnProperty(y)||(ve.value[y]=!1);else if(y==="italic")if(p){const V=p.commonAncestorContainer,N=V.nodeType===3?V.parentElement:V,b=N&&(N.tagName==="EM"||N.tagName==="I"||N.closest&&N.closest("em, i"));ve.value[y]=!!b}else{const V=document.queryCommandState(y);ve.value[y]=V}else{const V=document.queryCommandState(y);ve.value[y]=V}}catch{}}),an(),X(),Pt(),gt(),_n(),cn("handleRichTextInput"),a&&(l.inputType==="insertText"||l.inputType==="insertCompositionText")){const y=l.data||"";y&&y.length===1&&setTimeout(()=>_t(y),0),(y===" "||y===`
78
+ `||/[.,;:!?]/.test(y))&&setTimeout(()=>{Qo()},100)}Be.value=!1})},E=()=>{if(!g.value)return;const l=window.getSelection();if(!l||l.rangeCount===0)return;const o=l.getRangeAt(0),a=o.commonAncestorContainer,r=a.nodeType===3?a.parentElement:a;if(!r)return;const i=r.closest(".dss-image-wrapper");if(i){const u=i.querySelector("img");if(r!==u&&!u?.contains(r)){const d=o.startContainer.nodeType===3?o.startContainer.parentElement:o.startContainer,p=o.endContainer.nodeType===3?o.endContainer.parentElement:o.endContainer;if(i.contains(d)&&d!==u||i.contains(p)&&p!==u){const v=document.createRange();v.setStartAfter(i),v.collapse(!0),l.removeAllRanges(),l.addRange(v)}}}},x=()=>{if(!g.value)return;const l=g.value;if(l.querySelector&&l.querySelector("p"))return;const o=new Set(["P","H1","H2","H3","H4","H5","H6","BLOCKQUOTE","UL","OL","DIV"]),a=Array.from(l.childNodes);let r=null;a.forEach(i=>{if(i.nodeType===Node.TEXT_NODE){if((i.textContent||"").trim()===""){i.parentNode===l&&l.removeChild(i);return}r||(r=document.createElement("p"),l.insertBefore(r,i)),r.appendChild(i);return}if(i.nodeType===Node.ELEMENT_NODE){const u=i,d=u.tagName;if(d==="BR"){r=null;return}if(o.has(d)){r=null;return}r||(r=document.createElement("p"),l.insertBefore(r,u)),r.appendChild(u)}})},X=()=>{if(g.value&&!Ce.value){Ce.value=!0;try{g.value.querySelectorAll(".dss-image-wrapper").forEach(r=>{r.querySelector("img")||r.remove()}),g.value.querySelectorAll(".dss-image-no-alt-icon").forEach(r=>{const i=r.parentElement;!i||!i.classList.contains("dss-image-wrapper")?r.remove():i.querySelector("img")||r.remove()}),g.value.querySelectorAll("img").forEach(r=>{let i=r.getAttribute("alt");i===null&&(i=r.alt||"");const u=r.getAttribute("src")||r.src||"";if(i){const y=u.replace(/^https?:\/\//,"").replace(/^data:.*,/,""),V=i===u||i===y;(i.startsWith("http://")||i.startsWith("https://")||i.startsWith("data:")||V||V)&&(i="")}r.setAttribute("alt",i),r.setAttribute("data-alt",i);const d=!i||i.trim()==="";let p=r.parentElement;const v=p&&p.classList.contains("dss-image-wrapper");if(v){const y=p.querySelector(".dss-image-no-alt-icon");y&&y.remove()}else{const y=r.nextElementSibling?.classList.contains("dss-image-no-alt-icon")?r.nextElementSibling:null;y&&y.remove()}if(d){v?p.setAttribute("contenteditable","false"):(p=document.createElement("span"),p.className="dss-image-wrapper",p.setAttribute("contenteditable","false"),r.parentNode.insertBefore(p,r),p.appendChild(r));const y=document.createElement("div");y.className="dss-image-no-alt-icon",y.setAttribute("contenteditable","false"),y.innerHTML=ct,p.appendChild(y)}else if(v&&p.children.length===1){const y=p.parentNode;y.insertBefore(r,p),y.removeChild(p)}})}finally{Ce.value=!1}}},ue=l=>{Qo(),ye("blur",l),Co()},be=()=>{if(S.disabled||!S.richText||!g.value)return;qt(),de.value&&(clearTimeout(de.value),de.value=null),ge.value&&(k(),ge.value=!1);const l=st.value==="title",o=st.value==="description",a=st.value==="editor";if(Fe.value.length===0){l&&Ve.value?Ve.value.focus():o&&Oe.value?Oe.value.focus():g.value.focus(),document.execCommand("undo",!1),e.nextTick(()=>{m()});return}const r={content:g.value.innerHTML,title:S.title||"",description:S.description||""};jt.value.push(r);const i=Fe.value.pop();if(i!==void 0){Be.value=!0;const u=typeof i=="string"?i:i.content,d=typeof i=="object"&&i.title||"",p=typeof i=="object"&&i.description||"";g.value.innerHTML=u,ze.value=u,Kt.value=d,ft.value=p,$t.value=u,Te.value=d,je.value=p,e.nextTick(()=>{an(),Qt(),Vn(),gt();const v=Ln(u);ye("update:modelValue",v),ye("update:title",d),ye("update:description",p),ye("change",v),ye("title-change",d),ye("description-change",p),Be.value=!1,e.nextTick(()=>{setTimeout(()=>{if(l){if(Ve.value){Ve.value.focus();const y=d.length;Ve.value.setSelectionRange&&Ve.value.setSelectionRange(y,y),kn()}}else if(o){if(Oe.value){Oe.value.focus();const y=p.length;Oe.value.setSelectionRange(y,y)}}else if(a)ce();else if(Ve.value&&document.activeElement===Ve.value){const y=d.length;Ve.value.setSelectionRange&&Ve.value.setSelectionRange(y,y),kn()}else if(Oe.value&&document.activeElement===Oe.value){const y=p.length;Oe.value.setSelectionRange(y,y)}else g.value&&ce()},10)})})}},zt=()=>{if(S.disabled||!S.richText||!g.value)return;qt();const l=st.value==="title",o=st.value==="description",a=st.value==="editor";if(jt.value.length===0){l&&Ve.value?Ve.value.focus():o&&Oe.value?Oe.value.focus():g.value.focus(),document.execCommand("redo",!1),e.nextTick(()=>{m()});return}const r={content:g.value.innerHTML,title:S.title||"",description:S.description||""};Fe.value.push(r);const i=jt.value.pop();if(i!==void 0){Be.value=!0;const u=typeof i=="string"?i:i.content,d=typeof i=="object"&&i.title||"",p=typeof i=="object"&&i.description||"";g.value.innerHTML=u,ze.value=u,Kt.value=d,ft.value=p,$t.value=u,Te.value=d,je.value=p,e.nextTick(()=>{an(),Qt(),Vn(),gt();const v=Ln(u);ye("update:modelValue",v),ye("update:title",d),ye("update:description",p),ye("change",v),ye("title-change",d),ye("description-change",p),Be.value=!1,e.nextTick(()=>{setTimeout(()=>{if(l){if(Ve.value){Ve.value.focus();const y=d.length;Ve.value.setSelectionRange&&Ve.value.setSelectionRange(y,y),kn()}}else if(o){if(Oe.value){Oe.value.focus();const y=p.length;Oe.value.setSelectionRange(y,y)}}else if(a)ce();else if(Ve.value&&document.activeElement===Ve.value){const y=d.length;Ve.value.setSelectionRange&&Ve.value.setSelectionRange(y,y),kn()}else if(Oe.value&&document.activeElement===Oe.value){const y=p.length;Oe.value.setSelectionRange(y,y)}else g.value&&ce()},10)})})}},En=()=>{if(!g.value)return;g.value.querySelectorAll('span[style*="font-weight"]').forEach(r=>{const i=r.style.fontWeight;if(i==="normal"||i==="400"){const u=document.createDocumentFragment();for(;r.firstChild;)u.appendChild(r.firstChild);r.parentNode&&r.parentNode.replaceChild(u,r)}}),g.value.querySelectorAll('span[style*="font-weight"]').forEach(r=>{if(parseInt(r.style.fontWeight)>=600){const u=document.createElement("b");for(u.style.fontWeight="600";r.firstChild;)u.appendChild(r.firstChild);r.parentNode&&r.parentNode.replaceChild(u,r)}}),g.value.querySelectorAll("b, strong").forEach(r=>{r.style.fontWeight="600"})},Pt=()=>{if(!g.value)return;g.value.querySelectorAll("i, em").forEach(o=>{o.style.fontStyle="italic"})},Oo=()=>{const l=window.getSelection();if(!l||l.rangeCount===0)return!1;const o=l.getRangeAt(0);let a=!1;if(o.collapsed){const r=o.startContainer;let i=r.nodeType===3?r.parentElement:r;for(;i&&i!==g.value;){if(i.tagName==="EM"||i.tagName==="I"){a=!0;break}if(i.style&&i.style.fontStyle==="italic"){a=!0;break}i=i.parentElement}}else{const r=o.commonAncestorContainer.nodeType===1?o.commonAncestorContainer:o.commonAncestorContainer.parentNode;if(r){const i=document.createTreeWalker(r,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let u;for(;u=i.nextNode();)if(!(typeof o.intersectsNode=="function"&&!o.intersectsNode(u))){if(u.nodeType===3){let d=u.parentElement;for(;d&&d!==g.value;){if(d.tagName==="EM"||d.tagName==="I"){a=!0;break}if(d.style&&d.style.fontStyle==="italic"){a=!0;break}d=d.parentElement}}else if(u.nodeType===1){const d=u;if(d.tagName==="EM"||d.tagName==="I"){a=!0;break}if(d.style&&d.style.fontStyle==="italic"){a=!0;break}}if(a)break}}}if(a)return document.execCommand("italic",!1),e.nextTick(()=>{Pt()}),!1;if(o.collapsed)document.execCommand("italic",!1),e.nextTick(()=>{Pt()});else try{const r=o.extractContents(),i=document.createElement("em");i.style.fontStyle="italic",i.appendChild(r),o.insertNode(i),o.setStartAfter(i),o.collapse(!0),l.removeAllRanges(),l.addRange(o),e.nextTick(()=>{Pt()})}catch{document.execCommand("italic",!1),e.nextTick(()=>{Pt()})}return!0},Zo=()=>{const l=window.getSelection();if(!l||l.rangeCount===0)return!1;const o=l.getRangeAt(0);let a=!1;if(o.collapsed){const r=o.startContainer;let i=r.nodeType===3?r.parentElement:r;for(;i&&i!==g.value;){if(i.tagName==="STRONG"||i.tagName==="B"){a=!0;break}if(i.style&&parseInt(i.style.fontWeight)>=600){a=!0;break}i=i.parentElement}}else{const r=o.commonAncestorContainer.nodeType===1?o.commonAncestorContainer:o.commonAncestorContainer.parentNode;if(r){const i=document.createTreeWalker(r,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let u;for(;u=i.nextNode();)if(!(typeof o.intersectsNode=="function"&&!o.intersectsNode(u))){if(u.nodeType===3){let d=u.parentElement;for(;d&&d!==g.value;){if(d.tagName==="STRONG"||d.tagName==="B"){a=!0;break}if(d.style&&parseInt(d.style.fontWeight)>=600){a=!0;break}d=d.parentElement}}else if(u.nodeType===1){const d=u;if(d.tagName==="STRONG"||d.tagName==="B"){a=!0;break}if(d.style&&parseInt(d.style.fontWeight)>=600){a=!0;break}}if(a)break}}}if(a)return document.execCommand("bold",!1),e.nextTick(()=>{En()}),!1;if(o.collapsed)document.execCommand("bold",!1),e.nextTick(()=>{const r=window.getSelection();if(r.rangeCount>0){const i=r.getRangeAt(0),u=i.startContainer;let d=u.nodeType===3?u.parentElement:u;for(;d&&d!==g.value;){if(d.tagName==="SPAN"&&d.style.fontWeight){const p=d.style.fontWeight;if(p==="normal"||p==="400"){const v=document.createElement("b");v.style.fontWeight="600";const y=document.createDocumentFragment();for(;d.firstChild;)y.appendChild(d.firstChild);v.appendChild(y),d.parentNode&&d.parentNode.replaceChild(v,d),i.setStart(v,0),i.collapse(!0),r.removeAllRanges(),r.addRange(i);break}}else if(d.tagName==="STRONG"||d.tagName==="B"){d.style.fontWeight="600";break}d=d.parentElement}if(!d||d===g.value){const p=document.createElement("b");p.style.fontWeight="600",p.innerHTML="<br>",i.insertNode(p),i.setStart(p,0),i.collapse(!0),r.removeAllRanges(),r.addRange(i)}}En()});else try{const r=o.extractContents(),i=document.createElement("b");i.style.fontWeight="600",i.appendChild(r),o.insertNode(i),o.setStartAfter(i),o.collapse(!0),l.removeAllRanges(),l.addRange(o),e.nextTick(()=>{En()})}catch{document.execCommand("bold",!1),e.nextTick(()=>{En()})}return!0},on=(l,o=null)=>{if(S.disabled||!S.richText||!g.value)return;ge.value?(de.value&&(clearTimeout(de.value),de.value=null),k(),ge.value=!1):k(),qt(),g.value.focus();const a=window.getSelection();let r=null;if(a&&a.rangeCount>0){const u=a.getRangeAt(0);!u.collapsed&&uo(u)&&(r=ae())}if(l==="createLink"&&o){const u=window.getSelection();if(u.rangeCount>0){const d=u.getRangeAt(0);if(d.collapsed)try{d.expand("word")}catch{const v=document.createTextNode(o);d.insertNode(v),d.selectNodeContents(v)}}}if(l==="bold"){const u=Zo();ve.value.bold=u;const d=window.getSelection();d.rangeCount>0&&d.getRangeAt(0).collapsed&&(rt.value={command:"bold",state:u}),e.nextTick(()=>{r&&(wt(r),e.nextTick(()=>{const p=ln("bold");ve.value.bold=p})),m(),Qt(),gt()});return}if(l==="italic"){const u=Oo();ve.value.italic=u;const d=window.getSelection();d.rangeCount>0&&d.getRangeAt(0).collapsed&&(rt.value={command:"italic",state:u}),e.nextTick(()=>{r&&(wt(r),e.nextTick(()=>{const p=ln("italic");ve.value.italic=p})),m(),Pt(),Qt(),gt()});return}let i=!1;try{i=document.execCommand(l,!1,o)}catch{}e.nextTick(()=>{if(r&&wt(r),["bold","italic","underline"].includes(l))try{if(l==="bold")r&&e.nextTick(()=>{const d=ln("bold");ve.value.bold=d});else if(l==="italic")if(r)e.nextTick(()=>{const d=ln("italic");ve.value.italic=d});else{const d=document.queryCommandState(l);ve.value[l]=d}else{const d=document.queryCommandState(l);ve.value[l]=d}}catch{ve.value.hasOwnProperty(l)?ve.value[l]=!ve.value[l]:ve.value[l]=!0}if(l==="createLink"&&o){const d=window.getSelection();if(d.rangeCount>0){const v=d.getRangeAt(0),y=v.commonAncestorContainer.nodeType===1?v.commonAncestorContainer.closest("a"):v.commonAncestorContainer.parentElement?.closest("a");y&&(!y.getAttribute("href")||y.getAttribute("href")==="")&&y.setAttribute("href",o)}g.value.querySelectorAll("a").forEach(v=>{const y=v.getAttribute("href");(!y||y===""||y==="#")&&v.setAttribute("href",o)})}m(),Qt(),gt()})},ln=(l,o=null)=>{if(S.disabled||!g.value)return!1;try{if(l==="formatBlock"&&o){const r=document.queryCommandValue("formatBlock");if(o==="<blockquote>"){const i=r.toLowerCase();if(i==="blockquote"||i==="<blockquote>")return!0;const u=window.getSelection();if(u.rangeCount>0){const p=u.getRangeAt(0).commonAncestorContainer;return!!(p.nodeType===1?p.tagName==="BLOCKQUOTE"?p:p.closest("blockquote"):p.parentElement?.closest("blockquote"))}}return r===o||r.toLowerCase()===o.toLowerCase()}if(["bold","italic","underline"].includes(l))try{const r=window.getSelection();if(r.rangeCount>0){const i=r.getRangeAt(0);if(l==="bold"){let d=!1;if(i.collapsed){const p=i.commonAncestorContainer,v=p.nodeType===3?p.parentElement:p;if(v&&((v.tagName==="STRONG"||v.tagName==="B"||v.closest&&v.closest("strong, b"))&&(d=!0),!d&&v.style&&parseInt(v.style.fontWeight)>=600&&(d=!0),!d))try{const y=window.getComputedStyle(v);parseInt(y.fontWeight)>=600&&(d=!0)}catch{}return ve.value.hasOwnProperty(l)?ve.value[l]:(ve.value[l]=d,d)}else{const p=i.commonAncestorContainer.nodeType===1?i.commonAncestorContainer:i.commonAncestorContainer.parentNode;let v=!1;if(p){const y=document.createTreeWalker(p,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let V;for(;V=y.nextNode();)if(!(typeof i.intersectsNode=="function"&&!i.intersectsNode(V))){if(V.nodeType===3){if(!(V.textContent||"").trim())continue;v=!0;let b=V.parentElement;for(;b&&b!==g.value;){if(b.tagName==="STRONG"||b.tagName==="B"){d=!0;break}if(b.style&&parseInt(b.style.fontWeight)>=600){d=!0;break}b=b.parentElement}}else if(V.nodeType===1){const N=V;if(N.tagName==="STRONG"||N.tagName==="B"){d=!0;break}if(N.style&&parseInt(N.style.fontWeight)>=600){d=!0;break}}if(d)break}}return ve.value[l]=d&&v,d&&v}}if(l==="italic"){let d=!1;if(i.collapsed){const p=i.commonAncestorContainer,v=p.nodeType===3?p.parentElement:p;if(v&&((v.tagName==="EM"||v.tagName==="I"||v.closest&&v.closest("em, i"))&&(d=!0),!d&&v.style&&v.style.fontStyle==="italic"&&(d=!0),!d))try{window.getComputedStyle(v).fontStyle==="italic"&&(d=!0)}catch{}return ve.value.hasOwnProperty(l)?ve.value[l]:(ve.value[l]=d,d)}else{const p=i.commonAncestorContainer.nodeType===1?i.commonAncestorContainer:i.commonAncestorContainer.parentNode;let v=!1;if(p){const y=document.createTreeWalker(p,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let V;for(;V=y.nextNode();)if(!(typeof i.intersectsNode=="function"&&!i.intersectsNode(V))){if(V.nodeType===3){if(!(V.textContent||"").trim())continue;v=!0;let b=V.parentElement;for(;b&&b!==g.value;){if(b.tagName==="EM"||b.tagName==="I"){d=!0;break}if(b.style&&b.style.fontStyle==="italic"){d=!0;break}b=b.parentElement}}else if(V.nodeType===1){const N=V;if(N.tagName==="EM"||N.tagName==="I"){d=!0;break}if(N.style&&N.style.fontStyle==="italic"){d=!0;break}}if(d)break}}return ve.value[l]=d&&v,d&&v}}const u=document.queryCommandState(l);return i.collapsed&&ve.value.hasOwnProperty(l)?ve.value[l]:(ve.value[l]=u,u)}return ve.value.hasOwnProperty(l)?ve.value[l]:!1}catch{return ve.value.hasOwnProperty(l)?ve.value[l]:!1}try{return document.queryCommandState(l)}catch{return!1}}catch{return!1}},cl=l=>{S.disabled||!S.richText||(we.value=we.value===l?null:l,l==="askAi"&&($e.value=null))},qt=()=>{we.value=null,Ze.value=null},zn=l=>{on("formatBlock",l),qt()},dl=l=>{if(!l||!g.value)return l;const o=oe=>{let Y=oe.nodeType===Node.TEXT_NODE?oe.parentElement:oe;for(;Y&&Y!==g.value;){const Ee=Y.tagName;if(Ee==="P"){const yt=Y.parentElement;if(yt===g.value||yt.tagName==="BLOCKQUOTE")return Y}if(Ee==="BLOCKQUOTE")break;Y=Y.parentElement}return null},a=o(l.startContainer),r=o(l.endContainer);if(!a||!r)return l;const i=[],u=document.createTreeWalker(g.value,NodeFilter.SHOW_ELEMENT,{acceptNode:oe=>{const Y=oe.tagName;if(Y==="P"){const Ee=oe.parentElement;if(Ee===g.value||Ee.tagName==="BLOCKQUOTE")return NodeFilter.FILTER_ACCEPT}return Y==="BLOCKQUOTE"?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_SKIP}});let d;for(;d=u.nextNode();)i.push(d);const p=i.indexOf(a),v=i.indexOf(r);if(p===-1||v===-1)return l;const y=Math.min(p,v),V=Math.max(p,v),N=i.slice(y,V+1);if(N.length===0)return l;const b=N[0],z=N[N.length-1],I=document.createRange();return I.setStartBefore(b),I.setEndAfter(z),I},ul=()=>{if(S.disabled||!S.richText||!g.value)return;ge.value?(de.value&&(clearTimeout(de.value),de.value=null),k(),ge.value=!1):k(),qt(),g.value.focus();const l=window.getSelection();if(l.rangeCount===0)return;let o=l.getRangeAt(0);!o.collapsed&&uo(o)&&(o=dl(o),l.removeAllRanges(),l.addRange(o));let a=null;!o.collapsed&&uo(o)&&(a=ae());const r=o.commonAncestorContainer,i=r.nodeType===1?r.tagName==="BLOCKQUOTE"?r:r.closest("blockquote"):r.parentElement?.closest("blockquote");if(!!(i&&g.value.contains(i))){if(i){const d=i.parentNode;Array.from(i.childNodes).forEach(v=>{if(v.nodeType===Node.ELEMENT_NODE)if(v.tagName==="P"||v.tagName==="DIV")d.insertBefore(v,i);else{const y=document.createElement("p");y.appendChild(v.cloneNode(!0)),d.insertBefore(y,i)}else if(v.nodeType===Node.TEXT_NODE&&v.textContent.trim()){const y=document.createElement("p");y.appendChild(v.cloneNode(!0)),d.insertBefore(y,i)}}),i.remove()}}else if(o.collapsed)document.execCommand("formatBlock",!1,"<blockquote>");else{const d=document.createElement("blockquote"),p=o.extractContents();d.appendChild(p),o.insertNode(d);const v=[],y=document.createTreeWalker(d,NodeFilter.SHOW_TEXT,{acceptNode:b=>b.parentNode===d&&b.textContent.trim()?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});let V;for(;V=y.nextNode();)v.push(V);if(v.forEach(b=>{const z=document.createElement("p");b.parentNode.insertBefore(z,b),z.appendChild(b)}),d.querySelectorAll("p, div").forEach(b=>{b.textContent.trim()===""&&!b.querySelector("img")&&(b.innerHTML="<br>")}),d.children.length===0&&d.textContent.trim()===""){const b=document.createElement("p");b.innerHTML="<br>",d.appendChild(b)}}e.nextTick(()=>{a&&wt(a),Vn(),m(),gt()})},ml=()=>{if(!g.value)return;const l=window.getSelection();if(l.rangeCount===0)return;const a=l.getRangeAt(0).commonAncestorContainer,r=a.nodeType===1?a.tagName==="BLOCKQUOTE"?a:a.closest("blockquote"):a.parentElement?.closest("blockquote");if(!r||!g.value.contains(r))return;const i=V=>{if(!V)return!1;const N=V.textContent||"",z=(V.innerHTML||"").trim();return N.trim()===""||z===""||z==="<br>"||z==="<br/>"||z==="<p></p>"||z==="<p><br></p>"||z==="<p><br/></p>"||z==="<p> </p>"||z==="<p><br> </p>"||z==="<div></div>"||z==="<div><br></div>"||z==="<div><br/></div>"};let u=null;for(a.nodeType===3?u=a.parentElement:a.tagName==="P"||a.tagName==="DIV"?u=a:u=a.closest("p, div"),u&&r.contains(u)&&i(u)&&u.remove();r.lastChild;){const V=r.lastChild;if(V.nodeType===1&&V.tagName==="BR")V.remove();else if(V.nodeType===3)if((V.textContent||"").trim()==="")V.remove();else break;else break}if(r.children.length>0)for(let V=r.children.length-1;V>=0;V--){const N=r.children[V];if((N.tagName==="P"||N.tagName==="DIV")&&i(N))N.remove();else break}let d=r.innerHTML;const p=d;d=d.replace(/(<br\s*\/?>)+$/gi,""),d!==p&&(r.innerHTML=d);const v=document.createElement("p");v.innerHTML="<br>",r.parentNode?r.nextSibling?r.parentNode.insertBefore(v,r.nextSibling):r.parentNode.appendChild(v):g.value&&g.value.appendChild(v);const y=document.createRange();y.selectNodeContents(v),y.collapse(!0),l.removeAllRanges(),l.addRange(y),e.nextTick(()=>{Vn(),m()})},Qt=()=>{if(!g.value){Me.value=!1;return}try{const l=window.getSelection();if(l.rangeCount>0){const a=l.getRangeAt(0).commonAncestorContainer,r=a.nodeType===1?a.closest("a"):a.parentElement?.closest("a");Me.value=!!r}else Me.value=!1}catch{Me.value=!1}},pl=()=>{if(!g.value)return;const l=window.getSelection();l&&l.rangeCount>0&&l.getRangeAt(0),Xt.value=ae();const o=window.getSelection();let a="";o.rangeCount>0&&(a=o.getRangeAt(0).toString()),mt.value="",F.value=a,en.value="",pe.value=null,At.value=!0,qt(),e.nextTick(()=>{Tt.value&&Tt.value.focus()})},Gn=()=>{if(!g.value)return;ge.value?(de.value&&(clearTimeout(de.value),de.value=null),k(),ge.value=!1):k();const l=window.getSelection();let o=null;if(l.rangeCount>0){const r=l.getRangeAt(0).commonAncestorContainer;o=r.nodeType===1?r.closest("a"):r.parentElement?.closest("a")}if(!o&&pe.value&&(o=pe.value),o&&o.parentNode){const a=document.createDocumentFragment();for(;o.firstChild;)a.appendChild(o.firstChild);if(o.parentNode.replaceChild(a,o),a.firstChild){const r=document.createRange();r.setStartBefore(a.firstChild),r.setEndAfter(a.lastChild||a.firstChild),l.removeAllRanges(),l.addRange(r),document.execCommand("removeFormat",!1),r.collapse(!1),l.removeAllRanges(),l.addRange(r)}pe.value=null}else on("unlink");Me.value=!1,qt(),e.nextTick(()=>{m(),Qt()})},vl=()=>{S.disabled||!S.richText||g.value&&(ge.value?(de.value&&(clearTimeout(de.value),de.value=null),k(),ge.value=!1):k(),qt(),g.value.focus(),document.execCommand("insertUnorderedList",!1),e.nextTick(()=>{an(),m(),gt()}))},fl=()=>{S.disabled||!S.richText||g.value&&(ge.value?(de.value&&(clearTimeout(de.value),de.value=null),k(),ge.value=!1):k(),qt(),g.value.focus(),document.execCommand("insertOrderedList",!1),e.nextTick(()=>{an(),m(),gt()}))},gl=l=>{const o=l.parentElement;if(!o||o.tagName!=="OL")return null;let a=0,r=l.previousElementSibling;for(;r;)r.tagName==="LI"&&a++,r=r.previousElementSibling;return a+1},an=()=>{if(!g.value)return;g.value.querySelectorAll("li > ol").forEach(o=>{const a=o.parentElement;if(a&&a.tagName==="LI"){const r=gl(a);r!==null&&Array.from(o.children).filter(u=>u.tagName==="LI").forEach(u=>{u.setAttribute("data-parent-num",String(r))})}})},hl=()=>{if(S.disabled||!S.richText||!g.value)return;qt(),g.value.focus();const l=window.getSelection();if(l.rangeCount===0)return;const o=l.getRangeAt(0),a=o.commonAncestorContainer.nodeType===1?o.commonAncestorContainer.closest("li"):o.commonAncestorContainer.parentElement?.closest("li");if(!a){document.execCommand("indent",!1),e.nextTick(()=>{an(),m()});return}const r=a.parentElement;if(!r||r.tagName!=="OL"&&r.tagName!=="UL")return;const i=a.previousElementSibling;if(i&&i.tagName==="LI"){const u=r.tagName.toLowerCase();let d=i.querySelector(`:scope > ${u}`);d||(d=document.createElement(u),i.appendChild(d));const p=gl(i);d.appendChild(a),p!==null&&r.tagName==="OL"&&a.setAttribute("data-parent-num",String(p)),an();const v=document.createRange();v.selectNodeContents(a),v.collapse(!1),l.removeAllRanges(),l.addRange(v),e.nextTick(()=>{m(),gt()})}else document.execCommand("indent",!1),e.nextTick(()=>{an(),m(),gt()})},Io=()=>{if(S.disabled||!S.richText||!g.value)return;qt(),g.value.focus();const l=window.getSelection();if(l.rangeCount===0)return;const o=l.getRangeAt(0),a=o.commonAncestorContainer.nodeType===1?o.commonAncestorContainer.closest("li"):o.commonAncestorContainer.parentElement?.closest("li");if(!a){document.execCommand("outdent",!1),e.nextTick(()=>{an(),m()});return}const r=a.parentElement;if(!r||r.tagName!=="OL"&&r.tagName!=="UL")return;const i=r.parentElement;if(i&&i.tagName==="LI"){const u=i.parentElement;if(u&&(u.tagName==="OL"||u.tagName==="UL")){r.tagName==="OL"&&a.removeAttribute("data-parent-num"),u.insertBefore(a,i.nextSibling),r.children.length===0&&r.remove(),an();const d=document.createRange();d.selectNodeContents(a),d.collapse(!1),l.removeAllRanges(),l.addRange(d),e.nextTick(()=>{m(),gt()});return}}document.execCommand("outdent",!1),e.nextTick(()=>{an(),m(),gt()})},Ot=e.ref(null),sn=e.ref(null),yo=e.ref({}),Pn=e.ref(""),On=e.ref(null),Qn=e.ref("");e.ref("");const Jn=e.ref(null);e.ref("");const fn=e.ref([]),Wo=e.ref(!1),ko=e.ref(!1),qo=l=>{if(!l)return"";const o=l.cloneRange(),a=document.createElement("div");return a.appendChild(o.cloneContents()),a.innerHTML},Uo=()=>{if(S.disabled||!S.richText||!g.value)return;if(Ot.value!==null){Ot.value=null,Pn.value="",Qn.value="",Jn.value=null,fn.value=[],no(!0);return}qt(),g.value.focus();const l=window.getSelection();if(!l||l.rangeCount===0)return;const o=l.getRangeAt(0);if(o.collapsed||!uo(o))return;Qn.value=qo(o)||"",Jn.value=ae();const a=o.getBoundingClientRect(),r=g.value.parentElement;if(!r)return;const i=r.getBoundingClientRect(),u=a.bottom-i.top,p=Math.max(u+8,0);yo.value={top:`${p}px`,bottom:"auto"},Ot.value=Date.now(),e.nextTick(()=>{if(Pn.value="",On.value){const y=On.value;y.style.height="auto",y.style.height=`${y.scrollHeight}px`,y.focus()}const v=r.querySelector(".dss-comment-overlay");if(v&&r){const y=r.querySelector(".dss-text-editor-footer");if(y){const V=r.getBoundingClientRect(),N=v.getBoundingClientRect(),b=y.getBoundingClientRect(),z=N.bottom-V.top,I=b.top-V.top,oe=8;if(z>I-oe){const Y=b.height;yo.value={bottom:`${Y+oe}px`,top:"auto"}}else yo.value={top:`${p}px`,bottom:"auto"}}}})},yl=()=>{if(!Pn.value.trim())return;const l=Pn.value.trim(),o=new Date,a={text:l,selectionText:Qn.value,selectionRange:Jn.value,commentId:Ot.value,user:S.commentUser||null,createdAt:o.toISOString()};fn.value=[...fn.value,a],ye("comment-submitted",a),Zn(a),Jn.value&&!Xo(Jn.value)&&Yo(Ot.value,Jn.value),Pn.value="",e.nextTick(()=>{if(On.value){const r=On.value;r.style.height="auto",r.style.height=`${r.scrollHeight}px`,r.focus()}cn("sendComment")})},Bl=(l,o)=>{if(!(!S.commentUser||!l.user||l.user.id!==S.commentUser.id)){if(fn.value=fn.value.filter((a,r)=>r!==o),Ot.value!==null&&g.value){const a=String(Ot.value),r=g.value.querySelector(`[data-comment="${a}"], [data-fake-comment="${a}"]`);if(r&&fn.value.length>0){const i=[],u=new Set;fn.value.forEach(d=>{d.user&&d.user.id&&!u.has(d.user.id)&&(u.add(d.user.id),i.push(d.user))}),i.length>0?r.setAttribute("data-comment-user",JSON.stringify(i[0])):r.removeAttribute("data-comment-user"),i.length>1?r.setAttribute("data-comment-user-2",JSON.stringify(i[1])):r.removeAttribute("data-comment-user-2"),r.setAttribute("data-comment-count",String(fn.value.length))}else r&&fn.value.length===0&&(r.removeAttribute("data-comment-user"),r.removeAttribute("data-comment-user-2"),r.setAttribute("data-comment-count","0"))}if(ye("comment-deleted",{comment:l,index:o,commentId:Ot.value}),S.comments&&Array.isArray(S.comments)){const a=S.comments.filter(r=>!(r.commentId===l.commentId&&r.text===l.text&&r.user?.id===l.user?.id));ye("update:comments",a)}e.nextTick(()=>{cn("deleteComment")})}},Xo=l=>{if(!l||!g.value)return!1;try{const o=kl(l);if(!o)return!1;const a=o.commonAncestorContainer,r=a.nodeType===3?a.parentElement:a;if(r)return!!r.closest("[data-comment], [data-fake-comment]")}catch{}return!1},kl=l=>{if(!l||!g.value)return null;try{const o=document.createRange();if(l.type==="element"&&l.element)return g.value.contains(l.element)?(o.setStart(l.element,l.offset),o.collapse(!0),o):null;let a=0;const r=[g.value];let i=null,u=!1,d=!1;for(;!d&&(i=r.pop());)if(i.nodeType===3){const p=a+i.length;!u&&l.start>=a&&l.start<=p&&(o.setStart(i,l.start-a),u=!0),u&&l.end>=a&&l.end<=p&&(o.setEnd(i,l.end-a),d=!0),a=p}else{let p=i.childNodes.length;for(;p--;)r.push(i.childNodes[p])}return u?o:null}catch{return null}},Yo=(l,o)=>{if(!(!l||!o||!g.value))try{const a=kl(o);if(!a||a.collapsed)return;const r=a.commonAncestorContainer,i=r.nodeType===3?r.parentElement:r;if(i){const p=i.closest("[data-comment], [data-fake-comment]");if(p){p.getAttribute("data-comment")!==String(l)&&p.getAttribute("data-fake-comment")!==String(l)&&p.setAttribute("data-comment",String(l));return}}const u=document.createElement("span");u.setAttribute("data-comment",String(l));try{const p=a.startContainer,v=a.endContainer,y=a.startOffset,V=a.endOffset,N=p.nodeType===3?p.parentNode:p,b=v.nodeType===3?v.parentNode:v;if(N===b&&y===0&&V===(v.nodeType===3?v.length:b.childNodes.length)&&(N.tagName==="P"||N.tagName==="DIV"||N.tagName==="H1"||N.tagName==="H2"||N.tagName==="H3"||N.tagName==="H4"||N.tagName==="H5"||N.tagName==="H6")){const I=a.extractContents();u.appendChild(I),a.insertNode(u)}else a.surroundContents(u)}catch{const v=a.extractContents();u.appendChild(v),a.insertNode(u)}const d=g.value.querySelector(`[data-comment="${String(l)}"]`);e.nextTick(()=>{cn("wrapSelectionWithCommentMarker"),m()})}catch{}},Zn=l=>{if(!l||!l.commentId)return;const o=Array.isArray(S.comments)?[...S.comments]:[],a=typeof l.commentId=="string"&&l.commentId.startsWith("comment-")?Date.now():Number(l.commentId)||l.commentId;let r=o.findIndex(u=>typeof u.conversation_id=="string"&&u.conversation_id.startsWith("comment-")?null:Number(u.conversation_id)===Number(a)||u.conversation_id===a);const i={text:l.text,user:l.user,createdAt:l.createdAt,created_at:l.createdAt,updated_at:l.createdAt};if(r>=0){const u=o[r];if(u.conversation||(u.conversation=[]),u.conversation.push(i),u.updated_at=l.createdAt,!u.article_id&&o.length>0){const d=o.find(p=>p.article_id);d&&(u.article_id=d.article_id)}}else{const u=l.selectionRange,d=o.length>0&&o.find(v=>v.article_id)?.article_id||null,p={conversation_id:a,article_id:d,selection_range:u?{start:u.start||0,end:u.end||0,type:u.type||"text"}:null,selection_text:l.selectionText||"",conversation:[i],created_by_user:l.user,created_at:l.createdAt,updated_at:l.createdAt,status:"active"};o.push(p)}Wo.value=!0,ye("update:comments",o)},H=(l,o=[])=>{if(S.disabled||!S.richText||!g.value)return;const a=g.value;let r=null;try{r=a.querySelector(l)}catch{return}if(!r)return;qt(),a.focus();const i=document.createRange();i.selectNodeContents(r);const u=window.getSelection();u&&(u.removeAllRanges(),u.addRange(i)),Qn.value=r.innerHTML||"",Jn.value=ae();const d=i.getBoundingClientRect(),p=a.parentElement;if(p){const V=p.getBoundingClientRect(),N=d.bottom-V.top,z=Math.max(N+8,0);yo.value={top:`${z}px`,bottom:"auto"}}const v=r.getAttribute("data-comment")||r.getAttribute("data-fake-comment");let y=[];if(v&&S.comments&&Array.isArray(S.comments)){const V=S.comments.find(N=>String(N.conversation_id)===String(v));if(V&&V.conversation&&Array.isArray(V.conversation)){const N=V.conversation.map(b=>({id:b.id||b.commentary_id,commentary_id:b.id||b.commentary_id,conversation_id:V.id||V.conversation_id,text:b.text,user:b.user,createdAt:b.created_at||b.createdAt,updated_at:b.updated_at||b.updatedAt}));y.push(...N)}}y.length===0&&Array.isArray(o)&&o.length>0&&(y=o.slice()),y.sort((V,N)=>{const b=oe=>{if(!oe)return 0;const Y=new Date(oe).getTime();return isNaN(Y)?0:Y},z=b(V.createdAt),I=b(N.createdAt);return z===I?0:z-I}),fn.value=y,no(!0),Ot.value=v||null,r&&(sn.value=r,r.classList.add("editor-comment-highlighted")),e.nextTick(()=>{if(Pn.value="",On.value){const V=On.value;V.style.height="auto",V.style.height=`${V.scrollHeight}px`,V.focus()}if(p){const V=p.querySelector(".dss-comment-overlay");if(V){const N=p.querySelector(".dss-text-editor-footer");if(N){const b=p.getBoundingClientRect(),z=V.getBoundingClientRect(),I=N.getBoundingClientRect(),oe=z.bottom-b.top,Y=I.top-b.top,Ee=8;if(oe>Y-Ee){const yt=I.height;yo.value={bottom:`${yt+Ee}px`,top:"auto"}}}}}cn("openCommentOverlayForSelector")})},Lt=e.ref(null),Cn=e.ref(0),rn=l=>{if(!(S.disabled||!S.richText)){if(l.key==="Escape"){const o=window.getSelection();if(o.rangeCount>0){const r=o.getRangeAt(0).commonAncestorContainer,i=r.nodeType===1?r.tagName==="BLOCKQUOTE"?r:r.closest("blockquote"):r.parentElement?.closest("blockquote");if(!!(i&&g.value&&g.value.contains(i))){l.preventDefault();let d=null;r.nodeType===3?d=r.parentElement:r.tagName==="P"||r.tagName==="DIV"?d=r:d=r.closest("p, div");const p=document.createElement("p");p.innerHTML="<br>",d&&i.contains(d)&&d.nextSibling?i.insertBefore(p,d.nextSibling):i.appendChild(p),setTimeout(()=>{ml()},50);return}}}if(l.key.length===1||l.key==="Enter"){const o=window.getSelection();if(o&&o.rangeCount>0){const a=o.getRangeAt(0),r=a.commonAncestorContainer,i=r.nodeType===3?r.parentElement:r;if(i){const u=i.closest(".dss-image-wrapper");if(u){const d=u.querySelector("img");if(i!==d&&!d?.contains(i)){const p=a.startContainer.nodeType===3?a.startContainer.parentElement:a.startContainer,v=a.endContainer.nodeType===3?a.endContainer.parentElement:a.endContainer;if(u.contains(p)&&p!==d||u.contains(v)&&v!==d){l.preventDefault();const y=document.createRange();y.setStartAfter(u),y.collapse(!0),o.removeAllRanges(),o.addRange(y);return}}}}}}if(l.key==="Backspace"||l.key==="Delete"){const o=window.getSelection();if(o.rangeCount>0){const a=o.getRangeAt(0);let r=null,i=null;if(a.collapsed)if(l.key==="Backspace"){const u=a.startContainer;let d=u;u.nodeType===3&&(a.startOffset===0?d=u.previousSibling||u.parentNode:d=u.parentNode);const p=d.previousSibling;p&&(p.classList&&p.classList.contains("dss-image-wrapper")?i=p:p.tagName==="IMG"&&(r=p,i=r.closest(".dss-image-wrapper"))),i||(i=d.closest(".dss-image-wrapper"),i&&(r=i.querySelector("img")))}else{const u=a.startContainer;let d=u;u.nodeType===3&&(a.startOffset===u.length?d=u.nextSibling||u.parentNode:d=u.parentNode);const p=d.nextSibling;p&&(p.classList&&p.classList.contains("dss-image-wrapper")?i=p:p.tagName==="IMG"&&(r=p,i=r.closest(".dss-image-wrapper"))),i||(i=d.closest(".dss-image-wrapper"),i&&(r=i.querySelector("img")))}else{const u=a.commonAncestorContainer,d=a.startContainer.nodeType===3?a.startContainer.parentElement:a.startContainer,p=a.endContainer.nodeType===3?a.endContainer.parentElement:a.endContainer;if(u.nodeType===1&&u.tagName==="IMG"?(r=u,i=r.closest(".dss-image-wrapper")):(r=u.querySelector("img"),r&&(i=r.closest(".dss-image-wrapper"))),i){const v=i.contains(d)||d===i,y=i.contains(p)||p===i,N=a.cloneContents().textContent?.trim()||"",b=i.textContent?.trim()||"";(!v||!y||N.length>b.length)&&(i=null,r=null)}}if(i){l.preventDefault(),l.stopPropagation();const u=i.parentNode;if(u){const d=document.createTextNode("");u.insertBefore(d,i),i.remove();const p=document.createRange();p.setStartAfter(d),p.collapse(!0),o.removeAllRanges(),o.addRange(p),e.nextTick(()=>{m()});return}}}}if(l.key==="Tab"){l.preventDefault(),l.shiftKey?Io():hl();return}if(l.key==="Enter"){const o=window.getSelection();if(o.rangeCount>0){const a=o.getRangeAt(0);if(a.collapsed){const d=a.startContainer,p=v=>{if(!v)return!1;let y=v.previousSibling;for(;y;){if(y.classList&&y.classList.contains("dss-image-wrapper")||y.tagName==="IMG"||y.querySelector&&y.querySelector(".dss-image-wrapper")||y.querySelector&&y.querySelector("img"))return!0;y=y.previousSibling}const V=v.parentElement;return V&&V!==g.value?p(V):!1};if(d.nodeType===3){const v=d.parentElement;if(v&&(p(v)||p(d))){const y=v.closest("p, div");if(y&&y!==g.value){l.preventDefault(),l.stopPropagation();let V=null;const N=a.startOffset;N<d.length&&(V=d.splitText(N));const b=document.createElement("p");if(V?b.appendChild(V):b.innerHTML="<br>",d.length===0){const I=d.parentElement;I&&(I.removeChild(d),I.childNodes.length===0&&I.appendChild(document.createElement("br")))}y.nextSibling?y.parentNode.insertBefore(b,y.nextSibling):y.parentNode.appendChild(b);const z=document.createRange();V?z.setStart(V,0):z.setStart(b,0),z.collapse(!0),o.removeAllRanges(),o.addRange(z),e.nextTick(()=>{m()});return}}}}const r=a.commonAncestorContainer,i=r.nodeType===1?r.tagName==="BLOCKQUOTE"?r:r.closest("blockquote"):r.parentElement?.closest("blockquote");if(!!(i&&g.value&&g.value.contains(i))){let d=null;r.nodeType===3?d=r.parentElement:r.tagName==="P"||r.tagName==="DIV"?d=r:d=r.closest("p, div");const p=I=>{if(!I)return!1;const oe=I.textContent||"",Ee=(I.innerHTML||"").trim(),yt=Ee.replace(/<br\s*\/?>/gi,"").trim();return oe.trim()===""||Ee===""||yt===""||Ee==="<br>"||Ee==="<br/>"||Ee==="<p></p>"||Ee==="<p><br></p>"||Ee==="<p><br/></p>"||Ee==="<p> </p>"||Ee==="<p><br> </p>"||Ee==="<div></div>"||Ee==="<div><br></div>"||Ee==="<div><br/></div>"},v=i.lastChild,y=v&&v.nodeType===1&&v.tagName==="BR",V=a.startContainer,N=V.nodeType===3?V.parentElement:V,b=N===i||N&&N.parentElement===i;if(d&&p(d)||y&&b){l.preventDefault(),setTimeout(()=>{ml()},50);return}}}}if(l.key===" "){const o=Date.now(),a=o-Cn.value;if(Lt.value===" "&&a<300){const r=window.getSelection();if(r.rangeCount>0){const i=r.getRangeAt(0),u=i.commonAncestorContainer.nodeType===1?i.commonAncestorContainer.closest("li"):i.commonAncestorContainer.parentElement?.closest("li");if(u){const d=i.startContainer.textContent?.substring(0,i.startOffset)||"";if((u.textContent||"").indexOf(d.trim())<=10||d.trim().length<=2){l.preventDefault(),hl();return}}}}Lt.value=" ",Cn.value=o}else Lt.value=l.key}},Wn=l=>{if(S.disabled||!S.richText)return;l.preventDefault();let o=l.clipboardData.getData("text/html"),a=l.clipboardData.getData("text/plain");o&&(o=o.replace(/<!--[\s\S]*?-->/g,"")),a&&(a=a.replace(/<!--[\s\S]*?-->/g,"")),k();const r=window.getSelection();let i=null;if(r&&r.rangeCount>0){let p=r.getRangeAt(0).commonAncestorContainer;p.nodeType===3&&(p=p.parentNode),i=p.closest("p, h1, h2, h3, h4, h5, h6, li, blockquote")}const u=d=>{const v=new DOMParser().parseFromString(d,"text/html");let y=g.value.querySelector("h1")?1:0;if(v.querySelectorAll("h1").forEach(N=>{if(y>0){const b=v.createElement("p");b.innerHTML=N.innerHTML,N.parentNode.replaceChild(b,N)}else y++}),i){const N=["P","H1","H2","H3","H4","H5","H6","DIV","BLOCKQUOTE","UL","OL","LI"],b=Array.from(v.body.children).filter(z=>N.includes(z.tagName));if(b.length===1){const z=b[0].tagName,I=i.tagName,oe=i.textContent.trim()===""&&!i.querySelector("img");let Y=!1;if(["H1","H2","H3","H4","H5","H6"].includes(I)?Y=!0:oe||(z===I||z==="P")&&(Y=!0),Y)return b[0].innerHTML.trim()}}return v.body.innerHTML.trim()};if(o){const d=u(o);document.execCommand("insertHTML",!1,d)}else if(a)if(/<[a-z][\s\S]*>/i.test(a)){const p=u(a);document.execCommand("insertHTML",!1,p)}else document.execCommand("insertText",!1,a);m()},dt=l=>{if(we.value){const a=l.target;!a.closest(".dss-toolbar-dropdown")&&!a.closest(".dss-toolbar-dropdown-toggle")&&qt()}if(Q.value){const a=l.target,r=a.closest(".dss-floating-toolbar"),i=g.value&&a.closest(".dss-text-editor-content");!r&&!i&&Co()}if($e.value){const a=l.target,r=a.closest(".dss-floating-toolbar"),i=a.closest(".dss-toolbar-dropdown");!r&&!i&&Ko()}const o=l.target;if(!o.closest(".dss-toolbar-dropdown")&&!o.closest(".dss-toolbar-dropdown-submenu")&&(Ze.value=null),!g.value||!o.closest(".dss-text-editor-content")){const a=window.getSelection();if(a&&a.rangeCount>0){const r=a.getRangeAt(0);pn.value=!r.collapsed&&uo(r)}else pn.value=!1}if(Ot.value!==null){const a=document.querySelector(".dss-comment-overlay");let r=!1;if(a){const d=a.getBoundingClientRect(),p=l.clientX,v=l.clientY;r=p>=d.left&&p<=d.right&&v>=d.top&&v<=d.bottom}const i=o.closest(".dss-toolbar-button"),u=i&&i.getAttribute("title")==="Comment";!r&&!u&&(Ot.value=null,Pn.value="",Qn.value="",Jn.value=null,fn.value=[],no(!0))}},Nt=(l,o)=>{l&&l.stopPropagation&&l.stopPropagation(),It.value&&(clearTimeout(It.value),It.value=null),Ze.value=o},qn=l=>{const o=l.relatedTarget;if(o){const a=o.closest(".dss-toolbar-dropdown-submenu"),r=o.closest(".dss-toolbar-dropdown-item-has-submenu");if(a||r)return}It.value&&clearTimeout(It.value),It.value=setTimeout(()=>{Ze.value=null,It.value=null},150)},co=l=>{Ze.value=null};let We=0;const qe=l=>{if(!l)return;const o=Array.from(l.children);o.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")}),o.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 i=Array.from(a.children).find(p=>p.tagName==="DIV"?p.classList.contains("dss-toolbar-dropdown-item")?!1:Array.from(p.children).filter(y=>y.tagName==="BUTTON"||y.tagName==="DIV").length>0:!1),u=a.nextElementSibling,d=u&&!u.classList.contains("dss-toolbar-dropdown-submenu")&&!u.classList.contains("dss-toolbar-dropdown-item-has-submenu")&&u.tagName==="DIV"&&!u.classList.contains("dss-toolbar-dropdown-item")&&Array.from(u.children).some(p=>p.tagName==="BUTTON"||p.tagName==="DIV");if(i||d){const p=`submenu-auto-${++We}`;a.classList.add("dss-toolbar-dropdown-item-has-submenu"),a.setAttribute("data-submenu-id",p);let v=null;i?(a.tagName==="BUTTON"&&a.parentNode.insertBefore(i,a.nextSibling),i.classList.add("dss-toolbar-dropdown-submenu"),v=i):d&&(u.classList.add("dss-toolbar-dropdown-submenu"),v=u),v&&(v.setAttribute("data-submenu-id",p),v.setAttribute("data-processed","true"),i&&a.tagName!=="BUTTON"?v.dataset.originalParentRef="inside":v.dataset.originalParentRef="sibling",Array.from(v.children).forEach(V=>{(V.tagName==="BUTTON"||V.tagName==="DIV")&&!V.classList.contains("dss-toolbar-dropdown-item")&&V.classList.add("dss-toolbar-dropdown-item")}))}})},Ne=()=>{document.querySelectorAll(".dss-toolbar-dropdown").forEach(o=>{qe(o),o.querySelectorAll(".dss-toolbar-dropdown-item-has-submenu").forEach(i=>{const u=i._subMenuHandlers;u&&(i.removeEventListener("mouseenter",u.enter),i.removeEventListener("mouseleave",u.leave));const d=v=>{const y=i.getAttribute("data-submenu-id");y&&Nt(v,y)},p=qn;i.addEventListener("mouseenter",d),i.addEventListener("mouseleave",p),i._subMenuHandlers={enter:d,leave:p}}),o.querySelectorAll(".dss-toolbar-dropdown-submenu").forEach(i=>{const u=i._subMenuHandlers;u&&(i.removeEventListener("mouseenter",u.enter),i.removeEventListener("mouseleave",u.leave));const d=y=>{const V=i.getAttribute("data-submenu-id");V&&Nt(y,V)},p=qn;i.addEventListener("mouseenter",d),i.addEventListener("mouseleave",p),i._subMenuHandlers={enter:d,leave:p},i.querySelectorAll(".dss-toolbar-dropdown-item").forEach(y=>{y.addEventListener("click",co)})})})};let tt=null;const So=()=>{if(Ze.value){const l=document.querySelector(`.dss-toolbar-dropdown-submenu[data-submenu-id="${Ze.value}"]`),o=document.querySelector(`.dss-toolbar-dropdown-item-has-submenu[data-submenu-id="${Ze.value}"]`);l&&o&&Sl(l,o)}if(Q.value&&gt(),S.richText){if(tt!==null)return;tt=setTimeout(()=>{tt=null,cn("handleWindowResize")},150)}},No=()=>{if(!S.richText)return;document.querySelectorAll(".dss-toolbar-custom-group").forEach(o=>{Array.from(o.children).filter(r=>r.tagName==="DIV"&&!r.classList.contains("dss-toolbar-button")).forEach(r=>{r.classList.add("dss-toolbar-button")})})},Mo=()=>{const l=document.querySelectorAll(".dss-text-editor-footer, .dss-text-editor-footer-content, .dss-text-editor-footer-stat, .dss-text-editor-footer-separator"),o=a=>{if(a.preventDefault(),a.stopPropagation(),window.getSelection){const r=window.getSelection();r.removeAllRanges?r.removeAllRanges():r.empty&&r.empty()}return!1};l.forEach(a=>{a.addEventListener("selectstart",o),a.addEventListener("mousedown",o),a.addEventListener("dragstart",o),a.addEventListener("contextmenu",o),a.addEventListener("click",r=>{if(window.getSelection){const i=window.getSelection();i.removeAllRanges&&i.removeAllRanges()}})})};e.onMounted(()=>{if(e.nextTick(()=>{requestAnimationFrame(()=>{Ft.value?kn():so(),_e.value?ro():J()})}),e.nextTick(()=>{Mo()}),S.richText&&g.value){try{document.execCommand("defaultParagraphSeparator",!1,"p")}catch{}document.addEventListener("click",dt),window.addEventListener("resize",So);let l=null;const o=()=>{l===null&&(l=setTimeout(()=>{l=null,So()},150))};window.addEventListener("scroll",o,!0),g.value._windowScrollHandler=o,g.value._windowScrollTimeout=l,g.value.closest(".editor-with-comments"),g.value.closest(".dss-text-editor-content-wrapper");const a=g.value.closest(".dss-text-editor-content");let r=null;const i=()=>{r===null&&(r=setTimeout(()=>{r=null,So()},150))};a&&(a.addEventListener("scroll",i),g.value._scrollHandlers={wrapper:null,content:a,handler:i}),e.nextTick(()=>{Ne(),No()}),g.value.addEventListener("click",p=>{const v=p.target;v.closest("a")&&!S.disabled&&p.preventDefault();const V=v.closest(".dss-image-no-alt-icon"),N=v.closest(".dss-image-wrapper");if(V||N&&v===N){p.preventDefault(),p.stopPropagation();const b=window.getSelection(),z=document.createRange();z.setStartAfter(N),z.collapse(!0),b.removeAllRanges(),b.addRange(z)}else N&&v.tagName!=="IMG"&&(p.preventDefault(),e.nextTick(()=>{const b=window.getSelection();if(b.rangeCount>0){const I=b.getRangeAt(0).commonAncestorContainer,oe=I.nodeType===3?I.parentElement:I;if(N.contains(oe)&&oe!==N.querySelector("img")){const Y=document.createRange();Y.setStartAfter(N),Y.collapse(!0),b.removeAllRanges(),b.addRange(Y)}}else{const z=document.createRange();z.setStartAfter(N),z.collapse(!0),b.addRange(z)}}))},!0),g.value.addEventListener("mousedown",p=>{const v=p.target,y=v.closest(".dss-image-no-alt-icon"),V=v.closest(".dss-image-wrapper");if(y||V&&v.tagName!=="IMG"){p.preventDefault();const N=window.getSelection(),b=document.createRange();V&&(b.setStartAfter(V),b.collapse(!0),N.removeAllRanges(),N.addRange(b))}},!0),g.value.addEventListener("paste",p=>{e.nextTick(()=>{if(!g.value)return;g.value.querySelectorAll("img").forEach(y=>{if(!y.closest(".dss-image-wrapper"))y.removeAttribute("alt"),y.removeAttribute("data-alt"),y.setAttribute("alt",""),y.setAttribute("data-alt",""),y.alt="";else{const N=y.getAttribute("alt")||y.alt||"";if(N){const b=y.getAttribute("src")||y.src||"",z=b.replace(/^https?:\/\//,"").replace(/^data:.*,/,""),I=N===b||N===z;(N.startsWith("http://")||N.startsWith("https://")||N.startsWith("data:")||I||I)&&(y.setAttribute("alt",""),y.setAttribute("data-alt",""),y.alt="")}}}),X()})}),g.value.addEventListener("dragstart",p=>{const v=p.target,y=v.tagName==="IMG"?v:v.closest("img"),V=y?.closest(".dss-image-wrapper");y&&g.value.contains(y)&&(nt.value=V||y,p.dataTransfer.effectAllowed="move",p.dataTransfer.setData("text/html","image-drag"))}),g.value.addEventListener("dragover",p=>{nt.value&&(p.preventDefault(),p.stopPropagation(),p.dataTransfer.dropEffect="move")}),g.value.addEventListener("dragenter",p=>{nt.value&&(p.preventDefault(),p.stopPropagation())}),g.value.addEventListener("drop",p=>{if(!nt.value||!g.value)return;p.preventDefault(),p.stopPropagation();const v=nt.value,y=v.classList?.contains("dss-image-wrapper"),V=y?v.querySelector("img"):v,N=y?v:V?.closest(".dss-image-wrapper");if(!V||!g.value.contains(V)){nt.value=null;return}let b=null;const z=p.clientX,I=p.clientY;if(document.caretRangeFromPoint)b=document.caretRangeFromPoint(z,I);else{const kt=window.getSelection();kt.rangeCount>0?b=kt.getRangeAt(0).cloneRange():(b=document.createRange(),b.selectNodeContents(g.value),b.collapse(!1))}if(!b){nt.value=null;return}const oe=b.commonAncestorContainer,Y=oe.nodeType===3?oe.parentElement:oe;if(Y?.closest(".dss-image-wrapper")===N||N&&N.contains(Y)){nt.value=null;return}if(N&&(Y===N||N.contains(Y))){nt.value=null;return}const yt=V.getAttribute("src");let Mt=null;N?Mt=N.cloneNode(!0):Mt=V.cloneNode(!0);try{let kt=b.startContainer;if(kt.nodeType===3&&(kt=kt.parentElement),N&&(kt===N||N.contains(kt))){const Xe=document.createRange();Xe.setStartAfter(N),Xe.collapse(!0),b=Xe}b.insertNode(Mt);const xt=document.createRange();xt.setStartAfter(Mt),xt.collapse(!0);const Bt=window.getSelection();Bt.removeAllRanges(),Bt.addRange(xt)}catch{if(g.value.childNodes.length===0){const xt=document.createElement("p");xt.appendChild(Mt),g.value.appendChild(xt)}else{const xt=g.value.lastChild;if(xt&&xt.nodeType===1)xt.appendChild(Mt);else{const Bt=document.createElement("p");Bt.appendChild(Mt),g.value.appendChild(Bt)}}}N?N.remove():V.remove(),nt.value=null,e.nextTick(()=>{const kt=g.value.querySelectorAll("img");let xt=!1;kt.forEach(Bt=>{if(Bt.getAttribute("src")===yt)if(!xt)xt=!0;else{const Xe=Bt.closest(".dss-image-wrapper");Xe?Xe.remove():Bt.remove()}}),X(),m()})}),g.value.addEventListener("dragend",p=>{nt.value=null});let u=null;const d=new MutationObserver(p=>{p.forEach(v=>{v.addedNodes.forEach(y=>{if(y.nodeType===1){y.tagName==="IMG"&&(y.removeAttribute("alt"),y.removeAttribute("data-alt"),y.setAttribute("alt",""),y.setAttribute("data-alt",""),y.alt="");const V=y.querySelectorAll&&y.querySelectorAll("img");V&&V.forEach(N=>{N.removeAttribute("alt"),N.removeAttribute("data-alt"),N.setAttribute("alt",""),N.setAttribute("data-alt",""),N.alt=""})}})}),u&&clearTimeout(u),u=setTimeout(()=>{X(),No(),u=null},100)});if(d.observe(g.value,{childList:!0,subtree:!0}),e.nextTick(()=>{const p=document.querySelector(".dss-text-editor-toolbar");if(p){const v=new MutationObserver(()=>{e.nextTick(()=>{No()})});v.observe(p,{childList:!0,subtree:!0}),p._toolbarMutationObserver=v}}),S.modelValue){const p=Gt(S.modelValue);g.value.innerHTML=p,x()}e.nextTick(()=>{const p=g.value.innerHTML||"",v=S.title||"",y=S.description||"";ze.value=p,Kt.value=v,ft.value=y,Te.value=v,je.value=y,an(),X(),Pt(),_n(),Vl(),To()}),Qt(),Vn(),g.value._mutationObserver=d}}),e.onUnmounted(()=>{if(document.removeEventListener("click",dt),window.removeEventListener("resize",So),g.value&&g.value._windowScrollHandler&&window.removeEventListener("scroll",g.value._windowScrollHandler,!0),tt!==null&&(clearTimeout(tt),tt=null),g.value&&g.value._windowScrollTimeout!==null&&clearTimeout(g.value._windowScrollTimeout),de.value&&clearTimeout(de.value),It.value&&clearTimeout(It.value),g.value&&g.value._mutationObserver&&g.value._mutationObserver.disconnect(),Ct.value&&Ct.value.disconnect(),et.value!==null&&(cancelAnimationFrame(et.value),et.value=null),In.value!==null&&(clearTimeout(In.value),In.value=null),St.value!==null&&(clearTimeout(St.value),St.value=null),no(!0),g.value&&g.value._scrollHandlers){const{wrapper:o,content:a,handler:r}=g.value._scrollHandlers;o&&o.removeEventListener("scroll",r),a&&a.removeEventListener("scroll",r)}const l=document.querySelector(".dss-text-editor-toolbar");l&&l._toolbarMutationObserver&&l._toolbarMutationObserver.disconnect()});const jo=l=>{const o=l.target,a=o.closest("a");if(a&&!S.disabled){l.preventDefault();const i=document.createRange();i.selectNodeContents(a);const u=window.getSelection();u.removeAllRanges(),u.addRange(i)}const r=o.closest(".dss-image-wrapper");r&&o.tagName!=="IMG"?e.nextTick(()=>{const i=window.getSelection();if(i.rangeCount>0){const d=i.getRangeAt(0).commonAncestorContainer,p=d.nodeType===3?d.parentElement:d;if(r.contains(p)&&p!==r.querySelector("img")){const v=document.createRange();v.setStartAfter(r),v.collapse(!0),i.removeAllRanges(),i.addRange(v)}}X(),Qt(),Vn(),gt(),_n()}):e.nextTick(()=>{X(),Qt(),Vn(),gt(),_n()})},eo=()=>{E();const l=window.getSelection();if(l&&l.rangeCount>0){const a=l.getRangeAt(0);pn.value=!a.collapsed&&uo(a),!a.collapsed&&rt.value&&(rt.value=null)}else pn.value=!1;if(X(),Qt(),Vn(),gt(),_n(),l&&l.rangeCount>0){const r=l.getRangeAt(0).commonAncestorContainer,i=r.nodeType===3?r.parentElement:r;if(i&&i.closest(".dss-text-editor-footer")){l.removeAllRanges(),pn.value=!1;return}}["bold","italic","underline"].forEach(a=>{try{const r=window.getSelection();if(r.rangeCount>0){const i=r.getRangeAt(0);if(!i.collapsed)if(a==="bold"){const u=i.commonAncestorContainer,d=u.nodeType===3?u.parentElement:u;let p=!1;if(d&&((d.tagName==="STRONG"||d.tagName==="B"||d.closest&&d.closest("strong, b"))&&(p=!0),!p&&d.style&&parseInt(d.style.fontWeight)>=600&&(p=!0),!p))try{const v=window.getComputedStyle(d);parseInt(v.fontWeight)>=600&&(p=!0)}catch{}ve.value[a]=p}else{const u=document.queryCommandState(a);ve.value[a]=u}}}catch{}})},_n=()=>{if(!S.richText||S.disabled||!g.value){Ke.value="p";return}try{const l=window.getSelection();if(!l||l.rangeCount===0){Ke.value="p";return}const a=l.getRangeAt(0).commonAncestorContainer,r=a.nodeType===3?a.parentElement:a;if(!r||!g.value.contains(r)){Ke.value="p";return}const i=r.closest("h1, h2, h3, h4, h5, h6, p");if(!i){Ke.value="p";return}const u=i.tagName.toLowerCase();["h1","h2","h3","h4","h5","h6","p"].includes(u)?Ke.value=u:Ke.value="p"}catch{Ke.value="p"}},Vn=()=>{if(!g.value){lt.value=!1;return}try{const l=window.getSelection();let o=!1;if(l.rangeCount>0){const r=l.getRangeAt(0).commonAncestorContainer,i=r.nodeType===1?r.tagName==="BLOCKQUOTE"?r:r.closest("blockquote"):r.parentElement?.closest("blockquote");o=!!(i&&g.value.contains(i))}lt.value=o}catch{lt.value=!1}},uo=l=>{if(!l||!g.value)return!1;const o=l.commonAncestorContainer;if(!o)return!1;const a=o.nodeType===3?o.parentElement:o;return a?g.value.contains(a):!1},Co=()=>{Q.value=!1},gt=()=>{if(!S.floatingToolbar||!S.richText||S.disabled){Q.value=!1;return}const l=window.getSelection();if(!l||l.rangeCount===0){Q.value=!1;return}const o=l.getRangeAt(0);if(o.collapsed||!uo(o)){Q.value=!1;return}const a=o.getBoundingClientRect();if(!a||a.width===0&&a.height===0){Q.value=!1;return}const r=g.value;if(!r){Q.value=!1;return}const i=r.getBoundingClientRect();if(!i||i.width===0){Q.value=!1;return}const u=40,d=8,p=a.top-u/2+15;let v=a.left+a.width/2;const y=window.innerWidth||document.documentElement.clientWidth||0;let V=0;Ue.value&&(V=Ue.value.getBoundingClientRect().width);const N=(V||320)/2;let b=i.left+N,z=i.right-N;if(z<b){const I=i.left+i.width/2;b=I,z=I}if(y>0){const I=N+d,oe=y-N-d;if(b=Math.max(b,I),z=Math.min(z,oe),z<b){const Y=y/2;b=Y,z=Y}}v<b?v=b:v>z&&(v=z),Rn.value={position:"fixed",top:`${Math.max(p,8)}px`,left:`${v}px`,transform:"translate(-50%, -100%)",zIndex:10003},Q.value=!0},to=l=>{S.disabled||!S.richText||($e.value=$e.value===l?null:l,l==="askAi"&&(we.value=null))},Ko=()=>{$e.value=null,Ze.value=null},Jt=l=>{zn(l),Ko()};let mo=null,bo=null,Sn=null,wo=null;const Cl=l=>{if(S.disabled||!S.richText){xo(),Bo();return}const o=l.target,a=o.closest("a"),r=o.closest("img");if(mo&&(clearTimeout(mo),mo=null),Sn&&(clearTimeout(Sn),Sn=null),a&&a!==bo){Bo(),bo=a;let i=a.getAttribute("href")||"";(!i||i==="#"||i==="")&&(i=a.textContent||""),pe.value=a,A.value=i,He.value=!0,Qe.value=!0,Go(a)}else!a&&bo?(bo=null,mo=setTimeout(()=>{Qe.value||xo()},150)):a&&a===bo&&Go(a);if(r&&r!==wo){xo(),wo=r;let i=r.getAttribute("alt");i===null&&(i=r.alt||"");let u=r.getAttribute("data-alt");u===null&&(u=i),r.hasAttribute("alt")||r.setAttribute("alt",i),r.hasAttribute("data-alt")||r.setAttribute("data-alt",u),ke.value=r,vt.value=i.trim()||R("textEditor.image.noAlt"),Rt.value=!0,Vt.value=!0,bl(r)}else!r&&wo?(wo=null,Sn=setTimeout(()=>{Vt.value||Bo()},150)):r&&r===wo&&bl(r)},Tl=l=>{const o=l.relatedTarget;(!o||!o.closest(".dss-text-editor-content")&&!o.closest(".dss-link-popup"))&&(bo=null,wo=null,mo&&(clearTimeout(mo),mo=null),Sn&&(clearTimeout(Sn),Sn=null),xo(),Bo())},xo=()=>{Qe.value=!1,setTimeout(()=>{Qe.value||(He.value=!1,A.value="",At.value||(pe.value=null))},100)},Go=l=>{if(!l||!g.value)return;const o=l.getBoundingClientRect(),i=o.top-32-8,u=o.left+o.width/2;Le.value={position:"fixed",top:`${i}px`,left:`${u}px`,transform:"translateX(-50%)",zIndex:10002}},Bo=()=>{Vt.value=!1,setTimeout(()=>{Vt.value||(Rt.value=!1,vt.value="",xn.value||(ke.value=null))},100)},bl=l=>{if(!l||!g.value)return;const o=l.getBoundingClientRect(),i=o.top-32-8,u=o.left+o.width/2;fo.value={position:"fixed",top:`${i}px`,left:`${u}px`,transform:"translateX(-50%)",zIndex:10002}},Un=()=>{if(!A.value||!pe.value)return;let o=pe.value.getAttribute("href")||A.value;!o.startsWith("http://")&&!o.startsWith("https://")&&!o.startsWith("mailto:")&&(o="https://"+o),window.open(o,"_blank","noopener,noreferrer")},po=()=>{if(pe.value){const l=pe.value.textContent||"",o=pe.value.getAttribute("href")||"",a=pe.value;mt.value=o,F.value=l,en.value=l,Qe.value=!1,He.value=!1,A.value="",pe.value=a,At.value=!0}else if(Me.value){const l=window.getSelection();if(l.rangeCount>0){const a=l.getRangeAt(0).commonAncestorContainer,r=a.nodeType===1?a.closest("a"):a.parentElement?.closest("a");if(r){const i=r.textContent||"",u=r.getAttribute("href")||"";mt.value=u,F.value=i,en.value=i,pe.value=r,At.value=!0}}}else{Xt.value=ae();const l=window.getSelection();let o="";l.rangeCount>0&&(o=l.getRangeAt(0).toString()),mt.value="",F.value=o,en.value="",pe.value=null,At.value=!0}e.nextTick(()=>{Tt.value&&(Tt.value.focus(),Tt.value.select())})},Nn=()=>{At.value=!1,mt.value="",F.value="",en.value="",pe.value=null,Xt.value=null},it=()=>{if(!mt.value.trim()){Nn();return}if(ge.value?(de.value&&(clearTimeout(de.value),de.value=null),k(),ge.value=!1):k(),F.value.trim()||(F.value=mt.value.trim()),pe.value&&g.value&&g.value.contains(pe.value)){const l=window.getSelection();l.rangeCount>0&&l.removeAllRanges();const o=pe.value;if(o.setAttribute("href",mt.value.trim()),F.value.trim()!==en.value.trim()){for(;o.firstChild;)o.removeChild(o.firstChild);o.textContent=F.value.trim()}o.style.color="#60afdf",o.style.textDecoration="underline";const a=document.createRange();a.selectNodeContents(o),a.collapse(!1),l.removeAllRanges(),l.addRange(a),m()}else if(g.value){g.value.focus();const l=window.getSelection();l.removeAllRanges(),Xt.value&&wt(Xt.value);let o=null;if(l.rangeCount>0&&(o=l.getRangeAt(0)),o&&!o.collapsed){o.toString();const a=document.createElement("a");a.href=mt.value.trim(),a.textContent=F.value.trim(),a.style.color="#60afdf",a.style.textDecoration="underline",o.deleteContents(),o.insertNode(a);const r=document.createTextNode(" ");o.setStartAfter(a),o.insertNode(r),o.setStartAfter(r),o.collapse(!0),l.removeAllRanges(),l.addRange(o)}else{o||(o=document.createRange(),o.selectNodeContents(g.value),o.collapse(!1));const a=o.startContainer,r=a.nodeType===3,i=r&&o.startOffset===a.textContent.length,u=document.createElement("a");if(u.href=mt.value.trim(),u.textContent=F.value.trim(),u.style.color="#60afdf",u.style.textDecoration="underline",i){let d=a.parentElement;for(;d&&d!==g.value&&!["P","DIV","H1","H2","H3","H4","H5","H6"].includes(d.tagName);)d=d.parentElement;if(d&&d!==g.value){let p=d.nextElementSibling;if(p&&(p.innerHTML==="<br>"||p.innerHTML==="<br/>"||p.textContent.trim()==="")){p.textContent="",p.appendChild(u);const v=document.createTextNode(" ");p.appendChild(v);const y=document.createRange();y.setStartAfter(u),y.collapse(!0),l.removeAllRanges(),l.addRange(y)}else{if(o.startOffset>0){const y=a.textContent.substring(0,o.startOffset),V=y[y.length-1];if(V&&V!==" "&&V!==" "&&V!==`
79
+ `){const N=document.createTextNode(" ");o.insertNode(N),o.setStartAfter(N)}}o.insertNode(u);const v=document.createTextNode(" ");o.setStartAfter(u),o.insertNode(v),o.setStartAfter(v),o.collapse(!0),l.removeAllRanges(),l.addRange(o)}}}else{if(r&&o.startOffset>0){const p=a.textContent.substring(0,o.startOffset),v=p[p.length-1];if(v&&v!==" "&&v!==" "&&v!==`
80
+ `){const y=document.createTextNode(" ");o.insertNode(y),o.setStartAfter(y)}}o.insertNode(u);const d=document.createTextNode(" ");o.setStartAfter(u),o.insertNode(d),o.setStartAfter(d),o.collapse(!0),l.removeAllRanges(),l.addRange(o)}}m()}e.nextTick(()=>{Qt(),Nn()})},Qo=()=>{if(!g.value||Be.value)return;const l=window.getSelection();let o=null;l&&l.rangeCount>0&&(o=ae());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(g.value,NodeFilter.SHOW_TEXT,{acceptNode:p=>{const v=p.parentElement;return!v||v.closest("a")||v.closest(".dss-image-wrapper")||!p.textContent||p.textContent.trim()===""?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}}),i=[];let u;for(;u=r.nextNode();)i.push(u);let d=!1;for(let p=i.length-1;p>=0;p--){const v=i[p],y=v.textContent;a.lastIndex=0;const V=[...y.matchAll(a)];if(V.length===0)continue;const N=V.filter(I=>{const oe=I[0],Y=I.index;if(Y>0&&y[Y-1]==="@"||Y+oe.length<y.length&&y[Y+oe.length]==="@")return!1;const Ee=v.parentElement;return!(Ee&&Ee.closest("a"))});if(N.length===0)continue;if(N.length===1&&N[0][0]===y.trim()){const I=N[0][0],oe=I.startsWith("http://")||I.startsWith("https://")?I:`https://${I}`,Y=document.createElement("a");Y.href=oe,Y.textContent=I,Y.style.color="#60afdf",Y.style.textDecoration="underline",v.parentNode&&(v.parentNode.replaceChild(Y,v),d=!0);continue}let b=0;const z=document.createDocumentFragment();if(N.forEach(I=>{const oe=I.index,Y=I[0];if(oe>b){const Mt=y.substring(b,oe);Mt&&z.appendChild(document.createTextNode(Mt))}const Ee=Y.startsWith("http://")||Y.startsWith("https://")?Y:`https://${Y}`,yt=document.createElement("a");yt.href=Ee,yt.textContent=Y,yt.style.color="#60afdf",yt.style.textDecoration="underline",z.appendChild(yt),b=oe+Y.length}),b<y.length){const I=y.substring(b);I&&z.appendChild(document.createTextNode(I))}v.parentNode&&z.childNodes.length>0&&(v.parentNode.replaceChild(z,v),d=!0)}d&&o&&e.nextTick(()=>{wt(o),Qt()})},ht=()=>{if(!g.value)return;const l=/<u>([\s\S]*?)<\/u>|<ins>([\s\S]*?)<\/ins>/gi,o=document.createTreeWalker(g.value,NodeFilter.SHOW_TEXT,{acceptNode:i=>{const u=i.parentElement;return!u||u.closest("a, code, pre, u, ins")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}}),a=[];let r;for(;r=o.nextNode();)a.push(r);for(let i=a.length-1;i>=0;i--){const u=a[i],d=u.textContent,p=[...d.matchAll(l)];if(p.length===0)continue;let v=0;const y=document.createDocumentFragment();p.forEach(V=>{const N=V.index,b=V[0].startsWith("<u>")?"u":"ins",z=V[1]||V[2]||"";N>v&&y.appendChild(document.createTextNode(d.substring(v,N)));const I=document.createElement(b);I.textContent=z,y.appendChild(I),v=N+V[0].length}),v<d.length&&y.appendChild(document.createTextNode(d.substring(v))),u.parentNode&&y.childNodes.length>0&&u.parentNode.replaceChild(y,u)}},_t=l=>{if(!g.value||Be.value)return;if(!l){ht();return}if(!["*","_",">"].includes(l))return;const a=window.getSelection();if(!a||a.rangeCount===0)return;const r=a.getRangeAt(0);if(!r.collapsed)return;const i=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(!i||i===g.value||!g.value.contains(i))return;const u=()=>{let Mt="",kt=0,xt=!1;const Bt=document.createTreeWalker(i,NodeFilter.SHOW_TEXT,{acceptNode:bn=>bn.parentElement?.closest("a, code, pre")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT});document.createTreeWalker(i,NodeFilter.SHOW_TEXT,null);let Xe=0;for(;Bt.nextNode();){const bn=Bt.currentNode,Mn=bn.textContent||"",Zt=Xe;if(Xe+=Mn.length,bn===r.startContainer){Mt+=Mn.substring(0,r.startOffset),kt=Zt+r.startOffset,xt=!0;break}Mt+=Mn}return xt||(kt=Mt.length),{textBeforeCursor:Mt,cursorCharOffset:kt}},{textBeforeCursor:d}=u();if(!d.length)return;let p=null,v=null;if(d.endsWith("**")&&(p=d.match(/\*\*(.+?)\*\*$/s))||d.endsWith("__")&&(p=d.match(/__(.+?)__$/s))?v="strong":d.endsWith("*")&&!d.endsWith("**")&&(p=d.match(new RegExp("(?<!\\*)\\*([^*]+)\\*$")))||d.endsWith("_")&&!d.endsWith("__")&&(p=d.match(new RegExp("(?<!_)_([^_]+)_$")))?v="em":l===">"&&((p=d.match(/<u>(.+?)<\/u>$/s))||(p=d.match(/<ins>(.+?)<\/ins>$/s)))&&(v=p[0].startsWith("<u>")?"u":"ins",p[0].startsWith("<u>"),p[0].startsWith("<u>")),!p||!p[1])return;const y=p[0],V=p[1],N=d.length-y.length,z=(Mt=>{let kt=0;const xt=document.createTreeWalker(i,NodeFilter.SHOW_TEXT,{acceptNode:Xe=>Xe.parentElement?.closest("a, code, pre")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT});let Bt;for(;Bt=xt.nextNode();){const Xe=(Bt.textContent||"").length;if(kt+Xe>=Mt)return{node:Bt,offset:Mt-kt};kt+=Xe}return null})(N);if(!z)return;const I=document.createRange();I.setStart(z.node,z.offset),I.setEnd(r.endContainer,r.endOffset);const oe=document.createElement(v);oe.textContent=V,I.deleteContents(),I.insertNode(oe);const Y=window.getSelection(),Ee=document.createRange();Ee.setStartAfter(oe),Ee.collapse(!0),Y.removeAllRanges(),Y.addRange(Ee);const yt=ae();e.nextTick(()=>{m(),yt&&wt(yt)})},Jo=()=>{g.value&&(mn.value=ae(),tn.value="",Ye.value="",gn.value="",Ie.value="",at.value="",Tn.value=null,ke.value=null,Je.value="upload",xn.value=!0,qt(),e.nextTick(()=>{Yt.value&&Yt.value.focus(),un.value&&(un.value.value="")}))},wl=l=>{const o=l.target?.files?.[0];if(!o){Tn.value=null,Ye.value="";return}Tn.value=o;const a=new FileReader;a.onload=r=>{Ye.value=r.target?.result||""},a.readAsDataURL(o)},el=()=>{un.value&&un.value.click()},xl=()=>{Ie.value&&(at.value="")},tl=()=>{at.value&&(Ie.value="")},ut=()=>{let l=ke.value;if(!l){const o=window.getSelection();if(o&&o.rangeCount>0){const r=o.getRangeAt(0).commonAncestorContainer;l=r.nodeType===1?r.closest("img"):r.parentElement?.closest("img")}}if(l){const o=l.getAttribute("data-alt")||l.getAttribute("alt")||"";ke.value=l,tn.value=o.trim()===""||o.trim()==="Image"?"":o;const a=l.getAttribute("src")||l.src||"";a.startsWith("http://")||a.startsWith("https://")?(gn.value=a,Ye.value="",Je.value="url"):(Ye.value=a,gn.value="",Je.value="upload");const i=l.style.width||l.getAttribute("width")||"",u=l.style.height||l.getAttribute("height")||"";Ie.value=i.endsWith("px")?i.replace("px",""):i,at.value=u.endsWith("px")?u.replace("px",""):u,mn.value=null}else{Jo();return}xn.value=!0,Vt.value=!1,Rt.value=!1,e.nextTick(()=>{Je.value==="url"&&pt.value?(pt.value.focus(),pt.value.select()):Yt.value&&(Yt.value.focus(),Yt.value.select()),un.value&&(un.value.value="")})},vo=()=>{xn.value=!1,tn.value="",Ye.value="",gn.value="",Ie.value="",at.value="",Tn.value=null,ke.value=null,mn.value=null,Je.value="upload"},An=()=>{const l=(tn.value||"").trim(),o=g.value?._mutationObserver;o&&o.disconnect(),ge.value?(de.value&&(clearTimeout(de.value),de.value=null),k(),ge.value=!1):k();const a=Je.value==="url"?gn.value.trim():Ye.value;if(ke.value&&g.value&&g.value.contains(ke.value)){a&&(ke.value.src=a),ke.value.setAttribute("alt",l),ke.value.setAttribute("data-alt",l),Ie.value?(ke.value.style.width=`${Ie.value}px`,ke.value.setAttribute("width",Ie.value)):(ke.value.style.removeProperty("width"),ke.value.removeAttribute("width")),at.value?(ke.value.style.height=`${at.value}px`,ke.value.setAttribute("height",at.value)):(ke.value.style.removeProperty("height"),ke.value.removeAttribute("height"));const r=window.getSelection();if(r){r.removeAllRanges();const i=document.createRange();i.setStartAfter(ke.value),i.collapse(!0),r.addRange(i)}m()}else{if(!a){o&&g.value&&o.observe(g.value,{childList:!0,subtree:!0}),vo();return}if(g.value){g.value.focus();const r=window.getSelection();r&&r.rangeCount>0&&r.removeAllRanges();const i=window.getSelection();let u=null;if(mn.value&&(wt(mn.value),i&&i.rangeCount>0&&(u=i.getRangeAt(0))),!u&&i&&i.rangeCount>0&&(u=i.getRangeAt(0)),!u&&g.value){if(u=document.createRange(),g.value.childNodes.length===0){const y=document.createElement("p");y.innerHTML="<br>",g.value.appendChild(y),u.setStart(y,0),u.collapse(!0)}else u.selectNodeContents(g.value),u.collapse(!1);i&&(i.removeAllRanges(),i.addRange(u))}if(!u){vo();return}const d=u.commonAncestorContainer,p=d.nodeType===3?d.parentElement:d;if(!g.value.contains(p)){if(u=document.createRange(),g.value.childNodes.length===0){const y=document.createElement("p");y.innerHTML="<br>",g.value.appendChild(y),u.setStart(y,0),u.collapse(!0)}else u.selectNodeContents(g.value),u.collapse(!1);i&&(i.removeAllRanges(),i.addRange(u))}const v=document.createElement("img");v.src=a,v.setAttribute("alt",l),v.setAttribute("data-alt",l),Ie.value&&(v.style.width=`${Ie.value}px`,v.setAttribute("width",Ie.value)),at.value&&(v.style.height=`${at.value}px`,v.setAttribute("height",at.value));try{u.insertNode(v),u.setStartAfter(v),u.collapse(!0),i&&(i.removeAllRanges(),i.addRange(u))}catch{if(g.value){if(g.value.childNodes.length===0){const N=document.createElement("p");g.value.appendChild(N),N.appendChild(v)}else{const N=g.value.lastChild;if(N&&N.nodeType===1)N.appendChild(v);else{const b=document.createElement("p");g.value.appendChild(b),b.appendChild(v)}}const V=document.createRange();V.setStartAfter(v),V.collapse(!0),i&&(i.removeAllRanges(),i.addRange(V))}}ke.value=v,m()}}e.nextTick(()=>{o&&g.value&&o.observe(g.value,{childList:!0,subtree:!0}),Qt(),gt(),vo()})};e.watch(()=>S.modelValue,l=>{if(S.richText&&g.value&&!Be.value){const o=Gt(l||""),r=g.value.innerHTML.replace(/&nbsp;|\u00A0/g," "),i=o.replace(/&nbsp;|\u00A0/g," ");if(r!==i){const u=ae();g.value.innerHTML=o,e.nextTick(()=>{x();const d=g.value.innerHTML||"",p=S.title||"",v=S.description||"";ze.value=d,Kt.value=p,ft.value=v,$t.value=d,Te.value=p,je.value=v,Fe.value=[],jt.value=[],de.value&&(clearTimeout(de.value),de.value=null),ge.value=!1,u&&wt(u),an(),X(),Pt(),Qt(),gt(),_n(),cn("watch-modelValue")})}}},{immediate:!0}),e.watch(()=>S.richText,l=>{l?(gt(),e.nextTick(()=>{Vl()})):(Co(),hn.value=[],Ct.value&&(Ct.value.disconnect(),Ct.value=null)),_n()}),e.watch(()=>S.floatingToolbar,l=>{l?gt():Co()}),e.watch(()=>S.disabled,l=>{l&&Co(),_n()}),e.watch(()=>S.description,()=>{e.nextTick(()=>{_e.value?ro():J()})}),e.watch(()=>S.title,()=>{e.nextTick(()=>{Ft.value?kn():so()})}),e.watch(()=>S.customToolbarSlots,()=>{e.nextTick(()=>{No()})},{deep:!0}),e.watch(()=>S.comments,(l,o)=>{if(Wo.value){Wo.value=!1;return}ko.value||S.richText&&g.value&&e.nextTick(()=>{To()})},{deep:!0,immediate:!1});const To=()=>{if(!ko.value&&!(!S.comments||!Array.isArray(S.comments)||S.comments.length===0)&&!(!S.richText||!g.value)){ko.value=!0;try{const l=new Set,o=S.comments.filter(d=>{const p=String(d.conversation_id||d.id);return l.has(p)?!1:(l.add(p),!0)}),a=g.value.querySelectorAll("[data-comment], [data-fake-comment]"),r=a.length;a.forEach(d=>{const p=d.parentNode;if(p){for(;d.firstChild;)p.insertBefore(d.firstChild,d);p.removeChild(d)}});let i=0;const u=new Set;o.forEach(d=>{if(!d.conversation_id||!d.selection_range)return;const p=typeof d.conversation_id=="string"&&d.conversation_id.startsWith("comment-")?null:Number(d.conversation_id)||d.conversation_id;if(!p)return;const v=String(p);if(u.has(v))return;const y=g.value.querySelector(`[data-comment="${v}"]`);if(y){Fo(y,d),u.add(v);return}try{const V=Hl(d.selection_range,d.selection_text);if(V&&!V.collapsed){const N=V.commonAncestorContainer,b=N.nodeType===3?N.parentElement:N;if(b){const oe=b.closest("[data-comment], [data-fake-comment]");if(oe){const Y=oe.getAttribute("data-comment")||oe.getAttribute("data-fake-comment");if(String(Y)===String(p)){oe.setAttribute("data-comment",v),oe.removeAttribute("data-fake-comment"),Fo(oe,d),u.add(v);return}else return}}const z=g.value.querySelector(`[data-comment="${v}"]`);if(z){Fo(z,d),u.add(v);return}const I=document.createElement("span");I.setAttribute("data-comment",v),Fo(I,d);try{V.surroundContents(I),i++,u.add(v)}catch{try{const Y=document.createRange();Y.setStart(V.startContainer,V.startOffset),Y.setEnd(V.endContainer,V.endOffset),nl(Y),Y.surroundContents(I),i++,u.add(v)}catch{try{const Ee=V.extractContents();I.appendChild(Ee),V.insertNode(I),i++,u.add(v)}catch(Ee){console.warn("Failed to create comment marker:",Ee)}}}}}catch{}}),e.nextTick(()=>{cn("restoreCommentsFromModel"),m(),ko.value=!1})}catch{ko.value=!1}}},nl=l=>{if(!l||!g.value)return l;try{const o=["P","DIV","H1","H2","H3","H4","H5","H6","LI","BLOCKQUOTE","PRE"];let a=l.startContainer,r=l.startOffset;if(a.nodeType===3){const d=a.parentElement;d&&o.includes(d.tagName)&&(r===0&&!El(a)||l.setStartBefore(d))}else a.nodeType===1&&o.includes(a.tagName)&&r>0&&l.setStartBefore(a);let i=l.endContainer,u=l.endOffset;if(i.nodeType===3){const d=i.parentElement;d&&o.includes(d.tagName)&&(u===i.length&&!$l(i)||l.setEndAfter(d))}else i.nodeType===1&&o.includes(i.tagName)&&u<i.childNodes.length&&l.setEndAfter(i);return l}catch{return l}},El=l=>{let o=l.previousSibling;for(;o;){if(o.nodeType===3&&o.textContent.trim().length>0||o.nodeType===1&&o.textContent.trim().length>0)return!0;o=o.previousSibling}return!1},$l=l=>{let o=l.nextSibling;for(;o;){if(o.nodeType===3&&o.textContent.trim().length>0||o.nodeType===1&&o.textContent.trim().length>0)return!0;o=o.nextSibling}return!1},Hl=(l,o)=>{if(!l||!g.value)return null;try{const a=document.createRange();if(l.type==="text"&&typeof l.start=="number"&&typeof l.end=="number"){let r=0;const i=[g.value];let u=null,d=!1,p=!1;for(;!p&&(u=i.pop());)if(u.nodeType===3){const v=r+u.length;!d&&l.start>=r&&l.start<=v&&(a.setStart(u,l.start-r),d=!0),d&&l.end>=r&&l.end<=v&&(a.setEnd(u,l.end-r),p=!0),r=v}else{let v=u.childNodes.length;for(;v--;)i.push(u.childNodes[v])}return d?nl(a):null}}catch{return null}return null},Fo=(l,o)=>{if(!l||!o)return;const a=o.conversation||[],r=new Set,i=[],u=p=>{p&&p.id&&!r.has(p.id)&&(r.add(p.id),i.push(p))};a.length>0&&a.forEach(p=>{p.user&&u(p.user)}),i.length>0?l.setAttribute("data-comment-user",JSON.stringify(i[0])):l.removeAttribute("data-comment-user"),i.length>1?l.setAttribute("data-comment-user-2",JSON.stringify(i[1])):l.removeAttribute("data-comment-user-2");const d=a.length;d>0?l.setAttribute("data-comment-count",String(d)):l.removeAttribute("data-comment-count")},cn=(l="unknown")=>{if(!S.richText||!g.value){hn.value=[];return}Date.now()-Hn.value<vn&&et.value!==null||et.value===null&&(et.value=requestAnimationFrame(()=>{if(et.value=null,Hn.value=Date.now(),$n.value)return;$n.value=!0;const a={},r=g.value;if(!r){$n.value=!1;return}const i=r.closest(".editor-with-comments");if(!i){$n.value=!1;return}const u=r.querySelectorAll("[data-comment], [data-fake-comment]"),d=[],p=new Set;u.forEach(b=>{const z=b.getAttribute("data-comment")||b.getAttribute("data-fake-comment");z&&b.tagName==="SPAN"&&(p.has(z)||(d.push(b),p.add(z)))}),u.forEach(b=>{const z=b.getAttribute("data-comment")||b.getAttribute("data-fake-comment");!z||p.has(z)||(["P","DIV","H1","H2","H3","H4","H5","H6"].includes(b.tagName)?b.querySelector(`span[data-comment="${z}"], span[data-fake-comment="${z}"]`)||(d.push(b),p.add(z)):b.tagName!=="SPAN"&&(d.push(b),p.add(z)))});const v=i.getBoundingClientRect(),y=r.getBoundingClientRect();d.forEach((b,z)=>{let I=b.getAttribute("data-comment")||b.getAttribute("data-fake-comment");if(!I)return;if(typeof I=="string"&&I.startsWith("comment-")){const Yn=b.textContent?.trim(),Bn=S.comments?.find(wn=>(typeof wn.conversation_id=="string"&&wn.conversation_id.startsWith("comment-")?null:wn.conversation_id)&&wn.selection_text?.trim()===Yn);Bn?(I=String(Bn.conversation_id),b.setAttribute("data-comment",I),b.removeAttribute("data-fake-comment")):(I=String(Date.now()),b.setAttribute("data-comment",I),b.removeAttribute("data-fake-comment"))}const oe=b.getBoundingClientRect(),Y=window.getComputedStyle(b),Ee=parseFloat(Y.lineHeight)||parseFloat(Y.fontSize)*1.2,kt=oe.top-y.top+Ee/2-15,Bt=y.top-v.top+kt;let Xe=null,bn=null,Mn=0;const Zt=[],Eo=new Set;if(I&&S.comments){const Yn=S.comments.find(Bn=>String(Bn.conversation_id||Bn.id)===String(I));if(Yn){const Bn=Yn.conversation||[];Bn.length>0?(Bn.forEach(wn=>{wn.user&&wn.user.id&&!Eo.has(wn.user.id)&&(Eo.add(wn.user.id),Zt.push(wn.user))}),Mn=Bn.length):(Mn=0,Xe=null,bn=null),Zt.length>0?Xe=Zt[0]:Xe=null,Zt.length>1?bn=Zt[1]:bn=null}}const Vo=oe.top+Ee/2-15,$o=Vo+30,Ae=5,Dn=$o>y.top+Ae&&Vo<y.bottom-Ae?1:0;hn.value.find(Yn=>Yn.id===I);let Ho=b;if(!Ho&&I&&g.value){const Yn=String(I);Ho=g.value.querySelector(`[data-comment="${Yn}"], [data-fake-comment="${Yn}"]`)}const Ml=Zt.length;a[I]?(a[I].top=Bt,a[I].opacity=Dn,a[I].element=Ho,a[I].firstUser=Xe,a[I].secondUser=bn,a[I].totalCount=Mn,a[I].uniqueUserCount=Ml):a[I]={id:I,top:Bt,opacity:Dn,element:Ho,firstUser:Xe,secondUser:bn,totalCount:Mn,uniqueUserCount:Ml}});const V=Object.values(a).map(b=>{const z=Math.max(0,(b.uniqueUserCount??0)-2);if(!b.element&&b.id&&g.value){const oe=String(b.id);b.element=g.value.querySelector(`[data-comment="${oe}"], [data-fake-comment="${oe}"]`)}return{...b,firstUser:b.firstUser||null,secondUser:b.secondUser||null,totalCount:b.totalCount,additionalCount:z}});(hn.value.length!==V.length||V.some((b,z)=>{const I=hn.value[z];if(!I)return!0;const oe=(I.firstUser?.id||null)!==(b.firstUser?.id||null),Y=(I.secondUser?.id||null)!==(b.secondUser?.id||null);return I.id!==b.id||Math.abs(I.top-b.top)>1||I.opacity!==b.opacity||I.totalCount!==b.totalCount||I.additionalCount!==b.additionalCount||oe||Y||I.element!==b.element}))&&(hn.value=V),$n.value=!1}))},ol=l=>{if(!l)return;let o=l.element;if(!o&&l.id&&g.value){const a=String(l.id);o=g.value.querySelector(`[data-comment="${a}"], [data-fake-comment="${a}"]`)}o&&(no(),sn.value=o,o.classList.add("editor-comment-highlighted"))},no=(l=!1)=>{!l&&Ot.value!==null&&sn.value&&(sn.value.getAttribute("data-comment")||sn.value.getAttribute("data-fake-comment"))===Ot.value||(g.value&&g.value.querySelectorAll(".editor-comment-highlighted").forEach(a=>{a.classList.remove("editor-comment-highlighted")}),sn.value&&(sn.value.classList.remove("editor-comment-highlighted"),sn.value=null))},Xn=l=>{if(!l||!l.element)return;no(!0);const o=l.element.getAttribute("data-comment")||l.element.getAttribute("data-fake-comment");if(!o)return;const a=`[data-comment="${o}"], [data-fake-comment="${o}"]`;ye("comment-marker-clicked",{commentId:o,selector:a,element:l.element})},Ll=()=>{no()},Vl=()=>{!S.richText||!g.value||(Ct.value&&Ct.value.disconnect(),St.value!==null&&(clearTimeout(St.value),St.value=null),Ct.value=new MutationObserver(()=>{St.value===null&&(St.value=setTimeout(()=>{St.value=null,e.nextTick(()=>{cn("MutationObserver")})},200))}),Ct.value.observe(g.value,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-comment","data-fake-comment","data-comment-user","data-comment-user-2","data-comment-count"]}),cn("setupCommentMarkersObserver-initial"))},Sl=(l,o)=>{if(!l||!o)return;const a=o.getBoundingClientRect();let r=a.top,i=a.right+4;l.style.top=`${r}px`,l.style.left=`${i}px`,l.offsetHeight;const u=l.getBoundingClientRect(),d=window.innerWidth,p=window.innerHeight;if(u.right>d){const v=a.left-u.width-4;l.style.left=`${v}px`}if(u.bottom>p){const v=Math.max(8,p-u.height-8);l.style.top=`${v}px`}u.top<0&&(l.style.top="8px")};return e.watch(()=>Ze.value,l=>{e.nextTick(()=>{document.querySelectorAll(".dss-toolbar-dropdown-submenu").forEach(a=>{const r=a.getAttribute("data-submenu-id");if(r===l&&l){const i=document.querySelector(`.dss-toolbar-dropdown-item-has-submenu[data-submenu-id="${r}"]`);if(i){if(a.parentNode!==document.body){const u=a.parentNode;a.dataset.originalParentRef=u===i?"inside":"sibling",document.body.appendChild(a)}a.style.display="block",a.style.visibility="hidden",a.style.opacity="0",requestAnimationFrame(()=>{requestAnimationFrame(()=>{Sl(a,i),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(()=>[we.value,$e.value],()=>{we.value==="askAi"||$e.value==="askAi"?e.nextTick(()=>{Ne()}):(Ze.value=null,e.nextTick(()=>{document.querySelectorAll(".dss-toolbar-dropdown-submenu").forEach(o=>{if(o.parentNode===document.body){const a=o.getAttribute("data-submenu-id");if(a){const r=document.querySelector(`.dss-toolbar-dropdown-item-has-submenu[data-submenu-id="${a}"]`);if(r)if(o.dataset.originalParentRef==="inside")r.appendChild(o);else{const u=r.closest(".dss-toolbar-dropdown");u&&u.insertBefore(o,r.nextSibling)}}}})}))}),e.watch(()=>S.locale,l=>{l&&l!==Pe.value&&(Pe.value=l)},{immediate:!0}),Ut({openCommentOverlayForSelector:H,updateCommentMarkers:cn,restoreCommentsFromModel:To}),(l,o)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-text-editor-container editor-with-comments",Wt.value]),style:e.normalizeStyle(Fn.value)},[O.richText?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-text-editor-toolbar",onMousedown:o[14]||(o[14]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("div",lc,[e.createElementVNode("div",{class:"dss-toolbar-button",onClick:be,title:e.unref(R)("textEditor.toolbar.undo")},[...o[45]||(o[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,ac),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-disabled":!D.value}]),onClick:zt,title:e.unref(R)("textEditor.toolbar.redo")},[...o[46]||(o[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,sc),o[73]||(o[73]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",rc,[e.createElementVNode("div",{class:"dss-toolbar-button dss-toolbar-dropdown-toggle",onClick:o[0]||(o[0]=a=>cl("paragraph")),title:e.unref(R)("textEditor.toolbar.paragraphFormat")},[Ke.value==="h1"?(e.openBlock(),e.createElementBlock("svg",cc,[...o[47]||(o[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)])])):Ke.value==="h2"?(e.openBlock(),e.createElementBlock("svg",dc,[...o[48]||(o[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)])])):Ke.value==="h3"?(e.openBlock(),e.createElementBlock("svg",uc,[...o[49]||(o[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)])])):Ke.value==="h4"?(e.openBlock(),e.createElementBlock("svg",mc,[...o[50]||(o[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)])])):Ke.value==="h5"?(e.openBlock(),e.createElementBlock("svg",pc,[...o[51]||(o[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)])])):Ke.value==="h6"?(e.openBlock(),e.createElementBlock("svg",vc,[...o[52]||(o[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",fc,[...o[53]||(o[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)])])),o[54]||(o[54]=e.createElementVNode("span",{class:"dss-toolbar-dropdown-arrow"},"˅",-1))],8,ic),we.value==="paragraph"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:o[8]||(o[8]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:o[1]||(o[1]=a=>zn("<h1>"))},[o[55]||(o[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(R)("textEditor.paragraph.heading1")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:o[2]||(o[2]=a=>zn("<h2>"))},[o[56]||(o[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(R)("textEditor.paragraph.heading2")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:o[3]||(o[3]=a=>zn("<h3>"))},[o[57]||(o[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(R)("textEditor.paragraph.heading3")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:o[4]||(o[4]=a=>zn("<h4>"))},[o[58]||(o[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(R)("textEditor.paragraph.heading4")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:o[5]||(o[5]=a=>zn("<h5>"))},[o[59]||(o[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(R)("textEditor.paragraph.heading5")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:o[6]||(o[6]=a=>zn("<h6>"))},[o[60]||(o[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(R)("textEditor.paragraph.heading6")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:o[7]||(o[7]=a=>zn("<p>"))},[o[61]||(o[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(R)("textEditor.paragraph.paragraph")),1)])])):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":ln("bold")}]),onClick:o[9]||(o[9]=a=>on("bold")),title:e.unref(R)("textEditor.toolbar.bold")},[...o[62]||(o[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,gc),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":ln("italic")}]),onClick:o[10]||(o[10]=a=>on("italic")),title:e.unref(R)("textEditor.toolbar.italic")},[...o[63]||(o[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,hc),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":ln("underline")}]),onClick:o[11]||(o[11]=a=>on("underline")),title:e.unref(R)("textEditor.toolbar.underline")},[...o[64]||(o[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,yc),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":lt.value}]),onClick:ul,title:e.unref(R)("textEditor.toolbar.citation")},[...o[65]||(o[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,kc),o[74]||(o[74]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),Me.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-button",onClick:Gn,title:e.unref(R)("textEditor.toolbar.removeLink")},[...o[67]||(o[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,bc)):(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-button",onClick:pl,title:e.unref(R)("textEditor.toolbar.insertLink")},[...o[66]||(o[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,Cc)),o[75]||(o[75]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":ln("insertUnorderedList")}]),onClick:vl,title:e.unref(R)("textEditor.toolbar.bulletList")},[...o[68]||(o[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,wc),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":ln("insertOrderedList")}]),onClick:fl,title:e.unref(R)("textEditor.toolbar.numberList")},[...o[69]||(o[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,xc),o[76]||(o[76]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:"dss-toolbar-button",onClick:Jo,title:e.unref(R)("textEditor.toolbar.image")},[...o[70]||(o[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,Ec),pn.value?(e.openBlock(),e.createElementBlock("div",Vc)):e.createCommentVNode("",!0),pn.value?(e.openBlock(),e.createElementBlock("div",{key:3,class:"dss-toolbar-button",title:e.unref(R)("textEditor.toolbar.comment"),onClick:Uo},[...o[71]||(o[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,Sc)):e.createCommentVNode("",!0),O.askAi?(e.openBlock(),e.createElementBlock("div",Nc)):e.createCommentVNode("",!0),O.askAi?(e.openBlock(),e.createElementBlock("div",Mc,[e.createElementVNode("div",{class:"dss-toolbar-ai-button dss-toolbar-dropdown-toggle",onClick:o[12]||(o[12]=a=>cl("askAi")),title:e.unref(R)("textEditor.toolbar.askAi")},[o[72]||(o[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",Tc,e.toDisplayString(e.unref(R)("textEditor.toolbar.askAi")),1)],8,Bc),we.value==="askAi"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:o[13]||(o[13]=e.withModifiers(()=>{},["stop"]))},[e.renderSlot(l.$slots,"ask-ai-dropdown")])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),e.createElementVNode("div",$c,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(O.customToolbarSlots,(a,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:r},[Se(a)?(e.openBlock(),e.createElementBlock("div",Hc,[e.renderSlot(l.$slots,a)])):e.createCommentVNode("",!0),Se(a)&&r<O.customToolbarSlots.length-1&&bt(r)?(e.openBlock(),e.createElementBlock("div",Lc)):e.createCommentVNode("",!0)],64))),128))])],32)):e.createCommentVNode("",!0),(we.value==="paragraph"||we.value==="askAi")&&O.richText?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-dropdown-overlay",onClick:qt})):e.createCommentVNode("",!0),e.createVNode(_l,{showModal:At.value,width:"500px",height:"55vh",onCloseModal:Nn},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(R)("textEditor.link.editLink")),1)]),content:e.withCtx(()=>[e.createElementVNode("div",_c,[e.createElementVNode("div",Ac,[e.createElementVNode("label",Dc,e.toDisplayString(e.unref(R)("textEditor.link.altText")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"linkAltInput",ref:Dt,type:"text","onUpdate:modelValue":o[15]||(o[15]=a=>F.value=a),class:"dss-link-modal-input",placeholder:e.unref(R)("textEditor.link.enterAltText"),onKeyup:e.withKeys(it,["enter"])},null,40,Rc),[[e.vModelText,F.value]])]),e.createElementVNode("div",Ic,[e.createElementVNode("label",Fc,e.toDisplayString(e.unref(R)("textEditor.link.url")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"linkUrlInput",ref:Tt,type:"text","onUpdate:modelValue":o[16]||(o[16]=a=>mt.value=a),class:"dss-link-modal-input",placeholder:e.unref(R)("textEditor.link.enterUrl"),onKeyup:e.withKeys(it,["enter"])},null,40,zc),[[e.vModelText,mt.value]])])])]),actions:e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-cancel",onClick:Nn},e.toDisplayString(e.unref(R)("textEditor.link.cancel")),1),e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-save",onClick:it},e.toDisplayString(e.unref(R)("textEditor.link.save")),1)]),_:1},8,["showModal"]),e.createVNode(_l,{showModal:xn.value,width:"500px",height:"80vh",onCloseModal:vo},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(ke.value?e.unref(R)("textEditor.image.editImage"):e.unref(R)("textEditor.image.addImage")),1)]),content:e.withCtx(()=>[e.createElementVNode("div",Pc,[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-image-modal-tab",{"dss-image-modal-tab-active":Je.value==="upload"}]),onClick:o[17]||(o[17]=a=>Je.value="upload")},e.toDisplayString(e.unref(R)("textEditor.image.upload")),3),o[77]||(o[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":Je.value==="url"}]),onClick:o[18]||(o[18]=a=>Je.value="url")},e.toDisplayString(e.unref(R)("textEditor.image.imageLink")),3)]),Je.value==="upload"?(e.openBlock(),e.createElementBlock("div",Oc,[e.createElementVNode("div",Zc,[e.createElementVNode("div",Wc,[he.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("label",qc,e.toDisplayString(e.unref(R)("textEditor.image.uploadImage")),1)),he.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-image-upload-preview",onClick:el},[e.createElementVNode("img",{src:Ye.value,alt:"Preview",class:"dss-image-preview-image"},null,8,Uc),o[78]||(o[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:un,type:"file",accept:"image/*",class:"dss-image-file-input-hidden",onChange:wl},null,544)])):(e.openBlock(),e.createElementBlock("input",{key:2,ref_key:"imageFileInput",ref:un,type:"file",accept:"image/*",class:"dss-link-modal-input dss-link-modal-input-image",onChange:wl},null,544))]),e.createElementVNode("div",Xc,[e.createElementVNode("label",Yc,e.toDisplayString(e.unref(R)("textEditor.image.altText")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"imageAltInput",ref:Yt,type:"text","onUpdate:modelValue":o[19]||(o[19]=a=>tn.value=a),class:"dss-link-modal-input",placeholder:e.unref(R)("textEditor.image.enterAltText"),onKeyup:e.withKeys(An,["enter"])},null,40,jc),[[e.vModelText,tn.value]])]),e.createElementVNode("div",Kc,[e.createElementVNode("label",Gc,e.toDisplayString(e.unref(R)("textEditor.image.width")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":o[20]||(o[20]=a=>Ie.value=a),class:"dss-link-modal-input",placeholder:e.unref(R)("textEditor.image.auto"),onKeyup:e.withKeys(An,["enter"]),onInput:xl},null,40,Qc),[[e.vModelText,Ie.value]])]),e.createElementVNode("div",Jc,[e.createElementVNode("label",ed,e.toDisplayString(e.unref(R)("textEditor.image.height")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":o[21]||(o[21]=a=>at.value=a),class:"dss-link-modal-input",placeholder:e.unref(R)("textEditor.image.auto"),onKeyup:e.withKeys(An,["enter"]),onInput:tl},null,40,td),[[e.vModelText,at.value]])])])])):e.createCommentVNode("",!0),Je.value==="url"?(e.openBlock(),e.createElementBlock("div",nd,[e.createElementVNode("div",od,[e.createElementVNode("div",ld,[e.createElementVNode("label",ad,e.toDisplayString(e.unref(R)("textEditor.image.imageUrl")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"imageUrlInput",ref:pt,type:"text","onUpdate:modelValue":o[22]||(o[22]=a=>gn.value=a),class:"dss-link-modal-input",placeholder:e.unref(R)("textEditor.image.enterImageUrl"),onKeyup:e.withKeys(An,["enter"])},null,40,sd),[[e.vModelText,gn.value]])]),e.createElementVNode("div",rd,[e.createElementVNode("label",id,e.toDisplayString(e.unref(R)("textEditor.image.altText")),1),e.withDirectives(e.createElementVNode("input",{type:"text","onUpdate:modelValue":o[23]||(o[23]=a=>tn.value=a),class:"dss-link-modal-input",placeholder:e.unref(R)("textEditor.image.enterAltText"),onKeyup:e.withKeys(An,["enter"])},null,40,cd),[[e.vModelText,tn.value]])]),e.createElementVNode("div",dd,[e.createElementVNode("label",ud,e.toDisplayString(e.unref(R)("textEditor.image.width")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":o[24]||(o[24]=a=>Ie.value=a),class:"dss-link-modal-input",placeholder:e.unref(R)("textEditor.image.auto"),onKeyup:e.withKeys(An,["enter"]),onInput:xl},null,40,md),[[e.vModelText,Ie.value]])]),e.createElementVNode("div",pd,[e.createElementVNode("label",vd,e.toDisplayString(e.unref(R)("textEditor.image.height")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":o[25]||(o[25]=a=>at.value=a),class:"dss-link-modal-input",placeholder:e.unref(R)("textEditor.image.auto"),onKeyup:e.withKeys(An,["enter"]),onInput:tl},null,40,fd),[[e.vModelText,at.value]])])])])):e.createCommentVNode("",!0)]),actions:e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-cancel",onClick:vo},e.toDisplayString(e.unref(R)("textEditor.image.cancel")),1),e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-save",onClick:An},e.toDisplayString(e.unref(R)("textEditor.image.save")),1)]),_:1},8,["showModal"]),e.createElementVNode("div",{class:e.normalizeClass(["dss-text-editor-title-wrapper",{"dss-text-editor-no-border-bottom":go.value&&Ft.value}])},[e.createElementVNode("p",null,e.toDisplayString(e.unref(R)("textEditor.labels.title")),1),e.createElementVNode("div",gd,[Ft.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",hd,[O.title?(e.openBlock(),e.createElementBlock("span",yd,e.toDisplayString(O.title),1)):(e.openBlock(),e.createElementBlock("span",kd,e.toDisplayString(xe.value),1))])),e.createElementVNode("textarea",{ref_key:"titleInputRef",ref:Ve,value:O.title,onInput:Ro,onFocus:Do,onBlur:ao,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-title-input",{"dss-text-editor-title-input-blurred":!Ft.value}]),placeholder:xe.value,disabled:O.disabled,rows:"1"},null,42,Cd)])],2),go.value&&Ft.value?(e.openBlock(),e.createElementBlock("div",bd,[e.renderSlot(l.$slots,"title-slot")])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["dss-text-editor-description-wrapper",{"dss-text-editor-no-border-bottom":ho.value&&_e.value}])},[e.createElementVNode("p",null,e.toDisplayString(e.unref(R)("textEditor.labels.description")),1),e.createElementVNode("div",wd,[_e.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",xd,[O.description?(e.openBlock(),e.createElementBlock("span",Ed,e.toDisplayString(O.description),1)):(e.openBlock(),e.createElementBlock("span",Vd,e.toDisplayString(ie.value),1))])),e.createElementVNode("textarea",{ref_key:"descriptionInputRef",ref:Oe,value:O.description,onInput:Kn,onFocus:io,onBlur:ot,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-description-input",{"dss-text-editor-description-input-blurred":!_e.value}]),placeholder:ie.value,disabled:O.disabled,rows:"1"},null,42,Sd)])],2),ho.value&&_e.value?(e.openBlock(),e.createElementBlock("div",Nd,[e.renderSlot(l.$slots,"description-slot")])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(hn.value,a=>(e.openBlock(),e.createElementBlock("div",{key:a.id,class:e.normalizeClass(["editor-comment-marker-group",{"editor-comment-marker-active":Ot.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=>ol(a),onMouseleave:Ll},[a.firstUser?(e.openBlock(),e.createElementBlock("div",{key:0,class:"editor-comment-marker editor-comment-marker-first",onClick:e.withModifiers(r=>Xn(a),["stop"])},[a.firstUser.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:a.firstUser.avatar,alt:a.firstUser.name||"avatar"},null,8,Td)):(e.openBlock(),e.createElementBlock("span",$d,e.toDisplayString(a.firstUser.initials||(a.firstUser.name?a.firstUser.name.charAt(0):"")),1))],8,Bd)):e.createCommentVNode("",!0),a.secondUser?(e.openBlock(),e.createElementBlock("div",{key:1,class:"editor-comment-marker editor-comment-marker-second",onClick:e.withModifiers(r=>Xn(a),["stop"])},[a.secondUser.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:a.secondUser.avatar,alt:a.secondUser.name||"avatar"},null,8,Ld)):(e.openBlock(),e.createElementBlock("span",_d,e.toDisplayString(a.secondUser.initials||(a.secondUser.name?a.secondUser.name.charAt(0):"")),1))],8,Hd)):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=>Xn(a),["stop"])},[e.createElementVNode("span",Dd,"+"+e.toDisplayString(a.additionalCount),1)],12,Ad)):e.createCommentVNode("",!0)],46,Md))),128)),O.richText?(e.openBlock(),e.createElementBlock("div",Zd,[e.createElementVNode("div",{ref_key:"editorRef",ref:g,contenteditable:"true",spellcheck:"false",class:e.normalizeClass(["dss-text-editor-content",{"dss-text-editor-content-disabled":O.disabled,"dss-text-editor-fixed-height":O.fixedHeight}]),style:e.normalizeStyle($.value),onInput:m,onBlur:ue,onClick:jo,onMouseup:eo,onKeyup:eo,onKeydown:rn,onPaste:Wn,onMousemove:Cl,onMouseleave:Tl},null,38),e.createVNode(e.Transition,{name:"comment-overlay"},{default:e.withCtx(()=>[Ot.value!==null?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-comment-overlay",style:e.normalizeStyle(yo.value)},[Qn.value||fn.value.length>0?(e.openBlock(),e.createElementBlock("div",Wd,[e.createElementVNode("div",qd,[Qn.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-comment-selection",innerHTML:Qn.value},null,8,Ud)):e.createCommentVNode("",!0)]),e.createElementVNode("div",Xd,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(fn.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",Yd,[e.createElementVNode("div",jd,[a.user.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:a.user.avatar,alt:a.user.name||"avatar"},null,8,Kd)):(e.openBlock(),e.createElementBlock("span",Gd,e.toDisplayString(a.user.initials||(a.user.name?a.user.name.charAt(0):"")),1))])])):e.createCommentVNode("",!0),e.createElementVNode("div",Qd,[e.createElementVNode("div",Jd,[e.createElementVNode("div",eu,e.toDisplayString(a.user&&a.user.name||"Comment"),1),a.createdAt?(e.openBlock(),e.createElementBlock("div",tu,e.toDisplayString(_o(new Date(a.createdAt))),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:e.normalizeClass(["dss-comment-body-text",{"comment-started":yn(a.text)||a.class==="comment-started"}])},e.toDisplayString(a.text||""),3)]),S.commentUser&&a.user&&a.user.id===S.commentUser.id&&!yn(a.text)?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-comment-delete-button",onClick:e.withModifiers(i=>Bl(a,r),["stop"]),title:e.unref(R)("textEditor.comment.delete")||"Delete comment"},[...o[80]||(o[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,nu)):e.createCommentVNode("",!0)]))),128))])])):e.createCommentVNode("",!0),e.createElementVNode("div",ou,[e.withDirectives(e.createElementVNode("textarea",{ref_key:"commentInputRef",ref:On,"onUpdate:modelValue":o[26]||(o[26]=a=>Pn.value=a),class:"dss-comment-input",rows:"1",placeholder:e.unref(R)("textEditor.comment.placeholder"),onKeydown:e.withKeys(e.withModifiers(yl,["prevent","stop"]),["enter"]),onInput:o[27]||(o[27]=()=>{if(On.value){const a=On.value;a.style.height="auto",a.style.height=`${a.scrollHeight}px`}})},null,40,lu),[[e.vModelText,Pn.value]]),e.createElementVNode("button",{type:"button",class:"dss-comment-send-button",onClick:e.withModifiers(yl,["stop"])},[...o[81]||(o[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",au,[e.createElementVNode("div",su,[e.createElementVNode("span",ru,e.toDisplayString(W.value)+" "+e.toDisplayString(W.value===1?e.unref(R)("textEditor.footer.word"):e.unref(R)("textEditor.footer.words")),1),o[82]||(o[82]=e.createElementVNode("span",{class:"dss-text-editor-footer-separator"},"•",-1)),e.createElementVNode("span",iu,e.toDisplayString(ne.value)+" "+e.toDisplayString(ne.value===1?e.unref(R)("textEditor.footer.character"):e.unref(R)("textEditor.footer.characters")),1)])])])):(e.openBlock(),e.createElementBlock("div",Rd,[e.createElementVNode("textarea",{value:O.modelValue,onInput:Ao,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-textarea",{"dss-text-editor-fixed-height":O.fixedHeight}]),placeholder:fe.value,rows:O.rows,disabled:O.disabled,style:e.normalizeStyle(lo.value)},null,46,Id),e.createElementVNode("div",Fd,[e.createElementVNode("div",zd,[e.createElementVNode("span",Pd,e.toDisplayString(W.value)+" "+e.toDisplayString(W.value===1?e.unref(R)("textEditor.footer.word"):e.unref(R)("textEditor.footer.words")),1),o[79]||(o[79]=e.createElementVNode("span",{class:"dss-text-editor-footer-separator"},"•",-1)),e.createElementVNode("span",Od,e.toDisplayString(ne.value)+" "+e.toDisplayString(ne.value===1?e.unref(R)("textEditor.footer.character"):e.unref(R)("textEditor.footer.characters")),1)])])])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[He.value&&A.value&&g.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-link-popup",style:e.normalizeStyle(Le.value),onMouseenter:o[28]||(o[28]=a=>Qe.value=!0),onMouseleave:xo},[e.createElementVNode("span",{class:"dss-link-popup-url",onClick:e.withModifiers(Un,["stop"]),title:A.value},e.toDisplayString(A.value),9,cu),e.createElementVNode("button",{type:"button",class:"dss-link-popup-edit",onClick:e.withModifiers(po,["stop"]),title:e.unref(R)("textEditor.link.editLink")},[(e.openBlock(),e.createElementBlock("svg",uu,[...o[83]||(o[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,du)],36)):e.createCommentVNode("",!0)])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[Rt.value&&vt.value&&g.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-link-popup",style:e.normalizeStyle(fo.value),onMouseenter:o[29]||(o[29]=a=>Vt.value=!0),onMouseleave:Bo},[e.createElementVNode("div",mu,[vt.value===e.unref(R)("textEditor.image.noAlt")?(e.openBlock(),e.createElementBlock("div",pu,[...o[84]||(o[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:vt.value},e.toDisplayString(vt.value),9,vu)]),e.createElementVNode("button",{type:"button",class:"dss-link-popup-edit",onClick:e.withModifiers(ut,["stop"]),title:e.unref(R)("textEditor.image.editImage")},[(e.openBlock(),e.createElementBlock("svg",gu,[...o[85]||(o[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,fu)],36)):e.createCommentVNode("",!0)])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[O.floatingToolbar&&O.richText&&Q.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"floatingToolbarRef",ref:Ue,class:"dss-floating-toolbar",style:e.normalizeStyle(Rn.value),onMousedown:o[44]||(o[44]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("div",hu,[e.createElementVNode("div",{class:"dss-toolbar-button",onClick:e.withModifiers(be,["stop"]),title:e.unref(R)("textEditor.toolbar.undo")},[...o[86]||(o[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,yu),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-disabled":!D.value}]),onClick:e.withModifiers(zt,["stop"]),title:e.unref(R)("textEditor.toolbar.redo")},[...o[87]||(o[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,ku),o[107]||(o[107]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",Cu,[e.createElementVNode("div",{class:"dss-toolbar-button dss-toolbar-dropdown-toggle",onClick:o[30]||(o[30]=e.withModifiers(a=>to("paragraph"),["stop"])),title:e.unref(R)("textEditor.toolbar.paragraphFormat")},[Ke.value==="h1"?(e.openBlock(),e.createElementBlock("svg",wu,[...o[88]||(o[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)])])):Ke.value==="h2"?(e.openBlock(),e.createElementBlock("svg",xu,[...o[89]||(o[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)])])):Ke.value==="h3"?(e.openBlock(),e.createElementBlock("svg",Eu,[...o[90]||(o[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)])])):Ke.value==="h4"?(e.openBlock(),e.createElementBlock("svg",Vu,[...o[91]||(o[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)])])):Ke.value==="h5"?(e.openBlock(),e.createElementBlock("svg",Su,[...o[92]||(o[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)])])):Ke.value==="h6"?(e.openBlock(),e.createElementBlock("svg",Nu,[...o[93]||(o[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",Mu,[...o[94]||(o[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)])])),o[95]||(o[95]=e.createElementVNode("span",{class:"dss-toolbar-dropdown-arrow"},"˅",-1))],8,bu),$e.value==="paragraph"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:o[38]||(o[38]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:o[31]||(o[31]=a=>Jt("<h1>"))},[e.createElementVNode("h1",null,e.toDisplayString(e.unref(R)("textEditor.paragraph.heading1")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:o[32]||(o[32]=a=>Jt("<h2>"))},[e.createElementVNode("h2",null,e.toDisplayString(e.unref(R)("textEditor.paragraph.heading2")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:o[33]||(o[33]=a=>Jt("<h3>"))},[e.createElementVNode("h3",null,e.toDisplayString(e.unref(R)("textEditor.paragraph.heading3")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:o[34]||(o[34]=a=>Jt("<h4>"))},[e.createElementVNode("h4",null,e.toDisplayString(e.unref(R)("textEditor.paragraph.heading4")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:o[35]||(o[35]=a=>Jt("<h5>"))},[e.createElementVNode("h5",null,e.toDisplayString(e.unref(R)("textEditor.paragraph.heading5")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:o[36]||(o[36]=a=>Jt("<h6>"))},[e.createElementVNode("h6",null,e.toDisplayString(e.unref(R)("textEditor.paragraph.heading6")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:o[37]||(o[37]=a=>Jt("<p>"))},[e.createElementVNode("p",null,e.toDisplayString(e.unref(R)("textEditor.paragraph.paragraph")),1)])])):e.createCommentVNode("",!0)]),o[108]||(o[108]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":ln("bold")}]),onClick:o[39]||(o[39]=e.withModifiers(a=>on("bold"),["stop"])),title:e.unref(R)("textEditor.toolbar.bold")},[...o[96]||(o[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,Bu),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":ln("italic")}]),onClick:o[40]||(o[40]=e.withModifiers(a=>on("italic"),["stop"])),title:e.unref(R)("textEditor.toolbar.italic")},[...o[97]||(o[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,Tu),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":ln("underline")}]),onClick:o[41]||(o[41]=e.withModifiers(a=>on("underline"),["stop"])),title:e.unref(R)("textEditor.toolbar.underline")},[...o[98]||(o[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,$u),o[109]||(o[109]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":lt.value}]),onClick:e.withModifiers(ul,["stop"]),title:e.unref(R)("textEditor.toolbar.citation")},[...o[99]||(o[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,Hu),o[110]||(o[110]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),Me.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-button",onClick:e.withModifiers(Gn,["stop"]),title:e.unref(R)("textEditor.toolbar.removeLink")},[...o[101]||(o[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,_u)):(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-button",onClick:e.withModifiers(pl,["stop"]),title:e.unref(R)("textEditor.toolbar.insertLink")},[...o[100]||(o[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,Lu)),o[111]||(o[111]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":ln("insertUnorderedList")}]),onClick:e.withModifiers(vl,["stop"]),title:e.unref(R)("textEditor.toolbar.bulletList")},[...o[102]||(o[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,Au),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":ln("insertOrderedList")}]),onClick:e.withModifiers(fl,["stop"]),title:e.unref(R)("textEditor.toolbar.numberList")},[...o[103]||(o[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,Du),o[112]||(o[112]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:"dss-toolbar-button",onClick:e.withModifiers(Jo,["stop"]),title:e.unref(R)("textEditor.toolbar.image")},[...o[104]||(o[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,Ru),o[113]||(o[113]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:"dss-toolbar-button",title:e.unref(R)("textEditor.toolbar.comment"),onClick:e.withModifiers(Uo,["stop"])},[...o[105]||(o[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,Iu),O.askAi?(e.openBlock(),e.createElementBlock("div",Fu)):e.createCommentVNode("",!0),O.askAi?(e.openBlock(),e.createElementBlock("div",zu,[e.createElementVNode("div",{class:"dss-toolbar-ai-button dss-toolbar-ai-float dss-toolbar-dropdown-toggle",onClick:o[42]||(o[42]=e.withModifiers(a=>to("askAi"),["stop"])),title:e.unref(R)("textEditor.toolbar.askAi")},[o[106]||(o[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",Ou,e.toDisplayString(e.unref(R)("textEditor.toolbar.askAi")),1)],8,Pu),$e.value==="askAi"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:o[43]||(o[43]=e.withModifiers(()=>{},["stop"]))},[e.renderSlot(l.$slots,"ask-ai-dropdown")])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),jn.value?(e.openBlock(),e.createElementBlock("div",Zu,[O.askAi&&jn.value?(e.openBlock(),e.createElementBlock("div",Wu)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(O.customToolbarSlots,(a,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:r},[Se(a)&&nn(a)?(e.openBlock(),e.createElementBlock("div",qu,[e.renderSlot(l.$slots,a)])):e.createCommentVNode("",!0),Se(a)&&nn(a)&&r<O.customToolbarSlots.length-1&&Ht(r)?(e.openBlock(),e.createElementBlock("div",Uu)):e.createCommentVNode("",!0)],64))),128))])):e.createCommentVNode("",!0)],36)):e.createCommentVNode("",!0)]))],6))}}),ju={key:0,class:"dss-datepicker__input-wrap dss-datepicker__input-wrap--readonly"},Ku=["value"],Gu=["placeholder","value","disabled"],Qu=["placeholder","value"],Ju={key:0,class:"dss-datepicker__double-wrap"},e1={key:0,class:"dss-datepicker__quick-select","aria-label":"Quick range"},t1=["onClick"],n1={class:"dss-datepicker__double-calendars"},o1={class:"dss-datepicker__double-calendar"},l1={class:"dss-datepicker__calendar-header"},a1=["aria-label"],s1={class:"dss-datepicker__month-year-row"},r1=["aria-label"],i1={class:"dss-datepicker__weekdays"},c1={class:"dss-datepicker__grid"},d1=["disabled","onClick","onMouseenter"],u1={key:1,class:"dss-datepicker__day dss-datepicker__day--empty"},m1={class:"dss-datepicker__double-calendar"},p1={class:"dss-datepicker__calendar-header"},v1=["aria-label"],f1={class:"dss-datepicker__month-year-row"},g1=["aria-label"],h1={class:"dss-datepicker__weekdays"},y1={class:"dss-datepicker__grid"},k1=["disabled","onClick","onMouseenter"],C1={key:1,class:"dss-datepicker__day dss-datepicker__day--empty"},b1={class:"dss-datepicker__calendar-header"},w1=["aria-label"],x1={class:"dss-datepicker__month-year-row"},E1=["aria-label"],V1={class:"dss-datepicker__weekdays"},S1={class:"dss-datepicker__grid"},N1=["disabled","onClick","onMouseenter"],M1={key:1,class:"dss-datepicker__day dss-datepicker__day--empty"},B1={class:"dss-datepicker__calendar-header"},T1={class:"dss-datepicker__month-year-row"},$1={class:"dss-datepicker__month-year dss-datepicker__month-year--static"},H1={class:"dss-datepicker__months-grid"},L1=["onClick"],_1={class:"dss-datepicker__calendar-header dss-datepicker__calendar-header--center"},A1={class:"dss-datepicker__month-year"},D1={class:"dss-datepicker__years-grid"},R1=["onClick"],Ol=15,I1={__name:"DSSDatepicker",props:{mode:{type:String,default:"single",validator:O=>["single","range","singleFromAvailable","rangeFromAvailable","readonly"].includes(O)},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(O,{emit:Ut}){const P=O,R=Ut,{t:Pe,locale:S}=al.useI18n(),ye=e.ref(!1),Ge=e.ref("days"),ct=e.ref(new Date().getMonth()),g=e.ref(new Date().getFullYear()),we=e.ref(new Date().getMonth()),Me=e.ref(new Date().getFullYear()),Be=e.ref(new Date().getMonth()),He=e.ref(new Date().getFullYear()),A=e.ref("start"),Le=e.ref(null),Qe=e.ref(null),At=new Date;function mt(){const $=At.getMonth(),D=At.getFullYear(),_=$===11?0:$+1,W=$===11?D+1:D;return{left:{month:$,year:D},right:{month:_,year:W}}}const F=e.ref(null),Tt=e.ref(null),Dt=e.ref(null),pe=e.ref(null),Xt=e.ref(null),en=e.ref(null),lt=new Date().getFullYear(),ve=e.computed(()=>["single","singleFromAvailable"].includes(P.mode)),Q=e.computed(()=>["range","rangeFromAvailable"].includes(P.mode)),Rn=e.computed(()=>{if(P.mode!=="single"&&P.mode!=="singleFromAvailable")return null;const $=P.modelValue;return $ instanceof Date?$:null}),Ue=e.computed(()=>{if(!Q.value)return{start:null,end:null};const $=P.modelValue;return!$||typeof $!="object"?{start:null,end:null}:{start:$.start instanceof Date?$.start:null,end:$.end instanceof Date?$.end:null}});function $e($){if(!$||!($ instanceof Date))return"";const D=$.getDate(),_=$.getMonth()+1,W=$.getFullYear(),ne=he=>String(he).padStart(2,"0");return`${ne(D)}/${ne(_)}/${W}`}const xn=e.computed(()=>$e(Rn.value)),tn=e.computed(()=>{const{start:$,end:D}=Ue.value;if(!$&&!D)return"";const _=!D||$&&$<=D?$:D,W=!$||D&&D>=$?D:$;return ge(_,W)?$e(_):`${$e(_)} - ${$e(W)}`}),Tn=e.computed(()=>{if(P.mode!=="readonly")return"—";const $=P.modelValue;if($ instanceof Date)return $e($)||"—";if($&&typeof $=="object"&&("start"in $||"end"in $)){const D=$.start instanceof Date?$.start:null,_=$.end instanceof Date?$.end:null;if(!D&&!_)return"—";const W=!_||D&&D<=_?D:_,ne=!D||_&&_>=D?_:D;return ge(W,ne)?$e(W):`${$e(W)} - ${$e(ne)}`}return"—"});e.computed(()=>{const $=new Date(g.value,ct.value,1);return new Intl.DateTimeFormat(S.value,{month:"long",year:"numeric"}).format($)});const Ye=e.computed(()=>Qe.value==="left"?we.value:Qe.value==="right"?Be.value:ct.value),Ie=e.computed(()=>Qe.value==="left"?Me.value:Qe.value==="right"?He.value:g.value),at=e.computed(()=>{const $=new Date(g.value,ct.value,1);return new Intl.DateTimeFormat(S.value,{month:"long"}).format($)}),Yt=e.computed(()=>{const $=new Date(Ie.value,Ye.value,1);return new Intl.DateTimeFormat(S.value,{month:"long"}).format($)}),un=e.computed(()=>{const $=new Intl.DateTimeFormat(S.value,{month:"short"});return Array.from({length:12},(D,_)=>$.format(new Date(2024,_,1)))}),pt=e.computed(()=>{const D=(Qe.value?Ie.value:g.value)-Math.floor(Ol/2);return Array.from({length:Ol},(_,W)=>D+W)}),ke=e.computed(()=>{const $=pt.value;return $.length?`${$[0]} – ${$[$.length-1]}`:""}),mn=e.computed(()=>{const $=new Intl.DateTimeFormat(S.value,{weekday:"short"}),D=new Date(2024,0,1),_=[];for(let W=0;W<7;W++){const ne=new Date(D);ne.setDate(D.getDate()+W),_.push($.format(ne).slice(0,2))}return _});function Rt($,D){const _=new Date($,D,1),W=new Date($,D+1,0),ne=_.getDay(),he=W.getDate(),xe=[];for(let ie=0;ie<ne;ie++)xe.push(null);for(let ie=1;ie<=he;ie++)xe.push(new Date($,D,ie));return xe}const vt=e.computed(()=>Rt(g.value,ct.value)),fo=e.computed(()=>Rt(Me.value,we.value)),Vt=e.computed(()=>Rt(He.value,Be.value));e.computed(()=>{const $=new Date(Me.value,we.value,1);return new Intl.DateTimeFormat(S.value,{month:"long",year:"numeric"}).format($)}),e.computed(()=>{const $=new Date(He.value,Be.value,1);return new Intl.DateTimeFormat(S.value,{month:"long",year:"numeric"}).format($)});const Je=e.computed(()=>{const $=new Date(Me.value,we.value,1);return new Intl.DateTimeFormat(S.value,{month:"long"}).format($)}),gn=e.computed(()=>{const $=new Date(He.value,Be.value,1);return new Intl.DateTimeFormat(S.value,{month:"long"}).format($)}),Ze=e.computed(()=>P.availableDates&&P.availableDates.length>0),It=e.computed(()=>Ze.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"}]),Fe=e.ref({top:0,left:0});function jt(){if(!pe.value||!ye.value)return;const $=pe.value.getBoundingClientRect(),D=window.innerWidth||document.documentElement.clientWidth,_=window.innerHeight||document.documentElement.clientHeight;let W=$.left,ne=$.bottom+4;const he=Xt.value;if(he){const xe=he.offsetWidth,ie=he.offsetHeight;if(W+xe>D-8&&(W=$.right-xe,W<8&&(W=8)),ne+ie>_-8){const fe=$.top-4-ie;fe>=8?ne=fe:ne=Math.max(8,_-ie-8)}}Fe.value={top:ne,left:W}}const de=e.computed(()=>!pe.value||!ye.value?{}:{position:"fixed",left:`${Fe.value.left}px`,top:`${Fe.value.top}px`,zIndex:1002});function ge($,D){return!$||!D?!1:$.getFullYear()===D.getFullYear()&&$.getMonth()===D.getMonth()&&$.getDate()===D.getDate()}function ze($){return new Date($.getFullYear(),$.getMonth(),$.getDate()).getTime()}function $t($){return!P.availableDates||!P.availableDates.length?!0:P.availableDates.some(D=>D instanceof Date&&ge(D,$))}function Kt($){const D=ze($);return!(P.minDate instanceof Date&&D<ze(P.minDate)||P.maxDate instanceof Date&&D>ze(P.maxDate))}function ft($){return!P.exceptDates||!P.exceptDates.length?!1:P.exceptDates.some(D=>D instanceof Date&&ge(D,$))}function Te($){return ft($)?!1:["singleFromAvailable","rangeFromAvailable"].includes(P.mode)?$t($):Kt($)}function je($){const D=Rn.value,_=Ue.value,W=ze($),ne=Q.value&&_.start&&_.end&&W>ze(_.start)&&W<ze(_.end),he=Q.value&&_.start&&ge($,_.start),xe=Q.value&&_.end&&ge($,_.end),ie=he&&xe,fe=ve.value&&D&&ge($,D)||he||xe;let Se=!1;if(Q.value&&_.start&&!_.end&&Le.value){const bt=ze(_.start),Ht=ze(Le.value),nn=Math.min(bt,Ht),jn=Math.max(bt,Ht);Se=W>nn&&W<jn}return{"dss-datepicker__day--selected":fe&&!ie,"dss-datepicker__day--range-start":he&&!ie,"dss-datepicker__day--range-end":xe&&!ie,"dss-datepicker__day--range-single":ie,"dss-datepicker__day--in-range":ne&&!he&&!xe,"dss-datepicker__day--in-range-preview":Se&&!he&&!xe&&!ne,"dss-datepicker__day--disabled":!Te($)}}function Ve($){if(!Q.value)return;const D=Ue.value;if(!D.start||D.end){Le.value=null;return}if(!Te($)){Le.value=null;return}Le.value=new Date($.getFullYear(),$.getMonth(),$.getDate())}function Oe(){Le.value=null}function st(){if(!P.doubleCalendar||!Q.value)return;const $=Ue.value,{start:D,end:_}=$;if(D&&_){const he=D<=_?D:_,xe=D<=_?_:D,ie=he.getMonth(),fe=he.getFullYear(),Se=xe.getMonth(),bt=xe.getFullYear();if(ie!==Se||fe!==bt){const Ht=we.value===ie&&Me.value===fe,nn=Be.value===Se&&He.value===bt;if(Ht&&nn)return;we.value=ie,Me.value=fe,Be.value=Se,He.value=bt}else{const Ht=ie===0?11:ie-1,nn=ie===0?fe-1:fe;we.value===Ht&&Me.value===nn&&Be.value===ie&&He.value===fe||(we.value=ie,Me.value=fe,ie===11?(Be.value=0,He.value=fe+1):(Be.value=ie+1,He.value=fe))}return}const W=D||_;if(W){const he=W.getMonth(),xe=W.getFullYear(),ie=we.value===he&&Me.value===xe,fe=Be.value===he&&He.value===xe;if(ie||fe)return;we.value=he,Me.value=xe,he===11?(Be.value=0,He.value=xe+1):(Be.value=he+1,He.value=xe);return}const ne=mt();we.value=ne.left.month,Me.value=ne.left.year,Be.value=ne.right.month,He.value=ne.right.year}function Ce($="start"){if(P.mode==="readonly")return;A.value=$;const D=Rn.value,_=Ue.value;if(ve.value&&D)ct.value=D.getMonth(),g.value=D.getFullYear();else if(Q.value)if(P.doubleCalendar)st();else{const W=$==="start"&&_.start?_.start:_.end||_.start;W&&(ct.value=W.getMonth(),g.value=W.getFullYear())}pe.value=ve.value?F.value?.closest(".dss-datepicker__input-wrap"):Tt.value,Ge.value="days",Qe.value=null,ye.value=!0,e.nextTick(()=>{jt()})}function nt(){Ge.value="days",Qe.value=null,Le.value=null,ye.value=!1}function Ft($,D){Qe.value=$,Ge.value=D}function _e(){Ge.value="days",Qe.value=null}function rt($){const D=new Date,_=D.getFullYear(),W=D.getMonth(),ne=D.getDate();let he,xe;if(Ze.value){const ie=[...P.availableDates].filter(fe=>fe instanceof Date).map(fe=>new Date(fe.getFullYear(),fe.getMonth(),fe.getDate()));if(ie.sort((fe,Se)=>fe.getTime()-Se.getTime()),ie.length===0)return;if($==="all")he=ie[0],xe=ie[ie.length-1];else{const fe=parseInt($.replace("last",""),10);if(fe<2||fe>5)return;const Se=ie.slice(-fe);he=Se[0],xe=Se[Se.length-1]}}else{const ie=new Date(_,W,ne);switch($){case"today":he=ie,xe=ie;break;case"lastWeek":he=new Date(_,W,ne-6),xe=ie;break;case"last15Days":he=new Date(_,W,ne-14),xe=ie;break;case"last30Days":he=new Date(_,W,ne-29),xe=ie;break;case"thisMonth":he=new Date(_,W,1),xe=ie;break;case"last3Months":he=new Date(_,W-3,1),xe=new Date(_,W,0);break;case"last6Months":he=new Date(_,W-6,1),xe=new Date(_,W,0);break;case"last12Months":he=new Date(_,W-12,1),xe=new Date(_,W,0);break;case"lastYear":he=new Date(_-1,0,1),xe=new Date(_-1,11,31);break;default:return}}R("update:modelValue",{start:he,end:xe}),st()}function Ke($){Qe.value==="left"?we.value=$:Qe.value==="right"?Be.value=$:ct.value=$,_e()}function pn($){Qe.value==="left"?Me.value=$:Qe.value==="right"?He.value=$:g.value=$,_e()}function hn(){ct.value===0?(ct.value=11,g.value--):ct.value--}function Ct(){ct.value===11?(ct.value=0,g.value++):ct.value++}function et(){we.value===0?(we.value=11,Me.value--):we.value--}function In(){we.value===11?(we.value=0,Me.value++):we.value++}function $n(){Be.value===0?(Be.value=11,He.value--):Be.value--}function Hn(){Be.value===11?(Be.value=0,He.value++):Be.value++}function vn($){if(!Te($))return;const D=new Date($.getFullYear(),$.getMonth(),$.getDate());if(ve.value){R("update:modelValue",D),nt();return}const _=Ue.value;if(!_.start&&!_.end){R("update:modelValue",{start:D,end:null}),A.value="end";return}if(_.start&&_.end){R("update:modelValue",{start:D,end:null}),A.value="end";return}if(A.value==="start"){let W=D,ne=_.end;W&&ne&&W>ne&&([W,ne]=[ne,W]),R("update:modelValue",{start:W||ne,end:ne||W}),A.value="end"}else{let W=_.start,ne=D;W&&ne&&ne<W&&([W,ne]=[ne,W]),R("update:modelValue",{start:W||ne,end:ne||W}),A.value="start"}}e.watch(Ue,()=>{P.doubleCalendar&&Q.value&&ye.value&&st()},{deep:!0});let St=null,Wt=null,Fn=null;function lo(){St&&(document.removeEventListener("keydown",St),St=null),Wt&&(window.removeEventListener("resize",Wt),Wt=null),Fn&&(window.removeEventListener("scroll",Fn,!0),Fn=null)}return e.watch(ye,$=>{lo(),$&&(St=D=>{D.key==="Escape"&&(Ge.value==="years"||Ge.value==="months"?_e():nt())},Wt=()=>{jt()},Fn=()=>{jt()},document.addEventListener("keydown",St),window.addEventListener("resize",Wt),window.addEventListener("scroll",Fn,!0))}),e.onBeforeUnmount(()=>{lo()}),($,D)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-datepicker",{"dss-datepicker--readonly":O.mode==="readonly"}])},[O.mode==="readonly"?(e.openBlock(),e.createElementBlock("div",ju,[D[9]||(D[9]=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:Tn.value,readonly:"",disabled:"",tabindex:"-1"},null,8,Ku)])):ve.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-datepicker__input-wrap",onClick:D[0]||(D[0]=_=>Ce("start"))},[D[10]||(D[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",{ref_key:"inputSingleRef",ref:F,type:"text",class:"dss-datepicker__input",placeholder:e.unref(Pe)("datepicker.selectDate"),value:xn.value,readonly:"",disabled:O.mode==="readonly"},null,8,Gu)])):Q.value?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-datepicker__input-wrap",ref_key:"inputRangeWrapRef",ref:Tt,onClick:D[1]||(D[1]=_=>Ce("start"))},[D[11]||(D[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:"inputRangeRef",ref:Dt,type:"text",class:"dss-datepicker__input",placeholder:e.unref(Pe)("datepicker.selectRange"),value:tn.value,readonly:""},null,8,Qu)],512)):e.createCommentVNode("",!0),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[ye.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-datepicker__overlay",onClick:e.withModifiers(nt,["self"])},[e.createElementVNode("div",{ref_key:"dropdownRef",ref:Xt,class:e.normalizeClass(["dss-datepicker__dropdown",{"dss-datepicker__dropdown--double":O.doubleCalendar&&Q.value&&Ge.value==="days","dss-datepicker__dropdown--quick-select":O.doubleCalendar&&Q.value&&Ge.value==="days"&&O.quickSelect}]),style:e.normalizeStyle(de.value)},[Ge.value==="days"&&O.doubleCalendar&&Q.value?(e.openBlock(),e.createElementBlock("div",Ju,[O.quickSelect?(e.openBlock(),e.createElementBlock("nav",e1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(It.value,_=>(e.openBlock(),e.createElementBlock("button",{key:_.id,type:"button",class:"dss-datepicker__quick-select-btn",onClick:W=>rt(_.id)},e.toDisplayString(e.unref(Pe)(_.labelKey)),9,t1))),128))])):e.createCommentVNode("",!0),e.createElementVNode("div",n1,[e.createElementVNode("div",o1,[e.createElementVNode("div",l1,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(Pe)("datepicker.prevMonth"),onClick:et}," ‹ ",8,a1),e.createElementVNode("div",s1,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:D[2]||(D[2]=_=>Ft("left","months"))},e.toDisplayString(Je.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:D[3]||(D[3]=_=>Ft("left","years"))},e.toDisplayString(Me.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(Pe)("datepicker.nextMonth"),onClick:In}," › ",8,r1)]),e.createElementVNode("div",i1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(mn.value,_=>(e.openBlock(),e.createElementBlock("span",{key:_,class:"dss-datepicker__weekday"},e.toDisplayString(_),1))),128))]),e.createElementVNode("div",c1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(fo.value,(_,W)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"L-"+W},[_?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-datepicker__day",je(_)]),disabled:!Te(_),onClick:ne=>vn(_),onMouseenter:ne=>Ve(_),onMouseleave:Oe},e.toDisplayString(_.getDate()),43,d1)):(e.openBlock(),e.createElementBlock("span",u1))],64))),128))])]),e.createElementVNode("div",m1,[e.createElementVNode("div",p1,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(Pe)("datepicker.prevMonth"),onClick:$n}," ‹ ",8,v1),e.createElementVNode("div",f1,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:D[4]||(D[4]=_=>Ft("right","months"))},e.toDisplayString(gn.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:D[5]||(D[5]=_=>Ft("right","years"))},e.toDisplayString(He.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(Pe)("datepicker.nextMonth"),onClick:Hn}," › ",8,g1)]),e.createElementVNode("div",h1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(mn.value,_=>(e.openBlock(),e.createElementBlock("span",{key:_,class:"dss-datepicker__weekday"},e.toDisplayString(_),1))),128))]),e.createElementVNode("div",y1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Vt.value,(_,W)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"R-"+W},[_?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-datepicker__day",je(_)]),disabled:!Te(_),onClick:ne=>vn(_),onMouseenter:ne=>Ve(_),onMouseleave:Oe},e.toDisplayString(_.getDate()),43,k1)):(e.openBlock(),e.createElementBlock("span",C1))],64))),128))])])])])):Ge.value==="days"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",b1,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(Pe)("datepicker.prevMonth"),onClick:hn}," ‹ ",8,w1),e.createElementVNode("div",x1,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:D[6]||(D[6]=_=>Ge.value="months")},e.toDisplayString(at.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:D[7]||(D[7]=_=>Ge.value="years")},e.toDisplayString(g.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(Pe)("datepicker.nextMonth"),onClick:Ct}," › ",8,E1)]),e.createElementVNode("div",V1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(mn.value,_=>(e.openBlock(),e.createElementBlock("span",{key:_,class:"dss-datepicker__weekday"},e.toDisplayString(_),1))),128))]),e.createElementVNode("div",S1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(vt.value,(_,W)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:W},[_?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-datepicker__day",je(_)]),disabled:!Te(_),onClick:ne=>vn(_),onMouseenter:ne=>Ve(_),onMouseleave:Oe},e.toDisplayString(_.getDate()),43,N1)):(e.openBlock(),e.createElementBlock("span",M1))],64))),128))])],64)):Ge.value==="months"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createElementVNode("div",B1,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav",onClick:_e}," ‹ "),e.createElementVNode("div",T1,[e.createElementVNode("span",$1,e.toDisplayString(Yt.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:D[8]||(D[8]=_=>Ge.value="years")},e.toDisplayString(Ie.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav",onClick:_e}," › ")]),e.createElementVNode("div",H1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(un.value,(_,W)=>(e.openBlock(),e.createElementBlock("button",{key:W,type:"button",class:e.normalizeClass(["dss-datepicker__month-cell",{"dss-datepicker__month-cell--selected":W===Ye.value}]),onClick:ne=>Ke(W)},e.toDisplayString(_),11,L1))),128))])],64)):Ge.value==="years"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.createElementVNode("div",_1,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav",onClick:_e}," ‹ "),e.createElementVNode("span",A1,e.toDisplayString(ke.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav",onClick:_e}," › ")]),e.createElementVNode("div",{class:"dss-datepicker__years-wrap",ref_key:"yearsWrapRef",ref:en},[e.createElementVNode("div",D1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(pt.value,_=>(e.openBlock(),e.createElementBlock("button",{key:_,type:"button",class:e.normalizeClass(["dss-datepicker__year-cell",{"dss-datepicker__year-cell--selected":_===Ie.value,"dss-datepicker__year-cell--current":_===e.unref(lt)}]),onClick:W=>pn(_)},e.toDisplayString(_),11,R1))),128))])],512)],64)):e.createCommentVNode("",!0)],6)])):e.createCommentVNode("",!0)]))],2))}},F1={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 (optional)"},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"}},z1={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"},P1={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"}},O1={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"}},sl={chart:F1,table:z1,datepicker:P1,textEditor:O1},Z1={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 (optionnel)"},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"}},W1={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"},q1={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"}},U1={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"}},rl={chart:Z1,table:W1,datepicker:q1,textEditor:U1},X1={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"}},Y1={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"},j1={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"}},K1={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"}},il={chart:X1,table:Y1,datepicker:j1,textEditor:K1},Al={en:sl,fr:rl,nl:il};function G1(O){if(!O||!O.global)return;const Ut=O.global.availableLocales||[];Object.keys(Al).forEach(P=>{Ut.includes(P)&&O.global.mergeLocaleMessage(P,Al[P])})}const Dl={en:{textEditor:sl.textEditor},fr:{textEditor:rl.textEditor},nl:{textEditor:il.textEditor}};function Q1(O){if(!O||!O.global)return;const Ut=O.global.availableLocales||[];Object.keys(Dl).forEach(P=>{Ut.includes(P)&&O.global.mergeLocaleMessage(P,Dl[P])})}const Rl={en:{table:sl.table},fr:{table:rl.table},nl:{table:il.table}};function J1(O){if(!O||!O.global)return;const Ut=O.global.availableLocales||[];Object.keys(Rl).forEach(P=>{Ut.includes(P)&&O.global.mergeLocaleMessage(P,Rl[P])})}const Il={en:{datepicker:sl.datepicker},fr:{datepicker:rl.datepicker},nl:{datepicker:il.datepicker}};function em(O){if(!O||!O.global)return;const Ut=O.global.availableLocales||[];Object.keys(Il).forEach(P=>{Ut.includes(P)&&O.global.mergeLocaleMessage(P,Il[P])})}const tm={en:{...sl},fr:{...rl},nl:{...il}};al.createI18n({legacy:!1,locale:"en",fallbackLocale:"en",messages:tm});exports.DSSChart=zr;exports.DSSChartMessages=Al;exports.DSSDatepicker=I1;exports.DSSDatepickerMessages=Il;exports.DSSModal=_l;exports.DSSTable=oc;exports.DSSTableMessages=Rl;exports.DSSTextEditor=Yu;exports.DSSTextEditorMessages=Dl;exports.addDSSChartTranslations=G1;exports.addDSSDatepickerTranslations=em;exports.addDSSTableTranslations=J1;exports.addDSSTextEditorTranslations=Q1;