dsp-semactic 0.5.56 → 0.5.57

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"),Jn=require("vue-i18n"),ll=["data-chart-type"],al={class:"dss-chart-header"},sl={class:"dss-chart-header-titles"},rl={key:0,class:"dss-chart-title"},il={key:1,class:"dss-chart-subtitle"},cl=["onClick","onMouseenter"],dl={class:"dss-legend-text"},ul=["onClick","onMouseenter"],ml={class:"dss-legend-text"},pl=["title"],fl=["src"],vl=["width","height","data-smooth","data-animated"],gl={id:"chart-clip"},hl=["x","y","width","height"],yl={key:0},Cl={key:0,class:"dss-grid-lines","clip-path":"url(#chart-clip)"},kl=["x1","x2","y1","y2"],xl={class:"dss-axes"},wl=["x1","x2","y1","y2"],El=["x1","x2","y1","y2"],bl={class:"dss-axis-labels"},Vl=["x","y"],Sl=["x","y"],Nl=["x","y"],Ml=["y","transform"],Bl={key:1,class:"dss-flag-markers"},Tl={"clip-path":"url(#chart-clip)"},Hl=["x1","x2","y1","y2","onMouseover"],Al=["x1","x2","y1","y2","onMouseover"],Ll=["x1","x2","y1","y2","onMouseover"],$l=["cx","cy","onMouseover"],Dl=["cx","cy","fill","onMouseover"],_l=["x","y"],Il={class:"dss-chart-data","clip-path":"url(#chart-clip)"},Rl={key:0},Fl={class:"dss-bar-chart"},zl=["d","onMouseover"],Ol=["x","y","width","height","fill","onMouseover"],Pl={class:"dss-line-chart"},Zl=["d","stroke","stroke-width"],Ul=["d","stroke","stroke-width","opacity"],Wl=["cx","cy","r","fill","onMouseover"],ql={key:1},Xl=["d","stroke","stroke-width"],Yl=["d","stroke","stroke-width"],jl=["d","stroke","stroke-width","opacity"],Kl=["cx","cy","r","fill","onMouseover"],Gl={key:2},Jl=["id"],Ql=["x","y","width","height"],ea=["d","fill","fill-opacity","mask"],ta=["d","stroke","stroke-width"],oa={key:3},na=["d","fill","onMouseover"],la=["x","y","width","height","onMouseover"],aa={key:2,class:"dss-crosshair","clip-path":"url(#chart-clip)"},sa=["x1","x2","y1","y2","stroke"],ra=["cx","cy","r","fill"],ia={key:1,class:"dss-bubble-chart"},ca={key:0,class:"dss-bubble-group"},da=["cx","cy","r","fill","fill-opacity","stroke","stroke-width","onMouseenter","onMouseleave","onClick"],ua=["x","y","width","height","xlink:href","clip-path","onLoad","onError","onMouseenter","onMouseleave","onClick"],ma={key:2,class:"radial-chart"},pa=["cx","cy","r"],fa=["data-chart-type"],va=["d","fill","fill-opacity","stroke","stroke-width","onMouseover"],ga={key:1,class:"dss-radial-labels"},ha=["x1","y1","x2","y2","stroke"],ya=["x1","y1","x2","y2","stroke"],Ca=["x","y","text-anchor","font-size"],ka={key:3,class:"dss-spider-chart"},xa={key:0,class:"dss-spider-grid"},wa=["cx","cy","r"],Ea={class:"dss-spider-grid-labels"},ba=["x","y"],Va=["x","y"],Sa=["x1","x2","y1","y2"],Na={class:"dss-spider-labels"},Ma=["x","y","text-anchor","dominant-baseline"],Ba=["points","fill","fill-opacity","stroke","stroke-width"],Ta=["cx","cy","r","fill","onMouseover"],Ha={class:"dss-chart-logos"},Aa=["cx","cy","r","fill"],La=["x","y","width","height","xlink:href","onLoad","onError","clip-path"],$a=["onClick","onMouseenter"],Da=["src"],_a={class:"dss-marker-tooltip-category"},Ia={key:0,class:"dss-marker-tooltip-description"},Ra={key:0,class:"dss-tooltip-section"},Fa={key:0,class:"dss-tooltip-title"},za={class:"dss-tooltip-series-name"},Oa={class:"dss-tooltip-series-value"},Pa={key:1,class:"dss-tooltip-section"},Za={class:"dss-tooltip-title"},Ua={class:"dss-tooltip-value"},Wa={key:0,class:"dss-tooltip-section"},qa={class:"dss-tooltip-section-title"},Xa={class:"dss-tooltip-group-header"},Ya={class:"dss-tooltip-item-content"},ja={class:"dss-tooltip-item-text"},Ka={key:1,class:"dss-tooltip-section"},Ga={class:"dss-tooltip-section-title"},Ja={class:"dss-tooltip-item-content"},Qa={class:"dss-tooltip-item-title"},es={key:0,class:"dss-tooltip-item-description"},ts={class:"dss-tooltip-section"},os={class:"dss-tooltip-title"},ns={key:0,class:"dss-bubble-tooltip-data"},ls={class:"dss-tooltip-series-name"},as={class:"dss-tooltip-series-value"},ss={key:0,class:"dss-tooltip-section"},rs={class:"dss-tooltip-section-title"},is={class:"dss-tooltip-group-header"},cs={class:"dss-tooltip-item-content"},ds={class:"dss-tooltip-item-text"},us={key:1,class:"dss-tooltip-section"},ms={class:"dss-tooltip-section-title"},ps={class:"dss-tooltip-item-content"},fs={class:"dss-tooltip-item-title"},vs={key:0,class:"dss-tooltip-item-description"},gs={key:1,class:"dss-context-menu-separator"},hs={key:0,class:"dss-context-menu-separator"},ys={key:0,class:"dss-context-menu-separator"},Cs=["onClick"],ks=["innerHTML"],xs={key:0,class:"dss-context-menu-icon"},ws={class:"dss-marker-modal-header"},Es={class:"dss-marker-modal-body"},bs={class:"dss-form-group"},Vs={key:0},Ss={key:1},Ns=["disabled"],Ms=["value"],Bs={class:"dss-form-group"},Ts={for:"dss-marker-description"},Hs={key:0,class:"dss-form-text-display"},As=["placeholder"],Ls={class:"dss-form-group"},$s={class:"icon-preview"},Ds=["src"],_s={class:"dss-marker-modal-footer"},Is={class:"modal-footer-left"},Rs={class:"dss-modal-footer-right"},Fs=["disabled"],zs={name:"DSSChart"},Os=Object.assign(zs,{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:A=>typeof A=="object"&&A!==null}},emits:["add-marker","update-marker","delete-marker"],setup(A,{emit:zt}){const{t:F,locale:b}=Jn.useI18n(),dt=zt,w=e.ref(null),X=e.ref(null),kt=e.computed(()=>{if(!w.value||!X.value)return 0;try{const l=w.value.getBoundingClientRect();return X.value.getBoundingClientRect().top-l.top}catch{return 0}}),N=A,v={chart:{type:"line",width:800,height:400,orientation:"vertical"},title:{text:"",style:{}},subtitle:{text:"",style:{}},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},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},contextMenu:{enabled:!0,items:{addMarker:!0,downloadSvg:!0,downloadPng:!0,downloadCsv:!0},customItems:[]}};function Le(l,u){const s=Object.assign({},l);return Oe(l)&&Oe(u)&&Object.keys(u).forEach(t=>{Oe(u[t])?t in l?s[t]=Le(l[t],u[t]):Object.assign(s,{[t]:u[t]}):Object.assign(s,{[t]:u[t]})}),s}const De=()=>{let l=20,u=0,s=0;if(J.value&&(l+=30),Q.value&&(l+=25),ye.value&&N.series.length>0){const t=N.series.filter((o,n)=>!re.value.has(n)).length;if(Be.value==="top"||Be.value==="bottom"){if(fo.value==="horizontal"){const n=Math.floor(D.value/100);u=Math.ceil(t/n)*25+10}else u=t*25+10;l+=u}else s=150}return{height:l,legendHeight:u,legendWidth:s}};function Oe(l){return l&&typeof l=="object"&&!Array.isArray(l)}const T=e.computed(()=>Le(v,N.options)),D=e.computed(()=>{const l=T.value;return l&&l.chart&&typeof l.chart.width=="number"?l.chart.width:800}),W=e.computed(()=>{const l=T.value;return l&&l.chart&&typeof l.chart.height=="number"?l.chart.height:400}),P=e.computed(()=>{const l=T.value;return l&&l.chart&&l.chart.type?l.chart.type:"line"}),et=e.computed(()=>{const l=N.series.map(u=>u.type||P.value);return new Set(l).size>1}),J=e.computed(()=>{const l=T.value;return l&&l.title&&l.title.text?l.title.text:""}),Q=e.computed(()=>{const l=T.value;return l&&l.subtitle&&l.subtitle.text?l.subtitle.text:""}),tt=e.computed(()=>{const l=T.value;return l&&l.xAxis&&l.xAxis.title&&l.xAxis.title.text?l.xAxis.title.text:""}),bo=e.computed(()=>{const l=T.value;return l&&l.yAxis&&l.yAxis.title&&l.yAxis.title.text?l.yAxis.title.text:""}),de=e.computed(()=>{const l=T.value;if(!l||!l.yAxis)return Lt;const u=l.yAxis.min;return typeof u=="number"||u===Lt?u:Lt}),xt=e.computed(()=>{const l=T.value;if(!l||!l.yAxis)return Lt;const u=l.yAxis.max;return typeof u=="number"||u===Lt?u:Lt}),Ot=e.computed(()=>{const l=T.value;return!l||!l.xAxis?null:typeof l.xAxis.min=="number"?l.xAxis.min:null}),Jt=e.computed(()=>{const l=T.value;return!l||!l.xAxis?null:typeof l.xAxis.max=="number"?l.xAxis.max:null}),O=e.computed(()=>{const l=T.value;return l&&l.grid&&l.grid.show!==!1}),ye=e.computed(()=>{const l=T.value;return l&&l.legend&&l.legend.show!==!1}),Be=e.computed(()=>{const l=T.value;return l&&l.legend&&l.legend.position?l.legend.position:"top"}),fo=e.computed(()=>{const l=T.value;return l&&l.legend&&l.legend.orientation?l.legend.orientation:"horizontal"}),Te=e.computed(()=>{const l=T.value;if(!l||!l.crosshair)return!1;const u=l.crosshair.show;return u===!0||u==="true"}),vo=e.computed(()=>{const l=T.value;return l&&l.crosshair&&l.crosshair.color?l.crosshair.color:"#666"}),Pe=e.computed(()=>{const l=T.value;return l&&l.zoom&&l.zoom.enabled!==!1}),Vo=e.computed(()=>{const l=T.value;return l&&l.zoom&&typeof l.zoom.minScale=="number"?l.zoom.minScale:1}),ot=e.computed(()=>{const l=T.value;return l&&l.zoom&&typeof l.zoom.maxScale=="number"?l.zoom.maxScale:2.5}),ee=e.computed(()=>{const l=T.value;return l&&l.stroke&&typeof l.stroke.width=="number"?l.stroke.width:2}),se=e.computed(()=>{const l=T.value;return l&&l.bubbles&&typeof l.bubbles.size=="number"?l.bubbles.size:4}),wt=e.computed(()=>{const{maxX:l}=ue.value;return l===0}),Xe=(l,u)=>wt.value&&u===0?5:u,go=e.computed(()=>{const l=T.value;return l&&l.fill&&l.fill.area&&typeof l.fill.area.opacity=="number"?l.fill.area.opacity:.3}),Y=e.computed(()=>{const l=T.value;return l&&l.smoothing&&l.smoothing.enabled===!0}),Et=e.computed(()=>{const l=T.value;return l&&l.smoothing&&typeof l.smoothing.factor=="number"?l.smoothing.factor:.3}),ho=e.computed(()=>{const l=T.value;return Y.value?l&&l.smoothing&&typeof l.smoothing.barRadius=="number"?l.smoothing.barRadius:4:0}),Qt=e.computed(()=>{const l=T.value,u=l&&l.colors&&Array.isArray(l.colors)?l.colors:[];return u.length>0?u:["#3B82F6","#EF4444","#10B981","#F59E0B","#8B5CF6","#F97316","#06B6D4","#84CC16"]}),Pt=e.computed(()=>{const l=T.value;return l&&l.animations&&l.animations.enabled!==!1}),Zt=e.computed(()=>{const l=T.value;return l&&l.animations&&l.animations.type?l.animations.type:"draw"}),_e=e.computed(()=>{const l=T.value;return l&&l.animations&&typeof l.animations.duration=="number"?l.animations.duration:2500}),bt=e.computed(()=>{const l=T.value;return l&&l.animations&&typeof l.animations.delay=="number"?l.animations.delay:0}),Ze=e.computed(()=>{const l=T.value;return l&&l.animations&&l.animations.easing?l.animations.easing:"ease-out"}),xe=e.computed(()=>{const l=T.value;return l&&l.animations&&typeof l.animations.staggerDelay=="number"?l.animations.staggerDelay:200}),nt=e.computed(()=>{const l=T.value;return l&&l.animations&&l.animations.onDataChange!==!1}),eo=e.computed(()=>{const l=T.value;return l&&l.animations&&l.animations.respectReducedMotion!==!1}),z=e.computed(()=>{const l=T.value;return l&&l.fill&&l.fill.spider&&typeof l.fill.spider.opacity=="number"?l.fill.spider.opacity:.15}),le=e.computed(()=>T.value?.spider?.gridSteps||5),Ue=e.computed(()=>{const l=[],u=le.value;for(let s=1;s<=u;s++)l.push(Z.value/u*s);return l}),Vt=l=>{const u=lt.value;if(u&&Array.isArray(u)&&u[l]!==void 0)return u[l].toString();const s=Ue.value[l];return Math.round(s/Z.value*100)+"%"},lt=e.computed(()=>T.value?.spider?.gridLabels||null);e.computed(()=>{const l=T.value;return l&&l.contextMenu&&l.contextMenu.enabled===!0});const fe=e.computed(()=>{const l=T.value,u={addMarker:!0,downloadSvg:!0,downloadPng:!0,downloadCsv:!0};return l&&l.contextMenu&&l.contextMenu.items?{...u,...l.contextMenu.items}:u}),We=e.computed(()=>{const l=T.value;return l&&l.contextMenu&&Array.isArray(l.contextMenu.customItems)?l.contextMenu.customItems:[]}),Ye=e.computed(()=>{const l=T.value;return l&&l.markers&&l.markers.icon?l.markers.icon:zo.value}),K=e.computed(()=>{const l=T.value;return l&&l.markers&&l.markers.customIcons?l.markers.customIcons:{}}),te=e.computed(()=>{const l=T.value;return l&&l.markers&&typeof l.markers.iconSize=="number"?l.markers.iconSize:20}),ut=e.computed(()=>!S.value.isZooming);e.computed(()=>ge.value.map(l=>{if(l.categoryIndex!==void 0&&(Se.value||ke.value)){const u=he(l.categoryIndex),s=kt.value+k.value.bottom-te.value/2;return{...l,x:u,y:s}}return l}));function Fo(l,u){const s=new Date(l);let t=0,o=1/0;return u.forEach((n,a)=>{const[r,c,i]=n.split("-"),d=new Date(`20${i}`,c-1,r),m=Math.abs(d-s);m<o&&(o=m,t=a)}),t}const je=e.computed(()=>{const l=N.markers.map(s=>{const t=Fo(s.marker_date,N.categories),o=he(t),n=kt.value+k.value.bottom-te.value/2;return{...s,x:o,y:n,categoryIndex:t,source:"props"}}),u=ge.value.map(s=>{if(s.categoryIndex!==void 0&&(Se.value||ke.value)){const t=he(s.categoryIndex),o=kt.value+k.value.bottom-te.value/2;return{...s,x:t,y:o,source:"internal"}}return{...s,source:"internal"}});return[...l,...u]}),Ke=e.computed(()=>{const l=T.value;return l&&l.watermark&&l.watermark.enabled===!0}),Ge=e.computed(()=>{const l=T.value;return l&&l.watermark&&typeof l.watermark.opacity=="number"?l.watermark.opacity:.05}),St=e.computed(()=>{const l=T.value;return l&&l.watermark&&l.watermark.size?l.watermark.size:"25%"}),ve=e.computed(()=>{const l=T.value;return l&&l.watermark&&l.watermark.position?l.watermark.position:"bottom-right"}),mt=e.computed(()=>{const l={left:k.value.left,top:k.value.top,width:k.value.width,height:k.value.height};let u,s;const t=String(St.value);if(t.includes("%")){const o=parseFloat(t)/100;u=l.width*o,s=u*(96/499)}else{const o=parseFloat(t)||25;u=Math.min(l.width*.25,200)*(o/25),s=u*(96/499)}return{width:u,height:s,area:l}}),Ut=e.computed(()=>{const{width:l,height:u}=mt.value,s=ve.value;let t,o;const n=k.value.left,a=k.value.right,r=k.value.top,c=k.value.bottom,i=k.value.width,d=k.value.height;switch(s){case"center":t=n+(i-l)/2,o=r+(d-u)/2;break;case"top-left":t=n+15,o=r+90;break;case"top-right":t=a-l-15,o=r+90;break;case"bottom-left":t=n+15,o=c-u+75;break;case"bottom-right":default:t=a-l-15,o=c-u+75;break}return{backgroundPositionX:t+"px",backgroundPositionY:o+"px",backgroundSize:`${l}px ${u}px`}}),pt=l=>!N.flags||!N.flags.length?[]:N.flags.filter(u=>u.categoryIndex===l),Ie=l=>{const u=pt(l),s=Ln(l),t=u.filter(a=>a.manual),o=u.filter(a=>!a.manual),n=[];return t.length>0&&n.push({type:F("chart.tooltip.manualFlags"),color:"#047395",flags:t.map(a=>({text:a.text,color:"#047395"}))}),o.length>0&&n.push({type:F("chart.tooltip.autoFlags"),color:"#0dbf89",flags:o.map(a=>({text:a.text,color:"#0dbf89"}))}),{flagGroups:n,markers:s.map(a=>({title:a.title,description:a.description,type:F("chart.tooltip.markers"),color:a.color||"#FF6B6B"}))}},zo=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"),El=require("vue-i18n"),Hl=["data-chart-type"],Al={class:"dss-chart-header-titles"},Ll={key:0,class:"dss-chart-title"},$l={key:1,class:"dss-chart-subtitle"},Dl=["onClick","onMouseenter"],Il={class:"dss-legend-text"},_l=["onClick","onMouseenter"],Rl={class:"dss-legend-text"},Fl=["title"],zl=["src"],Pl={class:"dss-chart-area-wrapper"},Ol={key:0,class:"dss-chart-z-axis-label"},Zl=["width","height","data-smooth","data-animated"],Wl={id:"chart-clip"},Ul=["x","y","width","height"],ql=["id"],Xl=["d"],Yl=["id"],jl=["d"],Kl={key:0},Gl={key:0,class:"dss-grid-lines","clip-path":"url(#chart-clip)"},Jl=["x1","x2","y1","y2"],Ql={class:"dss-axes"},ea=["x1","x2","y1","y2"],ta=["x1","x2","y1","y2"],oa={class:"dss-axis-labels"},na=["x","y"],la=["x","y"],aa=["x","y"],sa=["y","transform"],ra={key:1,class:"dss-flag-markers"},ia={"clip-path":"url(#chart-clip)"},ca=["x1","x2","y1","y2","onMouseover"],ua=["x1","x2","y1","y2","onMouseover"],da=["x1","x2","y1","y2","onMouseover"],ma=["cx","cy","onMouseover"],pa=["cx","cy","fill","onMouseover"],fa=["x","y"],va={class:"dss-chart-data","clip-path":"url(#chart-clip)"},ha={key:0},ga=["d","onMouseover"],ya=["x","y","width","height","fill","onMouseover"],Ca={class:"dss-line-chart"},ka=["d","stroke","stroke-width"],xa=["d","stroke","stroke-width","opacity"],wa=["cx","cy","r","fill","onMouseover"],ba={key:1},Ea=["d","stroke","stroke-width"],Va=["d","stroke","stroke-width"],Sa=["d","stroke","stroke-width","opacity"],Na=["cx","cy","r","fill","onMouseover"],Ma={key:2},Ba=["id"],Ta=["x","y","width","height"],Ha=["d","fill","fill-opacity","mask"],Aa=["d","stroke","stroke-width"],La=["d","fill","onMouseover"],$a=["x","y","width","height","onMouseover"],Da={key:2,class:"dss-crosshair","clip-path":"url(#chart-clip)"},Ia=["x1","x2","y1","y2","stroke"],_a=["cx","cy","r","fill"],Ra={key:1,class:"dss-bubble-chart"},Fa={key:0,class:"dss-bubble-group"},za=["cx","cy","r","fill","fill-opacity","stroke","onMouseenter","onMouseleave","onClick"],Pa=["x","y","width","height","xlink:href","clip-path","onLoad","onError","onMouseenter","onMouseleave","onClick"],Oa={key:2,class:"radial-chart"},Za=["cx","cy","r"],Wa=["data-chart-type","clip-path"],Ua=["d","fill","fill-opacity","stroke","stroke-width","onMouseover"],qa={key:1,class:"dss-radial-segment-data-labels"},Xa=["x","y"],Ya=["x1","y1","x2","y2","stroke"],ja=["x1","y1","x2","y2","stroke"],Ka=["x","y","text-anchor","font-size"],Ga={key:3,class:"dss-spider-chart"},Ja={key:0,class:"dss-spider-grid"},Qa=["cx","cy","r"],es={class:"dss-spider-grid-labels"},ts=["x","y"],os=["x","y"],ns=["x1","x2","y1","y2"],ls={class:"dss-spider-labels"},as=["x","y","text-anchor","dominant-baseline"],ss=["points","fill","fill-opacity","stroke","stroke-width"],rs=["cx","cy","r","fill","onMouseover"],is={class:"dss-chart-logos"},cs=["cx","cy","r","fill"],us=["x","y","width","height","xlink:href","onLoad","onError","clip-path"],ds=["onClick","onMouseenter"],ms=["src"],ps={class:"dss-marker-tooltip-category"},fs={key:0,class:"dss-marker-tooltip-description"},vs={key:0,class:"dss-tooltip-section"},hs={key:0,class:"dss-tooltip-title"},gs={class:"dss-tooltip-series-name"},ys={class:"dss-tooltip-series-value"},Cs={key:1,class:"dss-tooltip-section"},ks={key:0,class:"dss-tooltip-title"},xs={class:"dss-bubble-tooltip-data"},ws={key:2,class:"dss-tooltip-section"},bs={class:"dss-tooltip-title"},Es={class:"dss-tooltip-value"},Vs={key:0,class:"dss-tooltip-section"},Ss={class:"dss-tooltip-section-title"},Ns={class:"dss-tooltip-group-header"},Ms={class:"dss-tooltip-item-content"},Bs={class:"dss-tooltip-item-text"},Ts={key:1,class:"dss-tooltip-section"},Hs={class:"dss-tooltip-section-title"},As={class:"dss-tooltip-item-content"},Ls={class:"dss-tooltip-item-title"},$s={key:0,class:"dss-tooltip-item-description"},Ds={class:"dss-tooltip-section"},Is={class:"dss-tooltip-title"},_s={key:0,class:"dss-bubble-tooltip-data"},Rs={class:"dss-tooltip-series-name"},Fs={class:"dss-tooltip-series-value"},zs={key:0,class:"dss-tooltip-section"},Ps={class:"dss-tooltip-section-title"},Os={class:"dss-tooltip-group-header"},Zs={class:"dss-tooltip-item-content"},Ws={class:"dss-tooltip-item-text"},Us={key:1,class:"dss-tooltip-section"},qs={class:"dss-tooltip-section-title"},Xs={class:"dss-tooltip-item-content"},Ys={class:"dss-tooltip-item-title"},js={key:0,class:"dss-tooltip-item-description"},Ks={key:1,class:"dss-context-menu-separator"},Gs={key:0,class:"dss-context-menu-separator"},Js={key:0,class:"dss-context-menu-separator"},Qs=["onClick"],er=["innerHTML"],tr={key:0,class:"dss-context-menu-icon"},or={class:"dss-marker-modal-header"},nr={class:"dss-marker-modal-body"},lr={class:"dss-form-group"},ar={key:0},sr={key:1},rr=["disabled"],ir=["value"],cr={class:"dss-form-group"},ur={for:"dss-marker-description"},dr={key:0,class:"dss-form-text-display"},mr=["placeholder"],pr={class:"dss-form-group"},fr={class:"icon-preview"},vr=["src"],hr={class:"dss-marker-modal-footer"},gr={class:"modal-footer-left"},yr={class:"dss-modal-footer-right"},Cr=["disabled"],kr={name:"DSSChart"},xr=Object.assign(kr,{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}},emits:["add-marker","update-marker","delete-marker"],setup(z,{emit:vo}){const{t:J,locale:H}=El.useI18n(),zt=vo,S=e.ref(null),ie=e.ref(null),bo=e.ref(null),Uo=e.ref(0),g=e.ref(0);let Re=null;const ct=20,et=e.computed(()=>{if(!S.value||!ie.value)return 0;try{const t=S.value.getBoundingClientRect();return ie.value.getBoundingClientRect().top-t.top}catch{return 0}}),D=z,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}},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},contextMenu:{enabled:!0,items:{addMarker:!0,downloadSvg:!0,downloadPng:!0,downloadCsv:!0},customItems:[]}};function ke(t,r){const n=Object.assign({},t);return yt(t)&&yt(r)&&Object.keys(r).forEach(c=>{yt(r[c])?c in t?n[c]=ke(t[c],r[c]):Object.assign(n,{[c]:r[c]}):Object.assign(n,{[c]:r[c]})}),n}const gt=()=>{let t=20,r=0,n=0;if(j.value&&(t+=30),xe.value&&(t+=25),Ce.value&&D.series.length>0){const c=D.series.filter((v,f)=>!Ee.value.has(f)).length;if(Ae.value==="top"||Ae.value==="bottom"){if(Lt.value==="horizontal"){const f=Math.floor(Ze.value/100);r=Math.ceil(c/f)*25+10}else r=c*25+10;t+=r}else n=150}return{height:t,legendHeight:r,legendWidth:n}};function yt(t){return t&&typeof t=="object"&&!Array.isArray(t)}const $=e.computed(()=>ke(le,D.options)),Ye=e.computed(()=>{const t=$.value;return t&&t.chart&&t.chart.width==="auto"}),Ht=e.computed(()=>{const t=$.value;return t&&t.chart&&t.chart.height==="auto"}),Ze=e.computed(()=>{const t=$.value;return Ye.value?Uo.value||800:t&&t.chart&&typeof t.chart.width=="number"?t.chart.width:800}),He=e.ref(ct),je=e.computed(()=>{const t=$.value;return Ht.value?Math.max(0,(g.value||400)-He.value):t&&t.chart&&typeof t.chart.height=="number"?t.chart.height:400}),ae=e.computed(()=>{const t=$.value;return t&&t.chart&&t.chart.type?t.chart.type:"line"}),Eo=e.computed(()=>{const t=D.series.map(r=>r.type||ae.value);return new Set(t).size>1}),j=e.computed(()=>{const t=$.value;return t&&t.title&&t.title.text?t.title.text:""}),xe=e.computed(()=>{const t=$.value;return t&&t.subtitle&&t.subtitle.text?t.subtitle.text:""}),rn=e.computed(()=>{const t=$.value;if(!t||!t.zAxis)return"";const r=t.zAxis;return typeof r=="string"?r:r&&typeof r.label=="string"?r.label:""}),Ao=e.computed(()=>{const t=$.value;return t&&t.xAxis&&t.xAxis.title&&t.xAxis.title.text?t.xAxis.title.text:""}),At=e.computed(()=>{const t=$.value;return t&&t.yAxis&&t.yAxis.title&&t.yAxis.title.text?t.yAxis.title.text:""}),lo=e.computed(()=>{const t=$.value;if(!t||!t.yAxis)return oo;const r=t.yAxis.min;return typeof r=="number"||r===oo?r:oo}),Ct=e.computed(()=>{const t=$.value;if(!t||!t.yAxis)return oo;const r=t.yAxis.max;return typeof r=="number"||r===oo?r:oo}),Lo=e.computed(()=>{const t=$.value;return!t||!t.xAxis?null:typeof t.xAxis.min=="number"?t.xAxis.min:null}),kt=e.computed(()=>{const t=$.value;return!t||!t.xAxis?null:typeof t.xAxis.max=="number"?t.xAxis.max:null}),Je=e.computed(()=>{const t=$.value;return t&&t.grid&&t.grid.show!==!1}),Ce=e.computed(()=>{const t=$.value;return t&&t.legend&&t.legend.show!==!1}),Ae=e.computed(()=>{const t=$.value;return t&&t.legend&&t.legend.position?t.legend.position:"top"}),Lt=e.computed(()=>{const t=$.value;return t&&t.legend&&t.legend.orientation?t.legend.orientation:"horizontal"}),Vo=e.computed(()=>{const t=$.value;return!t||!t.tooltip?!0:t.tooltip.enabled!==!1}),ue=e.computed(()=>{const t=$.value;if(!t||!t.crosshair)return!1;const r=t.crosshair.show;return r===!0||r==="true"}),$o=e.computed(()=>{const t=$.value;return t&&t.crosshair&&t.crosshair.color?t.crosshair.color:"#666"}),Pt=e.computed(()=>{const t=$.value;return t&&t.zoom&&t.zoom.enabled!==!1}),So=e.computed(()=>{const t=$.value;return t&&t.zoom&&typeof t.zoom.minScale=="number"?t.zoom.minScale:1}),Bn=e.computed(()=>{const t=$.value;return t&&t.zoom&&typeof t.zoom.maxScale=="number"?t.zoom.maxScale:2.5}),We=e.computed(()=>{const t=$.value;return t&&t.stroke&&typeof t.stroke.width=="number"?t.stroke.width:2}),nt=e.computed(()=>{if(!vt.value)return 0;const t=$.value;return t&&t.stroke&&typeof t.stroke.width=="number"?t.stroke.width:0}),Ke=e.computed(()=>{const t=$.value;return t&&t.bubbles&&typeof t.bubbles.size=="number"?t.bubbles.size:4}),rt=e.computed(()=>{const{maxX:t}=he.value;return t===0}),ut=(t,r)=>rt.value&&r===0?5:r,xt=e.computed(()=>{const t=$.value;return t&&t.fill&&t.fill.area&&typeof t.fill.area.opacity=="number"?t.fill.area.opacity:.3}),lt=e.computed(()=>{const t=$.value;return t&&t.smoothing&&t.smoothing.enabled===!0}),te=e.computed(()=>{const t=$.value;return t&&t.smoothing&&typeof t.smoothing.factor=="number"?t.smoothing.factor:.3}),ve=e.computed(()=>{const t=$.value;return lt.value?t&&t.smoothing&&typeof t.smoothing.barRadius=="number"?t.smoothing.barRadius:4:0}),$t=e.computed(()=>{const t=$.value,r=t&&t.colors&&Array.isArray(t.colors)?t.colors:[];return r.length>0?r:["#3B82F6","#EF4444","#10B981","#F59E0B","#8B5CF6","#F97316","#06B6D4","#84CC16"]}),tt=e.computed(()=>{const t=$.value;return t&&t.animations&&t.animations.enabled!==!1}),wt=e.computed(()=>{const t=$.value;return t&&t.animations&&t.animations.type?t.animations.type:"draw"}),dt=e.computed(()=>{const t=$.value;return t&&t.animations&&typeof t.animations.duration=="number"?t.animations.duration:2500}),mt=e.computed(()=>{const t=$.value;return t&&t.animations&&typeof t.animations.delay=="number"?t.animations.delay:0}),pt=e.computed(()=>{const t=$.value;return t&&t.animations&&t.animations.easing?t.animations.easing:"ease-out"}),se=e.computed(()=>{const t=$.value;return t&&t.animations&&typeof t.animations.staggerDelay=="number"?t.animations.staggerDelay:200}),Ne=e.computed(()=>{const t=$.value;return t&&t.animations&&t.animations.onDataChange!==!1}),Ot=e.computed(()=>{const t=$.value;return t&&t.animations&&t.animations.respectReducedMotion!==!1}),ho=e.computed(()=>{const t=$.value;return t&&t.fill&&t.fill.spider&&typeof t.fill.spider.opacity=="number"?t.fill.spider.opacity:.15}),bt=e.computed(()=>$.value?.spider?.gridSteps||5),Et=e.computed(()=>{const t=[],r=bt.value;for(let n=1;n<=r;n++)t.push(ce.value/r*n);return t}),Zt=t=>{const r=ao.value;if(r&&Array.isArray(r)&&r[t]!==void 0)return r[t].toString();const n=Et.value[t];return Math.round(n/ce.value*100)+"%"},ao=e.computed(()=>$.value?.spider?.gridLabels||null),Fe=e.computed(()=>{const t=$.value;return t&&t.contextMenu&&t.contextMenu.enabled===!0}),Ue=e.computed(()=>{const t=$.value,r={addMarker:!0,downloadSvg:!0,downloadPng:!0,downloadCsv:!0};return t&&t.contextMenu&&t.contextMenu.items?{...r,...t.contextMenu.items}:r}),Wt=e.computed(()=>{const t=$.value;return t&&t.contextMenu&&Array.isArray(t.contextMenu.customItems)?t.contextMenu.customItems:[]}),Dt=e.computed(()=>{const t=$.value;return t&&t.markers&&t.markers.icon?t.markers.icon:qo.value}),It=e.computed(()=>{const t=$.value;return t&&t.markers&&t.markers.customIcons?t.markers.customIcons:{}}),Ut=e.computed(()=>{const t=$.value;return t&&t.markers&&typeof t.markers.iconSize=="number"?t.markers.iconSize:20}),Do=e.computed(()=>!A.value.isZooming);e.computed(()=>Me.value.map(t=>{if(t.categoryIndex!==void 0&&(De.value||Be.value)){const r=ge(t.categoryIndex),n=et.value+E.value.bottom-Ut.value/2;return{...t,x:r,y:n}}return t}));function Tn(t,r){const n=new Date(t);let c=0,v=1/0;return r.forEach((f,C)=>{const[y,b,V]=f.split("-"),N=new Date(`20${V}`,b-1,y),M=Math.abs(N-n);M<v&&(v=M,c=C)}),c}const al=e.computed(()=>{const t=D.markers.map(n=>{const c=Tn(n.marker_date,D.categories),v=ge(c),f=et.value+E.value.bottom-Ut.value/2;return{...n,x:v,y:f,categoryIndex:c,source:"props"}}),r=Me.value.map(n=>{if(n.categoryIndex!==void 0&&(De.value||Be.value)){const c=ge(n.categoryIndex),v=et.value+E.value.bottom-Ut.value/2;return{...n,x:c,y:v,source:"internal"}}return{...n,source:"internal"}});return[...t,...r]}),Vt=e.computed(()=>{const t=$.value;return t&&t.watermark&&t.watermark.enabled===!0}),cn=e.computed(()=>{const t=$.value;return t&&t.watermark&&typeof t.watermark.opacity=="number"?t.watermark.opacity:.05}),sl=e.computed(()=>{const t=$.value;return t&&t.watermark&&t.watermark.size?t.watermark.size:"25%"}),un=e.computed(()=>{const t=$.value;return t&&t.watermark&&t.watermark.position?t.watermark.position:"bottom-right"}),dn=e.computed(()=>{const t={left:E.value.left,top:E.value.top,width:E.value.width,height:E.value.height};let r,n;const c=String(sl.value);if(c.includes("%")){const v=parseFloat(c)/100;r=t.width*v,n=r*(96/499)}else{const v=parseFloat(c)||25;r=Math.min(t.width*.25,200)*(v/25),n=r*(96/499)}return{width:r,height:n,area:t}}),Hn=e.computed(()=>{const{width:t,height:r}=dn.value,n=un.value;let c,v;const f=E.value.left,C=E.value.right,y=E.value.top,b=E.value.bottom,V=E.value.width,N=E.value.height;switch(n){case"center":c=f+(V-t)/2,v=y+(N-r)/2;break;case"top-left":c=f+15,v=y+90;break;case"top-right":c=C-t-15,v=y+90;break;case"bottom-left":c=f+15,v=b-r+75;break;case"bottom-right":default:c=C-t-15,v=b-r+75;break}return{backgroundPositionX:c+"px",backgroundPositionY:v+"px",backgroundSize:`${t}px ${r}px`}}),An=t=>!D.flags||!D.flags.length?[]:D.flags.filter(r=>r.categoryIndex===t),St=t=>{const r=An(t),n=Go(t),c=r.filter(C=>C.manual),v=r.filter(C=>!C.manual),f=[];return c.length>0&&f.push({type:J("chart.tooltip.manualFlags"),color:"#047395",flags:c.map(C=>({text:C.text,color:"#047395"}))}),v.length>0&&f.push({type:J("chart.tooltip.autoFlags"),color:"#0dbf89",flags:v.map(C=>({text:C.text,color:"#0dbf89"}))}),{flagGroups:f,markers:n.map(C=>({title:C.title,description:C.description,type:J("chart.tooltip.markers"),color:C.color||"#FF6B6B"}))}},qo=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>`)}`),to=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>`)}`),mn=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>`)}`),Oo=e.computed(()=>{const l=T.value;return l&&l.radialLabels&&l.radialLabels.show===!0}),Sn=e.computed(()=>{const l=T.value;return l&&l.radialLabels&&typeof l.radialLabels.fontSize=="number"?l.radialLabels.fontSize:12});e.computed(()=>{const l=T.value;return l&&l.radialLabels&&l.radialLabels.color?l.radialLabels.color:"#000"});const ft=e.computed(()=>{const l=T.value;return l&&l.radialLabels&&typeof l.radialLabels.pointerLength=="number"?l.radialLabels.pointerLength:25}),Nn=e.computed(()=>{const l=T.value;return l&&l.radialLabels&&typeof l.radialLabels.horizontalLength=="number"?l.radialLabels.horizontalLength:40}),Mn=e.computed(()=>{const l=T.value;return l&&l.radialLabels&&typeof l.radialLabels.textOffset=="number"?l.radialLabels.textOffset:8}),Jo=e.computed(()=>{if(!N.flags||!N.flags.length)return[];const l=new Map;return N.flags.forEach(u=>{const s=u.categoryIndex;l.has(s)||l.set(s,[]),l.get(s).push(u)}),Array.from(l.entries()).map(([u,s])=>{const t=he(u),o=s.filter(a=>a.manual),n=s.filter(a=>!a.manual);return{categoryIndex:parseInt(u),x:t,flags:s,manualCount:o.length,autoCount:n.length,totalCount:s.length,hasManual:o.length>0,hasAuto:n.length>0,texts:s.map(a=>a.text).join(`
22
- `)}})}),Po=e.ref({show:!1,x:0,y:0,content:"",count:0}),Qo=e.computed(()=>T.value?.bubbles?.tooltip?.fields||["x","y","size","label"]),en=e.computed(()=>{const l=T.value;return{...{x:"X",y:"Y",size:"Size",label:"Label",seriesName:"Series"},...l?.bubbles?.tooltip?.labels||{}}}),So=e.computed(()=>T.value?.bubbles?.tooltip?.formatters||{}),re=e.ref(new Set),L=e.ref(null),No=e.ref(!1),ae=e.ref({show:!1,x:0,y:0,title:"",value:"",spiderSeries:[]}),Nt=e.ref({show:!1,x:0,y:0,categoryValue:"",description:""}),I=e.ref({show:!1,x:0,categoryIndex:-1,data:[]}),oe=e.ref({show:!1,x:0,y:0,mouseDataX:0,mouseDataY:0,categoryIndex:-1,chartX:0,chartY:0}),S=e.ref({scale:1,offsetX:0,minScale:1,maxScale:2.5,isDragging:!1,lastMouseX:0,lastMouseY:0,isZooming:!1,zoomTimeout:null}),ge=e.ref([]),$=e.ref({show:!1,title:"",description:"",color:"#FF6B6B",type:"default",editingMarkerId:null,readonly:!1,categoryIndex:null,fromButton:!1});e.computed(()=>{const l=["default"];return K.value&&l.push(...Object.keys(K.value)),l});const tn=e.computed(()=>{if(!N.categories||N.categories.length===0){const{maxX:l}=ue.value;return Array.from({length:l+1},(u,s)=>F("chart.fallback.item",{number:s+1}))}return N.categories}),oo=e.computed(()=>$.value.editingMarkerId!==null),Mt=e.computed(()=>$.value.readonly),Zo=l=>{re.value.has(l)||(xo.value=!0,L.value=l)},on=()=>{xo.value=!1,L.value=null},Bn=l=>{if(uo.value||wo.value){I.value.show=!1;return}const s=l.currentTarget.getBoundingClientRect(),t=l.clientX-s.left,o=l.clientY-s.top,n=ke.value?t>=k.value.left-50&&t<=k.value.right+50&&o>=k.value.top-50&&o<=k.value.bottom+100:t>=k.value.left&&t<=k.value.right&&o>=k.value.top&&o<=k.value.bottom;if(No.value=n,ke.value){if(!Te.value||!n||S.value.isDragging||S.value.isZooming){I.value.show=!1;return}if(Xt.value.find(f=>!f||f.isHidden?!1:Math.sqrt(Math.pow(f.x-t,2)+Math.pow(f.y-o,2))<=f.radius+3))I.value.show=!1;else{const f=Xt.value.filter(C=>!C||C.isHidden?!1:Math.sqrt(Math.pow(C.x-t,2)+Math.pow(C.y-o,2))<=250);if(f.length>0){let C=f[0],y=Math.sqrt(Math.pow(C.x-t,2)+Math.pow(C.y-o,2));f.forEach(V=>{const M=Math.sqrt(Math.pow(V.x-t,2)+Math.pow(V.y-o,2));M<y&&(y=M,C=V)});const x=30,E=Xt.value.filter(V=>!V||V.isHidden?!1:Math.abs(V.x-C.x)<=x).sort((V,M)=>V.y-M.y);I.value={show:!0,x:C.x,categoryIndex:Math.round(C.originalX),data:(()=>{const V=Qo.value,M=en.value,H=[];return E.forEach(B=>{V.forEach(_=>{const R=M[_]||_,q=hn(_,B);q&&H.push({seriesName:B.seriesName,label:B.label,value:`${R}: ${q}`,color:B.color,y:B.y})})}),H})()}}else I.value.show=!1}return}if(S.value.isDragging&&S.value.scale>1&&Se.value&&Pe.value){I.value.show=!1;const h=l.clientX-S.value.lastMouseX,{minX:f,maxX:C}=ue.value,y=C-f||1,E=h*.8;S.value.offsetX+=E;const V=y/S.value.scale,M=y-V,H=0,B=-M/y*k.value.width,_=H;S.value.offsetX=Math.max(B,Math.min(_,S.value.offsetX)),S.value.lastMouseX=l.clientX,S.value.lastMouseY=l.clientY;return}if(!Te.value||!Se.value||S.value.isDragging||S.value.isZooming||!n){I.value.show=!1;return}const{minX:a,maxX:r}=ue.value,c=r-a||1,i=c/S.value.scale,d=a-S.value.offsetX/k.value.width*c,m=(t-k.value.left)/k.value.width,p=d+m*i,g=Math.round(p);if(g>=0&&g<=r){const h=he(g),f=qt.value.map((C,y)=>{const x=N.series.findIndex(V=>V===C),E=C.data[g];return{seriesName:C.name,value:E!==void 0?E:null,color:me(x),y:E!==void 0?Ne(E):null}}).filter(C=>C.value!==null);I.value={show:!0,x:h,categoryIndex:g,data:f}}},nn=()=>{I.value.show=!1,No.value=!1,wo.value=!1,uo.value||(Po.value.show=!1),S.value.isDragging&&(S.value.isDragging=!1),S.value.zoomTimeout&&(clearTimeout(S.value.zoomTimeout),S.value.zoomTimeout=null),S.value.isZooming=!1,setTimeout(()=>{L.value=null,ae.value.show=!1},150)},Tn=l=>{if(l.preventDefault(),l.stopPropagation(),At.value)return;const u=l.currentTarget.getBoundingClientRect(),s=l.clientX-u.left,t=l.clientY-u.top,o=Math.max(0,k.value.left-20),n=k.value.right,a=k.value.top,r=k.value.bottom+80;s>=o&&s<=n&&t>=a&&t<=r&&(oe.value.show=!1,e.nextTick(()=>{oe.value.show=!0,oe.value.x=l.clientX,oe.value.y=l.clientY,oe.value.categoryIndex=null;const c=Math.max(k.value.left,Math.min(s,k.value.right))-k.value.left,d=k.value.width/Xo.value.length,m=Math.floor(c/d);m>=0&&m<Xo.value.length&&(oe.value.categoryIndex=m)}))},Re=l=>{if(!(l&&l.button===2)){if(oe.value.show&&l&&l.type==="click"){const u=document.querySelector(".dss-context-menu");if(u&&u.contains(l.target))return}oe.value.show=!1}},Hn=l=>{if(typeof l.template=="function"){const u={series:N.series,categories:N.categories,markers:ge.value},s={chartX:oe.value.chartX,chartY:oe.value.chartY,dataX:oe.value.mouseDataX,dataY:oe.value.mouseDataY,categoryIndex:oe.value.categoryIndex};return l.template(u,s)}return l.template||l.label||""},An=l=>{const u=["dss-context-menu-item"];return l.cssClass&&u.push(l.cssClass),u},Uo=l=>l.style||{},ln=l=>l.type&&K.value[l.type]?K.value[l.type]:l.customIcon?l.customIcon:Ye.value,yo=l=>l==null?"":N.categories&&N.categories[l]?N.categories[l]:"",Ln=l=>ge.value.length?ge.value.filter(u=>u.categoryIndex===l):[],$n=l=>{if(!Se.value&&!ke.value)return{x:0,y:0};const u=he(l),s=kt.value+k.value.bottom-te.value/2;return{x:u,y:s}},Mo=()=>{ge.value.forEach(l=>{if(l.categoryIndex!==void 0&&(Se.value||ke.value)){const u=$n(l.categoryIndex);l.x=u.x,l.y=u.y}})},Dn=()=>{if($.value.description&&$.value.description.length){if(oo.value){const l=ge.value.findIndex(u=>u.id===$.value.editingMarkerId);l!==-1?(ge.value[l].description=$.value.description||"",ge.value[l].color=$.value.color||"",ge.value[l].type=$.value.type||"default",dt("update-marker",ge.value[l])):dt("update-marker",{id:$.value.editingMarkerId,description:$.value.description||"",color:$.value.color||"",type:$.value.type||"default"})}else{const l="dss-marker-"+Date.now()+"-"+Math.random().toString(36).substring(2,9);let u=Math.max(0,$.value.categoryIndex);if(ke.value){const{maxX:a}=ue.value;u=Math.max(0,Math.min(u,Math.floor(a)))}else Se.value&&(u=Math.max(0,Math.min(u,ue.value.maxX)));const s=he(u),t=kt.value+k.value.bottom-te.value/2,o=Array.isArray(N.categories)?N.categories[u]:null,n={id:l,title:"",description:$.value.description||"",color:$.value.color||"",type:$.value.type||"default",categoryIndex:u,x:s,y:t,marker_date:o||null};$.value.categoryIndex=u,ge.value.push(n),dt("add-marker",n)}be(),j()}},be=()=>{$.value.show=!1,$.value.title="",$.value.description="",$.value.color="#FF6B6B",$.value.type="default",$.value.editingMarkerId=null,$.value.readonly=!1,$.value.categoryIndex=null,$.value.fromButton=!1},at=()=>{oo.value&&(Bo($.value.editingMarkerId),be())},Bo=l=>{const u=ge.value.findIndex(s=>s.id===l);u!==-1&&(ge.value.splice(u,1),j()),dt("delete-marker",l)},we=l=>{$.value.show=!0,$.value.title=l?.title??l?.comment??"",$.value.description=l?.description??l?.comment??"",$.value.color=l?.color??"",$.value.type=l?.type??"default",$.value.editingMarkerId=l?.id??l?.marker_id??null,$.value.readonly=l?.readonly??!1,$.value.categoryIndex=l?.categoryIndex??null},j=()=>{try{const l=`dss-chart-markers-${N.chartId}`;localStorage.setItem(l,JSON.stringify(ge.value))}catch(l){console.warn("Could not save markers to localStorage:",l)}},Wo=()=>{try{const l=`dss-chart-markers-${N.chartId}`,u=localStorage.getItem(l);if(u){const s=JSON.parse(u);Array.isArray(s)&&(ge.value=s.map(t=>({...t,originalYOffset:t.originalYOffset!==void 0?t.originalYOffset:15})))}}catch(l){console.warn("Could not load markers from localStorage:",l),ge.value=[]}},no=l=>{const u=J.value||"Chart",s=new Date().toLocaleDateString("en-GB",{day:"2-digit",month:"2-digit",year:"2-digit"}).replace(/\//g,"-");return`${u.replace(/[^a-zA-Z0-9\s]/g,"").replace(/\s+/g,"-").substring(0,50).replace(/^-|-$/g,"")||"Chart"}-${s}.${l}`},st=()=>{const l=I.value.show,u=ae.value.show;return I.value.show=!1,ae.value.show=!1,{originalCrosshair:l,originalTooltip:u}},Wt=l=>{I.value.show=l.originalCrosshair,ae.value.show=l.originalTooltip},an=async(l,u=32,s=32)=>new Promise((t,o)=>{if(l.startsWith("data:")){t(l);return}const n=new Image;n.crossOrigin="anonymous";const a=setTimeout(()=>{console.warn("Image conversion timeout for:",l),t(l)},5e3);n.onload=()=>{clearTimeout(a);try{const r=document.createElement("canvas"),c=r.getContext("2d");r.width=u,r.height=s,c.fillStyle="#fafafa",c.fillRect(0,0,u,s),c.drawImage(n,0,0,u,s);const i=r.toDataURL("image/png");t(i)}catch(r){console.warn("Canvas conversion failed:",r),t(l)}},n.onerror=r=>{clearTimeout(a),console.warn("Failed to load image:",l,r),t(l)},n.src=l}),sn=async()=>{try{const l=st();setTimeout(async()=>{try{const u=document.querySelector(".dss-chart-svg");if(!u){console.error("Chart SVG element not found"),Wt(l);return}const s=De(),t=D.value,o=W.value+s.height,n=u.cloneNode(!0);n.querySelectorAll(".dss-flag-markers, .dss-flag-line, .dss-flag-extension-line, .dss-flag-count-indicator, .dss-flag-count-text").forEach(x=>x.remove());const r=n.querySelectorAll("image"),c=Array.from(r).map(async x=>{const E=x.getAttribute("xlink:href")||x.getAttribute("href");if(E&&!E.startsWith("data:"))try{const V=await an(E,32,32);x.setAttribute("xlink:href",V),x.setAttribute("href",V)}catch(V){console.warn("Failed to convert logo to base64:",V)}});await Promise.all(c);const d=new XMLSerializer().serializeToString(n).replace(/<svg[^>]*>/,"").replace("</svg>","");let m="",p=30;if(J.value&&(m+=`
23
- <text x="24" y="${p}"
21
+ </svg>`)}`),pn=e.computed(()=>{const t=$.value;return t&&t.radialLabels&&t.radialLabels.show===!0}),Ln=e.computed(()=>{const t=$.value;return t&&t.radialLabels&&typeof t.radialLabels.fontSize=="number"?t.radialLabels.fontSize:12});e.computed(()=>{const t=$.value;return t&&t.radialLabels&&t.radialLabels.color?t.radialLabels.color:"#000"});const rl=e.computed(()=>{const t=$.value;return t&&t.radialLabels&&typeof t.radialLabels.pointerLength=="number"?t.radialLabels.pointerLength:25}),qt=e.computed(()=>{const t=$.value;return t&&t.radialLabels&&typeof t.radialLabels.horizontalLength=="number"?t.radialLabels.horizontalLength:40}),il=e.computed(()=>{const t=$.value;return t&&t.radialLabels&&typeof t.radialLabels.textOffset=="number"?t.radialLabels.textOffset:8}),$n=e.computed(()=>{const r=$.value?.radialBar?.dataLabels;return r&&(r.show===!0||r.enabled===!0)}),Xo=e.computed(()=>{const r=$.value?.radialBar?.dataLabels?.minAngleDegrees;return typeof r=="number"&&r>=0?r:20}),Dn=e.computed(()=>{if(!$n.value||!vt.value||!Oo.value.length)return[];const t=Xo.value*Math.PI/180,r=(ot.value+ce.value)/2;return Oo.value.map(n=>{const v=n.endAngle-n.startAngle>=t&&!n.isHidden,f=Ve.value+Math.cos(n.midAngle)*r,C=Se.value+Math.sin(n.midAngle)*r;return{value:n.value,x:f,y:C,show:v,color:n.color}})}),fn=e.computed(()=>{if(!D.flags||!D.flags.length)return[];const t=new Map;return D.flags.forEach(r=>{const n=r.categoryIndex;t.has(n)||t.set(n,[]),t.get(n).push(r)}),Array.from(t.entries()).map(([r,n])=>{const c=ge(r),v=n.filter(C=>C.manual),f=n.filter(C=>!C.manual);return{categoryIndex:parseInt(r),x:c,flags:n,manualCount:v.length,autoCount:f.length,totalCount:n.length,hasManual:v.length>0,hasAuto:f.length>0,texts:n.map(C=>C.text).join(`
22
+ `)}})}),Yo=e.ref({show:!1,x:0,y:0,content:"",count:0}),jo=e.computed(()=>$.value?.bubbles?.tooltip?.fields||["x","y","size","label"]),vn=e.computed(()=>{const t=$.value;return{...{x:"X",y:"Y",size:"Size",label:"Label",seriesName:"Series"},...t?.bubbles?.tooltip?.labels||{}}}),cl=e.computed(()=>$.value?.bubbles?.tooltip?.formatters||{}),Ee=e.ref(new Set),U=e.ref(null),hn=e.ref(!1),oe=e.ref({show:!1,x:0,y:0,title:"",value:"",bubbleData:[],spiderSeries:[]}),so=e.ref({show:!1,x:0,y:0,categoryValue:"",description:""}),ne=e.ref({show:!1,x:0,categoryIndex:-1,data:[]}),re=e.ref({show:!1,x:0,y:0,mouseDataX:0,mouseDataY:0,categoryIndex:-1,chartX:0,chartY:0}),A=e.ref({scale:1,offsetX:0,minScale:1,maxScale:2.5,isDragging:!1,lastMouseX:0,lastMouseY:0,isZooming:!1,zoomTimeout:null}),Me=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 It.value&&t.push(...Object.keys(It.value)),t});const ul=e.computed(()=>{if(!D.categories||D.categories.length===0){const{maxX:t}=he.value;return Array.from({length:t+1},(r,n)=>J("chart.fallback.item",{number:n+1}))}return D.categories}),go=e.computed(()=>X.value.editingMarkerId!==null),No=e.computed(()=>X.value.readonly),ft=t=>{Ee.value.has(t)||(h.value=!0,U.value=t)},Nt=()=>{h.value=!1,U.value=null},Ko=t=>{if(k.value||x.value){ne.value.show=!1;return}const n=t.currentTarget.getBoundingClientRect(),c=t.clientX-n.left,v=t.clientY-n.top,f=Be.value?c>=E.value.left-50&&c<=E.value.right+50&&v>=E.value.top-50&&v<=E.value.bottom+100:c>=E.value.left&&c<=E.value.right&&v>=E.value.top&&v<=E.value.bottom;if(hn.value=f,Be.value){if(!ue.value||!f||A.value.isDragging||A.value.isZooming){ne.value.show=!1;return}if(Ho.value.find(I=>!I||I.isHidden?!1:Math.sqrt(Math.pow(I.x-c,2)+Math.pow(I.y-v,2))<=I.radius+3))ne.value.show=!1;else{const I=Ho.value.filter(Z=>!Z||Z.isHidden?!1:Math.sqrt(Math.pow(Z.x-c,2)+Math.pow(Z.y-v,2))<=250);if(I.length>0){let Z=I[0],P=Math.sqrt(Math.pow(Z.x-c,2)+Math.pow(Z.y-v,2));I.forEach(O=>{const W=Math.sqrt(Math.pow(O.x-c,2)+Math.pow(O.y-v,2));W<P&&(P=W,Z=O)});const _=30,ee=Ho.value.filter(O=>!O||O.isHidden?!1:Math.abs(O.x-Z.x)<=_).sort((O,W)=>O.y-W.y);ne.value={show:!0,x:Z.x,categoryIndex:Math.round(Z.originalX),data:(()=>{const O=jo.value,W=vn.value,K=[];return ee.forEach(G=>{O.forEach(de=>{const pe=W[de]||de,ht=tl(de,G);ht&&K.push({seriesName:G.seriesName,label:G.label,value:`${pe}: ${ht}`,color:G.color,y:G.y})})}),K})()}}else ne.value.show=!1}return}if(A.value.isDragging&&A.value.scale>1&&De.value&&Pt.value){ne.value.show=!1;const Y=t.clientX-A.value.lastMouseX,{minX:I,maxX:Z}=he.value,P=Z-I||1,ee=Y*.8;A.value.offsetX+=ee;const O=P/A.value.scale,W=P-O,K=0,G=-W/P*E.value.width,de=K;A.value.offsetX=Math.max(G,Math.min(de,A.value.offsetX)),A.value.lastMouseX=t.clientX,A.value.lastMouseY=t.clientY;return}if(!ue.value||!De.value||A.value.isDragging||A.value.isZooming||!f){ne.value.show=!1;return}const{minX:C,maxX:y}=he.value,b=y-C||1,V=b/A.value.scale,N=C-A.value.offsetX/E.value.width*b,M=(c-E.value.left)/E.value.width,R=N+M*V,q=Math.round(R);if(q>=0&&q<=y){const Y=ge(q),I=uo.value.map((Z,P)=>{const _=D.series.findIndex(O=>O===Z),ee=Z.data[q];return{seriesName:Z.name,value:ee!==void 0?ee:null,color:ye(_),y:ee!==void 0?we(ee):null}}).filter(Z=>Z.value!==null);ne.value={show:!0,x:Y,categoryIndex:q,data:I}}},ze=()=>{ne.value.show=!1,hn.value=!1,x.value=!1,k.value||(Yo.value.show=!1),A.value.isDragging&&(A.value.isDragging=!1),A.value.zoomTimeout&&(clearTimeout(A.value.zoomTimeout),A.value.zoomTimeout=null),A.value.isZooming=!1,setTimeout(()=>{U.value=null,oe.value.show=!1},150)},fe=t=>{if(t.preventDefault(),t.stopPropagation(),!Fe.value)return;const r=t.currentTarget.getBoundingClientRect(),n=t.clientX-r.left,c=t.clientY-r.top;if(vt.value){re.value.show=!1,e.nextTick(()=>{re.value.show=!0,re.value.x=t.clientX,re.value.y=t.clientY,re.value.categoryIndex=null});return}const v=Math.max(0,E.value.left-20),f=E.value.right,C=E.value.top,y=E.value.bottom+80;n>=v&&n<=f&&c>=C&&c<=y&&(re.value.show=!1,e.nextTick(()=>{re.value.show=!0,re.value.x=t.clientX,re.value.y=t.clientY,re.value.categoryIndex=null;const b=Math.max(E.value.left,Math.min(n,E.value.right))-E.value.left,N=E.value.width/xn.value.length,M=Math.floor(b/N);M>=0&&M<xn.value.length&&(re.value.categoryIndex=M)}))},Xt=t=>{if(!(t&&t.button===2)){if(re.value.show&&t&&t.type==="click"){const r=document.querySelector(".dss-context-menu");if(r&&r.contains(t.target))return}re.value.show=!1}},gn=t=>{if(typeof t.template=="function"){const r={series:D.series,categories:D.categories,markers:Me.value},n={chartX:re.value.chartX,chartY:re.value.chartY,dataX:re.value.mouseDataX,dataY:re.value.mouseDataY,categoryIndex:re.value.categoryIndex};return t.template(r,n)}return t.template||t.label||""},Yt=t=>{const r=["dss-context-menu-item"];return t.cssClass&&r.push(t.cssClass),r},dl=t=>t.style||{},yn=t=>t.type&&It.value[t.type]?It.value[t.type]:t.customIcon?t.customIcon:Dt.value,Cn=t=>t==null?"":D.categories&&D.categories[t]?D.categories[t]:"",Go=t=>Me.value.length?Me.value.filter(r=>r.categoryIndex===t):[],ro=t=>{if(!De.value&&!Be.value)return{x:0,y:0};const r=ge(t),n=et.value+E.value.bottom-Ut.value/2;return{x:r,y:n}},In=()=>{Me.value.forEach(t=>{if(t.categoryIndex!==void 0&&(De.value||Be.value)){const r=ro(t.categoryIndex);t.x=r.x,t.y=r.y}})},ml=()=>{if(X.value.description&&X.value.description.length){if(go.value){const t=Me.value.findIndex(r=>r.id===X.value.editingMarkerId);t!==-1?(Me.value[t].description=X.value.description||"",Me.value[t].color=X.value.color||"",Me.value[t].type=X.value.type||"default",zt("update-marker",Me.value[t])):zt("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 r=Math.max(0,X.value.categoryIndex);if(Be.value){const{maxX:C}=he.value;r=Math.max(0,Math.min(r,Math.floor(C)))}else De.value&&(r=Math.max(0,Math.min(r,he.value.maxX)));const n=ge(r),c=et.value+E.value.bottom-Ut.value/2,v=Array.isArray(D.categories)?D.categories[r]:null,f={id:t,title:"",description:X.value.description||"",color:X.value.color||"",type:X.value.type||"default",categoryIndex:r,x:n,y:c,marker_date:v||null};X.value.categoryIndex=r,Me.value.push(f),zt("add-marker",f)}at(),jt()}},at=()=>{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},st=()=>{go.value&&(_n(X.value.editingMarkerId),at())},_n=t=>{const r=Me.value.findIndex(n=>n.id===t);r!==-1&&(Me.value.splice(r,1),jt()),zt("delete-marker",t)},Qe=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},jt=()=>{try{const t=`dss-chart-markers-${D.chartId}`;localStorage.setItem(t,JSON.stringify(Me.value))}catch(t){console.warn("Could not save markers to localStorage:",t)}},pl=()=>{try{const t=`dss-chart-markers-${D.chartId}`,r=localStorage.getItem(t);if(r){const n=JSON.parse(r);Array.isArray(n)&&(Me.value=n.map(c=>({...c,originalYOffset:c.originalYOffset!==void 0?c.originalYOffset:15})))}}catch(t){console.warn("Could not load markers from localStorage:",t),Me.value=[]}},Io=t=>{const r=j.value||"Chart",n=new Date().toLocaleDateString("en-GB",{day:"2-digit",month:"2-digit",year:"2-digit"}).replace(/\//g,"-");return`${r.replace(/[^a-zA-Z0-9\s]/g,"").replace(/\s+/g,"-").substring(0,50).replace(/^-|-$/g,"")||"Chart"}-${n}.${t}`},kn=()=>{const t=ne.value.show,r=oe.value.show;return ne.value.show=!1,oe.value.show=!1,{originalCrosshair:t,originalTooltip:r}},Le=t=>{ne.value.show=t.originalCrosshair,oe.value.show=t.originalTooltip},Rn=async(t,r=32,n=32)=>new Promise((c,v)=>{if(t.startsWith("data:")){c(t);return}const f=new Image;f.crossOrigin="anonymous";const C=setTimeout(()=>{console.warn("Image conversion timeout for:",t),c(t)},5e3);f.onload=()=>{clearTimeout(C);try{const y=document.createElement("canvas"),b=y.getContext("2d");y.width=r,y.height=n,b.fillStyle="#fafafa",b.fillRect(0,0,r,n),b.drawImage(f,0,0,r,n);const V=y.toDataURL("image/png");c(V)}catch(y){console.warn("Canvas conversion failed:",y),c(t)}},f.onerror=y=>{clearTimeout(C),console.warn("Failed to load image:",t,y),c(t)},f.src=t}),Fn=async()=>{try{const t=kn();setTimeout(async()=>{try{const r=document.querySelector(".dss-chart-svg");if(!r){console.error("Chart SVG element not found"),Le(t);return}const n=gt(),c=Ze.value,v=je.value+n.height,f=r.cloneNode(!0);f.querySelectorAll(".dss-flag-markers, .dss-flag-line, .dss-flag-extension-line, .dss-flag-count-indicator, .dss-flag-count-text").forEach(_=>_.remove());const y=f.querySelectorAll("image"),b=Array.from(y).map(async _=>{const ee=_.getAttribute("xlink:href")||_.getAttribute("href");if(ee&&!ee.startsWith("data:"))try{const O=await Rn(ee,32,32);_.setAttribute("xlink:href",O),_.setAttribute("href",O)}catch(O){console.warn("Failed to convert logo to base64:",O)}});await Promise.all(b);const N=new XMLSerializer().serializeToString(f).replace(/<svg[^>]*>/,"").replace("</svg>","");let M="",R=30;if(j.value&&(M+=`
23
+ <text x="24" y="${R}"
24
24
  font-family="Arial, sans-serif"
25
25
  font-size="18"
26
26
  font-weight="bold"
27
27
  fill="#333">
28
- ${J.value.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}
29
- </text>`,p+=30),Q.value&&(m+=`
30
- <text x="24" y="${p}"
28
+ ${j.value.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}
29
+ </text>`,R+=30),xe.value&&(M+=`
30
+ <text x="24" y="${R}"
31
31
  font-family="Arial, sans-serif"
32
32
  font-size="14"
33
33
  fill="#666">
34
- ${Q.value.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}
35
- </text>`,p+=25),ye.value&&N.series.length>0){let x=t-200,E=J.value||Q.value?35:25;const V=Math.floor((t-250)/120);let M=0;N.series.forEach((H,B)=>{if(!re.value.has(B)){const _=me(B),R=H.name.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;");m+=`<circle cx="${x+6}" cy="${E-4}" r="6" fill="${_}"/>`,m+=`<text x="${x+18}" y="${E}" font-family="Arial, sans-serif" font-size="12" fill="#333">${R}</text>`,M++,M%V===0?(x=t-200,E+=20):x+=Math.min(120,R.length*8+35)}})}let g="";if(Ke.value)try{const{width:x,height:E}=mt.value,V=ve.value,M=k.value.left,H=k.value.right,B=k.value.top,_=k.value.bottom,R=k.value.width,q=k.value.height;let G,Me;switch(V){case"center":G=M+(R-x)/2,Me=B+(q-E)/2;break;case"top-left":G=M+15,Me=B+5;break;case"top-right":G=H-x-5,Me=B+5;break;case"bottom-left":G=M+15,Me=_-E-5;break;case"bottom-right":default:G=H-x-5,Me=_-E-5;break}g=`
36
- <g opacity="${Ge.value}">
37
- <g transform="translate(${G}, ${Me}) scale(${x/499})">
34
+ ${xe.value.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}
35
+ </text>`,R+=25),Ce.value&&D.series.length>0){let _=c-200,ee=j.value||xe.value?35:25;const O=Math.floor((c-250)/120);let W=0;D.series.forEach((K,G)=>{if(!Ee.value.has(G)){const de=ye(G),pe=K.name.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;");M+=`<circle cx="${_+6}" cy="${ee-4}" r="6" fill="${de}"/>`,M+=`<text x="${_+18}" y="${ee}" font-family="Arial, sans-serif" font-size="12" fill="#333">${pe}</text>`,W++,W%O===0?(_=c-200,ee+=20):_+=Math.min(120,pe.length*8+35)}})}let q="";if(Vt.value)try{const{width:_,height:ee}=dn.value,O=un.value,W=E.value.left,K=E.value.right,G=E.value.top,de=E.value.bottom,pe=E.value.width,ht=E.value.height;let Ge,fo;switch(O){case"center":Ge=W+(pe-_)/2,fo=G+(ht-ee)/2;break;case"top-left":Ge=W+15,fo=G+5;break;case"top-right":Ge=K-_-5,fo=G+5;break;case"bottom-left":Ge=W+15,fo=de-ee-5;break;case"bottom-right":default:Ge=K-_-5,fo=de-ee-5;break}q=`
36
+ <g opacity="${cn.value}">
37
+ <g transform="translate(${Ge}, ${fo}) scale(${_/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),g=""}const h=`<?xml version="1.0" encoding="UTF-8"?>
53
- <svg width="${t}" height="${o}"
52
+ </g>`}catch(_){console.warn("Watermark processing failed, skipping watermark in SVG:",_),q=""}const Y=`<?xml version="1.0" encoding="UTF-8"?>
53
+ <svg width="${c}" height="${v}"
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
- ${m}
65
- <g transform="translate(0, ${s.height})">
66
- ${d}
67
- ${g}
64
+ ${M}
65
+ <g transform="translate(0, ${n.height})">
66
+ ${N}
67
+ ${q}
68
68
  </g>
69
- </svg>`,f=new Blob([h],{type:"image/svg+xml;charset=utf-8"}),C=URL.createObjectURL(f),y=document.createElement("a");y.href=C,y.download=no("svg"),document.body.appendChild(y),y.click(),document.body.removeChild(y),URL.revokeObjectURL(C),Wt(l),Re()}catch(u){console.error("Error downloading SVG:",u),Wt(l)}},50)}catch(l){console.error("Error downloading SVG:",l)}},To=async()=>{try{const l=st();document.querySelector(".dss-custom-chart-container").offsetHeight,await new Promise(x=>setTimeout(x,300));const u=De(),s=D.value,t=W.value+u.height,o=document.createElement("canvas"),n=o.getContext("2d"),a=2;o.width=s*a,o.height=t*a,o.style.width=s+"px",o.style.height=t+"px",n.scale(a,a),n.fillStyle="#fafafa",n.fillRect(0,0,s,t);let r=30;if(J.value&&(n.fillStyle="#333",n.font="bold 18px Arial, sans-serif",n.fillText(J.value,24,r),r+=30),Q.value&&(n.fillStyle="#666",n.font="14px Arial, sans-serif",n.fillText(Q.value,24,r),r+=25),ye.value&&N.series.length>0){let x=s-200,E=J.value||Q.value?35:25;const V=Math.floor((s-250)/120);let M=0;n.font="12px Arial, sans-serif",N.series.forEach((H,B)=>{if(!re.value.has(B)){const _=me(B);n.beginPath(),n.arc(x+6,E-4,6,0,2*Math.PI),n.fillStyle=_,n.fill(),n.fillStyle="#333",n.fillText(H.name,x+18,E),M++,M%V===0?(x=s-200,E+=20):x+=Math.min(120,H.name.length*8+35)}})}const i=document.querySelector(".dss-chart-svg").cloneNode(!0),d=i.querySelectorAll(".dss-flag-markers, .dss-flag-line, .dss-flag-extension-line, .dss-flag-count-indicator, .dss-flag-count-text"),m=i.querySelectorAll(".dss-crosshair"),p=i.querySelectorAll('[class*="tooltip"]');d.forEach(x=>x.remove()),m.forEach(x=>x.remove()),p.forEach(x=>x.remove()),i.querySelectorAll("image").forEach((x,E)=>{const V=x.getAttribute("xlink:href")||x.getAttribute("href");if(V&&!V.startsWith("data:")){const M=Do.value[E],H=M?me(M.seriesIndex):"#3B82F6",B=x.getAttribute("x")||0,_=x.getAttribute("y")||0,R=x.getAttribute("width")||32,q=x.getAttribute("height")||32,G=document.createElementNS("http://www.w3.org/2000/svg","circle");G.setAttribute("cx",parseFloat(B)+parseFloat(R)/2),G.setAttribute("cy",parseFloat(_)+parseFloat(q)/2),G.setAttribute("r",Math.min(parseFloat(R),parseFloat(q))/2-1),G.setAttribute("fill",H),G.setAttribute("stroke","#fafafa"),G.setAttribute("stroke-width","2"),x.parentNode.replaceChild(G,x)}});const h=new XMLSerializer().serializeToString(i),f=new Blob([h],{type:"image/svg+xml;charset=utf-8"}),C=URL.createObjectURL(f),y=new Image;return new Promise((x,E)=>{y.onload=async()=>{try{if(n.drawImage(y,0,u.height),Do.value.forEach(V=>{const M=V.x,H=V.y+u.height,B=(V.width||32)/2,_=me(V.seriesIndex);n.save(),n.beginPath(),n.arc(M,H,B-1,0,2*Math.PI),n.fillStyle=_,n.fill(),n.strokeStyle="#fafafa",n.lineWidth=2,n.stroke(),n.restore()}),Ke.value){const V=new Image,M=()=>{const{width:B,height:_}=mt.value,R=ve.value,q=k.value.left,G=k.value.right,Me=k.value.top,yt=k.value.bottom,En=k.value.width,bn=k.value.height;let po,jt;switch(R){case"center":po=q+(En-B)/2,jt=Me+u.height+(bn-_)/2;break;case"top-left":po=q+15,jt=Me+u.height+10;break;case"top-right":po=G-B-5,jt=Me+u.height+10;break;case"bottom-left":po=q+15,jt=yt+u.height-_-5;break;case"bottom-right":default:po=G-B-5,jt=yt+u.height-_-5;break}n.globalAlpha=Ge.value,n.drawImage(V,po,jt,B,_),n.globalAlpha=1,H()},H=()=>{o.toBlob(B=>{const _=URL.createObjectURL(B),R=document.createElement("a");R.href=_,R.download=no("png"),document.body.appendChild(R),R.click(),document.body.removeChild(R),URL.revokeObjectURL(_),URL.revokeObjectURL(C),Wt(l),Re(),x()},"image/png")};V.onload=M,V.onerror=H,V.src=to.value}else o.toBlob(V=>{const M=URL.createObjectURL(V),H=document.createElement("a");H.href=M,H.download=no("png"),document.body.appendChild(H),H.click(),document.body.removeChild(H),URL.revokeObjectURL(M),URL.revokeObjectURL(C),Wt(l),Re(),x()},"image/png")}catch(V){URL.revokeObjectURL(C),Wt(l),E(V)}},y.onerror=()=>{URL.revokeObjectURL(C),Wt(l),E(new Error("Failed to load SVG image"))},y.src=C})}catch(l){console.error("Error downloading PNG:",l)}},Bt=()=>{try{let l="";J.value&&(l+=`# ${F("chart.csv.chartTitle")}: ${J.value}
70
- `),Q.value&&(l+=`# ${F("chart.csv.chartSubtitle")}: ${Q.value}
71
- `),l+=`# ${F("chart.csv.generated")}: ${new Date().toLocaleString()}
69
+ </svg>`,I=new Blob([Y],{type:"image/svg+xml;charset=utf-8"}),Z=URL.createObjectURL(I),P=document.createElement("a");P.href=Z,P.download=Io("svg"),document.body.appendChild(P),P.click(),document.body.removeChild(P),URL.revokeObjectURL(Z),Le(t),Xt()}catch(r){console.error("Error downloading SVG:",r),Le(t)}},50)}catch(t){console.error("Error downloading SVG:",t)}},zn=async()=>{try{const t=kn();document.querySelector(".dss-custom-chart-container").offsetHeight,await new Promise(_=>setTimeout(_,300));const r=gt(),n=Ze.value,c=je.value+r.height,v=document.createElement("canvas"),f=v.getContext("2d"),C=2;v.width=n*C,v.height=c*C,v.style.width=n+"px",v.style.height=c+"px",f.scale(C,C),f.fillStyle="#fafafa",f.fillRect(0,0,n,c);let y=30;if(j.value&&(f.fillStyle="#333",f.font="bold 18px Arial, sans-serif",f.fillText(j.value,24,y),y+=30),xe.value&&(f.fillStyle="#666",f.font="14px Arial, sans-serif",f.fillText(xe.value,24,y),y+=25),Ce.value&&D.series.length>0){let _=n-200,ee=j.value||xe.value?35:25;const O=Math.floor((n-250)/120);let W=0;f.font="12px Arial, sans-serif",D.series.forEach((K,G)=>{if(!Ee.value.has(G)){const de=ye(G);f.beginPath(),f.arc(_+6,ee-4,6,0,2*Math.PI),f.fillStyle=de,f.fill(),f.fillStyle="#333",f.fillText(K.name,_+18,ee),W++,W%O===0?(_=n-200,ee+=20):_+=Math.min(120,K.name.length*8+35)}})}const V=document.querySelector(".dss-chart-svg").cloneNode(!0),N=V.querySelectorAll(".dss-flag-markers, .dss-flag-line, .dss-flag-extension-line, .dss-flag-count-indicator, .dss-flag-count-text"),M=V.querySelectorAll(".dss-crosshair"),R=V.querySelectorAll('[class*="tooltip"]');N.forEach(_=>_.remove()),M.forEach(_=>_.remove()),R.forEach(_=>_.remove()),V.querySelectorAll("image").forEach((_,ee)=>{const O=_.getAttribute("xlink:href")||_.getAttribute("href");if(O&&!O.startsWith("data:")){const W=s.value[ee],K=W?ye(W.seriesIndex):"#3B82F6",G=_.getAttribute("x")||0,de=_.getAttribute("y")||0,pe=_.getAttribute("width")||32,ht=_.getAttribute("height")||32,Ge=document.createElementNS("http://www.w3.org/2000/svg","circle");Ge.setAttribute("cx",parseFloat(G)+parseFloat(pe)/2),Ge.setAttribute("cy",parseFloat(de)+parseFloat(ht)/2),Ge.setAttribute("r",Math.min(parseFloat(pe),parseFloat(ht))/2-1),Ge.setAttribute("fill",K),Ge.setAttribute("stroke","#fafafa"),Ge.setAttribute("stroke-width","2"),_.parentNode.replaceChild(Ge,_)}});const Y=new XMLSerializer().serializeToString(V),I=new Blob([Y],{type:"image/svg+xml;charset=utf-8"}),Z=URL.createObjectURL(I),P=new Image;return new Promise((_,ee)=>{P.onload=async()=>{try{if(f.drawImage(P,0,r.height),s.value.forEach(O=>{const W=O.x,K=O.y+r.height,G=(O.width||32)/2,de=ye(O.seriesIndex);f.save(),f.beginPath(),f.arc(W,K,G-1,0,2*Math.PI),f.fillStyle=de,f.fill(),f.strokeStyle="#fafafa",f.lineWidth=2,f.stroke(),f.restore()}),Vt.value){const O=new Image,W=()=>{const{width:G,height:de}=dn.value,pe=un.value,ht=E.value.left,Ge=E.value.right,fo=E.value.top,Ml=E.value.bottom,Bl=E.value.width,Tl=E.value.height;let an,sn;switch(pe){case"center":an=ht+(Bl-G)/2,sn=fo+r.height+(Tl-de)/2;break;case"top-left":an=ht+15,sn=fo+r.height+10;break;case"top-right":an=Ge-G-5,sn=fo+r.height+10;break;case"bottom-left":an=ht+15,sn=Ml+r.height-de-5;break;case"bottom-right":default:an=Ge-G-5,sn=Ml+r.height-de-5;break}f.globalAlpha=cn.value,f.drawImage(O,an,sn,G,de),f.globalAlpha=1,K()},K=()=>{v.toBlob(G=>{const de=URL.createObjectURL(G),pe=document.createElement("a");pe.href=de,pe.download=Io("png"),document.body.appendChild(pe),pe.click(),document.body.removeChild(pe),URL.revokeObjectURL(de),URL.revokeObjectURL(Z),Le(t),Xt(),_()},"image/png")};O.onload=W,O.onerror=K,O.src=mn.value}else v.toBlob(O=>{const W=URL.createObjectURL(O),K=document.createElement("a");K.href=W,K.download=Io("png"),document.body.appendChild(K),K.click(),document.body.removeChild(K),URL.revokeObjectURL(W),URL.revokeObjectURL(Z),Le(t),Xt(),_()},"image/png")}catch(O){URL.revokeObjectURL(Z),Le(t),ee(O)}},P.onerror=()=>{URL.revokeObjectURL(Z),Le(t),ee(new Error("Failed to load SVG image"))},P.src=Z})}catch(t){console.error("Error downloading PNG:",t)}},Pn=()=>{try{let t="";j.value&&(t+=`# ${J("chart.csv.chartTitle")}: ${j.value}
70
+ `),xe.value&&(t+=`# ${J("chart.csv.chartSubtitle")}: ${xe.value}
71
+ `),t+=`# ${J("chart.csv.generated")}: ${new Date().toLocaleString()}
72
72
 
73
- `,l+="Category",N.series.forEach(n=>{const a=n.name.replace(/"/g,'""');l+=',"'+a+'"'}),l+=`
74
- `;const u=Math.max(...N.series.map(n=>n.data?.length||0));for(let n=0;n<u;n++){let c='"'+(N.categories[n]||F("chart.fallback.item",{number:n+1})).toString().replace(/"/g,'""')+'"';N.series.forEach(i=>{const d=i.data&&i.data[n]!==void 0?i.data[n]:"";c+=","+d}),l+=c+`
75
- `}const s=new Blob([l],{type:"text/csv;charset=utf-8;"}),t=URL.createObjectURL(s),o=document.createElement("a");o.href=t,o.download=no("csv"),document.body.appendChild(o),o.click(),document.body.removeChild(o),URL.revokeObjectURL(t),Re()}catch(l){console.error("Error downloading CSV:",l)}},_n=l=>{if(typeof l.action=="function"){const u={series:N.series,categories:N.categories,markers:ge.value},s={chartX:oe.value.chartX,chartY:oe.value.chartY,dataX:oe.value.mouseDataX,dataY:oe.value.mouseDataY,categoryIndex:clampedCategoryIndex||oe.value.categoryIndex};l.action(u,s)}Re()},In=()=>{be(),$.value.show=!0,$.value.categoryIndex=oe.value.categoryIndex,$.value.fromButton=!1,Re()},Tt=()=>{be(),$.value.show=!0,$.value.categoryIndex=0,$.value.fromButton=!0},$e=l=>{if(oe.value.show){const u=document.querySelector(".dss-context-menu");u&&!u.contains(l.target)&&(oe.value.show=!1)}},Ho=l=>{oe.value.show&&!l.target.closest(".context-menu")&&(oe.value.show=!1)},Ve=l=>{if(!Se.value||!Pe.value)return;l.preventDefault(),l.stopPropagation(),S.value.isZooming=!0,I.value.show=!1,S.value.zoomTimeout&&clearTimeout(S.value.zoomTimeout);const s=l.currentTarget.getBoundingClientRect(),t=l.clientX-s.left,o=l.clientY-s.top;if(t<k.value.left-50||t>k.value.right+50||o<k.value.top-50||o>k.value.bottom+100){S.value.isZooming=!1;return}const n=l.deltaY>0?.9:1.1,a=Math.max(S.value.minScale,Math.min(S.value.maxScale,S.value.scale*n));if(a!==S.value.scale){const{minX:r,maxX:c}=ue.value,i=c-r||1,d=i/S.value.scale,m=r-S.value.offsetX/k.value.width*i,p=(t-k.value.left)/k.value.width,g=m+p*d;S.value.scale=a;const h=i/S.value.scale,f=g-p*h;S.value.offsetX=-(f-r)/i*k.value.width,S.value.scale<=1.01&&(S.value.scale=1,S.value.offsetX=0)}S.value.zoomTimeout=setTimeout(()=>{S.value.isZooming=!1,S.value.zoomTimeout=null},300)},Ht=l=>{if(!Se.value||!Pe.value||S.value.scale<=1)return;I.value.show=!1;const s=l.currentTarget.getBoundingClientRect();l.clientX-s.left,l.clientY-s.top,S.value.isDragging=!0,S.value.lastMouseX=l.clientX,S.value.lastMouseY=l.clientY,l.preventDefault()},Rn=()=>{S.value.isDragging=!1},Ao=()=>{!Se.value||!Pe.value||(S.value.scale=1,S.value.offsetX=0,S.value.isDragging=!1,S.value.zoomTimeout&&(clearTimeout(S.value.zoomTimeout),S.value.zoomTimeout=null),S.value.isZooming=!1)},rn=()=>!Se.value||!No.value||!Pe.value?"default":S.value.isDragging?"grabbing":S.value.scale>1?"grab":"dss-crosshair",He=l=>{if(l.length<2)return"";if(l.length===2)return`M ${l[0].x} ${l[0].y} L ${l[1].x} ${l[1].y}`;let u=`M ${l[0].x} ${l[0].y}`;for(let s=0;s<l.length-1;s++){const t=l[Math.max(s-1,0)],o=l[s],n=l[s+1],a=l[Math.min(s+2,l.length-1)],r=o.x+(n.x-t.x)/6*Et.value,c=o.y+(n.y-t.y)/6*Et.value,i=n.x-(a.x-o.x)/6*Et.value,d=n.y-(a.y-o.y)/6*Et.value;u+=` C ${r} ${c} ${i} ${d} ${n.x} ${n.y}`}return u},vt=e.computed(()=>{let u=50+(tt.value?30:0)+60;if(Ce.value)return{left:90,top:90,right:90,bottom:90};if(At.value){let a=0;J.value&&(a+=15),Q.value&&(a+=10);const r=De();let c=66,i=50;return ye.value&&Be.value==="left"?c+=r.legendWidth||150:ye.value&&Be.value==="right"&&(i+=r.legendWidth||150),{left:c,top:50+a,right:i,bottom:130}}let s=0;J.value&&(s+=15),Q.value&&(s+=10);const t=De();let o=66,n=50;return ye.value&&Be.value==="left"?o+=t.legendWidth||150:ye.value&&Be.value==="right"&&(n+=t.legendWidth||150),ye.value&&Be.value==="bottom"&&(u+=t.legendHeight||0),{left:o,top:50+s,right:n,bottom:u}}),k=e.computed(()=>({left:vt.value.left,top:vt.value.top,right:D.value-vt.value.right,bottom:W.value-vt.value.bottom,width:D.value-(vt.value.left+vt.value.right),height:W.value-(vt.value.top+vt.value.bottom)})),Se=e.computed(()=>["line","area","bar"].includes(P.value)||et.value),qe=e.computed(()=>et.value),At=e.computed(()=>["radial","semi-radial"].includes(P.value)),Ce=e.computed(()=>P.value==="spider"),ke=e.computed(()=>P.value==="bubble"),Ae=e.computed(()=>T.value?.chart?.orientation==="horizontal"&&(P.value==="bar"||qe.value)),ce=l=>{const{minY:u,maxY:s}=ue.value,t=s-u||1;return k.value.left+(l-u)/t*k.value.width},Fe=l=>{const{maxX:u}=ue.value,s=u+1,o=k.value.height/s;return k.value.top+(l+.5)*o},ie=e.computed(()=>D.value/2),ne=e.computed(()=>Ce.value?W.value/2-40:W.value/2),Z=e.computed(()=>{if(Ce.value){const l=k.value.width-80,u=k.value.height-80;return Math.min(l,u)/2}return Math.min(k.value.width,k.value.height)/2}),Ee=e.computed(()=>Z.value*.45),rt=e.computed(()=>T.value?.bubbles?.minSize||8),ze=e.computed(()=>T.value?.bubbles?.maxSize||50),Lo=e.computed(()=>T.value?.bubbles?.opacity||.7),lo=(l,u)=>{const s=[15,20,25,18,22],t=s[l%s.length]||20,o=1+Math.sin(u*.5)*.2;return Math.max(5,t*o)},Fn=l=>{const u=document.querySelector(`.dss-bubble-image-${l}`);u&&(u.style.opacity="1")},cn=l=>{const u=document.querySelector(`.dss-bubble-image-${l}`);u&&(u.style.display="none")},it=e.computed(()=>N.series),qt=e.computed(()=>N.series.filter((l,u)=>!re.value.has(u))),Lt="auto",ue=e.computed(()=>{if(ke.value)return zn();if(!qt.value.length)return{minX:0,maxX:1,minY:0,maxY:1};let l=1/0,u=-1/0,s=0;qt.value.forEach(r=>{r.data&&r.data.length&&(s=Math.max(s,r.data.length-1),r.data.forEach(c=>{typeof c=="number"&&(l=Math.min(l,c),u=Math.max(u,c))}))}),N.categories.length>0&&(s=Math.max(s,N.categories.length-1)),l===1/0&&(l=0,u=100);const t=de.value,o=xt.value;let n,a;if(t===Lt){const r=u-l,c=r>0?r*.1:1;n=Math.max(0,l-c)}else if(typeof t=="number")n=t;else{const r=u-l,c=r>0?r*.1:1;n=Math.max(0,l-c)}if(o===Lt){const r=u-l,c=r>0?r*.1:2;a=u+c}else if(typeof o=="number")a=o;else{const r=u-l,c=r>0?r*.1:2;a=u+c}return{minX:0,maxX:s,minY:n,maxY:a}}),zn=()=>{if(!qt.value.length)return{minX:0,maxX:8,minY:0,maxY:50,minSize:10,maxSize:30};let l=1/0,u=-1/0,s=1/0,t=-1/0,o=1/0,n=-1/0,a=!1;if(qt.value.forEach((g,h)=>{g?.data?.length&&g.data.forEach((f,C)=>{let y,x,E;if(typeof f=="object"&&f!==null&&!Array.isArray(f))y=typeof f.x=="number"?f.x:C,x=typeof f.y=="number"?f.y:0,E=typeof f.size=="number"?f.size:20;else if(Array.isArray(f)&&f.length>=3)y=typeof f[0]=="number"?f[0]:C,x=typeof f[1]=="number"?f[1]:0,E=typeof f[2]=="number"?f[2]:20;else if(typeof f=="number")y=C,x=f,E=lo(h,C);else return;isFinite(y)&&isFinite(x)&&isFinite(E)&&(l=Math.min(l,y),u=Math.max(u,y),s=Math.min(s,x),t=Math.max(t,x),o=Math.min(o,E),n=Math.max(n,E),a=!0)})}),!a)return{minX:0,maxX:8,minY:0,maxY:50,minSize:10,maxSize:30};l===u&&(l=Math.min(l,0),u=Math.max(u,N.categories?.length-1||8)),s===t&&(s=Math.max(0,s-10),t=s+20);const r=u-l,c=t-s;let i,d,m,p;return Ot.value!==null?i=Ot.value:i=l-r*.1,Jt.value!==null?d=Jt.value:d=u+r*.1,de.value!==null&&typeof de.value=="number"?m=de.value:m=Math.max(0,s-c*.1),xt.value!==null&&typeof xt.value=="number"?p=xt.value:p=t+c*.1,{minX:i,maxX:d,minY:m,maxY:p,minSize:o,maxSize:n}},he=l=>{if(ke.value){const{minX:r,maxX:c}=ue.value,i=c-r||1;return k.value.left+(l-r)/i*k.value.width}const{minX:u,maxX:s}=ue.value,t=s-u;if(s===0||t===0)return k.value.left+k.value.width/2;const o=t/S.value.scale,n=u-S.value.offsetX/k.value.width*t,a=(l-n)/o;return k.value.left+a*k.value.width},Ne=l=>{const{minY:u,maxY:s}=ue.value,t=s-u||1;return k.value.bottom-(l-u)/t*k.value.height},qo=l=>{if(!ke.value)return se.value||4;const{minSize:u,maxSize:s}=ue.value,t=s-u||1;if(t===0)return(rt.value+ze.value)/2;const o=(l-u)/t;return rt.value+o*(ze.value-rt.value)},dn=e.computed(()=>Yo.value.map(l=>({y:l.y}))),Xo=e.computed(()=>{if(ke.value)return On();if(P.value==="bar"){if(Ae.value){const V=[],{minY:M,maxY:H}=ue.value,B=5,_=H-M||1;for(let R=0;R<=B;R++){const q=M+_*(R/B),G=ce(q);V.push({x:G,y:k.value.bottom+20,text:Math.round(q).toString()})}return V}const h=[],{maxX:f}=ue.value,C=f+1,y=5,E=(k.value.width-y*2)/C;for(let V=0;V<=f;V++){const M=k.value.left+y+(V+.5)*E;h.push({x:M,y:k.value.bottom+20,text:N.categories[V]||F("chart.fallback.item",{number:V+1})})}return h}const l=[],{minX:u,maxX:s}=ue.value,t=s-u||1,o=t/S.value.scale,n=u-S.value.offsetX/k.value.width*t,a=n+o,r=Math.max(0,Math.floor(n-2)),c=Math.min(s,Math.ceil(a+2)),i=c-r,d=k.value.width,p=Math.floor(d/60);let g=1;i>p&&(g=Math.ceil(i/p));for(let h=r;h<=c;h+=g)if(h>=0&&h<=s){const f=he(h);f>=k.value.left-100&&f<=k.value.right+100&&l.push({x:f,y:k.value.bottom+20,text:N.categories[h]||`Item ${h+1}`})}return l}),On=()=>{const l=[],{minX:u,maxX:s}=ue.value,t=s-u||1,o=Math.min(8,Math.max(4,Math.floor(k.value.width/80)));for(let n=0;n<=o;n++){const a=u+t*n/o,r=he(a);if(r>=k.value.left-10&&r<=k.value.right+10){const c=Math.round(a),i=N.categories?.[c];l.push({x:r,y:k.value.bottom+20,text:i||(Number.isInteger(a)?a.toString():a.toFixed(1))})}}return l},Yo=e.computed(()=>{if(Ae.value){const o=[],{maxX:n}=ue.value;for(let a=0;a<=n;a++)o.push({x:k.value.left-10,y:Fe(a),text:N.categories[a]||`Item ${a+1}`});return o}const l=[],{minY:u,maxY:s}=ue.value,t=5;for(let o=0;o<=t;o++){const n=u+(s-u)*(o/t),a=Math.round(n);l.push({x:k.value.left-10,y:Ne(n),text:a.toString()})}return l}),me=l=>{const u=Qt.value;if(!u||u.length===0){const s=["#3B82F6","#EF4444","#10B981","#F59E0B","#8B5CF6","#F97316","#06B6D4","#84CC16"];return s[l%s.length]}return u[l%u.length]},$o=l=>{let u=0;for(let s=1;s<l.length;s++){const t=l[s].x-l[s-1].x,o=l[s].y-l[s-1].y;u+=Math.sqrt(t*t+o*o)}return u},un=e.computed(()=>P.value==="line"||qe.value?(qe.value?N.series.filter(u=>(u.type||P.value)==="line"):it.value).map((u,s)=>{const t=N.series.findIndex(m=>m===u),o=[];let n=[];u.data.forEach((m,p)=>{m==null?n.length>0&&(o.push([...n]),n=[]):n.push({x:Ae.value?ce(m):he(p),y:Ae.value?Fe(p):Ne(m),index:p})}),n.length>0&&o.push(n);let a="";o.forEach(m=>{if(m.length>0){let p="";Y.value?p=He(m):p=`M ${m[0].x} ${m[0].y}`+m.slice(1).map(g=>` L ${g.x} ${g.y}`).join(""),a+=(a?" ":"")+p}});const r=o.reduce((m,p)=>m+$o(p),0),c=re.value.has(t),i=L.value===t,d=L.value!==null&&L.value!==t;return{path:a,color:me(t),pathLength:r,seriesIndex:t,animationDelay:s*xe.value,isHighlighted:i,isDimmed:d,isHidden:c}}):[]),mn=e.computed(()=>{if(!(P.value==="line"||qe.value))return[];const l=qe.value?N.series.filter(s=>(s.type||P.value)==="line"):it.value,u=[];return l.forEach((s,t)=>{const o=N.series.findIndex(n=>n===s);for(let n=0;n<s.data.length-1;n++){const a=s.data[n];if(a!=null){let r=-1,c=0;for(let i=n+1;i<s.data.length;i++){const d=s.data[i];if(d==null)c++;else{r=i;break}}if(c>0&&r!==-1){const i=s.data[r],d=Ae.value?ce(a):he(n),m=Ae.value?Fe(n):Ne(a),p=Ae.value?ce(i):he(r),g=Ae.value?Fe(r):Ne(i),h=re.value.has(o),f=L.value===o,C=L.value!==null&&L.value!==o;u.push({path:`M ${d} ${m} L ${p} ${g}`,color:me(o),seriesIndex:o,animationDelay:t*xe.value,isHighlighted:f,isDimmed:C,isHidden:h,gapSize:c}),n=r-1}}}}),u}),Pn=e.computed(()=>P.value==="line"||qe.value?!Pt.value||Rt.value||U.value.hasAnimated?[]:(qe.value?N.series.filter(u=>(u.type||P.value)==="line"):it.value).map((u,s)=>{const t=N.series.findIndex(c=>c===u);let o="",n=null;u.data.forEach((c,i)=>{if(c!=null){const d={x:Ae.value?ce(c):he(i),y:Ae.value?Fe(i):Ne(c)};n===null?o+=`M ${d.x} ${d.y}`:o+=` L ${d.x} ${d.y}`,n=d}else if(n!==null){const d=u.data.findIndex((m,p)=>p>i&&m!==null&&m!==void 0);if(d!==-1){const m={x:Ae.value?ce(u.data[d]):he(d),y:Ae.value?Fe(d):Ne(u.data[d])};o+=` L ${m.x} ${m.y}`,n=m}}});const a=u.data.map((c,i)=>c==null?null:{x:Ae.value?ce(c):he(i),y:Ae.value?Fe(i):Ne(c)}).filter(c=>c!==null),r=$o(a);return{path:o,pathLength:r,color:me(t),animationDelay:s*xe.value,seriesIndex:t}}):[]),pn=e.computed(()=>{if(P.value!=="line")return[];const l=[];return it.value.forEach((u,s)=>{const t=L.value===s,o=L.value!==null&&L.value!==s,n=re.value.has(s);u.data.forEach((a,r)=>{a!=null&&l.push({x:he(r),y:Ne(a),color:me(s),value:a,label:N.categories[r]||r.toString(),seriesName:u.name,categoryIndex:r,dataIndex:r,animationDelay:(s*u.data.length+r)*(xe.value/8),isHighlighted:t,isDimmed:o,isHidden:n})})}),l}),ao=e.computed(()=>{if(!qe.value)return[];const l=[];return N.series.filter(s=>(s.type||P.value)==="line").forEach((s,t)=>{const o=N.series.findIndex(c=>c===s),n=L.value===o,a=L.value!==null&&L.value!==o,r=re.value.has(o);s.data.forEach((c,i)=>{c!=null&&l.push({x:he(i),y:Ne(c),color:me(o),value:c,label:N.categories[i]||i.toString(),seriesName:s.name,categoryIndex:i,dataIndex:i,animationDelay:(t*s.data.length+i)*(xe.value/8),isHighlighted:n,isDimmed:a,isHidden:r})})}),l}),Xt=e.computed(()=>{if(!ke.value)return[];const l=[];return it.value.forEach((u,s)=>{if(!u?.data?.length)return;const t=L.value,o=t!==null&&t===s,n=t!==null&&t!==s,a=re.value.has(s);u.data.forEach((r,c)=>{let i,d,m,p,g;if(typeof r=="object"&&r!==null&&!Array.isArray(r))i=typeof r.x=="number"?r.x:c,d=typeof r.y=="number"?r.y:0,m=typeof r.size=="number"?r.size:20,p=r.label||N.categories?.[c]||`Point ${c+1}`,g=r.image||r.imageUrl;else if(Array.isArray(r)&&r.length>=3)i=typeof r[0]=="number"?r[0]:c,d=typeof r[1]=="number"?r[1]:0,m=typeof r[2]=="number"?r[2]:20,p=r[3]||N.categories?.[c]||`Point ${c+1}`,g=r[4];else if(typeof r=="number")i=c,d=r,m=lo(s,c),p=N.categories?.[c]||`Point ${c+1}`;else return;!isFinite(i)||!isFinite(d)||!isFinite(m)||l.push({x:he(i),y:Ne(d),radius:qo(m),originalX:i,originalY:d,originalSize:m,color:me(s),seriesName:u.name||`Series ${s+1}`,label:p,imageUrl:g,seriesIndex:s,dataIndex:c,categoryIndex:Math.round(i),isHighlighted:o,isDimmed:n,isHidden:a,opacity:Lo.value})})}),l}),so=e.computed(()=>P.value!=="area"?[]:it.value.map((l,u)=>{const s=[];let t=[];if(l.data.forEach((m,p)=>{m==null?t.length>0&&(s.push([...t]),t=[]):t.push({x:he(p),y:Ne(m),index:p})}),t.length>0&&s.push(t),s.length===0)return{linePath:"",areaPath:"",color:me(u),isHidden:re.value.has(u)};const o=k.value.bottom+1;let n="",a="";s.forEach((m,p)=>{if(m.length===0)return;let g=`M ${m[0].x} ${m[0].y}`;Y.value&&m.length>1?g=He(m):m.slice(1).forEach(f=>{g+=` L ${f.x} ${f.y}`}),n+=(n?" ":"")+g;let h=`M ${m[0].x} ${o}`;if(h+=` L ${m[0].x} ${m[0].y}`,Y.value&&m.length>1){const f=He(m),C=f.substring(f.indexOf("C")||f.indexOf("Q")||f.indexOf("L"));C?h+=" "+C:m.slice(1).forEach(y=>{h+=` L ${y.x} ${y.y}`})}else m.slice(1).forEach(f=>{h+=` L ${f.x} ${f.y}`});h+=` L ${m[m.length-1].x} ${o} Z`,a+=(a?" ":"")+h});const r=L.value===u,c=L.value!==null&&L.value!==u,i=re.value.has(u),d=s.reduce((m,p)=>m+$o(p),0);return{linePath:n,areaPath:a,color:me(u),pathLength:d,isHighlighted:r,isDimmed:c,isHidden:i}})),fn=e.computed(()=>{if(!(["bar"].includes(P.value)||qe.value))return[];const l=[],{maxX:u}=ue.value,s=qe.value?N.series.filter(o=>(o.type||P.value)==="bar"):it.value,t=s.length;if(Ae.value){const o=u+1,a=k.value.height/o,r=a*(2/3),c=r/t,i=c*.02,d=t===o?Math.max(12,r-i*t):Math.max(12,c-i);s.forEach((m,p)=>{const g=N.series.findIndex(y=>y===m),h=L.value===g,f=L.value!==null&&L.value!==g,C=re.value.has(g);m.data.forEach((y,x)=>{if(y==null||typeof y!="number"||!isFinite(y))return;const M=k.value.top+(x+.5)*a-r/2+p*c+i/2,H=k.value.left,B=Math.abs(ce(y)-k.value.left);let _="";if(Y.value&&B>0){const R=Math.min(ho.value,d/2,B/2);_=[`M ${H} ${M}`,`L ${H+B-R} ${M}`,`Q ${H+B} ${M} ${H+B} ${M+R}`,`L ${H+B} ${M+d-R}`,`Q ${H+B} ${M+d} ${H+B-R} ${M+d}`,`L ${H} ${M+d}`,"Z"].join(" ")}l.push({x:H,y:M,width:B,height:d,color:me(g),value:y,label:N.categories[x]||x.toString(),seriesName:m.name,animationDelay:(p*s.length+x)*(xe.value/4),isHighlighted:h,isDimmed:f,isHidden:C,barPath:_,isSmooth:Y.value&&B>0})})})}else{const o=u+1,a=k.value.width/o,r=a*.8,c=r/t,i=c*.05,d=c-i;s.forEach((m,p)=>{const g=N.series.findIndex(y=>y===m),h=L.value===g,f=L.value!==null&&L.value!==g,C=re.value.has(g);m.data.forEach((y,x)=>{if(y==null||typeof y!="number"||!isFinite(y))return;const M=k.value.left+(x+.5)*a-r/2+p*c+i/2,H=Ne(Math.max(0,y)),B=Math.abs(Ne(0)-Ne(y));let _="";if(Y.value&&B>0){const R=Math.min(ho.value,d/2,B/2);_=[`M ${M} ${H+B}`,`L ${M} ${H+R}`,`Q ${M} ${H} ${M+R} ${H}`,`L ${M+d-R} ${H}`,`Q ${M+d} ${H} ${M+d} ${H+R}`,`L ${M+d} ${H+B}`,"Z"].join(" ")}l.push({x:M,y:H,width:d,height:B,color:me(g),value:y,label:N.categories[x]||x.toString(),seriesName:m.name,animationDelay:(p*s.length+x)*(xe.value/4),isHighlighted:h,isDimmed:f,isHidden:C,barPath:_,isSmooth:Y.value&&B>0})})})}return l}),vn=e.computed(()=>{if(!At.value)return[];const l=it.value.map((n,a)=>({series:n,originalIndex:a})).filter(({originalIndex:n})=>!re.value.has(n));if(l.length===0)return[];let u=P.value==="semi-radial"?Math.PI:-Math.PI/2;const s=P.value==="semi-radial"?Math.PI:Math.PI*2,t=[];if(l.length===1){const{series:n,originalIndex:a}=l[0],r=n.data[0]||0,c=u,i=u+s-.001,d=c+s/2,m=ie.value+Math.cos(c)*Ee.value,p=ne.value+Math.sin(c)*Ee.value,g=ie.value+Math.cos(i)*Ee.value,h=ne.value+Math.sin(i)*Ee.value,f=ie.value+Math.cos(i)*Z.value,C=ne.value+Math.sin(i)*Z.value,y=ie.value+Math.cos(c)*Z.value,x=ne.value+Math.sin(c)*Z.value,E=1,V=[`M ${m} ${p}`,`A ${Ee.value} ${Ee.value} 0 ${E} 1 ${g} ${h}`,`L ${f} ${C}`,`A ${Z.value} ${Z.value} 0 ${E} 0 ${y} ${x}`,"Z"].join(" ");return t.push({path:V,color:me(a),value:r,seriesName:n.name,opacity:.8,isHighlighted:L.value===a,isDimmed:!1,isHidden:!1,startAngle:c,endAngle:i,midAngle:d}),t}const o=l.reduce((n,{series:a})=>n+(a.data[0]||0),0);return o===0?[]:(l.forEach(({series:n,originalIndex:a})=>{const r=n.data[0]||0,c=r/o*s,i=u,d=u+c,m=i+c/2,p=ie.value+Math.cos(i)*Ee.value,g=ne.value+Math.sin(i)*Ee.value,h=ie.value+Math.cos(d)*Ee.value,f=ne.value+Math.sin(d)*Ee.value,C=ie.value+Math.cos(d)*Z.value,y=ne.value+Math.sin(d)*Z.value,x=ie.value+Math.cos(i)*Z.value,E=ne.value+Math.sin(i)*Z.value,V=c>Math.PI?1:0,M=[`M ${p} ${g}`,`A ${Ee.value} ${Ee.value} 0 ${V} 1 ${h} ${f}`,`L ${C} ${y}`,`A ${Z.value} ${Z.value} 0 ${V} 0 ${x} ${E}`,"Z"].join(" ");t.push({path:M,color:me(a),value:r,seriesName:n.name,opacity:.8,isHighlighted:L.value===a,isDimmed:L.value!==null&&L.value!==a,isHidden:!1,startAngle:i,endAngle:d,midAngle:m}),u=d}),t)}),gn=e.computed(()=>!Oo.value||!At.value?[]:vn.value.map((l,u)=>{if(l.isHidden)return null;const s=ft.value,t=Nn.value,o=Mn.value,n=ie.value+Math.cos(l.midAngle)*Z.value,a=ne.value+Math.sin(l.midAngle)*Z.value,r=ie.value+Math.cos(l.midAngle)*(Z.value+s),c=ne.value+Math.sin(l.midAngle)*(Z.value+s),i=Math.cos(l.midAngle)>=0,m=r+t*(i?1:-1),p=c,g=i?r+15:r-15,h=p-o,f=i?"start":"end";return{pointerStartX:n,pointerStartY:a,pointerEndX:r,pointerEndY:c,horizontalEndX:m,horizontalEndY:p,textX:g,textY:h,text:`${l.seriesName}: ${l.value}`,color:l.color,textAnchor:f,isRightSide:i,isHighlighted:l.isHighlighted,isDimmed:l.isDimmed}}).filter(Boolean)),$t=l=>{if(!l||l.isHidden)return 0;const u=l.opacity||Lo.value||.7;return L.value===null||L.value===void 0?u:L.value!==null?l.seriesIndex===L.value?Math.min(1,u+.1):Math.max(.5,u*.8):u},Dt=l=>{if(!l||l.isHidden)return 0;const u=l.radius>20?.9:.8;return L.value!==null?l.seriesIndex===L.value?Math.min(1,u+.1):u*.7:u},_t=(l,u)=>{if(l)try{if(L.value===l.seriesIndex?L.value=null:L.value=l.seriesIndex,typeof window<"u"&&window.dispatchEvent){const s=new CustomEvent("dss-bubble-click",{detail:{bubble:l,originalEvent:u,chartId:N.chartId}});window.dispatchEvent(s)}}catch(s){console.error("Error in onBubbleClick:",s)}},Co=(l,u)=>{const s=[`dss-bubble-fallback-${u}`];return l.isHighlighted&&s.push("dss-bubble-highlighted"),l.isDimmed&&s.push("dss-bubble-dimmed"),l.isHidden&&s.push("dss-bubble-hidden"),s.push(`dss-bubble-series-${l.seriesIndex}`),s.join(" ")},pe=(l,u)=>{l&&(u.stopPropagation(),wo.value=!0,L.value=l.seriesIndex,I.value.show=!1)},hn=(l,u)=>{let s;switch(l){case"x":s=u.originalX;break;case"y":s=u.originalY;break;case"size":s=u.originalSize;break;case"label":s=u.label;break;case"seriesName":s=u.seriesName;break;default:s=u[l]||""}const t=So.value[l];return typeof t=="function"?t(s,u):typeof s=="number"?s.toFixed(1):s?.toString()||""},yn=()=>{if(!ke.value||!I.value.data||I.value.data.length===0)return"Bubbles";const l=[],u=new Set;return I.value.data.forEach(s=>{if(s.seriesName&&s.label){const t=`${s.seriesName} - ${s.label}`;u.has(t)||(l.push(t),u.add(t))}else s.seriesName&&(u.has(s.seriesName)||(l.push(s.seriesName),u.add(s.seriesName)))}),l.length>0?l.join(" | "):"Bubbles"},It=(l,u)=>{l&&(wo.value=!1,L.value=null)},Yt=(l,u)=>{const s=u.target.closest(".dss-custom-chart-container");if(!s)return;const t=s.getBoundingClientRect(),o=yo(l.categoryIndex),n=l.description||l.comment||"";let a=u.clientX-t.left+15,r=u.clientY-t.top-10;const c=200,i=n?80:50;a+c>D.value&&(a=u.clientX-t.left-c-15),r+i>W.value&&(r=u.clientY-t.top-i-10),a<0&&(a=10),r<0&&(r=10),Nt.value={show:!0,x:a,y:r,categoryValue:o,description:n}},ro=()=>{Nt.value.show=!1},Je=e.computed(()=>N.categories.length||Math.max(...qt.value.map(l=>l.data.length))),io=e.computed(()=>{let l=0;return qt.value.forEach(u=>{u.data.forEach(s=>{typeof s=="number"&&(l=Math.max(l,s))})}),l||100}),Cn=e.computed(()=>{const l=[],u=Je.value;for(let s=0;s<u;s++){const t=s*2*Math.PI/u-Math.PI/2,o=ie.value+Math.cos(t)*Z.value,n=ne.value+Math.sin(t)*Z.value;l.push({x:o,y:n,angle:t,index:s})}return l}),Zn=e.computed(()=>{const l=[],u=Je.value;return Cn.value.forEach((s,t)=>{const o=Z.value+15,n=t*2*Math.PI/u-Math.PI/2,a=ie.value+Math.cos(n)*o,r=ne.value+Math.sin(n)*o+5;let c="middle",i="middle";Math.abs(Math.cos(n))>.5&&(c=Math.cos(n)>0?"start":"end"),Math.abs(Math.sin(n))>.5&&(i=Math.sin(n)>0?"hanging":"auto"),l.push({x:a,y:r,text:N.categories[t]||`Axis ${t+1}`,anchor:c,baseline:i})}),l}),ko=e.ref(new Set),kn=(l,u,s)=>{const t=`current-${s}`,o=ko.value.has(t);return!o&&L.value===null?u.fillOpacity||z.value:u.isHighlighted||o?(u.fillOpacity||z.value)+.15:u.isDimmed?(u.fillOpacity||z.value)*.3:u.fillOpacity||z.value},co=e.computed(()=>{if(!Ce.value)return[];const l=[],u=Je.value;return it.value.forEach((s,t)=>{const o=[],n=[],a=[],r=L.value===t,c=L.value!==null&&L.value!==t,i=re.value.has(t);for(let d=0;d<u;d++){const m=s.data[d]||0,g=m/io.value*Z.value,h=d*2*Math.PI/u-Math.PI/2,f=ie.value+Math.cos(h)*g,C=ne.value+Math.sin(h)*g;o.push(`${f},${C}`),n.push({x:f,y:C}),a.push({x:f,y:C,value:m,label:N.categories[d]||`Axis ${d+1}`,seriesName:s.name})}l.push({points:o.join(" "),polygonPoints:n,dataPoints:a,color:me(t),fillOpacity:z.value,seriesName:s.name,value:`${s.name}: ${s.data.join(", ")}`,isHighlighted:r,isDimmed:c,isHidden:i,seriesIndex:t})}),l}),xn=(l,u)=>{if(!u||u.length<3)return!1;let s=!1;for(let t=0,o=u.length-1;t<u.length;o=t++){const n=u[t].x,a=u[t].y,r=u[o].x,c=u[o].y;a>l.y!=c>l.y&&l.x<(r-n)*(l.y-a)/(c-a)+n&&(s=!s)}return s},Un=l=>{if(!Ce.value)return;const u=l.currentTarget.closest(".dss-custom-chart-container");if(!u)return;const s=u.getBoundingClientRect(),t=X.value?.getBoundingClientRect();if(!t)return;const o=l.clientX-t.left,n=l.clientY-t.top,a=co.value.filter(r=>r.isHidden?!1:xn({x:o,y:n},r.polygonPoints));if(a.length>0){a.length,L.value=a[0].seriesIndex;const r=l.clientX-s.left+10,c=l.clientY-s.top-10,i=200,d=50+a.length*25;let m=r,p=c;m+i>D.value&&(m=l.clientX-s.left-i-10),p+d>W.value&&(p=l.clientY-s.top-d-10),m<0&&(m=10),p<0&&(p=10);const g=a.map(h=>{let f=h.dataPoints[0],C=1/0;return h.dataPoints.forEach(y=>{const x=Math.sqrt(Math.pow(y.x-o,2)+Math.pow(y.y-n,2));x<C&&(C=x,f=y)}),{seriesName:h.seriesName,color:h.color,value:f.value!==void 0?f.value:h.value}});ae.value={show:!0,x:m,y:p,title:a.length===1?a[0].seriesName:"",value:"",spiderSeries:g}}else ct()},Do=e.computed(()=>{const l=T.value;return l.logos.map((u,s)=>{const t=N.series[u.seriesIndex];if(!t||!t.data||t.data.length===0||re.value.has(u.seriesIndex))return null;let o,n;if(Se.value){let r=-1,c=null;for(let d=t.data.length-1;d>=0;d--)if(t.data[d]!==null&&t.data[d]!==void 0){r=d,c=t.data[d];break}if(r===-1||c===null)return null;const i=t.data.map((d,m)=>d==null?null:{x:he(m),y:Ne(d),index:m}).filter(d=>d!==null);if(l.animations.enabled&&!Rt.value&&l.animations.type==="draw"&&l.chart.type==="line"&&(U.value.isAnimating||!U.value.hasAnimated))if(U.value.isAnimating){const d=U.value.currentFrame/U.value.totalFrames,m=ht(l.animations.easing,Math.min(d,1)),p=Go(i,m);o=p.x+(u.offsetX||0),n=p.y+(u.offsetY||0)}else o=i[0].x+(u.offsetX||0),n=i[0].y+(u.offsetY||0);else o=he(r)+(u.offsetX||0),n=Ne(c)+(u.offsetY||0)}else if(At.value||Ce.value){const r=Math.PI*2/l.logos.length*s;o=ie.value+Math.cos(r)*(Z.value+30)+(u.offsetX||0),n=ne.value+Math.sin(r)*(Z.value+30)+(u.offsetY||0)}return{...u,x:o,y:n,seriesIndex:u.seriesIndex}}).filter(Boolean)}),_o=l=>{const u=document.querySelector(`.dss-logo-fallback-${l}`),s=document.querySelector(`.dss-logo-image-${l}`);u&&(u.style.opacity="0"),s&&(s.style.opacity="1")},jo=l=>{console.warn(`Logo ${l} failed to load, keeping fallback circle`);const u=document.querySelector(`.dss-logo-image-${l}`);u&&(u.style.display="none")},Io=l=>{re.value.has(l)?re.value.delete(l):re.value.add(l)},Wn=e.computed(()=>{if(!ae.value.show&&!(Te.value&&I.value.show&&!S.value.isZooming))return{display:"none"};let l,u;if(Te.value&&I.value.show&&!S.value.isZooming){l=I.value.x+15,u=k.value.top;const s=ke.value?200:150;l+s>D.value&&(l=I.value.x-s-15),l<0&&(l=10),u<10&&(u=10)}else l=ae.value.x,u=ae.value.y;return{left:l+"px",top:u+"px"}}),gt=(l,u)=>{if(uo.value)return;const t=u.target.closest(".dss-custom-chart-container").getBoundingClientRect();let o=u.clientX-t.left+10,n=u.clientY-t.top-10;const a=200,r=120,c=D.value,i=W.value;o+a>c&&(o=u.clientX-t.left-a-10),n+r>i&&(n=u.clientY-t.top-r-10),o<0&&(o=10),n<0&&(n=10);let d;typeof l.categoryIndex=="number"?d=l.categoryIndex:typeof l.dataIndex=="number"?d=l.dataIndex:l.label&&N.categories.includes(l.label)&&(d=N.categories.indexOf(l.label));const m=(Ae.value||P.value==="bar")&&l.label?l.label:l.seriesName||l.label||"";ae.value={show:!0,x:o,y:n,title:m,value:l.value?.toString()||"",categoryIndex:d,spiderSeries:[]}},xo=e.ref(!1),wo=e.ref(!1),ct=()=>{ae.value.show=!1,ae.value.spiderSeries=[],I.value.show=!1,xo.value||(L.value=null)},uo=e.ref(!1),mo=(l,u)=>{uo.value=!0,ae.value.show=!1,I.value.show=!1;const t=u.target.closest(".dss-custom-chart-container").getBoundingClientRect();let o=u.clientX-t.left+15,n=u.clientY-t.top-10;const a=250;o+a>D.value&&(o=u.clientX-t.left-a-15),o<0&&(o=10),n<0&&(n=10),Po.value={show:!0,x:o,y:n,content:l.texts,count:l.totalCount}},Eo=()=>{uo.value=!1,Po.value.show=!1},U=e.ref({isAnimating:!1,currentFrame:0,totalFrames:0,animationId:null,hasAnimated:!1}),ht=(l,u)=>{switch(l){case"linear":return u;case"ease":return u<.5?2*u*u:-1+(4-2*u)*u;case"ease-in":return u*u;case"ease-out":return u*(2-u);case"ease-in-out":return u<.5?2*u*u:-1+(4-2*u)*u;default:return u}},Rt=e.computed(()=>eo.value?window.matchMedia("(prefers-reduced-motion: reduce)").matches:!1),Ko=()=>{if(!Pt.value||Rt.value){U.value.hasAnimated=!0;return}U.value.isAnimating=!0,U.value.currentFrame=0,U.value.totalFrames=Math.ceil(_e.value/16.67);const l=()=>{const u=U.value.currentFrame/U.value.totalFrames,s=ht(Ze.value,Math.min(u,1));qn(s),u<1?(U.value.currentFrame++,U.value.animationId=requestAnimationFrame(l)):Xn()};U.value.animationId=requestAnimationFrame(l)},qn=l=>{const u=document.querySelector(".dss-custom-chart-container");u&&u.style.setProperty("--dss-animation-progress",l)},Xn=()=>{U.value.isAnimating=!1,U.value.hasAnimated=!0,U.value.animationId&&(cancelAnimationFrame(U.value.animationId),U.value.animationId=null)},Yn=e.computed(()=>{if(!Pt.value||Rt.value||U.value.hasAnimated)return{};const l={};return l["--dss-animation-duration"]=`${_e.value}ms`,l["--dss-animation-easing"]=Ro(Ze.value),l["--dss-stagger-delay"]=`${xe.value}ms`,l}),Ro=l=>({linear:"linear",ease:"ease","ease-in":"ease-in","ease-out":"ease-out","ease-in-out":"ease-in-out"})[l]||"ease-out",Qe=()=>{if(!Pt.value||Rt.value)return"";const l=["dss-chart-animated"];return U.value.hasAnimated||l.push(`dss-animate-${Zt.value}`),U.value.hasAnimated||(At.value?l.push("dss-animate-fill"):l.push(`dss-animate-${Zt.value}`)),U.value.isAnimating&&l.push("dss-is-animating"),l.join(" ")};e.watch(()=>N.series,(l,u)=>{nt.value&&u&&U.value.hasAnimated&&(U.value.hasAnimated=!1,e.nextTick(()=>{setTimeout(()=>Ko(),bt.value)}))},{deep:!0}),e.watch(()=>S.value.isZooming,(l,u)=>{u&&!l&&setTimeout(()=>{Mo()},50)}),e.watch(()=>[S.value.scale,S.value.offsetX],()=>{!S.value.isZooming&&!S.value.isDragging&&Mo()},{flush:"post"}),e.watch([Vo,ot],([l,u])=>{S.value.minScale=l,S.value.maxScale=u,(S.value.scale<l||S.value.scale>u)&&Ao()},{immediate:!0}),e.watch(()=>N.locale,l=>{l&&l!==b.value&&(b.value=l)},{immediate:!0}),e.watch(()=>oe.value.show,l=>{l?e.nextTick(()=>{document.addEventListener("click",Ho)}):document.removeEventListener("click",Ho)}),e.onMounted(()=>{L.value=null,Wo(),Pt.value&&!Rt.value?setTimeout(()=>Ko(),bt.value):U.value.hasAnimated=!0,document.addEventListener("mousemove",wn),document.addEventListener("mouseup",Ft),document.addEventListener("click",$e)}),e.onUnmounted(()=>{U.value.animationId&&cancelAnimationFrame(U.value.animationId),S.value.zoomTimeout&&clearTimeout(S.value.zoomTimeout),document.removeEventListener("mousemove",wn),document.removeEventListener("mouseup",Ft),document.removeEventListener("click",$e),document.removeEventListener("click",Ho)});const wn=l=>{if(S.value.isDragging&&S.value.scale>1&&Se.value){I.value.show=!1;const u=l.clientX-S.value.lastMouseX,{minX:s,maxX:t}=ue.value,o=t-s||1,a=u*.8;S.value.offsetX+=a;const r=o/S.value.scale,c=o-r,i=0,d=-c/o*k.value.width,m=i;S.value.offsetX=Math.max(d,Math.min(m,S.value.offsetX)),S.value.lastMouseX=l.clientX,S.value.lastMouseY=l.clientY}},Ft=()=>{S.value.isDragging&&(S.value.isDragging=!1,setTimeout(()=>{!S.value.isDragging&&S.value.isZooming},100))},Go=(l,u)=>{const s=l.filter(r=>r!=null);if(!s||s.length===0)return{x:0,y:0};if(s.length===1||u<=0)return s[0];if(u>=1)return s[s.length-1];let t=0;const o=[];for(let r=1;r<s.length;r++){const c=s[r].x-s[r-1].x,i=s[r].y-s[r-1].y,d=Math.sqrt(c*c+i*i);o.push(d),t+=d}const n=t*u;let a=0;for(let r=0;r<o.length;r++){const c=a+o[r];if(n<=c){const i=(n-a)/o[r],d=s[r],m=s[r+1];return{x:d.x+(m.x-d.x)*i,y:d.y+(m.y-d.y)*i}}a=c}return s[s.length-1]};return(l,u)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{class:e.normalizeClass(["dss-custom-chart-container",Qe()]),style:e.normalizeStyle({width:D.value+"px",height:W.value+20+"px",...Yn.value,cursor:rn()}),"data-chart-type":P.value,ref_key:"containerEl",ref:w,onWheel:Ve,onMousedown:Ht,onMousemove:Bn,onMouseup:Rn,onMouseleave:nn,onDblclick:Ao,onContextmenu:e.withModifiers(Tn,["prevent"]),onClick:e.withModifiers(Re,["left"]),onWheelCapture:Ve},[e.createElementVNode("div",al,[e.createElementVNode("div",sl,[J.value?(e.openBlock(),e.createElementBlock("div",rl,e.toDisplayString(J.value),1)):e.createCommentVNode("",!0),Q.value?(e.openBlock(),e.createElementBlock("div",il,e.toDisplayString(Q.value),1)):e.createCommentVNode("",!0)]),ye.value&&(Be.value==="top"||Be.value==="bottom")?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["dss-chart-legend",{"dss-legend-horizontal":fo.value==="horizontal","dss-legend-vertical":fo.value==="vertical","dss-legend-top":Be.value==="top","dss-legend-bottom":Be.value==="bottom"}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(N.series,(s,t)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-${t}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":re.value.has(t),"dss-legend-hovered":L.value===t,"dss-legend-dimmed":L.value!==null&&L.value!==t}]),onClick:o=>Io(t),onMouseenter:o=>Zo(t),onMouseleave:on,style:e.normalizeStyle({animationDelay:`${t*100}ms`})},[e.createElementVNode("div",{class:"dss-legend-color",style:e.normalizeStyle({backgroundColor:me(t)})},null,4),e.createElementVNode("span",dl,e.toDisplayString(s.name),1)],46,cl))),128))],2)):e.createCommentVNode("",!0),ye.value&&(Be.value==="left"||Be.value==="right")?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["dss-chart-legend-side",{"dss-legend-left":Be.value==="left","dss-legend-right":Be.value==="right"}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(N.series,(s,t)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-${t}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":re.value.has(t),"dss-legend-hovered":L.value===t,"dss-legend-dimmed":L.value!==null&&L.value!==t}]),onClick:o=>Io(t),onMouseenter:o=>Zo(t),onMouseleave:on,style:e.normalizeStyle({animationDelay:`${t*100}ms`})},[e.createElementVNode("div",{class:"dss-legend-color",style:e.normalizeStyle({backgroundColor:me(t)})},null,4),e.createElementVNode("span",ml,e.toDisplayString(s.name),1)],46,ul))),128))],2)):e.createCommentVNode("",!0)]),A.showAddMarkerButton&&fe.value.addMarker&&(Se.value||ke.value)?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-add-marker-button",onClick:Tt,title:e.unref(F)("chart.contextMenu.addMarker")},[e.createElementVNode("img",{src:Ye.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,fl),u[5]||(u[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,pl)):e.createCommentVNode("",!0),(e.openBlock(),e.createElementBlock("svg",{width:D.value,height:W.value,class:"dss-chart-svg","data-smooth":Y.value,"data-animated":Pt.value,ref_key:"svgEl",ref:X},[e.createElementVNode("defs",null,[e.createElementVNode("clipPath",gl,[e.createElementVNode("rect",{x:k.value.left,y:k.value.top,width:k.value.width,height:k.value.height*4},null,8,hl)])]),Se.value||ke.value?(e.openBlock(),e.createElementBlock("g",yl,[O.value?(e.openBlock(),e.createElementBlock("g",Cl,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(dn.value,(s,t)=>(e.openBlock(),e.createElementBlock("line",{key:`h-grid-${t}`,x1:k.value.left,x2:k.value.right,y1:s.y,y2:s.y,stroke:"#e0e0e0","stroke-width":"1","stroke-dasharray":"4,2",style:e.normalizeStyle({animationDelay:`${t*50}ms`})},null,12,kl))),128))])):e.createCommentVNode("",!0),e.createElementVNode("g",xl,[e.createElementVNode("line",{x1:k.value.left,x2:k.value.right,y1:k.value.bottom,y2:k.value.bottom,stroke:"#ccc","stroke-width":"1"},null,8,wl),e.createElementVNode("line",{x1:k.value.left,x2:k.value.left,y1:k.value.top,y2:k.value.bottom,stroke:"#ccc","stroke-width":"1"},null,8,El)]),e.createElementVNode("g",bl,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Xo.value,(s,t)=>(e.openBlock(),e.createElementBlock("text",{key:`x-${t}`,x:s.x,y:s.y,"text-anchor":"middle","font-size":"12",fill:"#666",style:e.normalizeStyle({animationDelay:`${t*100}ms`})},e.toDisplayString(s.text),13,Vl))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Yo.value,(s,t)=>(e.openBlock(),e.createElementBlock("text",{key:`y-${t}`,x:s.x,y:s.y,"text-anchor":"end","font-size":"12",fill:"#666","dominant-baseline":"middle",style:e.normalizeStyle({animationDelay:`${t*80}ms`})},e.toDisplayString(s.text),13,Sl))),128)),tt.value?(e.openBlock(),e.createElementBlock("text",{key:0,x:k.value.left+k.value.width/2,y:k.value.bottom+45,"text-anchor":"middle","font-size":"14","font-weight":"bold",fill:"#333"},e.toDisplayString(tt.value),9,Nl)):e.createCommentVNode("",!0),bo.value?(e.openBlock(),e.createElementBlock("text",{key:1,x:15,y:k.value.top+12+k.value.height/2,"text-anchor":"middle","font-size":"14","font-weight":"bold",fill:"#333",transform:`rotate(-90, 15, ${k.value.top+k.value.height/2})`},e.toDisplayString(bo.value),9,Ml)):e.createCommentVNode("",!0)]),Jo.value.length>0?(e.openBlock(),e.createElementBlock("g",Bl,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Jo.value,s=>(e.openBlock(),e.createElementBlock("g",{key:`flag-group-${s.categoryIndex}`},[e.createElementVNode("g",Tl,[s.hasManual?(e.openBlock(),e.createElementBlock("line",{key:0,x1:s.x,x2:s.x,y1:k.value.bottom,y2:k.value.top,stroke:"#047395","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:t=>mo(s,t),onMouseleave:Eo},null,40,Hl)):e.createCommentVNode("",!0),s.hasAuto&&!s.hasManual?(e.openBlock(),e.createElementBlock("line",{key:1,x1:s.x,x2:s.x,y1:k.value.bottom,y2:k.value.top,stroke:"#0dbf89","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:t=>mo(s,t),onMouseleave:Eo},null,40,Al)):e.createCommentVNode("",!0),s.hasAuto&&s.hasManual?(e.openBlock(),e.createElementBlock("line",{key:2,x1:s.x,x2:s.x,y1:k.value.bottom,y2:k.value.top,stroke:"#047395","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:t=>mo(s,t),onMouseleave:Eo},null,40,Ll)):e.createCommentVNode("",!0)]),s.hasManual&&s.hasAuto?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:s.x+8,cy:Math.max(15,k.value.top-10),r:"14",fill:"#0dbf89",stroke:"#fafafa","stroke-width":"2",class:"flag-count-circle",onMouseover:t=>mo(s,t),onMouseleave:Eo},null,40,$l)):e.createCommentVNode("",!0),e.createElementVNode("circle",{cx:s.x,cy:Math.max(15,k.value.top-10),r:"14",fill:s.hasManual&&s.hasAuto||s.hasManual?"#047395":"#0dbf89",stroke:"#fafafa","stroke-width":"2",class:"dss-flag-count-indicator",onMouseover:t=>mo(s,t),onMouseleave:Eo},null,40,Dl),e.createElementVNode("text",{x:s.x,y:Math.max(15,k.value.top-5),"text-anchor":"middle","font-size":"12","font-weight":"bold",fill:"#fafafa",class:"dss-flag-count-text","pointer-events":"none"},e.toDisplayString(s.totalCount),9,_l)]))),128))])):e.createCommentVNode("",!0),e.createElementVNode("g",Il,[qe.value?(e.openBlock(),e.createElementBlock("g",Rl,[e.createElementVNode("g",Fl,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(fn.value,(s,t)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`mixed-bar-${t}`},[s.isSmooth?(e.openBlock(),e.createElementBlock("path",{key:0,d:s.barPath,stroke:"#fafafa","stroke-width":"1",class:e.normalizeClass({"dss-bar-highlighted":s.isHighlighted,"dss-bar-dimmed":s.isDimmed,"dss-bar-hidden":s.isHidden}),style:e.normalizeStyle({fill:s.color,fillOpacity:s.isDimmed?.4:1,animationDelay:`${s.animationDelay}ms`}),onMouseover:o=>gt(s,o),onMouseleave:ct},null,46,zl)):(e.openBlock(),e.createElementBlock("rect",{key:1,x:s.x,y:s.y,width:s.width,height:s.height,fill:s.color,stroke:"#fafafa","stroke-width":"1",class:e.normalizeClass({"dss-bar-highlighted":s.isHighlighted,"dss-bar-dimmed":s.isDimmed,"dss-bar-hidden":s.isHidden}),style:e.normalizeStyle({animationDelay:`${s.animationDelay}ms`}),onMouseover:o=>gt(s,o),onMouseleave:ct},null,46,Ol))],64))),128))]),e.createElementVNode("g",Pl,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(un.value,(s,t)=>(e.openBlock(),e.createElementBlock("path",{key:`mixed-line-${t}`,d:s.path,stroke:s.color,"stroke-width":s.isHighlighted?ee.value+2:ee.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass({"dss-series-highlighted":s.isHighlighted,"dss-series-dimmed":s.isDimmed,"dss-series-hidden":s.isHidden}),style:e.normalizeStyle({"--dss-path-length":s.pathLength,animationDelay:`${s.animationDelay}ms`})},null,14,Zl))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(mn.value,(s,t)=>(e.openBlock(),e.createElementBlock("path",{key:`mixed-gap-connector-${t}`,d:s.path,stroke:s.color,"stroke-width":s.isHighlighted?ee.value+2:ee.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round","stroke-dasharray":"15, 10, 5, 10",opacity:s.isHighlighted?0:.5,class:e.normalizeClass({"dss-gap-connector":!0,"dss-series-dimmed":s.isDimmed,"dss-series-hidden":s.isHidden}),style:e.normalizeStyle({animationDelay:`${s.animationDelay}ms`,transition:"opacity 0.2s ease"})},null,14,Ul))),128)),se.value>0||wt.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(ao.value,(s,t)=>(e.openBlock(),e.createElementBlock("circle",{key:`mixed-point-${t}`,cx:s.x,cy:s.y,r:s.isHighlighted?Xe(s,se.value)+2:Xe(s,se.value),fill:s.color,stroke:"#fafafa","stroke-width":"2",class:e.normalizeClass({"dss-point-highlighted":s.isHighlighted,"dss-point-dimmed":s.isDimmed,"dss-point-hidden":s.isHidden}),style:e.normalizeStyle({animationDelay:`${s.animationDelay}ms`}),onMouseover:o=>gt(s,o),onMouseleave:ct},null,46,Wl))),128)):e.createCommentVNode("",!0)])])):P.value==="line"?(e.openBlock(),e.createElementBlock("g",ql,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Pn.value,(s,t)=>(e.openBlock(),e.createElementBlock("path",{key:`anim-${t}`,d:s.path,stroke:s.color,"stroke-width":ee.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass(["dss-line-animation-overlay",{"dss-animation-complete":U.value.hasAnimated}]),style:e.normalizeStyle({"--dss-path-length":s.pathLength,animationDelay:`${s.animationDelay}ms`})},null,14,Xl))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(un.value,(s,t)=>(e.openBlock(),e.createElementBlock("path",{key:`line-${t}`,d:s.path,stroke:s.color,"stroke-width":s.isHighlighted?ee.value+2:ee.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass({"dss-series-highlighted":s.isHighlighted,"dss-series-dimmed":s.isDimmed,"dss-series-hidden":s.isHidden}),style:e.normalizeStyle({"--dss-path-length":s.pathLength,animationDelay:`${s.animationDelay}ms`})},null,14,Yl))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(mn.value,(s,t)=>(e.openBlock(),e.createElementBlock("path",{key:`gap-connector-${t}`,d:s.path,stroke:s.color,"stroke-width":s.isHighlighted?ee.value+2:ee.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round","stroke-dasharray":"15, 10, 5, 10",opacity:s.isHighlighted?0:.5,class:e.normalizeClass({"dss-gap-connector":!0,"dss-series-dimmed":s.isDimmed,"dss-series-hidden":s.isHidden}),style:e.normalizeStyle({animationDelay:`${s.animationDelay}ms`,transition:"opacity 0.2s ease"})},null,14,jl))),128)),se.value>0||wt.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(pn.value,(s,t)=>(e.openBlock(),e.createElementBlock("circle",{key:`point-${t}`,cx:s.x,cy:s.y,r:s.isHighlighted?Xe(s,se.value)+2:Xe(s,se.value),fill:s.color,stroke:"#fafafa","stroke-width":"2",class:e.normalizeClass({"dss-point-highlighted":s.isHighlighted,"dss-point-dimmed":s.isDimmed,"dss-point-hidden":s.isHidden}),style:e.normalizeStyle({animationDelay:`${s.animationDelay}ms`}),onMouseover:o=>gt(s,o),onMouseleave:ct},null,46,Kl))),128)):e.createCommentVNode("",!0)])):P.value==="area"?(e.openBlock(),e.createElementBlock("g",Gl,[e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(so.value,(s,t)=>(e.openBlock(),e.createElementBlock("mask",{key:`mask-${t}`,id:`area-mask-${t}-${A.chartId}`},[e.createElementVNode("rect",{x:k.value.left-10,y:k.value.top-10,width:k.value.width+20,height:k.value.height+20,fill:"#fafafa",class:"dss-area-mask-rect",style:e.normalizeStyle({"--dss-mask-width":`${k.value.width+20}px`})},null,12,Ql)],8,Jl))),128))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(so.value,(s,t)=>(e.openBlock(),e.createElementBlock("path",{key:`area-fill-${t}`,d:s.areaPath,fill:s.color,"fill-opacity":s.isHighlighted?go.value+.2:go.value,mask:`url(#area-mask-${t}-${A.chartId})`,class:e.normalizeClass({"dss-area-fill-smooth":!0,"dss-series-highlighted":s.isHighlighted,"dss-series-dimmed":s.isDimmed,"dss-series-hidden":s.isHidden})},null,10,ea))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(so.value,(s,t)=>(e.openBlock(),e.createElementBlock("path",{key:`area-line-${t}`,d:s.linePath,stroke:s.color,"stroke-width":s.isHighlighted?ee.value+1:ee.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass({"dss-area-line-animated":!0,"dss-series-highlighted":s.isHighlighted,"dss-series-dimmed":s.isDimmed,"dss-series-hidden":s.isHidden}),style:e.normalizeStyle({"--dss-path-length":s.pathLength,animationDelay:`${t*xe.value}ms`})},null,14,ta))),128))])):P.value==="bar"?(e.openBlock(),e.createElementBlock("g",oa,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(fn.value,(s,t)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`bar-${t}`},[s.isSmooth?(e.openBlock(),e.createElementBlock("path",{key:0,d:s.barPath,fill:s.color,stroke:"#fafafa","stroke-width":"1",class:e.normalizeClass({"dss-bar-highlighted":s.isHighlighted,"dss-bar-dimmed":s.isDimmed,"dss-bar-hidden":s.isHidden}),style:e.normalizeStyle({animationDelay:`${s.animationDelay}ms`}),onMouseover:o=>gt(s,o),onMouseleave:ct},null,46,na)):(e.openBlock(),e.createElementBlock("rect",{key:1,x:s.x,y:s.y,width:s.width,height:s.height,stroke:"#fafafa","stroke-width":"1",class:e.normalizeClass({"dss-bar-highlighted":s.isHighlighted,"dss-bar-dimmed":s.isDimmed,"dss-bar-hidden":s.isHidden}),style:e.normalizeStyle({fill:s.color,fillOpacity:s.isDimmed?.4:1,animationDelay:`${s.animationDelay}ms`}),onMouseover:o=>gt(s,o),onMouseleave:ct},null,46,la))],64))),128))])):e.createCommentVNode("",!0)]),Te.value&&I.value.show&&!S.value.isZooming?(e.openBlock(),e.createElementBlock("g",aa,[e.createElementVNode("line",{x1:I.value.x,x2:I.value.x,y1:k.value.top,y2:k.value.bottom,stroke:vo.value,"stroke-width":"1","stroke-dasharray":"4,4",opacity:"0.8"},null,8,sa),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(I.value.data,(s,t)=>(e.openBlock(),e.createElementBlock("circle",{key:`dss-crosshair-point-${t}`,cx:I.value.x,cy:s.y,r:se.value+2,fill:s.color,stroke:"#fafafa","stroke-width":"2",opacity:"0.9"},null,8,ra))),128))])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),ke.value?(e.openBlock(),e.createElementBlock("g",ia,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Xt.value,(s,t)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`bubble-${t}`},[s?(e.openBlock(),e.createElementBlock("g",ca,[e.createElementVNode("circle",{cx:s.x,cy:s.y,r:s.radius,fill:s.color,"fill-opacity":$t(s),stroke:s.color,"stroke-width":s.isHighlighted?3:1,"stroke-opacity":"0.8",class:e.normalizeClass(Co(s,t)),style:{cursor:"pointer",transition:"all 0.3s ease"},onMouseenter:o=>pe(s,o),onMouseleave:o=>It(s),onClick:o=>_t(s,o)},null,42,da),s.imageUrl?(e.openBlock(),e.createElementBlock("image",{key:0,x:s.x-s.radius*.65,y:s.y-s.radius*.65,width:s.radius*1.3,height:s.radius*1.3,"xlink:href":s.imageUrl,class:e.normalizeClass(`dss-bubble-image-${t} ${s.isHighlighted?"dss-bubble-highlighted":""} ${s.isDimmed?"dss-bubble-dimmed":""} ${s.isHidden?"dss-bubble-hidden":""}`),"clip-path":`circle(${s.radius*.65}px at ${s.radius*.65}px ${s.radius*.65}px)`,style:e.normalizeStyle({cursor:"pointer",transition:"all 0.3s ease",opacity:Dt(s)}),onLoad:o=>Fn(t),onError:o=>cn(t),onMouseenter:o=>pe(s,o),onMouseleave:o=>It(s),onClick:o=>_t(s,o)},null,46,ua)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],64))),128))])):e.createCommentVNode("",!0),At.value?(e.openBlock(),e.createElementBlock("g",ma,[P.value==="radial"?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:ie.value,cy:ne.value,r:Z.value,fill:"none",stroke:"#e0e0e0","stroke-width":"1"},null,8,pa)):e.createCommentVNode("",!0),e.createElementVNode("g",{class:"dss-radial-data","data-chart-type":P.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(vn.value,(s,t)=>(e.openBlock(),e.createElementBlock("path",{key:`radial-${t}`,d:s.path,fill:s.color,"fill-opacity":s.isHighlighted?(s.opacity||.8)+.2:s.opacity||.8,stroke:s.color,"stroke-width":s.isHighlighted?2:1,class:e.normalizeClass({"dss-series-highlighted":s.isHighlighted,"dss-series-dimmed":s.isDimmed,"dss-series-hidden":s.isHidden}),onMouseover:o=>gt(s,o),onMouseleave:ct},null,42,va))),128))],8,fa),Oo.value?(e.openBlock(),e.createElementBlock("g",ga,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(gn.value,(s,t)=>(e.openBlock(),e.createElementBlock("g",{key:`radial-label-${t}`,class:e.normalizeClass({"dss-label-highlighted":s.isHighlighted,"dss-label-dimmed":s.isDimmed})},[e.createElementVNode("line",{x1:s.pointerStartX,y1:s.pointerStartY,x2:s.pointerEndX,y2:s.pointerEndY,stroke:s.color,"stroke-width":"1.5",opacity:"0.8",style:e.normalizeStyle({animationDelay:`${t*100}ms`})},null,12,ha),e.createElementVNode("line",{x1:s.pointerEndX,y1:s.pointerEndY,x2:s.horizontalEndX,y2:s.horizontalEndY,stroke:s.color,"stroke-width":"1.5",opacity:"0.8",style:e.normalizeStyle({animationDelay:`${t*120}ms`})},null,12,ya),e.createElementVNode("text",{x:s.textX,y:s.textY,"text-anchor":s.textAnchor,"font-size":Sn.value,"dominant-baseline":"middle",style:e.normalizeStyle({animationDelay:`${t*150}ms`})},e.toDisplayString(s.text),13,Ca)],2))),128))])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),Ce.value?(e.openBlock(),e.createElementBlock("g",ka,[O.value?(e.openBlock(),e.createElementBlock("g",xa,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ue.value,(s,t)=>(e.openBlock(),e.createElementBlock("circle",{key:`spider-grid-circle-${t}`,cx:ie.value,cy:ne.value,r:s,fill:"none",stroke:"#dedede","stroke-width":"1",style:e.normalizeStyle({animationDelay:`${t*150}ms`})},null,12,wa))),128)),e.createElementVNode("g",Ea,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ue.value,(s,t)=>(e.openBlock(),e.createElementBlock("g",{key:`spider-grid-label-group-${t}`},[e.createElementVNode("rect",{x:ie.value-16,y:ne.value-s-7,width:"32",height:"16",fill:"#fafafa",stroke:"none"},null,8,ba),e.createElementVNode("text",{x:ie.value,y:ne.value-s+2,"text-anchor":"middle","dominant-baseline":"central",class:"dss-spider-grid-label",style:{fontSize:"10px",fill:"#999",fontWeight:"600"}},e.toDisplayString(Vt(t)),9,Va)]))),128))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Cn.value,(s,t)=>(e.openBlock(),e.createElementBlock("line",{key:`spider-axis-${t}`,x1:ie.value,x2:s.x,y1:ne.value,y2:s.y,stroke:"#dedede","stroke-width":"1",style:e.normalizeStyle({animationDelay:`${t*100}ms`})},null,12,Sa))),128))])):e.createCommentVNode("",!0),e.createElementVNode("g",Na,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Zn.value,(s,t)=>(e.openBlock(),e.createElementBlock("text",{key:`spider-label-${t}`,x:s.x+Math.cos(t*2*Math.PI/Je.value-Math.PI/2)*16,y:s.y+Math.sin(t*2*Math.PI/Je.value-Math.PI/2)*16,"text-anchor":s.anchor,"dominant-baseline":s.baseline,"font-size":"14px",fill:"#666","font-weight":"500",style:e.normalizeStyle({animationDelay:`${t*120}ms`})},e.toDisplayString(s.text.charAt(0).toUpperCase()+s.text.slice(1)),13,Ma))),128))]),e.createElementVNode("g",{class:"dss-spider-data",onMousemove:Un,onMouseleave:ct},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(co.value,(s,t)=>(e.openBlock(),e.createElementBlock("g",{key:`spider-${t}`},[e.createElementVNode("polygon",{points:s.points,fill:s.color,"fill-opacity":kn("current",s,t),stroke:s.color,"stroke-width":s.isHighlighted?ee.value+1:ee.value,"stroke-linejoin":"round",class:e.normalizeClass({"dss-series-highlighted":s.isHighlighted,"dss-series-dimmed":s.isDimmed,"dss-series-hidden":s.isHidden}),style:e.normalizeStyle({animationDelay:`${t*xe.value}ms`,transition:"all 0.2s ease"})},null,14,Ba),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.dataPoints,(o,n)=>(e.openBlock(),e.createElementBlock("circle",{key:`spider-point-${t}-${n}`,cx:o.x,cy:o.y,r:s.isHighlighted?se.value+1:se.value>0?se.value:0,fill:s.color,stroke:"#fafafa","stroke-width":"2",class:e.normalizeClass({"dss-point-highlighted":s.isHighlighted,"dss-point-dimmed":s.isDimmed,"dss-point-hidden":s.isHidden}),style:e.normalizeStyle({animationDelay:`${t*xe.value+n*50}ms`,transition:"all 0.2s ease"}),onMouseover:a=>gt(o,a),onMouseleave:ct},null,46,Ta))),128))]))),128))],32)])):e.createCommentVNode("",!0),e.createElementVNode("g",Ha,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Do.value,(s,t)=>(e.openBlock(),e.createElementBlock("circle",{key:`logo-fallback-${t}`,cx:s.x,cy:s.y,r:s.width/2,fill:me(s.seriesIndex),stroke:"#fafafa","stroke-width":"2",class:e.normalizeClass(`logo-fallback-${t}`),style:e.normalizeStyle({animationDelay:`${t*200}ms`})},null,14,Aa))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Do.value,(s,t)=>(e.openBlock(),e.createElementBlock("image",{key:`logo-${t}`,x:s.x-s.width/2,y:s.y-s.height/2,width:s.width,height:s.height,"xlink:href":s.url,onLoad:o=>_o(t),onError:o=>jo(t),preserveAspectRatio:"xMidYMid slice",class:e.normalizeClass(`dss-logo-image-${t}`),"clip-path":`circle(${s.width/2}px at ${s.width/2}px ${s.height/2}px)`,style:e.normalizeStyle({animationDelay:`${t*200}ms`})},null,46,La))),128))])],8,vl)),Ke.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-chart-watermark",style:e.normalizeStyle({position:"absolute",top:"0px",left:"0px",width:D.value+"px",height:W.value+"px",backgroundImage:`url('${to.value}')`,backgroundRepeat:"no-repeat",...Ut.value,opacity:Ge.value,pointerEvents:"none",zIndex:10})},null,4)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(je.value,(s,t)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{key:"marker-"+s.id,class:"dss-chart-marker",style:e.normalizeStyle({position:"absolute",left:s.x+"px",top:s.y+"px",width:te.value+"px",height:te.value+"px",backgroundColor:"#fafafa",borderRadius:"50%",border:"2px solid #ddd",cursor:"pointer",zIndex:500}),onClick:e.withModifiers(o=>we(s),["stop"]),onMouseenter:o=>Yt(s,o),onMouseleave:ro},[e.createElementVNode("img",{src:ln(s),class:"dss-marker-icon",alt:"Marker Icon",style:{width:"100%",height:"100%","object-fit":"contain","border-radius":"50%","pointer-events":"none"}},null,8,Da)],44,$a)),[[e.vShow,ut.value]])),128)),Nt.value.show?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-marker-tooltip",style:e.normalizeStyle({left:Nt.value.x+"px",top:Nt.value.y+"px"})},[e.createElementVNode("div",_a,e.toDisplayString(Nt.value.categoryValue),1),Nt.value.description?(e.openBlock(),e.createElementBlock("div",Ia,e.toDisplayString(Nt.value.description),1)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),ae.value.show||Te.value&&I.value.show&&!S.value.isZooming?(e.openBlock(),e.createElementBlock("div",{key:3,class:e.normalizeClass(["dss-chart-tooltip",{"dss-crosshair-tooltip":Te.value&&I.value.show&&!S.value.isZooming}]),style:e.normalizeStyle(Wn.value)},[!Te.value||!I.value.show||S.value.isZooming?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[Ce.value&&ae.value.spiderSeries&&ae.value.spiderSeries.length>0?(e.openBlock(),e.createElementBlock("div",Ra,[ae.value.title?(e.openBlock(),e.createElementBlock("div",Fa,e.toDisplayString(ae.value.title),1)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ae.value.spiderSeries,(s,t)=>(e.openBlock(),e.createElementBlock("div",{key:`spider-tooltip-${t}`,class:"dss-tooltip-series"},[e.createElementVNode("div",{class:"dss-tooltip-series-indicator",style:e.normalizeStyle({backgroundColor:s.color})},null,4),e.createElementVNode("span",za,e.toDisplayString(s.seriesName)+":",1),e.createElementVNode("span",Oa,e.toDisplayString(s.value),1)]))),128))])):(e.openBlock(),e.createElementBlock("div",Pa,[e.createElementVNode("div",Za,e.toDisplayString(ae.value.title),1),e.createElementVNode("div",Ua,e.toDisplayString(ae.value.value),1)])),ae.value.categoryIndex!==void 0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[Ie(ae.value.categoryIndex).flagGroups.length>0?(e.openBlock(),e.createElementBlock("div",Wa,[u[6]||(u[6]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",qa,e.toDisplayString(e.unref(F)("chart.tooltip.flags")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ie(ae.value.categoryIndex).flagGroups,(s,t)=>(e.openBlock(),e.createElementBlock("div",{key:`tooltip-flag-group-${t}`},[e.createElementVNode("div",Xa,[e.createElementVNode("div",{class:"dss-tooltip-item-indicator",style:e.normalizeStyle({backgroundColor:s.color})},null,4),e.createElementVNode("span",null,e.toDisplayString(s.type),1)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.flags,(o,n)=>(e.openBlock(),e.createElementBlock("div",{key:`tooltip-flag-${t}-${n}`,class:"dss-tooltip-item dss-tooltip-item-no-indicator"},[e.createElementVNode("div",Ya,[e.createElementVNode("div",ja,e.toDisplayString(o.text),1)])]))),128))]))),128))])):e.createCommentVNode("",!0),Ie(ae.value.categoryIndex).markers.length>0?(e.openBlock(),e.createElementBlock("div",Ka,[u[7]||(u[7]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",Ga,e.toDisplayString(e.unref(F)("chart.tooltip.markers")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ie(ae.value.categoryIndex).markers,(s,t)=>(e.openBlock(),e.createElementBlock("div",{key:`tooltip-marker-${t}`,class:"dss-tooltip-item"},[e.createElementVNode("div",{class:"dss-tooltip-item-indicator",style:e.normalizeStyle({backgroundColor:s.color})},null,4),e.createElementVNode("div",Ja,[e.createElementVNode("div",Qa,e.toDisplayString(s.title),1),s.description?(e.openBlock(),e.createElementBlock("div",es,e.toDisplayString(s.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",ts,[e.createElementVNode("div",os,e.toDisplayString(ke.value?yn():A.categories[I.value.categoryIndex]||`Category ${I.value.categoryIndex+1}`),1),ke.value?(e.openBlock(),e.createElementBlock("div",ns,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(I.value.data,(s,t)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-tooltip-${t}`,class:"dss-bubble-tooltip-item"},e.toDisplayString(s.value),1))),128))])):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(I.value.data,(s,t)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-tooltip-${t}`,class:"dss-tooltip-series"},[e.createElementVNode("div",{class:"dss-tooltip-series-indicator",style:e.normalizeStyle({backgroundColor:s.color})},null,4),e.createElementVNode("span",ls,e.toDisplayString(s.seriesName)+":",1),e.createElementVNode("span",as,e.toDisplayString(s.value),1)]))),128))]),Ie(I.value.categoryIndex).flagGroups.length>0?(e.openBlock(),e.createElementBlock("div",ss,[u[8]||(u[8]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",rs,e.toDisplayString(e.unref(F)("chart.tooltip.flags")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ie(I.value.categoryIndex).flagGroups,(s,t)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-flag-group-${t}`},[e.createElementVNode("div",is,[e.createElementVNode("div",{class:"dss-tooltip-item-indicator",style:e.normalizeStyle({backgroundColor:s.color})},null,4),e.createElementVNode("span",null,e.toDisplayString(s.type),1)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.flags,(o,n)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-flag-${t}-${n}`,class:"dss-tooltip-item dss-tooltip-item-no-indicator"},[e.createElementVNode("div",cs,[e.createElementVNode("div",ds,e.toDisplayString(o.text),1)])]))),128))]))),128))])):e.createCommentVNode("",!0),Ie(I.value.categoryIndex).markers.length>0?(e.openBlock(),e.createElementBlock("div",us,[u[9]||(u[9]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",ms,e.toDisplayString(e.unref(F)("chart.tooltip.markers")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ie(I.value.categoryIndex).markers,(s,t)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-dss-marker-${t}`,class:"dss-tooltip-item"},[e.createElementVNode("div",{class:"dss-tooltip-item-indicator",style:e.normalizeStyle({backgroundColor:s.color})},null,4),e.createElementVNode("div",ps,[e.createElementVNode("div",fs,e.toDisplayString(s.title),1),s.description?(e.openBlock(),e.createElementBlock("div",vs,e.toDisplayString(s.description),1)):e.createCommentVNode("",!0)])]))),128))])):e.createCommentVNode("",!0)],64))],6)):e.createCommentVNode("",!0),Se.value&&Pe.value&&S.value.scale>1?(e.openBlock(),e.createElementBlock("div",{key:4,class:"dss-zoom-indicator",onClick:Ao},[u[10]||(u[10]=e.createElementVNode("span",{style:{display:"inline-block",transform:"scaleX(-1)","font-size":"14px"}},"⌕",-1)),e.createTextVNode(" "+e.toDisplayString(Math.round(S.value.scale*100))+"% "+e.toDisplayString(e.unref(F)("chart.zoom.doubleClickToReset")),1)])):e.createCommentVNode("",!0)],46,ll),oe.value.show?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-chart-context-menu",style:e.normalizeStyle({left:oe.value.x+"px",top:oe.value.y+"px"}),onClick:u[0]||(u[0]=e.withModifiers(()=>{},["stop"]))},[fe.value.addMarker?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-context-menu-item",onClick:In},e.toDisplayString(e.unref(F)("chart.contextMenu.addMarker")),1)):e.createCommentVNode("",!0),fe.value.addMarker&&(fe.value.downloadSvg||fe.value.downloadPng||fe.value.downloadCsv||We.value.length>0)?(e.openBlock(),e.createElementBlock("div",gs)):e.createCommentVNode("",!0),fe.value.downloadSvg?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-context-menu-item",onClick:sn},e.toDisplayString(e.unref(F)("chart.contextMenu.downloadSvg")),1)):e.createCommentVNode("",!0),fe.value.downloadPng?(e.openBlock(),e.createElementBlock("div",{key:3,class:"dss-context-menu-item",onClick:To},e.toDisplayString(e.unref(F)("chart.contextMenu.downloadPng")),1)):e.createCommentVNode("",!0),fe.value.downloadCsv?(e.openBlock(),e.createElementBlock("div",{key:4,class:"dss-context-menu-item",onClick:Bt},e.toDisplayString(e.unref(F)("chart.contextMenu.downloadCsv")),1)):e.createCommentVNode("",!0),We.value.length>0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:5},[fe.value.downloadSvg||fe.value.downloadPng||fe.value.downloadCsv?(e.openBlock(),e.createElementBlock("div",hs)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(We.value,(s,t)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"custom-"+t},[s.separator?(e.openBlock(),e.createElementBlock("div",ys)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(An(s)),style:e.normalizeStyle(Uo(s)),onClick:o=>_n(s)},[s.template?(e.openBlock(),e.createElementBlock("div",{key:0,innerHTML:Hn(s),class:"dss-custom-menu-content"},null,8,ks)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[s.icon?(e.openBlock(),e.createElementBlock("span",xs,e.toDisplayString(s.icon),1)):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(s.label),1)],64))],14,Cs)],64))),128))],64)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),$.value.show?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-marker-modal-overlay",onClick:be},[e.createElementVNode("div",{class:"dss-marker-modal",onClick:u[4]||(u[4]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",ws,[e.createElementVNode("h3",null,e.toDisplayString(Mt.value?e.unref(F)("chart.modalMarker.viewMarker"):oo.value?e.unref(F)("chart.modalMarker.editMarker"):e.unref(F)("chart.contextMenu.addMarker")),1),e.createElementVNode("button",{class:"dss-modal-close-btn",onClick:be},"×")]),e.createElementVNode("div",Es,[e.createElementVNode("div",bs,[$.value.fromButton?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("label",Vs,e.toDisplayString(yo($.value.categoryIndex)||""),1)),$.value.fromButton?(e.openBlock(),e.createElementBlock("div",Ss,[e.withDirectives(e.createElementVNode("select",{id:"dss-marker-category","onUpdate:modelValue":u[1]||(u[1]=s=>$.value.categoryIndex=s),class:"dss-form-select",disabled:Mt.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(tn.value,(s,t)=>(e.openBlock(),e.createElementBlock("option",{key:`category-option-${t}`,value:t},e.toDisplayString(s),9,Ms))),128))],8,Ns),[[e.vModelSelect,$.value.categoryIndex]])])):e.createCommentVNode("",!0)]),e.createElementVNode("div",Bs,[e.createElementVNode("label",Ts,e.toDisplayString(e.unref(F)("chart.modalMarker.description")),1),Mt.value?(e.openBlock(),e.createElementBlock("div",Hs,e.toDisplayString($.value.description),1)):e.withDirectives((e.openBlock(),e.createElementBlock("textarea",{key:1,id:"dss-marker-description","onUpdate:modelValue":u[2]||(u[2]=s=>$.value.description=s),placeholder:e.unref(F)("chart.modalMarker.placeholderDescription"),class:"dss-form-textarea",rows:"3"},null,8,As)),[[e.vModelText,$.value.description]])]),e.createElementVNode("div",Ls,[e.createElementVNode("label",null,e.toDisplayString(e.unref(F)("chart.modalMarker.iconPreview")),1),e.createElementVNode("div",$s,[e.createElementVNode("img",{src:ln({type:$.value.type}),alt:"Marker Icon Preview",class:"preview-icon",style:{width:"32px",height:"32px","border-radius":"50%",border:"2px solid #ddd"},onError:u[3]||(u[3]=s=>s.target.style.display="none")},null,40,Ds)])])]),e.createElementVNode("div",_s,[e.createElementVNode("div",Is,[oo.value&&!Mt.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-btn dss-btn-danger",onClick:at},e.toDisplayString(e.unref(F)("chart.modalMarker.deleteMarker")),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",Rs,[e.createElementVNode("button",{class:"dss-btn dss-btn-secondary",onClick:be},e.toDisplayString(Mt.value?e.unref(F)("chart.modalMarker.close"):e.unref(F)("chart.modalMarker.cancel")),1),Mt.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-btn dss-btn-primary",onClick:Dn,disabled:!($.value.description&&$.value.description.length)},e.toDisplayString(oo.value?e.unref(F)("chart.modalMarker.save"):e.unref(F)("chart.contextMenu.addMarker")),9,Fs))])])])])):e.createCommentVNode("",!0)],64))}}),Ps={class:"dss-modal-title"},Zs={class:"dss-modal-actions"},jn={__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(A,{emit:zt}){const F=A,b=zt,dt=e.ref(null),w=e.ref(null),X=e.computed(()=>{const D={"max-width":F.width};return F.height!=="auto"&&(D.height=F.height,D["min-height"]="0"),D}),kt=e.computed(()=>({}));function N(){b("close-modal")}function v(){F.backDrop&&!dt.value&&b("close-modal")}function Le(D){D.target.tagName==="INPUT"&&(dt.value=D.target.tagName)}function De(){setTimeout(()=>{dt.value=null},300)}function Oe(){const D=document.body,W=document.documentElement;w.value={bodyOverflow:D.style.overflow,bodyPosition:D.style.position,bodyTop:D.style.top,bodyWidth:D.style.width,htmlOverflow:W.style.overflow,scrollY:window.scrollY},D.style.overflow="hidden",D.style.position="fixed",D.style.top=`-${w.value.scrollY}px`,D.style.width="100%",D.style.left="0",W.style.overflow="hidden"}function T(){if(!w.value)return;const D=document.body,W=document.documentElement,{bodyOverflow:P,bodyPosition:et,bodyTop:J,bodyWidth:Q,htmlOverflow:tt,scrollY:bo}=w.value;D.style.overflow=P||"",D.style.position=et||"",D.style.top=J||"",D.style.width=Q||"",D.style.left="",W.style.overflow=tt||"",window.scrollTo(0,bo||0)}return e.watch(()=>F.showModal,D=>{if(D)Oe(),document.body.classList.add("dss-modal-open"),setTimeout(()=>{const W=document.getElementById("dss-modal-backdrop");W&&(W.addEventListener("focusin",Le),W.addEventListener("focusout",De))},100);else{T(),document.body.classList.remove("dss-modal-open");const W=document.getElementById("dss-modal-backdrop");W&&(W.removeEventListener("focusin",Le),W.removeEventListener("focusout",De))}},{immediate:!0}),e.onUnmounted(()=>{F.showModal&&T()}),(D,W)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[A.showModal?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-modal-backdrop",onClick:v},[e.withDirectives(e.createElementVNode("div",{id:"dss-modal-backdrop",class:"dss-modal",style:e.normalizeStyle(X.value)},[e.createElementVNode("div",{class:"dss-modal-content",onClick:W[0]||(W[0]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:"dss-modal-header",style:e.normalizeStyle({"justify-content":A.headerType,"font-size":A.titleSize})},[e.createElementVNode("h1",Ps,[e.renderSlot(D.$slots,"title",{},()=>[W[1]||(W[1]=e.createTextVNode("Default Title",-1))])]),e.renderSlot(D.$slots,"title-data"),A.showCloseBtn?(e.openBlock(),e.createElementBlock("span",{key:0,class:"dss-modal-close",onClick:N,title:"Close"},"×")):e.createCommentVNode("",!0)],4),e.createElementVNode("div",{class:"dss-modal-body",style:e.normalizeStyle(kt.value)},[e.renderSlot(D.$slots,"content",{},()=>[W[2]||(W[2]=e.createTextVNode("Default Content",-1))])],4),e.createElementVNode("div",Zs,[e.renderSlot(D.$slots,"actions")])])],4),[[e.vShow,A.showModal]])])):e.createCommentVNode("",!0)]))}},Us={class:"dss-toolbar-left"},Ws=["title"],qs=["title"],Xs={class:"dss-toolbar-dropdown-wrapper"},Ys=["title"],js={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"},Ks={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"},Gs={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"},Js={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"},Qs={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"},er={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"},tr={key:6,width:"13",height:"14",viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"paragraph-icon"},or=["title"],nr=["title"],lr=["title"],ar=["title"],sr=["title"],rr=["title"],ir=["title"],cr=["title"],dr=["title"],ur={key:2,class:"dss-toolbar-separator"},mr=["title"],pr={key:4,class:"dss-toolbar-separator"},fr={key:5,class:"dss-toolbar-dropdown-wrapper"},vr=["title"],gr={class:"dss-toolbar-dropdown-ai"},hr={class:"dss-toolbar-right"},yr={key:0,class:"dss-toolbar-custom-group"},Cr={key:1,class:"dss-toolbar-separator"},kr={class:"dss-link-modal-content"},xr={class:"dss-link-modal-field"},wr={class:"dss-link-modal-label"},Er=["placeholder"],br={class:"dss-link-modal-field"},Vr={class:"dss-link-modal-label"},Sr=["placeholder"],Nr={class:"dss-image-modal-tabs"},Mr={key:0,class:"dss-image-tab-content"},Br={class:"dss-link-modal-content"},Tr={class:"dss-link-modal-field"},Hr={key:0,class:"dss-link-modal-label"},Ar=["src"],Lr={class:"dss-link-modal-field"},$r={class:"dss-link-modal-label"},Dr=["placeholder"],_r={class:"dss-link-modal-field"},Ir={class:"dss-link-modal-label"},Rr=["placeholder"],Fr={class:"dss-link-modal-field"},zr={class:"dss-link-modal-label"},Or=["placeholder"],Pr={key:1,class:"dss-image-tab-content"},Zr={class:"dss-link-modal-content"},Ur={class:"dss-link-modal-field"},Wr={class:"dss-link-modal-label"},qr=["placeholder"],Xr={class:"dss-link-modal-field"},Yr={class:"dss-link-modal-label"},jr=["placeholder"],Kr={class:"dss-link-modal-field"},Gr={class:"dss-link-modal-label"},Jr=["placeholder"],Qr={class:"dss-link-modal-field"},ei={class:"dss-link-modal-label"},ti=["placeholder"],oi={class:"dss-text-editor-title-input-container"},ni={key:0,class:"dss-text-editor-title-preview"},li={key:0},ai={key:1,class:"dss-text-editor-preview-placeholder"},si=["value","placeholder","disabled"],ri={key:2,class:"dss-text-editor-title-slot dss-text-editor-slot-last"},ii={class:"dss-text-editor-description-input-container"},ci={key:0,class:"dss-text-editor-description-preview"},di={key:0},ui={key:1,class:"dss-text-editor-preview-placeholder"},mi=["value","placeholder","disabled"],pi={key:3,class:"dss-text-editor-description-slot dss-text-editor-slot-last"},fi=["data-comment-id","onMouseenter"],vi=["onClick"],gi=["src","alt"],hi={key:1},yi=["onClick"],Ci=["src","alt"],ki={key:1},xi=["data-has-second-user","onClick"],wi={class:"editor-comment-marker-count"},Ei={key:4,class:"dss-text-editor-textarea-wrapper"},bi=["value","placeholder","rows","disabled"],Vi={class:"dss-text-editor-footer"},Si={class:"dss-text-editor-footer-content"},Ni={class:"dss-text-editor-footer-stat"},Mi={class:"dss-text-editor-footer-stat"},Bi={key:5,class:"dss-text-editor-content-wrapper"},Ti={key:0,class:"dss-comment-overlay-body"},Hi={class:"dss-comment-selection-wrapper"},Ai=["innerHTML"],Li={class:"dss-comment-messages-wrapper"},$i={key:0,class:"dss-comment-avatar-wrapper"},Di={class:"dss-comment-avatar"},_i=["src","alt"],Ii={key:1},Ri={class:"dss-comment-header"},Fi={class:"dss-comment-header-text"},zi={class:"dss-comment-author"},Oi={key:0,class:"dss-comment-date"},Pi=["onClick","title"],Zi={class:"dss-comment-overlay-inner"},Ui=["placeholder","onKeydown"],Wi={class:"dss-text-editor-footer"},qi={class:"dss-text-editor-footer-content"},Xi={class:"dss-text-editor-footer-stat"},Yi={class:"dss-text-editor-footer-stat"},ji=["title"],Ki=["title"],Gi={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:""},Ji={class:"dss-image-popup-content"},Qi={key:0,class:"dss-image-popup-no-alt-icon"},ec=["title"],tc=["title"],oc={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:""},nc={class:"dss-toolbar-left"},lc=["title"],ac=["title"],sc={class:"dss-toolbar-dropdown-wrapper"},rc=["title"],ic={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"},cc={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"},dc={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"},uc={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"},mc={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"},pc={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"},vc=["title"],gc=["title"],hc=["title"],yc=["title"],Cc=["title"],kc=["title"],xc=["title"],wc=["title"],Ec=["title"],bc=["title"],Vc={key:2,class:"dss-toolbar-separator"},Sc={key:3,class:"dss-toolbar-dropdown-wrapper"},Nc=["title"],Mc={class:"dss-toolbar-dropdown-ai"},Bc={key:0,class:"dss-toolbar-right"},Tc={key:0,class:"dss-toolbar-separator"},Hc={key:0,class:"dss-toolbar-custom-group"},Ac={key:1,class:"dss-toolbar-separator"},Lc={name:"DSSTextEditor"},$c=Object.assign(Lc,{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:A=>typeof A=="object"&&A!==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:A=>typeof A=="object"&&A!==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(A,{expose:zt,emit:F}){const{t:b,locale:dt}=Jn.useI18n(),w=A,X=F,kt=e.useSlots(),N=`<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
73
+ `,t+="Category",D.series.forEach(f=>{const C=f.name.replace(/"/g,'""');t+=',"'+C+'"'}),t+=`
74
+ `;const r=Math.max(...D.series.map(f=>f.data?.length||0));for(let f=0;f<r;f++){let b='"'+(D.categories[f]||J("chart.fallback.item",{number:f+1})).toString().replace(/"/g,'""')+'"';D.series.forEach(V=>{const N=V.data&&V.data[f]!==void 0?V.data[f]:"";b+=","+N}),t+=b+`
75
+ `}const n=new Blob([t],{type:"text/csv;charset=utf-8;"}),c=URL.createObjectURL(n),v=document.createElement("a");v.href=c,v.download=Io("csv"),document.body.appendChild(v),v.click(),document.body.removeChild(v),URL.revokeObjectURL(c),Xt()}catch(t){console.error("Error downloading CSV:",t)}},On=t=>{if(typeof t.action=="function"){const r={series:D.series,categories:D.categories,markers:Me.value},n={chartX:re.value.chartX,chartY:re.value.chartY,dataX:re.value.mouseDataX,dataY:re.value.mouseDataY,categoryIndex:clampedCategoryIndex||re.value.categoryIndex};t.action(r,n)}Xt()},it=()=>{at(),X.value.show=!0,X.value.categoryIndex=re.value.categoryIndex,X.value.fromButton=!1,Xt()},Zn=()=>{at(),X.value.show=!0,X.value.categoryIndex=0,X.value.fromButton=!0},Wn=t=>{if(re.value.show){const r=document.querySelector(".dss-context-menu");r&&!r.contains(t.target)&&(re.value.show=!1)}},qe=t=>{re.value.show&&!t.target.closest(".context-menu")&&(re.value.show=!1)},Kt=t=>{if(!De.value||!Pt.value)return;t.preventDefault(),t.stopPropagation(),A.value.isZooming=!0,ne.value.show=!1,A.value.zoomTimeout&&clearTimeout(A.value.zoomTimeout);const n=t.currentTarget.getBoundingClientRect(),c=t.clientX-n.left,v=t.clientY-n.top;if(c<E.value.left-50||c>E.value.right+50||v<E.value.top-50||v>E.value.bottom+100){A.value.isZooming=!1;return}const f=t.deltaY>0?.9:1.1,C=Math.max(A.value.minScale,Math.min(A.value.maxScale,A.value.scale*f));if(C!==A.value.scale){const{minX:y,maxX:b}=he.value,V=b-y||1,N=V/A.value.scale,M=y-A.value.offsetX/E.value.width*V,R=(c-E.value.left)/E.value.width,q=M+R*N;A.value.scale=C;const Y=V/A.value.scale,I=q-R*Y;A.value.offsetX=-(I-y)/V*E.value.width,A.value.scale<=1.01&&(A.value.scale=1,A.value.offsetX=0)}A.value.zoomTimeout=setTimeout(()=>{A.value.isZooming=!1,A.value.zoomTimeout=null},300)},Mo=t=>{if(!De.value||!Pt.value||A.value.scale<=1)return;ne.value.show=!1;const n=t.currentTarget.getBoundingClientRect();t.clientX-n.left,t.clientY-n.top,A.value.isDragging=!0,A.value.lastMouseX=t.clientX,A.value.lastMouseY=t.clientY,t.preventDefault()},Gt=()=>{A.value.isDragging=!1},Mt=()=>{!De.value||!Pt.value||(A.value.scale=1,A.value.offsetX=0,A.value.isDragging=!1,A.value.zoomTimeout&&(clearTimeout(A.value.zoomTimeout),A.value.zoomTimeout=null),A.value.isZooming=!1)},io=()=>!De.value||!hn.value||!Pt.value?"default":A.value.isDragging?"grabbing":A.value.scale>1?"grab":"dss-crosshair",_t=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 r=`M ${t[0].x} ${t[0].y}`;for(let n=0;n<t.length-1;n++){const c=t[Math.max(n-1,0)],v=t[n],f=t[n+1],C=t[Math.min(n+2,t.length-1)],y=v.x+(f.x-c.x)/6*te.value,b=v.y+(f.y-c.y)/6*te.value,V=f.x-(C.x-v.x)/6*te.value,N=f.y-(C.y-v.y)/6*te.value;r+=` C ${y} ${b} ${V} ${N} ${f.x} ${f.y}`}return r},$e=e.computed(()=>{let r=50+(Ao.value?30:0)+60;if(Jt.value)return{left:90,top:90,right:90,bottom:90};if(vt.value){let C=0;j.value&&(C+=15),xe.value&&(C+=10);const y=gt();let b=66,V=50;return Ce.value&&Ae.value==="left"?b+=y.legendWidth||150:Ce.value&&Ae.value==="right"&&(V+=y.legendWidth||150),{left:b,top:50+C,right:V,bottom:130}}let n=0;j.value&&(n+=15),xe.value&&(n+=10);const c=gt();let v=66,f=50;return Ce.value&&Ae.value==="left"?v+=c.legendWidth||150:Ce.value&&Ae.value==="right"&&(f+=c.legendWidth||150),Ce.value&&Ae.value==="bottom"&&(r+=c.legendHeight||0),{left:v,top:50+n,right:f,bottom:r}}),E=e.computed(()=>({left:$e.value.left,top:$e.value.top,right:Ze.value-$e.value.right,bottom:je.value-$e.value.bottom,width:Ze.value-($e.value.left+$e.value.right),height:je.value-($e.value.top+$e.value.bottom)})),De=e.computed(()=>["line","area","bar"].includes(ae.value)||Eo.value),Bt=e.computed(()=>Eo.value),vt=e.computed(()=>["radial","semi-radial"].includes(ae.value)),Jt=e.computed(()=>ae.value==="spider"),Be=e.computed(()=>ae.value==="bubble"),Xe=e.computed(()=>$.value?.chart?.orientation==="horizontal"&&(ae.value==="bar"||Bt.value)),Qt=t=>{const{minY:r,maxY:n}=he.value,c=n-r||1;return E.value.left+(t-r)/c*E.value.width},yo=t=>{const{maxX:r}=he.value,n=r+1,v=E.value.height/n;return E.value.top+(t+.5)*v},Ve=e.computed(()=>Ze.value/2),Se=e.computed(()=>Jt.value?je.value/2-40:je.value/2),ce=e.computed(()=>{if(Jt.value){const t=E.value.width-80,r=E.value.height-80;return Math.min(t,r)/2}return Math.min(E.value.width,E.value.height)/2}),ot=e.computed(()=>{const t=$.value,r=t?.plotOptions?.radialBar?.innerRadiusRatio??t?.radialBar?.innerRadiusRatio,n=typeof r=="number"&&r>=0&&r<=1?r:.45;return ce.value*n}),_o=e.ref(0),Un=e.computed(()=>`semi-radial-fill-clip-${D.chartId}`),Ro=e.computed(()=>ae.value==="semi-radial"),Jo=e.computed(()=>Ro.value&&tt.value&&!Q.value),qn=e.computed(()=>{const t=Jo.value?_o.value:1,r=Ve.value,n=Se.value,c=ot.value,v=ce.value,f=Math.PI,C=Math.PI+t*Math.PI;if(t<=0)return`M ${r} ${n} L ${r} ${n} Z`;const y=r+v*Math.cos(f),b=n+v*Math.sin(f),V=r+v*Math.cos(C),N=n+v*Math.sin(C),M=r+c*Math.cos(C),R=n+c*Math.sin(C),q=r+c*Math.cos(f),Y=n+c*Math.sin(f),I=t>.5?1:0;return`M ${r} ${n} L ${y} ${b} A ${v} ${v} 0 ${I} 1 ${V} ${N} L ${M} ${R} A ${c} ${c} 0 ${I} 1 ${q} ${Y} Z`}),Xn=e.computed(()=>Ro.value&&Jo.value?`url(#${Un.value})`:void 0),Co=e.ref(0),Yn=e.computed(()=>`radial-reveal-clip-${D.chartId}`),Rt=e.computed(()=>ae.value==="radial"),Bo=e.computed(()=>{const t=Rt.value?Co.value:1,r=Ve.value,n=Se.value,c=Math.max(ce.value*1.5,Ze.value,je.value);if(t<=0)return`M ${r} ${n} L ${r} ${n} Z`;if(t>=1){const M=r-c,R=r+c;return`M ${M} ${n} A ${c} ${c} 0 0 1 ${R} ${n} A ${c} ${c} 0 0 1 ${M} ${n} Z`}const v=-Math.PI/2,f=v+t*Math.PI*2,C=r+c*Math.cos(v),y=n+c*Math.sin(v),b=r+c*Math.cos(f),V=n+c*Math.sin(f),N=t>=.5?1:0;return`M ${r} ${n} L ${C} ${y} A ${c} ${c} 0 ${N} 1 ${b} ${V} Z`}),Qo=e.computed(()=>{if(Xn.value)return Xn.value;if(Rt.value)return`url(#${Yn.value})`});let co=null;const fl=()=>{if(!Jo.value)return;_o.value=0;const t=dt.value,r=performance.now(),n=c=>{const v=c-r,f=Math.min(1,v/t);_o.value=F(pt.value,f),f<1&&(co=requestAnimationFrame(n))};co=requestAnimationFrame(n)},jn=e.computed(()=>$.value?.bubbles?.minSize||8),Kn=e.computed(()=>$.value?.bubbles?.maxSize||50),eo=e.computed(()=>$.value?.bubbles?.opacity||.7),to=(t,r)=>{const n=[15,20,25,18,22],c=n[t%n.length]||20,v=1+Math.sin(r*.5)*.2;return Math.max(5,c*v)},ko=t=>{const r=document.querySelector(`.dss-bubble-image-${t}`);r&&(r.style.opacity="1")},Fo=t=>{const r=document.querySelector(`.dss-bubble-image-${t}`);r&&(r.style.display="none")},me=e.computed(()=>D.series),uo=e.computed(()=>D.series.filter((t,r)=>!Ee.value.has(r))),oo="auto",he=e.computed(()=>{if(Be.value)return xo();if(!uo.value.length)return{minX:0,maxX:1,minY:0,maxY:1};let t=1/0,r=-1/0,n=0;uo.value.forEach(y=>{y.data&&y.data.length&&(n=Math.max(n,y.data.length-1),y.data.forEach(b=>{typeof b=="number"&&(t=Math.min(t,b),r=Math.max(r,b))}))}),D.categories.length>0&&(n=Math.max(n,D.categories.length-1)),t===1/0&&(t=0,r=100);const c=lo.value,v=Ct.value;let f,C;if(c===oo){const y=r-t,b=y>0?y*.1:1;f=Math.max(0,t-b)}else if(typeof c=="number")f=c;else{const y=r-t,b=y>0?y*.1:1;f=Math.max(0,t-b)}if(v===oo){const y=r-t,b=y>0?y*.1:2;C=r+b}else if(typeof v=="number")C=v;else{const y=r-t,b=y>0?y*.1:2;C=r+b}return{minX:0,maxX:n,minY:f,maxY:C}}),xo=()=>{if(!uo.value.length)return{minX:0,maxX:8,minY:0,maxY:50,minSize:10,maxSize:30};let t=1/0,r=-1/0,n=1/0,c=-1/0,v=1/0,f=-1/0,C=!1;if(uo.value.forEach((q,Y)=>{q?.data?.length&&q.data.forEach((I,Z)=>{let P,_,ee;if(typeof I=="object"&&I!==null&&!Array.isArray(I))P=typeof I.x=="number"?I.x:Z,_=typeof I.y=="number"?I.y:0,ee=typeof I.size=="number"?I.size:20;else if(Array.isArray(I)&&I.length>=3)P=typeof I[0]=="number"?I[0]:Z,_=typeof I[1]=="number"?I[1]:0,ee=typeof I[2]=="number"?I[2]:20;else if(typeof I=="number")P=Z,_=I,ee=to(Y,Z);else return;isFinite(P)&&isFinite(_)&&isFinite(ee)&&(t=Math.min(t,P),r=Math.max(r,P),n=Math.min(n,_),c=Math.max(c,_),v=Math.min(v,ee),f=Math.max(f,ee),C=!0)})}),!C)return{minX:0,maxX:8,minY:0,maxY:50,minSize:10,maxSize:30};t===r&&(t=Math.min(t,0),r=Math.max(r,D.categories?.length-1||8)),n===c&&(n=Math.max(0,n-10),c=n+20);const y=r-t,b=c-n;let V,N,M,R;return Lo.value!==null?V=Lo.value:V=t-y*.1,kt.value!==null?N=kt.value:N=r+y*.1,lo.value!==null&&typeof lo.value=="number"?M=lo.value:M=Math.max(0,n-b*.1),Ct.value!==null&&typeof Ct.value=="number"?R=Ct.value:R=c+b*.1,{minX:V,maxX:N,minY:M,maxY:R,minSize:v,maxSize:f}},ge=t=>{if(Be.value){const{minX:y,maxX:b}=he.value,V=b-y||1;return E.value.left+(t-y)/V*E.value.width}const{minX:r,maxX:n}=he.value,c=n-r;if(n===0||c===0)return E.value.left+E.value.width/2;const v=c/A.value.scale,f=r-A.value.offsetX/E.value.width*c,C=(t-f)/v;return E.value.left+C*E.value.width},we=t=>{const{minY:r,maxY:n}=he.value,c=n-r||1;return E.value.bottom-(t-r)/c*E.value.height},To=t=>{if(!Be.value)return Ke.value||4;const{maxSize:r}=he.value,n=Math.max(1,r),c=Math.min(1,Math.max(0,t/n));return jn.value+c*(Kn.value-jn.value)},vl=e.computed(()=>wn.value.map(t=>({y:t.y}))),xn=e.computed(()=>{if(Be.value)return zo();if(ae.value==="bar"){if(Xe.value){const O=[],{minY:W,maxY:K}=he.value,G=5,de=K-W||1;for(let pe=0;pe<=G;pe++){const ht=W+de*(pe/G),Ge=Qt(ht);O.push({x:Ge,y:E.value.bottom+20,text:Math.round(ht).toString()})}return O}const Y=[],{maxX:I}=he.value,Z=I+1,P=5,ee=(E.value.width-P*2)/Z;for(let O=0;O<=I;O++){const W=E.value.left+P+(O+.5)*ee;Y.push({x:W,y:E.value.bottom+20,text:D.categories[O]||J("chart.fallback.item",{number:O+1})})}return Y}const t=[],{minX:r,maxX:n}=he.value,c=n-r||1,v=c/A.value.scale,f=r-A.value.offsetX/E.value.width*c,C=f+v,y=Math.max(0,Math.floor(f-2)),b=Math.min(n,Math.ceil(C+2)),V=b-y,N=E.value.width,R=Math.floor(N/60);let q=1;V>R&&(q=Math.ceil(V/R));for(let Y=y;Y<=b;Y+=q)if(Y>=0&&Y<=n){const I=ge(Y);I>=E.value.left-100&&I<=E.value.right+100&&t.push({x:I,y:E.value.bottom+20,text:D.categories[Y]||`Item ${Y+1}`})}return t}),zo=()=>{const t=[],{minX:r,maxX:n}=he.value,c=n-r||1,v=Math.min(8,Math.max(4,Math.floor(E.value.width/80)));for(let f=0;f<=v;f++){const C=r+c*f/v,y=ge(C);if(y>=E.value.left-10&&y<=E.value.right+10){const b=Math.round(C),V=D.categories?.[b];t.push({x:y,y:E.value.bottom+20,text:V||(Number.isInteger(C)?C.toString():C.toFixed(1))})}}return t},wn=e.computed(()=>{if(Xe.value){const v=[],{maxX:f}=he.value;for(let C=0;C<=f;C++)v.push({x:E.value.left-10,y:yo(C),text:D.categories[C]||`Item ${C+1}`});return v}const t=[],{minY:r,maxY:n}=he.value,c=5;for(let v=0;v<=c;v++){const f=r+(n-r)*(v/c),C=Math.round(f);t.push({x:E.value.left-10,y:we(f),text:C.toString()})}return t}),ye=t=>{const r=$t.value;if(!r||r.length===0){const n=["#3B82F6","#EF4444","#10B981","#F59E0B","#8B5CF6","#F97316","#06B6D4","#84CC16"];return n[t%n.length]}return r[t%r.length]},en=t=>{if(!t||typeof t!="string")return t;const r=t.trim(),n=r.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i);if(n){const f=Math.max(0,Math.floor(Number(n[1])*.65)),C=Math.max(0,Math.floor(Number(n[2])*.65)),y=Math.max(0,Math.floor(Number(n[3])*.65));return`rgb(${f}, ${C}, ${y})`}const c=r.match(/^rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)\s*\)$/i);if(c){const f=Math.max(0,Math.floor(Number(c[1])*.65)),C=Math.max(0,Math.floor(Number(c[2])*.65)),y=Math.max(0,Math.floor(Number(c[3])*.65));return`rgba(${f}, ${C}, ${y}, ${c[4]})`}const v=r.match(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/);if(v){let f=v[1];f.length===3&&(f=f[0]+f[0]+f[1]+f[1]+f[2]+f[2]);const C=Math.max(0,Math.min(255,Math.floor(parseInt(f.slice(0,2),16)*.65))),y=Math.max(0,Math.min(255,Math.floor(parseInt(f.slice(2,4),16)*.65))),b=Math.max(0,Math.min(255,Math.floor(parseInt(f.slice(4,6),16)*.65)));return`#${[C,y,b].map(V=>V.toString(16).padStart(2,"0")).join("")}`}return r},Gn=(t,r)=>{const c=$.value?.stroke?.color;return c==null?en(r):typeof c=="string"?c:Array.isArray(c)&&c.length?c[t%c.length]??en(r):en(r)},bn=t=>{let r=0;for(let n=1;n<t.length;n++){const c=t[n].x-t[n-1].x,v=t[n].y-t[n-1].y;r+=Math.sqrt(c*c+v*v)}return r},Po=e.computed(()=>ae.value==="line"||Bt.value?(Bt.value?D.series.filter(r=>(r.type||ae.value)==="line"):me.value).map((r,n)=>{const c=D.series.findIndex(M=>M===r),v=[];let f=[];r.data.forEach((M,R)=>{M==null?f.length>0&&(v.push([...f]),f=[]):f.push({x:Xe.value?Qt(M):ge(R),y:Xe.value?yo(R):we(M),index:R})}),f.length>0&&v.push(f);let C="";v.forEach(M=>{if(M.length>0){let R="";lt.value?R=_t(M):R=`M ${M[0].x} ${M[0].y}`+M.slice(1).map(q=>` L ${q.x} ${q.y}`).join(""),C+=(C?" ":"")+R}});const y=v.reduce((M,R)=>M+bn(R),0),b=Ee.value.has(c),V=U.value===c,N=U.value!==null&&U.value!==c;return{path:C,color:ye(c),pathLength:y,seriesIndex:c,animationDelay:n*se.value,isHighlighted:V,isDimmed:N,isHidden:b}}):[]),tn=e.computed(()=>{if(!(ae.value==="line"||Bt.value))return[];const t=Bt.value?D.series.filter(n=>(n.type||ae.value)==="line"):me.value,r=[];return t.forEach((n,c)=>{const v=D.series.findIndex(f=>f===n);for(let f=0;f<n.data.length-1;f++){const C=n.data[f];if(C!=null){let y=-1,b=0;for(let V=f+1;V<n.data.length;V++){const N=n.data[V];if(N==null)b++;else{y=V;break}}if(b>0&&y!==-1){const V=n.data[y],N=Xe.value?Qt(C):ge(f),M=Xe.value?yo(f):we(C),R=Xe.value?Qt(V):ge(y),q=Xe.value?yo(y):we(V),Y=Ee.value.has(v),I=U.value===v,Z=U.value!==null&&U.value!==v;r.push({path:`M ${N} ${M} L ${R} ${q}`,color:ye(v),seriesIndex:v,animationDelay:c*se.value,isHighlighted:I,isDimmed:Z,isHidden:Y,gapSize:b}),f=y-1}}}}),r}),En=e.computed(()=>ae.value==="line"||Bt.value?!tt.value||Q.value||L.value.hasAnimated?[]:(Bt.value?D.series.filter(r=>(r.type||ae.value)==="line"):me.value).map((r,n)=>{const c=D.series.findIndex(b=>b===r);let v="",f=null;r.data.forEach((b,V)=>{if(b!=null){const N={x:Xe.value?Qt(b):ge(V),y:Xe.value?yo(V):we(b)};f===null?v+=`M ${N.x} ${N.y}`:v+=` L ${N.x} ${N.y}`,f=N}else if(f!==null){const N=r.data.findIndex((M,R)=>R>V&&M!==null&&M!==void 0);if(N!==-1){const M={x:Xe.value?Qt(r.data[N]):ge(N),y:Xe.value?yo(N):we(r.data[N])};v+=` L ${M.x} ${M.y}`,f=M}}});const C=r.data.map((b,V)=>b==null?null:{x:Xe.value?Qt(b):ge(V),y:Xe.value?yo(V):we(b)}).filter(b=>b!==null),y=bn(C);return{path:v,pathLength:y,color:ye(c),animationDelay:n*se.value,seriesIndex:c}}):[]),hl=e.computed(()=>{if(ae.value!=="line")return[];const t=[];return me.value.forEach((r,n)=>{const c=U.value===n,v=U.value!==null&&U.value!==n,f=Ee.value.has(n);r.data.forEach((C,y)=>{C!=null&&t.push({x:ge(y),y:we(C),color:ye(n),value:C,label:D.categories[y]||y.toString(),seriesName:r.name,categoryIndex:y,dataIndex:y,animationDelay:(n*r.data.length+y)*(se.value/8),isHighlighted:c,isDimmed:v,isHidden:f})})}),t}),Jn=e.computed(()=>{if(!Bt.value)return[];const t=[];return D.series.filter(n=>(n.type||ae.value)==="line").forEach((n,c)=>{const v=D.series.findIndex(b=>b===n),f=U.value===v,C=U.value!==null&&U.value!==v,y=Ee.value.has(v);n.data.forEach((b,V)=>{b!=null&&t.push({x:ge(V),y:we(b),color:ye(v),value:b,label:D.categories[V]||V.toString(),seriesName:n.name,categoryIndex:V,dataIndex:V,animationDelay:(c*n.data.length+V)*(se.value/8),isHighlighted:f,isDimmed:C,isHidden:y})})}),t}),Ho=e.computed(()=>{if(!Be.value)return[];const t=[];return me.value.forEach((r,n)=>{if(!r?.data?.length)return;const c=U.value,v=c!==null&&c===n,f=c!==null&&c!==n,C=Ee.value.has(n);r.data.forEach((y,b)=>{let V,N,M,R,q;if(typeof y=="object"&&y!==null&&!Array.isArray(y))V=typeof y.x=="number"?y.x:b,N=typeof y.y=="number"?y.y:0,M=typeof y.size=="number"?y.size:20,R=y.label||D.categories?.[b]||`Point ${b+1}`,q=y.image||y.imageUrl;else if(Array.isArray(y)&&y.length>=3)V=typeof y[0]=="number"?y[0]:b,N=typeof y[1]=="number"?y[1]:0,M=typeof y[2]=="number"?y[2]:20,R=y[3]||D.categories?.[b]||`Point ${b+1}`,q=y[4];else if(typeof y=="number")V=b,N=y,M=to(n,b),R=D.categories?.[b]||`Point ${b+1}`;else return;!isFinite(V)||!isFinite(N)||!isFinite(M)||t.push({x:ge(V),y:we(N),radius:To(M),originalX:V,originalY:N,originalSize:M,color:ye(n),seriesName:r.name||`Series ${n+1}`,label:R,imageUrl:q,seriesIndex:n,dataIndex:b,categoryIndex:Math.round(V),isHighlighted:v,isDimmed:f,isHidden:C,opacity:eo.value})})}),t}),on=e.computed(()=>ae.value!=="area"?[]:me.value.map((t,r)=>{const n=[];let c=[];if(t.data.forEach((M,R)=>{M==null?c.length>0&&(n.push([...c]),c=[]):c.push({x:ge(R),y:we(M),index:R})}),c.length>0&&n.push(c),n.length===0)return{linePath:"",areaPath:"",color:ye(r),isHidden:Ee.value.has(r)};const v=E.value.bottom+1;let f="",C="";n.forEach((M,R)=>{if(M.length===0)return;let q=`M ${M[0].x} ${M[0].y}`;lt.value&&M.length>1?q=_t(M):M.slice(1).forEach(I=>{q+=` L ${I.x} ${I.y}`}),f+=(f?" ":"")+q;let Y=`M ${M[0].x} ${v}`;if(Y+=` L ${M[0].x} ${M[0].y}`,lt.value&&M.length>1){const I=_t(M),Z=I.substring(I.indexOf("C")||I.indexOf("Q")||I.indexOf("L"));Z?Y+=" "+Z:M.slice(1).forEach(P=>{Y+=` L ${P.x} ${P.y}`})}else M.slice(1).forEach(I=>{Y+=` L ${I.x} ${I.y}`});Y+=` L ${M[M.length-1].x} ${v} Z`,C+=(C?" ":"")+Y});const y=U.value===r,b=U.value!==null&&U.value!==r,V=Ee.value.has(r),N=n.reduce((M,R)=>M+bn(R),0);return{linePath:f,areaPath:C,color:ye(r),pathLength:N,isHighlighted:y,isDimmed:b,isHidden:V}})),Qn=e.computed(()=>{if(!(["bar"].includes(ae.value)||Bt.value))return[];const t=[],{maxX:r}=he.value,n=Bt.value?D.series.filter(v=>(v.type||ae.value)==="bar"):me.value,c=n.length;if(Xe.value){const v=r+1,C=E.value.height/v,y=C*(2/3),b=Math.min(4,y/c*.15),V=y-(c-1)*b,N=Math.max(4,V/c);n.forEach((M,R)=>{const q=D.series.findIndex(P=>P===M),Y=U.value===q,I=U.value!==null&&U.value!==q,Z=Ee.value.has(q);M.data.forEach((P,_)=>{if(P==null||typeof P!="number"||!isFinite(P))return;const W=E.value.top+(_+.5)*C-y/2+R*(N+b),K=E.value.left,G=Math.abs(Qt(P)-E.value.left);let de="";if(lt.value&&G>0){const pe=Math.min(ve.value,N/2,G/2);de=[`M ${K} ${W}`,`L ${K+G-pe} ${W}`,`Q ${K+G} ${W} ${K+G} ${W+pe}`,`L ${K+G} ${W+N-pe}`,`Q ${K+G} ${W+N} ${K+G-pe} ${W+N}`,`L ${K} ${W+N}`,"Z"].join(" ")}t.push({x:K,y:W,width:G,height:N,color:ye(c===1?_:q),value:P,label:D.categories[_]||_.toString(),seriesName:M.name,animationDelay:(R*n.length+_)*(se.value/4),isHighlighted:Y,isDimmed:I,isHidden:Z,barPath:de,isSmooth:lt.value&&G>0})})})}else{const v=r+1,C=E.value.width/v,y=C*.8,b=y/c,V=b*.05,N=b-V;n.forEach((M,R)=>{const q=D.series.findIndex(P=>P===M),Y=U.value===q,I=U.value!==null&&U.value!==q,Z=Ee.value.has(q);M.data.forEach((P,_)=>{if(P==null||typeof P!="number"||!isFinite(P))return;const W=E.value.left+(_+.5)*C-y/2+R*b+V/2,K=we(Math.max(0,P)),G=Math.abs(we(0)-we(P));let de="";if(lt.value&&G>0){const pe=Math.min(ve.value,N/2,G/2);de=[`M ${W} ${K+G}`,`L ${W} ${K+pe}`,`Q ${W} ${K} ${W+pe} ${K}`,`L ${W+N-pe} ${K}`,`Q ${W+N} ${K} ${W+N} ${K+pe}`,`L ${W+N} ${K+G}`,"Z"].join(" ")}t.push({x:W,y:K,width:N,height:G,color:ye(c===1?_:q),value:P,label:D.categories[_]||_.toString(),seriesName:M.name,animationDelay:(R*n.length+_)*(se.value/4),isHighlighted:Y,isDimmed:I,isHidden:Z,barPath:de,isSmooth:lt.value&&G>0})})})}return t}),Oo=e.computed(()=>{if(!vt.value)return[];const t=me.value.map((f,C)=>({series:f,originalIndex:C})).filter(({originalIndex:f})=>!Ee.value.has(f));if(t.length===0)return[];let r=ae.value==="semi-radial"?Math.PI:-Math.PI/2;const n=ae.value==="semi-radial"?Math.PI:Math.PI*2,c=[];if(t.length===1){const{series:f,originalIndex:C}=t[0],y=f.data[0]||0,b=r,V=r+n-.001,N=b+n/2,M=Ve.value+Math.cos(b)*ot.value,R=Se.value+Math.sin(b)*ot.value,q=Ve.value+Math.cos(V)*ot.value,Y=Se.value+Math.sin(V)*ot.value,I=Ve.value+Math.cos(V)*ce.value,Z=Se.value+Math.sin(V)*ce.value,P=Ve.value+Math.cos(b)*ce.value,_=Se.value+Math.sin(b)*ce.value,ee=1,O=[`M ${M} ${R}`,`A ${ot.value} ${ot.value} 0 ${ee} 1 ${q} ${Y}`,`L ${I} ${Z}`,`A ${ce.value} ${ce.value} 0 ${ee} 0 ${P} ${_}`,"Z"].join(" "),W=ye(C);return c.push({path:O,color:W,strokeWidth:nt.value,strokeColor:Gn(0,W),value:y,seriesName:f.name,opacity:.8,isHighlighted:U.value===C,isDimmed:!1,isHidden:!1,startAngle:b,endAngle:V,midAngle:N}),c}const v=t.reduce((f,{series:C})=>f+(C.data[0]||0),0);return v===0?[]:(t.forEach(({series:f,originalIndex:C})=>{const y=f.data[0]||0,b=y/v*n,V=r,N=r+b,M=V+b/2,R=Ve.value+Math.cos(V)*ot.value,q=Se.value+Math.sin(V)*ot.value,Y=Ve.value+Math.cos(N)*ot.value,I=Se.value+Math.sin(N)*ot.value,Z=Ve.value+Math.cos(N)*ce.value,P=Se.value+Math.sin(N)*ce.value,_=Ve.value+Math.cos(V)*ce.value,ee=Se.value+Math.sin(V)*ce.value,O=b>Math.PI?1:0,W=[`M ${R} ${q}`,`A ${ot.value} ${ot.value} 0 ${O} 1 ${Y} ${I}`,`L ${Z} ${P}`,`A ${ce.value} ${ce.value} 0 ${O} 0 ${_} ${ee}`,"Z"].join(" "),K=ye(C);c.push({path:W,color:K,strokeWidth:nt.value,strokeColor:Gn(c.length,K),value:y,seriesName:f.name,opacity:.8,isHighlighted:U.value===C,isDimmed:U.value!==null&&U.value!==C,isHidden:!1,startAngle:V,endAngle:N,midAngle:M}),r=N}),c)}),el=e.computed(()=>!pn.value||!vt.value?[]:Oo.value.map((t,r)=>{if(t.isHidden)return null;const n=rl.value,c=qt.value,v=il.value,f=Ve.value+Math.cos(t.midAngle)*ce.value,C=Se.value+Math.sin(t.midAngle)*ce.value,y=Ve.value+Math.cos(t.midAngle)*(ce.value+n),b=Se.value+Math.sin(t.midAngle)*(ce.value+n),V=Math.cos(t.midAngle)>=0,M=y+c*(V?1:-1),R=b,q=V?y+15:y-15,Y=R-v,I=V?"start":"end",Z=Math.hypot(y-f,b-C),P=Math.hypot(M-y,R-b);return{pointerStartX:f,pointerStartY:C,pointerEndX:y,pointerEndY:b,horizontalEndX:M,horizontalEndY:R,textX:q,textY:Y,text:`${t.seriesName}: ${t.value}`,color:t.color,textAnchor:I,isRightSide:V,isHighlighted:t.isHighlighted,isDimmed:t.isDimmed,pointerLineLength:Z,horizontalLineLength:P}}).filter(Boolean)),gl=t=>{if(!t||t.isHidden)return 0;const r=t.opacity||eo.value||.7;return U.value===null||U.value===void 0?r:U.value!==null?t.seriesIndex===U.value?Math.min(1,r+.1):Math.max(.5,r*.8):r},Zo=t=>{if(!t||t.isHidden)return 0;const r=t.radius>20?.9:.8;return U.value!==null?t.seriesIndex===U.value?Math.min(1,r+.1):r*.7:r},no=(t,r)=>{if(t)try{if(U.value===t.seriesIndex?U.value=null:U.value=t.seriesIndex,typeof window<"u"&&window.dispatchEvent){const n=new CustomEvent("dss-bubble-click",{detail:{bubble:t,originalEvent:r,chartId:D.chartId}});window.dispatchEvent(n)}}catch(n){console.error("Error in onBubbleClick:",n)}},Vn=(t,r)=>{const n=[`dss-bubble-fallback-${r}`];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(" ")},Sn=(t,r)=>{if(!t||(r.stopPropagation(),x.value=!0,U.value=t.seriesIndex,ne.value.show=!1,!Vo.value))return;const n=r.target.closest(".dss-custom-chart-container");if(!n)return;const c=n.getBoundingClientRect();let v=r.clientX-c.left+10,f=r.clientY-c.top-10;const C=200,y=120;v+C>Ze.value&&(v=r.clientX-c.left-C-10),f+y>c.height&&(f=r.clientY-c.top-y-10),v<0&&(v=10),f<0&&(f=10);const b=jo.value,V=vn.value,N=b.map(M=>{const R=V[M]||M,q=tl(M,t);return q?{seriesName:t.seriesName,label:t.label,value:`${R}: ${q}`,color:t.color}:null}).filter(Boolean);oe.value={show:!0,x:v,y:f,title:t.label||t.seriesName||"",value:"",bubbleData:N,categoryIndex:void 0,spiderSeries:[]}},tl=(t,r)=>{let n;switch(t){case"x":n=r.originalX;break;case"y":n=r.originalY;break;case"size":n=r.originalSize;break;case"label":n=r.label;break;case"seriesName":n=r.seriesName;break;default:n=r[t]||""}const c=cl.value[t];return typeof c=="function"?c(n,r):typeof n=="number"?n.toFixed(1):n?.toString()||""},yl=()=>{if(!Be.value||!ne.value.data||ne.value.data.length===0)return"Bubbles";const t=[],r=new Set;return ne.value.data.forEach(n=>{if(n.seriesName&&n.label){const c=`${n.seriesName} - ${n.label}`;r.has(c)||(t.push(c),r.add(c))}else n.seriesName&&(r.has(n.seriesName)||(t.push(n.seriesName),r.add(n.seriesName)))}),t.length>0?t.join(" | "):"Bubbles"},ol=(t,r)=>{t&&(x.value=!1,U.value=null,oe.value.show=!1,oe.value.bubbleData=[])},nn=(t,r)=>{const n=r.target.closest(".dss-custom-chart-container");if(!n)return;const c=n.getBoundingClientRect(),v=Cn(t.categoryIndex),f=t.description||t.comment||"";let C=r.clientX-c.left+15,y=r.clientY-c.top-10;const b=200,V=f?80:50;C+b>Ze.value&&(C=r.clientX-c.left-b-15),y+V>je.value&&(y=r.clientY-c.top-V-10),C<0&&(C=10),y<0&&(y=10),so.value={show:!0,x:C,y,categoryValue:v,description:f}},Tt=()=>{so.value.show=!1},Wo=e.computed(()=>D.categories.length||Math.max(...uo.value.map(t=>t.data.length))),wo=e.computed(()=>{let t=0;return uo.value.forEach(r=>{r.data.forEach(n=>{typeof n=="number"&&(t=Math.max(t,n))})}),t||100}),ln=e.computed(()=>{const t=[],r=Wo.value;for(let n=0;n<r;n++){const c=n*2*Math.PI/r-Math.PI/2,v=Ve.value+Math.cos(c)*ce.value,f=Se.value+Math.sin(c)*ce.value;t.push({x:v,y:f,angle:c,index:n})}return t}),Cl=e.computed(()=>{const t=[],r=Wo.value;return ln.value.forEach((n,c)=>{const v=ce.value+15,f=c*2*Math.PI/r-Math.PI/2,C=Ve.value+Math.cos(f)*v,y=Se.value+Math.sin(f)*v+5;let b="middle",V="middle";Math.abs(Math.cos(f))>.5&&(b=Math.cos(f)>0?"start":"end"),Math.abs(Math.sin(f))>.5&&(V=Math.sin(f)>0?"hanging":"auto"),t.push({x:C,y,text:D.categories[c]||`Axis ${c+1}`,anchor:b,baseline:V})}),t}),nl=e.ref(new Set),ll=(t,r,n)=>{const c=`current-${n}`,v=nl.value.has(c);return!v&&U.value===null?r.fillOpacity||ho.value:r.isHighlighted||v?(r.fillOpacity||ho.value)+.15:r.isDimmed?(r.fillOpacity||ho.value)*.3:r.fillOpacity||ho.value},l=e.computed(()=>{if(!Jt.value)return[];const t=[],r=Wo.value;return me.value.forEach((n,c)=>{const v=[],f=[],C=[],y=U.value===c,b=U.value!==null&&U.value!==c,V=Ee.value.has(c);for(let N=0;N<r;N++){const M=n.data[N]||0,q=M/wo.value*ce.value,Y=N*2*Math.PI/r-Math.PI/2,I=Ve.value+Math.cos(Y)*q,Z=Se.value+Math.sin(Y)*q;v.push(`${I},${Z}`),f.push({x:I,y:Z}),C.push({x:I,y:Z,value:M,label:D.categories[N]||`Axis ${N+1}`,seriesName:n.name})}t.push({points:v.join(" "),polygonPoints:f,dataPoints:C,color:ye(c),fillOpacity:ho.value,seriesName:n.name,value:`${n.name}: ${n.data.join(", ")}`,isHighlighted:y,isDimmed:b,isHidden:V,seriesIndex:c})}),t}),o=(t,r)=>{if(!r||r.length<3)return!1;let n=!1;for(let c=0,v=r.length-1;c<r.length;v=c++){const f=r[c].x,C=r[c].y,y=r[v].x,b=r[v].y;C>t.y!=b>t.y&&t.x<(y-f)*(t.y-C)/(b-C)+f&&(n=!n)}return n},a=t=>{if(!Jt.value)return;const r=t.currentTarget.closest(".dss-custom-chart-container");if(!r)return;const n=r.getBoundingClientRect(),c=ie.value?.getBoundingClientRect();if(!c)return;const v=t.clientX-c.left,f=t.clientY-c.top,C=l.value.filter(y=>y.isHidden?!1:o({x:v,y:f},y.polygonPoints));if(C.length>0){C.length,U.value=C[0].seriesIndex;const y=t.clientX-n.left+10,b=t.clientY-n.top-10,V=200,N=50+C.length*25;let M=y,R=b;M+V>Ze.value&&(M=t.clientX-n.left-V-10),R+N>je.value&&(R=t.clientY-n.top-N-10),M<0&&(M=10),R<0&&(R=10);const q=C.map(Y=>{let I=Y.dataPoints[0],Z=1/0;return Y.dataPoints.forEach(P=>{const _=Math.sqrt(Math.pow(P.x-v,2)+Math.pow(P.y-f,2));_<Z&&(Z=_,I=P)}),{seriesName:Y.seriesName,color:Y.color,value:I.value!==void 0?I.value:Y.value}});oe.value={show:!0,x:M,y:R,title:C.length===1?C[0].seriesName:"",value:"",bubbleData:[],spiderSeries:q}}else w()},s=e.computed(()=>{const t=$.value;return t.logos.map((r,n)=>{const c=D.series[r.seriesIndex];if(!c||!c.data||c.data.length===0||Ee.value.has(r.seriesIndex))return null;let v,f;if(De.value){let y=-1,b=null;for(let N=c.data.length-1;N>=0;N--)if(c.data[N]!==null&&c.data[N]!==void 0){y=N,b=c.data[N];break}if(y===-1||b===null)return null;const V=c.data.map((N,M)=>N==null?null:{x:ge(M),y:we(N),index:M}).filter(N=>N!==null);if(t.animations.enabled&&!Q.value&&t.animations.type==="draw"&&t.chart.type==="line"&&(L.value.isAnimating||!L.value.hasAnimated))if(L.value.isAnimating){const N=L.value.currentFrame/L.value.totalFrames,M=F(t.animations.easing,Math.min(N,1)),R=kl(V,M);v=R.x+(r.offsetX||0),f=R.y+(r.offsetY||0)}else v=V[0].x+(r.offsetX||0),f=V[0].y+(r.offsetY||0);else v=ge(y)+(r.offsetX||0),f=we(b)+(r.offsetY||0)}else if(vt.value||Jt.value){const y=Math.PI*2/t.logos.length*n;v=Ve.value+Math.cos(y)*(ce.value+30)+(r.offsetX||0),f=Se.value+Math.sin(y)*(ce.value+30)+(r.offsetY||0)}return{...r,x:v,y:f,seriesIndex:r.seriesIndex}}).filter(Boolean)}),i=t=>{const r=document.querySelector(`.dss-logo-fallback-${t}`),n=document.querySelector(`.dss-logo-image-${t}`);r&&(r.style.opacity="0"),n&&(n.style.opacity="1")},d=t=>{console.warn(`Logo ${t} failed to load, keeping fallback circle`);const r=document.querySelector(`.dss-logo-image-${t}`);r&&(r.style.display="none")},u=t=>{Ee.value.has(t)?Ee.value.delete(t):Ee.value.add(t)},m=e.computed(()=>{if(!oe.value.show&&!(ue.value&&ne.value.show&&!A.value.isZooming))return{display:"none"};let t,r;if(ue.value&&ne.value.show&&!A.value.isZooming){t=ne.value.x+15,r=E.value.top;const n=Be.value?200:150;t+n>Ze.value&&(t=ne.value.x-n-15),t<0&&(t=10),r<10&&(r=10)}else t=oe.value.x,r=oe.value.y;return{left:t+"px",top:r+"px"}}),p=(t,r)=>{if(!Vo.value||k.value)return;const c=r.target.closest(".dss-custom-chart-container").getBoundingClientRect();let v=r.clientX-c.left+10,f=r.clientY-c.top-10;const C=200,y=120,b=Ze.value,V=je.value;v+C>b&&(v=r.clientX-c.left-C-10),f+y>V&&(f=r.clientY-c.top-y-10),v<0&&(v=10),f<0&&(f=10);let N;typeof t.categoryIndex=="number"?N=t.categoryIndex:typeof t.dataIndex=="number"?N=t.dataIndex:t.label&&D.categories.includes(t.label)&&(N=D.categories.indexOf(t.label));const M=(Xe.value||ae.value==="bar")&&t.label?t.label:t.seriesName||t.label||"";oe.value={show:!0,x:v,y:f,title:M,value:t.value?.toString()||"",categoryIndex:N,spiderSeries:[]}},h=e.ref(!1),x=e.ref(!1),w=()=>{oe.value.show=!1,oe.value.spiderSeries=[],oe.value.bubbleData=[],ne.value.show=!1,h.value||(U.value=null)},k=e.ref(!1),T=(t,r)=>{k.value=!0,oe.value.show=!1,ne.value.show=!1;const c=r.target.closest(".dss-custom-chart-container").getBoundingClientRect();let v=r.clientX-c.left+15,f=r.clientY-c.top-10;const C=250;v+C>Ze.value&&(v=r.clientX-c.left-C-15),v<0&&(v=10),f<0&&(f=10),Yo.value={show:!0,x:v,y:f,content:t.texts,count:t.totalCount}},B=()=>{k.value=!1,Yo.value.show=!1},L=e.ref({isAnimating:!1,currentFrame:0,totalFrames:0,animationId:null,hasAnimated:!1}),F=(t,r)=>{switch(t){case"linear":return r;case"ease":return r<.5?2*r*r:-1+(4-2*r)*r;case"ease-in":return r*r;case"ease-out":return r*(2-r);case"ease-in-out":return r<.5?2*r*r:-1+(4-2*r)*r;default:return r}},Q=e.computed(()=>Ot.value?window.matchMedia("(prefers-reduced-motion: reduce)").matches:!1),Pe=()=>{if(!tt.value||Q.value){L.value.hasAnimated=!0,Rt.value&&(Co.value=1);return}Rt.value&&(Co.value=0),L.value.isAnimating=!0,L.value.currentFrame=0,L.value.totalFrames=Math.ceil(dt.value/16.67);const t=()=>{const r=L.value.currentFrame/L.value.totalFrames,n=F(pt.value,Math.min(r,1));Oe(n),Rt.value&&(Co.value=n),r<1?(L.value.currentFrame++,L.value.animationId=requestAnimationFrame(t)):Te()};L.value.animationId=requestAnimationFrame(t)},Oe=t=>{const r=document.querySelector(".dss-custom-chart-container");r&&r.style.setProperty("--dss-animation-progress",t)},Te=()=>{L.value.isAnimating=!1,L.value.hasAnimated=!0,Rt.value&&(Co.value=1),L.value.animationId&&(cancelAnimationFrame(L.value.animationId),L.value.animationId=null)},Ie=e.computed(()=>!vt.value||L.value.hasAnimated?!0:Rt.value?Co.value>=1:Ro.value?_o.value>=1:!0),_e=e.computed(()=>pn.value&&Ie.value),be=e.ref(!1);e.watch(_e,t=>{t?(be.value=!1,e.nextTick(()=>{requestAnimationFrame(()=>{be.value=!0})})):be.value=!1},{immediate:!0});const Ft=e.computed(()=>{if(!tt.value||Q.value||L.value.hasAnimated)return{};const t={};return t["--dss-animation-duration"]=`${dt.value}ms`,t["--dss-animation-easing"]=mo(pt.value),t["--dss-stagger-delay"]=`${se.value}ms`,t}),mo=t=>({linear:"linear",ease:"ease","ease-in":"ease-in","ease-out":"ease-out","ease-in-out":"ease-in-out"})[t]||"ease-out",po=()=>{if(!tt.value||Q.value)return"";const t=["dss-chart-animated"];return L.value.hasAnimated||t.push(`dss-animate-${wt.value}`),L.value.hasAnimated||(vt.value&&ae.value!=="semi-radial"?t.push("dss-animate-fill"):vt.value||t.push(`dss-animate-${wt.value}`)),L.value.isAnimating&&t.push("dss-is-animating"),t.join(" ")};e.watch(()=>D.series,(t,r)=>{Ne.value&&r&&L.value.hasAnimated&&(L.value.hasAnimated=!1,e.nextTick(()=>{setTimeout(()=>Pe(),mt.value)}))},{deep:!0}),e.watch(()=>A.value.isZooming,(t,r)=>{r&&!t&&setTimeout(()=>{In()},50)}),e.watch(()=>[A.value.scale,A.value.offsetX],()=>{!A.value.isZooming&&!A.value.isDragging&&In()},{flush:"post"}),e.watch([So,Bn],([t,r])=>{A.value.minScale=t,A.value.maxScale=r,(A.value.scale<t||A.value.scale>r)&&Mt()},{immediate:!0}),e.watch(()=>D.locale,t=>{t&&t!==H.value&&(H.value=t)},{immediate:!0}),e.watch(()=>re.value.show,t=>{t?e.nextTick(()=>{document.addEventListener("click",qe)}):document.removeEventListener("click",qe)}),e.onMounted(()=>{U.value=null,Rt.value&&(!tt.value||Q.value)&&(Co.value=1),pl(),S.value&&typeof ResizeObserver<"u"&&(Re=new ResizeObserver(t=>{const r=t[0];if(!r||!r.contentRect)return;const{width:n,height:c}=r.contentRect;Uo.value=Math.round(n),g.value=Math.round(c),bo.value&&(He.value=bo.value.offsetHeight||ct)}),Re.observe(S.value)),tt.value&&!Q.value?ae.value==="semi-radial"?setTimeout(()=>fl(),mt.value):setTimeout(()=>Pe(),mt.value):(L.value.hasAnimated=!0,ae.value==="semi-radial"&&(_o.value=1)),document.addEventListener("mousemove",Nn),document.addEventListener("mouseup",Mn),document.addEventListener("click",Wn)}),e.onUnmounted(()=>{Re&&S.value&&(Re.unobserve(S.value),Re.disconnect(),Re=null),L.value.animationId&&cancelAnimationFrame(L.value.animationId),co&&(cancelAnimationFrame(co),co=null),A.value.zoomTimeout&&clearTimeout(A.value.zoomTimeout),document.removeEventListener("mousemove",Nn),document.removeEventListener("mouseup",Mn),document.removeEventListener("click",Wn),document.removeEventListener("click",qe)});const Nn=t=>{if(A.value.isDragging&&A.value.scale>1&&De.value){ne.value.show=!1;const r=t.clientX-A.value.lastMouseX,{minX:n,maxX:c}=he.value,v=c-n||1,C=r*.8;A.value.offsetX+=C;const y=v/A.value.scale,b=v-y,V=0,N=-b/v*E.value.width,M=V;A.value.offsetX=Math.max(N,Math.min(M,A.value.offsetX)),A.value.lastMouseX=t.clientX,A.value.lastMouseY=t.clientY}},Mn=()=>{A.value.isDragging&&(A.value.isDragging=!1,setTimeout(()=>{!A.value.isDragging&&A.value.isZooming},100))},kl=(t,r)=>{const n=t.filter(y=>y!=null);if(!n||n.length===0)return{x:0,y:0};if(n.length===1||r<=0)return n[0];if(r>=1)return n[n.length-1];let c=0;const v=[];for(let y=1;y<n.length;y++){const b=n[y].x-n[y-1].x,V=n[y].y-n[y-1].y,N=Math.sqrt(b*b+V*V);v.push(N),c+=N}const f=c*r;let C=0;for(let y=0;y<v.length;y++){const b=C+v[y];if(f<=b){const V=(f-C)/v[y],N=n[y],M=n[y+1];return{x:N.x+(M.x-N.x)*V,y:N.y+(M.y-N.y)*V}}C=b}return n[n.length-1]};return(t,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{class:e.normalizeClass(["dss-custom-chart-container",[po(),{"dss-chart-fill-width":Ye.value,"dss-chart-fill-height":Ht.value}]]),style:e.normalizeStyle({width:Ye.value?"100%":Ze.value+"px",height:Ht.value?"100%":je.value+20+"px",...Ft.value,cursor:io()}),"data-chart-type":ae.value,ref_key:"containerEl",ref:S,onWheel:Kt,onMousedown:Mo,onMousemove:Ko,onMouseup:Gt,onMouseleave:ze,onDblclick:Mt,onContextmenu:e.withModifiers(fe,["prevent"]),onClick:e.withModifiers(Xt,["left"]),onWheelCapture:Kt},[e.createElementVNode("div",{class:"dss-chart-header",ref_key:"headerEl",ref:bo},[e.createElementVNode("div",Al,[j.value?(e.openBlock(),e.createElementBlock("div",Ll,e.toDisplayString(j.value),1)):e.createCommentVNode("",!0),xe.value?(e.openBlock(),e.createElementBlock("div",$l,e.toDisplayString(xe.value),1)):e.createCommentVNode("",!0)]),Ce.value&&(Ae.value==="top"||Ae.value==="bottom")?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["dss-chart-legend",{"dss-legend-horizontal":Lt.value==="horizontal","dss-legend-vertical":Lt.value==="vertical","dss-legend-top":Ae.value==="top","dss-legend-bottom":Ae.value==="bottom"}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(D.series,(n,c)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-${c}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":Ee.value.has(c),"dss-legend-hovered":U.value===c,"dss-legend-dimmed":U.value!==null&&U.value!==c}]),onClick:v=>u(c),onMouseenter:v=>ft(c),onMouseleave:Nt,style:e.normalizeStyle({animationDelay:`${c*100}ms`})},[e.createElementVNode("div",{class:"dss-legend-color",style:e.normalizeStyle({backgroundColor:ye(c)})},null,4),e.createElementVNode("span",Il,e.toDisplayString(n.name),1)],46,Dl))),128))],2)):e.createCommentVNode("",!0),Ce.value&&(Ae.value==="left"||Ae.value==="right")?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["dss-chart-legend-side",{"dss-legend-left":Ae.value==="left","dss-legend-right":Ae.value==="right"}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(D.series,(n,c)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-${c}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":Ee.value.has(c),"dss-legend-hovered":U.value===c,"dss-legend-dimmed":U.value!==null&&U.value!==c}]),onClick:v=>u(c),onMouseenter:v=>ft(c),onMouseleave:Nt,style:e.normalizeStyle({animationDelay:`${c*100}ms`})},[e.createElementVNode("div",{class:"dss-legend-color",style:e.normalizeStyle({backgroundColor:ye(c)})},null,4),e.createElementVNode("span",Rl,e.toDisplayString(n.name),1)],46,_l))),128))],2)):e.createCommentVNode("",!0)],512),z.showAddMarkerButton&&Ue.value.addMarker&&(De.value||Be.value)?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-add-marker-button",onClick:Zn,title:e.unref(J)("chart.contextMenu.addMarker")},[e.createElementVNode("img",{src:Dt.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,zl),r[5]||(r[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,Fl)):e.createCommentVNode("",!0),e.createElementVNode("div",Pl,[Be.value&&rn.value?(e.openBlock(),e.createElementBlock("div",Ol,"Bubble size: "+e.toDisplayString(rn.value),1)):e.createCommentVNode("",!0),(e.openBlock(),e.createElementBlock("svg",{width:Ze.value,height:je.value,class:"dss-chart-svg","data-smooth":lt.value,"data-animated":tt.value,ref_key:"svgEl",ref:ie},[e.createElementVNode("defs",null,[e.createElementVNode("clipPath",Wl,[e.createElementVNode("rect",{x:E.value.left,y:E.value.top,width:E.value.width,height:E.value.height*4},null,8,Ul)]),Ro.value?(e.openBlock(),e.createElementBlock("clipPath",{key:0,id:Un.value},[e.createElementVNode("path",{d:qn.value},null,8,Xl)],8,ql)):e.createCommentVNode("",!0),Rt.value?(e.openBlock(),e.createElementBlock("clipPath",{key:1,id:Yn.value},[e.createElementVNode("path",{d:Bo.value},null,8,jl)],8,Yl)):e.createCommentVNode("",!0)]),De.value||Be.value?(e.openBlock(),e.createElementBlock("g",Kl,[Je.value?(e.openBlock(),e.createElementBlock("g",Gl,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(vl.value,(n,c)=>(e.openBlock(),e.createElementBlock("line",{key:`h-grid-${c}`,x1:E.value.left,x2:E.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,Jl))),128))])):e.createCommentVNode("",!0),e.createElementVNode("g",Ql,[e.createElementVNode("line",{x1:E.value.left,x2:E.value.right,y1:E.value.bottom,y2:E.value.bottom,stroke:"#ccc","stroke-width":"1"},null,8,ea),e.createElementVNode("line",{x1:E.value.left,x2:E.value.left,y1:E.value.top,y2:E.value.bottom,stroke:"#ccc","stroke-width":"1"},null,8,ta)]),e.createElementVNode("g",oa,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(xn.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,na))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(wn.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,la))),128)),Ao.value?(e.openBlock(),e.createElementBlock("text",{key:0,x:E.value.left+E.value.width/2,y:E.value.bottom+45,"text-anchor":"middle","font-size":"14","font-weight":"bold",fill:"#333"},e.toDisplayString(Ao.value),9,aa)):e.createCommentVNode("",!0),At.value?(e.openBlock(),e.createElementBlock("text",{key:1,x:15,y:E.value.top+12+E.value.height/2,"text-anchor":"middle","font-size":"14","font-weight":"bold",fill:"#333",transform:`rotate(-90, 15, ${E.value.top+E.value.height/2})`},e.toDisplayString(At.value),9,sa)):e.createCommentVNode("",!0)]),fn.value.length>0?(e.openBlock(),e.createElementBlock("g",ra,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(fn.value,n=>(e.openBlock(),e.createElementBlock("g",{key:`flag-group-${n.categoryIndex}`},[e.createElementVNode("g",ia,[n.hasManual?(e.openBlock(),e.createElementBlock("line",{key:0,x1:n.x,x2:n.x,y1:E.value.bottom,y2:E.value.top,stroke:"#047395","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:c=>T(n,c),onMouseleave:B},null,40,ca)):e.createCommentVNode("",!0),n.hasAuto&&!n.hasManual?(e.openBlock(),e.createElementBlock("line",{key:1,x1:n.x,x2:n.x,y1:E.value.bottom,y2:E.value.top,stroke:"#0dbf89","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:c=>T(n,c),onMouseleave:B},null,40,ua)):e.createCommentVNode("",!0),n.hasAuto&&n.hasManual?(e.openBlock(),e.createElementBlock("line",{key:2,x1:n.x,x2:n.x,y1:E.value.bottom,y2:E.value.top,stroke:"#047395","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:c=>T(n,c),onMouseleave:B},null,40,da)):e.createCommentVNode("",!0)]),n.hasManual&&n.hasAuto?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:n.x+8,cy:Math.max(15,E.value.top-10),r:"14",fill:"#0dbf89",stroke:"#fafafa","stroke-width":"2",class:"flag-count-circle",onMouseover:c=>T(n,c),onMouseleave:B},null,40,ma)):e.createCommentVNode("",!0),e.createElementVNode("circle",{cx:n.x,cy:Math.max(15,E.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=>T(n,c),onMouseleave:B},null,40,pa),e.createElementVNode("text",{x:n.x,y:Math.max(15,E.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,fa)]))),128))])):e.createCommentVNode("",!0),e.createElementVNode("g",va,[Bt.value?(e.openBlock(),e.createElementBlock("g",ha,[e.createElementVNode("g",{class:e.normalizeClass(["dss-bar-chart",{"dss-horizontal-bars":Xe.value}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Qn.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:v=>p(n,v),onMouseleave:w},null,46,ga)):(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:v=>p(n,v),onMouseleave:w},null,46,ya))],64))),128))],2),e.createElementVNode("g",Ca,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Po.value,(n,c)=>(e.openBlock(),e.createElementBlock("path",{key:`mixed-line-${c}`,d:n.path,stroke:n.color,"stroke-width":n.isHighlighted?We.value+2:We.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass({"dss-series-highlighted":n.isHighlighted,"dss-series-dimmed":n.isDimmed,"dss-series-hidden":n.isHidden}),style:e.normalizeStyle({"--dss-path-length":n.pathLength,animationDelay:`${n.animationDelay}ms`})},null,14,ka))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(tn.value,(n,c)=>(e.openBlock(),e.createElementBlock("path",{key:`mixed-gap-connector-${c}`,d:n.path,stroke:n.color,"stroke-width":n.isHighlighted?We.value+2:We.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round","stroke-dasharray":"15, 10, 5, 10",opacity:n.isHighlighted?0:.5,class:e.normalizeClass({"dss-gap-connector":!0,"dss-series-dimmed":n.isDimmed,"dss-series-hidden":n.isHidden}),style:e.normalizeStyle({animationDelay:`${n.animationDelay}ms`,transition:"opacity 0.2s ease"})},null,14,xa))),128)),Ke.value>0||rt.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(Jn.value,(n,c)=>(e.openBlock(),e.createElementBlock("circle",{key:`mixed-point-${c}`,cx:n.x,cy:n.y,r:n.isHighlighted?ut(n,Ke.value)+2:ut(n,Ke.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:v=>p(n,v),onMouseleave:w},null,46,wa))),128)):e.createCommentVNode("",!0)])])):ae.value==="line"?(e.openBlock(),e.createElementBlock("g",ba,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(En.value,(n,c)=>(e.openBlock(),e.createElementBlock("path",{key:`anim-${c}`,d:n.path,stroke:n.color,"stroke-width":We.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass(["dss-line-animation-overlay",{"dss-animation-complete":L.value.hasAnimated}]),style:e.normalizeStyle({"--dss-path-length":n.pathLength,animationDelay:`${n.animationDelay}ms`})},null,14,Ea))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Po.value,(n,c)=>(e.openBlock(),e.createElementBlock("path",{key:`line-${c}`,d:n.path,stroke:n.color,"stroke-width":n.isHighlighted?We.value+2:We.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass({"dss-series-highlighted":n.isHighlighted,"dss-series-dimmed":n.isDimmed,"dss-series-hidden":n.isHidden}),style:e.normalizeStyle({"--dss-path-length":n.pathLength,animationDelay:`${n.animationDelay}ms`})},null,14,Va))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(tn.value,(n,c)=>(e.openBlock(),e.createElementBlock("path",{key:`gap-connector-${c}`,d:n.path,stroke:n.color,"stroke-width":n.isHighlighted?We.value+2:We.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round","stroke-dasharray":"15, 10, 5, 10",opacity:n.isHighlighted?0:.5,class:e.normalizeClass({"dss-gap-connector":!0,"dss-series-dimmed":n.isDimmed,"dss-series-hidden":n.isHidden}),style:e.normalizeStyle({animationDelay:`${n.animationDelay}ms`,transition:"opacity 0.2s ease"})},null,14,Sa))),128)),Ke.value>0||rt.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?ut(n,Ke.value)+2:ut(n,Ke.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:v=>p(n,v),onMouseleave:w},null,46,Na))),128)):e.createCommentVNode("",!0)])):ae.value==="area"?(e.openBlock(),e.createElementBlock("g",Ma,[e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(on.value,(n,c)=>(e.openBlock(),e.createElementBlock("mask",{key:`mask-${c}`,id:`area-mask-${c}-${z.chartId}`},[e.createElementVNode("rect",{x:E.value.left-10,y:E.value.top-10,width:E.value.width+20,height:E.value.height+20,fill:"#fafafa",class:"dss-area-mask-rect",style:e.normalizeStyle({"--dss-mask-width":`${E.value.width+20}px`})},null,12,Ta)],8,Ba))),128))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(on.value,(n,c)=>(e.openBlock(),e.createElementBlock("path",{key:`area-fill-${c}`,d:n.areaPath,fill:n.color,"fill-opacity":n.isHighlighted?xt.value+.2:xt.value,mask:`url(#area-mask-${c}-${z.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,Ha))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(on.value,(n,c)=>(e.openBlock(),e.createElementBlock("path",{key:`area-line-${c}`,d:n.linePath,stroke:n.color,"stroke-width":n.isHighlighted?We.value+1:We.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass({"dss-area-line-animated":!0,"dss-series-highlighted":n.isHighlighted,"dss-series-dimmed":n.isDimmed,"dss-series-hidden":n.isHidden}),style:e.normalizeStyle({"--dss-path-length":n.pathLength,animationDelay:`${c*se.value}ms`})},null,14,Aa))),128))])):ae.value==="bar"?(e.openBlock(),e.createElementBlock("g",{key:3,class:e.normalizeClass({"dss-horizontal-bars":Xe.value})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Qn.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:v=>p(n,v),onMouseleave:w},null,46,La)):(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:v=>p(n,v),onMouseleave:w},null,46,$a))],64))),128))],2)):e.createCommentVNode("",!0)]),ue.value&&ne.value.show&&!A.value.isZooming?(e.openBlock(),e.createElementBlock("g",Da,[e.createElementVNode("line",{x1:ne.value.x,x2:ne.value.x,y1:E.value.top,y2:E.value.bottom,stroke:$o.value,"stroke-width":"1","stroke-dasharray":"4,4",opacity:"0.8"},null,8,Ia),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ne.value.data,(n,c)=>(e.openBlock(),e.createElementBlock("circle",{key:`dss-crosshair-point-${c}`,cx:ne.value.x,cy:n.y,r:Ke.value+2,fill:n.color,stroke:"none",opacity:"0.9"},null,8,_a))),128))])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),Be.value?(e.openBlock(),e.createElementBlock("g",Ra,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ho.value,(n,c)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`bubble-${c}`},[n?(e.openBlock(),e.createElementBlock("g",Fa,[e.createElementVNode("circle",{cx:n.x,cy:n.y,r:n.radius,fill:n.color,"fill-opacity":gl(n),stroke:n.color,"stroke-width":"1","stroke-opacity":"0.8",class:e.normalizeClass(Vn(n,c)),style:{cursor:"pointer",transition:"all 0.3s ease"},onMouseenter:v=>Sn(n,v),onMouseleave:v=>ol(n),onClick:v=>no(n,v)},null,42,za),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:Zo(n)}),onLoad:v=>ko(c),onError:v=>Fo(c),onMouseenter:v=>Sn(n,v),onMouseleave:v=>ol(n),onClick:v=>no(n,v)},null,46,Pa)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],64))),128))])):e.createCommentVNode("",!0),vt.value?(e.openBlock(),e.createElementBlock("g",Oa,[ae.value==="radial"?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:Ve.value,cy:Se.value,r:ce.value,fill:"none",stroke:"#e0e0e0","stroke-width":"1"},null,8,Za)):e.createCommentVNode("",!0),e.createElementVNode("g",{class:"dss-radial-data","data-chart-type":ae.value,"clip-path":Qo.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Oo.value,(n,c)=>(e.openBlock(),e.createElementBlock("path",{key:`radial-${c}`,d:n.path,fill:n.color,"fill-opacity":n.isHighlighted?(n.opacity||.8)+.2:n.opacity||.8,stroke:n.strokeWidth?n.strokeColor||n.color:"none","stroke-width":n.strokeWidth||0,class:e.normalizeClass({"dss-series-highlighted":n.isHighlighted,"dss-series-dimmed":n.isDimmed,"dss-series-hidden":n.isHidden}),onMouseover:v=>p(n,v),onMouseleave:w},null,42,Ua))),128))],8,Wa),$n.value&&Ie.value?(e.openBlock(),e.createElementBlock("g",qa,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Dn.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,Xa)),[[e.vShow,n.show]])),128))])):e.createCommentVNode("",!0),_e.value?(e.openBlock(),e.createElementBlock("g",{key:2,class:e.normalizeClass(["dss-radial-labels dss-radial-labels-initial",{"dss-radial-labels-animated":be.value}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(el.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,Ya),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,ja),e.createElementVNode("text",{class:"dss-radial-label-text",x:n.textX,y:n.textY,"text-anchor":n.textAnchor,"font-size":Ln.value,"dominant-baseline":"middle"},e.toDisplayString(n.text),9,Ka)],6))),128))],2)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),Jt.value?(e.openBlock(),e.createElementBlock("g",Ga,[Je.value?(e.openBlock(),e.createElementBlock("g",Ja,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Et.value,(n,c)=>(e.openBlock(),e.createElementBlock("circle",{key:`spider-grid-circle-${c}`,cx:Ve.value,cy:Se.value,r:n,fill:"none",stroke:"#dedede","stroke-width":"1",style:e.normalizeStyle({animationDelay:`${c*150}ms`})},null,12,Qa))),128)),e.createElementVNode("g",es,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Et.value,(n,c)=>(e.openBlock(),e.createElementBlock("g",{key:`spider-grid-label-group-${c}`},[e.createElementVNode("rect",{x:Ve.value-16,y:Se.value-n-7,width:"32",height:"16",fill:"#fafafa",stroke:"none"},null,8,ts),e.createElementVNode("text",{x:Ve.value,y:Se.value-n+2,"text-anchor":"middle","dominant-baseline":"central",class:"dss-spider-grid-label",style:{fontSize:"10px",fill:"#999",fontWeight:"600"}},e.toDisplayString(Zt(c)),9,os)]))),128))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ln.value,(n,c)=>(e.openBlock(),e.createElementBlock("line",{key:`spider-axis-${c}`,x1:Ve.value,x2:n.x,y1:Se.value,y2:n.y,stroke:"#dedede","stroke-width":"1",style:e.normalizeStyle({animationDelay:`${c*100}ms`})},null,12,ns))),128))])):e.createCommentVNode("",!0),e.createElementVNode("g",ls,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Cl.value,(n,c)=>(e.openBlock(),e.createElementBlock("text",{key:`spider-label-${c}`,x:n.x+Math.cos(c*2*Math.PI/Wo.value-Math.PI/2)*16,y:n.y+Math.sin(c*2*Math.PI/Wo.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,as))),128))]),e.createElementVNode("g",{class:"dss-spider-data",onMousemove:a,onMouseleave:w},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.value,(n,c)=>(e.openBlock(),e.createElementBlock("g",{key:`spider-${c}`},[e.createElementVNode("polygon",{points:n.points,fill:n.color,"fill-opacity":ll("current",n,c),stroke:n.color,"stroke-width":n.isHighlighted?We.value+1:We.value,"stroke-linejoin":"round",class:e.normalizeClass({"dss-series-highlighted":n.isHighlighted,"dss-series-dimmed":n.isDimmed,"dss-series-hidden":n.isHidden}),style:e.normalizeStyle({animationDelay:`${c*se.value}ms`,transition:"all 0.2s ease"})},null,14,ss),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.dataPoints,(v,f)=>(e.openBlock(),e.createElementBlock("circle",{key:`spider-point-${c}-${f}`,cx:v.x,cy:v.y,r:n.isHighlighted?Ke.value+1:Ke.value>0?Ke.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*se.value+f*50}ms`,transition:"all 0.2s ease"}),onMouseover:C=>p(v,C),onMouseleave:w},null,46,rs))),128))]))),128))],32)])):e.createCommentVNode("",!0),e.createElementVNode("g",is,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,(n,c)=>(e.openBlock(),e.createElementBlock("circle",{key:`logo-fallback-${c}`,cx:n.x,cy:n.y,r:n.width/2,fill:ye(n.seriesIndex),stroke:"#fafafa","stroke-width":"2",class:e.normalizeClass(`logo-fallback-${c}`),style:e.normalizeStyle({animationDelay:`${c*200}ms`})},null,14,cs))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.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:v=>i(c),onError:v=>d(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,us))),128))])],8,Zl))]),Vt.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-chart-watermark",style:e.normalizeStyle({position:"absolute",top:"0px",left:"0px",width:Ze.value+"px",height:je.value+"px",backgroundImage:`url('${mn.value}')`,backgroundRepeat:"no-repeat",...Hn.value,opacity:cn.value,pointerEvents:"none",zIndex:10})},null,4)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(al.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:Ut.value+"px",height:Ut.value+"px",backgroundColor:"#fafafa",borderRadius:"50%",border:"2px solid #ddd",cursor:"pointer",zIndex:500}),onClick:e.withModifiers(v=>Qe(n),["stop"]),onMouseenter:v=>nn(n,v),onMouseleave:Tt},[e.createElementVNode("img",{src:yn(n),class:"dss-marker-icon",alt:"Marker Icon",style:{width:"100%",height:"100%","object-fit":"contain","border-radius":"50%","pointer-events":"none"}},null,8,ms)],44,ds)),[[e.vShow,Do.value]])),128)),so.value.show?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-marker-tooltip",style:e.normalizeStyle({left:so.value.x+"px",top:so.value.y+"px"})},[e.createElementVNode("div",ps,e.toDisplayString(so.value.categoryValue),1),so.value.description?(e.openBlock(),e.createElementBlock("div",fs,e.toDisplayString(so.value.description),1)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),Vo.value&&(oe.value.show||ue.value&&ne.value.show&&!A.value.isZooming)?(e.openBlock(),e.createElementBlock("div",{key:3,class:e.normalizeClass(["dss-chart-tooltip",{"dss-crosshair-tooltip":ue.value&&ne.value.show&&!A.value.isZooming}]),style:e.normalizeStyle(m.value)},[!ue.value||!ne.value.show||A.value.isZooming?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[Jt.value&&oe.value.spiderSeries&&oe.value.spiderSeries.length>0?(e.openBlock(),e.createElementBlock("div",vs,[oe.value.title?(e.openBlock(),e.createElementBlock("div",hs,e.toDisplayString(oe.value.title),1)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(oe.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",gs,e.toDisplayString(n.seriesName)+":",1),e.createElementVNode("span",ys,e.toDisplayString(n.value),1)]))),128))])):Be.value&&oe.value.bubbleData&&oe.value.bubbleData.length>0?(e.openBlock(),e.createElementBlock("div",Cs,[oe.value.title?(e.openBlock(),e.createElementBlock("div",ks,e.toDisplayString(oe.value.title),1)):e.createCommentVNode("",!0),e.createElementVNode("div",xs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(oe.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",ws,[e.createElementVNode("div",bs,e.toDisplayString(oe.value.title),1),e.createElementVNode("div",Es,e.toDisplayString(oe.value.value),1)])),oe.value.categoryIndex!==void 0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[St(oe.value.categoryIndex).flagGroups.length>0?(e.openBlock(),e.createElementBlock("div",Vs,[r[6]||(r[6]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",Ss,e.toDisplayString(e.unref(J)("chart.tooltip.flags")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(St(oe.value.categoryIndex).flagGroups,(n,c)=>(e.openBlock(),e.createElementBlock("div",{key:`tooltip-flag-group-${c}`},[e.createElementVNode("div",Ns,[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,(v,f)=>(e.openBlock(),e.createElementBlock("div",{key:`tooltip-flag-${c}-${f}`,class:"dss-tooltip-item dss-tooltip-item-no-indicator"},[e.createElementVNode("div",Ms,[e.createElementVNode("div",Bs,e.toDisplayString(v.text),1)])]))),128))]))),128))])):e.createCommentVNode("",!0),St(oe.value.categoryIndex).markers.length>0?(e.openBlock(),e.createElementBlock("div",Ts,[r[7]||(r[7]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",Hs,e.toDisplayString(e.unref(J)("chart.tooltip.markers")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(St(oe.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",As,[e.createElementVNode("div",Ls,e.toDisplayString(n.title),1),n.description?(e.openBlock(),e.createElementBlock("div",$s,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",Ds,[e.createElementVNode("div",Is,e.toDisplayString(Be.value?yl():z.categories[ne.value.categoryIndex]||`Category ${ne.value.categoryIndex+1}`),1),Be.value?(e.openBlock(),e.createElementBlock("div",_s,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ne.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(ne.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",Rs,e.toDisplayString(n.seriesName)+":",1),e.createElementVNode("span",Fs,e.toDisplayString(n.value),1)]))),128))]),St(ne.value.categoryIndex).flagGroups.length>0?(e.openBlock(),e.createElementBlock("div",zs,[r[8]||(r[8]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",Ps,e.toDisplayString(e.unref(J)("chart.tooltip.flags")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(St(ne.value.categoryIndex).flagGroups,(n,c)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-flag-group-${c}`},[e.createElementVNode("div",Os,[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,(v,f)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-flag-${c}-${f}`,class:"dss-tooltip-item dss-tooltip-item-no-indicator"},[e.createElementVNode("div",Zs,[e.createElementVNode("div",Ws,e.toDisplayString(v.text),1)])]))),128))]))),128))])):e.createCommentVNode("",!0),St(ne.value.categoryIndex).markers.length>0?(e.openBlock(),e.createElementBlock("div",Us,[r[9]||(r[9]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",qs,e.toDisplayString(e.unref(J)("chart.tooltip.markers")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(St(ne.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",Xs,[e.createElementVNode("div",Ys,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))],6)):e.createCommentVNode("",!0),De.value&&Pt.value&&A.value.scale>1?(e.openBlock(),e.createElementBlock("div",{key:4,class:"dss-zoom-indicator",onClick:Mt},[r[10]||(r[10]=e.createElementVNode("span",{style:{display:"inline-block",transform:"scaleX(-1)","font-size":"14px"}},"⌕",-1)),e.createTextVNode(" "+e.toDisplayString(Math.round(A.value.scale*100))+"% "+e.toDisplayString(e.unref(J)("chart.zoom.doubleClickToReset")),1)])):e.createCommentVNode("",!0)],46,Hl),re.value.show?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-chart-context-menu",style:e.normalizeStyle({left:re.value.x+"px",top:re.value.y+"px"}),onClick:r[0]||(r[0]=e.withModifiers(()=>{},["stop"]))},[Ue.value.addMarker?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-context-menu-item",onClick:it},e.toDisplayString(e.unref(J)("chart.contextMenu.addMarker")),1)):e.createCommentVNode("",!0),Ue.value.addMarker&&(Ue.value.downloadSvg||Ue.value.downloadPng||Ue.value.downloadCsv||Wt.value.length>0)?(e.openBlock(),e.createElementBlock("div",Ks)):e.createCommentVNode("",!0),Ue.value.downloadSvg?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-context-menu-item",onClick:Fn},e.toDisplayString(e.unref(J)("chart.contextMenu.downloadSvg")),1)):e.createCommentVNode("",!0),Ue.value.downloadPng?(e.openBlock(),e.createElementBlock("div",{key:3,class:"dss-context-menu-item",onClick:zn},e.toDisplayString(e.unref(J)("chart.contextMenu.downloadPng")),1)):e.createCommentVNode("",!0),Ue.value.downloadCsv?(e.openBlock(),e.createElementBlock("div",{key:4,class:"dss-context-menu-item",onClick:Pn},e.toDisplayString(e.unref(J)("chart.contextMenu.downloadCsv")),1)):e.createCommentVNode("",!0),Wt.value.length>0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:5},[Ue.value.downloadSvg||Ue.value.downloadPng||Ue.value.downloadCsv?(e.openBlock(),e.createElementBlock("div",Gs)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Wt.value,(n,c)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"custom-"+c},[n.separator?(e.openBlock(),e.createElementBlock("div",Js)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(Yt(n)),style:e.normalizeStyle(dl(n)),onClick:v=>On(n)},[n.template?(e.openBlock(),e.createElementBlock("div",{key:0,innerHTML:gn(n),class:"dss-custom-menu-content"},null,8,er)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[n.icon?(e.openBlock(),e.createElementBlock("span",tr,e.toDisplayString(n.icon),1)):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(n.label),1)],64))],14,Qs)],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:at},[e.createElementVNode("div",{class:"dss-marker-modal",onClick:r[4]||(r[4]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",or,[e.createElementVNode("h3",null,e.toDisplayString(No.value?e.unref(J)("chart.modalMarker.viewMarker"):go.value?e.unref(J)("chart.modalMarker.editMarker"):e.unref(J)("chart.contextMenu.addMarker")),1),e.createElementVNode("button",{class:"dss-modal-close-btn",onClick:at},"×")]),e.createElementVNode("div",nr,[e.createElementVNode("div",lr,[X.value.fromButton?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("label",ar,e.toDisplayString(Cn(X.value.categoryIndex)||""),1)),X.value.fromButton?(e.openBlock(),e.createElementBlock("div",sr,[e.withDirectives(e.createElementVNode("select",{id:"dss-marker-category","onUpdate:modelValue":r[1]||(r[1]=n=>X.value.categoryIndex=n),class:"dss-form-select",disabled:No.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ul.value,(n,c)=>(e.openBlock(),e.createElementBlock("option",{key:`category-option-${c}`,value:c},e.toDisplayString(n),9,ir))),128))],8,rr),[[e.vModelSelect,X.value.categoryIndex]])])):e.createCommentVNode("",!0)]),e.createElementVNode("div",cr,[e.createElementVNode("label",ur,e.toDisplayString(e.unref(J)("chart.modalMarker.description")),1),No.value?(e.openBlock(),e.createElementBlock("div",dr,e.toDisplayString(X.value.description),1)):e.withDirectives((e.openBlock(),e.createElementBlock("textarea",{key:1,id:"dss-marker-description","onUpdate:modelValue":r[2]||(r[2]=n=>X.value.description=n),placeholder:e.unref(J)("chart.modalMarker.placeholderDescription"),class:"dss-form-textarea",rows:"3"},null,8,mr)),[[e.vModelText,X.value.description]])]),e.createElementVNode("div",pr,[e.createElementVNode("label",null,e.toDisplayString(e.unref(J)("chart.modalMarker.iconPreview")),1),e.createElementVNode("div",fr,[e.createElementVNode("img",{src:yn({type:X.value.type}),alt:"Marker Icon Preview",class:"preview-icon",style:{width:"32px",height:"32px","border-radius":"50%",border:"2px solid #ddd"},onError:r[3]||(r[3]=n=>n.target.style.display="none")},null,40,vr)])])]),e.createElementVNode("div",hr,[e.createElementVNode("div",gr,[go.value&&!No.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-btn dss-btn-danger",onClick:st},e.toDisplayString(e.unref(J)("chart.modalMarker.deleteMarker")),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",yr,[e.createElementVNode("button",{class:"dss-btn dss-btn-secondary",onClick:at},e.toDisplayString(No.value?e.unref(J)("chart.modalMarker.close"):e.unref(J)("chart.modalMarker.cancel")),1),No.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-btn dss-btn-primary",onClick:ml,disabled:!(X.value.description&&X.value.description.length)},e.toDisplayString(go.value?e.unref(J)("chart.modalMarker.save"):e.unref(J)("chart.contextMenu.addMarker")),9,Cr))])])])])):e.createCommentVNode("",!0)],64))}}),wr={class:"dss-modal-title"},br={class:"dss-modal-actions"},xl={__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:vo}){const J=z,H=vo,zt=e.ref(null),S=e.ref(null),ie=e.computed(()=>{const le={"max-width":J.width};return J.height!=="auto"&&(le.height=J.height,le["min-height"]="0"),le}),bo=e.computed(()=>({}));function Uo(){H("close-modal")}function g(){J.backDrop&&!zt.value&&H("close-modal")}function Re(le){le.target.tagName==="INPUT"&&(zt.value=le.target.tagName)}function ct(){setTimeout(()=>{zt.value=null},300)}function et(){const le=document.body,ke=document.documentElement;S.value={bodyOverflow:le.style.overflow,bodyPosition:le.style.position,bodyTop:le.style.top,bodyWidth:le.style.width,htmlOverflow:ke.style.overflow,scrollY:window.scrollY},le.style.overflow="hidden",le.style.position="fixed",le.style.top=`-${S.value.scrollY}px`,le.style.width="100%",le.style.left="0",ke.style.overflow="hidden"}function D(){if(!S.value)return;const le=document.body,ke=document.documentElement,{bodyOverflow:gt,bodyPosition:yt,bodyTop:$,bodyWidth:Ye,htmlOverflow:Ht,scrollY:Ze}=S.value;le.style.overflow=gt||"",le.style.position=yt||"",le.style.top=$||"",le.style.width=Ye||"",le.style.left="",ke.style.overflow=Ht||"",window.scrollTo(0,Ze||0)}return e.watch(()=>J.showModal,le=>{if(le)et(),document.body.classList.add("dss-modal-open"),setTimeout(()=>{const ke=document.getElementById("dss-modal-backdrop");ke&&(ke.addEventListener("focusin",Re),ke.addEventListener("focusout",ct))},100);else{D(),document.body.classList.remove("dss-modal-open");const ke=document.getElementById("dss-modal-backdrop");ke&&(ke.removeEventListener("focusin",Re),ke.removeEventListener("focusout",ct))}},{immediate:!0}),e.onUnmounted(()=>{J.showModal&&D()}),(le,ke)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[z.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(ie.value)},[e.createElementVNode("div",{class:"dss-modal-content",onClick:ke[0]||(ke[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",wr,[e.renderSlot(le.$slots,"title",{},()=>[ke[1]||(ke[1]=e.createTextVNode("Default Title",-1))])]),e.renderSlot(le.$slots,"title-data"),z.showCloseBtn?(e.openBlock(),e.createElementBlock("span",{key:0,class:"dss-modal-close",onClick:Uo,title:"Close"},"×")):e.createCommentVNode("",!0)],4),e.createElementVNode("div",{class:"dss-modal-body",style:e.normalizeStyle(bo.value)},[e.renderSlot(le.$slots,"content",{},()=>[ke[2]||(ke[2]=e.createTextVNode("Default Content",-1))])],4),e.createElementVNode("div",br,[e.renderSlot(le.$slots,"actions")])])],4),[[e.vShow,z.showModal]])])):e.createCommentVNode("",!0)]))}},Er={class:"dss-toolbar-left"},Vr=["title"],Sr=["title"],Nr={class:"dss-toolbar-dropdown-wrapper"},Mr=["title"],Br={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"},Tr={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"},Hr={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"},Ar={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"},Lr={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"},$r={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"},Dr={key:6,width:"13",height:"14",viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"paragraph-icon"},Ir=["title"],_r=["title"],Rr=["title"],Fr=["title"],zr=["title"],Pr=["title"],Or=["title"],Zr=["title"],Wr=["title"],Ur={key:2,class:"dss-toolbar-separator"},qr=["title"],Xr={key:4,class:"dss-toolbar-separator"},Yr={key:5,class:"dss-toolbar-dropdown-wrapper"},jr=["title"],Kr={class:"dss-toolbar-dropdown-ai"},Gr={class:"dss-toolbar-right"},Jr={key:0,class:"dss-toolbar-custom-group"},Qr={key:1,class:"dss-toolbar-separator"},ei={class:"dss-link-modal-content"},ti={class:"dss-link-modal-field"},oi={class:"dss-link-modal-label"},ni=["placeholder"],li={class:"dss-link-modal-field"},ai={class:"dss-link-modal-label"},si=["placeholder"],ri={class:"dss-image-modal-tabs"},ii={key:0,class:"dss-image-tab-content"},ci={class:"dss-link-modal-content"},ui={class:"dss-link-modal-field"},di={key:0,class:"dss-link-modal-label"},mi=["src"],pi={class:"dss-link-modal-field"},fi={class:"dss-link-modal-label"},vi=["placeholder"],hi={class:"dss-link-modal-field"},gi={class:"dss-link-modal-label"},yi=["placeholder"],Ci={class:"dss-link-modal-field"},ki={class:"dss-link-modal-label"},xi=["placeholder"],wi={key:1,class:"dss-image-tab-content"},bi={class:"dss-link-modal-content"},Ei={class:"dss-link-modal-field"},Vi={class:"dss-link-modal-label"},Si=["placeholder"],Ni={class:"dss-link-modal-field"},Mi={class:"dss-link-modal-label"},Bi=["placeholder"],Ti={class:"dss-link-modal-field"},Hi={class:"dss-link-modal-label"},Ai=["placeholder"],Li={class:"dss-link-modal-field"},$i={class:"dss-link-modal-label"},Di=["placeholder"],Ii={class:"dss-text-editor-title-input-container"},_i={key:0,class:"dss-text-editor-title-preview"},Ri={key:0},Fi={key:1,class:"dss-text-editor-preview-placeholder"},zi=["value","placeholder","disabled"],Pi={key:2,class:"dss-text-editor-title-slot dss-text-editor-slot-last"},Oi={class:"dss-text-editor-description-input-container"},Zi={key:0,class:"dss-text-editor-description-preview"},Wi={key:0},Ui={key:1,class:"dss-text-editor-preview-placeholder"},qi=["value","placeholder","disabled"],Xi={key:3,class:"dss-text-editor-description-slot dss-text-editor-slot-last"},Yi=["data-comment-id","onMouseenter"],ji=["onClick"],Ki=["src","alt"],Gi={key:1},Ji=["onClick"],Qi=["src","alt"],ec={key:1},tc=["data-has-second-user","onClick"],oc={class:"editor-comment-marker-count"},nc={key:4,class:"dss-text-editor-textarea-wrapper"},lc=["value","placeholder","rows","disabled"],ac={class:"dss-text-editor-footer"},sc={class:"dss-text-editor-footer-content"},rc={class:"dss-text-editor-footer-stat"},ic={class:"dss-text-editor-footer-stat"},cc={key:5,class:"dss-text-editor-content-wrapper"},uc={key:0,class:"dss-comment-overlay-body"},dc={class:"dss-comment-selection-wrapper"},mc=["innerHTML"],pc={class:"dss-comment-messages-wrapper"},fc={key:0,class:"dss-comment-avatar-wrapper"},vc={class:"dss-comment-avatar"},hc=["src","alt"],gc={key:1},yc={class:"dss-comment-header"},Cc={class:"dss-comment-header-text"},kc={class:"dss-comment-author"},xc={key:0,class:"dss-comment-date"},wc=["onClick","title"],bc={class:"dss-comment-overlay-inner"},Ec=["placeholder","onKeydown"],Vc={class:"dss-text-editor-footer"},Sc={class:"dss-text-editor-footer-content"},Nc={class:"dss-text-editor-footer-stat"},Mc={class:"dss-text-editor-footer-stat"},Bc=["title"],Tc=["title"],Hc={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:""},Ac={class:"dss-image-popup-content"},Lc={key:0,class:"dss-image-popup-no-alt-icon"},$c=["title"],Dc=["title"],Ic={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:""},_c={class:"dss-toolbar-left"},Rc=["title"],Fc=["title"],zc={class:"dss-toolbar-dropdown-wrapper"},Pc=["title"],Oc={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"},Zc={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"},Wc={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"},Uc={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"},qc={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"},Xc={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"},Yc={key:6,width:"13",height:"14",viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"paragraph-icon"},jc=["title"],Kc=["title"],Gc=["title"],Jc=["title"],Qc=["title"],eu=["title"],tu=["title"],ou=["title"],nu=["title"],lu=["title"],au={key:2,class:"dss-toolbar-separator"},su={key:3,class:"dss-toolbar-dropdown-wrapper"},ru=["title"],iu={class:"dss-toolbar-dropdown-ai"},cu={key:0,class:"dss-toolbar-right"},uu={key:0,class:"dss-toolbar-separator"},du={key:0,class:"dss-toolbar-custom-group"},mu={key:1,class:"dss-toolbar-separator"},pu={name:"DSSTextEditor"},fu=Object.assign(pu,{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:vo,emit:J}){const{t:H,locale:zt}=El.useI18n(),S=z,ie=J,bo=e.useSlots(),Uo=`<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>`,v=e.ref(null),Le=e.ref(null),De=e.ref(!1),Oe=e.ref(!1),T=e.ref(!1),D=e.ref(""),W=e.ref({}),P=e.ref(!1),et=e.ref(!1),J=e.ref(""),Q=e.ref(""),tt=e.ref(null),bo=e.ref(null),de=e.ref(null),xt=e.ref(null),Ot=e.ref(""),Jt=e.ref(!1),O=e.ref({}),ye=e.ref(!1),Be=e.ref({}),fo=e.ref(null),Te=e.ref(null),vo=e.ref(!1),Pe=e.ref(""),Vo=e.ref(null),ot=e.ref(""),ee=e.ref(""),se=e.ref(""),wt=e.ref(null),Xe=e.ref(null),go=e.ref(null),Y=e.ref(null),Et=e.ref(null),ho=e.ref(!1),Qt=e.ref(""),Pt=e.ref({}),Zt=e.ref(!1),_e=e.ref("upload"),bt=e.ref(""),Ze=e.ref(null),xe=e.ref(null),nt=e.ref([]),eo=e.ref([]),z=e.ref(null),le=e.ref(!1),Ue=e.ref(""),Vt=e.ref(""),lt=e.ref(""),fe=e.ref(""),We=e.ref(""),Ye=e.ref(""),K=e.ref(null),te=e.ref(null),ut=e.ref(null),Fo=e.ref(!1),je=e.ref(null),Ke=e.ref(!1),Ge=e.ref(!1),St=e.ref(null),ve=e.ref("p"),mt=e.ref(!1),Ut=e.ref([]),pt=e.ref(null),Ie=e.ref(null),zo=e.ref(null),to=e.ref(!1),Oo=e.ref(0),Sn=100,ft=e.ref(null),Nn=e.computed(()=>({"dss-text-editor-no-border":!w.border,"dss-text-editor-rounded":w.rounded,"dss-text-editor-full-height":w.fullHeight,"dss-comment-overlay-open":ce.value!==null})),Mn=e.computed(()=>({})),Jo=e.computed(()=>!w.fixedHeight||w.fullHeight?{}:{height:`${1.6*14*w.rows+24+2}px`,resize:"none",overflowY:"auto"}),Po=e.computed(()=>!w.fixedHeight||w.fullHeight?{}:{height:`${1.6*14*w.rows+32}px`,overflowY:"auto"}),Qo=e.computed(()=>w.richText&&eo.value.length>0),en=e.computed(()=>{if(!w.modelValue)return"";if(w.richText){let t=w.modelValue.replace(/<script[^>]*>[\s\S]*?<\/script>/gi,"");return t=t.replace(/<style[^>]*>[\s\S]*?<\/style>/gi,""),t=t.replace(/<[^>]+>/g,""),t=t.replace(/&nbsp;/g," "),t=t.replace(/&amp;/g,"&"),t=t.replace(/&lt;/g,"<"),t=t.replace(/&gt;/g,">"),t=t.replace(/&quot;/g,'"'),t=t.replace(/&#39;/g,"'"),t=t.replace(/\s+/g," ").trim(),t}return w.modelValue}),So=e.computed(()=>{const t=en.value.trim();return t?t.split(/\s+/).filter(o=>o.length>0).length:0}),re=e.computed(()=>en.value.length),L=e.computed(()=>Y.value!==null&&_e.value==="upload"&&ot.value&&ot.value.startsWith("data:")),No=e.computed(()=>w.titlePlaceholder||b("textEditor.placeholders.title")),ae=e.computed(()=>w.descriptionPlaceholder||b("textEditor.placeholders.description")),Nt=e.computed(()=>w.placeholder||b("textEditor.placeholders.startTyping")),I=t=>kt&&kt[t]!==void 0,oe=t=>{for(let o=t+1;o<w.customToolbarSlots.length;o++)if(I(w.customToolbarSlots[o]))return!0;return!1},S=t=>{for(let o=t+1;o<w.customToolbarSlots.length;o++){const n=w.customToolbarSlots[o];if(I(n)&&ge(n))return!0}return!1},ge=t=>w.customToolbarFloatingMap.hasOwnProperty(t)?w.customToolbarFloatingMap[t]===!0:!0,$=e.computed(()=>w.customToolbarSlots.some(t=>I(t)&&ge(t))),tn=e.computed(()=>I("title-slot")),oo=e.computed(()=>I("description-slot")),Mt=t=>{if(!t||t.trim()==="")return"<html></html>";const o=t.trim();return o.startsWith("<html>")&&o.endsWith("</html>")?t:`<html>${t}</html>`},Zo=t=>{if(!t||t.trim()==="")return"";const o=t.replace(/<!--[\s\S]*?-->/g,""),n=o.trim();return n.startsWith("<html>")&&n.endsWith("</html>")?n.slice(6,-7).trim():o},on=t=>{if(!t)return;const o=document.createTreeWalker(t,NodeFilter.SHOW_COMMENT,null,!1),n=[];let a=o.nextNode();for(;a;)n.push(a),a=o.nextNode();n.forEach(r=>r.remove())},Bn=t=>{try{const o=String(t.getDate()).padStart(2,"0"),a=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][t.getMonth()],r=t.getFullYear();return`${o} ${a} ${r}`}catch{return""}},nn=t=>{if(!t||typeof t!="string")return!1;const o=t.trim();if(!o)return!1;if(["Started conversation","A démarré la conversation","started_conversation","conv_started"].includes(o))return!0;try{const r=b("textEditor.started_conversation");if(r&&o===r)return!0}catch{}const a=o.toLowerCase();return a.includes("started conversation")||a.includes("démarré la conversation")||a==="started conversation"||a==="a démarré la conversation"},Tn=t=>{const o=t.target.value;X("update:modelValue",o),X("change",o)},Re=()=>{if(!K.value)return;const t=K.value;if(t.style.setProperty("text-overflow","","important"),t.style.setProperty("white-space","","important"),t.style.setProperty("overflow-x","","important"),t.style.setProperty("height","auto","important"),t.value.trim()===""){const a=t.value;t.value="M";const r=t.scrollHeight;t.value=a,t.style.setProperty("height",`${r}px`,"important"),t.style.setProperty("overflow-y","hidden","important");return}t.offsetHeight;const n=t.scrollHeight;t.style.setProperty("height",`${n}px`,"important"),t.style.setProperty("overflow-y","hidden","important")},Hn=()=>{Ke.value=!0,Re()},An=()=>{Ke.value=!1,Uo()},Uo=()=>{if(!K.value)return;const t=K.value;t.style.setProperty("text-overflow","","important"),t.style.setProperty("white-space","","important"),t.style.setProperty("overflow-x","","important"),t.style.setProperty("height","auto","important");const o=t.value;t.value="M";const n=t.scrollHeight;t.value=o,t.offsetHeight,t.style.setProperty("height",`${n}px`,"important"),t.style.setProperty("overflow-y","hidden","important"),t.style.setProperty("overflow-x","hidden","important"),t.style.setProperty("text-overflow","ellipsis","important"),t.style.setProperty("white-space","nowrap","important")},ln=t=>{const n=t.target.value;Ke.value&&Re(),X("update:title",n),X("title-change",n),ut.value="title",w.richText&&(le.value||(Vt.value=Ue.value,We.value=lt.value,Ye.value=fe.value),z.value&&clearTimeout(z.value),le.value=!0,z.value=setTimeout(()=>{le.value=!1,we()},500))},yo=()=>{if(!te.value)return;const t=te.value;if(t.style.setProperty("text-overflow","","important"),t.style.setProperty("white-space","","important"),t.style.setProperty("overflow-x","","important"),t.style.setProperty("height","auto","important"),t.value.trim()===""){const a=t.value;t.value="M";const r=t.scrollHeight;t.value=a,t.style.setProperty("height",`${r}px`,"important"),t.style.setProperty("overflow-y","hidden","important");return}t.offsetHeight;const n=t.scrollHeight;t.style.setProperty("height",`${n}px`,"important"),t.style.setProperty("overflow-y","hidden","important")},Ln=()=>{Ge.value=!0,yo()},$n=()=>{Ge.value=!1,Mo()},Mo=()=>{if(!te.value)return;const t=te.value;t.style.setProperty("text-overflow","","important"),t.style.setProperty("white-space","","important"),t.style.setProperty("overflow-x","","important"),t.style.setProperty("height","auto","important");const o=t.value;t.value="M";const n=t.scrollHeight;t.value=o,t.offsetHeight,t.style.setProperty("height",`${n}px`,"important"),t.style.setProperty("overflow-y","hidden","important"),t.style.setProperty("overflow-x","hidden","important"),t.style.setProperty("text-overflow","ellipsis","important"),t.style.setProperty("white-space","nowrap","important")},Dn=t=>{const n=t.target.value;Ge.value&&yo(),X("update:description",n),X("description-change",n),ut.value="description",w.richText&&(le.value||(Vt.value=Ue.value,We.value=lt.value,Ye.value=fe.value),z.value&&clearTimeout(z.value),le.value=!0,z.value=setTimeout(()=>{le.value=!1,we()},500))},be=()=>{const t=window.getSelection();if(t.rangeCount===0)return null;const o=t.getRangeAt(0);if(o.startContainer.nodeType===1)return{type:"element",element:o.startContainer,offset:o.startOffset};const n=o.cloneRange();return n.selectNodeContents(v.value),n.setEnd(o.startContainer,o.startOffset),{type:"text",start:n.toString().length,end:n.toString().length+o.toString().length}},at=t=>{if(!(!t||!v.value))try{const o=window.getSelection(),n=document.createRange();if(t.type==="element"&&t.element)if(v.value.contains(t.element)){n.setStart(t.element,t.offset),n.collapse(!0),o.removeAllRanges(),o.addRange(n);return}else{v.value.focus();return}let a=0;const r=[v.value];let c=null,i=!1,d=!1;for(;!d&&(c=r.pop());)if(c.nodeType===3){const m=a+c.length;!i&&t.start>=a&&t.start<=m&&(n.setStart(c,t.start-a),i=!0),i&&t.end>=a&&t.end<=m&&(n.setEnd(c,t.end-a),d=!0),a=m}else{let m=c.childNodes.length;for(;m--;)r.push(c.childNodes[m])}o.removeAllRanges(),o.addRange(n)}catch{v.value.focus()}},Bo=()=>{if(!v.value)return;v.value.focus();const t=window.getSelection(),o=document.createRange(),n=r=>{if(r.nodeType===3||r.childNodes.length===0)return r;for(let c=r.childNodes.length-1;c>=0;c--){const i=r.childNodes[c],d=n(i);if(d)return d}return r},a=n(v.value);if(a.nodeType===3)o.setStart(a,a.length),o.setEnd(a,a.length);else if(a.childNodes.length>0){const r=n(a);r&&r.nodeType===3?(o.setStart(r,r.length),o.setEnd(r,r.length)):(o.selectNodeContents(a),o.collapse(!1))}else o.setStart(a,0),o.setEnd(a,0);t.removeAllRanges(),t.addRange(o)},we=(t=!1)=>{if(!v.value)return;const o=v.value.innerHTML,n=w.title||"",a=w.description||"";if(!t&&o===Ue.value&&n===lt.value&&a===fe.value)return;const r={content:Vt.value||Ue.value,title:We.value!==void 0?We.value:lt.value,description:Ye.value!==void 0?Ye.value:fe.value},c=nt.value.length>0?nt.value[nt.value.length-1]:null;let i=!0;c&&(typeof c=="string"?i=r.content!==c:i=r.content!==c.content||r.title!==c.title||r.description!==c.description),i&&(nt.value.push(r),nt.value.length>50&&nt.value.shift(),eo.value=[]),Ue.value=o,lt.value=n,fe.value=a,Vt.value=o,We.value=n,Ye.value=a},j=t=>{if(!v.value)return;Wo(),v.value&&on(v.value);let o=null;v.value&&(v.value.querySelector("p")||(o=be(),no()));const n=t&&t.inputType&&(t.inputType==="insertText"||t.inputType==="insertCompositionText"||t.inputType==="deleteContentBackward"||t.inputType==="deleteContentForward");n&&St.value&&(St.value=null),Oe.value=!0;const a=v.value.innerHTML.replace(/<!--[\s\S]*?-->/g,"").replace(/&nbsp;|\u00A0/g," "),r=Mt(a);X("update:modelValue",r),X("change",r),ut.value="editor",le.value||(Vt.value=Ue.value,We.value=lt.value,Ye.value=fe.value),z.value&&clearTimeout(z.value),le.value=!0,z.value=setTimeout(()=>{le.value=!1,we(),Io(),gt()},500),e.nextTick(()=>{o&&at(o),Wo();const c=["bold","italic","underline"],i=window.getSelection(),d=i.rangeCount>0?i.getRangeAt(0):null,m=d&&d.collapsed;if(c.forEach(p=>{try{if(m&&St.value?.command===p){O.value[p]=St.value.state;return}if(p==="bold")if(d){const g=d.commonAncestorContainer,h=g.nodeType===3?g.parentElement:g;let f=!1;if(h&&((h.tagName==="STRONG"||h.tagName==="B"||h.closest&&h.closest("strong, b"))&&(f=!0),!f&&h.style&&parseInt(h.style.fontWeight)>=600&&(f=!0),!f))try{const C=window.getComputedStyle(h);parseInt(C.fontWeight)>=600&&(f=!0)}catch{}O.value[p]=f}else O.value.hasOwnProperty(p)||(O.value[p]=!1);else if(p==="italic")if(d){const g=d.commonAncestorContainer,h=g.nodeType===3?g.parentElement:g,f=h&&(h.tagName==="EM"||h.tagName==="I"||h.closest&&h.closest("em, i"));O.value[p]=!!f}else{const g=document.queryCommandState(p);O.value[p]=g}else{const g=document.queryCommandState(p);O.value[p]=g}}catch{}}),Ce(),st(),Bt(),pe(),$t(),Qe("handleRichTextInput"),n&&(t.inputType==="insertText"||t.inputType==="insertCompositionText")){const p=t.data||"";p&&p.length===1&&setTimeout(()=>gt(p),0),(p===" "||p===`
78
- `||/[.,;:!?]/.test(p))&&setTimeout(()=>{Io()},100)}Oe.value=!1})},Wo=()=>{if(!v.value)return;const t=window.getSelection();if(!t||t.rangeCount===0)return;const o=t.getRangeAt(0),n=o.commonAncestorContainer,a=n.nodeType===3?n.parentElement:n;if(!a)return;const r=a.closest(".dss-image-wrapper");if(r){const c=r.querySelector("img");if(a!==c&&!c?.contains(a)){const i=o.startContainer.nodeType===3?o.startContainer.parentElement:o.startContainer,d=o.endContainer.nodeType===3?o.endContainer.parentElement:o.endContainer;if(r.contains(i)&&i!==c||r.contains(d)&&d!==c){const m=document.createRange();m.setStartAfter(r),m.collapse(!0),t.removeAllRanges(),t.addRange(m)}}}},no=()=>{if(!v.value)return;const t=v.value;if(t.querySelector&&t.querySelector("p"))return;const o=new Set(["P","H1","H2","H3","H4","H5","H6","BLOCKQUOTE","UL","OL","DIV"]),n=Array.from(t.childNodes);let a=null;n.forEach(r=>{if(r.nodeType===Node.TEXT_NODE){if((r.textContent||"").trim()===""){r.parentNode===t&&t.removeChild(r);return}a||(a=document.createElement("p"),t.insertBefore(a,r)),a.appendChild(r);return}if(r.nodeType===Node.ELEMENT_NODE){const c=r,i=c.tagName;if(i==="BR"){a=null;return}if(o.has(i)){a=null;return}a||(a=document.createElement("p"),t.insertBefore(a,c)),a.appendChild(c)}})},st=()=>{if(v.value&&!Fo.value){Fo.value=!0;try{v.value.querySelectorAll(".dss-image-wrapper").forEach(a=>{a.querySelector("img")||a.remove()}),v.value.querySelectorAll(".dss-image-no-alt-icon").forEach(a=>{const r=a.parentElement;!r||!r.classList.contains("dss-image-wrapper")?a.remove():r.querySelector("img")||a.remove()}),v.value.querySelectorAll("img").forEach(a=>{let r=a.getAttribute("alt");r===null&&(r=a.alt||"");const c=a.getAttribute("src")||a.src||"";if(r){const p=c.replace(/^https?:\/\//,"").replace(/^data:.*,/,""),g=r===c||r===p;(r.startsWith("http://")||r.startsWith("https://")||r.startsWith("data:")||g||g)&&(r="")}a.setAttribute("alt",r),a.setAttribute("data-alt",r);const i=!r||r.trim()==="";let d=a.parentElement;const m=d&&d.classList.contains("dss-image-wrapper");if(m){const p=d.querySelector(".dss-image-no-alt-icon");p&&p.remove()}else{const p=a.nextElementSibling?.classList.contains("dss-image-no-alt-icon")?a.nextElementSibling:null;p&&p.remove()}if(i){m?d.setAttribute("contenteditable","false"):(d=document.createElement("span"),d.className="dss-image-wrapper",d.setAttribute("contenteditable","false"),a.parentNode.insertBefore(d,a),d.appendChild(a));const p=document.createElement("div");p.className="dss-image-no-alt-icon",p.setAttribute("contenteditable","false"),p.innerHTML=N,d.appendChild(p)}else if(m&&d.children.length===1){const p=d.parentNode;p.insertBefore(a,d),p.removeChild(d)}})}finally{Fo.value=!1}}},Wt=t=>{Io(),X("blur",t),Co()},an=()=>{if(w.disabled||!w.richText||!v.value)return;Ve(),z.value&&(clearTimeout(z.value),z.value=null),le.value&&(we(),le.value=!1);const t=ut.value==="title",o=ut.value==="description",n=ut.value==="editor";if(nt.value.length===0){t&&K.value?K.value.focus():o&&te.value?te.value.focus():v.value.focus(),document.execCommand("undo",!1),e.nextTick(()=>{j()});return}const a={content:v.value.innerHTML,title:w.title||"",description:w.description||""};eo.value.push(a);const r=nt.value.pop();if(r!==void 0){Oe.value=!0;const c=typeof r=="string"?r:r.content,i=typeof r=="object"&&r.title||"",d=typeof r=="object"&&r.description||"";v.value.innerHTML=c,Ue.value=c,lt.value=i,fe.value=d,Vt.value=c,We.value=i,Ye.value=d,e.nextTick(()=>{Ce(),He(),Dt(),pe();const m=Mt(c);X("update:modelValue",m),X("update:title",i),X("update:description",d),X("change",m),X("title-change",i),X("description-change",d),Oe.value=!1,e.nextTick(()=>{setTimeout(()=>{if(t){if(K.value){K.value.focus();const p=i.length;K.value.setSelectionRange&&K.value.setSelectionRange(p,p),Re()}}else if(o){if(te.value){te.value.focus();const p=d.length;te.value.setSelectionRange(p,p)}}else if(n)Bo();else if(K.value&&document.activeElement===K.value){const p=i.length;K.value.setSelectionRange&&K.value.setSelectionRange(p,p),Re()}else if(te.value&&document.activeElement===te.value){const p=d.length;te.value.setSelectionRange(p,p)}else v.value&&Bo()},10)})})}},sn=()=>{if(w.disabled||!w.richText||!v.value)return;Ve();const t=ut.value==="title",o=ut.value==="description",n=ut.value==="editor";if(eo.value.length===0){t&&K.value?K.value.focus():o&&te.value?te.value.focus():v.value.focus(),document.execCommand("redo",!1),e.nextTick(()=>{j()});return}const a={content:v.value.innerHTML,title:w.title||"",description:w.description||""};nt.value.push(a);const r=eo.value.pop();if(r!==void 0){Oe.value=!0;const c=typeof r=="string"?r:r.content,i=typeof r=="object"&&r.title||"",d=typeof r=="object"&&r.description||"";v.value.innerHTML=c,Ue.value=c,lt.value=i,fe.value=d,Vt.value=c,We.value=i,Ye.value=d,e.nextTick(()=>{Ce(),He(),Dt(),pe();const m=Mt(c);X("update:modelValue",m),X("update:title",i),X("update:description",d),X("change",m),X("title-change",i),X("description-change",d),Oe.value=!1,e.nextTick(()=>{setTimeout(()=>{if(t){if(K.value){K.value.focus();const p=i.length;K.value.setSelectionRange&&K.value.setSelectionRange(p,p),Re()}}else if(o){if(te.value){te.value.focus();const p=d.length;te.value.setSelectionRange(p,p)}}else if(n)Bo();else if(K.value&&document.activeElement===K.value){const p=i.length;K.value.setSelectionRange&&K.value.setSelectionRange(p,p),Re()}else if(te.value&&document.activeElement===te.value){const p=d.length;te.value.setSelectionRange(p,p)}else v.value&&Bo()},10)})})}},To=()=>{if(!v.value)return;v.value.querySelectorAll('span[style*="font-weight"]').forEach(a=>{const r=a.style.fontWeight;if(r==="normal"||r==="400"){const c=document.createDocumentFragment();for(;a.firstChild;)c.appendChild(a.firstChild);a.parentNode&&a.parentNode.replaceChild(c,a)}}),v.value.querySelectorAll('span[style*="font-weight"]').forEach(a=>{if(parseInt(a.style.fontWeight)>=600){const c=document.createElement("b");for(c.style.fontWeight="600";a.firstChild;)c.appendChild(a.firstChild);a.parentNode&&a.parentNode.replaceChild(c,a)}}),v.value.querySelectorAll("b, strong").forEach(a=>{a.style.fontWeight="600"})},Bt=()=>{if(!v.value)return;v.value.querySelectorAll("i, em").forEach(o=>{o.style.fontStyle="italic"})},_n=()=>{const t=window.getSelection();if(!t||t.rangeCount===0)return!1;const o=t.getRangeAt(0);let n=!1;if(o.collapsed){const a=o.startContainer;let r=a.nodeType===3?a.parentElement:a;for(;r&&r!==v.value;){if(r.tagName==="EM"||r.tagName==="I"){n=!0;break}if(r.style&&r.style.fontStyle==="italic"){n=!0;break}r=r.parentElement}}else{const a=o.commonAncestorContainer.nodeType===1?o.commonAncestorContainer:o.commonAncestorContainer.parentNode;if(a){const r=document.createTreeWalker(a,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let c;for(;c=r.nextNode();)if(!(typeof o.intersectsNode=="function"&&!o.intersectsNode(c))){if(c.nodeType===3){let i=c.parentElement;for(;i&&i!==v.value;){if(i.tagName==="EM"||i.tagName==="I"){n=!0;break}if(i.style&&i.style.fontStyle==="italic"){n=!0;break}i=i.parentElement}}else if(c.nodeType===1){const i=c;if(i.tagName==="EM"||i.tagName==="I"){n=!0;break}if(i.style&&i.style.fontStyle==="italic"){n=!0;break}}if(n)break}}}if(n)return document.execCommand("italic",!1),e.nextTick(()=>{Bt()}),!1;if(o.collapsed)document.execCommand("italic",!1),e.nextTick(()=>{Bt()});else try{const a=o.extractContents(),r=document.createElement("em");r.style.fontStyle="italic",r.appendChild(a),o.insertNode(r),o.setStartAfter(r),o.collapse(!0),t.removeAllRanges(),t.addRange(o),e.nextTick(()=>{Bt()})}catch{document.execCommand("italic",!1),e.nextTick(()=>{Bt()})}return!0},In=()=>{const t=window.getSelection();if(!t||t.rangeCount===0)return!1;const o=t.getRangeAt(0);let n=!1;if(o.collapsed){const a=o.startContainer;let r=a.nodeType===3?a.parentElement:a;for(;r&&r!==v.value;){if(r.tagName==="STRONG"||r.tagName==="B"){n=!0;break}if(r.style&&parseInt(r.style.fontWeight)>=600){n=!0;break}r=r.parentElement}}else{const a=o.commonAncestorContainer.nodeType===1?o.commonAncestorContainer:o.commonAncestorContainer.parentNode;if(a){const r=document.createTreeWalker(a,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let c;for(;c=r.nextNode();)if(!(typeof o.intersectsNode=="function"&&!o.intersectsNode(c))){if(c.nodeType===3){let i=c.parentElement;for(;i&&i!==v.value;){if(i.tagName==="STRONG"||i.tagName==="B"){n=!0;break}if(i.style&&parseInt(i.style.fontWeight)>=600){n=!0;break}i=i.parentElement}}else if(c.nodeType===1){const i=c;if(i.tagName==="STRONG"||i.tagName==="B"){n=!0;break}if(i.style&&parseInt(i.style.fontWeight)>=600){n=!0;break}}if(n)break}}}if(n)return document.execCommand("bold",!1),e.nextTick(()=>{To()}),!1;if(o.collapsed)document.execCommand("bold",!1),e.nextTick(()=>{const a=window.getSelection();if(a.rangeCount>0){const r=a.getRangeAt(0),c=r.startContainer;let i=c.nodeType===3?c.parentElement:c;for(;i&&i!==v.value;){if(i.tagName==="SPAN"&&i.style.fontWeight){const d=i.style.fontWeight;if(d==="normal"||d==="400"){const m=document.createElement("b");m.style.fontWeight="600";const p=document.createDocumentFragment();for(;i.firstChild;)p.appendChild(i.firstChild);m.appendChild(p),i.parentNode&&i.parentNode.replaceChild(m,i),r.setStart(m,0),r.collapse(!0),a.removeAllRanges(),a.addRange(r);break}}else if(i.tagName==="STRONG"||i.tagName==="B"){i.style.fontWeight="600";break}i=i.parentElement}if(!i||i===v.value){const d=document.createElement("b");d.style.fontWeight="600",d.innerHTML="<br>",r.insertNode(d),r.setStart(d,0),r.collapse(!0),a.removeAllRanges(),a.addRange(r)}}To()});else try{const a=o.extractContents(),r=document.createElement("b");r.style.fontWeight="600",r.appendChild(a),o.insertNode(r),o.setStartAfter(r),o.collapse(!0),t.removeAllRanges(),t.addRange(o),e.nextTick(()=>{To()})}catch{document.execCommand("bold",!1),e.nextTick(()=>{To()})}return!0},Tt=(t,o=null)=>{if(w.disabled||!w.richText||!v.value)return;le.value?(z.value&&(clearTimeout(z.value),z.value=null),we(),le.value=!1):we(),Ve(),v.value.focus();const n=window.getSelection();let a=null;if(n&&n.rangeCount>0){const c=n.getRangeAt(0);!c.collapsed&&_t(c)&&(a=be())}if(t==="createLink"&&o){const c=window.getSelection();if(c.rangeCount>0){const i=c.getRangeAt(0);if(i.collapsed)try{i.expand("word")}catch{const m=document.createTextNode(o);i.insertNode(m),i.selectNodeContents(m)}}}if(t==="bold"){const c=In();O.value.bold=c;const i=window.getSelection();i.rangeCount>0&&i.getRangeAt(0).collapsed&&(St.value={command:"bold",state:c}),e.nextTick(()=>{a&&(at(a),e.nextTick(()=>{const d=$e("bold");O.value.bold=d})),j(),He(),pe()});return}if(t==="italic"){const c=_n();O.value.italic=c;const i=window.getSelection();i.rangeCount>0&&i.getRangeAt(0).collapsed&&(St.value={command:"italic",state:c}),e.nextTick(()=>{a&&(at(a),e.nextTick(()=>{const d=$e("italic");O.value.italic=d})),j(),Bt(),He(),pe()});return}let r=!1;try{r=document.execCommand(t,!1,o)}catch{}e.nextTick(()=>{if(a&&at(a),["bold","italic","underline"].includes(t))try{if(t==="bold")a&&e.nextTick(()=>{const i=$e("bold");O.value.bold=i});else if(t==="italic")if(a)e.nextTick(()=>{const i=$e("italic");O.value.italic=i});else{const i=document.queryCommandState(t);O.value[t]=i}else{const i=document.queryCommandState(t);O.value[t]=i}}catch{O.value.hasOwnProperty(t)?O.value[t]=!O.value[t]:O.value[t]=!0}if(t==="createLink"&&o){const i=window.getSelection();if(i.rangeCount>0){const m=i.getRangeAt(0),p=m.commonAncestorContainer.nodeType===1?m.commonAncestorContainer.closest("a"):m.commonAncestorContainer.parentElement?.closest("a");p&&(!p.getAttribute("href")||p.getAttribute("href")==="")&&p.setAttribute("href",o)}v.value.querySelectorAll("a").forEach(m=>{const p=m.getAttribute("href");(!p||p===""||p==="#")&&m.setAttribute("href",o)})}j(),He(),pe()})},$e=(t,o=null)=>{if(w.disabled||!v.value)return!1;try{if(t==="formatBlock"&&o){const a=document.queryCommandValue("formatBlock");if(o==="<blockquote>"){const r=a.toLowerCase();if(r==="blockquote"||r==="<blockquote>")return!0;const c=window.getSelection();if(c.rangeCount>0){const d=c.getRangeAt(0).commonAncestorContainer;return!!(d.nodeType===1?d.tagName==="BLOCKQUOTE"?d:d.closest("blockquote"):d.parentElement?.closest("blockquote"))}}return a===o||a.toLowerCase()===o.toLowerCase()}if(["bold","italic","underline"].includes(t))try{const a=window.getSelection();if(a.rangeCount>0){const r=a.getRangeAt(0);if(t==="bold"){let i=!1;if(r.collapsed){const d=r.commonAncestorContainer,m=d.nodeType===3?d.parentElement:d;if(m&&((m.tagName==="STRONG"||m.tagName==="B"||m.closest&&m.closest("strong, b"))&&(i=!0),!i&&m.style&&parseInt(m.style.fontWeight)>=600&&(i=!0),!i))try{const p=window.getComputedStyle(m);parseInt(p.fontWeight)>=600&&(i=!0)}catch{}return O.value.hasOwnProperty(t)?O.value[t]:(O.value[t]=i,i)}else{const d=r.commonAncestorContainer.nodeType===1?r.commonAncestorContainer:r.commonAncestorContainer.parentNode;let m=!1;if(d){const p=document.createTreeWalker(d,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let g;for(;g=p.nextNode();)if(!(typeof r.intersectsNode=="function"&&!r.intersectsNode(g))){if(g.nodeType===3){if(!(g.textContent||"").trim())continue;m=!0;let f=g.parentElement;for(;f&&f!==v.value;){if(f.tagName==="STRONG"||f.tagName==="B"){i=!0;break}if(f.style&&parseInt(f.style.fontWeight)>=600){i=!0;break}f=f.parentElement}}else if(g.nodeType===1){const h=g;if(h.tagName==="STRONG"||h.tagName==="B"){i=!0;break}if(h.style&&parseInt(h.style.fontWeight)>=600){i=!0;break}}if(i)break}}return O.value[t]=i&&m,i&&m}}if(t==="italic"){let i=!1;if(r.collapsed){const d=r.commonAncestorContainer,m=d.nodeType===3?d.parentElement:d;if(m&&((m.tagName==="EM"||m.tagName==="I"||m.closest&&m.closest("em, i"))&&(i=!0),!i&&m.style&&m.style.fontStyle==="italic"&&(i=!0),!i))try{window.getComputedStyle(m).fontStyle==="italic"&&(i=!0)}catch{}return O.value.hasOwnProperty(t)?O.value[t]:(O.value[t]=i,i)}else{const d=r.commonAncestorContainer.nodeType===1?r.commonAncestorContainer:r.commonAncestorContainer.parentNode;let m=!1;if(d){const p=document.createTreeWalker(d,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let g;for(;g=p.nextNode();)if(!(typeof r.intersectsNode=="function"&&!r.intersectsNode(g))){if(g.nodeType===3){if(!(g.textContent||"").trim())continue;m=!0;let f=g.parentElement;for(;f&&f!==v.value;){if(f.tagName==="EM"||f.tagName==="I"){i=!0;break}if(f.style&&f.style.fontStyle==="italic"){i=!0;break}f=f.parentElement}}else if(g.nodeType===1){const h=g;if(h.tagName==="EM"||h.tagName==="I"){i=!0;break}if(h.style&&h.style.fontStyle==="italic"){i=!0;break}}if(i)break}}return O.value[t]=i&&m,i&&m}}const c=document.queryCommandState(t);return r.collapsed&&O.value.hasOwnProperty(t)?O.value[t]:(O.value[t]=c,c)}return O.value.hasOwnProperty(t)?O.value[t]:!1}catch{return O.value.hasOwnProperty(t)?O.value[t]:!1}try{return document.queryCommandState(t)}catch{return!1}}catch{return!1}},Ho=t=>{w.disabled||!w.richText||(Le.value=Le.value===t?null:t,t==="askAi"&&(Te.value=null))},Ve=()=>{Le.value=null,Ze.value=null},Ht=t=>{Tt("formatBlock",t),Ve()},Rn=t=>{if(!t||!v.value)return t;const o=x=>{let E=x.nodeType===Node.TEXT_NODE?x.parentElement:x;for(;E&&E!==v.value;){const V=E.tagName;if(V==="P"){const M=E.parentElement;if(M===v.value||M.tagName==="BLOCKQUOTE")return E}if(V==="BLOCKQUOTE")break;E=E.parentElement}return null},n=o(t.startContainer),a=o(t.endContainer);if(!n||!a)return t;const r=[],c=document.createTreeWalker(v.value,NodeFilter.SHOW_ELEMENT,{acceptNode:x=>{const E=x.tagName;if(E==="P"){const V=x.parentElement;if(V===v.value||V.tagName==="BLOCKQUOTE")return NodeFilter.FILTER_ACCEPT}return E==="BLOCKQUOTE"?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_SKIP}});let i;for(;i=c.nextNode();)r.push(i);const d=r.indexOf(n),m=r.indexOf(a);if(d===-1||m===-1)return t;const p=Math.min(d,m),g=Math.max(d,m),h=r.slice(p,g+1);if(h.length===0)return t;const f=h[0],C=h[h.length-1],y=document.createRange();return y.setStartBefore(f),y.setEndAfter(C),y},Ao=()=>{if(w.disabled||!w.richText||!v.value)return;le.value?(z.value&&(clearTimeout(z.value),z.value=null),we(),le.value=!1):we(),Ve(),v.value.focus();const t=window.getSelection();if(t.rangeCount===0)return;let o=t.getRangeAt(0);!o.collapsed&&_t(o)&&(o=Rn(o),t.removeAllRanges(),t.addRange(o));let n=null;!o.collapsed&&_t(o)&&(n=be());const a=o.commonAncestorContainer,r=a.nodeType===1?a.tagName==="BLOCKQUOTE"?a:a.closest("blockquote"):a.parentElement?.closest("blockquote");if(!!(r&&v.value.contains(r))){if(r){const i=r.parentNode;Array.from(r.childNodes).forEach(m=>{if(m.nodeType===Node.ELEMENT_NODE)if(m.tagName==="P"||m.tagName==="DIV")i.insertBefore(m,r);else{const p=document.createElement("p");p.appendChild(m.cloneNode(!0)),i.insertBefore(p,r)}else if(m.nodeType===Node.TEXT_NODE&&m.textContent.trim()){const p=document.createElement("p");p.appendChild(m.cloneNode(!0)),i.insertBefore(p,r)}}),r.remove()}}else if(o.collapsed)document.execCommand("formatBlock",!1,"<blockquote>");else{const i=document.createElement("blockquote"),d=o.extractContents();i.appendChild(d),o.insertNode(i);const m=[],p=document.createTreeWalker(i,NodeFilter.SHOW_TEXT,{acceptNode:f=>f.parentNode===i&&f.textContent.trim()?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});let g;for(;g=p.nextNode();)m.push(g);if(m.forEach(f=>{const C=document.createElement("p");f.parentNode.insertBefore(C,f),C.appendChild(f)}),i.querySelectorAll("p, div").forEach(f=>{f.textContent.trim()===""&&!f.querySelector("img")&&(f.innerHTML="<br>")}),i.children.length===0&&i.textContent.trim()===""){const f=document.createElement("p");f.innerHTML="<br>",i.appendChild(f)}}e.nextTick(()=>{n&&at(n),Dt(),j(),pe()})},rn=()=>{if(!v.value)return;const t=window.getSelection();if(t.rangeCount===0)return;const n=t.getRangeAt(0).commonAncestorContainer,a=n.nodeType===1?n.tagName==="BLOCKQUOTE"?n:n.closest("blockquote"):n.parentElement?.closest("blockquote");if(!a||!v.value.contains(a))return;const r=g=>{if(!g)return!1;const h=g.textContent||"",C=(g.innerHTML||"").trim();return h.trim()===""||C===""||C==="<br>"||C==="<br/>"||C==="<p></p>"||C==="<p><br></p>"||C==="<p><br/></p>"||C==="<p> </p>"||C==="<p><br> </p>"||C==="<div></div>"||C==="<div><br></div>"||C==="<div><br/></div>"};let c=null;for(n.nodeType===3?c=n.parentElement:n.tagName==="P"||n.tagName==="DIV"?c=n:c=n.closest("p, div"),c&&a.contains(c)&&r(c)&&c.remove();a.lastChild;){const g=a.lastChild;if(g.nodeType===1&&g.tagName==="BR")g.remove();else if(g.nodeType===3)if((g.textContent||"").trim()==="")g.remove();else break;else break}if(a.children.length>0)for(let g=a.children.length-1;g>=0;g--){const h=a.children[g];if((h.tagName==="P"||h.tagName==="DIV")&&r(h))h.remove();else break}let i=a.innerHTML;const d=i;i=i.replace(/(<br\s*\/?>)+$/gi,""),i!==d&&(a.innerHTML=i);const m=document.createElement("p");m.innerHTML="<br>",a.parentNode?a.nextSibling?a.parentNode.insertBefore(m,a.nextSibling):a.parentNode.appendChild(m):v.value&&v.value.appendChild(m);const p=document.createRange();p.selectNodeContents(m),p.collapse(!0),t.removeAllRanges(),t.addRange(p),e.nextTick(()=>{Dt(),j()})},He=()=>{if(!v.value){De.value=!1;return}try{const t=window.getSelection();if(t.rangeCount>0){const n=t.getRangeAt(0).commonAncestorContainer,a=n.nodeType===1?n.closest("a"):n.parentElement?.closest("a");De.value=!!a}else De.value=!1}catch{De.value=!1}},vt=()=>{if(!v.value)return;const t=window.getSelection();t&&t.rangeCount>0&&t.getRangeAt(0),xt.value=be();const o=window.getSelection();let n="";o.rangeCount>0&&(n=o.getRangeAt(0).toString()),J.value="",Q.value=n,Ot.value="",de.value=null,et.value=!0,Ve(),e.nextTick(()=>{tt.value&&tt.value.focus()})},k=()=>{if(!v.value)return;le.value?(z.value&&(clearTimeout(z.value),z.value=null),we(),le.value=!1):we();const t=window.getSelection();let o=null;if(t.rangeCount>0){const a=t.getRangeAt(0).commonAncestorContainer;o=a.nodeType===1?a.closest("a"):a.parentElement?.closest("a")}if(!o&&de.value&&(o=de.value),o&&o.parentNode){const n=document.createDocumentFragment();for(;o.firstChild;)n.appendChild(o.firstChild);if(o.parentNode.replaceChild(n,o),n.firstChild){const a=document.createRange();a.setStartBefore(n.firstChild),a.setEndAfter(n.lastChild||n.firstChild),t.removeAllRanges(),t.addRange(a),document.execCommand("removeFormat",!1),a.collapse(!1),t.removeAllRanges(),t.addRange(a)}de.value=null}else Tt("unlink");De.value=!1,Ve(),e.nextTick(()=>{j(),He()})},Se=()=>{w.disabled||!w.richText||v.value&&(le.value?(z.value&&(clearTimeout(z.value),z.value=null),we(),le.value=!1):we(),Ve(),v.value.focus(),document.execCommand("insertUnorderedList",!1),e.nextTick(()=>{Ce(),j(),pe()}))},qe=()=>{w.disabled||!w.richText||v.value&&(le.value?(z.value&&(clearTimeout(z.value),z.value=null),we(),le.value=!1):we(),Ve(),v.value.focus(),document.execCommand("insertOrderedList",!1),e.nextTick(()=>{Ce(),j(),pe()}))},At=t=>{const o=t.parentElement;if(!o||o.tagName!=="OL")return null;let n=0,a=t.previousElementSibling;for(;a;)a.tagName==="LI"&&n++,a=a.previousElementSibling;return n+1},Ce=()=>{if(!v.value)return;v.value.querySelectorAll("li > ol").forEach(o=>{const n=o.parentElement;if(n&&n.tagName==="LI"){const a=At(n);a!==null&&Array.from(o.children).filter(c=>c.tagName==="LI").forEach(c=>{c.setAttribute("data-parent-num",String(a))})}})},ke=()=>{if(w.disabled||!w.richText||!v.value)return;Ve(),v.value.focus();const t=window.getSelection();if(t.rangeCount===0)return;const o=t.getRangeAt(0),n=o.commonAncestorContainer.nodeType===1?o.commonAncestorContainer.closest("li"):o.commonAncestorContainer.parentElement?.closest("li");if(!n){document.execCommand("indent",!1),e.nextTick(()=>{Ce(),j()});return}const a=n.parentElement;if(!a||a.tagName!=="OL"&&a.tagName!=="UL")return;const r=n.previousElementSibling;if(r&&r.tagName==="LI"){const c=a.tagName.toLowerCase();let i=r.querySelector(`:scope > ${c}`);i||(i=document.createElement(c),r.appendChild(i));const d=At(r);i.appendChild(n),d!==null&&a.tagName==="OL"&&n.setAttribute("data-parent-num",String(d)),Ce();const m=document.createRange();m.selectNodeContents(n),m.collapse(!1),t.removeAllRanges(),t.addRange(m),e.nextTick(()=>{j(),pe()})}else document.execCommand("indent",!1),e.nextTick(()=>{Ce(),j(),pe()})},Ae=()=>{if(w.disabled||!w.richText||!v.value)return;Ve(),v.value.focus();const t=window.getSelection();if(t.rangeCount===0)return;const o=t.getRangeAt(0),n=o.commonAncestorContainer.nodeType===1?o.commonAncestorContainer.closest("li"):o.commonAncestorContainer.parentElement?.closest("li");if(!n){document.execCommand("outdent",!1),e.nextTick(()=>{Ce(),j()});return}const a=n.parentElement;if(!a||a.tagName!=="OL"&&a.tagName!=="UL")return;const r=a.parentElement;if(r&&r.tagName==="LI"){const c=r.parentElement;if(c&&(c.tagName==="OL"||c.tagName==="UL")){a.tagName==="OL"&&n.removeAttribute("data-parent-num"),c.insertBefore(n,r.nextSibling),a.children.length===0&&a.remove(),Ce();const i=document.createRange();i.selectNodeContents(n),i.collapse(!1),t.removeAllRanges(),t.addRange(i),e.nextTick(()=>{j(),pe()});return}}document.execCommand("outdent",!1),e.nextTick(()=>{Ce(),j(),pe()})},ce=e.ref(null),Fe=e.ref(null),ie=e.ref({}),ne=e.ref(""),Z=e.ref(null),Ee=e.ref("");e.ref("");const rt=e.ref(null);e.ref("");const ze=e.ref([]),Lo=e.ref(!1),lo=e.ref(!1),Fn=t=>{if(!t)return"";const o=t.cloneRange(),n=document.createElement("div");return n.appendChild(o.cloneContents()),n.innerHTML},cn=()=>{if(w.disabled||!w.richText||!v.value)return;if(ce.value!==null){ce.value=null,ne.value="",Ee.value="",rt.value=null,ze.value=[],Ft(!0);return}Ve(),v.value.focus();const t=window.getSelection();if(!t||t.rangeCount===0)return;const o=t.getRangeAt(0);if(o.collapsed||!_t(o))return;Ee.value=Fn(o)||"",rt.value=be();const n=o.getBoundingClientRect(),a=v.value.parentElement;if(!a)return;const r=a.getBoundingClientRect(),c=n.bottom-r.top,d=Math.max(c+8,0);ie.value={top:`${d}px`,bottom:"auto"},ce.value=Date.now(),e.nextTick(()=>{if(ne.value="",Z.value){const p=Z.value;p.style.height="auto",p.style.height=`${p.scrollHeight}px`,p.focus()}const m=a.querySelector(".dss-comment-overlay");if(m&&a){const p=a.querySelector(".dss-text-editor-footer");if(p){const g=a.getBoundingClientRect(),h=m.getBoundingClientRect(),f=p.getBoundingClientRect(),C=h.bottom-g.top,y=f.top-g.top,x=8;if(C>y-x){const E=f.height;ie.value={bottom:`${E+x}px`,top:"auto"}}else ie.value={top:`${d}px`,bottom:"auto"}}}})},it=()=>{if(!ne.value.trim())return;const t=ne.value.trim(),o=new Date,n={text:t,selectionText:Ee.value,selectionRange:rt.value,commentId:ce.value,user:w.commentUser||null,createdAt:o.toISOString()};ze.value=[...ze.value,n],X("comment-submitted",n),he(n),rt.value&&!Lt(rt.value)&&zn(ce.value,rt.value),ne.value="",e.nextTick(()=>{if(Z.value){const a=Z.value;a.style.height="auto",a.style.height=`${a.scrollHeight}px`,a.focus()}Qe("sendComment")})},qt=(t,o)=>{if(!(!w.commentUser||!t.user||t.user.id!==w.commentUser.id)){if(ze.value=ze.value.filter((n,a)=>a!==o),ce.value!==null&&v.value){const n=String(ce.value),a=v.value.querySelector(`[data-comment="${n}"], [data-fake-comment="${n}"]`);if(a&&ze.value.length>0){const r=[],c=new Set;ze.value.forEach(i=>{i.user&&i.user.id&&!c.has(i.user.id)&&(c.add(i.user.id),r.push(i.user))}),r.length>0?a.setAttribute("data-comment-user",JSON.stringify(r[0])):a.removeAttribute("data-comment-user"),r.length>1?a.setAttribute("data-comment-user-2",JSON.stringify(r[1])):a.removeAttribute("data-comment-user-2"),a.setAttribute("data-comment-count",String(ze.value.length))}else a&&ze.value.length===0&&(a.removeAttribute("data-comment-user"),a.removeAttribute("data-comment-user-2"),a.setAttribute("data-comment-count","0"))}if(X("comment-deleted",{comment:t,index:o,commentId:ce.value}),w.comments&&Array.isArray(w.comments)){const n=w.comments.filter(a=>!(a.commentId===t.commentId&&a.text===t.text&&a.user?.id===t.user?.id));X("update:comments",n)}e.nextTick(()=>{Qe("deleteComment")})}},Lt=t=>{if(!t||!v.value)return!1;try{const o=ue(t);if(!o)return!1;const n=o.commonAncestorContainer,a=n.nodeType===3?n.parentElement:n;if(a)return!!a.closest("[data-comment], [data-fake-comment]")}catch{}return!1},ue=t=>{if(!t||!v.value)return null;try{const o=document.createRange();if(t.type==="element"&&t.element)return v.value.contains(t.element)?(o.setStart(t.element,t.offset),o.collapse(!0),o):null;let n=0;const a=[v.value];let r=null,c=!1,i=!1;for(;!i&&(r=a.pop());)if(r.nodeType===3){const d=n+r.length;!c&&t.start>=n&&t.start<=d&&(o.setStart(r,t.start-n),c=!0),c&&t.end>=n&&t.end<=d&&(o.setEnd(r,t.end-n),i=!0),n=d}else{let d=r.childNodes.length;for(;d--;)a.push(r.childNodes[d])}return c?o:null}catch{return null}},zn=(t,o)=>{if(!(!t||!o||!v.value))try{const n=ue(o);if(!n||n.collapsed)return;const a=n.commonAncestorContainer,r=a.nodeType===3?a.parentElement:a;if(r){const d=r.closest("[data-comment], [data-fake-comment]");if(d){d.getAttribute("data-comment")!==String(t)&&d.getAttribute("data-fake-comment")!==String(t)&&d.setAttribute("data-comment",String(t));return}}const c=document.createElement("span");c.setAttribute("data-comment",String(t));try{const d=n.startContainer,m=n.endContainer,p=n.startOffset,g=n.endOffset,h=d.nodeType===3?d.parentNode:d,f=m.nodeType===3?m.parentNode:m;if(h===f&&p===0&&g===(m.nodeType===3?m.length:f.childNodes.length)&&(h.tagName==="P"||h.tagName==="DIV"||h.tagName==="H1"||h.tagName==="H2"||h.tagName==="H3"||h.tagName==="H4"||h.tagName==="H5"||h.tagName==="H6")){const y=n.extractContents();c.appendChild(y),n.insertNode(c)}else n.surroundContents(c)}catch{const m=n.extractContents();c.appendChild(m),n.insertNode(c)}const i=v.value.querySelector(`[data-comment="${String(t)}"]`);e.nextTick(()=>{Qe("wrapSelectionWithCommentMarker"),j()})}catch{}},he=t=>{if(!t||!t.commentId)return;const o=Array.isArray(w.comments)?[...w.comments]:[],n=typeof t.commentId=="string"&&t.commentId.startsWith("comment-")?Date.now():Number(t.commentId)||t.commentId;let a=o.findIndex(c=>typeof c.conversation_id=="string"&&c.conversation_id.startsWith("comment-")?null:Number(c.conversation_id)===Number(n)||c.conversation_id===n);const r={text:t.text,user:t.user,createdAt:t.createdAt,created_at:t.createdAt,updated_at:t.createdAt};if(a>=0){const c=o[a];if(c.conversation||(c.conversation=[]),c.conversation.push(r),c.updated_at=t.createdAt,!c.article_id&&o.length>0){const i=o.find(d=>d.article_id);i&&(c.article_id=i.article_id)}}else{const c=t.selectionRange,i=o.length>0&&o.find(m=>m.article_id)?.article_id||null,d={conversation_id:n,article_id:i,selection_range:c?{start:c.start||0,end:c.end||0,type:c.type||"text"}:null,selection_text:t.selectionText||"",conversation:[r],created_by_user:t.user,created_at:t.createdAt,updated_at:t.createdAt,status:"active"};o.push(d)}Lo.value=!0,X("update:comments",o)},Ne=(t,o=[])=>{if(w.disabled||!w.richText||!v.value)return;const n=v.value;let a=null;try{a=n.querySelector(t)}catch{return}if(!a)return;Ve(),n.focus();const r=document.createRange();r.selectNodeContents(a);const c=window.getSelection();c&&(c.removeAllRanges(),c.addRange(r)),Ee.value=a.innerHTML||"",rt.value=be();const i=r.getBoundingClientRect(),d=n.parentElement;if(d){const g=d.getBoundingClientRect(),h=i.bottom-g.top,C=Math.max(h+8,0);ie.value={top:`${C}px`,bottom:"auto"}}const m=a.getAttribute("data-comment")||a.getAttribute("data-fake-comment");let p=[];if(m&&w.comments&&Array.isArray(w.comments)){const g=w.comments.find(h=>String(h.conversation_id)===String(m));if(g&&g.conversation&&Array.isArray(g.conversation)){const h=g.conversation.map(f=>({id:f.id||f.commentary_id,commentary_id:f.id||f.commentary_id,conversation_id:g.id||g.conversation_id,text:f.text,user:f.user,createdAt:f.created_at||f.createdAt,updated_at:f.updated_at||f.updatedAt}));p.push(...h)}}p.length===0&&Array.isArray(o)&&o.length>0&&(p=o.slice()),p.sort((g,h)=>{const f=x=>{if(!x)return 0;const E=new Date(x).getTime();return isNaN(E)?0:E},C=f(g.createdAt),y=f(h.createdAt);return C===y?0:C-y}),ze.value=p,Ft(!0),ce.value=m||null,a&&(Fe.value=a,a.classList.add("editor-comment-highlighted")),e.nextTick(()=>{if(ne.value="",Z.value){const g=Z.value;g.style.height="auto",g.style.height=`${g.scrollHeight}px`,g.focus()}if(d){const g=d.querySelector(".dss-comment-overlay");if(g){const h=d.querySelector(".dss-text-editor-footer");if(h){const f=d.getBoundingClientRect(),C=g.getBoundingClientRect(),y=h.getBoundingClientRect(),x=C.bottom-f.top,E=y.top-f.top,V=8;if(x>E-V){const M=y.height;ie.value={bottom:`${M+V}px`,top:"auto"}}}}}Qe("openCommentOverlayForSelector")})},qo=e.ref(null),dn=e.ref(0),Xo=t=>{if(!(w.disabled||!w.richText)){if(t.key==="Escape"){const o=window.getSelection();if(o.rangeCount>0){const a=o.getRangeAt(0).commonAncestorContainer,r=a.nodeType===1?a.tagName==="BLOCKQUOTE"?a:a.closest("blockquote"):a.parentElement?.closest("blockquote");if(!!(r&&v.value&&v.value.contains(r))){t.preventDefault();let i=null;a.nodeType===3?i=a.parentElement:a.tagName==="P"||a.tagName==="DIV"?i=a:i=a.closest("p, div");const d=document.createElement("p");d.innerHTML="<br>",i&&r.contains(i)&&i.nextSibling?r.insertBefore(d,i.nextSibling):r.appendChild(d),setTimeout(()=>{rn()},50);return}}}if(t.key.length===1||t.key==="Enter"){const o=window.getSelection();if(o&&o.rangeCount>0){const n=o.getRangeAt(0),a=n.commonAncestorContainer,r=a.nodeType===3?a.parentElement:a;if(r){const c=r.closest(".dss-image-wrapper");if(c){const i=c.querySelector("img");if(r!==i&&!i?.contains(r)){const d=n.startContainer.nodeType===3?n.startContainer.parentElement:n.startContainer,m=n.endContainer.nodeType===3?n.endContainer.parentElement:n.endContainer;if(c.contains(d)&&d!==i||c.contains(m)&&m!==i){t.preventDefault();const p=document.createRange();p.setStartAfter(c),p.collapse(!0),o.removeAllRanges(),o.addRange(p);return}}}}}}if(t.key==="Backspace"||t.key==="Delete"){const o=window.getSelection();if(o.rangeCount>0){const n=o.getRangeAt(0);let a=null,r=null;if(n.collapsed)if(t.key==="Backspace"){const c=n.startContainer;let i=c;c.nodeType===3&&(n.startOffset===0?i=c.previousSibling||c.parentNode:i=c.parentNode);const d=i.previousSibling;d&&(d.classList&&d.classList.contains("dss-image-wrapper")?r=d:d.tagName==="IMG"&&(a=d,r=a.closest(".dss-image-wrapper"))),r||(r=i.closest(".dss-image-wrapper"),r&&(a=r.querySelector("img")))}else{const c=n.startContainer;let i=c;c.nodeType===3&&(n.startOffset===c.length?i=c.nextSibling||c.parentNode:i=c.parentNode);const d=i.nextSibling;d&&(d.classList&&d.classList.contains("dss-image-wrapper")?r=d:d.tagName==="IMG"&&(a=d,r=a.closest(".dss-image-wrapper"))),r||(r=i.closest(".dss-image-wrapper"),r&&(a=r.querySelector("img")))}else{const c=n.commonAncestorContainer,i=n.startContainer.nodeType===3?n.startContainer.parentElement:n.startContainer,d=n.endContainer.nodeType===3?n.endContainer.parentElement:n.endContainer;if(c.nodeType===1&&c.tagName==="IMG"?(a=c,r=a.closest(".dss-image-wrapper")):(a=c.querySelector("img"),a&&(r=a.closest(".dss-image-wrapper"))),r){const m=r.contains(i)||i===r,p=r.contains(d)||d===r,h=n.cloneContents().textContent?.trim()||"",f=r.textContent?.trim()||"";(!m||!p||h.length>f.length)&&(r=null,a=null)}}if(r){t.preventDefault(),t.stopPropagation();const c=r.parentNode;if(c){const i=document.createTextNode("");c.insertBefore(i,r),r.remove();const d=document.createRange();d.setStartAfter(i),d.collapse(!0),o.removeAllRanges(),o.addRange(d),e.nextTick(()=>{j()});return}}}}if(t.key==="Tab"){t.preventDefault(),t.shiftKey?Ae():ke();return}if(t.key==="Enter"){const o=window.getSelection();if(o.rangeCount>0){const n=o.getRangeAt(0);if(n.collapsed){const i=n.startContainer,d=m=>{if(!m)return!1;let p=m.previousSibling;for(;p;){if(p.classList&&p.classList.contains("dss-image-wrapper")||p.tagName==="IMG"||p.querySelector&&p.querySelector(".dss-image-wrapper")||p.querySelector&&p.querySelector("img"))return!0;p=p.previousSibling}const g=m.parentElement;return g&&g!==v.value?d(g):!1};if(i.nodeType===3){const m=i.parentElement;if(m&&(d(m)||d(i))){const p=m.closest("p, div");if(p&&p!==v.value){t.preventDefault(),t.stopPropagation();let g=null;const h=n.startOffset;h<i.length&&(g=i.splitText(h));const f=document.createElement("p");if(g?f.appendChild(g):f.innerHTML="<br>",i.length===0){const y=i.parentElement;y&&(y.removeChild(i),y.childNodes.length===0&&y.appendChild(document.createElement("br")))}p.nextSibling?p.parentNode.insertBefore(f,p.nextSibling):p.parentNode.appendChild(f);const C=document.createRange();g?C.setStart(g,0):C.setStart(f,0),C.collapse(!0),o.removeAllRanges(),o.addRange(C),e.nextTick(()=>{j()});return}}}}const a=n.commonAncestorContainer,r=a.nodeType===1?a.tagName==="BLOCKQUOTE"?a:a.closest("blockquote"):a.parentElement?.closest("blockquote");if(!!(r&&v.value&&v.value.contains(r))){let i=null;a.nodeType===3?i=a.parentElement:a.tagName==="P"||a.tagName==="DIV"?i=a:i=a.closest("p, div");const d=y=>{if(!y)return!1;const x=y.textContent||"",V=(y.innerHTML||"").trim(),M=V.replace(/<br\s*\/?>/gi,"").trim();return x.trim()===""||V===""||M===""||V==="<br>"||V==="<br/>"||V==="<p></p>"||V==="<p><br></p>"||V==="<p><br/></p>"||V==="<p> </p>"||V==="<p><br> </p>"||V==="<div></div>"||V==="<div><br></div>"||V==="<div><br/></div>"},m=r.lastChild,p=m&&m.nodeType===1&&m.tagName==="BR",g=n.startContainer,h=g.nodeType===3?g.parentElement:g,f=h===r||h&&h.parentElement===r;if(i&&d(i)||p&&f){t.preventDefault(),setTimeout(()=>{rn()},50);return}}}}if(t.key===" "){const o=Date.now(),n=o-dn.value;if(qo.value===" "&&n<300){const a=window.getSelection();if(a.rangeCount>0){const r=a.getRangeAt(0),c=r.commonAncestorContainer.nodeType===1?r.commonAncestorContainer.closest("li"):r.commonAncestorContainer.parentElement?.closest("li");if(c){const i=r.startContainer.textContent?.substring(0,r.startOffset)||"";if((c.textContent||"").indexOf(i.trim())<=10||i.trim().length<=2){t.preventDefault(),ke();return}}}}qo.value=" ",dn.value=o}else qo.value=t.key}},On=t=>{if(w.disabled||!w.richText)return;t.preventDefault();let o=t.clipboardData.getData("text/html"),n=t.clipboardData.getData("text/plain");o&&(o=o.replace(/<!--[\s\S]*?-->/g,"")),n&&(n=n.replace(/<!--[\s\S]*?-->/g,"")),we();const a=window.getSelection();let r=null;if(a&&a.rangeCount>0){let d=a.getRangeAt(0).commonAncestorContainer;d.nodeType===3&&(d=d.parentNode),r=d.closest("p, h1, h2, h3, h4, h5, h6, li, blockquote")}const c=i=>{const m=new DOMParser().parseFromString(i,"text/html");let p=v.value.querySelector("h1")?1:0;if(m.querySelectorAll("h1").forEach(h=>{if(p>0){const f=m.createElement("p");f.innerHTML=h.innerHTML,h.parentNode.replaceChild(f,h)}else p++}),r){const h=["P","H1","H2","H3","H4","H5","H6","DIV","BLOCKQUOTE","UL","OL","LI"],f=Array.from(m.body.children).filter(C=>h.includes(C.tagName));if(f.length===1){const C=f[0].tagName,y=r.tagName,x=r.textContent.trim()===""&&!r.querySelector("img");let E=!1;if(["H1","H2","H3","H4","H5","H6"].includes(y)?E=!0:x||(C===y||C==="P")&&(E=!0),E)return f[0].innerHTML.trim()}}return m.body.innerHTML.trim()};if(o){const i=c(o);document.execCommand("insertHTML",!1,i)}else if(n)if(/<[a-z][\s\S]*>/i.test(n)){const d=c(n);document.execCommand("insertHTML",!1,d)}else document.execCommand("insertText",!1,n);j()},Yo=t=>{if(Le.value){const n=t.target;!n.closest(".dss-toolbar-dropdown")&&!n.closest(".dss-toolbar-dropdown-toggle")&&Ve()}if(ye.value){const n=t.target,a=n.closest(".dss-floating-toolbar"),r=v.value&&n.closest(".dss-text-editor-content");!a&&!r&&Co()}if(Te.value){const n=t.target,a=n.closest(".dss-floating-toolbar"),r=n.closest(".dss-toolbar-dropdown");!a&&!r&&yn()}const o=t.target;if(!o.closest(".dss-toolbar-dropdown")&&!o.closest(".dss-toolbar-dropdown-submenu")&&(Ze.value=null),!v.value||!o.closest(".dss-text-editor-content")){const n=window.getSelection();if(n&&n.rangeCount>0){const a=n.getRangeAt(0);mt.value=!a.collapsed&&_t(a)}else mt.value=!1}if(ce.value!==null){const n=document.querySelector(".dss-comment-overlay");let a=!1;if(n){const i=n.getBoundingClientRect(),d=t.clientX,m=t.clientY;a=d>=i.left&&d<=i.right&&m>=i.top&&m<=i.bottom}const r=o.closest(".dss-toolbar-button"),c=r&&r.getAttribute("title")==="Comment";!a&&!c&&(ce.value=null,ne.value="",Ee.value="",rt.value=null,ze.value=[],Ft(!0))}},me=(t,o)=>{t&&t.stopPropagation&&t.stopPropagation(),xe.value&&(clearTimeout(xe.value),xe.value=null),Ze.value=o},$o=t=>{const o=t.relatedTarget;if(o){const n=o.closest(".dss-toolbar-dropdown-submenu"),a=o.closest(".dss-toolbar-dropdown-item-has-submenu");if(n||a)return}xe.value&&clearTimeout(xe.value),xe.value=setTimeout(()=>{Ze.value=null,xe.value=null},150)},un=t=>{Ze.value=null};let mn=0;const Pn=t=>{if(!t)return;const o=Array.from(t.children);o.forEach(n=>{n.classList.contains("dss-toolbar-dropdown-submenu")||n.classList.contains("dss-toolbar-dropdown-item-has-submenu")||(n.tagName==="BUTTON"||n.tagName==="DIV")&&!n.classList.contains("dss-toolbar-dropdown-item")&&n.classList.add("dss-toolbar-dropdown-item")}),o.forEach((n,a)=>{if(n.classList.contains("dss-toolbar-dropdown-item-has-submenu")||n.classList.contains("dss-toolbar-dropdown-submenu")||!n.classList.contains("dss-toolbar-dropdown-item"))return;const r=Array.from(n.children).find(d=>d.tagName==="DIV"?d.classList.contains("dss-toolbar-dropdown-item")?!1:Array.from(d.children).filter(p=>p.tagName==="BUTTON"||p.tagName==="DIV").length>0:!1),c=n.nextElementSibling,i=c&&!c.classList.contains("dss-toolbar-dropdown-submenu")&&!c.classList.contains("dss-toolbar-dropdown-item-has-submenu")&&c.tagName==="DIV"&&!c.classList.contains("dss-toolbar-dropdown-item")&&Array.from(c.children).some(d=>d.tagName==="BUTTON"||d.tagName==="DIV");if(r||i){const d=`submenu-auto-${++mn}`;n.classList.add("dss-toolbar-dropdown-item-has-submenu"),n.setAttribute("data-submenu-id",d);let m=null;r?(n.tagName==="BUTTON"&&n.parentNode.insertBefore(r,n.nextSibling),r.classList.add("dss-toolbar-dropdown-submenu"),m=r):i&&(c.classList.add("dss-toolbar-dropdown-submenu"),m=c),m&&(m.setAttribute("data-submenu-id",d),m.setAttribute("data-processed","true"),r&&n.tagName!=="BUTTON"?m.dataset.originalParentRef="inside":m.dataset.originalParentRef="sibling",Array.from(m.children).forEach(g=>{(g.tagName==="BUTTON"||g.tagName==="DIV")&&!g.classList.contains("dss-toolbar-dropdown-item")&&g.classList.add("dss-toolbar-dropdown-item")}))}})},pn=()=>{document.querySelectorAll(".dss-toolbar-dropdown").forEach(o=>{Pn(o),o.querySelectorAll(".dss-toolbar-dropdown-item-has-submenu").forEach(r=>{const c=r._subMenuHandlers;c&&(r.removeEventListener("mouseenter",c.enter),r.removeEventListener("mouseleave",c.leave));const i=m=>{const p=r.getAttribute("data-submenu-id");p&&me(m,p)},d=$o;r.addEventListener("mouseenter",i),r.addEventListener("mouseleave",d),r._subMenuHandlers={enter:i,leave:d}}),o.querySelectorAll(".dss-toolbar-dropdown-submenu").forEach(r=>{const c=r._subMenuHandlers;c&&(r.removeEventListener("mouseenter",c.enter),r.removeEventListener("mouseleave",c.leave));const i=p=>{const g=r.getAttribute("data-submenu-id");g&&me(p,g)},d=$o;r.addEventListener("mouseenter",i),r.addEventListener("mouseleave",d),r._subMenuHandlers={enter:i,leave:d},r.querySelectorAll(".dss-toolbar-dropdown-item").forEach(p=>{p.addEventListener("click",un)})})})};let ao=null;const Xt=()=>{if(Ze.value){const t=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}"]`);t&&o&&s(t,o)}if(ye.value&&pe(),w.richText){if(ao!==null)return;ao=setTimeout(()=>{ao=null,Qe("handleWindowResize")},150)}},so=()=>{if(!w.richText)return;document.querySelectorAll(".dss-toolbar-custom-group").forEach(o=>{Array.from(o.children).filter(a=>a.tagName==="DIV"&&!a.classList.contains("dss-toolbar-button")).forEach(a=>{a.classList.add("dss-toolbar-button")})})},fn=()=>{const t=document.querySelectorAll(".dss-text-editor-footer, .dss-text-editor-footer-content, .dss-text-editor-footer-stat, .dss-text-editor-footer-separator"),o=n=>{if(n.preventDefault(),n.stopPropagation(),window.getSelection){const a=window.getSelection();a.removeAllRanges?a.removeAllRanges():a.empty&&a.empty()}return!1};t.forEach(n=>{n.addEventListener("selectstart",o),n.addEventListener("mousedown",o),n.addEventListener("dragstart",o),n.addEventListener("contextmenu",o),n.addEventListener("click",a=>{if(window.getSelection){const r=window.getSelection();r.removeAllRanges&&r.removeAllRanges()}})})};e.onMounted(()=>{if(e.nextTick(()=>{requestAnimationFrame(()=>{Ke.value?Re():Uo(),Ge.value?yo():Mo()})}),e.nextTick(()=>{fn()}),w.richText&&v.value){try{document.execCommand("defaultParagraphSeparator",!1,"p")}catch{}document.addEventListener("click",Yo),window.addEventListener("resize",Xt);let t=null;const o=()=>{t===null&&(t=setTimeout(()=>{t=null,Xt()},150))};window.addEventListener("scroll",o,!0),v.value._windowScrollHandler=o,v.value._windowScrollTimeout=t,v.value.closest(".editor-with-comments"),v.value.closest(".dss-text-editor-content-wrapper");const n=v.value.closest(".dss-text-editor-content");let a=null;const r=()=>{a===null&&(a=setTimeout(()=>{a=null,Xt()},150))};n&&(n.addEventListener("scroll",r),v.value._scrollHandlers={wrapper:null,content:n,handler:r}),e.nextTick(()=>{pn(),so()}),v.value.addEventListener("click",d=>{const m=d.target;m.closest("a")&&!w.disabled&&d.preventDefault();const g=m.closest(".dss-image-no-alt-icon"),h=m.closest(".dss-image-wrapper");if(g||h&&m===h){d.preventDefault(),d.stopPropagation();const f=window.getSelection(),C=document.createRange();C.setStartAfter(h),C.collapse(!0),f.removeAllRanges(),f.addRange(C)}else h&&m.tagName!=="IMG"&&(d.preventDefault(),e.nextTick(()=>{const f=window.getSelection();if(f.rangeCount>0){const y=f.getRangeAt(0).commonAncestorContainer,x=y.nodeType===3?y.parentElement:y;if(h.contains(x)&&x!==h.querySelector("img")){const E=document.createRange();E.setStartAfter(h),E.collapse(!0),f.removeAllRanges(),f.addRange(E)}}else{const C=document.createRange();C.setStartAfter(h),C.collapse(!0),f.addRange(C)}}))},!0),v.value.addEventListener("mousedown",d=>{const m=d.target,p=m.closest(".dss-image-no-alt-icon"),g=m.closest(".dss-image-wrapper");if(p||g&&m.tagName!=="IMG"){d.preventDefault();const h=window.getSelection(),f=document.createRange();g&&(f.setStartAfter(g),f.collapse(!0),h.removeAllRanges(),h.addRange(f))}},!0),v.value.addEventListener("paste",d=>{e.nextTick(()=>{if(!v.value)return;v.value.querySelectorAll("img").forEach(p=>{if(!p.closest(".dss-image-wrapper"))p.removeAttribute("alt"),p.removeAttribute("data-alt"),p.setAttribute("alt",""),p.setAttribute("data-alt",""),p.alt="";else{const h=p.getAttribute("alt")||p.alt||"";if(h){const f=p.getAttribute("src")||p.src||"",C=f.replace(/^https?:\/\//,"").replace(/^data:.*,/,""),y=h===f||h===C;(h.startsWith("http://")||h.startsWith("https://")||h.startsWith("data:")||y||y)&&(p.setAttribute("alt",""),p.setAttribute("data-alt",""),p.alt="")}}}),st()})}),v.value.addEventListener("dragstart",d=>{const m=d.target,p=m.tagName==="IMG"?m:m.closest("img"),g=p?.closest(".dss-image-wrapper");p&&v.value.contains(p)&&(je.value=g||p,d.dataTransfer.effectAllowed="move",d.dataTransfer.setData("text/html","image-drag"))}),v.value.addEventListener("dragover",d=>{je.value&&(d.preventDefault(),d.stopPropagation(),d.dataTransfer.dropEffect="move")}),v.value.addEventListener("dragenter",d=>{je.value&&(d.preventDefault(),d.stopPropagation())}),v.value.addEventListener("drop",d=>{if(!je.value||!v.value)return;d.preventDefault(),d.stopPropagation();const m=je.value,p=m.classList?.contains("dss-image-wrapper"),g=p?m.querySelector("img"):m,h=p?m:g?.closest(".dss-image-wrapper");if(!g||!v.value.contains(g)){je.value=null;return}let f=null;const C=d.clientX,y=d.clientY;if(document.caretRangeFromPoint)f=document.caretRangeFromPoint(C,y);else{const B=window.getSelection();B.rangeCount>0?f=B.getRangeAt(0).cloneRange():(f=document.createRange(),f.selectNodeContents(v.value),f.collapse(!1))}if(!f){je.value=null;return}const x=f.commonAncestorContainer,E=x.nodeType===3?x.parentElement:x;if(E?.closest(".dss-image-wrapper")===h||h&&h.contains(E)){je.value=null;return}if(h&&(E===h||h.contains(E))){je.value=null;return}const M=g.getAttribute("src");let H=null;h?H=h.cloneNode(!0):H=g.cloneNode(!0);try{let B=f.startContainer;if(B.nodeType===3&&(B=B.parentElement),h&&(B===h||h.contains(B))){const q=document.createRange();q.setStartAfter(h),q.collapse(!0),f=q}f.insertNode(H);const _=document.createRange();_.setStartAfter(H),_.collapse(!0);const R=window.getSelection();R.removeAllRanges(),R.addRange(_)}catch{if(v.value.childNodes.length===0){const _=document.createElement("p");_.appendChild(H),v.value.appendChild(_)}else{const _=v.value.lastChild;if(_&&_.nodeType===1)_.appendChild(H);else{const R=document.createElement("p");R.appendChild(H),v.value.appendChild(R)}}}h?h.remove():g.remove(),je.value=null,e.nextTick(()=>{const B=v.value.querySelectorAll("img");let _=!1;B.forEach(R=>{if(R.getAttribute("src")===M)if(!_)_=!0;else{const q=R.closest(".dss-image-wrapper");q?q.remove():R.remove()}}),st(),j()})}),v.value.addEventListener("dragend",d=>{je.value=null});let c=null;const i=new MutationObserver(d=>{d.forEach(m=>{m.addedNodes.forEach(p=>{if(p.nodeType===1){p.tagName==="IMG"&&(p.removeAttribute("alt"),p.removeAttribute("data-alt"),p.setAttribute("alt",""),p.setAttribute("data-alt",""),p.alt="");const g=p.querySelectorAll&&p.querySelectorAll("img");g&&g.forEach(h=>{h.removeAttribute("alt"),h.removeAttribute("data-alt"),h.setAttribute("alt",""),h.setAttribute("data-alt",""),h.alt=""})}})}),c&&clearTimeout(c),c=setTimeout(()=>{st(),so(),c=null},100)});if(i.observe(v.value,{childList:!0,subtree:!0}),e.nextTick(()=>{const d=document.querySelector(".dss-text-editor-toolbar");if(d){const m=new MutationObserver(()=>{e.nextTick(()=>{so()})});m.observe(d,{childList:!0,subtree:!0}),d._toolbarMutationObserver=m}}),w.modelValue){const d=Zo(w.modelValue);v.value.innerHTML=d,no()}e.nextTick(()=>{const d=v.value.innerHTML||"",m=w.title||"",p=w.description||"";Ue.value=d,lt.value=m,fe.value=p,We.value=m,Ye.value=p,Ce(),st(),Bt(),$t(),u(),Rt()}),He(),Dt(),v.value._mutationObserver=i}}),e.onUnmounted(()=>{if(document.removeEventListener("click",Yo),window.removeEventListener("resize",Xt),v.value&&v.value._windowScrollHandler&&window.removeEventListener("scroll",v.value._windowScrollHandler,!0),ao!==null&&(clearTimeout(ao),ao=null),v.value&&v.value._windowScrollTimeout!==null&&clearTimeout(v.value._windowScrollTimeout),z.value&&clearTimeout(z.value),xe.value&&clearTimeout(xe.value),v.value&&v.value._mutationObserver&&v.value._mutationObserver.disconnect(),pt.value&&pt.value.disconnect(),Ie.value!==null&&(cancelAnimationFrame(Ie.value),Ie.value=null),zo.value!==null&&(clearTimeout(zo.value),zo.value=null),ft.value!==null&&(clearTimeout(ft.value),ft.value=null),Ft(!0),v.value&&v.value._scrollHandlers){const{wrapper:o,content:n,handler:a}=v.value._scrollHandlers;o&&o.removeEventListener("scroll",a),n&&n.removeEventListener("scroll",a)}const t=document.querySelector(".dss-text-editor-toolbar");t&&t._toolbarMutationObserver&&t._toolbarMutationObserver.disconnect()});const vn=t=>{const o=t.target,n=o.closest("a");if(n&&!w.disabled){t.preventDefault();const r=document.createRange();r.selectNodeContents(n);const c=window.getSelection();c.removeAllRanges(),c.addRange(r)}const a=o.closest(".dss-image-wrapper");a&&o.tagName!=="IMG"?e.nextTick(()=>{const r=window.getSelection();if(r.rangeCount>0){const i=r.getRangeAt(0).commonAncestorContainer,d=i.nodeType===3?i.parentElement:i;if(a.contains(d)&&d!==a.querySelector("img")){const m=document.createRange();m.setStartAfter(a),m.collapse(!0),r.removeAllRanges(),r.addRange(m)}}st(),He(),Dt(),pe(),$t()}):e.nextTick(()=>{st(),He(),Dt(),pe(),$t()})},gn=()=>{Wo();const t=window.getSelection();if(t&&t.rangeCount>0){const n=t.getRangeAt(0);mt.value=!n.collapsed&&_t(n),!n.collapsed&&St.value&&(St.value=null)}else mt.value=!1;if(st(),He(),Dt(),pe(),$t(),t&&t.rangeCount>0){const a=t.getRangeAt(0).commonAncestorContainer,r=a.nodeType===3?a.parentElement:a;if(r&&r.closest(".dss-text-editor-footer")){t.removeAllRanges(),mt.value=!1;return}}["bold","italic","underline"].forEach(n=>{try{const a=window.getSelection();if(a.rangeCount>0){const r=a.getRangeAt(0);if(!r.collapsed)if(n==="bold"){const c=r.commonAncestorContainer,i=c.nodeType===3?c.parentElement:c;let d=!1;if(i&&((i.tagName==="STRONG"||i.tagName==="B"||i.closest&&i.closest("strong, b"))&&(d=!0),!d&&i.style&&parseInt(i.style.fontWeight)>=600&&(d=!0),!d))try{const m=window.getComputedStyle(i);parseInt(m.fontWeight)>=600&&(d=!0)}catch{}O.value[n]=d}else{const c=document.queryCommandState(n);O.value[n]=c}}}catch{}})},$t=()=>{if(!w.richText||w.disabled||!v.value){ve.value="p";return}try{const t=window.getSelection();if(!t||t.rangeCount===0){ve.value="p";return}const n=t.getRangeAt(0).commonAncestorContainer,a=n.nodeType===3?n.parentElement:n;if(!a||!v.value.contains(a)){ve.value="p";return}const r=a.closest("h1, h2, h3, h4, h5, h6, p");if(!r){ve.value="p";return}const c=r.tagName.toLowerCase();["h1","h2","h3","h4","h5","h6","p"].includes(c)?ve.value=c:ve.value="p"}catch{ve.value="p"}},Dt=()=>{if(!v.value){Jt.value=!1;return}try{const t=window.getSelection();let o=!1;if(t.rangeCount>0){const a=t.getRangeAt(0).commonAncestorContainer,r=a.nodeType===1?a.tagName==="BLOCKQUOTE"?a:a.closest("blockquote"):a.parentElement?.closest("blockquote");o=!!(r&&v.value.contains(r))}Jt.value=o}catch{Jt.value=!1}},_t=t=>{if(!t||!v.value)return!1;const o=t.commonAncestorContainer;if(!o)return!1;const n=o.nodeType===3?o.parentElement:o;return n?v.value.contains(n):!1},Co=()=>{ye.value=!1},pe=()=>{if(!w.floatingToolbar||!w.richText||w.disabled){ye.value=!1;return}const t=window.getSelection();if(!t||t.rangeCount===0){ye.value=!1;return}const o=t.getRangeAt(0);if(o.collapsed||!_t(o)){ye.value=!1;return}const n=o.getBoundingClientRect();if(!n||n.width===0&&n.height===0){ye.value=!1;return}const a=v.value;if(!a){ye.value=!1;return}const r=a.getBoundingClientRect();if(!r||r.width===0){ye.value=!1;return}const c=40,i=8,d=n.top-c/2+15;let m=n.left+n.width/2;const p=window.innerWidth||document.documentElement.clientWidth||0;let g=0;fo.value&&(g=fo.value.getBoundingClientRect().width);const h=(g||320)/2;let f=r.left+h,C=r.right-h;if(C<f){const y=r.left+r.width/2;f=y,C=y}if(p>0){const y=h+i,x=p-h-i;if(f=Math.max(f,y),C=Math.min(C,x),C<f){const E=p/2;f=E,C=E}}m<f?m=f:m>C&&(m=C),Be.value={position:"fixed",top:`${Math.max(d,8)}px`,left:`${m}px`,transform:"translate(-50%, -100%)",zIndex:10003},ye.value=!0},hn=t=>{w.disabled||!w.richText||(Te.value=Te.value===t?null:t,t==="askAi"&&(Le.value=null))},yn=()=>{Te.value=null,Ze.value=null},It=t=>{Ht(t),yn()};let Yt=null,ro=null,Je=null,io=null;const Cn=t=>{if(w.disabled||!w.richText){ko(),co();return}const o=t.target,n=o.closest("a"),a=o.closest("img");if(Yt&&(clearTimeout(Yt),Yt=null),Je&&(clearTimeout(Je),Je=null),n&&n!==ro){co(),ro=n;let r=n.getAttribute("href")||"";(!r||r==="#"||r==="")&&(r=n.textContent||""),de.value=n,D.value=r,T.value=!0,P.value=!0,kn(n)}else!n&&ro?(ro=null,Yt=setTimeout(()=>{P.value||ko()},150)):n&&n===ro&&kn(n);if(a&&a!==io){ko(),io=a;let r=a.getAttribute("alt");r===null&&(r=a.alt||"");let c=a.getAttribute("data-alt");c===null&&(c=r),a.hasAttribute("alt")||a.setAttribute("alt",r),a.hasAttribute("data-alt")||a.setAttribute("data-alt",c),Y.value=a,Qt.value=r.trim()||b("textEditor.image.noAlt"),ho.value=!0,Zt.value=!0,xn(a)}else!a&&io?(io=null,Je=setTimeout(()=>{Zt.value||co()},150)):a&&a===io&&xn(a)},Zn=t=>{const o=t.relatedTarget;(!o||!o.closest(".dss-text-editor-content")&&!o.closest(".dss-link-popup"))&&(ro=null,io=null,Yt&&(clearTimeout(Yt),Yt=null),Je&&(clearTimeout(Je),Je=null),ko(),co())},ko=()=>{P.value=!1,setTimeout(()=>{P.value||(T.value=!1,D.value="",et.value||(de.value=null))},100)},kn=t=>{if(!t||!v.value)return;const o=t.getBoundingClientRect(),r=o.top-32-8,c=o.left+o.width/2;W.value={position:"fixed",top:`${r}px`,left:`${c}px`,transform:"translateX(-50%)",zIndex:10002}},co=()=>{Zt.value=!1,setTimeout(()=>{Zt.value||(ho.value=!1,Qt.value="",vo.value||(Y.value=null))},100)},xn=t=>{if(!t||!v.value)return;const o=t.getBoundingClientRect(),r=o.top-32-8,c=o.left+o.width/2;Pt.value={position:"fixed",top:`${r}px`,left:`${c}px`,transform:"translateX(-50%)",zIndex:10002}},Un=()=>{if(!D.value||!de.value)return;let o=de.value.getAttribute("href")||D.value;!o.startsWith("http://")&&!o.startsWith("https://")&&!o.startsWith("mailto:")&&(o="https://"+o),window.open(o,"_blank","noopener,noreferrer")},Do=()=>{if(de.value){const t=de.value.textContent||"",o=de.value.getAttribute("href")||"",n=de.value;J.value=o,Q.value=t,Ot.value=t,P.value=!1,T.value=!1,D.value="",de.value=n,et.value=!0}else if(De.value){const t=window.getSelection();if(t.rangeCount>0){const n=t.getRangeAt(0).commonAncestorContainer,a=n.nodeType===1?n.closest("a"):n.parentElement?.closest("a");if(a){const r=a.textContent||"",c=a.getAttribute("href")||"";J.value=c,Q.value=r,Ot.value=r,de.value=a,et.value=!0}}}else{xt.value=be();const t=window.getSelection();let o="";t.rangeCount>0&&(o=t.getRangeAt(0).toString()),J.value="",Q.value=o,Ot.value="",de.value=null,et.value=!0}e.nextTick(()=>{tt.value&&(tt.value.focus(),tt.value.select())})},_o=()=>{et.value=!1,J.value="",Q.value="",Ot.value="",de.value=null,xt.value=null},jo=()=>{if(!J.value.trim()){_o();return}if(le.value?(z.value&&(clearTimeout(z.value),z.value=null),we(),le.value=!1):we(),Q.value.trim()||(Q.value=J.value.trim()),de.value&&v.value&&v.value.contains(de.value)){const t=window.getSelection();t.rangeCount>0&&t.removeAllRanges();const o=de.value;if(o.setAttribute("href",J.value.trim()),Q.value.trim()!==Ot.value.trim()){for(;o.firstChild;)o.removeChild(o.firstChild);o.textContent=Q.value.trim()}o.style.color="#60afdf",o.style.textDecoration="underline";const n=document.createRange();n.selectNodeContents(o),n.collapse(!1),t.removeAllRanges(),t.addRange(n),j()}else if(v.value){v.value.focus();const t=window.getSelection();t.removeAllRanges(),xt.value&&at(xt.value);let o=null;if(t.rangeCount>0&&(o=t.getRangeAt(0)),o&&!o.collapsed){o.toString();const n=document.createElement("a");n.href=J.value.trim(),n.textContent=Q.value.trim(),n.style.color="#60afdf",n.style.textDecoration="underline",o.deleteContents(),o.insertNode(n);const a=document.createTextNode(" ");o.setStartAfter(n),o.insertNode(a),o.setStartAfter(a),o.collapse(!0),t.removeAllRanges(),t.addRange(o)}else{o||(o=document.createRange(),o.selectNodeContents(v.value),o.collapse(!1));const n=o.startContainer,a=n.nodeType===3,r=a&&o.startOffset===n.textContent.length,c=document.createElement("a");if(c.href=J.value.trim(),c.textContent=Q.value.trim(),c.style.color="#60afdf",c.style.textDecoration="underline",r){let i=n.parentElement;for(;i&&i!==v.value&&!["P","DIV","H1","H2","H3","H4","H5","H6"].includes(i.tagName);)i=i.parentElement;if(i&&i!==v.value){let d=i.nextElementSibling;if(d&&(d.innerHTML==="<br>"||d.innerHTML==="<br/>"||d.textContent.trim()==="")){d.textContent="",d.appendChild(c);const m=document.createTextNode(" ");d.appendChild(m);const p=document.createRange();p.setStartAfter(c),p.collapse(!0),t.removeAllRanges(),t.addRange(p)}else{if(o.startOffset>0){const p=n.textContent.substring(0,o.startOffset),g=p[p.length-1];if(g&&g!==" "&&g!==" "&&g!==`
79
- `){const h=document.createTextNode(" ");o.insertNode(h),o.setStartAfter(h)}}o.insertNode(c);const m=document.createTextNode(" ");o.setStartAfter(c),o.insertNode(m),o.setStartAfter(m),o.collapse(!0),t.removeAllRanges(),t.addRange(o)}}}else{if(a&&o.startOffset>0){const d=n.textContent.substring(0,o.startOffset),m=d[d.length-1];if(m&&m!==" "&&m!==" "&&m!==`
80
- `){const p=document.createTextNode(" ");o.insertNode(p),o.setStartAfter(p)}}o.insertNode(c);const i=document.createTextNode(" ");o.setStartAfter(c),o.insertNode(i),o.setStartAfter(i),o.collapse(!0),t.removeAllRanges(),t.addRange(o)}}j()}e.nextTick(()=>{He(),_o()})},Io=()=>{if(!v.value||Oe.value)return;const t=window.getSelection();let o=null;t&&t.rangeCount>0&&(o=be());const n=/(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,a=document.createTreeWalker(v.value,NodeFilter.SHOW_TEXT,{acceptNode:d=>{const m=d.parentElement;return!m||m.closest("a")||m.closest(".dss-image-wrapper")||!d.textContent||d.textContent.trim()===""?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}}),r=[];let c;for(;c=a.nextNode();)r.push(c);let i=!1;for(let d=r.length-1;d>=0;d--){const m=r[d],p=m.textContent;n.lastIndex=0;const g=[...p.matchAll(n)];if(g.length===0)continue;const h=g.filter(y=>{const x=y[0],E=y.index;if(E>0&&p[E-1]==="@"||E+x.length<p.length&&p[E+x.length]==="@")return!1;const V=m.parentElement;return!(V&&V.closest("a"))});if(h.length===0)continue;if(h.length===1&&h[0][0]===p.trim()){const y=h[0][0],x=y.startsWith("http://")||y.startsWith("https://")?y:`https://${y}`,E=document.createElement("a");E.href=x,E.textContent=y,E.style.color="#60afdf",E.style.textDecoration="underline",m.parentNode&&(m.parentNode.replaceChild(E,m),i=!0);continue}let f=0;const C=document.createDocumentFragment();if(h.forEach(y=>{const x=y.index,E=y[0];if(x>f){const H=p.substring(f,x);H&&C.appendChild(document.createTextNode(H))}const V=E.startsWith("http://")||E.startsWith("https://")?E:`https://${E}`,M=document.createElement("a");M.href=V,M.textContent=E,M.style.color="#60afdf",M.style.textDecoration="underline",C.appendChild(M),f=x+E.length}),f<p.length){const y=p.substring(f);y&&C.appendChild(document.createTextNode(y))}m.parentNode&&C.childNodes.length>0&&(m.parentNode.replaceChild(C,m),i=!0)}i&&o&&e.nextTick(()=>{at(o),He()})},Wn=()=>{if(!v.value)return;const t=/<u>([\s\S]*?)<\/u>|<ins>([\s\S]*?)<\/ins>/gi,o=document.createTreeWalker(v.value,NodeFilter.SHOW_TEXT,{acceptNode:r=>{const c=r.parentElement;return!c||c.closest("a, code, pre, u, ins")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}}),n=[];let a;for(;a=o.nextNode();)n.push(a);for(let r=n.length-1;r>=0;r--){const c=n[r],i=c.textContent,d=[...i.matchAll(t)];if(d.length===0)continue;let m=0;const p=document.createDocumentFragment();d.forEach(g=>{const h=g.index,f=g[0].startsWith("<u>")?"u":"ins",C=g[1]||g[2]||"";h>m&&p.appendChild(document.createTextNode(i.substring(m,h)));const y=document.createElement(f);y.textContent=C,p.appendChild(y),m=h+g[0].length}),m<i.length&&p.appendChild(document.createTextNode(i.substring(m))),c.parentNode&&p.childNodes.length>0&&c.parentNode.replaceChild(p,c)}},gt=t=>{if(!v.value||Oe.value)return;if(!t){Wn();return}if(!["*","_",">"].includes(t))return;const n=window.getSelection();if(!n||n.rangeCount===0)return;const a=n.getRangeAt(0);if(!a.collapsed)return;const r=a.startContainer.nodeType===Node.TEXT_NODE?a.startContainer.parentElement?.closest("p, h1, h2, h3, h4, h5, h6, li, td, th, blockquote, div"):a.startContainer.closest?.("p, h1, h2, h3, h4, h5, h6, li, td, th, blockquote, div");if(!r||r===v.value||!v.value.contains(r))return;const c=()=>{let H="",B=0,_=!1;const R=document.createTreeWalker(r,NodeFilter.SHOW_TEXT,{acceptNode:G=>G.parentElement?.closest("a, code, pre")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT});document.createTreeWalker(r,NodeFilter.SHOW_TEXT,null);let q=0;for(;R.nextNode();){const G=R.currentNode,Me=G.textContent||"",yt=q;if(q+=Me.length,G===a.startContainer){H+=Me.substring(0,a.startOffset),B=yt+a.startOffset,_=!0;break}H+=Me}return _||(B=H.length),{textBeforeCursor:H,cursorCharOffset:B}},{textBeforeCursor:i}=c();if(!i.length)return;let d=null,m=null;if(i.endsWith("**")&&(d=i.match(/\*\*(.+?)\*\*$/s))||i.endsWith("__")&&(d=i.match(/__(.+?)__$/s))?m="strong":i.endsWith("*")&&!i.endsWith("**")&&(d=i.match(new RegExp("(?<!\\*)\\*([^*]+)\\*$")))||i.endsWith("_")&&!i.endsWith("__")&&(d=i.match(new RegExp("(?<!_)_([^_]+)_$")))?m="em":t===">"&&((d=i.match(/<u>(.+?)<\/u>$/s))||(d=i.match(/<ins>(.+?)<\/ins>$/s)))&&(m=d[0].startsWith("<u>")?"u":"ins",d[0].startsWith("<u>"),d[0].startsWith("<u>")),!d||!d[1])return;const p=d[0],g=d[1],h=i.length-p.length,C=(H=>{let B=0;const _=document.createTreeWalker(r,NodeFilter.SHOW_TEXT,{acceptNode:q=>q.parentElement?.closest("a, code, pre")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT});let R;for(;R=_.nextNode();){const q=(R.textContent||"").length;if(B+q>=H)return{node:R,offset:H-B};B+=q}return null})(h);if(!C)return;const y=document.createRange();y.setStart(C.node,C.offset),y.setEnd(a.endContainer,a.endOffset);const x=document.createElement(m);x.textContent=g,y.deleteContents(),y.insertNode(x);const E=window.getSelection(),V=document.createRange();V.setStartAfter(x),V.collapse(!0),E.removeAllRanges(),E.addRange(V);const M=be();e.nextTick(()=>{j(),M&&at(M)})},xo=()=>{v.value&&(Et.value=be(),Pe.value="",ot.value="",bt.value="",ee.value="",se.value="",Vo.value=null,Y.value=null,_e.value="upload",vo.value=!0,Ve(),e.nextTick(()=>{wt.value&&wt.value.focus(),Xe.value&&(Xe.value.value="")}))},wo=t=>{const o=t.target?.files?.[0];if(!o){Vo.value=null,ot.value="";return}Vo.value=o;const n=new FileReader;n.onload=a=>{ot.value=a.target?.result||""},n.readAsDataURL(o)},ct=()=>{Xe.value&&Xe.value.click()},uo=()=>{ee.value&&(se.value="")},mo=()=>{se.value&&(ee.value="")},Eo=()=>{let t=Y.value;if(!t){const o=window.getSelection();if(o&&o.rangeCount>0){const a=o.getRangeAt(0).commonAncestorContainer;t=a.nodeType===1?a.closest("img"):a.parentElement?.closest("img")}}if(t){const o=t.getAttribute("data-alt")||t.getAttribute("alt")||"";Y.value=t,Pe.value=o.trim()===""||o.trim()==="Image"?"":o;const n=t.getAttribute("src")||t.src||"";n.startsWith("http://")||n.startsWith("https://")?(bt.value=n,ot.value="",_e.value="url"):(ot.value=n,bt.value="",_e.value="upload");const r=t.style.width||t.getAttribute("width")||"",c=t.style.height||t.getAttribute("height")||"";ee.value=r.endsWith("px")?r.replace("px",""):r,se.value=c.endsWith("px")?c.replace("px",""):c,Et.value=null}else{xo();return}vo.value=!0,Zt.value=!1,ho.value=!1,e.nextTick(()=>{_e.value==="url"&&go.value?(go.value.focus(),go.value.select()):wt.value&&(wt.value.focus(),wt.value.select()),Xe.value&&(Xe.value.value="")})},U=()=>{vo.value=!1,Pe.value="",ot.value="",bt.value="",ee.value="",se.value="",Vo.value=null,Y.value=null,Et.value=null,_e.value="upload"},ht=()=>{const t=(Pe.value||"").trim(),o=v.value?._mutationObserver;o&&o.disconnect(),le.value?(z.value&&(clearTimeout(z.value),z.value=null),we(),le.value=!1):we();const n=_e.value==="url"?bt.value.trim():ot.value;if(Y.value&&v.value&&v.value.contains(Y.value)){n&&(Y.value.src=n),Y.value.setAttribute("alt",t),Y.value.setAttribute("data-alt",t),ee.value?(Y.value.style.width=`${ee.value}px`,Y.value.setAttribute("width",ee.value)):(Y.value.style.removeProperty("width"),Y.value.removeAttribute("width")),se.value?(Y.value.style.height=`${se.value}px`,Y.value.setAttribute("height",se.value)):(Y.value.style.removeProperty("height"),Y.value.removeAttribute("height"));const a=window.getSelection();if(a){a.removeAllRanges();const r=document.createRange();r.setStartAfter(Y.value),r.collapse(!0),a.addRange(r)}j()}else{if(!n){o&&v.value&&o.observe(v.value,{childList:!0,subtree:!0}),U();return}if(v.value){v.value.focus();const a=window.getSelection();a&&a.rangeCount>0&&a.removeAllRanges();const r=window.getSelection();let c=null;if(Et.value&&(at(Et.value),r&&r.rangeCount>0&&(c=r.getRangeAt(0))),!c&&r&&r.rangeCount>0&&(c=r.getRangeAt(0)),!c&&v.value){if(c=document.createRange(),v.value.childNodes.length===0){const p=document.createElement("p");p.innerHTML="<br>",v.value.appendChild(p),c.setStart(p,0),c.collapse(!0)}else c.selectNodeContents(v.value),c.collapse(!1);r&&(r.removeAllRanges(),r.addRange(c))}if(!c){U();return}const i=c.commonAncestorContainer,d=i.nodeType===3?i.parentElement:i;if(!v.value.contains(d)){if(c=document.createRange(),v.value.childNodes.length===0){const p=document.createElement("p");p.innerHTML="<br>",v.value.appendChild(p),c.setStart(p,0),c.collapse(!0)}else c.selectNodeContents(v.value),c.collapse(!1);r&&(r.removeAllRanges(),r.addRange(c))}const m=document.createElement("img");m.src=n,m.setAttribute("alt",t),m.setAttribute("data-alt",t),ee.value&&(m.style.width=`${ee.value}px`,m.setAttribute("width",ee.value)),se.value&&(m.style.height=`${se.value}px`,m.setAttribute("height",se.value));try{c.insertNode(m),c.setStartAfter(m),c.collapse(!0),r&&(r.removeAllRanges(),r.addRange(c))}catch{if(v.value){if(v.value.childNodes.length===0){const h=document.createElement("p");v.value.appendChild(h),h.appendChild(m)}else{const h=v.value.lastChild;if(h&&h.nodeType===1)h.appendChild(m);else{const f=document.createElement("p");v.value.appendChild(f),f.appendChild(m)}}const g=document.createRange();g.setStartAfter(m),g.collapse(!0),r&&(r.removeAllRanges(),r.addRange(g))}}Y.value=m,j()}}e.nextTick(()=>{o&&v.value&&o.observe(v.value,{childList:!0,subtree:!0}),He(),pe(),U()})};e.watch(()=>w.modelValue,t=>{if(w.richText&&v.value&&!Oe.value){const o=Zo(t||""),a=v.value.innerHTML.replace(/&nbsp;|\u00A0/g," "),r=o.replace(/&nbsp;|\u00A0/g," ");if(a!==r){const c=be();v.value.innerHTML=o,e.nextTick(()=>{no();const i=v.value.innerHTML||"",d=w.title||"",m=w.description||"";Ue.value=i,lt.value=d,fe.value=m,Vt.value=i,We.value=d,Ye.value=m,nt.value=[],eo.value=[],z.value&&(clearTimeout(z.value),z.value=null),le.value=!1,c&&at(c),Ce(),st(),Bt(),He(),pe(),$t(),Qe("watch-modelValue")})}}},{immediate:!0}),e.watch(()=>w.richText,t=>{t?(pe(),e.nextTick(()=>{u()})):(Co(),Ut.value=[],pt.value&&(pt.value.disconnect(),pt.value=null)),$t()}),e.watch(()=>w.floatingToolbar,t=>{t?pe():Co()}),e.watch(()=>w.disabled,t=>{t&&Co(),$t()}),e.watch(()=>w.description,()=>{e.nextTick(()=>{Ge.value?yo():Mo()})}),e.watch(()=>w.title,()=>{e.nextTick(()=>{Ke.value?Re():Uo()})}),e.watch(()=>w.customToolbarSlots,()=>{e.nextTick(()=>{so()})},{deep:!0}),e.watch(()=>w.comments,(t,o)=>{if(Lo.value){Lo.value=!1;return}lo.value||w.richText&&v.value&&e.nextTick(()=>{Rt()})},{deep:!0,immediate:!1});const Rt=()=>{if(!lo.value&&!(!w.comments||!Array.isArray(w.comments)||w.comments.length===0)&&!(!w.richText||!v.value)){lo.value=!0;try{const t=new Set,o=w.comments.filter(i=>{const d=String(i.conversation_id||i.id);return t.has(d)?!1:(t.add(d),!0)}),n=v.value.querySelectorAll("[data-comment], [data-fake-comment]"),a=n.length;n.forEach(i=>{const d=i.parentNode;if(d){for(;i.firstChild;)d.insertBefore(i.firstChild,i);d.removeChild(i)}});let r=0;const c=new Set;o.forEach(i=>{if(!i.conversation_id||!i.selection_range)return;const d=typeof i.conversation_id=="string"&&i.conversation_id.startsWith("comment-")?null:Number(i.conversation_id)||i.conversation_id;if(!d)return;const m=String(d);if(c.has(m))return;const p=v.value.querySelector(`[data-comment="${m}"]`);if(p){Ro(p,i),c.add(m);return}try{const g=Yn(i.selection_range,i.selection_text);if(g&&!g.collapsed){const h=g.commonAncestorContainer,f=h.nodeType===3?h.parentElement:h;if(f){const x=f.closest("[data-comment], [data-fake-comment]");if(x){const E=x.getAttribute("data-comment")||x.getAttribute("data-fake-comment");if(String(E)===String(d)){x.setAttribute("data-comment",m),x.removeAttribute("data-fake-comment"),Ro(x,i),c.add(m);return}else return}}const C=v.value.querySelector(`[data-comment="${m}"]`);if(C){Ro(C,i),c.add(m);return}const y=document.createElement("span");y.setAttribute("data-comment",m),Ro(y,i);try{g.surroundContents(y),r++,c.add(m)}catch{try{const E=document.createRange();E.setStart(g.startContainer,g.startOffset),E.setEnd(g.endContainer,g.endOffset),Ko(E),E.surroundContents(y),r++,c.add(m)}catch{try{const V=g.extractContents();y.appendChild(V),g.insertNode(y),r++,c.add(m)}catch(V){console.warn("Failed to create comment marker:",V)}}}}}catch{}}),e.nextTick(()=>{Qe("restoreCommentsFromModel"),j(),lo.value=!1})}catch{lo.value=!1}}},Ko=t=>{if(!t||!v.value)return t;try{const o=["P","DIV","H1","H2","H3","H4","H5","H6","LI","BLOCKQUOTE","PRE"];let n=t.startContainer,a=t.startOffset;if(n.nodeType===3){const i=n.parentElement;i&&o.includes(i.tagName)&&(a===0&&!qn(n)||t.setStartBefore(i))}else n.nodeType===1&&o.includes(n.tagName)&&a>0&&t.setStartBefore(n);let r=t.endContainer,c=t.endOffset;if(r.nodeType===3){const i=r.parentElement;i&&o.includes(i.tagName)&&(c===r.length&&!Xn(r)||t.setEndAfter(i))}else r.nodeType===1&&o.includes(r.tagName)&&c<r.childNodes.length&&t.setEndAfter(r);return t}catch{return t}},qn=t=>{let o=t.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},Xn=t=>{let o=t.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},Yn=(t,o)=>{if(!t||!v.value)return null;try{const n=document.createRange();if(t.type==="text"&&typeof t.start=="number"&&typeof t.end=="number"){let a=0;const r=[v.value];let c=null,i=!1,d=!1;for(;!d&&(c=r.pop());)if(c.nodeType===3){const m=a+c.length;!i&&t.start>=a&&t.start<=m&&(n.setStart(c,t.start-a),i=!0),i&&t.end>=a&&t.end<=m&&(n.setEnd(c,t.end-a),d=!0),a=m}else{let m=c.childNodes.length;for(;m--;)r.push(c.childNodes[m])}return i?Ko(n):null}}catch{return null}return null},Ro=(t,o)=>{if(!t||!o)return;const n=o.conversation||[],a=new Set,r=[],c=d=>{d&&d.id&&!a.has(d.id)&&(a.add(d.id),r.push(d))};n.length>0&&n.forEach(d=>{d.user&&c(d.user)}),r.length>0?t.setAttribute("data-comment-user",JSON.stringify(r[0])):t.removeAttribute("data-comment-user"),r.length>1?t.setAttribute("data-comment-user-2",JSON.stringify(r[1])):t.removeAttribute("data-comment-user-2");const i=n.length;i>0?t.setAttribute("data-comment-count",String(i)):t.removeAttribute("data-comment-count")},Qe=(t="unknown")=>{if(!w.richText||!v.value){Ut.value=[];return}Date.now()-Oo.value<Sn&&Ie.value!==null||Ie.value===null&&(Ie.value=requestAnimationFrame(()=>{if(Ie.value=null,Oo.value=Date.now(),to.value)return;to.value=!0;const n={},a=v.value;if(!a){to.value=!1;return}const r=a.closest(".editor-with-comments");if(!r){to.value=!1;return}const c=a.querySelectorAll("[data-comment], [data-fake-comment]"),i=[],d=new Set;c.forEach(f=>{const C=f.getAttribute("data-comment")||f.getAttribute("data-fake-comment");C&&f.tagName==="SPAN"&&(d.has(C)||(i.push(f),d.add(C)))}),c.forEach(f=>{const C=f.getAttribute("data-comment")||f.getAttribute("data-fake-comment");!C||d.has(C)||(["P","DIV","H1","H2","H3","H4","H5","H6"].includes(f.tagName)?f.querySelector(`span[data-comment="${C}"], span[data-fake-comment="${C}"]`)||(i.push(f),d.add(C)):f.tagName!=="SPAN"&&(i.push(f),d.add(C)))});const m=r.getBoundingClientRect(),p=a.getBoundingClientRect();i.forEach((f,C)=>{let y=f.getAttribute("data-comment")||f.getAttribute("data-fake-comment");if(!y)return;if(typeof y=="string"&&y.startsWith("comment-")){const Kt=f.textContent?.trim(),Gt=w.comments?.find(Ct=>(typeof Ct.conversation_id=="string"&&Ct.conversation_id.startsWith("comment-")?null:Ct.conversation_id)&&Ct.selection_text?.trim()===Kt);Gt?(y=String(Gt.conversation_id),f.setAttribute("data-comment",y),f.removeAttribute("data-fake-comment")):(y=String(Date.now()),f.setAttribute("data-comment",y),f.removeAttribute("data-fake-comment"))}const x=f.getBoundingClientRect(),E=window.getComputedStyle(f),V=parseFloat(E.lineHeight)||parseFloat(E.fontSize)*1.2,B=x.top-p.top+V/2-15,R=p.top-m.top+B;let q=null,G=null,Me=0;const yt=[],En=new Set;if(y&&w.comments){const Kt=w.comments.find(Gt=>String(Gt.conversation_id||Gt.id)===String(y));if(Kt){const Gt=Kt.conversation||[];Gt.length>0?(Gt.forEach(Ct=>{Ct.user&&Ct.user.id&&!En.has(Ct.user.id)&&(En.add(Ct.user.id),yt.push(Ct.user))}),Me=Gt.length):(Me=0,q=null,G=null),yt.length>0?q=yt[0]:q=null,yt.length>1?G=yt[1]:G=null}}const bn=x.top+V/2-15,po=bn+30,jt=5,ol=po>p.top+jt&&bn<p.bottom-jt?1:0;Ut.value.find(Kt=>Kt.id===y);let Vn=f;if(!Vn&&y&&v.value){const Kt=String(y);Vn=v.value.querySelector(`[data-comment="${Kt}"], [data-fake-comment="${Kt}"]`)}const nl=yt.length;n[y]?(n[y].top=R,n[y].opacity=ol,n[y].element=Vn,n[y].firstUser=q,n[y].secondUser=G,n[y].totalCount=Me,n[y].uniqueUserCount=nl):n[y]={id:y,top:R,opacity:ol,element:Vn,firstUser:q,secondUser:G,totalCount:Me,uniqueUserCount:nl}});const g=Object.values(n).map(f=>{const C=Math.max(0,(f.uniqueUserCount??0)-2);if(!f.element&&f.id&&v.value){const x=String(f.id);f.element=v.value.querySelector(`[data-comment="${x}"], [data-fake-comment="${x}"]`)}return{...f,firstUser:f.firstUser||null,secondUser:f.secondUser||null,totalCount:f.totalCount,additionalCount:C}});(Ut.value.length!==g.length||g.some((f,C)=>{const y=Ut.value[C];if(!y)return!0;const x=(y.firstUser?.id||null)!==(f.firstUser?.id||null),E=(y.secondUser?.id||null)!==(f.secondUser?.id||null);return y.id!==f.id||Math.abs(y.top-f.top)>1||y.opacity!==f.opacity||y.totalCount!==f.totalCount||y.additionalCount!==f.additionalCount||x||E||y.element!==f.element}))&&(Ut.value=g),to.value=!1}))},wn=t=>{if(!t)return;let o=t.element;if(!o&&t.id&&v.value){const n=String(t.id);o=v.value.querySelector(`[data-comment="${n}"], [data-fake-comment="${n}"]`)}o&&(Ft(),Fe.value=o,o.classList.add("editor-comment-highlighted"))},Ft=(t=!1)=>{!t&&ce.value!==null&&Fe.value&&(Fe.value.getAttribute("data-comment")||Fe.value.getAttribute("data-fake-comment"))===ce.value||(v.value&&v.value.querySelectorAll(".editor-comment-highlighted").forEach(n=>{n.classList.remove("editor-comment-highlighted")}),Fe.value&&(Fe.value.classList.remove("editor-comment-highlighted"),Fe.value=null))},Go=t=>{if(!t||!t.element)return;Ft(!0);const o=t.element.getAttribute("data-comment")||t.element.getAttribute("data-fake-comment");if(!o)return;const n=`[data-comment="${o}"], [data-fake-comment="${o}"]`;X("comment-marker-clicked",{commentId:o,selector:n,element:t.element})},l=()=>{Ft()},u=()=>{!w.richText||!v.value||(pt.value&&pt.value.disconnect(),ft.value!==null&&(clearTimeout(ft.value),ft.value=null),pt.value=new MutationObserver(()=>{ft.value===null&&(ft.value=setTimeout(()=>{ft.value=null,e.nextTick(()=>{Qe("MutationObserver")})},200))}),pt.value.observe(v.value,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-comment","data-fake-comment","data-comment-user","data-comment-user-2","data-comment-count"]}),Qe("setupCommentMarkersObserver-initial"))},s=(t,o)=>{if(!t||!o)return;const n=o.getBoundingClientRect();let a=n.top,r=n.right+4;t.style.top=`${a}px`,t.style.left=`${r}px`,t.offsetHeight;const c=t.getBoundingClientRect(),i=window.innerWidth,d=window.innerHeight;if(c.right>i){const m=n.left-c.width-4;t.style.left=`${m}px`}if(c.bottom>d){const m=Math.max(8,d-c.height-8);t.style.top=`${m}px`}c.top<0&&(t.style.top="8px")};return e.watch(()=>Ze.value,t=>{e.nextTick(()=>{document.querySelectorAll(".dss-toolbar-dropdown-submenu").forEach(n=>{const a=n.getAttribute("data-submenu-id");if(a===t&&t){const r=document.querySelector(`.dss-toolbar-dropdown-item-has-submenu[data-submenu-id="${a}"]`);if(r){if(n.parentNode!==document.body){const c=n.parentNode;n.dataset.originalParentRef=c===r?"inside":"sibling",document.body.appendChild(n)}n.style.display="block",n.style.visibility="hidden",n.style.opacity="0",requestAnimationFrame(()=>{requestAnimationFrame(()=>{s(n,r),n.offsetHeight,n.setAttribute("data-active","true"),n.style.visibility="visible",n.style.opacity="1"})})}else n.setAttribute("data-active","true")}else n.setAttribute("data-active","false"),n.style.display="none",n.style.top="",n.style.left="",n.style.visibility="",n.style.opacity=""})})}),e.watch(()=>[Le.value,Te.value],()=>{Le.value==="askAi"||Te.value==="askAi"?e.nextTick(()=>{pn()}):(Ze.value=null,e.nextTick(()=>{document.querySelectorAll(".dss-toolbar-dropdown-submenu").forEach(o=>{if(o.parentNode===document.body){const n=o.getAttribute("data-submenu-id");if(n){const a=document.querySelector(`.dss-toolbar-dropdown-item-has-submenu[data-submenu-id="${n}"]`);if(a)if(o.dataset.originalParentRef==="inside")a.appendChild(o);else{const c=a.closest(".dss-toolbar-dropdown");c&&c.insertBefore(o,a.nextSibling)}}}})}))}),e.watch(()=>w.locale,t=>{t&&t!==dt.value&&(dt.value=t)},{immediate:!0}),zt({openCommentOverlayForSelector:Ne,updateCommentMarkers:Qe,restoreCommentsFromModel:Rt}),(t,o)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-text-editor-container editor-with-comments",Nn.value]),style:e.normalizeStyle(Mn.value)},[A.richText?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-text-editor-toolbar",onMousedown:o[14]||(o[14]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("div",Us,[e.createElementVNode("div",{class:"dss-toolbar-button",onClick:an,title:e.unref(b)("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,Ws),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-disabled":!Qo.value}]),onClick:sn,title:e.unref(b)("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,qs),o[73]||(o[73]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",Xs,[e.createElementVNode("div",{class:"dss-toolbar-button dss-toolbar-dropdown-toggle",onClick:o[0]||(o[0]=n=>Ho("paragraph")),title:e.unref(b)("textEditor.toolbar.paragraphFormat")},[ve.value==="h1"?(e.openBlock(),e.createElementBlock("svg",js,[...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)])])):ve.value==="h2"?(e.openBlock(),e.createElementBlock("svg",Ks,[...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)])])):ve.value==="h3"?(e.openBlock(),e.createElementBlock("svg",Gs,[...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)])])):ve.value==="h4"?(e.openBlock(),e.createElementBlock("svg",Js,[...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)])])):ve.value==="h5"?(e.openBlock(),e.createElementBlock("svg",Qs,[...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)])])):ve.value==="h6"?(e.openBlock(),e.createElementBlock("svg",er,[...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",tr,[...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,Ys),Le.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]=n=>Ht("<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(b)("textEditor.paragraph.heading1")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:o[2]||(o[2]=n=>Ht("<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(b)("textEditor.paragraph.heading2")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:o[3]||(o[3]=n=>Ht("<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(b)("textEditor.paragraph.heading3")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:o[4]||(o[4]=n=>Ht("<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(b)("textEditor.paragraph.heading4")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:o[5]||(o[5]=n=>Ht("<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(b)("textEditor.paragraph.heading5")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:o[6]||(o[6]=n=>Ht("<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(b)("textEditor.paragraph.heading6")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:o[7]||(o[7]=n=>Ht("<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(b)("textEditor.paragraph.paragraph")),1)])])):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":$e("bold")}]),onClick:o[9]||(o[9]=n=>Tt("bold")),title:e.unref(b)("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,or),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":$e("italic")}]),onClick:o[10]||(o[10]=n=>Tt("italic")),title:e.unref(b)("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,nr),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":$e("underline")}]),onClick:o[11]||(o[11]=n=>Tt("underline")),title:e.unref(b)("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,lr),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Jt.value}]),onClick:Ao,title:e.unref(b)("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,ar),o[74]||(o[74]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),De.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-button",onClick:k,title:e.unref(b)("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,rr)):(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-button",onClick:vt,title:e.unref(b)("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,sr)),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":$e("insertUnorderedList")}]),onClick:Se,title:e.unref(b)("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,ir),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":$e("insertOrderedList")}]),onClick:qe,title:e.unref(b)("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,cr),o[76]||(o[76]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:"dss-toolbar-button",onClick:xo,title:e.unref(b)("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,dr),mt.value?(e.openBlock(),e.createElementBlock("div",ur)):e.createCommentVNode("",!0),mt.value?(e.openBlock(),e.createElementBlock("div",{key:3,class:"dss-toolbar-button",title:e.unref(b)("textEditor.toolbar.comment"),onClick:cn},[...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,mr)):e.createCommentVNode("",!0),A.askAi?(e.openBlock(),e.createElementBlock("div",pr)):e.createCommentVNode("",!0),A.askAi?(e.openBlock(),e.createElementBlock("div",fr,[e.createElementVNode("div",{class:"dss-toolbar-ai-button dss-toolbar-dropdown-toggle",onClick:o[12]||(o[12]=n=>Ho("askAi")),title:e.unref(b)("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",gr,e.toDisplayString(e.unref(b)("textEditor.toolbar.askAi")),1)],8,vr),Le.value==="askAi"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:o[13]||(o[13]=e.withModifiers(()=>{},["stop"]))},[e.renderSlot(t.$slots,"ask-ai-dropdown")])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),e.createElementVNode("div",hr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(A.customToolbarSlots,(n,a)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:a},[I(n)?(e.openBlock(),e.createElementBlock("div",yr,[e.renderSlot(t.$slots,n)])):e.createCommentVNode("",!0),I(n)&&a<A.customToolbarSlots.length-1&&oe(a)?(e.openBlock(),e.createElementBlock("div",Cr)):e.createCommentVNode("",!0)],64))),128))])],32)):e.createCommentVNode("",!0),(Le.value==="paragraph"||Le.value==="askAi")&&A.richText?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-dropdown-overlay",onClick:Ve})):e.createCommentVNode("",!0),e.createVNode(jn,{showModal:et.value,width:"500px",height:"55vh",onCloseModal:_o},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(b)("textEditor.link.editLink")),1)]),content:e.withCtx(()=>[e.createElementVNode("div",kr,[e.createElementVNode("div",xr,[e.createElementVNode("label",wr,e.toDisplayString(e.unref(b)("textEditor.link.altText")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"linkAltInput",ref:bo,type:"text","onUpdate:modelValue":o[15]||(o[15]=n=>Q.value=n),class:"dss-link-modal-input",placeholder:e.unref(b)("textEditor.link.enterAltText"),onKeyup:e.withKeys(jo,["enter"])},null,40,Er),[[e.vModelText,Q.value]])]),e.createElementVNode("div",br,[e.createElementVNode("label",Vr,e.toDisplayString(e.unref(b)("textEditor.link.url")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"linkUrlInput",ref:tt,type:"text","onUpdate:modelValue":o[16]||(o[16]=n=>J.value=n),class:"dss-link-modal-input",placeholder:e.unref(b)("textEditor.link.enterUrl"),onKeyup:e.withKeys(jo,["enter"])},null,40,Sr),[[e.vModelText,J.value]])])])]),actions:e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-cancel",onClick:_o},e.toDisplayString(e.unref(b)("textEditor.link.cancel")),1),e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-save",onClick:jo},e.toDisplayString(e.unref(b)("textEditor.link.save")),1)]),_:1},8,["showModal"]),e.createVNode(jn,{showModal:vo.value,width:"500px",height:"80vh",onCloseModal:U},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(Y.value?e.unref(b)("textEditor.image.editImage"):e.unref(b)("textEditor.image.addImage")),1)]),content:e.withCtx(()=>[e.createElementVNode("div",Nr,[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-image-modal-tab",{"dss-image-modal-tab-active":_e.value==="upload"}]),onClick:o[17]||(o[17]=n=>_e.value="upload")},e.toDisplayString(e.unref(b)("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":_e.value==="url"}]),onClick:o[18]||(o[18]=n=>_e.value="url")},e.toDisplayString(e.unref(b)("textEditor.image.imageLink")),3)]),_e.value==="upload"?(e.openBlock(),e.createElementBlock("div",Mr,[e.createElementVNode("div",Br,[e.createElementVNode("div",Tr,[L.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("label",Hr,e.toDisplayString(e.unref(b)("textEditor.image.uploadImage")),1)),L.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-image-upload-preview",onClick:ct},[e.createElementVNode("img",{src:ot.value,alt:"Preview",class:"dss-image-preview-image"},null,8,Ar),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:Xe,type:"file",accept:"image/*",class:"dss-image-file-input-hidden",onChange:wo},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:wo},null,544))]),e.createElementVNode("div",Lr,[e.createElementVNode("label",$r,e.toDisplayString(e.unref(b)("textEditor.image.altText")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"imageAltInput",ref:wt,type:"text","onUpdate:modelValue":o[19]||(o[19]=n=>Pe.value=n),class:"dss-link-modal-input",placeholder:e.unref(b)("textEditor.image.enterAltText"),onKeyup:e.withKeys(ht,["enter"])},null,40,Dr),[[e.vModelText,Pe.value]])]),e.createElementVNode("div",_r,[e.createElementVNode("label",Ir,e.toDisplayString(e.unref(b)("textEditor.image.width")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":o[20]||(o[20]=n=>ee.value=n),class:"dss-link-modal-input",placeholder:e.unref(b)("textEditor.image.auto"),onKeyup:e.withKeys(ht,["enter"]),onInput:uo},null,40,Rr),[[e.vModelText,ee.value]])]),e.createElementVNode("div",Fr,[e.createElementVNode("label",zr,e.toDisplayString(e.unref(b)("textEditor.image.height")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":o[21]||(o[21]=n=>se.value=n),class:"dss-link-modal-input",placeholder:e.unref(b)("textEditor.image.auto"),onKeyup:e.withKeys(ht,["enter"]),onInput:mo},null,40,Or),[[e.vModelText,se.value]])])])])):e.createCommentVNode("",!0),_e.value==="url"?(e.openBlock(),e.createElementBlock("div",Pr,[e.createElementVNode("div",Zr,[e.createElementVNode("div",Ur,[e.createElementVNode("label",Wr,e.toDisplayString(e.unref(b)("textEditor.image.imageUrl")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"imageUrlInput",ref:go,type:"text","onUpdate:modelValue":o[22]||(o[22]=n=>bt.value=n),class:"dss-link-modal-input",placeholder:e.unref(b)("textEditor.image.enterImageUrl"),onKeyup:e.withKeys(ht,["enter"])},null,40,qr),[[e.vModelText,bt.value]])]),e.createElementVNode("div",Xr,[e.createElementVNode("label",Yr,e.toDisplayString(e.unref(b)("textEditor.image.altText")),1),e.withDirectives(e.createElementVNode("input",{type:"text","onUpdate:modelValue":o[23]||(o[23]=n=>Pe.value=n),class:"dss-link-modal-input",placeholder:e.unref(b)("textEditor.image.enterAltText"),onKeyup:e.withKeys(ht,["enter"])},null,40,jr),[[e.vModelText,Pe.value]])]),e.createElementVNode("div",Kr,[e.createElementVNode("label",Gr,e.toDisplayString(e.unref(b)("textEditor.image.width")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":o[24]||(o[24]=n=>ee.value=n),class:"dss-link-modal-input",placeholder:e.unref(b)("textEditor.image.auto"),onKeyup:e.withKeys(ht,["enter"]),onInput:uo},null,40,Jr),[[e.vModelText,ee.value]])]),e.createElementVNode("div",Qr,[e.createElementVNode("label",ei,e.toDisplayString(e.unref(b)("textEditor.image.height")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":o[25]||(o[25]=n=>se.value=n),class:"dss-link-modal-input",placeholder:e.unref(b)("textEditor.image.auto"),onKeyup:e.withKeys(ht,["enter"]),onInput:mo},null,40,ti),[[e.vModelText,se.value]])])])])):e.createCommentVNode("",!0)]),actions:e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-cancel",onClick:U},e.toDisplayString(e.unref(b)("textEditor.image.cancel")),1),e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-save",onClick:ht},e.toDisplayString(e.unref(b)("textEditor.image.save")),1)]),_:1},8,["showModal"]),e.createElementVNode("div",{class:e.normalizeClass(["dss-text-editor-title-wrapper",{"dss-text-editor-no-border-bottom":tn.value&&Ke.value}])},[e.createElementVNode("p",null,e.toDisplayString(e.unref(b)("textEditor.labels.title")),1),e.createElementVNode("div",oi,[Ke.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",ni,[A.title?(e.openBlock(),e.createElementBlock("span",li,e.toDisplayString(A.title),1)):(e.openBlock(),e.createElementBlock("span",ai,e.toDisplayString(No.value),1))])),e.createElementVNode("textarea",{ref_key:"titleInputRef",ref:K,value:A.title,onInput:ln,onFocus:Hn,onBlur:An,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-title-input",{"dss-text-editor-title-input-blurred":!Ke.value}]),placeholder:No.value,disabled:A.disabled,rows:"1"},null,42,si)])],2),tn.value&&Ke.value?(e.openBlock(),e.createElementBlock("div",ri,[e.renderSlot(t.$slots,"title-slot")])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["dss-text-editor-description-wrapper",{"dss-text-editor-no-border-bottom":oo.value&&Ge.value}])},[e.createElementVNode("p",null,e.toDisplayString(e.unref(b)("textEditor.labels.description")),1),e.createElementVNode("div",ii,[Ge.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",ci,[A.description?(e.openBlock(),e.createElementBlock("span",di,e.toDisplayString(A.description),1)):(e.openBlock(),e.createElementBlock("span",ui,e.toDisplayString(ae.value),1))])),e.createElementVNode("textarea",{ref_key:"descriptionInputRef",ref:te,value:A.description,onInput:Dn,onFocus:Ln,onBlur:$n,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-description-input",{"dss-text-editor-description-input-blurred":!Ge.value}]),placeholder:ae.value,disabled:A.disabled,rows:"1"},null,42,mi)])],2),oo.value&&Ge.value?(e.openBlock(),e.createElementBlock("div",pi,[e.renderSlot(t.$slots,"description-slot")])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ut.value,n=>(e.openBlock(),e.createElementBlock("div",{key:n.id,class:e.normalizeClass(["editor-comment-marker-group",{"editor-comment-marker-active":ce.value===n.id,"editor-comment-marker-group-out-of-view":n.opacity===0}]),"data-comment-id":n.id,style:e.normalizeStyle({top:n.top+"px"}),onMouseenter:a=>wn(n),onMouseleave:l},[n.firstUser?(e.openBlock(),e.createElementBlock("div",{key:0,class:"editor-comment-marker editor-comment-marker-first",onClick:e.withModifiers(a=>Go(n),["stop"])},[n.firstUser.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:n.firstUser.avatar,alt:n.firstUser.name||"avatar"},null,8,gi)):(e.openBlock(),e.createElementBlock("span",hi,e.toDisplayString(n.firstUser.initials||(n.firstUser.name?n.firstUser.name.charAt(0):"")),1))],8,vi)):e.createCommentVNode("",!0),n.secondUser?(e.openBlock(),e.createElementBlock("div",{key:1,class:"editor-comment-marker editor-comment-marker-second",onClick:e.withModifiers(a=>Go(n),["stop"])},[n.secondUser.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:n.secondUser.avatar,alt:n.secondUser.name||"avatar"},null,8,Ci)):(e.openBlock(),e.createElementBlock("span",ki,e.toDisplayString(n.secondUser.initials||(n.secondUser.name?n.secondUser.name.charAt(0):"")),1))],8,yi)):e.createCommentVNode("",!0),n.additionalCount>0?(e.openBlock(),e.createElementBlock("div",{key:2,class:"editor-comment-marker editor-comment-marker-additional",style:e.normalizeStyle({top:n.secondUser?"30px":"15px"}),"data-has-second-user":n.secondUser?"true":"false",onClick:e.withModifiers(a=>Go(n),["stop"])},[e.createElementVNode("span",wi,"+"+e.toDisplayString(n.additionalCount),1)],12,xi)):e.createCommentVNode("",!0)],46,fi))),128)),A.richText?(e.openBlock(),e.createElementBlock("div",Bi,[e.createElementVNode("div",{ref_key:"editorRef",ref:v,contenteditable:"true",spellcheck:"false",class:e.normalizeClass(["dss-text-editor-content",{"dss-text-editor-content-disabled":A.disabled,"dss-text-editor-fixed-height":A.fixedHeight}]),style:e.normalizeStyle(Po.value),onInput:j,onBlur:Wt,onClick:vn,onMouseup:gn,onKeyup:gn,onKeydown:Xo,onPaste:On,onMousemove:Cn,onMouseleave:Zn},null,38),e.createVNode(e.Transition,{name:"comment-overlay"},{default:e.withCtx(()=>[ce.value!==null?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-comment-overlay",style:e.normalizeStyle(ie.value)},[Ee.value||ze.value.length>0?(e.openBlock(),e.createElementBlock("div",Ti,[e.createElementVNode("div",Hi,[Ee.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-comment-selection",innerHTML:Ee.value},null,8,Ai)):e.createCommentVNode("",!0)]),e.createElementVNode("div",Li,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ze.value,(n,a)=>(e.openBlock(),e.createElementBlock("div",{key:a,class:"dss-comment-message"},[n.user&&(n.user.avatar||n.user.initials||n.user.name)?(e.openBlock(),e.createElementBlock("div",$i,[e.createElementVNode("div",Di,[n.user.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:n.user.avatar,alt:n.user.name||"avatar"},null,8,_i)):(e.openBlock(),e.createElementBlock("span",Ii,e.toDisplayString(n.user.initials||(n.user.name?n.user.name.charAt(0):"")),1))])])):e.createCommentVNode("",!0),e.createElementVNode("div",Ri,[e.createElementVNode("div",Fi,[e.createElementVNode("div",zi,e.toDisplayString(n.user&&n.user.name||"Comment"),1),n.createdAt?(e.openBlock(),e.createElementBlock("div",Oi,e.toDisplayString(Bn(new Date(n.createdAt))),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:e.normalizeClass(["dss-comment-body-text",{"comment-started":nn(n.text)||n.class==="comment-started"}])},e.toDisplayString(n.text||""),3)]),w.commentUser&&n.user&&n.user.id===w.commentUser.id&&!nn(n.text)?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-comment-delete-button",onClick:e.withModifiers(r=>qt(n,a),["stop"]),title:e.unref(b)("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,Pi)):e.createCommentVNode("",!0)]))),128))])])):e.createCommentVNode("",!0),e.createElementVNode("div",Zi,[e.withDirectives(e.createElementVNode("textarea",{ref_key:"commentInputRef",ref:Z,"onUpdate:modelValue":o[26]||(o[26]=n=>ne.value=n),class:"dss-comment-input",rows:"1",placeholder:e.unref(b)("textEditor.comment.placeholder"),onKeydown:e.withKeys(e.withModifiers(it,["prevent","stop"]),["enter"]),onInput:o[27]||(o[27]=()=>{if(Z.value){const n=Z.value;n.style.height="auto",n.style.height=`${n.scrollHeight}px`}})},null,40,Ui),[[e.vModelText,ne.value]]),e.createElementVNode("button",{type:"button",class:"dss-comment-send-button",onClick:e.withModifiers(it,["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",Wi,[e.createElementVNode("div",qi,[e.createElementVNode("span",Xi,e.toDisplayString(So.value)+" "+e.toDisplayString(So.value===1?e.unref(b)("textEditor.footer.word"):e.unref(b)("textEditor.footer.words")),1),o[82]||(o[82]=e.createElementVNode("span",{class:"dss-text-editor-footer-separator"},"•",-1)),e.createElementVNode("span",Yi,e.toDisplayString(re.value)+" "+e.toDisplayString(re.value===1?e.unref(b)("textEditor.footer.character"):e.unref(b)("textEditor.footer.characters")),1)])])])):(e.openBlock(),e.createElementBlock("div",Ei,[e.createElementVNode("textarea",{value:A.modelValue,onInput:Tn,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-textarea",{"dss-text-editor-fixed-height":A.fixedHeight}]),placeholder:Nt.value,rows:A.rows,disabled:A.disabled,style:e.normalizeStyle(Jo.value)},null,46,bi),e.createElementVNode("div",Vi,[e.createElementVNode("div",Si,[e.createElementVNode("span",Ni,e.toDisplayString(So.value)+" "+e.toDisplayString(So.value===1?e.unref(b)("textEditor.footer.word"):e.unref(b)("textEditor.footer.words")),1),o[79]||(o[79]=e.createElementVNode("span",{class:"dss-text-editor-footer-separator"},"•",-1)),e.createElementVNode("span",Mi,e.toDisplayString(re.value)+" "+e.toDisplayString(re.value===1?e.unref(b)("textEditor.footer.character"):e.unref(b)("textEditor.footer.characters")),1)])])])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[T.value&&D.value&&v.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-link-popup",style:e.normalizeStyle(W.value),onMouseenter:o[28]||(o[28]=n=>P.value=!0),onMouseleave:ko},[e.createElementVNode("span",{class:"dss-link-popup-url",onClick:e.withModifiers(Un,["stop"]),title:D.value},e.toDisplayString(D.value),9,ji),e.createElementVNode("button",{type:"button",class:"dss-link-popup-edit",onClick:e.withModifiers(Do,["stop"]),title:e.unref(b)("textEditor.link.editLink")},[(e.openBlock(),e.createElementBlock("svg",Gi,[...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,Ki)],36)):e.createCommentVNode("",!0)])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[ho.value&&Qt.value&&v.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-link-popup",style:e.normalizeStyle(Pt.value),onMouseenter:o[29]||(o[29]=n=>Zt.value=!0),onMouseleave:co},[e.createElementVNode("div",Ji,[Qt.value===e.unref(b)("textEditor.image.noAlt")?(e.openBlock(),e.createElementBlock("div",Qi,[...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:Qt.value},e.toDisplayString(Qt.value),9,ec)]),e.createElementVNode("button",{type:"button",class:"dss-link-popup-edit",onClick:e.withModifiers(Eo,["stop"]),title:e.unref(b)("textEditor.image.editImage")},[(e.openBlock(),e.createElementBlock("svg",oc,[...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,tc)],36)):e.createCommentVNode("",!0)])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[A.floatingToolbar&&A.richText&&ye.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"floatingToolbarRef",ref:fo,class:"dss-floating-toolbar",style:e.normalizeStyle(Be.value),onMousedown:o[44]||(o[44]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("div",nc,[e.createElementVNode("div",{class:"dss-toolbar-button",onClick:e.withModifiers(an,["stop"]),title:e.unref(b)("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,lc),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-disabled":!Qo.value}]),onClick:e.withModifiers(sn,["stop"]),title:e.unref(b)("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,ac),o[107]||(o[107]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",sc,[e.createElementVNode("div",{class:"dss-toolbar-button dss-toolbar-dropdown-toggle",onClick:o[30]||(o[30]=e.withModifiers(n=>hn("paragraph"),["stop"])),title:e.unref(b)("textEditor.toolbar.paragraphFormat")},[ve.value==="h1"?(e.openBlock(),e.createElementBlock("svg",ic,[...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)])])):ve.value==="h2"?(e.openBlock(),e.createElementBlock("svg",cc,[...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)])])):ve.value==="h3"?(e.openBlock(),e.createElementBlock("svg",dc,[...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)])])):ve.value==="h4"?(e.openBlock(),e.createElementBlock("svg",uc,[...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)])])):ve.value==="h5"?(e.openBlock(),e.createElementBlock("svg",mc,[...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)])])):ve.value==="h6"?(e.openBlock(),e.createElementBlock("svg",pc,[...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",fc,[...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,rc),Te.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]=n=>It("<h1>"))},[e.createElementVNode("h1",null,e.toDisplayString(e.unref(b)("textEditor.paragraph.heading1")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:o[32]||(o[32]=n=>It("<h2>"))},[e.createElementVNode("h2",null,e.toDisplayString(e.unref(b)("textEditor.paragraph.heading2")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:o[33]||(o[33]=n=>It("<h3>"))},[e.createElementVNode("h3",null,e.toDisplayString(e.unref(b)("textEditor.paragraph.heading3")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:o[34]||(o[34]=n=>It("<h4>"))},[e.createElementVNode("h4",null,e.toDisplayString(e.unref(b)("textEditor.paragraph.heading4")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:o[35]||(o[35]=n=>It("<h5>"))},[e.createElementVNode("h5",null,e.toDisplayString(e.unref(b)("textEditor.paragraph.heading5")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:o[36]||(o[36]=n=>It("<h6>"))},[e.createElementVNode("h6",null,e.toDisplayString(e.unref(b)("textEditor.paragraph.heading6")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:o[37]||(o[37]=n=>It("<p>"))},[e.createElementVNode("p",null,e.toDisplayString(e.unref(b)("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":$e("bold")}]),onClick:o[39]||(o[39]=e.withModifiers(n=>Tt("bold"),["stop"])),title:e.unref(b)("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,vc),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":$e("italic")}]),onClick:o[40]||(o[40]=e.withModifiers(n=>Tt("italic"),["stop"])),title:e.unref(b)("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,gc),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":$e("underline")}]),onClick:o[41]||(o[41]=e.withModifiers(n=>Tt("underline"),["stop"])),title:e.unref(b)("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,hc),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":Jt.value}]),onClick:e.withModifiers(Ao,["stop"]),title:e.unref(b)("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,yc),o[110]||(o[110]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),De.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-button",onClick:e.withModifiers(k,["stop"]),title:e.unref(b)("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,kc)):(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-button",onClick:e.withModifiers(vt,["stop"]),title:e.unref(b)("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,Cc)),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":$e("insertUnorderedList")}]),onClick:e.withModifiers(Se,["stop"]),title:e.unref(b)("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,xc),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":$e("insertOrderedList")}]),onClick:e.withModifiers(qe,["stop"]),title:e.unref(b)("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,wc),o[112]||(o[112]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:"dss-toolbar-button",onClick:e.withModifiers(xo,["stop"]),title:e.unref(b)("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,Ec),o[113]||(o[113]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:"dss-toolbar-button",title:e.unref(b)("textEditor.toolbar.comment"),onClick:e.withModifiers(cn,["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,bc),A.askAi?(e.openBlock(),e.createElementBlock("div",Vc)):e.createCommentVNode("",!0),A.askAi?(e.openBlock(),e.createElementBlock("div",Sc,[e.createElementVNode("div",{class:"dss-toolbar-ai-button dss-toolbar-ai-float dss-toolbar-dropdown-toggle",onClick:o[42]||(o[42]=e.withModifiers(n=>hn("askAi"),["stop"])),title:e.unref(b)("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",Mc,e.toDisplayString(e.unref(b)("textEditor.toolbar.askAi")),1)],8,Nc),Te.value==="askAi"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:o[43]||(o[43]=e.withModifiers(()=>{},["stop"]))},[e.renderSlot(t.$slots,"ask-ai-dropdown")])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),$.value?(e.openBlock(),e.createElementBlock("div",Bc,[A.askAi&&$.value?(e.openBlock(),e.createElementBlock("div",Tc)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(A.customToolbarSlots,(n,a)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:a},[I(n)&&ge(n)?(e.openBlock(),e.createElementBlock("div",Hc,[e.renderSlot(t.$slots,n)])):e.createCommentVNode("",!0),I(n)&&ge(n)&&a<A.customToolbarSlots.length-1&&S(a)?(e.openBlock(),e.createElementBlock("div",Ac)):e.createCommentVNode("",!0)],64))),128))])):e.createCommentVNode("",!0)],36)):e.createCommentVNode("",!0)]))],6))}}),Dc={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"}},_c={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"}},Qn={chart:Dc,textEditor:_c},Ic={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"}},Rc={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"}},el={chart:Ic,textEditor:Rc},Fc={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"}},zc={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"}},tl={chart:Fc,textEditor:zc},Kn={en:Qn,fr:el,nl:tl};function Oc(A){if(!A||!A.global)return;const zt=A.global.availableLocales||[];Object.keys(Kn).forEach(F=>{zt.includes(F)&&A.global.mergeLocaleMessage(F,Kn[F])})}const Gn={en:{textEditor:Qn.textEditor},fr:{textEditor:el.textEditor},nl:{textEditor:tl.textEditor}};function Pc(A){if(!A||!A.global)return;const zt=A.global.availableLocales||[];Object.keys(Gn).forEach(F=>{zt.includes(F)&&A.global.mergeLocaleMessage(F,Gn[F])})}const Zc={en:{...Qn},fr:{...el},nl:{...tl}};Jn.createI18n({legacy:!1,locale:"en",fallbackLocale:"en",messages:Zc});exports.DSSChart=Os;exports.DSSChartMessages=Kn;exports.DSSModal=jn;exports.DSSTextEditor=$c;exports.DSSTextEditorMessages=Gn;exports.addDSSChartTranslations=Oc;exports.addDSSTextEditorTranslations=Pc;
77
+ </svg>`,g=e.ref(null),Re=e.ref(null),ct=e.ref(!1),et=e.ref(!1),D=e.ref(!1),le=e.ref(""),ke=e.ref({}),gt=e.ref(!1),yt=e.ref(!1),$=e.ref(""),Ye=e.ref(""),Ht=e.ref(null),Ze=e.ref(null),He=e.ref(null),je=e.ref(null),ae=e.ref(""),Eo=e.ref(!1),j=e.ref({}),xe=e.ref(!1),rn=e.ref({}),Ao=e.ref(null),At=e.ref(null),lo=e.ref(!1),Ct=e.ref(""),Lo=e.ref(null),kt=e.ref(""),Je=e.ref(""),Ce=e.ref(""),Ae=e.ref(null),Lt=e.ref(null),Vo=e.ref(null),ue=e.ref(null),$o=e.ref(null),Pt=e.ref(!1),So=e.ref(""),Bn=e.ref({}),We=e.ref(!1),nt=e.ref("upload"),Ke=e.ref(""),rt=e.ref(null),ut=e.ref(null),xt=e.ref([]),lt=e.ref([]),te=e.ref(null),ve=e.ref(!1),$t=e.ref(""),tt=e.ref(""),wt=e.ref(""),dt=e.ref(""),mt=e.ref(""),pt=e.ref(""),se=e.ref(null),Ne=e.ref(null),Ot=e.ref(null),ho=e.ref(!1),bt=e.ref(null),Et=e.ref(!1),Zt=e.ref(!1),ao=e.ref(null),Fe=e.ref("p"),Ue=e.ref(!1),Wt=e.ref([]),Dt=e.ref(null),It=e.ref(null),Ut=e.ref(null),Do=e.ref(!1),Tn=e.ref(0),al=100,Vt=e.ref(null),cn=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":qe.value!==null})),sl=e.computed(()=>({})),un=e.computed(()=>!S.fixedHeight||S.fullHeight?{}:{height:`${1.6*14*S.rows+24+2}px`,resize:"none",overflowY:"auto"}),dn=e.computed(()=>!S.fixedHeight||S.fullHeight?{}:{height:`${1.6*14*S.rows+32}px`,overflowY:"auto"}),Hn=e.computed(()=>S.richText&&lt.value.length>0),An=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}),St=e.computed(()=>{const l=An.value.trim();return l?l.split(/\s+/).filter(o=>o.length>0).length:0}),qo=e.computed(()=>An.value.length),mn=e.computed(()=>ue.value!==null&&nt.value==="upload"&&kt.value&&kt.value.startsWith("data:")),pn=e.computed(()=>S.titlePlaceholder||H("textEditor.placeholders.title")),Ln=e.computed(()=>S.descriptionPlaceholder||H("textEditor.placeholders.description")),rl=e.computed(()=>S.placeholder||H("textEditor.placeholders.startTyping")),qt=l=>bo&&bo[l]!==void 0,il=l=>{for(let o=l+1;o<S.customToolbarSlots.length;o++)if(qt(S.customToolbarSlots[o]))return!0;return!1},$n=l=>{for(let o=l+1;o<S.customToolbarSlots.length;o++){const a=S.customToolbarSlots[o];if(qt(a)&&Xo(a))return!0}return!1},Xo=l=>S.customToolbarFloatingMap.hasOwnProperty(l)?S.customToolbarFloatingMap[l]===!0:!0,Dn=e.computed(()=>S.customToolbarSlots.some(l=>qt(l)&&Xo(l))),fn=e.computed(()=>qt("title-slot")),Yo=e.computed(()=>qt("description-slot")),jo=l=>{if(!l||l.trim()==="")return"<html></html>";const o=l.trim();return o.startsWith("<html>")&&o.endsWith("</html>")?l:`<html>${l}</html>`},vn=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},cl=l=>{if(!l)return;const o=document.createTreeWalker(l,NodeFilter.SHOW_COMMENT,null,!1),a=[];let s=o.nextNode();for(;s;)a.push(s),s=o.nextNode();a.forEach(i=>i.remove())},Ee=l=>{try{const o=String(l.getDate()).padStart(2,"0"),s=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][l.getMonth()],i=l.getFullYear();return`${o} ${s} ${i}`}catch{return""}},U=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=H("textEditor.started_conversation");if(i&&o===i)return!0}catch{}const s=o.toLowerCase();return s.includes("started conversation")||s.includes("démarré la conversation")||s==="started conversation"||s==="a démarré la conversation"},hn=l=>{const o=l.target.value;ie("update:modelValue",o),ie("change",o)},oe=()=>{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 s=l.value;l.value="M";const i=l.scrollHeight;l.value=s,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")},so=()=>{Et.value=!0,oe()},ne=()=>{Et.value=!1,re()},re=()=>{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 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")},A=l=>{const a=l.target.value;Et.value&&oe(),ie("update:title",a),ie("title-change",a),Ot.value="title",S.richText&&(ve.value||(tt.value=$t.value,mt.value=wt.value,pt.value=dt.value),te.value&&clearTimeout(te.value),ve.value=!0,te.value=setTimeout(()=>{ve.value=!1,ze()},500))},Me=()=>{if(!Ne.value)return;const l=Ne.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 s=l.value;l.value="M";const i=l.scrollHeight;l.value=s,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")},X=()=>{Zt.value=!0,Me()},ul=()=>{Zt.value=!1,go()},go=()=>{if(!Ne.value)return;const l=Ne.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")},No=l=>{const a=l.target.value;Zt.value&&Me(),ie("update:description",a),ie("description-change",a),Ot.value="description",S.richText&&(ve.value||(tt.value=$t.value,mt.value=wt.value,pt.value=dt.value),te.value&&clearTimeout(te.value),ve.value=!0,te.value=setTimeout(()=>{ve.value=!1,ze()},500))},ft=()=>{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}},Nt=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 s=0;const i=[g.value];let d=null,u=!1,m=!1;for(;!m&&(d=i.pop());)if(d.nodeType===3){const p=s+d.length;!u&&l.start>=s&&l.start<=p&&(a.setStart(d,l.start-s),u=!0),u&&l.end>=s&&l.end<=p&&(a.setEnd(d,l.end-s),m=!0),s=p}else{let p=d.childNodes.length;for(;p--;)i.push(d.childNodes[p])}o.removeAllRanges(),o.addRange(a)}catch{g.value.focus()}},Ko=()=>{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 d=i.childNodes.length-1;d>=0;d--){const u=i.childNodes[d],m=a(u);if(m)return m}return i},s=a(g.value);if(s.nodeType===3)o.setStart(s,s.length),o.setEnd(s,s.length);else if(s.childNodes.length>0){const i=a(s);i&&i.nodeType===3?(o.setStart(i,i.length),o.setEnd(i,i.length)):(o.selectNodeContents(s),o.collapse(!1))}else o.setStart(s,0),o.setEnd(s,0);l.removeAllRanges(),l.addRange(o)},ze=(l=!1)=>{if(!g.value)return;const o=g.value.innerHTML,a=S.title||"",s=S.description||"";if(!l&&o===$t.value&&a===wt.value&&s===dt.value)return;const i={content:tt.value||$t.value,title:mt.value!==void 0?mt.value:wt.value,description:pt.value!==void 0?pt.value:dt.value},d=xt.value.length>0?xt.value[xt.value.length-1]:null;let u=!0;d&&(typeof d=="string"?u=i.content!==d:u=i.content!==d.content||i.title!==d.title||i.description!==d.description),u&&(xt.value.push(i),xt.value.length>50&&xt.value.shift(),lt.value=[]),$t.value=o,wt.value=a,dt.value=s,tt.value=o,mt.value=a,pt.value=s},fe=l=>{if(!g.value)return;Xt(),g.value&&cl(g.value);let o=null;g.value&&(g.value.querySelector("p")||(o=ft(),gn()));const a=l&&l.inputType&&(l.inputType==="insertText"||l.inputType==="insertCompositionText"||l.inputType==="deleteContentBackward"||l.inputType==="deleteContentForward");a&&ao.value&&(ao.value=null),et.value=!0;const s=g.value.innerHTML.replace(/<!--[\s\S]*?-->/g,"").replace(/&nbsp;|\u00A0/g," "),i=jo(s);ie("update:modelValue",i),ie("change",i),Ot.value="editor",ve.value||(tt.value=$t.value,mt.value=wt.value,pt.value=dt.value),te.value&&clearTimeout(te.value),ve.value=!0,te.value=setTimeout(()=>{ve.value=!1,ze(),En(),Jn()},500),e.nextTick(()=>{o&&Nt(o),Xt();const d=["bold","italic","underline"],u=window.getSelection(),m=u.rangeCount>0?u.getRangeAt(0):null,p=m&&m.collapsed;if(d.forEach(h=>{try{if(p&&ao.value?.command===h){j.value[h]=ao.value.state;return}if(h==="bold")if(m){const x=m.commonAncestorContainer,w=x.nodeType===3?x.parentElement:x;let k=!1;if(w&&((w.tagName==="STRONG"||w.tagName==="B"||w.closest&&w.closest("strong, b"))&&(k=!0),!k&&w.style&&parseInt(w.style.fontWeight)>=600&&(k=!0),!k))try{const T=window.getComputedStyle(w);parseInt(T.fontWeight)>=600&&(k=!0)}catch{}j.value[h]=k}else j.value.hasOwnProperty(h)||(j.value[h]=!1);else if(h==="italic")if(m){const x=m.commonAncestorContainer,w=x.nodeType===3?x.parentElement:x,k=w&&(w.tagName==="EM"||w.tagName==="I"||w.closest&&w.closest("em, i"));j.value[h]=!!k}else{const x=document.queryCommandState(h);j.value[h]=x}else{const x=document.queryCommandState(h);j.value[h]=x}}catch{}}),it(),Yt(),ro(),me(),eo(),Tt("handleRichTextInput"),a&&(l.inputType==="insertText"||l.inputType==="insertCompositionText")){const h=l.data||"";h&&h.length===1&&setTimeout(()=>Jn(h),0),(h===" "||h===`
78
+ `||/[.,;:!?]/.test(h))&&setTimeout(()=>{En()},100)}et.value=!1})},Xt=()=>{if(!g.value)return;const l=window.getSelection();if(!l||l.rangeCount===0)return;const o=l.getRangeAt(0),a=o.commonAncestorContainer,s=a.nodeType===3?a.parentElement:a;if(!s)return;const i=s.closest(".dss-image-wrapper");if(i){const d=i.querySelector("img");if(s!==d&&!d?.contains(s)){const u=o.startContainer.nodeType===3?o.startContainer.parentElement:o.startContainer,m=o.endContainer.nodeType===3?o.endContainer.parentElement:o.endContainer;if(i.contains(u)&&u!==d||i.contains(m)&&m!==d){const p=document.createRange();p.setStartAfter(i),p.collapse(!0),l.removeAllRanges(),l.addRange(p)}}}},gn=()=>{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 s=null;a.forEach(i=>{if(i.nodeType===Node.TEXT_NODE){if((i.textContent||"").trim()===""){i.parentNode===l&&l.removeChild(i);return}s||(s=document.createElement("p"),l.insertBefore(s,i)),s.appendChild(i);return}if(i.nodeType===Node.ELEMENT_NODE){const d=i,u=d.tagName;if(u==="BR"){s=null;return}if(o.has(u)){s=null;return}s||(s=document.createElement("p"),l.insertBefore(s,d)),s.appendChild(d)}})},Yt=()=>{if(g.value&&!ho.value){ho.value=!0;try{g.value.querySelectorAll(".dss-image-wrapper").forEach(s=>{s.querySelector("img")||s.remove()}),g.value.querySelectorAll(".dss-image-no-alt-icon").forEach(s=>{const i=s.parentElement;!i||!i.classList.contains("dss-image-wrapper")?s.remove():i.querySelector("img")||s.remove()}),g.value.querySelectorAll("img").forEach(s=>{let i=s.getAttribute("alt");i===null&&(i=s.alt||"");const d=s.getAttribute("src")||s.src||"";if(i){const h=d.replace(/^https?:\/\//,"").replace(/^data:.*,/,""),x=i===d||i===h;(i.startsWith("http://")||i.startsWith("https://")||i.startsWith("data:")||x||x)&&(i="")}s.setAttribute("alt",i),s.setAttribute("data-alt",i);const u=!i||i.trim()==="";let m=s.parentElement;const p=m&&m.classList.contains("dss-image-wrapper");if(p){const h=m.querySelector(".dss-image-no-alt-icon");h&&h.remove()}else{const h=s.nextElementSibling?.classList.contains("dss-image-no-alt-icon")?s.nextElementSibling:null;h&&h.remove()}if(u){p?m.setAttribute("contenteditable","false"):(m=document.createElement("span"),m.className="dss-image-wrapper",m.setAttribute("contenteditable","false"),s.parentNode.insertBefore(m,s),m.appendChild(s));const h=document.createElement("div");h.className="dss-image-no-alt-icon",h.setAttribute("contenteditable","false"),h.innerHTML=Uo,m.appendChild(h)}else if(p&&m.children.length===1){const h=m.parentNode;h.insertBefore(s,m),h.removeChild(m)}})}finally{ho.value=!1}}},dl=l=>{En(),ie("blur",l),Fo()},yn=()=>{if(S.disabled||!S.richText||!g.value)return;Qe(),te.value&&(clearTimeout(te.value),te.value=null),ve.value&&(ze(),ve.value=!1);const l=Ot.value==="title",o=Ot.value==="description",a=Ot.value==="editor";if(xt.value.length===0){l&&se.value?se.value.focus():o&&Ne.value?Ne.value.focus():g.value.focus(),document.execCommand("undo",!1),e.nextTick(()=>{fe()});return}const s={content:g.value.innerHTML,title:S.title||"",description:S.description||""};lt.value.push(s);const i=xt.value.pop();if(i!==void 0){et.value=!0;const d=typeof i=="string"?i:i.content,u=typeof i=="object"&&i.title||"",m=typeof i=="object"&&i.description||"";g.value.innerHTML=d,$t.value=d,wt.value=u,dt.value=m,tt.value=d,mt.value=u,pt.value=m,e.nextTick(()=>{it(),Le(),to(),me();const p=jo(d);ie("update:modelValue",p),ie("update:title",u),ie("update:description",m),ie("change",p),ie("title-change",u),ie("description-change",m),et.value=!1,e.nextTick(()=>{setTimeout(()=>{if(l){if(se.value){se.value.focus();const h=u.length;se.value.setSelectionRange&&se.value.setSelectionRange(h,h),oe()}}else if(o){if(Ne.value){Ne.value.focus();const h=m.length;Ne.value.setSelectionRange(h,h)}}else if(a)Ko();else if(se.value&&document.activeElement===se.value){const h=u.length;se.value.setSelectionRange&&se.value.setSelectionRange(h,h),oe()}else if(Ne.value&&document.activeElement===Ne.value){const h=m.length;Ne.value.setSelectionRange(h,h)}else g.value&&Ko()},10)})})}},Cn=()=>{if(S.disabled||!S.richText||!g.value)return;Qe();const l=Ot.value==="title",o=Ot.value==="description",a=Ot.value==="editor";if(lt.value.length===0){l&&se.value?se.value.focus():o&&Ne.value?Ne.value.focus():g.value.focus(),document.execCommand("redo",!1),e.nextTick(()=>{fe()});return}const s={content:g.value.innerHTML,title:S.title||"",description:S.description||""};xt.value.push(s);const i=lt.value.pop();if(i!==void 0){et.value=!0;const d=typeof i=="string"?i:i.content,u=typeof i=="object"&&i.title||"",m=typeof i=="object"&&i.description||"";g.value.innerHTML=d,$t.value=d,wt.value=u,dt.value=m,tt.value=d,mt.value=u,pt.value=m,e.nextTick(()=>{it(),Le(),to(),me();const p=jo(d);ie("update:modelValue",p),ie("update:title",u),ie("update:description",m),ie("change",p),ie("title-change",u),ie("description-change",m),et.value=!1,e.nextTick(()=>{setTimeout(()=>{if(l){if(se.value){se.value.focus();const h=u.length;se.value.setSelectionRange&&se.value.setSelectionRange(h,h),oe()}}else if(o){if(Ne.value){Ne.value.focus();const h=m.length;Ne.value.setSelectionRange(h,h)}}else if(a)Ko();else if(se.value&&document.activeElement===se.value){const h=u.length;se.value.setSelectionRange&&se.value.setSelectionRange(h,h),oe()}else if(Ne.value&&document.activeElement===Ne.value){const h=m.length;Ne.value.setSelectionRange(h,h)}else g.value&&Ko()},10)})})}},Go=()=>{if(!g.value)return;g.value.querySelectorAll('span[style*="font-weight"]').forEach(s=>{const i=s.style.fontWeight;if(i==="normal"||i==="400"){const d=document.createDocumentFragment();for(;s.firstChild;)d.appendChild(s.firstChild);s.parentNode&&s.parentNode.replaceChild(d,s)}}),g.value.querySelectorAll('span[style*="font-weight"]').forEach(s=>{if(parseInt(s.style.fontWeight)>=600){const d=document.createElement("b");for(d.style.fontWeight="600";s.firstChild;)d.appendChild(s.firstChild);s.parentNode&&s.parentNode.replaceChild(d,s)}}),g.value.querySelectorAll("b, strong").forEach(s=>{s.style.fontWeight="600"})},ro=()=>{if(!g.value)return;g.value.querySelectorAll("i, em").forEach(o=>{o.style.fontStyle="italic"})},In=()=>{const l=window.getSelection();if(!l||l.rangeCount===0)return!1;const o=l.getRangeAt(0);let a=!1;if(o.collapsed){const s=o.startContainer;let i=s.nodeType===3?s.parentElement:s;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 s=o.commonAncestorContainer.nodeType===1?o.commonAncestorContainer:o.commonAncestorContainer.parentNode;if(s){const i=document.createTreeWalker(s,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let d;for(;d=i.nextNode();)if(!(typeof o.intersectsNode=="function"&&!o.intersectsNode(d))){if(d.nodeType===3){let u=d.parentElement;for(;u&&u!==g.value;){if(u.tagName==="EM"||u.tagName==="I"){a=!0;break}if(u.style&&u.style.fontStyle==="italic"){a=!0;break}u=u.parentElement}}else if(d.nodeType===1){const u=d;if(u.tagName==="EM"||u.tagName==="I"){a=!0;break}if(u.style&&u.style.fontStyle==="italic"){a=!0;break}}if(a)break}}}if(a)return document.execCommand("italic",!1),e.nextTick(()=>{ro()}),!1;if(o.collapsed)document.execCommand("italic",!1),e.nextTick(()=>{ro()});else try{const s=o.extractContents(),i=document.createElement("em");i.style.fontStyle="italic",i.appendChild(s),o.insertNode(i),o.setStartAfter(i),o.collapse(!0),l.removeAllRanges(),l.addRange(o),e.nextTick(()=>{ro()})}catch{document.execCommand("italic",!1),e.nextTick(()=>{ro()})}return!0},ml=()=>{const l=window.getSelection();if(!l||l.rangeCount===0)return!1;const o=l.getRangeAt(0);let a=!1;if(o.collapsed){const s=o.startContainer;let i=s.nodeType===3?s.parentElement:s;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 s=o.commonAncestorContainer.nodeType===1?o.commonAncestorContainer:o.commonAncestorContainer.parentNode;if(s){const i=document.createTreeWalker(s,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let d;for(;d=i.nextNode();)if(!(typeof o.intersectsNode=="function"&&!o.intersectsNode(d))){if(d.nodeType===3){let u=d.parentElement;for(;u&&u!==g.value;){if(u.tagName==="STRONG"||u.tagName==="B"){a=!0;break}if(u.style&&parseInt(u.style.fontWeight)>=600){a=!0;break}u=u.parentElement}}else if(d.nodeType===1){const u=d;if(u.tagName==="STRONG"||u.tagName==="B"){a=!0;break}if(u.style&&parseInt(u.style.fontWeight)>=600){a=!0;break}}if(a)break}}}if(a)return document.execCommand("bold",!1),e.nextTick(()=>{Go()}),!1;if(o.collapsed)document.execCommand("bold",!1),e.nextTick(()=>{const s=window.getSelection();if(s.rangeCount>0){const i=s.getRangeAt(0),d=i.startContainer;let u=d.nodeType===3?d.parentElement:d;for(;u&&u!==g.value;){if(u.tagName==="SPAN"&&u.style.fontWeight){const m=u.style.fontWeight;if(m==="normal"||m==="400"){const p=document.createElement("b");p.style.fontWeight="600";const h=document.createDocumentFragment();for(;u.firstChild;)h.appendChild(u.firstChild);p.appendChild(h),u.parentNode&&u.parentNode.replaceChild(p,u),i.setStart(p,0),i.collapse(!0),s.removeAllRanges(),s.addRange(i);break}}else if(u.tagName==="STRONG"||u.tagName==="B"){u.style.fontWeight="600";break}u=u.parentElement}if(!u||u===g.value){const m=document.createElement("b");m.style.fontWeight="600",m.innerHTML="<br>",i.insertNode(m),i.setStart(m,0),i.collapse(!0),s.removeAllRanges(),s.addRange(i)}}Go()});else try{const s=o.extractContents(),i=document.createElement("b");i.style.fontWeight="600",i.appendChild(s),o.insertNode(i),o.setStartAfter(i),o.collapse(!0),l.removeAllRanges(),l.addRange(o),e.nextTick(()=>{Go()})}catch{document.execCommand("bold",!1),e.nextTick(()=>{Go()})}return!0},at=(l,o=null)=>{if(S.disabled||!S.richText||!g.value)return;ve.value?(te.value&&(clearTimeout(te.value),te.value=null),ze(),ve.value=!1):ze(),Qe(),g.value.focus();const a=window.getSelection();let s=null;if(a&&a.rangeCount>0){const d=a.getRangeAt(0);!d.collapsed&&ko(d)&&(s=ft())}if(l==="createLink"&&o){const d=window.getSelection();if(d.rangeCount>0){const u=d.getRangeAt(0);if(u.collapsed)try{u.expand("word")}catch{const p=document.createTextNode(o);u.insertNode(p),u.selectNodeContents(p)}}}if(l==="bold"){const d=ml();j.value.bold=d;const u=window.getSelection();u.rangeCount>0&&u.getRangeAt(0).collapsed&&(ao.value={command:"bold",state:d}),e.nextTick(()=>{s&&(Nt(s),e.nextTick(()=>{const m=st("bold");j.value.bold=m})),fe(),Le(),me()});return}if(l==="italic"){const d=In();j.value.italic=d;const u=window.getSelection();u.rangeCount>0&&u.getRangeAt(0).collapsed&&(ao.value={command:"italic",state:d}),e.nextTick(()=>{s&&(Nt(s),e.nextTick(()=>{const m=st("italic");j.value.italic=m})),fe(),ro(),Le(),me()});return}let i=!1;try{i=document.execCommand(l,!1,o)}catch{}e.nextTick(()=>{if(s&&Nt(s),["bold","italic","underline"].includes(l))try{if(l==="bold")s&&e.nextTick(()=>{const u=st("bold");j.value.bold=u});else if(l==="italic")if(s)e.nextTick(()=>{const u=st("italic");j.value.italic=u});else{const u=document.queryCommandState(l);j.value[l]=u}else{const u=document.queryCommandState(l);j.value[l]=u}}catch{j.value.hasOwnProperty(l)?j.value[l]=!j.value[l]:j.value[l]=!0}if(l==="createLink"&&o){const u=window.getSelection();if(u.rangeCount>0){const p=u.getRangeAt(0),h=p.commonAncestorContainer.nodeType===1?p.commonAncestorContainer.closest("a"):p.commonAncestorContainer.parentElement?.closest("a");h&&(!h.getAttribute("href")||h.getAttribute("href")==="")&&h.setAttribute("href",o)}g.value.querySelectorAll("a").forEach(p=>{const h=p.getAttribute("href");(!h||h===""||h==="#")&&p.setAttribute("href",o)})}fe(),Le(),me()})},st=(l,o=null)=>{if(S.disabled||!g.value)return!1;try{if(l==="formatBlock"&&o){const s=document.queryCommandValue("formatBlock");if(o==="<blockquote>"){const i=s.toLowerCase();if(i==="blockquote"||i==="<blockquote>")return!0;const d=window.getSelection();if(d.rangeCount>0){const m=d.getRangeAt(0).commonAncestorContainer;return!!(m.nodeType===1?m.tagName==="BLOCKQUOTE"?m:m.closest("blockquote"):m.parentElement?.closest("blockquote"))}}return s===o||s.toLowerCase()===o.toLowerCase()}if(["bold","italic","underline"].includes(l))try{const s=window.getSelection();if(s.rangeCount>0){const i=s.getRangeAt(0);if(l==="bold"){let u=!1;if(i.collapsed){const m=i.commonAncestorContainer,p=m.nodeType===3?m.parentElement:m;if(p&&((p.tagName==="STRONG"||p.tagName==="B"||p.closest&&p.closest("strong, b"))&&(u=!0),!u&&p.style&&parseInt(p.style.fontWeight)>=600&&(u=!0),!u))try{const h=window.getComputedStyle(p);parseInt(h.fontWeight)>=600&&(u=!0)}catch{}return j.value.hasOwnProperty(l)?j.value[l]:(j.value[l]=u,u)}else{const m=i.commonAncestorContainer.nodeType===1?i.commonAncestorContainer:i.commonAncestorContainer.parentNode;let p=!1;if(m){const h=document.createTreeWalker(m,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let x;for(;x=h.nextNode();)if(!(typeof i.intersectsNode=="function"&&!i.intersectsNode(x))){if(x.nodeType===3){if(!(x.textContent||"").trim())continue;p=!0;let k=x.parentElement;for(;k&&k!==g.value;){if(k.tagName==="STRONG"||k.tagName==="B"){u=!0;break}if(k.style&&parseInt(k.style.fontWeight)>=600){u=!0;break}k=k.parentElement}}else if(x.nodeType===1){const w=x;if(w.tagName==="STRONG"||w.tagName==="B"){u=!0;break}if(w.style&&parseInt(w.style.fontWeight)>=600){u=!0;break}}if(u)break}}return j.value[l]=u&&p,u&&p}}if(l==="italic"){let u=!1;if(i.collapsed){const m=i.commonAncestorContainer,p=m.nodeType===3?m.parentElement:m;if(p&&((p.tagName==="EM"||p.tagName==="I"||p.closest&&p.closest("em, i"))&&(u=!0),!u&&p.style&&p.style.fontStyle==="italic"&&(u=!0),!u))try{window.getComputedStyle(p).fontStyle==="italic"&&(u=!0)}catch{}return j.value.hasOwnProperty(l)?j.value[l]:(j.value[l]=u,u)}else{const m=i.commonAncestorContainer.nodeType===1?i.commonAncestorContainer:i.commonAncestorContainer.parentNode;let p=!1;if(m){const h=document.createTreeWalker(m,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let x;for(;x=h.nextNode();)if(!(typeof i.intersectsNode=="function"&&!i.intersectsNode(x))){if(x.nodeType===3){if(!(x.textContent||"").trim())continue;p=!0;let k=x.parentElement;for(;k&&k!==g.value;){if(k.tagName==="EM"||k.tagName==="I"){u=!0;break}if(k.style&&k.style.fontStyle==="italic"){u=!0;break}k=k.parentElement}}else if(x.nodeType===1){const w=x;if(w.tagName==="EM"||w.tagName==="I"){u=!0;break}if(w.style&&w.style.fontStyle==="italic"){u=!0;break}}if(u)break}}return j.value[l]=u&&p,u&&p}}const d=document.queryCommandState(l);return i.collapsed&&j.value.hasOwnProperty(l)?j.value[l]:(j.value[l]=d,d)}return j.value.hasOwnProperty(l)?j.value[l]:!1}catch{return j.value.hasOwnProperty(l)?j.value[l]:!1}try{return document.queryCommandState(l)}catch{return!1}}catch{return!1}},_n=l=>{S.disabled||!S.richText||(Re.value=Re.value===l?null:l,l==="askAi"&&(At.value=null))},Qe=()=>{Re.value=null,rt.value=null},jt=l=>{at("formatBlock",l),Qe()},pl=l=>{if(!l||!g.value)return l;const o=L=>{let F=L.nodeType===Node.TEXT_NODE?L.parentElement:L;for(;F&&F!==g.value;){const Q=F.tagName;if(Q==="P"){const Pe=F.parentElement;if(Pe===g.value||Pe.tagName==="BLOCKQUOTE")return F}if(Q==="BLOCKQUOTE")break;F=F.parentElement}return null},a=o(l.startContainer),s=o(l.endContainer);if(!a||!s)return l;const i=[],d=document.createTreeWalker(g.value,NodeFilter.SHOW_ELEMENT,{acceptNode:L=>{const F=L.tagName;if(F==="P"){const Q=L.parentElement;if(Q===g.value||Q.tagName==="BLOCKQUOTE")return NodeFilter.FILTER_ACCEPT}return F==="BLOCKQUOTE"?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_SKIP}});let u;for(;u=d.nextNode();)i.push(u);const m=i.indexOf(a),p=i.indexOf(s);if(m===-1||p===-1)return l;const h=Math.min(m,p),x=Math.max(m,p),w=i.slice(h,x+1);if(w.length===0)return l;const k=w[0],T=w[w.length-1],B=document.createRange();return B.setStartBefore(k),B.setEndAfter(T),B},Io=()=>{if(S.disabled||!S.richText||!g.value)return;ve.value?(te.value&&(clearTimeout(te.value),te.value=null),ze(),ve.value=!1):ze(),Qe(),g.value.focus();const l=window.getSelection();if(l.rangeCount===0)return;let o=l.getRangeAt(0);!o.collapsed&&ko(o)&&(o=pl(o),l.removeAllRanges(),l.addRange(o));let a=null;!o.collapsed&&ko(o)&&(a=ft());const s=o.commonAncestorContainer,i=s.nodeType===1?s.tagName==="BLOCKQUOTE"?s:s.closest("blockquote"):s.parentElement?.closest("blockquote");if(!!(i&&g.value.contains(i))){if(i){const u=i.parentNode;Array.from(i.childNodes).forEach(p=>{if(p.nodeType===Node.ELEMENT_NODE)if(p.tagName==="P"||p.tagName==="DIV")u.insertBefore(p,i);else{const h=document.createElement("p");h.appendChild(p.cloneNode(!0)),u.insertBefore(h,i)}else if(p.nodeType===Node.TEXT_NODE&&p.textContent.trim()){const h=document.createElement("p");h.appendChild(p.cloneNode(!0)),u.insertBefore(h,i)}}),i.remove()}}else if(o.collapsed)document.execCommand("formatBlock",!1,"<blockquote>");else{const u=document.createElement("blockquote"),m=o.extractContents();u.appendChild(m),o.insertNode(u);const p=[],h=document.createTreeWalker(u,NodeFilter.SHOW_TEXT,{acceptNode:k=>k.parentNode===u&&k.textContent.trim()?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});let x;for(;x=h.nextNode();)p.push(x);if(p.forEach(k=>{const T=document.createElement("p");k.parentNode.insertBefore(T,k),T.appendChild(k)}),u.querySelectorAll("p, div").forEach(k=>{k.textContent.trim()===""&&!k.querySelector("img")&&(k.innerHTML="<br>")}),u.children.length===0&&u.textContent.trim()===""){const k=document.createElement("p");k.innerHTML="<br>",u.appendChild(k)}}e.nextTick(()=>{a&&Nt(a),to(),fe(),me()})},kn=()=>{if(!g.value)return;const l=window.getSelection();if(l.rangeCount===0)return;const a=l.getRangeAt(0).commonAncestorContainer,s=a.nodeType===1?a.tagName==="BLOCKQUOTE"?a:a.closest("blockquote"):a.parentElement?.closest("blockquote");if(!s||!g.value.contains(s))return;const i=x=>{if(!x)return!1;const w=x.textContent||"",T=(x.innerHTML||"").trim();return w.trim()===""||T===""||T==="<br>"||T==="<br/>"||T==="<p></p>"||T==="<p><br></p>"||T==="<p><br/></p>"||T==="<p> </p>"||T==="<p><br> </p>"||T==="<div></div>"||T==="<div><br></div>"||T==="<div><br/></div>"};let d=null;for(a.nodeType===3?d=a.parentElement:a.tagName==="P"||a.tagName==="DIV"?d=a:d=a.closest("p, div"),d&&s.contains(d)&&i(d)&&d.remove();s.lastChild;){const x=s.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(s.children.length>0)for(let x=s.children.length-1;x>=0;x--){const w=s.children[x];if((w.tagName==="P"||w.tagName==="DIV")&&i(w))w.remove();else break}let u=s.innerHTML;const m=u;u=u.replace(/(<br\s*\/?>)+$/gi,""),u!==m&&(s.innerHTML=u);const p=document.createElement("p");p.innerHTML="<br>",s.parentNode?s.nextSibling?s.parentNode.insertBefore(p,s.nextSibling):s.parentNode.appendChild(p):g.value&&g.value.appendChild(p);const h=document.createRange();h.selectNodeContents(p),h.collapse(!0),l.removeAllRanges(),l.addRange(h),e.nextTick(()=>{to(),fe()})},Le=()=>{if(!g.value){ct.value=!1;return}try{const l=window.getSelection();if(l.rangeCount>0){const a=l.getRangeAt(0).commonAncestorContainer,s=a.nodeType===1?a.closest("a"):a.parentElement?.closest("a");ct.value=!!s}else ct.value=!1}catch{ct.value=!1}},Rn=()=>{if(!g.value)return;const l=window.getSelection();l&&l.rangeCount>0&&l.getRangeAt(0),je.value=ft();const o=window.getSelection();let a="";o.rangeCount>0&&(a=o.getRangeAt(0).toString()),$.value="",Ye.value=a,ae.value="",He.value=null,yt.value=!0,Qe(),e.nextTick(()=>{Ht.value&&Ht.value.focus()})},Fn=()=>{if(!g.value)return;ve.value?(te.value&&(clearTimeout(te.value),te.value=null),ze(),ve.value=!1):ze();const l=window.getSelection();let o=null;if(l.rangeCount>0){const s=l.getRangeAt(0).commonAncestorContainer;o=s.nodeType===1?s.closest("a"):s.parentElement?.closest("a")}if(!o&&He.value&&(o=He.value),o&&o.parentNode){const a=document.createDocumentFragment();for(;o.firstChild;)a.appendChild(o.firstChild);if(o.parentNode.replaceChild(a,o),a.firstChild){const s=document.createRange();s.setStartBefore(a.firstChild),s.setEndAfter(a.lastChild||a.firstChild),l.removeAllRanges(),l.addRange(s),document.execCommand("removeFormat",!1),s.collapse(!1),l.removeAllRanges(),l.addRange(s)}He.value=null}else at("unlink");ct.value=!1,Qe(),e.nextTick(()=>{fe(),Le()})},zn=()=>{S.disabled||!S.richText||g.value&&(ve.value?(te.value&&(clearTimeout(te.value),te.value=null),ze(),ve.value=!1):ze(),Qe(),g.value.focus(),document.execCommand("insertUnorderedList",!1),e.nextTick(()=>{it(),fe(),me()}))},Pn=()=>{S.disabled||!S.richText||g.value&&(ve.value?(te.value&&(clearTimeout(te.value),te.value=null),ze(),ve.value=!1):ze(),Qe(),g.value.focus(),document.execCommand("insertOrderedList",!1),e.nextTick(()=>{it(),fe(),me()}))},On=l=>{const o=l.parentElement;if(!o||o.tagName!=="OL")return null;let a=0,s=l.previousElementSibling;for(;s;)s.tagName==="LI"&&a++,s=s.previousElementSibling;return a+1},it=()=>{if(!g.value)return;g.value.querySelectorAll("li > ol").forEach(o=>{const a=o.parentElement;if(a&&a.tagName==="LI"){const s=On(a);s!==null&&Array.from(o.children).filter(d=>d.tagName==="LI").forEach(d=>{d.setAttribute("data-parent-num",String(s))})}})},Zn=()=>{if(S.disabled||!S.richText||!g.value)return;Qe(),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(()=>{it(),fe()});return}const s=a.parentElement;if(!s||s.tagName!=="OL"&&s.tagName!=="UL")return;const i=a.previousElementSibling;if(i&&i.tagName==="LI"){const d=s.tagName.toLowerCase();let u=i.querySelector(`:scope > ${d}`);u||(u=document.createElement(d),i.appendChild(u));const m=On(i);u.appendChild(a),m!==null&&s.tagName==="OL"&&a.setAttribute("data-parent-num",String(m)),it();const p=document.createRange();p.selectNodeContents(a),p.collapse(!1),l.removeAllRanges(),l.addRange(p),e.nextTick(()=>{fe(),me()})}else document.execCommand("indent",!1),e.nextTick(()=>{it(),fe(),me()})},Wn=()=>{if(S.disabled||!S.richText||!g.value)return;Qe(),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(()=>{it(),fe()});return}const s=a.parentElement;if(!s||s.tagName!=="OL"&&s.tagName!=="UL")return;const i=s.parentElement;if(i&&i.tagName==="LI"){const d=i.parentElement;if(d&&(d.tagName==="OL"||d.tagName==="UL")){s.tagName==="OL"&&a.removeAttribute("data-parent-num"),d.insertBefore(a,i.nextSibling),s.children.length===0&&s.remove(),it();const u=document.createRange();u.selectNodeContents(a),u.collapse(!1),l.removeAllRanges(),l.addRange(u),e.nextTick(()=>{fe(),me()});return}}document.execCommand("outdent",!1),e.nextTick(()=>{it(),fe(),me()})},qe=e.ref(null),Kt=e.ref(null),Mo=e.ref({}),Gt=e.ref(""),Mt=e.ref(null),io=e.ref("");e.ref("");const _t=e.ref(null);e.ref("");const $e=e.ref([]),E=e.ref(!1),De=e.ref(!1),Bt=l=>{if(!l)return"";const o=l.cloneRange(),a=document.createElement("div");return a.appendChild(o.cloneContents()),a.innerHTML},vt=()=>{if(S.disabled||!S.richText||!g.value)return;if(qe.value!==null){qe.value=null,Gt.value="",io.value="",_t.value=null,$e.value=[],wo(!0);return}Qe(),g.value.focus();const l=window.getSelection();if(!l||l.rangeCount===0)return;const o=l.getRangeAt(0);if(o.collapsed||!ko(o))return;io.value=Bt(o)||"",_t.value=ft();const a=o.getBoundingClientRect(),s=g.value.parentElement;if(!s)return;const i=s.getBoundingClientRect(),d=a.bottom-i.top,m=Math.max(d+8,0);Mo.value={top:`${m}px`,bottom:"auto"},qe.value=Date.now(),e.nextTick(()=>{if(Gt.value="",Mt.value){const h=Mt.value;h.style.height="auto",h.style.height=`${h.scrollHeight}px`,h.focus()}const p=s.querySelector(".dss-comment-overlay");if(p&&s){const h=s.querySelector(".dss-text-editor-footer");if(h){const x=s.getBoundingClientRect(),w=p.getBoundingClientRect(),k=h.getBoundingClientRect(),T=w.bottom-x.top,B=k.top-x.top,L=8;if(T>B-L){const F=k.height;Mo.value={bottom:`${F+L}px`,top:"auto"}}else Mo.value={top:`${m}px`,bottom:"auto"}}}})},Jt=()=>{if(!Gt.value.trim())return;const l=Gt.value.trim(),o=new Date,a={text:l,selectionText:io.value,selectionRange:_t.value,commentId:qe.value,user:S.commentUser||null,createdAt:o.toISOString()};$e.value=[...$e.value,a],ie("comment-submitted",a),Ve(a),_t.value&&!Xe(_t.value)&&yo(qe.value,_t.value),Gt.value="",e.nextTick(()=>{if(Mt.value){const s=Mt.value;s.style.height="auto",s.style.height=`${s.scrollHeight}px`,s.focus()}Tt("sendComment")})},Be=(l,o)=>{if(!(!S.commentUser||!l.user||l.user.id!==S.commentUser.id)){if($e.value=$e.value.filter((a,s)=>s!==o),qe.value!==null&&g.value){const a=String(qe.value),s=g.value.querySelector(`[data-comment="${a}"], [data-fake-comment="${a}"]`);if(s&&$e.value.length>0){const i=[],d=new Set;$e.value.forEach(u=>{u.user&&u.user.id&&!d.has(u.user.id)&&(d.add(u.user.id),i.push(u.user))}),i.length>0?s.setAttribute("data-comment-user",JSON.stringify(i[0])):s.removeAttribute("data-comment-user"),i.length>1?s.setAttribute("data-comment-user-2",JSON.stringify(i[1])):s.removeAttribute("data-comment-user-2"),s.setAttribute("data-comment-count",String($e.value.length))}else s&&$e.value.length===0&&(s.removeAttribute("data-comment-user"),s.removeAttribute("data-comment-user-2"),s.setAttribute("data-comment-count","0"))}if(ie("comment-deleted",{comment:l,index:o,commentId:qe.value}),S.comments&&Array.isArray(S.comments)){const a=S.comments.filter(s=>!(s.commentId===l.commentId&&s.text===l.text&&s.user?.id===l.user?.id));ie("update:comments",a)}e.nextTick(()=>{Tt("deleteComment")})}},Xe=l=>{if(!l||!g.value)return!1;try{const o=Qt(l);if(!o)return!1;const a=o.commonAncestorContainer,s=a.nodeType===3?a.parentElement:a;if(s)return!!s.closest("[data-comment], [data-fake-comment]")}catch{}return!1},Qt=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 s=[g.value];let i=null,d=!1,u=!1;for(;!u&&(i=s.pop());)if(i.nodeType===3){const m=a+i.length;!d&&l.start>=a&&l.start<=m&&(o.setStart(i,l.start-a),d=!0),d&&l.end>=a&&l.end<=m&&(o.setEnd(i,l.end-a),u=!0),a=m}else{let m=i.childNodes.length;for(;m--;)s.push(i.childNodes[m])}return d?o:null}catch{return null}},yo=(l,o)=>{if(!(!l||!o||!g.value))try{const a=Qt(o);if(!a||a.collapsed)return;const s=a.commonAncestorContainer,i=s.nodeType===3?s.parentElement:s;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 d=document.createElement("span");d.setAttribute("data-comment",String(l));try{const m=a.startContainer,p=a.endContainer,h=a.startOffset,x=a.endOffset,w=m.nodeType===3?m.parentNode:m,k=p.nodeType===3?p.parentNode:p;if(w===k&&h===0&&x===(p.nodeType===3?p.length:k.childNodes.length)&&(w.tagName==="P"||w.tagName==="DIV"||w.tagName==="H1"||w.tagName==="H2"||w.tagName==="H3"||w.tagName==="H4"||w.tagName==="H5"||w.tagName==="H6")){const B=a.extractContents();d.appendChild(B),a.insertNode(d)}else a.surroundContents(d)}catch{const p=a.extractContents();d.appendChild(p),a.insertNode(d)}const u=g.value.querySelector(`[data-comment="${String(l)}"]`);e.nextTick(()=>{Tt("wrapSelectionWithCommentMarker"),fe()})}catch{}},Ve=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 s=o.findIndex(d=>typeof d.conversation_id=="string"&&d.conversation_id.startsWith("comment-")?null:Number(d.conversation_id)===Number(a)||d.conversation_id===a);const i={text:l.text,user:l.user,createdAt:l.createdAt,created_at:l.createdAt,updated_at:l.createdAt};if(s>=0){const d=o[s];if(d.conversation||(d.conversation=[]),d.conversation.push(i),d.updated_at=l.createdAt,!d.article_id&&o.length>0){const u=o.find(m=>m.article_id);u&&(d.article_id=u.article_id)}}else{const d=l.selectionRange,u=o.length>0&&o.find(p=>p.article_id)?.article_id||null,m={conversation_id:a,article_id:u,selection_range:d?{start:d.start||0,end:d.end||0,type:d.type||"text"}:null,selection_text:l.selectionText||"",conversation:[i],created_by_user:l.user,created_at:l.createdAt,updated_at:l.createdAt,status:"active"};o.push(m)}E.value=!0,ie("update:comments",o)},Se=(l,o=[])=>{if(S.disabled||!S.richText||!g.value)return;const a=g.value;let s=null;try{s=a.querySelector(l)}catch{return}if(!s)return;Qe(),a.focus();const i=document.createRange();i.selectNodeContents(s);const d=window.getSelection();d&&(d.removeAllRanges(),d.addRange(i)),io.value=s.innerHTML||"",_t.value=ft();const u=i.getBoundingClientRect(),m=a.parentElement;if(m){const x=m.getBoundingClientRect(),w=u.bottom-x.top,T=Math.max(w+8,0);Mo.value={top:`${T}px`,bottom:"auto"}}const p=s.getAttribute("data-comment")||s.getAttribute("data-fake-comment");let h=[];if(p&&S.comments&&Array.isArray(S.comments)){const x=S.comments.find(w=>String(w.conversation_id)===String(p));if(x&&x.conversation&&Array.isArray(x.conversation)){const w=x.conversation.map(k=>({id:k.id||k.commentary_id,commentary_id:k.id||k.commentary_id,conversation_id:x.id||x.conversation_id,text:k.text,user:k.user,createdAt:k.created_at||k.createdAt,updated_at:k.updated_at||k.updatedAt}));h.push(...w)}}h.length===0&&Array.isArray(o)&&o.length>0&&(h=o.slice()),h.sort((x,w)=>{const k=L=>{if(!L)return 0;const F=new Date(L).getTime();return isNaN(F)?0:F},T=k(x.createdAt),B=k(w.createdAt);return T===B?0:T-B}),$e.value=h,wo(!0),qe.value=p||null,s&&(Kt.value=s,s.classList.add("editor-comment-highlighted")),e.nextTick(()=>{if(Gt.value="",Mt.value){const x=Mt.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 w=m.querySelector(".dss-text-editor-footer");if(w){const k=m.getBoundingClientRect(),T=x.getBoundingClientRect(),B=w.getBoundingClientRect(),L=T.bottom-k.top,F=B.top-k.top,Q=8;if(L>F-Q){const Pe=B.height;Mo.value={bottom:`${Pe+Q}px`,top:"auto"}}}}}Tt("openCommentOverlayForSelector")})},ce=e.ref(null),ot=e.ref(0),_o=l=>{if(!(S.disabled||!S.richText)){if(l.key==="Escape"){const o=window.getSelection();if(o.rangeCount>0){const s=o.getRangeAt(0).commonAncestorContainer,i=s.nodeType===1?s.tagName==="BLOCKQUOTE"?s:s.closest("blockquote"):s.parentElement?.closest("blockquote");if(!!(i&&g.value&&g.value.contains(i))){l.preventDefault();let u=null;s.nodeType===3?u=s.parentElement:s.tagName==="P"||s.tagName==="DIV"?u=s:u=s.closest("p, div");const m=document.createElement("p");m.innerHTML="<br>",u&&i.contains(u)&&u.nextSibling?i.insertBefore(m,u.nextSibling):i.appendChild(m),setTimeout(()=>{kn()},50);return}}}if(l.key.length===1||l.key==="Enter"){const o=window.getSelection();if(o&&o.rangeCount>0){const a=o.getRangeAt(0),s=a.commonAncestorContainer,i=s.nodeType===3?s.parentElement:s;if(i){const d=i.closest(".dss-image-wrapper");if(d){const u=d.querySelector("img");if(i!==u&&!u?.contains(i)){const m=a.startContainer.nodeType===3?a.startContainer.parentElement:a.startContainer,p=a.endContainer.nodeType===3?a.endContainer.parentElement:a.endContainer;if(d.contains(m)&&m!==u||d.contains(p)&&p!==u){l.preventDefault();const h=document.createRange();h.setStartAfter(d),h.collapse(!0),o.removeAllRanges(),o.addRange(h);return}}}}}}if(l.key==="Backspace"||l.key==="Delete"){const o=window.getSelection();if(o.rangeCount>0){const a=o.getRangeAt(0);let s=null,i=null;if(a.collapsed)if(l.key==="Backspace"){const d=a.startContainer;let u=d;d.nodeType===3&&(a.startOffset===0?u=d.previousSibling||d.parentNode:u=d.parentNode);const m=u.previousSibling;m&&(m.classList&&m.classList.contains("dss-image-wrapper")?i=m:m.tagName==="IMG"&&(s=m,i=s.closest(".dss-image-wrapper"))),i||(i=u.closest(".dss-image-wrapper"),i&&(s=i.querySelector("img")))}else{const d=a.startContainer;let u=d;d.nodeType===3&&(a.startOffset===d.length?u=d.nextSibling||d.parentNode:u=d.parentNode);const m=u.nextSibling;m&&(m.classList&&m.classList.contains("dss-image-wrapper")?i=m:m.tagName==="IMG"&&(s=m,i=s.closest(".dss-image-wrapper"))),i||(i=u.closest(".dss-image-wrapper"),i&&(s=i.querySelector("img")))}else{const d=a.commonAncestorContainer,u=a.startContainer.nodeType===3?a.startContainer.parentElement:a.startContainer,m=a.endContainer.nodeType===3?a.endContainer.parentElement:a.endContainer;if(d.nodeType===1&&d.tagName==="IMG"?(s=d,i=s.closest(".dss-image-wrapper")):(s=d.querySelector("img"),s&&(i=s.closest(".dss-image-wrapper"))),i){const p=i.contains(u)||u===i,h=i.contains(m)||m===i,w=a.cloneContents().textContent?.trim()||"",k=i.textContent?.trim()||"";(!p||!h||w.length>k.length)&&(i=null,s=null)}}if(i){l.preventDefault(),l.stopPropagation();const d=i.parentNode;if(d){const u=document.createTextNode("");d.insertBefore(u,i),i.remove();const m=document.createRange();m.setStartAfter(u),m.collapse(!0),o.removeAllRanges(),o.addRange(m),e.nextTick(()=>{fe()});return}}}}if(l.key==="Tab"){l.preventDefault(),l.shiftKey?Wn():Zn();return}if(l.key==="Enter"){const o=window.getSelection();if(o.rangeCount>0){const a=o.getRangeAt(0);if(a.collapsed){const u=a.startContainer,m=p=>{if(!p)return!1;let h=p.previousSibling;for(;h;){if(h.classList&&h.classList.contains("dss-image-wrapper")||h.tagName==="IMG"||h.querySelector&&h.querySelector(".dss-image-wrapper")||h.querySelector&&h.querySelector("img"))return!0;h=h.previousSibling}const x=p.parentElement;return x&&x!==g.value?m(x):!1};if(u.nodeType===3){const p=u.parentElement;if(p&&(m(p)||m(u))){const h=p.closest("p, div");if(h&&h!==g.value){l.preventDefault(),l.stopPropagation();let x=null;const w=a.startOffset;w<u.length&&(x=u.splitText(w));const k=document.createElement("p");if(x?k.appendChild(x):k.innerHTML="<br>",u.length===0){const B=u.parentElement;B&&(B.removeChild(u),B.childNodes.length===0&&B.appendChild(document.createElement("br")))}h.nextSibling?h.parentNode.insertBefore(k,h.nextSibling):h.parentNode.appendChild(k);const T=document.createRange();x?T.setStart(x,0):T.setStart(k,0),T.collapse(!0),o.removeAllRanges(),o.addRange(T),e.nextTick(()=>{fe()});return}}}}const s=a.commonAncestorContainer,i=s.nodeType===1?s.tagName==="BLOCKQUOTE"?s:s.closest("blockquote"):s.parentElement?.closest("blockquote");if(!!(i&&g.value&&g.value.contains(i))){let u=null;s.nodeType===3?u=s.parentElement:s.tagName==="P"||s.tagName==="DIV"?u=s:u=s.closest("p, div");const m=B=>{if(!B)return!1;const L=B.textContent||"",Q=(B.innerHTML||"").trim(),Pe=Q.replace(/<br\s*\/?>/gi,"").trim();return L.trim()===""||Q===""||Pe===""||Q==="<br>"||Q==="<br/>"||Q==="<p></p>"||Q==="<p><br></p>"||Q==="<p><br/></p>"||Q==="<p> </p>"||Q==="<p><br> </p>"||Q==="<div></div>"||Q==="<div><br></div>"||Q==="<div><br/></div>"},p=i.lastChild,h=p&&p.nodeType===1&&p.tagName==="BR",x=a.startContainer,w=x.nodeType===3?x.parentElement:x,k=w===i||w&&w.parentElement===i;if(u&&m(u)||h&&k){l.preventDefault(),setTimeout(()=>{kn()},50);return}}}}if(l.key===" "){const o=Date.now(),a=o-ot.value;if(ce.value===" "&&a<300){const s=window.getSelection();if(s.rangeCount>0){const i=s.getRangeAt(0),d=i.commonAncestorContainer.nodeType===1?i.commonAncestorContainer.closest("li"):i.commonAncestorContainer.parentElement?.closest("li");if(d){const u=i.startContainer.textContent?.substring(0,i.startOffset)||"";if((d.textContent||"").indexOf(u.trim())<=10||u.trim().length<=2){l.preventDefault(),Zn();return}}}}ce.value=" ",ot.value=o}else ce.value=l.key}},Un=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,"")),ze();const s=window.getSelection();let i=null;if(s&&s.rangeCount>0){let m=s.getRangeAt(0).commonAncestorContainer;m.nodeType===3&&(m=m.parentNode),i=m.closest("p, h1, h2, h3, h4, h5, h6, li, blockquote")}const d=u=>{const p=new DOMParser().parseFromString(u,"text/html");let h=g.value.querySelector("h1")?1:0;if(p.querySelectorAll("h1").forEach(w=>{if(h>0){const k=p.createElement("p");k.innerHTML=w.innerHTML,w.parentNode.replaceChild(k,w)}else h++}),i){const w=["P","H1","H2","H3","H4","H5","H6","DIV","BLOCKQUOTE","UL","OL","LI"],k=Array.from(p.body.children).filter(T=>w.includes(T.tagName));if(k.length===1){const T=k[0].tagName,B=i.tagName,L=i.textContent.trim()===""&&!i.querySelector("img");let F=!1;if(["H1","H2","H3","H4","H5","H6"].includes(B)?F=!0:L||(T===B||T==="P")&&(F=!0),F)return k[0].innerHTML.trim()}}return p.body.innerHTML.trim()};if(o){const u=d(o);document.execCommand("insertHTML",!1,u)}else if(a)if(/<[a-z][\s\S]*>/i.test(a)){const m=d(a);document.execCommand("insertHTML",!1,m)}else document.execCommand("insertText",!1,a);fe()},Ro=l=>{if(Re.value){const a=l.target;!a.closest(".dss-toolbar-dropdown")&&!a.closest(".dss-toolbar-dropdown-toggle")&&Qe()}if(xe.value){const a=l.target,s=a.closest(".dss-floating-toolbar"),i=g.value&&a.closest(".dss-text-editor-content");!s&&!i&&Fo()}if(At.value){const a=l.target,s=a.closest(".dss-floating-toolbar"),i=a.closest(".dss-toolbar-dropdown");!s&&!i&&oo()}const o=l.target;if(!o.closest(".dss-toolbar-dropdown")&&!o.closest(".dss-toolbar-dropdown-submenu")&&(rt.value=null),!g.value||!o.closest(".dss-text-editor-content")){const a=window.getSelection();if(a&&a.rangeCount>0){const s=a.getRangeAt(0);Ue.value=!s.collapsed&&ko(s)}else Ue.value=!1}if(qe.value!==null){const a=document.querySelector(".dss-comment-overlay");let s=!1;if(a){const u=a.getBoundingClientRect(),m=l.clientX,p=l.clientY;s=m>=u.left&&m<=u.right&&p>=u.top&&p<=u.bottom}const i=o.closest(".dss-toolbar-button"),d=i&&i.getAttribute("title")==="Comment";!s&&!d&&(qe.value=null,Gt.value="",io.value="",_t.value=null,$e.value=[],wo(!0))}},Jo=(l,o)=>{l&&l.stopPropagation&&l.stopPropagation(),ut.value&&(clearTimeout(ut.value),ut.value=null),rt.value=o},qn=l=>{const o=l.relatedTarget;if(o){const a=o.closest(".dss-toolbar-dropdown-submenu"),s=o.closest(".dss-toolbar-dropdown-item-has-submenu");if(a||s)return}ut.value&&clearTimeout(ut.value),ut.value=setTimeout(()=>{rt.value=null,ut.value=null},150)},Xn=l=>{rt.value=null};let Co=0;const Yn=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,s)=>{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(h=>h.tagName==="BUTTON"||h.tagName==="DIV").length>0:!1),d=a.nextElementSibling,u=d&&!d.classList.contains("dss-toolbar-dropdown-submenu")&&!d.classList.contains("dss-toolbar-dropdown-item-has-submenu")&&d.tagName==="DIV"&&!d.classList.contains("dss-toolbar-dropdown-item")&&Array.from(d.children).some(m=>m.tagName==="BUTTON"||m.tagName==="DIV");if(i||u){const m=`submenu-auto-${++Co}`;a.classList.add("dss-toolbar-dropdown-item-has-submenu"),a.setAttribute("data-submenu-id",m);let p=null;i?(a.tagName==="BUTTON"&&a.parentNode.insertBefore(i,a.nextSibling),i.classList.add("dss-toolbar-dropdown-submenu"),p=i):u&&(d.classList.add("dss-toolbar-dropdown-submenu"),p=d),p&&(p.setAttribute("data-submenu-id",m),p.setAttribute("data-processed","true"),i&&a.tagName!=="BUTTON"?p.dataset.originalParentRef="inside":p.dataset.originalParentRef="sibling",Array.from(p.children).forEach(x=>{(x.tagName==="BUTTON"||x.tagName==="DIV")&&!x.classList.contains("dss-toolbar-dropdown-item")&&x.classList.add("dss-toolbar-dropdown-item")}))}})},Rt=()=>{document.querySelectorAll(".dss-toolbar-dropdown").forEach(o=>{Yn(o),o.querySelectorAll(".dss-toolbar-dropdown-item-has-submenu").forEach(i=>{const d=i._subMenuHandlers;d&&(i.removeEventListener("mouseenter",d.enter),i.removeEventListener("mouseleave",d.leave));const u=p=>{const h=i.getAttribute("data-submenu-id");h&&Jo(p,h)},m=qn;i.addEventListener("mouseenter",u),i.addEventListener("mouseleave",m),i._subMenuHandlers={enter:u,leave:m}}),o.querySelectorAll(".dss-toolbar-dropdown-submenu").forEach(i=>{const d=i._subMenuHandlers;d&&(i.removeEventListener("mouseenter",d.enter),i.removeEventListener("mouseleave",d.leave));const u=h=>{const x=i.getAttribute("data-submenu-id");x&&Jo(h,x)},m=qn;i.addEventListener("mouseenter",u),i.addEventListener("mouseleave",m),i._subMenuHandlers={enter:u,leave:m},i.querySelectorAll(".dss-toolbar-dropdown-item").forEach(h=>{h.addEventListener("click",Xn)})})})};let Bo=null;const Qo=()=>{if(rt.value){const l=document.querySelector(`.dss-toolbar-dropdown-submenu[data-submenu-id="${rt.value}"]`),o=document.querySelector(`.dss-toolbar-dropdown-item-has-submenu[data-submenu-id="${rt.value}"]`);l&&o&&ll(l,o)}if(xe.value&&me(),S.richText){if(Bo!==null)return;Bo=setTimeout(()=>{Bo=null,Tt("handleWindowResize")},150)}},co=()=>{if(!S.richText)return;document.querySelectorAll(".dss-toolbar-custom-group").forEach(o=>{Array.from(o.children).filter(s=>s.tagName==="DIV"&&!s.classList.contains("dss-toolbar-button")).forEach(s=>{s.classList.add("dss-toolbar-button")})})},fl=()=>{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 s=window.getSelection();s.removeAllRanges?s.removeAllRanges():s.empty&&s.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",s=>{if(window.getSelection){const i=window.getSelection();i.removeAllRanges&&i.removeAllRanges()}})})};e.onMounted(()=>{if(e.nextTick(()=>{requestAnimationFrame(()=>{Et.value?oe():re(),Zt.value?Me():go()})}),e.nextTick(()=>{fl()}),S.richText&&g.value){try{document.execCommand("defaultParagraphSeparator",!1,"p")}catch{}document.addEventListener("click",Ro),window.addEventListener("resize",Qo);let l=null;const o=()=>{l===null&&(l=setTimeout(()=>{l=null,Qo()},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 s=null;const i=()=>{s===null&&(s=setTimeout(()=>{s=null,Qo()},150))};a&&(a.addEventListener("scroll",i),g.value._scrollHandlers={wrapper:null,content:a,handler:i}),e.nextTick(()=>{Rt(),co()}),g.value.addEventListener("click",m=>{const p=m.target;p.closest("a")&&!S.disabled&&m.preventDefault();const x=p.closest(".dss-image-no-alt-icon"),w=p.closest(".dss-image-wrapper");if(x||w&&p===w){m.preventDefault(),m.stopPropagation();const k=window.getSelection(),T=document.createRange();T.setStartAfter(w),T.collapse(!0),k.removeAllRanges(),k.addRange(T)}else w&&p.tagName!=="IMG"&&(m.preventDefault(),e.nextTick(()=>{const k=window.getSelection();if(k.rangeCount>0){const B=k.getRangeAt(0).commonAncestorContainer,L=B.nodeType===3?B.parentElement:B;if(w.contains(L)&&L!==w.querySelector("img")){const F=document.createRange();F.setStartAfter(w),F.collapse(!0),k.removeAllRanges(),k.addRange(F)}}else{const T=document.createRange();T.setStartAfter(w),T.collapse(!0),k.addRange(T)}}))},!0),g.value.addEventListener("mousedown",m=>{const p=m.target,h=p.closest(".dss-image-no-alt-icon"),x=p.closest(".dss-image-wrapper");if(h||x&&p.tagName!=="IMG"){m.preventDefault();const w=window.getSelection(),k=document.createRange();x&&(k.setStartAfter(x),k.collapse(!0),w.removeAllRanges(),w.addRange(k))}},!0),g.value.addEventListener("paste",m=>{e.nextTick(()=>{if(!g.value)return;g.value.querySelectorAll("img").forEach(h=>{if(!h.closest(".dss-image-wrapper"))h.removeAttribute("alt"),h.removeAttribute("data-alt"),h.setAttribute("alt",""),h.setAttribute("data-alt",""),h.alt="";else{const w=h.getAttribute("alt")||h.alt||"";if(w){const k=h.getAttribute("src")||h.src||"",T=k.replace(/^https?:\/\//,"").replace(/^data:.*,/,""),B=w===k||w===T;(w.startsWith("http://")||w.startsWith("https://")||w.startsWith("data:")||B||B)&&(h.setAttribute("alt",""),h.setAttribute("data-alt",""),h.alt="")}}}),Yt()})}),g.value.addEventListener("dragstart",m=>{const p=m.target,h=p.tagName==="IMG"?p:p.closest("img"),x=h?.closest(".dss-image-wrapper");h&&g.value.contains(h)&&(bt.value=x||h,m.dataTransfer.effectAllowed="move",m.dataTransfer.setData("text/html","image-drag"))}),g.value.addEventListener("dragover",m=>{bt.value&&(m.preventDefault(),m.stopPropagation(),m.dataTransfer.dropEffect="move")}),g.value.addEventListener("dragenter",m=>{bt.value&&(m.preventDefault(),m.stopPropagation())}),g.value.addEventListener("drop",m=>{if(!bt.value||!g.value)return;m.preventDefault(),m.stopPropagation();const p=bt.value,h=p.classList?.contains("dss-image-wrapper"),x=h?p.querySelector("img"):p,w=h?p:x?.closest(".dss-image-wrapper");if(!x||!g.value.contains(x)){bt.value=null;return}let k=null;const T=m.clientX,B=m.clientY;if(document.caretRangeFromPoint)k=document.caretRangeFromPoint(T,B);else{const Te=window.getSelection();Te.rangeCount>0?k=Te.getRangeAt(0).cloneRange():(k=document.createRange(),k.selectNodeContents(g.value),k.collapse(!1))}if(!k){bt.value=null;return}const L=k.commonAncestorContainer,F=L.nodeType===3?L.parentElement:L;if(F?.closest(".dss-image-wrapper")===w||w&&w.contains(F)){bt.value=null;return}if(w&&(F===w||w.contains(F))){bt.value=null;return}const Pe=x.getAttribute("src");let Oe=null;w?Oe=w.cloneNode(!0):Oe=x.cloneNode(!0);try{let Te=k.startContainer;if(Te.nodeType===3&&(Te=Te.parentElement),w&&(Te===w||w.contains(Te))){const be=document.createRange();be.setStartAfter(w),be.collapse(!0),k=be}k.insertNode(Oe);const Ie=document.createRange();Ie.setStartAfter(Oe),Ie.collapse(!0);const _e=window.getSelection();_e.removeAllRanges(),_e.addRange(Ie)}catch{if(g.value.childNodes.length===0){const Ie=document.createElement("p");Ie.appendChild(Oe),g.value.appendChild(Ie)}else{const Ie=g.value.lastChild;if(Ie&&Ie.nodeType===1)Ie.appendChild(Oe);else{const _e=document.createElement("p");_e.appendChild(Oe),g.value.appendChild(_e)}}}w?w.remove():x.remove(),bt.value=null,e.nextTick(()=>{const Te=g.value.querySelectorAll("img");let Ie=!1;Te.forEach(_e=>{if(_e.getAttribute("src")===Pe)if(!Ie)Ie=!0;else{const be=_e.closest(".dss-image-wrapper");be?be.remove():_e.remove()}}),Yt(),fe()})}),g.value.addEventListener("dragend",m=>{bt.value=null});let d=null;const u=new MutationObserver(m=>{m.forEach(p=>{p.addedNodes.forEach(h=>{if(h.nodeType===1){h.tagName==="IMG"&&(h.removeAttribute("alt"),h.removeAttribute("data-alt"),h.setAttribute("alt",""),h.setAttribute("data-alt",""),h.alt="");const x=h.querySelectorAll&&h.querySelectorAll("img");x&&x.forEach(w=>{w.removeAttribute("alt"),w.removeAttribute("data-alt"),w.setAttribute("alt",""),w.setAttribute("data-alt",""),w.alt=""})}})}),d&&clearTimeout(d),d=setTimeout(()=>{Yt(),co(),d=null},100)});if(u.observe(g.value,{childList:!0,subtree:!0}),e.nextTick(()=>{const m=document.querySelector(".dss-text-editor-toolbar");if(m){const p=new MutationObserver(()=>{e.nextTick(()=>{co()})});p.observe(m,{childList:!0,subtree:!0}),m._toolbarMutationObserver=p}}),S.modelValue){const m=vn(S.modelValue);g.value.innerHTML=m,gn()}e.nextTick(()=>{const m=g.value.innerHTML||"",p=S.title||"",h=S.description||"";$t.value=m,wt.value=p,dt.value=h,mt.value=p,pt.value=h,it(),Yt(),ro(),eo(),nl(),Vn()}),Le(),to(),g.value._mutationObserver=u}}),e.onUnmounted(()=>{if(document.removeEventListener("click",Ro),window.removeEventListener("resize",Qo),g.value&&g.value._windowScrollHandler&&window.removeEventListener("scroll",g.value._windowScrollHandler,!0),Bo!==null&&(clearTimeout(Bo),Bo=null),g.value&&g.value._windowScrollTimeout!==null&&clearTimeout(g.value._windowScrollTimeout),te.value&&clearTimeout(te.value),ut.value&&clearTimeout(ut.value),g.value&&g.value._mutationObserver&&g.value._mutationObserver.disconnect(),Dt.value&&Dt.value.disconnect(),It.value!==null&&(cancelAnimationFrame(It.value),It.value=null),Ut.value!==null&&(clearTimeout(Ut.value),Ut.value=null),Vt.value!==null&&(clearTimeout(Vt.value),Vt.value=null),wo(!0),g.value&&g.value._scrollHandlers){const{wrapper:o,content:a,handler:s}=g.value._scrollHandlers;o&&o.removeEventListener("scroll",s),a&&a.removeEventListener("scroll",s)}const l=document.querySelector(".dss-text-editor-toolbar");l&&l._toolbarMutationObserver&&l._toolbarMutationObserver.disconnect()});const jn=l=>{const o=l.target,a=o.closest("a");if(a&&!S.disabled){l.preventDefault();const i=document.createRange();i.selectNodeContents(a);const d=window.getSelection();d.removeAllRanges(),d.addRange(i)}const s=o.closest(".dss-image-wrapper");s&&o.tagName!=="IMG"?e.nextTick(()=>{const i=window.getSelection();if(i.rangeCount>0){const u=i.getRangeAt(0).commonAncestorContainer,m=u.nodeType===3?u.parentElement:u;if(s.contains(m)&&m!==s.querySelector("img")){const p=document.createRange();p.setStartAfter(s),p.collapse(!0),i.removeAllRanges(),i.addRange(p)}}Yt(),Le(),to(),me(),eo()}):e.nextTick(()=>{Yt(),Le(),to(),me(),eo()})},Kn=()=>{Xt();const l=window.getSelection();if(l&&l.rangeCount>0){const a=l.getRangeAt(0);Ue.value=!a.collapsed&&ko(a),!a.collapsed&&ao.value&&(ao.value=null)}else Ue.value=!1;if(Yt(),Le(),to(),me(),eo(),l&&l.rangeCount>0){const s=l.getRangeAt(0).commonAncestorContainer,i=s.nodeType===3?s.parentElement:s;if(i&&i.closest(".dss-text-editor-footer")){l.removeAllRanges(),Ue.value=!1;return}}["bold","italic","underline"].forEach(a=>{try{const s=window.getSelection();if(s.rangeCount>0){const i=s.getRangeAt(0);if(!i.collapsed)if(a==="bold"){const d=i.commonAncestorContainer,u=d.nodeType===3?d.parentElement:d;let m=!1;if(u&&((u.tagName==="STRONG"||u.tagName==="B"||u.closest&&u.closest("strong, b"))&&(m=!0),!m&&u.style&&parseInt(u.style.fontWeight)>=600&&(m=!0),!m))try{const p=window.getComputedStyle(u);parseInt(p.fontWeight)>=600&&(m=!0)}catch{}j.value[a]=m}else{const d=document.queryCommandState(a);j.value[a]=d}}}catch{}})},eo=()=>{if(!S.richText||S.disabled||!g.value){Fe.value="p";return}try{const l=window.getSelection();if(!l||l.rangeCount===0){Fe.value="p";return}const a=l.getRangeAt(0).commonAncestorContainer,s=a.nodeType===3?a.parentElement:a;if(!s||!g.value.contains(s)){Fe.value="p";return}const i=s.closest("h1, h2, h3, h4, h5, h6, p");if(!i){Fe.value="p";return}const d=i.tagName.toLowerCase();["h1","h2","h3","h4","h5","h6","p"].includes(d)?Fe.value=d:Fe.value="p"}catch{Fe.value="p"}},to=()=>{if(!g.value){Eo.value=!1;return}try{const l=window.getSelection();let o=!1;if(l.rangeCount>0){const s=l.getRangeAt(0).commonAncestorContainer,i=s.nodeType===1?s.tagName==="BLOCKQUOTE"?s:s.closest("blockquote"):s.parentElement?.closest("blockquote");o=!!(i&&g.value.contains(i))}Eo.value=o}catch{Eo.value=!1}},ko=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},Fo=()=>{xe.value=!1},me=()=>{if(!S.floatingToolbar||!S.richText||S.disabled){xe.value=!1;return}const l=window.getSelection();if(!l||l.rangeCount===0){xe.value=!1;return}const o=l.getRangeAt(0);if(o.collapsed||!ko(o)){xe.value=!1;return}const a=o.getBoundingClientRect();if(!a||a.width===0&&a.height===0){xe.value=!1;return}const s=g.value;if(!s){xe.value=!1;return}const i=s.getBoundingClientRect();if(!i||i.width===0){xe.value=!1;return}const d=40,u=8,m=a.top-d/2+15;let p=a.left+a.width/2;const h=window.innerWidth||document.documentElement.clientWidth||0;let x=0;Ao.value&&(x=Ao.value.getBoundingClientRect().width);const w=(x||320)/2;let k=i.left+w,T=i.right-w;if(T<k){const B=i.left+i.width/2;k=B,T=B}if(h>0){const B=w+u,L=h-w-u;if(k=Math.max(k,B),T=Math.min(T,L),T<k){const F=h/2;k=F,T=F}}p<k?p=k:p>T&&(p=T),rn.value={position:"fixed",top:`${Math.max(m,8)}px`,left:`${p}px`,transform:"translate(-50%, -100%)",zIndex:10003},xe.value=!0},uo=l=>{S.disabled||!S.richText||(At.value=At.value===l?null:l,l==="askAi"&&(Re.value=null))},oo=()=>{At.value=null,rt.value=null},he=l=>{jt(l),oo()};let xo=null,ge=null,we=null,To=null;const vl=l=>{if(S.disabled||!S.richText){zo(),ye();return}const o=l.target,a=o.closest("a"),s=o.closest("img");if(xo&&(clearTimeout(xo),xo=null),we&&(clearTimeout(we),we=null),a&&a!==ge){ye(),ge=a;let i=a.getAttribute("href")||"";(!i||i==="#"||i==="")&&(i=a.textContent||""),He.value=a,le.value=i,D.value=!0,gt.value=!0,wn(a)}else!a&&ge?(ge=null,xo=setTimeout(()=>{gt.value||zo()},150)):a&&a===ge&&wn(a);if(s&&s!==To){zo(),To=s;let i=s.getAttribute("alt");i===null&&(i=s.alt||"");let d=s.getAttribute("data-alt");d===null&&(d=i),s.hasAttribute("alt")||s.setAttribute("alt",i),s.hasAttribute("data-alt")||s.setAttribute("data-alt",d),ue.value=s,So.value=i.trim()||H("textEditor.image.noAlt"),Pt.value=!0,We.value=!0,en(s)}else!s&&To?(To=null,we=setTimeout(()=>{We.value||ye()},150)):s&&s===To&&en(s)},xn=l=>{const o=l.relatedTarget;(!o||!o.closest(".dss-text-editor-content")&&!o.closest(".dss-link-popup"))&&(ge=null,To=null,xo&&(clearTimeout(xo),xo=null),we&&(clearTimeout(we),we=null),zo(),ye())},zo=()=>{gt.value=!1,setTimeout(()=>{gt.value||(D.value=!1,le.value="",yt.value||(He.value=null))},100)},wn=l=>{if(!l||!g.value)return;const o=l.getBoundingClientRect(),i=o.top-32-8,d=o.left+o.width/2;ke.value={position:"fixed",top:`${i}px`,left:`${d}px`,transform:"translateX(-50%)",zIndex:10002}},ye=()=>{We.value=!1,setTimeout(()=>{We.value||(Pt.value=!1,So.value="",lo.value||(ue.value=null))},100)},en=l=>{if(!l||!g.value)return;const o=l.getBoundingClientRect(),i=o.top-32-8,d=o.left+o.width/2;Bn.value={position:"fixed",top:`${i}px`,left:`${d}px`,transform:"translateX(-50%)",zIndex:10002}},Gn=()=>{if(!le.value||!He.value)return;let o=He.value.getAttribute("href")||le.value;!o.startsWith("http://")&&!o.startsWith("https://")&&!o.startsWith("mailto:")&&(o="https://"+o),window.open(o,"_blank","noopener,noreferrer")},bn=()=>{if(He.value){const l=He.value.textContent||"",o=He.value.getAttribute("href")||"",a=He.value;$.value=o,Ye.value=l,ae.value=l,gt.value=!1,D.value=!1,le.value="",He.value=a,yt.value=!0}else if(ct.value){const l=window.getSelection();if(l.rangeCount>0){const a=l.getRangeAt(0).commonAncestorContainer,s=a.nodeType===1?a.closest("a"):a.parentElement?.closest("a");if(s){const i=s.textContent||"",d=s.getAttribute("href")||"";$.value=d,Ye.value=i,ae.value=i,He.value=s,yt.value=!0}}}else{je.value=ft();const l=window.getSelection();let o="";l.rangeCount>0&&(o=l.getRangeAt(0).toString()),$.value="",Ye.value=o,ae.value="",He.value=null,yt.value=!0}e.nextTick(()=>{Ht.value&&(Ht.value.focus(),Ht.value.select())})},Po=()=>{yt.value=!1,$.value="",Ye.value="",ae.value="",He.value=null,je.value=null},tn=()=>{if(!$.value.trim()){Po();return}if(ve.value?(te.value&&(clearTimeout(te.value),te.value=null),ze(),ve.value=!1):ze(),Ye.value.trim()||(Ye.value=$.value.trim()),He.value&&g.value&&g.value.contains(He.value)){const l=window.getSelection();l.rangeCount>0&&l.removeAllRanges();const o=He.value;if(o.setAttribute("href",$.value.trim()),Ye.value.trim()!==ae.value.trim()){for(;o.firstChild;)o.removeChild(o.firstChild);o.textContent=Ye.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),fe()}else if(g.value){g.value.focus();const l=window.getSelection();l.removeAllRanges(),je.value&&Nt(je.value);let o=null;if(l.rangeCount>0&&(o=l.getRangeAt(0)),o&&!o.collapsed){o.toString();const a=document.createElement("a");a.href=$.value.trim(),a.textContent=Ye.value.trim(),a.style.color="#60afdf",a.style.textDecoration="underline",o.deleteContents(),o.insertNode(a);const s=document.createTextNode(" ");o.setStartAfter(a),o.insertNode(s),o.setStartAfter(s),o.collapse(!0),l.removeAllRanges(),l.addRange(o)}else{o||(o=document.createRange(),o.selectNodeContents(g.value),o.collapse(!1));const a=o.startContainer,s=a.nodeType===3,i=s&&o.startOffset===a.textContent.length,d=document.createElement("a");if(d.href=$.value.trim(),d.textContent=Ye.value.trim(),d.style.color="#60afdf",d.style.textDecoration="underline",i){let u=a.parentElement;for(;u&&u!==g.value&&!["P","DIV","H1","H2","H3","H4","H5","H6"].includes(u.tagName);)u=u.parentElement;if(u&&u!==g.value){let m=u.nextElementSibling;if(m&&(m.innerHTML==="<br>"||m.innerHTML==="<br/>"||m.textContent.trim()==="")){m.textContent="",m.appendChild(d);const p=document.createTextNode(" ");m.appendChild(p);const h=document.createRange();h.setStartAfter(d),h.collapse(!0),l.removeAllRanges(),l.addRange(h)}else{if(o.startOffset>0){const h=a.textContent.substring(0,o.startOffset),x=h[h.length-1];if(x&&x!==" "&&x!==" "&&x!==`
79
+ `){const w=document.createTextNode(" ");o.insertNode(w),o.setStartAfter(w)}}o.insertNode(d);const p=document.createTextNode(" ");o.setStartAfter(d),o.insertNode(p),o.setStartAfter(p),o.collapse(!0),l.removeAllRanges(),l.addRange(o)}}}else{if(s&&o.startOffset>0){const m=a.textContent.substring(0,o.startOffset),p=m[m.length-1];if(p&&p!==" "&&p!==" "&&p!==`
80
+ `){const h=document.createTextNode(" ");o.insertNode(h),o.setStartAfter(h)}}o.insertNode(d);const u=document.createTextNode(" ");o.setStartAfter(d),o.insertNode(u),o.setStartAfter(u),o.collapse(!0),l.removeAllRanges(),l.addRange(o)}}fe()}e.nextTick(()=>{Le(),Po()})},En=()=>{if(!g.value||et.value)return;const l=window.getSelection();let o=null;l&&l.rangeCount>0&&(o=ft());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,s=document.createTreeWalker(g.value,NodeFilter.SHOW_TEXT,{acceptNode:m=>{const p=m.parentElement;return!p||p.closest("a")||p.closest(".dss-image-wrapper")||!m.textContent||m.textContent.trim()===""?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}}),i=[];let d;for(;d=s.nextNode();)i.push(d);let u=!1;for(let m=i.length-1;m>=0;m--){const p=i[m],h=p.textContent;a.lastIndex=0;const x=[...h.matchAll(a)];if(x.length===0)continue;const w=x.filter(B=>{const L=B[0],F=B.index;if(F>0&&h[F-1]==="@"||F+L.length<h.length&&h[F+L.length]==="@")return!1;const Q=p.parentElement;return!(Q&&Q.closest("a"))});if(w.length===0)continue;if(w.length===1&&w[0][0]===h.trim()){const B=w[0][0],L=B.startsWith("http://")||B.startsWith("https://")?B:`https://${B}`,F=document.createElement("a");F.href=L,F.textContent=B,F.style.color="#60afdf",F.style.textDecoration="underline",p.parentNode&&(p.parentNode.replaceChild(F,p),u=!0);continue}let k=0;const T=document.createDocumentFragment();if(w.forEach(B=>{const L=B.index,F=B[0];if(L>k){const Oe=h.substring(k,L);Oe&&T.appendChild(document.createTextNode(Oe))}const Q=F.startsWith("http://")||F.startsWith("https://")?F:`https://${F}`,Pe=document.createElement("a");Pe.href=Q,Pe.textContent=F,Pe.style.color="#60afdf",Pe.style.textDecoration="underline",T.appendChild(Pe),k=L+F.length}),k<h.length){const B=h.substring(k);B&&T.appendChild(document.createTextNode(B))}p.parentNode&&T.childNodes.length>0&&(p.parentNode.replaceChild(T,p),u=!0)}u&&o&&e.nextTick(()=>{Nt(o),Le()})},hl=()=>{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 d=i.parentElement;return!d||d.closest("a, code, pre, u, ins")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}}),a=[];let s;for(;s=o.nextNode();)a.push(s);for(let i=a.length-1;i>=0;i--){const d=a[i],u=d.textContent,m=[...u.matchAll(l)];if(m.length===0)continue;let p=0;const h=document.createDocumentFragment();m.forEach(x=>{const w=x.index,k=x[0].startsWith("<u>")?"u":"ins",T=x[1]||x[2]||"";w>p&&h.appendChild(document.createTextNode(u.substring(p,w)));const B=document.createElement(k);B.textContent=T,h.appendChild(B),p=w+x[0].length}),p<u.length&&h.appendChild(document.createTextNode(u.substring(p))),d.parentNode&&h.childNodes.length>0&&d.parentNode.replaceChild(h,d)}},Jn=l=>{if(!g.value||et.value)return;if(!l){hl();return}if(!["*","_",">"].includes(l))return;const a=window.getSelection();if(!a||a.rangeCount===0)return;const s=a.getRangeAt(0);if(!s.collapsed)return;const i=s.startContainer.nodeType===Node.TEXT_NODE?s.startContainer.parentElement?.closest("p, h1, h2, h3, h4, h5, h6, li, td, th, blockquote, div"):s.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 d=()=>{let Oe="",Te=0,Ie=!1;const _e=document.createTreeWalker(i,NodeFilter.SHOW_TEXT,{acceptNode:Ft=>Ft.parentElement?.closest("a, code, pre")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT});document.createTreeWalker(i,NodeFilter.SHOW_TEXT,null);let be=0;for(;_e.nextNode();){const Ft=_e.currentNode,mo=Ft.textContent||"",po=be;if(be+=mo.length,Ft===s.startContainer){Oe+=mo.substring(0,s.startOffset),Te=po+s.startOffset,Ie=!0;break}Oe+=mo}return Ie||(Te=Oe.length),{textBeforeCursor:Oe,cursorCharOffset:Te}},{textBeforeCursor:u}=d();if(!u.length)return;let m=null,p=null;if(u.endsWith("**")&&(m=u.match(/\*\*(.+?)\*\*$/s))||u.endsWith("__")&&(m=u.match(/__(.+?)__$/s))?p="strong":u.endsWith("*")&&!u.endsWith("**")&&(m=u.match(new RegExp("(?<!\\*)\\*([^*]+)\\*$")))||u.endsWith("_")&&!u.endsWith("__")&&(m=u.match(new RegExp("(?<!_)_([^_]+)_$")))?p="em":l===">"&&((m=u.match(/<u>(.+?)<\/u>$/s))||(m=u.match(/<ins>(.+?)<\/ins>$/s)))&&(p=m[0].startsWith("<u>")?"u":"ins",m[0].startsWith("<u>"),m[0].startsWith("<u>")),!m||!m[1])return;const h=m[0],x=m[1],w=u.length-h.length,T=(Oe=>{let Te=0;const Ie=document.createTreeWalker(i,NodeFilter.SHOW_TEXT,{acceptNode:be=>be.parentElement?.closest("a, code, pre")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT});let _e;for(;_e=Ie.nextNode();){const be=(_e.textContent||"").length;if(Te+be>=Oe)return{node:_e,offset:Oe-Te};Te+=be}return null})(w);if(!T)return;const B=document.createRange();B.setStart(T.node,T.offset),B.setEnd(s.endContainer,s.endOffset);const L=document.createElement(p);L.textContent=x,B.deleteContents(),B.insertNode(L);const F=window.getSelection(),Q=document.createRange();Q.setStartAfter(L),Q.collapse(!0),F.removeAllRanges(),F.addRange(Q);const Pe=ft();e.nextTick(()=>{fe(),Pe&&Nt(Pe)})},Ho=()=>{g.value&&($o.value=ft(),Ct.value="",kt.value="",Ke.value="",Je.value="",Ce.value="",Lo.value=null,ue.value=null,nt.value="upload",lo.value=!0,Qe(),e.nextTick(()=>{Ae.value&&Ae.value.focus(),Lt.value&&(Lt.value.value="")}))},on=l=>{const o=l.target?.files?.[0];if(!o){Lo.value=null,kt.value="";return}Lo.value=o;const a=new FileReader;a.onload=s=>{kt.value=s.target?.result||""},a.readAsDataURL(o)},Qn=()=>{Lt.value&&Lt.value.click()},Oo=()=>{Je.value&&(Ce.value="")},el=()=>{Ce.value&&(Je.value="")},gl=()=>{let l=ue.value;if(!l){const o=window.getSelection();if(o&&o.rangeCount>0){const s=o.getRangeAt(0).commonAncestorContainer;l=s.nodeType===1?s.closest("img"):s.parentElement?.closest("img")}}if(l){const o=l.getAttribute("data-alt")||l.getAttribute("alt")||"";ue.value=l,Ct.value=o.trim()===""||o.trim()==="Image"?"":o;const a=l.getAttribute("src")||l.src||"";a.startsWith("http://")||a.startsWith("https://")?(Ke.value=a,kt.value="",nt.value="url"):(kt.value=a,Ke.value="",nt.value="upload");const i=l.style.width||l.getAttribute("width")||"",d=l.style.height||l.getAttribute("height")||"";Je.value=i.endsWith("px")?i.replace("px",""):i,Ce.value=d.endsWith("px")?d.replace("px",""):d,$o.value=null}else{Ho();return}lo.value=!0,We.value=!1,Pt.value=!1,e.nextTick(()=>{nt.value==="url"&&Vo.value?(Vo.value.focus(),Vo.value.select()):Ae.value&&(Ae.value.focus(),Ae.value.select()),Lt.value&&(Lt.value.value="")})},Zo=()=>{lo.value=!1,Ct.value="",kt.value="",Ke.value="",Je.value="",Ce.value="",Lo.value=null,ue.value=null,$o.value=null,nt.value="upload"},no=()=>{const l=(Ct.value||"").trim(),o=g.value?._mutationObserver;o&&o.disconnect(),ve.value?(te.value&&(clearTimeout(te.value),te.value=null),ze(),ve.value=!1):ze();const a=nt.value==="url"?Ke.value.trim():kt.value;if(ue.value&&g.value&&g.value.contains(ue.value)){a&&(ue.value.src=a),ue.value.setAttribute("alt",l),ue.value.setAttribute("data-alt",l),Je.value?(ue.value.style.width=`${Je.value}px`,ue.value.setAttribute("width",Je.value)):(ue.value.style.removeProperty("width"),ue.value.removeAttribute("width")),Ce.value?(ue.value.style.height=`${Ce.value}px`,ue.value.setAttribute("height",Ce.value)):(ue.value.style.removeProperty("height"),ue.value.removeAttribute("height"));const s=window.getSelection();if(s){s.removeAllRanges();const i=document.createRange();i.setStartAfter(ue.value),i.collapse(!0),s.addRange(i)}fe()}else{if(!a){o&&g.value&&o.observe(g.value,{childList:!0,subtree:!0}),Zo();return}if(g.value){g.value.focus();const s=window.getSelection();s&&s.rangeCount>0&&s.removeAllRanges();const i=window.getSelection();let d=null;if($o.value&&(Nt($o.value),i&&i.rangeCount>0&&(d=i.getRangeAt(0))),!d&&i&&i.rangeCount>0&&(d=i.getRangeAt(0)),!d&&g.value){if(d=document.createRange(),g.value.childNodes.length===0){const h=document.createElement("p");h.innerHTML="<br>",g.value.appendChild(h),d.setStart(h,0),d.collapse(!0)}else d.selectNodeContents(g.value),d.collapse(!1);i&&(i.removeAllRanges(),i.addRange(d))}if(!d){Zo();return}const u=d.commonAncestorContainer,m=u.nodeType===3?u.parentElement:u;if(!g.value.contains(m)){if(d=document.createRange(),g.value.childNodes.length===0){const h=document.createElement("p");h.innerHTML="<br>",g.value.appendChild(h),d.setStart(h,0),d.collapse(!0)}else d.selectNodeContents(g.value),d.collapse(!1);i&&(i.removeAllRanges(),i.addRange(d))}const p=document.createElement("img");p.src=a,p.setAttribute("alt",l),p.setAttribute("data-alt",l),Je.value&&(p.style.width=`${Je.value}px`,p.setAttribute("width",Je.value)),Ce.value&&(p.style.height=`${Ce.value}px`,p.setAttribute("height",Ce.value));try{d.insertNode(p),d.setStartAfter(p),d.collapse(!0),i&&(i.removeAllRanges(),i.addRange(d))}catch{if(g.value){if(g.value.childNodes.length===0){const w=document.createElement("p");g.value.appendChild(w),w.appendChild(p)}else{const w=g.value.lastChild;if(w&&w.nodeType===1)w.appendChild(p);else{const k=document.createElement("p");g.value.appendChild(k),k.appendChild(p)}}const x=document.createRange();x.setStartAfter(p),x.collapse(!0),i&&(i.removeAllRanges(),i.addRange(x))}}ue.value=p,fe()}}e.nextTick(()=>{o&&g.value&&o.observe(g.value,{childList:!0,subtree:!0}),Le(),me(),Zo()})};e.watch(()=>S.modelValue,l=>{if(S.richText&&g.value&&!et.value){const o=vn(l||""),s=g.value.innerHTML.replace(/&nbsp;|\u00A0/g," "),i=o.replace(/&nbsp;|\u00A0/g," ");if(s!==i){const d=ft();g.value.innerHTML=o,e.nextTick(()=>{gn();const u=g.value.innerHTML||"",m=S.title||"",p=S.description||"";$t.value=u,wt.value=m,dt.value=p,tt.value=u,mt.value=m,pt.value=p,xt.value=[],lt.value=[],te.value&&(clearTimeout(te.value),te.value=null),ve.value=!1,d&&Nt(d),it(),Yt(),ro(),Le(),me(),eo(),Tt("watch-modelValue")})}}},{immediate:!0}),e.watch(()=>S.richText,l=>{l?(me(),e.nextTick(()=>{nl()})):(Fo(),Wt.value=[],Dt.value&&(Dt.value.disconnect(),Dt.value=null)),eo()}),e.watch(()=>S.floatingToolbar,l=>{l?me():Fo()}),e.watch(()=>S.disabled,l=>{l&&Fo(),eo()}),e.watch(()=>S.description,()=>{e.nextTick(()=>{Zt.value?Me():go()})}),e.watch(()=>S.title,()=>{e.nextTick(()=>{Et.value?oe():re()})}),e.watch(()=>S.customToolbarSlots,()=>{e.nextTick(()=>{co()})},{deep:!0}),e.watch(()=>S.comments,(l,o)=>{if(E.value){E.value=!1;return}De.value||S.richText&&g.value&&e.nextTick(()=>{Vn()})},{deep:!0,immediate:!1});const Vn=()=>{if(!De.value&&!(!S.comments||!Array.isArray(S.comments)||S.comments.length===0)&&!(!S.richText||!g.value)){De.value=!0;try{const l=new Set,o=S.comments.filter(u=>{const m=String(u.conversation_id||u.id);return l.has(m)?!1:(l.add(m),!0)}),a=g.value.querySelectorAll("[data-comment], [data-fake-comment]"),s=a.length;a.forEach(u=>{const m=u.parentNode;if(m){for(;u.firstChild;)m.insertBefore(u.firstChild,u);m.removeChild(u)}});let i=0;const d=new Set;o.forEach(u=>{if(!u.conversation_id||!u.selection_range)return;const m=typeof u.conversation_id=="string"&&u.conversation_id.startsWith("comment-")?null:Number(u.conversation_id)||u.conversation_id;if(!m)return;const p=String(m);if(d.has(p))return;const h=g.value.querySelector(`[data-comment="${p}"]`);if(h){nn(h,u),d.add(p);return}try{const x=ol(u.selection_range,u.selection_text);if(x&&!x.collapsed){const w=x.commonAncestorContainer,k=w.nodeType===3?w.parentElement:w;if(k){const L=k.closest("[data-comment], [data-fake-comment]");if(L){const F=L.getAttribute("data-comment")||L.getAttribute("data-fake-comment");if(String(F)===String(m)){L.setAttribute("data-comment",p),L.removeAttribute("data-fake-comment"),nn(L,u),d.add(p);return}else return}}const T=g.value.querySelector(`[data-comment="${p}"]`);if(T){nn(T,u),d.add(p);return}const B=document.createElement("span");B.setAttribute("data-comment",p),nn(B,u);try{x.surroundContents(B),i++,d.add(p)}catch{try{const F=document.createRange();F.setStart(x.startContainer,x.startOffset),F.setEnd(x.endContainer,x.endOffset),Sn(F),F.surroundContents(B),i++,d.add(p)}catch{try{const Q=x.extractContents();B.appendChild(Q),x.insertNode(B),i++,d.add(p)}catch(Q){console.warn("Failed to create comment marker:",Q)}}}}}catch{}}),e.nextTick(()=>{Tt("restoreCommentsFromModel"),fe(),De.value=!1})}catch{De.value=!1}}},Sn=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,s=l.startOffset;if(a.nodeType===3){const u=a.parentElement;u&&o.includes(u.tagName)&&(s===0&&!tl(a)||l.setStartBefore(u))}else a.nodeType===1&&o.includes(a.tagName)&&s>0&&l.setStartBefore(a);let i=l.endContainer,d=l.endOffset;if(i.nodeType===3){const u=i.parentElement;u&&o.includes(u.tagName)&&(d===i.length&&!yl(i)||l.setEndAfter(u))}else i.nodeType===1&&o.includes(i.tagName)&&d<i.childNodes.length&&l.setEndAfter(i);return l}catch{return l}},tl=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},yl=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},ol=(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 s=0;const i=[g.value];let d=null,u=!1,m=!1;for(;!m&&(d=i.pop());)if(d.nodeType===3){const p=s+d.length;!u&&l.start>=s&&l.start<=p&&(a.setStart(d,l.start-s),u=!0),u&&l.end>=s&&l.end<=p&&(a.setEnd(d,l.end-s),m=!0),s=p}else{let p=d.childNodes.length;for(;p--;)i.push(d.childNodes[p])}return u?Sn(a):null}}catch{return null}return null},nn=(l,o)=>{if(!l||!o)return;const a=o.conversation||[],s=new Set,i=[],d=m=>{m&&m.id&&!s.has(m.id)&&(s.add(m.id),i.push(m))};a.length>0&&a.forEach(m=>{m.user&&d(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 u=a.length;u>0?l.setAttribute("data-comment-count",String(u)):l.removeAttribute("data-comment-count")},Tt=(l="unknown")=>{if(!S.richText||!g.value){Wt.value=[];return}Date.now()-Tn.value<al&&It.value!==null||It.value===null&&(It.value=requestAnimationFrame(()=>{if(It.value=null,Tn.value=Date.now(),Do.value)return;Do.value=!0;const a={},s=g.value;if(!s){Do.value=!1;return}const i=s.closest(".editor-with-comments");if(!i){Do.value=!1;return}const d=s.querySelectorAll("[data-comment], [data-fake-comment]"),u=[],m=new Set;d.forEach(k=>{const T=k.getAttribute("data-comment")||k.getAttribute("data-fake-comment");T&&k.tagName==="SPAN"&&(m.has(T)||(u.push(k),m.add(T)))}),d.forEach(k=>{const T=k.getAttribute("data-comment")||k.getAttribute("data-fake-comment");!T||m.has(T)||(["P","DIV","H1","H2","H3","H4","H5","H6"].includes(k.tagName)?k.querySelector(`span[data-comment="${T}"], span[data-fake-comment="${T}"]`)||(u.push(k),m.add(T)):k.tagName!=="SPAN"&&(u.push(k),m.add(T)))});const p=i.getBoundingClientRect(),h=s.getBoundingClientRect();u.forEach((k,T)=>{let B=k.getAttribute("data-comment")||k.getAttribute("data-fake-comment");if(!B)return;if(typeof B=="string"&&B.startsWith("comment-")){const f=k.textContent?.trim(),C=S.comments?.find(y=>(typeof y.conversation_id=="string"&&y.conversation_id.startsWith("comment-")?null:y.conversation_id)&&y.selection_text?.trim()===f);C?(B=String(C.conversation_id),k.setAttribute("data-comment",B),k.removeAttribute("data-fake-comment")):(B=String(Date.now()),k.setAttribute("data-comment",B),k.removeAttribute("data-fake-comment"))}const L=k.getBoundingClientRect(),F=window.getComputedStyle(k),Q=parseFloat(F.lineHeight)||parseFloat(F.fontSize)*1.2,Te=L.top-h.top+Q/2-15,_e=h.top-p.top+Te;let be=null,Ft=null,mo=0;const po=[],Nn=new Set;if(B&&S.comments){const f=S.comments.find(C=>String(C.conversation_id||C.id)===String(B));if(f){const C=f.conversation||[];C.length>0?(C.forEach(y=>{y.user&&y.user.id&&!Nn.has(y.user.id)&&(Nn.add(y.user.id),po.push(y.user))}),mo=C.length):(mo=0,be=null,Ft=null),po.length>0?be=po[0]:be=null,po.length>1?Ft=po[1]:Ft=null}}const Mn=L.top+Q/2-15,kl=Mn+30,t=5,n=kl>h.top+t&&Mn<h.bottom-t?1:0;Wt.value.find(f=>f.id===B);let c=k;if(!c&&B&&g.value){const f=String(B);c=g.value.querySelector(`[data-comment="${f}"], [data-fake-comment="${f}"]`)}const v=po.length;a[B]?(a[B].top=_e,a[B].opacity=n,a[B].element=c,a[B].firstUser=be,a[B].secondUser=Ft,a[B].totalCount=mo,a[B].uniqueUserCount=v):a[B]={id:B,top:_e,opacity:n,element:c,firstUser:be,secondUser:Ft,totalCount:mo,uniqueUserCount:v}});const x=Object.values(a).map(k=>{const T=Math.max(0,(k.uniqueUserCount??0)-2);if(!k.element&&k.id&&g.value){const L=String(k.id);k.element=g.value.querySelector(`[data-comment="${L}"], [data-fake-comment="${L}"]`)}return{...k,firstUser:k.firstUser||null,secondUser:k.secondUser||null,totalCount:k.totalCount,additionalCount:T}});(Wt.value.length!==x.length||x.some((k,T)=>{const B=Wt.value[T];if(!B)return!0;const L=(B.firstUser?.id||null)!==(k.firstUser?.id||null),F=(B.secondUser?.id||null)!==(k.secondUser?.id||null);return B.id!==k.id||Math.abs(B.top-k.top)>1||B.opacity!==k.opacity||B.totalCount!==k.totalCount||B.additionalCount!==k.additionalCount||L||F||B.element!==k.element}))&&(Wt.value=x),Do.value=!1}))},Wo=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&&(wo(),Kt.value=o,o.classList.add("editor-comment-highlighted"))},wo=(l=!1)=>{!l&&qe.value!==null&&Kt.value&&(Kt.value.getAttribute("data-comment")||Kt.value.getAttribute("data-fake-comment"))===qe.value||(g.value&&g.value.querySelectorAll(".editor-comment-highlighted").forEach(a=>{a.classList.remove("editor-comment-highlighted")}),Kt.value&&(Kt.value.classList.remove("editor-comment-highlighted"),Kt.value=null))},ln=l=>{if(!l||!l.element)return;wo(!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}"]`;ie("comment-marker-clicked",{commentId:o,selector:a,element:l.element})},Cl=()=>{wo()},nl=()=>{!S.richText||!g.value||(Dt.value&&Dt.value.disconnect(),Vt.value!==null&&(clearTimeout(Vt.value),Vt.value=null),Dt.value=new MutationObserver(()=>{Vt.value===null&&(Vt.value=setTimeout(()=>{Vt.value=null,e.nextTick(()=>{Tt("MutationObserver")})},200))}),Dt.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"]}),Tt("setupCommentMarkersObserver-initial"))},ll=(l,o)=>{if(!l||!o)return;const a=o.getBoundingClientRect();let s=a.top,i=a.right+4;l.style.top=`${s}px`,l.style.left=`${i}px`,l.offsetHeight;const d=l.getBoundingClientRect(),u=window.innerWidth,m=window.innerHeight;if(d.right>u){const p=a.left-d.width-4;l.style.left=`${p}px`}if(d.bottom>m){const p=Math.max(8,m-d.height-8);l.style.top=`${p}px`}d.top<0&&(l.style.top="8px")};return e.watch(()=>rt.value,l=>{e.nextTick(()=>{document.querySelectorAll(".dss-toolbar-dropdown-submenu").forEach(a=>{const s=a.getAttribute("data-submenu-id");if(s===l&&l){const i=document.querySelector(`.dss-toolbar-dropdown-item-has-submenu[data-submenu-id="${s}"]`);if(i){if(a.parentNode!==document.body){const d=a.parentNode;a.dataset.originalParentRef=d===i?"inside":"sibling",document.body.appendChild(a)}a.style.display="block",a.style.visibility="hidden",a.style.opacity="0",requestAnimationFrame(()=>{requestAnimationFrame(()=>{ll(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(()=>[Re.value,At.value],()=>{Re.value==="askAi"||At.value==="askAi"?e.nextTick(()=>{Rt()}):(rt.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 s=document.querySelector(`.dss-toolbar-dropdown-item-has-submenu[data-submenu-id="${a}"]`);if(s)if(o.dataset.originalParentRef==="inside")s.appendChild(o);else{const d=s.closest(".dss-toolbar-dropdown");d&&d.insertBefore(o,s.nextSibling)}}}})}))}),e.watch(()=>S.locale,l=>{l&&l!==zt.value&&(zt.value=l)},{immediate:!0}),vo({openCommentOverlayForSelector:Se,updateCommentMarkers:Tt,restoreCommentsFromModel:Vn}),(l,o)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-text-editor-container editor-with-comments",cn.value]),style:e.normalizeStyle(sl.value)},[z.richText?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-text-editor-toolbar",onMousedown:o[14]||(o[14]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("div",Er,[e.createElementVNode("div",{class:"dss-toolbar-button",onClick:yn,title:e.unref(H)("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,Vr),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-disabled":!Hn.value}]),onClick:Cn,title:e.unref(H)("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,Sr),o[73]||(o[73]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",Nr,[e.createElementVNode("div",{class:"dss-toolbar-button dss-toolbar-dropdown-toggle",onClick:o[0]||(o[0]=a=>_n("paragraph")),title:e.unref(H)("textEditor.toolbar.paragraphFormat")},[Fe.value==="h1"?(e.openBlock(),e.createElementBlock("svg",Br,[...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)])])):Fe.value==="h2"?(e.openBlock(),e.createElementBlock("svg",Tr,[...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)])])):Fe.value==="h3"?(e.openBlock(),e.createElementBlock("svg",Hr,[...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)])])):Fe.value==="h4"?(e.openBlock(),e.createElementBlock("svg",Ar,[...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)])])):Fe.value==="h5"?(e.openBlock(),e.createElementBlock("svg",Lr,[...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)])])):Fe.value==="h6"?(e.openBlock(),e.createElementBlock("svg",$r,[...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",Dr,[...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,Mr),Re.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=>jt("<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(H)("textEditor.paragraph.heading1")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:o[2]||(o[2]=a=>jt("<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(H)("textEditor.paragraph.heading2")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:o[3]||(o[3]=a=>jt("<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(H)("textEditor.paragraph.heading3")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:o[4]||(o[4]=a=>jt("<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(H)("textEditor.paragraph.heading4")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:o[5]||(o[5]=a=>jt("<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(H)("textEditor.paragraph.heading5")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:o[6]||(o[6]=a=>jt("<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(H)("textEditor.paragraph.heading6")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:o[7]||(o[7]=a=>jt("<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(H)("textEditor.paragraph.paragraph")),1)])])):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":st("bold")}]),onClick:o[9]||(o[9]=a=>at("bold")),title:e.unref(H)("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,Ir),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":st("italic")}]),onClick:o[10]||(o[10]=a=>at("italic")),title:e.unref(H)("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,_r),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":st("underline")}]),onClick:o[11]||(o[11]=a=>at("underline")),title:e.unref(H)("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,Rr),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Eo.value}]),onClick:Io,title:e.unref(H)("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,Fr),o[74]||(o[74]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),ct.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-button",onClick:Fn,title:e.unref(H)("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,Pr)):(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-button",onClick:Rn,title:e.unref(H)("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,zr)),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":st("insertUnorderedList")}]),onClick:zn,title:e.unref(H)("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,Or),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":st("insertOrderedList")}]),onClick:Pn,title:e.unref(H)("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,Zr),o[76]||(o[76]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:"dss-toolbar-button",onClick:Ho,title:e.unref(H)("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,Wr),Ue.value?(e.openBlock(),e.createElementBlock("div",Ur)):e.createCommentVNode("",!0),Ue.value?(e.openBlock(),e.createElementBlock("div",{key:3,class:"dss-toolbar-button",title:e.unref(H)("textEditor.toolbar.comment"),onClick:vt},[...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,qr)):e.createCommentVNode("",!0),z.askAi?(e.openBlock(),e.createElementBlock("div",Xr)):e.createCommentVNode("",!0),z.askAi?(e.openBlock(),e.createElementBlock("div",Yr,[e.createElementVNode("div",{class:"dss-toolbar-ai-button dss-toolbar-dropdown-toggle",onClick:o[12]||(o[12]=a=>_n("askAi")),title:e.unref(H)("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",Kr,e.toDisplayString(e.unref(H)("textEditor.toolbar.askAi")),1)],8,jr),Re.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",Gr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(z.customToolbarSlots,(a,s)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:s},[qt(a)?(e.openBlock(),e.createElementBlock("div",Jr,[e.renderSlot(l.$slots,a)])):e.createCommentVNode("",!0),qt(a)&&s<z.customToolbarSlots.length-1&&il(s)?(e.openBlock(),e.createElementBlock("div",Qr)):e.createCommentVNode("",!0)],64))),128))])],32)):e.createCommentVNode("",!0),(Re.value==="paragraph"||Re.value==="askAi")&&z.richText?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-dropdown-overlay",onClick:Qe})):e.createCommentVNode("",!0),e.createVNode(xl,{showModal:yt.value,width:"500px",height:"55vh",onCloseModal:Po},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(H)("textEditor.link.editLink")),1)]),content:e.withCtx(()=>[e.createElementVNode("div",ei,[e.createElementVNode("div",ti,[e.createElementVNode("label",oi,e.toDisplayString(e.unref(H)("textEditor.link.altText")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"linkAltInput",ref:Ze,type:"text","onUpdate:modelValue":o[15]||(o[15]=a=>Ye.value=a),class:"dss-link-modal-input",placeholder:e.unref(H)("textEditor.link.enterAltText"),onKeyup:e.withKeys(tn,["enter"])},null,40,ni),[[e.vModelText,Ye.value]])]),e.createElementVNode("div",li,[e.createElementVNode("label",ai,e.toDisplayString(e.unref(H)("textEditor.link.url")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"linkUrlInput",ref:Ht,type:"text","onUpdate:modelValue":o[16]||(o[16]=a=>$.value=a),class:"dss-link-modal-input",placeholder:e.unref(H)("textEditor.link.enterUrl"),onKeyup:e.withKeys(tn,["enter"])},null,40,si),[[e.vModelText,$.value]])])])]),actions:e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-cancel",onClick:Po},e.toDisplayString(e.unref(H)("textEditor.link.cancel")),1),e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-save",onClick:tn},e.toDisplayString(e.unref(H)("textEditor.link.save")),1)]),_:1},8,["showModal"]),e.createVNode(xl,{showModal:lo.value,width:"500px",height:"80vh",onCloseModal:Zo},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(ue.value?e.unref(H)("textEditor.image.editImage"):e.unref(H)("textEditor.image.addImage")),1)]),content:e.withCtx(()=>[e.createElementVNode("div",ri,[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-image-modal-tab",{"dss-image-modal-tab-active":nt.value==="upload"}]),onClick:o[17]||(o[17]=a=>nt.value="upload")},e.toDisplayString(e.unref(H)("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":nt.value==="url"}]),onClick:o[18]||(o[18]=a=>nt.value="url")},e.toDisplayString(e.unref(H)("textEditor.image.imageLink")),3)]),nt.value==="upload"?(e.openBlock(),e.createElementBlock("div",ii,[e.createElementVNode("div",ci,[e.createElementVNode("div",ui,[mn.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("label",di,e.toDisplayString(e.unref(H)("textEditor.image.uploadImage")),1)),mn.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-image-upload-preview",onClick:Qn},[e.createElementVNode("img",{src:kt.value,alt:"Preview",class:"dss-image-preview-image"},null,8,mi),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:Lt,type:"file",accept:"image/*",class:"dss-image-file-input-hidden",onChange:on},null,544)])):(e.openBlock(),e.createElementBlock("input",{key:2,ref_key:"imageFileInput",ref:Lt,type:"file",accept:"image/*",class:"dss-link-modal-input dss-link-modal-input-image",onChange:on},null,544))]),e.createElementVNode("div",pi,[e.createElementVNode("label",fi,e.toDisplayString(e.unref(H)("textEditor.image.altText")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"imageAltInput",ref:Ae,type:"text","onUpdate:modelValue":o[19]||(o[19]=a=>Ct.value=a),class:"dss-link-modal-input",placeholder:e.unref(H)("textEditor.image.enterAltText"),onKeyup:e.withKeys(no,["enter"])},null,40,vi),[[e.vModelText,Ct.value]])]),e.createElementVNode("div",hi,[e.createElementVNode("label",gi,e.toDisplayString(e.unref(H)("textEditor.image.width")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":o[20]||(o[20]=a=>Je.value=a),class:"dss-link-modal-input",placeholder:e.unref(H)("textEditor.image.auto"),onKeyup:e.withKeys(no,["enter"]),onInput:Oo},null,40,yi),[[e.vModelText,Je.value]])]),e.createElementVNode("div",Ci,[e.createElementVNode("label",ki,e.toDisplayString(e.unref(H)("textEditor.image.height")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":o[21]||(o[21]=a=>Ce.value=a),class:"dss-link-modal-input",placeholder:e.unref(H)("textEditor.image.auto"),onKeyup:e.withKeys(no,["enter"]),onInput:el},null,40,xi),[[e.vModelText,Ce.value]])])])])):e.createCommentVNode("",!0),nt.value==="url"?(e.openBlock(),e.createElementBlock("div",wi,[e.createElementVNode("div",bi,[e.createElementVNode("div",Ei,[e.createElementVNode("label",Vi,e.toDisplayString(e.unref(H)("textEditor.image.imageUrl")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"imageUrlInput",ref:Vo,type:"text","onUpdate:modelValue":o[22]||(o[22]=a=>Ke.value=a),class:"dss-link-modal-input",placeholder:e.unref(H)("textEditor.image.enterImageUrl"),onKeyup:e.withKeys(no,["enter"])},null,40,Si),[[e.vModelText,Ke.value]])]),e.createElementVNode("div",Ni,[e.createElementVNode("label",Mi,e.toDisplayString(e.unref(H)("textEditor.image.altText")),1),e.withDirectives(e.createElementVNode("input",{type:"text","onUpdate:modelValue":o[23]||(o[23]=a=>Ct.value=a),class:"dss-link-modal-input",placeholder:e.unref(H)("textEditor.image.enterAltText"),onKeyup:e.withKeys(no,["enter"])},null,40,Bi),[[e.vModelText,Ct.value]])]),e.createElementVNode("div",Ti,[e.createElementVNode("label",Hi,e.toDisplayString(e.unref(H)("textEditor.image.width")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":o[24]||(o[24]=a=>Je.value=a),class:"dss-link-modal-input",placeholder:e.unref(H)("textEditor.image.auto"),onKeyup:e.withKeys(no,["enter"]),onInput:Oo},null,40,Ai),[[e.vModelText,Je.value]])]),e.createElementVNode("div",Li,[e.createElementVNode("label",$i,e.toDisplayString(e.unref(H)("textEditor.image.height")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":o[25]||(o[25]=a=>Ce.value=a),class:"dss-link-modal-input",placeholder:e.unref(H)("textEditor.image.auto"),onKeyup:e.withKeys(no,["enter"]),onInput:el},null,40,Di),[[e.vModelText,Ce.value]])])])])):e.createCommentVNode("",!0)]),actions:e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-cancel",onClick:Zo},e.toDisplayString(e.unref(H)("textEditor.image.cancel")),1),e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-save",onClick:no},e.toDisplayString(e.unref(H)("textEditor.image.save")),1)]),_:1},8,["showModal"]),e.createElementVNode("div",{class:e.normalizeClass(["dss-text-editor-title-wrapper",{"dss-text-editor-no-border-bottom":fn.value&&Et.value}])},[e.createElementVNode("p",null,e.toDisplayString(e.unref(H)("textEditor.labels.title")),1),e.createElementVNode("div",Ii,[Et.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",_i,[z.title?(e.openBlock(),e.createElementBlock("span",Ri,e.toDisplayString(z.title),1)):(e.openBlock(),e.createElementBlock("span",Fi,e.toDisplayString(pn.value),1))])),e.createElementVNode("textarea",{ref_key:"titleInputRef",ref:se,value:z.title,onInput:A,onFocus:so,onBlur:ne,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-title-input",{"dss-text-editor-title-input-blurred":!Et.value}]),placeholder:pn.value,disabled:z.disabled,rows:"1"},null,42,zi)])],2),fn.value&&Et.value?(e.openBlock(),e.createElementBlock("div",Pi,[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":Yo.value&&Zt.value}])},[e.createElementVNode("p",null,e.toDisplayString(e.unref(H)("textEditor.labels.description")),1),e.createElementVNode("div",Oi,[Zt.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Zi,[z.description?(e.openBlock(),e.createElementBlock("span",Wi,e.toDisplayString(z.description),1)):(e.openBlock(),e.createElementBlock("span",Ui,e.toDisplayString(Ln.value),1))])),e.createElementVNode("textarea",{ref_key:"descriptionInputRef",ref:Ne,value:z.description,onInput:No,onFocus:X,onBlur:ul,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-description-input",{"dss-text-editor-description-input-blurred":!Zt.value}]),placeholder:Ln.value,disabled:z.disabled,rows:"1"},null,42,qi)])],2),Yo.value&&Zt.value?(e.openBlock(),e.createElementBlock("div",Xi,[e.renderSlot(l.$slots,"description-slot")])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Wt.value,a=>(e.openBlock(),e.createElementBlock("div",{key:a.id,class:e.normalizeClass(["editor-comment-marker-group",{"editor-comment-marker-active":qe.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:s=>Wo(a),onMouseleave:Cl},[a.firstUser?(e.openBlock(),e.createElementBlock("div",{key:0,class:"editor-comment-marker editor-comment-marker-first",onClick:e.withModifiers(s=>ln(a),["stop"])},[a.firstUser.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:a.firstUser.avatar,alt:a.firstUser.name||"avatar"},null,8,Ki)):(e.openBlock(),e.createElementBlock("span",Gi,e.toDisplayString(a.firstUser.initials||(a.firstUser.name?a.firstUser.name.charAt(0):"")),1))],8,ji)):e.createCommentVNode("",!0),a.secondUser?(e.openBlock(),e.createElementBlock("div",{key:1,class:"editor-comment-marker editor-comment-marker-second",onClick:e.withModifiers(s=>ln(a),["stop"])},[a.secondUser.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:a.secondUser.avatar,alt:a.secondUser.name||"avatar"},null,8,Qi)):(e.openBlock(),e.createElementBlock("span",ec,e.toDisplayString(a.secondUser.initials||(a.secondUser.name?a.secondUser.name.charAt(0):"")),1))],8,Ji)):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(s=>ln(a),["stop"])},[e.createElementVNode("span",oc,"+"+e.toDisplayString(a.additionalCount),1)],12,tc)):e.createCommentVNode("",!0)],46,Yi))),128)),z.richText?(e.openBlock(),e.createElementBlock("div",cc,[e.createElementVNode("div",{ref_key:"editorRef",ref:g,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(dn.value),onInput:fe,onBlur:dl,onClick:jn,onMouseup:Kn,onKeyup:Kn,onKeydown:_o,onPaste:Un,onMousemove:vl,onMouseleave:xn},null,38),e.createVNode(e.Transition,{name:"comment-overlay"},{default:e.withCtx(()=>[qe.value!==null?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-comment-overlay",style:e.normalizeStyle(Mo.value)},[io.value||$e.value.length>0?(e.openBlock(),e.createElementBlock("div",uc,[e.createElementVNode("div",dc,[io.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-comment-selection",innerHTML:io.value},null,8,mc)):e.createCommentVNode("",!0)]),e.createElementVNode("div",pc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList($e.value,(a,s)=>(e.openBlock(),e.createElementBlock("div",{key:s,class:"dss-comment-message"},[a.user&&(a.user.avatar||a.user.initials||a.user.name)?(e.openBlock(),e.createElementBlock("div",fc,[e.createElementVNode("div",vc,[a.user.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:a.user.avatar,alt:a.user.name||"avatar"},null,8,hc)):(e.openBlock(),e.createElementBlock("span",gc,e.toDisplayString(a.user.initials||(a.user.name?a.user.name.charAt(0):"")),1))])])):e.createCommentVNode("",!0),e.createElementVNode("div",yc,[e.createElementVNode("div",Cc,[e.createElementVNode("div",kc,e.toDisplayString(a.user&&a.user.name||"Comment"),1),a.createdAt?(e.openBlock(),e.createElementBlock("div",xc,e.toDisplayString(Ee(new Date(a.createdAt))),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:e.normalizeClass(["dss-comment-body-text",{"comment-started":U(a.text)||a.class==="comment-started"}])},e.toDisplayString(a.text||""),3)]),S.commentUser&&a.user&&a.user.id===S.commentUser.id&&!U(a.text)?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-comment-delete-button",onClick:e.withModifiers(i=>Be(a,s),["stop"]),title:e.unref(H)("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,wc)):e.createCommentVNode("",!0)]))),128))])])):e.createCommentVNode("",!0),e.createElementVNode("div",bc,[e.withDirectives(e.createElementVNode("textarea",{ref_key:"commentInputRef",ref:Mt,"onUpdate:modelValue":o[26]||(o[26]=a=>Gt.value=a),class:"dss-comment-input",rows:"1",placeholder:e.unref(H)("textEditor.comment.placeholder"),onKeydown:e.withKeys(e.withModifiers(Jt,["prevent","stop"]),["enter"]),onInput:o[27]||(o[27]=()=>{if(Mt.value){const a=Mt.value;a.style.height="auto",a.style.height=`${a.scrollHeight}px`}})},null,40,Ec),[[e.vModelText,Gt.value]]),e.createElementVNode("button",{type:"button",class:"dss-comment-send-button",onClick:e.withModifiers(Jt,["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",Vc,[e.createElementVNode("div",Sc,[e.createElementVNode("span",Nc,e.toDisplayString(St.value)+" "+e.toDisplayString(St.value===1?e.unref(H)("textEditor.footer.word"):e.unref(H)("textEditor.footer.words")),1),o[82]||(o[82]=e.createElementVNode("span",{class:"dss-text-editor-footer-separator"},"•",-1)),e.createElementVNode("span",Mc,e.toDisplayString(qo.value)+" "+e.toDisplayString(qo.value===1?e.unref(H)("textEditor.footer.character"):e.unref(H)("textEditor.footer.characters")),1)])])])):(e.openBlock(),e.createElementBlock("div",nc,[e.createElementVNode("textarea",{value:z.modelValue,onInput:hn,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-textarea",{"dss-text-editor-fixed-height":z.fixedHeight}]),placeholder:rl.value,rows:z.rows,disabled:z.disabled,style:e.normalizeStyle(un.value)},null,46,lc),e.createElementVNode("div",ac,[e.createElementVNode("div",sc,[e.createElementVNode("span",rc,e.toDisplayString(St.value)+" "+e.toDisplayString(St.value===1?e.unref(H)("textEditor.footer.word"):e.unref(H)("textEditor.footer.words")),1),o[79]||(o[79]=e.createElementVNode("span",{class:"dss-text-editor-footer-separator"},"•",-1)),e.createElementVNode("span",ic,e.toDisplayString(qo.value)+" "+e.toDisplayString(qo.value===1?e.unref(H)("textEditor.footer.character"):e.unref(H)("textEditor.footer.characters")),1)])])])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[D.value&&le.value&&g.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-link-popup",style:e.normalizeStyle(ke.value),onMouseenter:o[28]||(o[28]=a=>gt.value=!0),onMouseleave:zo},[e.createElementVNode("span",{class:"dss-link-popup-url",onClick:e.withModifiers(Gn,["stop"]),title:le.value},e.toDisplayString(le.value),9,Bc),e.createElementVNode("button",{type:"button",class:"dss-link-popup-edit",onClick:e.withModifiers(bn,["stop"]),title:e.unref(H)("textEditor.link.editLink")},[(e.openBlock(),e.createElementBlock("svg",Hc,[...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,Tc)],36)):e.createCommentVNode("",!0)])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[Pt.value&&So.value&&g.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-link-popup",style:e.normalizeStyle(Bn.value),onMouseenter:o[29]||(o[29]=a=>We.value=!0),onMouseleave:ye},[e.createElementVNode("div",Ac,[So.value===e.unref(H)("textEditor.image.noAlt")?(e.openBlock(),e.createElementBlock("div",Lc,[...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:So.value},e.toDisplayString(So.value),9,$c)]),e.createElementVNode("button",{type:"button",class:"dss-link-popup-edit",onClick:e.withModifiers(gl,["stop"]),title:e.unref(H)("textEditor.image.editImage")},[(e.openBlock(),e.createElementBlock("svg",Ic,[...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,Dc)],36)):e.createCommentVNode("",!0)])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[z.floatingToolbar&&z.richText&&xe.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"floatingToolbarRef",ref:Ao,class:"dss-floating-toolbar",style:e.normalizeStyle(rn.value),onMousedown:o[44]||(o[44]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("div",_c,[e.createElementVNode("div",{class:"dss-toolbar-button",onClick:e.withModifiers(yn,["stop"]),title:e.unref(H)("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,Rc),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-disabled":!Hn.value}]),onClick:e.withModifiers(Cn,["stop"]),title:e.unref(H)("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,Fc),o[107]||(o[107]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",zc,[e.createElementVNode("div",{class:"dss-toolbar-button dss-toolbar-dropdown-toggle",onClick:o[30]||(o[30]=e.withModifiers(a=>uo("paragraph"),["stop"])),title:e.unref(H)("textEditor.toolbar.paragraphFormat")},[Fe.value==="h1"?(e.openBlock(),e.createElementBlock("svg",Oc,[...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)])])):Fe.value==="h2"?(e.openBlock(),e.createElementBlock("svg",Zc,[...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)])])):Fe.value==="h3"?(e.openBlock(),e.createElementBlock("svg",Wc,[...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)])])):Fe.value==="h4"?(e.openBlock(),e.createElementBlock("svg",Uc,[...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)])])):Fe.value==="h5"?(e.openBlock(),e.createElementBlock("svg",qc,[...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)])])):Fe.value==="h6"?(e.openBlock(),e.createElementBlock("svg",Xc,[...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",Yc,[...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,Pc),At.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=>he("<h1>"))},[e.createElementVNode("h1",null,e.toDisplayString(e.unref(H)("textEditor.paragraph.heading1")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:o[32]||(o[32]=a=>he("<h2>"))},[e.createElementVNode("h2",null,e.toDisplayString(e.unref(H)("textEditor.paragraph.heading2")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:o[33]||(o[33]=a=>he("<h3>"))},[e.createElementVNode("h3",null,e.toDisplayString(e.unref(H)("textEditor.paragraph.heading3")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:o[34]||(o[34]=a=>he("<h4>"))},[e.createElementVNode("h4",null,e.toDisplayString(e.unref(H)("textEditor.paragraph.heading4")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:o[35]||(o[35]=a=>he("<h5>"))},[e.createElementVNode("h5",null,e.toDisplayString(e.unref(H)("textEditor.paragraph.heading5")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:o[36]||(o[36]=a=>he("<h6>"))},[e.createElementVNode("h6",null,e.toDisplayString(e.unref(H)("textEditor.paragraph.heading6")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:o[37]||(o[37]=a=>he("<p>"))},[e.createElementVNode("p",null,e.toDisplayString(e.unref(H)("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":st("bold")}]),onClick:o[39]||(o[39]=e.withModifiers(a=>at("bold"),["stop"])),title:e.unref(H)("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,jc),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":st("italic")}]),onClick:o[40]||(o[40]=e.withModifiers(a=>at("italic"),["stop"])),title:e.unref(H)("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,Kc),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":st("underline")}]),onClick:o[41]||(o[41]=e.withModifiers(a=>at("underline"),["stop"])),title:e.unref(H)("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,Gc),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":Eo.value}]),onClick:e.withModifiers(Io,["stop"]),title:e.unref(H)("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,Jc),o[110]||(o[110]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),ct.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-button",onClick:e.withModifiers(Fn,["stop"]),title:e.unref(H)("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,eu)):(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-button",onClick:e.withModifiers(Rn,["stop"]),title:e.unref(H)("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,Qc)),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":st("insertUnorderedList")}]),onClick:e.withModifiers(zn,["stop"]),title:e.unref(H)("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,tu),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":st("insertOrderedList")}]),onClick:e.withModifiers(Pn,["stop"]),title:e.unref(H)("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,ou),o[112]||(o[112]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:"dss-toolbar-button",onClick:e.withModifiers(Ho,["stop"]),title:e.unref(H)("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,nu),o[113]||(o[113]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:"dss-toolbar-button",title:e.unref(H)("textEditor.toolbar.comment"),onClick:e.withModifiers(vt,["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,lu),z.askAi?(e.openBlock(),e.createElementBlock("div",au)):e.createCommentVNode("",!0),z.askAi?(e.openBlock(),e.createElementBlock("div",su,[e.createElementVNode("div",{class:"dss-toolbar-ai-button dss-toolbar-ai-float dss-toolbar-dropdown-toggle",onClick:o[42]||(o[42]=e.withModifiers(a=>uo("askAi"),["stop"])),title:e.unref(H)("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",iu,e.toDisplayString(e.unref(H)("textEditor.toolbar.askAi")),1)],8,ru),At.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)]),Dn.value?(e.openBlock(),e.createElementBlock("div",cu,[z.askAi&&Dn.value?(e.openBlock(),e.createElementBlock("div",uu)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(z.customToolbarSlots,(a,s)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:s},[qt(a)&&Xo(a)?(e.openBlock(),e.createElementBlock("div",du,[e.renderSlot(l.$slots,a)])):e.createCommentVNode("",!0),qt(a)&&Xo(a)&&s<z.customToolbarSlots.length-1&&$n(s)?(e.openBlock(),e.createElementBlock("div",mu)):e.createCommentVNode("",!0)],64))),128))])):e.createCommentVNode("",!0)],36)):e.createCommentVNode("",!0)]))],6))}}),vu={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"}},hu={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"}},Vl={chart:vu,textEditor:hu},gu={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"}},yu={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"}},Sl={chart:gu,textEditor:yu},Cu={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"}},ku={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"}},Nl={chart:Cu,textEditor:ku},wl={en:Vl,fr:Sl,nl:Nl};function xu(z){if(!z||!z.global)return;const vo=z.global.availableLocales||[];Object.keys(wl).forEach(J=>{vo.includes(J)&&z.global.mergeLocaleMessage(J,wl[J])})}const bl={en:{textEditor:Vl.textEditor},fr:{textEditor:Sl.textEditor},nl:{textEditor:Nl.textEditor}};function wu(z){if(!z||!z.global)return;const vo=z.global.availableLocales||[];Object.keys(bl).forEach(J=>{vo.includes(J)&&z.global.mergeLocaleMessage(J,bl[J])})}const bu={en:{...Vl},fr:{...Sl},nl:{...Nl}};El.createI18n({legacy:!1,locale:"en",fallbackLocale:"en",messages:bu});exports.DSSChart=xr;exports.DSSChartMessages=wl;exports.DSSModal=xl;exports.DSSTextEditor=fu;exports.DSSTextEditorMessages=bl;exports.addDSSChartTranslations=xu;exports.addDSSTextEditorTranslations=wu;