M&&(_=M),{...g,keypoint:_,path:f.formula(k.width,k.height,_)}}return g})},p=m=>{c=!1,document.ontouchmove=null,document.ontouchend=null,document.onmousemove=null,document.onmouseup=null;const A=m instanceof MouseEvent?m.pageX:m.changedTouches[0].pageX,x=m instanceof MouseEvent?m.pageY:m.changedTouches[0].pageY;l===A&&u===x||(n.updateSlide({elements:e.value}),r())};s?(document.ontouchmove=h,document.ontouchend=p):(document.onmousemove=h,document.onmouseup=p)}}},Coe=e=>{const t=ft(),{canvasScale:n,creatingElement:r}=Ee(t),o=u=>{const{start:f,end:d}=u;if(!e.value)return;const h=e.value.getBoundingClientRect(),[p,m]=f,[A,x]=d,y=Math.min(p,A),R=Math.max(p,A),g=Math.min(m,x),b=Math.max(m,x),L=(y-h.x)/n.value,T=(g-h.y)/n.value,M=(R-y)/n.value,w=(b-g)/n.value;return{left:L,top:T,width:M,height:w}},i=u=>{const{start:f,end:d}=u;if(!e.value)return;const h=e.value.getBoundingClientRect(),[p,m]=f,[A,x]=d,y=Math.min(p,A),R=Math.max(p,A),g=Math.min(m,x),b=Math.max(m,x),L=(y-h.x)/n.value,T=(g-h.y)/n.value,M=(R-y)/n.value,w=(b-g)/n.value;return{left:L,top:T,start:[p===y?0:M,m===g?0:w],end:[A===y?0:M,x===g?0:w]}},{createTextElement:a,createShapeElement:s,createLineElement:c}=Ju();return{formatCreateSelection:o,insertElementFromCreateSelection:u=>{if(!r.value)return;const f=r.value.type;if(f==="text"){const d=o(u);d&&a(d,{vertical:r.value.vertical})}else if(f==="shape"){const d=o(u);d&&s(d,r.value.data)}else if(f==="line"){const d=i(u);d&&c(d,r.value.data)}t.setCreatingElement(null)}}},i2=()=>{const e=st(),{activeElementIdList:t,activeElementList:n}=Ee(ft()),{currentSlide:r,viewportRatio:o}=Ee(e),{addHistorySnapshot:i}=Jt();return{alignElementToCanvas:s=>{const c=Gt,l=Gt*o.value,{minX:u,maxX:f,minY:d,maxY:h}=ec(n.value),p=JSON.parse(JSON.stringify(r.value.elements));for(const m of p)if(t.value.includes(m.id)){if(s===on.CENTER){const A=d+(h-d)/2-l/2,x=u+(f-u)/2-c/2;m.top=m.top-A,m.left=m.left-x}if(s===on.TOP){const A=d-0;m.top=m.top-A}else if(s===on.VERTICAL){const A=d+(h-d)/2-l/2;m.top=m.top-A}else if(s===on.BOTTOM){const A=h-l;m.top=m.top-A}else if(s===on.LEFT){const A=u-0;m.left=m.left-A}else if(s===on.HORIZONTAL){const A=u+(f-u)/2-c/2;m.left=m.left-A}else if(s===on.RIGHT){const A=f-c;m.left=m.left-A}}e.updateSlide({elements:p}),i()}}},wc=e=>({shadowStyle:Me(()=>{if(e.value){const{h:n,v:r,blur:o,color:i}=e.value;return`${n}px ${r}px ${o}px ${i}`}return""})}),a2=(e,t)=>({flipStyle:Me(()=>{let r="";return e.value&&t.value?r="rotateX(180deg) rotateY(180deg)":t.value?r="rotateX(180deg)":e.value&&(r="rotateY(180deg)"),r})});var gI=(e=>(e.RECT="rect",e.ELLIPSE="ellipse",e.POLYGON="polygon",e))(gI||{});const K3={rect:{name:"矩形",type:"rect",radius:"0",style:""},rect2:{name:"矩形2",type:"polygon",style:"polygon(0% 0%, 80% 0%, 100% 20%, 100% 100%, 0 100%)",createPath:(e,t)=>`M 0 0 L ${e*.8} 0 L ${e} ${t*.2} L ${e} ${t} L 0 ${t} Z`},rect3:{name:"矩形3",type:"polygon",style:"polygon(0% 0%, 80% 0%, 100% 20%, 100% 100%, 20% 100%, 0% 80%)",createPath:(e,t)=>`M 0 0 L ${e*.8} 0 L ${e} ${t*.2} L ${e} ${t} L ${e*.2} ${t} L 0 ${t*.8} Z`},roundRect:{name:"圆角矩形",type:"rect",radius:"10px",style:"inset(0 0 0 0 round 10px 10px 10px 10px)"},ellipse:{name:"圆形",type:"ellipse",style:"ellipse(50% 50% at 50% 50%)"},triangle:{name:"三角形",type:"polygon",style:"polygon(50% 0%, 0% 100%, 100% 100%)",createPath:(e,t)=>`M ${e*.5} 0 L 0 ${t} L ${e} ${t} Z`},triangle2:{name:"三角形2",type:"polygon",style:"polygon(50% 100%, 0% 0%, 100% 0%)",createPath:(e,t)=>`M ${e*.5} ${t} L 0 0 L ${e} 0 Z`},triangle3:{name:"三角形3",type:"polygon",style:"polygon(0% 0%, 0% 100%, 100% 100%)",createPath:(e,t)=>`M 0 0 L 0 ${t} L ${e} ${t} Z`},rhombus:{name:"菱形",type:"polygon",style:"polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%)",createPath:(e,t)=>`M ${e*.5} 0 L ${e} ${t*.5} L ${e*.5} ${t} L 0 ${t*.5} Z`},pentagon:{name:"五边形",type:"polygon",style:"polygon(50% 0%, 100% 38%, 82% 100%, 18% 100%, 0% 38%)",createPath:(e,t)=>`M ${e*.5} 0 L ${e} ${.38*t} L ${.82*e} ${t} L ${.18*e} ${t} L 0 ${.38*t} Z`},hexagon:{name:"六边形",type:"polygon",style:"polygon(20% 0%, 80% 0%, 100% 50%, 80% 100%, 20% 100%, 0% 50%)",createPath:(e,t)=>`M ${e*.2} 0 L ${e*.8} 0 L ${e} ${t*.5} L ${e*.8} ${t} L ${e*.2} ${t} L 0 ${t*.5} Z`},heptagon:{name:"七边形",type:"polygon",style:"polygon(50% 0%, 90% 20%, 100% 60%, 75% 100%, 25% 100%, 0% 60%, 10% 20%)",createPath:(e,t)=>`M ${e*.5} 0 L ${e*.9} ${t*.2} L ${e} ${t*.6} L ${e*.75} ${t} L ${e*.25} ${t} L 0 ${t*.6} L ${e*.1} ${t*.2} Z`},octagon:{name:"八边形",type:"polygon",style:"polygon(30% 0%, 70% 0%, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0% 70%, 0% 30%)",createPath:(e,t)=>`M ${e*.3} 0 L ${e*.7} 0 L ${e} ${t*.3} L ${e} ${t*.7} L ${e*.7} ${t} L ${e*.3} ${t} L 0 ${t*.7} L 0 ${t*.3} Z`},chevron:{name:"V形",type:"polygon",style:"polygon(75% 0%, 100% 50%, 75% 100%, 0% 100%, 25% 50%, 0% 0%)",createPath:(e,t)=>`M ${e*.75} 0 L ${e} ${t*.5} L ${e*.75} ${t} L 0 ${t} L ${e*.25} ${t*.5} L 0 0 Z`},point:{name:"点",type:"polygon",style:"polygon(0% 0%, 75% 0%, 100% 50%, 75% 100%, 0% 100%)",createPath:(e,t)=>`M 0 0 L ${e*.75} 0 L ${e} ${t*.5} L ${e*.75} ${t} L 0 ${t} Z`},arrow:{name:"箭头",type:"polygon",style:"polygon(0% 20%, 60% 20%, 60% 0%, 100% 50%, 60% 100%, 60% 80%, 0% 80%)",createPath:(e,t)=>`M 0 ${t*.2} L ${e*.6} ${t*.2} L ${e*.6} 0 L ${e} ${t*.5} L ${e*.6} ${t} L ${e*.6} ${t*.8} L 0 ${t*.8} Z`},parallelogram:{name:"平行四边形",type:"polygon",style:"polygon(30% 0%, 100% 0%, 70% 100%, 0% 100%)",createPath:(e,t)=>`M ${e*.3} 0 L ${e} 0 L ${e*.7} ${t} L 0 ${t} Z`},parallelogram2:{name:"平行四边形2",type:"polygon",style:"polygon(30% 100%, 100% 100%, 70% 0%, 0% 0%)",createPath:(e,t)=>`M ${e*.3} ${t} L ${e} ${t} L ${e*.7} 0 L 0 0 Z`},trapezoid:{name:"梯形",type:"polygon",style:"polygon(25% 0%, 75% 0%, 100% 100%, 0% 100%)",createPath:(e,t)=>`M ${e*.25} 0 L ${e*.75} 0 L ${e} ${t} L 0 ${t} Z`},trapezoid2:{name:"梯形2",type:"polygon",style:"polygon(0% 0%, 100% 0%, 75% 100%, 25% 100%)",createPath:(e,t)=>`M 0 0 L ${e} 0 L ${e*.75} ${t} L ${e*.25} ${t} Z`}},s5=e=>{const t=Me(()=>{if(!e.value)return K3.rect;const r=e.value.shape||gI.RECT;return K3[r]}),n=Me(()=>{if(!e.value)return{top:"0",left:"0",width:"100%",height:"100%"};const[r,o]=e.value.range,i=(o[0]-r[0])/100,a=(o[1]-r[1])/100,s=r[0]/i,c=r[1]/a;return{left:-s+"%",top:-c+"%",width:100/i+"%",height:100/a+"%"}});return{clipShape:t,imgPosition:n}},AI=e=>({filter:Me(()=>{if(!e.value)return"";let n="";const r=Object.keys(e.value);for(const o of r)n+=`${o}(${e.value[o]}) `;return n})}),Hd=e=>{const t=Me(()=>{var i;return((i=e.value)==null?void 0:i.width)??0}),n=Me(()=>{var i;return((i=e.value)==null?void 0:i.style)||"solid"}),r=Me(()=>{var i;return((i=e.value)==null?void 0:i.color)||"#d14424"}),o=Me(()=>{if(n.value!=="dashed")return"0 0";const i=t.value;return i<=6?`${i*4.5} ${i*2}`:`${i*4} ${i*1.5}`});return{outlineWidth:t,outlineStyle:n,outlineColor:r,strokeDashArray:o}},Ioe=["width","height"],Foe=["rx","ry","width","height","stroke","stroke-width","stroke-dasharray"],_oe=Ie({__name:"ImageRectOutline",props:{width:{},height:{},outline:{},radius:{default:"0"}},setup(e){const t=e,{outlineWidth:n,outlineColor:r,strokeDashArray:o}=Hd(Xd(t,"outline"));return(i,a)=>i.outline?(Y(),q("svg",{key:0,class:"image-rect-outline",overflow:"visible",width:i.width,height:i.height},[W("rect",{"vector-effect":"non-scaling-stroke","stroke-linecap":"butt","stroke-miterlimit":"8",fill:"transparent",rx:i.radius,ry:i.radius,width:i.width,height:i.height,stroke:G(r),"stroke-width":G(n),"stroke-dasharray":G(o)},null,8,Foe)],8,Ioe)):Ze("",!0)}}),Eoe=Ve(_oe,[["__scopeId","data-v-09a0319c"]]),Xoe=["width","height"],Woe=["cx","cy","rx","ry","stroke","stroke-width","stroke-dasharray"],Voe=Ie({__name:"ImageEllipseOutline",props:{width:{},height:{},outline:{}},setup(e){const t=e,{outlineWidth:n,outlineColor:r,strokeDashArray:o}=Hd(Xd(t,"outline"));return(i,a)=>i.outline?(Y(),q("svg",{key:0,class:"image-ellipse-outline",overflow:"visible",width:i.width,height:i.height},[W("ellipse",{"vector-effect":"non-scaling-stroke","stroke-linecap":"butt","stroke-miterlimit":"8",fill:"transparent",cx:i.width/2,cy:i.height/2,rx:i.width/2,ry:i.height/2,stroke:G(r),"stroke-width":G(n),"stroke-dasharray":G(o)},null,8,Woe)],8,Xoe)):Ze("",!0)}}),Uoe=Ve(Voe,[["__scopeId","data-v-19e68d74"]]),Yoe=["width","height"],Qoe=["d","stroke","stroke-width","stroke-dasharray"],Zoe=Ie({__name:"ImagePolygonOutline",props:{width:{},height:{},createPath:{type:Function},outline:{}},setup(e){const t=e,{outlineWidth:n,outlineColor:r,strokeDashArray:o}=Hd(Xd(t,"outline"));return(i,a)=>i.outline?(Y(),q("svg",{key:0,class:"image-polygon-outline",overflow:"visible",width:i.width,height:i.height},[W("path",{"vector-effect":"non-scaling-stroke","stroke-linecap":"butt","stroke-miterlimit":"8",fill:"transparent",d:i.createPath(i.width,i.height),stroke:G(r),"stroke-width":G(n),"stroke-dasharray":G(o)},null,8,Qoe)],8,Yoe)):Ze("",!0)}}),Boe=Ve(Zoe,[["__scopeId","data-v-a036b0a3"]]),Doe={class:"image-outline"},RI=Ie({__name:"index",props:{elementInfo:{}},setup(e){const t=e,n=Me(()=>t.elementInfo.clip),{clipShape:r}=s5(n);return(o,i)=>(Y(),q("div",Doe,[G(r).type==="rect"?(Y(),Te(Eoe,{key:0,width:o.elementInfo.width,height:o.elementInfo.height,radius:G(r).radius,outline:o.elementInfo.outline},null,8,["width","height","radius","outline"])):G(r).type==="ellipse"?(Y(),Te(Uoe,{key:1,width:o.elementInfo.width,height:o.elementInfo.height,outline:o.elementInfo.outline},null,8,["width","height","outline"])):G(r).type==="polygon"?(Y(),Te(Boe,{key:2,width:o.elementInfo.width,height:o.elementInfo.height,outline:o.elementInfo.outline,createPath:G(r).createPath},null,8,["width","height","outline","createPath"])):Ze("",!0)]))}}),yI=e=>(qt("data-v-31b3b0f9"),e=e(),en(),e),Koe=["src"],Hoe=["src"],Goe=["onMousedown"],Joe=yI(()=>W("svg",{width:"16",height:"16",fill:"#fff",stroke:"#333"},[W("path",{"stroke-width":"0.3","shape-rendering":"crispEdges",d:"M 16 0 L 0 0 L 0 16 L 4 16 L 4 4 L 16 4 L 16 0 Z"})],-1)),zoe=[Joe],$oe=["onMousedown"],joe=yI(()=>W("svg",{width:"16",height:"16",fill:"#fff",stroke:"#333"},[W("path",{"stroke-width":"0.3","shape-rendering":"crispEdges",d:"M 16 0 L 0 0 L 0 4 L 16 4 Z"})],-1)),qoe=[joe],eie=Ie({__name:"ImageClipHandler",props:{src:{},clipPath:{},width:{},height:{},top:{},left:{},rotate:{},clipData:{}},emits:["clip"],setup(e,{emit:t}){const n=e,r=t,{canvasScale:o}=Ee(ft()),{ctrlOrShiftKeyActive:i}=Ee(Ss()),a=he({top:"0",left:"0"}),s=he(!1),c=he(null),l=()=>{const[M,w]=n.clipData?n.clipData.range:[[0,0],[100,100]],k=(w[0]-M[0])/100,_=(w[1]-M[1])/100,P=M[0]/k,E=M[1]/_;return{widthScale:k,heightScale:_,left:P,top:E}},u=Me(()=>{const{widthScale:M,heightScale:w,left:k,top:_}=l();return{left:-k,top:-_,width:100/M,height:100/w}}),f=Me(()=>({top:u.value.top+"%",left:u.value.left+"%",width:u.value.width+"%",height:u.value.height+"%"})),d=he({top:0,left:0,width:0,height:0}),h=Me(()=>{const{top:M,left:w,width:k,height:_}=d.value;return{top:M+"%",left:w+"%",width:k+"%",height:_+"%"}}),p=Me(()=>{const M=u.value.width,w=u.value.height,{top:k,left:_,width:P,height:E}=d.value;return{left:-_*(100/P)+"%",top:-k*(100/E)+"%",width:M/P*100+"%",height:w/E*100+"%"}}),m=()=>{const{left:M,top:w}=l();d.value={left:M,top:w,width:100,height:100},a.value={top:-w+"%",left:-M+"%"}},A=()=>{if(s.value)return;if(!c.value){r("clip",null);return}const{left:M,top:w}=l(),k={left:(d.value.left-M)/100*n.width,top:(d.value.top-w)/100*n.height,width:(d.value.width-100)/100*n.width,height:(d.value.height-100)/100*n.height},_={range:c.value,position:k};r("clip",_)},x=M=>{M.key.toUpperCase()===yt.ENTER&&A()};Ht(()=>{m(),document.addEventListener("keydown",x)}),wn(()=>{document.removeEventListener("keydown",x)});const y=()=>{const M={left:parseInt(p.value.left),top:parseInt(p.value.top),width:parseInt(p.value.width),height:parseInt(p.value.height)},w=100/M.width,k=100/M.height,_=[-M.left*w,-M.top*k],P=[w*100+_[0],k*100+_[1]];c.value=[_,P]},R=M=>{s.value=!0;let w=!0;const k=M.pageX,_=M.pageY,P=u.value,E={...d.value};document.onmousemove=I=>{if(!w)return;const F=I.pageX,N=I.pageY,V=(F-k)/o.value,Z=(N-_)/o.value,J=Math.sqrt(V*V+Z*Z),D=Math.atan2(Z,V)-n.rotate/180*Math.PI,Q=J*Math.cos(D)/n.width*100,B=J*Math.sin(D)/n.height*100;let H=E.left+Q,U=E.top+B;H<0?H=0:H+E.width>P.width&&(H=P.width-E.width),U<0?U=0:U+E.height>P.height&&(U=P.height-E.height),d.value={...d.value,left:H,top:U}},document.onmouseup=()=>{w=!1,document.onmousemove=null,document.onmouseup=null,y(),setTimeout(()=>{s.value=!1},0)}},g=(M,w)=>{s.value=!0;let k=!0;const _=50/n.width*100,P=50/n.height*100,E=M.pageX,I=M.pageY,F=u.value,N={...d.value},V=d.value.width/d.value.height;document.onmousemove=Z=>{if(!k)return;const J=Z.pageX,se=Z.pageY,D=(J-E)/o.value,Q=(se-I)/o.value,B=Math.sqrt(D*D+Q*Q),U=Math.atan2(Q,D)-n.rotate/180*Math.PI;let te=B*Math.cos(U)/n.width*100,z=B*Math.sin(U)/n.height*100;i.value&&((w===mt.RIGHT_BOTTOM||w===mt.LEFT_TOP)&&(z=te/V),(w===mt.LEFT_BOTTOM||w===mt.RIGHT_TOP)&&(z=-te/V));let oe,pe,Ae,me;w===mt.LEFT_TOP?(N.left+te<0&&(te=-N.left),N.top+z<0&&(z=-N.top),N.width-te<_&&(te=N.width-_),N.height-zF.width&&(te=F.width-(N.left+N.width)),N.top+z<0&&(z=-N.top),N.width+te<_&&(te=_-N.width),N.height-z
F.height&&(z=F.height-(N.top+N.height)),N.width-te<_&&(te=N.width-_),N.height+z
F.width&&(te=F.width-(N.left+N.width)),N.top+N.height+z>F.height&&(z=F.height-(N.top+N.height)),N.width+te<_&&(te=_-N.width),N.height+z
F.height&&(z=F.height-(N.top+N.height)),N.height+z
F.width&&(te=F.width-(N.left+N.width)),N.width+te<_&&(te=_-N.width),me=N.height,Ae=N.width+te,oe=N.left,pe=N.top),d.value={left:oe,top:pe,width:Ae,height:me}},document.onmouseup=()=>{k=!1,document.onmousemove=null,document.onmouseup=null,y(),setTimeout(()=>s.value=!1,0)}},b=Me(()=>{const M="rotate-",w=n.rotate;return w>-22.5&&w<=22.5?M+0:w>22.5&&w<=67.5?M+45:w>67.5&&w<=112.5?M+90:w>112.5&&w<=157.5?M+135:w>157.5||w<=-157.5?M+0:w>-157.5&&w<=-112.5?M+45:w>-112.5&&w<=-67.5?M+90:w>-67.5&&w<=-22.5?M+135:M+0}),L=[mt.LEFT_TOP,mt.RIGHT_TOP,mt.LEFT_BOTTOM,mt.RIGHT_BOTTOM],T=[mt.TOP,mt.BOTTOM,mt.LEFT,mt.RIGHT];return(M,w)=>{const k=Sn("click-outside");return Ke((Y(),q("div",{class:"image-clip-handler",style:we(a.value)},[W("img",{class:"bottom-img",src:M.src,draggable:!1,alt:"",style:we(f.value)},null,12,Koe),W("div",{class:"top-image-content",style:we({...h.value,clipPath:M.clipPath})},[W("img",{class:"top-img",src:M.src,draggable:!1,alt:"",style:we(p.value)},null,12,Hoe)],4),W("div",{class:"operate",style:we(h.value),onMousedown:w[0]||(w[0]=Wt(_=>R(_),["stop"]))},[(Y(),q(Xe,null,ot(L,_=>W("div",{class:Ge(["clip-point",_,b.value]),key:_,onMousedown:Wt(P=>g(P,_),["stop"])},zoe,42,Goe)),64)),(Y(),q(Xe,null,ot(T,_=>W("div",{class:Ge(["clip-point",_,b.value]),key:_,onMousedown:Wt(P=>g(P,_),["stop"])},qoe,42,$oe)),64))],36)],4)),[[k,A]])}}}),tie=Ve(eie,[["__scopeId","data-v-31b3b0f9"]]),nie=["src"],rie=Ie({__name:"index",props:{elementInfo:{},selectElement:{type:Function},contextmenus:{type:Function}},setup(e){const t=e,n=ft(),r=st(),{clipingImageElementId:o}=Ee(n),i=Me(()=>o.value===t.elementInfo.id),{addHistorySnapshot:a}=Jt(),s=Me(()=>t.elementInfo.shadow),{shadowStyle:c}=wc(s),l=Me(()=>t.elementInfo.flipH),u=Me(()=>t.elementInfo.flipV),{flipStyle:f}=a2(l,u),d=Me(()=>t.elementInfo.clip),{clipShape:h,imgPosition:p}=s5(d),m=Me(()=>t.elementInfo.filters),{filter:A}=AI(m),x=R=>{t.elementInfo.lock||(R.stopPropagation(),t.selectElement(R,t.elementInfo))},y=R=>{if(n.setClipingImageElementId(""),!R)return;const{range:g,position:b}=R,L=t.elementInfo.clip||{shape:"rect",range:[[0,0],[100,100]]},T=t.elementInfo.left+b.left,M=t.elementInfo.top+b.top,w=t.elementInfo.width+b.width,k=t.elementInfo.height+b.height;let _=0,P=0;if(t.elementInfo.rotate){const I=T+w/2-(t.elementInfo.left+t.elementInfo.width/2),F=-(M+k/2-(t.elementInfo.top+t.elementInfo.height/2)),N=-t.elementInfo.rotate*Math.PI/180,V=I*Math.cos(N)-F*Math.sin(N),Z=I*Math.sin(N)+F*Math.cos(N);_=V-I,P=-(Z-F)}const E={clip:{...L,range:g},left:T+_,top:M+P,width:w,height:k};r.updateElement({id:t.elementInfo.id,props:E}),a()};return(R,g)=>{const b=Sn("contextmenu");return Y(),q("div",{class:Ge(["editable-element-image",{lock:R.elementInfo.lock}]),style:we({top:R.elementInfo.top+"px",left:R.elementInfo.left+"px",width:R.elementInfo.width+"px",height:R.elementInfo.height+"px"})},[W("div",{class:"rotate-wrapper",style:we({transform:`rotate(${R.elementInfo.rotate}deg)`})},[i.value?(Y(),Te(tie,{key:0,src:R.elementInfo.src,clipData:R.elementInfo.clip,width:R.elementInfo.width,height:R.elementInfo.height,top:R.elementInfo.top,left:R.elementInfo.left,rotate:R.elementInfo.rotate,clipPath:G(h).style,onClip:g[0]||(g[0]=L=>y(L))},null,8,["src","clipData","width","height","top","left","rotate","clipPath"])):Ke((Y(),q("div",{key:1,class:"element-content",style:we({filter:G(c)?`drop-shadow(${G(c)})`:"",transform:G(f)}),onMousedown:g[2]||(g[2]=L=>x(L)),onTouchstart:g[3]||(g[3]=L=>x(L))},[O(RI,{elementInfo:R.elementInfo},null,8,["elementInfo"]),W("div",{class:"image-content",style:we({clipPath:G(h).style})},[W("img",{src:R.elementInfo.src,draggable:!1,style:we({top:G(p).top,left:G(p).left,width:G(p).width,height:G(p).height,filter:G(A)}),onDragstart:g[1]||(g[1]=Wt(()=>{},["prevent"])),alt:""},null,44,nie),R.elementInfo.colorMask?(Y(),q("div",{key:0,class:"color-mask",style:we({backgroundColor:R.elementInfo.colorMask})},null,4)):Ze("",!0)],4)],36)),[[b,R.contextmenus]])],4)],6)}}}),bI=Ve(rie,[["__scopeId","data-v-d615c21a"]]),oie=["width","height"],iie=["d","stroke","stroke-width","stroke-dasharray"],aie=Ie({__name:"ElementOutline",props:{width:{},height:{},outline:{}},setup(e){const t=e,{outlineWidth:n,outlineColor:r,strokeDashArray:o}=Hd(Xd(t,"outline"));return(i,a)=>i.outline?(Y(),q("svg",{key:0,class:"element-outline",overflow:"visible",width:i.width,height:i.height},[W("path",{"vector-effect":"non-scaling-stroke","stroke-linecap":"butt","stroke-miterlimit":"8",fill:"transparent",d:`M0,0 L${i.width},0 L${i.width},${i.height} L0,${i.height} Z`,stroke:G(r),"stroke-width":G(n),"stroke-dasharray":G(o)},null,8,iie)],8,oie)):Ze("",!0)}}),s2=Ve(aie,[["__scopeId","data-v-e2ef58f5"]]),Co=function(e){for(var t=0;;t++)if(e=e.previousSibling,!e)return t},ip=function(e){let t=e.assignedSlot||e.parentNode;return t&&t.nodeType==11?t.host:t};let UO=null;const Zs=function(e,t,n){let r=UO||(UO=document.createRange());return r.setEnd(e,n??e.nodeValue.length),r.setStart(e,t||0),r},Xu=function(e,t,n,r){return n&&(YO(e,t,n,r,-1)||YO(e,t,n,r,1))},sie=/^(img|br|input|textarea|hr)$/i;function YO(e,t,n,r,o){for(;;){if(e==n&&t==r)return!0;if(t==(o<0?0:is(e))){let i=e.parentNode;if(!i||i.nodeType!=1||l5(e)||sie.test(e.nodeName)||e.contentEditable=="false")return!1;t=Co(e)+(o<0?0:1),e=i}else if(e.nodeType==1){if(e=e.childNodes[t+(o<0?-1:0)],e.contentEditable=="false")return!1;t=o<0?is(e):0}else return!1}}function is(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function lie(e,t,n){for(let r=t==0,o=t==is(e);r||o;){if(e==n)return!0;let i=Co(e);if(e=e.parentNode,!e)return!1;r=r&&i==0,o=o&&i==is(e)}}function l5(e){let t;for(let n=e;n&&!(t=n.pmViewDesc);n=n.parentNode);return t&&t.node&&t.node.isBlock&&(t.dom==e||t.contentDOM==e)}const l2=function(e){return e.focusNode&&Xu(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)};function qc(e,t){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=e,n.key=n.code=t,n}function cie(e){let t=e.activeElement;for(;t&&t.shadowRoot;)t=t.shadowRoot.activeElement;return t}function uie(e,t,n){if(e.caretPositionFromPoint)try{let r=e.caretPositionFromPoint(t,n);if(r)return{node:r.offsetNode,offset:r.offset}}catch{}if(e.caretRangeFromPoint){let r=e.caretRangeFromPoint(t,n);if(r)return{node:r.startContainer,offset:r.startOffset}}}const vs=typeof navigator<"u"?navigator:null,QO=typeof document<"u"?document:null,Lc=vs&&vs.userAgent||"",H3=/Edge\/(\d+)/.exec(Lc),xI=/MSIE \d/.exec(Lc),G3=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Lc),ni=!!(xI||G3||H3),lc=xI?document.documentMode:G3?+G3[1]:H3?+H3[1]:0,Ia=!ni&&/gecko\/(\d+)/i.test(Lc);Ia&&+(/Firefox\/(\d+)/.exec(Lc)||[0,0])[1];const J3=!ni&&/Chrome\/(\d+)/.exec(Lc),po=!!J3,fie=J3?+J3[1]:0,Eo=!ni&&!!vs&&/Apple Computer/.test(vs.vendor),Pd=Eo&&(/Mobile\/\w+/.test(Lc)||!!vs&&vs.maxTouchPoints>2),Ki=Pd||(vs?/Mac/.test(vs.platform):!1),die=vs?/Win/.test(vs.platform):!1,wa=/Android \d/.test(Lc),Yp=!!QO&&"webkitFontSmoothing"in QO.documentElement.style,hie=Yp?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function pie(e){return{left:0,right:e.documentElement.clientWidth,top:0,bottom:e.documentElement.clientHeight}}function Ws(e,t){return typeof e=="number"?e:e[t]}function mie(e){let t=e.getBoundingClientRect(),n=t.width/e.offsetWidth||1,r=t.height/e.offsetHeight||1;return{left:t.left,right:t.left+e.clientWidth*n,top:t.top,bottom:t.top+e.clientHeight*r}}function ZO(e,t,n){let r=e.someProp("scrollThreshold")||0,o=e.someProp("scrollMargin")||5,i=e.dom.ownerDocument;for(let a=n||e.dom;a;a=ip(a)){if(a.nodeType!=1)continue;let s=a,c=s==i.body,l=c?pie(i):mie(s),u=0,f=0;if(t.topl.bottom-Ws(r,"bottom")&&(f=t.bottom-t.top>l.bottom-l.top?t.top+Ws(o,"top")-l.top:t.bottom-l.bottom+Ws(o,"bottom")),t.leftl.right-Ws(r,"right")&&(u=t.right-l.right+Ws(o,"right")),u||f)if(c)i.defaultView.scrollBy(u,f);else{let d=s.scrollLeft,h=s.scrollTop;f&&(s.scrollTop+=f),u&&(s.scrollLeft+=u);let p=s.scrollLeft-d,m=s.scrollTop-h;t={left:t.left-p,top:t.top-m,right:t.right-p,bottom:t.bottom-m}}if(c||/^(fixed|sticky)$/.test(getComputedStyle(a).position))break}}function vie(e){let t=e.dom.getBoundingClientRect(),n=Math.max(0,t.top),r,o;for(let i=(t.left+t.right)/2,a=n+1;a=n-20){r=s,o=c.top;break}}return{refDOM:r,refTop:o,stack:SI(e.dom)}}function SI(e){let t=[],n=e.ownerDocument;for(let r=e;r&&(t.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),e!=n);r=ip(r));return t}function gie({refDOM:e,refTop:t,stack:n}){let r=e?e.getBoundingClientRect().top:0;MI(n,r==0?0:r-t)}function MI(e,t){for(let n=0;n=s){a=Math.max(p.bottom,a),s=Math.min(p.top,s);let m=p.left>t.left?p.left-t.left:p.right=(p.left+p.right)/2?1:0));continue}}else p.top>t.top&&!c&&p.left<=t.left&&p.right>=t.left&&(c=u,l={left:Math.max(p.left,Math.min(p.right,t.left)),top:p.top});!n&&(t.left>=p.right&&t.top>=p.top||t.left>=p.left&&t.top>=p.bottom)&&(i=f+1)}}return!n&&c&&(n=c,o=l,r=0),n&&n.nodeType==3?Rie(n,o):!n||r&&n.nodeType==1?{node:e,offset:i}:wI(n,o)}function Rie(e,t){let n=e.nodeValue.length,r=document.createRange();for(let o=0;o=(i.left+i.right)/2?1:0)}}return{node:e,offset:0}}function c5(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function yie(e,t){let n=e.parentNode;return n&&/^li$/i.test(n.nodeName)&&t.left(a.left+a.right)/2?1:-1}return e.docView.posFromDOM(r,o,i)}function xie(e,t,n,r){let o=-1;for(let i=t,a=!1;i!=e.dom;){let s=e.docView.nearestDesc(i,!0);if(!s)return null;if(s.dom.nodeType==1&&(s.node.isBlock&&s.parent&&!a||!s.contentDOM)){let c=s.dom.getBoundingClientRect();if(s.node.isBlock&&s.parent&&!a&&(a=!0,c.left>r.left||c.top>r.top?o=s.posBefore:(c.right-1?o:e.docView.posFromDOM(t,n,-1)}function LI(e,t,n){let r=e.childNodes.length;if(r&&n.topt.top&&o++}let l;Yp&&o&&r.nodeType==1&&(l=r.childNodes[o-1]).nodeType==1&&l.contentEditable=="false"&&l.getBoundingClientRect().top>=t.top&&o--,r==e.dom&&o==r.childNodes.length-1&&r.lastChild.nodeType==1&&t.top>r.lastChild.getBoundingClientRect().bottom?s=e.state.doc.content.size:(o==0||r.nodeType!=1||r.childNodes[o-1].nodeName!="BR")&&(s=xie(e,r,o,t))}s==null&&(s=bie(e,a,t));let c=e.docView.nearestDesc(a,!0);return{pos:s,inside:c?c.posAtStart-c.border:-1}}function BO(e){return e.top=0&&o==r.nodeValue.length?(c--,u=1):n<0?c--:l++,A0(Wl(Zs(r,c,l),u),u<0)}if(!e.state.doc.resolve(t-(i||0)).parent.inlineContent){if(i==null&&o&&(n<0||o==is(r))){let c=r.childNodes[o-1];if(c.nodeType==1)return Vy(c.getBoundingClientRect(),!1)}if(i==null&&o=0)}if(i==null&&o&&(n<0||o==is(r))){let c=r.childNodes[o-1],l=c.nodeType==3?Zs(c,is(c)-(a?0:1)):c.nodeType==1&&(c.nodeName!="BR"||!c.nextSibling)?c:null;if(l)return A0(Wl(l,1),!1)}if(i==null&&o=0)}function A0(e,t){if(e.width==0)return e;let n=t?e.left:e.right;return{top:e.top,bottom:e.bottom,left:n,right:n}}function Vy(e,t){if(e.height==0)return e;let n=t?e.top:e.bottom;return{top:n,bottom:n,left:e.left,right:e.right}}function TI(e,t,n){let r=e.state,o=e.root.activeElement;r!=t&&e.updateState(t),o!=e.dom&&e.focus();try{return n()}finally{r!=t&&e.updateState(r),o!=e.dom&&o&&o.focus()}}function wie(e,t,n){let r=t.selection,o=n=="up"?r.$from:r.$to;return TI(e,t,()=>{let{node:i}=e.docView.domFromPos(o.pos,n=="up"?-1:1);for(;;){let s=e.docView.nearestDesc(i,!0);if(!s)break;if(s.node.isBlock){i=s.contentDOM||s.dom;break}i=s.dom.parentNode}let a=OI(e,o.pos,1);for(let s=i.firstChild;s;s=s.nextSibling){let c;if(s.nodeType==1)c=s.getClientRects();else if(s.nodeType==3)c=Zs(s,0,s.nodeValue.length).getClientRects();else continue;for(let l=0;lu.top+1&&(n=="up"?a.top-u.top>(u.bottom-a.top)*2:u.bottom-a.bottom>(a.bottom-u.top)*2))return!1}}return!0})}const Lie=/[\u0590-\u08ac]/;function Oie(e,t,n){let{$head:r}=t.selection;if(!r.parent.isTextblock)return!1;let o=r.parentOffset,i=!o,a=o==r.parent.content.size,s=e.domSelection();return!Lie.test(r.parent.textContent)||!s.modify?n=="left"||n=="backward"?i:a:TI(e,t,()=>{let{focusNode:c,focusOffset:l,anchorNode:u,anchorOffset:f}=e.domSelectionRange(),d=s.caretBidiLevel;s.modify("move",n,"character");let h=r.depth?e.docView.domAfterPos(r.before()):e.dom,{focusNode:p,focusOffset:m}=e.domSelectionRange(),A=p&&!h.contains(p.nodeType==1?p:p.parentNode)||c==p&&l==m;try{s.collapse(u,f),c&&(c!=u||l!=f)&&s.extend&&s.extend(c,l)}catch{}return d!=null&&(s.caretBidiLevel=d),A})}let DO=null,KO=null,HO=!1;function Tie(e,t,n){return DO==t&&KO==n?HO:(DO=t,KO=n,HO=n=="up"||n=="down"?wie(e,t,n):Oie(e,t,n))}const ji=0,GO=1,ou=2,gs=3;class Qp{constructor(t,n,r,o){this.parent=t,this.children=n,this.dom=r,this.contentDOM=o,this.dirty=ji,r.pmViewDesc=this}matchesWidget(t){return!1}matchesMark(t){return!1}matchesNode(t,n,r){return!1}matchesHack(t){return!1}parseRule(){return null}stopEvent(t){return!1}get size(){let t=0;for(let n=0;nCo(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))o=t.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(n==0)for(let i=t;;i=i.parentNode){if(i==this.dom){o=!1;break}if(i.previousSibling)break}if(o==null&&n==t.childNodes.length)for(let i=t;;i=i.parentNode){if(i==this.dom){o=!0;break}if(i.nextSibling)break}}return o??r>0?this.posAtEnd:this.posAtStart}nearestDesc(t,n=!1){for(let r=!0,o=t;o;o=o.parentNode){let i=this.getDesc(o),a;if(i&&(!n||i.node))if(r&&(a=i.nodeDOM)&&!(a.nodeType==1?a.contains(t.nodeType==1?t:t.parentNode):a==t))r=!1;else return i}}getDesc(t){let n=t.pmViewDesc;for(let r=n;r;r=r.parent)if(r==this)return n}posFromDOM(t,n,r){for(let o=t;o;o=o.parentNode){let i=this.getDesc(o);if(i)return i.localPosFromDOM(t,n,r)}return-1}descAt(t){for(let n=0,r=0;nt||a instanceof NI){o=t-i;break}i=s}if(o)return this.children[r].domFromPos(o-this.children[r].border,n);for(let i;r&&!(i=this.children[r-1]).size&&i instanceof kI&&i.side>=0;r--);if(n<=0){let i,a=!0;for(;i=r?this.children[r-1]:null,!(!i||i.dom.parentNode==this.contentDOM);r--,a=!1);return i&&n&&a&&!i.border&&!i.domAtom?i.domFromPos(i.size,n):{node:this.contentDOM,offset:i?Co(i.dom)+1:0}}else{let i,a=!0;for(;i=r=u&&n<=l-c.border&&c.node&&c.contentDOM&&this.contentDOM.contains(c.contentDOM))return c.parseRange(t,n,u);t=a;for(let f=s;f>0;f--){let d=this.children[f-1];if(d.size&&d.dom.parentNode==this.contentDOM&&!d.emptyChildAt(1)){o=Co(d.dom)+1;break}t-=d.size}o==-1&&(o=0)}if(o>-1&&(l>n||s==this.children.length-1)){n=l;for(let u=s+1;uh&&ae.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&m[1]!==void 0?m[1]:{},n=tc(tc({},{slideFactor:96/914400,fontsizeFactor:100/75}),n),r=[],A.next=6,Pte.loadAsync(t);case 6:return o=A.sent,A.next=9,rne(o);case 9:return i=A.sent,A.next=12,one(o,n);case 12:return a=A.sent,s=a.width,c=a.height,l=a.defaultTextStyle,A.next=18,ine(o);case 18:u=A.sent,f=Po(i.slides),A.prev=20,f.s();case 22:if((d=f.n()).done){A.next=30;break}return h=d.value,A.next=26,ane(o,h,u,l,n);case 26:p=A.sent,r.push(p);case 28:A.next=22;break;case 30:A.next=35;break;case 32:A.prev=32,A.t0=A.catch(20),f.e(A.t0);case 35:return A.prev=35,f.f(),A.finish(35);case 38:return A.abrupt("return",{slides:r,size:{width:s,height:c}});case 39:case"end":return A.stop()}},e,null,[[20,32,35,38]])})),_3.apply(this,arguments)}function rne(e){return QC.apply(this,arguments)}function QC(){return(QC=ii(Wn.mark(function e(t){var n,r,o,i,a,s,c,l;return Wn.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return u.next=2,Lo(t,"[Content_Types].xml");case 2:n=u.sent,r=n.Types.Override,o=[],i=[],a=Po(r),u.prev=7,a.s();case 9:if((s=a.n()).done){u.next=20;break}c=s.value,u.t0=c.attrs.ContentType,u.next=u.t0==="application/vnd.openxmlformats-officedocument.presentationml.slide+xml"?14:u.t0==="application/vnd.openxmlformats-officedocument.presentationml.slideLayout+xml"?16:18;break;case 14:return o.push(c.attrs.PartName.substr(1)),u.abrupt("break",18);case 16:return i.push(c.attrs.PartName.substr(1)),u.abrupt("break",18);case 18:u.next=9;break;case 20:u.next=25;break;case 22:u.prev=22,u.t1=u.catch(7),a.e(u.t1);case 25:return u.prev=25,a.f(),u.finish(25);case 28:return l=function(f,d){return+/(\d+)\.xml/.exec(f)[1]-+/(\d+)\.xml/.exec(d)[1]},o=o.sort(l),i=i.sort(l),u.abrupt("return",{slides:o,slideLayouts:i});case 32:case"end":return u.stop()}},e,null,[[7,22,25,28]])}))).apply(this,arguments)}function one(e,t){return ZC.apply(this,arguments)}function ZC(){return(ZC=ii(Wn.mark(function e(t,n){var r,o,i;return Wn.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,Lo(t,"ppt/presentation.xml");case 2:return r=a.sent,o=r["p:presentation"]["p:sldSz"].attrs,i=r["p:presentation"]["p:defaultTextStyle"],a.abrupt("return",{width:parseInt(o.cx)*n.slideFactor,height:parseInt(o.cy)*n.slideFactor,defaultTextStyle:i});case 6:case"end":return a.stop()}},e)}))).apply(this,arguments)}function ine(e){return BC.apply(this,arguments)}function BC(){return(BC=ii(Wn.mark(function e(t){var n,r,o,i,a,s;return Wn.wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return c.next=2,Lo(t,"ppt/_rels/presentation.xml.rels");case 2:if(n=c.sent,(r=n.Relationships.Relationship).constructor!==Array){c.next=25;break}i=Po(r),c.prev=6,i.s();case 8:if((a=i.n()).done){c.next=15;break}if((s=a.value).attrs.Type!=="http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme"){c.next=13;break}return o=s.attrs.Target,c.abrupt("break",15);case 13:c.next=8;break;case 15:c.next=20;break;case 17:c.prev=17,c.t0=c.catch(6),i.e(c.t0);case 20:return c.prev=20,i.f(),c.finish(20);case 23:c.next=26;break;case 25:r.attrs.Type==="http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme"&&(o=r.attrs.Target);case 26:if(o){c.next=28;break}throw Error("Can't open theme file.");case 28:return c.next=30,Lo(t,"ppt/"+o);case 30:return c.abrupt("return",c.sent);case 31:case"end":return c.stop()}},e,null,[[6,17,20,23]])}))).apply(this,arguments)}function ane(e,t,n,r,o){return E3.apply(this,arguments)}function E3(){return E3=ii(Wn.mark(function e(t,n,r,o,i){var a,s,c,l,u,f,d,h,p,m,A,x,y,R,g,b,L,T,M,w,k,_,P,E,I,F,N,V,Z,J,se,D,Q,B,H,U,te,z,oe,pe,Ae,me,$,ue,X,ne,le,j,ee,ae,ge,ce,ve,ye,_e,Se;return Wn.wrap(function(be){for(;;)switch(be.prev=be.next){case 0:return a=n.replace("slides/slide","slides/_rels/slide")+".rels",be.next=3,Lo(t,a);case 3:if(s=be.sent,c=s.Relationships.Relationship,l="",u="",f={},c.constructor!==Array){be.next=35;break}d=Po(c),be.prev=10,d.s();case 12:if((h=d.n()).done){be.next=25;break}p=h.value,be.t0=p.attrs.Type,be.next=be.t0==="http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideLayout"?17:be.t0==="http://schemas.microsoft.com/office/2007/relationships/diagramDrawing"?19:(be.t0==="http://schemas.openxmlformats.org/officeDocument/2006/relationships/notesSlide"||be.t0==="http://schemas.openxmlformats.org/officeDocument/2006/relationships/image"||be.t0==="http://schemas.openxmlformats.org/officeDocument/2006/relationships/chart"||be.t0,22);break;case 17:return l=p.attrs.Target.replace("../","ppt/"),be.abrupt("break",23);case 19:return u=p.attrs.Target.replace("../","ppt/"),f[p.attrs.Id]={type:p.attrs.Type.replace("http://schemas.openxmlformats.org/officeDocument/2006/relationships/",""),target:p.attrs.Target.replace("../","ppt/")},be.abrupt("break",23);case 22:f[p.attrs.Id]={type:p.attrs.Type.replace("http://schemas.openxmlformats.org/officeDocument/2006/relationships/",""),target:p.attrs.Target.replace("../","ppt/")};case 23:be.next=12;break;case 25:be.next=30;break;case 27:be.prev=27,be.t1=be.catch(10),d.e(be.t1);case 30:return be.prev=30,d.f(),be.finish(30);case 33:be.next=36;break;case 35:l=c.attrs.Target.replace("../","ppt/");case 36:return be.next=38,Lo(t,l);case 38:return m=be.sent,be.next=41,RO(m);case 41:return A=be.sent,x=l.replace("slideLayouts/slideLayout","slideLayouts/_rels/slideLayout")+".rels",be.next=45,Lo(t,x);case 45:if(y=be.sent,c=y.Relationships.Relationship,R="",g={},c.constructor!==Array){be.next=73;break}b=Po(c),be.prev=51,b.s();case 53:if((L=b.n()).done){be.next=63;break}T=L.value,be.t2=T.attrs.Type,be.next=be.t2==="http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideMaster"?58:60;break;case 58:return R=T.attrs.Target.replace("../","ppt/"),be.abrupt("break",61);case 60:g[T.attrs.Id]={type:T.attrs.Type.replace("http://schemas.openxmlformats.org/officeDocument/2006/relationships/",""),target:T.attrs.Target.replace("../","ppt/")};case 61:be.next=53;break;case 63:be.next=68;break;case 65:be.prev=65,be.t3=be.catch(51),b.e(be.t3);case 68:return be.prev=68,b.f(),be.finish(68);case 71:be.next=74;break;case 73:R=c.attrs.Target.replace("../","ppt/");case 74:return be.next=76,Lo(t,R);case 76:return M=be.sent,w=Ue(M,["p:sldMaster","p:txStyles"]),k=RO(M),_=R.replace("slideMasters/slideMaster","slideMasters/_rels/slideMaster")+".rels",be.next=82,Lo(t,_);case 82:if(P=be.sent,c=P.Relationships.Relationship,E="",I={},c.constructor!==Array){be.next=109;break}F=Po(c),be.prev=88,F.s();case 90:if((N=F.n()).done){be.next=99;break}V=N.value,be.t4=V.attrs.Type,be.next=be.t4==="http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme"?95:96;break;case 95:return be.abrupt("break",97);case 96:I[V.attrs.Id]={type:V.attrs.Type.replace("http://schemas.openxmlformats.org/officeDocument/2006/relationships/",""),target:V.attrs.Target.replace("../","ppt/")};case 97:be.next=90;break;case 99:be.next=104;break;case 101:be.prev=101,be.t5=be.catch(88),F.e(be.t5);case 104:return be.prev=104,F.f(),be.finish(104);case 107:be.next=110;break;case 109:E=c.attrs.Target.replace("../","ppt/");case 110:if(Z={},!E){be.next=118;break}return J=E.split("/").pop(),se=E.replace(J,"_rels/"+J)+".rels",be.next=116,Lo(t,se);case 116:if((D=be.sent)&&(c=D.Relationships.Relationship))if(c.constructor===Array){Q=Po(c);try{for(Q.s();!(B=Q.n()).done;)H=B.value,Z[H.attrs.Id]={type:H.attrs.Type.replace("http://schemas.openxmlformats.org/officeDocument/2006/relationships/",""),target:H.attrs.Target.replace("../","ppt/")}}catch(ut){Q.e(ut)}finally{Q.f()}}else Z[c.attrs.Id]={type:c.attrs.Type.replace("http://schemas.openxmlformats.org/officeDocument/2006/relationships/",""),target:c.attrs.Target.replace("../","ppt/")};case 118:if(U={},te={},!u){be.next=131;break}return z=u.split("/").pop(),oe=u.replace(z,"_rels/"+z)+".rels",be.next=125,Lo(t,u);case 125:return(te=be.sent)&&te&&te&&(pe=(pe=JSON.stringify(te)).replace(/dsp:/g,"p:"),te=JSON.parse(pe)),be.next=129,Lo(t,oe);case 129:if(Ae=be.sent)if((c=Ae.Relationships.Relationship).constructor===Array){me=Po(c);try{for(me.s();!($=me.n()).done;)ue=$.value,U[ue.attrs.Id]={type:ue.attrs.Type.replace("http://schemas.openxmlformats.org/officeDocument/2006/relationships/",""),target:ue.attrs.Target.replace("../","ppt/")}}catch(ut){me.e(ut)}finally{me.f()}}else U[c.attrs.Id]={type:c.attrs.Type.replace("http://schemas.openxmlformats.org/officeDocument/2006/relationships/",""),target:c.attrs.Target.replace("../","ppt/")};case 131:return be.next=133,Lo(t,"ppt/tableStyles.xml");case 133:return X=be.sent,be.next=136,Lo(t,n);case 136:return ne=be.sent,le=ne["p:sld"]["p:cSld"]["p:spTree"],j={zip:t,slideLayoutContent:m,slideLayoutTables:A,slideMasterContent:M,slideMasterTables:k,slideContent:ne,tableStyles:X,slideResObj:f,slideMasterTextStyles:w,layoutResObj:g,masterResObj:I,themeContent:r,themeResObj:Z,digramFileContent:te,diagramResObj:U,defaultTextStyle:o,options:i},be.next=141,$te(j);case 141:ee=be.sent,ae=[],be.t6=Wn.keys(le);case 144:if((be.t7=be.t6()).done){be.next=174;break}if(ge=be.t7.value,le[ge].constructor!==Array){be.next=168;break}ce=Po(le[ge]),be.prev=148,ce.s();case 150:if((ve=ce.n()).done){be.next=158;break}return ye=ve.value,be.next=154,jv(ge,ye,j,"slide");case 154:(_e=be.sent)&&ae.push(_e);case 156:be.next=150;break;case 158:be.next=163;break;case 160:be.prev=160,be.t8=be.catch(148),ce.e(be.t8);case 163:return be.prev=163,ce.f(),be.finish(163);case 166:be.next=172;break;case 168:return be.next=170,jv(ge,le[ge],j,"slide");case 170:(Se=be.sent)&&ae.push(Se);case 172:be.next=144;break;case 174:return be.abrupt("return",{fill:ee,elements:ae});case 175:case"end":return be.stop()}},e,null,[[10,27,30,33],[51,65,68,71],[88,101,104,107],[148,160,163,166]])})),E3.apply(this,arguments)}function RO(e){var t=e[Object.keys(e)[0]]["p:cSld"]["p:spTree"],n={},r={},o={};for(var i in t)if(i!=="p:nvGrpSpPr"&&i!=="p:grpSpPr"){var a=t[i];if(a.constructor===Array){var s,c=Po(a);try{for(c.s();!(s=c.n()).done;){var l=s.value,u=l["p:nvSpPr"],f=Ue(u,["p:cNvPr","attrs","id"]),d=Ue(u,["p:nvPr","p:ph","attrs","idx"]),h=Ue(u,["p:nvPr","p:ph","attrs","type"]);f&&(n[f]=l),d&&(r[d]=l),h&&(o[h]=l)}}catch(y){c.e(y)}finally{c.f()}}else{var p=a["p:nvSpPr"],m=Ue(p,["p:cNvPr","attrs","id"]),A=Ue(p,["p:nvPr","p:ph","attrs","idx"]),x=Ue(p,["p:nvPr","p:ph","attrs","type"]);m&&(n[m]=a),A&&(r[A]=a),x&&(o[x]=a)}}return{idTable:n,idxTable:r,typeTable:o}}function jv(e,t,n,r){return DC.apply(this,arguments)}function DC(){return(DC=ii(Wn.mark(function e(t,n,r,o){var i;return Wn.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:a.t0=t,a.next=a.t0==="p:sp"?3:a.t0==="p:cxnSp"?5:a.t0==="p:pic"?7:a.t0==="p:graphicFrame"?9:a.t0==="p:grpSp"?13:a.t0==="mc:AlternateContent"?17:21;break;case 3:return i=KC(n,r,o),a.abrupt("break",21);case 5:return i=sne(n,r),a.abrupt("break",21);case 7:return i=lne(n,r,o),a.abrupt("break",21);case 9:return a.next=11,cne(n,r,o);case 11:case 15:case 19:return i=a.sent,a.abrupt("break",21);case 13:return a.next=15,X3(n,r,o);case 17:return a.next=19,X3(Ue(n,["mc:Fallback"]),r,o);case 21:return a.abrupt("return",i);case 22:case"end":return a.stop()}},e)}))).apply(this,arguments)}function X3(e,t,n){return W3.apply(this,arguments)}function W3(){return W3=ii(Wn.mark(function e(t,n,r){var o,i,a,s,c,l,u,f,d,h,p,m,A,x,y,R,g,b;return Wn.wrap(function(L){for(;;)switch(L.prev=L.next){case 0:if(o=Ue(t,["p:grpSpPr","a:xfrm"])){L.next=3;break}return L.abrupt("return",null);case 3:i=parseInt(o["a:off"].attrs.x)*n.options.slideFactor,a=parseInt(o["a:off"].attrs.y)*n.options.slideFactor,s=parseInt(o["a:chOff"].attrs.x)*n.options.slideFactor,c=parseInt(o["a:chOff"].attrs.y)*n.options.slideFactor,l=parseInt(o["a:ext"].attrs.cx)*n.options.slideFactor,u=parseInt(o["a:ext"].attrs.cy)*n.options.slideFactor,f=parseInt(o["a:chExt"].attrs.cx)*n.options.slideFactor,d=parseInt(o["a:chExt"].attrs.cy)*n.options.slideFactor,h=l/f,p=u/d,m=[],L.t0=Wn.keys(t);case 15:if((L.t1=L.t0()).done){L.next=45;break}if(A=L.t1.value,t[A].constructor!==Array){L.next=39;break}x=Po(t[A]),L.prev=19,x.s();case 21:if((y=x.n()).done){L.next=29;break}return R=y.value,L.next=25,jv(A,R,n,r);case 25:(g=L.sent)&&m.push(g);case 27:L.next=21;break;case 29:L.next=34;break;case 31:L.prev=31,L.t2=L.catch(19),x.e(L.t2);case 34:return L.prev=34,x.f(),L.finish(34);case 37:L.next=43;break;case 39:return L.next=41,jv(A,t[A],n,r);case 41:(b=L.sent)&&m.push(b);case 43:L.next=15;break;case 45:return L.abrupt("return",{type:"group",top:parseFloat(a.toFixed(2)),left:parseFloat(i.toFixed(2)),width:parseFloat(l.toFixed(2)),height:parseFloat(u.toFixed(2)),elements:m.map(function(T){return tc(tc({},T),{},{left:parseFloat(((T.left-s)*h).toFixed(2)),top:parseFloat(((T.top-c)*p).toFixed(2)),width:parseFloat((T.width*h).toFixed(2)),height:parseFloat((T.height*p).toFixed(2))})})});case 46:case"end":return L.stop()}},e,null,[[19,31,34,37]])})),W3.apply(this,arguments)}function KC(e,t,n){var r,o,i=Ue(e,["p:nvSpPr","p:cNvPr","attrs","name"]),a=Ue(e,["p:nvSpPr","p:nvPr","p:ph","attrs","idx"]),s=Ue(e,["p:nvSpPr","p:nvPr","p:ph","attrs","type"]);return s?(r=t.slideLayoutTables.typeTable[s],o=t.slideMasterTables.typeTable[s]):a&&(r=t.slideLayoutTables.idxTable[a],o=t.slideMasterTables.idxTable[a]),s||Ue(e,["p:nvSpPr","p:cNvSpPr","attrs","txBox"])==="1"&&(s="text"),s||(s=Ue(r,["p:nvSpPr","p:nvPr","p:ph","attrs","type"])),s||(s=Ue(o,["p:nvSpPr","p:nvPr","p:ph","attrs","type"])),s||(s=n==="diagramBg"?"diagram":"obj"),HC(e,r,o,i,s,t)}function sne(e,t){return HC(e,void 0,void 0,e["p:nvCxnSpPr"]["p:cNvPr"].attrs.name,e["p:nvCxnSpPr"]["p:nvPr"]["p:ph"]===void 0?void 0:e["p:nvSpPr"]["p:nvPr"]["p:ph"].attrs.type,t)}function HC(e,t,n,r,o,i){var a,s=["p:spPr","a:xfrm"],c=Ue(e,s),l=Ue(t,s),u=Ue(n,s),f=Ue(e,["p:spPr","a:prstGeom","attrs","prst"]),d=Ue(e,["p:spPr","a:custGeom"]),h=Xp(c,l,u,i.options.slideFactor),p=h.top,m=h.left,A=Wp(c,l,u,i.options.slideFactor),x=A.width,y=A.height,R=Ue(c,["attrs","flipV"])==="1",g=Ue(c,["attrs","flipH"])==="1",b=$v(Ue(c,["attrs","rot"])),L=Ue(e,["p:txXfrm"]);if(L){var T=Ue(L,["attrs","rot"]);T&&(a=$v(T)+90)}else a=b;var M="";e["p:txBody"]&&(M=J0(e["p:txBody"],e,t,o,i));var w,k=function(Q,B,H){var U=Q["p:spPr"]["a:ln"],te=parseInt(Ue(U,["attrs","w"]))/12700;isNaN(te)&&(te=U||B==="text"?0:1);var z=Ue(U,["a:solidFill","a:srgbClr","attrs","val"]);if(!z){var oe=Ue(U,["a:solidFill","a:schemeClr"]);z=G0("a:"+Ue(oe,["attrs","val"]),H)}if(!z){var pe=Ue(Q,["p:style","a:lnRef","a:schemeClr"]);if(z=G0("a:"+Ue(pe,["attrs","val"]),H)){var Ae=Ue(pe,["a:shade","attrs","val"]);if(Ae){Ae=parseInt(Ae)/1e5;var me=dt("#"+z).toHsl();z=dt({h:me.h,s:me.s,l:me.l*Ae,a:me.a}).toHex()}}}z=z?"#".concat(z):"#000";var $="solid",ue="0";switch(Ue(U,["a:prstDash","attrs","val"])){case"solid":$="solid",ue="0";break;case"dash":$="dashed",ue="5";break;case"dashDot":$="dashed",ue="5, 5, 1, 5";break;case"dot":$="dotted",ue="1, 5";break;case"lgDash":$="dashed",ue="10, 5";break;case"lgDashDotDot":$="dotted",ue="10, 5, 1, 5, 1, 5";break;case"sysDash":$="dashed",ue="5, 2";break;case"sysDashDot":$="dotted",ue="5, 2, 1, 5";break;case"sysDashDotDot":$="dotted",ue="5, 2, 1, 5, 1, 5";break;case"sysDot":$="dotted",ue="2, 5"}return{borderColor:z,borderWidth:te,borderType:$,strokeDasharray:ue}}(e,o,i),_=k.borderColor,P=k.borderWidth,E=k.borderType,I=k.strokeDasharray,F=function(Q,B,H){if(Ue(Q,["p:spPr","a:noFill"]))return B?"none":"";var U;if(U||(U=Ue(Q,["p:spPr","a:solidFill","a:srgbClr","attrs","val"])),U||(U=G0("a:"+Ue(Q,["p:spPr","a:solidFill","a:schemeClr","attrs","val"]),H)),U||(U=G0("a:"+Ue(Q,["p:style","a:fillRef","a:schemeClr","attrs","val"]),H)),U){U="#".concat(U);var te=parseInt(Ue(Q,["p:spPr","a:solidFill","a:schemeClr","a:lumMod","attrs","val"]))/1e5,z=parseInt(Ue(Q,["p:spPr","a:solidFill","a:schemeClr","a:lumOff","attrs","val"]))/1e5;isNaN(te)&&(te=1),isNaN(z)&&(z=0);var oe=dt(U).toHsl(),pe=oe.l*te+z;return dt({h:oe.h,s:oe.s,l:pe,a:oe.a}).toHexString()}return B?"none":U}(e,void 0,i)||"",N=Ue(e,["p:spPr","a:effectLst","a:outerShdw"]);N&&(w=YC(N,i));var V=function(Q,B,H){var U=Ue(Q,["p:txBody","a:bodyPr","attrs","anchor"]);return U||(U=Ue(B,["p:txBody","a:bodyPr","attrs","anchor"]))||(U=Ue(H,["p:txBody","a:bodyPr","attrs","anchor"]))||(U="t"),U==="ctr"?"mid":U==="b"?"down":"up"}(e,t,n),Z=Ue(e,["p:txBody","a:bodyPr","attrs","vert"])==="eaVert",J={left:m,top:p,width:x,height:y,borderColor:_,borderWidth:P,borderType:E,borderStrokeDasharray:I,fillColor:F,content:M,isFlipV:R,isFlipH:g,rotate:b,vAlign:V,name:r};if(w&&(J.shadow=w),d&&o!=="diagram"){var se=Ue(c,["a:ext","attrs"]),D=function(Q,B,H){var U=Ue(Q,["a:pathLst"]),te=Ue(U,["a:path"]);Array.isArray(te)&&(te=te.pop());var z=parseInt(te.attrs.w),oe=parseInt(te.attrs.h),pe=z===0?0:1/z*B,Ae=oe===0?0:1/oe*H,me="",$=Ue(te,["a:moveTo"]),ue=te["a:lnTo"],X=te["a:cubicBezTo"],ne=te["a:arcTo"],le=Ue(te,["a:close"]);Array.isArray($)||($=[$]);var j=[];if($.length>0){if(Object.keys($).forEach(function(Be){var qe=$[Be]["a:pt"];qe&&Object.keys(qe).forEach(function(ke){var Qe=qe[ke],et=Qe.x,bt=Qe.y,ct=Qe.order;j.push({type:"movto",x:et,y:bt,order:ct})})}),ue&&Object.keys(ue).forEach(function(Be){var qe=ue[Be]["a:pt"];qe&&Object.keys(qe).forEach(function(ke){var Qe=qe[ke],et=Qe.x,bt=Qe.y,ct=Qe.order;j.push({type:"lnto",x:et,y:bt,order:ct})})}),X){var ee=[];Array.isArray(X)||(X=[X]),Object.keys(X).forEach(function(Be){ee.push(X[Be]["a:pt"])}),ee.forEach(function(Be){var qe=[];Be.forEach(function(Qe){var et={x:Qe.attrs.x,y:Qe.attrs.y};qe.push(et)});var ke=Be[0].attrs.order;j.push({type:"cubicBezTo",cubBzPt:qe,order:ke})})}if(ne){var ae=ne.attrs,ge=ae.order,ce=ae.hR,ve=ae.wR,ye=ae.stAng,_e=ae.swAng,Se=0,be=0,ut=Ue(ne,["a:pt","attrs"]);ut&&(Se=ut.x,be=ut.y),j.push({type:"arcTo",hR:ce,wR:ve,stAng:ye,swAng:_e,shftX:Se,shftY:be,order:ge})}le&&(Array.isArray(le)||(le=[le]),Object.keys(le).forEach(function(){j.push({type:"close",order:1/0})})),j.sort(function(Be,qe){return Be.order-qe.order});for(var tt=0;tt{const e=st(),{theme:t}=Ee(st()),{addSlidesFromData:n,isEmptySlide:r}=Dg(),o=he(!1),i=(c,l=!1)=>{const u=c[0],f=new FileReader;f.addEventListener("load",()=>{try{const d=JSON.parse(HP(f.result));l||r.value?e.setSlides(d):n(d)}catch{xn.error("无法正确读取 / 解析该文件")}}),f.readAsText(u)},a=c=>{let l=[0,0],u=[0,0];return!c.isFlipV&&!c.isFlipH?(l=[0,0],u=[c.width,c.height]):c.isFlipV&&c.isFlipH?(l=[c.width,c.height],u=[0,0]):c.isFlipV&&!c.isFlipH?(l=[0,c.height],u=[c.width,0]):(l=[c.width,0],u=[0,c.height]),{type:"line",id:pn(10),width:c.borderWidth||1,left:c.left,top:c.top,start:l,end:u,style:c.borderType==="solid"?"solid":"dashed",color:c.borderColor,points:["",c.shapType==="straightConnector1"?"arrow":""]}};return{importSpecificFile:i,importPPTXFile:c=>{const l=c[0];if(!l)return;o.value=!0;const u=[];for(const d of Cx)u.push(...d.children);const f=new FileReader;f.onload=async d=>{const h=await nne(d.target.result,{slideFactor:8202099737532808e-20,fontsizeFactor:1.0204081632653061}),p=h.size.width,m=Gt/p,A=[];for(const x of h.slides){const{type:y,value:R}=x.fill;let g;y==="image"?g={type:"image",image:R.picBase64,imageSize:"cover"}:y==="gradient"?g={type:"gradient",gradientType:"linear",gradientColor:[R.colors[0].color,R.colors[R.colors.length-1].color],gradientRotate:R.rot}:g={type:"solid",color:R};const b={id:pn(10),elements:[],background:g},L=T=>{for(const M of T){const w=M.width||1,k=M.height||1,_=M.left,P=M.top;if(M.width=M.width*m,M.height=M.height*m,M.left=M.left*m,M.top=M.top*m,M.type==="text"){const E={type:"text",id:pn(10),width:M.width,height:M.height,left:M.left,top:M.top,rotate:M.rotate,defaultFontName:t.value.fontName,defaultColor:t.value.fontColor,content:M.content,lineHeight:1,outline:{color:M.borderColor,width:M.borderWidth,style:M.borderType==="solid"?"solid":"dashed"},fill:M.fillColor,vertical:M.isVertical};M.shadow&&(E.shadow=M.shadow),b.elements.push(E)}else if(M.type==="image")b.elements.push({type:"image",id:pn(10),src:M.src,width:M.width,height:M.height,left:M.left,top:M.top,fixedRatio:!0,rotate:M.rotate,flipH:M.isFlipH,flipV:M.isFlipV});else if(M.type==="audio")b.elements.push({type:"audio",id:pn(10),src:M.blob,width:M.width,height:M.height,left:M.left,top:M.top,rotate:0,fixedRatio:!1,color:t.value.themeColor,loop:!1,autoplay:!1});else if(M.type==="video")b.elements.push({type:"video",id:pn(10),src:M.blob||M.src,width:M.width,height:M.height,left:M.left,top:M.top,rotate:0,autoplay:!1});else if(M.type==="shape")if(M.shapType==="line"||/Connector/.test(M.shapType)){const E=a(M);b.elements.push(E)}else{const E=u.find(N=>N.pptxShapeType===M.shapType),I={mid:"middle",down:"bottom",up:"top"},F={type:"shape",id:pn(10),width:M.width,height:M.height,left:M.left,top:M.top,viewBox:[200,200],path:"M 0 0 L 200 0 L 200 200 L 0 200 Z",fill:M.fillColor||"none",fixedRatio:!1,rotate:M.rotate,outline:{color:M.borderColor,width:M.borderWidth,style:M.borderType==="solid"?"solid":"dashed"},text:{content:M.content,defaultFontName:t.value.fontName,defaultColor:t.value.fontColor,align:I[M.vAlign]||"middle"},flipH:M.isFlipH,flipV:M.isFlipV};if(M.shadow&&(F.shadow=M.shadow),E&&(F.path=E.path,F.viewBox=E.viewBox,E.pathFormula)){F.pathFormula=E.pathFormula,F.viewBox=[M.width,M.height];const N=Gu[E.pathFormula];"editable"in N?(F.path=N.formula(M.width,M.height,N.defaultValue),F.keypoint=N.defaultValue):F.path=N.formula(M.width,M.height)}M.shapType==="custom"&&(F.special=!0,F.path=M.path,F.viewBox=[w,k]),b.elements.push(F)}else if(M.type==="table"){const E=M.data.length,I=M.data[0].length,F={fontname:t.value.fontName,color:t.value.fontColor},N=[];for(let Z=0;ZJ+""),I=["系列1"],F=[Z[1]]}else{const Z=M.data;E=Object.values(Z[0].xlabels),I=Z.map(J=>J.key),F=Z.map(J=>J.values.map(se=>se.y))}const N={};let V="bar";switch(M.chartType){case"barChart":case"bar3DChart":V="bar",M.barDir==="bar"&&(N.horizontalBars=!0),(M.grouping==="stacked"||M.grouping==="percentStacked")&&(N.stackBars=!0);break;case"lineChart":case"line3DChart":case"areaChart":case"area3DChart":case"scatterChart":case"bubbleChart":V="line",(M.chartType==="areaChart"||M.chartType==="area3DChart")&&(N.showArea=!0),(M.chartType==="scatterChart"||M.chartType==="bubbleChart")&&(N.showLine=!1);break;case"pieChart":case"pie3DChart":case"doughnutChart":V="pie",M.chartType==="doughnutChart"&&(N.donut=!0);break}b.elements.push({type:"chart",id:pn(10),chartType:V,width:M.width,height:M.height,left:M.left,top:M.top,rotate:0,themeColor:[t.value.themeColor],gridColor:t.value.fontColor,data:{labels:E,legends:I,series:F},options:N})}else if(M.type==="group"||M.type==="diagram"){const E=M.elements.map(I=>({...I,left:I.left+_,top:I.top+P}));L(E)}}};L(x.elements),A.push(b)}r.value?e.setSlides(A):n(A),o.value=!1},f.readAsArrayBuffer(l)},exporting:o}},pne={class:"hotkey-doc"},mne={class:"title"},vne={class:"label"},gne={class:"value"},Ane=Ie({__name:"HotkeyDoc",setup(e){return(t,n)=>(Y(),q("div",pne,[(Y(!0),q(Xe,null,ot(G(lz),r=>(Y(),q(Xe,{key:r.type},[W("div",mne,gt(r.type),1),(Y(!0),q(Xe,null,ot(r.children,o=>(Y(),q("div",{class:"hotkey-item",key:o.label},[W("div",vne,gt(o.label),1),W("div",gne,gt(o.value),1)]))),128))],64))),128))]))}}),Rne=Ve(Ane,[["__scopeId","data-v-0762be00"]]),yne=["accept"],bne=Ie({__name:"FileInput",props:{accept:{default:"image/*"}},emits:["change"],setup(e,{emit:t}){const n=t,r=he(),o=()=>{r.value&&(r.value.value="",r.value.click())},i=a=>{const s=a.target.files;s&&n("change",s)};return(a,s)=>(Y(),q("div",{class:"file-input",onClick:s[1]||(s[1]=c=>o())},[lr(a.$slots,"default",{},void 0,!0),W("input",{class:"input",type:"file",name:"upload",ref_key:"inputRef",ref:r,accept:a.accept,onChange:s[0]||(s[0]=c=>i(c))},null,40,yne)]))}}),Fu=Ve(bne,[["__scopeId","data-v-1bd53d05"]]),xne=e=>(qt("data-v-9856918a"),e=e(),en(),e),Sne={key:0,class:"fullscreen-spin"},Mne={class:"spin"},wne=xne(()=>W("div",{class:"spinner"},null,-1)),Lne={class:"text"},One=Ie({__name:"FullscreenSpin",props:{loading:{type:Boolean,default:!1},tip:{default:""}},setup(e){return(t,n)=>t.loading?(Y(),q("div",Sne,[W("div",Mne,[wne,W("div",Lne,gt(t.tip),1)])])):Ze("",!0)}}),$x=Ve(One,[["__scopeId","data-v-9856918a"]]),Tne={class:"header"},kne=Ie({__name:"Drawer",props:{visible:{type:Boolean},width:{default:320},contentStyle:{},placement:{default:"right"}},emits:["update:visible"],setup(e,{emit:t}){const n=e,r=t,o=he(!1),i=Me(()=>({width:n.width+"px",...n.contentStyle||{}}));return(a,s)=>{const c=xe("IconClose");return Y(),Te(nx,{to:"body"},[O(Ou,{name:`drawer-slide-${a.placement}`,onAfterLeave:s[1]||(s[1]=l=>o.value=!1),onBeforeEnter:s[2]||(s[2]=l=>o.value=!0)},{default:ie(()=>[Ke(W("div",{class:Ge(["drawer",a.placement]),style:we({width:n.width+"px"})},[W("div",Tne,[lr(a.$slots,"title",{},void 0,!0),W("span",{class:"close-btn",onClick:s[0]||(s[0]=l=>r("update:visible",!1))},[O(c)])]),o.value?(Y(),q("div",{key:0,class:"content",style:we(i.value)},[lr(a.$slots,"default",{},void 0,!0)],4)):Ze("",!0)],6),[[il,a.visible]])]),_:3},8,["name"])])}}}),Nne=Ve(kne,[["__scopeId","data-v-46f39759"]]),Pne={class:"prefix"},Cne=["disabled","value","placeholder"],Ine={class:"suffix"},Fne=Ie({__name:"Input",props:{value:{},disabled:{type:Boolean,default:!1},placeholder:{default:""}},emits:["update:value","input","change","blur","focus","enter"],setup(e,{expose:t,emit:n}){const r=n,o=he(!1),i=u=>{r("update:value",u.target.value)},a=u=>{o.value=!1,r("blur",u)},s=u=>{o.value=!0,r("focus",u)},c=he();return t({focus:()=>{c.value&&c.value.focus()}}),(u,f)=>(Y(),q("div",{class:Ge(["input",{disabled:u.disabled,focused:o.value}])},[W("span",Pne,[lr(u.$slots,"prefix",{},void 0,!0)]),W("input",{type:"text",ref_key:"inputRef",ref:c,disabled:u.disabled,value:u.value,placeholder:u.placeholder,onInput:f[0]||(f[0]=d=>i(d)),onFocus:f[1]||(f[1]=d=>s(d)),onBlur:f[2]||(f[2]=d=>a(d)),onChange:f[3]||(f[3]=d=>r("change",d)),onKeydown:f[4]||(f[4]=gc(d=>r("enter",d),["enter"]))},null,40,Cne),W("span",Ine,[lr(u.$slots,"suffix",{},void 0,!0)])],2))}}),_u=Ve(Fne,[["__scopeId","data-v-08dd2583"]]);var ei="top",ta="bottom",na="right",ti="left",jx="auto",Vp=[ei,ta,na,ti],Od="start",rp="end",_ne="clippingParents",GC="viewport",g0="popper",Ene="reference",yO=Vp.reduce(function(e,t){return e.concat([t+"-"+Od,t+"-"+rp])},[]),JC=[].concat(Vp,[jx]).reduce(function(e,t){return e.concat([t,t+"-"+Od,t+"-"+rp])},[]),Xne="beforeRead",Wne="read",Vne="afterRead",Une="beforeMain",Yne="main",Qne="afterMain",Zne="beforeWrite",Bne="write",Dne="afterWrite",Kne=[Xne,Wne,Vne,Une,Yne,Qne,Zne,Bne,Dne];function ms(e){return e?(e.nodeName||"").toLowerCase():null}function Ci(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function Eu(e){var t=Ci(e).Element;return e instanceof t||e instanceof Element}function $i(e){var t=Ci(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function qx(e){if(typeof ShadowRoot>"u")return!1;var t=Ci(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function Hne(e){var t=e.state;Object.keys(t.elements).forEach(function(n){var r=t.styles[n]||{},o=t.attributes[n]||{},i=t.elements[n];!$i(i)||!ms(i)||(Object.assign(i.style,r),Object.keys(o).forEach(function(a){var s=o[a];s===!1?i.removeAttribute(a):i.setAttribute(a,s===!0?"":s)}))})}function Gne(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach(function(r){var o=t.elements[r],i=t.attributes[r]||{},a=Object.keys(t.styles.hasOwnProperty(r)?t.styles[r]:n[r]),s=a.reduce(function(c,l){return c[l]="",c},{});!$i(o)||!ms(o)||(Object.assign(o.style,s),Object.keys(i).forEach(function(c){o.removeAttribute(c)}))})}}const zC={name:"applyStyles",enabled:!0,phase:"write",fn:Hne,effect:Gne,requires:["computeStyles"]};function ds(e){return e.split("-")[0]}var Au=Math.max,qv=Math.min,Td=Math.round;function Q3(){var e=navigator.userAgentData;return e!=null&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function $C(){return!/^((?!chrome|android).)*safari/i.test(Q3())}function kd(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var r=e.getBoundingClientRect(),o=1,i=1;t&&$i(e)&&(o=e.offsetWidth>0&&Td(r.width)/e.offsetWidth||1,i=e.offsetHeight>0&&Td(r.height)/e.offsetHeight||1);var a=Eu(e)?Ci(e):window,s=a.visualViewport,c=!$C()&&n,l=(r.left+(c&&s?s.offsetLeft:0))/o,u=(r.top+(c&&s?s.offsetTop:0))/i,f=r.width/o,d=r.height/i;return{width:f,height:d,top:u,right:l+f,bottom:u+d,left:l,x:l,y:u}}function e5(e){var t=kd(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function jC(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&qx(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function sl(e){return Ci(e).getComputedStyle(e)}function Jne(e){return["table","td","th"].indexOf(ms(e))>=0}function Mc(e){return((Eu(e)?e.ownerDocument:e.document)||window.document).documentElement}function r2(e){return ms(e)==="html"?e:e.assignedSlot||e.parentNode||(qx(e)?e.host:null)||Mc(e)}function bO(e){return!$i(e)||sl(e).position==="fixed"?null:e.offsetParent}function zne(e){var t=/firefox/i.test(Q3()),n=/Trident/i.test(Q3());if(n&&$i(e)){var r=sl(e);if(r.position==="fixed")return null}var o=r2(e);for(qx(o)&&(o=o.host);$i(o)&&["html","body"].indexOf(ms(o))<0;){var i=sl(o);if(i.transform!=="none"||i.perspective!=="none"||i.contain==="paint"||["transform","perspective"].indexOf(i.willChange)!==-1||t&&i.willChange==="filter"||t&&i.filter&&i.filter!=="none")return o;o=o.parentNode}return null}function Up(e){for(var t=Ci(e),n=bO(e);n&&Jne(n)&&sl(n).position==="static";)n=bO(n);return n&&(ms(n)==="html"||ms(n)==="body"&&sl(n).position==="static")?t:n||zne(e)||t}function t5(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function Mh(e,t,n){return Au(e,qv(t,n))}function $ne(e,t,n){var r=Mh(e,t,n);return r>n?n:r}function qC(){return{top:0,right:0,bottom:0,left:0}}function eI(e){return Object.assign({},qC(),e)}function tI(e,t){return t.reduce(function(n,r){return n[r]=e,n},{})}var jne=function(t,n){return t=typeof t=="function"?t(Object.assign({},n.rects,{placement:n.placement})):t,eI(typeof t!="number"?t:tI(t,Vp))};function qne(e){var t,n=e.state,r=e.name,o=e.options,i=n.elements.arrow,a=n.modifiersData.popperOffsets,s=ds(n.placement),c=t5(s),l=[ti,na].indexOf(s)>=0,u=l?"height":"width";if(!(!i||!a)){var f=jne(o.padding,n),d=e5(i),h=c==="y"?ei:ti,p=c==="y"?ta:na,m=n.rects.reference[u]+n.rects.reference[c]-a[c]-n.rects.popper[u],A=a[c]-n.rects.reference[c],x=Up(i),y=x?c==="y"?x.clientHeight||0:x.clientWidth||0:0,R=m/2-A/2,g=f[h],b=y-d[u]-f[p],L=y/2-d[u]/2+R,T=Mh(g,L,b),M=c;n.modifiersData[r]=(t={},t[M]=T,t.centerOffset=T-L,t)}}function ere(e){var t=e.state,n=e.options,r=n.element,o=r===void 0?"[data-popper-arrow]":r;o!=null&&(typeof o=="string"&&(o=t.elements.popper.querySelector(o),!o)||jC(t.elements.popper,o)&&(t.elements.arrow=o))}const tre={name:"arrow",enabled:!0,phase:"main",fn:qne,effect:ere,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Nd(e){return e.split("-")[1]}var nre={top:"auto",right:"auto",bottom:"auto",left:"auto"};function rre(e,t){var n=e.x,r=e.y,o=t.devicePixelRatio||1;return{x:Td(n*o)/o||0,y:Td(r*o)/o||0}}function xO(e){var t,n=e.popper,r=e.popperRect,o=e.placement,i=e.variation,a=e.offsets,s=e.position,c=e.gpuAcceleration,l=e.adaptive,u=e.roundOffsets,f=e.isFixed,d=a.x,h=d===void 0?0:d,p=a.y,m=p===void 0?0:p,A=typeof u=="function"?u({x:h,y:m}):{x:h,y:m};h=A.x,m=A.y;var x=a.hasOwnProperty("x"),y=a.hasOwnProperty("y"),R=ti,g=ei,b=window;if(l){var L=Up(n),T="clientHeight",M="clientWidth";if(L===Ci(n)&&(L=Mc(n),sl(L).position!=="static"&&s==="absolute"&&(T="scrollHeight",M="scrollWidth")),L=L,o===ei||(o===ti||o===na)&&i===rp){g=ta;var w=f&&L===b&&b.visualViewport?b.visualViewport.height:L[T];m-=w-r.height,m*=c?1:-1}if(o===ti||(o===ei||o===ta)&&i===rp){R=na;var k=f&&L===b&&b.visualViewport?b.visualViewport.width:L[M];h-=k-r.width,h*=c?1:-1}}var _=Object.assign({position:s},l&&nre),P=u===!0?rre({x:h,y:m},Ci(n)):{x:h,y:m};if(h=P.x,m=P.y,c){var E;return Object.assign({},_,(E={},E[g]=y?"0":"",E[R]=x?"0":"",E.transform=(b.devicePixelRatio||1)<=1?"translate("+h+"px, "+m+"px)":"translate3d("+h+"px, "+m+"px, 0)",E))}return Object.assign({},_,(t={},t[g]=y?m+"px":"",t[R]=x?h+"px":"",t.transform="",t))}function ore(e){var t=e.state,n=e.options,r=n.gpuAcceleration,o=r===void 0?!0:r,i=n.adaptive,a=i===void 0?!0:i,s=n.roundOffsets,c=s===void 0?!0:s,l={placement:ds(t.placement),variation:Nd(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:o,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,xO(Object.assign({},l,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a,roundOffsets:c})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,xO(Object.assign({},l,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:c})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const ire={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:ore,data:{}};var gm={passive:!0};function are(e){var t=e.state,n=e.instance,r=e.options,o=r.scroll,i=o===void 0?!0:o,a=r.resize,s=a===void 0?!0:a,c=Ci(t.elements.popper),l=[].concat(t.scrollParents.reference,t.scrollParents.popper);return i&&l.forEach(function(u){u.addEventListener("scroll",n.update,gm)}),s&&c.addEventListener("resize",n.update,gm),function(){i&&l.forEach(function(u){u.removeEventListener("scroll",n.update,gm)}),s&&c.removeEventListener("resize",n.update,gm)}}const sre={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:are,data:{}};var lre={left:"right",right:"left",bottom:"top",top:"bottom"};function jm(e){return e.replace(/left|right|bottom|top/g,function(t){return lre[t]})}var cre={start:"end",end:"start"};function SO(e){return e.replace(/start|end/g,function(t){return cre[t]})}function n5(e){var t=Ci(e),n=t.pageXOffset,r=t.pageYOffset;return{scrollLeft:n,scrollTop:r}}function r5(e){return kd(Mc(e)).left+n5(e).scrollLeft}function ure(e,t){var n=Ci(e),r=Mc(e),o=n.visualViewport,i=r.clientWidth,a=r.clientHeight,s=0,c=0;if(o){i=o.width,a=o.height;var l=$C();(l||!l&&t==="fixed")&&(s=o.offsetLeft,c=o.offsetTop)}return{width:i,height:a,x:s+r5(e),y:c}}function fre(e){var t,n=Mc(e),r=n5(e),o=(t=e.ownerDocument)==null?void 0:t.body,i=Au(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),a=Au(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),s=-r.scrollLeft+r5(e),c=-r.scrollTop;return sl(o||n).direction==="rtl"&&(s+=Au(n.clientWidth,o?o.clientWidth:0)-i),{width:i,height:a,x:s,y:c}}function o5(e){var t=sl(e),n=t.overflow,r=t.overflowX,o=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+o+r)}function nI(e){return["html","body","#document"].indexOf(ms(e))>=0?e.ownerDocument.body:$i(e)&&o5(e)?e:nI(r2(e))}function wh(e,t){var n;t===void 0&&(t=[]);var r=nI(e),o=r===((n=e.ownerDocument)==null?void 0:n.body),i=Ci(r),a=o?[i].concat(i.visualViewport||[],o5(r)?r:[]):r,s=t.concat(a);return o?s:s.concat(wh(r2(a)))}function Z3(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function dre(e,t){var n=kd(e,!1,t==="fixed");return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}function MO(e,t,n){return t===GC?Z3(ure(e,n)):Eu(t)?dre(t,n):Z3(fre(Mc(e)))}function hre(e){var t=wh(r2(e)),n=["absolute","fixed"].indexOf(sl(e).position)>=0,r=n&&$i(e)?Up(e):e;return Eu(r)?t.filter(function(o){return Eu(o)&&jC(o,r)&&ms(o)!=="body"}):[]}function pre(e,t,n,r){var o=t==="clippingParents"?hre(e):[].concat(t),i=[].concat(o,[n]),a=i[0],s=i.reduce(function(c,l){var u=MO(e,l,r);return c.top=Au(u.top,c.top),c.right=qv(u.right,c.right),c.bottom=qv(u.bottom,c.bottom),c.left=Au(u.left,c.left),c},MO(e,a,r));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function rI(e){var t=e.reference,n=e.element,r=e.placement,o=r?ds(r):null,i=r?Nd(r):null,a=t.x+t.width/2-n.width/2,s=t.y+t.height/2-n.height/2,c;switch(o){case ei:c={x:a,y:t.y-n.height};break;case ta:c={x:a,y:t.y+t.height};break;case na:c={x:t.x+t.width,y:s};break;case ti:c={x:t.x-n.width,y:s};break;default:c={x:t.x,y:t.y}}var l=o?t5(o):null;if(l!=null){var u=l==="y"?"height":"width";switch(i){case Od:c[l]=c[l]-(t[u]/2-n[u]/2);break;case rp:c[l]=c[l]+(t[u]/2-n[u]/2);break}}return c}function op(e,t){t===void 0&&(t={});var n=t,r=n.placement,o=r===void 0?e.placement:r,i=n.strategy,a=i===void 0?e.strategy:i,s=n.boundary,c=s===void 0?_ne:s,l=n.rootBoundary,u=l===void 0?GC:l,f=n.elementContext,d=f===void 0?g0:f,h=n.altBoundary,p=h===void 0?!1:h,m=n.padding,A=m===void 0?0:m,x=eI(typeof A!="number"?A:tI(A,Vp)),y=d===g0?Ene:g0,R=e.rects.popper,g=e.elements[p?y:d],b=pre(Eu(g)?g:g.contextElement||Mc(e.elements.popper),c,u,a),L=kd(e.elements.reference),T=rI({reference:L,element:R,strategy:"absolute",placement:o}),M=Z3(Object.assign({},R,T)),w=d===g0?M:L,k={top:b.top-w.top+x.top,bottom:w.bottom-b.bottom+x.bottom,left:b.left-w.left+x.left,right:w.right-b.right+x.right},_=e.modifiersData.offset;if(d===g0&&_){var P=_[o];Object.keys(k).forEach(function(E){var I=[na,ta].indexOf(E)>=0?1:-1,F=[ei,ta].indexOf(E)>=0?"y":"x";k[E]+=P[F]*I})}return k}function mre(e,t){t===void 0&&(t={});var n=t,r=n.placement,o=n.boundary,i=n.rootBoundary,a=n.padding,s=n.flipVariations,c=n.allowedAutoPlacements,l=c===void 0?JC:c,u=Nd(r),f=u?s?yO:yO.filter(function(p){return Nd(p)===u}):Vp,d=f.filter(function(p){return l.indexOf(p)>=0});d.length===0&&(d=f);var h=d.reduce(function(p,m){return p[m]=op(e,{placement:m,boundary:o,rootBoundary:i,padding:a})[ds(m)],p},{});return Object.keys(h).sort(function(p,m){return h[p]-h[m]})}function vre(e){if(ds(e)===jx)return[];var t=jm(e);return[SO(e),t,SO(t)]}function gre(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var o=n.mainAxis,i=o===void 0?!0:o,a=n.altAxis,s=a===void 0?!0:a,c=n.fallbackPlacements,l=n.padding,u=n.boundary,f=n.rootBoundary,d=n.altBoundary,h=n.flipVariations,p=h===void 0?!0:h,m=n.allowedAutoPlacements,A=t.options.placement,x=ds(A),y=x===A,R=c||(y||!p?[jm(A)]:vre(A)),g=[A].concat(R).reduce(function(H,U){return H.concat(ds(U)===jx?mre(t,{placement:U,boundary:u,rootBoundary:f,padding:l,flipVariations:p,allowedAutoPlacements:m}):U)},[]),b=t.rects.reference,L=t.rects.popper,T=new Map,M=!0,w=g[0],k=0;k=0,F=I?"width":"height",N=op(t,{placement:_,boundary:u,rootBoundary:f,altBoundary:d,padding:l}),V=I?E?na:ti:E?ta:ei;b[F]>L[F]&&(V=jm(V));var Z=jm(V),J=[];if(i&&J.push(N[P]<=0),s&&J.push(N[V]<=0,N[Z]<=0),J.every(function(H){return H})){w=_,M=!1;break}T.set(_,J)}if(M)for(var se=p?3:1,D=function(U){var te=g.find(function(z){var oe=T.get(z);if(oe)return oe.slice(0,U).every(function(pe){return pe})});if(te)return w=te,"break"},Q=se;Q>0;Q--){var B=D(Q);if(B==="break")break}t.placement!==w&&(t.modifiersData[r]._skip=!0,t.placement=w,t.reset=!0)}}const Are={name:"flip",enabled:!0,phase:"main",fn:gre,requiresIfExists:["offset"],data:{_skip:!1}};function wO(e,t,n){return n===void 0&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function LO(e){return[ei,na,ta,ti].some(function(t){return e[t]>=0})}function Rre(e){var t=e.state,n=e.name,r=t.rects.reference,o=t.rects.popper,i=t.modifiersData.preventOverflow,a=op(t,{elementContext:"reference"}),s=op(t,{altBoundary:!0}),c=wO(a,r),l=wO(s,o,i),u=LO(c),f=LO(l);t.modifiersData[n]={referenceClippingOffsets:c,popperEscapeOffsets:l,isReferenceHidden:u,hasPopperEscaped:f},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":f})}const yre={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:Rre};function bre(e,t,n){var r=ds(e),o=[ti,ei].indexOf(r)>=0?-1:1,i=typeof n=="function"?n(Object.assign({},t,{placement:e})):n,a=i[0],s=i[1];return a=a||0,s=(s||0)*o,[ti,na].indexOf(r)>=0?{x:s,y:a}:{x:a,y:s}}function xre(e){var t=e.state,n=e.options,r=e.name,o=n.offset,i=o===void 0?[0,0]:o,a=JC.reduce(function(u,f){return u[f]=bre(f,t.rects,i),u},{}),s=a[t.placement],c=s.x,l=s.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=c,t.modifiersData.popperOffsets.y+=l),t.modifiersData[r]=a}const Sre={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:xre};function Mre(e){var t=e.state,n=e.name;t.modifiersData[n]=rI({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}const wre={name:"popperOffsets",enabled:!0,phase:"read",fn:Mre,data:{}};function Lre(e){return e==="x"?"y":"x"}function Ore(e){var t=e.state,n=e.options,r=e.name,o=n.mainAxis,i=o===void 0?!0:o,a=n.altAxis,s=a===void 0?!1:a,c=n.boundary,l=n.rootBoundary,u=n.altBoundary,f=n.padding,d=n.tether,h=d===void 0?!0:d,p=n.tetherOffset,m=p===void 0?0:p,A=op(t,{boundary:c,rootBoundary:l,padding:f,altBoundary:u}),x=ds(t.placement),y=Nd(t.placement),R=!y,g=t5(x),b=Lre(g),L=t.modifiersData.popperOffsets,T=t.rects.reference,M=t.rects.popper,w=typeof m=="function"?m(Object.assign({},t.rects,{placement:t.placement})):m,k=typeof w=="number"?{mainAxis:w,altAxis:w}:Object.assign({mainAxis:0,altAxis:0},w),_=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,P={x:0,y:0};if(L){if(i){var E,I=g==="y"?ei:ti,F=g==="y"?ta:na,N=g==="y"?"height":"width",V=L[g],Z=V+A[I],J=V-A[F],se=h?-M[N]/2:0,D=y===Od?T[N]:M[N],Q=y===Od?-M[N]:-T[N],B=t.elements.arrow,H=h&&B?e5(B):{width:0,height:0},U=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:qC(),te=U[I],z=U[F],oe=Mh(0,T[N],H[N]),pe=R?T[N]/2-se-oe-te-k.mainAxis:D-oe-te-k.mainAxis,Ae=R?-T[N]/2+se+oe+z+k.mainAxis:Q+oe+z+k.mainAxis,me=t.elements.arrow&&Up(t.elements.arrow),$=me?g==="y"?me.clientTop||0:me.clientLeft||0:0,ue=(E=_==null?void 0:_[g])!=null?E:0,X=V+pe-ue-$,ne=V+Ae-ue,le=Mh(h?qv(Z,X):Z,V,h?Au(J,ne):J);L[g]=le,P[g]=le-V}if(s){var j,ee=g==="x"?ei:ti,ae=g==="x"?ta:na,ge=L[b],ce=b==="y"?"height":"width",ve=ge+A[ee],ye=ge-A[ae],_e=[ei,ti].indexOf(x)!==-1,Se=(j=_==null?void 0:_[b])!=null?j:0,be=_e?ve:ge-T[ce]-M[ce]-Se+k.altAxis,ut=_e?ge+T[ce]+M[ce]-Se-k.altAxis:ye,tt=h&&_e?$ne(be,ge,ut):Mh(h?be:ve,ge,h?ut:ye);L[b]=tt,P[b]=tt-ge}t.modifiersData[r]=P}}const Tre={name:"preventOverflow",enabled:!0,phase:"main",fn:Ore,requiresIfExists:["offset"]};function kre(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function Nre(e){return e===Ci(e)||!$i(e)?n5(e):kre(e)}function Pre(e){var t=e.getBoundingClientRect(),n=Td(t.width)/e.offsetWidth||1,r=Td(t.height)/e.offsetHeight||1;return n!==1||r!==1}function Cre(e,t,n){n===void 0&&(n=!1);var r=$i(t),o=$i(t)&&Pre(t),i=Mc(t),a=kd(e,o,n),s={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(r||!r&&!n)&&((ms(t)!=="body"||o5(i))&&(s=Nre(t)),$i(t)?(c=kd(t,!0),c.x+=t.clientLeft,c.y+=t.clientTop):i&&(c.x=r5(i))),{x:a.left+s.scrollLeft-c.x,y:a.top+s.scrollTop-c.y,width:a.width,height:a.height}}function Ire(e){var t=new Map,n=new Set,r=[];e.forEach(function(i){t.set(i.name,i)});function o(i){n.add(i.name);var a=[].concat(i.requires||[],i.requiresIfExists||[]);a.forEach(function(s){if(!n.has(s)){var c=t.get(s);c&&o(c)}}),r.push(i)}return e.forEach(function(i){n.has(i.name)||o(i)}),r}function Fre(e){var t=Ire(e);return Kne.reduce(function(n,r){return n.concat(t.filter(function(o){return o.phase===r}))},[])}function _re(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}function Ere(e){var t=e.reduce(function(n,r){var o=n[r.name];return n[r.name]=o?Object.assign({},o,r,{options:Object.assign({},o.options,r.options),data:Object.assign({},o.data,r.data)}):r,n},{});return Object.keys(t).map(function(n){return t[n]})}var OO={placement:"bottom",modifiers:[],strategy:"absolute"};function TO(){for(var e=arguments.length,t=new Array(e),n=0;n-1}function lI(e,t){return typeof e=="function"?e.apply(void 0,t):e}function kO(e,t){if(t===0)return e;var n;return function(r){clearTimeout(n),n=setTimeout(function(){e(r)},t)}}function Qre(e){return e.split(/\s+/).filter(Boolean)}function Yf(e){return[].concat(e)}function NO(e,t){e.indexOf(t)===-1&&e.push(t)}function Zre(e){return e.filter(function(t,n){return e.indexOf(t)===n})}function Bre(e){return e.split("-")[0]}function eg(e){return[].slice.call(e)}function PO(e){return Object.keys(e).reduce(function(t,n){return e[n]!==void 0&&(t[n]=e[n]),t},{})}function Lh(){return document.createElement("div")}function o2(e){return["Element","Fragment"].some(function(t){return i5(e,t)})}function Dre(e){return i5(e,"NodeList")}function Kre(e){return i5(e,"MouseEvent")}function Hre(e){return!!(e&&e._tippy&&e._tippy.reference===e)}function Gre(e){return o2(e)?[e]:Dre(e)?eg(e):Array.isArray(e)?e:eg(document.querySelectorAll(e))}function Ey(e,t){e.forEach(function(n){n&&(n.style.transitionDuration=t+"ms")})}function CO(e,t){e.forEach(function(n){n&&n.setAttribute("data-state",t)})}function Jre(e){var t,n=Yf(e),r=n[0];return r!=null&&(t=r.ownerDocument)!=null&&t.body?r.ownerDocument:document}function zre(e,t){var n=t.clientX,r=t.clientY;return e.every(function(o){var i=o.popperRect,a=o.popperState,s=o.props,c=s.interactiveBorder,l=Bre(a.placement),u=a.modifiersData.offset;if(!u)return!0;var f=l==="bottom"?u.top.y:0,d=l==="top"?u.bottom.y:0,h=l==="right"?u.left.x:0,p=l==="left"?u.right.x:0,m=i.top-r+f>c,A=r-i.bottom-d>c,x=i.left-n+h>c,y=n-i.right-p>c;return m||A||x||y})}function Xy(e,t,n){var r=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(o){e[r](o,n)})}function IO(e,t){for(var n=t;n;){var r;if(e.contains(n))return!0;n=n.getRootNode==null||(r=n.getRootNode())==null?void 0:r.host}return!1}var ja={isTouch:!1},FO=0;function $re(){ja.isTouch||(ja.isTouch=!0,window.performance&&document.addEventListener("mousemove",cI))}function cI(){var e=performance.now();e-FO<20&&(ja.isTouch=!1,document.removeEventListener("mousemove",cI)),FO=e}function jre(){var e=document.activeElement;if(Hre(e)){var t=e._tippy;e.blur&&!t.state.isVisible&&e.blur()}}function qre(){document.addEventListener("touchstart",$re,Gc),window.addEventListener("blur",jre)}var eoe=typeof window<"u"&&typeof document<"u",toe=eoe?!!window.msCrypto:!1,noe={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},roe={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},Na=Object.assign({appendTo:sI,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},noe,roe),ooe=Object.keys(Na),ioe=function(t){var n=Object.keys(t);n.forEach(function(r){Na[r]=t[r]})};function uI(e){var t=e.plugins||[],n=t.reduce(function(r,o){var i=o.name,a=o.defaultValue;if(i){var s;r[i]=e[i]!==void 0?e[i]:(s=Na[i])!=null?s:a}return r},{});return Object.assign({},e,n)}function aoe(e,t){var n=t?Object.keys(uI(Object.assign({},Na,{plugins:t}))):ooe,r=n.reduce(function(o,i){var a=(e.getAttribute("data-tippy-"+i)||"").trim();if(!a)return o;if(i==="content")o[i]=a;else try{o[i]=JSON.parse(a)}catch{o[i]=a}return o},{});return r}function _O(e,t){var n=Object.assign({},t,{content:lI(t.content,[e])},t.ignoreAttributes?{}:aoe(e,t.plugins));return n.aria=Object.assign({},Na.aria,n.aria),n.aria={expanded:n.aria.expanded==="auto"?t.interactive:n.aria.expanded,content:n.aria.content==="auto"?t.interactive?null:"describedby":n.aria.content},n}var soe=function(){return"innerHTML"};function B3(e,t){e[soe()]=t}function EO(e){var t=Lh();return e===!0?t.className=iI:(t.className=aI,o2(e)?t.appendChild(e):B3(t,e)),t}function XO(e,t){o2(t.content)?(B3(e,""),e.appendChild(t.content)):typeof t.content!="function"&&(t.allowHTML?B3(e,t.content):e.textContent=t.content)}function D3(e){var t=e.firstElementChild,n=eg(t.children);return{box:t,content:n.find(function(r){return r.classList.contains(oI)}),arrow:n.find(function(r){return r.classList.contains(iI)||r.classList.contains(aI)}),backdrop:n.find(function(r){return r.classList.contains(Yre)})}}function fI(e){var t=Lh(),n=Lh();n.className=Ure,n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var r=Lh();r.className=oI,r.setAttribute("data-state","hidden"),XO(r,e.props),t.appendChild(n),n.appendChild(r),o(e.props,e.props);function o(i,a){var s=D3(t),c=s.box,l=s.content,u=s.arrow;a.theme?c.setAttribute("data-theme",a.theme):c.removeAttribute("data-theme"),typeof a.animation=="string"?c.setAttribute("data-animation",a.animation):c.removeAttribute("data-animation"),a.inertia?c.setAttribute("data-inertia",""):c.removeAttribute("data-inertia"),c.style.maxWidth=typeof a.maxWidth=="number"?a.maxWidth+"px":a.maxWidth,a.role?c.setAttribute("role",a.role):c.removeAttribute("role"),(i.content!==a.content||i.allowHTML!==a.allowHTML)&&XO(l,e.props),a.arrow?u?i.arrow!==a.arrow&&(c.removeChild(u),c.appendChild(EO(a.arrow))):c.appendChild(EO(a.arrow)):u&&c.removeChild(u)}return{popper:t,onUpdate:o}}fI.$$tippy=!0;var loe=1,Am=[],Wy=[];function coe(e,t){var n=_O(e,Object.assign({},Na,uI(PO(t)))),r,o,i,a=!1,s=!1,c=!1,l=!1,u,f,d,h=[],p=kO(X,n.interactiveDebounce),m,A=loe++,x=null,y=Zre(n.plugins),R={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},g={id:A,reference:e,popper:Lh(),popperInstance:x,props:n,state:R,plugins:y,clearDelayTimeouts:be,setProps:ut,setContent:tt,show:Oe,hide:Ne,hideWithInteractivity:Fe,enable:_e,disable:Se,unmount:Be,destroy:qe};if(!n.render)return g;var b=n.render(g),L=b.popper,T=b.onUpdate;L.setAttribute("data-tippy-root",""),L.id="tippy-"+g.id,g.popper=L,e._tippy=g,L._tippy=g;var M=y.map(function(ke){return ke.fn(g)}),w=e.hasAttribute("aria-expanded");return me(),se(),V(),Z("onCreate",[g]),n.showOnCreate&&ve(),L.addEventListener("mouseenter",function(){g.props.interactive&&g.state.isVisible&&g.clearDelayTimeouts()}),L.addEventListener("mouseleave",function(){g.props.interactive&&g.props.trigger.indexOf("mouseenter")>=0&&I().addEventListener("mousemove",p)}),g;function k(){var ke=g.props.touch;return Array.isArray(ke)?ke:[ke,0]}function _(){return k()[0]==="hold"}function P(){var ke;return!!((ke=g.props.render)!=null&&ke.$$tippy)}function E(){return m||e}function I(){var ke=E().parentNode;return ke?Jre(ke):document}function F(){return D3(L)}function N(ke){return g.state.isMounted&&!g.state.isVisible||ja.isTouch||u&&u.type==="focus"?0:_y(g.props.delay,ke?0:1,Na.delay)}function V(ke){ke===void 0&&(ke=!1),L.style.pointerEvents=g.props.interactive&&!ke?"":"none",L.style.zIndex=""+g.props.zIndex}function Z(ke,Qe,et){if(et===void 0&&(et=!0),M.forEach(function(ct){ct[ke]&&ct[ke].apply(ct,Qe)}),et){var bt;(bt=g.props)[ke].apply(bt,Qe)}}function J(){var ke=g.props.aria;if(ke.content){var Qe="aria-"+ke.content,et=L.id,bt=Yf(g.props.triggerTarget||e);bt.forEach(function(ct){var ht=ct.getAttribute(Qe);if(g.state.isVisible)ct.setAttribute(Qe,ht?ht+" "+et:et);else{var At=ht&&ht.replace(et,"").trim();At?ct.setAttribute(Qe,At):ct.removeAttribute(Qe)}})}}function se(){if(!(w||!g.props.aria.expanded)){var ke=Yf(g.props.triggerTarget||e);ke.forEach(function(Qe){g.props.interactive?Qe.setAttribute("aria-expanded",g.state.isVisible&&Qe===E()?"true":"false"):Qe.removeAttribute("aria-expanded")})}}function D(){I().removeEventListener("mousemove",p),Am=Am.filter(function(ke){return ke!==p})}function Q(ke){if(!(ja.isTouch&&(c||ke.type==="mousedown"))){var Qe=ke.composedPath&&ke.composedPath()[0]||ke.target;if(!(g.props.interactive&&IO(L,Qe))){if(Yf(g.props.triggerTarget||e).some(function(et){return IO(et,Qe)})){if(ja.isTouch||g.state.isVisible&&g.props.trigger.indexOf("click")>=0)return}else Z("onClickOutside",[g,ke]);g.props.hideOnClick===!0&&(g.clearDelayTimeouts(),g.hide(),s=!0,setTimeout(function(){s=!1}),g.state.isMounted||te())}}}function B(){c=!0}function H(){c=!1}function U(){var ke=I();ke.addEventListener("mousedown",Q,!0),ke.addEventListener("touchend",Q,Gc),ke.addEventListener("touchstart",H,Gc),ke.addEventListener("touchmove",B,Gc)}function te(){var ke=I();ke.removeEventListener("mousedown",Q,!0),ke.removeEventListener("touchend",Q,Gc),ke.removeEventListener("touchstart",H,Gc),ke.removeEventListener("touchmove",B,Gc)}function z(ke,Qe){pe(ke,function(){!g.state.isVisible&&L.parentNode&&L.parentNode.contains(L)&&Qe()})}function oe(ke,Qe){pe(ke,Qe)}function pe(ke,Qe){var et=F().box;function bt(ct){ct.target===et&&(Xy(et,"remove",bt),Qe())}if(ke===0)return Qe();Xy(et,"remove",f),Xy(et,"add",bt),f=bt}function Ae(ke,Qe,et){et===void 0&&(et=!1);var bt=Yf(g.props.triggerTarget||e);bt.forEach(function(ct){ct.addEventListener(ke,Qe,et),h.push({node:ct,eventType:ke,handler:Qe,options:et})})}function me(){_()&&(Ae("touchstart",ue,{passive:!0}),Ae("touchend",ne,{passive:!0})),Qre(g.props.trigger).forEach(function(ke){if(ke!=="manual")switch(Ae(ke,ue),ke){case"mouseenter":Ae("mouseleave",ne);break;case"focus":Ae(toe?"focusout":"blur",le);break;case"focusin":Ae("focusout",le);break}})}function $(){h.forEach(function(ke){var Qe=ke.node,et=ke.eventType,bt=ke.handler,ct=ke.options;Qe.removeEventListener(et,bt,ct)}),h=[]}function ue(ke){var Qe,et=!1;if(!(!g.state.isEnabled||j(ke)||s)){var bt=((Qe=u)==null?void 0:Qe.type)==="focus";u=ke,m=ke.currentTarget,se(),!g.state.isVisible&&Kre(ke)&&Am.forEach(function(ct){return ct(ke)}),ke.type==="click"&&(g.props.trigger.indexOf("mouseenter")<0||a)&&g.props.hideOnClick!==!1&&g.state.isVisible?et=!0:ve(ke),ke.type==="click"&&(a=!et),et&&!bt&&ye(ke)}}function X(ke){var Qe=ke.target,et=E().contains(Qe)||L.contains(Qe);if(!(ke.type==="mousemove"&&et)){var bt=ce().concat(L).map(function(ct){var ht,At=ct._tippy,Ft=(ht=At.popperInstance)==null?void 0:ht.state;return Ft?{popperRect:ct.getBoundingClientRect(),popperState:Ft,props:n}:null}).filter(Boolean);zre(bt,ke)&&(D(),ye(ke))}}function ne(ke){var Qe=j(ke)||g.props.trigger.indexOf("click")>=0&&a;if(!Qe){if(g.props.interactive){g.hideWithInteractivity(ke);return}ye(ke)}}function le(ke){g.props.trigger.indexOf("focusin")<0&&ke.target!==E()||g.props.interactive&&ke.relatedTarget&&L.contains(ke.relatedTarget)||ye(ke)}function j(ke){return ja.isTouch?_()!==ke.type.indexOf("touch")>=0:!1}function ee(){ae();var ke=g.props,Qe=ke.popperOptions,et=ke.placement,bt=ke.offset,ct=ke.getReferenceClientRect,ht=ke.moveTransition,At=P()?D3(L).arrow:null,Ft=ct?{getBoundingClientRect:ct,contextElement:ct.contextElement||E()}:e,Qt={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(Ea){var io=Ea.state;if(P()){var nf=F(),Tc=nf.box;["placement","reference-hidden","escaped"].forEach(function(Ms){Ms==="placement"?Tc.setAttribute("data-placement",io.placement):io.attributes.popper["data-popper-"+Ms]?Tc.setAttribute("data-"+Ms,""):Tc.removeAttribute("data-"+Ms)}),io.attributes.popper={}}}},Nn=[{name:"offset",options:{offset:bt}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!ht}},Qt];P()&&At&&Nn.push({name:"arrow",options:{element:At,padding:3}}),Nn.push.apply(Nn,(Qe==null?void 0:Qe.modifiers)||[]),g.popperInstance=Vre(Ft,L,Object.assign({},Qe,{placement:et,onFirstUpdate:d,modifiers:Nn}))}function ae(){g.popperInstance&&(g.popperInstance.destroy(),g.popperInstance=null)}function ge(){var ke=g.props.appendTo,Qe,et=E();g.props.interactive&&ke===sI||ke==="parent"?Qe=et.parentNode:Qe=lI(ke,[et]),Qe.contains(L)||Qe.appendChild(L),g.state.isMounted=!0,ee()}function ce(){return eg(L.querySelectorAll("[data-tippy-root]"))}function ve(ke){g.clearDelayTimeouts(),ke&&Z("onTrigger",[g,ke]),U();var Qe=N(!0),et=k(),bt=et[0],ct=et[1];ja.isTouch&&bt==="hold"&&ct&&(Qe=ct),Qe?r=setTimeout(function(){g.show()},Qe):g.show()}function ye(ke){if(g.clearDelayTimeouts(),Z("onUntrigger",[g,ke]),!g.state.isVisible){te();return}if(!(g.props.trigger.indexOf("mouseenter")>=0&&g.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(ke.type)>=0&&a)){var Qe=N(!1);Qe?o=setTimeout(function(){g.state.isVisible&&g.hide()},Qe):i=requestAnimationFrame(function(){g.hide()})}}function _e(){g.state.isEnabled=!0}function Se(){g.hide(),g.state.isEnabled=!1}function be(){clearTimeout(r),clearTimeout(o),cancelAnimationFrame(i)}function ut(ke){if(!g.state.isDestroyed){Z("onBeforeUpdate",[g,ke]),$();var Qe=g.props,et=_O(e,Object.assign({},Qe,PO(ke),{ignoreAttributes:!0}));g.props=et,me(),Qe.interactiveDebounce!==et.interactiveDebounce&&(D(),p=kO(X,et.interactiveDebounce)),Qe.triggerTarget&&!et.triggerTarget?Yf(Qe.triggerTarget).forEach(function(bt){bt.removeAttribute("aria-expanded")}):et.triggerTarget&&e.removeAttribute("aria-expanded"),se(),V(),T&&T(Qe,et),g.popperInstance&&(ee(),ce().forEach(function(bt){requestAnimationFrame(bt._tippy.popperInstance.forceUpdate)})),Z("onAfterUpdate",[g,ke])}}function tt(ke){g.setProps({content:ke})}function Oe(){var ke=g.state.isVisible,Qe=g.state.isDestroyed,et=!g.state.isEnabled,bt=ja.isTouch&&!g.props.touch,ct=_y(g.props.duration,0,Na.duration);if(!(ke||Qe||et||bt)&&!E().hasAttribute("disabled")&&(Z("onShow",[g],!1),g.props.onShow(g)!==!1)){if(g.state.isVisible=!0,P()&&(L.style.visibility="visible"),V(),U(),g.state.isMounted||(L.style.transition="none"),P()){var ht=F(),At=ht.box,Ft=ht.content;Ey([At,Ft],0)}d=function(){var Nn;if(!(!g.state.isVisible||l)){if(l=!0,L.offsetHeight,L.style.transition=g.props.moveTransition,P()&&g.props.animation){var aa=F(),Ea=aa.box,io=aa.content;Ey([Ea,io],ct),CO([Ea,io],"visible")}J(),se(),NO(Wy,g),(Nn=g.popperInstance)==null||Nn.forceUpdate(),Z("onMount",[g]),g.props.animation&&P()&&oe(ct,function(){g.state.isShown=!0,Z("onShown",[g])})}},ge()}}function Ne(){var ke=!g.state.isVisible,Qe=g.state.isDestroyed,et=!g.state.isEnabled,bt=_y(g.props.duration,1,Na.duration);if(!(ke||Qe||et)&&(Z("onHide",[g],!1),g.props.onHide(g)!==!1)){if(g.state.isVisible=!1,g.state.isShown=!1,l=!1,a=!1,P()&&(L.style.visibility="hidden"),D(),te(),V(!0),P()){var ct=F(),ht=ct.box,At=ct.content;g.props.animation&&(Ey([ht,At],bt),CO([ht,At],"hidden"))}J(),se(),g.props.animation?P()&&z(bt,g.unmount):g.unmount()}}function Fe(ke){I().addEventListener("mousemove",p),NO(Am,p),p(ke)}function Be(){g.state.isVisible&&g.hide(),g.state.isMounted&&(ae(),ce().forEach(function(ke){ke._tippy.unmount()}),L.parentNode&&L.parentNode.removeChild(L),Wy=Wy.filter(function(ke){return ke!==g}),g.state.isMounted=!1,Z("onHidden",[g]))}function qe(){g.state.isDestroyed||(g.clearDelayTimeouts(),g.unmount(),$(),delete e._tippy,g.state.isDestroyed=!0,Z("onDestroy",[g]))}}function ju(e,t){t===void 0&&(t={});var n=Na.plugins.concat(t.plugins||[]);qre();var r=Object.assign({},t,{plugins:n}),o=Gre(e),i=o.reduce(function(a,s){var c=s&&coe(s,r);return c&&a.push(c),a},[]);return o2(e)?i[0]:i}ju.defaultProps=Na;ju.setDefaultProps=ioe;ju.currentInput=ja;Object.assign({},zC,{effect:function(t){var n=t.state,r={popper:{position:n.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(n.elements.popper.style,r.popper),n.styles=r,n.elements.arrow&&Object.assign(n.elements.arrow.style,r.arrow)}});ju.setDefaultProps({render:fI});const uoe=Ie({__name:"Popover",props:{value:{type:Boolean,default:!1},trigger:{default:"click"},placement:{default:"bottom"},appendTo:{},contentStyle:{},center:{type:Boolean,default:!1}},emits:["update:value"],setup(e,{emit:t}){const n=e,r=t,o=he(),i=he(),a=he(),s=he(!1),c=Me(()=>n.contentStyle||{});return Tt(()=>n.value,()=>{o.value&&(n.value?o.value.show():o.value.hide())}),wn(()=>{o.value&&o.value.destroy()}),Ht(()=>{o.value=ju(i.value,{content:a.value,allowHTML:!0,trigger:n.trigger,placement:n.placement,interactive:!0,appendTo:n.appendTo||document.body,maxWidth:"none",offset:[0,8],duration:200,animation:"scale",theme:"popover",onShow(){s.value=!0},onShown(){n.value||r("update:value",!0)},onHidden(){n.value&&r("update:value",!1),s.value=!1}})}),(l,u)=>(Y(),q("div",{class:Ge(["popover",{center:l.center}]),ref_key:"triggerRef",ref:i},[W("div",{class:"popover-content",style:we(c.value),ref_key:"contentRef",ref:a},[s.value?lr(l.$slots,"content",{key:0},void 0,!0):Ze("",!0)],4),lr(l.$slots,"default",{},void 0,!0)],2))}}),Pt=Ve(uoe,[["__scopeId","data-v-7277ff01"]]),foe=Ie({__name:"PopoverMenuItem",props:{center:{type:Boolean,default:!1}},emits:["click"],setup(e,{emit:t}){const n=t;return(r,o)=>(Y(),q("div",{class:Ge(["popover-menu-item",{center:r.center}]),onClick:o[0]||(o[0]=i=>n("click"))},[lr(r.$slots,"default",{},void 0,!0)],2))}}),Oo=Ve(foe,[["__scopeId","data-v-1f176c16"]]),doe={class:"editor-header"},hoe={class:"left"},poe={class:"menu-item"},moe={class:"title"},voe=["title"],goe={class:"right"},Aoe={class:"group-menu-item"},Roe={class:"arrow-btn"},yoe={class:"github-link",href:"https://github.com/pipipi-pikachu/PPTist",target:"_blank"},boe={class:"menu-item"},xoe=Ie({__name:"index",setup(e){const t=ft(),n=st(),{title:r}=Ee(n),{enterScreening:o,enterScreeningFromStart:i}=Sc(),{importSpecificFile:a,importPPTXFile:s,exporting:c}=hne(),{resetSlides:l}=Bd(),u=he(!1),f=he(!1),d=he(!1),h=he(),p=he(""),m=()=>{p.value=r.value,d.value=!0,Wr(()=>{var R;return(R=h.value)==null?void 0:R.focus()})},A=()=>{n.setTitle(p.value),d.value=!1},x=R=>{window.open(R),u.value=!1},y=R=>{t.setDialogForExport(R),u.value=!1};return(R,g)=>{const b=xe("IconHamburgerButton"),L=xe("IconPpt"),T=xe("IconDown"),M=xe("IconDownload"),w=xe("IconGithub"),k=Sn("tooltip");return Y(),q("div",doe,[W("div",hoe,[O(Pt,{trigger:"click",placement:"bottom-start",value:u.value,"onUpdate:value":g[7]||(g[7]=_=>u.value=_)},{content:ie(()=>[O(Fu,{accept:".pptist",onChange:g[0]||(g[0]=_=>{G(a)(_),u.value=!1})},{default:ie(()=>[O(Oo,null,{default:ie(()=>[We("导入 pptist 文件")]),_:1})]),_:1}),O(Fu,{accept:"application/vnd.openxmlformats-officedocument.presentationml.presentation",onChange:g[1]||(g[1]=_=>{G(s)(_),u.value=!1})},{default:ie(()=>[O(Oo,null,{default:ie(()=>[We("导入 pptx 文件(测试版)")]),_:1})]),_:1}),O(Oo,{onClick:g[2]||(g[2]=_=>y("pptx"))},{default:ie(()=>[We("导出文件")]),_:1}),O(Oo,{onClick:g[3]||(g[3]=_=>{G(l)(),u.value=!1})},{default:ie(()=>[We("重置幻灯片")]),_:1}),O(Oo,{onClick:g[4]||(g[4]=_=>x("https://github.com/pipipi-pikachu/PPTist/issues"))},{default:ie(()=>[We("意见反馈")]),_:1}),O(Oo,{onClick:g[5]||(g[5]=_=>x("https://github.com/pipipi-pikachu/PPTist/blob/master/doc/Q&A.md"))},{default:ie(()=>[We("常见问题")]),_:1}),O(Oo,{onClick:g[6]||(g[6]=_=>{u.value=!1,f.value=!0})},{default:ie(()=>[We("快捷键")]),_:1})]),default:ie(()=>[W("div",poe,[O(b,{class:"icon"})])]),_:1},8,["value"]),W("div",moe,[d.value?(Y(),Te(_u,{key:0,class:"title-input",ref_key:"titleInputRef",ref:h,value:p.value,"onUpdate:value":g[8]||(g[8]=_=>p.value=_),onBlur:g[9]||(g[9]=_=>A())},null,8,["value"])):(Y(),q("div",{key:1,class:"title-text",onClick:g[10]||(g[10]=_=>m()),title:G(r)},gt(G(r)),9,voe))])]),W("div",goe,[W("div",Aoe,[Ke((Y(),q("div",{class:"menu-item",onClick:g[11]||(g[11]=_=>G(o)())},[O(L,{class:"icon"})])),[[k,"幻灯片放映"]]),O(Pt,{trigger:"click",center:""},{content:ie(()=>[O(Oo,{onClick:g[12]||(g[12]=_=>G(i)())},{default:ie(()=>[We("从头开始")]),_:1}),O(Oo,{onClick:g[13]||(g[13]=_=>G(o)())},{default:ie(()=>[We("从当前页开始")]),_:1})]),default:ie(()=>[W("div",Roe,[O(T,{class:"arrow"})])]),_:1})]),Ke((Y(),q("div",{class:"menu-item",onClick:g[14]||(g[14]=_=>y("pptx"))},[O(M,{class:"icon"})])),[[k,"导出"]]),Ke((Y(),q("a",yoe,[W("div",boe,[O(w,{class:"icon"})])])),[[k,"Copyright © 2020-PRESENT pipipi-pikachu"]])]),O(Nne,{width:320,visible:f.value,"onUpdate:visible":g[15]||(g[15]=_=>f.value=_),placement:"right"},{default:ie(()=>[O(Rne)]),_:1},8,["visible"]),O($x,{loading:G(c),tip:"正在导入..."},null,8,["loading"])])}}}),Soe=Ve(xoe,[["__scopeId","data-v-89efe6b2"]]),qu=Symbol(),a5=Symbol(),dI=Symbol(),Moe=()=>{const e=window.getSelection();e&&e.removeAllRanges()},woe=e=>{const t=he(0),n=he(0),r=ft(),{canvasPercentage:o,canvasDragged:i}=Ee(r),{viewportRatio:a}=Ee(st()),s=()=>{if(!e.value)return;const d=e.value.clientWidth,h=e.value.clientHeight;if(h/d>a.value){const p=d*(o.value/100);r.setCanvasScale(p/Gt),t.value=(d-p)/2,n.value=(h-p*a.value)/2}else{const p=h*(o.value/100);r.setCanvasScale(p/(Gt*a.value)),t.value=(d-p/a.value)/2,n.value=(h-p)/2}};Tt(o,(d,h)=>{if(!e.value)return;const p=e.value.clientWidth,m=e.value.clientHeight;if(m/p>a.value){const A=p*(d/100),x=p*(h/100),y=A*a.value,R=x*a.value;r.setCanvasScale(A/Gt),t.value=t.value-(A-x)/2,n.value=n.value-(y-R)/2}else{const A=m*(d/100),x=m*(h/100),y=A/a.value,R=x/a.value;r.setCanvasScale(A/(Gt*a.value)),t.value=t.value-(y-R)/2,n.value=n.value-(A-x)/2}}),Tt(a,s),Tt(i,()=>{i.value||s()});const l=Me(()=>({width:Gt,height:Gt*a.value,left:t.value,top:n.value})),u=new ResizeObserver(s);return Ht(()=>{e.value&&u.observe(e.value)}),wn(()=>{e.value&&u.unobserve(e.value)}),{viewportStyles:l,dragViewport:d=>{let h=!0;const p=d.pageX,m=d.pageY,A=t.value,x=n.value;document.onmousemove=y=>{if(!h)return;const R=y.pageX,g=y.pageY;t.value=A+(R-p),n.value=x+(g-m)},document.onmouseup=()=>{h=!1,document.onmousemove=null,document.onmouseup=null,r.setCanvasDragged(!0)}}}},Loe=(e,t)=>{const n=ft(),{canvasScale:r,hiddenElementIdList:o}=Ee(n),i=he(!1),a=he(1),s=he({top:0,left:0,width:0,height:0});return{mouseSelection:s,mouseSelectionVisible:i,mouseSelectionQuadrant:a,updateMouseSelection:l=>{if(!t.value)return;let u=!0;const f=t.value.getBoundingClientRect(),d=5,h=l.pageX,p=l.pageY,m=(h-f.x)/r.value,A=(p-f.y)/r.value;s.value={top:A,left:m,width:0,height:0},i.value=!1,a.value=4,document.onmousemove=x=>{if(!u)return;const y=x.pageX,R=x.pageY,g=(y-h)/r.value,b=(R-p)/r.value,L=Math.abs(g),T=Math.abs(b);if(L0&&b>0?M=4:g<0&&b<0?M=2:g>0&&b<0?M=1:g<0&&b>0&&(M=3),s.value={...s.value,width:L,height:T},i.value=!0,a.value=M},document.onmouseup=()=>{document.onmousemove=null,document.onmouseup=null,u=!1;let x=[];for(let R=0;Rb&&kL&&Pb-T&&kL-M&&Pb&&kL-M&&Pb-T&&kL&&P{if(R.groupId){const g=x.map(L=>L.id);return e.value.filter(L=>L.groupId===R.groupId).every(L=>g.includes(L.id))}return!0});const y=x.map(R=>R.id);n.setActiveElementIdList(y),i.value=!1}}}},Ooe=e=>{const{disableHotkeys:t}=Ee(ft()),{createImageElement:n,createTextElement:r}=Ju(),o=i=>{if(!i.dataTransfer||i.dataTransfer.items.length===0)return;const a=i.dataTransfer.items[0];if(a.kind==="file"&&a.type.indexOf("image")!==-1){const s=a.getAsFile();s&&Hu(s).then(c=>n(c))}else a.kind==="string"&&a.type==="text/plain"&&a.getAsString(s=>{if(t.value)return;const c=Px(s);r({left:0,top:0,width:600,height:50},{content:c})})};Ht(()=>{e.value&&e.value.addEventListener("drop",o),document.ondragleave=i=>i.preventDefault(),document.ondrop=i=>i.preventDefault(),document.ondragenter=i=>i.preventDefault(),document.ondragover=i=>i.preventDefault()}),wn(()=>{e.value&&e.value.removeEventListener("drop",o),document.ondragleave=null,document.ondrop=null,document.ondragenter=null,document.ondragover=null})},Toe=(e,t)=>{const n=Math.atan2(e,t);return 180/Math.PI*n},hI=(e,t,n)=>{const r=st(),{addHistorySnapshot:o}=Jt();return{rotateElement:(a,s)=>{const c=!(a instanceof MouseEvent);if(c&&(!a.changedTouches||!a.changedTouches[0]))return;let l=!0,u=0;const f=s.rotate||0,d=s.left,h=s.top,p=s.width,m=s.height,A=d+p/2,x=h+m/2;if(!t.value)return;const y=t.value.getBoundingClientRect(),R=b=>{if(!l)return;const L=b instanceof MouseEvent?b.pageX:b.changedTouches[0].pageX,T=b instanceof MouseEvent?b.pageY:b.changedTouches[0].pageY,M=(L-y.left)/n.value,w=(T-y.top)/n.value,k=M-A,_=x-w;u=Toe(k,_);const P=5;Math.abs(u)<=P?u=0:u>0&&Math.abs(u-45)<=P?u-=u-45:u<0&&Math.abs(u+45)<=P?u-=u+45:u>0&&Math.abs(u-90)<=P?u-=u-90:u<0&&Math.abs(u+90)<=P?u-=u+90:u>0&&Math.abs(u-135)<=P?u-=u-135:u<0&&Math.abs(u+135)<=P?u-=u+135:u>0&&Math.abs(u-180)<=P?u-=u-180:u<0&&Math.abs(u+180)<=P&&(u-=u+180),e.value=e.value.map(E=>s.id===E.id?{...E,rotate:u}:E)},g=()=>{l=!1,document.onmousemove=null,document.onmouseup=null,f!==u&&(r.updateSlide({elements:e.value}),o())};c?(document.ontouchmove=R,document.ontouchend=g):(document.onmousemove=R,document.onmouseup=g)}}},z0={text:"文本",image:"图片",shape:"形状",line:"线条",chart:"图表",table:"表格",video:"视频",audio:"音频",latex:"公式"},pI={text:20,image:20,shape:20,chart:200,table:20,video:250,audio:20,latex:20},WO=(e,t)=>{const{left:n,top:r,width:o,height:i}=e,a=Math.sqrt(Math.pow(o,2)+Math.pow(i,2))/2,s=Math.atan(i/o)*180/Math.PI,c=(180-t-s)*Math.PI/180,l=(s-t)*Math.PI/180,u=(90-t)*Math.PI/180,f=t*Math.PI/180,d=o/2,h=i/2,p=n+d,m=r+h,A={left:p+a*Math.cos(c),top:m-a*Math.sin(c)},x={left:p+h*Math.cos(u),top:m-h*Math.sin(u)},y={left:p+a*Math.cos(l),top:m-a*Math.sin(l)},R={left:p+d*Math.cos(f),top:m+d*Math.sin(f)},g={left:p-a*Math.cos(c),top:m+a*Math.sin(c)},b={left:p-h*Math.sin(f),top:m+h*Math.cos(f)},L={left:p-a*Math.cos(l),top:m+a*Math.sin(l)},T={left:p-d*Math.cos(f),top:m-d*Math.sin(f)};return{leftTopPoint:A,topPoint:x,rightTopPoint:y,rightPoint:R,rightBottomPoint:g,bottomPoint:b,leftBottomPoint:L,leftPoint:T}},VO=(e,t)=>({[mt.RIGHT_BOTTOM]:t.leftTopPoint,[mt.LEFT_BOTTOM]:t.rightTopPoint,[mt.LEFT_TOP]:t.rightBottomPoint,[mt.RIGHT_TOP]:t.leftBottomPoint,[mt.TOP]:t.bottomPoint,[mt.BOTTOM]:t.topPoint,[mt.LEFT]:t.rightPoint,[mt.RIGHT]:t.leftPoint})[e],mI=(e,t,n)=>{const r=ft(),o=st(),{activeElementIdList:i,activeGroupElementId:a}=Ee(r),{viewportRatio:s}=Ee(o),{ctrlOrShiftKeyActive:c}=Ee(Ss()),{addHistorySnapshot:l}=Jt();return{scaleElement:(d,h,p)=>{const m=!(d instanceof MouseEvent);if(m&&(!d.changedTouches||!d.changedTouches[0]))return;let A=!0;r.setScalingState(!0);const x=h.left,y=h.top,R=h.width,g=h.height,b=h.type==="table"?h.cellMinHeight:0,L="rotate"in h&&h.rotate?h.rotate:0,T=Math.PI*L/180,M=c.value||"fixedRatio"in h&&h.fixedRatio,w=R/g,k=m?d.changedTouches[0].pageX:d.pageX,_=m?d.changedTouches[0].pageY:d.pageY,P=pI[h.type]||20,E=Q=>Q{const U=[];let te=!1,z=!1;const oe={offsetX:0,offsetY:0};if(B||B===0)for(let pe=0;pe{if(!A)return;const B=Q instanceof MouseEvent?Q.pageX:Q.changedTouches[0].pageX,H=Q instanceof MouseEvent?Q.pageY:Q.changedTouches[0].pageY,U=B-k,te=H-_;let z=R,oe=g,pe=x,Ae=y;if(L){const me=(Math.cos(T)*U+Math.sin(T)*te)/n.value;let $=(Math.cos(T)*te-Math.sin(T)*U)/n.value;M&&((p===mt.RIGHT_BOTTOM||p===mt.LEFT_TOP)&&($=me/w),(p===mt.LEFT_BOTTOM||p===mt.RIGHT_TOP)&&($=-me/w)),p===mt.RIGHT_BOTTOM?(z=E(R+me),oe=E(g+$)):p===mt.LEFT_BOTTOM?(z=E(R-me),oe=E(g+$),pe=x-(z-R)):p===mt.LEFT_TOP?(z=E(R-me),oe=E(g-$),pe=x-(z-R),Ae=y-(oe-g)):p===mt.RIGHT_TOP?(z=E(R+me),oe=E(g-$),Ae=y-(oe-g)):p===mt.TOP?(oe=E(g-$),Ae=y-(oe-g)):p===mt.BOTTOM?oe=E(g+$):p===mt.LEFT?(z=E(R-me),pe=x-(z-R)):p===mt.RIGHT&&(z=E(R+me));const ue=WO({width:z,height:oe,left:pe,top:Ae},L),X=VO(p,ue),ne=X.left,le=X.top,j=ne-F,ee=le-N;pe=pe-j,Ae=Ae-ee}else{let me=U/n.value,$=te/n.value;if(M&&((p===mt.RIGHT_BOTTOM||p===mt.LEFT_TOP)&&($=me/w),(p===mt.LEFT_BOTTOM||p===mt.RIGHT_TOP)&&($=-me/w)),p===mt.RIGHT_BOTTOM){const{offsetX:ue,offsetY:X}=J(x+R+me,y+g+$);me=me-ue,$=$-X,M&&(X?me=$*w:$=me/w),z=E(R+me),oe=E(g+$)}else if(p===mt.LEFT_BOTTOM){const{offsetX:ue,offsetY:X}=J(x+me,y+g+$);me=me-ue,$=$-X,M&&(X?me=-$*w:$=-me/w),z=E(R-me),oe=E(g+$),pe=x-(z-R)}else if(p===mt.LEFT_TOP){const{offsetX:ue,offsetY:X}=J(x+me,y+$);me=me-ue,$=$-X,M&&(X?me=$*w:$=me/w),z=E(R-me),oe=E(g-$),pe=x-(z-R),Ae=y-(oe-g)}else if(p===mt.RIGHT_TOP){const{offsetX:ue,offsetY:X}=J(x+R+me,y+$);me=me-ue,$=$-X,M&&(X?me=-$*w:$=-me/w),z=E(R+me),oe=E(g-$),Ae=y-(oe-g)}else if(p===mt.LEFT){const{offsetX:ue}=J(x+me,null);me=me-ue,z=E(R-me),pe=x-(z-R)}else if(p===mt.RIGHT){const{offsetX:ue}=J(x+R+me,null);me=me-ue,z=E(R+me)}else if(p===mt.TOP){const{offsetY:ue}=J(null,y+$);$=$-ue,oe=E(g-$),Ae=y-(oe-g)}else if(p===mt.BOTTOM){const{offsetY:ue}=J(null,y+g+$);$=$-ue,oe=E(g+$)}}e.value=e.value.map(me=>{if(h.id!==me.id)return me;if(me.type==="shape"&&"pathFormula"in me&&me.pathFormula){const $=Gu[me.pathFormula];let ue="";return"editable"in $?ue=$.formula(z,oe,me.keypoint):ue=$.formula(z,oe),{...me,left:pe,top:Ae,width:z,height:oe,viewBox:[z,oe],path:ue}}if(me.type==="table"){let $=b+(oe-g)/me.data.length;return $=$<36?36:$,$===b?{...me,left:pe,width:z}:{...me,left:pe,top:Ae,width:z,height:oe,cellMinHeight:$<36?36:$}}return{...me,left:pe,top:Ae,width:z,height:oe}})},D=Q=>{A=!1,document.ontouchmove=null,document.ontouchend=null,document.onmousemove=null,document.onmouseup=null,t.value=[];const B=Q instanceof MouseEvent?Q.pageX:Q.changedTouches[0].pageX,H=Q instanceof MouseEvent?Q.pageY:Q.changedTouches[0].pageY;k===B&&_===H||(o.updateSlide({elements:e.value}),r.setScalingState(!1),l())};m?(document.ontouchmove=se,document.ontouchend=D):(document.onmousemove=se,document.onmouseup=D)},scaleMultiElement:(d,h,p)=>{let m=!0;const{minX:A,maxX:x,minY:y,maxY:R}=h,g=x-A,b=R-y,L=g/b,T=d.pageX,M=d.pageY,w=JSON.parse(JSON.stringify(e.value));document.onmousemove=k=>{if(!m)return;const _=k.pageX,P=k.pageY,E=(_-T)/n.value;let I=(P-M)/n.value;c.value&&((p===mt.RIGHT_BOTTOM||p===mt.LEFT_TOP)&&(I=E/L),(p===mt.LEFT_BOTTOM||p===mt.RIGHT_TOP)&&(I=-E/L));let F=A,N=x,V=y,Z=R;p===mt.RIGHT_BOTTOM?(N=x+E,Z=R+I):p===mt.LEFT_BOTTOM?(F=A+E,Z=R+I):p===mt.LEFT_TOP?(F=A+E,V=y+I):p===mt.RIGHT_TOP?(N=x+E,V=y+I):p===mt.TOP?V=y+I:p===mt.BOTTOM?Z=R+I:p===mt.LEFT?F=A+E:p===mt.RIGHT&&(N=x+E);const J=N-F,se=Z-V;let D=J/g,Q=se/b;D<=0&&(D=0),Q<=0&&(Q=0),e.value=e.value.map(B=>{if((B.type==="image"||B.type==="shape")&&i.value.includes(B.id)){const H=w.find(U=>U.id===B.id);return{...B,width:H.width*D,height:H.height*Q,left:F+(H.left-A)*D,top:V+(H.top-y)*Q}}return B})},document.onmouseup=k=>{m=!1,document.onmousemove=null,document.onmouseup=null,!(T===k.pageX&&M===k.pageY)&&(o.updateSlide({elements:e.value}),l())}}}},koe=(e,t)=>{const n=ft(),{activeElementIdList:r,activeGroupElementId:o,handleElementId:i,editorAreaFocus:a}=Ee(n),{ctrlOrShiftKeyActive:s}=Ee(Ss());return{selectElement:(l,u,f=!0)=>{if(a.value||n.setEditorareaFocus(!0),r.value.includes(u.id)){if(s.value){let d=[];if(u.groupId){const h=[];e.value.forEach(p=>{p.groupId===u.groupId&&h.push(p.id)}),d=r.value.filter(p=>!h.includes(p))}else d=r.value.filter(h=>h!==u.id);d.length>0&&n.setActiveElementIdList(d)}else if(i.value!==u.id)n.setHandleElementId(u.id);else if(o.value!==u.id){const d=l instanceof MouseEvent?l.pageX:l.changedTouches[0].pageX,h=l instanceof MouseEvent?l.pageY:l.changedTouches[0].pageY;l.target.onmouseup=p=>{const m=p.pageX,A=p.pageY;d===m&&h===A&&(n.setActiveGroupElementId(u.id),p.target.onmouseup=null)}}}else{let d=[];if(s.value?d=[...r.value,u.id]:d=[u.id],u.groupId){const h=[];e.value.forEach(p=>{p.groupId===u.groupId&&h.push(p.id)}),d=[...d,...h]}n.setActiveElementIdList(Fn.uniq(d)),n.setHandleElementId(u.id)}f&&t(l,u)}}},vI=(e,t,n)=>{const r=st(),{activeElementIdList:o,activeGroupElementId:i}=Ee(ft()),{shiftKeyState:a}=Ee(Ss()),{viewportRatio:s}=Ee(r),{addHistorySnapshot:c}=Jt();return{dragElement:(u,f)=>{const d=!(u instanceof MouseEvent);if(d&&(!u.changedTouches||!u.changedTouches[0])||!o.value.includes(f.id))return;let h=!0;const p=Gt,m=Gt*s.value,A=5,y=JSON.parse(JSON.stringify(e.value)).filter(Q=>o.value.includes(Q.id)),R=f.left,g=f.top,b=f.width,L="height"in f&&f.height?f.height:0,T="rotate"in f&&f.rotate?f.rotate:0,M=d?u.changedTouches[0].pageX:u.pageX,w=d?u.changedTouches[0].pageY:u.pageY;let k=null;const _=f.id===i.value;let P=[],E=[];for(const Q of e.value){if(Q.type==="line"||_&&Q.id===f.id||!_&&o.value.includes(Q.id))continue;let B,H,U,te;if("rotate"in Q&&Q.rotate){const{xRange:j,yRange:ee}=ud({left:Q.left,top:Q.top,width:Q.width,height:Q.height,rotate:Q.rotate});B=j[0],H=ee[0],U=j[1]-j[0],te=ee[1]-ee[0]}else B=Q.left,H=Q.top,U=Q.width,te=Q.height;const z=B+U,oe=H+te,pe=H+te/2,Ae=B+U/2,me={value:H,range:[B,z]},$={value:oe,range:[B,z]},ue={value:pe,range:[B,z]},X={value:B,range:[H,oe]},ne={value:z,range:[H,oe]},le={value:Ae,range:[H,oe]};P.push(me,$,ue),E.push(X,ne,le)}const I={value:0,range:[0,p]},F={value:m,range:[0,p]},N={value:m/2,range:[0,p]},V={value:0,range:[0,m]},Z={value:p,range:[0,m]},J={value:p/2,range:[0,m]};P.push(I,F,N),E.push(V,Z,J),P=Vv(P),E=Vv(E);const se=Q=>{const B=Q instanceof MouseEvent?Q.pageX:Q.changedTouches[0].pageX,H=Q instanceof MouseEvent?Q.pageY:Q.changedTouches[0].pageY;if(k!==!1&&(k=Math.abs(M-B)Math.abs(te)&&(te=0),Math.abs(U)ee.id===f.id?{...ee,left:z,top:oe}:ee);else{const ee=e.value.find(ae=>ae.id===f.id);if(!ee)return;e.value=e.value.map(ae=>o.value.includes(ae.id)?ae.id===f.id?{...ae,left:z,top:oe}:{...ae,left:ae.left+(z-ee.left),top:ae.top+(oe-ee.top)}:ae)}},D=Q=>{h=!1,document.ontouchmove=null,document.ontouchend=null,document.onmousemove=null,document.onmouseup=null,t.value=[];const B=Q instanceof MouseEvent?Q.pageX:Q.changedTouches[0].pageX,H=Q instanceof MouseEvent?Q.pageY:Q.changedTouches[0].pageY;M===B&&w===H||(r.updateSlide({elements:e.value}),c())};d?(document.ontouchmove=se,document.ontouchend=D):(document.onmousemove=se,document.onmouseup=D)}}},Noe=e=>{const t=st(),{canvasScale:n}=Ee(ft()),{ctrlOrShiftKeyActive:r}=Ee(Ss()),{addHistorySnapshot:o}=Jt();return{dragLineElement:(a,s,c)=>{let l=!0;const u=8,f=a.pageX,d=a.pageY,h=[];for(let p=0;p{if(!l)return;const m=p.pageX,A=p.pageY,x=(m-f)/n.value,y=(A-d)/n.value;let R=s.left+s.start[0],g=s.top+s.start[1],b=s.left+s.end[0],L=s.top+s.end[1];const T=s.broken||s.curve||[0,0];let M=s.left+T[0],w=s.top+T[1];const[k,_]=s.cubic||[[0,0],[0,0]];let P=s.left+k[0],E=s.top+k[1],I=s.left+_[0],F=s.top+_[1];if(c===Go.START){R=R+x,g=g+y,Math.abs(R-b)b&&(se[0]=Z-N,D[0]=0),g>L&&(se[1]=J-V,D[1]=0),e.value=e.value.map(Q=>{if(Q.id===s.id){const B={...Q,left:N,top:V,start:se,end:D};return c===Go.START||c===Go.END?r.value?(s.broken&&(B.broken=[M-N,w-V]),s.curve&&(B.curve=[M-N,w-V]),s.cubic&&(B.cubic=[[P-N,E-V],[I-N,F-V]])):(s.broken&&(B.broken=[(se[0]+D[0])/2,(se[1]+D[1])/2]),s.curve&&(B.curve=[(se[0]+D[0])/2,(se[1]+D[1])/2]),s.cubic&&(B.cubic=[[(se[0]+D[0])/2,(se[1]+D[1])/2],[(se[0]+D[0])/2,(se[1]+D[1])/2]])):c===Go.C?(s.broken&&(B.broken=[M-N,w-V]),s.curve&&(B.curve=[M-N,w-V])):s.cubic&&(B.cubic=[[P-N,E-V],[I-N,F-V]]),B}return Q})},document.onmouseup=p=>{l=!1,document.onmousemove=null,document.onmouseup=null;const m=p.pageX,A=p.pageY;f===m&&d===A||(t.updateSlide({elements:e.value}),o())}}}},Poe=(e,t)=>{const n=st(),{addHistorySnapshot:r}=Jt();return{moveShapeKeypoint:(i,a)=>{const s=!(i instanceof MouseEvent);if(s&&(!i.changedTouches||!i.changedTouches[0]))return;let c=!0;const l=s?i.changedTouches[0].pageX:i.pageX,u=s?i.changedTouches[0].pageY:i.pageY,f=Gu[a.pathFormula];let d=null;if("editable"in f){const m=f.getBaseSize(a.width,a.height),A=m*a.keypoint,[x,y]=f.range,R=f.relative;d={baseSize:m,originPos:A,min:x,max:y,relative:R}}const h=m=>{if(!c)return;const A=m instanceof MouseEvent?m.pageX:m.changedTouches[0].pageX,x=m instanceof MouseEvent?m.pageY:m.changedTouches[0].pageY,y=(A-l)/t.value,R=(x-u)/t.value;e.value=e.value.map(g=>{if(g.id===a.id&&d){const{baseSize:b,originPos:L,min:T,max:M,relative:w}=d,k=g;let _=0;return w==="left"&&(_=(L+y)/b),w==="right"&&(_=(L-y)/b),w==="center"&&(_=(L-y*2)/b),w==="top"&&(_=(L+R)/b),w==="bottom"&&(_=(L-R)/b),_M&&(_=M),{...g,keypoint:_,path:f.formula(k.width,k.height,_)}}return g})},p=m=>{c=!1,document.ontouchmove=null,document.ontouchend=null,document.onmousemove=null,document.onmouseup=null;const A=m instanceof MouseEvent?m.pageX:m.changedTouches[0].pageX,x=m instanceof MouseEvent?m.pageY:m.changedTouches[0].pageY;l===A&&u===x||(n.updateSlide({elements:e.value}),r())};s?(document.ontouchmove=h,document.ontouchend=p):(document.onmousemove=h,document.onmouseup=p)}}},Coe=e=>{const t=ft(),{canvasScale:n,creatingElement:r}=Ee(t),o=u=>{const{start:f,end:d}=u;if(!e.value)return;const h=e.value.getBoundingClientRect(),[p,m]=f,[A,x]=d,y=Math.min(p,A),R=Math.max(p,A),g=Math.min(m,x),b=Math.max(m,x),L=(y-h.x)/n.value,T=(g-h.y)/n.value,M=(R-y)/n.value,w=(b-g)/n.value;return{left:L,top:T,width:M,height:w}},i=u=>{const{start:f,end:d}=u;if(!e.value)return;const h=e.value.getBoundingClientRect(),[p,m]=f,[A,x]=d,y=Math.min(p,A),R=Math.max(p,A),g=Math.min(m,x),b=Math.max(m,x),L=(y-h.x)/n.value,T=(g-h.y)/n.value,M=(R-y)/n.value,w=(b-g)/n.value;return{left:L,top:T,start:[p===y?0:M,m===g?0:w],end:[A===y?0:M,x===g?0:w]}},{createTextElement:a,createShapeElement:s,createLineElement:c}=Ju();return{formatCreateSelection:o,insertElementFromCreateSelection:u=>{if(!r.value)return;const f=r.value.type;if(f==="text"){const d=o(u);d&&a(d,{vertical:r.value.vertical})}else if(f==="shape"){const d=o(u);d&&s(d,r.value.data)}else if(f==="line"){const d=i(u);d&&c(d,r.value.data)}t.setCreatingElement(null)}}},i2=()=>{const e=st(),{activeElementIdList:t,activeElementList:n}=Ee(ft()),{currentSlide:r,viewportRatio:o}=Ee(e),{addHistorySnapshot:i}=Jt();return{alignElementToCanvas:s=>{const c=Gt,l=Gt*o.value,{minX:u,maxX:f,minY:d,maxY:h}=ec(n.value),p=JSON.parse(JSON.stringify(r.value.elements));for(const m of p)if(t.value.includes(m.id)){if(s===on.CENTER){const A=d+(h-d)/2-l/2,x=u+(f-u)/2-c/2;m.top=m.top-A,m.left=m.left-x}if(s===on.TOP){const A=d-0;m.top=m.top-A}else if(s===on.VERTICAL){const A=d+(h-d)/2-l/2;m.top=m.top-A}else if(s===on.BOTTOM){const A=h-l;m.top=m.top-A}else if(s===on.LEFT){const A=u-0;m.left=m.left-A}else if(s===on.HORIZONTAL){const A=u+(f-u)/2-c/2;m.left=m.left-A}else if(s===on.RIGHT){const A=f-c;m.left=m.left-A}}e.updateSlide({elements:p}),i()}}},wc=e=>({shadowStyle:Me(()=>{if(e.value){const{h:n,v:r,blur:o,color:i}=e.value;return`${n}px ${r}px ${o}px ${i}`}return""})}),a2=(e,t)=>({flipStyle:Me(()=>{let r="";return e.value&&t.value?r="rotateX(180deg) rotateY(180deg)":t.value?r="rotateX(180deg)":e.value&&(r="rotateY(180deg)"),r})});var gI=(e=>(e.RECT="rect",e.ELLIPSE="ellipse",e.POLYGON="polygon",e))(gI||{});const K3={rect:{name:"矩形",type:"rect",radius:"0",style:""},rect2:{name:"矩形2",type:"polygon",style:"polygon(0% 0%, 80% 0%, 100% 20%, 100% 100%, 0 100%)",createPath:(e,t)=>`M 0 0 L ${e*.8} 0 L ${e} ${t*.2} L ${e} ${t} L 0 ${t} Z`},rect3:{name:"矩形3",type:"polygon",style:"polygon(0% 0%, 80% 0%, 100% 20%, 100% 100%, 20% 100%, 0% 80%)",createPath:(e,t)=>`M 0 0 L ${e*.8} 0 L ${e} ${t*.2} L ${e} ${t} L ${e*.2} ${t} L 0 ${t*.8} Z`},roundRect:{name:"圆角矩形",type:"rect",radius:"10px",style:"inset(0 0 0 0 round 10px 10px 10px 10px)"},ellipse:{name:"圆形",type:"ellipse",style:"ellipse(50% 50% at 50% 50%)"},triangle:{name:"三角形",type:"polygon",style:"polygon(50% 0%, 0% 100%, 100% 100%)",createPath:(e,t)=>`M ${e*.5} 0 L 0 ${t} L ${e} ${t} Z`},triangle2:{name:"三角形2",type:"polygon",style:"polygon(50% 100%, 0% 0%, 100% 0%)",createPath:(e,t)=>`M ${e*.5} ${t} L 0 0 L ${e} 0 Z`},triangle3:{name:"三角形3",type:"polygon",style:"polygon(0% 0%, 0% 100%, 100% 100%)",createPath:(e,t)=>`M 0 0 L 0 ${t} L ${e} ${t} Z`},rhombus:{name:"菱形",type:"polygon",style:"polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%)",createPath:(e,t)=>`M ${e*.5} 0 L ${e} ${t*.5} L ${e*.5} ${t} L 0 ${t*.5} Z`},pentagon:{name:"五边形",type:"polygon",style:"polygon(50% 0%, 100% 38%, 82% 100%, 18% 100%, 0% 38%)",createPath:(e,t)=>`M ${e*.5} 0 L ${e} ${.38*t} L ${.82*e} ${t} L ${.18*e} ${t} L 0 ${.38*t} Z`},hexagon:{name:"六边形",type:"polygon",style:"polygon(20% 0%, 80% 0%, 100% 50%, 80% 100%, 20% 100%, 0% 50%)",createPath:(e,t)=>`M ${e*.2} 0 L ${e*.8} 0 L ${e} ${t*.5} L ${e*.8} ${t} L ${e*.2} ${t} L 0 ${t*.5} Z`},heptagon:{name:"七边形",type:"polygon",style:"polygon(50% 0%, 90% 20%, 100% 60%, 75% 100%, 25% 100%, 0% 60%, 10% 20%)",createPath:(e,t)=>`M ${e*.5} 0 L ${e*.9} ${t*.2} L ${e} ${t*.6} L ${e*.75} ${t} L ${e*.25} ${t} L 0 ${t*.6} L ${e*.1} ${t*.2} Z`},octagon:{name:"八边形",type:"polygon",style:"polygon(30% 0%, 70% 0%, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0% 70%, 0% 30%)",createPath:(e,t)=>`M ${e*.3} 0 L ${e*.7} 0 L ${e} ${t*.3} L ${e} ${t*.7} L ${e*.7} ${t} L ${e*.3} ${t} L 0 ${t*.7} L 0 ${t*.3} Z`},chevron:{name:"V形",type:"polygon",style:"polygon(75% 0%, 100% 50%, 75% 100%, 0% 100%, 25% 50%, 0% 0%)",createPath:(e,t)=>`M ${e*.75} 0 L ${e} ${t*.5} L ${e*.75} ${t} L 0 ${t} L ${e*.25} ${t*.5} L 0 0 Z`},point:{name:"点",type:"polygon",style:"polygon(0% 0%, 75% 0%, 100% 50%, 75% 100%, 0% 100%)",createPath:(e,t)=>`M 0 0 L ${e*.75} 0 L ${e} ${t*.5} L ${e*.75} ${t} L 0 ${t} Z`},arrow:{name:"箭头",type:"polygon",style:"polygon(0% 20%, 60% 20%, 60% 0%, 100% 50%, 60% 100%, 60% 80%, 0% 80%)",createPath:(e,t)=>`M 0 ${t*.2} L ${e*.6} ${t*.2} L ${e*.6} 0 L ${e} ${t*.5} L ${e*.6} ${t} L ${e*.6} ${t*.8} L 0 ${t*.8} Z`},parallelogram:{name:"平行四边形",type:"polygon",style:"polygon(30% 0%, 100% 0%, 70% 100%, 0% 100%)",createPath:(e,t)=>`M ${e*.3} 0 L ${e} 0 L ${e*.7} ${t} L 0 ${t} Z`},parallelogram2:{name:"平行四边形2",type:"polygon",style:"polygon(30% 100%, 100% 100%, 70% 0%, 0% 0%)",createPath:(e,t)=>`M ${e*.3} ${t} L ${e} ${t} L ${e*.7} 0 L 0 0 Z`},trapezoid:{name:"梯形",type:"polygon",style:"polygon(25% 0%, 75% 0%, 100% 100%, 0% 100%)",createPath:(e,t)=>`M ${e*.25} 0 L ${e*.75} 0 L ${e} ${t} L 0 ${t} Z`},trapezoid2:{name:"梯形2",type:"polygon",style:"polygon(0% 0%, 100% 0%, 75% 100%, 25% 100%)",createPath:(e,t)=>`M 0 0 L ${e} 0 L ${e*.75} ${t} L ${e*.25} ${t} Z`}},s5=e=>{const t=Me(()=>{if(!e.value)return K3.rect;const r=e.value.shape||gI.RECT;return K3[r]}),n=Me(()=>{if(!e.value)return{top:"0",left:"0",width:"100%",height:"100%"};const[r,o]=e.value.range,i=(o[0]-r[0])/100,a=(o[1]-r[1])/100,s=r[0]/i,c=r[1]/a;return{left:-s+"%",top:-c+"%",width:100/i+"%",height:100/a+"%"}});return{clipShape:t,imgPosition:n}},AI=e=>({filter:Me(()=>{if(!e.value)return"";let n="";const r=Object.keys(e.value);for(const o of r)n+=`${o}(${e.value[o]}) `;return n})}),Hd=e=>{const t=Me(()=>{var i;return((i=e.value)==null?void 0:i.width)??0}),n=Me(()=>{var i;return((i=e.value)==null?void 0:i.style)||"solid"}),r=Me(()=>{var i;return((i=e.value)==null?void 0:i.color)||"#d14424"}),o=Me(()=>{if(n.value!=="dashed")return"0 0";const i=t.value;return i<=6?`${i*4.5} ${i*2}`:`${i*4} ${i*1.5}`});return{outlineWidth:t,outlineStyle:n,outlineColor:r,strokeDashArray:o}},Ioe=["width","height"],Foe=["rx","ry","width","height","stroke","stroke-width","stroke-dasharray"],_oe=Ie({__name:"ImageRectOutline",props:{width:{},height:{},outline:{},radius:{default:"0"}},setup(e){const t=e,{outlineWidth:n,outlineColor:r,strokeDashArray:o}=Hd(Xd(t,"outline"));return(i,a)=>i.outline?(Y(),q("svg",{key:0,class:"image-rect-outline",overflow:"visible",width:i.width,height:i.height},[W("rect",{"vector-effect":"non-scaling-stroke","stroke-linecap":"butt","stroke-miterlimit":"8",fill:"transparent",rx:i.radius,ry:i.radius,width:i.width,height:i.height,stroke:G(r),"stroke-width":G(n),"stroke-dasharray":G(o)},null,8,Foe)],8,Ioe)):Ze("",!0)}}),Eoe=Ve(_oe,[["__scopeId","data-v-09a0319c"]]),Xoe=["width","height"],Woe=["cx","cy","rx","ry","stroke","stroke-width","stroke-dasharray"],Voe=Ie({__name:"ImageEllipseOutline",props:{width:{},height:{},outline:{}},setup(e){const t=e,{outlineWidth:n,outlineColor:r,strokeDashArray:o}=Hd(Xd(t,"outline"));return(i,a)=>i.outline?(Y(),q("svg",{key:0,class:"image-ellipse-outline",overflow:"visible",width:i.width,height:i.height},[W("ellipse",{"vector-effect":"non-scaling-stroke","stroke-linecap":"butt","stroke-miterlimit":"8",fill:"transparent",cx:i.width/2,cy:i.height/2,rx:i.width/2,ry:i.height/2,stroke:G(r),"stroke-width":G(n),"stroke-dasharray":G(o)},null,8,Woe)],8,Xoe)):Ze("",!0)}}),Uoe=Ve(Voe,[["__scopeId","data-v-19e68d74"]]),Yoe=["width","height"],Qoe=["d","stroke","stroke-width","stroke-dasharray"],Zoe=Ie({__name:"ImagePolygonOutline",props:{width:{},height:{},createPath:{type:Function},outline:{}},setup(e){const t=e,{outlineWidth:n,outlineColor:r,strokeDashArray:o}=Hd(Xd(t,"outline"));return(i,a)=>i.outline?(Y(),q("svg",{key:0,class:"image-polygon-outline",overflow:"visible",width:i.width,height:i.height},[W("path",{"vector-effect":"non-scaling-stroke","stroke-linecap":"butt","stroke-miterlimit":"8",fill:"transparent",d:i.createPath(i.width,i.height),stroke:G(r),"stroke-width":G(n),"stroke-dasharray":G(o)},null,8,Qoe)],8,Yoe)):Ze("",!0)}}),Boe=Ve(Zoe,[["__scopeId","data-v-a036b0a3"]]),Doe={class:"image-outline"},RI=Ie({__name:"index",props:{elementInfo:{}},setup(e){const t=e,n=Me(()=>t.elementInfo.clip),{clipShape:r}=s5(n);return(o,i)=>(Y(),q("div",Doe,[G(r).type==="rect"?(Y(),Te(Eoe,{key:0,width:o.elementInfo.width,height:o.elementInfo.height,radius:G(r).radius,outline:o.elementInfo.outline},null,8,["width","height","radius","outline"])):G(r).type==="ellipse"?(Y(),Te(Uoe,{key:1,width:o.elementInfo.width,height:o.elementInfo.height,outline:o.elementInfo.outline},null,8,["width","height","outline"])):G(r).type==="polygon"?(Y(),Te(Boe,{key:2,width:o.elementInfo.width,height:o.elementInfo.height,outline:o.elementInfo.outline,createPath:G(r).createPath},null,8,["width","height","outline","createPath"])):Ze("",!0)]))}}),yI=e=>(qt("data-v-31b3b0f9"),e=e(),en(),e),Koe=["src"],Hoe=["src"],Goe=["onMousedown"],Joe=yI(()=>W("svg",{width:"16",height:"16",fill:"#fff",stroke:"#333"},[W("path",{"stroke-width":"0.3","shape-rendering":"crispEdges",d:"M 16 0 L 0 0 L 0 16 L 4 16 L 4 4 L 16 4 L 16 0 Z"})],-1)),zoe=[Joe],$oe=["onMousedown"],joe=yI(()=>W("svg",{width:"16",height:"16",fill:"#fff",stroke:"#333"},[W("path",{"stroke-width":"0.3","shape-rendering":"crispEdges",d:"M 16 0 L 0 0 L 0 4 L 16 4 Z"})],-1)),qoe=[joe],eie=Ie({__name:"ImageClipHandler",props:{src:{},clipPath:{},width:{},height:{},top:{},left:{},rotate:{},clipData:{}},emits:["clip"],setup(e,{emit:t}){const n=e,r=t,{canvasScale:o}=Ee(ft()),{ctrlOrShiftKeyActive:i}=Ee(Ss()),a=he({top:"0",left:"0"}),s=he(!1),c=he(null),l=()=>{const[M,w]=n.clipData?n.clipData.range:[[0,0],[100,100]],k=(w[0]-M[0])/100,_=(w[1]-M[1])/100,P=M[0]/k,E=M[1]/_;return{widthScale:k,heightScale:_,left:P,top:E}},u=Me(()=>{const{widthScale:M,heightScale:w,left:k,top:_}=l();return{left:-k,top:-_,width:100/M,height:100/w}}),f=Me(()=>({top:u.value.top+"%",left:u.value.left+"%",width:u.value.width+"%",height:u.value.height+"%"})),d=he({top:0,left:0,width:0,height:0}),h=Me(()=>{const{top:M,left:w,width:k,height:_}=d.value;return{top:M+"%",left:w+"%",width:k+"%",height:_+"%"}}),p=Me(()=>{const M=u.value.width,w=u.value.height,{top:k,left:_,width:P,height:E}=d.value;return{left:-_*(100/P)+"%",top:-k*(100/E)+"%",width:M/P*100+"%",height:w/E*100+"%"}}),m=()=>{const{left:M,top:w}=l();d.value={left:M,top:w,width:100,height:100},a.value={top:-w+"%",left:-M+"%"}},A=()=>{if(s.value)return;if(!c.value){r("clip",null);return}const{left:M,top:w}=l(),k={left:(d.value.left-M)/100*n.width,top:(d.value.top-w)/100*n.height,width:(d.value.width-100)/100*n.width,height:(d.value.height-100)/100*n.height},_={range:c.value,position:k};r("clip",_)},x=M=>{M.key.toUpperCase()===yt.ENTER&&A()};Ht(()=>{m(),document.addEventListener("keydown",x)}),wn(()=>{document.removeEventListener("keydown",x)});const y=()=>{const M={left:parseInt(p.value.left),top:parseInt(p.value.top),width:parseInt(p.value.width),height:parseInt(p.value.height)},w=100/M.width,k=100/M.height,_=[-M.left*w,-M.top*k],P=[w*100+_[0],k*100+_[1]];c.value=[_,P]},R=M=>{s.value=!0;let w=!0;const k=M.pageX,_=M.pageY,P=u.value,E={...d.value};document.onmousemove=I=>{if(!w)return;const F=I.pageX,N=I.pageY,V=(F-k)/o.value,Z=(N-_)/o.value,J=Math.sqrt(V*V+Z*Z),D=Math.atan2(Z,V)-n.rotate/180*Math.PI,Q=J*Math.cos(D)/n.width*100,B=J*Math.sin(D)/n.height*100;let H=E.left+Q,U=E.top+B;H<0?H=0:H+E.width>P.width&&(H=P.width-E.width),U<0?U=0:U+E.height>P.height&&(U=P.height-E.height),d.value={...d.value,left:H,top:U}},document.onmouseup=()=>{w=!1,document.onmousemove=null,document.onmouseup=null,y(),setTimeout(()=>{s.value=!1},0)}},g=(M,w)=>{s.value=!0;let k=!0;const _=50/n.width*100,P=50/n.height*100,E=M.pageX,I=M.pageY,F=u.value,N={...d.value},V=d.value.width/d.value.height;document.onmousemove=Z=>{if(!k)return;const J=Z.pageX,se=Z.pageY,D=(J-E)/o.value,Q=(se-I)/o.value,B=Math.sqrt(D*D+Q*Q),U=Math.atan2(Q,D)-n.rotate/180*Math.PI;let te=B*Math.cos(U)/n.width*100,z=B*Math.sin(U)/n.height*100;i.value&&((w===mt.RIGHT_BOTTOM||w===mt.LEFT_TOP)&&(z=te/V),(w===mt.LEFT_BOTTOM||w===mt.RIGHT_TOP)&&(z=-te/V));let oe,pe,Ae,me;w===mt.LEFT_TOP?(N.left+te<0&&(te=-N.left),N.top+z<0&&(z=-N.top),N.width-te<_&&(te=N.width-_),N.height-zF.width&&(te=F.width-(N.left+N.width)),N.top+z<0&&(z=-N.top),N.width+te<_&&(te=_-N.width),N.height-z
F.height&&(z=F.height-(N.top+N.height)),N.width-te<_&&(te=N.width-_),N.height+z
F.width&&(te=F.width-(N.left+N.width)),N.top+N.height+z>F.height&&(z=F.height-(N.top+N.height)),N.width+te<_&&(te=_-N.width),N.height+z
F.height&&(z=F.height-(N.top+N.height)),N.height+z
F.width&&(te=F.width-(N.left+N.width)),N.width+te<_&&(te=_-N.width),me=N.height,Ae=N.width+te,oe=N.left,pe=N.top),d.value={left:oe,top:pe,width:Ae,height:me}},document.onmouseup=()=>{k=!1,document.onmousemove=null,document.onmouseup=null,y(),setTimeout(()=>s.value=!1,0)}},b=Me(()=>{const M="rotate-",w=n.rotate;return w>-22.5&&w<=22.5?M+0:w>22.5&&w<=67.5?M+45:w>67.5&&w<=112.5?M+90:w>112.5&&w<=157.5?M+135:w>157.5||w<=-157.5?M+0:w>-157.5&&w<=-112.5?M+45:w>-112.5&&w<=-67.5?M+90:w>-67.5&&w<=-22.5?M+135:M+0}),L=[mt.LEFT_TOP,mt.RIGHT_TOP,mt.LEFT_BOTTOM,mt.RIGHT_BOTTOM],T=[mt.TOP,mt.BOTTOM,mt.LEFT,mt.RIGHT];return(M,w)=>{const k=Sn("click-outside");return Ke((Y(),q("div",{class:"image-clip-handler",style:we(a.value)},[W("img",{class:"bottom-img",src:M.src,draggable:!1,alt:"",style:we(f.value)},null,12,Koe),W("div",{class:"top-image-content",style:we({...h.value,clipPath:M.clipPath})},[W("img",{class:"top-img",src:M.src,draggable:!1,alt:"",style:we(p.value)},null,12,Hoe)],4),W("div",{class:"operate",style:we(h.value),onMousedown:w[0]||(w[0]=Wt(_=>R(_),["stop"]))},[(Y(),q(Xe,null,ot(L,_=>W("div",{class:Ge(["clip-point",_,b.value]),key:_,onMousedown:Wt(P=>g(P,_),["stop"])},zoe,42,Goe)),64)),(Y(),q(Xe,null,ot(T,_=>W("div",{class:Ge(["clip-point",_,b.value]),key:_,onMousedown:Wt(P=>g(P,_),["stop"])},qoe,42,$oe)),64))],36)],4)),[[k,A]])}}}),tie=Ve(eie,[["__scopeId","data-v-31b3b0f9"]]),nie=["src"],rie=Ie({__name:"index",props:{elementInfo:{},selectElement:{type:Function},contextmenus:{type:Function}},setup(e){const t=e,n=ft(),r=st(),{clipingImageElementId:o}=Ee(n),i=Me(()=>o.value===t.elementInfo.id),{addHistorySnapshot:a}=Jt(),s=Me(()=>t.elementInfo.shadow),{shadowStyle:c}=wc(s),l=Me(()=>t.elementInfo.flipH),u=Me(()=>t.elementInfo.flipV),{flipStyle:f}=a2(l,u),d=Me(()=>t.elementInfo.clip),{clipShape:h,imgPosition:p}=s5(d),m=Me(()=>t.elementInfo.filters),{filter:A}=AI(m),x=R=>{t.elementInfo.lock||(R.stopPropagation(),t.selectElement(R,t.elementInfo))},y=R=>{if(n.setClipingImageElementId(""),!R)return;const{range:g,position:b}=R,L=t.elementInfo.clip||{shape:"rect",range:[[0,0],[100,100]]},T=t.elementInfo.left+b.left,M=t.elementInfo.top+b.top,w=t.elementInfo.width+b.width,k=t.elementInfo.height+b.height;let _=0,P=0;if(t.elementInfo.rotate){const I=T+w/2-(t.elementInfo.left+t.elementInfo.width/2),F=-(M+k/2-(t.elementInfo.top+t.elementInfo.height/2)),N=-t.elementInfo.rotate*Math.PI/180,V=I*Math.cos(N)-F*Math.sin(N),Z=I*Math.sin(N)+F*Math.cos(N);_=V-I,P=-(Z-F)}const E={clip:{...L,range:g},left:T+_,top:M+P,width:w,height:k};r.updateElement({id:t.elementInfo.id,props:E}),a()};return(R,g)=>{const b=Sn("contextmenu");return Y(),q("div",{class:Ge(["editable-element-image",{lock:R.elementInfo.lock}]),style:we({top:R.elementInfo.top+"px",left:R.elementInfo.left+"px",width:R.elementInfo.width+"px",height:R.elementInfo.height+"px"})},[W("div",{class:"rotate-wrapper",style:we({transform:`rotate(${R.elementInfo.rotate}deg)`})},[i.value?(Y(),Te(tie,{key:0,src:R.elementInfo.src,clipData:R.elementInfo.clip,width:R.elementInfo.width,height:R.elementInfo.height,top:R.elementInfo.top,left:R.elementInfo.left,rotate:R.elementInfo.rotate,clipPath:G(h).style,onClip:g[0]||(g[0]=L=>y(L))},null,8,["src","clipData","width","height","top","left","rotate","clipPath"])):Ke((Y(),q("div",{key:1,class:"element-content",style:we({filter:G(c)?`drop-shadow(${G(c)})`:"",transform:G(f)}),onMousedown:g[2]||(g[2]=L=>x(L)),onTouchstart:g[3]||(g[3]=L=>x(L))},[O(RI,{elementInfo:R.elementInfo},null,8,["elementInfo"]),W("div",{class:"image-content",style:we({clipPath:G(h).style})},[W("img",{src:R.elementInfo.src,draggable:!1,style:we({top:G(p).top,left:G(p).left,width:G(p).width,height:G(p).height,filter:G(A)}),onDragstart:g[1]||(g[1]=Wt(()=>{},["prevent"])),alt:""},null,44,nie),R.elementInfo.colorMask?(Y(),q("div",{key:0,class:"color-mask",style:we({backgroundColor:R.elementInfo.colorMask})},null,4)):Ze("",!0)],4)],36)),[[b,R.contextmenus]])],4)],6)}}}),bI=Ve(rie,[["__scopeId","data-v-d615c21a"]]),oie=["width","height"],iie=["d","stroke","stroke-width","stroke-dasharray"],aie=Ie({__name:"ElementOutline",props:{width:{},height:{},outline:{}},setup(e){const t=e,{outlineWidth:n,outlineColor:r,strokeDashArray:o}=Hd(Xd(t,"outline"));return(i,a)=>i.outline?(Y(),q("svg",{key:0,class:"element-outline",overflow:"visible",width:i.width,height:i.height},[W("path",{"vector-effect":"non-scaling-stroke","stroke-linecap":"butt","stroke-miterlimit":"8",fill:"transparent",d:`M0,0 L${i.width},0 L${i.width},${i.height} L0,${i.height} Z`,stroke:G(r),"stroke-width":G(n),"stroke-dasharray":G(o)},null,8,iie)],8,oie)):Ze("",!0)}}),s2=Ve(aie,[["__scopeId","data-v-e2ef58f5"]]),Co=function(e){for(var t=0;;t++)if(e=e.previousSibling,!e)return t},ip=function(e){let t=e.assignedSlot||e.parentNode;return t&&t.nodeType==11?t.host:t};let UO=null;const Zs=function(e,t,n){let r=UO||(UO=document.createRange());return r.setEnd(e,n??e.nodeValue.length),r.setStart(e,t||0),r},Xu=function(e,t,n,r){return n&&(YO(e,t,n,r,-1)||YO(e,t,n,r,1))},sie=/^(img|br|input|textarea|hr)$/i;function YO(e,t,n,r,o){for(;;){if(e==n&&t==r)return!0;if(t==(o<0?0:is(e))){let i=e.parentNode;if(!i||i.nodeType!=1||l5(e)||sie.test(e.nodeName)||e.contentEditable=="false")return!1;t=Co(e)+(o<0?0:1),e=i}else if(e.nodeType==1){if(e=e.childNodes[t+(o<0?-1:0)],e.contentEditable=="false")return!1;t=o<0?is(e):0}else return!1}}function is(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function lie(e,t,n){for(let r=t==0,o=t==is(e);r||o;){if(e==n)return!0;let i=Co(e);if(e=e.parentNode,!e)return!1;r=r&&i==0,o=o&&i==is(e)}}function l5(e){let t;for(let n=e;n&&!(t=n.pmViewDesc);n=n.parentNode);return t&&t.node&&t.node.isBlock&&(t.dom==e||t.contentDOM==e)}const l2=function(e){return e.focusNode&&Xu(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)};function qc(e,t){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=e,n.key=n.code=t,n}function cie(e){let t=e.activeElement;for(;t&&t.shadowRoot;)t=t.shadowRoot.activeElement;return t}function uie(e,t,n){if(e.caretPositionFromPoint)try{let r=e.caretPositionFromPoint(t,n);if(r)return{node:r.offsetNode,offset:r.offset}}catch{}if(e.caretRangeFromPoint){let r=e.caretRangeFromPoint(t,n);if(r)return{node:r.startContainer,offset:r.startOffset}}}const vs=typeof navigator<"u"?navigator:null,QO=typeof document<"u"?document:null,Lc=vs&&vs.userAgent||"",H3=/Edge\/(\d+)/.exec(Lc),xI=/MSIE \d/.exec(Lc),G3=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Lc),ni=!!(xI||G3||H3),lc=xI?document.documentMode:G3?+G3[1]:H3?+H3[1]:0,Ia=!ni&&/gecko\/(\d+)/i.test(Lc);Ia&&+(/Firefox\/(\d+)/.exec(Lc)||[0,0])[1];const J3=!ni&&/Chrome\/(\d+)/.exec(Lc),po=!!J3,fie=J3?+J3[1]:0,Eo=!ni&&!!vs&&/Apple Computer/.test(vs.vendor),Pd=Eo&&(/Mobile\/\w+/.test(Lc)||!!vs&&vs.maxTouchPoints>2),Ki=Pd||(vs?/Mac/.test(vs.platform):!1),die=vs?/Win/.test(vs.platform):!1,wa=/Android \d/.test(Lc),Yp=!!QO&&"webkitFontSmoothing"in QO.documentElement.style,hie=Yp?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function pie(e){return{left:0,right:e.documentElement.clientWidth,top:0,bottom:e.documentElement.clientHeight}}function Ws(e,t){return typeof e=="number"?e:e[t]}function mie(e){let t=e.getBoundingClientRect(),n=t.width/e.offsetWidth||1,r=t.height/e.offsetHeight||1;return{left:t.left,right:t.left+e.clientWidth*n,top:t.top,bottom:t.top+e.clientHeight*r}}function ZO(e,t,n){let r=e.someProp("scrollThreshold")||0,o=e.someProp("scrollMargin")||5,i=e.dom.ownerDocument;for(let a=n||e.dom;a;a=ip(a)){if(a.nodeType!=1)continue;let s=a,c=s==i.body,l=c?pie(i):mie(s),u=0,f=0;if(t.topl.bottom-Ws(r,"bottom")&&(f=t.bottom-t.top>l.bottom-l.top?t.top+Ws(o,"top")-l.top:t.bottom-l.bottom+Ws(o,"bottom")),t.leftl.right-Ws(r,"right")&&(u=t.right-l.right+Ws(o,"right")),u||f)if(c)i.defaultView.scrollBy(u,f);else{let d=s.scrollLeft,h=s.scrollTop;f&&(s.scrollTop+=f),u&&(s.scrollLeft+=u);let p=s.scrollLeft-d,m=s.scrollTop-h;t={left:t.left-p,top:t.top-m,right:t.right-p,bottom:t.bottom-m}}if(c||/^(fixed|sticky)$/.test(getComputedStyle(a).position))break}}function vie(e){let t=e.dom.getBoundingClientRect(),n=Math.max(0,t.top),r,o;for(let i=(t.left+t.right)/2,a=n+1;a=n-20){r=s,o=c.top;break}}return{refDOM:r,refTop:o,stack:SI(e.dom)}}function SI(e){let t=[],n=e.ownerDocument;for(let r=e;r&&(t.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),e!=n);r=ip(r));return t}function gie({refDOM:e,refTop:t,stack:n}){let r=e?e.getBoundingClientRect().top:0;MI(n,r==0?0:r-t)}function MI(e,t){for(let n=0;n=s){a=Math.max(p.bottom,a),s=Math.min(p.top,s);let m=p.left>t.left?p.left-t.left:p.right=(p.left+p.right)/2?1:0));continue}}else p.top>t.top&&!c&&p.left<=t.left&&p.right>=t.left&&(c=u,l={left:Math.max(p.left,Math.min(p.right,t.left)),top:p.top});!n&&(t.left>=p.right&&t.top>=p.top||t.left>=p.left&&t.top>=p.bottom)&&(i=f+1)}}return!n&&c&&(n=c,o=l,r=0),n&&n.nodeType==3?Rie(n,o):!n||r&&n.nodeType==1?{node:e,offset:i}:wI(n,o)}function Rie(e,t){let n=e.nodeValue.length,r=document.createRange();for(let o=0;o=(i.left+i.right)/2?1:0)}}return{node:e,offset:0}}function c5(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function yie(e,t){let n=e.parentNode;return n&&/^li$/i.test(n.nodeName)&&t.left(a.left+a.right)/2?1:-1}return e.docView.posFromDOM(r,o,i)}function xie(e,t,n,r){let o=-1;for(let i=t,a=!1;i!=e.dom;){let s=e.docView.nearestDesc(i,!0);if(!s)return null;if(s.dom.nodeType==1&&(s.node.isBlock&&s.parent&&!a||!s.contentDOM)){let c=s.dom.getBoundingClientRect();if(s.node.isBlock&&s.parent&&!a&&(a=!0,c.left>r.left||c.top>r.top?o=s.posBefore:(c.right-1?o:e.docView.posFromDOM(t,n,-1)}function LI(e,t,n){let r=e.childNodes.length;if(r&&n.topt.top&&o++}let l;Yp&&o&&r.nodeType==1&&(l=r.childNodes[o-1]).nodeType==1&&l.contentEditable=="false"&&l.getBoundingClientRect().top>=t.top&&o--,r==e.dom&&o==r.childNodes.length-1&&r.lastChild.nodeType==1&&t.top>r.lastChild.getBoundingClientRect().bottom?s=e.state.doc.content.size:(o==0||r.nodeType!=1||r.childNodes[o-1].nodeName!="BR")&&(s=xie(e,r,o,t))}s==null&&(s=bie(e,a,t));let c=e.docView.nearestDesc(a,!0);return{pos:s,inside:c?c.posAtStart-c.border:-1}}function BO(e){return e.top=0&&o==r.nodeValue.length?(c--,u=1):n<0?c--:l++,A0(Wl(Zs(r,c,l),u),u<0)}if(!e.state.doc.resolve(t-(i||0)).parent.inlineContent){if(i==null&&o&&(n<0||o==is(r))){let c=r.childNodes[o-1];if(c.nodeType==1)return Vy(c.getBoundingClientRect(),!1)}if(i==null&&o=0)}if(i==null&&o&&(n<0||o==is(r))){let c=r.childNodes[o-1],l=c.nodeType==3?Zs(c,is(c)-(a?0:1)):c.nodeType==1&&(c.nodeName!="BR"||!c.nextSibling)?c:null;if(l)return A0(Wl(l,1),!1)}if(i==null&&o=0)}function A0(e,t){if(e.width==0)return e;let n=t?e.left:e.right;return{top:e.top,bottom:e.bottom,left:n,right:n}}function Vy(e,t){if(e.height==0)return e;let n=t?e.top:e.bottom;return{top:n,bottom:n,left:e.left,right:e.right}}function TI(e,t,n){let r=e.state,o=e.root.activeElement;r!=t&&e.updateState(t),o!=e.dom&&e.focus();try{return n()}finally{r!=t&&e.updateState(r),o!=e.dom&&o&&o.focus()}}function wie(e,t,n){let r=t.selection,o=n=="up"?r.$from:r.$to;return TI(e,t,()=>{let{node:i}=e.docView.domFromPos(o.pos,n=="up"?-1:1);for(;;){let s=e.docView.nearestDesc(i,!0);if(!s)break;if(s.node.isBlock){i=s.contentDOM||s.dom;break}i=s.dom.parentNode}let a=OI(e,o.pos,1);for(let s=i.firstChild;s;s=s.nextSibling){let c;if(s.nodeType==1)c=s.getClientRects();else if(s.nodeType==3)c=Zs(s,0,s.nodeValue.length).getClientRects();else continue;for(let l=0;lu.top+1&&(n=="up"?a.top-u.top>(u.bottom-a.top)*2:u.bottom-a.bottom>(a.bottom-u.top)*2))return!1}}return!0})}const Lie=/[\u0590-\u08ac]/;function Oie(e,t,n){let{$head:r}=t.selection;if(!r.parent.isTextblock)return!1;let o=r.parentOffset,i=!o,a=o==r.parent.content.size,s=e.domSelection();return!Lie.test(r.parent.textContent)||!s.modify?n=="left"||n=="backward"?i:a:TI(e,t,()=>{let{focusNode:c,focusOffset:l,anchorNode:u,anchorOffset:f}=e.domSelectionRange(),d=s.caretBidiLevel;s.modify("move",n,"character");let h=r.depth?e.docView.domAfterPos(r.before()):e.dom,{focusNode:p,focusOffset:m}=e.domSelectionRange(),A=p&&!h.contains(p.nodeType==1?p:p.parentNode)||c==p&&l==m;try{s.collapse(u,f),c&&(c!=u||l!=f)&&s.extend&&s.extend(c,l)}catch{}return d!=null&&(s.caretBidiLevel=d),A})}let DO=null,KO=null,HO=!1;function Tie(e,t,n){return DO==t&&KO==n?HO:(DO=t,KO=n,HO=n=="up"||n=="down"?wie(e,t,n):Oie(e,t,n))}const ji=0,GO=1,ou=2,gs=3;class Qp{constructor(t,n,r,o){this.parent=t,this.children=n,this.dom=r,this.contentDOM=o,this.dirty=ji,r.pmViewDesc=this}matchesWidget(t){return!1}matchesMark(t){return!1}matchesNode(t,n,r){return!1}matchesHack(t){return!1}parseRule(){return null}stopEvent(t){return!1}get size(){let t=0;for(let n=0;nCo(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))o=t.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(n==0)for(let i=t;;i=i.parentNode){if(i==this.dom){o=!1;break}if(i.previousSibling)break}if(o==null&&n==t.childNodes.length)for(let i=t;;i=i.parentNode){if(i==this.dom){o=!0;break}if(i.nextSibling)break}}return o??r>0?this.posAtEnd:this.posAtStart}nearestDesc(t,n=!1){for(let r=!0,o=t;o;o=o.parentNode){let i=this.getDesc(o),a;if(i&&(!n||i.node))if(r&&(a=i.nodeDOM)&&!(a.nodeType==1?a.contains(t.nodeType==1?t:t.parentNode):a==t))r=!1;else return i}}getDesc(t){let n=t.pmViewDesc;for(let r=n;r;r=r.parent)if(r==this)return n}posFromDOM(t,n,r){for(let o=t;o;o=o.parentNode){let i=this.getDesc(o);if(i)return i.localPosFromDOM(t,n,r)}return-1}descAt(t){for(let n=0,r=0;nt||a instanceof NI){o=t-i;break}i=s}if(o)return this.children[r].domFromPos(o-this.children[r].border,n);for(let i;r&&!(i=this.children[r-1]).size&&i instanceof kI&&i.side>=0;r--);if(n<=0){let i,a=!0;for(;i=r?this.children[r-1]:null,!(!i||i.dom.parentNode==this.contentDOM);r--,a=!1);return i&&n&&a&&!i.border&&!i.domAtom?i.domFromPos(i.size,n):{node:this.contentDOM,offset:i?Co(i.dom)+1:0}}else{let i,a=!0;for(;i=r=u&&n<=l-c.border&&c.node&&c.contentDOM&&this.contentDOM.contains(c.contentDOM))return c.parseRange(t,n,u);t=a;for(let f=s;f>0;f--){let d=this.children[f-1];if(d.size&&d.dom.parentNode==this.contentDOM&&!d.emptyChildAt(1)){o=Co(d.dom)+1;break}t-=d.size}o==-1&&(o=0)}if(o>-1&&(l>n||s==this.children.length-1)){n=l;for(let u=s+1;uh&&an){let h=s;s=c,c=h}let d=document.createRange();d.setEnd(c.node,c.offset),d.setStart(s.node,s.offset),l.removeAllRanges(),l.addRange(d)}}ignoreMutation(t){return!this.contentDOM&&t.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(t,n){for(let r=0,o=0;o=r:tr){let s=r+i.border,c=a-i.border;if(t>=s&&n<=c){this.dirty=t==r||n==a?ou:GO,t==s&&n==c&&(i.contentLost||i.dom.parentNode!=this.contentDOM)?i.dirty=gs:i.markDirty(t-s,n-s);return}else i.dirty=i.dom==i.contentDOM&&i.dom.parentNode==this.contentDOM&&!i.children.length?ou:gs}r=a}this.dirty=ou}markParentsDirty(){let t=1;for(let n=this.parent;n;n=n.parent,t++){let r=t==1?ou:GO;n.dirty{if(!i)return o;if(i.parent)return i.parent.posBeforeChild(i)})),!n.type.spec.raw){if(a.nodeType!=1){let s=document.createElement("span");s.appendChild(a),a=s}a.contentEditable="false",a.classList.add("ProseMirror-widget")}super(t,[],a,null),this.widget=n,this.widget=n,i=this}matchesWidget(t){return this.dirty==ji&&t.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(t){let n=this.widget.spec.stopEvent;return n?n(t):!1}ignoreMutation(t){return t.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get side(){return this.widget.type.side}}class kie extends Qp{constructor(t,n,r,o){super(t,[],n,null),this.textDOM=r,this.text=o}get size(){return this.text.length}localPosFromDOM(t,n){return t!=this.textDOM?this.posAtStart+(n?this.size:0):this.posAtStart+n}domFromPos(t){return{node:this.textDOM,offset:t}}ignoreMutation(t){return t.type==="characterData"&&t.target.nodeValue==t.oldValue}}class Wu extends Qp{constructor(t,n,r,o){super(t,[],r,o),this.mark=n}static create(t,n,r,o){let i=o.nodeViews[n.type.name],a=i&&i(n,o,r);return(!a||!a.dom)&&(a=zs.renderSpec(document,n.type.spec.toDOM(n,r))),new Wu(t,n,a.dom,a.contentDOM||a.dom)}parseRule(){return this.dirty&gs||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(t){return this.dirty!=gs&&this.mark.eq(t)}markDirty(t,n){if(super.markDirty(t,n),this.dirty!=ji){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty0&&(i=j3(i,0,t,r));for(let s=0;s{if(!c)return a;if(c.parent)return c.parent.posBeforeChild(c)},r,o),u=l&&l.dom,f=l&&l.contentDOM;if(n.isText){if(!u)u=document.createTextNode(n.text);else if(u.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else u||({dom:u,contentDOM:f}=zs.renderSpec(document,n.type.spec.toDOM(n)));!f&&!n.isText&&u.nodeName!="BR"&&(u.hasAttribute("contenteditable")||(u.contentEditable="false"),n.type.spec.draggable&&(u.draggable=!0));let d=u;return u=II(u,r,n),l?c=new Nie(t,n,r,o,u,f||null,d,l,i,a+1):n.isText?new c2(t,n,r,o,u,d,i):new cc(t,n,r,o,u,f||null,d,i,a+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let t={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(t.preserveWhitespace="full"),!this.contentDOM)t.getContent=()=>this.node.content;else if(!this.contentLost)t.contentElement=this.contentDOM;else{for(let n=this.children.length-1;n>=0;n--){let r=this.children[n];if(this.dom.contains(r.dom.parentNode)){t.contentElement=r.dom.parentNode;break}}t.contentElement||(t.getContent=()=>lt.empty)}return t}matchesNode(t,n,r){return this.dirty==ji&&t.eq(this.node)&&$3(n,this.outerDeco)&&r.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(t,n){let r=this.node.inlineContent,o=n,i=t.composing?this.localCompositionInfo(t,n):null,a=i&&i.pos>-1?i:null,s=i&&i.pos<0,c=new Cie(this,a&&a.node,t);_ie(this.node,this.innerDeco,(l,u,f)=>{l.spec.marks?c.syncToMarks(l.spec.marks,r,t):l.type.side>=0&&!f&&c.syncToMarks(u==this.node.childCount?In.none:this.node.child(u).marks,r,t),c.placeWidget(l,t,o)},(l,u,f,d)=>{c.syncToMarks(l.marks,r,t);let h;c.findNodeMatch(l,u,f,d)||s&&t.state.selection.from>o&&t.state.selection.to-1&&c.updateNodeAt(l,u,f,h,t)||c.updateNextNode(l,u,f,t,d,o)||c.addNode(l,u,f,t,o),o+=l.nodeSize}),c.syncToMarks([],r,t),this.node.isTextblock&&c.addTextblockHacks(),c.destroyRest(),(c.changed||this.dirty==ou)&&(a&&this.protectLocalComposition(t,a),PI(this.contentDOM,this.children,t),Pd&&Eie(this.dom))}localCompositionInfo(t,n){let{from:r,to:o}=t.state.selection;if(!(t.state.selection instanceof Xn)||rn+this.node.content.size)return null;let i=t.domSelectionRange(),a=Xie(i.focusNode,i.focusOffset);if(!a||!this.dom.contains(a.parentNode))return null;if(this.node.inlineContent){let s=a.nodeValue,c=Wie(this.node.content,s,r-n,o-n);return c<0?null:{node:a,pos:c,text:s}}else return{node:a,pos:-1,text:""}}protectLocalComposition(t,{node:n,pos:r,text:o}){if(this.getDesc(n))return;let i=n;for(;i.parentNode!=this.contentDOM;i=i.parentNode){for(;i.previousSibling;)i.parentNode.removeChild(i.previousSibling);for(;i.nextSibling;)i.parentNode.removeChild(i.nextSibling);i.pmViewDesc&&(i.pmViewDesc=void 0)}let a=new kie(this,i,n,o);t.input.compositionNodes.push(a),this.children=j3(this.children,r,r+o.length,t,a)}update(t,n,r,o){return this.dirty==gs||!t.sameMarkup(this.node)?!1:(this.updateInner(t,n,r,o),!0)}updateInner(t,n,r,o){this.updateOuterDeco(n),this.node=t,this.innerDeco=r,this.contentDOM&&this.updateChildren(o,this.posAtStart),this.dirty=ji}updateOuterDeco(t){if($3(t,this.outerDeco))return;let n=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=CI(this.dom,this.nodeDOM,z3(this.outerDeco,this.node,n),z3(t,this.node,n)),this.dom!=r&&(r.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=t}selectNode(){this.nodeDOM.nodeType==1&&this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.dom.draggable=!0)}deselectNode(){this.nodeDOM.nodeType==1&&this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.dom.removeAttribute("draggable")}get domAtom(){return this.node.isAtom}}function JO(e,t,n,r,o){II(r,t,e);let i=new cc(void 0,e,t,n,r,r,r,o,0);return i.contentDOM&&i.updateChildren(o,0),i}class c2 extends cc{constructor(t,n,r,o,i,a,s){super(t,n,r,o,i,null,a,s,0)}parseRule(){let t=this.nodeDOM.parentNode;for(;t&&t!=this.dom&&!t.pmIsDeco;)t=t.parentNode;return{skip:t||!0}}update(t,n,r,o){return this.dirty==gs||this.dirty!=ji&&!this.inParent()||!t.sameMarkup(this.node)?!1:(this.updateOuterDeco(n),(this.dirty!=ji||t.text!=this.node.text)&&t.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=t.text,o.trackWrites==this.nodeDOM&&(o.trackWrites=null)),this.node=t,this.dirty=ji,!0)}inParent(){let t=this.parent.contentDOM;for(let n=this.nodeDOM;n;n=n.parentNode)if(n==t)return!0;return!1}domFromPos(t){return{node:this.nodeDOM,offset:t}}localPosFromDOM(t,n,r){return t==this.nodeDOM?this.posAtStart+Math.min(n,this.node.text.length):super.localPosFromDOM(t,n,r)}ignoreMutation(t){return t.type!="characterData"&&t.type!="selection"}slice(t,n,r){let o=this.node.cut(t,n),i=document.createTextNode(o.text);return new c2(this.parent,o,this.outerDeco,this.innerDeco,i,i,r)}markDirty(t,n){super.markDirty(t,n),this.dom!=this.nodeDOM&&(t==0||n==this.nodeDOM.nodeValue.length)&&(this.dirty=gs)}get domAtom(){return!1}}class NI extends Qp{parseRule(){return{ignore:!0}}matchesHack(t){return this.dirty==ji&&this.dom.nodeName==t}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class Nie extends cc{constructor(t,n,r,o,i,a,s,c,l,u){super(t,n,r,o,i,a,s,l,u),this.spec=c}update(t,n,r,o){if(this.dirty==gs)return!1;if(this.spec.update){let i=this.spec.update(t,n,r);return i&&this.updateInner(t,n,r,o),i}else return!this.contentDOM&&!t.isLeaf?!1:super.update(t,n,r,o)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(t,n,r,o){this.spec.setSelection?this.spec.setSelection(t,n,r):super.setSelection(t,n,r,o)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(t){return this.spec.stopEvent?this.spec.stopEvent(t):!1}ignoreMutation(t){return this.spec.ignoreMutation?this.spec.ignoreMutation(t):super.ignoreMutation(t)}}function PI(e,t,n){let r=e.firstChild,o=!1;for(let i=0;i>1,a=Math.min(i,t.length);for(;o-1)s>this.index&&(this.changed=!0,this.destroyBetween(this.index,s)),this.top=this.top.children[this.index];else{let c=Wu.create(this.top,t[i],n,r);this.top.children.splice(this.index,0,c),this.top=c,this.changed=!0}this.index=0,i++}}findNodeMatch(t,n,r,o){let i=-1,a;if(o>=this.preMatch.index&&(a=this.preMatch.matches[o-this.preMatch.index]).parent==this.top&&a.matchesNode(t,n,r))i=this.top.children.indexOf(a,this.index);else for(let s=this.index,c=Math.min(this.top.children.length,s+5);s0;){let s;for(;;)if(r){let l=n.children[r-1];if(l instanceof Wu)n=l,r=l.children.length;else{s=l,r--;break}}else{if(n==t)break e;r=n.parent.children.indexOf(n),n=n.parent}let c=s.node;if(c){if(c!=e.child(o-1))break;--o,i.set(s,o),a.push(s)}}return{index:o,matched:i,matches:a.reverse()}}function Fie(e,t){return e.type.side-t.type.side}function _ie(e,t,n,r){let o=t.locals(e),i=0;if(o.length==0){for(let l=0;li;)s.push(o[a++]);let p=i+d.nodeSize;if(d.isText){let A=p;a!A.inline):s.slice();r(d,m,t.forChild(i,d),h),i=p}}function Eie(e){if(e.nodeName=="UL"||e.nodeName=="OL"){let t=e.style.cssText;e.style.cssText=t+"; list-style: square !important",window.getComputedStyle(e).listStyle,e.style.cssText=t}}function Xie(e,t){for(;;){if(e.nodeType==3)return e;if(e.nodeType==1&&t>0){if(e.childNodes.length>t&&e.childNodes[t].nodeType==3)return e.childNodes[t];e=e.childNodes[t-1],t=is(e)}else if(e.nodeType==1&&t=n){if(i>=r&&c.slice(r-t.length-s,r-s)==t)return r-t.length;let l=s=0&&l+t.length+s>=n)return s+l;if(n==r&&c.length>=r+t.length-s&&c.slice(r-s,r-s+t.length)==t)return r}}return-1}function j3(e,t,n,r,o){let i=[];for(let a=0,s=0;a=n||u<=t?i.push(c):(ln&&i.push(c.slice(n-l,c.size,r)))}return i}function u5(e,t=null){let n=e.domSelectionRange(),r=e.state.doc;if(!n.focusNode)return null;let o=e.docView.nearestDesc(n.focusNode),i=o&&o.size==0,a=e.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(a<0)return null;let s=r.resolve(a),c,l;if(l2(n)){for(c=s;o&&!o.node;)o=o.parent;let u=o.node;if(o&&u.isAtom&&Yt.isSelectable(u)&&o.parent&&!(u.isInline&&lie(n.focusNode,n.focusOffset,o.dom))){let f=o.posBefore;l=new Yt(a==f?s:r.resolve(f))}}else{let u=e.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(u<0)return null;c=r.resolve(u)}if(!l){let u=t=="pointer"||e.state.selection.head{(n.anchorNode!=r||n.anchorOffset!=o)&&(t.removeEventListener("selectionchange",e.input.hideSelectionGuard),setTimeout(()=>{(!FI(e)||e.state.selection.visible)&&e.dom.classList.remove("ProseMirror-hideselection")},20))})}function Uie(e){let t=e.domSelection(),n=document.createRange(),r=e.cursorWrapper.dom,o=r.nodeName=="IMG";o?n.setEnd(r.parentNode,Co(r)+1):n.setEnd(r,0),n.collapse(!1),t.removeAllRanges(),t.addRange(n),!o&&!e.state.selection.visible&&ni&&lc<=11&&(r.disabled=!0,r.disabled=!1)}function _I(e,t){if(t instanceof Yt){let n=e.docView.descAt(t.from);n!=e.lastSelectedViewDesc&&(eT(e),n&&n.selectNode(),e.lastSelectedViewDesc=n)}else eT(e)}function eT(e){e.lastSelectedViewDesc&&(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),e.lastSelectedViewDesc=void 0)}function f5(e,t,n,r){return e.someProp("createSelectionBetween",o=>o(e,t,n))||Xn.between(t,n,r)}function tT(e){return e.editable&&!e.hasFocus()?!1:EI(e)}function EI(e){let t=e.domSelectionRange();if(!t.anchorNode)return!1;try{return e.dom.contains(t.anchorNode.nodeType==3?t.anchorNode.parentNode:t.anchorNode)&&(e.editable||e.dom.contains(t.focusNode.nodeType==3?t.focusNode.parentNode:t.focusNode))}catch{return!1}}function Yie(e){let t=e.docView.domFromPos(e.state.selection.anchor,0),n=e.domSelectionRange();return Xu(t.node,t.offset,n.anchorNode,n.anchorOffset)}function q3(e,t){let{$anchor:n,$head:r}=e.selection,o=t>0?n.max(r):n.min(r),i=o.parent.inlineContent?o.depth?e.doc.resolve(t>0?o.after():o.before()):null:o;return i&&bn.findFrom(i,t)}function Bl(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function nT(e,t,n){let r=e.state.selection;if(r instanceof Xn)if(n.indexOf("s")>-1){let{$head:o}=r,i=o.textOffset?null:t<0?o.nodeBefore:o.nodeAfter;if(!i||i.isText||!i.isLeaf)return!1;let a=e.state.doc.resolve(o.pos+i.nodeSize*(t<0?-1:1));return Bl(e,new Xn(r.$anchor,a))}else if(r.empty){if(e.endOfTextblock(t>0?"forward":"backward")){let o=q3(e.state,t);return o&&o instanceof Yt?Bl(e,o):!1}else if(!(Ki&&n.indexOf("m")>-1)){let o=r.$head,i=o.textOffset?null:t<0?o.nodeBefore:o.nodeAfter,a;if(!i||i.isText)return!1;let s=t<0?o.pos-i.nodeSize:o.pos;return i.isAtom||(a=e.docView.descAt(s))&&!a.contentDOM?Yt.isSelectable(i)?Bl(e,new Yt(t<0?e.state.doc.resolve(o.pos-i.nodeSize):o)):Yp?Bl(e,new Xn(e.state.doc.resolve(t<0?s:s+i.nodeSize))):!1:!1}}else return!1;else{if(r instanceof Yt&&r.node.isInline)return Bl(e,new Xn(t>0?r.$to:r.$from));{let o=q3(e.state,t);return o?Bl(e,o):!1}}}function tg(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function Th(e,t){let n=e.pmViewDesc;return n&&n.size==0&&(t<0||e.nextSibling||e.nodeName!="BR")}function wf(e,t){return t<0?Qie(e):Zie(e)}function Qie(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let o,i,a=!1;for(Ia&&n.nodeType==1&&r0){if(n.nodeType!=1)break;{let s=n.childNodes[r-1];if(Th(s,-1))o=n,i=--r;else if(s.nodeType==3)n=s,r=n.nodeValue.length;else break}}else{if(XI(n))break;{let s=n.previousSibling;for(;s&&Th(s,-1);)o=n.parentNode,i=Co(s),s=s.previousSibling;if(s)n=s,r=tg(n);else{if(n=n.parentNode,n==e.dom)break;r=0}}}a?eb(e,n,r):o&&eb(e,o,i)}function Zie(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let o=tg(n),i,a;for(;;)if(r{e.state==o&&nl(e)},50)}function rT(e,t){let n=e.state.doc.resolve(t);if(!(po||die)&&n.parent.inlineContent){let o=e.coordsAtPos(t);if(t>n.start()){let i=e.coordsAtPos(t-1),a=(i.top+i.bottom)/2;if(a>o.top&&a1)return i.lefto.top&&a1)return i.left>o.left?"ltr":"rtl"}}return getComputedStyle(e.dom).direction=="rtl"?"rtl":"ltr"}function oT(e,t,n){let r=e.state.selection;if(r instanceof Xn&&!r.empty||n.indexOf("s")>-1||Ki&&n.indexOf("m")>-1)return!1;let{$from:o,$to:i}=r;if(!o.parent.inlineContent||e.endOfTextblock(t<0?"up":"down")){let a=q3(e.state,t);if(a&&a instanceof Yt)return Bl(e,a)}if(!o.parent.inlineContent){let a=t<0?o:i,s=r instanceof qo?bn.near(a,t):bn.findFrom(a,t);return s?Bl(e,s):!1}return!1}function iT(e,t){if(!(e.state.selection instanceof Xn))return!0;let{$head:n,$anchor:r,empty:o}=e.state.selection;if(!n.sameParent(r))return!0;if(!o)return!1;if(e.endOfTextblock(t>0?"forward":"backward"))return!0;let i=!n.textOffset&&(t<0?n.nodeBefore:n.nodeAfter);if(i&&!i.isText){let a=e.state.tr;return t<0?a.delete(n.pos-i.nodeSize,n.pos):a.delete(n.pos,n.pos+i.nodeSize),e.dispatch(a),!0}return!1}function aT(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function Kie(e){if(!Eo||e.state.selection.$head.parentOffset>0)return!1;let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(t&&t.nodeType==1&&n==0&&t.firstChild&&t.firstChild.contentEditable=="false"){let r=t.firstChild;aT(e,r,"true"),setTimeout(()=>aT(e,r,"false"),20)}return!1}function Hie(e){let t="";return e.ctrlKey&&(t+="c"),e.metaKey&&(t+="m"),e.altKey&&(t+="a"),e.shiftKey&&(t+="s"),t}function Gie(e,t){let n=t.keyCode,r=Hie(t);if(n==8||Ki&&n==72&&r=="c")return iT(e,-1)||wf(e,-1);if(n==46&&!t.shiftKey||Ki&&n==68&&r=="c")return iT(e,1)||wf(e,1);if(n==13||n==27)return!0;if(n==37||Ki&&n==66&&r=="c"){let o=n==37?rT(e,e.state.selection.from)=="ltr"?-1:1:-1;return nT(e,o,r)||wf(e,o)}else if(n==39||Ki&&n==70&&r=="c"){let o=n==39?rT(e,e.state.selection.from)=="ltr"?1:-1:1;return nT(e,o,r)||wf(e,o)}else{if(n==38||Ki&&n==80&&r=="c")return oT(e,-1,r)||wf(e,-1);if(n==40||Ki&&n==78&&r=="c")return Kie(e)||oT(e,1,r)||wf(e,1);if(r==(Ki?"m":"c")&&(n==66||n==73||n==89||n==90))return!0}return!1}function WI(e,t){e.someProp("transformCopied",h=>{t=h(t,e)});let n=[],{content:r,openStart:o,openEnd:i}=t;for(;o>1&&i>1&&r.childCount==1&&r.firstChild.childCount==1;){o--,i--;let h=r.firstChild;n.push(h.type.name,h.attrs!=h.type.defaultAttrs?h.attrs:null),r=h.content}let a=e.someProp("clipboardSerializer")||zs.fromSchema(e.state.schema),s=BI(),c=s.createElement("div");c.appendChild(a.serializeFragment(r,{document:s}));let l=c.firstChild,u,f=0;for(;l&&l.nodeType==1&&(u=ZI[l.nodeName.toLowerCase()]);){for(let h=u.length-1;h>=0;h--){let p=s.createElement(u[h]);for(;c.firstChild;)p.appendChild(c.firstChild);c.appendChild(p),f++}l=c.firstChild}l&&l.nodeType==1&&l.setAttribute("data-pm-slice",`${o} ${i}${f?` -${f}`:""} ${JSON.stringify(n)}`);let d=e.someProp("clipboardTextSerializer",h=>h(t,e))||t.content.textBetween(0,t.content.size,`
`);return{dom:c,text:d}}function VI(e,t,n,r,o){let i=o.parent.type.spec.code,a,s;if(!n&&!t)return null;let c=t&&(r||i||!n);if(c){if(e.someProp("transformPastedText",d=>{t=d(t,i||r,e)}),i)return t?new Rt(lt.from(e.state.schema.text(t.replace(/\r\n?/g,`
diff --git a/index.html b/index.html
index 94341329..989baad8 100644
--- a/index.html
+++ b/index.html
@@ -45,7 +45,7 @@
}
}
-
+