dsp-semactic 0.5.34 → 0.5.35
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 +1 -1
- package/dist/index.es.js +0 -1
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -74,4 +74,4 @@
|
|
|
74
74
|
`;const r=Math.max(...T.series.map(v=>v.data?.length||0));for(let v=0;v<r;v++){let w='"'+(T.categories[v]||U("chart.fallback.item",{number:v+1})).toString().replace(/"/g,'""')+'"';T.series.forEach(x=>{const S=x.data&&x.data[v]!==void 0?x.data[v]:"";w+=","+S}),t+=w+`
|
|
75
75
|
`}const l=new Blob([t],{type:"text/csv;charset=utf-8;"}),c=URL.createObjectURL(l),m=document.createElement("a");m.href=c,m.download=To("csv"),document.body.appendChild(m),m.click(),document.body.removeChild(m),URL.revokeObjectURL(c),kt()}catch(t){console.error("Error downloading CSV:",t)}},rl=t=>{if(typeof t.action=="function"){const r={series:T.series,categories:T.categories,markers:Re.value},l={chartX:ae.value.chartX,chartY:ae.value.chartY,dataX:ae.value.mouseDataX,dataY:ae.value.mouseDataY,categoryIndex:clampedCategoryIndex||ae.value.categoryIndex};t.action(r,l)}kt()},Hl=()=>{ao(),P.value.show=!0,P.value.categoryIndex=ae.value.categoryIndex,kt()},Ue=t=>{if(ae.value.show){const r=document.querySelector(".dss-context-menu");r&&!r.contains(t.target)&&(ae.value.show=!1)}},Lo=t=>{ae.value.show&&!t.target.closest(".context-menu")&&(ae.value.show=!1)},Uo=t=>{if(!xe.value||!qe.value)return;t.preventDefault(),t.stopPropagation(),N.value.isZooming=!0,Y.value.show=!1,N.value.zoomTimeout&&clearTimeout(N.value.zoomTimeout);const l=t.currentTarget.getBoundingClientRect(),c=t.clientX-l.left,m=t.clientY-l.top;if(c<k.value.left-50||c>k.value.right+50||m<k.value.top-50||m>k.value.bottom+100){N.value.isZooming=!1;return}const v=t.deltaY>0?.9:1.1,y=Math.max(N.value.minScale,Math.min(N.value.maxScale,N.value.scale*v));if(y!==N.value.scale){const{minX:C,maxX:w}=ye.value,x=w-C||1,S=x/N.value.scale,A=C-N.value.offsetX/k.value.width*x,q=(c-k.value.left)/k.value.width,G=A+q*S;N.value.scale=y;const Q=x/N.value.scale,$=G-q*Q;N.value.offsetX=-($-C)/x*k.value.width,N.value.scale<=1.01&&(N.value.scale=1,N.value.offsetX=0)}N.value.zoomTimeout=setTimeout(()=>{N.value.isZooming=!1,N.value.zoomTimeout=null},300)},il=t=>{if(!xe.value||!qe.value||N.value.scale<=1)return;Y.value.show=!1;const l=t.currentTarget.getBoundingClientRect();t.clientX-l.left,t.clientY-l.top,N.value.isDragging=!0,N.value.lastMouseX=t.clientX,N.value.lastMouseY=t.clientY,t.preventDefault()},cl=()=>{N.value.isDragging=!1},Ao=()=>{!xe.value||!qe.value||(N.value.scale=1,N.value.offsetX=0,N.value.isDragging=!1,N.value.zoomTimeout&&(clearTimeout(N.value.zoomTimeout),N.value.zoomTimeout=null),N.value.isZooming=!1)},Ye=()=>!xe.value||!So.value||!qe.value?"default":N.value.isDragging?"grabbing":N.value.scale>1?"grab":"dss-crosshair",$o=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 l=0;l<t.length-1;l++){const c=t[Math.max(l-1,0)],m=t[l],v=t[l+1],y=t[Math.min(l+2,t.length-1)],C=m.x+(v.x-c.x)/6*Tt.value,w=m.y+(v.y-c.y)/6*Tt.value,x=v.x-(y.x-m.x)/6*Tt.value,S=v.y-(y.y-m.y)/6*Tt.value;r+=` C ${C} ${w} ${x} ${S} ${v.x} ${v.y}`}return r},_t=e.computed(()=>{let r=50+(at.value?30:0)+60;if(_e.value)return{left:90,top:90,right:90,bottom:90};if(Pe.value){let y=0;ce.value&&(y+=15),ue.value&&(y+=10);const C=Ze();let w=66,x=50;return Ee.value&&$e.value==="left"?w+=C.legendWidth||150:Ee.value&&$e.value==="right"&&(x+=C.legendWidth||150),{left:w,top:50+y,right:x,bottom:130}}let l=0;ce.value&&(l+=15),ue.value&&(l+=10);const c=Ze();let m=66,v=50;return Ee.value&&$e.value==="left"?m+=c.legendWidth||150:Ee.value&&$e.value==="right"&&(v+=c.legendWidth||150),Ee.value&&$e.value==="bottom"&&(r+=c.legendHeight||0),{left:m,top:50+l,right:v,bottom:r}}),k=e.computed(()=>({left:_t.value.left,top:_t.value.top,right:z.value-_t.value.right,bottom:te.value-_t.value.bottom,width:z.value-(_t.value.left+_t.value.right),height:te.value-(_t.value.top+_t.value.bottom)})),xe=e.computed(()=>["line","area","bar"].includes(le.value)||nt.value),Et=e.computed(()=>nt.value),Pe=e.computed(()=>["radial","semi-radial"].includes(le.value)),_e=e.computed(()=>le.value==="spider"),ge=e.computed(()=>le.value==="bubble"),dt=e.computed(()=>L.value?.chart?.orientation==="horizontal"&&(le.value==="bar"||Et.value)),Vt=t=>{const{minY:r,maxY:l}=ye.value,c=l-r||1;return k.value.left+(t-r)/c*k.value.width},ul=t=>{const{maxX:r}=ye.value,l=r+1,m=k.value.height/l;return k.value.top+(t+.5)*m},Me=e.computed(()=>z.value/2),Be=e.computed(()=>_e.value?te.value/2-40:te.value/2),ve=e.computed(()=>{if(_e.value){const t=k.value.width-80,r=k.value.height-80;return Math.min(t,r)/2}return Math.min(k.value.width,k.value.height)/2}),We=e.computed(()=>ve.value*.45),Do=e.computed(()=>L.value?.bubbles?.minSize||8),dl=e.computed(()=>L.value?.bubbles?.maxSize||50),Wo=e.computed(()=>L.value?.bubbles?.opacity||.7),qo=(t,r)=>{const l=[15,20,25,18,22],c=l[t%l.length]||20,m=1+Math.sin(r*.5)*.2;return Math.max(5,c*m)},ml=t=>{const r=document.querySelector(`.dss-bubble-image-${t}`);r&&(r.style.opacity="1")},Tl=t=>{const r=document.querySelector(`.dss-bubble-image-${t}`);r&&(r.style.display="none")},qt=e.computed(()=>T.series),Yt=e.computed(()=>T.series.filter((t,r)=>!we.value.has(r))),St="auto",ye=e.computed(()=>{if(ge.value)return Ro();if(!Yt.value.length)return{minX:0,maxX:1,minY:0,maxY:1};let t=1/0,r=-1/0,l=0;Yt.value.forEach(C=>{C.data&&C.data.length&&(l=Math.max(l,C.data.length-1),C.data.forEach(w=>{typeof w=="number"&&(t=Math.min(t,w),r=Math.max(r,w))}))}),T.categories.length>0&&(l=Math.max(l,T.categories.length-1)),t===1/0&&(t=0,r=100);const c=Ce.value,m=Bt.value;let v,y;if(c===St){const C=r-t,w=C>0?C*.1:1;v=Math.max(0,t-w)}else if(typeof c=="number")v=c;else{const C=r-t,w=C>0?C*.1:1;v=Math.max(0,t-w)}if(m===St){const C=r-t,w=C>0?C*.1:2;y=r+w}else if(typeof m=="number")y=m;else{const C=r-t,w=C>0?C*.1:2;y=r+w}return{minX:0,maxX:l,minY:v,maxY:y}}),Ro=()=>{if(!Yt.value.length)return{minX:0,maxX:8,minY:0,maxY:50,minSize:10,maxSize:30};let t=1/0,r=-1/0,l=1/0,c=-1/0,m=1/0,v=-1/0,y=!1;if(Yt.value.forEach((G,Q)=>{G?.data?.length&&G.data.forEach(($,O)=>{let _,H,j;if(typeof $=="object"&&$!==null&&!Array.isArray($))_=typeof $.x=="number"?$.x:O,H=typeof $.y=="number"?$.y:0,j=typeof $.size=="number"?$.size:20;else if(Array.isArray($)&&$.length>=3)_=typeof $[0]=="number"?$[0]:O,H=typeof $[1]=="number"?$[1]:0,j=typeof $[2]=="number"?$[2]:20;else if(typeof $=="number")_=O,H=$,j=qo(Q,O);else return;isFinite(_)&&isFinite(H)&&isFinite(j)&&(t=Math.min(t,_),r=Math.max(r,_),l=Math.min(l,H),c=Math.max(c,H),m=Math.min(m,j),v=Math.max(v,j),y=!0)})}),!y)return{minX:0,maxX:8,minY:0,maxY:50,minSize:10,maxSize:30};t===r&&(t=Math.min(t,0),r=Math.max(r,T.categories?.length-1||8)),l===c&&(l=Math.max(0,l-10),c=l+20);const C=r-t,w=c-l;let x,S,A,q;return Ut.value!==null?x=Ut.value:x=t-C*.1,eo.value!==null?S=eo.value:S=r+C*.1,Ce.value!==null&&typeof Ce.value=="number"?A=Ce.value:A=Math.max(0,l-w*.1),Bt.value!==null&&typeof Bt.value=="number"?q=Bt.value:q=c+w*.1,{minX:x,maxX:S,minY:A,maxY:q,minSize:m,maxSize:v}},Oe=t=>{if(ge.value){const{minX:C,maxX:w}=ye.value,x=w-C||1;return k.value.left+(t-C)/x*k.value.width}const{minX:r,maxX:l}=ye.value,c=l-r;if(l===0||c===0)return k.value.left+k.value.width/2;const m=c/N.value.scale,v=r-N.value.offsetX/k.value.width*c,y=(t-v)/m;return k.value.left+y*k.value.width},Qe=t=>{const{minY:r,maxY:l}=ye.value,c=l-r||1;return k.value.bottom-(t-r)/c*k.value.height},pl=t=>{if(!ge.value)return fe.value||4;const{minSize:r,maxSize:l}=ye.value,c=l-r||1;if(c===0)return(Do.value+dl.value)/2;const m=(t-r)/c;return Do.value+m*(dl.value-Do.value)},Ft=e.computed(()=>so.value.map(t=>({y:t.y}))),mt=e.computed(()=>{if(ge.value)return jt();if(le.value==="bar"){if(dt.value){const R=[],{minY:F,maxY:W}=ye.value,Z=5,ne=W-F||1;for(let se=0;se<=Z;se++){const Je=F+ne*(se/Z),Ae=Vt(Je);R.push({x:Ae,y:k.value.bottom+20,text:Math.round(Je).toString()})}return R}const Q=[],{maxX:$}=ye.value,O=$+1,_=5,j=(k.value.width-_*2)/O;for(let R=0;R<=$;R++){const F=k.value.left+_+(R+.5)*j;Q.push({x:F,y:k.value.bottom+20,text:T.categories[R]||U("chart.fallback.item",{number:R+1})})}return Q}const t=[],{minX:r,maxX:l}=ye.value,c=l-r||1,m=c/N.value.scale,v=r-N.value.offsetX/k.value.width*c,y=v+m,C=Math.max(0,Math.floor(v-2)),w=Math.min(l,Math.ceil(y+2)),x=w-C,S=k.value.width,q=Math.floor(S/60);let G=1;x>q&&(G=Math.ceil(x/q));for(let Q=C;Q<=w;Q+=G)if(Q>=0&&Q<=l){const $=Oe(Q);$>=k.value.left-100&&$<=k.value.right+100&&t.push({x:$,y:k.value.bottom+20,text:T.categories[Q]||`Item ${Q+1}`})}return t}),jt=()=>{const t=[],{minX:r,maxX:l}=ye.value,c=l-r||1,m=Math.min(8,Math.max(4,Math.floor(k.value.width/80)));for(let v=0;v<=m;v++){const y=r+c*v/m,C=Oe(y);if(C>=k.value.left-10&&C<=k.value.right+10){const w=Math.round(y),x=T.categories?.[w];t.push({x:C,y:k.value.bottom+20,text:x||(Number.isInteger(y)?y.toString():y.toFixed(1))})}}return t},so=e.computed(()=>{if(dt.value){const m=[],{maxX:v}=ye.value;for(let y=0;y<=v;y++)m.push({x:k.value.left-10,y:ul(y),text:T.categories[y]||`Item ${y+1}`});return m}const t=[],{minY:r,maxY:l}=ye.value,c=5;for(let m=0;m<=c;m++){const v=r+(l-r)*(m/c),y=Math.round(v);t.push({x:k.value.left-10,y:Qe(v),text:y.toString()})}return t}),J=t=>{const r=to.value;if(!r||r.length===0){const l=["#3B82F6","#EF4444","#10B981","#F59E0B","#8B5CF6","#F97316","#06B6D4","#84CC16"];return l[t%l.length]}return r[t%r.length]},Yo=t=>{let r=0;for(let l=1;l<t.length;l++){const c=t[l].x-t[l-1].x,m=t[l].y-t[l-1].y;r+=Math.sqrt(c*c+m*m)}return r},jo=e.computed(()=>le.value==="line"||Et.value?(Et.value?T.series.filter(r=>(r.type||le.value)==="line"):qt.value).map((r,l)=>{const c=T.series.findIndex(S=>S===r),m=r.data.map((S,A)=>({x:dt.value?Vt(S):Oe(A),y:dt.value?ul(A):Qe(S)}));let v="";m.length>0&&(oe.value?v=$o(m):v=`M ${m[0].x} ${m[0].y}`+m.slice(1).map(S=>` L ${S.x} ${S.y}`).join(""));const y=Yo(m),C=we.value.has(c),w=I.value===c,x=I.value!==null&&I.value!==c;return{path:v,color:J(c),pathLength:y,seriesIndex:c,animationDelay:l*Le.value,isHighlighted:w,isDimmed:x,isHidden:C}}):[]),Kt=e.computed(()=>{if(le.value!=="line")return[];const t=[];return qt.value.forEach((r,l)=>{const c=I.value===l,m=I.value!==null&&I.value!==l,v=we.value.has(l);r.data.forEach((y,C)=>{t.push({x:Oe(C),y:Qe(y),color:J(l),value:y,label:T.categories[C]||C.toString(),seriesName:r.name,categoryIndex:C,dataIndex:C,animationDelay:(l*r.data.length+C)*(Le.value/8),isHighlighted:c,isDimmed:m,isHidden:v})})}),t}),Gt=e.computed(()=>{if(!Et.value)return[];const t=[];return T.series.filter(l=>(l.type||le.value)==="line").forEach((l,c)=>{const m=T.series.findIndex(w=>w===l),v=I.value===m,y=I.value!==null&&I.value!==m,C=we.value.has(m);l.data.forEach((w,x)=>{t.push({x:Oe(x),y:Qe(w),color:J(m),value:w,label:T.categories[x]||x.toString(),seriesName:l.name,categoryIndex:x,dataIndex:x,animationDelay:(c*l.data.length+x)*(Le.value/8),isHighlighted:v,isDimmed:y,isHidden:C})})}),t}),Nt=e.computed(()=>{if(!ge.value)return[];const t=[];return qt.value.forEach((r,l)=>{if(!r?.data?.length)return;const c=I.value,m=c!==null&&c===l,v=c!==null&&c!==l,y=we.value.has(l);r.data.forEach((C,w)=>{let x,S,A,q,G;if(typeof C=="object"&&C!==null&&!Array.isArray(C))x=typeof C.x=="number"?C.x:w,S=typeof C.y=="number"?C.y:0,A=typeof C.size=="number"?C.size:20,q=C.label||T.categories?.[w]||`Point ${w+1}`,G=C.image||C.imageUrl;else if(Array.isArray(C)&&C.length>=3)x=typeof C[0]=="number"?C[0]:w,S=typeof C[1]=="number"?C[1]:0,A=typeof C[2]=="number"?C[2]:20,q=C[3]||T.categories?.[w]||`Point ${w+1}`,G=C[4];else if(typeof C=="number")x=w,S=C,A=qo(l,w),q=T.categories?.[w]||`Point ${w+1}`;else return;!isFinite(x)||!isFinite(S)||!isFinite(A)||t.push({x:Oe(x),y:Qe(S),radius:pl(A),originalX:x,originalY:S,originalSize:A,color:J(l),seriesName:r.name||`Series ${l+1}`,label:q,imageUrl:G,seriesIndex:l,dataIndex:w,categoryIndex:Math.round(x),isHighlighted:m,isDimmed:v,isHidden:y,opacity:Wo.value})})}),t}),Mt=e.computed(()=>le.value!=="area"?[]:qt.value.map((t,r)=>{const l=t.data.map((S,A)=>({x:Oe(A),y:Qe(S)}));if(l.length===0)return{linePath:"",areaPath:"",color:J(r),isHidden:we.value.has(r)};let c=`M ${l[0].x} ${l[0].y}`;oe.value&&l.length>1?c=$o(l):l.slice(1).forEach(S=>{c+=` L ${S.x} ${S.y}`});const m=k.value.bottom+1;let v=`M ${l[0].x} ${m}`;if(v+=` L ${l[0].x} ${l[0].y}`,oe.value&&l.length>1){const S=$o(l),A=S.substring(S.indexOf("C")||S.indexOf("Q")||S.indexOf("L"));A?v+=" "+A:l.slice(1).forEach(q=>{v+=` L ${q.x} ${q.y}`})}else l.slice(1).forEach(S=>{v+=` L ${S.x} ${S.y}`});v+=` L ${l[l.length-1].x} ${m} Z`;const y=I.value===r,C=I.value!==null&&I.value!==r,w=we.value.has(r),x=Yo(l);return{linePath:c,areaPath:v,color:J(r),pathLength:x,isHighlighted:y,isDimmed:C,isHidden:w}})),Qt=e.computed(()=>{if(!(["bar"].includes(le.value)||Et.value))return[];const t=[],{maxX:r}=ye.value,l=Et.value?T.series.filter(m=>(m.type||le.value)==="bar"):qt.value,c=l.length;if(dt.value){const m=r+1,y=k.value.height/m,C=y*(2/3),w=C/c,x=w*.02,S=c===m?Math.max(12,C-x*c):Math.max(12,w-x);l.forEach((A,q)=>{const G=T.series.findIndex(_=>_===A),Q=I.value===G,$=I.value!==null&&I.value!==G,O=we.value.has(G);A.data.forEach((_,H)=>{if(_==null||typeof _!="number"||!isFinite(_))return;const F=k.value.top+(H+.5)*y-C/2+q*w+x/2,W=k.value.left,Z=Math.abs(Vt(_)-k.value.left);let ne="";if(oe.value&&Z>0){const se=Math.min(vo.value,S/2,Z/2);ne=[`M ${W} ${F}`,`L ${W+Z-se} ${F}`,`Q ${W+Z} ${F} ${W+Z} ${F+se}`,`L ${W+Z} ${F+S-se}`,`Q ${W+Z} ${F+S} ${W+Z-se} ${F+S}`,`L ${W} ${F+S}`,"Z"].join(" ")}t.push({x:W,y:F,width:Z,height:S,color:J(G),value:_,label:T.categories[H]||H.toString(),seriesName:A.name,animationDelay:(q*l.length+H)*(Le.value/4),isHighlighted:Q,isDimmed:$,isHidden:O,barPath:ne,isSmooth:oe.value&&Z>0})})})}else{const m=r+1,y=k.value.width/m,C=y*.8,w=C/c,x=w*.05,S=w-x;l.forEach((A,q)=>{const G=T.series.findIndex(_=>_===A),Q=I.value===G,$=I.value!==null&&I.value!==G,O=we.value.has(G);A.data.forEach((_,H)=>{if(_==null||typeof _!="number"||!isFinite(_))return;const F=k.value.left+(H+.5)*y-C/2+q*w+x/2,W=Qe(Math.max(0,_)),Z=Math.abs(Qe(0)-Qe(_));let ne="";if(oe.value&&Z>0){const se=Math.min(vo.value,S/2,Z/2);ne=[`M ${F} ${W+Z}`,`L ${F} ${W+se}`,`Q ${F} ${W} ${F+se} ${W}`,`L ${F+S-se} ${W}`,`Q ${F+S} ${W} ${F+S} ${W+se}`,`L ${F+S} ${W+Z}`,"Z"].join(" ")}t.push({x:F,y:W,width:S,height:Z,color:J(G),value:_,label:T.categories[H]||H.toString(),seriesName:A.name,animationDelay:(q*l.length+H)*(Le.value/4),isHighlighted:Q,isDimmed:$,isHidden:O,barPath:ne,isSmooth:oe.value&&Z>0})})})}return t}),vl=e.computed(()=>{if(!Pe.value)return[];const t=qt.value.map((v,y)=>({series:v,originalIndex:y})).filter(({originalIndex:v})=>!we.value.has(v));if(t.length===0)return[];let r=le.value==="semi-radial"?Math.PI:-Math.PI/2;const l=le.value==="semi-radial"?Math.PI:Math.PI*2,c=[];if(t.length===1){const{series:v,originalIndex:y}=t[0],C=v.data[0]||0,w=r,x=r+l-.001,S=w+l/2,A=Me.value+Math.cos(w)*We.value,q=Be.value+Math.sin(w)*We.value,G=Me.value+Math.cos(x)*We.value,Q=Be.value+Math.sin(x)*We.value,$=Me.value+Math.cos(x)*ve.value,O=Be.value+Math.sin(x)*ve.value,_=Me.value+Math.cos(w)*ve.value,H=Be.value+Math.sin(w)*ve.value,j=1,R=[`M ${A} ${q}`,`A ${We.value} ${We.value} 0 ${j} 1 ${G} ${Q}`,`L ${$} ${O}`,`A ${ve.value} ${ve.value} 0 ${j} 0 ${_} ${H}`,"Z"].join(" ");return c.push({path:R,color:J(y),value:C,seriesName:v.name,opacity:.8,isHighlighted:I.value===y,isDimmed:!1,isHidden:!1,startAngle:w,endAngle:x,midAngle:S}),c}const m=t.reduce((v,{series:y})=>v+(y.data[0]||0),0);return m===0?[]:(t.forEach(({series:v,originalIndex:y})=>{const C=v.data[0]||0,w=C/m*l,x=r,S=r+w,A=x+w/2,q=Me.value+Math.cos(x)*We.value,G=Be.value+Math.sin(x)*We.value,Q=Me.value+Math.cos(S)*We.value,$=Be.value+Math.sin(S)*We.value,O=Me.value+Math.cos(S)*ve.value,_=Be.value+Math.sin(S)*ve.value,H=Me.value+Math.cos(x)*ve.value,j=Be.value+Math.sin(x)*ve.value,R=w>Math.PI?1:0,F=[`M ${q} ${G}`,`A ${We.value} ${We.value} 0 ${R} 1 ${Q} ${$}`,`L ${O} ${_}`,`A ${ve.value} ${ve.value} 0 ${R} 0 ${H} ${j}`,"Z"].join(" ");c.push({path:F,color:J(y),value:C,seriesName:v.name,opacity:.8,isHighlighted:I.value===y,isDimmed:I.value!==null&&I.value!==y,isHidden:!1,startAngle:x,endAngle:S,midAngle:A}),r=S}),c)}),Ll=e.computed(()=>!Oo.value||!Pe.value?[]:vl.value.map((t,r)=>{if(t.isHidden)return null;const l=bo.value,c=Eo.value,m=ol.value,v=Me.value+Math.cos(t.midAngle)*ve.value,y=Be.value+Math.sin(t.midAngle)*ve.value,C=Me.value+Math.cos(t.midAngle)*(ve.value+l),w=Be.value+Math.sin(t.midAngle)*(ve.value+l),x=Math.cos(t.midAngle)>=0,A=C+c*(x?1:-1),q=w,G=x?C+15:C-15,Q=q-m,$=x?"start":"end";return{pointerStartX:v,pointerStartY:y,pointerEndX:C,pointerEndY:w,horizontalEndX:A,horizontalEndY:q,textX:G,textY:Q,text:`${t.seriesName}: ${t.value}`,color:t.color,textAnchor:$,isRightSide:x,isHighlighted:t.isHighlighted,isDimmed:t.isDimmed}}).filter(Boolean)),yo=t=>{if(!t||t.isHidden)return 0;const r=t.opacity||Wo.value||.7;return I.value===null||I.value===void 0?r:I.value!==null?t.seriesIndex===I.value?Math.min(1,r+.1):Math.max(.5,r*.8):r},gl=t=>{if(!t||t.isHidden)return 0;const r=t.radius>20?.9:.8;return I.value!==null?t.seriesIndex===I.value?Math.min(1,r+.1):r*.7:r},ro=(t,r)=>{if(t)try{if(I.value===t.seriesIndex?I.value=null:I.value=t.seriesIndex,typeof window<"u"&&window.dispatchEvent){const l=new CustomEvent("dss-bubble-click",{detail:{bubble:t,originalEvent:r,chartId:T.chartId}});window.dispatchEvent(l)}}catch(l){console.error("Error in onBubbleClick:",l)}},fl=(t,r)=>{const l=[`dss-bubble-fallback-${r}`];return t.isHighlighted&&l.push("dss-bubble-highlighted"),t.isDimmed&&l.push("dss-bubble-dimmed"),t.isHidden&&l.push("dss-bubble-hidden"),l.push(`dss-bubble-series-${t.seriesIndex}`),l.join(" ")},hl=(t,r)=>{t&&(r.stopPropagation(),u.value=!0,I.value=t.seriesIndex,Y.value.show=!1)},Al=(t,r)=>{let l;switch(t){case"x":l=r.originalX;break;case"y":l=r.originalY;break;case"size":l=r.originalSize;break;case"label":l=r.label;break;case"seriesName":l=r.seriesName;break;default:l=r[t]||""}const c=El.value[t];return typeof c=="function"?c(l,r):typeof l=="number"?l.toFixed(1):l?.toString()||""},Io=()=>{if(!ge.value||!Y.value.data||Y.value.data.length===0)return"Bubbles";const t=[],r=new Set;return Y.value.data.forEach(l=>{if(l.seriesName&&l.label){const c=`${l.seriesName} - ${l.label}`;r.has(c)||(t.push(c),r.add(c))}else l.seriesName&&(r.has(l.seriesName)||(t.push(l.seriesName),r.add(l.seriesName)))}),t.length>0?t.join(" | "):"Bubbles"},_o=(t,r)=>{t&&(u.value=!1,I.value=null)},Ko=(t,r)=>{const l=r.target.closest(".dss-custom-chart-container");if(!l)return;const c=l.getBoundingClientRect(),m=Te(t.categoryIndex),v=t.description||t.comment||"";let y=r.clientX-c.left+15,C=r.clientY-c.top-10;const w=200,x=v?80:50;y+w>z.value&&(y=r.clientX-c.left-w-15),C+x>te.value&&(C=r.clientY-c.top-x-10),y<0&&(y=10),C<0&&(C=10),Ct.value={show:!0,x:y,y:C,categoryValue:m,description:v}},yl=()=>{Ct.value.show=!1},Co=e.computed(()=>T.categories.length||Math.max(...Yt.value.map(t=>t.data.length))),$l=e.computed(()=>{let t=0;return Yt.value.forEach(r=>{r.data.forEach(l=>{typeof l=="number"&&(t=Math.max(t,l))})}),t||100}),io=e.computed(()=>{const t=[],r=Co.value;for(let l=0;l<r;l++){const c=l*2*Math.PI/r-Math.PI/2,m=Me.value+Math.cos(c)*ve.value,v=Be.value+Math.sin(c)*ve.value;t.push({x:m,y:v,angle:c,index:l})}return t}),zt=e.computed(()=>{const t=[],r=Co.value;return io.value.forEach((l,c)=>{const m=ve.value+15,v=c*2*Math.PI/r-Math.PI/2,y=Me.value+Math.cos(v)*m,C=Be.value+Math.sin(v)*m+5;let w="middle",x="middle";Math.abs(Math.cos(v))>.5&&(w=Math.cos(v)>0?"start":"end"),Math.abs(Math.sin(v))>.5&&(x=Math.sin(v)>0?"hanging":"auto"),t.push({x:y,y:C,text:T.categories[c]||`Axis ${c+1}`,anchor:w,baseline:x})}),t}),co=e.ref(new Set),Dl=(t,r,l)=>{const c=`current-${l}`,m=co.value.has(c);return!m&&I.value===null?r.fillOpacity||K.value:r.isHighlighted||m?(r.fillOpacity||K.value)+.15:r.isDimmed?(r.fillOpacity||K.value)*.3:r.fillOpacity||K.value},Pt=e.computed(()=>{if(!_e.value)return[];const t=[],r=Co.value;return qt.value.forEach((l,c)=>{const m=[],v=[],y=[],C=I.value===c,w=I.value!==null&&I.value!==c,x=we.value.has(c);for(let S=0;S<r;S++){const A=l.data[S]||0,G=A/$l.value*ve.value,Q=S*2*Math.PI/r-Math.PI/2,$=Me.value+Math.cos(Q)*G,O=Be.value+Math.sin(Q)*G;m.push(`${$},${O}`),v.push({x:$,y:O}),y.push({x:$,y:O,value:A,label:T.categories[S]||`Axis ${S+1}`,seriesName:l.name})}t.push({points:m.join(" "),polygonPoints:v,dataPoints:y,color:J(c),fillOpacity:K.value,seriesName:l.name,value:`${l.name}: ${l.data.join(", ")}`,isHighlighted:C,isDimmed:w,isHidden:x,seriesIndex:c})}),t}),Go=(t,r)=>{if(!r||r.length<3)return!1;let l=!1;for(let c=0,m=r.length-1;c<r.length;m=c++){const v=r[c].x,y=r[c].y,C=r[m].x,w=r[m].y;y>t.y!=w>t.y&&t.x<(C-v)*(t.y-y)/(w-y)+v&&(l=!l)}return l},Cl=t=>{if(!_e.value)return;const r=t.currentTarget.closest(".dss-custom-chart-container");if(!r)return;const l=r.getBoundingClientRect(),c=re.value?.getBoundingClientRect();if(!c)return;const m=t.clientX-c.left,v=t.clientY-c.top,y=Pt.value.filter(C=>C.isHidden?!1:Go({x:m,y:v},C.polygonPoints));if(y.length>0){y.length,I.value=y[0].seriesIndex;const C=t.clientX-l.left+10,w=t.clientY-l.top-10,x=200,S=50+y.length*25;let A=C,q=w;A+x>z.value&&(A=t.clientX-l.left-x-10),q+S>te.value&&(q=t.clientY-l.top-S-10),A<0&&(A=10),q<0&&(q=10);const G=y.map(Q=>{let $=Q.dataPoints[0],O=1/0;return Q.dataPoints.forEach(_=>{const H=Math.sqrt(Math.pow(_.x-m,2)+Math.pow(_.y-v,2));H<O&&(O=H,$=_)}),{seriesName:Q.seriesName,color:Q.color,value:$.value!==void 0?$.value:Q.value}});pe.value={show:!0,x:A,y:q,title:y.length===1?y[0].seriesName:"",value:"",spiderSeries:G}}else g()},ko=e.computed(()=>{const t=L.value;return t.logos.map((r,l)=>{const c=T.series[r.seriesIndex];if(!c||!c.data||c.data.length===0||we.value.has(r.seriesIndex))return null;let m,v;if(xe.value){const C=c.data.map((w,x)=>({x:Oe(x),y:Qe(w)}));if(t.animations.enabled&&!X.value&&t.animations.type==="draw"&&t.chart.type==="line"&&(E.value.isAnimating||!E.value.hasAnimated))if(E.value.isAnimating){const w=E.value.currentFrame/E.value.totalFrames,x=M(t.animations.easing,Math.min(w,1)),S=Rl(C,x);m=S.x+(r.offsetX||0),v=S.y+(r.offsetY||0)}else m=C[0].x+(r.offsetX||0),v=C[0].y+(r.offsetY||0);else{const w=c.data.length-1,x=c.data[w];m=Oe(w)+(r.offsetX||0),v=Qe(x)+(r.offsetY||0)}}else if(Pe.value||_e.value){const C=Math.PI*2/t.logos.length*l;m=Me.value+Math.cos(C)*(ve.value+30)+(r.offsetX||0),v=Be.value+Math.sin(C)*(ve.value+30)+(r.offsetY||0)}return{...r,x:m,y:v,seriesIndex:r.seriesIndex}}).filter(Boolean)}),n=t=>{const r=document.querySelector(`.dss-logo-fallback-${t}`),l=document.querySelector(`.dss-logo-image-${t}`);r&&(r.style.opacity="0"),l&&(l.style.opacity="1")},o=t=>{console.warn(`Logo ${t} failed to load, keeping fallback circle`);const r=document.querySelector(`.dss-logo-image-${t}`);r&&(r.style.display="none")},a=t=>{we.value.has(t)?we.value.delete(t):we.value.add(t)},i=e.computed(()=>{if(!pe.value.show&&!(De.value&&Y.value.show&&!N.value.isZooming))return{display:"none"};let t,r;if(De.value&&Y.value.show&&!N.value.isZooming){t=Y.value.x+15,r=k.value.top;const l=ge.value?200:150;t+l>z.value&&(t=Y.value.x-l-15),t<0&&(t=10),r<10&&(r=10)}else t=pe.value.x,r=pe.value.y;return{left:t+"px",top:r+"px"}}),s=(t,r)=>{if(p.value)return;const c=r.target.closest(".dss-custom-chart-container").getBoundingClientRect();let m=r.clientX-c.left+10,v=r.clientY-c.top-10;const y=200,C=120,w=z.value,x=te.value;m+y>w&&(m=r.clientX-c.left-y-10),v+C>x&&(v=r.clientY-c.top-C-10),m<0&&(m=10),v<0&&(v=10);let S;typeof t.categoryIndex=="number"?S=t.categoryIndex:typeof t.dataIndex=="number"?S=t.dataIndex:t.label&&T.categories.includes(t.label)&&(S=T.categories.indexOf(t.label));const A=(dt.value||le.value==="bar")&&t.label?t.label:t.seriesName||t.label||"";pe.value={show:!0,x:m,y:v,title:A,value:t.value?.toString()||"",categoryIndex:S,spiderSeries:[]}},d=e.ref(!1),u=e.ref(!1),g=()=>{pe.value.show=!1,pe.value.spiderSeries=[],Y.value.show=!1,d.value||(I.value=null)},p=e.ref(!1),f=(t,r)=>{p.value=!0,pe.value.show=!1,Y.value.show=!1;const c=r.target.closest(".dss-custom-chart-container").getBoundingClientRect();let m=r.clientX-c.left+15,v=r.clientY-c.top-10;const y=250;m+y>z.value&&(m=r.clientX-c.left-y-15),m<0&&(m=10),v<0&&(v=10),Vo.value={show:!0,x:m,y:v,content:t.texts,count:t.totalCount}},b=()=>{p.value=!1,Vo.value.show=!1},E=e.ref({isAnimating:!1,currentFrame:0,totalFrames:0,animationId:null,hasAnimated:!1}),M=(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}},X=e.computed(()=>lo.value?window.matchMedia("(prefers-reduced-motion: reduce)").matches:!1),ke=()=>{if(!oo.value||X.value){E.value.hasAnimated=!0;return}E.value.isAnimating=!0,E.value.currentFrame=0,E.value.totalFrames=Math.ceil(Xe.value/16.67);const t=()=>{const r=E.value.currentFrame/E.value.totalFrames,l=M(je.value,Math.min(r,1));lt(l),r<1?(E.value.currentFrame++,E.value.animationId=requestAnimationFrame(t)):Fe()};E.value.animationId=requestAnimationFrame(t)},lt=t=>{const r=document.querySelector(".dss-custom-chart-container");r&&r.style.setProperty("--dss-animation-progress",t)},Fe=()=>{E.value.isAnimating=!1,E.value.hasAnimated=!0,E.value.animationId&&(cancelAnimationFrame(E.value.animationId),E.value.animationId=null)},be=e.computed(()=>{if(!oo.value||X.value||E.value.hasAnimated)return{};const t={};return t["--dss-animation-duration"]=`${Xe.value}ms`,t["--dss-animation-easing"]=Jt(je.value),t["--dss-stagger-delay"]=`${Le.value}ms`,t}),Jt=t=>({linear:"linear",ease:"ease","ease-in":"ease-in","ease-out":"ease-out","ease-in-out":"ease-in-out"})[t]||"ease-out",kl=()=>{if(!oo.value||X.value)return"";const t=["dss-chart-animated"];return E.value.hasAnimated||t.push(`dss-animate-${Wt.value}`),E.value.hasAnimated||(Pe.value?t.push("dss-animate-fill"):t.push(`dss-animate-${Wt.value}`)),E.value.isAnimating&&t.push("dss-is-animating"),t.join(" ")};e.watch(()=>T.series,(t,r)=>{rt.value&&r&&E.value.hasAnimated&&(E.value.hasAnimated=!1,e.nextTick(()=>{setTimeout(()=>ke(),Lt.value)}))},{deep:!0}),e.watch(()=>N.value.isZooming,(t,r)=>{r&&!t&&setTimeout(()=>{Bo()},50)}),e.watch(()=>[N.value.scale,N.value.offsetX],()=>{!N.value.isZooming&&!N.value.isDragging&&Bo()},{flush:"post"}),e.watch([xo,st],([t,r])=>{N.value.minScale=t,N.value.maxScale=r,(N.value.scale<t||N.value.scale>r)&&Ao()},{immediate:!0}),e.watch(()=>T.locale,t=>{t&&t!==B.value&&(B.value=t)},{immediate:!0}),e.watch(()=>ae.value.show,t=>{t?e.nextTick(()=>{document.addEventListener("click",Lo)}):document.removeEventListener("click",Lo)}),e.onMounted(()=>{I.value=null,Ml(),oo.value&&!X.value?setTimeout(()=>ke(),Lt.value):E.value.hasAnimated=!0,document.addEventListener("mousemove",Qo),document.addEventListener("mouseup",Jo),document.addEventListener("click",Ue)}),e.onUnmounted(()=>{E.value.animationId&&cancelAnimationFrame(E.value.animationId),N.value.zoomTimeout&&clearTimeout(N.value.zoomTimeout),document.removeEventListener("mousemove",Qo),document.removeEventListener("mouseup",Jo),document.removeEventListener("click",Ue),document.removeEventListener("click",Lo)});const Qo=t=>{if(N.value.isDragging&&N.value.scale>1&&xe.value){Y.value.show=!1;const r=t.clientX-N.value.lastMouseX,{minX:l,maxX:c}=ye.value,m=c-l||1,y=r*.8;N.value.offsetX+=y;const C=m/N.value.scale,w=m-C,x=0,S=-w/m*k.value.width,A=x;N.value.offsetX=Math.max(S,Math.min(A,N.value.offsetX)),N.value.lastMouseX=t.clientX,N.value.lastMouseY=t.clientY}},Jo=()=>{N.value.isDragging&&(N.value.isDragging=!1,setTimeout(()=>{!N.value.isDragging&&N.value.isZooming},100))},Rl=(t,r)=>{if(!t||t.length===0)return{x:0,y:0};if(t.length===1||r<=0)return t[0];if(r>=1)return t[t.length-1];let l=0;const c=[];for(let y=1;y<t.length;y++){const C=t[y].x-t[y-1].x,w=t[y].y-t[y-1].y,x=Math.sqrt(C*C+w*w);c.push(x),l+=x}const m=l*r;let v=0;for(let y=0;y<c.length;y++){const C=v+c[y];if(m<=C){const w=(m-v)/c[y],x=t[y],S=t[y+1];return{x:x.x+(S.x-x.x)*w,y:x.y+(S.y-x.y)*w}}v=C}return t[t.length-1]};return(t,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{class:e.normalizeClass(["dss-custom-chart-container",kl()]),style:e.normalizeStyle({width:z.value+"px",height:te.value+20+"px",...be.value,cursor:Ye()}),"data-chart-type":le.value,ref_key:"containerEl",ref:V,onWheel:Uo,onMousedown:il,onMousemove:Mo,onMouseup:cl,onMouseleave:Vl,onDblclick:Ao,onContextmenu:e.withModifiers(Sl,["prevent"]),onClick:e.withModifiers(kt,["left"]),onWheelCapture:Uo},[e.createElementVNode("div",Yl,[e.createElementVNode("div",jl,[ce.value?(e.openBlock(),e.createElementBlock("div",Kl,e.toDisplayString(ce.value),1)):e.createCommentVNode("",!0),ue.value?(e.openBlock(),e.createElementBlock("div",Gl,e.toDisplayString(ue.value),1)):e.createCommentVNode("",!0)]),Ee.value&&($e.value==="top"||$e.value==="bottom")?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["dss-chart-legend",{"dss-legend-horizontal":uo.value==="horizontal","dss-legend-vertical":uo.value==="vertical","dss-legend-top":$e.value==="top","dss-legend-bottom":$e.value==="bottom"}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(T.series,(l,c)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-${c}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":we.value.has(c),"dss-legend-hovered":I.value===c,"dss-legend-dimmed":I.value!==null&&I.value!==c}]),onClick:m=>a(c),onMouseenter:m=>No(c),onMouseleave:ll,style:e.normalizeStyle({animationDelay:`${c*100}ms`})},[e.createElementVNode("div",{class:"dss-legend-color",style:e.normalizeStyle({backgroundColor:J(c)})},null,4),e.createElementVNode("span",Jl,e.toDisplayString(l.name),1)],46,Ql))),128))],2)):e.createCommentVNode("",!0)]),Ee.value&&($e.value==="left"||$e.value==="right")?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["dss-chart-legend-side",{"dss-legend-left":$e.value==="left","dss-legend-right":$e.value==="right"}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(T.series,(l,c)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-${c}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":we.value.has(c),"dss-legend-hovered":I.value===c,"dss-legend-dimmed":I.value!==null&&I.value!==c}]),onClick:m=>a(c),onMouseenter:m=>No(c),onMouseleave:ll,style:e.normalizeStyle({animationDelay:`${c*100}ms`})},[e.createElementVNode("div",{class:"dss-legend-color",style:e.normalizeStyle({backgroundColor:J(c)})},null,4),e.createElementVNode("span",tn,e.toDisplayString(l.name),1)],46,en))),128))],2)):e.createCommentVNode("",!0),(e.openBlock(),e.createElementBlock("svg",{width:z.value,height:te.value,class:"dss-chart-svg","data-smooth":oe.value,"data-animated":oo.value,ref_key:"svgEl",ref:re},[e.createElementVNode("defs",null,[e.createElementVNode("clipPath",ln,[e.createElementVNode("rect",{x:k.value.left,y:k.value.top,width:k.value.width,height:k.value.height*4},null,8,nn)])]),xe.value||ge.value?(e.openBlock(),e.createElementBlock("g",an,[ee.value?(e.openBlock(),e.createElementBlock("g",sn,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ft.value,(l,c)=>(e.openBlock(),e.createElementBlock("line",{key:`h-grid-${c}`,x1:k.value.left,x2:k.value.right,y1:l.y,y2:l.y,stroke:"#e0e0e0","stroke-width":"1","stroke-dasharray":"4,2",style:e.normalizeStyle({animationDelay:`${c*50}ms`})},null,12,rn))),128))])):e.createCommentVNode("",!0),e.createElementVNode("g",cn,[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,un),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,dn)]),e.createElementVNode("g",mn,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(mt.value,(l,c)=>(e.openBlock(),e.createElementBlock("text",{key:`x-${c}`,x:l.x,y:l.y,"text-anchor":"middle","font-size":"12",fill:"#666",style:e.normalizeStyle({animationDelay:`${c*100}ms`})},e.toDisplayString(l.text),13,pn))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(so.value,(l,c)=>(e.openBlock(),e.createElementBlock("text",{key:`y-${c}`,x:l.x,y:l.y,"text-anchor":"end","font-size":"12",fill:"#666","dominant-baseline":"middle",style:e.normalizeStyle({animationDelay:`${c*80}ms`})},e.toDisplayString(l.text),13,vn))),128)),at.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(at.value),9,gn)):e.createCommentVNode("",!0),wo.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(wo.value),9,fn)):e.createCommentVNode("",!0)]),Zo.value.length>0?(e.openBlock(),e.createElementBlock("g",hn,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Zo.value,l=>(e.openBlock(),e.createElementBlock("g",{key:`flag-group-${l.categoryIndex}`},[e.createElementVNode("g",yn,[l.hasManual?(e.openBlock(),e.createElementBlock("line",{key:0,x1:l.x,x2:l.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:c=>f(l,c),onMouseleave:b},null,40,Cn)):e.createCommentVNode("",!0),l.hasAuto&&!l.hasManual?(e.openBlock(),e.createElementBlock("line",{key:1,x1:l.x,x2:l.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:c=>f(l,c),onMouseleave:b},null,40,kn)):e.createCommentVNode("",!0),l.hasAuto&&l.hasManual?(e.openBlock(),e.createElementBlock("line",{key:2,x1:l.x,x2:l.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:c=>f(l,c),onMouseleave:b},null,40,wn)):e.createCommentVNode("",!0)]),l.hasManual&&l.hasAuto?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:l.x+8,cy:Math.max(15,k.value.top-10),r:"14",fill:"#0dbf89",stroke:"#fafafa","stroke-width":"2",class:"flag-count-circle",onMouseover:c=>f(l,c),onMouseleave:b},null,40,xn)):e.createCommentVNode("",!0),e.createElementVNode("circle",{cx:l.x,cy:Math.max(15,k.value.top-10),r:"14",fill:l.hasManual&&l.hasAuto||l.hasManual?"#047395":"#0dbf89",stroke:"#fafafa","stroke-width":"2",class:"dss-flag-count-indicator",onMouseover:c=>f(l,c),onMouseleave:b},null,40,bn),e.createElementVNode("text",{x:l.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(l.totalCount),9,En)]))),128))])):e.createCommentVNode("",!0),e.createElementVNode("g",Vn,[Et.value?(e.openBlock(),e.createElementBlock("g",Sn,[e.createElementVNode("g",Nn,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Qt.value,(l,c)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`mixed-bar-${c}`},[l.isSmooth?(e.openBlock(),e.createElementBlock("path",{key:0,d:l.barPath,stroke:"#fafafa","stroke-width":"1",class:e.normalizeClass({"dss-bar-highlighted":l.isHighlighted,"dss-bar-dimmed":l.isDimmed,"dss-bar-hidden":l.isHidden}),style:e.normalizeStyle({fill:l.color,fillOpacity:l.isDimmed?.4:1,animationDelay:`${l.animationDelay}ms`}),onMouseover:m=>s(l,m),onMouseleave:g},null,46,Mn)):(e.openBlock(),e.createElementBlock("rect",{key:1,x:l.x,y:l.y,width:l.width,height:l.height,fill:l.color,stroke:"#fafafa","stroke-width":"1",class:e.normalizeClass({"dss-bar-highlighted":l.isHighlighted,"dss-bar-dimmed":l.isDimmed,"dss-bar-hidden":l.isHidden}),style:e.normalizeStyle({animationDelay:`${l.animationDelay}ms`}),onMouseover:m=>s(l,m),onMouseleave:g},null,46,Bn))],64))),128))]),e.createElementVNode("g",Hn,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(jo.value,(l,c)=>(e.openBlock(),e.createElementBlock("path",{key:`mixed-line-${c}`,d:l.path,stroke:l.color,"stroke-width":l.isHighlighted?Ve.value+2:Ve.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass({"dss-series-highlighted":l.isHighlighted,"dss-series-dimmed":l.isDimmed,"dss-series-hidden":l.isHidden}),style:e.normalizeStyle({"--dss-path-length":l.pathLength,animationDelay:`${l.animationDelay}ms`})},null,14,Tn))),128)),fe.value>0||Ht.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(Gt.value,(l,c)=>(e.openBlock(),e.createElementBlock("circle",{key:`mixed-point-${c}`,cx:l.x,cy:l.y,r:l.isHighlighted?tt(l,fe.value)+2:tt(l,fe.value),fill:l.color,stroke:"#fafafa","stroke-width":"2",class:e.normalizeClass({"dss-point-highlighted":l.isHighlighted,"dss-point-dimmed":l.isDimmed,"dss-point-hidden":l.isHidden}),style:e.normalizeStyle({animationDelay:`${l.animationDelay}ms`}),onMouseover:m=>s(l,m),onMouseleave:g},null,46,Ln))),128)):e.createCommentVNode("",!0)])])):le.value==="line"?(e.openBlock(),e.createElementBlock("g",An,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(jo.value,(l,c)=>(e.openBlock(),e.createElementBlock("path",{key:`line-${c}`,d:l.path,stroke:l.color,"stroke-width":l.isHighlighted?Ve.value+2:Ve.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass({"dss-series-highlighted":l.isHighlighted,"dss-series-dimmed":l.isDimmed,"dss-series-hidden":l.isHidden}),style:e.normalizeStyle({"--dss-path-length":l.pathLength,animationDelay:`${l.animationDelay}ms`})},null,14,$n))),128)),fe.value>0||Ht.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(Kt.value,(l,c)=>(e.openBlock(),e.createElementBlock("circle",{key:`point-${c}`,cx:l.x,cy:l.y,r:l.isHighlighted?tt(l,fe.value)+2:tt(l,fe.value),fill:l.color,stroke:"#fafafa","stroke-width":"2",class:e.normalizeClass({"dss-point-highlighted":l.isHighlighted,"dss-point-dimmed":l.isDimmed,"dss-point-hidden":l.isHidden}),style:e.normalizeStyle({animationDelay:`${l.animationDelay}ms`}),onMouseover:m=>s(l,m),onMouseleave:g},null,46,Dn))),128)):e.createCommentVNode("",!0)])):le.value==="area"?(e.openBlock(),e.createElementBlock("g",Rn,[e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Mt.value,(l,c)=>(e.openBlock(),e.createElementBlock("mask",{key:`mask-${c}`,id:`area-mask-${c}-${D.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,_n)],8,In))),128))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Mt.value,(l,c)=>(e.openBlock(),e.createElementBlock("path",{key:`area-fill-${c}`,d:l.areaPath,fill:l.color,"fill-opacity":l.isHighlighted?po.value+.2:po.value,mask:`url(#area-mask-${c}-${D.chartId})`,class:e.normalizeClass({"dss-area-fill-smooth":!0,"dss-series-highlighted":l.isHighlighted,"dss-series-dimmed":l.isDimmed,"dss-series-hidden":l.isHidden})},null,10,Fn))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Mt.value,(l,c)=>(e.openBlock(),e.createElementBlock("path",{key:`area-line-${c}`,d:l.linePath,stroke:l.color,"stroke-width":l.isHighlighted?Ve.value+1:Ve.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass({"dss-area-line-animated":!0,"dss-series-highlighted":l.isHighlighted,"dss-series-dimmed":l.isDimmed,"dss-series-hidden":l.isHidden}),style:e.normalizeStyle({"--dss-path-length":l.pathLength,animationDelay:`${c*Le.value}ms`})},null,14,zn))),128))])):le.value==="bar"?(e.openBlock(),e.createElementBlock("g",Pn,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Qt.value,(l,c)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`bar-${c}`},[l.isSmooth?(e.openBlock(),e.createElementBlock("path",{key:0,d:l.barPath,fill:l.color,stroke:"#fafafa","stroke-width":"1",class:e.normalizeClass({"dss-bar-highlighted":l.isHighlighted,"dss-bar-dimmed":l.isDimmed,"dss-bar-hidden":l.isHidden}),style:e.normalizeStyle({animationDelay:`${l.animationDelay}ms`}),onMouseover:m=>s(l,m),onMouseleave:g},null,46,On)):(e.openBlock(),e.createElementBlock("rect",{key:1,x:l.x,y:l.y,width:l.width,height:l.height,stroke:"#fafafa","stroke-width":"1",class:e.normalizeClass({"dss-bar-highlighted":l.isHighlighted,"dss-bar-dimmed":l.isDimmed,"dss-bar-hidden":l.isHidden}),style:e.normalizeStyle({fill:l.color,fillOpacity:l.isDimmed?.4:1,animationDelay:`${l.animationDelay}ms`}),onMouseover:m=>s(l,m),onMouseleave:g},null,46,Zn))],64))),128))])):e.createCommentVNode("",!0)]),De.value&&Y.value.show&&!N.value.isZooming?(e.openBlock(),e.createElementBlock("g",Xn,[e.createElementVNode("line",{x1:Y.value.x,x2:Y.value.x,y1:k.value.top,y2:k.value.bottom,stroke:mo.value,"stroke-width":"1","stroke-dasharray":"4,4",opacity:"0.8"},null,8,Un),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Y.value.data,(l,c)=>(e.openBlock(),e.createElementBlock("circle",{key:`dss-crosshair-point-${c}`,cx:Y.value.x,cy:l.y,r:fe.value+2,fill:l.color,stroke:"#fafafa","stroke-width":"2",opacity:"0.9"},null,8,Wn))),128))])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),ge.value?(e.openBlock(),e.createElementBlock("g",qn,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Nt.value,(l,c)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`bubble-${c}`},[l?(e.openBlock(),e.createElementBlock("g",Yn,[e.createElementVNode("circle",{cx:l.x,cy:l.y,r:l.radius,fill:l.color,"fill-opacity":yo(l),stroke:l.color,"stroke-width":l.isHighlighted?3:1,"stroke-opacity":"0.8",class:e.normalizeClass(fl(l,c)),style:{cursor:"pointer",transition:"all 0.3s ease"},onMouseenter:m=>hl(l,m),onMouseleave:m=>_o(l),onClick:m=>ro(l,m)},null,42,jn),l.imageUrl?(e.openBlock(),e.createElementBlock("image",{key:0,x:l.x-l.radius*.65,y:l.y-l.radius*.65,width:l.radius*1.3,height:l.radius*1.3,"xlink:href":l.imageUrl,class:e.normalizeClass(`dss-bubble-image-${c} ${l.isHighlighted?"dss-bubble-highlighted":""} ${l.isDimmed?"dss-bubble-dimmed":""} ${l.isHidden?"dss-bubble-hidden":""}`),"clip-path":`circle(${l.radius*.65}px at ${l.radius*.65}px ${l.radius*.65}px)`,style:e.normalizeStyle({cursor:"pointer",transition:"all 0.3s ease",opacity:gl(l)}),onLoad:m=>ml(c),onError:m=>Tl(c),onMouseenter:m=>hl(l,m),onMouseleave:m=>_o(l),onClick:m=>ro(l,m)},null,46,Kn)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],64))),128))])):e.createCommentVNode("",!0),Pe.value?(e.openBlock(),e.createElementBlock("g",Gn,[le.value==="radial"?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:Me.value,cy:Be.value,r:ve.value,fill:"none",stroke:"#e0e0e0","stroke-width":"1"},null,8,Qn)):e.createCommentVNode("",!0),e.createElementVNode("g",{class:"dss-radial-data","data-chart-type":le.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(vl.value,(l,c)=>(e.openBlock(),e.createElementBlock("path",{key:`radial-${c}`,d:l.path,fill:l.color,"fill-opacity":l.isHighlighted?(l.opacity||.8)+.2:l.opacity||.8,stroke:l.color,"stroke-width":l.isHighlighted?2:1,class:e.normalizeClass({"dss-series-highlighted":l.isHighlighted,"dss-series-dimmed":l.isDimmed,"dss-series-hidden":l.isHidden}),onMouseover:m=>s(l,m),onMouseleave:g},null,42,ea))),128))],8,Jn),Oo.value?(e.openBlock(),e.createElementBlock("g",ta,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ll.value,(l,c)=>(e.openBlock(),e.createElementBlock("g",{key:`radial-label-${c}`,class:e.normalizeClass({"dss-label-highlighted":l.isHighlighted,"dss-label-dimmed":l.isDimmed})},[e.createElementVNode("line",{x1:l.pointerStartX,y1:l.pointerStartY,x2:l.pointerEndX,y2:l.pointerEndY,stroke:l.color,"stroke-width":"1.5",opacity:"0.8",style:e.normalizeStyle({animationDelay:`${c*100}ms`})},null,12,oa),e.createElementVNode("line",{x1:l.pointerEndX,y1:l.pointerEndY,x2:l.horizontalEndX,y2:l.horizontalEndY,stroke:l.color,"stroke-width":"1.5",opacity:"0.8",style:e.normalizeStyle({animationDelay:`${c*120}ms`})},null,12,la),e.createElementVNode("text",{x:l.textX,y:l.textY,"text-anchor":l.textAnchor,"font-size":tl.value,"dominant-baseline":"middle",style:e.normalizeStyle({animationDelay:`${c*150}ms`})},e.toDisplayString(l.text),13,na)],2))),128))])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),_e.value?(e.openBlock(),e.createElementBlock("g",aa,[ee.value?(e.openBlock(),e.createElementBlock("g",sa,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ke.value,(l,c)=>(e.openBlock(),e.createElementBlock("circle",{key:`spider-grid-circle-${c}`,cx:Me.value,cy:Be.value,r:l,fill:"none",stroke:"#dedede","stroke-width":"1",style:e.normalizeStyle({animationDelay:`${c*150}ms`})},null,12,ra))),128)),e.createElementVNode("g",ia,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ke.value,(l,c)=>(e.openBlock(),e.createElementBlock("g",{key:`spider-grid-label-group-${c}`},[e.createElementVNode("rect",{x:Me.value-16,y:Be.value-l-7,width:"32",height:"16",fill:"#fafafa",stroke:"none"},null,8,ca),e.createElementVNode("text",{x:Me.value,y:Be.value-l+2,"text-anchor":"middle","dominant-baseline":"central",class:"dss-spider-grid-label",style:{fontSize:"10px",fill:"#999",fontWeight:"600"}},e.toDisplayString(At(c)),9,ua)]))),128))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(io.value,(l,c)=>(e.openBlock(),e.createElementBlock("line",{key:`spider-axis-${c}`,x1:Me.value,x2:l.x,y1:Be.value,y2:l.y,stroke:"#dedede","stroke-width":"1",style:e.normalizeStyle({animationDelay:`${c*100}ms`})},null,12,da))),128))])):e.createCommentVNode("",!0),e.createElementVNode("g",ma,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(zt.value,(l,c)=>(e.openBlock(),e.createElementBlock("text",{key:`spider-label-${c}`,x:l.x+Math.cos(c*2*Math.PI/Co.value-Math.PI/2)*16,y:l.y+Math.sin(c*2*Math.PI/Co.value-Math.PI/2)*16,"text-anchor":l.anchor,"dominant-baseline":l.baseline,"font-size":"14px",fill:"#666","font-weight":"500",style:e.normalizeStyle({animationDelay:`${c*120}ms`})},e.toDisplayString(l.text.charAt(0).toUpperCase()+l.text.slice(1)),13,pa))),128))]),e.createElementVNode("g",{class:"dss-spider-data",onMousemove:Cl,onMouseleave:g},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Pt.value,(l,c)=>(e.openBlock(),e.createElementBlock("g",{key:`spider-${c}`},[e.createElementVNode("polygon",{points:l.points,fill:l.color,"fill-opacity":Dl("current",l,c),stroke:l.color,"stroke-width":l.isHighlighted?Ve.value+1:Ve.value,"stroke-linejoin":"round",class:e.normalizeClass({"dss-series-highlighted":l.isHighlighted,"dss-series-dimmed":l.isDimmed,"dss-series-hidden":l.isHidden}),style:e.normalizeStyle({animationDelay:`${c*Le.value}ms`,transition:"all 0.2s ease"})},null,14,va),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.dataPoints,(m,v)=>(e.openBlock(),e.createElementBlock("circle",{key:`spider-point-${c}-${v}`,cx:m.x,cy:m.y,r:l.isHighlighted?fe.value+1:fe.value>0?fe.value:0,fill:l.color,stroke:"#fafafa","stroke-width":"2",class:e.normalizeClass({"dss-point-highlighted":l.isHighlighted,"dss-point-dimmed":l.isDimmed,"dss-point-hidden":l.isHidden}),style:e.normalizeStyle({animationDelay:`${c*Le.value+v*50}ms`,transition:"all 0.2s ease"}),onMouseover:y=>s(m,y),onMouseleave:g},null,46,ga))),128))]))),128))],32)])):e.createCommentVNode("",!0),e.createElementVNode("g",fa,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ko.value,(l,c)=>(e.openBlock(),e.createElementBlock("circle",{key:`logo-fallback-${c}`,cx:l.x,cy:l.y,r:l.width/2,fill:J(l.seriesIndex),stroke:"#fafafa","stroke-width":"2",class:e.normalizeClass(`logo-fallback-${c}`),style:e.normalizeStyle({animationDelay:`${c*200}ms`})},null,14,ha))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ko.value,(l,c)=>(e.openBlock(),e.createElementBlock("image",{key:`logo-${c}`,x:l.x-l.width/2,y:l.y-l.height/2,width:l.width,height:l.height,"xlink:href":l.url,onLoad:m=>n(c),onError:m=>o(c),class:e.normalizeClass(`dss-logo-image-${c}`),"clip-path":`circle(${l.width/2}px at ${l.width/2}px ${l.height/2}px)`,style:e.normalizeStyle({animationDelay:`${c*200}ms`})},null,46,ya))),128))])],8,on)),ot.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-chart-watermark",style:e.normalizeStyle({position:"absolute",top:"0px",left:"0px",width:z.value+"px",height:te.value+"px",backgroundImage:`url('${el.value}')`,backgroundRepeat:"no-repeat",...ht.value,opacity:ut.value,pointerEvents:"none",zIndex:10})},null,4)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(gt.value,(l,c)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{key:"marker-"+l.id,class:"dss-chart-marker",style:e.normalizeStyle({position:"absolute",left:l.x+"px",top:l.y+"px",width:me.value+"px",height:me.value+"px",backgroundColor:"#fafafa",borderRadius:"50%",border:"2px solid #ddd",cursor:"pointer",zIndex:500}),onClick:e.withModifiers(m=>Ho(l),["stop"]),onMouseenter:m=>Ko(l,m),onMouseleave:yl},[e.createElementVNode("img",{src:ho(l),class:"dss-marker-icon",alt:"Marker Icon",style:{width:"100%",height:"100%","object-fit":"contain","border-radius":"50%","pointer-events":"none"}},null,8,ka)],44,Ca)),[[e.vShow,vt.value]])),128)),Ct.value.show?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-marker-tooltip",style:e.normalizeStyle({left:Ct.value.x+"px",top:Ct.value.y+"px"})},[e.createElementVNode("div",wa,e.toDisplayString(Ct.value.categoryValue),1),Ct.value.description?(e.openBlock(),e.createElementBlock("div",xa,e.toDisplayString(Ct.value.description),1)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),pe.value.show||De.value&&Y.value.show&&!N.value.isZooming?(e.openBlock(),e.createElementBlock("div",{key:3,class:e.normalizeClass(["dss-chart-tooltip",{"dss-crosshair-tooltip":De.value&&Y.value.show&&!N.value.isZooming}]),style:e.normalizeStyle(i.value)},[!De.value||!Y.value.show||N.value.isZooming?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[_e.value&&pe.value.spiderSeries&&pe.value.spiderSeries.length>0?(e.openBlock(),e.createElementBlock("div",ba,[pe.value.title?(e.openBlock(),e.createElementBlock("div",Ea,e.toDisplayString(pe.value.title),1)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(pe.value.spiderSeries,(l,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:l.color})},null,4),e.createElementVNode("span",Va,e.toDisplayString(l.seriesName)+":",1),e.createElementVNode("span",Sa,e.toDisplayString(l.value),1)]))),128))])):(e.openBlock(),e.createElementBlock("div",Na,[e.createElementVNode("div",Ma,e.toDisplayString(pe.value.title),1),e.createElementVNode("div",Ba,e.toDisplayString(pe.value.value),1)])),pe.value.categoryIndex!==void 0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[$t(pe.value.categoryIndex).flagGroups.length>0?(e.openBlock(),e.createElementBlock("div",Ha,[r[4]||(r[4]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",Ta,e.toDisplayString(e.unref(U)("chart.tooltip.flags")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList($t(pe.value.categoryIndex).flagGroups,(l,c)=>(e.openBlock(),e.createElementBlock("div",{key:`tooltip-flag-group-${c}`},[e.createElementVNode("div",La,[e.createElementVNode("div",{class:"dss-tooltip-item-indicator",style:e.normalizeStyle({backgroundColor:l.color})},null,4),e.createElementVNode("span",null,e.toDisplayString(l.type),1)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.flags,(m,v)=>(e.openBlock(),e.createElementBlock("div",{key:`tooltip-flag-${c}-${v}`,class:"dss-tooltip-item dss-tooltip-item-no-indicator"},[e.createElementVNode("div",Aa,[e.createElementVNode("div",$a,e.toDisplayString(m.text),1)])]))),128))]))),128))])):e.createCommentVNode("",!0),$t(pe.value.categoryIndex).markers.length>0?(e.openBlock(),e.createElementBlock("div",Da,[r[5]||(r[5]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",Ra,e.toDisplayString(e.unref(U)("chart.tooltip.markers")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList($t(pe.value.categoryIndex).markers,(l,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:l.color})},null,4),e.createElementVNode("div",Ia,[e.createElementVNode("div",_a,e.toDisplayString(l.title),1),l.description?(e.openBlock(),e.createElementBlock("div",Fa,e.toDisplayString(l.description),1)):e.createCommentVNode("",!0)])]))),128))])):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",za,[e.createElementVNode("div",Pa,e.toDisplayString(ge.value?Io():D.categories[Y.value.categoryIndex]||`Category ${Y.value.categoryIndex+1}`),1),ge.value?(e.openBlock(),e.createElementBlock("div",Oa,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Y.value.data,(l,c)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-tooltip-${c}`,class:"dss-bubble-tooltip-item"},e.toDisplayString(l.value),1))),128))])):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(Y.value.data,(l,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:l.color})},null,4),e.createElementVNode("span",Za,e.toDisplayString(l.seriesName)+":",1),e.createElementVNode("span",Xa,e.toDisplayString(l.value),1)]))),128))]),$t(Y.value.categoryIndex).flagGroups.length>0?(e.openBlock(),e.createElementBlock("div",Ua,[r[6]||(r[6]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",Wa,e.toDisplayString(e.unref(U)("chart.tooltip.flags")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList($t(Y.value.categoryIndex).flagGroups,(l,c)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-flag-group-${c}`},[e.createElementVNode("div",qa,[e.createElementVNode("div",{class:"dss-tooltip-item-indicator",style:e.normalizeStyle({backgroundColor:l.color})},null,4),e.createElementVNode("span",null,e.toDisplayString(l.type),1)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.flags,(m,v)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-flag-${c}-${v}`,class:"dss-tooltip-item dss-tooltip-item-no-indicator"},[e.createElementVNode("div",Ya,[e.createElementVNode("div",ja,e.toDisplayString(m.text),1)])]))),128))]))),128))])):e.createCommentVNode("",!0),$t(Y.value.categoryIndex).markers.length>0?(e.openBlock(),e.createElementBlock("div",Ka,[r[7]||(r[7]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",Ga,e.toDisplayString(e.unref(U)("chart.tooltip.markers")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList($t(Y.value.categoryIndex).markers,(l,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:l.color})},null,4),e.createElementVNode("div",Qa,[e.createElementVNode("div",Ja,e.toDisplayString(l.title),1),l.description?(e.openBlock(),e.createElementBlock("div",es,e.toDisplayString(l.description),1)):e.createCommentVNode("",!0)])]))),128))])):e.createCommentVNode("",!0)],64))],6)):e.createCommentVNode("",!0),xe.value&&qe.value&&N.value.scale>1?(e.openBlock(),e.createElementBlock("div",{key:4,class:"dss-zoom-indicator",onClick:Ao},[r[8]||(r[8]=e.createElementVNode("span",{style:{display:"inline-block",transform:"scaleX(-1)","font-size":"14px"}},"⌕",-1)),e.createTextVNode(" "+e.toDisplayString(Math.round(N.value.scale*100))+"% "+e.toDisplayString(e.unref(U)("chart.zoom.doubleClickToReset")),1)])):e.createCommentVNode("",!0)],46,ql),ae.value.show?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-chart-context-menu",style:e.normalizeStyle({left:ae.value.x+"px",top:ae.value.y+"px"}),onClick:r[0]||(r[0]=e.withModifiers(()=>{},["stop"]))},[Se.value.addMarker?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-context-menu-item",onClick:Hl},e.toDisplayString(e.unref(U)("chart.contextMenu.addMarker")),1)):e.createCommentVNode("",!0),Se.value.addMarker&&(Se.value.downloadSvg||Se.value.downloadPng||Se.value.downloadCsv||Ge.value.length>0)?(e.openBlock(),e.createElementBlock("div",ts)):e.createCommentVNode("",!0),Se.value.downloadSvg?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-context-menu-item",onClick:Ie},e.toDisplayString(e.unref(U)("chart.contextMenu.downloadSvg")),1)):e.createCommentVNode("",!0),Se.value.downloadPng?(e.openBlock(),e.createElementBlock("div",{key:3,class:"dss-context-menu-item",onClick:It},e.toDisplayString(e.unref(U)("chart.contextMenu.downloadPng")),1)):e.createCommentVNode("",!0),Se.value.downloadCsv?(e.openBlock(),e.createElementBlock("div",{key:4,class:"dss-context-menu-item",onClick:Bl},e.toDisplayString(e.unref(U)("chart.contextMenu.downloadCsv")),1)):e.createCommentVNode("",!0),Ge.value.length>0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:5},[Se.value.downloadSvg||Se.value.downloadPng||Se.value.downloadCsv?(e.openBlock(),e.createElementBlock("div",os)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ge.value,(l,c)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"custom-"+c},[l.separator?(e.openBlock(),e.createElementBlock("div",ls)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(wt(l)),style:e.normalizeStyle(Dt(l)),onClick:m=>rl(l)},[l.template?(e.openBlock(),e.createElementBlock("div",{key:0,innerHTML:Nl(l),class:"dss-custom-menu-content"},null,8,as)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[l.icon?(e.openBlock(),e.createElementBlock("span",ss,e.toDisplayString(l.icon),1)):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(l.label),1)],64))],14,ns)],64))),128))],64)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),P.value.show?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-marker-modal-overlay",onClick:ao},[e.createElementVNode("div",{class:"dss-marker-modal",onClick:r[3]||(r[3]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",rs,[e.createElementVNode("h3",null,e.toDisplayString(fo.value?e.unref(U)("chart.modalMarker.viewMarker"):go.value?e.unref(U)("chart.modalMarker.editMarker"):e.unref(U)("chart.contextMenu.addMarker")),1),e.createElementVNode("button",{class:"dss-modal-close-btn",onClick:ao},"×")]),e.createElementVNode("div",is,[e.createElementVNode("div",cs,e.toDisplayString(Te(P.value.categoryIndex)||""),1),e.createElementVNode("div",us,[e.createElementVNode("label",ds,e.toDisplayString(e.unref(U)("chart.modalMarker.description")),1),fo.value?(e.openBlock(),e.createElementBlock("div",ms,e.toDisplayString(P.value.description),1)):e.withDirectives((e.openBlock(),e.createElementBlock("textarea",{key:1,id:"dss-marker-description","onUpdate:modelValue":r[1]||(r[1]=l=>P.value.description=l),placeholder:e.unref(U)("chart.modalMarker.placeholderDescription"),class:"dss-form-textarea",rows:"3"},null,8,ps)),[[e.vModelText,P.value.description]])]),e.createElementVNode("div",vs,[e.createElementVNode("label",null,e.toDisplayString(e.unref(U)("chart.modalMarker.iconPreview")),1),e.createElementVNode("div",gs,[e.createElementVNode("img",{src:ho({type:P.value.type}),alt:"Marker Icon Preview",class:"preview-icon",style:{width:"32px",height:"32px","border-radius":"50%",border:"2px solid #ddd"},onError:r[2]||(r[2]=l=>l.target.style.display="none")},null,40,fs)])])]),e.createElementVNode("div",hs,[e.createElementVNode("div",ys,[go.value&&!fo.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-btn dss-btn-danger",onClick:nl},e.toDisplayString(e.unref(U)("chart.modalMarker.deleteMarker")),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",Cs,[e.createElementVNode("button",{class:"dss-btn dss-btn-secondary",onClick:ao},e.toDisplayString(fo.value?e.unref(U)("chart.modalMarker.close"):e.unref(U)("chart.modalMarker.cancel")),1),fo.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-btn dss-btn-primary",onClick:Rt,disabled:!(P.value.description&&P.value.description.length)},e.toDisplayString(go.value?e.unref(U)("chart.modalMarker.save"):e.unref(U)("chart.contextMenu.addMarker")),9,ks))])])])])):e.createCommentVNode("",!0)],64))}}),bs={class:"dss-modal-title"},Es={class:"dss-modal-actions"},Il={__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(D,{emit:Zt}){const U=D,B=Zt,pt=e.ref(null),V=e.ref(null),re=e.computed(()=>{const z={"max-width":U.width};return U.height!=="auto"&&(z.height=U.height,z["min-height"]="0"),z}),Xt=e.computed(()=>({}));function T(){B("close-modal")}function h(){U.backDrop&&!pt.value&&B("close-modal")}function ze(z){z.target.tagName==="INPUT"&&(pt.value=z.target.tagName)}function Ze(){setTimeout(()=>{pt.value=null},300)}function et(){const z=document.body,te=document.documentElement;V.value={bodyOverflow:z.style.overflow,bodyPosition:z.style.position,bodyTop:z.style.top,bodyWidth:z.style.width,htmlOverflow:te.style.overflow,scrollY:window.scrollY},z.style.overflow="hidden",z.style.position="fixed",z.style.top=`-${V.value.scrollY}px`,z.style.width="100%",z.style.left="0",te.style.overflow="hidden"}function L(){if(!V.value)return;const z=document.body,te=document.documentElement,{bodyOverflow:le,bodyPosition:nt,bodyTop:ce,bodyWidth:ue,htmlOverflow:at,scrollY:wo}=V.value;z.style.overflow=le||"",z.style.position=nt||"",z.style.top=ce||"",z.style.width=ue||"",z.style.left="",te.style.overflow=at||"",window.scrollTo(0,wo||0)}return e.watch(()=>U.showModal,z=>{if(z)et(),document.body.classList.add("dss-modal-open"),setTimeout(()=>{const te=document.getElementById("dss-modal-backdrop");te&&(te.addEventListener("focusin",ze),te.addEventListener("focusout",Ze))},100);else{L(),document.body.classList.remove("dss-modal-open");const te=document.getElementById("dss-modal-backdrop");te&&(te.removeEventListener("focusin",ze),te.removeEventListener("focusout",Ze))}},{immediate:!0}),e.onUnmounted(()=>{U.showModal&&L()}),(z,te)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[D.showModal?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-modal-backdrop",onClick:h},[e.withDirectives(e.createElementVNode("div",{id:"dss-modal-backdrop",class:"dss-modal",style:e.normalizeStyle(re.value)},[e.createElementVNode("div",{class:"dss-modal-content",onClick:te[0]||(te[0]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:"dss-modal-header",style:e.normalizeStyle({"justify-content":D.headerType,"font-size":D.titleSize})},[e.createElementVNode("h1",bs,[e.renderSlot(z.$slots,"title",{},()=>[te[1]||(te[1]=e.createTextVNode("Default Title",-1))])]),e.renderSlot(z.$slots,"title-data"),D.showCloseBtn?(e.openBlock(),e.createElementBlock("span",{key:0,class:"dss-modal-close",onClick:T,title:"Close"},"×")):e.createCommentVNode("",!0)],4),e.createElementVNode("div",{class:"dss-modal-body",style:e.normalizeStyle(Xt.value)},[e.renderSlot(z.$slots,"content",{},()=>[te[2]||(te[2]=e.createTextVNode("Default Content",-1))])],4),e.createElementVNode("div",Es,[e.renderSlot(z.$slots,"actions")])])],4),[[e.vShow,D.showModal]])])):e.createCommentVNode("",!0)]))}},Vs={class:"dss-toolbar-left"},Ss=["title"],Ns=["title"],Ms={class:"dss-toolbar-dropdown-wrapper"},Bs=["title"],Hs={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"},Ts={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"},Ls={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"},As={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"},$s={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"},Ds={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"},Rs={key:6,width:"13",height:"14",viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"paragraph-icon"},Is=["title"],_s=["title"],Fs=["title"],zs=["title"],Ps=["title"],Os={viewBox:"0 0 27 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{width:"20px",height:"20px"}},Zs=["title"],Xs={viewBox:"0 0 24 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{width:"20px",height:"20px"}},Us=["title"],Ws=["title"],qs=["title"],Ys={key:2,class:"dss-toolbar-separator"},js=["title"],Ks={key:4,class:"dss-toolbar-separator"},Gs={key:5,class:"dss-toolbar-dropdown-wrapper"},Qs=["title"],Js={class:"dss-toolbar-dropdown-ai"},er={class:"dss-toolbar-right"},tr={key:0,class:"dss-toolbar-custom-group"},or={key:1,class:"dss-toolbar-separator"},lr={class:"dss-link-modal-content"},nr={class:"dss-link-modal-field"},ar={class:"dss-link-modal-field"},sr={class:"dss-link-modal-label"},rr=["placeholder"],ir={class:"dss-image-modal-tabs"},cr={key:0,class:"dss-image-tab-content"},ur={class:"dss-link-modal-content"},dr={class:"dss-link-modal-field"},mr={key:0,class:"dss-link-modal-label"},pr=["src"],vr={class:"dss-link-modal-field"},gr={class:"dss-link-modal-label"},fr={class:"dss-link-modal-field"},hr={class:"dss-link-modal-label"},yr={class:"dss-link-modal-field"},Cr={class:"dss-link-modal-label"},kr={key:1,class:"dss-image-tab-content"},wr={class:"dss-link-modal-content"},xr={class:"dss-link-modal-field"},br={class:"dss-link-modal-field"},Er={class:"dss-link-modal-label"},Vr={class:"dss-link-modal-field"},Sr={class:"dss-link-modal-label"},Nr={class:"dss-link-modal-field"},Mr={class:"dss-link-modal-label"},Br={class:"dss-text-editor-title-input-container"},Hr={key:0,class:"dss-text-editor-title-preview"},Tr={key:0},Lr={key:1,class:"dss-text-editor-preview-placeholder"},Ar=["value","placeholder","disabled"],$r={key:2,class:"dss-text-editor-title-slot dss-text-editor-slot-last"},Dr={class:"dss-text-editor-description-input-container"},Rr={key:0,class:"dss-text-editor-description-preview"},Ir={key:0},_r={key:1,class:"dss-text-editor-preview-placeholder"},Fr=["value","placeholder","disabled"],zr={key:3,class:"dss-text-editor-description-slot dss-text-editor-slot-last"},Pr=["data-comment-id","onMouseenter"],Or=["onClick"],Zr=["src","alt"],Xr={key:1},Ur=["onClick"],Wr=["src","alt"],qr={key:1},Yr=["data-has-second-user","onClick"],jr={class:"editor-comment-marker-count"},Kr={key:4,class:"dss-text-editor-textarea-wrapper"},Gr=["value","placeholder","rows","disabled"],Qr={class:"dss-text-editor-footer"},Jr={class:"dss-text-editor-footer-content"},ei={class:"dss-text-editor-footer-stat"},ti={class:"dss-text-editor-footer-stat"},oi={key:5,class:"dss-text-editor-content-wrapper"},li={key:0,class:"dss-comment-overlay-body"},ni={class:"dss-comment-selection-wrapper"},ai=["innerHTML"],si={key:0,class:"dss-comment-avatar-wrapper"},ri={class:"dss-comment-avatar"},ii=["src","alt"],ci={key:1},ui={class:"dss-comment-header"},di={class:"dss-comment-header-text"},mi={class:"dss-comment-author"},pi={key:0,class:"dss-comment-date"},vi={class:"dss-comment-body-text"},gi={class:"dss-comment-overlay-inner"},fi=["onKeydown"],hi={class:"dss-text-editor-footer"},yi={class:"dss-text-editor-footer-content"},Ci={class:"dss-text-editor-footer-stat"},ki={class:"dss-text-editor-footer-stat"},wi=["title"],xi=["title"],bi={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:""},Ei={class:"dss-image-popup-content"},Vi={key:0,class:"dss-image-popup-no-alt-icon"},Si=["title"],Ni=["title"],Mi={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:""},Bi={class:"dss-toolbar-left"},Hi=["title"],Ti=["title"],Li={class:"dss-toolbar-dropdown-wrapper"},Ai=["title"],$i={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"},Di={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"},Ri={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"},Ii={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"},_i={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"},Fi={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"},zi={key:6,width:"13",height:"14",viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"paragraph-icon"},Pi=["title"],Oi=["title"],Zi=["title"],Xi=["title"],Ui=["title"],Wi={viewBox:"0 0 27 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{width:"20px",height:"20px"}},qi=["title"],Yi={viewBox:"0 0 24 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{width:"20px",height:"20px"}},ji=["title"],Ki=["title"],Gi=["title"],Qi=["title"],Ji={key:2,class:"dss-toolbar-separator"},ec={key:3,class:"dss-toolbar-dropdown-wrapper"},tc=["title"],oc={class:"dss-toolbar-dropdown-ai"},lc={key:0,class:"dss-toolbar-right"},nc={key:0,class:"dss-toolbar-separator"},ac={key:0,class:"dss-toolbar-custom-group"},sc={key:1,class:"dss-toolbar-separator"},rc={name:"DSSTextEditor"},ic=Object.assign(rc,{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:D=>typeof D=="object"&&D!==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:D=>typeof D=="object"&&D!==null},locale:{type:String,default:null}},emits:["update:modelValue","update:title","update:description","change","blur","title-change","description-change","comment-submitted","comment-marker-clicked"],setup(D,{expose:Zt,emit:U}){const{t:B,locale:pt}=zl.useI18n(),V=D,re=U,Xt=e.useSlots(),T=`<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>`,h=e.ref(null),ze=e.ref(null),Ze=e.ref(!1),et=e.ref(!1),L=e.ref(!1),z=e.ref(""),te=e.ref({}),le=e.ref(!1),nt=e.ref(!1),ce=e.ref(""),ue=e.ref(""),at=e.ref(null),wo=e.ref(null),Ce=e.ref(null),Bt=e.ref(null),Ut=e.ref(""),eo=e.ref(!1),ee=e.ref({}),Ee=e.ref(!1),$e=e.ref({}),uo=e.ref(null),De=e.ref(null),mo=e.ref(!1),qe=e.ref(""),xo=e.ref(null),st=e.ref(""),Ve=e.ref(""),fe=e.ref(""),Ht=e.ref(null),tt=e.ref(null),po=e.ref(null),oe=e.ref(null),Tt=e.ref(null),vo=e.ref(!1),to=e.ref(""),oo=e.ref({}),Wt=e.ref(!1),Xe=e.ref("upload"),Lt=e.ref(""),je=e.ref(null),Le=e.ref(null),rt=e.ref([]),lo=e.ref([]),K=e.ref(null),de=e.ref(!1),Ke=e.ref(""),At=e.ref(""),it=e.ref(""),Se=e.ref(""),Ge=e.ref(""),ct=e.ref(""),ie=e.ref(null),me=e.ref(null),vt=e.ref(null),Po=e.ref(!1),gt=e.ref(!1),ot=e.ref(!1),ut=e.ref(null),He=e.ref("p"),ft=e.ref(!1),no=e.ref([]),ht=e.ref(null),wl=e.computed(()=>({"dss-text-editor-no-border":!V.border,"dss-text-editor-rounded":V.rounded,"dss-text-editor-full-height":V.fullHeight,"dss-comment-overlay-open":k.value!==null})),$t=e.computed(()=>({})),xl=e.computed(()=>!V.fixedHeight||V.fullHeight?{}:{height:`${1.6*14*V.rows+24+2}px`,resize:"none",overflowY:"auto"}),el=e.computed(()=>!V.fixedHeight||V.fullHeight?{}:{height:`${1.6*14*V.rows+32}px`,overflowY:"auto"}),Oo=e.computed(()=>V.richText&&lo.value.length>0),tl=e.computed(()=>{if(!V.modelValue)return"";if(V.richText){let n=V.modelValue.replace(/<script[^>]*>[\s\S]*?<\/script>/gi,"");return n=n.replace(/<style[^>]*>[\s\S]*?<\/style>/gi,""),n=n.replace(/<[^>]+>/g,""),n=n.replace(/ /g," "),n=n.replace(/&/g,"&"),n=n.replace(/</g,"<"),n=n.replace(/>/g,">"),n=n.replace(/"/g,'"'),n=n.replace(/'/g,"'"),n=n.replace(/\s+/g," ").trim(),n}return V.modelValue}),bo=e.computed(()=>{const n=tl.value.trim();return n?n.split(/\s+/).filter(o=>o.length>0).length:0}),Eo=e.computed(()=>tl.value.length),ol=e.computed(()=>oe.value!==null&&Xe.value==="upload"&&st.value&&st.value.startsWith("data:")),Zo=e.computed(()=>V.titlePlaceholder||B("textEditor.placeholders.title")),Vo=e.computed(()=>V.descriptionPlaceholder||B("textEditor.placeholders.description")),bl=e.computed(()=>V.placeholder||B("textEditor.placeholders.startTyping")),yt=n=>Xt&&Xt[n]!==void 0,El=n=>{for(let o=n+1;o<V.customToolbarSlots.length;o++)if(yt(V.customToolbarSlots[o]))return!0;return!1},we=n=>{for(let o=n+1;o<V.customToolbarSlots.length;o++){const a=V.customToolbarSlots[o];if(yt(a)&&I(a))return!0}return!1},I=n=>V.customToolbarFloatingMap.hasOwnProperty(n)?V.customToolbarFloatingMap[n]===!0:!0,So=e.computed(()=>V.customToolbarSlots.some(n=>yt(n)&&I(n))),pe=e.computed(()=>yt("title-slot")),Ct=e.computed(()=>yt("description-slot")),Y=n=>{if(!n||n.trim()==="")return"<html></html>";const o=n.trim();return o.startsWith("<html>")&&o.endsWith("</html>")?n:`<html>${n}</html>`},ae=n=>{if(!n||n.trim()==="")return"";const o=n.trim();return o.startsWith("<html>")&&o.endsWith("</html>")?o.slice(6,-7).trim():n},N=n=>{try{const o=String(n.getDate()).padStart(2,"0"),i=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][n.getMonth()],s=n.getFullYear();return`${o} ${i} ${s}`}catch{return""}},Re=n=>{const o=n.target.value;re("update:modelValue",o),re("change",o)},P=()=>{if(!ie.value)return;const n=ie.value;if(n.style.setProperty("text-overflow","","important"),n.style.setProperty("white-space","","important"),n.style.setProperty("overflow-x","","important"),n.style.setProperty("height","auto","important"),n.value.trim()===""){const i=n.value;n.value="M";const s=n.scrollHeight;n.value=i,n.style.setProperty("height",`${s}px`,"important"),n.style.setProperty("overflow-y","hidden","important");return}n.offsetHeight;const a=n.scrollHeight;n.style.setProperty("height",`${a}px`,"important"),n.style.setProperty("overflow-y","hidden","important")},go=()=>{gt.value=!0,P()},fo=()=>{gt.value=!1,No()},No=()=>{if(!ie.value)return;const n=ie.value;n.style.setProperty("text-overflow","","important"),n.style.setProperty("white-space","","important"),n.style.setProperty("overflow-x","","important"),n.style.setProperty("height","auto","important");const o=n.value;n.value="M";const a=n.scrollHeight;n.value=o,n.offsetHeight,n.style.setProperty("height",`${a}px`,"important"),n.style.setProperty("overflow-y","hidden","important"),n.style.setProperty("overflow-x","hidden","important"),n.style.setProperty("text-overflow","ellipsis","important"),n.style.setProperty("white-space","nowrap","important")},ll=n=>{const a=n.target.value;gt.value&&P(),re("update:title",a),re("title-change",a),vt.value="title",V.richText&&(de.value||(At.value=Ke.value,Ge.value=it.value,ct.value=Se.value),K.value&&clearTimeout(K.value),de.value=!0,K.value=setTimeout(()=>{de.value=!1,Te()},500))},Mo=()=>{if(!me.value)return;const n=me.value;if(n.style.setProperty("text-overflow","","important"),n.style.setProperty("white-space","","important"),n.style.setProperty("overflow-x","","important"),n.style.setProperty("height","auto","important"),n.value.trim()===""){const i=n.value;n.value="M";const s=n.scrollHeight;n.value=i,n.style.setProperty("height",`${s}px`,"important"),n.style.setProperty("overflow-y","hidden","important");return}n.offsetHeight;const a=n.scrollHeight;n.style.setProperty("height",`${a}px`,"important"),n.style.setProperty("overflow-y","hidden","important")},Vl=()=>{ot.value=!0,Mo()},Sl=()=>{ot.value=!1,kt()},kt=()=>{if(!me.value)return;const n=me.value;n.style.setProperty("text-overflow","","important"),n.style.setProperty("white-space","","important"),n.style.setProperty("overflow-x","","important"),n.style.setProperty("height","auto","important");const o=n.value;n.value="M";const a=n.scrollHeight;n.value=o,n.offsetHeight,n.style.setProperty("height",`${a}px`,"important"),n.style.setProperty("overflow-y","hidden","important"),n.style.setProperty("overflow-x","hidden","important"),n.style.setProperty("text-overflow","ellipsis","important"),n.style.setProperty("white-space","nowrap","important")},Nl=n=>{const a=n.target.value;ot.value&&Mo(),re("update:description",a),re("description-change",a),vt.value="description",V.richText&&(de.value||(At.value=Ke.value,Ge.value=it.value,ct.value=Se.value),K.value&&clearTimeout(K.value),de.value=!0,K.value=setTimeout(()=>{de.value=!1,Te()},500))},wt=()=>{const n=window.getSelection();if(n.rangeCount===0)return null;const o=n.getRangeAt(0),a=o.cloneRange();return a.selectNodeContents(h.value),a.setEnd(o.startContainer,o.startOffset),{start:a.toString().length,end:a.toString().length+o.toString().length}},Dt=n=>{if(!(!n||!h.value))try{const o=window.getSelection(),a=document.createRange();let i=0;const s=[h.value];let d=null,u=!1,g=!1;for(;!g&&(d=s.pop());)if(d.nodeType===3){const p=i+d.length;!u&&n.start>=i&&n.start<=p&&(a.setStart(d,n.start-i),u=!0),u&&n.end>=i&&n.end<=p&&(a.setEnd(d,n.end-i),g=!0),i=p}else{let p=d.childNodes.length;for(;p--;)s.push(d.childNodes[p])}o.removeAllRanges(),o.addRange(a)}catch{h.value.focus()}},ho=()=>{if(!h.value)return;h.value.focus();const n=window.getSelection(),o=document.createRange(),a=s=>{if(s.nodeType===3||s.childNodes.length===0)return s;for(let d=s.childNodes.length-1;d>=0;d--){const u=s.childNodes[d],g=a(u);if(g)return g}return s},i=a(h.value);if(i.nodeType===3)o.setStart(i,i.length),o.setEnd(i,i.length);else if(i.childNodes.length>0){const s=a(i);s&&s.nodeType===3?(o.setStart(s,s.length),o.setEnd(s,s.length)):(o.selectNodeContents(i),o.collapse(!1))}else o.setStart(i,0),o.setEnd(i,0);n.removeAllRanges(),n.addRange(o)},Te=(n=!1)=>{if(!h.value)return;const o=h.value.innerHTML,a=V.title||"",i=V.description||"";if(!n&&o===Ke.value&&a===it.value&&i===Se.value)return;const s={content:At.value||Ke.value,title:Ge.value!==void 0?Ge.value:it.value,description:ct.value!==void 0?ct.value:Se.value},d=rt.value.length>0?rt.value[rt.value.length-1]:null;let u=!0;d&&(typeof d=="string"?u=s.content!==d:u=s.content!==d.content||s.title!==d.title||s.description!==d.description),u&&(rt.value.push(s),rt.value.length>50&&rt.value.shift(),lo.value=[]),Ke.value=o,it.value=a,Se.value=i,At.value=o,Ge.value=a,ct.value=i},he=n=>{if(!h.value)return;Xo();let o=null;h.value&&(h.value.querySelector("p")||(o=wt(),Bo())),n&&n.inputType&&(n.inputType==="insertText"||n.inputType==="insertCompositionText"||n.inputType==="deleteContentBackward"||n.inputType==="deleteContentForward")&&ut.value&&(ut.value=null),et.value=!0;const i=h.value.innerHTML,s=Y(i);re("update:modelValue",s),re("change",s),vt.value="editor",de.value||(At.value=Ke.value,Ge.value=it.value,ct.value=Se.value),K.value&&clearTimeout(K.value),de.value=!0,K.value=setTimeout(()=>{de.value=!1,Te()},500),e.nextTick(()=>{o&&Dt(o),Xo();const d=["bold","italic","underline"],u=window.getSelection(),g=u.rangeCount>0?u.getRangeAt(0):null,p=g&&g.collapsed;d.forEach(f=>{try{if(p&&ut.value?.command===f){ee.value[f]=ut.value.state;return}if(f==="bold")if(g){const b=g.commonAncestorContainer,E=b.nodeType===3?b.parentElement:b;let M=!1;if(E&&((E.tagName==="STRONG"||E.tagName==="B"||E.closest&&E.closest("strong, b"))&&(M=!0),!M&&E.style&&parseInt(E.style.fontWeight)>=600&&(M=!0),!M))try{const X=window.getComputedStyle(E);parseInt(X.fontWeight)>=600&&(M=!0)}catch{}ee.value[f]=M}else ee.value.hasOwnProperty(f)||(ee.value[f]=!1);else if(f==="italic")if(g){const b=g.commonAncestorContainer,E=b.nodeType===3?b.parentElement:b,M=E&&(E.tagName==="EM"||E.tagName==="I"||E.closest&&E.closest("em, i"));ee.value[f]=!!M}else{const b=document.queryCommandState(f);ee.value[f]=b}else{const b=document.queryCommandState(f);ee.value[f]=b}}catch{}}),Ye(),Rt(),xt(),J(),Ft(),co(),et.value=!1})},Xo=()=>{if(!h.value)return;const n=window.getSelection();if(!n||n.rangeCount===0)return;const o=n.getRangeAt(0),a=o.commonAncestorContainer,i=a.nodeType===3?a.parentElement:a;if(!i)return;const s=i.closest(".dss-image-wrapper");if(s){const d=s.querySelector("img");if(i!==d&&!d?.contains(i)){const u=o.startContainer.nodeType===3?o.startContainer.parentElement:o.startContainer,g=o.endContainer.nodeType===3?o.endContainer.parentElement:o.endContainer;if(s.contains(u)&&u!==d||s.contains(g)&&g!==d){const p=document.createRange();p.setStartAfter(s),p.collapse(!0),n.removeAllRanges(),n.addRange(p)}}}},Bo=()=>{if(!h.value)return;const n=h.value;if(n.querySelector&&n.querySelector("p"))return;const o=new Set(["P","H1","H2","H3","H4","H5","H6","BLOCKQUOTE","UL","OL","DIV"]),a=Array.from(n.childNodes);let i=null;a.forEach(s=>{if(s.nodeType===Node.TEXT_NODE){if((s.textContent||"").trim()===""){s.parentNode===n&&n.removeChild(s);return}i||(i=document.createElement("p"),n.insertBefore(i,s)),i.appendChild(s);return}if(s.nodeType===Node.ELEMENT_NODE){const d=s,u=d.tagName;if(u==="BR"){i=null;return}if(o.has(u)){i=null;return}i||(i=document.createElement("p"),n.insertBefore(i,d)),i.appendChild(d)}})},Rt=()=>{if(h.value&&!Po.value){Po.value=!0;try{h.value.querySelectorAll(".dss-image-wrapper").forEach(i=>{i.querySelector("img")||i.remove()}),h.value.querySelectorAll(".dss-image-no-alt-icon").forEach(i=>{const s=i.parentElement;!s||!s.classList.contains("dss-image-wrapper")?i.remove():s.querySelector("img")||i.remove()}),h.value.querySelectorAll("img").forEach(i=>{let s=i.getAttribute("alt");s===null&&(s=i.alt||"");const d=i.getAttribute("src")||i.src||"";if(s){const f=d.replace(/^https?:\/\//,"").replace(/^data:.*,/,""),b=s===d||s===f;(s.startsWith("http://")||s.startsWith("https://")||s.startsWith("data:")||b||b)&&(s="")}i.setAttribute("alt",s),i.setAttribute("data-alt",s);const u=!s||s.trim()==="";let g=i.parentElement;const p=g&&g.classList.contains("dss-image-wrapper");if(p){const f=g.querySelector(".dss-image-no-alt-icon");f&&f.remove()}else{const f=i.nextElementSibling?.classList.contains("dss-image-no-alt-icon")?i.nextElementSibling:null;f&&f.remove()}if(u){p?g.setAttribute("contenteditable","false"):(g=document.createElement("span"),g.className="dss-image-wrapper",g.setAttribute("contenteditable","false"),i.parentNode.insertBefore(g,i),g.appendChild(i));const f=document.createElement("div");f.className="dss-image-no-alt-icon",f.setAttribute("contenteditable","false"),f.innerHTML=T,g.appendChild(f)}else if(p&&g.children.length===1){const f=g.parentNode;f.insertBefore(i,g),f.removeChild(g)}})}finally{Po.value=!1}}},ao=n=>{re("blur",n),so()},nl=()=>{if(V.disabled||!V.richText||!h.value)return;Ie(),K.value&&(clearTimeout(K.value),K.value=null),de.value&&(Te(),de.value=!1);const n=vt.value==="title",o=vt.value==="description",a=vt.value==="editor";if(rt.value.length===0){n&&ie.value?ie.value.focus():o&&me.value?me.value.focus():h.value.focus(),document.execCommand("undo",!1),e.nextTick(()=>{he()});return}const i={content:h.value.innerHTML,title:V.title||"",description:V.description||""};lo.value.push(i);const s=rt.value.pop();if(s!==void 0){et.value=!0;const d=typeof s=="string"?s:s.content,u=typeof s=="object"&&s.title||"",g=typeof s=="object"&&s.description||"";h.value.innerHTML=d,Ke.value=d,it.value=u,Se.value=g,At.value=d,Ge.value=u,ct.value=g,e.nextTick(()=>{Ye(),Ue(),mt(),J();const p=Y(d);re("update:modelValue",p),re("update:title",u),re("update:description",g),re("change",p),re("title-change",u),re("description-change",g),et.value=!1,e.nextTick(()=>{setTimeout(()=>{if(n){if(ie.value){ie.value.focus();const f=u.length;ie.value.setSelectionRange&&ie.value.setSelectionRange(f,f),P()}}else if(o){if(me.value){me.value.focus();const f=g.length;me.value.setSelectionRange(f,f)}}else if(a)ho();else if(ie.value&&document.activeElement===ie.value){const f=u.length;ie.value.setSelectionRange&&ie.value.setSelectionRange(f,f),P()}else if(me.value&&document.activeElement===me.value){const f=g.length;me.value.setSelectionRange(f,f)}else h.value&&ho()},10)})})}},al=()=>{if(V.disabled||!V.richText||!h.value)return;Ie();const n=vt.value==="title",o=vt.value==="description",a=vt.value==="editor";if(lo.value.length===0){n&&ie.value?ie.value.focus():o&&me.value?me.value.focus():h.value.focus(),document.execCommand("redo",!1),e.nextTick(()=>{he()});return}const i={content:h.value.innerHTML,title:V.title||"",description:V.description||""};rt.value.push(i);const s=lo.value.pop();if(s!==void 0){et.value=!0;const d=typeof s=="string"?s:s.content,u=typeof s=="object"&&s.title||"",g=typeof s=="object"&&s.description||"";h.value.innerHTML=d,Ke.value=d,it.value=u,Se.value=g,At.value=d,Ge.value=u,ct.value=g,e.nextTick(()=>{Ye(),Ue(),mt(),J();const p=Y(d);re("update:modelValue",p),re("update:title",u),re("update:description",g),re("change",p),re("title-change",u),re("description-change",g),et.value=!1,e.nextTick(()=>{setTimeout(()=>{if(n){if(ie.value){ie.value.focus();const f=u.length;ie.value.setSelectionRange&&ie.value.setSelectionRange(f,f),P()}}else if(o){if(me.value){me.value.focus();const f=g.length;me.value.setSelectionRange(f,f)}}else if(a)ho();else if(ie.value&&document.activeElement===ie.value){const f=u.length;ie.value.setSelectionRange&&ie.value.setSelectionRange(f,f),P()}else if(me.value&&document.activeElement===me.value){const f=g.length;me.value.setSelectionRange(f,f)}else h.value&&ho()},10)})})}},Ho=()=>{if(!h.value)return;h.value.querySelectorAll('span[style*="font-weight"]').forEach(i=>{const s=i.style.fontWeight;if(s==="normal"||s==="400"){const d=document.createDocumentFragment();for(;i.firstChild;)d.appendChild(i.firstChild);i.parentNode&&i.parentNode.replaceChild(d,i)}}),h.value.querySelectorAll('span[style*="font-weight"]').forEach(i=>{if(parseInt(i.style.fontWeight)>=600){const d=document.createElement("b");for(d.style.fontWeight="600";i.firstChild;)d.appendChild(i.firstChild);i.parentNode&&i.parentNode.replaceChild(d,i)}}),h.value.querySelectorAll("b, strong").forEach(i=>{i.style.fontWeight="600"})},xt=()=>{if(!h.value)return;h.value.querySelectorAll("i, em").forEach(o=>{o.style.fontStyle="italic"})},Ml=()=>{const n=window.getSelection();if(!n||n.rangeCount===0)return!1;const o=n.getRangeAt(0);let a=!1;if(o.collapsed){const i=o.startContainer;let s=i.nodeType===3?i.parentElement:i;for(;s&&s!==h.value;){if(s.tagName==="EM"||s.tagName==="I"){a=!0;break}if(s.style&&s.style.fontStyle==="italic"){a=!0;break}s=s.parentElement}}else{const i=o.commonAncestorContainer.nodeType===1?o.commonAncestorContainer:o.commonAncestorContainer.parentNode;if(i){const s=document.createTreeWalker(i,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let d;for(;d=s.nextNode();)if(!(typeof o.intersectsNode=="function"&&!o.intersectsNode(d))){if(d.nodeType===3){let u=d.parentElement;for(;u&&u!==h.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(()=>{xt()}),!1;if(o.collapsed)document.execCommand("italic",!1),e.nextTick(()=>{xt()});else try{const i=o.extractContents(),s=document.createElement("em");s.style.fontStyle="italic",s.appendChild(i),o.insertNode(s),o.setStartAfter(s),o.collapse(!0),n.removeAllRanges(),n.addRange(o),e.nextTick(()=>{xt()})}catch{document.execCommand("italic",!1),e.nextTick(()=>{xt()})}return!0},To=()=>{const n=window.getSelection();if(!n||n.rangeCount===0)return!1;const o=n.getRangeAt(0);let a=!1;if(o.collapsed){const i=o.startContainer;let s=i.nodeType===3?i.parentElement:i;for(;s&&s!==h.value;){if(s.tagName==="STRONG"||s.tagName==="B"){a=!0;break}if(s.style&&parseInt(s.style.fontWeight)>=600){a=!0;break}s=s.parentElement}}else{const i=o.commonAncestorContainer.nodeType===1?o.commonAncestorContainer:o.commonAncestorContainer.parentNode;if(i){const s=document.createTreeWalker(i,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let d;for(;d=s.nextNode();)if(!(typeof o.intersectsNode=="function"&&!o.intersectsNode(d))){if(d.nodeType===3){let u=d.parentElement;for(;u&&u!==h.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(()=>{Ho()}),!1;if(o.collapsed)document.execCommand("bold",!1),e.nextTick(()=>{const i=window.getSelection();if(i.rangeCount>0){const s=i.getRangeAt(0),d=s.startContainer;let u=d.nodeType===3?d.parentElement:d;for(;u&&u!==h.value;){if(u.tagName==="SPAN"&&u.style.fontWeight){const g=u.style.fontWeight;if(g==="normal"||g==="400"){const p=document.createElement("b");p.style.fontWeight="600";const f=document.createDocumentFragment();for(;u.firstChild;)f.appendChild(u.firstChild);p.appendChild(f),u.parentNode&&u.parentNode.replaceChild(p,u),s.setStart(p,0),s.collapse(!0),i.removeAllRanges(),i.addRange(s);break}}else if(u.tagName==="STRONG"||u.tagName==="B"){u.style.fontWeight="600";break}u=u.parentElement}if(!u||u===h.value){const g=document.createElement("b");g.style.fontWeight="600",g.innerHTML="<br>",s.insertNode(g),s.setStart(g,0),s.collapse(!0),i.removeAllRanges(),i.addRange(s)}}Ho()});else try{const i=o.extractContents(),s=document.createElement("b");s.style.fontWeight="600",s.appendChild(i),o.insertNode(s),o.setStartAfter(s),o.collapse(!0),n.removeAllRanges(),n.addRange(o),e.nextTick(()=>{Ho()})}catch{document.execCommand("bold",!1),e.nextTick(()=>{Ho()})}return!0},bt=(n,o=null)=>{if(V.disabled||!V.richText||!h.value)return;de.value?(K.value&&(clearTimeout(K.value),K.value=null),Te(),de.value=!1):Te(),Ie(),h.value.focus();const a=window.getSelection();let i=null;if(a&&a.rangeCount>0){const d=a.getRangeAt(0);!d.collapsed&&jt(d)&&(i=wt())}if(n==="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(n==="bold"){const d=To();ee.value.bold=d;const u=window.getSelection();u.rangeCount>0&&u.getRangeAt(0).collapsed&&(ut.value={command:"bold",state:d}),e.nextTick(()=>{i&&(Dt(i),e.nextTick(()=>{const g=Ne("bold");ee.value.bold=g})),he(),Ue(),J()});return}if(n==="italic"){const d=Ml();ee.value.italic=d;const u=window.getSelection();u.rangeCount>0&&u.getRangeAt(0).collapsed&&(ut.value={command:"italic",state:d}),e.nextTick(()=>{i&&(Dt(i),e.nextTick(()=>{const g=Ne("italic");ee.value.italic=g})),he(),xt(),Ue(),J()});return}let s=!1;try{s=document.execCommand(n,!1,o)}catch(d){console.warn(`Failed to execute command ${n}:`,d)}e.nextTick(()=>{if(i&&Dt(i),["bold","italic","underline"].includes(n))try{if(n==="bold")i&&e.nextTick(()=>{const u=Ne("bold");ee.value.bold=u});else if(n==="italic")if(i)e.nextTick(()=>{const u=Ne("italic");ee.value.italic=u});else{const u=document.queryCommandState(n);ee.value[n]=u}else{const u=document.queryCommandState(n);ee.value[n]=u}}catch{ee.value.hasOwnProperty(n)?ee.value[n]=!ee.value[n]:ee.value[n]=!0}if(n==="createLink"&&o){const u=window.getSelection();if(u.rangeCount>0){const p=u.getRangeAt(0),f=p.commonAncestorContainer.nodeType===1?p.commonAncestorContainer.closest("a"):p.commonAncestorContainer.parentElement?.closest("a");f&&(!f.getAttribute("href")||f.getAttribute("href")==="")&&f.setAttribute("href",o)}h.value.querySelectorAll("a").forEach(p=>{const f=p.getAttribute("href");(!f||f===""||f==="#")&&p.setAttribute("href",o)})}he(),Ue(),J()})},Ne=(n,o=null)=>{if(V.disabled||!h.value)return!1;try{if(n==="formatBlock"&&o){const i=document.queryCommandValue("formatBlock");if(o==="<blockquote>"){const s=i.toLowerCase();if(s==="blockquote"||s==="<blockquote>")return!0;const d=window.getSelection();if(d.rangeCount>0){const g=d.getRangeAt(0).commonAncestorContainer;return!!(g.nodeType===1?g.tagName==="BLOCKQUOTE"?g:g.closest("blockquote"):g.parentElement?.closest("blockquote"))}}return i===o||i.toLowerCase()===o.toLowerCase()}if(["bold","italic","underline"].includes(n))try{const i=window.getSelection();if(i.rangeCount>0){const s=i.getRangeAt(0);if(n==="bold"){let u=!1;if(s.collapsed){const g=s.commonAncestorContainer,p=g.nodeType===3?g.parentElement:g;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 f=window.getComputedStyle(p);parseInt(f.fontWeight)>=600&&(u=!0)}catch{}return ee.value.hasOwnProperty(n)?ee.value[n]:(ee.value[n]=u,u)}else{const g=s.commonAncestorContainer.nodeType===1?s.commonAncestorContainer:s.commonAncestorContainer.parentNode;let p=!1;if(g){const f=document.createTreeWalker(g,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let b;for(;b=f.nextNode();)if(!(typeof s.intersectsNode=="function"&&!s.intersectsNode(b))){if(b.nodeType===3){if(!(b.textContent||"").trim())continue;p=!0;let M=b.parentElement;for(;M&&M!==h.value;){if(M.tagName==="STRONG"||M.tagName==="B"){u=!0;break}if(M.style&&parseInt(M.style.fontWeight)>=600){u=!0;break}M=M.parentElement}}else if(b.nodeType===1){const E=b;if(E.tagName==="STRONG"||E.tagName==="B"){u=!0;break}if(E.style&&parseInt(E.style.fontWeight)>=600){u=!0;break}}if(u)break}}return ee.value[n]=u&&p,u&&p}}if(n==="italic"){let u=!1;if(s.collapsed){const g=s.commonAncestorContainer,p=g.nodeType===3?g.parentElement:g;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 ee.value.hasOwnProperty(n)?ee.value[n]:(ee.value[n]=u,u)}else{const g=s.commonAncestorContainer.nodeType===1?s.commonAncestorContainer:s.commonAncestorContainer.parentNode;let p=!1;if(g){const f=document.createTreeWalker(g,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let b;for(;b=f.nextNode();)if(!(typeof s.intersectsNode=="function"&&!s.intersectsNode(b))){if(b.nodeType===3){if(!(b.textContent||"").trim())continue;p=!0;let M=b.parentElement;for(;M&&M!==h.value;){if(M.tagName==="EM"||M.tagName==="I"){u=!0;break}if(M.style&&M.style.fontStyle==="italic"){u=!0;break}M=M.parentElement}}else if(b.nodeType===1){const E=b;if(E.tagName==="EM"||E.tagName==="I"){u=!0;break}if(E.style&&E.style.fontStyle==="italic"){u=!0;break}}if(u)break}}return ee.value[n]=u&&p,u&&p}}const d=document.queryCommandState(n);return s.collapsed&&ee.value.hasOwnProperty(n)?ee.value[n]:(ee.value[n]=d,d)}return ee.value.hasOwnProperty(n)?ee.value[n]:!1}catch{return ee.value.hasOwnProperty(n)?ee.value[n]:!1}try{return document.queryCommandState(n)}catch{return!1}}catch{return!1}},sl=n=>{V.disabled||!V.richText||(ze.value=ze.value===n?null:n,n==="askAi"&&(De.value=null))},Ie=()=>{ze.value=null,je.value=null},It=n=>{bt("formatBlock",n),Ie()},Bl=n=>{if(!n||!h.value)return n;const o=lt=>{let Fe=lt.nodeType===Node.TEXT_NODE?lt.parentElement:lt;for(;Fe&&Fe!==h.value;){const be=Fe.tagName;if(be==="P"){const Jt=Fe.parentElement;if(Jt===h.value||Jt.tagName==="BLOCKQUOTE")return Fe}if(be==="BLOCKQUOTE")break;Fe=Fe.parentElement}return null},a=o(n.startContainer),i=o(n.endContainer);if(!a||!i)return n;const s=[],d=document.createTreeWalker(h.value,NodeFilter.SHOW_ELEMENT,{acceptNode:lt=>{const Fe=lt.tagName;if(Fe==="P"){const be=lt.parentElement;if(be===h.value||be.tagName==="BLOCKQUOTE")return NodeFilter.FILTER_ACCEPT}return Fe==="BLOCKQUOTE"?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_SKIP}});let u;for(;u=d.nextNode();)s.push(u);const g=s.indexOf(a),p=s.indexOf(i);if(g===-1||p===-1)return n;const f=Math.min(g,p),b=Math.max(g,p),E=s.slice(f,b+1);if(E.length===0)return n;const M=E[0],X=E[E.length-1],ke=document.createRange();return ke.setStartBefore(M),ke.setEndAfter(X),ke},rl=()=>{if(V.disabled||!V.richText||!h.value)return;de.value?(K.value&&(clearTimeout(K.value),K.value=null),Te(),de.value=!1):Te(),Ie(),h.value.focus();const n=window.getSelection();if(n.rangeCount===0)return;let o=n.getRangeAt(0);!o.collapsed&&jt(o)&&(o=Bl(o),n.removeAllRanges(),n.addRange(o));let a=null;!o.collapsed&&jt(o)&&(a=wt());const i=o.commonAncestorContainer,s=i.nodeType===1?i.tagName==="BLOCKQUOTE"?i:i.closest("blockquote"):i.parentElement?.closest("blockquote");if(!!(s&&h.value.contains(s))){if(s){const u=s.parentNode;Array.from(s.childNodes).forEach(p=>{if(p.nodeType===Node.ELEMENT_NODE)if(p.tagName==="P"||p.tagName==="DIV")u.insertBefore(p,s);else{const f=document.createElement("p");f.appendChild(p.cloneNode(!0)),u.insertBefore(f,s)}else if(p.nodeType===Node.TEXT_NODE&&p.textContent.trim()){const f=document.createElement("p");f.appendChild(p.cloneNode(!0)),u.insertBefore(f,s)}}),s.remove()}}else if(o.collapsed)document.execCommand("formatBlock",!1,"<blockquote>");else{const u=document.createElement("blockquote"),g=o.extractContents();u.appendChild(g),o.insertNode(u);const p=[],f=document.createTreeWalker(u,NodeFilter.SHOW_TEXT,{acceptNode:M=>M.parentNode===u&&M.textContent.trim()?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});let b;for(;b=f.nextNode();)p.push(b);if(p.forEach(M=>{const X=document.createElement("p");M.parentNode.insertBefore(X,M),X.appendChild(M)}),u.querySelectorAll("p, div").forEach(M=>{M.textContent.trim()===""&&!M.querySelector("img")&&(M.innerHTML="<br>")}),u.children.length===0&&u.textContent.trim()===""){const M=document.createElement("p");M.innerHTML="<br>",u.appendChild(M)}}e.nextTick(()=>{a&&Dt(a),mt(),he(),J()})},Hl=()=>{if(!h.value)return;const n=window.getSelection();if(n.rangeCount===0)return;const a=n.getRangeAt(0).commonAncestorContainer,i=a.nodeType===1?a.tagName==="BLOCKQUOTE"?a:a.closest("blockquote"):a.parentElement?.closest("blockquote");if(!i||!h.value.contains(i))return;const s=b=>{if(!b)return!1;const E=b.textContent||"",X=(b.innerHTML||"").trim();return E.trim()===""||X===""||X==="<br>"||X==="<br/>"||X==="<p></p>"||X==="<p><br></p>"||X==="<p><br/></p>"||X==="<p> </p>"||X==="<p><br> </p>"||X==="<div></div>"||X==="<div><br></div>"||X==="<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&&i.contains(d)&&s(d)&&d.remove();i.lastChild;){const b=i.lastChild;if(b.nodeType===1&&b.tagName==="BR")b.remove();else if(b.nodeType===3)if((b.textContent||"").trim()==="")b.remove();else break;else break}if(i.children.length>0)for(let b=i.children.length-1;b>=0;b--){const E=i.children[b];if((E.tagName==="P"||E.tagName==="DIV")&&s(E))E.remove();else break}let u=i.innerHTML;const g=u;u=u.replace(/(<br\s*\/?>)+$/gi,""),u!==g&&(i.innerHTML=u);const p=document.createElement("p");p.innerHTML="<br>",i.parentNode?i.nextSibling?i.parentNode.insertBefore(p,i.nextSibling):i.parentNode.appendChild(p):h.value&&h.value.appendChild(p);const f=document.createRange();f.selectNodeContents(p),f.collapse(!0),n.removeAllRanges(),n.addRange(f),e.nextTick(()=>{mt(),he()})},Ue=()=>{if(!h.value){Ze.value=!1;return}try{const n=window.getSelection();if(n.rangeCount>0){const a=n.getRangeAt(0).commonAncestorContainer,i=a.nodeType===1?a.closest("a"):a.parentElement?.closest("a");Ze.value=!!i}else Ze.value=!1}catch{Ze.value=!1}},Lo=()=>{if(!h.value)return;Bt.value=wt();const n=window.getSelection();let o="";n.rangeCount>0&&(o=n.getRangeAt(0).toString()),ce.value="",ue.value=o,Ut.value="",Ce.value=null,nt.value=!0,Ie(),e.nextTick(()=>{at.value&&at.value.focus()})},Uo=()=>{if(!h.value)return;de.value?(K.value&&(clearTimeout(K.value),K.value=null),Te(),de.value=!1):Te();const n=window.getSelection();let o=null;if(n.rangeCount>0){const i=n.getRangeAt(0).commonAncestorContainer;o=i.nodeType===1?i.closest("a"):i.parentElement?.closest("a")}if(!o&&Ce.value&&(o=Ce.value),o&&o.parentNode){const a=document.createDocumentFragment();for(;o.firstChild;)a.appendChild(o.firstChild);if(o.parentNode.replaceChild(a,o),a.firstChild){const i=document.createRange();i.setStartBefore(a.firstChild),i.setEndAfter(a.lastChild||a.firstChild),n.removeAllRanges(),n.addRange(i),document.execCommand("removeFormat",!1),i.collapse(!1),n.removeAllRanges(),n.addRange(i)}Ce.value=null}else bt("unlink");Ze.value=!1,Ie(),e.nextTick(()=>{he(),Ue()})},il=()=>{V.disabled||!V.richText||h.value&&(de.value?(K.value&&(clearTimeout(K.value),K.value=null),Te(),de.value=!1):Te(),Ie(),h.value.focus(),document.execCommand("insertUnorderedList",!1),e.nextTick(()=>{Ye(),he(),J()}))},cl=()=>{V.disabled||!V.richText||h.value&&(de.value?(K.value&&(clearTimeout(K.value),K.value=null),Te(),de.value=!1):Te(),Ie(),h.value.focus(),document.execCommand("insertOrderedList",!1),e.nextTick(()=>{Ye(),he(),J()}))},Ao=n=>{const o=n.parentElement;if(!o||o.tagName!=="OL")return null;let a=0,i=n.previousElementSibling;for(;i;)i.tagName==="LI"&&a++,i=i.previousElementSibling;return a+1},Ye=()=>{if(!h.value)return;h.value.querySelectorAll("li > ol").forEach(o=>{const a=o.parentElement;if(a&&a.tagName==="LI"){const i=Ao(a);i!==null&&Array.from(o.children).filter(d=>d.tagName==="LI").forEach(d=>{d.setAttribute("data-parent-num",String(i))})}})},$o=()=>{if(V.disabled||!V.richText||!h.value)return;Ie(),h.value.focus();const n=window.getSelection();if(n.rangeCount===0)return;const o=n.getRangeAt(0),a=o.commonAncestorContainer.nodeType===1?o.commonAncestorContainer.closest("li"):o.commonAncestorContainer.parentElement?.closest("li");if(!a){document.execCommand("indent",!1),e.nextTick(()=>{Ye(),he()});return}const i=a.parentElement;if(!i||i.tagName!=="OL"&&i.tagName!=="UL")return;const s=a.previousElementSibling;if(s&&s.tagName==="LI"){const d=i.tagName.toLowerCase();let u=s.querySelector(`:scope > ${d}`);u||(u=document.createElement(d),s.appendChild(u));const g=Ao(s);u.appendChild(a),g!==null&&i.tagName==="OL"&&a.setAttribute("data-parent-num",String(g)),Ye();const p=document.createRange();p.selectNodeContents(a),p.collapse(!1),n.removeAllRanges(),n.addRange(p),e.nextTick(()=>{he(),J()})}else document.execCommand("indent",!1),e.nextTick(()=>{Ye(),he(),J()})},_t=()=>{if(V.disabled||!V.richText||!h.value)return;Ie(),h.value.focus();const n=window.getSelection();if(n.rangeCount===0)return;const o=n.getRangeAt(0),a=o.commonAncestorContainer.nodeType===1?o.commonAncestorContainer.closest("li"):o.commonAncestorContainer.parentElement?.closest("li");if(!a){document.execCommand("outdent",!1),e.nextTick(()=>{Ye(),he()});return}const i=a.parentElement;if(!i||i.tagName!=="OL"&&i.tagName!=="UL")return;const s=i.parentElement;if(s&&s.tagName==="LI"){const d=s.parentElement;if(d&&(d.tagName==="OL"||d.tagName==="UL")){i.tagName==="OL"&&a.removeAttribute("data-parent-num"),d.insertBefore(a,s.nextSibling),i.children.length===0&&i.remove(),Ye();const u=document.createRange();u.selectNodeContents(a),u.collapse(!1),n.removeAllRanges(),n.addRange(u),e.nextTick(()=>{he(),J()});return}}document.execCommand("outdent",!1),e.nextTick(()=>{Ye(),he(),J()})},k=e.ref(null),xe=e.ref(null),Et=e.ref({}),Pe=e.ref(""),_e=e.ref(null),ge=e.ref("");e.ref("");const dt=e.ref(null);e.ref("");const Vt=e.ref([]),ul=n=>{if(!n)return"";const o=n.cloneRange(),a=document.createElement("div");return a.appendChild(o.cloneContents()),a.innerHTML},Me=()=>{if(V.disabled||!V.richText||!h.value)return;if(k.value!==null){k.value=null,Pe.value="",ge.value="",dt.value=null,Vt.value=[],Pt(!0);return}Ie(),h.value.focus();const n=window.getSelection();if(!n||n.rangeCount===0)return;const o=n.getRangeAt(0);if(o.collapsed||!jt(o))return;ge.value=ul(o)||"",dt.value=wt();const a=o.getBoundingClientRect(),i=h.value.parentElement;if(!i)return;const s=i.getBoundingClientRect(),d=a.bottom-s.top,g=Math.max(d+8,0);Et.value={top:`${g}px`},k.value=null,e.nextTick(()=>{if(Pe.value="",_e.value){const p=_e.value;p.style.height="auto",p.style.height=`${p.scrollHeight}px`,p.focus()}})},Be=()=>{if(!Pe.value.trim())return;const n=Pe.value.trim(),o=new Date,a={text:n,selectionText:ge.value,selectionRange:dt.value,user:V.commentUser||null,createdAt:o.toISOString()};Vt.value=[...Vt.value,a],re("comment-submitted",a),Pe.value="",e.nextTick(()=>{if(_e.value){const i=_e.value;i.style.height="auto",i.style.height=`${i.scrollHeight}px`,i.focus()}})},ve=(n,o=[])=>{if(V.disabled||!V.richText||!h.value)return;const a=h.value;let i=null;try{i=a.querySelector(n)}catch{return}if(!i)return;Ie(),a.focus();const s=document.createRange();s.selectNodeContents(i);const d=window.getSelection();d&&(d.removeAllRanges(),d.addRange(s)),ge.value=i.innerHTML||"",dt.value=wt();const u=s.getBoundingClientRect(),g=a.parentElement;if(g){const f=g.getBoundingClientRect(),b=u.bottom-f.top,M=Math.max(b+8,0);Et.value={top:`${M}px`}}Vt.value=Array.isArray(o)?o.slice():[];const p=i.getAttribute("data-comment")||i.getAttribute("data-fake-comment");Pt(!0),k.value=p||null,i&&(xe.value=i,i.classList.add("editor-comment-highlighted")),e.nextTick(()=>{if(Pe.value="",_e.value){const f=_e.value;f.style.height="auto",f.style.height=`${f.scrollHeight}px`,f.focus()}})},We=e.ref(null),Do=e.ref(0),dl=n=>{if(!(V.disabled||!V.richText)){if(n.key.length===1||n.key==="Enter"){const o=window.getSelection();if(o&&o.rangeCount>0){const a=o.getRangeAt(0),i=a.commonAncestorContainer,s=i.nodeType===3?i.parentElement:i;if(s){const d=s.closest(".dss-image-wrapper");if(d){const u=d.querySelector("img");if(s!==u&&!u?.contains(s)){const g=a.startContainer.nodeType===3?a.startContainer.parentElement:a.startContainer,p=a.endContainer.nodeType===3?a.endContainer.parentElement:a.endContainer;if(d.contains(g)&&g!==u||d.contains(p)&&p!==u){n.preventDefault();const f=document.createRange();f.setStartAfter(d),f.collapse(!0),o.removeAllRanges(),o.addRange(f);return}}}}}}if(n.key==="Backspace"||n.key==="Delete"){const o=window.getSelection();if(o.rangeCount>0){const a=o.getRangeAt(0);let i=null,s=null;if(a.collapsed)if(n.key==="Backspace"){const d=a.startContainer;let u=d;d.nodeType===3&&(a.startOffset===0?u=d.previousSibling||d.parentNode:u=d.parentNode);const g=u.previousSibling;g&&(g.classList&&g.classList.contains("dss-image-wrapper")?s=g:g.tagName==="IMG"&&(i=g,s=i.closest(".dss-image-wrapper"))),s||(s=u.closest(".dss-image-wrapper"),s&&(i=s.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 g=u.nextSibling;g&&(g.classList&&g.classList.contains("dss-image-wrapper")?s=g:g.tagName==="IMG"&&(i=g,s=i.closest(".dss-image-wrapper"))),s||(s=u.closest(".dss-image-wrapper"),s&&(i=s.querySelector("img")))}else{const d=a.commonAncestorContainer,u=a.startContainer.nodeType===3?a.startContainer.parentElement:a.startContainer,g=a.endContainer.nodeType===3?a.endContainer.parentElement:a.endContainer;if(d.nodeType===1&&d.tagName==="IMG"?(i=d,s=i.closest(".dss-image-wrapper")):(i=d.querySelector("img"),i&&(s=i.closest(".dss-image-wrapper"))),s){const p=s.contains(u)||u===s,f=s.contains(g)||g===s,E=a.cloneContents().textContent?.trim()||"",M=s.textContent?.trim()||"";(!p||!f||E.length>M.length)&&(s=null,i=null)}}if(s){n.preventDefault(),n.stopPropagation();const d=s.parentNode;if(d){const u=document.createTextNode("");d.insertBefore(u,s),s.remove();const g=document.createRange();g.setStartAfter(u),g.collapse(!0),o.removeAllRanges(),o.addRange(g),e.nextTick(()=>{he()});return}}}}if(n.key==="Tab"){n.preventDefault(),n.shiftKey?_t():$o();return}if(n.key==="Enter"){const o=window.getSelection();if(o.rangeCount>0){const a=o.getRangeAt(0);if(a.collapsed){const u=a.startContainer,g=p=>{if(!p)return!1;let f=p.previousSibling;for(;f;){if(f.classList&&f.classList.contains("dss-image-wrapper")||f.tagName==="IMG"||f.querySelector&&f.querySelector(".dss-image-wrapper")||f.querySelector&&f.querySelector("img"))return!0;f=f.previousSibling}const b=p.parentElement;return b&&b!==h.value?g(b):!1};if(u.nodeType===3){const p=u.parentElement;if(p&&(g(p)||g(u))){const f=p.closest("p, div");if(f&&f!==h.value){n.preventDefault(),n.stopPropagation();let b=null;const E=a.startOffset;E<u.length&&(b=u.splitText(E));const M=document.createElement("p");if(b?M.appendChild(b):M.innerHTML="<br>",u.length===0){const ke=u.parentElement;ke&&(ke.removeChild(u),ke.childNodes.length===0&&ke.appendChild(document.createElement("br")))}f.nextSibling?f.parentNode.insertBefore(M,f.nextSibling):f.parentNode.appendChild(M);const X=document.createRange();b?X.setStart(b,0):X.setStart(M,0),X.collapse(!0),o.removeAllRanges(),o.addRange(X),e.nextTick(()=>{he()});return}}}}const i=a.commonAncestorContainer,s=i.nodeType===1?i.tagName==="BLOCKQUOTE"?i:i.closest("blockquote"):i.parentElement?.closest("blockquote");if(!!(s&&h.value&&h.value.contains(s))){let u=null;i.nodeType===3?u=i.parentElement:i.tagName==="P"||i.tagName==="DIV"?u=i:u=i.closest("p, div");const g=ke=>{if(!ke)return!1;const lt=ke.textContent||"",be=(ke.innerHTML||"").trim(),Jt=be.replace(/<br\s*\/?>/gi,"").trim();return lt.trim()===""||be===""||Jt===""||be==="<br>"||be==="<br/>"||be==="<p></p>"||be==="<p><br></p>"||be==="<p><br/></p>"||be==="<p> </p>"||be==="<p><br> </p>"||be==="<div></div>"||be==="<div><br></div>"||be==="<div><br/></div>"},p=s.lastChild,f=p&&p.nodeType===1&&p.tagName==="BR",b=a.startContainer,E=b.nodeType===3?b.parentElement:b,M=E===s||E&&E.parentElement===s;if(u&&g(u)||f&&M){n.preventDefault(),setTimeout(()=>{Hl()},50);return}}}}if(n.key===" "){const o=Date.now(),a=o-Do.value;if(We.value===" "&&a<300){const i=window.getSelection();if(i.rangeCount>0){const s=i.getRangeAt(0),d=s.commonAncestorContainer.nodeType===1?s.commonAncestorContainer.closest("li"):s.commonAncestorContainer.parentElement?.closest("li");if(d){const u=s.startContainer.textContent?.substring(0,s.startOffset)||"";if((d.textContent||"").indexOf(u.trim())<=10||u.trim().length<=2){n.preventDefault(),$o();return}}}}We.value=" ",Do.value=o}else We.value=n.key}},Wo=n=>{if(ze.value){const a=n.target;!a.closest(".dss-toolbar-dropdown")&&!a.closest(".dss-toolbar-dropdown-toggle")&&Ie()}if(Ee.value){const a=n.target,i=a.closest(".dss-floating-toolbar"),s=h.value&&a.closest(".dss-text-editor-content");!i&&!s&&so()}if(De.value){const a=n.target,i=a.closest(".dss-floating-toolbar"),s=a.closest(".dss-toolbar-dropdown");!i&&!s&&jo()}const o=n.target;if(!o.closest(".dss-toolbar-dropdown")&&!o.closest(".dss-toolbar-dropdown-submenu")&&(je.value=null),!h.value||!o.closest(".dss-text-editor-content")){const a=window.getSelection();if(a&&a.rangeCount>0){const i=a.getRangeAt(0);ft.value=!i.collapsed&&jt(i)}else ft.value=!1}if(k.value!==null){const a=document.querySelector(".dss-comment-overlay");let i=!1;if(a){const u=a.getBoundingClientRect(),g=n.clientX,p=n.clientY;i=g>=u.left&&g<=u.right&&p>=u.top&&p<=u.bottom}const s=o.closest(".dss-toolbar-button"),d=s&&s.getAttribute("title")==="Comment";!i&&!d&&(k.value=null,Pe.value="",ge.value="",dt.value=null,Vt.value=[],Pt(!0))}},qo=(n,o)=>{n&&n.stopPropagation&&n.stopPropagation(),Le.value&&(clearTimeout(Le.value),Le.value=null),je.value=o},ml=n=>{const o=n.relatedTarget;if(o){const a=o.closest(".dss-toolbar-dropdown-submenu"),i=o.closest(".dss-toolbar-dropdown-item-has-submenu");if(a||i)return}Le.value&&clearTimeout(Le.value),Le.value=setTimeout(()=>{je.value=null,Le.value=null},150)},Tl=n=>{je.value=null};let qt=0;const Yt=n=>{if(!n)return;const o=Array.from(n.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,i)=>{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 s=Array.from(a.children).find(g=>g.tagName==="DIV"?g.classList.contains("dss-toolbar-dropdown-item")?!1:Array.from(g.children).filter(f=>f.tagName==="BUTTON"||f.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(g=>g.tagName==="BUTTON"||g.tagName==="DIV");if(s||u){const g=`submenu-auto-${++qt}`;a.classList.add("dss-toolbar-dropdown-item-has-submenu"),a.setAttribute("data-submenu-id",g);let p=null;s?(a.tagName==="BUTTON"&&a.parentNode.insertBefore(s,a.nextSibling),s.classList.add("dss-toolbar-dropdown-submenu"),p=s):u&&(d.classList.add("dss-toolbar-dropdown-submenu"),p=d),p&&(p.setAttribute("data-submenu-id",g),p.setAttribute("data-processed","true"),s&&a.tagName!=="BUTTON"?p.dataset.originalParentRef="inside":p.dataset.originalParentRef="sibling",Array.from(p.children).forEach(b=>{(b.tagName==="BUTTON"||b.tagName==="DIV")&&!b.classList.contains("dss-toolbar-dropdown-item")&&b.classList.add("dss-toolbar-dropdown-item")}))}})},St=()=>{document.querySelectorAll(".dss-toolbar-dropdown").forEach(o=>{Yt(o),o.querySelectorAll(".dss-toolbar-dropdown-item-has-submenu").forEach(s=>{const d=s._subMenuHandlers;d&&(s.removeEventListener("mouseenter",d.enter),s.removeEventListener("mouseleave",d.leave));const u=p=>{const f=s.getAttribute("data-submenu-id");f&&qo(p,f)},g=ml;s.addEventListener("mouseenter",u),s.addEventListener("mouseleave",g),s._subMenuHandlers={enter:u,leave:g}}),o.querySelectorAll(".dss-toolbar-dropdown-submenu").forEach(s=>{const d=s._subMenuHandlers;d&&(s.removeEventListener("mouseenter",d.enter),s.removeEventListener("mouseleave",d.leave));const u=f=>{const b=s.getAttribute("data-submenu-id");b&&qo(f,b)},g=ml;s.addEventListener("mouseenter",u),s.addEventListener("mouseleave",g),s._subMenuHandlers={enter:u,leave:g},s.querySelectorAll(".dss-toolbar-dropdown-item").forEach(f=>{f.addEventListener("click",Tl)})})})},ye=()=>{if(je.value){const n=document.querySelector(`.dss-toolbar-dropdown-submenu[data-submenu-id="${je.value}"]`),o=document.querySelector(`.dss-toolbar-dropdown-item-has-submenu[data-submenu-id="${je.value}"]`);n&&o&&ko(n,o)}Ee.value&&J(),V.richText&&co()},Ro=()=>{if(!V.richText)return;document.querySelectorAll(".dss-toolbar-custom-group").forEach(o=>{Array.from(o.children).filter(i=>i.tagName==="DIV"&&!i.classList.contains("dss-toolbar-button")).forEach(i=>{i.classList.add("dss-toolbar-button")})})},Oe=()=>{const n=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 i=window.getSelection();i.removeAllRanges?i.removeAllRanges():i.empty&&i.empty()}return!1};n.forEach(a=>{a.addEventListener("selectstart",o),a.addEventListener("mousedown",o),a.addEventListener("dragstart",o),a.addEventListener("contextmenu",o),a.addEventListener("click",i=>{if(window.getSelection){const s=window.getSelection();s.removeAllRanges&&s.removeAllRanges()}})})};e.onMounted(()=>{if(e.nextTick(()=>{requestAnimationFrame(()=>{gt.value?P():No(),ot.value?Mo():kt()})}),e.nextTick(()=>{Oe()}),V.richText&&h.value){try{document.execCommand("defaultParagraphSeparator",!1,"p")}catch{}document.addEventListener("click",Wo),window.addEventListener("resize",ye),window.addEventListener("scroll",ye,!0);const n=h.value.closest(".editor-with-comments"),o=h.value.closest(".dss-text-editor-content-wrapper");if(n){const s=()=>{co()};n.addEventListener("scroll",s,{passive:!0}),o&&o!==n&&o.addEventListener("scroll",s,{passive:!0}),h.value._scrollHandlers={wrapper:n,content:o,handler:s}}e.nextTick(()=>{St(),Ro()}),h.value.addEventListener("click",s=>{const d=s.target;d.closest("a")&&!V.disabled&&s.preventDefault();const g=d.closest(".dss-image-no-alt-icon"),p=d.closest(".dss-image-wrapper");if(g||p&&d===p){s.preventDefault(),s.stopPropagation();const f=window.getSelection(),b=document.createRange();b.setStartAfter(p),b.collapse(!0),f.removeAllRanges(),f.addRange(b)}else p&&d.tagName!=="IMG"&&(s.preventDefault(),e.nextTick(()=>{const f=window.getSelection();if(f.rangeCount>0){const E=f.getRangeAt(0).commonAncestorContainer,M=E.nodeType===3?E.parentElement:E;if(p.contains(M)&&M!==p.querySelector("img")){const X=document.createRange();X.setStartAfter(p),X.collapse(!0),f.removeAllRanges(),f.addRange(X)}}else{const b=document.createRange();b.setStartAfter(p),b.collapse(!0),f.addRange(b)}}))},!0),h.value.addEventListener("mousedown",s=>{const d=s.target,u=d.closest(".dss-image-no-alt-icon"),g=d.closest(".dss-image-wrapper");if(u||g&&d.tagName!=="IMG"){s.preventDefault();const p=window.getSelection(),f=document.createRange();g&&(f.setStartAfter(g),f.collapse(!0),p.removeAllRanges(),p.addRange(f))}},!0),h.value.addEventListener("paste",s=>{e.nextTick(()=>{if(!h.value)return;h.value.querySelectorAll("img").forEach(u=>{if(!u.closest(".dss-image-wrapper"))u.removeAttribute("alt"),u.removeAttribute("data-alt"),u.setAttribute("alt",""),u.setAttribute("data-alt",""),u.alt="";else{const p=u.getAttribute("alt")||u.alt||"";if(p){const f=u.getAttribute("src")||u.src||"",b=f.replace(/^https?:\/\//,"").replace(/^data:.*,/,""),E=p===f||p===b;(p.startsWith("http://")||p.startsWith("https://")||p.startsWith("data:")||E||E)&&(u.setAttribute("alt",""),u.setAttribute("data-alt",""),u.alt="")}}}),Rt()})});let a=null;const i=new MutationObserver(s=>{s.forEach(d=>{d.addedNodes.forEach(u=>{if(u.nodeType===1){u.tagName==="IMG"&&(u.removeAttribute("alt"),u.removeAttribute("data-alt"),u.setAttribute("alt",""),u.setAttribute("data-alt",""),u.alt="");const g=u.querySelectorAll&&u.querySelectorAll("img");g&&g.forEach(p=>{p.removeAttribute("alt"),p.removeAttribute("data-alt"),p.setAttribute("alt",""),p.setAttribute("data-alt",""),p.alt=""})}})}),a&&clearTimeout(a),a=setTimeout(()=>{Rt(),Ro(),a=null},100)});if(i.observe(h.value,{childList:!0,subtree:!0}),e.nextTick(()=>{const s=document.querySelector(".dss-text-editor-toolbar");if(s){const d=new MutationObserver(()=>{e.nextTick(()=>{Ro()})});d.observe(s,{childList:!0,subtree:!0}),s._toolbarMutationObserver=d}}),V.modelValue){const s=ae(V.modelValue);h.value.innerHTML=s,Bo()}e.nextTick(()=>{const s=h.value.innerHTML||"",d=V.title||"",u=V.description||"";Ke.value=s,it.value=d,Se.value=u,Ge.value=d,ct.value=u,Ye(),Rt(),xt(),Ft(),Cl()}),Ue(),mt(),h.value._mutationObserver=i}}),e.onUnmounted(()=>{if(document.removeEventListener("click",Wo),window.removeEventListener("resize",ye),window.removeEventListener("scroll",ye,!0),K.value&&clearTimeout(K.value),Le.value&&clearTimeout(Le.value),h.value&&h.value._mutationObserver&&h.value._mutationObserver.disconnect(),ht.value&&ht.value.disconnect(),Pt(!0),h.value&&h.value._scrollHandlers){const{wrapper:o,content:a,handler:i}=h.value._scrollHandlers;o&&o.removeEventListener("scroll",i),a&&a.removeEventListener("scroll",i)}const n=document.querySelector(".dss-text-editor-toolbar");n&&n._toolbarMutationObserver&&n._toolbarMutationObserver.disconnect()});const Qe=n=>{const o=n.target,a=o.closest("a");if(a&&!V.disabled){n.preventDefault();const s=document.createRange();s.selectNodeContents(a);const d=window.getSelection();d.removeAllRanges(),d.addRange(s)}const i=o.closest(".dss-image-wrapper");i&&o.tagName!=="IMG"?e.nextTick(()=>{const s=window.getSelection();if(s.rangeCount>0){const u=s.getRangeAt(0).commonAncestorContainer,g=u.nodeType===3?u.parentElement:u;if(i.contains(g)&&g!==i.querySelector("img")){const p=document.createRange();p.setStartAfter(i),p.collapse(!0),s.removeAllRanges(),s.addRange(p)}}Rt(),Ue(),mt(),J(),Ft()}):e.nextTick(()=>{Rt(),Ue(),mt(),J(),Ft()})},pl=()=>{Xo();const n=window.getSelection();if(n&&n.rangeCount>0){const a=n.getRangeAt(0);ft.value=!a.collapsed&&jt(a),!a.collapsed&&ut.value&&(ut.value=null)}else ft.value=!1;if(Rt(),Ue(),mt(),J(),Ft(),n&&n.rangeCount>0){const i=n.getRangeAt(0).commonAncestorContainer,s=i.nodeType===3?i.parentElement:i;if(s&&s.closest(".dss-text-editor-footer")){n.removeAllRanges(),ft.value=!1;return}}["bold","italic","underline"].forEach(a=>{try{const i=window.getSelection();if(i.rangeCount>0){const s=i.getRangeAt(0);if(!s.collapsed)if(a==="bold"){const d=s.commonAncestorContainer,u=d.nodeType===3?d.parentElement:d;let g=!1;if(u&&((u.tagName==="STRONG"||u.tagName==="B"||u.closest&&u.closest("strong, b"))&&(g=!0),!g&&u.style&&parseInt(u.style.fontWeight)>=600&&(g=!0),!g))try{const p=window.getComputedStyle(u);parseInt(p.fontWeight)>=600&&(g=!0)}catch{}ee.value[a]=g}else{const d=document.queryCommandState(a);ee.value[a]=d}}}catch{}})},Ft=()=>{if(!V.richText||V.disabled||!h.value){He.value="p";return}try{const n=window.getSelection();if(!n||n.rangeCount===0){He.value="p";return}const a=n.getRangeAt(0).commonAncestorContainer,i=a.nodeType===3?a.parentElement:a;if(!i||!h.value.contains(i)){He.value="p";return}const s=i.closest("h1, h2, h3, h4, h5, h6, p");if(!s){He.value="p";return}const d=s.tagName.toLowerCase();["h1","h2","h3","h4","h5","h6","p"].includes(d)?He.value=d:He.value="p"}catch{He.value="p"}},mt=()=>{if(!h.value){eo.value=!1;return}try{const n=window.getSelection();let o=!1;if(n.rangeCount>0){const i=n.getRangeAt(0).commonAncestorContainer,s=i.nodeType===1?i.tagName==="BLOCKQUOTE"?i:i.closest("blockquote"):i.parentElement?.closest("blockquote");o=!!(s&&h.value.contains(s))}eo.value=o}catch{eo.value=!1}},jt=n=>{if(!n||!h.value)return!1;const o=n.commonAncestorContainer;if(!o)return!1;const a=o.nodeType===3?o.parentElement:o;return a?h.value.contains(a):!1},so=()=>{Ee.value=!1},J=()=>{if(!V.floatingToolbar||!V.richText||V.disabled){Ee.value=!1;return}const n=window.getSelection();if(!n||n.rangeCount===0){Ee.value=!1;return}const o=n.getRangeAt(0);if(o.collapsed||!jt(o)){Ee.value=!1;return}const a=o.getBoundingClientRect();if(!a||a.width===0&&a.height===0){Ee.value=!1;return}const i=h.value;if(!i){Ee.value=!1;return}const s=i.getBoundingClientRect();if(!s||s.width===0){Ee.value=!1;return}const d=40,u=8,g=a.top-d/2+15;let p=a.left+a.width/2;const f=window.innerWidth||document.documentElement.clientWidth||0;let b=0;uo.value&&(b=uo.value.getBoundingClientRect().width);const E=(b||320)/2;let M=s.left+E,X=s.right-E;if(X<M){const ke=s.left+s.width/2;M=ke,X=ke}if(f>0){const ke=E+u,lt=f-E-u;if(M=Math.max(M,ke),X=Math.min(X,lt),X<M){const Fe=f/2;M=Fe,X=Fe}}p<M?p=M:p>X&&(p=X),$e.value={position:"fixed",top:`${Math.max(g,8)}px`,left:`${p}px`,transform:"translate(-50%, -100%)",zIndex:10003},Ee.value=!0},Yo=n=>{V.disabled||!V.richText||(De.value=De.value===n?null:n,n==="askAi"&&(ze.value=null))},jo=()=>{De.value=null,je.value=null},Kt=n=>{It(n),jo()};let Gt=null,Nt=null,Mt=null,Qt=null;const vl=n=>{if(V.disabled||!V.richText){yo(),ro();return}const o=n.target,a=o.closest("a"),i=o.closest("img");if(Gt&&(clearTimeout(Gt),Gt=null),Mt&&(clearTimeout(Mt),Mt=null),a&&a!==Nt){ro(),Nt=a;let s=a.getAttribute("href")||"";(!s||s==="#"||s==="")&&(s=a.textContent||""),Ce.value=a,z.value=s,L.value=!0,le.value=!0,gl(a)}else!a&&Nt?(Nt=null,Gt=setTimeout(()=>{le.value||yo()},150)):a&&a===Nt&&gl(a);if(i&&i!==Qt){yo(),Qt=i;let s=i.getAttribute("alt");s===null&&(s=i.alt||"");let d=i.getAttribute("data-alt");d===null&&(d=s),i.hasAttribute("alt")||i.setAttribute("alt",s),i.hasAttribute("data-alt")||i.setAttribute("data-alt",d),oe.value=i,to.value=s.trim()||B("textEditor.image.noAlt"),vo.value=!0,Wt.value=!0,fl(i)}else!i&&Qt?(Qt=null,Mt=setTimeout(()=>{Wt.value||ro()},150)):i&&i===Qt&&fl(i)},Ll=n=>{const o=n.relatedTarget;(!o||!o.closest(".dss-text-editor-content")&&!o.closest(".dss-link-popup"))&&(Nt=null,Qt=null,Gt&&(clearTimeout(Gt),Gt=null),Mt&&(clearTimeout(Mt),Mt=null),yo(),ro())},yo=()=>{le.value=!1,setTimeout(()=>{le.value||(L.value=!1,z.value="",nt.value||(Ce.value=null))},100)},gl=n=>{if(!n||!h.value)return;const o=n.getBoundingClientRect(),s=o.top-32-8,d=o.left+o.width/2;te.value={position:"fixed",top:`${s}px`,left:`${d}px`,transform:"translateX(-50%)",zIndex:10002}},ro=()=>{Wt.value=!1,setTimeout(()=>{Wt.value||(vo.value=!1,to.value="",mo.value||(oe.value=null))},100)},fl=n=>{if(!n||!h.value)return;const o=n.getBoundingClientRect(),s=o.top-32-8,d=o.left+o.width/2;oo.value={position:"fixed",top:`${s}px`,left:`${d}px`,transform:"translateX(-50%)",zIndex:10002}},hl=()=>{if(!z.value||!Ce.value)return;let o=Ce.value.getAttribute("href")||z.value;!o.startsWith("http://")&&!o.startsWith("https://")&&!o.startsWith("mailto:")&&(o="https://"+o),window.open(o,"_blank","noopener,noreferrer")},Al=()=>{if(Ce.value){const n=Ce.value.textContent||"",o=Ce.value.getAttribute("href")||"",a=Ce.value;ce.value=o,ue.value=n,Ut.value=n,le.value=!1,L.value=!1,z.value="",Ce.value=a,nt.value=!0}else if(Ze.value){const n=window.getSelection();if(n.rangeCount>0){const a=n.getRangeAt(0).commonAncestorContainer,i=a.nodeType===1?a.closest("a"):a.parentElement?.closest("a");if(i){const s=i.textContent||"",d=i.getAttribute("href")||"";ce.value=d,ue.value=s,Ut.value=s,Ce.value=i,nt.value=!0}}}else{Bt.value=wt();const n=window.getSelection();let o="";n.rangeCount>0&&(o=n.getRangeAt(0).toString()),ce.value="",ue.value=o,Ut.value="",Ce.value=null,nt.value=!0}e.nextTick(()=>{at.value&&(at.value.focus(),at.value.select())})},Io=()=>{nt.value=!1,ce.value="",ue.value="",Ut.value="",Ce.value=null,Bt.value=null},_o=()=>{if(!ce.value.trim()){Io();return}if(de.value?(K.value&&(clearTimeout(K.value),K.value=null),Te(),de.value=!1):Te(),ue.value.trim()||(ue.value=ce.value.trim()),Ce.value&&h.value&&h.value.contains(Ce.value)){const n=window.getSelection();n.rangeCount>0&&n.removeAllRanges();const o=Ce.value;if(o.textContent,o.setAttribute("href",ce.value.trim()),ue.value.trim()!==Ut.value.trim()){for(;o.firstChild;)o.removeChild(o.firstChild);o.textContent=ue.value.trim()}o.style.color="#60afdf",o.style.textDecoration="underline";const a=document.createRange();a.selectNodeContents(o),a.collapse(!1),n.removeAllRanges(),n.addRange(a),he()}else if(h.value){h.value.focus();const n=window.getSelection();n.removeAllRanges(),Bt.value&&Dt(Bt.value);let o=null;if(n.rangeCount>0&&(o=n.getRangeAt(0)),o&&!o.collapsed){o.deleteContents();const a=document.createElement("a");a.href=ce.value.trim(),a.textContent=ue.value.trim(),a.style.color="#60afdf",a.style.textDecoration="underline",o.insertNode(a),o.setStartAfter(a),o.collapse(!0),n.removeAllRanges(),n.addRange(o)}else{o||(o=document.createRange(),o.selectNodeContents(h.value),o.collapse(!1));const a=document.createElement("a");a.href=ce.value.trim(),a.textContent=ue.value.trim(),a.style.color="#60afdf",a.style.textDecoration="underline",o.insertNode(a),o.setStartAfter(a),o.collapse(!0),n.removeAllRanges(),n.addRange(o)}he()}e.nextTick(()=>{Ue(),Io()})},Ko=()=>{h.value&&(Tt.value=wt(),qe.value="",st.value="",Lt.value="",Ve.value="",fe.value="",xo.value=null,oe.value=null,Xe.value="upload",mo.value=!0,Ie(),e.nextTick(()=>{Ht.value&&Ht.value.focus(),tt.value&&(tt.value.value="")}))},yl=n=>{const o=n.target?.files?.[0];if(!o){xo.value=null,st.value="";return}xo.value=o;const a=new FileReader;a.onload=i=>{st.value=i.target?.result||""},a.readAsDataURL(o)},Co=()=>{tt.value&&tt.value.click()},$l=()=>{let n=oe.value;if(!n){const o=window.getSelection();if(o&&o.rangeCount>0){const i=o.getRangeAt(0).commonAncestorContainer;n=i.nodeType===1?i.closest("img"):i.parentElement?.closest("img")}}if(n){const o=n.getAttribute("data-alt")||n.getAttribute("alt")||"";oe.value=n,qe.value=o.trim()===""||o.trim()==="Image"?"":o;const a=n.getAttribute("src")||n.src||"";a.startsWith("http://")||a.startsWith("https://")?(Lt.value=a,st.value="",Xe.value="url"):(st.value=a,Lt.value="",Xe.value="upload");const s=n.style.width||n.getAttribute("width")||"",d=n.style.height||n.getAttribute("height")||"";Ve.value=s.endsWith("px")?s.replace("px",""):s,fe.value=d.endsWith("px")?d.replace("px",""):d,Tt.value=null}else{Ko();return}mo.value=!0,Wt.value=!1,vo.value=!1,e.nextTick(()=>{Xe.value==="url"&&po.value?(po.value.focus(),po.value.select()):Ht.value&&(Ht.value.focus(),Ht.value.select()),tt.value&&(tt.value.value="")})},io=()=>{mo.value=!1,qe.value="",st.value="",Lt.value="",Ve.value="",fe.value="",xo.value=null,oe.value=null,Tt.value=null,Xe.value="upload"},zt=()=>{const n=(qe.value||"").trim(),o=h.value?._mutationObserver;o&&o.disconnect(),de.value?(K.value&&(clearTimeout(K.value),K.value=null),Te(),de.value=!1):Te();const a=Xe.value==="url"?Lt.value.trim():st.value;if(oe.value&&h.value&&h.value.contains(oe.value)){a&&(oe.value.src=a),oe.value.setAttribute("alt",n),oe.value.setAttribute("data-alt",n),Ve.value?(oe.value.style.width=`${Ve.value}px`,oe.value.setAttribute("width",Ve.value)):(oe.value.style.removeProperty("width"),oe.value.removeAttribute("width")),fe.value?(oe.value.style.height=`${fe.value}px`,oe.value.setAttribute("height",fe.value)):(oe.value.style.removeProperty("height"),oe.value.removeAttribute("height"));const i=window.getSelection();if(i){i.removeAllRanges();const s=document.createRange();s.setStartAfter(oe.value),s.collapse(!0),i.addRange(s)}he()}else{if(!a){o&&h.value&&o.observe(h.value,{childList:!0,subtree:!0}),io();return}if(h.value){h.value.focus();const i=window.getSelection();i&&i.rangeCount>0&&i.removeAllRanges();const s=window.getSelection();let d=null;if(Tt.value&&(Dt(Tt.value),s&&s.rangeCount>0&&(d=s.getRangeAt(0))),!d&&s&&s.rangeCount>0&&(d=s.getRangeAt(0)),!d&&h.value){if(d=document.createRange(),h.value.childNodes.length===0){const f=document.createElement("p");f.innerHTML="<br>",h.value.appendChild(f),d.setStart(f,0),d.collapse(!0)}else d.selectNodeContents(h.value),d.collapse(!1);s&&(s.removeAllRanges(),s.addRange(d))}if(!d){io();return}const u=d.commonAncestorContainer,g=u.nodeType===3?u.parentElement:u;if(!h.value.contains(g)){if(d=document.createRange(),h.value.childNodes.length===0){const f=document.createElement("p");f.innerHTML="<br>",h.value.appendChild(f),d.setStart(f,0),d.collapse(!0)}else d.selectNodeContents(h.value),d.collapse(!1);s&&(s.removeAllRanges(),s.addRange(d))}const p=document.createElement("img");p.src=a,p.setAttribute("alt",n),p.setAttribute("data-alt",n),Ve.value&&(p.style.width=`${Ve.value}px`,p.setAttribute("width",Ve.value)),fe.value&&(p.style.height=`${fe.value}px`,p.setAttribute("height",fe.value));try{d.insertNode(p),d.setStartAfter(p),d.collapse(!0),s&&(s.removeAllRanges(),s.addRange(d))}catch{if(h.value){if(h.value.childNodes.length===0){const E=document.createElement("p");h.value.appendChild(E),E.appendChild(p)}else{const E=h.value.lastChild;if(E&&E.nodeType===1)E.appendChild(p);else{const M=document.createElement("p");h.value.appendChild(M),M.appendChild(p)}}const b=document.createRange();b.setStartAfter(p),b.collapse(!0),s&&(s.removeAllRanges(),s.addRange(b))}}oe.value=p,he()}}e.nextTick(()=>{o&&h.value&&o.observe(h.value,{childList:!0,subtree:!0}),Ue(),J(),io()})};e.watch(()=>V.modelValue,n=>{if(V.richText&&h.value&&!et.value){const o=ae(n||"");if(h.value.innerHTML!==o){const i=wt();h.value.innerHTML=o,e.nextTick(()=>{Bo();const s=h.value.innerHTML||"",d=V.title||"",u=V.description||"";Ke.value=s,it.value=d,Se.value=u,At.value=s,Ge.value=d,ct.value=u,rt.value=[],lo.value=[],K.value&&(clearTimeout(K.value),K.value=null),de.value=!1,i&&Dt(i),Ye(),Rt(),xt(),Ue(),J(),Ft(),co()})}}},{immediate:!0}),e.watch(()=>V.richText,n=>{n?(J(),e.nextTick(()=>{Cl()})):(so(),no.value=[],ht.value&&(ht.value.disconnect(),ht.value=null)),Ft()}),e.watch(()=>V.floatingToolbar,n=>{n?J():so()}),e.watch(()=>V.disabled,n=>{n&&so(),Ft()}),e.watch(()=>V.description,()=>{e.nextTick(()=>{ot.value?Mo():kt()})}),e.watch(()=>V.title,()=>{e.nextTick(()=>{gt.value?P():No()})}),e.watch(()=>V.customToolbarSlots,()=>{e.nextTick(()=>{Ro()})},{deep:!0});const co=()=>{if(!V.richText||!h.value){no.value=[];return}const n={},o=h.value,a=o.closest(".editor-with-comments");if(!a)return;o.querySelectorAll("[data-comment], [data-fake-comment]").forEach((s,d)=>{const u=s.getAttribute("data-comment")||s.getAttribute("data-fake-comment");if(!u)return;const g=a.getBoundingClientRect(),p=s.getBoundingClientRect(),f=o.getBoundingClientRect(),b=window.getComputedStyle(s),E=parseFloat(b.lineHeight)||parseFloat(b.fontSize)*1.2,ke=p.top-f.top+E/2-15,Fe=f.top-g.top+ke;let be=V.commentUser||null;const Jt=s.getAttribute("data-comment-user");if(Jt)try{be=JSON.parse(Jt)}catch{}let kl=null;const Qo=s.getAttribute("data-comment-user-2");if(Qo)try{kl=JSON.parse(Qo)}catch{}const Jo=s.getAttribute("data-comment-count"),Rl=Jo?parseInt(Jo,10):1;n[u]||(n[u]={id:u,top:Fe,element:s,firstUser:be,secondUser:kl,totalCount:Rl})}),no.value=Object.values(n).map(s=>{const d=s.firstUser?s.secondUser?2:1:0,u=Math.max(0,s.totalCount-d);return{...s,additionalCount:u}})},Dl=n=>{!n||!n.element||(Pt(),xe.value=n.element,n.element.classList.add("editor-comment-highlighted"))},Pt=(n=!1)=>{!n&&k.value!==null&&xe.value&&(xe.value.getAttribute("data-comment")||xe.value.getAttribute("data-fake-comment"))===k.value||(h.value&&h.value.querySelectorAll(".editor-comment-highlighted").forEach(a=>{a.classList.remove("editor-comment-highlighted")}),xe.value&&(xe.value.classList.remove("editor-comment-highlighted"),xe.value=null))},Go=n=>{if(!n||!n.element)return;Pt(!0);const o=n.element.getAttribute("data-comment")||n.element.getAttribute("data-fake-comment");if(!o)return;const a=`[data-comment="${o}"], [data-fake-comment="${o}"]`;re("comment-marker-clicked",{commentId:o,selector:a,element:n.element})},Cl=()=>{!V.richText||!h.value||(ht.value&&ht.value.disconnect(),ht.value=new MutationObserver(()=>{e.nextTick(()=>{co()})}),ht.value.observe(h.value,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-comment","data-fake-comment","data-comment-user","data-comment-user-2","data-comment-count"]}),co())},ko=(n,o)=>{if(!n||!o)return;const a=o.getBoundingClientRect(),i=o.closest(".dss-toolbar-dropdown");o.closest(".dss-floating-toolbar"),i&&i.getBoundingClientRect();let s=a.top,d=a.right+4;n.style.top=`${s}px`,n.style.left=`${d}px`,n.offsetHeight;const u=n.getBoundingClientRect(),g=window.innerWidth,p=window.innerHeight;if(u.right>g){const f=a.left-u.width-4;n.style.left=`${f}px`}if(u.bottom>p){const f=Math.max(8,p-u.height-8);n.style.top=`${f}px`}u.top<0&&(n.style.top="8px"),n.getBoundingClientRect()};return e.watch(()=>je.value,n=>{e.nextTick(()=>{document.querySelectorAll(".dss-toolbar-dropdown-submenu").forEach(a=>{const i=a.getAttribute("data-submenu-id");if(i===n&&n){const s=document.querySelector(`.dss-toolbar-dropdown-item-has-submenu[data-submenu-id="${i}"]`);if(s){if(a.parentNode!==document.body){const d=a.parentNode;a.dataset.originalParentRef=d===s?"inside":"sibling",document.body.appendChild(a)}a.style.display="block",a.style.visibility="hidden",a.style.opacity="0",requestAnimationFrame(()=>{requestAnimationFrame(()=>{ko(a,s),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(()=>[ze.value,De.value],()=>{ze.value==="askAi"||De.value==="askAi"?e.nextTick(()=>{St()}):(je.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 i=document.querySelector(`.dss-toolbar-dropdown-item-has-submenu[data-submenu-id="${a}"]`);if(i)if(o.dataset.originalParentRef==="inside")i.appendChild(o);else{const d=i.closest(".dss-toolbar-dropdown");d&&d.insertBefore(o,i.nextSibling)}}}})}))}),e.watch(()=>V.locale,n=>{n&&n!==pt.value&&(pt.value=n)},{immediate:!0}),Zt({openCommentOverlayForSelector:ve}),(n,o)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-text-editor-container editor-with-comments",wl.value]),style:e.normalizeStyle($t.value)},[D.richText?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-text-editor-toolbar",onMousedown:o[14]||(o[14]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("div",Vs,[e.createElementVNode("button",{type:"button",class:"dss-toolbar-button",onClick:nl,title:e.unref(B)("textEditor.toolbar.undo")},[...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:"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,Ss),e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-disabled":!Oo.value}]),onClick:al,title:e.unref(B)("textEditor.toolbar.redo")},[...o[47]||(o[47]=[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,Ns),o[74]||(o[74]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",Ms,[e.createElementVNode("button",{type:"button",class:"dss-toolbar-button dss-toolbar-dropdown-toggle",onClick:o[0]||(o[0]=a=>sl("paragraph")),title:e.unref(B)("textEditor.toolbar.paragraphFormat")},[He.value==="h1"?(e.openBlock(),e.createElementBlock("svg",Hs,[...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.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)])])):He.value==="h2"?(e.openBlock(),e.createElementBlock("svg",Ts,[...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:"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)])])):He.value==="h3"?(e.openBlock(),e.createElementBlock("svg",Ls,[...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:"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)])])):He.value==="h4"?(e.openBlock(),e.createElementBlock("svg",As,[...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:"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)])])):He.value==="h5"?(e.openBlock(),e.createElementBlock("svg",$s,[...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:"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)])])):He.value==="h6"?(e.openBlock(),e.createElementBlock("svg",Ds,[...o[53]||(o[53]=[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",Rs,[...o[54]||(o[54]=[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[55]||(o[55]=e.createElementVNode("span",{class:"dss-toolbar-dropdown-arrow"},"˅",-1))],8,Bs),ze.value==="paragraph"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:o[8]||(o[8]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{type:"button",class:"dss-toolbar-dropdown-item",onClick:o[1]||(o[1]=a=>It("<h1>"))},[...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.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,"Heading 1",-1)])]),e.createElementVNode("div",{type:"button",class:"dss-toolbar-dropdown-item",onClick:o[2]||(o[2]=a=>It("<h2>"))},[...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:"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,"Heading 2",-1)])]),e.createElementVNode("div",{type:"button",class:"dss-toolbar-dropdown-item",onClick:o[3]||(o[3]=a=>It("<h3>"))},[...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:"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,"Heading 3",-1)])]),e.createElementVNode("div",{type:"button",class:"dss-toolbar-dropdown-item",onClick:o[4]||(o[4]=a=>It("<h4>"))},[...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:"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,"Heading 4",-1)])]),e.createElementVNode("div",{type:"button",class:"dss-toolbar-dropdown-item",onClick:o[5]||(o[5]=a=>It("<h5>"))},[...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:"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,"Heading 5",-1)])]),e.createElementVNode("div",{type:"button",class:"dss-toolbar-dropdown-item",onClick:o[6]||(o[6]=a=>It("<h6>"))},[...o[61]||(o[61]=[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,"Heading 6",-1)])]),e.createElementVNode("div",{type:"button",class:"dss-toolbar-dropdown-item",onClick:o[7]||(o[7]=a=>It("<p>"))},[...o[62]||(o[62]=[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,"Paragraph",-1)])])])):e.createCommentVNode("",!0)]),e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Ne("bold")}]),onClick:o[9]||(o[9]=a=>bt("bold")),title:e.unref(B)("textEditor.toolbar.bold")},[...o[63]||(o[63]=[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,Is),e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Ne("italic")}]),onClick:o[10]||(o[10]=a=>bt("italic")),title:e.unref(B)("textEditor.toolbar.italic")},[...o[64]||(o[64]=[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,_s),e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Ne("underline")}]),onClick:o[11]||(o[11]=a=>bt("underline")),title:e.unref(B)("textEditor.toolbar.underline")},[...o[65]||(o[65]=[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,Fs),e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":eo.value}]),onClick:rl,title:e.unref(B)("textEditor.toolbar.citation")},[...o[66]||(o[66]=[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,zs),o[75]||(o[75]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),Ze.value?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-toolbar-button",onClick:Uo,title:e.unref(B)("textEditor.toolbar.removeLink")},[(e.openBlock(),e.createElementBlock("svg",Xs,[...o[68]||(o[68]=[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"},null,-1)])]))],8,Zs)):(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-toolbar-button",onClick:Lo,title:e.unref(B)("textEditor.toolbar.insertLink")},[(e.openBlock(),e.createElementBlock("svg",Os,[...o[67]||(o[67]=[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"},null,-1)])]))],8,Ps)),o[76]||(o[76]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Ne("insertUnorderedList")}]),onClick:il,title:e.unref(B)("textEditor.toolbar.bulletList")},[...o[69]||(o[69]=[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,Us),e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Ne("insertOrderedList")}]),onClick:cl,title:e.unref(B)("textEditor.toolbar.numberList")},[...o[70]||(o[70]=[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,Ws),o[77]||(o[77]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("button",{type:"button",class:"dss-toolbar-button",onClick:Ko,title:e.unref(B)("textEditor.toolbar.image")},[...o[71]||(o[71]=[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:"M14 12.4444V1.55556C14 0.7 13.3 0 12.4444 0H1.55556C0.7 0 0 0.7 0 1.55556V12.4444C0 13.3 0.7 14 1.55556 14H12.4444C13.3 14 14 13.3 14 12.4444ZM4.27778 8.16667L6.22222 10.5078L8.94444 7L12.4444 11.6667H1.55556L4.27778 8.16667Z",fill:"#323232"})],-1)])],8,qs),ft.value?(e.openBlock(),e.createElementBlock("div",Ys)):e.createCommentVNode("",!0),ft.value?(e.openBlock(),e.createElementBlock("button",{key:3,type:"button",class:"dss-toolbar-button",title:e.unref(B)("textEditor.toolbar.comment"),onClick:Me},[...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:"M12.5996 0C13.3696 0 14 0.630391 14 1.40039V14L11.2002 11.2002H7.77637C8.02637 10.6283 8.16699 9.99705 8.16699 9.33301C8.16682 6.75583 6.07722 4.66699 3.5 4.66699C2.10579 4.66699 0.85512 5.27873 0 6.24805V1.40039C0 0.630391 0.630391 0 1.40039 0H12.5996ZM3.55762 7.08398C3.83361 7.08416 4.05762 7.30795 4.05762 7.58398V8.88965H5.36328C5.63927 8.88982 5.86328 9.11362 5.86328 9.38965C5.86302 9.66546 5.63911 9.88947 5.36328 9.88965H4.05762V11.1963C4.05753 11.4722 3.83356 11.6961 3.55762 11.6963C3.28168 11.6961 3.0577 11.4722 3.05762 11.1963V9.88965H1.75098C1.475 9.88965 1.25124 9.66557 1.25098 9.38965C1.25098 9.11351 1.47483 8.88965 1.75098 8.88965H3.05762V7.58398C3.05762 7.30795 3.28162 7.08416 3.55762 7.08398Z",fill:"#323232"})],-1)])],8,js)):e.createCommentVNode("",!0),D.askAi?(e.openBlock(),e.createElementBlock("div",Ks)):e.createCommentVNode("",!0),D.askAi?(e.openBlock(),e.createElementBlock("div",Gs,[e.createElementVNode("button",{type:"button",class:"dss-toolbar-ai-button dss-toolbar-dropdown-toggle",onClick:o[12]||(o[12]=a=>sl("askAi")),title:e.unref(B)("textEditor.toolbar.askAi")},[o[73]||(o[73]=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",Js,e.toDisplayString(e.unref(B)("textEditor.toolbar.askAi")),1)],8,Qs),ze.value==="askAi"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:o[13]||(o[13]=e.withModifiers(()=>{},["stop"]))},[e.renderSlot(n.$slots,"ask-ai-dropdown")])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),e.createElementVNode("div",er,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(D.customToolbarSlots,(a,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:i},[yt(a)?(e.openBlock(),e.createElementBlock("div",tr,[e.renderSlot(n.$slots,a)])):e.createCommentVNode("",!0),yt(a)&&i<D.customToolbarSlots.length-1&&El(i)?(e.openBlock(),e.createElementBlock("div",or)):e.createCommentVNode("",!0)],64))),128))])],32)):e.createCommentVNode("",!0),(ze.value==="paragraph"||ze.value==="askAi")&&D.richText?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-dropdown-overlay",onClick:Ie})):e.createCommentVNode("",!0),e.createVNode(Il,{showModal:nt.value,width:"500px",height:"55vh",onCloseModal:Io},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(B)("textEditor.link.editLink")),1)]),content:e.withCtx(()=>[e.createElementVNode("div",lr,[e.createElementVNode("div",nr,[o[78]||(o[78]=e.createElementVNode("label",{class:"dss-link-modal-label"},"Alt text:",-1)),e.withDirectives(e.createElementVNode("input",{ref_key:"linkAltInput",ref:wo,type:"text","onUpdate:modelValue":o[15]||(o[15]=a=>ue.value=a),class:"dss-link-modal-input",placeholder:"Enter alt text...",onKeyup:e.withKeys(_o,["enter"])},null,544),[[e.vModelText,ue.value]])]),e.createElementVNode("div",ar,[e.createElementVNode("label",sr,e.toDisplayString(e.unref(B)("textEditor.link.url")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"linkUrlInput",ref:at,type:"text","onUpdate:modelValue":o[16]||(o[16]=a=>ce.value=a),class:"dss-link-modal-input",placeholder:e.unref(B)("textEditor.link.enterUrl"),onKeyup:e.withKeys(_o,["enter"])},null,40,rr),[[e.vModelText,ce.value]])])])]),actions:e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-cancel",onClick:Io},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:_o},e.toDisplayString(e.unref(B)("textEditor.link.save")),1)]),_:1},8,["showModal"]),e.createVNode(Il,{showModal:mo.value,width:"500px",height:"80vh",onCloseModal:io},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(oe.value?e.unref(B)("textEditor.image.editImage"):e.unref(B)("textEditor.image.addImage")),1)]),content:e.withCtx(()=>[e.createElementVNode("div",ir,[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-image-modal-tab",{"dss-image-modal-tab-active":Xe.value==="upload"}]),onClick:o[17]||(o[17]=a=>Xe.value="upload")},e.toDisplayString(e.unref(B)("textEditor.image.upload")),3),o[79]||(o[79]=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":Xe.value==="url"}]),onClick:o[18]||(o[18]=a=>Xe.value="url")},e.toDisplayString(e.unref(B)("textEditor.image.imageLink")),3)]),Xe.value==="upload"?(e.openBlock(),e.createElementBlock("div",cr,[e.createElementVNode("div",ur,[e.createElementVNode("div",dr,[ol.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("label",mr,e.toDisplayString(e.unref(B)("textEditor.image.uploadImage")),1)),ol.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-image-upload-preview",onClick:Co},[e.createElementVNode("img",{src:st.value,alt:"Preview",class:"dss-image-preview-image"},null,8,pr),o[80]||(o[80]=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:tt,type:"file",accept:"image/*",class:"dss-image-file-input-hidden",onChange:yl},null,544)])):(e.openBlock(),e.createElementBlock("input",{key:2,ref_key:"imageFileInput",ref:tt,type:"file",accept:"image/*",class:"dss-link-modal-input dss-link-modal-input-image",onChange:yl},null,544))]),e.createElementVNode("div",vr,[e.createElementVNode("label",gr,e.toDisplayString(e.unref(B)("textEditor.image.altText")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"imageAltInput",ref:Ht,type:"text","onUpdate:modelValue":o[19]||(o[19]=a=>qe.value=a),class:"dss-link-modal-input",placeholder:"Enter alt text...",onKeyup:e.withKeys(zt,["enter"])},null,544),[[e.vModelText,qe.value]])]),e.createElementVNode("div",fr,[e.createElementVNode("label",hr,e.toDisplayString(e.unref(B)("textEditor.image.width")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":o[20]||(o[20]=a=>Ve.value=a),class:"dss-link-modal-input",placeholder:"Auto",onKeyup:e.withKeys(zt,["enter"])},null,544),[[e.vModelText,Ve.value]])]),e.createElementVNode("div",yr,[e.createElementVNode("label",Cr,e.toDisplayString(e.unref(B)("textEditor.image.height")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":o[21]||(o[21]=a=>fe.value=a),class:"dss-link-modal-input",placeholder:"Auto",onKeyup:e.withKeys(zt,["enter"])},null,544),[[e.vModelText,fe.value]])])])])):e.createCommentVNode("",!0),Xe.value==="url"?(e.openBlock(),e.createElementBlock("div",kr,[e.createElementVNode("div",wr,[e.createElementVNode("div",xr,[o[81]||(o[81]=e.createElementVNode("label",{class:"dss-link-modal-label"},"Image URL:",-1)),e.withDirectives(e.createElementVNode("input",{ref_key:"imageUrlInput",ref:po,type:"text","onUpdate:modelValue":o[22]||(o[22]=a=>Lt.value=a),class:"dss-link-modal-input",placeholder:"https://example.com/image.jpg",onKeyup:e.withKeys(zt,["enter"])},null,544),[[e.vModelText,Lt.value]])]),e.createElementVNode("div",br,[e.createElementVNode("label",Er,e.toDisplayString(e.unref(B)("textEditor.image.altText")),1),e.withDirectives(e.createElementVNode("input",{type:"text","onUpdate:modelValue":o[23]||(o[23]=a=>qe.value=a),class:"dss-link-modal-input",placeholder:"Enter alt text...",onKeyup:e.withKeys(zt,["enter"])},null,544),[[e.vModelText,qe.value]])]),e.createElementVNode("div",Vr,[e.createElementVNode("label",Sr,e.toDisplayString(e.unref(B)("textEditor.image.width")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":o[24]||(o[24]=a=>Ve.value=a),class:"dss-link-modal-input",placeholder:"Auto",onKeyup:e.withKeys(zt,["enter"])},null,544),[[e.vModelText,Ve.value]])]),e.createElementVNode("div",Nr,[e.createElementVNode("label",Mr,e.toDisplayString(e.unref(B)("textEditor.image.height")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":o[25]||(o[25]=a=>fe.value=a),class:"dss-link-modal-input",placeholder:"Auto",onKeyup:e.withKeys(zt,["enter"])},null,544),[[e.vModelText,fe.value]])])])])):e.createCommentVNode("",!0)]),actions:e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-cancel",onClick:io}," Cancel "),e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-save",onClick:zt}," Save ")]),_:1},8,["showModal"]),e.createElementVNode("div",{class:e.normalizeClass(["dss-text-editor-title-wrapper",{"dss-text-editor-no-border-bottom":pe.value&>.value}])},[o[82]||(o[82]=e.createElementVNode("p",null," Title ",-1)),e.createElementVNode("div",Br,[gt.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Hr,[D.title?(e.openBlock(),e.createElementBlock("span",Tr,e.toDisplayString(D.title),1)):(e.openBlock(),e.createElementBlock("span",Lr,e.toDisplayString(Zo.value),1))])),e.createElementVNode("textarea",{ref_key:"titleInputRef",ref:ie,value:D.title,onInput:ll,onFocus:go,onBlur:fo,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-title-input",{"dss-text-editor-title-input-blurred":!gt.value}]),placeholder:Zo.value,disabled:D.disabled,rows:"1"},null,42,Ar)])],2),pe.value&>.value?(e.openBlock(),e.createElementBlock("div",$r,[e.renderSlot(n.$slots,"title-slot")])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["dss-text-editor-description-wrapper",{"dss-text-editor-no-border-bottom":Ct.value&&ot.value}])},[o[83]||(o[83]=e.createElementVNode("p",null," Description ",-1)),e.createElementVNode("div",Dr,[ot.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Rr,[D.description?(e.openBlock(),e.createElementBlock("span",Ir,e.toDisplayString(D.description),1)):(e.openBlock(),e.createElementBlock("span",_r,e.toDisplayString(Vo.value),1))])),e.createElementVNode("textarea",{ref_key:"descriptionInputRef",ref:me,value:D.description,onInput:Nl,onFocus:Vl,onBlur:Sl,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-description-input",{"dss-text-editor-description-input-blurred":!ot.value}]),placeholder:Vo.value,disabled:D.disabled,rows:"1"},null,42,Fr)])],2),Ct.value&&ot.value?(e.openBlock(),e.createElementBlock("div",zr,[e.renderSlot(n.$slots,"description-slot")])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(no.value,a=>(e.openBlock(),e.createElementBlock("div",{key:a.id,class:e.normalizeClass(["editor-comment-marker-group",{"editor-comment-marker-active":k.value===a.id}]),"data-comment-id":a.id,style:e.normalizeStyle({top:a.top+"px"}),onMouseenter:i=>Dl(a),onMouseleave:o[26]||(o[26]=()=>Pt(!1))},[a.firstUser?(e.openBlock(),e.createElementBlock("div",{key:0,class:"editor-comment-marker editor-comment-marker-first",onClick:e.withModifiers(i=>Go(a),["stop"])},[a.firstUser.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:a.firstUser.avatar,alt:a.firstUser.name||"avatar"},null,8,Zr)):(e.openBlock(),e.createElementBlock("span",Xr,e.toDisplayString(a.firstUser.initials||(a.firstUser.name?a.firstUser.name.charAt(0):"")),1))],8,Or)):e.createCommentVNode("",!0),a.secondUser?(e.openBlock(),e.createElementBlock("div",{key:1,class:"editor-comment-marker editor-comment-marker-second",onClick:e.withModifiers(i=>Go(a),["stop"])},[a.secondUser.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:a.secondUser.avatar,alt:a.secondUser.name||"avatar"},null,8,Wr)):(e.openBlock(),e.createElementBlock("span",qr,e.toDisplayString(a.secondUser.initials||(a.secondUser.name?a.secondUser.name.charAt(0):"")),1))],8,Ur)):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(i=>Go(a),["stop"])},[e.createElementVNode("span",jr,"+"+e.toDisplayString(a.additionalCount),1)],12,Yr)):e.createCommentVNode("",!0)],46,Pr))),128)),D.richText?(e.openBlock(),e.createElementBlock("div",oi,[e.createElementVNode("div",{ref_key:"editorRef",ref:h,contenteditable:"true",spellcheck:"false",class:e.normalizeClass(["dss-text-editor-content",{"dss-text-editor-content-disabled":D.disabled,"dss-text-editor-fixed-height":D.fixedHeight}]),style:e.normalizeStyle(el.value),onInput:he,onBlur:ao,onClick:Qe,onMouseup:pl,onKeyup:pl,onKeydown:dl,onMousemove:vl,onMouseleave:Ll},null,38),e.createVNode(e.Transition,{name:"comment-overlay"},{default:e.withCtx(()=>[k.value!==null?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-comment-overlay",style:e.normalizeStyle(Et.value)},[ge.value||Vt.value.length>0?(e.openBlock(),e.createElementBlock("div",li,[e.createElementVNode("div",ni,[ge.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-comment-selection",innerHTML:ge.value},null,8,ai)):e.createCommentVNode("",!0)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Vt.value,(a,i)=>(e.openBlock(),e.createElementBlock("div",{key:i,class:"dss-comment-message"},[a.user&&(a.user.avatar||a.user.initials||a.user.name)?(e.openBlock(),e.createElementBlock("div",si,[e.createElementVNode("div",ri,[a.user.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:a.user.avatar,alt:a.user.name||"avatar"},null,8,ii)):(e.openBlock(),e.createElementBlock("span",ci,e.toDisplayString(a.user.initials||(a.user.name?a.user.name.charAt(0):"")),1))])])):e.createCommentVNode("",!0),e.createElementVNode("div",ui,[e.createElementVNode("div",di,[e.createElementVNode("div",mi,e.toDisplayString(a.user&&a.user.name||"Comment"),1),a.createdAt?(e.openBlock(),e.createElementBlock("div",pi,e.toDisplayString(N(new Date(a.createdAt))),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",vi,e.toDisplayString(a.text||""),1)])]))),128))])):e.createCommentVNode("",!0),e.createElementVNode("div",gi,[e.withDirectives(e.createElementVNode("textarea",{ref_key:"commentInputRef",ref:_e,"onUpdate:modelValue":o[27]||(o[27]=a=>Pe.value=a),class:"dss-comment-input",rows:"1",placeholder:"comment",onKeydown:e.withKeys(e.withModifiers(Be,["prevent","stop"]),["enter"]),onInput:o[28]||(o[28]=()=>{if(_e.value){const a=_e.value;a.style.height="auto",a.style.height=`${a.scrollHeight}px`}})},null,40,fi),[[e.vModelText,Pe.value]]),e.createElementVNode("button",{type:"button",class:"dss-comment-send-button",onClick:e.withModifiers(Be,["stop"])},[...o[85]||(o[85]=[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",hi,[e.createElementVNode("div",yi,[e.createElementVNode("span",Ci,e.toDisplayString(bo.value)+" "+e.toDisplayString(bo.value===1?e.unref(B)("textEditor.footer.word"):e.unref(B)("textEditor.footer.words")),1),o[86]||(o[86]=e.createElementVNode("span",{class:"dss-text-editor-footer-separator"},"•",-1)),e.createElementVNode("span",ki,e.toDisplayString(Eo.value)+" "+e.toDisplayString(Eo.value===1?e.unref(B)("textEditor.footer.character"):e.unref(B)("textEditor.footer.characters")),1)])])])):(e.openBlock(),e.createElementBlock("div",Kr,[e.createElementVNode("textarea",{value:D.modelValue,onInput:Re,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-textarea",{"dss-text-editor-fixed-height":D.fixedHeight}]),placeholder:bl.value,rows:D.rows,disabled:D.disabled,style:e.normalizeStyle(xl.value)},null,46,Gr),e.createElementVNode("div",Qr,[e.createElementVNode("div",Jr,[e.createElementVNode("span",ei,e.toDisplayString(bo.value)+" "+e.toDisplayString(bo.value===1?e.unref(B)("textEditor.footer.word"):e.unref(B)("textEditor.footer.words")),1),o[84]||(o[84]=e.createElementVNode("span",{class:"dss-text-editor-footer-separator"},"•",-1)),e.createElementVNode("span",ti,e.toDisplayString(Eo.value)+" "+e.toDisplayString(Eo.value===1?e.unref(B)("textEditor.footer.character"):e.unref(B)("textEditor.footer.characters")),1)])])])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[L.value&&z.value&&h.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-link-popup",style:e.normalizeStyle(te.value),onMouseenter:o[29]||(o[29]=a=>le.value=!0),onMouseleave:yo},[e.createElementVNode("span",{class:"dss-link-popup-url",onClick:e.withModifiers(hl,["stop"]),title:z.value},e.toDisplayString(z.value),9,wi),e.createElementVNode("button",{type:"button",class:"dss-link-popup-edit",onClick:e.withModifiers(Al,["stop"]),title:e.unref(B)("textEditor.link.editLink")},[(e.openBlock(),e.createElementBlock("svg",bi,[...o[87]||(o[87]=[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,xi)],36)):e.createCommentVNode("",!0)])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[vo.value&&to.value&&h.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-link-popup",style:e.normalizeStyle(oo.value),onMouseenter:o[30]||(o[30]=a=>Wt.value=!0),onMouseleave:ro},[e.createElementVNode("div",Ei,[to.value===e.unref(B)("textEditor.image.noAlt")?(e.openBlock(),e.createElementBlock("div",Vi,[...o[88]||(o[88]=[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:to.value},e.toDisplayString(to.value),9,Si)]),e.createElementVNode("button",{type:"button",class:"dss-link-popup-edit",onClick:e.withModifiers($l,["stop"]),title:e.unref(B)("textEditor.image.editImage")},[(e.openBlock(),e.createElementBlock("svg",Mi,[...o[89]||(o[89]=[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,Ni)],36)):e.createCommentVNode("",!0)])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[D.floatingToolbar&&D.richText&&Ee.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"floatingToolbarRef",ref:uo,class:"dss-floating-toolbar",style:e.normalizeStyle($e.value),onMousedown:o[45]||(o[45]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("div",Bi,[e.createElementVNode("button",{type:"button",class:"dss-toolbar-button",onClick:e.withModifiers(nl,["stop"]),title:e.unref(B)("textEditor.toolbar.undo")},[...o[90]||(o[90]=[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,Hi),e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-disabled":!Oo.value}]),onClick:e.withModifiers(al,["stop"]),title:e.unref(B)("textEditor.toolbar.redo")},[...o[91]||(o[91]=[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,Ti),o[111]||(o[111]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",Li,[e.createElementVNode("button",{type:"button",class:"dss-toolbar-button dss-toolbar-dropdown-toggle",onClick:o[31]||(o[31]=e.withModifiers(a=>Yo("paragraph"),["stop"])),title:e.unref(B)("textEditor.toolbar.paragraphFormat")},[He.value==="h1"?(e.openBlock(),e.createElementBlock("svg",$i,[...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:"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)])])):He.value==="h2"?(e.openBlock(),e.createElementBlock("svg",Di,[...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:"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)])])):He.value==="h3"?(e.openBlock(),e.createElementBlock("svg",Ri,[...o[94]||(o[94]=[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)])])):He.value==="h4"?(e.openBlock(),e.createElementBlock("svg",Ii,[...o[95]||(o[95]=[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)])])):He.value==="h5"?(e.openBlock(),e.createElementBlock("svg",_i,[...o[96]||(o[96]=[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)])])):He.value==="h6"?(e.openBlock(),e.createElementBlock("svg",Fi,[...o[97]||(o[97]=[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",zi,[...o[98]||(o[98]=[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[99]||(o[99]=e.createElementVNode("span",{class:"dss-toolbar-dropdown-arrow"},"˅",-1))],8,Ai),De.value==="paragraph"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:o[39]||(o[39]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("button",{type:"button",class:"dss-toolbar-dropdown-item",onClick:o[32]||(o[32]=a=>Kt("<h1>"))},[e.createElementVNode("h1",null,e.toDisplayString(e.unref(B)("textEditor.paragraph.heading1")),1)]),e.createElementVNode("button",{type:"button",class:"dss-toolbar-dropdown-item",onClick:o[33]||(o[33]=a=>Kt("<h2>"))},[e.createElementVNode("h2",null,e.toDisplayString(e.unref(B)("textEditor.paragraph.heading2")),1)]),e.createElementVNode("button",{type:"button",class:"dss-toolbar-dropdown-item",onClick:o[34]||(o[34]=a=>Kt("<h3>"))},[e.createElementVNode("h3",null,e.toDisplayString(e.unref(B)("textEditor.paragraph.heading3")),1)]),e.createElementVNode("button",{type:"button",class:"dss-toolbar-dropdown-item",onClick:o[35]||(o[35]=a=>Kt("<h4>"))},[e.createElementVNode("h4",null,e.toDisplayString(e.unref(B)("textEditor.paragraph.heading4")),1)]),e.createElementVNode("button",{type:"button",class:"dss-toolbar-dropdown-item",onClick:o[36]||(o[36]=a=>Kt("<h5>"))},[e.createElementVNode("h5",null,e.toDisplayString(e.unref(B)("textEditor.paragraph.heading5")),1)]),e.createElementVNode("button",{type:"button",class:"dss-toolbar-dropdown-item",onClick:o[37]||(o[37]=a=>Kt("<h6>"))},[e.createElementVNode("h6",null,e.toDisplayString(e.unref(B)("textEditor.paragraph.heading6")),1)]),e.createElementVNode("button",{type:"button",class:"dss-toolbar-dropdown-item",onClick:o[38]||(o[38]=a=>Kt("<p>"))},[e.createElementVNode("p",null,e.toDisplayString(e.unref(B)("textEditor.paragraph.paragraph")),1)])])):e.createCommentVNode("",!0)]),o[112]||(o[112]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Ne("bold")}]),onClick:o[40]||(o[40]=e.withModifiers(a=>bt("bold"),["stop"])),title:e.unref(B)("textEditor.toolbar.bold")},[...o[100]||(o[100]=[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,Pi),e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Ne("italic")}]),onClick:o[41]||(o[41]=e.withModifiers(a=>bt("italic"),["stop"])),title:e.unref(B)("textEditor.toolbar.italic")},[...o[101]||(o[101]=[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,Oi),e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Ne("underline")}]),onClick:o[42]||(o[42]=e.withModifiers(a=>bt("underline"),["stop"])),title:e.unref(B)("textEditor.toolbar.underline")},[...o[102]||(o[102]=[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,Zi),o[113]||(o[113]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":eo.value}]),onClick:e.withModifiers(rl,["stop"]),title:e.unref(B)("textEditor.toolbar.citation")},[...o[103]||(o[103]=[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,Xi),o[114]||(o[114]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),Ze.value?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-toolbar-button",onClick:e.withModifiers(Uo,["stop"]),title:e.unref(B)("textEditor.toolbar.removeLink")},[(e.openBlock(),e.createElementBlock("svg",Yi,[...o[105]||(o[105]=[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"},null,-1)])]))],8,qi)):(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-toolbar-button",onClick:e.withModifiers(Lo,["stop"]),title:e.unref(B)("textEditor.toolbar.insertLink")},[(e.openBlock(),e.createElementBlock("svg",Wi,[...o[104]||(o[104]=[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"},null,-1)])]))],8,Ui)),o[115]||(o[115]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Ne("insertUnorderedList")}]),onClick:e.withModifiers(il,["stop"]),title:e.unref(B)("textEditor.toolbar.bulletList")},[...o[106]||(o[106]=[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,ji),e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Ne("insertOrderedList")}]),onClick:e.withModifiers(cl,["stop"]),title:e.unref(B)("textEditor.toolbar.numberList")},[...o[107]||(o[107]=[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,Ki),o[116]||(o[116]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("button",{type:"button",class:"dss-toolbar-button",onClick:e.withModifiers(Ko,["stop"]),title:e.unref(B)("textEditor.toolbar.image")},[...o[108]||(o[108]=[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:"M14 12.4444V1.55556C14 0.7 13.3 0 12.4444 0H1.55556C0.7 0 0 0.7 0 1.55556V12.4444C0 13.3 0.7 14 1.55556 14H12.4444C13.3 14 14 13.3 14 12.4444ZM4.27778 8.16667L6.22222 10.5078L8.94444 7L12.4444 11.6667H1.55556L4.27778 8.16667Z",fill:"#323232"})],-1)])],8,Gi),o[117]||(o[117]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("button",{type:"button",class:"dss-toolbar-button",title:e.unref(B)("textEditor.toolbar.comment"),onClick:e.withModifiers(Me,["stop"])},[...o[109]||(o[109]=[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:"M12.5996 0C13.3696 0 14 0.630391 14 1.40039V14L11.2002 11.2002H7.77637C8.02637 10.6283 8.16699 9.99705 8.16699 9.33301C8.16682 6.75583 6.07722 4.66699 3.5 4.66699C2.10579 4.66699 0.85512 5.27873 0 6.24805V1.40039C0 0.630391 0.630391 0 1.40039 0H12.5996ZM3.55762 7.08398C3.83361 7.08416 4.05762 7.30795 4.05762 7.58398V8.88965H5.36328C5.63927 8.88982 5.86328 9.11362 5.86328 9.38965C5.86302 9.66546 5.63911 9.88947 5.36328 9.88965H4.05762V11.1963C4.05753 11.4722 3.83356 11.6961 3.55762 11.6963C3.28168 11.6961 3.0577 11.4722 3.05762 11.1963V9.88965H1.75098C1.475 9.88965 1.25124 9.66557 1.25098 9.38965C1.25098 9.11351 1.47483 8.88965 1.75098 8.88965H3.05762V7.58398C3.05762 7.30795 3.28162 7.08416 3.55762 7.08398Z",fill:"#323232"})],-1)])],8,Qi),D.askAi?(e.openBlock(),e.createElementBlock("div",Ji)):e.createCommentVNode("",!0),D.askAi?(e.openBlock(),e.createElementBlock("div",ec,[e.createElementVNode("div",{type:"button",class:"dss-toolbar-ai-button dss-toolbar-ai-float dss-toolbar-dropdown-toggle",onClick:o[43]||(o[43]=e.withModifiers(a=>Yo("askAi"),["stop"])),title:e.unref(B)("textEditor.toolbar.askAi")},[o[110]||(o[110]=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",oc,e.toDisplayString(e.unref(B)("textEditor.toolbar.askAi")),1)],8,tc),De.value==="askAi"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:o[44]||(o[44]=e.withModifiers(()=>{},["stop"]))},[e.renderSlot(n.$slots,"ask-ai-dropdown")])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),So.value?(e.openBlock(),e.createElementBlock("div",lc,[D.askAi&&So.value?(e.openBlock(),e.createElementBlock("div",nc)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(D.customToolbarSlots,(a,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:i},[yt(a)&&I(a)?(e.openBlock(),e.createElementBlock("div",ac,[e.renderSlot(n.$slots,a)])):e.createCommentVNode("",!0),yt(a)&&I(a)&&i<D.customToolbarSlots.length-1&&we(i)?(e.openBlock(),e.createElementBlock("div",sc)):e.createCommentVNode("",!0)],64))),128))])):e.createCommentVNode("",!0)],36)):e.createCommentVNode("",!0)]))],6))}}),cc={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"}},uc={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:"comment",send:"Send"},labels:{title:"Title",description:"Description"},placeholders:{title:"Enter title...",description:"Enter description...",startTyping:"Start typing..."},footer:{word:"word",words:"words",character:"character",characters:"characters"}},Pl={chart:cc,textEditor:uc},dc={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"}},mc={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:"Titre 1",heading2:"Titre 2",heading3:"Titre 3",heading4:"Titre 4",heading5:"Titre 5",heading6:"Titre 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:"commentaire",send:"Envoyer"},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"}},Ol={chart:dc,textEditor:mc},pc={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"}},vc={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:"commentaar",send:"Verzenden"},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"}},Zl={chart:pc,textEditor:vc},_l={en:Pl,fr:Ol,nl:Zl};function gc(D){if(!D||!D.global)return;const Zt=D.global.availableLocales||[];Object.keys(_l).forEach(U=>{Zt.includes(U)?D.global.mergeLocaleMessage(U,_l[U]):console.error(`⊗ Skipped DSP translations for: ${U} (not in app)`)})}const Fl={en:{textEditor:Pl.textEditor},fr:{textEditor:Ol.textEditor},nl:{textEditor:Zl.textEditor}};function fc(D){if(!D||!D.global)return;const Zt=D.global.availableLocales||[];Object.keys(Fl).forEach(U=>{Zt.includes(U)?D.global.mergeLocaleMessage(U,Fl[U]):console.error(`⊗ Skipped DSSTextEditor translations for: ${U} (not in app)`)})}const hc={en:{...Pl},fr:{...Ol},nl:{...Zl}};zl.createI18n({legacy:!1,locale:"en",fallbackLocale:"en",messages:hc});exports.DSSChart=xs;exports.DSSChartMessages=_l;exports.DSSModal=Il;exports.DSSTextEditor=ic;exports.DSSTextEditorMessages=Fl;exports.addDSSChartTranslations=gc;exports.addDSSTextEditorTranslations=fc;
|
|
77
|
+
</svg>`,h=e.ref(null),ze=e.ref(null),Ze=e.ref(!1),et=e.ref(!1),L=e.ref(!1),z=e.ref(""),te=e.ref({}),le=e.ref(!1),nt=e.ref(!1),ce=e.ref(""),ue=e.ref(""),at=e.ref(null),wo=e.ref(null),Ce=e.ref(null),Bt=e.ref(null),Ut=e.ref(""),eo=e.ref(!1),ee=e.ref({}),Ee=e.ref(!1),$e=e.ref({}),uo=e.ref(null),De=e.ref(null),mo=e.ref(!1),qe=e.ref(""),xo=e.ref(null),st=e.ref(""),Ve=e.ref(""),fe=e.ref(""),Ht=e.ref(null),tt=e.ref(null),po=e.ref(null),oe=e.ref(null),Tt=e.ref(null),vo=e.ref(!1),to=e.ref(""),oo=e.ref({}),Wt=e.ref(!1),Xe=e.ref("upload"),Lt=e.ref(""),je=e.ref(null),Le=e.ref(null),rt=e.ref([]),lo=e.ref([]),K=e.ref(null),de=e.ref(!1),Ke=e.ref(""),At=e.ref(""),it=e.ref(""),Se=e.ref(""),Ge=e.ref(""),ct=e.ref(""),ie=e.ref(null),me=e.ref(null),vt=e.ref(null),Po=e.ref(!1),gt=e.ref(!1),ot=e.ref(!1),ut=e.ref(null),He=e.ref("p"),ft=e.ref(!1),no=e.ref([]),ht=e.ref(null),wl=e.computed(()=>({"dss-text-editor-no-border":!V.border,"dss-text-editor-rounded":V.rounded,"dss-text-editor-full-height":V.fullHeight,"dss-comment-overlay-open":k.value!==null})),$t=e.computed(()=>({})),xl=e.computed(()=>!V.fixedHeight||V.fullHeight?{}:{height:`${1.6*14*V.rows+24+2}px`,resize:"none",overflowY:"auto"}),el=e.computed(()=>!V.fixedHeight||V.fullHeight?{}:{height:`${1.6*14*V.rows+32}px`,overflowY:"auto"}),Oo=e.computed(()=>V.richText&&lo.value.length>0),tl=e.computed(()=>{if(!V.modelValue)return"";if(V.richText){let n=V.modelValue.replace(/<script[^>]*>[\s\S]*?<\/script>/gi,"");return n=n.replace(/<style[^>]*>[\s\S]*?<\/style>/gi,""),n=n.replace(/<[^>]+>/g,""),n=n.replace(/ /g," "),n=n.replace(/&/g,"&"),n=n.replace(/</g,"<"),n=n.replace(/>/g,">"),n=n.replace(/"/g,'"'),n=n.replace(/'/g,"'"),n=n.replace(/\s+/g," ").trim(),n}return V.modelValue}),bo=e.computed(()=>{const n=tl.value.trim();return n?n.split(/\s+/).filter(o=>o.length>0).length:0}),Eo=e.computed(()=>tl.value.length),ol=e.computed(()=>oe.value!==null&&Xe.value==="upload"&&st.value&&st.value.startsWith("data:")),Zo=e.computed(()=>V.titlePlaceholder||B("textEditor.placeholders.title")),Vo=e.computed(()=>V.descriptionPlaceholder||B("textEditor.placeholders.description")),bl=e.computed(()=>V.placeholder||B("textEditor.placeholders.startTyping")),yt=n=>Xt&&Xt[n]!==void 0,El=n=>{for(let o=n+1;o<V.customToolbarSlots.length;o++)if(yt(V.customToolbarSlots[o]))return!0;return!1},we=n=>{for(let o=n+1;o<V.customToolbarSlots.length;o++){const a=V.customToolbarSlots[o];if(yt(a)&&I(a))return!0}return!1},I=n=>V.customToolbarFloatingMap.hasOwnProperty(n)?V.customToolbarFloatingMap[n]===!0:!0,So=e.computed(()=>V.customToolbarSlots.some(n=>yt(n)&&I(n))),pe=e.computed(()=>yt("title-slot")),Ct=e.computed(()=>yt("description-slot")),Y=n=>{if(!n||n.trim()==="")return"<html></html>";const o=n.trim();return o.startsWith("<html>")&&o.endsWith("</html>")?n:`<html>${n}</html>`},ae=n=>{if(!n||n.trim()==="")return"";const o=n.trim();return o.startsWith("<html>")&&o.endsWith("</html>")?o.slice(6,-7).trim():n},N=n=>{try{const o=String(n.getDate()).padStart(2,"0"),i=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][n.getMonth()],s=n.getFullYear();return`${o} ${i} ${s}`}catch{return""}},Re=n=>{const o=n.target.value;re("update:modelValue",o),re("change",o)},P=()=>{if(!ie.value)return;const n=ie.value;if(n.style.setProperty("text-overflow","","important"),n.style.setProperty("white-space","","important"),n.style.setProperty("overflow-x","","important"),n.style.setProperty("height","auto","important"),n.value.trim()===""){const i=n.value;n.value="M";const s=n.scrollHeight;n.value=i,n.style.setProperty("height",`${s}px`,"important"),n.style.setProperty("overflow-y","hidden","important");return}n.offsetHeight;const a=n.scrollHeight;n.style.setProperty("height",`${a}px`,"important"),n.style.setProperty("overflow-y","hidden","important")},go=()=>{gt.value=!0,P()},fo=()=>{gt.value=!1,No()},No=()=>{if(!ie.value)return;const n=ie.value;n.style.setProperty("text-overflow","","important"),n.style.setProperty("white-space","","important"),n.style.setProperty("overflow-x","","important"),n.style.setProperty("height","auto","important");const o=n.value;n.value="M";const a=n.scrollHeight;n.value=o,n.offsetHeight,n.style.setProperty("height",`${a}px`,"important"),n.style.setProperty("overflow-y","hidden","important"),n.style.setProperty("overflow-x","hidden","important"),n.style.setProperty("text-overflow","ellipsis","important"),n.style.setProperty("white-space","nowrap","important")},ll=n=>{const a=n.target.value;gt.value&&P(),re("update:title",a),re("title-change",a),vt.value="title",V.richText&&(de.value||(At.value=Ke.value,Ge.value=it.value,ct.value=Se.value),K.value&&clearTimeout(K.value),de.value=!0,K.value=setTimeout(()=>{de.value=!1,Te()},500))},Mo=()=>{if(!me.value)return;const n=me.value;if(n.style.setProperty("text-overflow","","important"),n.style.setProperty("white-space","","important"),n.style.setProperty("overflow-x","","important"),n.style.setProperty("height","auto","important"),n.value.trim()===""){const i=n.value;n.value="M";const s=n.scrollHeight;n.value=i,n.style.setProperty("height",`${s}px`,"important"),n.style.setProperty("overflow-y","hidden","important");return}n.offsetHeight;const a=n.scrollHeight;n.style.setProperty("height",`${a}px`,"important"),n.style.setProperty("overflow-y","hidden","important")},Vl=()=>{ot.value=!0,Mo()},Sl=()=>{ot.value=!1,kt()},kt=()=>{if(!me.value)return;const n=me.value;n.style.setProperty("text-overflow","","important"),n.style.setProperty("white-space","","important"),n.style.setProperty("overflow-x","","important"),n.style.setProperty("height","auto","important");const o=n.value;n.value="M";const a=n.scrollHeight;n.value=o,n.offsetHeight,n.style.setProperty("height",`${a}px`,"important"),n.style.setProperty("overflow-y","hidden","important"),n.style.setProperty("overflow-x","hidden","important"),n.style.setProperty("text-overflow","ellipsis","important"),n.style.setProperty("white-space","nowrap","important")},Nl=n=>{const a=n.target.value;ot.value&&Mo(),re("update:description",a),re("description-change",a),vt.value="description",V.richText&&(de.value||(At.value=Ke.value,Ge.value=it.value,ct.value=Se.value),K.value&&clearTimeout(K.value),de.value=!0,K.value=setTimeout(()=>{de.value=!1,Te()},500))},wt=()=>{const n=window.getSelection();if(n.rangeCount===0)return null;const o=n.getRangeAt(0),a=o.cloneRange();return a.selectNodeContents(h.value),a.setEnd(o.startContainer,o.startOffset),{start:a.toString().length,end:a.toString().length+o.toString().length}},Dt=n=>{if(!(!n||!h.value))try{const o=window.getSelection(),a=document.createRange();let i=0;const s=[h.value];let d=null,u=!1,g=!1;for(;!g&&(d=s.pop());)if(d.nodeType===3){const p=i+d.length;!u&&n.start>=i&&n.start<=p&&(a.setStart(d,n.start-i),u=!0),u&&n.end>=i&&n.end<=p&&(a.setEnd(d,n.end-i),g=!0),i=p}else{let p=d.childNodes.length;for(;p--;)s.push(d.childNodes[p])}o.removeAllRanges(),o.addRange(a)}catch{h.value.focus()}},ho=()=>{if(!h.value)return;h.value.focus();const n=window.getSelection(),o=document.createRange(),a=s=>{if(s.nodeType===3||s.childNodes.length===0)return s;for(let d=s.childNodes.length-1;d>=0;d--){const u=s.childNodes[d],g=a(u);if(g)return g}return s},i=a(h.value);if(i.nodeType===3)o.setStart(i,i.length),o.setEnd(i,i.length);else if(i.childNodes.length>0){const s=a(i);s&&s.nodeType===3?(o.setStart(s,s.length),o.setEnd(s,s.length)):(o.selectNodeContents(i),o.collapse(!1))}else o.setStart(i,0),o.setEnd(i,0);n.removeAllRanges(),n.addRange(o)},Te=(n=!1)=>{if(!h.value)return;const o=h.value.innerHTML,a=V.title||"",i=V.description||"";if(!n&&o===Ke.value&&a===it.value&&i===Se.value)return;const s={content:At.value||Ke.value,title:Ge.value!==void 0?Ge.value:it.value,description:ct.value!==void 0?ct.value:Se.value},d=rt.value.length>0?rt.value[rt.value.length-1]:null;let u=!0;d&&(typeof d=="string"?u=s.content!==d:u=s.content!==d.content||s.title!==d.title||s.description!==d.description),u&&(rt.value.push(s),rt.value.length>50&&rt.value.shift(),lo.value=[]),Ke.value=o,it.value=a,Se.value=i,At.value=o,Ge.value=a,ct.value=i},he=n=>{if(!h.value)return;Xo();let o=null;h.value&&(h.value.querySelector("p")||(o=wt(),Bo())),n&&n.inputType&&(n.inputType==="insertText"||n.inputType==="insertCompositionText"||n.inputType==="deleteContentBackward"||n.inputType==="deleteContentForward")&&ut.value&&(ut.value=null),et.value=!0;const i=h.value.innerHTML,s=Y(i);re("update:modelValue",s),re("change",s),vt.value="editor",de.value||(At.value=Ke.value,Ge.value=it.value,ct.value=Se.value),K.value&&clearTimeout(K.value),de.value=!0,K.value=setTimeout(()=>{de.value=!1,Te()},500),e.nextTick(()=>{o&&Dt(o),Xo();const d=["bold","italic","underline"],u=window.getSelection(),g=u.rangeCount>0?u.getRangeAt(0):null,p=g&&g.collapsed;d.forEach(f=>{try{if(p&&ut.value?.command===f){ee.value[f]=ut.value.state;return}if(f==="bold")if(g){const b=g.commonAncestorContainer,E=b.nodeType===3?b.parentElement:b;let M=!1;if(E&&((E.tagName==="STRONG"||E.tagName==="B"||E.closest&&E.closest("strong, b"))&&(M=!0),!M&&E.style&&parseInt(E.style.fontWeight)>=600&&(M=!0),!M))try{const X=window.getComputedStyle(E);parseInt(X.fontWeight)>=600&&(M=!0)}catch{}ee.value[f]=M}else ee.value.hasOwnProperty(f)||(ee.value[f]=!1);else if(f==="italic")if(g){const b=g.commonAncestorContainer,E=b.nodeType===3?b.parentElement:b,M=E&&(E.tagName==="EM"||E.tagName==="I"||E.closest&&E.closest("em, i"));ee.value[f]=!!M}else{const b=document.queryCommandState(f);ee.value[f]=b}else{const b=document.queryCommandState(f);ee.value[f]=b}}catch{}}),Ye(),Rt(),xt(),J(),Ft(),co(),et.value=!1})},Xo=()=>{if(!h.value)return;const n=window.getSelection();if(!n||n.rangeCount===0)return;const o=n.getRangeAt(0),a=o.commonAncestorContainer,i=a.nodeType===3?a.parentElement:a;if(!i)return;const s=i.closest(".dss-image-wrapper");if(s){const d=s.querySelector("img");if(i!==d&&!d?.contains(i)){const u=o.startContainer.nodeType===3?o.startContainer.parentElement:o.startContainer,g=o.endContainer.nodeType===3?o.endContainer.parentElement:o.endContainer;if(s.contains(u)&&u!==d||s.contains(g)&&g!==d){const p=document.createRange();p.setStartAfter(s),p.collapse(!0),n.removeAllRanges(),n.addRange(p)}}}},Bo=()=>{if(!h.value)return;const n=h.value;if(n.querySelector&&n.querySelector("p"))return;const o=new Set(["P","H1","H2","H3","H4","H5","H6","BLOCKQUOTE","UL","OL","DIV"]),a=Array.from(n.childNodes);let i=null;a.forEach(s=>{if(s.nodeType===Node.TEXT_NODE){if((s.textContent||"").trim()===""){s.parentNode===n&&n.removeChild(s);return}i||(i=document.createElement("p"),n.insertBefore(i,s)),i.appendChild(s);return}if(s.nodeType===Node.ELEMENT_NODE){const d=s,u=d.tagName;if(u==="BR"){i=null;return}if(o.has(u)){i=null;return}i||(i=document.createElement("p"),n.insertBefore(i,d)),i.appendChild(d)}})},Rt=()=>{if(h.value&&!Po.value){Po.value=!0;try{h.value.querySelectorAll(".dss-image-wrapper").forEach(i=>{i.querySelector("img")||i.remove()}),h.value.querySelectorAll(".dss-image-no-alt-icon").forEach(i=>{const s=i.parentElement;!s||!s.classList.contains("dss-image-wrapper")?i.remove():s.querySelector("img")||i.remove()}),h.value.querySelectorAll("img").forEach(i=>{let s=i.getAttribute("alt");s===null&&(s=i.alt||"");const d=i.getAttribute("src")||i.src||"";if(s){const f=d.replace(/^https?:\/\//,"").replace(/^data:.*,/,""),b=s===d||s===f;(s.startsWith("http://")||s.startsWith("https://")||s.startsWith("data:")||b||b)&&(s="")}i.setAttribute("alt",s),i.setAttribute("data-alt",s);const u=!s||s.trim()==="";let g=i.parentElement;const p=g&&g.classList.contains("dss-image-wrapper");if(p){const f=g.querySelector(".dss-image-no-alt-icon");f&&f.remove()}else{const f=i.nextElementSibling?.classList.contains("dss-image-no-alt-icon")?i.nextElementSibling:null;f&&f.remove()}if(u){p?g.setAttribute("contenteditable","false"):(g=document.createElement("span"),g.className="dss-image-wrapper",g.setAttribute("contenteditable","false"),i.parentNode.insertBefore(g,i),g.appendChild(i));const f=document.createElement("div");f.className="dss-image-no-alt-icon",f.setAttribute("contenteditable","false"),f.innerHTML=T,g.appendChild(f)}else if(p&&g.children.length===1){const f=g.parentNode;f.insertBefore(i,g),f.removeChild(g)}})}finally{Po.value=!1}}},ao=n=>{re("blur",n),so()},nl=()=>{if(V.disabled||!V.richText||!h.value)return;Ie(),K.value&&(clearTimeout(K.value),K.value=null),de.value&&(Te(),de.value=!1);const n=vt.value==="title",o=vt.value==="description",a=vt.value==="editor";if(rt.value.length===0){n&&ie.value?ie.value.focus():o&&me.value?me.value.focus():h.value.focus(),document.execCommand("undo",!1),e.nextTick(()=>{he()});return}const i={content:h.value.innerHTML,title:V.title||"",description:V.description||""};lo.value.push(i);const s=rt.value.pop();if(s!==void 0){et.value=!0;const d=typeof s=="string"?s:s.content,u=typeof s=="object"&&s.title||"",g=typeof s=="object"&&s.description||"";h.value.innerHTML=d,Ke.value=d,it.value=u,Se.value=g,At.value=d,Ge.value=u,ct.value=g,e.nextTick(()=>{Ye(),Ue(),mt(),J();const p=Y(d);re("update:modelValue",p),re("update:title",u),re("update:description",g),re("change",p),re("title-change",u),re("description-change",g),et.value=!1,e.nextTick(()=>{setTimeout(()=>{if(n){if(ie.value){ie.value.focus();const f=u.length;ie.value.setSelectionRange&&ie.value.setSelectionRange(f,f),P()}}else if(o){if(me.value){me.value.focus();const f=g.length;me.value.setSelectionRange(f,f)}}else if(a)ho();else if(ie.value&&document.activeElement===ie.value){const f=u.length;ie.value.setSelectionRange&&ie.value.setSelectionRange(f,f),P()}else if(me.value&&document.activeElement===me.value){const f=g.length;me.value.setSelectionRange(f,f)}else h.value&&ho()},10)})})}},al=()=>{if(V.disabled||!V.richText||!h.value)return;Ie();const n=vt.value==="title",o=vt.value==="description",a=vt.value==="editor";if(lo.value.length===0){n&&ie.value?ie.value.focus():o&&me.value?me.value.focus():h.value.focus(),document.execCommand("redo",!1),e.nextTick(()=>{he()});return}const i={content:h.value.innerHTML,title:V.title||"",description:V.description||""};rt.value.push(i);const s=lo.value.pop();if(s!==void 0){et.value=!0;const d=typeof s=="string"?s:s.content,u=typeof s=="object"&&s.title||"",g=typeof s=="object"&&s.description||"";h.value.innerHTML=d,Ke.value=d,it.value=u,Se.value=g,At.value=d,Ge.value=u,ct.value=g,e.nextTick(()=>{Ye(),Ue(),mt(),J();const p=Y(d);re("update:modelValue",p),re("update:title",u),re("update:description",g),re("change",p),re("title-change",u),re("description-change",g),et.value=!1,e.nextTick(()=>{setTimeout(()=>{if(n){if(ie.value){ie.value.focus();const f=u.length;ie.value.setSelectionRange&&ie.value.setSelectionRange(f,f),P()}}else if(o){if(me.value){me.value.focus();const f=g.length;me.value.setSelectionRange(f,f)}}else if(a)ho();else if(ie.value&&document.activeElement===ie.value){const f=u.length;ie.value.setSelectionRange&&ie.value.setSelectionRange(f,f),P()}else if(me.value&&document.activeElement===me.value){const f=g.length;me.value.setSelectionRange(f,f)}else h.value&&ho()},10)})})}},Ho=()=>{if(!h.value)return;h.value.querySelectorAll('span[style*="font-weight"]').forEach(i=>{const s=i.style.fontWeight;if(s==="normal"||s==="400"){const d=document.createDocumentFragment();for(;i.firstChild;)d.appendChild(i.firstChild);i.parentNode&&i.parentNode.replaceChild(d,i)}}),h.value.querySelectorAll('span[style*="font-weight"]').forEach(i=>{if(parseInt(i.style.fontWeight)>=600){const d=document.createElement("b");for(d.style.fontWeight="600";i.firstChild;)d.appendChild(i.firstChild);i.parentNode&&i.parentNode.replaceChild(d,i)}}),h.value.querySelectorAll("b, strong").forEach(i=>{i.style.fontWeight="600"})},xt=()=>{if(!h.value)return;h.value.querySelectorAll("i, em").forEach(o=>{o.style.fontStyle="italic"})},Ml=()=>{const n=window.getSelection();if(!n||n.rangeCount===0)return!1;const o=n.getRangeAt(0);let a=!1;if(o.collapsed){const i=o.startContainer;let s=i.nodeType===3?i.parentElement:i;for(;s&&s!==h.value;){if(s.tagName==="EM"||s.tagName==="I"){a=!0;break}if(s.style&&s.style.fontStyle==="italic"){a=!0;break}s=s.parentElement}}else{const i=o.commonAncestorContainer.nodeType===1?o.commonAncestorContainer:o.commonAncestorContainer.parentNode;if(i){const s=document.createTreeWalker(i,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let d;for(;d=s.nextNode();)if(!(typeof o.intersectsNode=="function"&&!o.intersectsNode(d))){if(d.nodeType===3){let u=d.parentElement;for(;u&&u!==h.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(()=>{xt()}),!1;if(o.collapsed)document.execCommand("italic",!1),e.nextTick(()=>{xt()});else try{const i=o.extractContents(),s=document.createElement("em");s.style.fontStyle="italic",s.appendChild(i),o.insertNode(s),o.setStartAfter(s),o.collapse(!0),n.removeAllRanges(),n.addRange(o),e.nextTick(()=>{xt()})}catch{document.execCommand("italic",!1),e.nextTick(()=>{xt()})}return!0},To=()=>{const n=window.getSelection();if(!n||n.rangeCount===0)return!1;const o=n.getRangeAt(0);let a=!1;if(o.collapsed){const i=o.startContainer;let s=i.nodeType===3?i.parentElement:i;for(;s&&s!==h.value;){if(s.tagName==="STRONG"||s.tagName==="B"){a=!0;break}if(s.style&&parseInt(s.style.fontWeight)>=600){a=!0;break}s=s.parentElement}}else{const i=o.commonAncestorContainer.nodeType===1?o.commonAncestorContainer:o.commonAncestorContainer.parentNode;if(i){const s=document.createTreeWalker(i,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let d;for(;d=s.nextNode();)if(!(typeof o.intersectsNode=="function"&&!o.intersectsNode(d))){if(d.nodeType===3){let u=d.parentElement;for(;u&&u!==h.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(()=>{Ho()}),!1;if(o.collapsed)document.execCommand("bold",!1),e.nextTick(()=>{const i=window.getSelection();if(i.rangeCount>0){const s=i.getRangeAt(0),d=s.startContainer;let u=d.nodeType===3?d.parentElement:d;for(;u&&u!==h.value;){if(u.tagName==="SPAN"&&u.style.fontWeight){const g=u.style.fontWeight;if(g==="normal"||g==="400"){const p=document.createElement("b");p.style.fontWeight="600";const f=document.createDocumentFragment();for(;u.firstChild;)f.appendChild(u.firstChild);p.appendChild(f),u.parentNode&&u.parentNode.replaceChild(p,u),s.setStart(p,0),s.collapse(!0),i.removeAllRanges(),i.addRange(s);break}}else if(u.tagName==="STRONG"||u.tagName==="B"){u.style.fontWeight="600";break}u=u.parentElement}if(!u||u===h.value){const g=document.createElement("b");g.style.fontWeight="600",g.innerHTML="<br>",s.insertNode(g),s.setStart(g,0),s.collapse(!0),i.removeAllRanges(),i.addRange(s)}}Ho()});else try{const i=o.extractContents(),s=document.createElement("b");s.style.fontWeight="600",s.appendChild(i),o.insertNode(s),o.setStartAfter(s),o.collapse(!0),n.removeAllRanges(),n.addRange(o),e.nextTick(()=>{Ho()})}catch{document.execCommand("bold",!1),e.nextTick(()=>{Ho()})}return!0},bt=(n,o=null)=>{if(V.disabled||!V.richText||!h.value)return;de.value?(K.value&&(clearTimeout(K.value),K.value=null),Te(),de.value=!1):Te(),Ie(),h.value.focus();const a=window.getSelection();let i=null;if(a&&a.rangeCount>0){const d=a.getRangeAt(0);!d.collapsed&&jt(d)&&(i=wt())}if(n==="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(n==="bold"){const d=To();ee.value.bold=d;const u=window.getSelection();u.rangeCount>0&&u.getRangeAt(0).collapsed&&(ut.value={command:"bold",state:d}),e.nextTick(()=>{i&&(Dt(i),e.nextTick(()=>{const g=Ne("bold");ee.value.bold=g})),he(),Ue(),J()});return}if(n==="italic"){const d=Ml();ee.value.italic=d;const u=window.getSelection();u.rangeCount>0&&u.getRangeAt(0).collapsed&&(ut.value={command:"italic",state:d}),e.nextTick(()=>{i&&(Dt(i),e.nextTick(()=>{const g=Ne("italic");ee.value.italic=g})),he(),xt(),Ue(),J()});return}let s=!1;try{s=document.execCommand(n,!1,o)}catch(d){console.warn(`Failed to execute command ${n}:`,d)}e.nextTick(()=>{if(i&&Dt(i),["bold","italic","underline"].includes(n))try{if(n==="bold")i&&e.nextTick(()=>{const u=Ne("bold");ee.value.bold=u});else if(n==="italic")if(i)e.nextTick(()=>{const u=Ne("italic");ee.value.italic=u});else{const u=document.queryCommandState(n);ee.value[n]=u}else{const u=document.queryCommandState(n);ee.value[n]=u}}catch{ee.value.hasOwnProperty(n)?ee.value[n]=!ee.value[n]:ee.value[n]=!0}if(n==="createLink"&&o){const u=window.getSelection();if(u.rangeCount>0){const p=u.getRangeAt(0),f=p.commonAncestorContainer.nodeType===1?p.commonAncestorContainer.closest("a"):p.commonAncestorContainer.parentElement?.closest("a");f&&(!f.getAttribute("href")||f.getAttribute("href")==="")&&f.setAttribute("href",o)}h.value.querySelectorAll("a").forEach(p=>{const f=p.getAttribute("href");(!f||f===""||f==="#")&&p.setAttribute("href",o)})}he(),Ue(),J()})},Ne=(n,o=null)=>{if(V.disabled||!h.value)return!1;try{if(n==="formatBlock"&&o){const i=document.queryCommandValue("formatBlock");if(o==="<blockquote>"){const s=i.toLowerCase();if(s==="blockquote"||s==="<blockquote>")return!0;const d=window.getSelection();if(d.rangeCount>0){const g=d.getRangeAt(0).commonAncestorContainer;return!!(g.nodeType===1?g.tagName==="BLOCKQUOTE"?g:g.closest("blockquote"):g.parentElement?.closest("blockquote"))}}return i===o||i.toLowerCase()===o.toLowerCase()}if(["bold","italic","underline"].includes(n))try{const i=window.getSelection();if(i.rangeCount>0){const s=i.getRangeAt(0);if(n==="bold"){let u=!1;if(s.collapsed){const g=s.commonAncestorContainer,p=g.nodeType===3?g.parentElement:g;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 f=window.getComputedStyle(p);parseInt(f.fontWeight)>=600&&(u=!0)}catch{}return ee.value.hasOwnProperty(n)?ee.value[n]:(ee.value[n]=u,u)}else{const g=s.commonAncestorContainer.nodeType===1?s.commonAncestorContainer:s.commonAncestorContainer.parentNode;let p=!1;if(g){const f=document.createTreeWalker(g,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let b;for(;b=f.nextNode();)if(!(typeof s.intersectsNode=="function"&&!s.intersectsNode(b))){if(b.nodeType===3){if(!(b.textContent||"").trim())continue;p=!0;let M=b.parentElement;for(;M&&M!==h.value;){if(M.tagName==="STRONG"||M.tagName==="B"){u=!0;break}if(M.style&&parseInt(M.style.fontWeight)>=600){u=!0;break}M=M.parentElement}}else if(b.nodeType===1){const E=b;if(E.tagName==="STRONG"||E.tagName==="B"){u=!0;break}if(E.style&&parseInt(E.style.fontWeight)>=600){u=!0;break}}if(u)break}}return ee.value[n]=u&&p,u&&p}}if(n==="italic"){let u=!1;if(s.collapsed){const g=s.commonAncestorContainer,p=g.nodeType===3?g.parentElement:g;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 ee.value.hasOwnProperty(n)?ee.value[n]:(ee.value[n]=u,u)}else{const g=s.commonAncestorContainer.nodeType===1?s.commonAncestorContainer:s.commonAncestorContainer.parentNode;let p=!1;if(g){const f=document.createTreeWalker(g,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let b;for(;b=f.nextNode();)if(!(typeof s.intersectsNode=="function"&&!s.intersectsNode(b))){if(b.nodeType===3){if(!(b.textContent||"").trim())continue;p=!0;let M=b.parentElement;for(;M&&M!==h.value;){if(M.tagName==="EM"||M.tagName==="I"){u=!0;break}if(M.style&&M.style.fontStyle==="italic"){u=!0;break}M=M.parentElement}}else if(b.nodeType===1){const E=b;if(E.tagName==="EM"||E.tagName==="I"){u=!0;break}if(E.style&&E.style.fontStyle==="italic"){u=!0;break}}if(u)break}}return ee.value[n]=u&&p,u&&p}}const d=document.queryCommandState(n);return s.collapsed&&ee.value.hasOwnProperty(n)?ee.value[n]:(ee.value[n]=d,d)}return ee.value.hasOwnProperty(n)?ee.value[n]:!1}catch{return ee.value.hasOwnProperty(n)?ee.value[n]:!1}try{return document.queryCommandState(n)}catch{return!1}}catch{return!1}},sl=n=>{V.disabled||!V.richText||(ze.value=ze.value===n?null:n,n==="askAi"&&(De.value=null))},Ie=()=>{ze.value=null,je.value=null},It=n=>{bt("formatBlock",n),Ie()},Bl=n=>{if(!n||!h.value)return n;const o=lt=>{let Fe=lt.nodeType===Node.TEXT_NODE?lt.parentElement:lt;for(;Fe&&Fe!==h.value;){const be=Fe.tagName;if(be==="P"){const Jt=Fe.parentElement;if(Jt===h.value||Jt.tagName==="BLOCKQUOTE")return Fe}if(be==="BLOCKQUOTE")break;Fe=Fe.parentElement}return null},a=o(n.startContainer),i=o(n.endContainer);if(!a||!i)return n;const s=[],d=document.createTreeWalker(h.value,NodeFilter.SHOW_ELEMENT,{acceptNode:lt=>{const Fe=lt.tagName;if(Fe==="P"){const be=lt.parentElement;if(be===h.value||be.tagName==="BLOCKQUOTE")return NodeFilter.FILTER_ACCEPT}return Fe==="BLOCKQUOTE"?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_SKIP}});let u;for(;u=d.nextNode();)s.push(u);const g=s.indexOf(a),p=s.indexOf(i);if(g===-1||p===-1)return n;const f=Math.min(g,p),b=Math.max(g,p),E=s.slice(f,b+1);if(E.length===0)return n;const M=E[0],X=E[E.length-1],ke=document.createRange();return ke.setStartBefore(M),ke.setEndAfter(X),ke},rl=()=>{if(V.disabled||!V.richText||!h.value)return;de.value?(K.value&&(clearTimeout(K.value),K.value=null),Te(),de.value=!1):Te(),Ie(),h.value.focus();const n=window.getSelection();if(n.rangeCount===0)return;let o=n.getRangeAt(0);!o.collapsed&&jt(o)&&(o=Bl(o),n.removeAllRanges(),n.addRange(o));let a=null;!o.collapsed&&jt(o)&&(a=wt());const i=o.commonAncestorContainer,s=i.nodeType===1?i.tagName==="BLOCKQUOTE"?i:i.closest("blockquote"):i.parentElement?.closest("blockquote");if(!!(s&&h.value.contains(s))){if(s){const u=s.parentNode;Array.from(s.childNodes).forEach(p=>{if(p.nodeType===Node.ELEMENT_NODE)if(p.tagName==="P"||p.tagName==="DIV")u.insertBefore(p,s);else{const f=document.createElement("p");f.appendChild(p.cloneNode(!0)),u.insertBefore(f,s)}else if(p.nodeType===Node.TEXT_NODE&&p.textContent.trim()){const f=document.createElement("p");f.appendChild(p.cloneNode(!0)),u.insertBefore(f,s)}}),s.remove()}}else if(o.collapsed)document.execCommand("formatBlock",!1,"<blockquote>");else{const u=document.createElement("blockquote"),g=o.extractContents();u.appendChild(g),o.insertNode(u);const p=[],f=document.createTreeWalker(u,NodeFilter.SHOW_TEXT,{acceptNode:M=>M.parentNode===u&&M.textContent.trim()?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});let b;for(;b=f.nextNode();)p.push(b);if(p.forEach(M=>{const X=document.createElement("p");M.parentNode.insertBefore(X,M),X.appendChild(M)}),u.querySelectorAll("p, div").forEach(M=>{M.textContent.trim()===""&&!M.querySelector("img")&&(M.innerHTML="<br>")}),u.children.length===0&&u.textContent.trim()===""){const M=document.createElement("p");M.innerHTML="<br>",u.appendChild(M)}}e.nextTick(()=>{a&&Dt(a),mt(),he(),J()})},Hl=()=>{if(!h.value)return;const n=window.getSelection();if(n.rangeCount===0)return;const a=n.getRangeAt(0).commonAncestorContainer,i=a.nodeType===1?a.tagName==="BLOCKQUOTE"?a:a.closest("blockquote"):a.parentElement?.closest("blockquote");if(!i||!h.value.contains(i))return;const s=b=>{if(!b)return!1;const E=b.textContent||"",X=(b.innerHTML||"").trim();return E.trim()===""||X===""||X==="<br>"||X==="<br/>"||X==="<p></p>"||X==="<p><br></p>"||X==="<p><br/></p>"||X==="<p> </p>"||X==="<p><br> </p>"||X==="<div></div>"||X==="<div><br></div>"||X==="<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&&i.contains(d)&&s(d)&&d.remove();i.lastChild;){const b=i.lastChild;if(b.nodeType===1&&b.tagName==="BR")b.remove();else if(b.nodeType===3)if((b.textContent||"").trim()==="")b.remove();else break;else break}if(i.children.length>0)for(let b=i.children.length-1;b>=0;b--){const E=i.children[b];if((E.tagName==="P"||E.tagName==="DIV")&&s(E))E.remove();else break}let u=i.innerHTML;const g=u;u=u.replace(/(<br\s*\/?>)+$/gi,""),u!==g&&(i.innerHTML=u);const p=document.createElement("p");p.innerHTML="<br>",i.parentNode?i.nextSibling?i.parentNode.insertBefore(p,i.nextSibling):i.parentNode.appendChild(p):h.value&&h.value.appendChild(p);const f=document.createRange();f.selectNodeContents(p),f.collapse(!0),n.removeAllRanges(),n.addRange(f),e.nextTick(()=>{mt(),he()})},Ue=()=>{if(!h.value){Ze.value=!1;return}try{const n=window.getSelection();if(n.rangeCount>0){const a=n.getRangeAt(0).commonAncestorContainer,i=a.nodeType===1?a.closest("a"):a.parentElement?.closest("a");Ze.value=!!i}else Ze.value=!1}catch{Ze.value=!1}},Lo=()=>{if(!h.value)return;Bt.value=wt();const n=window.getSelection();let o="";n.rangeCount>0&&(o=n.getRangeAt(0).toString()),ce.value="",ue.value=o,Ut.value="",Ce.value=null,nt.value=!0,Ie(),e.nextTick(()=>{at.value&&at.value.focus()})},Uo=()=>{if(!h.value)return;de.value?(K.value&&(clearTimeout(K.value),K.value=null),Te(),de.value=!1):Te();const n=window.getSelection();let o=null;if(n.rangeCount>0){const i=n.getRangeAt(0).commonAncestorContainer;o=i.nodeType===1?i.closest("a"):i.parentElement?.closest("a")}if(!o&&Ce.value&&(o=Ce.value),o&&o.parentNode){const a=document.createDocumentFragment();for(;o.firstChild;)a.appendChild(o.firstChild);if(o.parentNode.replaceChild(a,o),a.firstChild){const i=document.createRange();i.setStartBefore(a.firstChild),i.setEndAfter(a.lastChild||a.firstChild),n.removeAllRanges(),n.addRange(i),document.execCommand("removeFormat",!1),i.collapse(!1),n.removeAllRanges(),n.addRange(i)}Ce.value=null}else bt("unlink");Ze.value=!1,Ie(),e.nextTick(()=>{he(),Ue()})},il=()=>{V.disabled||!V.richText||h.value&&(de.value?(K.value&&(clearTimeout(K.value),K.value=null),Te(),de.value=!1):Te(),Ie(),h.value.focus(),document.execCommand("insertUnorderedList",!1),e.nextTick(()=>{Ye(),he(),J()}))},cl=()=>{V.disabled||!V.richText||h.value&&(de.value?(K.value&&(clearTimeout(K.value),K.value=null),Te(),de.value=!1):Te(),Ie(),h.value.focus(),document.execCommand("insertOrderedList",!1),e.nextTick(()=>{Ye(),he(),J()}))},Ao=n=>{const o=n.parentElement;if(!o||o.tagName!=="OL")return null;let a=0,i=n.previousElementSibling;for(;i;)i.tagName==="LI"&&a++,i=i.previousElementSibling;return a+1},Ye=()=>{if(!h.value)return;h.value.querySelectorAll("li > ol").forEach(o=>{const a=o.parentElement;if(a&&a.tagName==="LI"){const i=Ao(a);i!==null&&Array.from(o.children).filter(d=>d.tagName==="LI").forEach(d=>{d.setAttribute("data-parent-num",String(i))})}})},$o=()=>{if(V.disabled||!V.richText||!h.value)return;Ie(),h.value.focus();const n=window.getSelection();if(n.rangeCount===0)return;const o=n.getRangeAt(0),a=o.commonAncestorContainer.nodeType===1?o.commonAncestorContainer.closest("li"):o.commonAncestorContainer.parentElement?.closest("li");if(!a){document.execCommand("indent",!1),e.nextTick(()=>{Ye(),he()});return}const i=a.parentElement;if(!i||i.tagName!=="OL"&&i.tagName!=="UL")return;const s=a.previousElementSibling;if(s&&s.tagName==="LI"){const d=i.tagName.toLowerCase();let u=s.querySelector(`:scope > ${d}`);u||(u=document.createElement(d),s.appendChild(u));const g=Ao(s);u.appendChild(a),g!==null&&i.tagName==="OL"&&a.setAttribute("data-parent-num",String(g)),Ye();const p=document.createRange();p.selectNodeContents(a),p.collapse(!1),n.removeAllRanges(),n.addRange(p),e.nextTick(()=>{he(),J()})}else document.execCommand("indent",!1),e.nextTick(()=>{Ye(),he(),J()})},_t=()=>{if(V.disabled||!V.richText||!h.value)return;Ie(),h.value.focus();const n=window.getSelection();if(n.rangeCount===0)return;const o=n.getRangeAt(0),a=o.commonAncestorContainer.nodeType===1?o.commonAncestorContainer.closest("li"):o.commonAncestorContainer.parentElement?.closest("li");if(!a){document.execCommand("outdent",!1),e.nextTick(()=>{Ye(),he()});return}const i=a.parentElement;if(!i||i.tagName!=="OL"&&i.tagName!=="UL")return;const s=i.parentElement;if(s&&s.tagName==="LI"){const d=s.parentElement;if(d&&(d.tagName==="OL"||d.tagName==="UL")){i.tagName==="OL"&&a.removeAttribute("data-parent-num"),d.insertBefore(a,s.nextSibling),i.children.length===0&&i.remove(),Ye();const u=document.createRange();u.selectNodeContents(a),u.collapse(!1),n.removeAllRanges(),n.addRange(u),e.nextTick(()=>{he(),J()});return}}document.execCommand("outdent",!1),e.nextTick(()=>{Ye(),he(),J()})},k=e.ref(null),xe=e.ref(null),Et=e.ref({}),Pe=e.ref(""),_e=e.ref(null),ge=e.ref("");e.ref("");const dt=e.ref(null);e.ref("");const Vt=e.ref([]),ul=n=>{if(!n)return"";const o=n.cloneRange(),a=document.createElement("div");return a.appendChild(o.cloneContents()),a.innerHTML},Me=()=>{if(V.disabled||!V.richText||!h.value)return;if(k.value!==null){k.value=null,Pe.value="",ge.value="",dt.value=null,Vt.value=[],Pt(!0);return}Ie(),h.value.focus();const n=window.getSelection();if(!n||n.rangeCount===0)return;const o=n.getRangeAt(0);if(o.collapsed||!jt(o))return;ge.value=ul(o)||"",dt.value=wt();const a=o.getBoundingClientRect(),i=h.value.parentElement;if(!i)return;const s=i.getBoundingClientRect(),d=a.bottom-s.top,g=Math.max(d+8,0);Et.value={top:`${g}px`},k.value=null,e.nextTick(()=>{if(Pe.value="",_e.value){const p=_e.value;p.style.height="auto",p.style.height=`${p.scrollHeight}px`,p.focus()}})},Be=()=>{if(!Pe.value.trim())return;const n=Pe.value.trim(),o=new Date,a={text:n,selectionText:ge.value,selectionRange:dt.value,user:V.commentUser||null,createdAt:o.toISOString()};Vt.value=[...Vt.value,a],re("comment-submitted",a),Pe.value="",e.nextTick(()=>{if(_e.value){const i=_e.value;i.style.height="auto",i.style.height=`${i.scrollHeight}px`,i.focus()}})},ve=(n,o=[])=>{if(V.disabled||!V.richText||!h.value)return;const a=h.value;let i=null;try{i=a.querySelector(n)}catch{return}if(!i)return;Ie(),a.focus();const s=document.createRange();s.selectNodeContents(i);const d=window.getSelection();d&&(d.removeAllRanges(),d.addRange(s)),ge.value=i.innerHTML||"",dt.value=wt();const u=s.getBoundingClientRect(),g=a.parentElement;if(g){const f=g.getBoundingClientRect(),b=u.bottom-f.top,M=Math.max(b+8,0);Et.value={top:`${M}px`}}Vt.value=Array.isArray(o)?o.slice():[];const p=i.getAttribute("data-comment")||i.getAttribute("data-fake-comment");Pt(!0),k.value=p||null,i&&(xe.value=i,i.classList.add("editor-comment-highlighted")),e.nextTick(()=>{if(Pe.value="",_e.value){const f=_e.value;f.style.height="auto",f.style.height=`${f.scrollHeight}px`,f.focus()}})},We=e.ref(null),Do=e.ref(0),dl=n=>{if(!(V.disabled||!V.richText)){if(n.key.length===1||n.key==="Enter"){const o=window.getSelection();if(o&&o.rangeCount>0){const a=o.getRangeAt(0),i=a.commonAncestorContainer,s=i.nodeType===3?i.parentElement:i;if(s){const d=s.closest(".dss-image-wrapper");if(d){const u=d.querySelector("img");if(s!==u&&!u?.contains(s)){const g=a.startContainer.nodeType===3?a.startContainer.parentElement:a.startContainer,p=a.endContainer.nodeType===3?a.endContainer.parentElement:a.endContainer;if(d.contains(g)&&g!==u||d.contains(p)&&p!==u){n.preventDefault();const f=document.createRange();f.setStartAfter(d),f.collapse(!0),o.removeAllRanges(),o.addRange(f);return}}}}}}if(n.key==="Backspace"||n.key==="Delete"){const o=window.getSelection();if(o.rangeCount>0){const a=o.getRangeAt(0);let i=null,s=null;if(a.collapsed)if(n.key==="Backspace"){const d=a.startContainer;let u=d;d.nodeType===3&&(a.startOffset===0?u=d.previousSibling||d.parentNode:u=d.parentNode);const g=u.previousSibling;g&&(g.classList&&g.classList.contains("dss-image-wrapper")?s=g:g.tagName==="IMG"&&(i=g,s=i.closest(".dss-image-wrapper"))),s||(s=u.closest(".dss-image-wrapper"),s&&(i=s.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 g=u.nextSibling;g&&(g.classList&&g.classList.contains("dss-image-wrapper")?s=g:g.tagName==="IMG"&&(i=g,s=i.closest(".dss-image-wrapper"))),s||(s=u.closest(".dss-image-wrapper"),s&&(i=s.querySelector("img")))}else{const d=a.commonAncestorContainer,u=a.startContainer.nodeType===3?a.startContainer.parentElement:a.startContainer,g=a.endContainer.nodeType===3?a.endContainer.parentElement:a.endContainer;if(d.nodeType===1&&d.tagName==="IMG"?(i=d,s=i.closest(".dss-image-wrapper")):(i=d.querySelector("img"),i&&(s=i.closest(".dss-image-wrapper"))),s){const p=s.contains(u)||u===s,f=s.contains(g)||g===s,E=a.cloneContents().textContent?.trim()||"",M=s.textContent?.trim()||"";(!p||!f||E.length>M.length)&&(s=null,i=null)}}if(s){n.preventDefault(),n.stopPropagation();const d=s.parentNode;if(d){const u=document.createTextNode("");d.insertBefore(u,s),s.remove();const g=document.createRange();g.setStartAfter(u),g.collapse(!0),o.removeAllRanges(),o.addRange(g),e.nextTick(()=>{he()});return}}}}if(n.key==="Tab"){n.preventDefault(),n.shiftKey?_t():$o();return}if(n.key==="Enter"){const o=window.getSelection();if(o.rangeCount>0){const a=o.getRangeAt(0);if(a.collapsed){const u=a.startContainer,g=p=>{if(!p)return!1;let f=p.previousSibling;for(;f;){if(f.classList&&f.classList.contains("dss-image-wrapper")||f.tagName==="IMG"||f.querySelector&&f.querySelector(".dss-image-wrapper")||f.querySelector&&f.querySelector("img"))return!0;f=f.previousSibling}const b=p.parentElement;return b&&b!==h.value?g(b):!1};if(u.nodeType===3){const p=u.parentElement;if(p&&(g(p)||g(u))){const f=p.closest("p, div");if(f&&f!==h.value){n.preventDefault(),n.stopPropagation();let b=null;const E=a.startOffset;E<u.length&&(b=u.splitText(E));const M=document.createElement("p");if(b?M.appendChild(b):M.innerHTML="<br>",u.length===0){const ke=u.parentElement;ke&&(ke.removeChild(u),ke.childNodes.length===0&&ke.appendChild(document.createElement("br")))}f.nextSibling?f.parentNode.insertBefore(M,f.nextSibling):f.parentNode.appendChild(M);const X=document.createRange();b?X.setStart(b,0):X.setStart(M,0),X.collapse(!0),o.removeAllRanges(),o.addRange(X),e.nextTick(()=>{he()});return}}}}const i=a.commonAncestorContainer,s=i.nodeType===1?i.tagName==="BLOCKQUOTE"?i:i.closest("blockquote"):i.parentElement?.closest("blockquote");if(!!(s&&h.value&&h.value.contains(s))){let u=null;i.nodeType===3?u=i.parentElement:i.tagName==="P"||i.tagName==="DIV"?u=i:u=i.closest("p, div");const g=ke=>{if(!ke)return!1;const lt=ke.textContent||"",be=(ke.innerHTML||"").trim(),Jt=be.replace(/<br\s*\/?>/gi,"").trim();return lt.trim()===""||be===""||Jt===""||be==="<br>"||be==="<br/>"||be==="<p></p>"||be==="<p><br></p>"||be==="<p><br/></p>"||be==="<p> </p>"||be==="<p><br> </p>"||be==="<div></div>"||be==="<div><br></div>"||be==="<div><br/></div>"},p=s.lastChild,f=p&&p.nodeType===1&&p.tagName==="BR",b=a.startContainer,E=b.nodeType===3?b.parentElement:b,M=E===s||E&&E.parentElement===s;if(u&&g(u)||f&&M){n.preventDefault(),setTimeout(()=>{Hl()},50);return}}}}if(n.key===" "){const o=Date.now(),a=o-Do.value;if(We.value===" "&&a<300){const i=window.getSelection();if(i.rangeCount>0){const s=i.getRangeAt(0),d=s.commonAncestorContainer.nodeType===1?s.commonAncestorContainer.closest("li"):s.commonAncestorContainer.parentElement?.closest("li");if(d){const u=s.startContainer.textContent?.substring(0,s.startOffset)||"";if((d.textContent||"").indexOf(u.trim())<=10||u.trim().length<=2){n.preventDefault(),$o();return}}}}We.value=" ",Do.value=o}else We.value=n.key}},Wo=n=>{if(ze.value){const a=n.target;!a.closest(".dss-toolbar-dropdown")&&!a.closest(".dss-toolbar-dropdown-toggle")&&Ie()}if(Ee.value){const a=n.target,i=a.closest(".dss-floating-toolbar"),s=h.value&&a.closest(".dss-text-editor-content");!i&&!s&&so()}if(De.value){const a=n.target,i=a.closest(".dss-floating-toolbar"),s=a.closest(".dss-toolbar-dropdown");!i&&!s&&jo()}const o=n.target;if(!o.closest(".dss-toolbar-dropdown")&&!o.closest(".dss-toolbar-dropdown-submenu")&&(je.value=null),!h.value||!o.closest(".dss-text-editor-content")){const a=window.getSelection();if(a&&a.rangeCount>0){const i=a.getRangeAt(0);ft.value=!i.collapsed&&jt(i)}else ft.value=!1}if(k.value!==null){const a=document.querySelector(".dss-comment-overlay");let i=!1;if(a){const u=a.getBoundingClientRect(),g=n.clientX,p=n.clientY;i=g>=u.left&&g<=u.right&&p>=u.top&&p<=u.bottom}const s=o.closest(".dss-toolbar-button"),d=s&&s.getAttribute("title")==="Comment";!i&&!d&&(k.value=null,Pe.value="",ge.value="",dt.value=null,Vt.value=[],Pt(!0))}},qo=(n,o)=>{n&&n.stopPropagation&&n.stopPropagation(),Le.value&&(clearTimeout(Le.value),Le.value=null),je.value=o},ml=n=>{const o=n.relatedTarget;if(o){const a=o.closest(".dss-toolbar-dropdown-submenu"),i=o.closest(".dss-toolbar-dropdown-item-has-submenu");if(a||i)return}Le.value&&clearTimeout(Le.value),Le.value=setTimeout(()=>{je.value=null,Le.value=null},150)},Tl=n=>{je.value=null};let qt=0;const Yt=n=>{if(!n)return;const o=Array.from(n.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,i)=>{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 s=Array.from(a.children).find(g=>g.tagName==="DIV"?g.classList.contains("dss-toolbar-dropdown-item")?!1:Array.from(g.children).filter(f=>f.tagName==="BUTTON"||f.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(g=>g.tagName==="BUTTON"||g.tagName==="DIV");if(s||u){const g=`submenu-auto-${++qt}`;a.classList.add("dss-toolbar-dropdown-item-has-submenu"),a.setAttribute("data-submenu-id",g);let p=null;s?(a.tagName==="BUTTON"&&a.parentNode.insertBefore(s,a.nextSibling),s.classList.add("dss-toolbar-dropdown-submenu"),p=s):u&&(d.classList.add("dss-toolbar-dropdown-submenu"),p=d),p&&(p.setAttribute("data-submenu-id",g),p.setAttribute("data-processed","true"),s&&a.tagName!=="BUTTON"?p.dataset.originalParentRef="inside":p.dataset.originalParentRef="sibling",Array.from(p.children).forEach(b=>{(b.tagName==="BUTTON"||b.tagName==="DIV")&&!b.classList.contains("dss-toolbar-dropdown-item")&&b.classList.add("dss-toolbar-dropdown-item")}))}})},St=()=>{document.querySelectorAll(".dss-toolbar-dropdown").forEach(o=>{Yt(o),o.querySelectorAll(".dss-toolbar-dropdown-item-has-submenu").forEach(s=>{const d=s._subMenuHandlers;d&&(s.removeEventListener("mouseenter",d.enter),s.removeEventListener("mouseleave",d.leave));const u=p=>{const f=s.getAttribute("data-submenu-id");f&&qo(p,f)},g=ml;s.addEventListener("mouseenter",u),s.addEventListener("mouseleave",g),s._subMenuHandlers={enter:u,leave:g}}),o.querySelectorAll(".dss-toolbar-dropdown-submenu").forEach(s=>{const d=s._subMenuHandlers;d&&(s.removeEventListener("mouseenter",d.enter),s.removeEventListener("mouseleave",d.leave));const u=f=>{const b=s.getAttribute("data-submenu-id");b&&qo(f,b)},g=ml;s.addEventListener("mouseenter",u),s.addEventListener("mouseleave",g),s._subMenuHandlers={enter:u,leave:g},s.querySelectorAll(".dss-toolbar-dropdown-item").forEach(f=>{f.addEventListener("click",Tl)})})})},ye=()=>{if(je.value){const n=document.querySelector(`.dss-toolbar-dropdown-submenu[data-submenu-id="${je.value}"]`),o=document.querySelector(`.dss-toolbar-dropdown-item-has-submenu[data-submenu-id="${je.value}"]`);n&&o&&ko(n,o)}Ee.value&&J(),V.richText&&co()},Ro=()=>{if(!V.richText)return;document.querySelectorAll(".dss-toolbar-custom-group").forEach(o=>{Array.from(o.children).filter(i=>i.tagName==="DIV"&&!i.classList.contains("dss-toolbar-button")).forEach(i=>{i.classList.add("dss-toolbar-button")})})},Oe=()=>{const n=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 i=window.getSelection();i.removeAllRanges?i.removeAllRanges():i.empty&&i.empty()}return!1};n.forEach(a=>{a.addEventListener("selectstart",o),a.addEventListener("mousedown",o),a.addEventListener("dragstart",o),a.addEventListener("contextmenu",o),a.addEventListener("click",i=>{if(window.getSelection){const s=window.getSelection();s.removeAllRanges&&s.removeAllRanges()}})})};e.onMounted(()=>{if(e.nextTick(()=>{requestAnimationFrame(()=>{gt.value?P():No(),ot.value?Mo():kt()})}),e.nextTick(()=>{Oe()}),V.richText&&h.value){try{document.execCommand("defaultParagraphSeparator",!1,"p")}catch{}document.addEventListener("click",Wo),window.addEventListener("resize",ye),window.addEventListener("scroll",ye,!0);const n=h.value.closest(".editor-with-comments"),o=h.value.closest(".dss-text-editor-content-wrapper");if(n){const s=()=>{co()};n.addEventListener("scroll",s,{passive:!0}),o&&o!==n&&o.addEventListener("scroll",s,{passive:!0}),h.value._scrollHandlers={wrapper:n,content:o,handler:s}}e.nextTick(()=>{St(),Ro()}),h.value.addEventListener("click",s=>{const d=s.target;d.closest("a")&&!V.disabled&&s.preventDefault();const g=d.closest(".dss-image-no-alt-icon"),p=d.closest(".dss-image-wrapper");if(g||p&&d===p){s.preventDefault(),s.stopPropagation();const f=window.getSelection(),b=document.createRange();b.setStartAfter(p),b.collapse(!0),f.removeAllRanges(),f.addRange(b)}else p&&d.tagName!=="IMG"&&(s.preventDefault(),e.nextTick(()=>{const f=window.getSelection();if(f.rangeCount>0){const E=f.getRangeAt(0).commonAncestorContainer,M=E.nodeType===3?E.parentElement:E;if(p.contains(M)&&M!==p.querySelector("img")){const X=document.createRange();X.setStartAfter(p),X.collapse(!0),f.removeAllRanges(),f.addRange(X)}}else{const b=document.createRange();b.setStartAfter(p),b.collapse(!0),f.addRange(b)}}))},!0),h.value.addEventListener("mousedown",s=>{const d=s.target,u=d.closest(".dss-image-no-alt-icon"),g=d.closest(".dss-image-wrapper");if(u||g&&d.tagName!=="IMG"){s.preventDefault();const p=window.getSelection(),f=document.createRange();g&&(f.setStartAfter(g),f.collapse(!0),p.removeAllRanges(),p.addRange(f))}},!0),h.value.addEventListener("paste",s=>{e.nextTick(()=>{if(!h.value)return;h.value.querySelectorAll("img").forEach(u=>{if(!u.closest(".dss-image-wrapper"))u.removeAttribute("alt"),u.removeAttribute("data-alt"),u.setAttribute("alt",""),u.setAttribute("data-alt",""),u.alt="";else{const p=u.getAttribute("alt")||u.alt||"";if(p){const f=u.getAttribute("src")||u.src||"",b=f.replace(/^https?:\/\//,"").replace(/^data:.*,/,""),E=p===f||p===b;(p.startsWith("http://")||p.startsWith("https://")||p.startsWith("data:")||E||E)&&(u.setAttribute("alt",""),u.setAttribute("data-alt",""),u.alt="")}}}),Rt()})});let a=null;const i=new MutationObserver(s=>{s.forEach(d=>{d.addedNodes.forEach(u=>{if(u.nodeType===1){u.tagName==="IMG"&&(u.removeAttribute("alt"),u.removeAttribute("data-alt"),u.setAttribute("alt",""),u.setAttribute("data-alt",""),u.alt="");const g=u.querySelectorAll&&u.querySelectorAll("img");g&&g.forEach(p=>{p.removeAttribute("alt"),p.removeAttribute("data-alt"),p.setAttribute("alt",""),p.setAttribute("data-alt",""),p.alt=""})}})}),a&&clearTimeout(a),a=setTimeout(()=>{Rt(),Ro(),a=null},100)});if(i.observe(h.value,{childList:!0,subtree:!0}),e.nextTick(()=>{const s=document.querySelector(".dss-text-editor-toolbar");if(s){const d=new MutationObserver(()=>{e.nextTick(()=>{Ro()})});d.observe(s,{childList:!0,subtree:!0}),s._toolbarMutationObserver=d}}),V.modelValue){const s=ae(V.modelValue);h.value.innerHTML=s,Bo()}e.nextTick(()=>{const s=h.value.innerHTML||"",d=V.title||"",u=V.description||"";Ke.value=s,it.value=d,Se.value=u,Ge.value=d,ct.value=u,Ye(),Rt(),xt(),Ft(),Cl()}),Ue(),mt(),h.value._mutationObserver=i}}),e.onUnmounted(()=>{if(document.removeEventListener("click",Wo),window.removeEventListener("resize",ye),window.removeEventListener("scroll",ye,!0),K.value&&clearTimeout(K.value),Le.value&&clearTimeout(Le.value),h.value&&h.value._mutationObserver&&h.value._mutationObserver.disconnect(),ht.value&&ht.value.disconnect(),Pt(!0),h.value&&h.value._scrollHandlers){const{wrapper:o,content:a,handler:i}=h.value._scrollHandlers;o&&o.removeEventListener("scroll",i),a&&a.removeEventListener("scroll",i)}const n=document.querySelector(".dss-text-editor-toolbar");n&&n._toolbarMutationObserver&&n._toolbarMutationObserver.disconnect()});const Qe=n=>{const o=n.target,a=o.closest("a");if(a&&!V.disabled){n.preventDefault();const s=document.createRange();s.selectNodeContents(a);const d=window.getSelection();d.removeAllRanges(),d.addRange(s)}const i=o.closest(".dss-image-wrapper");i&&o.tagName!=="IMG"?e.nextTick(()=>{const s=window.getSelection();if(s.rangeCount>0){const u=s.getRangeAt(0).commonAncestorContainer,g=u.nodeType===3?u.parentElement:u;if(i.contains(g)&&g!==i.querySelector("img")){const p=document.createRange();p.setStartAfter(i),p.collapse(!0),s.removeAllRanges(),s.addRange(p)}}Rt(),Ue(),mt(),J(),Ft()}):e.nextTick(()=>{Rt(),Ue(),mt(),J(),Ft()})},pl=()=>{Xo();const n=window.getSelection();if(n&&n.rangeCount>0){const a=n.getRangeAt(0);ft.value=!a.collapsed&&jt(a),!a.collapsed&&ut.value&&(ut.value=null)}else ft.value=!1;if(Rt(),Ue(),mt(),J(),Ft(),n&&n.rangeCount>0){const i=n.getRangeAt(0).commonAncestorContainer,s=i.nodeType===3?i.parentElement:i;if(s&&s.closest(".dss-text-editor-footer")){n.removeAllRanges(),ft.value=!1;return}}["bold","italic","underline"].forEach(a=>{try{const i=window.getSelection();if(i.rangeCount>0){const s=i.getRangeAt(0);if(!s.collapsed)if(a==="bold"){const d=s.commonAncestorContainer,u=d.nodeType===3?d.parentElement:d;let g=!1;if(u&&((u.tagName==="STRONG"||u.tagName==="B"||u.closest&&u.closest("strong, b"))&&(g=!0),!g&&u.style&&parseInt(u.style.fontWeight)>=600&&(g=!0),!g))try{const p=window.getComputedStyle(u);parseInt(p.fontWeight)>=600&&(g=!0)}catch{}ee.value[a]=g}else{const d=document.queryCommandState(a);ee.value[a]=d}}}catch{}})},Ft=()=>{if(!V.richText||V.disabled||!h.value){He.value="p";return}try{const n=window.getSelection();if(!n||n.rangeCount===0){He.value="p";return}const a=n.getRangeAt(0).commonAncestorContainer,i=a.nodeType===3?a.parentElement:a;if(!i||!h.value.contains(i)){He.value="p";return}const s=i.closest("h1, h2, h3, h4, h5, h6, p");if(!s){He.value="p";return}const d=s.tagName.toLowerCase();["h1","h2","h3","h4","h5","h6","p"].includes(d)?He.value=d:He.value="p"}catch{He.value="p"}},mt=()=>{if(!h.value){eo.value=!1;return}try{const n=window.getSelection();let o=!1;if(n.rangeCount>0){const i=n.getRangeAt(0).commonAncestorContainer,s=i.nodeType===1?i.tagName==="BLOCKQUOTE"?i:i.closest("blockquote"):i.parentElement?.closest("blockquote");o=!!(s&&h.value.contains(s))}eo.value=o}catch{eo.value=!1}},jt=n=>{if(!n||!h.value)return!1;const o=n.commonAncestorContainer;if(!o)return!1;const a=o.nodeType===3?o.parentElement:o;return a?h.value.contains(a):!1},so=()=>{Ee.value=!1},J=()=>{if(!V.floatingToolbar||!V.richText||V.disabled){Ee.value=!1;return}const n=window.getSelection();if(!n||n.rangeCount===0){Ee.value=!1;return}const o=n.getRangeAt(0);if(o.collapsed||!jt(o)){Ee.value=!1;return}const a=o.getBoundingClientRect();if(!a||a.width===0&&a.height===0){Ee.value=!1;return}const i=h.value;if(!i){Ee.value=!1;return}const s=i.getBoundingClientRect();if(!s||s.width===0){Ee.value=!1;return}const d=40,u=8,g=a.top-d/2+15;let p=a.left+a.width/2;const f=window.innerWidth||document.documentElement.clientWidth||0;let b=0;uo.value&&(b=uo.value.getBoundingClientRect().width);const E=(b||320)/2;let M=s.left+E,X=s.right-E;if(X<M){const ke=s.left+s.width/2;M=ke,X=ke}if(f>0){const ke=E+u,lt=f-E-u;if(M=Math.max(M,ke),X=Math.min(X,lt),X<M){const Fe=f/2;M=Fe,X=Fe}}p<M?p=M:p>X&&(p=X),$e.value={position:"fixed",top:`${Math.max(g,8)}px`,left:`${p}px`,transform:"translate(-50%, -100%)",zIndex:10003},Ee.value=!0},Yo=n=>{V.disabled||!V.richText||(De.value=De.value===n?null:n,n==="askAi"&&(ze.value=null))},jo=()=>{De.value=null,je.value=null},Kt=n=>{It(n),jo()};let Gt=null,Nt=null,Mt=null,Qt=null;const vl=n=>{if(V.disabled||!V.richText){yo(),ro();return}const o=n.target,a=o.closest("a"),i=o.closest("img");if(Gt&&(clearTimeout(Gt),Gt=null),Mt&&(clearTimeout(Mt),Mt=null),a&&a!==Nt){ro(),Nt=a;let s=a.getAttribute("href")||"";(!s||s==="#"||s==="")&&(s=a.textContent||""),Ce.value=a,z.value=s,L.value=!0,le.value=!0,gl(a)}else!a&&Nt?(Nt=null,Gt=setTimeout(()=>{le.value||yo()},150)):a&&a===Nt&&gl(a);if(i&&i!==Qt){yo(),Qt=i;let s=i.getAttribute("alt");s===null&&(s=i.alt||"");let d=i.getAttribute("data-alt");d===null&&(d=s),i.hasAttribute("alt")||i.setAttribute("alt",s),i.hasAttribute("data-alt")||i.setAttribute("data-alt",d),oe.value=i,to.value=s.trim()||B("textEditor.image.noAlt"),vo.value=!0,Wt.value=!0,fl(i)}else!i&&Qt?(Qt=null,Mt=setTimeout(()=>{Wt.value||ro()},150)):i&&i===Qt&&fl(i)},Ll=n=>{const o=n.relatedTarget;(!o||!o.closest(".dss-text-editor-content")&&!o.closest(".dss-link-popup"))&&(Nt=null,Qt=null,Gt&&(clearTimeout(Gt),Gt=null),Mt&&(clearTimeout(Mt),Mt=null),yo(),ro())},yo=()=>{le.value=!1,setTimeout(()=>{le.value||(L.value=!1,z.value="",nt.value||(Ce.value=null))},100)},gl=n=>{if(!n||!h.value)return;const o=n.getBoundingClientRect(),s=o.top-32-8,d=o.left+o.width/2;te.value={position:"fixed",top:`${s}px`,left:`${d}px`,transform:"translateX(-50%)",zIndex:10002}},ro=()=>{Wt.value=!1,setTimeout(()=>{Wt.value||(vo.value=!1,to.value="",mo.value||(oe.value=null))},100)},fl=n=>{if(!n||!h.value)return;const o=n.getBoundingClientRect(),s=o.top-32-8,d=o.left+o.width/2;oo.value={position:"fixed",top:`${s}px`,left:`${d}px`,transform:"translateX(-50%)",zIndex:10002}},hl=()=>{if(!z.value||!Ce.value)return;let o=Ce.value.getAttribute("href")||z.value;!o.startsWith("http://")&&!o.startsWith("https://")&&!o.startsWith("mailto:")&&(o="https://"+o),window.open(o,"_blank","noopener,noreferrer")},Al=()=>{if(Ce.value){const n=Ce.value.textContent||"",o=Ce.value.getAttribute("href")||"",a=Ce.value;ce.value=o,ue.value=n,Ut.value=n,le.value=!1,L.value=!1,z.value="",Ce.value=a,nt.value=!0}else if(Ze.value){const n=window.getSelection();if(n.rangeCount>0){const a=n.getRangeAt(0).commonAncestorContainer,i=a.nodeType===1?a.closest("a"):a.parentElement?.closest("a");if(i){const s=i.textContent||"",d=i.getAttribute("href")||"";ce.value=d,ue.value=s,Ut.value=s,Ce.value=i,nt.value=!0}}}else{Bt.value=wt();const n=window.getSelection();let o="";n.rangeCount>0&&(o=n.getRangeAt(0).toString()),ce.value="",ue.value=o,Ut.value="",Ce.value=null,nt.value=!0}e.nextTick(()=>{at.value&&(at.value.focus(),at.value.select())})},Io=()=>{nt.value=!1,ce.value="",ue.value="",Ut.value="",Ce.value=null,Bt.value=null},_o=()=>{if(!ce.value.trim()){Io();return}if(de.value?(K.value&&(clearTimeout(K.value),K.value=null),Te(),de.value=!1):Te(),ue.value.trim()||(ue.value=ce.value.trim()),Ce.value&&h.value&&h.value.contains(Ce.value)){const n=window.getSelection();n.rangeCount>0&&n.removeAllRanges();const o=Ce.value;if(o.textContent,o.setAttribute("href",ce.value.trim()),ue.value.trim()!==Ut.value.trim()){for(;o.firstChild;)o.removeChild(o.firstChild);o.textContent=ue.value.trim()}o.style.color="#60afdf",o.style.textDecoration="underline";const a=document.createRange();a.selectNodeContents(o),a.collapse(!1),n.removeAllRanges(),n.addRange(a),he()}else if(h.value){h.value.focus();const n=window.getSelection();n.removeAllRanges(),Bt.value&&Dt(Bt.value);let o=null;if(n.rangeCount>0&&(o=n.getRangeAt(0)),o&&!o.collapsed){o.deleteContents();const a=document.createElement("a");a.href=ce.value.trim(),a.textContent=ue.value.trim(),a.style.color="#60afdf",a.style.textDecoration="underline",o.insertNode(a),o.setStartAfter(a),o.collapse(!0),n.removeAllRanges(),n.addRange(o)}else{o||(o=document.createRange(),o.selectNodeContents(h.value),o.collapse(!1));const a=document.createElement("a");a.href=ce.value.trim(),a.textContent=ue.value.trim(),a.style.color="#60afdf",a.style.textDecoration="underline",o.insertNode(a),o.setStartAfter(a),o.collapse(!0),n.removeAllRanges(),n.addRange(o)}he()}e.nextTick(()=>{Ue(),Io()})},Ko=()=>{h.value&&(Tt.value=wt(),qe.value="",st.value="",Lt.value="",Ve.value="",fe.value="",xo.value=null,oe.value=null,Xe.value="upload",mo.value=!0,Ie(),e.nextTick(()=>{Ht.value&&Ht.value.focus(),tt.value&&(tt.value.value="")}))},yl=n=>{const o=n.target?.files?.[0];if(!o){xo.value=null,st.value="";return}xo.value=o;const a=new FileReader;a.onload=i=>{st.value=i.target?.result||""},a.readAsDataURL(o)},Co=()=>{tt.value&&tt.value.click()},$l=()=>{let n=oe.value;if(!n){const o=window.getSelection();if(o&&o.rangeCount>0){const i=o.getRangeAt(0).commonAncestorContainer;n=i.nodeType===1?i.closest("img"):i.parentElement?.closest("img")}}if(n){const o=n.getAttribute("data-alt")||n.getAttribute("alt")||"";oe.value=n,qe.value=o.trim()===""||o.trim()==="Image"?"":o;const a=n.getAttribute("src")||n.src||"";a.startsWith("http://")||a.startsWith("https://")?(Lt.value=a,st.value="",Xe.value="url"):(st.value=a,Lt.value="",Xe.value="upload");const s=n.style.width||n.getAttribute("width")||"",d=n.style.height||n.getAttribute("height")||"";Ve.value=s.endsWith("px")?s.replace("px",""):s,fe.value=d.endsWith("px")?d.replace("px",""):d,Tt.value=null}else{Ko();return}mo.value=!0,Wt.value=!1,vo.value=!1,e.nextTick(()=>{Xe.value==="url"&&po.value?(po.value.focus(),po.value.select()):Ht.value&&(Ht.value.focus(),Ht.value.select()),tt.value&&(tt.value.value="")})},io=()=>{mo.value=!1,qe.value="",st.value="",Lt.value="",Ve.value="",fe.value="",xo.value=null,oe.value=null,Tt.value=null,Xe.value="upload"},zt=()=>{const n=(qe.value||"").trim(),o=h.value?._mutationObserver;o&&o.disconnect(),de.value?(K.value&&(clearTimeout(K.value),K.value=null),Te(),de.value=!1):Te();const a=Xe.value==="url"?Lt.value.trim():st.value;if(oe.value&&h.value&&h.value.contains(oe.value)){a&&(oe.value.src=a),oe.value.setAttribute("alt",n),oe.value.setAttribute("data-alt",n),Ve.value?(oe.value.style.width=`${Ve.value}px`,oe.value.setAttribute("width",Ve.value)):(oe.value.style.removeProperty("width"),oe.value.removeAttribute("width")),fe.value?(oe.value.style.height=`${fe.value}px`,oe.value.setAttribute("height",fe.value)):(oe.value.style.removeProperty("height"),oe.value.removeAttribute("height"));const i=window.getSelection();if(i){i.removeAllRanges();const s=document.createRange();s.setStartAfter(oe.value),s.collapse(!0),i.addRange(s)}he()}else{if(!a){o&&h.value&&o.observe(h.value,{childList:!0,subtree:!0}),io();return}if(h.value){h.value.focus();const i=window.getSelection();i&&i.rangeCount>0&&i.removeAllRanges();const s=window.getSelection();let d=null;if(Tt.value&&(Dt(Tt.value),s&&s.rangeCount>0&&(d=s.getRangeAt(0))),!d&&s&&s.rangeCount>0&&(d=s.getRangeAt(0)),!d&&h.value){if(d=document.createRange(),h.value.childNodes.length===0){const f=document.createElement("p");f.innerHTML="<br>",h.value.appendChild(f),d.setStart(f,0),d.collapse(!0)}else d.selectNodeContents(h.value),d.collapse(!1);s&&(s.removeAllRanges(),s.addRange(d))}if(!d){io();return}const u=d.commonAncestorContainer,g=u.nodeType===3?u.parentElement:u;if(!h.value.contains(g)){if(d=document.createRange(),h.value.childNodes.length===0){const f=document.createElement("p");f.innerHTML="<br>",h.value.appendChild(f),d.setStart(f,0),d.collapse(!0)}else d.selectNodeContents(h.value),d.collapse(!1);s&&(s.removeAllRanges(),s.addRange(d))}const p=document.createElement("img");p.src=a,p.setAttribute("alt",n),p.setAttribute("data-alt",n),Ve.value&&(p.style.width=`${Ve.value}px`,p.setAttribute("width",Ve.value)),fe.value&&(p.style.height=`${fe.value}px`,p.setAttribute("height",fe.value));try{d.insertNode(p),d.setStartAfter(p),d.collapse(!0),s&&(s.removeAllRanges(),s.addRange(d))}catch{if(h.value){if(h.value.childNodes.length===0){const E=document.createElement("p");h.value.appendChild(E),E.appendChild(p)}else{const E=h.value.lastChild;if(E&&E.nodeType===1)E.appendChild(p);else{const M=document.createElement("p");h.value.appendChild(M),M.appendChild(p)}}const b=document.createRange();b.setStartAfter(p),b.collapse(!0),s&&(s.removeAllRanges(),s.addRange(b))}}oe.value=p,he()}}e.nextTick(()=>{o&&h.value&&o.observe(h.value,{childList:!0,subtree:!0}),Ue(),J(),io()})};e.watch(()=>V.modelValue,n=>{if(V.richText&&h.value&&!et.value){const o=ae(n||"");if(h.value.innerHTML!==o){const i=wt();h.value.innerHTML=o,e.nextTick(()=>{Bo();const s=h.value.innerHTML||"",d=V.title||"",u=V.description||"";Ke.value=s,it.value=d,Se.value=u,At.value=s,Ge.value=d,ct.value=u,rt.value=[],lo.value=[],K.value&&(clearTimeout(K.value),K.value=null),de.value=!1,i&&Dt(i),Ye(),Rt(),xt(),Ue(),J(),Ft(),co()})}}},{immediate:!0}),e.watch(()=>V.richText,n=>{n?(J(),e.nextTick(()=>{Cl()})):(so(),no.value=[],ht.value&&(ht.value.disconnect(),ht.value=null)),Ft()}),e.watch(()=>V.floatingToolbar,n=>{n?J():so()}),e.watch(()=>V.disabled,n=>{n&&so(),Ft()}),e.watch(()=>V.description,()=>{e.nextTick(()=>{ot.value?Mo():kt()})}),e.watch(()=>V.title,()=>{e.nextTick(()=>{gt.value?P():No()})}),e.watch(()=>V.customToolbarSlots,()=>{e.nextTick(()=>{Ro()})},{deep:!0});const co=()=>{if(!V.richText||!h.value){no.value=[];return}const n={},o=h.value,a=o.closest(".editor-with-comments");if(!a)return;o.querySelectorAll("[data-comment], [data-fake-comment]").forEach((s,d)=>{const u=s.getAttribute("data-comment")||s.getAttribute("data-fake-comment");if(!u)return;const g=a.getBoundingClientRect(),p=s.getBoundingClientRect(),f=o.getBoundingClientRect(),b=window.getComputedStyle(s),E=parseFloat(b.lineHeight)||parseFloat(b.fontSize)*1.2,ke=p.top-f.top+E/2-15,Fe=f.top-g.top+ke;let be=V.commentUser||null;const Jt=s.getAttribute("data-comment-user");if(Jt)try{be=JSON.parse(Jt)}catch{}let kl=null;const Qo=s.getAttribute("data-comment-user-2");if(Qo)try{kl=JSON.parse(Qo)}catch{}const Jo=s.getAttribute("data-comment-count"),Rl=Jo?parseInt(Jo,10):1;n[u]||(n[u]={id:u,top:Fe,element:s,firstUser:be,secondUser:kl,totalCount:Rl})}),no.value=Object.values(n).map(s=>{const d=s.firstUser?s.secondUser?2:1:0,u=Math.max(0,s.totalCount-d);return{...s,additionalCount:u}})},Dl=n=>{!n||!n.element||(Pt(),xe.value=n.element,n.element.classList.add("editor-comment-highlighted"))},Pt=(n=!1)=>{!n&&k.value!==null&&xe.value&&(xe.value.getAttribute("data-comment")||xe.value.getAttribute("data-fake-comment"))===k.value||(h.value&&h.value.querySelectorAll(".editor-comment-highlighted").forEach(a=>{a.classList.remove("editor-comment-highlighted")}),xe.value&&(xe.value.classList.remove("editor-comment-highlighted"),xe.value=null))},Go=n=>{if(!n||!n.element)return;Pt(!0);const o=n.element.getAttribute("data-comment")||n.element.getAttribute("data-fake-comment");if(!o)return;const a=`[data-comment="${o}"], [data-fake-comment="${o}"]`;re("comment-marker-clicked",{commentId:o,selector:a,element:n.element})},Cl=()=>{!V.richText||!h.value||(ht.value&&ht.value.disconnect(),ht.value=new MutationObserver(()=>{e.nextTick(()=>{co()})}),ht.value.observe(h.value,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-comment","data-fake-comment","data-comment-user","data-comment-user-2","data-comment-count"]}),co())},ko=(n,o)=>{if(!n||!o)return;const a=o.getBoundingClientRect(),i=o.closest(".dss-toolbar-dropdown");o.closest(".dss-floating-toolbar"),i&&i.getBoundingClientRect();let s=a.top,d=a.right+4;n.style.top=`${s}px`,n.style.left=`${d}px`,n.offsetHeight;const u=n.getBoundingClientRect(),g=window.innerWidth,p=window.innerHeight;if(u.right>g){const f=a.left-u.width-4;n.style.left=`${f}px`}if(u.bottom>p){const f=Math.max(8,p-u.height-8);n.style.top=`${f}px`}u.top<0&&(n.style.top="8px"),n.getBoundingClientRect()};return e.watch(()=>je.value,n=>{e.nextTick(()=>{document.querySelectorAll(".dss-toolbar-dropdown-submenu").forEach(a=>{const i=a.getAttribute("data-submenu-id");if(i===n&&n){const s=document.querySelector(`.dss-toolbar-dropdown-item-has-submenu[data-submenu-id="${i}"]`);if(s){if(a.parentNode!==document.body){const d=a.parentNode;a.dataset.originalParentRef=d===s?"inside":"sibling",document.body.appendChild(a)}a.style.display="block",a.style.visibility="hidden",a.style.opacity="0",requestAnimationFrame(()=>{requestAnimationFrame(()=>{ko(a,s),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(()=>[ze.value,De.value],()=>{ze.value==="askAi"||De.value==="askAi"?e.nextTick(()=>{St()}):(je.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 i=document.querySelector(`.dss-toolbar-dropdown-item-has-submenu[data-submenu-id="${a}"]`);if(i)if(o.dataset.originalParentRef==="inside")i.appendChild(o);else{const d=i.closest(".dss-toolbar-dropdown");d&&d.insertBefore(o,i.nextSibling)}}}})}))}),e.watch(()=>V.locale,n=>{n&&n!==pt.value&&(pt.value=n)},{immediate:!0}),Zt({openCommentOverlayForSelector:ve}),(n,o)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-text-editor-container editor-with-comments",wl.value]),style:e.normalizeStyle($t.value)},[D.richText?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-text-editor-toolbar",onMousedown:o[14]||(o[14]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("div",Vs,[e.createElementVNode("button",{type:"button",class:"dss-toolbar-button",onClick:nl,title:e.unref(B)("textEditor.toolbar.undo")},[...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:"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,Ss),e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-disabled":!Oo.value}]),onClick:al,title:e.unref(B)("textEditor.toolbar.redo")},[...o[47]||(o[47]=[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,Ns),o[74]||(o[74]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",Ms,[e.createElementVNode("button",{type:"button",class:"dss-toolbar-button dss-toolbar-dropdown-toggle",onClick:o[0]||(o[0]=a=>sl("paragraph")),title:e.unref(B)("textEditor.toolbar.paragraphFormat")},[He.value==="h1"?(e.openBlock(),e.createElementBlock("svg",Hs,[...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.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)])])):He.value==="h2"?(e.openBlock(),e.createElementBlock("svg",Ts,[...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:"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)])])):He.value==="h3"?(e.openBlock(),e.createElementBlock("svg",Ls,[...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:"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)])])):He.value==="h4"?(e.openBlock(),e.createElementBlock("svg",As,[...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:"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)])])):He.value==="h5"?(e.openBlock(),e.createElementBlock("svg",$s,[...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:"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)])])):He.value==="h6"?(e.openBlock(),e.createElementBlock("svg",Ds,[...o[53]||(o[53]=[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",Rs,[...o[54]||(o[54]=[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[55]||(o[55]=e.createElementVNode("span",{class:"dss-toolbar-dropdown-arrow"},"˅",-1))],8,Bs),ze.value==="paragraph"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:o[8]||(o[8]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{type:"button",class:"dss-toolbar-dropdown-item",onClick:o[1]||(o[1]=a=>It("<h1>"))},[...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.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,"Heading 1",-1)])]),e.createElementVNode("div",{type:"button",class:"dss-toolbar-dropdown-item",onClick:o[2]||(o[2]=a=>It("<h2>"))},[...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:"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,"Heading 2",-1)])]),e.createElementVNode("div",{type:"button",class:"dss-toolbar-dropdown-item",onClick:o[3]||(o[3]=a=>It("<h3>"))},[...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:"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,"Heading 3",-1)])]),e.createElementVNode("div",{type:"button",class:"dss-toolbar-dropdown-item",onClick:o[4]||(o[4]=a=>It("<h4>"))},[...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:"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,"Heading 4",-1)])]),e.createElementVNode("div",{type:"button",class:"dss-toolbar-dropdown-item",onClick:o[5]||(o[5]=a=>It("<h5>"))},[...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:"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,"Heading 5",-1)])]),e.createElementVNode("div",{type:"button",class:"dss-toolbar-dropdown-item",onClick:o[6]||(o[6]=a=>It("<h6>"))},[...o[61]||(o[61]=[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,"Heading 6",-1)])]),e.createElementVNode("div",{type:"button",class:"dss-toolbar-dropdown-item",onClick:o[7]||(o[7]=a=>It("<p>"))},[...o[62]||(o[62]=[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,"Paragraph",-1)])])])):e.createCommentVNode("",!0)]),e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Ne("bold")}]),onClick:o[9]||(o[9]=a=>bt("bold")),title:e.unref(B)("textEditor.toolbar.bold")},[...o[63]||(o[63]=[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,Is),e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Ne("italic")}]),onClick:o[10]||(o[10]=a=>bt("italic")),title:e.unref(B)("textEditor.toolbar.italic")},[...o[64]||(o[64]=[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,_s),e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Ne("underline")}]),onClick:o[11]||(o[11]=a=>bt("underline")),title:e.unref(B)("textEditor.toolbar.underline")},[...o[65]||(o[65]=[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,Fs),e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":eo.value}]),onClick:rl,title:e.unref(B)("textEditor.toolbar.citation")},[...o[66]||(o[66]=[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,zs),o[75]||(o[75]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),Ze.value?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-toolbar-button",onClick:Uo,title:e.unref(B)("textEditor.toolbar.removeLink")},[(e.openBlock(),e.createElementBlock("svg",Xs,[...o[68]||(o[68]=[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"},null,-1)])]))],8,Zs)):(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-toolbar-button",onClick:Lo,title:e.unref(B)("textEditor.toolbar.insertLink")},[(e.openBlock(),e.createElementBlock("svg",Os,[...o[67]||(o[67]=[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"},null,-1)])]))],8,Ps)),o[76]||(o[76]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Ne("insertUnorderedList")}]),onClick:il,title:e.unref(B)("textEditor.toolbar.bulletList")},[...o[69]||(o[69]=[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,Us),e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Ne("insertOrderedList")}]),onClick:cl,title:e.unref(B)("textEditor.toolbar.numberList")},[...o[70]||(o[70]=[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,Ws),o[77]||(o[77]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("button",{type:"button",class:"dss-toolbar-button",onClick:Ko,title:e.unref(B)("textEditor.toolbar.image")},[...o[71]||(o[71]=[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:"M14 12.4444V1.55556C14 0.7 13.3 0 12.4444 0H1.55556C0.7 0 0 0.7 0 1.55556V12.4444C0 13.3 0.7 14 1.55556 14H12.4444C13.3 14 14 13.3 14 12.4444ZM4.27778 8.16667L6.22222 10.5078L8.94444 7L12.4444 11.6667H1.55556L4.27778 8.16667Z",fill:"#323232"})],-1)])],8,qs),ft.value?(e.openBlock(),e.createElementBlock("div",Ys)):e.createCommentVNode("",!0),ft.value?(e.openBlock(),e.createElementBlock("button",{key:3,type:"button",class:"dss-toolbar-button",title:e.unref(B)("textEditor.toolbar.comment"),onClick:Me},[...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:"M12.5996 0C13.3696 0 14 0.630391 14 1.40039V14L11.2002 11.2002H7.77637C8.02637 10.6283 8.16699 9.99705 8.16699 9.33301C8.16682 6.75583 6.07722 4.66699 3.5 4.66699C2.10579 4.66699 0.85512 5.27873 0 6.24805V1.40039C0 0.630391 0.630391 0 1.40039 0H12.5996ZM3.55762 7.08398C3.83361 7.08416 4.05762 7.30795 4.05762 7.58398V8.88965H5.36328C5.63927 8.88982 5.86328 9.11362 5.86328 9.38965C5.86302 9.66546 5.63911 9.88947 5.36328 9.88965H4.05762V11.1963C4.05753 11.4722 3.83356 11.6961 3.55762 11.6963C3.28168 11.6961 3.0577 11.4722 3.05762 11.1963V9.88965H1.75098C1.475 9.88965 1.25124 9.66557 1.25098 9.38965C1.25098 9.11351 1.47483 8.88965 1.75098 8.88965H3.05762V7.58398C3.05762 7.30795 3.28162 7.08416 3.55762 7.08398Z",fill:"#323232"})],-1)])],8,js)):e.createCommentVNode("",!0),D.askAi?(e.openBlock(),e.createElementBlock("div",Ks)):e.createCommentVNode("",!0),D.askAi?(e.openBlock(),e.createElementBlock("div",Gs,[e.createElementVNode("button",{type:"button",class:"dss-toolbar-ai-button dss-toolbar-dropdown-toggle",onClick:o[12]||(o[12]=a=>sl("askAi")),title:e.unref(B)("textEditor.toolbar.askAi")},[o[73]||(o[73]=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",Js,e.toDisplayString(e.unref(B)("textEditor.toolbar.askAi")),1)],8,Qs),ze.value==="askAi"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:o[13]||(o[13]=e.withModifiers(()=>{},["stop"]))},[e.renderSlot(n.$slots,"ask-ai-dropdown")])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),e.createElementVNode("div",er,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(D.customToolbarSlots,(a,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:i},[yt(a)?(e.openBlock(),e.createElementBlock("div",tr,[e.renderSlot(n.$slots,a)])):e.createCommentVNode("",!0),yt(a)&&i<D.customToolbarSlots.length-1&&El(i)?(e.openBlock(),e.createElementBlock("div",or)):e.createCommentVNode("",!0)],64))),128))])],32)):e.createCommentVNode("",!0),(ze.value==="paragraph"||ze.value==="askAi")&&D.richText?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-dropdown-overlay",onClick:Ie})):e.createCommentVNode("",!0),e.createVNode(Il,{showModal:nt.value,width:"500px",height:"55vh",onCloseModal:Io},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(B)("textEditor.link.editLink")),1)]),content:e.withCtx(()=>[e.createElementVNode("div",lr,[e.createElementVNode("div",nr,[o[78]||(o[78]=e.createElementVNode("label",{class:"dss-link-modal-label"},"Alt text:",-1)),e.withDirectives(e.createElementVNode("input",{ref_key:"linkAltInput",ref:wo,type:"text","onUpdate:modelValue":o[15]||(o[15]=a=>ue.value=a),class:"dss-link-modal-input",placeholder:"Enter alt text...",onKeyup:e.withKeys(_o,["enter"])},null,544),[[e.vModelText,ue.value]])]),e.createElementVNode("div",ar,[e.createElementVNode("label",sr,e.toDisplayString(e.unref(B)("textEditor.link.url")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"linkUrlInput",ref:at,type:"text","onUpdate:modelValue":o[16]||(o[16]=a=>ce.value=a),class:"dss-link-modal-input",placeholder:e.unref(B)("textEditor.link.enterUrl"),onKeyup:e.withKeys(_o,["enter"])},null,40,rr),[[e.vModelText,ce.value]])])])]),actions:e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-cancel",onClick:Io},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:_o},e.toDisplayString(e.unref(B)("textEditor.link.save")),1)]),_:1},8,["showModal"]),e.createVNode(Il,{showModal:mo.value,width:"500px",height:"80vh",onCloseModal:io},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(oe.value?e.unref(B)("textEditor.image.editImage"):e.unref(B)("textEditor.image.addImage")),1)]),content:e.withCtx(()=>[e.createElementVNode("div",ir,[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-image-modal-tab",{"dss-image-modal-tab-active":Xe.value==="upload"}]),onClick:o[17]||(o[17]=a=>Xe.value="upload")},e.toDisplayString(e.unref(B)("textEditor.image.upload")),3),o[79]||(o[79]=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":Xe.value==="url"}]),onClick:o[18]||(o[18]=a=>Xe.value="url")},e.toDisplayString(e.unref(B)("textEditor.image.imageLink")),3)]),Xe.value==="upload"?(e.openBlock(),e.createElementBlock("div",cr,[e.createElementVNode("div",ur,[e.createElementVNode("div",dr,[ol.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("label",mr,e.toDisplayString(e.unref(B)("textEditor.image.uploadImage")),1)),ol.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-image-upload-preview",onClick:Co},[e.createElementVNode("img",{src:st.value,alt:"Preview",class:"dss-image-preview-image"},null,8,pr),o[80]||(o[80]=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:tt,type:"file",accept:"image/*",class:"dss-image-file-input-hidden",onChange:yl},null,544)])):(e.openBlock(),e.createElementBlock("input",{key:2,ref_key:"imageFileInput",ref:tt,type:"file",accept:"image/*",class:"dss-link-modal-input dss-link-modal-input-image",onChange:yl},null,544))]),e.createElementVNode("div",vr,[e.createElementVNode("label",gr,e.toDisplayString(e.unref(B)("textEditor.image.altText")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"imageAltInput",ref:Ht,type:"text","onUpdate:modelValue":o[19]||(o[19]=a=>qe.value=a),class:"dss-link-modal-input",placeholder:"Enter alt text...",onKeyup:e.withKeys(zt,["enter"])},null,544),[[e.vModelText,qe.value]])]),e.createElementVNode("div",fr,[e.createElementVNode("label",hr,e.toDisplayString(e.unref(B)("textEditor.image.width")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":o[20]||(o[20]=a=>Ve.value=a),class:"dss-link-modal-input",placeholder:"Auto",onKeyup:e.withKeys(zt,["enter"])},null,544),[[e.vModelText,Ve.value]])]),e.createElementVNode("div",yr,[e.createElementVNode("label",Cr,e.toDisplayString(e.unref(B)("textEditor.image.height")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":o[21]||(o[21]=a=>fe.value=a),class:"dss-link-modal-input",placeholder:"Auto",onKeyup:e.withKeys(zt,["enter"])},null,544),[[e.vModelText,fe.value]])])])])):e.createCommentVNode("",!0),Xe.value==="url"?(e.openBlock(),e.createElementBlock("div",kr,[e.createElementVNode("div",wr,[e.createElementVNode("div",xr,[o[81]||(o[81]=e.createElementVNode("label",{class:"dss-link-modal-label"},"Image URL:",-1)),e.withDirectives(e.createElementVNode("input",{ref_key:"imageUrlInput",ref:po,type:"text","onUpdate:modelValue":o[22]||(o[22]=a=>Lt.value=a),class:"dss-link-modal-input",placeholder:"https://example.com/image.jpg",onKeyup:e.withKeys(zt,["enter"])},null,544),[[e.vModelText,Lt.value]])]),e.createElementVNode("div",br,[e.createElementVNode("label",Er,e.toDisplayString(e.unref(B)("textEditor.image.altText")),1),e.withDirectives(e.createElementVNode("input",{type:"text","onUpdate:modelValue":o[23]||(o[23]=a=>qe.value=a),class:"dss-link-modal-input",placeholder:"Enter alt text...",onKeyup:e.withKeys(zt,["enter"])},null,544),[[e.vModelText,qe.value]])]),e.createElementVNode("div",Vr,[e.createElementVNode("label",Sr,e.toDisplayString(e.unref(B)("textEditor.image.width")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":o[24]||(o[24]=a=>Ve.value=a),class:"dss-link-modal-input",placeholder:"Auto",onKeyup:e.withKeys(zt,["enter"])},null,544),[[e.vModelText,Ve.value]])]),e.createElementVNode("div",Nr,[e.createElementVNode("label",Mr,e.toDisplayString(e.unref(B)("textEditor.image.height")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":o[25]||(o[25]=a=>fe.value=a),class:"dss-link-modal-input",placeholder:"Auto",onKeyup:e.withKeys(zt,["enter"])},null,544),[[e.vModelText,fe.value]])])])])):e.createCommentVNode("",!0)]),actions:e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-cancel",onClick:io}," Cancel "),e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-save",onClick:zt}," Save ")]),_:1},8,["showModal"]),e.createElementVNode("div",{class:e.normalizeClass(["dss-text-editor-title-wrapper",{"dss-text-editor-no-border-bottom":pe.value&>.value}])},[o[82]||(o[82]=e.createElementVNode("p",null," Title ",-1)),e.createElementVNode("div",Br,[gt.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Hr,[D.title?(e.openBlock(),e.createElementBlock("span",Tr,e.toDisplayString(D.title),1)):(e.openBlock(),e.createElementBlock("span",Lr,e.toDisplayString(Zo.value),1))])),e.createElementVNode("textarea",{ref_key:"titleInputRef",ref:ie,value:D.title,onInput:ll,onFocus:go,onBlur:fo,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-title-input",{"dss-text-editor-title-input-blurred":!gt.value}]),placeholder:Zo.value,disabled:D.disabled,rows:"1"},null,42,Ar)])],2),pe.value&>.value?(e.openBlock(),e.createElementBlock("div",$r,[e.renderSlot(n.$slots,"title-slot")])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["dss-text-editor-description-wrapper",{"dss-text-editor-no-border-bottom":Ct.value&&ot.value}])},[o[83]||(o[83]=e.createElementVNode("p",null," Description ",-1)),e.createElementVNode("div",Dr,[ot.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Rr,[D.description?(e.openBlock(),e.createElementBlock("span",Ir,e.toDisplayString(D.description),1)):(e.openBlock(),e.createElementBlock("span",_r,e.toDisplayString(Vo.value),1))])),e.createElementVNode("textarea",{ref_key:"descriptionInputRef",ref:me,value:D.description,onInput:Nl,onFocus:Vl,onBlur:Sl,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-description-input",{"dss-text-editor-description-input-blurred":!ot.value}]),placeholder:Vo.value,disabled:D.disabled,rows:"1"},null,42,Fr)])],2),Ct.value&&ot.value?(e.openBlock(),e.createElementBlock("div",zr,[e.renderSlot(n.$slots,"description-slot")])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(no.value,a=>(e.openBlock(),e.createElementBlock("div",{key:a.id,class:e.normalizeClass(["editor-comment-marker-group",{"editor-comment-marker-active":k.value===a.id}]),"data-comment-id":a.id,style:e.normalizeStyle({top:a.top+"px"}),onMouseenter:i=>Dl(a),onMouseleave:o[26]||(o[26]=()=>Pt(!1))},[a.firstUser?(e.openBlock(),e.createElementBlock("div",{key:0,class:"editor-comment-marker editor-comment-marker-first",onClick:e.withModifiers(i=>Go(a),["stop"])},[a.firstUser.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:a.firstUser.avatar,alt:a.firstUser.name||"avatar"},null,8,Zr)):(e.openBlock(),e.createElementBlock("span",Xr,e.toDisplayString(a.firstUser.initials||(a.firstUser.name?a.firstUser.name.charAt(0):"")),1))],8,Or)):e.createCommentVNode("",!0),a.secondUser?(e.openBlock(),e.createElementBlock("div",{key:1,class:"editor-comment-marker editor-comment-marker-second",onClick:e.withModifiers(i=>Go(a),["stop"])},[a.secondUser.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:a.secondUser.avatar,alt:a.secondUser.name||"avatar"},null,8,Wr)):(e.openBlock(),e.createElementBlock("span",qr,e.toDisplayString(a.secondUser.initials||(a.secondUser.name?a.secondUser.name.charAt(0):"")),1))],8,Ur)):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(i=>Go(a),["stop"])},[e.createElementVNode("span",jr,"+"+e.toDisplayString(a.additionalCount),1)],12,Yr)):e.createCommentVNode("",!0)],46,Pr))),128)),D.richText?(e.openBlock(),e.createElementBlock("div",oi,[e.createElementVNode("div",{ref_key:"editorRef",ref:h,contenteditable:"true",spellcheck:"false",class:e.normalizeClass(["dss-text-editor-content",{"dss-text-editor-content-disabled":D.disabled,"dss-text-editor-fixed-height":D.fixedHeight}]),style:e.normalizeStyle(el.value),onInput:he,onBlur:ao,onClick:Qe,onMouseup:pl,onKeyup:pl,onKeydown:dl,onMousemove:vl,onMouseleave:Ll},null,38),e.createVNode(e.Transition,{name:"comment-overlay"},{default:e.withCtx(()=>[k.value!==null?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-comment-overlay",style:e.normalizeStyle(Et.value)},[ge.value||Vt.value.length>0?(e.openBlock(),e.createElementBlock("div",li,[e.createElementVNode("div",ni,[ge.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-comment-selection",innerHTML:ge.value},null,8,ai)):e.createCommentVNode("",!0)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Vt.value,(a,i)=>(e.openBlock(),e.createElementBlock("div",{key:i,class:"dss-comment-message"},[a.user&&(a.user.avatar||a.user.initials||a.user.name)?(e.openBlock(),e.createElementBlock("div",si,[e.createElementVNode("div",ri,[a.user.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:a.user.avatar,alt:a.user.name||"avatar"},null,8,ii)):(e.openBlock(),e.createElementBlock("span",ci,e.toDisplayString(a.user.initials||(a.user.name?a.user.name.charAt(0):"")),1))])])):e.createCommentVNode("",!0),e.createElementVNode("div",ui,[e.createElementVNode("div",di,[e.createElementVNode("div",mi,e.toDisplayString(a.user&&a.user.name||"Comment"),1),a.createdAt?(e.openBlock(),e.createElementBlock("div",pi,e.toDisplayString(N(new Date(a.createdAt))),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",vi,e.toDisplayString(a.text||""),1)])]))),128))])):e.createCommentVNode("",!0),e.createElementVNode("div",gi,[e.withDirectives(e.createElementVNode("textarea",{ref_key:"commentInputRef",ref:_e,"onUpdate:modelValue":o[27]||(o[27]=a=>Pe.value=a),class:"dss-comment-input",rows:"1",placeholder:"comment",onKeydown:e.withKeys(e.withModifiers(Be,["prevent","stop"]),["enter"]),onInput:o[28]||(o[28]=()=>{if(_e.value){const a=_e.value;a.style.height="auto",a.style.height=`${a.scrollHeight}px`}})},null,40,fi),[[e.vModelText,Pe.value]]),e.createElementVNode("button",{type:"button",class:"dss-comment-send-button",onClick:e.withModifiers(Be,["stop"])},[...o[85]||(o[85]=[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",hi,[e.createElementVNode("div",yi,[e.createElementVNode("span",Ci,e.toDisplayString(bo.value)+" "+e.toDisplayString(bo.value===1?e.unref(B)("textEditor.footer.word"):e.unref(B)("textEditor.footer.words")),1),o[86]||(o[86]=e.createElementVNode("span",{class:"dss-text-editor-footer-separator"},"•",-1)),e.createElementVNode("span",ki,e.toDisplayString(Eo.value)+" "+e.toDisplayString(Eo.value===1?e.unref(B)("textEditor.footer.character"):e.unref(B)("textEditor.footer.characters")),1)])])])):(e.openBlock(),e.createElementBlock("div",Kr,[e.createElementVNode("textarea",{value:D.modelValue,onInput:Re,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-textarea",{"dss-text-editor-fixed-height":D.fixedHeight}]),placeholder:bl.value,rows:D.rows,disabled:D.disabled,style:e.normalizeStyle(xl.value)},null,46,Gr),e.createElementVNode("div",Qr,[e.createElementVNode("div",Jr,[e.createElementVNode("span",ei,e.toDisplayString(bo.value)+" "+e.toDisplayString(bo.value===1?e.unref(B)("textEditor.footer.word"):e.unref(B)("textEditor.footer.words")),1),o[84]||(o[84]=e.createElementVNode("span",{class:"dss-text-editor-footer-separator"},"•",-1)),e.createElementVNode("span",ti,e.toDisplayString(Eo.value)+" "+e.toDisplayString(Eo.value===1?e.unref(B)("textEditor.footer.character"):e.unref(B)("textEditor.footer.characters")),1)])])])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[L.value&&z.value&&h.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-link-popup",style:e.normalizeStyle(te.value),onMouseenter:o[29]||(o[29]=a=>le.value=!0),onMouseleave:yo},[e.createElementVNode("span",{class:"dss-link-popup-url",onClick:e.withModifiers(hl,["stop"]),title:z.value},e.toDisplayString(z.value),9,wi),e.createElementVNode("button",{type:"button",class:"dss-link-popup-edit",onClick:e.withModifiers(Al,["stop"]),title:e.unref(B)("textEditor.link.editLink")},[(e.openBlock(),e.createElementBlock("svg",bi,[...o[87]||(o[87]=[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,xi)],36)):e.createCommentVNode("",!0)])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[vo.value&&to.value&&h.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-link-popup",style:e.normalizeStyle(oo.value),onMouseenter:o[30]||(o[30]=a=>Wt.value=!0),onMouseleave:ro},[e.createElementVNode("div",Ei,[to.value===e.unref(B)("textEditor.image.noAlt")?(e.openBlock(),e.createElementBlock("div",Vi,[...o[88]||(o[88]=[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:to.value},e.toDisplayString(to.value),9,Si)]),e.createElementVNode("button",{type:"button",class:"dss-link-popup-edit",onClick:e.withModifiers($l,["stop"]),title:e.unref(B)("textEditor.image.editImage")},[(e.openBlock(),e.createElementBlock("svg",Mi,[...o[89]||(o[89]=[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,Ni)],36)):e.createCommentVNode("",!0)])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[D.floatingToolbar&&D.richText&&Ee.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"floatingToolbarRef",ref:uo,class:"dss-floating-toolbar",style:e.normalizeStyle($e.value),onMousedown:o[45]||(o[45]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("div",Bi,[e.createElementVNode("button",{type:"button",class:"dss-toolbar-button",onClick:e.withModifiers(nl,["stop"]),title:e.unref(B)("textEditor.toolbar.undo")},[...o[90]||(o[90]=[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,Hi),e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-disabled":!Oo.value}]),onClick:e.withModifiers(al,["stop"]),title:e.unref(B)("textEditor.toolbar.redo")},[...o[91]||(o[91]=[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,Ti),o[111]||(o[111]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",Li,[e.createElementVNode("button",{type:"button",class:"dss-toolbar-button dss-toolbar-dropdown-toggle",onClick:o[31]||(o[31]=e.withModifiers(a=>Yo("paragraph"),["stop"])),title:e.unref(B)("textEditor.toolbar.paragraphFormat")},[He.value==="h1"?(e.openBlock(),e.createElementBlock("svg",$i,[...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:"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)])])):He.value==="h2"?(e.openBlock(),e.createElementBlock("svg",Di,[...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:"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)])])):He.value==="h3"?(e.openBlock(),e.createElementBlock("svg",Ri,[...o[94]||(o[94]=[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)])])):He.value==="h4"?(e.openBlock(),e.createElementBlock("svg",Ii,[...o[95]||(o[95]=[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)])])):He.value==="h5"?(e.openBlock(),e.createElementBlock("svg",_i,[...o[96]||(o[96]=[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)])])):He.value==="h6"?(e.openBlock(),e.createElementBlock("svg",Fi,[...o[97]||(o[97]=[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",zi,[...o[98]||(o[98]=[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[99]||(o[99]=e.createElementVNode("span",{class:"dss-toolbar-dropdown-arrow"},"˅",-1))],8,Ai),De.value==="paragraph"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:o[39]||(o[39]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("button",{type:"button",class:"dss-toolbar-dropdown-item",onClick:o[32]||(o[32]=a=>Kt("<h1>"))},[e.createElementVNode("h1",null,e.toDisplayString(e.unref(B)("textEditor.paragraph.heading1")),1)]),e.createElementVNode("button",{type:"button",class:"dss-toolbar-dropdown-item",onClick:o[33]||(o[33]=a=>Kt("<h2>"))},[e.createElementVNode("h2",null,e.toDisplayString(e.unref(B)("textEditor.paragraph.heading2")),1)]),e.createElementVNode("button",{type:"button",class:"dss-toolbar-dropdown-item",onClick:o[34]||(o[34]=a=>Kt("<h3>"))},[e.createElementVNode("h3",null,e.toDisplayString(e.unref(B)("textEditor.paragraph.heading3")),1)]),e.createElementVNode("button",{type:"button",class:"dss-toolbar-dropdown-item",onClick:o[35]||(o[35]=a=>Kt("<h4>"))},[e.createElementVNode("h4",null,e.toDisplayString(e.unref(B)("textEditor.paragraph.heading4")),1)]),e.createElementVNode("button",{type:"button",class:"dss-toolbar-dropdown-item",onClick:o[36]||(o[36]=a=>Kt("<h5>"))},[e.createElementVNode("h5",null,e.toDisplayString(e.unref(B)("textEditor.paragraph.heading5")),1)]),e.createElementVNode("button",{type:"button",class:"dss-toolbar-dropdown-item",onClick:o[37]||(o[37]=a=>Kt("<h6>"))},[e.createElementVNode("h6",null,e.toDisplayString(e.unref(B)("textEditor.paragraph.heading6")),1)]),e.createElementVNode("button",{type:"button",class:"dss-toolbar-dropdown-item",onClick:o[38]||(o[38]=a=>Kt("<p>"))},[e.createElementVNode("p",null,e.toDisplayString(e.unref(B)("textEditor.paragraph.paragraph")),1)])])):e.createCommentVNode("",!0)]),o[112]||(o[112]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Ne("bold")}]),onClick:o[40]||(o[40]=e.withModifiers(a=>bt("bold"),["stop"])),title:e.unref(B)("textEditor.toolbar.bold")},[...o[100]||(o[100]=[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,Pi),e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Ne("italic")}]),onClick:o[41]||(o[41]=e.withModifiers(a=>bt("italic"),["stop"])),title:e.unref(B)("textEditor.toolbar.italic")},[...o[101]||(o[101]=[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,Oi),e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Ne("underline")}]),onClick:o[42]||(o[42]=e.withModifiers(a=>bt("underline"),["stop"])),title:e.unref(B)("textEditor.toolbar.underline")},[...o[102]||(o[102]=[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,Zi),o[113]||(o[113]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":eo.value}]),onClick:e.withModifiers(rl,["stop"]),title:e.unref(B)("textEditor.toolbar.citation")},[...o[103]||(o[103]=[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,Xi),o[114]||(o[114]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),Ze.value?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-toolbar-button",onClick:e.withModifiers(Uo,["stop"]),title:e.unref(B)("textEditor.toolbar.removeLink")},[(e.openBlock(),e.createElementBlock("svg",Yi,[...o[105]||(o[105]=[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"},null,-1)])]))],8,qi)):(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-toolbar-button",onClick:e.withModifiers(Lo,["stop"]),title:e.unref(B)("textEditor.toolbar.insertLink")},[(e.openBlock(),e.createElementBlock("svg",Wi,[...o[104]||(o[104]=[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"},null,-1)])]))],8,Ui)),o[115]||(o[115]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Ne("insertUnorderedList")}]),onClick:e.withModifiers(il,["stop"]),title:e.unref(B)("textEditor.toolbar.bulletList")},[...o[106]||(o[106]=[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,ji),e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Ne("insertOrderedList")}]),onClick:e.withModifiers(cl,["stop"]),title:e.unref(B)("textEditor.toolbar.numberList")},[...o[107]||(o[107]=[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,Ki),o[116]||(o[116]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("button",{type:"button",class:"dss-toolbar-button",onClick:e.withModifiers(Ko,["stop"]),title:e.unref(B)("textEditor.toolbar.image")},[...o[108]||(o[108]=[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:"M14 12.4444V1.55556C14 0.7 13.3 0 12.4444 0H1.55556C0.7 0 0 0.7 0 1.55556V12.4444C0 13.3 0.7 14 1.55556 14H12.4444C13.3 14 14 13.3 14 12.4444ZM4.27778 8.16667L6.22222 10.5078L8.94444 7L12.4444 11.6667H1.55556L4.27778 8.16667Z",fill:"#323232"})],-1)])],8,Gi),o[117]||(o[117]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("button",{type:"button",class:"dss-toolbar-button",title:e.unref(B)("textEditor.toolbar.comment"),onClick:e.withModifiers(Me,["stop"])},[...o[109]||(o[109]=[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:"M12.5996 0C13.3696 0 14 0.630391 14 1.40039V14L11.2002 11.2002H7.77637C8.02637 10.6283 8.16699 9.99705 8.16699 9.33301C8.16682 6.75583 6.07722 4.66699 3.5 4.66699C2.10579 4.66699 0.85512 5.27873 0 6.24805V1.40039C0 0.630391 0.630391 0 1.40039 0H12.5996ZM3.55762 7.08398C3.83361 7.08416 4.05762 7.30795 4.05762 7.58398V8.88965H5.36328C5.63927 8.88982 5.86328 9.11362 5.86328 9.38965C5.86302 9.66546 5.63911 9.88947 5.36328 9.88965H4.05762V11.1963C4.05753 11.4722 3.83356 11.6961 3.55762 11.6963C3.28168 11.6961 3.0577 11.4722 3.05762 11.1963V9.88965H1.75098C1.475 9.88965 1.25124 9.66557 1.25098 9.38965C1.25098 9.11351 1.47483 8.88965 1.75098 8.88965H3.05762V7.58398C3.05762 7.30795 3.28162 7.08416 3.55762 7.08398Z",fill:"#323232"})],-1)])],8,Qi),D.askAi?(e.openBlock(),e.createElementBlock("div",Ji)):e.createCommentVNode("",!0),D.askAi?(e.openBlock(),e.createElementBlock("div",ec,[e.createElementVNode("div",{class:"dss-toolbar-ai-button dss-toolbar-ai-float dss-toolbar-dropdown-toggle",onClick:o[43]||(o[43]=e.withModifiers(a=>Yo("askAi"),["stop"])),title:e.unref(B)("textEditor.toolbar.askAi")},[o[110]||(o[110]=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",oc,e.toDisplayString(e.unref(B)("textEditor.toolbar.askAi")),1)],8,tc),De.value==="askAi"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:o[44]||(o[44]=e.withModifiers(()=>{},["stop"]))},[e.renderSlot(n.$slots,"ask-ai-dropdown")])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),So.value?(e.openBlock(),e.createElementBlock("div",lc,[D.askAi&&So.value?(e.openBlock(),e.createElementBlock("div",nc)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(D.customToolbarSlots,(a,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:i},[yt(a)&&I(a)?(e.openBlock(),e.createElementBlock("div",ac,[e.renderSlot(n.$slots,a)])):e.createCommentVNode("",!0),yt(a)&&I(a)&&i<D.customToolbarSlots.length-1&&we(i)?(e.openBlock(),e.createElementBlock("div",sc)):e.createCommentVNode("",!0)],64))),128))])):e.createCommentVNode("",!0)],36)):e.createCommentVNode("",!0)]))],6))}}),cc={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"}},uc={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:"comment",send:"Send"},labels:{title:"Title",description:"Description"},placeholders:{title:"Enter title...",description:"Enter description...",startTyping:"Start typing..."},footer:{word:"word",words:"words",character:"character",characters:"characters"}},Pl={chart:cc,textEditor:uc},dc={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"}},mc={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:"Titre 1",heading2:"Titre 2",heading3:"Titre 3",heading4:"Titre 4",heading5:"Titre 5",heading6:"Titre 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:"commentaire",send:"Envoyer"},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"}},Ol={chart:dc,textEditor:mc},pc={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"}},vc={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:"commentaar",send:"Verzenden"},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"}},Zl={chart:pc,textEditor:vc},_l={en:Pl,fr:Ol,nl:Zl};function gc(D){if(!D||!D.global)return;const Zt=D.global.availableLocales||[];Object.keys(_l).forEach(U=>{Zt.includes(U)?D.global.mergeLocaleMessage(U,_l[U]):console.error(`⊗ Skipped DSP translations for: ${U} (not in app)`)})}const Fl={en:{textEditor:Pl.textEditor},fr:{textEditor:Ol.textEditor},nl:{textEditor:Zl.textEditor}};function fc(D){if(!D||!D.global)return;const Zt=D.global.availableLocales||[];Object.keys(Fl).forEach(U=>{Zt.includes(U)?D.global.mergeLocaleMessage(U,Fl[U]):console.error(`⊗ Skipped DSSTextEditor translations for: ${U} (not in app)`)})}const hc={en:{...Pl},fr:{...Ol},nl:{...Zl}};zl.createI18n({legacy:!1,locale:"en",fallbackLocale:"en",messages:hc});exports.DSSChart=xs;exports.DSSChartMessages=_l;exports.DSSModal=Il;exports.DSSTextEditor=ic;exports.DSSTextEditorMessages=Fl;exports.addDSSChartTranslations=gc;exports.addDSSTextEditorTranslations=fc;
|
package/dist/index.es.js
CHANGED
|
@@ -7267,7 +7267,6 @@ const kn = ["data-chart-type"], Mn = { class: "dss-chart-header" }, Hn = { class
|
|
|
7267
7267
|
z.askAi ? (v(), g("div", Eu)) : R("", !0),
|
|
7268
7268
|
z.askAi ? (v(), g("div", Au, [
|
|
7269
7269
|
r("div", {
|
|
7270
|
-
type: "button",
|
|
7271
7270
|
class: "dss-toolbar-ai-button dss-toolbar-ai-float dss-toolbar-dropdown-toggle",
|
|
7272
7271
|
onClick: t[43] || (t[43] = he((n) => hl("askAi"), ["stop"])),
|
|
7273
7272
|
title: I(_)("textEditor.toolbar.askAi")
|