UNPKG

mira-app-server

Version:

Mira Server - standalone server application using mira-app-core

158 lines 906 kB
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-DtPz-KJn.js","./index-OOzZz4T6.js","../css/index-CUYZI462.css","./viewHistory-C1myXHNJ.js","./ImagePreview-DeQlNh-B.js","./StatusImage-ijC2Qank.js","./PreviewHeader-QH_5UTLt.js","../css/ImagePreview-Vyy9OH2p.css","./VideoPreview-CeSO8gVZ.js","./plyr-BSkcSigr.js","../css/plyr-8PObnEuw.css","../css/VideoPreview-In1J5raM.css","./index-D6jc44HL.js","./index-BpRkT7P5.js","./index-DolKtx8u.js","./index-DBhZjv2g.js","./index-C8yh0IHU.js","./index-n2L2E3jR.js","./index-BSP9QwWh.js","./index-Dl-bCbvo.js","./index-BRb9Yibv.js","./index-DR0aqjZa.js","./index-D25qiNaP.js","./index-DVJDSAa2.js","./index-BJrjaDrm.js","./index-CtilFvX1.js","./dockerfile-BKs6k2Af.js","./simple-mode-GW_nhZxv.js","./factor-kuTfRLto.js","./nsis-LdVXkNf5.js","./pug-DeIclll2.js","./javascript-iXu5QeM3.js","./index-Dc7PzYRH.js","./index-BqYrj7c9.js"])))=>i.map(i=>d[i]); import{aA as Oe,c8 as W,bV as ye,bQ as Ne,aJ as K,dl as te,a1 as Zt,bZ as se,ax as oe,as as G,x as ii,cb as vr,bL as Qi,av as $t,cS as Op,bN as Hs,cr as xe,al as le,aE as Mc,c5 as yt,aH as S,d1 as gp,cR as Lo,b1 as E1,dq as Lc,aG as Ic,at as ca,aj as yr,be as Q,cl as Ti,c2 as Ce,b8 as Ou,cw as ha,bJ as At,_ as R1,U as D1,bu as M1,a0 as A,ar as L1,bE as Ks,d0 as I1,C as Z1,Z as X1,A as z1,b4 as j1,b3 as B1,cg as V1}from"./index-OOzZz4T6.js";import{u as F1}from"./viewHistory-C1myXHNJ.js";import q1 from"./ImagePreview-DeQlNh-B.js";import{H as Zc,V as W1}from"./VideoPreview-CeSO8gVZ.js";import{P as gu}from"./PreviewHeader-QH_5UTLt.js";/** * @license @lucide/vue v1.17.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const N1=[["path",{d:"M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8",key:"mg9rjx"}]],Y1=Oe("bold",N1);/** * @license @lucide/vue v1.17.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const G1=[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M7 11.207a.5.5 0 0 1 .146-.353l2-2a.5.5 0 0 1 .708 0l3.292 3.292a.5.5 0 0 0 .708 0l4.292-4.292a.5.5 0 0 1 .854.353V16a1 1 0 0 1-1 1H8a1 1 0 0 1-1-1z",key:"q0gr47"}]],U1=Oe("chart-area",G1);/** * @license @lucide/vue v1.17.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const H1=[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]],K1=Oe("code",H1);/** * @license @lucide/vue v1.17.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const J1=[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]],eb=Oe("code-xml",J1);/** * @license @lucide/vue v1.17.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const tb=[["path",{d:"m15 15 6 6",key:"1s409w"}],["path",{d:"m15 9 6-6",key:"ko1vev"}],["path",{d:"M21 16v5h-5",key:"1ck2sf"}],["path",{d:"M21 8V3h-5",key:"1qoq8a"}],["path",{d:"M3 16v5h5",key:"1t08am"}],["path",{d:"m3 21 6-6",key:"wwnumi"}],["path",{d:"M3 8V3h5",key:"1ln10m"}],["path",{d:"M9 9 3 3",key:"v551iv"}]],ib=Oe("expand",tb);/** * @license @lucide/vue v1.17.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const nb=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],rb=Oe("eye",nb);/** * @license @lucide/vue v1.17.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const sb=[["path",{d:"m15 17 5-5-5-5",key:"nf172w"}],["path",{d:"M4 18v-2a4 4 0 0 1 4-4h12",key:"jmiej9"}]],ob=Oe("forward",sb);/** * @license @lucide/vue v1.17.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const lb=[["path",{d:"M6 12h12",key:"8npq4p"}],["path",{d:"M6 20V4",key:"1w1bmo"}],["path",{d:"M18 20V4",key:"o2hl4u"}]],ab=Oe("heading",lb);/** * @license @lucide/vue v1.17.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const ub=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]],cb=Oe("image",ub);/** * @license @lucide/vue v1.17.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const hb=[["line",{x1:"19",x2:"10",y1:"4",y2:"4",key:"15jd3p"}],["line",{x1:"14",x2:"5",y1:"20",y2:"20",key:"bu0au3"}],["line",{x1:"15",x2:"9",y1:"4",y2:"20",key:"uljnxc"}]],fb=Oe("italic",hb);/** * @license @lucide/vue v1.17.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const db=[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]],pb=Oe("link",db);/** * @license @lucide/vue v1.17.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const mb=[["path",{d:"M11 5h10",key:"1cz7ny"}],["path",{d:"M11 12h10",key:"1438ji"}],["path",{d:"M11 19h10",key:"11t30w"}],["path",{d:"M4 4h1v5",key:"10yrso"}],["path",{d:"M4 9h2",key:"r1h2o0"}],["path",{d:"M6.5 20H3.4c0-1 2.6-1.925 2.6-3.5a1.5 1.5 0 0 0-2.6-1.02",key:"xtkcd5"}]],Ob=Oe("list-ordered",mb);/** * @license @lucide/vue v1.17.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const gb=[["path",{d:"M13 5h8",key:"a7qcls"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["rect",{x:"3",y:"4",width:"6",height:"6",rx:"1",key:"cif1o7"}]],bb=Oe("list-todo",gb);/** * @license @lucide/vue v1.17.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const xb=[["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"M3 10a2 2 0 0 0 2 2h3",key:"1npucw"}],["path",{d:"M3 5v12a2 2 0 0 0 2 2h3",key:"x1gjn2"}]],vb=Oe("list-tree",xb);/** * @license @lucide/vue v1.17.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const yb=[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]],kb=Oe("list",yb);/** * @license @lucide/vue v1.17.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const wb=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"m21 3-7 7",key:"1l2asr"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M9 21H3v-6",key:"wtvkvv"}]],Sb=Oe("maximize-2",wb);/** * @license @lucide/vue v1.17.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const $b=[["path",{d:"m14 10 7-7",key:"oa77jy"}],["path",{d:"M20 10h-6V4",key:"mjg0md"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M4 14h6v6",key:"rmj7iw"}]],_b=Oe("minimize-2",$b);/** * @license @lucide/vue v1.17.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Qb=[["path",{d:"M16 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"rib7q0"}],["path",{d:"M5 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"1ymkrd"}]],Pb=Oe("quote",Qb);/** * @license @lucide/vue v1.17.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Tb=[["path",{d:"M20 18v-2a4 4 0 0 0-4-4H4",key:"5vmcpk"}],["path",{d:"m9 17-5-5 5-5",key:"nvlc11"}]],Cb=Oe("reply",Tb);/** * @license @lucide/vue v1.17.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Ab=[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]],Eb=Oe("save",Ab);/** * @license @lucide/vue v1.17.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Rb=[["path",{d:"m15 15 6 6m-6-6v4.8m0-4.8h4.8",key:"17vawe"}],["path",{d:"M9 19.8V15m0 0H4.2M9 15l-6 6",key:"chjx8e"}],["path",{d:"M15 4.2V9m0 0h4.8M15 9l6-6",key:"lav6yq"}],["path",{d:"M9 4.2V9m0 0H4.2M9 9 3 3",key:"1pxi2q"}]],Db=Oe("shrink",Rb);/** * @license @lucide/vue v1.17.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Mb=[["path",{d:"m10 9-3 3 3 3",key:"1oro0q"}],["path",{d:"m14 15 3-3-3-3",key:"bz13h7"}],["rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",key:"h1oib"}]],Xc=Oe("square-code",Mb);/** * @license @lucide/vue v1.17.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Lb=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M16 8.9V7H8l4 5-4 5h8v-1.9",key:"9nih0i"}]],Ib=Oe("square-sigma",Lb);/** * @license @lucide/vue v1.17.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Zb=[["path",{d:"M16 4H9a3 3 0 0 0-2.83 4",key:"43sutm"}],["path",{d:"M14 12a4 4 0 0 1 0 8H6",key:"nlfj13"}],["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}]],Xb=Oe("strikethrough",Zb);/** * @license @lucide/vue v1.17.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const zb=[["path",{d:"m4 5 8 8",key:"1eunvl"}],["path",{d:"m12 5-8 8",key:"1ah0jp"}],["path",{d:"M20 19h-4c0-1.5.44-2 1.5-2.5S20 15.33 20 14c0-.47-.17-.93-.48-1.29a2.11 2.11 0 0 0-2.62-.44c-.42.24-.74.62-.9 1.07",key:"e8ta8j"}]],jb=Oe("subscript",zb);/** * @license @lucide/vue v1.17.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Bb=[["path",{d:"m4 19 8-8",key:"hr47gm"}],["path",{d:"m12 19-8-8",key:"1dhhmo"}],["path",{d:"M20 12h-4c0-1.5.442-2 1.5-2.5S20 8.334 20 7.002c0-.472-.17-.93-.484-1.29a2.105 2.105 0 0 0-2.617-.436c-.42.239-.738.614-.899 1.06",key:"1dfcux"}]],Vb=Oe("superscript",Bb);/** * @license @lucide/vue v1.17.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Fb=[["path",{d:"M12 3v18",key:"108xh3"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M3 15h18",key:"5xshup"}]],qb=Oe("table",Fb);/** * @license @lucide/vue v1.17.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Wb=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],Nb=Oe("trash-2",Wb);/** * @license @lucide/vue v1.17.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Yb=[["path",{d:"M6 4v6a6 6 0 0 0 12 0V4",key:"9kb039"}],["line",{x1:"4",x2:"20",y1:"20",y2:"20",key:"nun2al"}]],Gb=Oe("underline",Yb);/** * @license @lucide/vue v1.17.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Ub=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],Hb=Oe("upload",Ub);/** * @license @lucide/vue v1.17.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Kb=[["path",{d:"M21 17v2a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-2",key:"mrq65r"}],["path",{d:"M21 7V5a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v2",key:"be3xqs"}],["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["path",{d:"M18.944 12.33a1 1 0 0 0 0-.66 7.5 7.5 0 0 0-13.888 0 1 1 0 0 0 0 .66 7.5 7.5 0 0 0 13.888 0",key:"11ak4c"}]],Jb=Oe("view",Kb);function bp(t){const e=W(t);e.value=t,ye(()=>{let i=0,n=performance.now();const r=s=>{const o=s-n;n=s,e.value(s,o),i=requestAnimationFrame(r)};i=requestAnimationFrame(r),Ne(()=>cancelAnimationFrame(i))})}const zc=.4375,jc=620,ex=K({__name:"Disc",props:{layers:{type:Array,required:!0},isPlaying:{type:Boolean,required:!0},isZoomed:{type:Boolean,required:!0},trackKey:{type:Number,required:!0},direction:{type:[String,null],required:!0},showFallback:{type:Boolean,required:!0}},emits:["zoom-toggle"],setup(t,{expose:e,emit:i}){e();const n=t,r=i,s=W(null),o=W(0),l=W(0),a=W({from:0,start:0,active:!1,pending:!1}),u=W(n.trackKey),c=W(n.showFallback),h=(m,O)=>m===n.layers.length-1?O?"cover cover-enter":"cover":"cover cover-exit",f=m=>{m.stopPropagation(),r("zoom-toggle")},d=()=>{c.value=!0};te(()=>n.trackKey,m=>{m!==u.value&&(u.value=m,n.direction&&(a.value.from=n.direction==="prev"?360:-360,a.value.pending=!0))}),te(()=>n.showFallback,m=>{c.value=m}),bp(m=>{const O=s.value;if(!O)return;if(n.isPlaying?l.value+=(zc-l.value)*.2:(l.value*=.96,l.value<.001&&(l.value=0)),n.isZoomed){const v=Math.round(o.value/360)*360,y=o.value+(v-o.value)*.08;o.value=Math.abs(v-y)<.1?v:y}else o.value+=l.value;const g=a.value;g.pending&&(g.start=m,g.pending=!1,g.active=!0);let x=0;if(g.active){const v=(m-g.start)/jc;v>=1?g.active=!1:x=g.from*(1-(1-Math.pow(1-v,3)))}O.style.transform=`scale(1.01) rotate(${o.value+x}deg)`});const p={props:n,emit:r,SPIN_MAX:zc,BURST_DURATION:jc,spinRef:s,rotRef:o,velRef:l,burstRef:a,lastKey:u,coverMissing:c,coverClass:h,onMaskClick:f,onCoverError:d};return Object.defineProperty(p,"__isScriptSetup",{enumerable:!1,value:!0}),p}}),tx={class:"spin",ref:"spinRef"},ix=["src","alt"],nx={key:0,class:"cover cover-fallback"};function rx(t,e,i,n,r,s){return se(),oe("div",{class:Qi(["mask",{"is-zoomed":i.isZoomed}]),onClick:n.onMaskClick},[G("div",tx,[(se(!0),oe(ii,null,vr(i.layers,(o,l)=>(se(),oe("img",{key:o.id,src:o.track.cover,alt:`${o.track.title} — ${o.track.artist}`,class:Qi(n.coverClass(l,o.dir)),draggable:"false",onError:n.onCoverError},null,42,ix))),128)),n.coverMissing?(se(),oe("div",nx,e[0]||(e[0]=[G("span",{class:"material-symbols-outlined"},"music_note",-1)]))):$t("",!0)],512),e[1]||(e[1]=G("div",{class:"hole"},[G("div",{class:"hole-inner"})],-1))],2)}const sx=Zt(ex,[["render",rx],["__file","D:/mira_typescript/packages/mira-client/src/renderer/components/ui/music-player-widget/components/Disc.vue"]]),nn=10,ll=10,rn=1.5,al=11,sn=1,Bc=.133,Vc=.8,ox=K({__name:"ScalesMixer",props:{isPlaying:{type:Boolean,required:!0},getFrequencyData:{type:Function,required:!1}},setup(t,{expose:e}){e();const i=t,n=Op(),r=n.replace(/[^a-zA-Z0-9_-]/g,"_"),s=[[0,1],[1,3],[3,6],[6,10],[10,16],[16,24],[24,36],[36,52],[52,74],[74,100]],o=v=>Math.sin(v*Math.PI/2),l=v=>1-Math.cos(v*Math.PI/2),a=v=>-(Math.cos(Math.PI*v)-1)/2,u=(v,y,b)=>v+(y-v)*b,c=3/(nn-1);function h(v,y){const b=v-y*c,$=rn*2,_=(b%$+$)%$;return _<rn?al*a(_/rn):al*a(1-(_-rn)/rn)}function f(v,y,b){const $=b/ll,_=u(77,-77,$),P=u(y,-y,$),E=v-y/nn,Z=sn*2,M=(E%Z+Z)%Z;let C;return M<sn?C=o(M/sn):C=l(1-(M-sn)/sn),[u(_,P,C),u(Bc,Vc,C)]}const d=W([]),p=W(Array.from({length:nn},()=>[])),m=(v,y)=>{d.value[v]=y},O=(v,y,b)=>{p.value[v][y]=b},g=W(50);bp((v,y)=>{i.isPlaying&&(g.value+=y/1e3);const b=g.value,$=i.getFrequencyData?.();for(let _=0;_<nn;_++){let P=1;if($){const[C,L]=s[_];let B=0;for(let z=C;z<L;z++)B+=$[z]??0;P=Math.sqrt(B/(L-C)/255)}const E=$?.4+P:1,Z=$?.5+P:1,M=d.value[_];if(M){const C=h(b,_)*E;M.style.transform=`translate(${_*10}px, ${C}px)`}for(let C=0;C<ll;C++){const L=p.value[_][C];if(!L)continue;const[B,z]=f(b,_,C);L.style.transform=`translateY(${B}px) scale(${z*Z})`}}}),Ne(()=>{d.value=[],p.value=Array.from({length:nn},()=>[])});const x={props:i,rawId:n,maskId:r,COLS:nn,ROWS:ll,BAND_RANGES:s,sineOut:o,sineIn:l,sineInOut:a,lerp:u,PART_A_DUR:rn,PART_A_TO:al,PART_A_STEP:c,PART_B_DUR:sn,SCALE_FROM:Bc,SCALE_TO:Vc,partAColumnY:h,partBCircle:f,colRefs:d,circleRefs:p,setColRef:m,setCircleRef:O,tRef:g};return Object.defineProperty(x,"__isScriptSetup",{enumerable:!1,value:!0}),x}}),lx={class:"scales",viewBox:"0 0 98 108","aria-hidden":"true"},ax=["id"],ux=["mask","transform"];function cx(t,e,i,n,r,s){return se(),oe("svg",lx,[G("mask",{id:n.maskId},e[0]||(e[0]=[G("rect",{width:"10",height:"10",fill:"#fff"},null,-1)]),8,ax),(se(),oe(ii,null,vr(n.COLS,o=>G("g",{key:o-1,ref_for:!0,ref:l=>n.setColRef(o-1,l),style:Hs({transform:`translate(${(o-1)*10}px, 0px)`})},[(se(),oe(ii,null,vr(n.ROWS,l=>G("g",{key:l-1,mask:`url(#${n.maskId})`,transform:`translate(0 ${(l-1)*10})`},[G("circle",{ref_for:!0,ref:a=>n.setCircleRef(o-1,l-1,a),cx:"5",cy:"5",r:"5"},null,512)],8,ux)),64))],4)),64))])}const hx=Zt(ox,[["render",cx],["__file","D:/mira_typescript/packages/mira-client/src/renderer/components/ui/music-player-widget/components/ScalesMixer.vue"]]),fx=K({__name:"TrackInfo",props:{layers:{type:Array,required:!0}},setup(t,{expose:e}){e();const i=t,n=l=>l===i.layers.length-1,o={props:i,isNewest:n,stateClass:(l,a)=>n(l)?a?"ti-enter":"":"ti-exit",dxStyle:(l,a)=>{const u=n(l),c=a==="next"?14:a==="prev"?-14:0;return{"--dx":`${u?c:-c}px`}}};return Object.defineProperty(o,"__isScriptSetup",{enumerable:!1,value:!0}),o}}),dx={class:"track-info"};function px(t,e,i,n,r,s){return se(),oe("div",dx,[(se(!0),oe(ii,null,vr(i.layers,(o,l)=>(se(),oe("div",{key:o.id,class:Qi(["ti-layer",{"ti-abs":!n.isNewest(l)}])},[G("p",{class:Qi(["artist",n.stateClass(l,o.dir)]),style:Hs(n.dxStyle(l,o.dir))},xe(o.track.artist),7),G("h2",{class:Qi(["track",n.stateClass(l,o.dir)]),style:Hs(n.dxStyle(l,o.dir))},xe(o.track.title),7)],2))),128))])}const mx=Zt(fx,[["render",px],["__file","D:/mira_typescript/packages/mira-client/src/renderer/components/ui/music-player-widget/components/TrackInfo.vue"]]),Ox=K({__name:"ProgressBar",props:{currentTime:{type:Number,required:!0},duration:{type:Number,required:!0}},emits:["seek"],setup(t,{expose:e,emit:i}){e();const n=t,r=i,s=le(()=>n.duration?n.currentTime/n.duration*100:0),a={props:n,emit:r,pct:s,fmt:u=>isFinite(u)?`${Math.floor(u/60)}:${String(Math.floor(u%60)).padStart(2,"0")}`:"0:00",onClick:u=>{const c=u.currentTarget.getBoundingClientRect(),h=Math.max(0,Math.min(1,(u.clientX-c.left)/c.width));r("seek",h)}};return Object.defineProperty(a,"__isScriptSetup",{enumerable:!1,value:!0}),a}}),gx={class:"progress-wrap"},bx={class:"time"},xx={class:"current"},vx={class:"total"};function yx(t,e,i,n,r,s){return se(),oe("div",gx,[G("div",{class:"bar",onClick:n.onClick},[G("div",{class:"bar-fill",style:Hs({width:`${n.pct}%`})},null,4)]),G("div",bx,[G("span",xx,xe(n.fmt(i.currentTime)),1),e[0]||(e[0]=G("span",{class:"sep"},"/",-1)),G("span",vx,xe(n.fmt(i.duration)),1)])])}const kx=Zt(Ox,[["render",yx],["__file","D:/mira_typescript/packages/mira-client/src/renderer/components/ui/music-player-widget/components/ProgressBar.vue"]]),wx=K({__name:"Controls",props:{isPlaying:{type:Boolean,required:!0},shuffled:{type:Boolean,required:!0},loopMode:{type:String,required:!0},multi:{type:Boolean,required:!0}},emits:["toggle","next","prev","shuffle","loop"],setup(t,{expose:e}){e();const i={};return Object.defineProperty(i,"__isScriptSetup",{enumerable:!1,value:!0}),i}}),Sx={class:"controls"},$x=["title"],_x=["title"],Qx=["title"],Px={key:0,viewBox:"0 0 24 24",width:"14",height:"14",fill:"currentColor"},Tx={key:1,viewBox:"0 0 24 24",width:"14",height:"14",fill:"currentColor"},Cx=["title"],Ax=["title"];function Ex(t,e,i,n,r,s){return se(),oe("div",Sx,[i.multi?(se(),oe("button",{key:0,class:Qi(["ctrl ctrl-toggle",{"is-active":i.shuffled}]),title:t.$t("preview.audioPreview.shuffle"),onClick:e[0]||(e[0]=o=>t.$emit("shuffle"))},e[5]||(e[5]=[Mc('<svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M16 3h5v5"></path><path d="M21 3l-7 7"></path><path d="M3 21l7-7"></path><path d="M16 21h5v-5"></path><path d="M21 21l-7-7"></path><path d="M3 3l7 7"></path></svg>',1)]),10,$x)):$t("",!0),i.multi?(se(),oe("button",{key:1,class:"ctrl",title:t.$t("preview.audioPreview.previous"),onClick:e[1]||(e[1]=o=>t.$emit("prev"))},e[6]||(e[6]=[G("svg",{viewBox:"0 0 24 24",width:"16",height:"16",fill:"currentColor"},[G("path",{d:"M19 5L8 12l11 7zM5 5h2v14H5z"})],-1)]),8,_x)):$t("",!0),G("button",{class:"ctrl ctrl-play",title:i.isPlaying?t.$t("preview.audioPreview.pause"):t.$t("preview.audioPreview.play"),onClick:e[2]||(e[2]=o=>t.$emit("toggle"))},[i.isPlaying?(se(),oe("svg",Px,e[7]||(e[7]=[G("path",{d:"M6 5h3v14H6zM15 5h3v14h-3z"},null,-1)]))):(se(),oe("svg",Tx,e[8]||(e[8]=[G("path",{d:"M7 5v14l11-7z"},null,-1)])))],8,Qx),i.multi?(se(),oe("button",{key:2,class:"ctrl",title:t.$t("preview.audioPreview.next"),onClick:e[3]||(e[3]=o=>t.$emit("next"))},e[9]||(e[9]=[G("svg",{viewBox:"0 0 24 24",width:"16",height:"16",fill:"currentColor"},[G("path",{d:"M5 5l11 7L5 19zM17 5h2v14h-2z"})],-1)]),8,Cx)):$t("",!0),i.multi?(se(),oe("button",{key:3,class:Qi(["ctrl ctrl-toggle ctrl-loop",{"is-active":i.loopMode!=="off","mode-one":i.loopMode==="one"}]),title:t.$t("preview.audioPreview.loop"),onClick:e[4]||(e[4]=o=>t.$emit("loop"))},e[10]||(e[10]=[Mc('<svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M4 12V8a2 2 0 0 1 2-2h12"></path><path d="M16 3l4 3l-4 3"></path><path d="M20 12v4a2 2 0 0 1-2 2H6"></path><path d="M8 21l-4-3l4-3"></path></svg><span class="loop-one">1</span>',2)]),10,Ax)):$t("",!0)])}const Rx=Zt(wx,[["render",Ex],["__file","D:/mira_typescript/packages/mira-client/src/renderer/components/ui/music-player-widget/components/Controls.vue"]]),Fc=256;function Dx(t){const e=W(null),i=W(null),n=W(new Uint8Array(Fc/2)),r=W(!1),s=()=>{const a=t.value;if(!(!a||r.value))try{const u=window.AudioContext||window.webkitAudioContext;if(!u)return;const c=new u,h=c.createAnalyser();h.fftSize=Fc,h.smoothingTimeConstant=.8,c.createMediaElementSource(a).connect(h),h.connect(c.destination),e.value=c,i.value=h,n.value=new Uint8Array(h.frequencyBinCount),r.value=!0,c.state==="suspended"&&c.resume().catch(()=>{})}catch{}};return Ne(()=>{e.value?.close().catch(()=>{}),e.value=null}),{connect:s,getFrequencyData:()=>{const a=i.value;return a?(e.value?.state==="suspended"&&e.value.resume().catch(()=>{}),a.getByteFrequencyData(n.value),n.value):null},getBandEnergy:(a,u)=>{if(!i.value)return 0;const c=n.value,h=u-a;if(h<=0)return 0;let f=0;for(let d=a;d<u&&d<c.length;d++)f+=c[d];return f/h/255}}}function Mx(){const t=W(null);return Ne(()=>{t.value?.close().catch(()=>{}),t.value=null}),(i=.5)=>{try{if(!t.value){const u=window.AudioContext||window.webkitAudioContext;if(!u)return;t.value=new u}const n=t.value;n.state==="suspended"&&n.resume();const r=n.currentTime,s=n.createOscillator(),o=n.createGain(),l=440+i*440,a=l*(2/3);s.type="triangle",s.frequency.setValueAtTime(l,r),s.frequency.exponentialRampToValueAtTime(a,r+.09),o.gain.setValueAtTime(1e-4,r),o.gain.exponentialRampToValueAtTime(.06,r+.012),o.gain.exponentialRampToValueAtTime(1e-4,r+.16),s.connect(o).connect(n.destination),s.start(r),s.stop(r+.18)}catch{}}}function Lx(t,e){const i=Array.from({length:e},(n,r)=>r).filter(n=>n!==t);for(let n=i.length-1;n>0;n--){const r=Math.floor(Math.random()*(n+1));[i[n],i[r]]=[i[r],i[n]]}return[t,...i]}function Ix(t){const e=W(null),i=W(0),n=W(0),r=yt({currentIndex:0,order:Array.from({length:t.value.length},(b,$)=>$),shuffled:!1,loopMode:"off",isPlaying:!1,direction:null}),{connect:s,getFrequencyData:o,getBandEnergy:l}=Dx(e),a=Mx();let u=null;const c=(b,$)=>{if(u?.destroy(),u=null,$.includes(".m3u8")&&Zc.isSupported()){u=new Zc({enableWorker:!0,lowLatencyMode:!1}),u.loadSource($),u.attachMedia(b);return}b.src=$,b.load()},h=(b,$,_)=>{const P=e.value;if(!P)return;const E=l(0,4);t.value.length>1&&a(E),r.currentIndex=b,r.direction=_,c(P,t.value[b].src),$&&P.play().catch(()=>{})},f=()=>{const b=e.value;b&&(b.paused?b.play().catch(()=>{}):b.pause())},d=()=>{const b=e.value;if(!b||t.value.length<=1)return;const _=r.order.indexOf(r.currentIndex)+1;if(_>=r.order.length){r.loopMode==="all"?h(r.order[0],!b.paused,"next"):(b.pause(),b.currentTime=0);return}h(r.order[_],!b.paused,"next")},p=()=>{const b=e.value;if(!b||t.value.length<=1)return;if(b.currentTime>3){b.currentTime=0;return}const _=r.order.indexOf(r.currentIndex)-1;if(_<0){r.loopMode==="all"?h(r.order[r.order.length-1],!b.paused,"prev"):b.currentTime=0;return}h(r.order[_],!b.paused,"prev")},m=b=>{const $=e.value;!$||!$.duration||($.currentTime=b*$.duration)},O=()=>{if(t.value.length<=1)return;const b=!r.shuffled;r.order=b?Lx(r.currentIndex,t.value.length):Array.from({length:t.value.length},($,_)=>_),r.shuffled=b},g=()=>{const b=r.loopMode==="off"?"all":r.loopMode==="all"?"one":"off";r.loopMode=b},x=()=>{const b=e.value;if(!b)return;const $=()=>{r.isPlaying=!0,s()},_=()=>{r.isPlaying=!1},P=()=>{Number.isFinite(b.duration)&&(n.value=b.duration)},E=()=>{i.value=b.currentTime,b.duration&&(n.value=b.duration)},Z=()=>{r.loopMode==="one"?(b.currentTime=0,b.play().catch(()=>{})):d()};b.addEventListener("play",$),b.addEventListener("pause",_),b.addEventListener("loadedmetadata",P),b.addEventListener("timeupdate",E),b.addEventListener("ended",Z),Ne(()=>{b.removeEventListener("play",$),b.removeEventListener("pause",_),b.removeEventListener("loadedmetadata",P),b.removeEventListener("timeupdate",E),b.removeEventListener("ended",Z)})};te(e,b=>{b&&(x(),t.value.length>0&&c(b,t.value[0].src))}),te(t,b=>{const $=e.value;!$||b.length===0||(r.currentIndex=0,r.direction=null,r.order=Array.from({length:b.length},(_,P)=>P),r.shuffled=!1,i.value=0,n.value=0,c($,b[0].src))}),Ne(()=>{u?.destroy(),u=null});const v=W(t.value[0]),y=()=>{v.value=t.value[r.currentIndex]??t.value[0]};return te(()=>r.currentIndex,y),te(t,y,{immediate:!0}),{audioRef:e,state:r,currentTime:i,duration:n,currentTrack:v,toggle:f,next:d,prev:p,seek:m,toggleShuffle:O,cycleLoop:g,getFrequencyData:o,connectAnalyser:s}}function Zx(t){const e=i=>{const n=i.target?.tagName;if(n==="INPUT"||n==="TEXTAREA")return;const r=t();switch(i.key){case" ":i.preventDefault(),r.toggle();break;case"ArrowRight":i.preventDefault(),i.shiftKey?r.next():r.seekForward();break;case"ArrowLeft":i.preventDefault(),i.shiftKey?r.prev():r.seekBackward();break;case"s":case"S":r.toggleShuffle();break;case"l":case"L":r.cycleLoop();break}};ye(()=>document.addEventListener("keydown",e)),Ne(()=>document.removeEventListener("keydown",e))}const Xx=K({__name:"MusicPlayer",props:{tracks:{type:Array,required:!0},crossOrigin:{type:String,required:!1}},setup(t,{expose:e}){e();const i=t,n=le(()=>i.tracks),r=Ix(n),s=W(null);te(s,g=>{r.audioRef.value=g},{immediate:!0});const o=W(!1),l=le(()=>i.tracks.length>1),a=le(()=>!r.currentTrack.value?.cover),u=W([{id:0,track:i.tracks[0],dir:null}]),c=W(0),h=W(1);te(()=>r.state.currentIndex,()=>{if(r.state.currentIndex===c.value)return;c.value=r.state.currentIndex;const g=h.value++;u.value=[...u.value,{id:g,track:r.currentTrack.value,dir:r.state.direction}],setTimeout(()=>{u.value=u.value.filter(x=>x.id===g)},760)}),te(()=>i.tracks,g=>{g.length&&(u.value=[{id:h.value++,track:g[0],dir:null}],c.value=0)});const f=()=>{o.value=!o.value},d=g=>{g.target.closest(".mask")||(o.value=!1)},p=()=>{const g=r.audioRef.value;g&&(g.currentTime=Math.min(g.duration||0,g.currentTime+5))},m=()=>{const g=r.audioRef.value;g&&(g.currentTime=Math.max(0,g.currentTime-5))};Zx(()=>({toggle:r.toggle,next:r.next,prev:r.prev,seekForward:p,seekBackward:m,toggleShuffle:r.toggleShuffle,cycleLoop:r.cycleLoop}));const O={props:i,tracksRef:n,player:r,audioEl:s,isZoomed:o,multi:l,coverMissing:a,layers:u,lastIndex:c,idRef:h,toggleZoom:f,onCardClick:d,seekForward:p,seekBackward:m,Disc:sx,ScalesMixer:hx,TrackInfo:mx,ProgressBar:kx,Controls:Rx};return Object.defineProperty(O,"__isScriptSetup",{enumerable:!1,value:!0}),O}}),zx=["crossorigin"],jx={class:"info"};function Bx(t,e,i,n,r,s){return se(),oe("div",{class:Qi(["card",{"is-playing":n.player.state.isPlaying,"is-zoomed":n.isZoomed}]),onClick:n.onCardClick},[G("audio",{ref:"audioEl",preload:"metadata",crossorigin:i.crossOrigin||void 0},null,8,zx),S(n.Disc,{layers:n.layers,"is-playing":n.player.state.isPlaying,"is-zoomed":n.isZoomed,"track-key":n.player.state.currentIndex,direction:n.player.state.direction,"show-fallback":n.coverMissing,onZoomToggle:n.toggleZoom},null,8,["layers","is-playing","is-zoomed","track-key","direction","show-fallback"]),G("div",jx,[S(n.ScalesMixer,{"is-playing":n.player.state.isPlaying,"get-frequency-data":n.player.getFrequencyData},null,8,["is-playing","get-frequency-data"]),S(n.TrackInfo,{layers:n.layers},null,8,["layers"]),S(n.ProgressBar,{"current-time":n.player.currentTime.value,duration:n.player.duration.value,onSeek:n.player.seek},null,8,["current-time","duration","onSeek"]),S(n.Controls,{"is-playing":n.player.state.isPlaying,shuffled:n.player.state.shuffled,"loop-mode":n.player.state.loopMode,multi:n.multi,onToggle:n.player.toggle,onNext:n.player.next,onPrev:n.player.prev,onShuffle:n.player.toggleShuffle,onLoop:n.player.cycleLoop},null,8,["is-playing","shuffled","loop-mode","multi","onToggle","onNext","onPrev","onShuffle","onLoop"])])],2)}const Vx=Zt(Xx,[["render",Bx],["__file","D:/mira_typescript/packages/mira-client/src/renderer/components/ui/music-player-widget/MusicPlayer.vue"]]),Fx=K({__name:"AudioPreview",props:{fileInfo:{type:null,required:!0}},emits:["error","renamed"],setup(t,{expose:e}){e();const i=t,n=gp(),{t:r}=Lo(),s=u=>{if(!u)return r("preview.audioPreview.unknownTitle");const c=u.lastIndexOf(".");return c>0?u.substring(0,c):u},o=le(()=>{const u=i.fileInfo;if(!u)return[];const c=E1(u);return c?[{title:s(u.name||u.title),artist:u.metadata?.artist||u.metadata?.album||r("preview.audioPreview.unknownArtist"),cover:u.thumbnailPath||"",src:c}]:[]}),a={props:i,router:n,t:r,baseTitle:s,tracks:o,closePreview:()=>{window.history.length>1?n.back():n.push("/")},PreviewHeader:gu,get MusicPlayer(){return Vx}};return Object.defineProperty(a,"__isScriptSetup",{enumerable:!1,value:!0}),a}}),qx={class:"audio-preview-view h-screen flex flex-col bg-muted dark:bg-muted text-[13px]"},Wx={class:"flex items-center space-x-2"},Nx={class:"inline-flex items-center rounded-md bg-muted px-2 py-1 text-xs font-medium text-muted-foreground"},Yx={class:"flex flex-grow items-center justify-center overflow-auto bg-background p-6"},Gx={key:1,class:"text-center text-destructive"};function Ux(t,e,i,n,r,s){return se(),oe("div",qx,[S(n.PreviewHeader,{"file-info":i.fileInfo,onRenamed:e[0]||(e[0]=o=>t.$emit("renamed",o)),onError:e[1]||(e[1]=o=>t.$emit("error",o))},{"left-extra":Lc(()=>[G("div",Wx,[G("span",Nx,[e[2]||(e[2]=G("span",{class:"material-symbols-outlined text-sm mr-1"},"folder",-1)),Ic(" "+xe(i.fileInfo?.folderId||t.$t("preview.audioPreview.unknownFolder")),1)]),(se(!0),oe(ii,null,vr(i.fileInfo?.tags,o=>(se(),oe("span",{key:o,class:"inline-flex items-center rounded-md bg-primary/10 px-2 py-1 text-xs font-medium text-primary"},[e[3]||(e[3]=G("span",{class:"material-symbols-outlined text-sm mr-1"},"label",-1)),Ic(" "+xe(o),1)]))),128))])]),"right-actions":Lc(()=>[e[5]||(e[5]=G("button",{class:"flex h-9 w-9 items-center justify-center rounded-full hover:bg-muted"},[G("span",{class:"material-symbols-outlined text-muted-foreground"},"more_horiz")],-1)),G("button",{class:"flex h-9 w-9 items-center justify-center rounded-full hover:bg-muted",onClick:n.closePreview},e[4]||(e[4]=[G("span",{class:"material-icons text-muted-foreground"},"close",-1)]))]),_:1},8,["file-info"]),G("div",Yx,[n.tracks.length?(se(),ca(n.MusicPlayer,{key:0,tracks:n.tracks},null,8,["tracks"])):(se(),oe("div",Gx,[G("p",null,xe(t.$t("preview.audioPreview.noAudioUrl")),1)]))])])}const Hx=Zt(Fx,[["render",Ux],["__scopeId","data-v-eb48917e"],["__file","D:/mira_typescript/packages/mira-client/src/renderer/components/preview/AudioPreview.vue"]]),Kx=t=>{const e=typeof t;return e!=="function"&&e!=="object"||t===null},Jx=t=>{const e=t.flags===""?void 0:t.flags;return new RegExp(t.source,e)},ir=(t,e=new WeakMap)=>{if(t===null||Kx(t))return t;if(e.has(t))return e.get(t);if(t instanceof RegExp)return Jx(t);if(t instanceof Date)return new Date(t.getTime());if(t instanceof Function)return t;if(t instanceof Map){const n=new Map;return e.set(t,n),t.forEach((r,s)=>{n.set(s,ir(r,e))}),n}if(t instanceof Set){const n=new Set;e.set(t,n);for(const r of t)n.add(ir(r,e));return n}if(Array.isArray(t)){const n=[];return e.set(t,n),t.forEach(r=>{n.push(ir(r,e))}),n}const i={};e.set(t,i);for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&(i[n]=ir(t[n],e));return i},xp=(t,e=200)=>{let i=0;return(...n)=>new Promise(r=>{i&&(clearTimeout(i),r("cancel")),i=window.setTimeout(()=>{t.apply(void 0,n),i=0,r("done")},e)})},ev=(t,e={_blank:!0,nofollow:!0})=>{const i=document.createElement("a");i.href=t,e._blank&&(i.target="_blank"),e.nofollow&&(i.rel="noopener noreferrer"),i.click()},bu=()=>{let t=-1;return(e,i,n,r=100)=>{const s=()=>{n&&(typeof r=="number"?setTimeout(n,r):n())};t!==-1&&(cancelAnimationFrame(t),s());let o=e.scrollTop;const l=()=>{t=-1;const a=i-o;o=o+a/5,Math.abs(a)<1?(e.scrollTo(0,i),s()):(e.scrollTo(0,o),t=requestAnimationFrame(l))};t=requestAnimationFrame(l)}},tv=(t,e=200)=>{let i=0,n=null;const r=s=>{i===0&&(i=s),s-i>=e?(t.apply(void 0,n),n=null,i=0):window.requestAnimationFrame(r)};return(...s)=>{n===null&&window.requestAnimationFrame(r),n=s}},iv=t=>{const e=i=>{const{scrollHeight:n,scrollWidth:r,offsetHeight:s,offsetWidth:o,scrollLeft:l,scrollTop:a}=t,u=i.x,c=i.y,h=d=>{const p=a+c-d.y,m=l+u-d.x,O=n-s,g=r-o,x={};m>=0&&m<=g&&(x.left=m),p>=0&&p<=O&&(x.top=p),t.scroll(x)};document.addEventListener("mousemove",h);const f=()=>{document.removeEventListener("mousemove",h),document.removeEventListener("mouseup",f)};document.addEventListener("mouseup",f)};return t.addEventListener("mousedown",e),()=>{t.removeEventListener("mousedown",e)}},fa=()=>`${Date.now().toString(36)}${Math.random().toString(36).substring(2)}`,Js=t=>t!==null&&typeof t=="object"&&!Array.isArray(t),nv=new Set(["__proto__","constructor","prototype"]),rv=t=>!nv.has(t),xu=(t,e,i={})=>{if(Array.isArray(t)&&Array.isArray(e))return da(t,e,i);const{excludeKeys:n}=i,r=t,s=e;for(const o of Object.keys(s)){if(!rv(o))continue;const l=s[o],a=r[o];n&&n(o)?r[o]=l:Array.isArray(l)&&Array.isArray(a)?r[o]=da(a,l,i):Js(l)&&Js(a)?r[o]=xu(a,l,i):r[o]=l}return t},da=(t,e,i)=>{const n=t.slice();return e.forEach((r,s)=>{const o=n[s];Array.isArray(r)&&Array.isArray(o)?n[s]=da(o,r,i):Js(r)&&Js(o)?n[s]=xu(o,r,i):n[s]=r}),n},k="md-editor",sv="MdEditor",Se="https://unpkg.com",ov=`${Se}/@highlightjs/cdn-assets@11.11.1/highlight.min.js`,qc={main:`${Se}/prettier@3.8.1/standalone.js`,markdown:`${Se}/prettier@3.8.1/plugins/markdown.js`},lv={css:`${Se}/cropperjs@1.6.2/dist/cropper.min.css`,js:`${Se}/cropperjs@1.6.2/dist/cropper.min.js`},av=`${Se}/screenfull@5.2.0/dist/screenfull.js`,uv=`${Se}/mermaid@11.12.3/dist/mermaid.min.js`,cv={js:`${Se}/katex@0.16.33/dist/katex.min.js`,css:`${Se}/katex@0.16.33/dist/katex.min.css`},pa={a11y:{light:`${Se}/@highlightjs/cdn-assets@11.11.1/styles/a11y-light.min.css`,dark:`${Se}/@highlightjs/cdn-assets@11.11.1/styles/a11y-dark.min.css`},atom:{light:`${Se}/@highlightjs/cdn-assets@11.11.1/styles/atom-one-light.min.css`,dark:`${Se}/@highlightjs/cdn-assets@11.11.1/styles/atom-one-dark.min.css`},github:{light:`${Se}/@highlightjs/cdn-assets@11.11.1/styles/github.min.css`,dark:`${Se}/@highlightjs/cdn-assets@11.11.1/styles/github-dark.min.css`},gradient:{light:`${Se}/@highlightjs/cdn-assets@11.11.1/styles/gradient-light.min.css`,dark:`${Se}/@highlightjs/cdn-assets@11.11.1/styles/gradient-dark.min.css`},kimbie:{light:`${Se}/@highlightjs/cdn-assets@11.11.1/styles/kimbie-light.min.css`,dark:`${Se}/@highlightjs/cdn-assets@11.11.1/styles/kimbie-dark.min.css`},paraiso:{light:`${Se}/@highlightjs/cdn-assets@11.11.1/styles/paraiso-light.min.css`,dark:`${Se}/@highlightjs/cdn-assets@11.11.1/styles/paraiso-dark.min.css`},qtcreator:{light:`${Se}/@highlightjs/cdn-assets@11.11.1/styles/qtcreator-light.min.css`,dark:`${Se}/@highlightjs/cdn-assets@11.11.1/styles/qtcreator-dark.min.css`},stackoverflow:{light:`${Se}/@highlightjs/cdn-assets@11.11.1/styles/stackoverflow-light.min.css`,dark:`${Se}/@highlightjs/cdn-assets@11.11.1/styles/stackoverflow-dark.min.css`}},hv=`${Se}/echarts@6.0.0/dist/echarts.min.js`,vp=["bold","underline","italic","strikeThrough","-","title","sub","sup","quote","unorderedList","orderedList","task","-","codeRow","code","link","image","table","mermaid","katex","-","revoke","next","save","=","prettier","pageFullscreen","fullscreen","preview","previewOnly","htmlPreview","catalog","github"],yp=["markdownTotal","=","scrollSwitch"],Wc={"zh-CN":{toolbarTips:{bold:"加粗",underline:"下划线",italic:"斜体",strikeThrough:"删除线",title:"标题",sub:"下标",sup:"上标",quote:"引用",unorderedList:"无序列表",orderedList:"有序列表",task:"任务列表",codeRow:"行内代码",code:"块级代码",link:"链接",image:"图片",table:"表格",mermaid:"mermaid图",katex:"katex公式",revoke:"后退",next:"前进",save:"保存",prettier:"美化",pageFullscreen:"浏览器全屏",fullscreen:"屏幕全屏",preview:"预览",previewOnly:"仅预览",htmlPreview:"html代码预览",catalog:"目录",github:"源码地址"},titleItem:{h1:"一级标题",h2:"二级标题",h3:"三级标题",h4:"四级标题",h5:"五级标题",h6:"六级标题"},imgTitleItem:{link:"添加链接",upload:"上传图片",clip2upload:"裁剪上传"},linkModalTips:{linkTitle:"添加链接",imageTitle:"添加图片",descLabel:"链接描述:",descLabelPlaceHolder:"请输入描述...",urlLabel:"链接地址:",urlLabelPlaceHolder:"请输入链接...",buttonOK:"确定"},clipModalTips:{title:"裁剪图片上传",buttonUpload:"上传"},copyCode:{text:"复制代码",successTips:"已复制!",failTips:"复制失败!"},mermaid:{flow:"流程图",sequence:"时序图",gantt:"甘特图",class:"类图",state:"状态图",pie:"饼图",relationship:"关系图",journey:"旅程图"},katex:{inline:"行内公式",block:"块级公式"},footer:{markdownTotal:"字数",scrollAuto:"同步滚动"}},"en-US":{toolbarTips:{bold:"bold",underline:"underline",italic:"italic",strikeThrough:"strikeThrough",title:"title",sub:"subscript",sup:"superscript",quote:"quote",unorderedList:"unordered list",orderedList:"ordered list",task:"task list",codeRow:"inline code",code:"block-level code",link:"link",image:"image",table:"table",mermaid:"mermaid",katex:"formula",revoke:"revoke",next:"undo revoke",save:"save",prettier:"prettier",pageFullscreen:"fullscreen in page",fullscreen:"fullscreen",preview:"preview",previewOnly:"preview only",htmlPreview:"html preview",catalog:"catalog",github:"source code"},titleItem:{h1:"Lv1 Heading",h2:"Lv2 Heading",h3:"Lv3 Heading",h4:"Lv4 Heading",h5:"Lv5 Heading",h6:"Lv6 Heading"},imgTitleItem:{link:"Add Image Link",upload:"Upload Images",clip2upload:"Crop And Upload"},linkModalTips:{linkTitle:"Add Link",imageTitle:"Add Image",descLabel:"Desc:",descLabelPlaceHolder:"Enter a description...",urlLabel:"Link:",urlLabelPlaceHolder:"Enter a link...",buttonOK:"OK"},clipModalTips:{title:"Crop Image",buttonUpload:"Upload"},copyCode:{text:"Copy",successTips:"Copied!",failTips:"Copy failed!"},mermaid:{flow:"flow",sequence:"sequence",gantt:"gantt",class:"class",state:"state",pie:"pie",relationship:"relationship",journey:"journey"},katex:{inline:"inline",block:"block"},footer:{markdownTotal:"Character Count",scrollAuto:"Scroll Auto"}}},Me={editorExtensions:{highlight:{js:ov,css:pa},prettier:{standaloneJs:qc.main,parserMarkdownJs:qc.markdown},cropper:{...lv},screenfull:{js:av},mermaid:{js:uv,enableZoom:!0},katex:{...cv},echarts:{js:hv,parseOption:t=>new Function(`return ${t}`)()}},editorExtensionsAttrs:{},editorConfig:{languageUserDefined:{},mermaidTemplate:{},renderDelay:500,zIndex:2e4},codeMirrorExtensions:t=>t,markdownItConfig:()=>{},markdownItPlugins:t=>t,mermaidConfig:t=>t,katexConfig:t=>t,echartsConfig:t=>t},ss=.1,Je=({instance:t,ctx:e,props:i={}},n="default")=>{const r=t?.$slots[n]||e?.slots[n];return(r?r(t):"")||i[n]},fv={overlay:{type:[String,Object],default:""},visible:{type:Boolean,default:!1},onChange:{type:Function,default:()=>{}},relative:{type:String,default:"html"},disabled:{type:Boolean,default:void 0}},Xn=K({name:`${k}-dropdown`,props:fv,setup(t,e){const i=`${k}-dropdown-hidden`,n=yt({overlayClass:[i],overlayStyle:{},triggerHover:!1,overlayHover:!1}),r=W(),s=W(),o=()=>{if(t.disabled)return!1;n.triggerHover=!0;const c=r.value,h=s.value;if(!c||!h)return;const f=c.getBoundingClientRect(),d=c.offsetTop,p=c.offsetLeft,m=f.height,O=f.width,g=c.getRootNode(),x=g.querySelector(t.relative)?.scrollLeft||0,v=g.querySelector(t.relative)?.clientWidth||0;let y=p-h.offsetWidth/2+O/2-x;y+h.offsetWidth>x+v&&(y=x+v-h.offsetWidth),y<0&&(y=0),n.overlayStyle={...n.overlayStyle,insetBlockStart:d+m+"px",insetInlineStart:y+"px"},t.onChange(!0)},l=()=>{if(t.disabled)return!1;n.overlayHover=!0};te(()=>t.visible,c=>{c?n.overlayClass=n.overlayClass.filter(h=>h!==i):n.overlayClass.push(i)});let a=-1;const u=c=>{r.value===c.target?n.triggerHover=!1:n.overlayHover=!1,clearTimeout(a),a=window.setTimeout(()=>{!n.overlayHover&&!n.triggerHover&&t.onChange(!1)},10)};return ye(()=>{r.value.addEventListener("mouseenter",o),r.value.addEventListener("mouseleave",u),s.value.addEventListener("mouseenter",l),s.value.addEventListener("mouseleave",u)}),Ne(()=>{r.value.removeEventListener("mouseenter",o),r.value.removeEventListener("mouseleave",u),s.value.removeEventListener("mouseenter",l),s.value.removeEventListener("mouseleave",u)}),()=>{const c=Je({ctx:e}),h=Je({props:t,ctx:e},"overlay"),f=yr(c instanceof Array?c[0]:c,{ref:r,key:"cloned-dropdown-trigger"}),d=S("div",{class:[`${k}-dropdown`,n.overlayClass],style:n.overlayStyle,ref:s},[S("div",{class:`${k}-dropdown-overlay`},[h instanceof Array?h[0]:h])]);return[f,d]}}}),dv={title:{type:String,default:""},visible:{type:Boolean,default:void 0},trigger:{type:[String,Object],default:void 0},onChange:{type:Function,default:void 0},overlay:{type:[String,Object],default:void 0},insert:{type:Function,default:void 0},language:{type:String,default:void 0},theme:{type:String,default:void 0},previewTheme:{type:String,default:void 0},codeTheme:{type:String,default:void 0},disabled:{type:Boolean,default:void 0},showToolbarName:{type:Boolean,default:void 0}},Ms=K({name:"DropdownToolbar",props:dv,emits:["onChange"],setup(t,e){const i=Q("editorId"),n=r=>{t.onChange?.(r),e.emit("onChange",r)};return()=>{const r=Je({props:t,ctx:e},"trigger"),s=Je({props:t,ctx:e},"overlay"),o=Je({props:t,ctx:e});return S(Xn,{relative:`#${i}-toolbar-wrapper`,visible:t.visible,onChange:n,overlay:s,disabled:t.disabled},{default:()=>[S("button",{class:[`${k}-toolbar-item`,t.disabled&&`${k}-disabled`],title:t.title||"",disabled:t.disabled,type:"button"},[o||r])]})}}});Ms.install=t=>(t.component(Ms.name,Ms),t);const Io="onSave",vu="changeCatalogVisible",kp="changeFullscreen",Nc="pageFullscreenChanged",Yc="fullscreenChanged",Gc="previewChanged",Uc="previewOnlyChanged",Hc="htmlPreviewChanged",Kc="catalogVisibleChanged",Ls="buildFinished",ni="errorCatcher",wp="replace",Zo="uploadImage",Sp="ctrlZ",$p="ctrlShiftZ",ar="catalogChanged",_p="pushCatalog",yu="rerender",Qp="eventListener",Pp="taskStateChanged",Tp="sendEditorView",eo="getEditorView";class pv{pools={};remove(e,i,n){const r=this.pools[e]&&this.pools[e][i];r&&(this.pools[e][i]=r.filter(s=>s!==n))}clear(e){this.pools[e]={}}on(e,i){return this.pools[e]||(this.pools[e]={}),this.pools[e][i.name]||(this.pools[e][i.name]=[]),this.pools[e][i.name].push(i.callback),this.pools[e][i.name].includes(i.callback)}emit(e,i,...n){this.pools[e]||(this.pools[e]={});const r=this.pools[e][i];r&&r.forEach(s=>{try{s(...n)}catch(o){console.error(`${i} monitor event exception!`,o)}})}}const H=new pv,mv=(t,e="image.png")=>{const i=t.split(","),n=i[0].match(/:(.*?);/);if(n){const r=n[1],s=atob(i[1]);let o=s.length;const l=new Uint8Array(o);for(;o--;)l[o]=s.charCodeAt(o);return new File([l],e,{type:r})}return null},Ov=(t,e)=>{if(!t)return t;const i=e.split(` `),n=['<span rn-wrapper aria-hidden="true">'];return i.forEach(()=>{n.push("<span></span>")}),n.push("</span>"),`<span class="${k}-code-block">${t}</span>${n.join("")}`},gv=(t,e)=>{if(!t||!e)return 0;const i=t?.getBoundingClientRect();if(e===document.documentElement)return i.top-e.clientTop;const n=e?.getBoundingClientRect();return i.top-n.top},Jc=(()=>{let t=0;return()=>++t})(),bv=`.${k}-preview > [data-line]`,ji=(t,e)=>+getComputedStyle(t).getPropertyValue(e).replace("px",""),xv=(t,e)=>{const i=xp(()=>{t.removeEventListener("scroll",n),t.addEventListener("scroll",n),e.removeEventListener("scroll",n),e.addEventListener("scroll",n)},50),n=r=>{const s=t.clientHeight,o=e.clientHeight,l=t.scrollHeight,a=e.scrollHeight,u=(l-s)/(a-o);r.target===t?(e.removeEventListener("scroll",n),e.scrollTo({top:t.scrollTop/u}),i()):(t.removeEventListener("scroll",n),t.scrollTo({top:e.scrollTop*u}),i())};return[()=>{i().finally(()=>{t.dispatchEvent(new Event("scroll"))})},()=>{t.removeEventListener("scroll",n),e.removeEventListener("scroll",n)}]},vv=(t,e,i)=>{const{view:n}=i,r=bu(),s=g=>n.lineBlockAt(n.state.doc.line(g+1).from).top,o=g=>n.lineBlockAt(n.state.doc.line(g+1).from).bottom;let l=[],a=[],u=[];const c=()=>{l=[],a=Array.from(e.querySelectorAll(bv)),u=a.map(b=>Number(b.dataset.line));const g=[...u],{lines:x}=n.state.doc;g[0]!==0&&g.unshift(0);let v=g.shift()||0,y=g.shift()||x;for(let b=0;b<x;b++)b===y&&(v=b,y=g.shift()||x),l.push({start:v,end:y-1})},h=(g,x)=>{let v=1;for(let y=a.length-1;y-1>=0;y--){const b=a[y];if(b.offsetTop<=x){v=Number(b.dataset.line);break}}for(let y=l.length-1;y>=0;y--)if(s(l[y].start)<=g){v=v<l[y].start?v:l[y].start;break}return v};let f=0,d=0;const p=()=>{if(d!==0)return!1;f++;const{scrollDOM:g}=n;let x=ji(e,"padding-block-start");const v=n.lineBlockAtHeight(g.scrollTop),{number:y}=n.state.doc.lineAt(v.from),b=l[y-1];if(!b)return!1;let $=1;const _=e.querySelector(`[data-line="${b.start}"]`)||e.firstElementChild?.firstElementChild,P=e.querySelector(`[data-line="${b.end+1}"]`)||e.lastElementChild?.lastElementChild,E=g.scrollHeight-g.clientHeight,Z=e.scrollHeight-e.clientHeight;let M=s(b.start),C=o(b.end),L=_.offsetTop,B=P.offsetTop-L;M===0&&(L=0,_===P?(x=0,B=0):B=P.offsetTop),$=(g.scrollTop-M)/(C-M);const z=P==e.lastElementChild?.lastElementChild?P.offsetTop+P.clientHeight:P.offsetTop;if(C>=E||z>Z){const N=h(E,Z);M=s(N),$=(g.scrollTop-M)/(E-M);const X=e.querySelector(`[data-line="${N}"]`);M>0&&X&&(L=X.offsetTop),B=Z-L+ji(e,"padding-block-start")}const D=L-x+B*$;r(e,D,()=>{f--})},m=()=>{if(f!==0)return;d++;const{scrollDOM:g}=n,x=e.scrollTop,v=e.scrollHeight,y=g.scrollHeight-g.clientHeight,b=e.scrollHeight-e.clientHeight;let $=e.firstElementChild?.firstElementChild,_=e.firstElementChild?.lastElementChild;if(u.length>0){let N=Math.ceil(u[u.length-1]*(x/v)),X=u.findLastIndex(U=>U<=N);X=X===-1?0:X,N=u[X];for(let U=X;U>=0&&U<u.length;)if(a[U].offsetTop>x){if(U-1>=0){U--;continue}N=-1,X=-1;break}else{if(U+1<u.length&&a[U+1].offsetTop<x){U++;continue}N=u[U],X=U;break}switch(X){case-1:{$=e.firstElementChild?.firstElementChild,_=a[0];break}case u.length-1:{$=a[X],_=e.firstElementChild?.lastElementChild;break}default:$=a[X],_=a[X+1]}}let P=$===e.firstElementChild?.firstElementChild?0:$.offsetTop-ji($,"margin-block-start"),E=_.offsetTop,Z=0;const{start:M,end:C}=l[Number($.dataset.line||0)];let L=s(M);const B=s(C+1===n.state.doc.lines?C:C+1);let z=0;const D=_==e.lastElementChild?.lastElementChild?_.offsetTop+_.offsetHeight:_.offsetTop;if(B>y||D>b){const N=h(y,b),X=e.querySelector(`[data-line="${N}"]`);P=X?X.offsetTop-ji(X,"margin-block-start"):P,L=s(N),Z=(x-P)/(b-P),z=y-L}else $===e.firstElementChild?.firstElementChild?($===_&&(E=_.offsetTop+_.offsetHeight+ji(_,"margin-block-end")),z=B,L=0,Z=Math.max(x/E,0)):(Z=Math.max((x-P)/(E-P),0),z=B-L);r(t,L+z*Z,()=>{d--})},O=g=>{const{scrollDOM:x,contentHeight:v}=n,y=x.clientHeight;if(v<=y||e.firstElementChild.clientHeight<=e.clientHeight||n.state.doc.lines<=l[l.length-1]?.end)return!1;g.target===t?p():m()};return[()=>{c(),t.addEventListener("scroll",O),e.addEventListener("scroll",O),t.dispatchEvent(new Event("scroll"))},()=>{t.removeEventListener("scroll",O),e.removeEventListener("scroll",O)}]},yv={tocItem:{type:Object,default:()=>({})},mdHeadingId:{type:Function,default:()=>{}},onActive:{type:Function,default:()=>{}},onClick:{type:Function,default:()=>{}},scrollElementOffsetTop:{type:Number,default:0}},Cp=K({props:yv,setup(t){const e=Q("scrollElementRef"),i=Q("roorNodeRef"),n=W();te(()=>t.tocItem.active,s=>{s&&t.onActive(t.tocItem,n.value)}),ye(()=>{t.tocItem.active&&t.onActive(t.tocItem,n.value)});const r=s=>{if(s.stopPropagation(),t.onClick(s,t.tocItem),s.defaultPrevented)return;co