const __vite__fileDeps=["./browserAll-Cn_0a7k3.js","./webworkerAll-L7cTVnAp.js","./colorToUniform-rMRo2qOn.js","./CanvasPool-D00IADyo.js","./getBatchSamplersUniformGroup-B1Z3BKU1.js","./ColoredChip.vue_vue_type_script_setup_true_lang-CBDbhtDT.js","./index-C0tfT_Qc.js","./vue-CfSjRv-x.js","./vuetify-PctCzU6r.js","./index-DrdRrMdo.css","./MixedButton.vue_vue_type_script_setup_true_lang-Br4NUWtV.js","./FileIcon-DH65fwz5.js","./MoveTorrentFileDialog.vue_vue_type_script_setup_true_lang-C8uA-x2z.js","./WebGPURenderer-I-StTdCm.js","./SharedSystems-Bg8GzrJB.js","./WebGLRenderer-CaSwjYL2.js"],__vite__mapDeps=i=>i.map(i=>__vite__fileDeps[i]); import{b as ae,_ as kn,a as Pn,__tla as __tla_0}from"./ColoredChip.vue_vue_type_script_setup_true_lang-CBDbhtDT.js";import{_ as Tn,__tla as __tla_1}from"./MixedButton.vue_vue_type_script_setup_true_lang-Br4NUWtV.js";import{b as Ue,m as ee,k as lt,g as ce,b8 as At,aZ as dr,b6 as In,X as Gt,ae as hs,e as ns,b9 as En,i as Qt,af as Rn,r as q,Z as Oe,$ as ri,ba as Bt,p as J,a8 as re,B as se,z as ie,aX as Dn,C as Bn,q as Ee,s as Jt,a4 as Bs,b3 as Zt,bb as fr,y as Fn,bc as os,o as pr,bd as _s,E as mr,b0 as $n,aV as Vn,aW as Gn,b4 as wi,be as Nn,V as Fs,bf as Ln,bg as Un,h as st,H as On,a5 as zn,aY as $s,c as Re,aU as Hn,ab as Yn,a7 as Xn,S as Wn,bh as qn,bi as gs,ag as _r,f as Vs,j as Gs,ad as Ci,w as Ai,a3 as jn,d as Kn,G as Zn,aK as Qn,U as Jn,W as to,aL as ne,__tla as __tla_2}from"./index-C0tfT_Qc.js";import{j as ct,E as me,c as j,H as I,Q as G,U as B,M as Ns,I as V,J as x,K as L,L as T,N as _t,u as S,_ as De,n as g,W as gr,$ as dt,f as ht,w as ze,Y as us,v as ni,P as eo,x as yr,a3 as Si,V as bt,F as ft,R as xr,B as oi,s as Mi,T as br,Z as ki,d as so,aa as io,ab as ro,q as Ls,G as vr,r as no,O as oo,S as ao,a as lo}from"./vue-CfSjRv-x.js";import{g as ho}from"./FileIcon-DH65fwz5.js";import{u as wr,a as uo}from"./vuetify-PctCzU6r.js";import{_ as co,__tla as __tla_3}from"./MoveTorrentFileDialog.vue_vue_type_script_setup_true_lang-C8uA-x2z.js";let fe,an,mt,pt,Nt,Y,Li,xa,ks,xt,Fr,et,tt,H,ol,xl,ut,Ae,ot,Tl,Ze,Ws,ke,ur,al,ll,ui,he,Lt,yn,Ji,ls,qo,bn,_u,Ml,Ne,Fa,Tt,Qi,fn,rn,Yr,Ft,W,Ba,Wo,mu,Il,wl,Mt,oa,Dr,Dt,at,Be,Rt,Va,el,zi;let __tla=Promise.all([(()=>{try{return __tla_0}catch{}})(),(()=>{try{return __tla_1}catch{}})(),(()=>{try{return __tla_2}catch{}})(),(()=>{try{return __tla_3}catch{}})()]).then(async()=>{var Vt=(i=>(i[i.DISABLED=0]="DISABLED",i[i.NOT_YET_CONTACTED=1]="NOT_YET_CONTACTED",i[i.WORKING=2]="WORKING",i[i.UPDATING=3]="UPDATING",i[i.NOT_WORKING=4]="NOT_WORKING",i))(Vt||{});const fo={class:"d-flex"},po={class:"d-flex flex-column overflow-hidden text-no-wrap mr-3"},mo={class:"text-grey"},_o={class:"d-flex align-center"},Pi="#ffe476",go=ct({__name:"ContentNode",props:{node:{},openedItems:{}},emits:["setFilePrio","onRightClick"],setup(i,{emit:t}){const e=i,s=t,{t:r}=me(),{mobile:n}=wr(),o=Ue(),a=ee(),l=j(()=>{if(e.node.fullName==="")return 0;const _=e.node.fullName.split("/").length,f=n.value?12:24;return _*f});function u(_,f){if(f.type==="file")return;_.stopPropagation();const v=e.openedItems.indexOf(f.fullName);v===-1?e.openedItems.push(f.fullName):e.openedItems.splice(v,1)}async function h(_){_.priority===At.DO_NOT_DOWNLOAD?s("setFilePrio",_.childrenIds,At.NORMAL):s("setFilePrio",_.childrenIds,At.DO_NOT_DOWNLOAD)}function c(_,f){In(_)?o.internalSelection.has(f.fullName)?o.internalSelection.delete(f.fullName):o.internalSelection.add(f.fullName):o.internalSelection=new Set([f.fullName])}function d(_){return _.priority===At.DO_NOT_DOWNLOAD?"grey":_.progress===1?"green":""}function m(_){const[f,v]=_.deepCount,y=[];return f>1&&y.push(r("torrentDetail.content.folderInfo",f-1)),v>0&&y.push(r("torrentDetail.content.fileInfo",v)),y.join(", ")}function p(_){const f=[Gt(_.size,a.useBinarySize)];return _.type==="folder"&&f.push(m(_)),f.join(" | ")}return(_,f)=>(I(),G("div",{class:De(["d-flex flex-column py-2 pr-3",_.node.isSelected(S(o).internalSelection)?"selected":""]),style:gr(`padding-left: ${l.value}px`),onClick:f[2]||(f[2]=Ns(v=>c(v,_.node),["stop"])),onContextmenu:f[3]||(f[3]=v=>_.$emit("onRightClick",v,_.node))},[B("div",fo,[B("div",{class:"d-flex align-center",onClick:f[0]||(f[0]=Ns(v=>h(_.node),["stop"]))},[_.node.wanted===null?(I(),V(lt,{key:0,color:d(_.node),icon:"mdi-checkbox-intermediate-variant"},null,8,["color"])):_.node.wanted?(I(),V(lt,{key:1,color:d(_.node),icon:"mdi-checkbox-marked"},null,8,["color"])):(I(),V(lt,{key:2,color:d(_.node),icon:"mdi-checkbox-blank-outline"},null,8,["color"]))]),B("div",{class:"d-flex align-center spacer",onClick:f[1]||(f[1]=v=>u(v,_.node))},[_.node.type==="folder"?(I(),V(lt,{key:0},{default:x(()=>[L(T(_.openedItems.includes(_.node.fullName)?"mdi-chevron-up":"mdi-chevron-down"),1)]),_:1})):_t("",!0),_.node.fullName===""?(I(),V(lt,{key:1,icon:"mdi-file-tree"})):_.node.type==="file"?(I(),V(lt,{key:2,icon:S(ho)(_.node.name)},null,8,["icon"])):_.openedItems.includes(_.node.fullName)?(I(),V(lt,{key:3,icon:"mdi-folder-open",color:Pi})):(I(),V(lt,{key:4,icon:"mdi-folder",color:Pi}))]),B("div",po,[B("div",{class:De(`text-${d(_.node)}`)},T(_.node.name),3),B("div",mo,T(p(_.node)),1)]),g(ce),B("div",_o,[_.node.priority===S(At).MAXIMAL?(I(),V(lt,{key:0,color:"error"},{default:x(()=>[L("mdi-arrow-up")]),_:1})):_.node.priority===S(At).HIGH?(I(),V(lt,{key:1,color:"warning"},{default:x(()=>[L("mdi-arrow-top-right")]),_:1})):_.node.priority===S(At).NORMAL?(I(),V(lt,{key:2},{default:x(()=>[L("mdi-minus")]),_:1})):_.node.priority===S(At).MIXED?(I(),V(lt,{key:3},{default:x(()=>[L("mdi-tilde")]),_:1})):_.node.priority===S(At).DO_NOT_DOWNLOAD?(I(),V(lt,{key:4,color:"grey"},{default:x(()=>[L("mdi-cancel")]),_:1})):_t("",!0)])]),g(dr,{"model-value":_.node.progress,max:1,color:d(_.node),rounded:"sm"},null,8,["model-value","color"])],38))}}),yo=hs(go,[["__scopeId","data-v-47f1c669"]]),xo={class:"mt-2 mx-3 d-flex flex-gap align-center"},bo=ct({__name:"Content",props:{torrent:{},isActive:{type:Boolean}},setup(i){const t=i,{height:e}=wr(),s=Ue(),{rightClickProperties:r,filenameFilter:n,openedItems:o,flatTree:a,internalSelection:l,timerForcedPause:u,isTimerActive:h}=dt(s),c=j(()=>e.value-48*2-64-12*2-56-8);async function d(y,b){r.value.isVisible&&(r.value.isVisible=!1,await yr()),Object.assign(r.value,{isVisible:!0,offset:[y.pageX,y.pageY],hash:t.torrent.hash}),l.value.size<=1&&(l.value=new Set([b.fullName]))}const m=ht();function p(y,b){m.value=setTimeout(()=>{d(y,b)},500)}function _(){clearTimeout(m.value)}ze(()=>t.isActive,y=>{y&&!u.value?s.resumeTimer():s.pauseTimer()}),us(()=>{t.isActive&&s.resumeTimer()}),ni(()=>{s.$reset()});function f(){u.value=!0,s.pauseTimer()}function v(){u.value=!1,s.resumeTimer()}return(y,b)=>(I(),V(Qt,null,{default:x(()=>[B("div",xo,[g(ns,{modelValue:S(n),"onUpdate:modelValue":b[0]||(b[0]=w=>eo(n)?n.value=w:null),"hide-details":"",clearable:"",placeholder:y.$t("torrentDetail.content.filter_placeholder")},null,8,["modelValue","placeholder"]),g(Tn,{icon:S(h)?"mdi-timer-pause":"mdi-timer-play",position:"left",color:"primary",text:S(h)?y.$t("common.pause"):y.$t("common.resume"),onClick:b[1]||(b[1]=w=>S(h)?f():v())},null,8,["icon","text"])]),g(En,{id:"tree-root",items:S(a),height:c.value,"item-height":"68",class:"pa-2"},{default:x(({item:w})=>[g(yo,{"opened-items":S(o),node:w,onSetFilePrio:b[2]||(b[2]=(A,R)=>S(s).setFilePriority(A,R)),onTouchcancel:_,onTouchend:_,onTouchmove:_,onTouchstart:A=>p(A.touches.item(0),w),onOnRightClick:b[3]||(b[3]=(A,R)=>d(A,R))},null,8,["opened-items","node","onTouchstart"])]),_:1},8,["items","height"])]),_:1}))}}),vo={},wo={class:"pl-4"},Co={class:"pr-4"};function Ao(i,t){return I(),V(q,{cols:"12",sm:"6",lg:"3"},{default:x(()=>[g(Rn,{rounded:"xl",class:"d-flex align-center py-2 border"},{default:x(()=>[B("div",wo,[Si(i.$slots,"title")]),g(ce),B("div",Co,[Si(i.$slots,"text")])]),_:3})]),_:3})}const St=hs(vo,[["render",Ao]]),So=ct({__name:"PanelBoolean",props:{torrent:{}},setup(i){const t=i,e=Oe(),s=ri(),{properties:r}=dt(Bt()),n=j({get:()=>t.torrent.auto_tmm,set:h=>e.toggleAutoTmm([t.torrent.hash],h)}),o=j({get:()=>t.torrent.f_l_piece_prio,set:()=>e.toggleFLPiecePrio([t.torrent.hash])}),a=j({get:()=>t.torrent.forced,set:h=>{h?s.forceResumeTorrents([t.torrent.hash]):s.resumeTorrents([t.torrent.hash])}}),l=j({get:()=>t.torrent.seq_dl,set:()=>e.toggleSeqDl([t.torrent.hash])}),u=j({get:()=>t.torrent.super_seeding,set:h=>e.setSuperSeeding([t.torrent.hash],h)});return(h,c)=>(I(),V(ie,{title:h.$t("torrentDetail.info.boolean_values")},{default:x(()=>[g(se,null,{default:x(()=>[g(J,null,{default:x(()=>[g(St,null,{title:x(()=>[g(re,{modelValue:n.value,"onUpdate:modelValue":c[0]||(c[0]=d=>n.value=d),"hide-details":"",density:"compact",label:h.$t("torrent.properties.auto_tmm")},null,8,["modelValue","label"])]),_:1}),g(St,null,{title:x(()=>[g(re,{modelValue:o.value,"onUpdate:modelValue":c[1]||(c[1]=d=>o.value=d),"hide-details":"",density:"compact",label:h.$t("torrent.properties.f_l_piece_prio")},null,8,["modelValue","label"])]),_:1}),g(St,null,{title:x(()=>[g(re,{modelValue:a.value,"onUpdate:modelValue":c[2]||(c[2]=d=>a.value=d),"hide-details":"",density:"compact",label:h.$t("torrent.properties.forced")},null,8,["modelValue","label"])]),_:1}),g(St,null,{title:x(()=>[g(re,{modelValue:l.value,"onUpdate:modelValue":c[3]||(c[3]=d=>l.value=d),"hide-details":"",density:"compact",label:h.$t("torrent.properties.seq_dl")},null,8,["modelValue","label"])]),_:1}),g(St,null,{title:x(()=>[g(re,{modelValue:u.value,"onUpdate:modelValue":c[4]||(c[4]=d=>u.value=d),"hide-details":"",density:"compact",label:h.$t("torrent.properties.super_seeding")},null,8,["modelValue","label"])]),_:1}),g(St,null,{title:x(()=>[g(re,{disabled:"","model-value":S(r)?.is_private,"hide-details":"",density:"compact",label:h.$t("torrent.properties.is_private")},null,8,["model-value","label"])]),_:1})]),_:1})]),_:1})]),_:1},8,["title"]))}}),Mo=ct({__name:"PanelData",props:{torrent:{}},setup(i){const t=i,{properties:e}=dt(Bt()),{useBinarySize:s}=dt(ee()),r=[{title:"downloaded",getter:()=>t.torrent.downloaded},{title:"downloaded_session",getter:()=>t.torrent.downloaded_session},{title:"uploaded",getter:()=>t.torrent.uploaded},{title:"uploaded_session",getter:()=>t.torrent.uploaded_session},{title:"size",getter:()=>t.torrent.size},{title:"total_size",getter:()=>t.torrent.total_size},{title:"total_wasted",getter:()=>e.value?.total_wasted??0},{title:"amount_left",getter:()=>t.torrent.amount_left},{title:"global_volume",getter:()=>t.torrent.globalVolume}];return(n,o)=>(I(),V(ie,{title:n.$t("torrentDetail.info.data_values")},{default:x(()=>[g(se,null,{default:x(()=>[g(J,null,{default:x(()=>[(I(),G(ft,null,bt(r,a=>g(St,null,{title:x(()=>[L(T(n.$t(`torrent.properties.${a.title}`)),1)]),text:x(()=>[L(T(S(Gt)(a.getter(),S(s))),1)]),_:2},1024)),64))]),_:1})]),_:1})]),_:1},8,["title"]))}}),ko=ct({__name:"PanelDatetime",props:{torrent:{}},setup(i){const t=i,{properties:e}=dt(Bt()),{dateFormat:s}=dt(ee()),r=[{title:"added_on",getter:()=>t.torrent.added_on},{title:"completed_on",getter:()=>t.torrent.completed_on},{title:"creation_date",getter:()=>e.value?.creation_date??0},{title:"last_activity",getter:()=>t.torrent.last_activity},{title:"seen_complete",getter:()=>t.torrent.seen_complete}];return(n,o)=>(I(),V(ie,{title:n.$t("torrentDetail.info.datetime_values")},{default:x(()=>[g(se,null,{default:x(()=>[g(J,null,{default:x(()=>[(I(),G(ft,null,bt(r,a=>g(St,null,xr({title:x(()=>[L(T(n.$t(`torrent.properties.${a.title}`)),1)]),_:2},[a.getter()>0?{name:"text",fn:x(()=>[L(T(S(Dn)(a.getter(),S(s))),1)]),key:"0"}:{name:"text",fn:x(()=>[L(T(n.$t("common.NA")),1)]),key:"1"}]),1024)),64))]),_:1})]),_:1})]),_:1},8,["title"]))}}),Po=ct({__name:"PanelDuration",props:{torrent:{}},setup(i){const t=i,{properties:e}=dt(Bt()),s=[{title:"seeding_time",unit:"s",getter:()=>t.torrent.seeding_time},{title:"seeding_time_limit",unit:"m",getter:()=>t.torrent.seeding_time_limit},{title:"inactive_seeding_time_limit",unit:"m",getter:()=>t.torrent.inactive_seeding_time_limit},{title:"time_active",unit:"s",getter:()=>t.torrent.time_active},{title:"reannounce",unit:"s",getter:()=>e.value?.reannounce??0}];return(r,n)=>(I(),V(ie,{title:r.$t("torrentDetail.info.duration_values")},{default:x(()=>[g(se,null,{default:x(()=>[g(J,null,{default:x(()=>[(I(),G(ft,null,bt(s,o=>g(St,null,xr({title:x(()=>[L(T(r.$t(`torrent.properties.${o.title}`)),1)]),_:2},[o.getter()>0?{name:"text",fn:x(()=>[L(T(S(Bn).duration(o.getter(),o.unit).humanize()),1)]),key:"0"}:{name:"text",fn:x(()=>[L(T(r.$t("common.NA")),1)]),key:"1"}]),1024)),64))]),_:1})]),_:1})]),_:1},8,["title"]))}}),To={key:0,class:"d-flex flex-gap-row-small flex-gap-column"},Io=ct({__name:"PanelLongText",props:{torrent:{}},setup(i){const t=i,{properties:e}=dt(Bt()),s=[{title:"content_path",getter:()=>t.torrent.content_path},{title:"download_path",getter:()=>t.torrent.download_path},{title:"hash",getter:()=>t.torrent.hash},{title:"infohash_v1",getter:()=>t.torrent.infohash_v1},{title:"infohash_v2",getter:()=>t.torrent.infohash_v2},{title:"magnet",getter:()=>t.torrent.magnet},{title:"name",getter:()=>t.torrent.name},{title:"save_path",getter:()=>t.torrent.savePath},{title:"tracker",getter:()=>t.torrent.tracker},{title:"comment",getter:()=>e.value?.comment},{title:"created_by",getter:()=>e.value?.created_by}];return(r,n)=>(I(),V(ie,{title:r.$t("torrentDetail.info.long_text_values")},{default:x(()=>[g(se,null,{default:x(()=>[g(Ee,null,{default:x(()=>[(I(),G(ft,null,bt(s,o=>g(Jt,{title:r.$t(`torrent.properties.${o.title}`)},{default:x(()=>[g(Bs,null,{default:x(()=>[L(T(o.getter()||r.$t("common.none")),1)]),_:2},1024)]),_:2},1032,["title"])),64)),g(Jt,{title:r.$t("torrent.properties.tags")},{default:x(()=>[r.torrent.tags?.length?(I(),G("div",To,[(I(!0),G(ft,null,bt(r.torrent.tags,o=>(I(),V(ae,{defaultColor:"tag",value:o},null,8,["value"]))),256))])):(I(),V(Bs,{key:1},{default:x(()=>[L(T(r.$t("torrent.properties.empty_tags")),1)]),_:1}))]),_:1},8,["title"])]),_:1})]),_:1})]),_:1},8,["title"]))}}),Eo=ct({__name:"PanelSpeed",props:{torrent:{}},setup(i){const t=i,{properties:e}=dt(Bt()),{useBitSpeed:s}=dt(ee()),r=[{title:"download_limit",getter:()=>t.torrent.dl_limit},{title:"download_speed",getter:()=>t.torrent.dlspeed},{title:"avg_download_speed",getter:()=>e.value?.dl_speed_avg??0},{title:"upload_limit",getter:()=>t.torrent.up_limit},{title:"upload_speed",getter:()=>t.torrent.upspeed},{title:"avg_upload_speed",getter:()=>e.value?.up_speed_avg??0},{title:"global_speed",getter:()=>t.torrent.globalSpeed}];return(n,o)=>(I(),V(ie,{title:n.$t("torrentDetail.info.speed_values")},{default:x(()=>[g(se,null,{default:x(()=>[g(J,null,{default:x(()=>[(I(),G(ft,null,bt(r,a=>g(St,null,{title:x(()=>[L(T(n.$t(`torrent.properties.${a.title}`)),1)]),text:x(()=>[L(T(S(Zt)(a.getter(),S(s))),1)]),_:2},1024)),64))]),_:1})]),_:1})]),_:1},8,["title"]))}}),Ro=ct({__name:"PanelText",props:{torrent:{}},setup(i){const t=i,{t:e}=me(),{properties:s}=dt(Bt()),r=[{title:"available_peers",getter:()=>t.torrent.available_peers},{title:"available_seeds",getter:()=>t.torrent.available_seeds},{title:"ratio",getter:()=>t.torrent.ratio},{title:"ratio_limit",getter:()=>t.torrent.ratio_limit},{title:"num_leechs",getter:()=>t.torrent.num_leechs},{title:"num_seeds",getter:()=>t.torrent.num_seeds},{title:"availability",getter:()=>t.torrent.availability},{title:"eta",getter:()=>t.torrent.eta},{title:"category",getter:()=>t.torrent.category||e("common.NA")},{title:"state",getter:()=>e(`torrent.state.${fr(t.torrent.state)}`)},{title:"trackers_count",getter:()=>t.torrent.trackers_count},{title:"priority",getter:()=>t.torrent.priority},{title:"nb_connections",getter:()=>s.value?.nb_connections??0},{title:"nb_connections_limit",getter:()=>s.value?.nb_connections_limit??0}];return(n,o)=>(I(),V(ie,{title:n.$t("torrentDetail.info.text_values")},{default:x(()=>[g(se,null,{default:x(()=>[g(J,null,{default:x(()=>[(I(),G(ft,null,bt(r,a=>g(St,null,{title:x(()=>[L(T(n.$t(`torrent.properties.${a.title}`)),1)]),text:x(()=>[L(T(a.getter()),1)]),_:2},1024)),64))]),_:1})]),_:1})]),_:1},8,["title"]))}}),Do=ct({__name:"Info",props:{torrent:{},isActive:{type:Boolean}},setup(i){return(t,e)=>(I(),V(Ee,null,{default:x(()=>[g(Jt,null,{default:x(()=>[g(Fn,null,{default:x(()=>[g(ko,{torrent:t.torrent},null,8,["torrent"]),g(Po,{torrent:t.torrent},null,8,["torrent"]),g(So,{torrent:t.torrent},null,8,["torrent"]),g(Mo,{torrent:t.torrent},null,8,["torrent"]),g(Eo,{torrent:t.torrent},null,8,["torrent"]),g(Ro,{torrent:t.torrent},null,8,["torrent"]),g(Io,{torrent:t.torrent},null,8,["torrent"])]),_:1})]),_:1})]),_:1}))}}),Bo=class Us{constructor(t,e){this.low=t,this.high=e}clone(){return new Us(this.low,this.high)}get max(){return this.clone()}less_than(t){return this.lowt.high?this.high:t.high)}output(){return[this.low,this.high]}static comparable_max(t,e){return t.merge(e)}static comparable_less_than(t,e){return tl&&([a,l]=[l,a]),this.item.key=new Bo(a,l)}this.max=this.item.key?this.item.key.max:void 0}isNil(){return this.item.key===void 0&&this.item.value===void 0&&this.left===null&&this.right===null&&this.color===z}_value_less_than(t){return this.item.value&&t.item.value&&this.item.value.less_than?this.item.value.less_than(t.item.value):this.item.valuet++),t}get keys(){let t=[];return this.tree_walk(this.root,e=>t.push(e.item.key.output?e.item.key.output():e.item.key)),t}get values(){let t=[];return this.tree_walk(this.root,e=>t.push(e.item.value)),t}get items(){let t=[];return this.tree_walk(this.root,e=>t.push({key:e.item.key.output?e.item.key.output():e.item.key,value:e.item.value})),t}isEmpty(){return this.root==null||this.root===this.nil_node}clear(){this.root=null}insert(t,e=t){if(t===void 0)return;let s=new Yt(t,e,this.nil_node,this.nil_node,null,nt);return this.tree_insert(s),this.recalc_max(s),s}exist(t,e=t){let s=new Yt(t,e);return!!this.tree_search(this.root,s)}remove(t,e=t){let s=new Yt(t,e),r=this.tree_search(this.root,s);return r&&this.tree_delete(r),r}search(t,e=(s,r)=>s===r?r.output():s){let s=new Yt(t),r=[];return this.tree_search_interval(this.root,s,r),r.map(n=>e(n.item.value,n.item.key))}intersect_any(t){let e=new Yt(t);return this.tree_find_any_interval(this.root,e)}forEach(t){this.tree_walk(this.root,e=>t(e.item.key,e.item.value))}map(t){const e=new ai;return this.tree_walk(this.root,s=>e.insert(s.item.key,t(s.item.value,s.item.key))),e}*iterate(t,e=(s,r)=>s===r?r.output():s){let s;for(t?s=this.tree_search_nearest_forward(this.root,new Yt(t)):this.root&&(s=this.local_minimum(this.root));s;)yield e(s.item.value,s.item.key),s=this.tree_successor(s)}recalc_max(t){let e=t;for(;e.parent!=null;)e.parent.update_max(),e=e.parent}tree_insert(t){let e=this.root,s=null;if(this.root==null||this.root===this.nil_node)this.root=t;else{for(;e!==this.nil_node;)s=e,t.less_than(e)?e=e.left:e=e.right;t.parent=s,t.less_than(s)?s.left=t:s.right=t}this.insert_fixup(t)}insert_fixup(t){let e,s;for(e=t;e!==this.root&&e.parent.color===nt;)e.parent===e.parent.parent.left?(s=e.parent.parent.right,s.color===nt?(e.parent.color=z,s.color=z,e.parent.parent.color=nt,e=e.parent.parent):(e===e.parent.right&&(e=e.parent,this.rotate_left(e)),e.parent.color=z,e.parent.parent.color=nt,this.rotate_right(e.parent.parent))):(s=e.parent.parent.left,s.color===nt?(e.parent.color=z,s.color=z,e.parent.parent.color=nt,e=e.parent.parent):(e===e.parent.left&&(e=e.parent,this.rotate_right(e)),e.parent.color=z,e.parent.parent.color=nt,this.rotate_left(e.parent.parent)));this.root.color=z}tree_delete(t){let e,s;t.left===this.nil_node||t.right===this.nil_node?e=t:e=this.tree_successor(t),e.left!==this.nil_node?s=e.left:s=e.right,s.parent=e.parent,e===this.root?this.root=s:(e===e.parent.left?e.parent.left=s:e.parent.right=s,e.parent.update_max()),this.recalc_max(s),e!==t&&(t.copy_data(e),t.update_max(),this.recalc_max(t)),e.color===z&&this.delete_fixup(s)}delete_fixup(t){let e=t,s;for(;e!==this.root&&e.parent!=null&&e.color===z;)e===e.parent.left?(s=e.parent.right,s.color===nt&&(s.color=z,e.parent.color=nt,this.rotate_left(e.parent),s=e.parent.right),s.left.color===z&&s.right.color===z?(s.color=nt,e=e.parent):(s.right.color===z&&(s.color=nt,s.left.color=z,this.rotate_right(s),s=e.parent.right),s.color=e.parent.color,e.parent.color=z,s.right.color=z,this.rotate_left(e.parent),e=this.root)):(s=e.parent.left,s.color===nt&&(s.color=z,e.parent.color=nt,this.rotate_right(e.parent),s=e.parent.left),s.left.color===z&&s.right.color===z?(s.color=nt,e=e.parent):(s.left.color===z&&(s.color=nt,s.right.color=z,this.rotate_left(s),s=e.parent.left),s.color=e.parent.color,e.parent.color=z,s.left.color=z,this.rotate_right(e.parent),e=this.root));e.color=z}tree_search(t,e){if(!(t==null||t===this.nil_node))return e.equal_to(t)?t:e.less_than(t)?this.tree_search(t.left,e):this.tree_search(t.right,e)}tree_search_nearest_forward(t,e){let s,r=t;for(;r&&r!==this.nil_node;)r.less_than(e)?r.intersect(e)?(s=r,r=r.left):r=r.right:((!s||r.less_than(s))&&(s=r),r=r.left);return s||null}tree_search_interval(t,e,s){t!=null&&t!==this.nil_node&&(t.left!==this.nil_node&&!t.not_intersect_left_subtree(e)&&this.tree_search_interval(t.left,e,s),t.intersect(e)&&s.push(t),t.right!==this.nil_node&&!t.not_intersect_right_subtree(e)&&this.tree_search_interval(t.right,e,s))}tree_find_any_interval(t,e){let s=!1;return t!=null&&t!==this.nil_node&&(t.left!==this.nil_node&&!t.not_intersect_left_subtree(e)&&(s=this.tree_find_any_interval(t.left,e)),s||(s=t.intersect(e)),!s&&t.right!==this.nil_node&&!t.not_intersect_right_subtree(e)&&(s=this.tree_find_any_interval(t.right,e))),s}local_minimum(t){let e=t;for(;e.left!=null&&e.left!==this.nil_node;)e=e.left;return e}local_maximum(t){let e=t;for(;e.right!=null&&e.right!==this.nil_node;)e=e.right;return e}tree_successor(t){let e,s,r;if(t.right!==this.nil_node)e=this.local_minimum(t.right);else{for(s=t,r=t.parent;r!=null&&r.right===s;)s=r,r=r.parent;e=r}return e}rotate_left(t){let e=t.right;t.right=e.left,e.left!==this.nil_node&&(e.left.parent=t),e.parent=t.parent,t===this.root?this.root=e:t===t.parent.left?t.parent.left=e:t.parent.right=e,e.left=t,t.parent=e,t!=null&&t!==this.nil_node&&t.update_max(),e=t.parent,e!=null&&e!==this.nil_node&&e.update_max()}rotate_right(t){let e=t.left;t.left=e.right,e.right!==this.nil_node&&(e.right.parent=t),e.parent=t.parent,t===this.root?this.root=e:t===t.parent.left?t.parent.left=e:t.parent.right=e,e.right=t,t.parent=e,t!==null&&t!==this.nil_node&&t.update_max(),e=t.parent,e!=null&&e!==this.nil_node&&e.update_max()}tree_walk(t,e){t!=null&&t!==this.nil_node&&(this.tree_walk(t.left,e),e(t),this.tree_walk(t.right,e))}testRedBlackProperty(){let t=!0;return this.tree_walk(this.root,function(e){e.color===nt&&(e.left.color===z&&e.right.color===z||(t=!1))}),t}testBlackHeightProperty(t){let e=0,s=0,r=0;if(t.color===z&&e++,t.left!==this.nil_node?s=this.testBlackHeightProperty(t.left):s=1,t.right!==this.nil_node?r=this.testBlackHeightProperty(t.right):r=1,s!==r)throw new Error("Red-black height property violated");return e+=s,e}}Y=(i=>(i.Application="application",i.WebGLPipes="webgl-pipes",i.WebGLPipesAdaptor="webgl-pipes-adaptor",i.WebGLSystem="webgl-system",i.WebGPUPipes="webgpu-pipes",i.WebGPUPipesAdaptor="webgpu-pipes-adaptor",i.WebGPUSystem="webgpu-system",i.CanvasSystem="canvas-system",i.CanvasPipesAdaptor="canvas-pipes-adaptor",i.CanvasPipes="canvas-pipes",i.Asset="asset",i.LoadParser="load-parser",i.ResolveParser="resolve-parser",i.CacheParser="cache-parser",i.DetectionParser="detection-parser",i.MaskEffect="mask-effect",i.BlendMode="blend-mode",i.TextureSource="texture-source",i.Environment="environment",i.ShapeBuilder="shape-builder",i))(Y||{});let Os,We,Fo,$o;Os=i=>{if(typeof i=="function"||typeof i=="object"&&i.extension){if(!i.extension)throw new Error("Extension class must have an extension object");i={...typeof i.extension!="object"?{type:i.extension}:i.extension,ref:i}}if(typeof i=="object")i={...i};else throw new Error("Invalid extension type");return typeof i.type=="string"&&(i.type=[i.type]),i};We=(i,t)=>Os(i).priority??t;Tt={_addHandlers:{},_removeHandlers:{},_queue:{},remove(...i){return i.map(Os).forEach(t=>{t.type.forEach(e=>this._removeHandlers[e]?.(t))}),this},add(...i){return i.map(Os).forEach(t=>{t.type.forEach(e=>{const s=this._addHandlers,r=this._queue;s[e]?s[e]?.(t):(r[e]=r[e]||[],r[e]?.push(t))})}),this},handle(i,t,e){const s=this._addHandlers,r=this._removeHandlers;if(s[i]||r[i])throw new Error(`Extension type ${i} already has a handler`);s[i]=t,r[i]=e;const n=this._queue;return n[i]&&(n[i]?.forEach(o=>t(o)),delete n[i]),this},handleByMap(i,t){return this.handle(i,e=>{e.name&&(t[e.name]=e.ref)},e=>{e.name&&delete t[e.name]})},handleByNamedList(i,t,e=-1){return this.handle(i,s=>{t.findIndex(n=>n.name===s.name)>=0||(t.push({name:s.name,value:s.ref}),t.sort((n,o)=>We(o.value,e)-We(n.value,e)))},s=>{const r=t.findIndex(n=>n.name===s.name);r!==-1&&t.splice(r,1)})},handleByList(i,t,e=-1){return this.handle(i,s=>{t.includes(s.ref)||(t.push(s.ref),t.sort((r,n)=>We(n,e)-We(r,e)))},s=>{const r=t.indexOf(s.ref);r!==-1&&t.splice(r,1)})}};Fo={extension:{type:Y.Environment,name:"browser",priority:-1},test:()=>!0,load:async()=>{await os(()=>import("./browserAll-Cn_0a7k3.js").then(async m=>{await m.__tla;return m}),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12]),import.meta.url)}};$o={extension:{type:Y.Environment,name:"webworker",priority:0},test:()=>typeof self<"u"&&self.WorkerGlobalScope!==void 0,load:async()=>{await os(()=>import("./webworkerAll-L7cTVnAp.js").then(async m=>{await m.__tla;return m}),__vite__mapDeps([1,2,3,4,5,6,7,8,9,10,11,12]),import.meta.url)}};class yt{constructor(t,e,s){this._x=e||0,this._y=s||0,this._observer=t}clone(t){return new yt(t??this._observer,this._x,this._y)}set(t=0,e=t){return(this._x!==t||this._y!==e)&&(this._x=t,this._y=e,this._observer._onUpdate(this)),this}copyFrom(t){return(this._x!==t.x||this._y!==t.y)&&(this._x=t.x,this._y=t.y,this._observer._onUpdate(this)),this}copyTo(t){return t.set(this._x,this._y),t}equals(t){return t.x===this._x&&t.y===this._y}toString(){return`[pixi.js/math:ObservablePoint x=0 y=0 scope=${this._observer}]`}get x(){return this._x}set x(t){this._x!==t&&(this._x=t,this._observer._onUpdate(this))}get y(){return this._y}set y(t){this._y!==t&&(this._y=t,this._observer._onUpdate(this))}}var Cr={exports:{}};(function(i){var t=Object.prototype.hasOwnProperty,e="~";function s(){}Object.create&&(s.prototype=Object.create(null),new s().__proto__||(e=!1));function r(l,u,h){this.fn=l,this.context=u,this.once=h||!1}function n(l,u,h,c,d){if(typeof h!="function")throw new TypeError("The listener must be a function");var m=new r(h,c||l,d),p=e?e+u:u;return l._events[p]?l._events[p].fn?l._events[p]=[l._events[p],m]:l._events[p].push(m):(l._events[p]=m,l._eventsCount++),l}function o(l,u){--l._eventsCount===0?l._events=new s:delete l._events[u]}function a(){this._events=new s,this._eventsCount=0}a.prototype.eventNames=function(){var u=[],h,c;if(this._eventsCount===0)return u;for(c in h=this._events)t.call(h,c)&&u.push(e?c.slice(1):c);return Object.getOwnPropertySymbols?u.concat(Object.getOwnPropertySymbols(h)):u},a.prototype.listeners=function(u){var h=e?e+u:u,c=this._events[h];if(!c)return[];if(c.fn)return[c.fn];for(var d=0,m=c.length,p=new Array(m);dWt[i],uY:i=>qt[i],vX:i=>jt[i],vY:i=>Kt[i],inv:i=>i&8?i&15:-i&7,add:(i,t)=>zs[i][t],sub:(i,t)=>zs[i][K.inv(t)],rotate180:i=>i^4,isVertical:i=>(i&3)===2,byDirection:(i,t)=>Math.abs(i)*2<=Math.abs(t)?t>=0?K.S:K.N:Math.abs(t)*2<=Math.abs(i)?i>0?K.E:K.W:t>0?i>0?K.SE:K.SW:i>0?K.NE:K.NW,matrixAppendRotationInv:(i,t,e=0,s=0)=>{const r=Ar[K.inv(t)];r.tx=e,r.ty=s,i.append(r)}},je=[new ut,new ut,new ut,new ut];ot=class{constructor(t=0,e=0,s=0,r=0){this.type="rectangle",this.x=Number(t),this.y=Number(e),this.width=Number(s),this.height=Number(r)}get left(){return this.x}get right(){return this.x+this.width}get top(){return this.y}get bottom(){return this.y+this.height}isEmpty(){return this.left===this.right||this.top===this.bottom}static get EMPTY(){return new ot(0,0,0,0)}clone(){return new ot(this.x,this.y,this.width,this.height)}copyFromBounds(t){return this.x=t.minX,this.y=t.minY,this.width=t.maxX-t.minX,this.height=t.maxY-t.minY,this}copyFrom(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this}copyTo(t){return t.copyFrom(this),t}contains(t,e){return this.width<=0||this.height<=0?!1:t>=this.x&&t=this.y&&e=l&&t<=u&&e>=h&&e<=c&&!(t>d&&tp&&e<_)}intersects(t,e){if(!e){const C=this.xt.right?t.right:this.right)<=C)return!1;const P=this.yt.bottom?t.bottom:this.bottom)>P}const s=this.left,r=this.right,n=this.top,o=this.bottom;if(r<=s||o<=n)return!1;const a=je[0].set(t.left,t.top),l=je[1].set(t.left,t.bottom),u=je[2].set(t.right,t.top),h=je[3].set(t.right,t.bottom);if(u.x<=a.x||l.y<=a.y)return!1;const c=Math.sign(e.a*e.d-e.b*e.c);if(c===0||(e.apply(a,a),e.apply(l,l),e.apply(u,u),e.apply(h,h),Math.max(a.x,l.x,u.x,h.x)<=s||Math.min(a.x,l.x,u.x,h.x)>=r||Math.max(a.y,l.y,u.y,h.y)<=n||Math.min(a.y,l.y,u.y,h.y)>=o))return!1;const d=c*(l.y-a.y),m=c*(a.x-l.x),p=d*s+m*n,_=d*r+m*n,f=d*s+m*o,v=d*r+m*o;if(Math.max(p,_,f,v)<=d*a.x+m*a.y||Math.min(p,_,f,v)>=d*h.x+m*h.y)return!1;const y=c*(a.y-u.y),b=c*(u.x-a.x),w=y*s+b*n,A=y*r+b*n,R=y*s+b*o,E=y*r+b*o;return!(Math.max(w,A,R,E)<=y*a.x+b*a.y||Math.min(w,A,R,E)>=y*h.x+b*h.y)}pad(t=0,e=t){return this.x-=t,this.y-=e,this.width+=t*2,this.height+=e*2,this}fit(t){const e=Math.max(this.x,t.x),s=Math.min(this.x+this.width,t.x+t.width),r=Math.max(this.y,t.y),n=Math.min(this.y+this.height,t.y+t.height);return this.x=e,this.width=Math.max(s-e,0),this.y=r,this.height=Math.max(n-r,0),this}ceil(t=1,e=.001){const s=Math.ceil((this.x+this.width-e)*t)/t,r=Math.ceil((this.y+this.height-e)*t)/t;return this.x=Math.floor((this.x+e)*t)/t,this.y=Math.floor((this.y+e)*t)/t,this.width=s-this.x,this.height=r-this.y,this}enlarge(t){const e=Math.min(this.x,t.x),s=Math.max(this.x+this.width,t.x+t.width),r=Math.min(this.y,t.y),n=Math.max(this.y+this.height,t.y+t.height);return this.x=e,this.width=s-e,this.y=r,this.height=n-r,this}getBounds(t){return t=t||new ot,t.copyFrom(this),t}toString(){return`[pixi.js/math:Rectangle x=${this.x} y=${this.y} width=${this.width} height=${this.height}]`}};const xs={default:-1};at=function(i="default"){return xs[i]===void 0&&(xs[i]=-1),++xs[i]};let Ti;Ti={};tt="8.0.0";et=function(i,t,e=3){if(Ti[t])return;let s=new Error().stack;typeof s>"u"?console.warn("PixiJS Deprecation Warning: ",`${t} Deprecated since v${i}`):(s=s.split(` `).splice(e).join(` `),console.groupCollapsed?(console.groupCollapsed("%cPixiJS Deprecation Warning: %c%s","color:#614108;background:#fffbe6","font-weight:normal;color:#614108;background:#fffbe6",`${t} Deprecated since v${i}`),console.warn(s),console.groupEnd()):(console.warn("PixiJS Deprecation Warning: ",`${t} Deprecated since v${i}`),console.warn(s))),Ti[t]=!0};const Sr=()=>{};mu=function(i){return i+=i===0?1:0,--i,i|=i>>>1,i|=i>>>2,i|=i>>>4,i|=i>>>8,i|=i>>>16,i+1};function Ii(i){return!(i&i-1)&&!!i}function Ho(i){const t={};for(const e in i)i[e]!==void 0&&(t[e]=i[e]);return t}const Ei=Object.create(null);function Yo(i){const t=Ei[i];return t===void 0&&(Ei[i]=at("resource")),t}const Mr=class kr extends Lt{constructor(t={}){super(),this._resourceType="textureSampler",this._touched=0,this._maxAnisotropy=1,this.destroyed=!1,t={...kr.defaultOptions,...t},this.addressMode=t.addressMode,this.addressModeU=t.addressModeU??this.addressModeU,this.addressModeV=t.addressModeV??this.addressModeV,this.addressModeW=t.addressModeW??this.addressModeW,this.scaleMode=t.scaleMode,this.magFilter=t.magFilter??this.magFilter,this.minFilter=t.minFilter??this.minFilter,this.mipmapFilter=t.mipmapFilter??this.mipmapFilter,this.lodMinClamp=t.lodMinClamp,this.lodMaxClamp=t.lodMaxClamp,this.compare=t.compare,this.maxAnisotropy=t.maxAnisotropy??1}set addressMode(t){this.addressModeU=t,this.addressModeV=t,this.addressModeW=t}get addressMode(){return this.addressModeU}set wrapMode(t){et(tt,"TextureStyle.wrapMode is now TextureStyle.addressMode"),this.addressMode=t}get wrapMode(){return this.addressMode}set scaleMode(t){this.magFilter=t,this.minFilter=t,this.mipmapFilter=t}get scaleMode(){return this.magFilter}set maxAnisotropy(t){this._maxAnisotropy=Math.min(t,16),this._maxAnisotropy>1&&(this.scaleMode="linear")}get maxAnisotropy(){return this._maxAnisotropy}get _resourceId(){return this._sharedResourceId||this._generateResourceId()}update(){this.emit("change",this),this._sharedResourceId=null}_generateResourceId(){const t=`${this.addressModeU}-${this.addressModeV}-${this.addressModeW}-${this.magFilter}-${this.minFilter}-${this.mipmapFilter}-${this.lodMinClamp}-${this.lodMaxClamp}-${this.compare}-${this._maxAnisotropy}`;return this._sharedResourceId=Yo(t),this._resourceId}destroy(){this.destroyed=!0,this.emit("destroy",this),this.emit("change",this),this.removeAllListeners()}};Mr.defaultOptions={addressMode:"clamp-to-edge",scaleMode:"linear"};let Xo=Mr;const Pr=class Tr extends Lt{constructor(t={}){super(),this.options=t,this.uid=at("textureSource"),this._resourceType="textureSource",this._resourceId=at("resource"),this.uploadMethodId="unknown",this._resolution=1,this.pixelWidth=1,this.pixelHeight=1,this.width=1,this.height=1,this.sampleCount=1,this.mipLevelCount=1,this.autoGenerateMipmaps=!1,this.format="rgba8unorm",this.dimension="2d",this.antialias=!1,this._touched=0,this._batchTick=-1,this._textureBindLocation=-1,t={...Tr.defaultOptions,...t},this.label=t.label??"",this.resource=t.resource,this.autoGarbageCollect=t.autoGarbageCollect,this._resolution=t.resolution,t.width?this.pixelWidth=t.width*this._resolution:this.pixelWidth=this.resource?this.resourceWidth??1:1,t.height?this.pixelHeight=t.height*this._resolution:this.pixelHeight=this.resource?this.resourceHeight??1:1,this.width=this.pixelWidth/this._resolution,this.height=this.pixelHeight/this._resolution,this.format=t.format,this.dimension=t.dimensions,this.mipLevelCount=t.mipLevelCount,this.autoGenerateMipmaps=t.autoGenerateMipmaps,this.sampleCount=t.sampleCount,this.antialias=t.antialias,this.alphaMode=t.alphaMode,this.style=new Xo(Ho(t)),this.destroyed=!1,this._refreshPOT()}get source(){return this}get style(){return this._style}set style(t){this.style!==t&&(this._style?.off("change",this._onStyleChange,this),this._style=t,this._style?.on("change",this._onStyleChange,this),this._onStyleChange())}get addressMode(){return this._style.addressMode}set addressMode(t){this._style.addressMode=t}get repeatMode(){return this._style.addressMode}set repeatMode(t){this._style.addressMode=t}get magFilter(){return this._style.magFilter}set magFilter(t){this._style.magFilter=t}get minFilter(){return this._style.minFilter}set minFilter(t){this._style.minFilter=t}get mipmapFilter(){return this._style.mipmapFilter}set mipmapFilter(t){this._style.mipmapFilter=t}get lodMinClamp(){return this._style.lodMinClamp}set lodMinClamp(t){this._style.lodMinClamp=t}get lodMaxClamp(){return this._style.lodMaxClamp}set lodMaxClamp(t){this._style.lodMaxClamp=t}_onStyleChange(){this.emit("styleChange",this)}update(){if(this.resource){const t=this._resolution;if(this.resize(this.resourceWidth/t,this.resourceHeight/t))return}this.emit("update",this)}destroy(){this.destroyed=!0,this.emit("destroy",this),this.emit("change",this),this._style&&(this._style.destroy(),this._style=null),this.uploadMethodId=null,this.resource=null,this.removeAllListeners()}unload(){this._resourceId=at("resource"),this.emit("change",this),this.emit("unload",this)}get resourceWidth(){const{resource:t}=this;return t.naturalWidth||t.videoWidth||t.displayWidth||t.width}get resourceHeight(){const{resource:t}=this;return t.naturalHeight||t.videoHeight||t.displayHeight||t.height}get resolution(){return this._resolution}set resolution(t){this._resolution!==t&&(this._resolution=t,this.width=this.pixelWidth/t,this.height=this.pixelHeight/t)}resize(t,e,s){s=s||this._resolution,t=t||this.width,e=e||this.height;const r=Math.round(t*s),n=Math.round(e*s);return this.width=r/s,this.height=n/s,this._resolution=s,this.pixelWidth===r&&this.pixelHeight===n?!1:(this._refreshPOT(),this.pixelWidth=r,this.pixelHeight=n,this.emit("resize",this),this._resourceId=at("resource"),this.emit("change",this),!0)}updateMipmaps(){this.autoGenerateMipmaps&&this.mipLevelCount>1&&this.emit("updateMipmaps",this)}set wrapMode(t){this._style.wrapMode=t}get wrapMode(){return this._style.wrapMode}set scaleMode(t){this._style.scaleMode=t}get scaleMode(){return this._style.scaleMode}_refreshPOT(){this.isPowerOfTwo=Ii(this.pixelWidth)&&Ii(this.pixelHeight)}static test(t){throw new Error("Unimplemented")}};Pr.defaultOptions={resolution:1,format:"bgra8unorm",alphaMode:"premultiply-alpha-on-upload",dimensions:"2d",mipLevelCount:1,autoGenerateMipmaps:!1,sampleCount:1,antialias:!1,autoGarbageCollect:!1};Ft=Pr;class li extends Ft{constructor(t){const e=t.resource||new Float32Array(t.width*t.height*4);let s=t.format;s||(e instanceof Float32Array?s="rgba32float":e instanceof Int32Array||e instanceof Uint32Array?s="rgba32uint":e instanceof Int16Array||e instanceof Uint16Array?s="rgba16uint":(e instanceof Int8Array,s="bgra8unorm")),super({...t,resource:e,format:s}),this.uploadMethodId="buffer"}static test(t){return t instanceof Int8Array||t instanceof Uint8Array||t instanceof Uint8ClampedArray||t instanceof Int16Array||t instanceof Uint16Array||t instanceof Int32Array||t instanceof Uint32Array||t instanceof Float32Array}}li.extension=Y.TextureSource;const Ri=new H;Wo=class{constructor(t,e){this.mapCoord=new H,this.uClampFrame=new Float32Array(4),this.uClampOffset=new Float32Array(2),this._textureID=-1,this._updateID=0,this.clampOffset=0,typeof e>"u"?this.clampMargin=t.width<10?0:.5:this.clampMargin=e,this.isSimple=!1,this.texture=t}get texture(){return this._texture}set texture(t){this.texture!==t&&(this._texture?.removeListener("update",this.update,this),this._texture=t,this._texture.addListener("update",this.update,this),this.update())}multiplyUvs(t,e){e===void 0&&(e=t);const s=this.mapCoord;for(let r=0;r0:typeof i=="number"},rt=function(i,t,e){return t===void 0&&(t=0),e===void 0&&(e=Math.pow(10,t)),Math.round(e*i)/e+0},vt=function(i,t,e){return t===void 0&&(t=0),e===void 0&&(e=1),i>e?e:i>t?i:t},Ir=function(i){return(i=isFinite(i)?i%360:0)>0?i:i+360},Di=function(i){return{r:vt(i.r,0,255),g:vt(i.g,0,255),b:vt(i.b,0,255),a:vt(i.a)}},bs=function(i){return{r:rt(i.r),g:rt(i.g),b:rt(i.b),a:rt(i.a,3)}},Ko=/^#([0-9a-f]{3,8})$/i,Ke=function(i){var t=i.toString(16);return t.length<2?"0"+t:t},Er=function(i){var t=i.r,e=i.g,s=i.b,r=i.a,n=Math.max(t,e,s),o=n-Math.min(t,e,s),a=o?n===t?(e-s)/o:n===e?2+(s-t)/o:4+(t-e)/o:0;return{h:60*(a<0?a+6:a),s:n?o/n*100:0,v:n/255*100,a:r}},Rr=function(i){var t=i.h,e=i.s,s=i.v,r=i.a;t=t/360*6,e/=100,s/=100;var n=Math.floor(t),o=s*(1-e),a=s*(1-(t-n)*e),l=s*(1-(1-t+n)*e),u=n%6;return{r:255*[s,a,o,o,l,s][u],g:255*[l,s,s,a,o,o][u],b:255*[o,o,l,s,s,a][u],a:r}},Bi=function(i){return{h:Ir(i.h),s:vt(i.s,0,100),l:vt(i.l,0,100),a:vt(i.a)}},Fi=function(i){return{h:rt(i.h),s:rt(i.s),l:rt(i.l),a:rt(i.a,3)}},$i=function(i){return Rr((e=(t=i).s,{h:t.h,s:(e*=((s=t.l)<50?s:100-s)/100)>0?2*e/(s+e)*100:0,v:s+e,a:t.a}));var t,e,s},Pe=function(i){return{h:(t=Er(i)).h,s:(r=(200-(e=t.s))*(s=t.v)/100)>0&&r<200?e*s/100/(r<=100?r:200-r)*100:0,l:r/2,a:t.a};var t,e,s,r},Zo=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Qo=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Jo=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,ta=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Hs={string:[[function(i){var t=Ko.exec(i);return t?(i=t[1]).length<=4?{r:parseInt(i[0]+i[0],16),g:parseInt(i[1]+i[1],16),b:parseInt(i[2]+i[2],16),a:i.length===4?rt(parseInt(i[3]+i[3],16)/255,2):1}:i.length===6||i.length===8?{r:parseInt(i.substr(0,2),16),g:parseInt(i.substr(2,2),16),b:parseInt(i.substr(4,2),16),a:i.length===8?rt(parseInt(i.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(i){var t=Jo.exec(i)||ta.exec(i);return t?t[2]!==t[4]||t[4]!==t[6]?null:Di({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:t[7]===void 0?1:Number(t[7])/(t[8]?100:1)}):null},"rgb"],[function(i){var t=Zo.exec(i)||Qo.exec(i);if(!t)return null;var e,s,r=Bi({h:(e=t[1],s=t[2],s===void 0&&(s="deg"),Number(e)*(jo[s]||1)),s:Number(t[3]),l:Number(t[4]),a:t[5]===void 0?1:Number(t[5])/(t[6]?100:1)});return $i(r)},"hsl"]],object:[[function(i){var t=i.r,e=i.g,s=i.b,r=i.a,n=r===void 0?1:r;return It(t)&&It(e)&&It(s)?Di({r:Number(t),g:Number(e),b:Number(s),a:Number(n)}):null},"rgb"],[function(i){var t=i.h,e=i.s,s=i.l,r=i.a,n=r===void 0?1:r;if(!It(t)||!It(e)||!It(s))return null;var o=Bi({h:Number(t),s:Number(e),l:Number(s),a:Number(n)});return $i(o)},"hsl"],[function(i){var t=i.h,e=i.s,s=i.v,r=i.a,n=r===void 0?1:r;if(!It(t)||!It(e)||!It(s))return null;var o=function(a){return{h:Ir(a.h),s:vt(a.s,0,100),v:vt(a.v,0,100),a:vt(a.a)}}({h:Number(t),s:Number(e),v:Number(s),a:Number(n)});return Rr(o)},"hsv"]]},Vi=function(i,t){for(var e=0;e=.5},i.prototype.toHex=function(){return t=bs(this.rgba),e=t.r,s=t.g,r=t.b,o=(n=t.a)<1?Ke(rt(255*n)):"","#"+Ke(e)+Ke(s)+Ke(r)+o;var t,e,s,r,n,o},i.prototype.toRgb=function(){return bs(this.rgba)},i.prototype.toRgbString=function(){return t=bs(this.rgba),e=t.r,s=t.g,r=t.b,(n=t.a)<1?"rgba("+e+", "+s+", "+r+", "+n+")":"rgb("+e+", "+s+", "+r+")";var t,e,s,r,n},i.prototype.toHsl=function(){return Fi(Pe(this.rgba))},i.prototype.toHslString=function(){return t=Fi(Pe(this.rgba)),e=t.h,s=t.s,r=t.l,(n=t.a)<1?"hsla("+e+", "+s+"%, "+r+"%, "+n+")":"hsl("+e+", "+s+"%, "+r+"%)";var t,e,s,r,n},i.prototype.toHsv=function(){return t=Er(this.rgba),{h:rt(t.h),s:rt(t.s),v:rt(t.v),a:rt(t.a,3)};var t},i.prototype.invert=function(){return kt({r:255-(t=this.rgba).r,g:255-t.g,b:255-t.b,a:t.a});var t},i.prototype.saturate=function(t){return t===void 0&&(t=.1),kt(vs(this.rgba,t))},i.prototype.desaturate=function(t){return t===void 0&&(t=.1),kt(vs(this.rgba,-t))},i.prototype.grayscale=function(){return kt(vs(this.rgba,-1))},i.prototype.lighten=function(t){return t===void 0&&(t=.1),kt(Gi(this.rgba,t))},i.prototype.darken=function(t){return t===void 0&&(t=.1),kt(Gi(this.rgba,-t))},i.prototype.rotate=function(t){return t===void 0&&(t=15),this.hue(this.hue()+t)},i.prototype.alpha=function(t){return typeof t=="number"?kt({r:(e=this.rgba).r,g:e.g,b:e.b,a:t}):rt(this.rgba.a,3);var e},i.prototype.hue=function(t){var e=Pe(this.rgba);return typeof t=="number"?kt({h:t,s:e.s,l:e.l,a:e.a}):rt(e.h)},i.prototype.isEqual=function(t){return this.toHex()===kt(t).toHex()},i}(),kt=function(i){return i instanceof Ys?i:new Ys(i)},Ni=[],sa=function(i){i.forEach(function(t){Ni.indexOf(t)<0&&(t(Ys,Hs),Ni.push(t))})};function ia(i,t){var e={white:"#ffffff",bisque:"#ffe4c4",blue:"#0000ff",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",antiquewhite:"#faebd7",aqua:"#00ffff",azure:"#f0ffff",whitesmoke:"#f5f5f5",papayawhip:"#ffefd5",plum:"#dda0dd",blanchedalmond:"#ffebcd",black:"#000000",gold:"#ffd700",goldenrod:"#daa520",gainsboro:"#dcdcdc",cornsilk:"#fff8dc",cornflowerblue:"#6495ed",burlywood:"#deb887",aquamarine:"#7fffd4",beige:"#f5f5dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkkhaki:"#bdb76b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",peachpuff:"#ffdab9",darkmagenta:"#8b008b",darkred:"#8b0000",darkorchid:"#9932cc",darkorange:"#ff8c00",darkslateblue:"#483d8b",gray:"#808080",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",deeppink:"#ff1493",deepskyblue:"#00bfff",wheat:"#f5deb3",firebrick:"#b22222",floralwhite:"#fffaf0",ghostwhite:"#f8f8ff",darkviolet:"#9400d3",magenta:"#ff00ff",green:"#008000",dodgerblue:"#1e90ff",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",blueviolet:"#8a2be2",forestgreen:"#228b22",lawngreen:"#7cfc00",indianred:"#cd5c5c",indigo:"#4b0082",fuchsia:"#ff00ff",brown:"#a52a2a",maroon:"#800000",mediumblue:"#0000cd",lightcoral:"#f08080",darkturquoise:"#00ced1",lightcyan:"#e0ffff",ivory:"#fffff0",lightyellow:"#ffffe0",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",linen:"#faf0e6",mediumaquamarine:"#66cdaa",lemonchiffon:"#fffacd",lime:"#00ff00",khaki:"#f0e68c",mediumseagreen:"#3cb371",limegreen:"#32cd32",mediumspringgreen:"#00fa9a",lightskyblue:"#87cefa",lightblue:"#add8e6",midnightblue:"#191970",lightpink:"#ffb6c1",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",mintcream:"#f5fffa",lightslategray:"#778899",lightslategrey:"#778899",navajowhite:"#ffdead",navy:"#000080",mediumvioletred:"#c71585",powderblue:"#b0e0e6",palegoldenrod:"#eee8aa",oldlace:"#fdf5e6",paleturquoise:"#afeeee",mediumturquoise:"#48d1cc",mediumorchid:"#ba55d3",rebeccapurple:"#663399",lightsteelblue:"#b0c4de",mediumslateblue:"#7b68ee",thistle:"#d8bfd8",tan:"#d2b48c",orchid:"#da70d6",mediumpurple:"#9370db",purple:"#800080",pink:"#ffc0cb",skyblue:"#87ceeb",springgreen:"#00ff7f",palegreen:"#98fb98",red:"#ff0000",yellow:"#ffff00",slateblue:"#6a5acd",lavenderblush:"#fff0f5",peru:"#cd853f",palevioletred:"#db7093",violet:"#ee82ee",teal:"#008080",slategray:"#708090",slategrey:"#708090",aliceblue:"#f0f8ff",darkseagreen:"#8fbc8f",darkolivegreen:"#556b2f",greenyellow:"#adff2f",seagreen:"#2e8b57",seashell:"#fff5ee",tomato:"#ff6347",silver:"#c0c0c0",sienna:"#a0522d",lavender:"#e6e6fa",lightgreen:"#90ee90",orange:"#ffa500",orangered:"#ff4500",steelblue:"#4682b4",royalblue:"#4169e1",turquoise:"#40e0d0",yellowgreen:"#9acd32",salmon:"#fa8072",saddlebrown:"#8b4513",sandybrown:"#f4a460",rosybrown:"#bc8f8f",darksalmon:"#e9967a",lightgoldenrodyellow:"#fafad2",snow:"#fffafa",lightgrey:"#d3d3d3",lightgray:"#d3d3d3",dimgray:"#696969",dimgrey:"#696969",olivedrab:"#6b8e23",olive:"#808000"},s={};for(var r in e)s[e[r]]=r;var n={};i.prototype.toName=function(o){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var a,l,u=s[this.toHex()];if(u)return u;if(o?.closest){var h=this.toRgb(),c=1/0,d="black";if(!n.length)for(var m in e)n[m]=new i(e[m]).toRgb();for(var p in e){var _=(a=h,l=n[p],Math.pow(a.r-l.r,2)+Math.pow(a.g-l.g,2)+Math.pow(a.b-l.b,2));_n===e[o]);if(t!==null&&e!==null){const n=Object.keys(t),o=Object.keys(e);return n.length!==o.length?!1:n.every(a=>t[a]===e[a])}return t===e}toRgba(){const[t,e,s,r]=this._components;return{r:t,g:e,b:s,a:r}}toRgb(){const[t,e,s]=this._components;return{r:t,g:e,b:s}}toRgbaString(){const[t,e,s]=this.toUint8RgbArray();return`rgba(${t},${e},${s},${this.alpha})`}toUint8RgbArray(t){const[e,s,r]=this._components;return this._arrayRgb||(this._arrayRgb=[]),t=t||this._arrayRgb,t[0]=Math.round(e*255),t[1]=Math.round(s*255),t[2]=Math.round(r*255),t}toArray(t){this._arrayRgba||(this._arrayRgba=[]),t=t||this._arrayRgba;const[e,s,r,n]=this._components;return t[0]=e,t[1]=s,t[2]=r,t[3]=n,t}toRgbArray(t){this._arrayRgb||(this._arrayRgb=[]),t=t||this._arrayRgb;const[e,s,r]=this._components;return t[0]=e,t[1]=s,t[2]=r,t}toNumber(){return this._int}toBgrNumber(){const[t,e,s]=this.toUint8RgbArray();return(s<<16)+(e<<8)+t}toLittleEndianNumber(){const t=this._int;return(t>>16)+(t&65280)+((t&255)<<16)}multiply(t){const[e,s,r,n]=Se._temp.setValue(t)._components;return this._components[0]*=e,this._components[1]*=s,this._components[2]*=r,this._components[3]*=n,this._refreshInt(),this._value=null,this}premultiply(t,e=!0){return e&&(this._components[0]*=t,this._components[1]*=t,this._components[2]*=t),this._components[3]=t,this._refreshInt(),this._value=null,this}toPremultiplied(t,e=!0){if(t===1)return(255<<24)+this._int;if(t===0)return e?0:this._int;let s=this._int>>16&255,r=this._int>>8&255,n=this._int&255;return e&&(s=s*t+.5|0,r=r*t+.5|0,n=n*t+.5|0),(t*255<<24)+(s<<16)+(r<<8)+n}toHex(){const t=this._int.toString(16);return`#${"000000".substring(0,6-t.length)+t}`}toHexa(){const e=Math.round(this._components[3]*255).toString(16);return this.toHex()+"00".substring(0,2-e.length)+e}setAlpha(t){return this._components[3]=this._clamp(t),this}_normalize(t){let e,s,r,n;if((typeof t=="number"||t instanceof Number)&&t>=0&&t<=16777215){const o=t;e=(o>>16&255)/255,s=(o>>8&255)/255,r=(o&255)/255,n=1}else if((Array.isArray(t)||t instanceof Float32Array)&&t.length>=3&&t.length<=4)t=this._clamp(t),[e,s,r,n=1]=t;else if((t instanceof Uint8Array||t instanceof Uint8ClampedArray)&&t.length>=3&&t.length<=4)t=this._clamp(t,0,255),[e,s,r,n=255]=t,e/=255,s/=255,r/=255,n/=255;else if(typeof t=="string"||typeof t=="object"){if(typeof t=="string"){const a=Se.HEX_PATTERN.exec(t);a&&(t=`#${a[2]}`)}const o=kt(t);o.isValid()&&({r:e,g:s,b:r,a:n}=o.rgba,e/=255,s/=255,r/=255)}if(e!==void 0)this._components[0]=e,this._components[1]=s,this._components[2]=r,this._components[3]=n,this._refreshInt();else throw new Error(`Unable to convert color ${t}`)}_refreshInt(){this._clamp(this._components);const[t,e,s]=this._components;this._int=(t*255<<16)+(e*255<<8)+(s*255|0)}_clamp(t,e=0,s=1){return typeof t=="number"?Math.min(Math.max(t,e),s):(t.forEach((r,n)=>{t[n]=Math.min(Math.max(r,e),s)}),t)}static isColorLike(t){return typeof t=="number"||typeof t=="string"||t instanceof Number||t instanceof Se||Array.isArray(t)||t instanceof Uint8Array||t instanceof Uint8ClampedArray||t instanceof Float32Array||t.r!==void 0&&t.g!==void 0&&t.b!==void 0||t.r!==void 0&&t.g!==void 0&&t.b!==void 0&&t.a!==void 0||t.h!==void 0&&t.s!==void 0&&t.l!==void 0||t.h!==void 0&&t.s!==void 0&&t.l!==void 0&&t.a!==void 0||t.h!==void 0&&t.s!==void 0&&t.v!==void 0||t.h!==void 0&&t.s!==void 0&&t.v!==void 0&&t.a!==void 0}};de.shared=new de;de._temp=new de;de.HEX_PATTERN=/^(#|0x)?(([a-f0-9]{3}){1,2}([a-f0-9]{2})?)$/i;xt=de;const ra={cullArea:null,cullable:!1,cullableChildren:!0};class hi{constructor(t,e){this._pool=[],this._count=0,this._index=0,this._classType=t,e&&this.prepopulate(e)}prepopulate(t){for(let e=0;e0?e=this._pool[--this._index]:e=new this._classType,e.init?.(t),e}return(t){t.reset?.(),this._pool[this._index++]=t}get totalSize(){return this._count}get totalFree(){return this._index}get totalUsed(){return this._count-this._index}}class na{constructor(){this._poolsByClass=new Map}prepopulate(t,e){this.getPool(t).prepopulate(e)}get(t,e){return this.getPool(t).get(e)}return(t){this.getPool(t.constructor).return(t)}getPool(t){return this._poolsByClass.has(t)||this._poolsByClass.set(t,new hi(t)),this._poolsByClass.get(t)}stats(){const t={};return this._poolsByClass.forEach(e=>{const s=t[e._classType.name]?e._classType.name+e._classType.ID:e._classType.name;t[s]={free:e.totalFree,used:e.totalUsed,size:e.totalSize}}),t}}Mt=new na;oa=function(i,t,e){const s=i.length;let r;if(t>=s||e===0)return;e=t+e>s?s-t:e;const n=s-e;for(r=t;r0&&s<=e){for(let o=e-1;o>=i;o--){const a=this.children[o];a&&(r.push(a),a.parent=null)}oa(this.children,i,e);const n=this.renderGroup||this.parentRenderGroup;n&&n.removeChildren(r);for(let o=0;o=this.children.length)throw new Error(`getChildAt: Index (${i}) does not exist.`);return this.children[i]},setChildIndex(i,t){if(t<0||t>=this.children.length)throw new Error(`The index ${t} supplied is out of bounds ${this.children.length}`);this.getChildIndex(i),this.addChildAt(i,t)},getChildIndex(i){const t=this.children.indexOf(i);if(t===-1)throw new Error("The supplied Container must be a child of the caller");return t},addChildAt(i,t){this.allowChildren||et(tt,"addChildAt: Only Containers will be allowed to add children in v8.0.0");const{children:e}=this;if(t<0||t>e.length)throw new Error(`${i}addChildAt: The index ${t} supplied is out of bounds ${e.length}`);if(i.parent){const r=i.parent.children.indexOf(i);if(i.parent===this&&r===t)return i;r!==-1&&i.parent.children.splice(r,1)}t===e.length?e.push(i):e.splice(t,0,i),i.parent=this,i.didChange=!0,i.didViewUpdate=!1,i._updateFlags=15;const s=this.renderGroup||this.parentRenderGroup;return s&&s.addChild(i),this.sortableChildren&&(this.sortDirty=!0),this.emit("childAdded",i,this,t),i.emit("added",this),i},swapChildren(i,t){if(i===t)return;const e=this.getChildIndex(i),s=this.getChildIndex(t);this.children[e]=t,this.children[s]=i;const r=this.renderGroup||this.parentRenderGroup;r&&(r.structureDidChange=!0),this._didChangeId++},removeFromParent(){this.parent?.removeChild(this)},reparentChild(...i){return i.length===1?this.reparentChildAt(i[0],this.children.length):(i.forEach(t=>this.reparentChildAt(t,this.children.length)),i[0])},reparentChildAt(i,t){if(i.parent===this)return this.setChildIndex(i,t),i;const e=i.worldTransform.clone();i.removeFromParent(),this.addChildAt(i,t);const s=this.worldTransform.clone();return s.invert(),e.prepend(s),i.setFromMatrix(e),i}};Li=class{constructor(){this.pipe="filter",this.priority=1}destroy(){for(let t=0;t{this.add({test:t.test,maskClass:t})}))}add(t){this._tests.push(t)}getMaskEffect(t){this._initialized||this.init();for(let e=0;es.priority-r.priority);const e=this.renderGroup||this.parentRenderGroup;e&&(e.structureDidChange=!0),this._updateIsSimple()},removeEffect(i){const t=this.effects.indexOf(i);t!==-1&&(this.effects.splice(t,1),this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0),this._updateIsSimple())},set mask(i){const t=this._maskEffect;t?.mask!==i&&(t&&(this.removeEffect(t),Xs.returnMaskEffect(t),this._maskEffect=null),i!=null&&(this._maskEffect=Xs.getMaskEffect(i),this.addEffect(this._maskEffect)))},get mask(){return this._maskEffect?.mask},set filters(i){!Array.isArray(i)&&i&&(i=[i]);const t=this._filterEffect||(this._filterEffect=new Li);i=i;const e=i?.length>0,s=t.filters?.length>0,r=e!==s;i=Array.isArray(i)?i.slice(0):i,t.filters=Object.freeze(i),r&&(e?this.addEffect(t):(this.removeEffect(t),t.filters=i??null))},get filters(){return this._filterEffect?.filters},set filterArea(i){this._filterEffect||(this._filterEffect=new Li),this._filterEffect.filterArea=i},get filterArea(){return this._filterEffect?.filterArea}},ua={label:null,get name(){return et(tt,"Container.name property has been removed, use Container.label instead"),this.label},set name(i){et(tt,"Container.name property has been removed, use Container.label instead"),this.label=i},getChildByName(i,t=!1){return this.getChildByLabel(i,t)},getChildByLabel(i,t=!1){const e=this.children;for(let s=0;sthis.maxX||this.minY>this.maxY}get rectangle(){this._rectangle||(this._rectangle=new ot);const t=this._rectangle;return this.minX>this.maxX||this.minY>this.maxY?(t.x=0,t.y=0,t.width=0,t.height=0):t.copyFromBounds(this),t}clear(){return this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.matrix=Ui,this}set(t,e,s,r){this.minX=t,this.minY=e,this.maxX=s,this.maxY=r}addFrame(t,e,s,r,n){n||(n=this.matrix);const o=n.a,a=n.b,l=n.c,u=n.d,h=n.tx,c=n.ty;let d=this.minX,m=this.minY,p=this.maxX,_=this.maxY,f=o*t+l*e+h,v=a*t+u*e+c;fp&&(p=f),v>_&&(_=v),f=o*s+l*e+h,v=a*s+u*e+c,fp&&(p=f),v>_&&(_=v),f=o*t+l*r+h,v=a*t+u*r+c,fp&&(p=f),v>_&&(_=v),f=o*s+l*r+h,v=a*s+u*r+c,fp&&(p=f),v>_&&(_=v),this.minX=d,this.minY=m,this.maxX=p,this.maxY=_}addRect(t,e){this.addFrame(t.x,t.y,t.x+t.width,t.y+t.height,e)}addBounds(t,e){this.addFrame(t.minX,t.minY,t.maxX,t.maxY,e)}addBoundsMask(t){this.minX=this.minX>t.minX?this.minX:t.minX,this.minY=this.minY>t.minY?this.minY:t.minY,this.maxX=this.maxXthis.maxX?d:this.maxX,this.maxY=m>this.maxY?m:this.maxY,d=o*e+l*n+h,m=a*e+u*n+c,this.minX=dthis.maxX?d:this.maxX,this.maxY=m>this.maxY?m:this.maxY,d=o*r+l*n+h,m=a*r+u*n+c,this.minX=dthis.maxX?d:this.maxX,this.maxY=m>this.maxY?m:this.maxY}fit(t){return this.minXt.right&&(this.maxX=t.right),this.minYt.bottom&&(this.maxY=t.bottom),this}fitBounds(t,e,s,r){return this.minXe&&(this.maxX=e),this.minYr&&(this.maxY=r),this}pad(t,e=t){return this.minX-=t,this.maxX+=t,this.minY-=e,this.maxY+=e,this}ceil(){return this.minX=Math.floor(this.minX),this.minY=Math.floor(this.minY),this.maxX=Math.ceil(this.maxX),this.maxY=Math.ceil(this.maxY),this}clone(){return new Dt(this.minX,this.minY,this.maxX,this.maxY)}scale(t,e=t){return this.minX*=t,this.minY*=e,this.maxX*=t,this.maxY*=e,this}get x(){return this.minX}set x(t){const e=this.maxX-this.minX;this.minX=t,this.maxX=t+e}get y(){return this.minY}set y(t){const e=this.maxY-this.minY;this.minY=t,this.maxY=t+e}get width(){return this.maxX-this.minX}set width(t){this.maxX=this.minX+t}get height(){return this.maxY-this.minY}set height(t){this.maxY=this.minY+t}get left(){return this.minX}get right(){return this.maxX}get top(){return this.minY}get bottom(){return this.maxY}get isPositive(){return this.maxX-this.minX>0&&this.maxY-this.minY>0}get isValid(){return this.minX+this.minY!==1/0}addVertexData(t,e,s,r){let n=this.minX,o=this.minY,a=this.maxX,l=this.maxY;r||(r=this.matrix);const u=r.a,h=r.b,c=r.c,d=r.d,m=r.tx,p=r.ty;for(let _=e;_a?y:a,l=b>l?b:l}this.minX=n,this.minY=o,this.maxX=a,this.maxY=l}containsPoint(t,e){return this.minX<=t&&this.minY<=e&&this.maxX>=t&&this.maxY>=e}toString(){return`[pixi.js:Bounds minX=${this.minX} minY=${this.minY} maxX=${this.maxX} maxY=${this.maxY} width=${this.width} height=${this.height}]`}};let Et;Et=new hi(H);fe=new hi(Dt);Dr=function(i,t,e){e.clear();let s,r;return i.parent?t?s=i.parent.worldTransform:(r=Et.get().identity(),s=as(i,r)):s=H.IDENTITY,Br(i,e,s,t),r&&Et.return(r),e.isValid||e.set(0,0,0,0),e};function Br(i,t,e,s){if(!i.visible||!i.measurable)return;let r;s?r=i.worldTransform:(i.updateLocalTransform(),r=Et.get(),r.appendFrom(i.localTransform,e));const n=t,o=!!i.effects.length;if(o&&(t=fe.get().clear()),i.boundsArea)t.addRect(i.boundsArea,r);else{i.addBounds&&(t.matrix=r,i.addBounds(t));for(let a=0;a>12&&(i.didChange=!0,i.data[0]=this._didChangeId>>12),Vr(this,i),i.didChange&&Fr(this,i.localBounds,ca),i.localBounds},getBounds(i,t){return Dr(this,i,t||new Dt)}},fa={_onRender:null,set onRender(i){const t=this.renderGroup||this.parentRenderGroup;if(!i){this._onRender&&t?.removeOnRender(this),this._onRender=null;return}this._onRender||t?.addOnRender(this),this._onRender=i},get onRender(){return this._onRender}},pa={_zIndex:0,sortDirty:!1,sortableChildren:!1,get zIndex(){return this._zIndex},set zIndex(i){this._zIndex!==i&&(this._zIndex=i,this.depthOfChildModified())},depthOfChildModified(){this.parent&&(this.parent.sortableChildren=!0,this.parent.sortDirty=!0),this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0)},sortChildren(){this.sortDirty&&(this.sortDirty=!1,this.children.sort(ma))}};function ma(i,t){return i._zIndex-t._zIndex}const _a={getGlobalPosition(i=new ut,t=!1){return this.parent?this.parent.toGlobal(this._position,i,t):(i.x=this._position.x,i.y=this._position.y),i},toGlobal(i,t,e=!1){if(!e){this.updateLocalTransform();const s=as(this,new H);return s.append(this.localTransform),s.apply(i,t)}return this.worldTransform.apply(i,t)},toLocal(i,t,e,s){if(t&&(i=t.toGlobal(i,e,s)),!s){this.updateLocalTransform();const r=as(this,new H);return r.append(this.localTransform),r.applyInverse(i,e)}return this.worldTransform.applyInverse(i,e)}};class Gr{constructor(){this.uid=at("instructionSet"),this.instructions=[],this.instructionSize=0}reset(){this.instructionSize=0}add(t){this.instructions[this.instructionSize++]=t}log(){this.instructions.length=this.instructionSize,console.table(this.instructions,["type","action"])}}class ga{constructor(){this.renderPipeId="renderGroup",this.root=null,this.canBundle=!1,this.renderGroupParent=null,this.renderGroupChildren=[],this.worldTransform=new H,this.worldColorAlpha=4294967295,this.worldColor=16777215,this.worldAlpha=1,this.childrenToUpdate=Object.create(null),this.updateTick=0,this.childrenRenderablesToUpdate={list:[],index:0},this.structureDidChange=!0,this.instructionSet=new Gr,this._onRenderContainers=[]}init(t){this.root=t,t._onRender&&this.addOnRender(t),t.didChange=!0;const e=t.children;for(let s=0;s-1&&this.renderGroupChildren.splice(e,1),t.renderGroupParent=null}addChild(t){if(this.structureDidChange=!0,t.parentRenderGroup=this,t.updateTick=-1,t.parent===this.root?t.relativeRenderGroupDepth=1:t.relativeRenderGroupDepth=t.parent.relativeRenderGroupDepth+1,t.didChange=!0,this.onChildUpdate(t),t.renderGroup){this.addRenderGroupChild(t.renderGroup);return}t._onRender&&this.addOnRender(t);const e=t.children;for(let s=0;s0}addOnRender(t){this._onRenderContainers.push(t)}removeOnRender(t){this._onRenderContainers.splice(this._onRenderContainers.indexOf(t),1)}runOnRender(){for(let t=0;tthis.addChild(e)),this.effects=[],t.parent?.addChild(this)}static mixin(t){Object.defineProperties(pt.prototype,Object.getOwnPropertyDescriptors(t))}addChild(...t){if(this.allowChildren||et(tt,"addChild: Only Containers will be allowed to add children in v8.0.0"),t.length>1){for(let r=0;r1){for(let r=0;r-1&&(this._didChangeId+=4096,this.children.splice(s,1),this.renderGroup?this.renderGroup.removeChild(e):this.parentRenderGroup&&this.parentRenderGroup.removeChild(e),e.parent=null,this.emit("childRemoved",e,this,s),e.emit("removed",this)),e}_onUpdate(t){t&&t===this._skew&&this._updateSkew(),this._didChangeId++,!this.didChange&&(this.didChange=!0,this.parentRenderGroup&&this.parentRenderGroup.onChildUpdate(this))}set isRenderGroup(t){!!this.renderGroup!==t&&(t?this.enableRenderGroup():this.disableRenderGroup())}get isRenderGroup(){return!!this.renderGroup}enableRenderGroup(){if(this.renderGroup)return;const t=this.parentRenderGroup;t?.removeChild(this),this.renderGroup=Mt.get(ga,this),this.groupTransform=H.IDENTITY,t?.addChild(this),this._updateIsSimple()}disableRenderGroup(){if(!this.renderGroup)return;const t=this.parentRenderGroup;t?.removeChild(this),Mt.return(this.renderGroup),this.renderGroup=null,this.groupTransform=this.relativeGroupTransform,t?.addChild(this),this._updateIsSimple()}_updateIsSimple(){this.isSimple=!this.renderGroup&&this.effects.length===0}get worldTransform(){return this._worldTransform||(this._worldTransform=new H),this.renderGroup?this._worldTransform.copyFrom(this.renderGroup.worldTransform):this.parentRenderGroup&&this._worldTransform.appendFrom(this.relativeGroupTransform,this.parentRenderGroup.worldTransform),this._worldTransform}get x(){return this._position.x}set x(t){this._position.x=t}get y(){return this._position.y}set y(t){this._position.y=t}get position(){return this._position}set position(t){this._position.copyFrom(t)}get rotation(){return this._rotation}set rotation(t){this._rotation!==t&&(this._rotation=t,this._onUpdate(this._skew))}get angle(){return this.rotation*No}set angle(t){this.rotation=t*Lo}get pivot(){return this._pivot===Ss&&(this._pivot=new yt(this,0,0)),this._pivot}set pivot(t){this._pivot===Ss&&(this._pivot=new yt(this,0,0)),typeof t=="number"?this._pivot.set(t):this._pivot.copyFrom(t)}get skew(){return this._skew===As&&(this._skew=new yt(this,0,0)),this._skew}set skew(t){this._skew===As&&(this._skew=new yt(this,0,0)),this._skew.copyFrom(t)}get scale(){return this._scale===Ms&&(this._scale=new yt(this,1,1)),this._scale}set scale(t){this._scale===Ms&&(this._scale=new yt(this,0,0)),typeof t=="number"?this._scale.set(t):this._scale.copyFrom(t)}get width(){return Math.abs(this.scale.x*this.getLocalBounds().width)}set width(t){const e=this.getLocalBounds().width;this._setWidth(t,e)}get height(){return Math.abs(this.scale.y*this.getLocalBounds().height)}set height(t){const e=this.getLocalBounds().height;this._setHeight(t,e)}getSize(t){t||(t={});const e=this.getLocalBounds();return t.width=Math.abs(this.scale.x*e.width),t.height=Math.abs(this.scale.y*e.height),t}setSize(t,e){const s=this.getLocalBounds();let r,n;typeof t!="object"?(r=t,n=e??t):(r=t.width,n=t.height??t.width),r!==void 0&&this._setWidth(r,s.width),n!==void 0&&this._setHeight(n,s.height)}_updateSkew(){const t=this._rotation,e=this._skew;this._cx=Math.cos(t+e._y),this._sx=Math.sin(t+e._y),this._cy=-Math.sin(t-e._x),this._sy=Math.cos(t-e._x)}updateTransform(t){return this.position.set(typeof t.x=="number"?t.x:this.position.x,typeof t.y=="number"?t.y:this.position.y),this.scale.set(typeof t.scaleX=="number"?t.scaleX||1:this.scale.x,typeof t.scaleY=="number"?t.scaleY||1:this.scale.y),this.rotation=typeof t.rotation=="number"?t.rotation:this.rotation,this.skew.set(typeof t.skewX=="number"?t.skewX:this.skew.x,typeof t.skewY=="number"?t.skewY:this.skew.y),this.pivot.set(typeof t.pivotX=="number"?t.pivotX:this.pivot.x,typeof t.pivotY=="number"?t.pivotY:this.pivot.y),this}setFromMatrix(t){t.decompose(this)}updateLocalTransform(){if((this._didLocalTransformChangeId&15)===this._didChangeId)return;this._didLocalTransformChangeId=this._didChangeId;const t=this.localTransform,e=this._scale,s=this._pivot,r=this._position,n=e._x,o=e._y,a=s._x,l=s._y;t.a=this._cx*n,t.b=this._sx*n,t.c=this._cy*o,t.d=this._sy*o,t.tx=r._x-(a*t.a+l*t.c),t.ty=r._y-(a*t.b+l*t.d)}set alpha(t){t!==this.localAlpha&&(this.localAlpha=t,this._updateFlags|=zi,this._onUpdate())}get alpha(){return this.localAlpha}set tint(t){const s=xt.shared.setValue(t??16777215).toBgrNumber();s!==this.localColor&&(this.localColor=s,this._updateFlags|=zi,this._onUpdate())}get tint(){const t=this.localColor;return((t&255)<<16)+(t&65280)+(t>>16&255)}set blendMode(t){this.localBlendMode!==t&&(this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0),this._updateFlags|=xa,this.localBlendMode=t,this._onUpdate())}get blendMode(){return this.localBlendMode}get visible(){return!!(this.localDisplayStatus&2)}set visible(t){const e=t?1:0;(this.localDisplayStatus&2)>>1!==e&&(this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0),this._updateFlags|=ks,this.localDisplayStatus^=2,this._onUpdate())}get culled(){return!(this.localDisplayStatus&4)}set culled(t){const e=t?1:0;(this.localDisplayStatus&4)>>2!==e&&(this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0),this._updateFlags|=ks,this.localDisplayStatus^=4,this._onUpdate())}get renderable(){return!!(this.localDisplayStatus&1)}set renderable(t){const e=t?1:0;(this.localDisplayStatus&1)!==e&&(this._updateFlags|=ks,this.localDisplayStatus^=1,this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0),this._onUpdate())}get isRenderable(){return this.localDisplayStatus===7&&this.groupAlpha>0}destroy(t=!1){if(this.destroyed)return;this.destroyed=!0;const e=this.removeChildren(0,this.children.length);if(this.removeFromParent(),this.parent=null,this._maskEffect=null,this._filterEffect=null,this.effects=null,this._position=null,this._scale=null,this._pivot=null,this._skew=null,this.emit("destroyed",this),this.removeAllListeners(),typeof t=="boolean"?t:t?.children)for(let r=0;r{this.onViewUpdate()}}),s?this.anchor=s:e.defaultAnchor&&(this.anchor=e.defaultAnchor),this.texture=e,this.allowChildren=!1,this.roundPixels=r??!1,n&&(this.width=n),o&&(this.height=o)}static from(t,e=!1){return t instanceof W?new Be(t):new Be(W.from(t,e))}set texture(t){t||(t=W.EMPTY);const e=this._texture;e!==t&&(e&&e.dynamic&&e.off("update",this.onViewUpdate,this),t.dynamic&&t.on("update",this.onViewUpdate,this),this._texture=t,this._width&&this._setWidth(this._width,this._texture.orig.width),this._height&&this._setHeight(this._height,this._texture.orig.height),this.onViewUpdate())}get texture(){return this._texture}get bounds(){return this._boundsDirty&&(this._updateBounds(),this._boundsDirty=!1),this._bounds}get sourceBounds(){return this._sourceBoundsDirty&&(this._updateSourceBounds(),this._sourceBoundsDirty=!1),this._sourceBounds}containsPoint(t){const e=this.sourceBounds;return t.x>=e.maxX&&t.x<=e.minX&&t.y>=e.maxY&&t.y<=e.minY}addBounds(t){const e=this._texture.trim?this.sourceBounds:this.bounds;t.addFrame(e.minX,e.minY,e.maxX,e.maxY)}onViewUpdate(){if(this._didChangeId+=4096,this._didSpriteUpdate=!0,this._sourceBoundsDirty=this._boundsDirty=!0,this.didViewUpdate)return;this.didViewUpdate=!0;const t=this.renderGroup||this.parentRenderGroup;t&&t.onChildViewUpdate(this)}_updateBounds(){qo(this._bounds,this._anchor,this._texture,0)}_updateSourceBounds(){const t=this._anchor,e=this._texture,s=this._sourceBounds,{width:r,height:n}=e.orig;s.maxX=-t._x*r,s.minX=s.maxX+r,s.maxY=-t._y*n,s.minY=s.maxY+n}destroy(t=!1){if(super.destroy(t),typeof t=="boolean"?t:t?.texture){const s=typeof t=="boolean"?t:t?.textureSource;this._texture.destroy(s)}this._texture=null,this._bounds=null,this._sourceBounds=null,this._anchor=null}get anchor(){return this._anchor}set anchor(t){typeof t=="number"?this._anchor.set(t):this._anchor.copyFrom(t)}get roundPixels(){return!!this._roundPixels}set roundPixels(t){this._roundPixels=t?1:0}get width(){return Math.abs(this.scale.x)*this._texture.orig.width}set width(t){this._setWidth(t,this._texture.orig.width),this._width=t}get height(){return Math.abs(this.scale.y)*this._texture.orig.height}set height(t){this._setHeight(t,this._texture.orig.height),this._height=t}getSize(t){return t||(t={}),t.width=Math.abs(this.scale.x)*this._texture.orig.width,t.height=Math.abs(this.scale.y)*this._texture.orig.height,t}setSize(t,e){let s,r;typeof t!="object"?(s=t,r=e??t):(s=t.width,r=t.height??t.width),s!==void 0&&this._setWidth(s,this._texture.orig.width),r!==void 0&&this._setHeight(r,this._texture.orig.height)}};const ba=new Dt;function Nr(i,t,e){const s=ba;i.measurable=!0,Dr(i,e,s),t.addBoundsMask(s),i.measurable=!1}function Lr(i,t,e){const s=fe.get();i.measurable=!0;const r=Et.get().identity(),n=Ur(i,e,r);Fr(i,s,n),i.measurable=!1,t.addBoundsMask(s),Et.return(r),fe.return(s)}function Ur(i,t,e){return i?(i!==t&&(Ur(i.parent,t,e),i.updateLocalTransform(),e.append(i.localTransform)),e):(Rt("Mask bounds, renderable is not inside the root container"),e)}class Or{constructor(t){this.priority=0,this.pipe="alphaMask",t?.mask&&this.init(t.mask)}init(t){this.mask=t,this.renderMaskToTexture=!(t instanceof Be),this.mask.renderable=this.renderMaskToTexture,this.mask.includeInBuild=!this.renderMaskToTexture,this.mask.measurable=!1}reset(){this.mask.measurable=!0,this.mask=null}addBounds(t,e){Nr(this.mask,t,e)}addLocalBounds(t,e){Lr(this.mask,t,e)}containsPoint(t,e){const s=this.mask;return e(s,t)}destroy(){this.reset()}static test(t){return t instanceof Be}}Or.extension=Y.MaskEffect;class zr{constructor(t){this.priority=0,this.pipe="colorMask",t?.mask&&this.init(t.mask)}init(t){this.mask=t}destroy(){}static test(t){return typeof t=="number"}}zr.extension=Y.MaskEffect;class Hr{constructor(t){this.priority=0,this.pipe="stencilMask",t?.mask&&this.init(t.mask)}init(t){this.mask=t,this.mask.includeInBuild=!1,this.mask.measurable=!1}reset(){this.mask.measurable=!0,this.mask.includeInBuild=!0,this.mask=null}addBounds(t,e){Nr(this.mask,t,e)}addLocalBounds(t,e){Lr(this.mask,t,e)}containsPoint(t,e){const s=this.mask;return e(s,t)}destroy(){this.reset()}static test(t){return t instanceof pt}}Hr.extension=Y.MaskEffect;const va={createCanvas:(i,t)=>{const e=document.createElement("canvas");return e.width=i,e.height=t,e},getCanvasRenderingContext2D:()=>CanvasRenderingContext2D,getWebGLRenderingContext:()=>WebGLRenderingContext,getNavigator:()=>navigator,getBaseUrl:()=>document.baseURI??window.location.href,getFontFaceSet:()=>document.fonts,fetch:(i,t)=>fetch(i,t),parseXML:i=>new DOMParser().parseFromString(i,"text/xml")};let Hi=va;Nt={get(){return Hi},set(i){Hi=i}};Yr=class extends Ft{constructor(t){t.resource||(t.resource=Nt.get().createCanvas()),t.width||(t.width=t.resource.width,t.autoDensity||(t.width/=t.resolution)),t.height||(t.height=t.resource.height,t.autoDensity||(t.height/=t.resolution)),super(t),this.uploadMethodId="image",this.autoDensity=t.autoDensity;const e=t.resource;(this.pixelWidth!==e.width||this.pixelWidth!==e.height)&&this.resizeCanvas(),this.transparent=!!t.transparent}resizeCanvas(){this.autoDensity&&(this.resource.style.width=`${this.width}px`,this.resource.style.height=`${this.height}px`),(this.resource.width!==this.pixelWidth||this.resource.height!==this.pixelHeight)&&(this.resource.width=this.pixelWidth,this.resource.height=this.pixelHeight)}resize(t=this.width,e=this.height,s=this._resolution){const r=super.resize(t,e,s);return r&&this.resizeCanvas(),r}static test(t){return globalThis.HTMLCanvasElement&&t instanceof HTMLCanvasElement||globalThis.OffscreenCanvas&&t instanceof OffscreenCanvas}};Yr.extension=Y.TextureSource;ui=class extends Ft{constructor(t){if(t.resource&&globalThis.HTMLImageElement&&t.resource instanceof HTMLImageElement){const e=Nt.get().createCanvas(t.resource.width,t.resource.height);e.getContext("2d").drawImage(t.resource,0,0),t.resource=e,Rt("ImageSource: Image element passed, converting to canvas. Use CanvasSource instead.")}super(t),this.uploadMethodId="image",this.autoGarbageCollect=!0}static test(t){return globalThis.HTMLImageElement&&t instanceof HTMLImageElement||typeof ImageBitmap<"u"&&t instanceof ImageBitmap}};ui.extension=Y.TextureSource;Ws=(i=>(i[i.INTERACTION=50]="INTERACTION",i[i.HIGH=25]="HIGH",i[i.NORMAL=0]="NORMAL",i[i.LOW=-25]="LOW",i[i.UTILITY=-50]="UTILITY",i))(Ws||{});class Ps{constructor(t,e=null,s=0,r=!1){this.next=null,this.previous=null,this._destroyed=!1,this._fn=t,this._context=e,this.priority=s,this._once=r}match(t,e=null){return this._fn===t&&this._context===e}emit(t){this._fn&&(this._context?this._fn.call(this._context,t):this._fn(t));const e=this.next;return this._once&&this.destroy(!0),this._destroyed&&(this.next=null),e}connect(t){this.previous=t,t.next&&(t.next.previous=this),this.next=t.next,t.next=this}destroy(t=!1){this._destroyed=!0,this._fn=null,this._context=null,this.previous&&(this.previous.next=this.next),this.next&&(this.next.previous=this.previous);const e=this.next;return this.next=t?null:e,this.previous=null,e}}const Xr=class gt{constructor(){this.autoStart=!1,this.deltaTime=1,this.lastTime=-1,this.speed=1,this.started=!1,this._requestId=null,this._maxElapsedMS=100,this._minElapsedMS=0,this._protected=!1,this._lastFrame=-1,this._head=new Ps(null,null,1/0),this.deltaMS=1/gt.targetFPMS,this.elapsedMS=1/gt.targetFPMS,this._tick=t=>{this._requestId=null,this.started&&(this.update(t),this.started&&this._requestId===null&&this._head.next&&(this._requestId=requestAnimationFrame(this._tick)))}}_requestIfNeeded(){this._requestId===null&&this._head.next&&(this.lastTime=performance.now(),this._lastFrame=this.lastTime,this._requestId=requestAnimationFrame(this._tick))}_cancelIfNeeded(){this._requestId!==null&&(cancelAnimationFrame(this._requestId),this._requestId=null)}_startIfPossible(){this.started?this._requestIfNeeded():this.autoStart&&this.start()}add(t,e,s=Ws.NORMAL){return this._addListener(new Ps(t,e,s))}addOnce(t,e,s=Ws.NORMAL){return this._addListener(new Ps(t,e,s,!0))}_addListener(t){let e=this._head.next,s=this._head;if(!e)t.connect(s);else{for(;e;){if(t.priority>e.priority){t.connect(s);break}s=e,e=e.next}t.previous||t.connect(s)}return this._startIfPossible(),this}remove(t,e){let s=this._head.next;for(;s;)s.match(t,e)?s=s.destroy():s=s.next;return this._head.next||this._cancelIfNeeded(),this}get count(){if(!this._head)return 0;let t=0,e=this._head;for(;e=e.next;)t++;return t}start(){this.started||(this.started=!0,this._requestIfNeeded())}stop(){this.started&&(this.started=!1,this._cancelIfNeeded())}destroy(){if(!this._protected){this.stop();let t=this._head.next;for(;t;)t=t.destroy(!0);this._head.destroy(),this._head=null}}update(t=performance.now()){let e;if(t>this.lastTime){if(e=this.elapsedMS=t-this.lastTime,e>this._maxElapsedMS&&(e=this._maxElapsedMS),e*=this.speed,this._minElapsedMS){const n=t-this._lastFrame|0;if(n{const t=document.createElement("canvas").getContext("webgl");if(!t)return"premultiply-alpha-on-upload";const e=await new Promise(o=>{const a=document.createElement("video");a.onloadeddata=()=>o(a),a.onerror=()=>o(null),a.autoplay=!1,a.crossOrigin="anonymous",a.preload="auto",a.src="data:video/webm;base64,GkXfo59ChoEBQveBAULygQRC84EIQoKEd2VibUKHgQJChYECGFOAZwEAAAAAAAHTEU2bdLpNu4tTq4QVSalmU6yBoU27i1OrhBZUrmtTrIHGTbuMU6uEElTDZ1OsggEXTbuMU6uEHFO7a1OsggG97AEAAAAAAABZAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVSalmoCrXsYMPQkBNgIRMYXZmV0GETGF2ZkSJiEBEAAAAAAAAFlSua8yuAQAAAAAAAEPXgQFzxYgAAAAAAAAAAZyBACK1nIN1bmSIgQCGhVZfVlA5g4EBI+ODhAJiWgDglLCBArqBApqBAlPAgQFVsIRVuYEBElTDZ9Vzc9JjwItjxYgAAAAAAAAAAWfInEWjh0VOQ09ERVJEh49MYXZjIGxpYnZweC12cDlnyKJFo4hEVVJBVElPTkSHlDAwOjAwOjAwLjA0MDAwMDAwMAAAH0O2dcfngQCgwqGggQAAAIJJg0IAABAAFgA4JBwYSgAAICAAEb///4r+AAB1oZ2mm+6BAaWWgkmDQgAAEAAWADgkHBhKAAAgIABIQBxTu2uRu4+zgQC3iveBAfGCAXHwgQM=",a.load()});if(!e)return"premultiply-alpha-on-upload";const s=t.createTexture();t.bindTexture(t.TEXTURE_2D,s);const r=t.createFramebuffer();t.bindFramebuffer(t.FRAMEBUFFER,r),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,s,0),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),t.pixelStorei(t.UNPACK_COLORSPACE_CONVERSION_WEBGL,t.NONE),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,e);const n=new Uint8Array(4);return t.readPixels(0,0,1,1,t.RGBA,t.UNSIGNED_BYTE,n),t.deleteFramebuffer(r),t.deleteTexture(s),t.getExtension("WEBGL_lose_context")?.loseContext(),n[0]<=n[3]?"premultiplied-alpha":"premultiply-alpha-on-upload"})()),Ts}const cs=class Wr extends Ft{constructor(t){super(t),this.isReady=!1,this.uploadMethodId="video",t={...Wr.defaultOptions,...t},this._autoUpdate=!0,this._isConnectedToTicker=!1,this._updateFPS=t.updateFPS||0,this._msToNextUpdate=0,this.autoPlay=t.autoPlay!==!1,this.alphaMode=t.alphaMode??"premultiply-alpha-on-upload",this._videoFrameRequestCallback=this._videoFrameRequestCallback.bind(this),this._videoFrameRequestCallbackHandle=null,this._load=null,this._resolve=null,this._reject=null,this._onCanPlay=this._onCanPlay.bind(this),this._onCanPlayThrough=this._onCanPlayThrough.bind(this),this._onError=this._onError.bind(this),this._onPlayStart=this._onPlayStart.bind(this),this._onPlayStop=this._onPlayStop.bind(this),this._onSeeked=this._onSeeked.bind(this),t.autoLoad!==!1&&this.load()}updateFrame(){if(!this.destroyed){if(this._updateFPS){const t=Ze.shared.elapsedMS*this.resource.playbackRate;this._msToNextUpdate=Math.floor(this._msToNextUpdate-t)}(!this._updateFPS||this._msToNextUpdate<=0)&&(this._msToNextUpdate=this._updateFPS?Math.floor(1e3/this._updateFPS):0),this.isValid&&this.update()}}_videoFrameRequestCallback(){this.updateFrame(),this.destroyed?this._videoFrameRequestCallbackHandle=null:this._videoFrameRequestCallbackHandle=this.resource.requestVideoFrameCallback(this._videoFrameRequestCallback)}get isValid(){return!!this.resource.videoWidth&&!!this.resource.videoHeight}async load(){if(this._load)return this._load;const t=this.resource,e=this.options;return(t.readyState===t.HAVE_ENOUGH_DATA||t.readyState===t.HAVE_FUTURE_DATA)&&t.width&&t.height&&(t.complete=!0),t.addEventListener("play",this._onPlayStart),t.addEventListener("pause",this._onPlayStop),t.addEventListener("seeked",this._onSeeked),this._isSourceReady()?this._mediaReady():(e.preload||t.addEventListener("canplay",this._onCanPlay),t.addEventListener("canplaythrough",this._onCanPlayThrough),t.addEventListener("error",this._onError,!0)),this.alphaMode=await wa(),this._load=new Promise((s,r)=>{this.isValid?s(this):(this._resolve=s,this._reject=r,e.preloadTimeoutMs!==void 0&&(this._preloadTimeout=setTimeout(()=>{this._onError(new ErrorEvent(`Preload exceeded timeout of ${e.preloadTimeoutMs}ms`))})),t.load())}),this._load}_onError(t){this.resource.removeEventListener("error",this._onError,!0),this.emit("error",t),this._reject&&(this._reject(t),this._reject=null,this._resolve=null)}_isSourcePlaying(){const t=this.resource;return!t.paused&&!t.ended}_isSourceReady(){return this.resource.readyState>2}_onPlayStart(){this.isValid||this._mediaReady(),this._configureAutoUpdate()}_onPlayStop(){this._configureAutoUpdate()}_onSeeked(){this._autoUpdate&&!this._isSourcePlaying()&&(this._msToNextUpdate=0,this.updateFrame(),this._msToNextUpdate=0)}_onCanPlay(){this.resource.removeEventListener("canplay",this._onCanPlay),this._mediaReady()}_onCanPlayThrough(){this.resource.removeEventListener("canplaythrough",this._onCanPlay),this._preloadTimeout&&(clearTimeout(this._preloadTimeout),this._preloadTimeout=void 0),this._mediaReady()}_mediaReady(){const t=this.resource;this.isValid&&(this.isReady=!0,this.resize(t.videoWidth,t.videoHeight)),this._msToNextUpdate=0,this.updateFrame(),this._msToNextUpdate=0,this._resolve&&(this._resolve(this),this._resolve=null,this._reject=null),this._isSourcePlaying()?this._onPlayStart():this.autoPlay&&this.resource.play()}destroy(){this._configureAutoUpdate();const t=this.resource;t&&(t.removeEventListener("play",this._onPlayStart),t.removeEventListener("pause",this._onPlayStop),t.removeEventListener("seeked",this._onSeeked),t.removeEventListener("canplay",this._onCanPlay),t.removeEventListener("canplaythrough",this._onCanPlayThrough),t.removeEventListener("error",this._onError,!0),t.pause(),t.src="",t.load()),super.destroy()}get autoUpdate(){return this._autoUpdate}set autoUpdate(t){t!==this._autoUpdate&&(this._autoUpdate=t,this._configureAutoUpdate())}get updateFPS(){return this._updateFPS}set updateFPS(t){t!==this._updateFPS&&(this._updateFPS=t,this._configureAutoUpdate())}_configureAutoUpdate(){this._autoUpdate&&this._isSourcePlaying()?!this._updateFPS&&this.resource.requestVideoFrameCallback?(this._isConnectedToTicker&&(Ze.shared.remove(this.updateFrame,this),this._isConnectedToTicker=!1,this._msToNextUpdate=0),this._videoFrameRequestCallbackHandle===null&&(this._videoFrameRequestCallbackHandle=this.resource.requestVideoFrameCallback(this._videoFrameRequestCallback))):(this._videoFrameRequestCallbackHandle!==null&&(this.resource.cancelVideoFrameCallback(this._videoFrameRequestCallbackHandle),this._videoFrameRequestCallbackHandle=null),this._isConnectedToTicker||(Ze.shared.add(this.updateFrame,this),this._isConnectedToTicker=!0,this._msToNextUpdate=0)):(this._videoFrameRequestCallbackHandle!==null&&(this.resource.cancelVideoFrameCallback(this._videoFrameRequestCallbackHandle),this._videoFrameRequestCallbackHandle=null),this._isConnectedToTicker&&(Ze.shared.remove(this.updateFrame,this),this._isConnectedToTicker=!1,this._msToNextUpdate=0))}static test(t){return globalThis.HTMLVideoElement&&t instanceof HTMLVideoElement||globalThis.VideoFrame&&t instanceof VideoFrame}};cs.extension=Y.TextureSource;cs.defaultOptions={...Ft.defaultOptions,autoLoad:!0,autoPlay:!0,updateFPS:0,crossorigin:!0,loop:!1,muted:!0,playsinline:!0,preload:!1};cs.MIME_TYPES={ogv:"video/ogg",mov:"video/quicktime",m4v:"video/mp4"};let Ca=cs;const le=(i,t,e=!1)=>(Array.isArray(i)||(i=[i]),t?i.map(s=>typeof s=="string"||e?t(s):s):i);class Aa{constructor(){this._parsers=[],this._cache=new Map,this._cacheMap=new Map}reset(){this._cacheMap.clear(),this._cache.clear()}has(t){return this._cache.has(t)}get(t){const e=this._cache.get(t);return e||Rt(`[Assets] Asset id ${t} was not found in the Cache`),e}set(t,e){const s=le(t);let r;for(let l=0;l{n.set(l,e)});const o=[...n.keys()],a={cacheKeys:o,keys:s};s.forEach(l=>{this._cacheMap.set(l,a)}),o.forEach(l=>{const u=r?r[l]:e;this._cache.has(l)&&this._cache.get(l)!==u&&Rt("[Cache] already has key:",l),this._cache.set(l,n.get(l))})}remove(t){if(!this._cacheMap.has(t)){Rt(`[Assets] Asset id ${t} was not found in the Cache`);return}const e=this._cacheMap.get(t);e.cacheKeys.forEach(r=>{this._cache.delete(r)}),e.keys.forEach(r=>{this._cacheMap.delete(r)})}get parsers(){return this._parsers}}let qs;he=new Aa;qs=[];Tt.handleByList(Y.TextureSource,qs);function qr(i={}){const t=i&&i.resource,e=t?i.resource:i,s=t?i:{resource:i};for(let r=0;r{he.has(s)&&he.remove(s)}),t||he.set(s,n),n}function Ma(i,t=!1){return typeof i=="string"?he.get(i):i instanceof Ft?new W({source:i}):Sa(i,t)}W.from=Ma;Ft.from=qr;Tt.add(Or,zr,Hr,Ca,ui,Yr,li);var jr=(i=>(i[i.Low=0]="Low",i[i.Normal=1]="Normal",i[i.High=2]="High",i))(jr||{});function Ct(i){if(typeof i!="string")throw new TypeError(`Path must be a string. Received ${JSON.stringify(i)}`)}function be(i){return i.split("?")[0].split("#")[0]}function ka(i){return i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Pa(i,t,e){return i.replace(new RegExp(ka(t),"g"),e)}function Ta(i,t){let e="",s=0,r=-1,n=0,o=-1;for(let a=0;a<=i.length;++a){if(a2){const l=e.lastIndexOf("/");if(l!==e.length-1){l===-1?(e="",s=0):(e=e.slice(0,l),s=e.length-1-e.lastIndexOf("/")),r=a,n=0;continue}}else if(e.length===2||e.length===1){e="",s=0,r=a,n=0;continue}}}else e.length>0?e+=`/${i.slice(r+1,a)}`:e=i.slice(r+1,a),s=a-r-1;r=a,n=0}else o===46&&n!==-1?++n:n=-1}return e}const Fe={toPosix(i){return Pa(i,"\\","/")},isUrl(i){return/^https?:/.test(this.toPosix(i))},isDataUrl(i){return/^data:([a-z]+\/[a-z0-9-+.]+(;[a-z0-9-.!#$%*+.{}|~`]+=[a-z0-9-.!#$%*+.{}()_|~`]+)*)?(;base64)?,([a-z0-9!$&',()*+;=\-._~:@\/?%\s<>]*?)$/i.test(i)},isBlobUrl(i){return i.startsWith("blob:")},hasProtocol(i){return/^[^/:]+:/.test(this.toPosix(i))},getProtocol(i){Ct(i),i=this.toPosix(i);const t=/^file:\/\/\//.exec(i);if(t)return t[0];const e=/^[^/:]+:\/{0,2}/.exec(i);return e?e[0]:""},toAbsolute(i,t,e){if(Ct(i),this.isDataUrl(i)||this.isBlobUrl(i))return i;const s=be(this.toPosix(t??Nt.get().getBaseUrl())),r=be(this.toPosix(e??this.rootname(s)));return i=this.toPosix(i),i.startsWith("/")?Fe.join(r,i.slice(1)):this.isAbsolute(i)?i:this.join(s,i)},normalize(i){if(Ct(i),i.length===0)return".";if(this.isDataUrl(i)||this.isBlobUrl(i))return i;i=this.toPosix(i);let t="";const e=i.startsWith("/");this.hasProtocol(i)&&(t=this.rootname(i),i=i.slice(t.length));const s=i.endsWith("/");return i=Ta(i),i.length>0&&s&&(i+="/"),e?`/${i}`:t+i},isAbsolute(i){return Ct(i),i=this.toPosix(i),this.hasProtocol(i)?!0:i.startsWith("/")},join(...i){if(i.length===0)return".";let t;for(let e=0;e0)if(t===void 0)t=s;else{const r=i[e-1]??"";this.joinExtensions.includes(this.extname(r).toLowerCase())?t+=`/../${s}`:t+=`/${s}`}}return t===void 0?".":this.normalize(t)},dirname(i){if(Ct(i),i.length===0)return".";i=this.toPosix(i);let t=i.charCodeAt(0);const e=t===47;let s=-1,r=!0;const n=this.getProtocol(i),o=i;i=i.slice(n.length);for(let a=i.length-1;a>=1;--a)if(t=i.charCodeAt(a),t===47){if(!r){s=a;break}}else r=!1;return s===-1?e?"/":this.isUrl(o)?n+i:n:e&&s===1?"//":n+i.slice(0,s)},rootname(i){Ct(i),i=this.toPosix(i);let t="";if(i.startsWith("/")?t="/":t=this.getProtocol(i),this.isUrl(i)){const e=i.indexOf("/",t.length);e!==-1?t=i.slice(0,e):t=i,t.endsWith("/")||(t+="/")}return t},basename(i,t){Ct(i),t&&Ct(t),i=be(this.toPosix(i));let e=0,s=-1,r=!0,n;if(t!==void 0&&t.length>0&&t.length<=i.length){if(t.length===i.length&&t===i)return"";let o=t.length-1,a=-1;for(n=i.length-1;n>=0;--n){const l=i.charCodeAt(n);if(l===47){if(!r){e=n+1;break}}else a===-1&&(r=!1,a=n+1),o>=0&&(l===t.charCodeAt(o)?--o===-1&&(s=n):(o=-1,s=a))}return e===s?s=a:s===-1&&(s=i.length),i.slice(e,s)}for(n=i.length-1;n>=0;--n)if(i.charCodeAt(n)===47){if(!r){e=n+1;break}}else s===-1&&(r=!1,s=n+1);return s===-1?"":i.slice(e,s)},extname(i){Ct(i),i=be(this.toPosix(i));let t=-1,e=0,s=-1,r=!0,n=0;for(let o=i.length-1;o>=0;--o){const a=i.charCodeAt(o);if(a===47){if(!r){e=o+1;break}continue}s===-1&&(r=!1,s=o+1),a===46?t===-1?t=o:n!==1&&(n=1):t!==-1&&(n=-1)}return t===-1||s===-1||n===0||n===1&&t===s-1&&t===e+1?"":i.slice(t,s)},parse(i){Ct(i);const t={root:"",dir:"",base:"",ext:"",name:""};if(i.length===0)return t;i=be(this.toPosix(i));let e=i.charCodeAt(0);const s=this.isAbsolute(i);let r;t.root=this.rootname(i),s||this.hasProtocol(i)?r=1:r=0;let n=-1,o=0,a=-1,l=!0,u=i.length-1,h=0;for(;u>=r;--u){if(e=i.charCodeAt(u),e===47){if(!l){o=u+1;break}continue}a===-1&&(l=!1,a=u+1),e===46?n===-1?n=u:h!==1&&(h=1):n!==-1&&(h=-1)}return n===-1||a===-1||h===0||h===1&&n===a-1&&n===o+1?a!==-1&&(o===0&&s?t.base=t.name=i.slice(1,a):t.base=t.name=i.slice(o,a)):(o===0&&s?(t.name=i.slice(1,n),t.base=i.slice(1,a)):(t.name=i.slice(o,n),t.base=i.slice(o,a)),t.ext=i.slice(n,a)),t.dir=this.dirname(i),t},sep:"/",delimiter:":",joinExtensions:[".html"]};function Kr(i,t,e,s,r){const n=t[e];for(let o=0;o{const o=n.substring(1,n.length-1).split(",");r.push(o)}),Kr(i,r,0,e,s)}else s.push(i);return s}const Yi=i=>!Array.isArray(i);class Zr{constructor(){this._defaultBundleIdentifierOptions={connector:"-",createBundleAssetId:(t,e)=>`${t}${this._bundleIdConnector}${e}`,extractAssetIdFromBundle:(t,e)=>e.replace(`${t}${this._bundleIdConnector}`,"")},this._bundleIdConnector=this._defaultBundleIdentifierOptions.connector,this._createBundleAssetId=this._defaultBundleIdentifierOptions.createBundleAssetId,this._extractAssetIdFromBundle=this._defaultBundleIdentifierOptions.extractAssetIdFromBundle,this._assetMap={},this._preferredOrder=[],this._parsers=[],this._resolverHash={},this._bundles={}}setBundleIdentifier(t){if(this._bundleIdConnector=t.connector??this._bundleIdConnector,this._createBundleAssetId=t.createBundleAssetId??this._createBundleAssetId,this._extractAssetIdFromBundle=t.extractAssetIdFromBundle??this._extractAssetIdFromBundle,this._extractAssetIdFromBundle("foo",this._createBundleAssetId("foo","bar"))!=="bar")throw new Error("[Resolver] GenerateBundleAssetId are not working correctly")}prefer(...t){t.forEach(e=>{this._preferredOrder.push(e),e.priority||(e.priority=Object.keys(e.params))}),this._resolverHash={}}set basePath(t){this._basePath=t}get basePath(){return this._basePath}set rootPath(t){this._rootPath=t}get rootPath(){return this._rootPath}get parsers(){return this._parsers}reset(){this.setBundleIdentifier(this._defaultBundleIdentifierOptions),this._assetMap={},this._preferredOrder=[],this._resolverHash={},this._rootPath=null,this._basePath=null,this._manifest=null,this._bundles={},this._defaultSearchParams=null}setDefaultSearchParams(t){if(typeof t=="string")this._defaultSearchParams=t;else{const e=t;this._defaultSearchParams=Object.keys(e).map(s=>`${encodeURIComponent(s)}=${encodeURIComponent(e[s])}`).join("&")}}getAlias(t){const{alias:e,src:s}=t;return le(e||s,n=>typeof n=="string"?n:Array.isArray(n)?n.map(o=>o?.src??o):n?.src?n.src:n,!0)}addManifest(t){this._manifest&&Rt("[Resolver] Manifest already exists, this will be overwritten"),this._manifest=t,t.bundles.forEach(e=>{this.addBundle(e.name,e.assets)})}addBundle(t,e){const s=[];let r=e;Array.isArray(e)||(r=Object.entries(e).map(([n,o])=>typeof o=="string"||Array.isArray(o)?{alias:n,src:o}:{alias:n,...o})),r.forEach(n=>{const o=n.src,a=n.alias;let l;if(typeof a=="string"){const u=this._createBundleAssetId(t,a);s.push(u),l=[a,u]}else{const u=a.map(h=>this._createBundleAssetId(t,h));s.push(...u),l=[...a,...u]}this.add({...n,alias:l,src:o})}),this._bundles[t]=s}add(t){const e=[];Array.isArray(t)?e.push(...t):e.push(t);let s;s=n=>{this.hasKey(n)&&Rt(`[Resolver] already has key: ${n} overwriting`)},le(e).forEach(n=>{const{src:o}=n;let{data:a,format:l,loadParser:u}=n;const h=le(o).map(m=>typeof m=="string"?Ia(m):Array.isArray(m)?m:[m]),c=this.getAlias(n);Array.isArray(c)?c.forEach(s):s(c);const d=[];h.forEach(m=>{m.forEach(p=>{let _={};if(typeof p!="object"){_.src=p;for(let f=0;f{this._assetMap[m]=d})})}resolveBundle(t){const e=Yi(t);t=le(t);const s={};return t.forEach(r=>{const n=this._bundles[r];if(n){const o=this.resolve(n),a={};for(const l in o){const u=o[l];a[this._extractAssetIdFromBundle(r,l)]=u}s[r]=a}}),e?s[t[0]]:s}resolveUrl(t){const e=this.resolve(t);if(typeof t!="string"){const s={};for(const r in e)s[r]=e[r].src;return s}return e.src}resolve(t){const e=Yi(t);t=le(t);const s={};return t.forEach(r=>{if(!this._resolverHash[r])if(this._assetMap[r]){let n=this._assetMap[r];const o=this._getPreferredOrder(n);o?.priority.forEach(a=>{o.params[a].forEach(l=>{const u=n.filter(h=>h[a]?h[a]===l:!1);u.length&&(n=u)})}),this._resolverHash[r]=n[0]}else this._resolverHash[r]=this._buildResolvedAsset({alias:[r],src:r},{});s[r]=this._resolverHash[r]}),e?s[t[0]]:s}hasKey(t){return!!this._assetMap[t]}hasBundle(t){return!!this._bundles[t]}_getPreferredOrder(t){for(let e=0;en.params.format.includes(s.format));if(r)return r}return this._preferredOrder[0]}_appendDefaultSearchParams(t){if(!this._defaultSearchParams)return t;const e=/\?/.test(t)?"&":"?";return`${t}${e}${this._defaultSearchParams}`}_buildResolvedAsset(t,e){const{aliases:s,data:r,loadParser:n,format:o}=e;return(this._basePath||this._rootPath)&&(t.src=Fe.toAbsolute(t.src,this._basePath,this._rootPath)),t.alias=s??t.alias??[t.src],t.src=this._appendDefaultSearchParams(t.src),t.data={...r||{},...t.data},t.loadParser=n??t.loadParser,t.format=o??t.format??Ea(t.src),t}}Zr.RETINA_PREFIX=/@([0-9\.]+)x/;function Ea(i){return i.split(".").pop().split("?").shift().split("#").shift()}const Xi=(i,t)=>{const e=t.split("?")[1];return e&&(i+=`?${e}`),i},Qr=class Me{constructor(t,e){this.linkedSheets=[],this._texture=t instanceof W?t:null,this.textureSource=t.source,this.textures={},this.animations={},this.data=e;const s=parseFloat(e.meta.scale);s?(this.resolution=s,t.source.resolution=this.resolution):this.resolution=t.source._resolution,this._frames=this.data.frames,this._frameKeys=Object.keys(this._frames),this._batchIndex=0,this._callback=null}parse(){return new Promise(t=>{this._callback=t,this._batchIndex=0,this._frameKeys.length<=Me.BATCH_SIZE?(this._processFrames(0),this._processAnimations(),this._parseComplete()):this._nextBatch()})}_processFrames(t){let e=t;const s=Me.BATCH_SIZE;for(;e-t{this._batchIndex*Me.BATCH_SIZE{s[r]=t}),Object.keys(t.textures).forEach(r=>{s[r]=t.textures[r]}),!e){const r=Fe.dirname(i[0]);t.linkedSheets.forEach((n,o)=>{const a=Jr([`${r}/${t.data.meta.related_multi_packs[o]}`],n,!0);Object.assign(s,a)})}return s}const Da={extension:Y.Asset,cache:{test:i=>i instanceof Wi,getCacheableAssets:(i,t)=>Jr(i,t,!1)},resolver:{extension:{type:Y.ResolveParser,name:"resolveSpritesheet"},test:i=>{const e=i.split("?")[0].split("."),s=e.pop(),r=e.pop();return s==="json"&&Ra.includes(r)},parse:i=>{const t=i.split(".");return{resolution:parseFloat(Zr.RETINA_PREFIX.exec(i)?.[1]??"1"),format:t[t.length-2],src:i}}},loader:{name:"spritesheetLoader",extension:{type:Y.LoadParser,priority:jr.Normal,name:"spritesheetLoader"},async testParse(i,t){return Fe.extname(t.src).toLowerCase()===".json"&&!!i.frames},async parse(i,t,e){const{texture:s,imageFilename:r}=t?.data??{};let n=Fe.dirname(t.src);n&&n.lastIndexOf("/")!==n.length-1&&(n+="/");let o;if(s instanceof W)o=s;else{const u=Xi(n+(r??i.meta.image),t.src);o=(await e.load([u]))[u]}const a=new Wi(o.source,i);await a.parse();const l=i?.meta?.related_multi_packs;if(Array.isArray(l)){const u=[];for(const c of l){if(typeof c!="string")continue;let d=n+c;t.data?.ignoreMultiPack||(d=Xi(d,t.src),u.push(e.load({src:d,data:{ignoreMultiPack:!0}})))}const h=await Promise.all(u);a.linkedSheets=h,h.forEach(c=>{c.linkedSheets=[a].concat(a.linkedSheets.filter(d=>d!==c))})}return a},async unload(i,t,e){await e.unload(i.textureSource._sourceOrigin),i.destroy(!1)}}};Tt.add(Da);let Qe;Ba=function(){return(!Qe||Qe?.isContextLost())&&(Qe=Nt.get().createCanvas().getContext("webgl",{})),Qe};Fa=class{constructor(t){this.resources=Object.create(null),this._dirty=!0;let e=0;for(const s in t){const r=t[s];this.setResource(r,e++)}this._updateKey()}_updateKey(){if(!this._dirty)return;this._dirty=!1;const t=[];let e=0;for(const s in this.resources)t[e++]=this.resources[s]._resourceId;this._key=t.join("|")}setResource(t,e){const s=this.resources[e];t!==s&&(s&&t.off?.("change",this.onResourceChange,this),t.on?.("change",this.onResourceChange,this),this.resources[e]=t,this._dirty=!0)}getResource(t){return this.resources[t]}_touch(t){const e=this.resources;for(const s in e)e[s]._touched=t}destroy(){const t=this.resources;for(const e in t)t[e].off?.("change",this.onResourceChange,this);this.resources=null}onResourceChange(t){if(this._dirty=!0,t.destroyed){const e=this.resources;for(const s in e)e[s]===t&&(e[s]=null)}else this._updateKey()}};const js=[];Tt.handleByNamedList(Y.Environment,js);async function $a(i){if(!i)for(let t=0;t80*e){a=u=i[0],l=h=i[1];for(var p=e;pu&&(u=c),d>h&&(h=d);m=Math.max(u-a,h-l),m=m!==0?32767/m:0}return $e(n,o,e,a,l,m,0),o}function tn(i,t,e,s,r){var n,o;if(r===Qs(i,t,e,s)>0)for(n=t;n=t;n-=s)o=qi(n,i[n],i[n+1],o);return o&&fs(o,o.next)&&(Ge(o),o=o.next),o}function te(i,t){if(!i)return i;t||(t=i);var e=i,s;do if(s=!1,!e.steiner&&(fs(e,e.next)||Z(e.prev,e,e.next)===0)){if(Ge(e),e=t=e.prev,e===e.next)break;s=!0}else e=e.next;while(s||e!==t);return t}function $e(i,t,e,s,r,n,o){if(i){!o&&n&&Wa(i,s,r,n);for(var a=i,l,u;i.prev!==i.next;){if(l=i.prev,u=i.next,n?Na(i,s,r,n):Ga(i)){t.push(l.i/e|0),t.push(i.i/e|0),t.push(u.i/e|0),Ge(i),i=u.next,a=u.next;continue}if(i=u,i===a){o?o===1?(i=La(te(i),t,e),$e(i,t,e,s,r,n,2)):o===2&&Ua(i,t,e,s,r,n):$e(te(i),t,e,s,r,n,1);break}}}}function Ga(i){var t=i.prev,e=i,s=i.next;if(Z(t,e,s)>=0)return!1;for(var r=t.x,n=e.x,o=s.x,a=t.y,l=e.y,u=s.y,h=rn?r>o?r:o:n>o?n:o,m=a>l?a>u?a:u:l>u?l:u,p=s.next;p!==t;){if(p.x>=h&&p.x<=d&&p.y>=c&&p.y<=m&&ue(r,a,n,l,o,u,p.x,p.y)&&Z(p.prev,p,p.next)>=0)return!1;p=p.next}return!0}function Na(i,t,e,s){var r=i.prev,n=i,o=i.next;if(Z(r,n,o)>=0)return!1;for(var a=r.x,l=n.x,u=o.x,h=r.y,c=n.y,d=o.y,m=al?a>u?a:u:l>u?l:u,f=h>c?h>d?h:d:c>d?c:d,v=Ks(m,p,t,e,s),y=Ks(_,f,t,e,s),b=i.prevZ,w=i.nextZ;b&&b.z>=v&&w&&w.z<=y;){if(b.x>=m&&b.x<=_&&b.y>=p&&b.y<=f&&b!==r&&b!==o&&ue(a,h,l,c,u,d,b.x,b.y)&&Z(b.prev,b,b.next)>=0||(b=b.prevZ,w.x>=m&&w.x<=_&&w.y>=p&&w.y<=f&&w!==r&&w!==o&&ue(a,h,l,c,u,d,w.x,w.y)&&Z(w.prev,w,w.next)>=0))return!1;w=w.nextZ}for(;b&&b.z>=v;){if(b.x>=m&&b.x<=_&&b.y>=p&&b.y<=f&&b!==r&&b!==o&&ue(a,h,l,c,u,d,b.x,b.y)&&Z(b.prev,b,b.next)>=0)return!1;b=b.prevZ}for(;w&&w.z<=y;){if(w.x>=m&&w.x<=_&&w.y>=p&&w.y<=f&&w!==r&&w!==o&&ue(a,h,l,c,u,d,w.x,w.y)&&Z(w.prev,w,w.next)>=0)return!1;w=w.nextZ}return!0}function La(i,t,e){var s=i;do{var r=s.prev,n=s.next.next;!fs(r,n)&&en(r,s,s.next,n)&&Ve(r,n)&&Ve(n,r)&&(t.push(r.i/e|0),t.push(s.i/e|0),t.push(n.i/e|0),Ge(s),Ge(s.next),s=i=n),s=s.next}while(s!==i);return te(s)}function Ua(i,t,e,s,r,n){var o=i;do{for(var a=o.next.next;a!==o.prev;){if(o.i!==a.i&&Ka(o,a)){var l=sn(o,a);o=te(o,o.next),l=te(l,l.next),$e(o,t,e,s,r,n,0),$e(l,t,e,s,r,n,0);return}a=a.next}o=o.next}while(o!==i)}function Oa(i,t,e,s){var r=[],n,o,a,l,u;for(n=0,o=t.length;n=e.next.y&&e.next.y!==e.y){var a=e.x+(r-e.y)*(e.next.x-e.x)/(e.next.y-e.y);if(a<=s&&a>n&&(n=a,o=e.x=e.x&&e.x>=u&&s!==e.x&&ue(ro.x||e.x===o.x&&Xa(o,e)))&&(o=e,c=d)),e=e.next;while(e!==l);return o}function Xa(i,t){return Z(i.prev,i,t.prev)<0&&Z(t.next,i,i.next)<0}function Wa(i,t,e,s){var r=i;do r.z===0&&(r.z=Ks(r.x,r.y,t,e,s)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next;while(r!==i);r.prevZ.nextZ=null,r.prevZ=null,qa(r)}function qa(i){var t,e,s,r,n,o,a,l,u=1;do{for(e=i,i=null,n=null,o=0;e;){for(o++,s=e,a=0,t=0;t0||l>0&&s;)a!==0&&(l===0||!s||e.z<=s.z)?(r=e,e=e.nextZ,a--):(r=s,s=s.nextZ,l--),n?n.nextZ=r:i=r,r.prevZ=n,n=r;e=s}n.nextZ=null,u*=2}while(o>1);return i}function Ks(i,t,e,s,r){return i=(i-e)*r|0,t=(t-s)*r|0,i=(i|i<<8)&16711935,i=(i|i<<4)&252645135,i=(i|i<<2)&858993459,i=(i|i<<1)&1431655765,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,i|t<<1}function ja(i){var t=i,e=i;do(t.x=(i-o)*(n-a)&&(i-o)*(s-a)>=(e-o)*(t-a)&&(e-o)*(n-a)>=(r-o)*(s-a)}function Ka(i,t){return i.next.i!==t.i&&i.prev.i!==t.i&&!Za(i,t)&&(Ve(i,t)&&Ve(t,i)&&Qa(i,t)&&(Z(i.prev,i,t.prev)||Z(i,t.prev,t))||fs(i,t)&&Z(i.prev,i,i.next)>0&&Z(t.prev,t,t.next)>0)}function Z(i,t,e){return(t.y-i.y)*(e.x-t.x)-(t.x-i.x)*(e.y-t.y)}function fs(i,t){return i.x===t.x&&i.y===t.y}function en(i,t,e,s){var r=ts(Z(i,t,e)),n=ts(Z(i,t,s)),o=ts(Z(e,s,i)),a=ts(Z(e,s,t));return!!(r!==n&&o!==a||r===0&&Je(i,e,t)||n===0&&Je(i,s,t)||o===0&&Je(e,i,s)||a===0&&Je(e,t,s))}function Je(i,t,e){return t.x<=Math.max(i.x,e.x)&&t.x>=Math.min(i.x,e.x)&&t.y<=Math.max(i.y,e.y)&&t.y>=Math.min(i.y,e.y)}function ts(i){return i>0?1:i<0?-1:0}function Za(i,t){var e=i;do{if(e.i!==i.i&&e.next.i!==i.i&&e.i!==t.i&&e.next.i!==t.i&&en(e,e.next,i,t))return!0;e=e.next}while(e!==i);return!1}function Ve(i,t){return Z(i.prev,i,i.next)<0?Z(i,t,i.next)>=0&&Z(i,i.prev,t)>=0:Z(i,t,i.prev)<0||Z(i,i.next,t)<0}function Qa(i,t){var e=i,s=!1,r=(i.x+t.x)/2,n=(i.y+t.y)/2;do e.y>n!=e.next.y>n&&e.next.y!==e.y&&r<(e.next.x-e.x)*(n-e.y)/(e.next.y-e.y)+e.x&&(s=!s),e=e.next;while(e!==i);return s}function sn(i,t){var e=new Zs(i.i,i.x,i.y),s=new Zs(t.i,t.x,t.y),r=i.next,n=t.prev;return i.next=t,t.prev=i,e.next=r,r.prev=e,s.next=e,e.prev=s,n.next=s,s.prev=n,s}function qi(i,t,e,s){var r=new Zs(i,t,e);return s?(r.next=s.next,r.prev=s,s.next.prev=r,s.next=r):(r.prev=r,r.next=r),r}function Ge(i){i.next.prev=i.prev,i.prev.next=i.next,i.prevZ&&(i.prevZ.nextZ=i.nextZ),i.nextZ&&(i.nextZ.prevZ=i.prevZ)}function Zs(i,t,e){this.i=i,this.x=t,this.y=e,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}ds.deviation=function(i,t,e,s){var r=t&&t.length,n=r?t[0]*e:i.length,o=Math.abs(Qs(i,0,n,e));if(r)for(var a=0,l=t.length;a0&&(s+=i[r-1].length,e.holes.push(s))}return e};var Ja=ci.exports;const tl=oi(Ja);rn=(i=>(i[i.NONE=0]="NONE",i[i.COLOR=16384]="COLOR",i[i.STENCIL=1024]="STENCIL",i[i.DEPTH=256]="DEPTH",i[i.COLOR_DEPTH=16640]="COLOR_DEPTH",i[i.COLOR_STENCIL=17408]="COLOR_STENCIL",i[i.DEPTH_STENCIL=1280]="DEPTH_STENCIL",i[i.ALL=17664]="ALL",i))(rn||{});el=class{constructor(t){this.items=[],this._name=t}emit(t,e,s,r,n,o,a,l){const{name:u,items:h}=this;for(let c=0,d=h.length;c{this.runners[e]=new el(e)})}_addSystems(t){let e;for(e in t){const s=t[e];this._addSystem(s.value,s.name)}}_addSystem(t,e){const s=new t(this);if(this[e])throw new Error(`Whoops! The name "${e}" is already in use`);this[e]=s,this._systemsHash[e]=s;for(const r in this.runners)this.runners[r].add(s);return this}_addPipes(t,e){const s=e.reduce((r,n)=>(r[n.name]=n.value,r),{});t.forEach(r=>{const n=r.value,o=r.name,a=s[o];this.renderPipes[o]=new n(this,a?new a:null)})}destroy(t=!1){this.runners.destroy.items.reverse(),this.runners.destroy.emit(t),Object.values(this.runners).forEach(e=>{e.destroy()}),this._systemsHash=null,this.renderPipes=null}generateTexture(t){return this.textureGenerator.generateTexture(t)}get roundPixels(){return!!this._roundPixels}_unsafeEvalCheck(){if(!Va())throw new Error("Current environment does not allow unsafe-eval, please use pixi.js/unsafe-eval module to enable support.")}};nn.defaultOptions={resolution:1,failIfMajorPerformanceCaveat:!1,roundPixels:!1};let es;an=nn;function il(i){return es!==void 0||(es=(()=>{const t={stencil:!0,failIfMajorPerformanceCaveat:i??an.defaultOptions.failIfMajorPerformanceCaveat};try{if(!Nt.get().getWebGLRenderingContext())return!1;let s=Nt.get().createCanvas().getContext("webgl",t);const r=!!s?.getContextAttributes()?.stencil;if(s){const n=s.getExtension("WEBGL_lose_context");n&&n.loseContext()}return s=null,r}catch{return!1}})()),es}let ss;async function rl(i={}){return ss!==void 0||(ss=await (async()=>{if(!Nt.get().getNavigator().gpu)return!1;try{return await (await navigator.gpu.requestAdapter(i)).requestDevice(),!0}catch{return!1}})()),ss}const ji=["webgl","webgpu","canvas"];async function nl(i){let t=[];i.preference?(t.push(i.preference),ji.forEach(n=>{n!==i.preference&&t.push(n)})):t=ji.slice();let e,s={};for(let n=0;n{const{WebGPURenderer:l}=await import("./WebGPURenderer-I-StTdCm.js").then(async m=>{await m.__tla;return m});return{WebGPURenderer:l}},__vite__mapDeps([13,2,14,3,5,6,7,8,9,10,11,12]),import.meta.url);e=a,s={...i,...i.webgpu};break}else if(o==="webgl"&&il(i.failIfMajorPerformanceCaveat??an.defaultOptions.failIfMajorPerformanceCaveat)){const{WebGLRenderer:a}=await os(async()=>{const{WebGLRenderer:l}=await import("./WebGLRenderer-CaSwjYL2.js").then(async m=>{await m.__tla;return m});return{WebGLRenderer:l}},__vite__mapDeps([15,2,4,14,5,6,7,8,9,10,11,12]),import.meta.url);e=a,s={...i,...i.webgl};break}else if(o==="canvas")throw s={...i},new Error("CanvasRenderer is not yet implemented")}if(delete s.webgpu,delete s.webgl,!e)throw new Error("No available renderer for the current environment");const r=new e;return await r.init(s),r}class ln{static init(){globalThis.__PIXI_APP_INIT__?.(this)}static destroy(){}}ln.extension=Y.Application;ol=class{constructor(t){this._renderer=t}init(){globalThis.__PIXI_RENDERER_INIT__?.(this._renderer)}destroy(){this._renderer=null}};ol.extension={type:[Y.WebGLSystem,Y.WebGPUSystem],name:"initHook",priority:-10};const hn=class Js{constructor(...t){this.stage=new pt,t[0]!==void 0&&et(tt,"Application constructor options are deprecated, please use Application.init() instead.")}async init(t){t={...t},this.renderer=await nl(t),Js._plugins.forEach(e=>{e.init.call(this,t)})}render(){this.renderer.render({container:this.stage})}get canvas(){return this.renderer.canvas}get view(){return et(tt,"Application.view is deprecated, please use Application.canvas instead."),this.renderer.canvas}get screen(){return this.renderer.screen}destroy(t=!1,e=!1){const s=Js._plugins.slice(0);s.reverse(),s.forEach(r=>{r.destroy.call(this)}),this.stage.destroy(e),this.stage=null,this.renderer.destroy(t),this.renderer=null}};hn._plugins=[];let un=hn;Tt.handleByList(Y.Application,un._plugins);Tt.add(ln);const cn=class ti{constructor(t,e,s,r){this.uid=at("fillGradient"),this.type="linear",this.gradientStops=[],this._styleKey=null,this.x0=t,this.y0=e,this.x1=s,this.y1=r}addColorStop(t,e){return this.gradientStops.push({offset:t,color:xt.shared.setValue(e).toHex()}),this._styleKey=null,this}buildLinearGradient(){const t=ti.defaultTextureSize,{gradientStops:e}=this,s=Nt.get().createCanvas();s.width=t,s.height=t;const r=s.getContext("2d"),n=r.createLinearGradient(0,0,ti.defaultTextureSize,1);for(let _=0;_`${r.offset}-${r.color}`).join("-"),e=this.texture.uid,s=this.transform.toArray().join("-");return`fill-gradient-${this.uid}-${t}-${e}-${s}-${this.x0}-${this.y0}-${this.x1}-${this.y1}`}};cn.defaultTextureSize=256;al=cn;const Ki={repeat:{addressModeU:"repeat",addressModeV:"repeat"},"repeat-x":{addressModeU:"repeat",addressModeV:"clamp-to-edge"},"repeat-y":{addressModeU:"clamp-to-edge",addressModeV:"repeat"},"no-repeat":{addressModeU:"clamp-to-edge",addressModeV:"clamp-to-edge"}};ll=class{constructor(t,e){this.uid=at("fillPattern"),this.transform=new H,this._styleKey=null,this.texture=t,this.transform.scale(1/t.frame.width,1/t.frame.height),e&&(t.source.style.addressModeU=Ki[e].addressModeU,t.source.style.addressModeV=Ki[e].addressModeV)}setTransform(t){const e=this.texture;this.transform.copyFrom(t),this.transform.invert(),this.transform.scale(1/e.frame.width,1/e.frame.height),this._styleKey=null}get styleKey(){return this._styleKey?this._styleKey:(this._styleKey=`fill-pattern-${this.uid}-${this.texture.uid}-${this.transform.toArray().join("-")}`,this._styleKey)}};var hl=cl,Is={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},ul=/([astvzqmhlc])([^astvzqmhlc]*)/ig;function cl(i){var t=[];return i.replace(ul,function(e,s,r){var n=s.toLowerCase();for(r=fl(r),n=="m"&&r.length>2&&(t.push([s].concat(r.splice(0,2))),n="l",s=s=="m"?"l":"L");;){if(r.length==Is[n])return r.unshift(s),t.push(r);if(r.length0&&(r=s.pop(),r?(n=r.startX,o=r.startY):(n=0,o=0)),r=null;break;default:Rt(`Unknown SVG path command: ${u}`)}u!=="Z"&&u!=="z"&&r===null&&(r={startX:n,startY:o},s.push(r))}return t}class di{constructor(t=0,e=0,s=0){this.type="circle",this.x=t,this.y=e,this.radius=s}clone(){return new di(this.x,this.y,this.radius)}contains(t,e){if(this.radius<=0)return!1;const s=this.radius*this.radius;let r=this.x-t,n=this.y-e;return r*=r,n*=n,r+n<=s}strokeContains(t,e,s){if(this.radius===0)return!1;const r=this.x-t,n=this.y-e,o=this.radius,a=s/2,l=Math.sqrt(r*r+n*n);return lo-a}getBounds(t){return t=t||new ot,t.x=this.x-this.radius,t.y=this.y-this.radius,t.width=this.radius*2,t.height=this.radius*2,t}copyFrom(t){return this.x=t.x,this.y=t.y,this.radius=t.radius,this}copyTo(t){return t.copyFrom(this),t}toString(){return`[pixi.js/math:Circle x=${this.x} y=${this.y} radius=${this.radius}]`}}class fi{constructor(t=0,e=0,s=0,r=0){this.type="ellipse",this.x=t,this.y=e,this.halfWidth=s,this.halfHeight=r}clone(){return new fi(this.x,this.y,this.halfWidth,this.halfHeight)}contains(t,e){if(this.halfWidth<=0||this.halfHeight<=0)return!1;let s=(t-this.x)/this.halfWidth,r=(e-this.y)/this.halfHeight;return s*=s,r*=r,s+r<=1}strokeContains(t,e,s){const{halfWidth:r,halfHeight:n}=this;if(r<=0||n<=0)return!1;const o=s/2,a=r-o,l=n-o,u=r+o,h=n+o,c=t-this.x,d=e-this.y,m=c*c/(a*a)+d*d/(l*l),p=c*c/(u*u)+d*d/(h*h);return m>1&&p<=1}getBounds(){return new ot(this.x-this.halfWidth,this.y-this.halfHeight,this.halfWidth*2,this.halfHeight*2)}copyFrom(t){return this.x=t.x,this.y=t.y,this.halfWidth=t.halfWidth,this.halfHeight=t.halfHeight,this}copyTo(t){return t.copyFrom(this),t}toString(){return`[pixi.js/math:Ellipse x=${this.x} y=${this.y} halfWidth=${this.halfWidth} halfHeight=${this.halfHeight}]`}}function _l(i,t,e,s,r,n){const o=i-e,a=t-s,l=r-e,u=n-s,h=o*l+a*u,c=l*l+u*u;let d=-1;c!==0&&(d=h/c);let m,p;d<0?(m=e,p=s):d>1?(m=r,p=n):(m=e+d*l,p=s+d*u);const _=i-m,f=t-p;return _*_+f*f}class Te{constructor(...t){this.type="polygon";let e=Array.isArray(t[0])?t[0]:t;if(typeof e[0]!="number"){const s=[];for(let r=0,n=e.length;re!=h>e&&t<(u-a)*((e-l)/(h-l))+a&&(s=!s)}return s}strokeContains(t,e,s){const r=s/2,n=r*r,{points:o}=this,a=o.length-(this.closePath?0:2);for(let l=0;lr?u:r,n=ho?h:o}return t.x=s,t.width=r-s,t.y=n,t.height=o-n,t}copyFrom(t){return this.points=t.points.slice(),this.closePath=t.closePath,this}copyTo(t){return t.copyFrom(this),t}toString(){return`[pixi.js/math:PolygoncloseStroke=${this.closePath}points=${this.points.reduce((t,e)=>`${t}, ${e}`,"")}]`}get lastX(){return this.points[this.points.length-2]}get lastY(){return this.points[this.points.length-1]}get x(){return this.points[this.points.length-2]}get y(){return this.points[this.points.length-1]}}const is=(i,t,e,s,r,n)=>{const o=i-e,a=t-s,l=Math.sqrt(o*o+a*a);return l>=r-n&&l<=r+n};class pi{constructor(t=0,e=0,s=0,r=0,n=20){this.type="roundedRectangle",this.x=t,this.y=e,this.width=s,this.height=r,this.radius=n}getBounds(t){return t=t||new ot,t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t}clone(){return new pi(this.x,this.y,this.width,this.height,this.radius)}copyFrom(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this}copyTo(t){return t.copyFrom(this),t}contains(t,e){if(this.width<=0||this.height<=0)return!1;if(t>=this.x&&t<=this.x+this.width&&e>=this.y&&e<=this.y+this.height){const s=Math.max(0,Math.min(this.radius,Math.min(this.width,this.height)/2));if(e>=this.y+s&&e<=this.y+this.height-s||t>=this.x+s&&t<=this.x+this.width-s)return!0;let r=t-(this.x+s),n=e-(this.y+s);const o=s*s;if(r*r+n*n<=o||(r=t-(this.x+this.width-s),r*r+n*n<=o)||(n=e-(this.y+this.height-s),r*r+n*n<=o)||(r=t-(this.x+s),r*r+n*n<=o))return!0}return!1}strokeContains(t,e,s){const{x:r,y:n,width:o,height:a,radius:l}=this,u=s/2,h=r+l,c=n+l,d=o-l*2,m=a-l*2,p=r+o,_=n+a;return(t>=r-u&&t<=r+u||t>=p-u&&t<=p+u)&&e>=c&&e<=c+m||(e>=n-u&&e<=n+u||e>=_-u&&e<=_+u)&&t>=h&&t<=h+d?!0:tp-l&&ep-l&&e>_-l&&is(t,e,p-l,_-l,l,u)||t_-l&&is(t,e,h,_-l,l,u)}toString(){return`[pixi.js/math:RoundedRectangle x=${this.x} y=${this.y}width=${this.width} height=${this.height} radius=${this.radius}]`}}mt=(i=>(i[i.MAP_READ=1]="MAP_READ",i[i.MAP_WRITE=2]="MAP_WRITE",i[i.COPY_SRC=4]="COPY_SRC",i[i.COPY_DST=8]="COPY_DST",i[i.INDEX=16]="INDEX",i[i.VERTEX=32]="VERTEX",i[i.UNIFORM=64]="UNIFORM",i[i.STORAGE=128]="STORAGE",i[i.INDIRECT=256]="INDIRECT",i[i.QUERY_RESOLVE=512]="QUERY_RESOLVE",i[i.STATIC=1024]="STATIC",i))(mt||{});Ne=class extends Lt{constructor(t){let{data:e,size:s}=t;const{usage:r,label:n,shrinkToFit:o}=t;super(),this.uid=at("buffer"),this._resourceType="buffer",this._resourceId=at("resource"),this._touched=0,this._updateID=1,this.shrinkToFit=!0,this.destroyed=!1,e instanceof Array&&(e=new Float32Array(e)),this._data=e,s=s??e?.byteLength;const a=!!e;this.descriptor={size:s,usage:r,mappedAtCreation:a,label:n},this.shrinkToFit=o??!0}get data(){return this._data}set data(t){this.setDataWithSize(t,t.length,!0)}get static(){return!!(this.descriptor.usage&mt.STATIC)}set static(t){t?this.descriptor.usage|=mt.STATIC:this.descriptor.usage&=~mt.STATIC}setDataWithSize(t,e,s){if(this._updateID++,this._updateSize=e*t.BYTES_PER_ELEMENT,this._data===t){s&&this.emit("update",this);return}const r=this._data;if(this._data=t,r.length!==t.length){!this.shrinkToFit&&t.byteLengtha&&(a=m),p>l&&(l=p),me.destroy()),this.attributes=null,this.buffers=null,this.indexBuffer=null,this._bounds=null}};const bl=new Float32Array(1),vl=new Uint32Array(1);wl=class extends xl{constructor(){const e=new Ne({data:bl,label:"attribute-batch-buffer",usage:mt.VERTEX|mt.COPY_DST,shrinkToFit:!1}),s=new Ne({data:vl,label:"index-batch-buffer",usage:mt.INDEX|mt.COPY_DST,shrinkToFit:!1}),r=6*4;super({attributes:{aPosition:{buffer:e,format:"float32x2",stride:r,offset:0,location:1},aUV:{buffer:e,format:"float32x2",stride:r,offset:2*4,location:3},aColor:{buffer:e,format:"unorm8x4",stride:r,offset:4*4,location:0},aTextureIdAndRound:{buffer:e,format:"uint16x2",stride:r,offset:5*4,location:2}},indexBuffer:s})}};const Cl=["precision mediump float;","void main(void){","float test = 0.1;","%forloop%","gl_FragColor = vec4(0.0);","}"].join(` `);function Al(i){let t="";for(let e=0;e0&&(t+=` else `),e>>0;return pn[e]||kl(i,e)};let Es=0;function kl(i,t){const e={};let s=0;Es||(Es=fn());for(let n=0;n0){const o=new Uint8Array(i,e*8,n);new Uint8Array(t,e*8,n).set(o)}};const Pl={normal:"normal-npm",add:"add-npm",screen:"screen-npm"};Tl=(i=>(i[i.DISABLED=0]="DISABLED",i[i.RENDERING_MASK_ADD=1]="RENDERING_MASK_ADD",i[i.MASK_ACTIVE=2]="MASK_ACTIVE",i[i.RENDERING_MASK_REMOVE=3]="RENDERING_MASK_REMOVE",i[i.NONE=4]="NONE",i))(Tl||{});Ji=function(i,t){return t.alphaMode==="no-premultiply-alpha"&&Pl[i]||i};class tr{constructor(){this.ids=Object.create(null),this.textures=[],this.count=0}clear(){for(let t=0;tthis.attributeBuffer.size&&this._resizeAttributeBuffer(this.attributeSize*4),this.indexSize>this.indexBuffer.length&&this._resizeIndexBuffer(this.indexSize);const o=this.attributeBuffer.float32View,a=this.attributeBuffer.uint32View,l=this.indexBuffer;let u=this._batchIndexSize,h=this._batchIndexStart,c="startBatch",d=this._batchPool[this._batchPoolIndex++]||new er;const m=this._maxTextures;for(let p=this.elementStart;p=m||b)&&(this._finishBatch(d,h,u-h,s,n,t,c),c="renderBatch",h=u,n=y,s=this._textureBatchPool[this._textureBatchPoolIndex++]||new tr,s.clear(),d=this._batchPool[this._batchPoolIndex++]||new er,++we),_.textureId=v._textureBindLocation=s.count,s.ids[v.uid]=s.count,s.textures[s.count++]=v,_.batch=d,u+=_.indexSize,_.packAttributes(o,a,_.location,_.textureId),_.packIndex(l,_.indexStart,_.location/this._vertexSize)}s.count>0&&(this._finishBatch(d,h,u-h,s,n,t,c),h=u,++we),this.elementStart=this.elementSize,this._batchIndexStart=h,this._batchIndexSize=u}_finishBatch(t,e,s,r,n,o,a){t.gpuBindGroup=null,t.action=a,t.batcher=this,t.textures=r,t.blendMode=n,t.start=e,t.size=s,++we,o.add(t)}finish(t){this.break(t)}ensureAttributeBuffer(t){t*4<=this.attributeBuffer.size||this._resizeAttributeBuffer(t*4)}ensureIndexBuffer(t){t<=this.indexBuffer.length||this._resizeIndexBuffer(t)}_resizeAttributeBuffer(t){const e=Math.max(t,this.attributeBuffer.size*2),s=new Zi(e);Qi(this.attributeBuffer.rawBinaryData,s.rawBinaryData),this.attributeBuffer=s}_resizeIndexBuffer(t){const e=this.indexBuffer;let s=Math.max(t,e.length*1.5);s+=s%2;const r=s>65535?new Uint32Array(s):new Uint16Array(s);if(r.BYTES_PER_ELEMENT!==e.BYTES_PER_ELEMENT)for(let n=0;n>16&255,s=i>>8&255,r=i&255,n=t>>16&255,o=t>>8&255,a=t&255,l=e*n/255,u=s*o/255,h=r*a/255;return(l<<16)+(u<<8)+h}yn=class{constructor(){this.batcher=null,this.batch=null,this.applyTransform=!0,this.roundPixels=0}get blendMode(){return this.applyTransform?this.renderable.groupBlendMode:"normal"}packIndex(t,e,s){const r=this.geometryData.indices;for(let n=0;n>16|c&65280|(c&255)<<16;if(this.applyTransform){const m=Dl(d,o.groupColor)+(this.alpha*o.groupAlpha*255<<24),p=o.groupTransform,_=r<<16|this.roundPixels&65535,f=p.a,v=p.b,y=p.c,b=p.d,w=p.tx,A=p.ty;for(let R=u;R=0&&a>=0&&r>=0&&n>=0))return t;const l=Math.ceil(2.3*Math.sqrt(o+a)),u=l*8+(r?4:0)+(n?4:0);if(u===0)return t;if(l===0)return t[0]=t[6]=e+r,t[1]=t[3]=s+n,t[2]=t[4]=e-r,t[5]=t[7]=s-n,t;let h=0,c=l*4+(r?2:0)+2,d=c,m=u,p=r+o,_=n,f=e+p,v=e-p,y=s+_;if(t[h++]=f,t[h++]=y,t[--c]=y,t[--c]=v,n){const w=s-_;t[d++]=v,t[d++]=w,t[--m]=w,t[--m]=f}for(let w=1;w0&&(r[n++]=l,r[n++]=u,r[n++]=l-1),l++;r[n++]=u+1,r[n++]=u,r[n++]=l-1}},Bl={...Le,extension:{...Le.extension,name:"ellipse"}},Fl={...Le,extension:{...Le.extension,name:"roundedRectangle"}},$l=1e-4,sr=1e-4;function Vl(i){const t=i.length;if(t<6)return 1;let e=0;for(let s=0,r=i[t-2],n=i[t-1];sc&&(c+=Math.PI*2);let d=h;const m=c-h,p=Math.abs(m),_=Math.sqrt(l*l+u*u),f=(15*p*Math.sqrt(_)/Math.PI>>0)+1,v=m/f;if(d+=v,a){o.push(i,t),o.push(e,s);for(let y=1,b=d;y=0&&(h.join==="round"?y+=Xt(k,P,k-M*$,P-F*$,k-O*$,P-Q*$,f,!1)+4:y+=2,f.push(k-O*N,P-Q*N),f.push(k+O*$,P+Q*$));continue}const xi=(-M+E)*(-F+P)-(-M+k)*(-F+C),bi=(-O+D)*(-Q+P)-(-O+k)*(-Q+U),Ye=($t*bi-ge*xi)/He,Xe=(ye*xi-_e*bi)/He,ms=(Ye-k)*(Ye-k)+(Xe-P)*(Xe-P),Ut=k+(Ye-k)*$,Ot=P+(Xe-P)*$,zt=k-(Ye-k)*N,Ht=P-(Xe-P)*N,Sn=Math.min($t*$t+_e*_e,ge*ge+ye*ye),vi=xe?$:N,Mn=Sn+vi*vi*A;ms<=Mn?h.join==="bevel"||ms/A>R?(xe?(f.push(Ut,Ot),f.push(k+M*N,P+F*N),f.push(Ut,Ot),f.push(k+O*N,P+Q*N)):(f.push(k-M*$,P-F*$),f.push(zt,Ht),f.push(k-O*$,P-Q*$),f.push(zt,Ht)),y+=2):h.join==="round"?xe?(f.push(Ut,Ot),f.push(k+M*N,P+F*N),y+=Xt(k,P,k+M*N,P+F*N,k+O*N,P+Q*N,f,!0)+4,f.push(Ut,Ot),f.push(k+O*N,P+Q*N)):(f.push(k-M*$,P-F*$),f.push(zt,Ht),y+=Xt(k,P,k-M*$,P-F*$,k-O*$,P-Q*$,f,!1)+4,f.push(k-O*$,P-Q*$),f.push(zt,Ht)):(f.push(Ut,Ot),f.push(zt,Ht)):(f.push(k-M*$,P-F*$),f.push(k+M*N,P+F*N),h.join==="round"?xe?y+=Xt(k,P,k+M*N,P+F*N,k+O*N,P+Q*N,f,!0)+2:y+=Xt(k,P,k-M*$,P-F*$,k-O*$,P-Q*$,f,!1)+2:h.join==="miter"&&ms/A<=R&&(xe?(f.push(zt,Ht),f.push(zt,Ht)):(f.push(Ut,Ot),f.push(Ut,Ot)),y+=2),f.push(k-O*$,P-Q*$),f.push(k+O*N,P+Q*N),y+=2)}E=i[(v-2)*2],C=i[(v-2)*2+1],k=i[(v-1)*2],P=i[(v-1)*2+1],M=-(C-P),F=E-k,wt=Math.sqrt(M*M+F*F),M/=wt,F/=wt,M*=w,F*=w,f.push(k-M*$,P-F*$),f.push(k+M*N,P+F*N),p||(h.cap==="round"?y+=Xt(k-M*($-N)*.5,P-F*($-N)*.5,k-M*$,P-F*$,k+M*N,P+F*N,f,!1)+2:h.cap==="square"&&(y+=ir(k,P,M,F,$,N,!1,f)));const An=sr*sr;for(let X=b;X=0&&o>=0&&(t[0]=s,t[1]=r,t[2]=s+n,t[3]=r,t[4]=s+n,t[5]=r+o,t[6]=s,t[7]=r+o),t},triangulate(i,t,e,s,r,n){let o=0;s*=e,t[s+o]=i[0],t[s+o+1]=i[1],o+=e,t[s+o]=i[2],t[s+o+1]=i[3],o+=e,t[s+o]=i[6],t[s+o+1]=i[7],o+=e,t[s+o]=i[4],t[s+o+1]=i[5],o+=e;const a=s/e;r[n++]=a,r[n++]=a+1,r[n++]=a+2,r[n++]=a+1,r[n++]=a+3,r[n++]=a+2}},Ol={extension:{type:Y.ShapeBuilder,name:"triangle"},build(i,t){return t[0]=i.x,t[1]=i.y,t[2]=i.x2,t[3]=i.y2,t[4]=i.x3,t[5]=i.y3,t},triangulate(i,t,e,s,r,n){let o=0;s*=e,t[s+o]=i[0],t[s+o+1]=i[1],o+=e,t[s+o]=i[2],t[s+o+1]=i[3],o+=e,t[s+o]=i[4],t[s+o+1]=i[5];const a=s/e;r[n++]=a,r[n++]=a+1,r[n++]=a+2}},ps={};Tt.handleByMap(Y.ShapeBuilder,ps);Tt.add(Ul,Ll,Ol,Le,Bl,Fl);const zl=new ot;function Hl(i,t){const{geometryData:e,batches:s}=t;s.length=0,e.indices.length=0,e.vertices.length=0,e.uvs.length=0;for(let r=0;r{const m=l.length,p=o.length/2,_=[],f=ps[h.type];if(f.build(h,_),c&&gn(_,c),s){const w=h.closePath??!0;Gl(_,t,!1,w,o,2,p,l)}else if(e&&u===d){u!==0&&console.warn("[Pixi Graphics] only the last shape have be cut out");const w=[],A=_.slice();Xl(e.shapePath).forEach(E=>{w.push(A.length/2),A.push(...E)}),xn(A,w,o,2,p,l,m)}else f.triangulate(_,o,2,p,l,m);const v=a.length/2,y=t.texture;if(y!==W.WHITE){const w=t.matrix;w&&(c&&w.append(c.clone().invert()),El(o,2,p,a,v,2,o.length/2-p,w))}else Rl(a,v,2,o.length/2-p);const b=Mt.get(yn);b.indexOffset=m,b.indexSize=l.length-m,b.vertexOffset=p,b.vertexSize=o.length/2-p,b.color=t.color,b.alpha=t.alpha,b.texture=y,b.geometryData=n,r.push(b)})}function Xl(i){if(!i)return[];const t=i.shapePrimitives,e=[];for(let s=0;s{Mt.return(s)})}destroy(){for(const t in this._gpuContextHash)this._gpuContextHash[t]&&this.onGraphicsContextDestroy(this._gpuContextHash[t].context)}};mi.extension={type:[Y.WebGLSystem,Y.WebGPUSystem,Y.CanvasSystem],name:"graphicsContext"};mi.defaultOptions={bezierSmoothness:.5};bn=mi;const jl=8,rs=11920929e-14,Kl=1;function vn(i,t,e,s,r,n,o,a,l,u){const c=Math.min(.99,Math.max(0,u??bn.defaultOptions.bezierSmoothness));let d=(Kl-c)/1;return d*=d,Zl(t,e,s,r,n,o,a,l,i,d),i}function Zl(i,t,e,s,r,n,o,a,l,u){si(i,t,e,s,r,n,o,a,l,u,0),l.push(o,a)}function si(i,t,e,s,r,n,o,a,l,u,h){if(h>jl)return;const c=(i+e)/2,d=(t+s)/2,m=(e+r)/2,p=(s+n)/2,_=(r+o)/2,f=(n+a)/2,v=(c+m)/2,y=(d+p)/2,b=(m+_)/2,w=(p+f)/2,A=(v+b)/2,R=(y+w)/2;if(h>0){let E=o-i,C=a-t;const k=Math.abs((e-o)*C-(s-a)*E),P=Math.abs((r-o)*C-(n-a)*E);if(k>rs&&P>rs){if((k+P)*(k+P)<=u*(E*E+C*C)){l.push(A,R);return}}else if(k>rs){if(k*k<=u*(E*E+C*C)){l.push(A,R);return}}else if(P>rs){if(P*P<=u*(E*E+C*C)){l.push(A,R);return}}else if(E=A-(i+o)/2,C=R-(t+a)/2,E*E+C*C<=u){l.push(A,R);return}}si(i,t,c,d,v,y,A,R,l,u,h+1),si(A,R,b,w,_,f,o,a,l,u,h+1)}const Ql=8,Jl=11920929e-14,th=1;function eh(i,t,e,s,r,n,o,a){const u=Math.min(.99,Math.max(0,a??bn.defaultOptions.bezierSmoothness));let h=(th-u)/1;return h*=h,sh(t,e,s,r,n,o,i,h),i}function sh(i,t,e,s,r,n,o,a){ii(o,i,t,e,s,r,n,a,0),o.push(r,n)}function ii(i,t,e,s,r,n,o,a,l){if(l>Ql)return;const u=(t+s)/2,h=(e+r)/2,c=(s+n)/2,d=(r+o)/2,m=(u+c)/2,p=(h+d)/2;let _=n-t,f=o-e;const v=Math.abs((s-n)*f-(r-o)*_);if(v>Jl){if(v*v<=a*(_*_+f*f)){i.push(m,p);return}}else if(_=m-(t+n)/2,f=p-(e+o)/2,_*_+f*f<=a){i.push(m,p);return}ii(i,t,e,u,h,m,p,a,l+1),ii(i,m,p,c,d,n,o,a,l+1)}function wn(i,t,e,s,r,n,o,a){let l=Math.abs(r-n);(!o&&r>n||o&&n>r)&&(l=2*Math.PI-l),a=a||Math.max(6,Math.floor(6*Math.pow(s,1/3)*(l/Math.PI))),a=Math.max(a,3);let u=l/a,h=r;u*=o?-1:1;for(let c=0;cc*l)}const Ie=Math.PI*2,Rs={centerX:0,centerY:0,ang1:0,ang2:0},Ds=({x:i,y:t},e,s,r,n,o,a,l)=>{i*=e,t*=s;const u=r*i-n*t,h=n*i+r*t;return l.x=u+o,l.y=h+a,l};function rh(i,t){const e=t===-1.5707963267948966?-.551915024494:1.3333333333333333*Math.tan(t/4),s=t===1.5707963267948966?.551915024494:e,r=Math.cos(i),n=Math.sin(i),o=Math.cos(i+t),a=Math.sin(i+t);return[{x:r-n*s,y:n+r*s},{x:o+a*s,y:a-o*s},{x:o,y:a}]}const nr=(i,t,e,s)=>{const r=i*s-t*e<0?-1:1;let n=i*e+t*s;return n>1&&(n=1),n<-1&&(n=-1),r*Math.acos(n)},nh=(i,t,e,s,r,n,o,a,l,u,h,c,d)=>{const m=Math.pow(r,2),p=Math.pow(n,2),_=Math.pow(h,2),f=Math.pow(c,2);let v=m*p-m*f-p*_;v<0&&(v=0),v/=m*f+p*_,v=Math.sqrt(v)*(o===a?-1:1);const y=v*r/n*c,b=v*-n/r*h,w=u*y-l*b+(i+e)/2,A=l*y+u*b+(t+s)/2,R=(h-y)/r,E=(c-b)/n,C=(-h-y)/r,k=(-c-b)/n,P=nr(1,0,R,E);let D=nr(R,E,C,k);a===0&&D>0&&(D-=Ie),a===1&&D<0&&(D+=Ie),d.centerX=w,d.centerY=A,d.ang1=P,d.ang2=D};function oh(i,t,e,s,r,n,o,a=0,l=0,u=0){if(n===0||o===0)return;const h=Math.sin(a*Ie/360),c=Math.cos(a*Ie/360),d=c*(t-s)/2+h*(e-r)/2,m=-h*(t-s)/2+c*(e-r)/2;if(d===0&&m===0)return;n=Math.abs(n),o=Math.abs(o);const p=Math.pow(d,2)/Math.pow(n,2)+Math.pow(m,2)/Math.pow(o,2);p>1&&(n*=Math.sqrt(p),o*=Math.sqrt(p)),nh(t,e,s,r,n,o,l,u,h,c,d,m,Rs);let{ang1:_,ang2:f}=Rs;const{centerX:v,centerY:y}=Rs;let b=Math.abs(f)/(Ie/4);Math.abs(1-b)<1e-7&&(b=1);const w=Math.max(Math.ceil(b),1);f/=w;let A=i[i.length-2],R=i[i.length-1];const E={x:0,y:0};for(let C=0;C{const l=a.x-o.x,u=a.y-o.y,h=Math.sqrt(l*l+u*u),c=l/h,d=u/h;return{len:h,nx:c,ny:d}},r=(o,a)=>{o===0?i.moveTo(a.x,a.y):i.lineTo(a.x,a.y)};let n=t[t.length-1];for(let o=0;o0&&(m=-1,p=!0);const _=d/2;let f,v=Math.abs(Math.cos(_)*l/Math.sin(_));v>Math.min(h.len/2,c.len/2)?(v=Math.min(h.len/2,c.len/2),f=Math.abs(v*Math.sin(_)/Math.cos(_))):f=l;const y=a.x+c.nx*v+-c.ny*f*m,b=a.y+c.ny*v+c.nx*f*m,w=Math.atan2(h.ny,h.nx)+Math.PI/2*m,A=Math.atan2(c.ny,c.nx)-Math.PI/2*m;o===0&&i.moveTo(y+Math.cos(w)*f,b+Math.sin(w)*f),i.arc(y,b,f,w,A,p),n=a}}function lh(i,t,e,s){const r=(a,l)=>Math.sqrt((a.x-l.x)**2+(a.y-l.y)**2),n=(a,l,u)=>({x:a.x+(l.x-a.x)*u,y:a.y+(l.y-a.y)*u}),o=t.length;for(let a=0;a=2;c-=2)h[c]===h[c-2]&&h[c-1]===h[c-3]&&h.splice(c-1,2);return this.poly(h,!0,o)}ellipse(t,e,s,r,n){return this.drawShape(new fi(t,e,s,r),n),this}roundRect(t,e,s,r,n,o){return this.drawShape(new pi(t,e,s,r,n),o),this}drawShape(t,e){return this.endPoly(),this.shapePrimitives.push({shape:t,transform:e}),this}startPoly(t,e){let s=this._currentPoly;return s&&this.endPoly(),s=new Te,s.points.push(t,e),this._currentPoly=s,this}endPoly(t=!1){const e=this._currentPoly;return e&&e.points.length>2&&(e.closePath=t,this.shapePrimitives.push({shape:e})),this._currentPoly=null,this}_ensurePoly(t=!0){if(!this._currentPoly&&(this._currentPoly=new Te,t)){const e=this.shapePrimitives[this.shapePrimitives.length-1];if(e){let s=e.shape.x,r=e.shape.y;if(!e.transform.isIdentity()){const n=e.transform,o=s;s=n.a*s+n.c*r+n.tx,r=n.b*o+n.d*r+n.ty}this._currentPoly.points.push(s,r)}else this._currentPoly.points.push(0,0)}}buildPath(){const t=this._graphicsPath2D;this.shapePrimitives.length=0,this._currentPoly=null;for(let e=0;eparseInt(C,10)),t.context.poly(y,!0),e&&t.context.fill(),s&&t.context.stroke();break;case"polyline":b=i.getAttribute("points"),y=b.match(/\d+/g).map(C=>parseInt(C,10)),t.context.poly(y,!1),s&&t.context.stroke();break;case"g":case"svg":break;default:{console.info(`[SVG parser] <${i.nodeName}> elements unsupported`);break}}for(let C=0;Cb.priority!==At.DO_NOT_DOWNLOAD).forEach(b=>_.insert(b.piece_range,b.name));const f=new ls;let v="",y=1;for(let b=0;b{})}const{pause:d,resume:m}=pr(c,n,{immediate:!1,immediateCallback:!0});return ze(()=>t.isActive,p=>{p?m():d()}),us(()=>{if(!o.value)return;const p=new un;p.init({antialias:!0,width:o.value?.width,height:o.value?.height,canvas:o.value}).then(()=>l.value=p).then(()=>t.isActive&&m())}),ni(()=>{l.value?.destroy({removeView:!1},{children:!0})}),(p,_)=>(I(),G("canvas",{ref_key:"canvas",ref:o,width:"4096",height:"20"},null,512))}});yh=hs(gh,[["__scopeId","data-v-2bc530c7"]]);xh=["href"];bh={key:1};vh={class:"my-1"};wh={class:"mr-2"};Ch={key:0};Ah={key:2};Sh={key:0};Mh={key:1};kh={key:2};Ph={key:0};Th={key:0,class:"d-flex flex-wrap flex-gap-row-small flex-gap-column"};Ih=ct({__name:"Overview",props:{torrent:{},isActive:{type:Boolean}},setup(i){const t=i,{t:e}=me(),{cachedFiles:s}=dt(Ue()),r=mr(),{properties:n}=dt(Bt()),o=ee(),a=j(()=>s.value.filter(C=>C.priority!==At.DO_NOT_DOWNLOAD)),l=j(()=>s.value.length),u=j(()=>a.value.length===1?a.value[0].name:""),h=j(()=>n.value?.comment??""),c=j(()=>n.value?.dl_speed_avg??0),d=j(()=>n.value?.piece_size??0),m=j(()=>n.value?.pieces_have??0),p=j(()=>n.value?.pieces_num??0),_=j(()=>n.value?.up_speed_avg??0),f=j(()=>$n(t.torrent.state)),v=j(()=>`${parseInt(Vn(d.value,!0))} ${Gn(d.value,!0)}`),y=j(()=>[wi.META_DOWNLOAD,wi.FORCED_META_DOWNLOAD].includes(t.torrent.state)),b=j(()=>o.enableRatioColors?Nn(t.torrent.ratio):"");async function w(){try{await navigator.clipboard.writeText(t.torrent.hash)}catch{ki.error(e("toast.copy.error"));return}ki.success(e("toast.copy.success"))}function A(C){r.createDialog(kn,{hashes:[t.torrent.hash],mode:C})}function R(){r.createDialog(co,{hash:t.torrent.hash,isFolder:!1,oldName:u.value})}function E(C){if(r.hasActiveDialog||!t.isActive)return!1;if(C.key==="d")return C.preventDefault(),A("dl"),!0;if(C.key==="s")return C.preventDefault(),A("save"),!0;if(C.key==="f"&&a.value.length===1)return C.preventDefault(),R(),!0;if(C.key==="Delete")return C.preventDefault(),r.createDialog(Hn,{hashes:[t.torrent.hash]}),!0}return us(()=>{document.addEventListener("keydown",E)}),br(async()=>{document.removeEventListener("keydown",E)}),(C,k)=>C.torrent?(I(),V(Qt,{key:0},{default:x(()=>[g(Fs,{class:"text-wrap"},{default:x(()=>[L(T(C.torrent.name),1)]),_:1}),g(On,null,{default:x(()=>[B("div",null,[(I(!0),G(ft,null,bt(S(Un)(h.value),P=>(I(),G("span",null,[S(Ln)(P)?(I(),G("a",{key:0,target:"_blank",href:P},T(P),9,xh)):(I(),G("span",bh,T(P),1))]))),256))]),B("div",vh,[B("span",wh,T(C.torrent.hash),1),g(st,{variant:"outlined",rounded:"",onClick:w},{default:x(()=>[L(T(C.$t("torrentDetail.overview.copy_hash")),1)]),_:1})])]),_:1}),g(Re,null,{default:x(()=>[g(J,null,{default:x(()=>[g(q,{cols:"12",md:"6"},{default:x(()=>[g(J,null,{default:x(()=>[g(q,{cols:"4"},{default:x(()=>[g(zn,{color:f.value,indeterminate:y.value,size:100,"model-value":C.torrent?.progress*100||0,width:15},{default:x(()=>[y.value?(I(),G("span",Ch,T(C.$t("torrentDetail.overview.fetchingMetadata")),1)):C.torrent.progress===1?(I(),V(lt,{key:1,icon:"mdi-check",size:"x-large"})):(I(),G("span",Ah,T(S($s)(C.torrent.progress)),1))]),_:1},8,["color","indeterminate","model-value"])]),_:1}),g(q,{cols:"8",class:"d-flex flex-column align-center justify-center"},{default:x(()=>[y.value?(I(),G("div",Sh,[B("span",null,T(C.$t("torrentDetail.overview.waitingForMetadata")),1)])):(I(),G("div",Mh,[g(yh,{torrent:C.torrent,isActive:C.isActive},null,8,["torrent","isActive"])])),p.value>0?(I(),G("div",kh,[B("span",null,T(S(e)("torrentDetail.overview.pieceCount",{owned:m.value,total:p.value,pieceSize:v.value})),1)])):_t("",!0),B("div",null,[g(lt,{icon:"mdi-arrow-down"}),L(" "+T(S(Zt)(C.torrent.dlspeed,S(o).useBitSpeed))+" ",1),g(lt,{icon:"mdi-arrow-up"}),L(" "+T(S(Zt)(C.torrent.upspeed,S(o).useBitSpeed)),1)])]),_:1})]),_:1}),g(J,null,{default:x(()=>[g(q,{cols:"6"},{default:x(()=>[B("div",null,T(C.$t("torrent.properties.download_path"))+":",1),B("div",null,T(C.torrent.download_path),1),g(st,{icon:"mdi-pencil",color:"accent",size:"x-small",onClick:k[0]||(k[0]=P=>A("dl"))})]),_:1}),g(q,{cols:"6"},{default:x(()=>[B("div",null,T(C.$t("torrentDetail.overview.fileCount"))+":",1),B("div",null,T(a.value.length)+" / "+T(l.value),1),a.value.length===1?(I(),G("div",Ph,T(u.value),1)):_t("",!0),a.value.length===1?(I(),V(st,{key:1,icon:"mdi-pencil",color:"accent",size:"x-small",onClick:R})):_t("",!0)]),_:1})]),_:1}),g(J,null,{default:x(()=>[g(q,{cols:"6"},{default:x(()=>[B("div",null,T(C.$t("torrent.properties.save_path"))+":",1),B("div",null,T(C.torrent.savePath),1),g(st,{icon:"mdi-pencil",color:"accent",size:"x-small",onClick:k[1]||(k[1]=P=>A("save"))})]),_:1}),g(q,{cols:"6"},{default:x(()=>[B("div",null,T(C.$t("torrent.properties.content_path"))+":",1),B("div",null,T(C.torrent.content_path),1)]),_:1})]),_:1})]),_:1}),g(q,{cols:"12",md:"6"},{default:x(()=>[g(J,null,{default:x(()=>[g(q,{cols:"6"},{default:x(()=>[B("div",null,T(C.$t("torrent.properties.state"))+":",1),g(ae,{disabled:!0,"default-color":f.value,value:C.$t(`torrent.state.${S(fr)(C.torrent.state)}`)},null,8,["default-color","value"])]),_:1}),g(q,{cols:"6"},{default:x(()=>[B("div",null,T(C.$t("torrent.properties.category"))+":",1),g(ae,{"default-color":"category",disabled:!C.torrent.category.length,"disabled-value":C.$t("navbar.side.filters.uncategorized"),value:C.torrent.category},null,8,["disabled","disabled-value","value"])]),_:1})]),_:1}),g(J,null,{default:x(()=>[g(q,{cols:"6"},{default:x(()=>[B("div",null,T(C.$t("torrent.properties.tracker"))+":",1),g(ae,{disabled:!C.torrent.trackerDomain.length,"default-color":"tracker","disabled-value":C.$t("navbar.side.filters.untracked"),value:C.torrent.trackerDomain},null,8,["disabled","disabled-value","value"])]),_:1}),g(q,{cols:"6"},{default:x(()=>[B("div",null,T(C.$t("torrent.properties.tags"))+":",1),C.torrent.tags.length?(I(),G("div",Th,[(I(!0),G(ft,null,bt(C.torrent.tags,P=>(I(),V(ae,{"default-color":"tag",value:P},null,8,["value"]))),256))])):(I(),V(ae,{key:1,disabled:!0,"default-color":"tag",value:C.$t("navbar.side.filters.untagged")},null,8,["value"]))]),_:1})]),_:1}),g(J,null,{default:x(()=>[g(q,{cols:"6"},{default:x(()=>[B("div",null,T(C.$t("torrentDetail.overview.selectedFileSize"))+":",1),B("div",null,T(S(Gt)(C.torrent.size,S(o).useBinarySize))+" / "+T(S(Gt)(C.torrent.total_size,S(o).useBinarySize)),1)]),_:1}),g(q,{cols:"6"},{default:x(()=>[B("div",null,T(C.$t("torrentDetail.overview.ratio"))+":",1),B("div",{class:De(b.value)},T(C.torrent.ratio),3)]),_:1})]),_:1}),g(J,null,{default:x(()=>[g(q,{cols:"6"},{default:x(()=>[B("div",null,T(C.$t("torrentDetail.overview.downloaded"))+":",1),B("div",null,T(S(Gt)(C.torrent.downloaded,S(o).useBinarySize)),1)]),_:1}),g(q,{cols:"6"},{default:x(()=>[B("div",null,T(C.$t("torrentDetail.overview.uploaded"))+":",1),B("div",null,T(S(Gt)(C.torrent.uploaded,S(o).useBinarySize)),1)]),_:1})]),_:1}),g(J,null,{default:x(()=>[g(q,{cols:"6"},{default:x(()=>[B("div",null,T(C.$t("torrentDetail.overview.dlSpeedAverage"))+":",1),B("div",null,T(S(Zt)(c.value,S(o).useBitSpeed)),1)]),_:1}),g(q,{cols:"6"},{default:x(()=>[B("div",null,T(C.$t("torrentDetail.overview.upSpeedAverage"))+":",1),B("div",null,T(S(Zt)(_.value,S(o).useBitSpeed)),1)]),_:1})]),_:1})]),_:1})]),_:1})]),_:1})]),_:1})):_t("",!0)}});Eh={class:"text-grey"};Rh={key:0};Dh={key:1};Bh={key:0};Fh={key:2,class:"text-grey"};$h=["title"];Vh=["alt","src","title"];Gh=["title"];Nh=["title"];Lh={key:1};Uh={class:"text-download"};Oh={class:"text-upload"};zh={class:"d-flex my-3 flex-gap align-center justify-center"};Hh=ct({__name:"Peers",props:{torrent:{},isActive:{type:Boolean}},setup(i){const t=i,{t:e}=me(),s=Oe(),r=Yn(),n=ee();function o(D,U){const M=D.ip.split(".").map(Number),F=U.ip.split(".").map(Number);for(let O=0;O<4;O++)if(M[O]!==F[O])return M[O]-F[O];return D.port-U.port}function a(D,U){return D.country&&!U.country?-1:!D.country&&U.country?1:D.country===U.country?o(D,U):D.country.localeCompare(U.country)}const l=so([{nowrap:!0,key:"actions",sortable:!1},{nowrap:!0,title:e("torrentDetail.peers.fields.country"),key:"country",sortRaw:a},{nowrap:!0,title:e("torrentDetail.peers.fields.host"),key:"host",sortRaw:o},{nowrap:!0,title:e("torrentDetail.peers.fields.progress"),key:"progress"},{nowrap:!0,title:e("torrentDetail.peers.fields.download"),key:"dl_speed"},{nowrap:!0,title:e("torrentDetail.peers.fields.upload"),key:"up_speed"},{nowrap:!0,title:e("torrentDetail.peers.fields.flags"),key:"flags"},{nowrap:!0,title:e("torrentDetail.peers.fields.client"),key:"client"},{nowrap:!0,title:e("torrentDetail.peers.fields.relevance"),key:"relevance"},{nowrap:!0,title:e("torrentDetail.peers.fields.files"),key:"files"}]),u=io([{key:"dl_speed",order:"desc"},{key:"up_speed",order:"desc"}]),h=ht(!1),c=ht(),d=ht(new Map),m=ht(!1),p=ht(""),_=ht(!1),f=ht(""),v=j(()=>Array.from(d.value.entries()).map(([D,U])=>({...U,host:D})));function y(D){Object.entries(D).forEach(([U,M])=>{const F=d.value.get(U);d.value.set(U,{...F,...M})})}function b(D){D.forEach(U=>d.value.delete(U))}async function w(){h.value=!0;const D=await s.syncTorrentPeers(t.torrent.hash,c.value);c.value=D.rid,m.value=D.show_flags??m.value,D.full_update?d.value=new Map(Object.entries(D.peers)):(D.peers_removed&&b(D.peers_removed),D.peers&&y(D.peers)),h.value=!1}async function A(){f.value.length&&(await s.addTorrentPeers(t.torrent.hash,f.value.split(` `)),P(),R())}function R(){_.value=!1,f.value=""}async function E(D){await s.banPeers([D.host]),await r.fetchPreferences(),P()}const{isActive:C,pause:k,resume:P}=pr(w,2e3,{immediate:!0,immediateCallback:!0});return ze(()=>t.isActive,D=>{D?P():k()}),ro(()=>!_.value),(D,U)=>(I(),V(Qt,null,{default:x(()=>[d.value.size?(I(),V(Wn,{key:1,headers:S(l),items:v.value,"multi-sort":"","sort-by":S(u),search:p.value,"filter-keys":["host","client","files"],mobile:null},{top:x(()=>[g(ns,{modelValue:p.value,"onUpdate:modelValue":U[0]||(U[0]=M=>p.value=M),class:"ma-3",density:"compact",label:D.$t("common.search"),"prepend-inner-icon":"mdi-magnify",flat:"","hide-details":"","single-line":"",clearable:""},null,8,["modelValue","label"])]),"item.host":x(({item:M})=>[L(T(M.ip),1),B("span",Eh,":"+T(M.port),1)]),"item.client":x(({item:M})=>[M.connection?(I(),G("span",Rh,"["+T(M.connection)+"]\xa0",1)):_t("",!0),M.client?(I(),G("span",Dh,[L(T(M.client)+" ",1),M.peer_id_client?(I(),G("span",Bh,"("+T(M.peer_id_client)+")",1)):_t("",!0)])):(I(),G("span",Fh,"?????"))]),"item.actions":x(({item:M})=>[g(st,{color:"red",icon:"mdi-cancel",variant:"text",onClick:F=>E(M)},null,8,["onClick"])]),"item.country":x(({item:M})=>[m.value?(I(),G("div",{key:0,class:"cursor-help",title:M.country},[S(qn)?(I(),G("img",{key:0,alt:S(gs)(M.country_code).char,src:S(gs)(M.country_code).url,title:M.country,style:{"max-width":"32px"}},null,8,Vh)):(I(),G("span",{key:1,title:M.country},T(S(gs)(M.country_code).char),9,Gh))],8,$h)):_t("",!0)]),"item.flags":x(({item:M})=>[M.flags?(I(),G("div",{key:0,class:"cursor-help",title:M.flags_desc},T(M.flags),9,Nh)):(I(),G("div",Lh,T(D.$t("common.none")),1))]),"item.dl_speed":x(({item:M})=>[B("span",Uh,T(S(Zt)(M.dl_speed,S(n).useBitSpeed))+" ("+T(S(Gt)(M.downloaded,S(n).useBinarySize))+") ",1)]),"item.up_speed":x(({item:M})=>[B("span",Oh,T(S(Zt)(M.up_speed,S(n).useBitSpeed))+" ("+T(S(Gt)(M.uploaded,S(n).useBinarySize))+") ",1)]),"item.progress":x(({item:M})=>[g(dr,{"model-value":M.progress,max:1,height:20,rounded:"sm",style:{width:"8em"},color:M.progress===1?"torrent-ul_stalled":"torrent-downloading"},{default:x(()=>[L(T(S($s)(M.progress)),1)]),_:2},1032,["model-value","color"])]),"item.relevance":x(({item:M})=>[L(T(S($s)(M.relevance)),1)]),_:2},1032,["headers","items","sort-by","search"])):(I(),V(Xn,{key:0,title:D.$t("torrentDetail.peers.empty"),icon:"mdi-account-sync",color:"accent"},null,8,["title"])),B("div",zh,[S(C)?(I(),V(st,{key:0,"prepend-icon":"mdi-pause",color:"primary",text:D.$t("common.pause"),onClick:U[1]||(U[1]=M=>S(k)())},null,8,["text"])):(I(),V(st,{key:1,"prepend-icon":"mdi-play",color:"primary",text:D.$t("common.resume"),onClick:U[2]||(U[2]=M=>S(P)())},null,8,["text"])),g(Gs,{modelValue:_.value,"onUpdate:modelValue":U[4]||(U[4]=M=>_.value=M),"max-width":"750px"},{activator:x(({props:M})=>[g(st,Ls(M,{variant:"flat",text:S(e)("torrentDetail.peers.addPeers.title"),color:"accent"}),null,16,["text"])]),default:x(()=>[g(Qt,{title:D.$t("torrentDetail.peers.addPeers.title")},{default:x(()=>[g(Re,null,{default:x(()=>[g(_r,{modelValue:f.value,"onUpdate:modelValue":U[3]||(U[3]=M=>f.value=M),label:S(e)("torrentDetail.peers.addPeers.newPeers"),placeholder:S(e)("torrentDetail.peers.addPeers.newPeersPlaceholder"),hint:S(e)("torrentDetail.peers.addPeers.newPeersHint")},null,8,["modelValue","label","placeholder","hint"])]),_:1}),g(Vs,null,{default:x(()=>[g(ce),g(st,{color:"error",onClick:R},{default:x(()=>[L(T(S(e)("common.cancel")),1)]),_:1}),g(st,{color:"accent",onClick:A},{default:x(()=>[L(T(S(e)("common.ok")),1)]),_:1})]),_:1})]),_:1},8,["title"])]),_:1},8,["modelValue"])])]),_:1}))}});Yh=ct({__name:"TagsAndCategories",props:{torrent:{},isActive:{type:Boolean}},setup(i){const t=i,e=Oe(),s=ri();async function r(o){t.torrent.category===o?await s.setTorrentCategory([t.torrent.hash],""):await s.setTorrentCategory([t.torrent.hash],o)}async function n(o){t.torrent.tags?.includes(o)?await s.removeTorrentTags([t.torrent.hash],[o]):await s.addTorrentTags([t.torrent.hash],[o])}return vr(async()=>{await e.fetchCategories(),await e.fetchTags()}),(o,a)=>(I(),V(Qt,null,{default:x(()=>[g(Re,null,{default:x(()=>[g(J,null,{default:x(()=>[g(q,{cols:"12",md:"6"},{default:x(()=>[g(Ee,null,{default:x(()=>[g(Ci,null,{default:x(()=>[L(T(o.$t("torrentDetail.tagsAndCategories.tags")),1)]),_:1}),(I(!0),G(ft,null,bt(S(e).tags,l=>(I(),V(Jt,{variant:"text",color:"accent",title:l,active:o.torrent.tags?.includes(l),onClick:u=>n(l)},null,8,["title","active","onClick"]))),256))]),_:1})]),_:1}),g(q,{cols:"12",md:"6"},{default:x(()=>[g(Ee,null,{default:x(()=>[g(Ci,null,{default:x(()=>[L(T(o.$t("torrentDetail.tagsAndCategories.categories")),1)]),_:1}),(I(!0),G(ft,null,bt(S(e).categories,l=>(I(),V(Jt,{variant:"text",color:"accent",title:l.name,active:l.name===t.torrent.category,onClick:u=>r(l.name)},null,8,["title","active","onClick"]))),256))]),_:1})]),_:1})]),_:1})]),_:1})]),_:1}))}});Xh={class:"d-flex"};Wh={key:0};qh={key:1};jh={key:2};Kh={key:3};Zh={key:0,class:"d-flex flex-column"};Qh={class:"text-h5"};Jh={class:"text-h5"};tu=ct({__name:"Trackers",props:{torrent:{},isActive:{type:Boolean}},setup(i){const t=i,{t:e}=me(),s=Oe();function r(A){switch(A){case Vt.DISABLED:return e("constants.trackerStatus.disabled");case Vt.NOT_YET_CONTACTED:return e("constants.trackerStatus.not_yet_contacted");case Vt.WORKING:return e("constants.trackerStatus.working");case Vt.UPDATING:return e("constants.trackerStatus.updating");case Vt.NOT_WORKING:return e("constants.trackerStatus.not_working");default:return""}}function n(A){return typeof A=="number"?A===-1?"N/A":A.valueOf():!A||A.num_peers===-1||A?.num_seeds===-1||A?.num_leeches===-1?"N/A":e("torrentDetail.trackers.peersValue",{peers:A.num_peers,seeds:A.num_seeds,leeches:A.num_leeches})}const o=ht(!1),a=ht([]),l=ht(""),u=ht(null),h=ht(!1),c=[A=>!!A||e("torrentDetail.trackers.editTracker.newUrlRequired")],d=no({isVisible:!1,isFormValid:!1,oldUrl:"",newUrl:""});function m(A){d.isVisible=!0,d.oldUrl=A.url,d.newUrl=A.url,yr(()=>{document.getElementById("input")?.select()})}async function p(){o.value=!0,a.value=(await s.getTorrentTrackers(t.torrent.hash)).map(A=>({...A,isSelectable:A.tier!==-1})),o.value=!1}async function _(){l.value.length&&(await s.addTorrentTrackers(t.torrent.hash,l.value),await p(),f())}function f(){h.value=!1,l.value=""}async function v(){d.isFormValid&&(await s.editTorrentTracker(t.torrent.hash,d.oldUrl,d.newUrl),d.isVisible=!1,await p())}async function y(A){await s.removeTorrentTrackers(t.torrent.hash,[A.url]),await p()}async function b(){await s.reannounceTorrents([t.torrent.hash])}async function w(A){A??t.isActive?(await p(),u.value=setInterval(p,5e3)):(clearInterval(u.value),u.value=null)}return vr(w),br(()=>w(!1)),ze(()=>t.isActive,w),(A,R)=>(I(),V(Ee,null,{default:x(()=>[(I(!0),G(ft,null,bt(a.value,(E,C)=>(I(),G(ft,null,[C===3?(I(),V(Ai,{key:0,color:"white",thickness:"5"})):C>0?(I(),V(Ai,{key:1,class:"mx-5",color:"white"})):_t("",!0),g(Jt,null,{default:x(()=>[B("div",Xh,[B("div",{class:De(`tracker-${S(Vt)[E.status].toLowerCase()}`)},[g(jn,{class:"text-break text-wrap"},{default:x(()=>[L(T(E.url),1)]),_:2},1024),g(Bs,{class:"d-block"},{default:x(()=>[E.msg?(I(),G("div",Wh,T(E.msg),1)):(I(),G("div",qh,T(r(E.status)),1)),E.tier>=0?(I(),G("div",jh,T(S(e)("torrentDetail.trackers.tier",E.tier)),1)):_t("",!0),E.status!==S(Vt).NOT_WORKING?(I(),G("div",Kh,[B("div",null,T(n(E)),1),B("div",null,"Downloads: "+T(n(E.num_downloaded)),1)])):_t("",!0)]),_:2},1024)],2),g(ce),E.tier>=0?(I(),G("div",Zh,[g(Gs,{modelValue:d.isVisible,"onUpdate:modelValue":R[4]||(R[4]=k=>d.isVisible=k),"max-width":"750px"},{activator:x(({props:k})=>[g(st,Ls({ref_for:!0},k,{icon:"mdi-pencil",variant:"text",onClick:P=>m(E)}),null,16,["onClick"])]),default:x(()=>[g(Qt,null,{default:x(()=>[g(Fs,null,{default:x(()=>[B("span",Qh,T(S(e)("torrentDetail.trackers.editTracker.title")),1)]),_:1}),g(Re,null,{default:x(()=>[g(S(Kn),{modelValue:d.isFormValid,"onUpdate:modelValue":R[1]||(R[1]=k=>d.isFormValid=k),onSubmit:R[2]||(R[2]=Ns(()=>{},["prevent"]))},{default:x(()=>[g(S(ns),{"model-value":d.oldUrl,disabled:"",label:A.$t("torrentDetail.trackers.editTracker.oldUrl")},null,8,["model-value","label"]),g(S(ns),{modelValue:d.newUrl,"onUpdate:modelValue":R[0]||(R[0]=k=>d.newUrl=k),id:"input",rules:c,label:A.$t("torrentDetail.trackers.editTracker.newUrl"),autofocus:"",onKeydown:oo(v,["enter"])},null,8,["modelValue","label"])]),_:1},8,["modelValue"])]),_:1}),g(Vs,null,{default:x(()=>[g(ce),g(st,{color:"error",disabled:!d.isFormValid,onClick:R[3]||(R[3]=k=>d.isVisible=!1)},{default:x(()=>[L(T(S(e)("common.cancel")),1)]),_:1},8,["disabled"]),g(st,{color:"accent",onClick:v},{default:x(()=>[L(T(S(e)("common.ok")),1)]),_:1})]),_:1})]),_:1})]),_:2},1032,["modelValue"]),g(st,{color:"red",icon:"mdi-delete",variant:"text",onClick:k=>y(E)},null,8,["onClick"])])):_t("",!0)])]),_:2},1024)],64))),256)),g(Jt,null,{default:x(()=>[B("div",{class:De(["d-flex py-5",A.$vuetify.display.mobile?"flex-column flex-gap-row":"justify-space-evenly"])},[g(Gs,{modelValue:h.value,"onUpdate:modelValue":R[6]||(R[6]=E=>h.value=E),"max-width":"750px"},{activator:x(({props:E})=>[g(st,Ls(E,{variant:"flat",text:S(e)("torrentDetail.trackers.addTrackers.title"),color:"accent"}),null,16,["text"])]),default:x(()=>[g(Qt,null,{default:x(()=>[g(Fs,null,{default:x(()=>[B("span",Jh,T(S(e)("torrentDetail.trackers.addTrackers.title")),1)]),_:1}),g(Re,null,{default:x(()=>[g(Zn,null,{default:x(()=>[g(J,null,{default:x(()=>[g(q,{cols:"12"},{default:x(()=>[g(_r,{modelValue:l.value,"onUpdate:modelValue":R[5]||(R[5]=E=>l.value=E),label:S(e)("torrentDetail.trackers.addTrackers.newTrackers"),hint:S(e)("torrentDetail.trackers.addTrackers.newTrackersHint")},null,8,["modelValue","label","hint"])]),_:1})]),_:1})]),_:1})]),_:1}),g(Vs,null,{default:x(()=>[g(ce),g(st,{color:"error",onClick:f},{default:x(()=>[L(T(S(e)("common.cancel")),1)]),_:1}),g(st,{color:"accent",onClick:_},{default:x(()=>[L(T(S(e)("common.ok")),1)]),_:1})]),_:1})]),_:1})]),_:1},8,["modelValue"]),g(st,{variant:"flat",disabled:a.value.length===3,text:S(e)("torrentDetail.trackers.reannounce"),color:"primary",onClick:b},null,8,["disabled","text"])],2)]),_:1})]),_:1}))}});eu=hs(tu,[["__scopeId","data-v-12f0128d"]]);su={class:"pa-3 text-select"};iu={style:{"font-size":"1.6em !important"},class:"subtitle-1 ml-2"};ru={class:"d-flex justify-end"};nu=ct({__name:"TorrentDetail",setup(i){const t=ao(),{t:e}=me(),s=Ue(),r=mr(),n=ri(),o=Bt(),a=[{text:e("torrentDetail.tabs.overview"),value:"overview"},{text:e("torrentDetail.tabs.info"),value:"info"},{text:e("torrentDetail.tabs.trackers"),value:"trackers"},{text:e("torrentDetail.tabs.peers"),value:"peers"},{text:e("torrentDetail.tabs.content"),value:"content"},{text:e("torrentDetail.tabs.tagsAndCategories"),value:"tagsAndCategories"}],l=ht("overview"),u=j(()=>t.currentRoute.value.params.hash),h=j(()=>n.getTorrentByHash(u.value)),c=()=>{t.push({name:"dashboard"})};function d(p){if(r.hasActiveDialog)return!1;p.key==="Escape"&&c()}function m(){const p=t.currentRoute.value.params.tab;p&&(l.value=p)}return lo(()=>{m()}),ze(h,()=>{o.fetchProperties(u.value)}),us(()=>{document.addEventListener("keydown",d),m(),o.fetchProperties(u.value),s.updateFileTree()}),ni(()=>{document.removeEventListener("keydown",d),o.$reset()}),(p,_)=>(I(),G(ft,null,[B("div",su,[g(J,{"no-gutters":"",align:"center",justify:"center"},{default:x(()=>[g(q,null,{default:x(()=>[B("h1",iu,T(S(e)("torrentDetail.title")),1)]),_:1}),g(q,null,{default:x(()=>[B("div",ru,[g(st,{icon:"mdi-close",variant:"plain",onClick:c})])]),_:1})]),_:1}),g(J,{class:"ma-0 pa-0"},{default:x(()=>[g(Jn,{modelValue:l.value,"onUpdate:modelValue":_[0]||(_[0]=f=>l.value=f),"bg-color":"primary",grow:"","show-arrows":""},{default:x(()=>[(I(),G(ft,null,bt(a,({text:f,value:v})=>g(to,{value:v,href:`#/torrent/${u.value}/${v}`,text:f},null,8,["value","href","text"])),64))]),_:1},8,["modelValue"])]),_:1}),h.value?(I(),V(Qn,{key:0,modelValue:l.value,"onUpdate:modelValue":_[1]||(_[1]=f=>l.value=f),touch:!1},{default:x(()=>[g(ne,{value:"overview"},{default:x(()=>[g(Ih,{torrent:h.value,"is-active":l.value==="overview"},null,8,["torrent","is-active"])]),_:1}),g(ne,{value:"info"},{default:x(()=>[g(Do,{torrent:h.value,"is-active":l.value==="info"},null,8,["torrent","is-active"])]),_:1}),g(ne,{value:"trackers"},{default:x(()=>[g(eu,{torrent:h.value,"is-active":l.value==="trackers"},null,8,["torrent","is-active"])]),_:1}),g(ne,{value:"peers"},{default:x(()=>[g(Hh,{torrent:h.value,"is-active":l.value==="peers"},null,8,["torrent","is-active"])]),_:1}),g(ne,{value:"content"},{default:x(()=>[g(S(bo),{torrent:h.value,"is-active":l.value==="content"},null,8,["torrent","is-active"])]),_:1}),g(ne,{value:"tagsAndCategories"},{default:x(()=>[g(Yh,{torrent:h.value,"is-active":l.value==="tagsAndCategories"},null,8,["torrent","is-active"])]),_:1})]),_:1},8,["modelValue"])):_t("",!0)]),B("div",{style:gr(`position: absolute; left: ${S(s).rightClickProperties.offset[0]}px; top: ${S(s).rightClickProperties.offset[1]}px;`)},[g(S(Pn),{modelValue:S(s).rightClickProperties.isVisible,"onUpdate:modelValue":_[2]||(_[2]=f=>S(s).rightClickProperties.isVisible=f),"menu-data":S(s).menuData},null,8,["modelValue","menu-data"])],4)],64))}});_u=Object.freeze(Object.defineProperty({__proto__:null,default:nu},Symbol.toStringTag,{value:"Module"}))});export{fe as $,an as A,mt as B,pt as C,Nt as D,Y as E,Li as F,xa as G,ks as H,xt as I,Fr as J,et as K,tt as L,H as M,ol as N,xl as O,ut as P,Ae as Q,ot as R,Tl as S,Ze as T,Ws as U,ke as V,ur as W,al as X,ll as Y,ui as Z,he as _,Lt as a,yn as a0,Ji as a1,ls as a2,qo as a3,bn as a4,_u as a5,Ml as b,Ne as c,Fa as d,Tt as e,Qi as f,fn as g,rn as h,Yr as i,Ft as j,W as k,Ba as l,Wo as m,mu as n,Il as o,wl as p,Mt as q,oa as r,Dr as s,Dt as t,at as u,Be as v,Rt as w,Va as x,el as y,zi as z,__tla};