vuetorrent update

This commit is contained in:
2024-07-06 03:48:00 -04:00
parent abfce84408
commit 51ce7170f3
50 changed files with 1109 additions and 1094 deletions

BIN
.DS_Store vendored Normal file

Binary file not shown.

View File

@@ -1 +1 @@
import{u as f,__tla as __tla_0}from"./index-DF2-l4SD.js";import{c as d,D as t}from"./vue-BQgCUbk_.js";let h;let __tla=Promise.all([(()=>{try{return __tla_0}catch{}})()]).then(async()=>{h=function(e,a,o=1){const{currentPage:n,currentPageSize:r,pageCount:u,isFirstPage:c,isLastPage:i,next:g,prev:l}=f({total:()=>t(e).length,page:o,pageSize:()=>t(a)===-1?t(e).length:t(a)}),p=d(()=>{const s=(n.value-1)*t(a),P=s+r.value;return t(e).slice(s,P)});return{currentPage:n,currentPageSize:r,pageCount:u,isFirstPage:c,isLastPage:i,next:g,prev:l,paginatedResults:p}}});export{h as u,__tla}; import{u as f,__tla as __tla_0}from"./index-C0tfT_Qc.js";import{c as d,D as t}from"./vue-CfSjRv-x.js";let h;let __tla=Promise.all([(()=>{try{return __tla_0}catch{}})()]).then(async()=>{h=function(e,a,o=1){const{currentPage:n,currentPageSize:r,pageCount:u,isFirstPage:c,isLastPage:i,next:g,prev:l}=f({total:()=>t(e).length,page:o,pageSize:()=>t(a)===-1?t(e).length:t(a)}),p=d(()=>{const s=(n.value-1)*t(a),P=s+r.value;return t(e).slice(s,P)});return{currentPage:n,currentPageSize:r,pageCount:u,isFirstPage:c,isLastPage:i,next:g,prev:l,paginatedResults:p}}});export{h as u,__tla};

View File

@@ -1 +1 @@
import{a as le,b as ae,V as te,I as oe,J as ne,h as q,c as se,d as de,p as re,r as h,K as z,M as G,t as ue,k as u,N as ie,O as ce,P as fe,v as J,Q as I,q as pe,s as ge,w as ye,i as me,j as he,__tla as __tla_0}from"./index-DF2-l4SD.js";import{g as O}from"./FileIcon-DH65fwz5.js";import{h as ke,E as ve,f as p,d as Ve,r as be,c as Ne,w as Fe,Y as _e,H as n,I as r,J as o,n as s,K as y,L as i,u as c,_ as R,U as k,N as v,W as Q,Q as V,V as Ce,F as W,P as Re,Z as B}from"./vue-BQgCUbk_.js";import"./vuetify-DWkLi8Ew.js";let Ke;let __tla=Promise.all([(()=>{try{return __tla_0}catch{}})()]).then(async()=>{let $e,we,Ee,Te;$e=["onClick"];we={key:1};Ee={key:1};Te={class:"d-flex flex-column pl-3"};Ke=ke({__name:"BulkRenameFilesDialog",props:{guid:{},node:{},hash:{}},setup(X){const m=X,{isOpened:b}=le(m.guid),{t:g}=ve(),K=ae(),L=p(),N=p(!1),$=p(!1),F=p(""),D=p(),_=p([]),C=p(""),S=p(),w=p(!1),M=[a=>!!a],Y=Ve([{fixed:!0,sortable:!1,key:"selected",width:"50px"},{title:g("dialogs.bulkRenameFiles.col_origin_name"),sortable:!1,key:"name"},{title:g("dialogs.bulkRenameFiles.col_result_name"),sortable:!1,key:"targetName"}]),f=be([]),E=Ne(()=>f.filter(a=>a.type==="file"&&a.selected&&a.targetName&&a.name!==a.targetName)),H=(a,t,l=0)=>{const e={indent:l,name:a.name,fullName:a.fullName,parentItem:t,show:!0,folded:!1,selected:!1,type:a.type,node:a};if(f.push(e),a.type==="folder")for(const d of a.children)H(d,e,l+1)},T=(a,t)=>{a.folded=t,a.node.children.forEach(l=>{const e=f.find(d=>d.node.id===l.id);e.show=!t,e.type==="folder"&&t&&T(e,t)})},x=a=>{const t=f.find(l=>l.node.id===a.id);if(a.type==="folder"){let l=0,e=0;return a.children.forEach(d=>{switch(x(d)){case 1:l++;break;case 0:e++;break}}),l===0&&e===0?(t.selected=!1,t.indeterminate=!1,-1):l===a.children.length?(t.selected=!0,t.indeterminate=!1,1):(t.indeterminate=!0,0)}else return t.indeterminate=!1,t.selected?1:-1},P=a=>{const t=l=>{l.node.children.forEach(e=>{const d=f.find(ee=>ee.node.id===e.id);d&&(d.selected=l.selected,d.selected&&(d.show=!0,d.folded=!1),d.type==="folder"&&t(d))}),l.selected&&(l.show=!0,l.folded=!1)};t(a),x(m.node),U()},j=a=>{x(m.node),U([a])},U=async a=>{if(await L.value?.validate(),!N.value)return;let t;try{t=new RegExp(F.value,_.value.join(""))}catch{return}(a||f).forEach(e=>{e.type==="file"&&(e.selected&&t.test(e.name)?(e.targetName=e.name.replace(t,C.value),e.targetFullName=(e.parentItem.fullName===""?"":e.parentItem.fullName+"/")+e.targetName):(e.targetName=void 0,e.targetFullName=void 0),e.notChanged=e.name===e.targetName)}),$.value=!1;const l=new Map;f.filter(e=>!!e.targetFullName).forEach(e=>{l.set(e.targetFullName,(l.get(e.targetFullName)||0)+1)}),f.forEach(e=>{e.duplicated=l.get(e.targetFullName)>1,e.duplicated&&($.value=!0)})},Z=async()=>{if(!E.value.length)return B.warn(g("dialogs.bulkRenameFiles.nothing_to_do"));const a=[];for(const t of E.value)a.push(K.renameTorrentFile(m.hash,t.fullName,t.targetFullName));w.value=!0,Promise.all(a).then(()=>{B.success(g("dialogs.bulkRenameFiles.success")),D.value?.saveValueToHistory(),S.value?.saveValueToHistory()}).catch(t=>{B.error(t.toString())}).finally(()=>{w.value=!1,K.updateFileTree(),A()})},A=()=>{b.value=!1};return Fe([F,_,C],()=>{U()}),_e(()=>{H(m.node)}),(a,t)=>(n(),r(he,{modelValue:c(b),"onUpdate:modelValue":t[6]||(t[6]=l=>Re(b)?b.value=l:null),persistent:"",fullscreen:""},{default:o(()=>[s(me,{density:"compact"},{default:o(()=>[s(te,null,{default:o(()=>[s(oe,{density:"compact",color:"transparent"},{default:o(()=>[s(ne,null,{default:o(()=>[y(i(a.$t("dialogs.bulkRenameFiles.title")),1)]),_:1}),s(q,{icon:"mdi-close",onClick:t[0]||(t[0]=l=>A())})]),_:1})]),_:1}),s(se,{class:"d-flex flex-column"},{default:o(()=>[s(c(de),{modelValue:N.value,"onUpdate:modelValue":t[5]||(t[5]=l=>N.value=l),ref_key:"form",ref:L},{default:o(()=>[s(re,{"no-gutters":"",align:"center",justify:"center"},{default:o(()=>[s(h,{cols:a.$vuetify.display.mobile?9:void 0},{default:o(()=>[s(z,{historyKey:c(G).BULK_RENAME_REGEXP,ref_key:"regexpEl",ref:D,"hide-details":"",density:"compact",modelValue:F.value,"onUpdate:modelValue":t[1]||(t[1]=l=>F.value=l),rules:M,label:a.$t("dialogs.bulkRenameFiles.regexp")},null,8,["historyKey","modelValue","label"])]),_:1},8,["cols"]),s(h,{cols:a.$vuetify.display.mobile?3:"auto"},{default:o(()=>[s(ue,{class:"ml-2",modelValue:_.value,"onUpdate:modelValue":t[2]||(t[2]=l=>_.value=l),items:["d","g","i","m","s","u","v","y"],placeholder:c(g)("dialogs.bulkRenameFiles.select_regex_flags"),label:a.$t("dialogs.bulkRenameFiles.flags"),density:"compact",multiple:"","hide-details":""},null,8,["modelValue","placeholder","label"])]),_:1},8,["cols"]),s(h,{cols:"auto"},{default:o(()=>[s(u,{class:"mx-2",icon:`mdi-arrow-${a.$vuetify.display.mobile?"down":"right"}`},null,8,["icon"])]),_:1}),s(h,{cols:a.$vuetify.display.mobile?12:void 0},{default:o(()=>[s(z,{historyKey:c(G).BULK_RENAME_TARGET,ref_key:"targetEl",ref:S,"hide-details":"",density:"compact",modelValue:C.value,"onUpdate:modelValue":t[3]||(t[3]=l=>C.value=l),rules:M,label:a.$t("dialogs.bulkRenameFiles.target")},null,8,["historyKey","modelValue","label"])]),_:1},8,["cols"]),s(h,{cols:"auto"},{default:o(()=>[s(ie,{class:R(a.$vuetify.display.mobile?"mt-2":"ml-5"),color:"success",location:"top left",content:E.value.length},{default:o(()=>[s(q,{loading:w.value,disabled:!N.value||$.value,color:"primary",onClick:t[4]||(t[4]=l=>Z())},{default:o(()=>[y(i(a.$t("dialogs.bulkRenameFiles.run")),1)]),_:1},8,["loading","disabled"])]),_:1},8,["class","content"])]),_:1})]),_:1})]),_:1},8,["modelValue"]),a.$vuetify.display.mobile?(n(),r(pe,{key:1},{default:o(()=>[(n(!0),V(W,null,Ce(f,(l,e)=>(n(),V(W,null,[l.show?(n(),r(ge,{key:0},{default:o(()=>[e>0?(n(),r(ye,{key:0,class:"my-2"})):v("",!0),k("div",{class:"d-flex align-center",style:Q({"padding-left":`${l.indent*16}px`})},[s(J,{modelValue:l.selected,"onUpdate:modelValue":d=>l.selected=d,inline:"",color:l.targetName&&"accent",indeterminate:l.type==="folder"&&l.indeterminate,onChange:d=>l.type==="file"?j(l):P(l)},null,8,["modelValue","onUpdate:modelValue","color","indeterminate","onChange"]),l.type==="folder"?(n(),r(u,{key:0,onClick:d=>l.type==="folder"&&T(l,!l.folded)},{default:o(()=>[y(i(`mdi-chevron-${l.folded?"down":"up"}`),1)]),_:2},1032,["onClick"])):v("",!0),l.fullName===""?(n(),r(u,{key:1,icon:"mdi-file-tree"})):l.type==="file"?(n(),r(u,{key:2,icon:c(O)(l.name)},null,8,["icon"])):l.folded?(n(),r(u,{key:4,icon:"mdi-folder",color:"#ffe476"})):(n(),r(u,{key:3,icon:"mdi-folder-open",color:"#ffe476"})),k("div",Te,[k("span",{class:R({"text-grey strikethrough":l.targetName})},i(l.name),3),k("span",null,i(l.targetName),1)])],4)]),_:2},1024)):v("",!0)],64))),256))]),_:1})):(n(),r(ce,{key:0,headers:c(Y),items:f,density:"compact","fixed-header":""},{item:o(({internalItem:l})=>[l.raw.show?(n(),r(fe,{key:0,item:l},{"item.selected":o(({item:e})=>[s(J,{modelValue:e.selected,"onUpdate:modelValue":d=>e.selected=d,color:e.targetName&&"accent",indeterminate:e.type==="folder"&&e.indeterminate,onChange:d=>e.type==="file"?j(e):P(e)},null,8,["modelValue","onUpdate:modelValue","color","indeterminate","onChange"])]),"item.name":o(({item:e})=>[k("span",{class:R(["fold-toggle",{"cursor-pointer":e.type==="folder"}]),style:Q({"padding-left":`${e.indent*16}px`}),onClick:d=>e.type==="folder"&&T(e,!e.folded)},[e.type==="folder"?(n(),r(I,{key:0,location:"top",activator:"parent"},{default:o(()=>[y(i(c(g)(`dialogs.bulkRenameFiles.${e.folded?"unfold":"fold"}`)),1)]),_:2},1024)):v("",!0),e.type==="folder"?(n(),r(u,{key:1},{default:o(()=>[y(i(`mdi-chevron-${e.folded?"down":"up"}`),1)]),_:2},1024)):(n(),r(u,{key:2})),e.fullName===""?(n(),r(u,{key:3,icon:"mdi-file-tree"})):e.type==="file"?(n(),r(u,{key:4,icon:c(O)(e.name)},null,8,["icon"])):e.folded?(n(),r(u,{key:6,icon:"mdi-folder",color:"#ffe476"})):(n(),r(u,{key:5,icon:"mdi-folder-open",color:"#ffe476"})),y(" "+i(e.name),1)],14,$e)]),"item.targetName":o(({item:e})=>[e.type==="file"?(n(),V("span",{key:0,class:R(["target-name",{duplicated:e.duplicated,"not-changed":e.notChanged}])},[e.duplicated||e.notChanged?(n(),r(I,{key:0,activator:"parent"},{default:o(()=>[y(i(c(g)(`dialogs.bulkRenameFiles.${e.duplicated?"duplicated":"not_changed"}`)),1)]),_:2},1024)):(n(),V("span",we,i(e.targetName),1))],2)):(n(),V("span",Ee,[s(u,{icon:"mdi-cancel",color:"grey-lighten-1"}),s(I,{activator:"parent"},{default:o(()=>[y(i(c(g)("dialogs.bulkRenameFiles.notForFolder")),1)]),_:1})]))]),_:2},1032,["item"])):v("",!0)]),_:1},8,["headers","items"]))]),_:1})]),_:1})]),_:1},8,["modelValue"]))}})});export{Ke as default,__tla}; import{a as le,b as ae,V as te,I as oe,J as ne,h as q,c as se,d as de,p as re,r as h,K as z,M as G,t as ue,k as u,N as ie,O as ce,P as fe,v as J,Q as I,q as pe,s as ge,w as ye,i as me,j as he,__tla as __tla_0}from"./index-C0tfT_Qc.js";import{g as O}from"./FileIcon-DH65fwz5.js";import{j as ke,E as ve,f as p,d as Ve,r as be,c as Ne,w as Fe,Y as _e,H as n,I as r,J as o,n as s,K as y,L as i,u as c,_ as R,U as k,N as v,W as Q,Q as V,V as Ce,F as W,P as Re,Z as B}from"./vue-CfSjRv-x.js";import"./vuetify-PctCzU6r.js";let Ke;let __tla=Promise.all([(()=>{try{return __tla_0}catch{}})()]).then(async()=>{let $e,we,Ee,Te;$e=["onClick"];we={key:1};Ee={key:1};Te={class:"d-flex flex-column pl-3"};Ke=ke({__name:"BulkRenameFilesDialog",props:{guid:{},node:{},hash:{}},setup(X){const m=X,{isOpened:b}=le(m.guid),{t:g}=ve(),K=ae(),L=p(),N=p(!1),$=p(!1),F=p(""),D=p(),_=p([]),C=p(""),S=p(),w=p(!1),M=[a=>!!a],Y=Ve([{fixed:!0,sortable:!1,key:"selected",width:"50px"},{title:g("dialogs.bulkRenameFiles.col_origin_name"),sortable:!1,key:"name"},{title:g("dialogs.bulkRenameFiles.col_result_name"),sortable:!1,key:"targetName"}]),f=be([]),E=Ne(()=>f.filter(a=>a.type==="file"&&a.selected&&a.targetName&&a.name!==a.targetName)),j=(a,t,l=0)=>{const e={indent:l,name:a.name,fullName:a.fullName,parentItem:t,show:!0,folded:!1,selected:!1,type:a.type,node:a};if(f.push(e),a.type==="folder")for(const d of a.children)j(d,e,l+1)},T=(a,t)=>{a.folded=t,a.node.children.forEach(l=>{const e=f.find(d=>d.node.id===l.id);e.show=!t,e.type==="folder"&&t&&T(e,t)})},x=a=>{const t=f.find(l=>l.node.id===a.id);if(a.type==="folder"){let l=0,e=0;return a.children.forEach(d=>{switch(x(d)){case 1:l++;break;case 0:e++;break}}),l===0&&e===0?(t.selected=!1,t.indeterminate=!1,-1):l===a.children.length?(t.selected=!0,t.indeterminate=!1,1):(t.indeterminate=!0,0)}else return t.indeterminate=!1,t.selected?1:-1},H=a=>{const t=l=>{l.node.children.forEach(e=>{const d=f.find(ee=>ee.node.id===e.id);d&&(d.selected=l.selected,d.selected&&(d.show=!0,d.folded=!1),d.type==="folder"&&t(d))}),l.selected&&(l.show=!0,l.folded=!1)};t(a),x(m.node),U()},P=a=>{x(m.node),U([a])},U=async a=>{if(await L.value?.validate(),!N.value)return;let t;try{t=new RegExp(F.value,_.value.join(""))}catch{return}(a||f).forEach(e=>{e.type==="file"&&(e.selected&&t.test(e.name)?(e.targetName=e.name.replace(t,C.value),e.targetFullName=(e.parentItem.fullName===""?"":e.parentItem.fullName+"/")+e.targetName):(e.targetName=void 0,e.targetFullName=void 0),e.notChanged=e.name===e.targetName)}),$.value=!1;const l=new Map;f.filter(e=>!!e.targetFullName).forEach(e=>{l.set(e.targetFullName,(l.get(e.targetFullName)||0)+1)}),f.forEach(e=>{e.duplicated=l.get(e.targetFullName)>1,e.duplicated&&($.value=!0)})},Z=async()=>{if(!E.value.length)return B.warn(g("dialogs.bulkRenameFiles.nothing_to_do"));const a=[];for(const t of E.value)a.push(K.renameTorrentFile(m.hash,t.fullName,t.targetFullName));w.value=!0,Promise.all(a).then(()=>{B.success(g("dialogs.bulkRenameFiles.success")),D.value?.saveValueToHistory(),S.value?.saveValueToHistory()}).catch(t=>{B.error(t.toString())}).finally(()=>{w.value=!1,K.updateFileTree(),A()})},A=()=>{b.value=!1};return Fe([F,_,C],()=>{U()}),_e(()=>{j(m.node)}),(a,t)=>(n(),r(he,{modelValue:c(b),"onUpdate:modelValue":t[6]||(t[6]=l=>Re(b)?b.value=l:null),persistent:"",fullscreen:""},{default:o(()=>[s(me,{density:"compact"},{default:o(()=>[s(te,null,{default:o(()=>[s(oe,{density:"compact",color:"transparent"},{default:o(()=>[s(ne,null,{default:o(()=>[y(i(a.$t("dialogs.bulkRenameFiles.title")),1)]),_:1}),s(q,{icon:"mdi-close",onClick:t[0]||(t[0]=l=>A())})]),_:1})]),_:1}),s(se,{class:"d-flex flex-column"},{default:o(()=>[s(c(de),{modelValue:N.value,"onUpdate:modelValue":t[5]||(t[5]=l=>N.value=l),ref_key:"form",ref:L},{default:o(()=>[s(re,{"no-gutters":"",align:"center",justify:"center"},{default:o(()=>[s(h,{cols:a.$vuetify.display.mobile?9:void 0},{default:o(()=>[s(z,{historyKey:c(G).BULK_RENAME_REGEXP,ref_key:"regexpEl",ref:D,"hide-details":"",density:"compact",modelValue:F.value,"onUpdate:modelValue":t[1]||(t[1]=l=>F.value=l),rules:M,label:a.$t("dialogs.bulkRenameFiles.regexp")},null,8,["historyKey","modelValue","label"])]),_:1},8,["cols"]),s(h,{cols:a.$vuetify.display.mobile?3:"auto"},{default:o(()=>[s(ue,{class:"ml-2",modelValue:_.value,"onUpdate:modelValue":t[2]||(t[2]=l=>_.value=l),items:["d","g","i","m","s","u","v","y"],placeholder:c(g)("dialogs.bulkRenameFiles.select_regex_flags"),label:a.$t("dialogs.bulkRenameFiles.flags"),density:"compact",multiple:"","hide-details":""},null,8,["modelValue","placeholder","label"])]),_:1},8,["cols"]),s(h,{cols:"auto"},{default:o(()=>[s(u,{class:"mx-2",icon:`mdi-arrow-${a.$vuetify.display.mobile?"down":"right"}`},null,8,["icon"])]),_:1}),s(h,{cols:a.$vuetify.display.mobile?12:void 0},{default:o(()=>[s(z,{historyKey:c(G).BULK_RENAME_TARGET,ref_key:"targetEl",ref:S,"hide-details":"",density:"compact",modelValue:C.value,"onUpdate:modelValue":t[3]||(t[3]=l=>C.value=l),rules:M,label:a.$t("dialogs.bulkRenameFiles.target")},null,8,["historyKey","modelValue","label"])]),_:1},8,["cols"]),s(h,{cols:"auto"},{default:o(()=>[s(ie,{class:R(a.$vuetify.display.mobile?"mt-2":"ml-5"),color:"success",location:"top left",content:E.value.length},{default:o(()=>[s(q,{loading:w.value,disabled:!N.value||$.value,color:"primary",onClick:t[4]||(t[4]=l=>Z())},{default:o(()=>[y(i(a.$t("dialogs.bulkRenameFiles.run")),1)]),_:1},8,["loading","disabled"])]),_:1},8,["class","content"])]),_:1})]),_:1})]),_:1},8,["modelValue"]),a.$vuetify.display.mobile?(n(),r(pe,{key:1},{default:o(()=>[(n(!0),V(W,null,Ce(f,(l,e)=>(n(),V(W,null,[l.show?(n(),r(ge,{key:0},{default:o(()=>[e>0?(n(),r(ye,{key:0,class:"my-2"})):v("",!0),k("div",{class:"d-flex align-center",style:Q({"padding-left":`${l.indent*16}px`})},[s(J,{modelValue:l.selected,"onUpdate:modelValue":d=>l.selected=d,inline:"",color:l.targetName&&"accent",indeterminate:l.type==="folder"&&l.indeterminate,onChange:d=>l.type==="file"?P(l):H(l)},null,8,["modelValue","onUpdate:modelValue","color","indeterminate","onChange"]),l.type==="folder"?(n(),r(u,{key:0,onClick:d=>l.type==="folder"&&T(l,!l.folded)},{default:o(()=>[y(i(`mdi-chevron-${l.folded?"down":"up"}`),1)]),_:2},1032,["onClick"])):v("",!0),l.fullName===""?(n(),r(u,{key:1,icon:"mdi-file-tree"})):l.type==="file"?(n(),r(u,{key:2,icon:c(O)(l.name)},null,8,["icon"])):l.folded?(n(),r(u,{key:4,icon:"mdi-folder",color:"#ffe476"})):(n(),r(u,{key:3,icon:"mdi-folder-open",color:"#ffe476"})),k("div",Te,[k("span",{class:R({"text-grey strikethrough":l.targetName})},i(l.name),3),k("span",null,i(l.targetName),1)])],4)]),_:2},1024)):v("",!0)],64))),256))]),_:1})):(n(),r(ce,{key:0,headers:c(Y),items:f,density:"compact","fixed-header":""},{item:o(({internalItem:l})=>[l.raw.show?(n(),r(fe,{key:0,item:l},{"item.selected":o(({item:e})=>[s(J,{modelValue:e.selected,"onUpdate:modelValue":d=>e.selected=d,color:e.targetName&&"accent",indeterminate:e.type==="folder"&&e.indeterminate,onChange:d=>e.type==="file"?P(e):H(e)},null,8,["modelValue","onUpdate:modelValue","color","indeterminate","onChange"])]),"item.name":o(({item:e})=>[k("span",{class:R(["fold-toggle",{"cursor-pointer":e.type==="folder"}]),style:Q({"padding-left":`${e.indent*16}px`}),onClick:d=>e.type==="folder"&&T(e,!e.folded)},[e.type==="folder"?(n(),r(I,{key:0,location:"top",activator:"parent"},{default:o(()=>[y(i(c(g)(`dialogs.bulkRenameFiles.${e.folded?"unfold":"fold"}`)),1)]),_:2},1024)):v("",!0),e.type==="folder"?(n(),r(u,{key:1},{default:o(()=>[y(i(`mdi-chevron-${e.folded?"down":"up"}`),1)]),_:2},1024)):(n(),r(u,{key:2})),e.fullName===""?(n(),r(u,{key:3,icon:"mdi-file-tree"})):e.type==="file"?(n(),r(u,{key:4,icon:c(O)(e.name)},null,8,["icon"])):e.folded?(n(),r(u,{key:6,icon:"mdi-folder",color:"#ffe476"})):(n(),r(u,{key:5,icon:"mdi-folder-open",color:"#ffe476"})),y(" "+i(e.name),1)],14,$e)]),"item.targetName":o(({item:e})=>[e.type==="file"?(n(),V("span",{key:0,class:R(["target-name",{duplicated:e.duplicated,"not-changed":e.notChanged}])},[e.duplicated||e.notChanged?(n(),r(I,{key:0,activator:"parent"},{default:o(()=>[y(i(c(g)(`dialogs.bulkRenameFiles.${e.duplicated?"duplicated":"not_changed"}`)),1)]),_:2},1024)):(n(),V("span",we,i(e.targetName),1))],2)):(n(),V("span",Ee,[s(u,{icon:"mdi-cancel",color:"grey-lighten-1"}),s(I,{activator:"parent"},{default:o(()=>[y(i(c(g)("dialogs.bulkRenameFiles.notForFolder")),1)]),_:1})]))]),_:2},1032,["item"])):v("",!0)]),_:1},8,["headers","items"]))]),_:1})]),_:1})]),_:1},8,["modelValue"]))}})});export{Ke as default,__tla};

View File

@@ -0,0 +1 @@
import{D as c,n,__tla as __tla_0}from"./TorrentDetail-CKmHZcwa.js";let C;let __tla=Promise.all([(()=>{try{return __tla_0}catch{}})()]).then(async()=>{class l{constructor(a){this._canvasPool=Object.create(null),this.canvasOptions=a||{},this.enableFullScreen=!1}_createCanvasAndContext(a,s){const t=c.get().createCanvas();t.width=a,t.height=s;const o=t.getContext("2d");return{canvas:t,context:o}}getOptimalCanvasAndContext(a,s,t=1){a=Math.ceil(a*t-1e-6),s=Math.ceil(s*t-1e-6),a=n(a),s=n(s);const o=(a<<17)+(s<<1);this._canvasPool[o]||(this._canvasPool[o]=[]);let e=this._canvasPool[o].pop();return e||(e=this._createCanvasAndContext(a,s)),e}returnCanvasAndContext(a){const s=a.canvas,{width:t,height:o}=s,e=(t<<17)+(o<<1);this._canvasPool[e].push(a)}clear(){this._canvasPool={}}}C=new l});export{C,__tla};

View File

@@ -1 +0,0 @@
import{D as c,n,__tla as __tla_0}from"./TorrentDetail-BZZ-B8cw.js";let C;let __tla=Promise.all([(()=>{try{return __tla_0}catch{}})()]).then(async()=>{class l{constructor(a){this._canvasPool=Object.create(null),this.canvasOptions=a||{},this.enableFullScreen=!1}_createCanvasAndContext(a,t){const s=c.get().createCanvas();s.width=a,s.height=t;const e=s.getContext("2d");return{canvas:s,context:e}}getOptimalCanvasAndContext(a,t,s=1){a=Math.ceil(a*s-1e-6),t=Math.ceil(t*s-1e-6),a=n(a),t=n(t);const e=(a<<17)+(t<<1);this._canvasPool[e]||(this._canvasPool[e]=[]);let o=this._canvasPool[e].pop();return o||(o=this._createCanvasAndContext(a,t)),o}returnCanvasAndContext(a){const{width:t,height:s}=a.canvas,e=(t<<17)+(s<<1);this._canvasPool[e].push(a)}clear(){this._canvasPool={}}}C=new l});export{C,__tla};

View File

@@ -0,0 +1 @@
import{k as M,g as F,Y as I,q as K,s as q,a as L,Z as A,$ as O,V as j,c as z,d as G,e as J,K as Q,M as W,f as Y,h as R,i as Z,j as X,m as x,a0 as D,a1 as ee,__tla as __tla_0}from"./index-C0tfT_Qc.js";import{j as T,a0 as ae,H as l,I as n,J as o,U as oe,K as f,L as d,N as y,Q as g,n as t,V as N,q as E,F as H,a1 as le,a2 as te,a3 as se,E as U,f as $,r as ne,c as C,G as re,u as P,M as de,O as ue,P as ie,$ as ce,W as me}from"./vue-CfSjRv-x.js";import{a as fe}from"./vuetify-PctCzU6r.js";let ke,ge,_e;let __tla=Promise.all([(()=>{try{return __tla_0}catch{}})()]).then(async()=>{let pe,ve,he,Ve;pe={class:"d-flex"};ve={key:2};he={key:3};Ve=T({__name:"RightClickMenuEntry",props:{text:{},icon:{},action:{type:Function},hidden:{type:Boolean},disabled:{type:Boolean},disabledText:{},disabledIcon:{},children:{}},setup(c){const e=c,s=()=>{e.action&&e.action()};return(a,r)=>{const p=ae("RightClickMenuEntry",!0);return a.hidden?y("",!0):(l(),n(q,{key:0,class:"px-3",disabled:a.disabled,onClick:s},{default:o(()=>[oe("div",pe,[a.disabled&&a.disabledIcon?(l(),n(M,{key:0,class:"mr-2"},{default:o(()=>[f(d(a.disabledIcon),1)]),_:1})):a.icon?(l(),n(M,{key:1,class:"mr-2"},{default:o(()=>[f(d(a.icon),1)]),_:1})):y("",!0),a.disabled&&a.disabledText?(l(),g("span",ve,d(a.disabledText),1)):(l(),g("span",he,d(a.text),1)),t(F),!a.disabled&&a.children?(l(),n(M,{key:4},{default:o(()=>[f("mdi-chevron-right")]),_:1})):y("",!0)]),a.children?(l(),n(I,{key:0,activator:"parent","open-on-hover":"","open-on-click":"","close-delay":"10","open-delay":"0",location:"right"},{default:o(()=>[t(K,null,{default:o(()=>[(l(!0),g(H,null,N(a.children,v=>(l(),n(p,E({ref_for:!0},v),null,16))),256))]),_:1})]),_:1})):y("",!0)]),_:1},8,["disabled"]))}}});ge=T({__name:"RightClickMenu",props:le({menuData:{}},{modelValue:{type:Boolean,required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(c){const e=te(c,"modelValue");return(s,a)=>e.value?(l(),n(I,{key:0,modelValue:e.value,"onUpdate:modelValue":a[0]||(a[0]=r=>e.value=r),activator:"parent","close-on-content-click":!0,transition:"slide-y-transition","scroll-strategy":"none"},{default:o(()=>[t(K,null,{default:o(()=>[se(s.$slots,"top"),(l(!0),g(H,null,N(s.menuData,r=>(l(),n(Ve,E({ref_for:!0},r),null,16))),256))]),_:3})]),_:3},8,["modelValue"])):y("",!0)}});ke=T({__name:"MoveTorrentDialog",props:{guid:{},hashes:{},mode:{}},setup(c){const e=c,{isOpened:s}=L(e.guid),{t:a}=U(),r=A(),p=O(),v=$(),k=$(),h=$(!1),m=ne({newPath:""}),w=[u=>!!u||a("dialogs.moveTorrent.required")],V=C(()=>e.hashes.map(p.getTorrentByHash)),_=C(()=>{switch(e.mode){case"dl":return V.value[0]?.download_path;case"save":return V.value[0]?.savePath}});async function B(){await v.value?.validate(),h.value&&(await r.toggleAutoTmm(e.hashes,!1),await p.moveTorrents(e.mode,e.hashes,m.newPath),k.value?.saveValueToHistory(),S())}const S=()=>{s.value=!1};return re(()=>{m.newPath=_.value||""}),(u,i)=>(l(),n(X,{modelValue:P(s),"onUpdate:modelValue":i[3]||(i[3]=b=>ie(s)?s.value=b:null)},{default:o(()=>[t(Z,null,{default:o(()=>[t(j,null,{default:o(()=>[f(d(u.$t(`dialogs.moveTorrent.${u.mode}.title`)),1)]),_:1}),t(z,null,{default:o(()=>[t(P(G),{modelValue:h.value,"onUpdate:modelValue":i[1]||(i[1]=b=>h.value=b),ref_key:"form",ref:v,onSubmit:i[2]||(i[2]=de(()=>{},["prevent"]))},{default:o(()=>[_.value?(l(),n(J,{key:0,"model-value":_.value,disabled:"",label:u.$t("dialogs.moveTorrent.oldPath")},null,8,["model-value","label"])):y("",!0),t(Q,{modelValue:m.newPath,"onUpdate:modelValue":i[0]||(i[0]=b=>m.newPath=b),historyKey:P(W).TORRENT_PATH,ref_key:"field",ref:k,rules:w,autofocus:"",label:u.$t("dialogs.moveTorrent.newPath"),onKeydown:ue(B,["enter"])},null,8,["modelValue","historyKey","label"])]),_:1},8,["modelValue"])]),_:1}),t(Y,null,{default:o(()=>[t(F),t(R,{color:"error",onClick:S},{default:o(()=>[f(d(u.$t("common.cancel")),1)]),_:1}),t(R,{color:"accent",disabled:!h.value,onClick:B},{default:o(()=>[f(d(u.$t("common.save")),1)]),_:1},8,["disabled"])]),_:1})]),_:1})]),_:1},8,["modelValue"]))}});_e=T({__name:"ColoredChip",props:{defaultColor:{},disabled:{type:Boolean,default:!1},disabledValue:{},value:{}},setup(c){const e=c,{t:s}=U(),{current:a}=fe(),{enableHashColors:r,hideColoredChip:p}=ce(x());function v(V){return a.value.colors[V]??V}const k=C(()=>e.disabled||!r.value?e.defaultColor:D(e.value)),h=C(()=>e.disabled||!r.value?v(e.defaultColor):D(e.value)),m=C(()=>e.disabled?e.disabledValue||e.value||s("common.none"):e.value),w=C(()=>!p.value);return(V,_)=>w.value?(l(),n(ee,{key:0,color:k.value,variant:"flat"},{default:o(()=>[f(d(m.value),1)]),_:1},8,["color"])):(l(),g("div",{key:1,class:"text-no-wrap",style:me(`color: ${h.value}`)},d(m.value),5))}})});export{ke as _,ge as a,_e as b,__tla};

View File

@@ -0,0 +1 @@
#torrentList[data-v-d4d10d01],#torrentList[data-v-8828dd56],#torrentList[data-v-403c3005]{background-color:unset}#torrentList tbody tr[data-v-403c3005]:nth-child(odd){background-color:rgb(var(--v-theme-surface))}#torrentList tbody tr.selected[data-v-403c3005]{position:relative}#torrentList tbody tr.selected[data-v-403c3005]:nth-child(odd):after{content:"";position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none}

View File

@@ -1 +0,0 @@
#torrentList[data-v-8ab52227],#torrentList[data-v-57c5171f],#torrentList[data-v-13e3f0fc]{background-color:unset}#torrentList tbody tr[data-v-13e3f0fc]:nth-child(odd){background-color:rgb(var(--v-theme-surface))}#torrentList tbody tr.selected[data-v-13e3f0fc]{position:relative}#torrentList tbody tr.selected[data-v-13e3f0fc]:nth-child(odd):after{content:"";position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none}.v-autocomplete .v-field:not(.v-field--focused) input{display:none}

View File

@@ -1 +0,0 @@
import{h as C,E as ke,$ as U,c as b,H as n,Q as p,U as g,n as r,u as d,J as c,W as $e,L as v,F as N,q as K,I as P,N as I,f as R,r as ze,G as Ce,Y as qe,K as x,M as J,O as ge,P as pe,S as Ye,Z as Fe,V as X,_ as ne,a5 as Be,a6 as Xe,a7 as vt,a8 as ht,w as ft,v as _t,x as Ie,a9 as yt}from"./vue-BQgCUbk_.js";import{aL as Z,aM as bt,$ as re,aN as f,e as ee,Q as W,Y as gt,aO as Tt,g as Se,h as O,aP as Y,k as De,q as je,s as me,a as xe,V as Le,c as ve,d as Oe,f as Me,i as se,j as Re,Z as Ve,aQ as kt,aR as Pe,p as Ne,r as ye,v as be,E as We,a9 as $t,aS as Ze,m as F,aT as Te,aU as Qe,aV as Ct,aW as St,aX as Je,C as we,aY as et,aZ as tt,a_ as Vt,a$ as wt,b0 as D,b1 as ot,ac as Ue,X as Et,b2 as It,aH as Dt,b3 as Pt,x as Ke,b4 as Ae,b5 as At,__tla as __tla_0}from"./index-DF2-l4SD.js";import{d as Bt}from"./index-UntZWul-.js";import{_ as He,a as xt,__tla as __tla_1}from"./MoveTorrentDialog.vue_vue_type_script_setup_true_lang-G1lEzMcG.js";import{a as at,u as lt}from"./vuetify-DWkLi8Ew.js";import{u as Lt,__tla as __tla_2}from"./ArrayPagination-O41uS7-1.js";let ua;let __tla=Promise.all([(()=>{try{return __tla_0}catch{}})(),(()=>{try{return __tla_1}catch{}})(),(()=>{try{return __tla_2}catch{}})()]).then(async()=>{let Ot,Mt,Rt,Nt,Ut,le,q,Ft,Ge,Kt,Ht,Gt,zt,qt,nt,Yt,Xt,jt,rt,Wt,Zt,Qt,st,Jt,eo,to,oo,it,ao,lo,no,ro,dt,so,io,ut,uo,co,ct,mo,po,vo,mt,ho,fo,pt,_o,yo,bo,go,To,ko,$o,Co,So,Vo,wo,Eo,Io,Do,Po,Ao,Bo,xo,Lo,Oo,Mo,Ro,No,Uo,Fo,Ko,Ho,Go,zo,qo,Yo,Xo,jo,Wo,Zo,Qo,Jo,ea,ta,oa,aa;Ot={class:"d-flex my-3"};Mt={class:"pa-0"};Rt={class:"d-flex align-center text-uppercase text-select",style:{"font-size":"0.8em"}};Nt=C({__name:"Toolbar",setup(y){const{t:e}=ke(),s=Z(),{torrentCountString:t,isSelectionMultiple:o,displayMode:i}=U(s),{isDrawerOpen:a}=U(bt()),u=re(),{sortOptions:m}=U(u),l=[{value:f.ADDED_ON,title:e("dashboard.sortBy.added_on")},{value:f.AMOUNT_LEFT,title:e("dashboard.sortBy.amount_left")},{value:f.AUTO_TMM,title:e("dashboard.sortBy.auto_tmm")},{value:f.AVAILABILITY,title:e("dashboard.sortBy.availability")},{value:f.AVG_DOWNLOAD_SPEED,title:e("dashboard.sortBy.avg_download_speed")},{value:f.AVG_UPLOAD_SPEED,title:e("dashboard.sortBy.avg_upload_speed")},{value:f.CATEGORY,title:e("dashboard.sortBy.category")},{value:f.COMPLETED,title:e("dashboard.sortBy.completed")},{value:f.COMPLETION_ON,title:e("dashboard.sortBy.completion_on")},{value:f.CONTENT_PATH,title:e("dashboard.sortBy.content_path")},{value:f.DL_LIMIT,title:e("dashboard.sortBy.dl_limit")},{value:f.DLSPEED,title:e("dashboard.sortBy.dlspeed")},{value:f.DOWNLOAD_PATH,title:e("dashboard.sortBy.download_path")},{value:f.DOWNLOADED,title:e("dashboard.sortBy.downloaded")},{value:f.DOWNLOADED_SESSION,title:e("dashboard.sortBy.downloaded_session")},{value:f.ETA,title:e("dashboard.sortBy.eta")},{value:f.F_L_PIECE_PRIO,title:e("dashboard.sortBy.f_l_piece_prio")},{value:f.FORCE_START,title:e("dashboard.sortBy.force_start")},{value:f.GLOBALSPEED,title:e("dashboard.sortBy.globalSpeed")},{value:f.GLOBALVOLUME,title:e("dashboard.sortBy.globalVolume")},{value:f.HASH,title:e("dashboard.sortBy.hash")},{value:f.INFOHASH_V1,title:e("dashboard.sortBy.infohash_v1")},{value:f.INFOHASH_V2,title:e("dashboard.sortBy.infohash_v2")},{value:f.LAST_ACTIVITY,title:e("dashboard.sortBy.last_activity")},{value:f.MAGNET_URI,title:e("dashboard.sortBy.magnet_uri")},{value:f.MAX_RATIO,title:e("dashboard.sortBy.max_ratio")},{value:f.MAX_SEEDING_TIME,title:e("dashboard.sortBy.max_seeding_time")},{value:f.NAME,title:e("dashboard.sortBy.name")},{value:f.NUM_COMPLETE,title:e("dashboard.sortBy.num_complete")},{value:f.NUM_INCOMPLETE,title:e("dashboard.sortBy.num_incomplete")},{value:f.NUM_LEECHS,title:e("dashboard.sortBy.num_leechs")},{value:f.NUM_SEEDS,title:e("dashboard.sortBy.num_seeds")},{value:f.PRIORITY,title:e("dashboard.sortBy.priority")},{value:f.PROGRESS,title:e("dashboard.sortBy.progress")},{value:f.RATIO,title:e("dashboard.sortBy.ratio")},{value:f.RATIO_LIMIT,title:e("dashboard.sortBy.ratio_limit")},{value:f.SAVE_PATH,title:e("dashboard.sortBy.save_path")},{value:f.SEEDING_TIME,title:e("dashboard.sortBy.seeding_time")},{value:f.SEEDING_TIME_LIMIT,title:e("dashboard.sortBy.seeding_time_limit")},{value:f.SEEN_COMPLETE,title:e("dashboard.sortBy.seen_complete")},{value:f.SEQ_DL,title:e("dashboard.sortBy.seq_dl")},{value:f.SIZE,title:e("dashboard.sortBy.size")},{value:f.STATE,title:e("dashboard.sortBy.state")},{value:f.SUPER_SEEDING,title:e("dashboard.sortBy.super_seeding")},{value:f.TAGS,title:e("dashboard.sortBy.tags")},{value:f.TIME_ACTIVE,title:e("dashboard.sortBy.time_active")},{value:f.TOTAL_SIZE,title:e("dashboard.sortBy.total_size")},{value:f.TRACKER,title:e("dashboard.sortBy.tracker")},{value:f.TRACKERS_COUNT,title:e("dashboard.sortBy.trackers_count")},{value:f.UP_LIMIT,title:e("dashboard.sortBy.up_limit")},{value:f.UPLOADED,title:e("dashboard.sortBy.uploaded")},{value:f.UPLOADED_SESSION,title:e("dashboard.sortBy.uploaded_session")},{value:f.UPSPEED,title:e("dashboard.sortBy.upspeed")}].sort((A,T)=>A.title.localeCompare(T.title));l.splice(0,0,{value:f.DEFAULT,title:e("dashboard.sortBy.default")});function h(){u.textFilter=""}const _=b({get:()=>u.textFilter,set:Bt(A=>{u.textFilter=A??""},300)});function B(){o.value&&s.unselectAllTorrents(),o.value=!o.value}return(A,T)=>(n(),p(N,null,[g("div",null,[r(ee,{id:"searchInput",modelValue:_.value,"onUpdate:modelValue":T[0]||(T[0]=S=>_.value=S),label:d(e)("dashboard.searchInputLabel"),clearable:"",density:"compact","single-line":"","hide-details":"","prepend-inner-icon":"mdi-magnify",variant:"solo","onClick:clear":T[1]||(T[1]=S=>h())},null,8,["modelValue","label"])]),g("div",Ot,[r(W,{text:d(e)("dashboard.toggleSelectMode"),location:"top"},{activator:c(({props:S})=>[r(O,K({icon:d(o)?"mdi-checkbox-marked":"mdi-checkbox-blank-outline"},S,{variant:"plain",onClick:B}),null,16,["icon"])]),_:1},8,["text"]),r(gt,null,{activator:c(({props:S})=>[r(W,{text:A.$t("dashboard.displayMode.title"),location:"top"},{activator:c(({props:V})=>[r(O,K({icon:""},K(S,V),{variant:"plain"}),{default:c(()=>[d(i)===d(Y).LIST?(n(),P(De,{key:0,icon:"mdi-view-list"})):I("",!0),d(i)===d(Y).GRID?(n(),P(De,{key:1,icon:"mdi-view-grid"})):I("",!0),d(i)===d(Y).TABLE?(n(),P(De,{key:2,icon:"mdi-table"})):I("",!0)]),_:2},1040)]),_:2},1032,["text"])]),default:c(()=>[r(je,null,{default:c(()=>[r(me,{title:A.$t("dashboard.displayMode.list"),"prepend-icon":"mdi-view-list",onClick:T[2]||(T[2]=S=>i.value=d(Y).LIST)},null,8,["title"]),r(me,{title:A.$t("dashboard.displayMode.grid"),"prepend-icon":"mdi-view-grid",onClick:T[3]||(T[3]=S=>i.value=d(Y).GRID)},null,8,["title"]),r(me,{title:A.$t("dashboard.displayMode.table"),"prepend-icon":"mdi-table",onClick:T[4]||(T[4]=S=>i.value=d(Y).TABLE)},null,8,["title"])]),_:1})]),_:1}),r(W,{text:d(e)("dashboard.toggleSortOrder"),location:"top"},{activator:c(({props:S})=>[r(O,K({icon:d(m).reverseOrder?"mdi-arrow-up-thin":"mdi-arrow-down-thin"},S,{variant:"plain",onClick:T[5]||(T[5]=V=>d(m).reverseOrder=!d(m).reverseOrder)}),null,16,["icon"])]),_:1},8,["text"]),g("div",Mt,[r(Tt,{modelValue:d(m).sortBy,"onUpdate:modelValue":T[6]||(T[6]=S=>d(m).sortBy=S),items:d(l),label:d(e)("dashboard.sortLabel"),"auto-select-first":"",density:"compact","hide-details":"",variant:"solo-filled",style:$e(`width: ${A.$vuetify.display.xs||A.$vuetify.display.sm&&d(a)?140:260}px`)},null,8,["modelValue","items","label","style"])]),r(Se),g("div",Rt,v(d(t)),1)])],64))}});Ut=C({__name:"RenameTorrentDialog",props:{guid:{},hash:{}},setup(y){const e=y,{isOpened:s}=xe(e.guid),{t}=ke(),o=re(),i=R(),a=R(),u=R(!1),m=ze({newName:""}),l=[T=>!!T||t("dialogs.renameTorrent.required"),T=>T!==_.value||t("dialogs.renameTorrent.sameName")],h=b(()=>o.getTorrentByHash(e.hash)),_=b(()=>h.value?.name);async function B(){await a.value?.validate(),u.value&&(await o.renameTorrent(e.hash,m.newName),A())}const A=()=>{s.value=!1};return Ce(()=>{m.newName=h.value?.name||""}),qe(()=>{i.value?.select()}),(T,S)=>(n(),P(Re,{modelValue:d(s),"onUpdate:modelValue":S[3]||(S[3]=V=>pe(s)?s.value=V:null)},{default:c(()=>[r(se,null,{default:c(()=>[r(Le,null,{default:c(()=>[x(v(T.$t("dialogs.renameTorrent.title")),1)]),_:1}),r(ve,null,{default:c(()=>[r(d(Oe),{modelValue:u.value,"onUpdate:modelValue":S[1]||(S[1]=V=>u.value=V),ref_key:"form",ref:a,onSubmit:S[2]||(S[2]=J(()=>{},["prevent"]))},{default:c(()=>[_.value?(n(),P(ee,{key:0,"model-value":_.value,disabled:"",label:T.$t("dialogs.renameTorrent.oldName")},null,8,["model-value","label"])):I("",!0),r(ee,{modelValue:m.newName,"onUpdate:modelValue":S[0]||(S[0]=V=>m.newName=V),ref_key:"field",ref:i,rules:l,autofocus:"",label:T.$t("dialogs.renameTorrent.newName"),onKeydown:ge(B,["enter"])},null,8,["modelValue","label"])]),_:1},8,["modelValue"])]),_:1}),r(Me,null,{default:c(()=>[r(Se),r(O,{color:"error",onClick:A},{default:c(()=>[x(v(T.$t("common.cancel")),1)]),_:1}),r(O,{color:"accent",disabled:!u.value,onClick:B},{default:c(()=>[x(v(T.$t("common.save")),1)]),_:1},8,["disabled"])]),_:1})]),_:1})]),_:1},8,["modelValue"]))}});le=-2;q=-1;Ft=C({__name:"ShareLimitDialog",props:{guid:{},hashes:{}},setup(y){const e=y,{isOpened:s}=xe(e.guid),t=Ve(),o=re(),i=R(!1),a=R("global"),u=R(!1),m=R(0),l=R(!1),h=R(0),_=R(!1),B=R(0),A=b(()=>a.value!=="enabled");function T(){s.value=!1}async function S(){switch(a.value){case"global":await t.setShareLimit(e.hashes,le,le,le);break;case"disabled":await t.setShareLimit(e.hashes,q,q,q);break;case"enabled":await t.setShareLimit(e.hashes,u.value?m.value:q,l.value?h.value:q,_.value?B.value:q);break}T()}return Ce(async()=>{const V=o.getTorrentByHash(e.hashes[0]);if(!V)return T();const k=V.ratio_limit,w=V.seeding_time_limit,G=V.inactive_seeding_time_limit;k===le&&w===le&&G===le?a.value="global":k===q&&w===q&&G===q?a.value="disabled":(a.value="enabled",u.value=k>=0,m.value=u.value?k:0,l.value=w>=0,h.value=l.value?w:0,_.value=G>=0,B.value=_.value?G:0)}),(V,k)=>(n(),P(Re,{modelValue:d(s),"onUpdate:modelValue":k[9]||(k[9]=w=>pe(s)?s.value=w:null),"max-width":"500"},{default:c(()=>[r(se,{title:V.$t("dialogs.share_limit.title")},{default:c(()=>[r(ve,null,{default:c(()=>[r(Oe,{modelValue:i.value,"onUpdate:modelValue":k[7]||(k[7]=w=>i.value=w),onSubmit:k[8]||(k[8]=J(()=>{},["prevent"])),onKeydown:ge(J(S,["prevent"]),["enter"])},{default:c(()=>[r(kt,{modelValue:a.value,"onUpdate:modelValue":k[0]||(k[0]=w=>a.value=w)},{default:c(()=>[r(Pe,{label:V.$t("dialogs.share_limit.global"),value:"global"},null,8,["label"]),r(Pe,{label:V.$t("dialogs.share_limit.disabled"),value:"disabled"},null,8,["label"]),r(Pe,{label:V.$t("dialogs.share_limit.enabled"),value:"enabled"},null,8,["label"])]),_:1},8,["modelValue"]),r(Ne,null,{default:c(()=>[r(ye,{cols:"12",class:"d-flex align-center"},{default:c(()=>[g("span",null,[r(be,{modelValue:u.value,"onUpdate:modelValue":k[1]||(k[1]=w=>u.value=w),disabled:A.value},null,8,["modelValue","disabled"])]),r(ee,{modelValue:m.value,"onUpdate:modelValue":k[2]||(k[2]=w=>m.value=w),disabled:A.value||!u.value,density:"compact","hide-details":"",label:V.$t("dialogs.share_limit.ratio_limit")},null,8,["modelValue","disabled","label"])]),_:1}),r(ye,{cols:"12",class:"d-flex align-center"},{default:c(()=>[g("span",null,[r(be,{modelValue:l.value,"onUpdate:modelValue":k[3]||(k[3]=w=>l.value=w),disabled:A.value},null,8,["modelValue","disabled"])]),r(ee,{modelValue:h.value,"onUpdate:modelValue":k[4]||(k[4]=w=>h.value=w),disabled:A.value||!l.value,density:"compact","hide-details":"",label:V.$t("dialogs.share_limit.seeding_time_limit")},null,8,["modelValue","disabled","label"])]),_:1}),r(ye,{cols:"12",class:"d-flex align-center"},{default:c(()=>[g("span",null,[r(be,{modelValue:_.value,"onUpdate:modelValue":k[5]||(k[5]=w=>_.value=w),disabled:A.value},null,8,["modelValue","disabled"])]),r(ee,{modelValue:B.value,"onUpdate:modelValue":k[6]||(k[6]=w=>B.value=w),disabled:A.value||!_.value,density:"compact","hide-details":"",label:V.$t("dialogs.share_limit.inactive_seeding_time_limit")},null,8,["modelValue","disabled","label"])]),_:1})]),_:1})]),_:1},8,["modelValue","onKeydown"])]),_:1}),r(Me,null,{default:c(()=>[r(Se),r(O,{color:"error",onClick:T},{default:c(()=>[x(v(V.$t("common.cancel")),1)]),_:1}),r(O,{color:"accent",disabled:!i.value,onClick:S},{default:c(()=>[x(v(V.$t("common.save")),1)]),_:1},8,["disabled"])]),_:1})]),_:1},8,["title"])]),_:1},8,["modelValue"]))}});Ge=C({__name:"SpeedLimitDialog",props:{guid:{},hashes:{},mode:{}},setup(y){const e=y,{isOpened:s}=xe(e.guid),t=Ve(),o=re(),i=R(!1),a=R(0);function u(){s.value=!1}async function m(){const l=Math.max(0,a.value)*1e3;switch(e.mode){case"download":await t.setDownloadLimit(l,e.hashes);break;case"upload":await t.setUploadLimit(l,e.hashes);break}u()}return Ce(async()=>{const l=o.getTorrentByHash(e.hashes[0]);if(!l)return u();switch(e.mode){case"download":a.value=Math.max(0,Math.round(l.dl_limit/1e3));break;case"upload":a.value=Math.max(0,Math.round(l.up_limit/1e3));break}}),(l,h)=>(n(),P(Re,{modelValue:d(s),"onUpdate:modelValue":h[3]||(h[3]=_=>pe(s)?s.value=_:null)},{default:c(()=>[r(se,{title:l.$t(`dialogs.speed_limit.${l.mode}`)},{default:c(()=>[r(ve,null,{default:c(()=>[r(Oe,{modelValue:i.value,"onUpdate:modelValue":h[1]||(h[1]=_=>i.value=_),onSubmit:h[2]||(h[2]=J(()=>{},["prevent"])),onKeydown:ge(J(m,["prevent"]),["enter"])},{default:c(()=>[r(ee,{modelValue:a.value,"onUpdate:modelValue":h[0]||(h[0]=_=>a.value=_),modelModifiers:{number:!0},type:"number",autofocus:"",clearable:"",label:l.$t("dialogs.speed_limit.label"),"prepend-inner-icon":"mdi-speedometer",suffix:"kB/s",onKeydown:ge(J(m,["prevent"]),["enter"])},null,8,["modelValue","label","onKeydown"])]),_:1},8,["modelValue","onKeydown"])]),_:1}),r(Me,null,{default:c(()=>[r(Se),r(O,{color:"error",onClick:u},{default:c(()=>[x(v(l.$t("common.cancel")),1)]),_:1}),r(O,{color:"accent",disabled:!i.value,onClick:m},{default:c(()=>[x(v(l.$t("common.save")),1)]),_:1},8,["disabled"])]),_:1})]),_:1},8,["title"])]),_:1},8,["modelValue"]))}});Kt={class:"d-flex justify-space-around"};Ht=C({__name:"RightClick",props:{rightClickProperties:{}},setup(y){const{t:e}=ke(),s=Ye(),t=Z(),o=We(),i=Ve(),a=$t(),u=re(),m=b(()=>t.selectedTorrents.length>1),l=b(()=>t.selectedTorrents),h=b(()=>l.value[0]),_=b(()=>u.getTorrentByHash(h.value)),B=b(()=>t.selectedTorrents.map(u.getTorrentByHash).filter(E=>!!E)),A=b(()=>[{name:""},...i.categories]);async function T(){await u.resumeTorrents(l)}async function S(){await u.forceResumeTorrents(l)}async function V(){await u.pauseTorrents(l)}function k(){o.createDialog(Ze,{hashes:[...t.selectedTorrents]})}function w(){o.createDialog(He,{hashes:[...t.selectedTorrents],mode:"dl"})}function G(){o.createDialog(He,{hashes:[...t.selectedTorrents],mode:"save"})}function j(){o.createDialog(Ut,{hash:t.selectedTorrents[0]})}async function ie(){await u.recheckTorrents(l)}async function he(){await i.reannounceTorrents(l)}async function Ee(){await i.toggleSeqDl(l)}async function de(){await i.toggleFLPiecePrio(l)}async function ue(){await i.toggleAutoTmm(l,!_.value?.auto_tmm)}function te(E){return B.value.every(z=>z&&z.tags&&z.tags.includes(E))}async function oe(){await u.removeTorrentTags(l.value)}async function fe(E){te(E)?await u.removeTorrentTags(l.value,[E]):await u.addTorrentTags(l.value,[E])}async function Q(E){try{await navigator.clipboard.writeText(E)}catch{Fe.error(e("toast.copy.error"));return}Fe.success(e("toast.copy.success"))}function ce(){o.createDialog(Ge,{hashes:l.value,mode:"download"})}function _e(){o.createDialog(Ge,{hashes:l.value,mode:"upload"})}function $(){o.createDialog(Ft,{hashes:l.value})}async function L(){l.value.forEach(E=>{u.exportTorrent(E).then(z=>{const H=window.URL.createObjectURL(z),ae=document.createElement("a");ae.href=H,ae.style.opacity="0",ae.setAttribute("download",`${E}.torrent`),document.body.appendChild(ae),ae.click(),document.body.removeChild(ae)})})}const M=b(()=>[{text:e("dashboard.right_click.advanced.title"),icon:"mdi-head-cog",children:[{text:e("dashboard.right_click.advanced.download_path"),icon:"mdi-tray-arrow-down",action:w},{text:e("dashboard.right_click.advanced.save_path"),icon:"mdi-content-save",action:G},{text:e("dashboard.right_click.advanced.rename"),icon:"mdi-rename-box",hidden:m.value,action:j},{text:e("dashboard.right_click.advanced.recheck"),icon:"mdi-playlist-check",action:ie},{text:e("dashboard.right_click.advanced.reannounce"),icon:"mdi-bullhorn",action:he},{text:e("dashboard.right_click.advanced.seq_dl"),icon:_.value?.seq_dl?"mdi-checkbox-marked":"mdi-checkbox-blank-outline",action:Ee},{text:e("dashboard.right_click.advanced.f_l_prio"),icon:_.value?.f_l_piece_prio?"mdi-checkbox-marked":"mdi-checkbox-blank-outline",action:de},{text:e("dashboard.right_click.advanced.auto_tmm"),icon:_.value?.auto_tmm?"mdi-checkbox-marked":"mdi-checkbox-blank-outline",action:ue}]},{text:e("dashboard.right_click.priority.title"),icon:"mdi-priority-high",hidden:!a.preferences?.queueing_enabled,children:[{text:e("dashboard.right_click.priority.top"),icon:"mdi-priority-high",action:async()=>await u.setTorrentPriority(l.value,"topPrio")},{text:e("dashboard.right_click.priority.increase"),icon:"mdi-arrow-up",action:async()=>await u.setTorrentPriority(l.value,"increasePrio")},{text:e("dashboard.right_click.priority.decrease"),icon:"mdi-arrow-down",action:async()=>await u.setTorrentPriority(l.value,"decreasePrio")},{text:e("dashboard.right_click.priority.bottom"),icon:"mdi-priority-low",action:async()=>await u.setTorrentPriority(l.value,"bottomPrio")}]},{text:e("dashboard.right_click.tags.title"),icon:"mdi-tag",disabled:i.tags.length===0,disabledText:e("dashboard.right_click.tags.disabled_title"),disabledIcon:"mdi-tag-off",children:[..._.value?.tags.length?[{text:e("dashboard.right_click.tags.remove_all"),action:oe,icon:"mdi-playlist-remove"}]:[],...i.tags.map(E=>({text:E,icon:te(E)?"mdi-checkbox-marked":"mdi-checkbox-blank-outline",action:async()=>await fe(E)}))]},{text:e("dashboard.right_click.category.title"),icon:"mdi-label",disabled:i.categories.length===0,disabledText:e("dashboard.right_click.category.disabled_title"),disabledIcon:"mdi-label-off",children:A.value.map(E=>({text:E.name===""?e("dashboard.right_click.category.clear"):E.name,action:async()=>await u.setTorrentCategory(l.value,E.name)}))},{text:e("dashboard.right_click.speed_limit.title"),icon:"mdi-speedometer-slow",children:[{text:e("dashboard.right_click.speed_limit.download"),icon:"mdi-download",action:ce},{text:e("dashboard.right_click.speed_limit.upload"),icon:"mdi-upload",action:_e},{text:e("dashboard.right_click.speed_limit.share"),icon:"mdi-account-group",action:$}]},{text:e("dashboard.right_click.copy.title"),icon:"mdi-content-copy",hidden:m.value,children:[{text:e("dashboard.right_click.copy.name"),icon:"mdi-alphabetical-variant",action:async()=>_.value&&await Q(_.value.name)},{text:e("dashboard.right_click.copy.hash"),icon:"mdi-pound",action:async()=>await Q(h.value)},{text:e("dashboard.right_click.copy.magnet"),icon:"mdi-magnet",action:async()=>_.value&&await Q(_.value.magnet)}]},{text:e("dashboard.right_click.export",t.selectedTorrents.length),icon:m.value?"mdi-download-multiple":"mdi-download",action:L},{text:e("dashboard.right_click.info"),icon:"mdi-information",hidden:m.value,action:()=>s.push({name:"torrentDetail",params:{hash:h.value}})}]);return(E,z)=>(n(),p("div",{style:$e(`position: absolute; left: ${E.rightClickProperties.offset[0]}px; top: ${E.rightClickProperties.offset[1]}px;`)},[r(d(xt),{modelValue:E.rightClickProperties.isVisible,"onUpdate:modelValue":z[0]||(z[0]=H=>E.rightClickProperties.isVisible=H),"menu-data":M.value},{top:c(()=>[r(me,null,{default:c(()=>[g("div",Kt,[r(W,{location:"top"},{activator:c(({props:H})=>[r(O,K({density:"compact",variant:"plain",icon:"mdi-play"},H,{onClick:T}),null,16)]),default:c(()=>[g("span",null,v(E.$t("dashboard.right_click.top.resume")),1)]),_:1}),r(W,{location:"top"},{activator:c(({props:H})=>[r(O,K({density:"compact",variant:"plain",icon:"mdi-fast-forward"},H,{onClick:S}),null,16)]),default:c(()=>[g("span",null,v(E.$t("dashboard.right_click.top.force_resume")),1)]),_:1}),r(W,{location:"top"},{activator:c(({props:H})=>[r(O,K({density:"compact",variant:"plain",icon:"mdi-pause"},H,{onClick:V}),null,16)]),default:c(()=>[g("span",null,v(E.$t("dashboard.right_click.top.pause")),1)]),_:1}),r(W,{location:"top"},{activator:c(({props:H})=>[r(O,K({color:"red",density:"compact",variant:"plain",icon:"mdi-delete-forever"},H,{onClick:k}),null,16)]),default:c(()=>[g("span",null,v(E.$t("dashboard.right_click.top.delete")),1)]),_:1})])]),_:1})]),_:1},8,["modelValue","menu-data"])],4))}});Gt={class:"d-flex flex-column"};zt={key:0,class:"text-caption text-grey"};qt={key:0,class:"text-caption text-grey"};nt=C({__name:"ItemAmount",props:{torrent:{},titleKey:{},value:{type:Function},total:{type:Function}},setup(y){return(e,s)=>(n(),p("div",Gt,[e.titleKey?(n(),p("div",zt,v(e.$t(e.titleKey)),1)):I("",!0),g("div",null,[x(v(e.value(e.torrent))+" ",1),e.total?(n(),p("span",qt," / "+v(e.total(e.torrent)),1)):I("",!0)])]))}});Yt={key:0,class:"d-flex flex-column"};Xt={key:0,class:"text-caption text-grey"};jt={class:"d-flex flex-row flex-gap-column-small"};rt=C({__name:"ItemChip",props:{torrent:{},titleKey:{},value:{},emptyValueKey:{},color:{},enableHashColor:{type:Boolean,default:!1}},setup(y){const e=y,{hideChipIfUnset:s,enableHashColors:t,hideColoredChip:o}=U(F()),i=b(()=>e.value(e.torrent)),a=b(()=>i.value.length<1||i.value[0]===""),u=b(()=>!(s.value&&a.value)),m=b(()=>!o.value),l=b(()=>t.value&&e.enableHashColor);return(h,_)=>u.value?(n(),p("div",Yt,[h.titleKey?(n(),p("div",Xt,v(h.$t(h.titleKey)),1)):I("",!0),g("div",jt,[a.value?(n(),P(Te,{key:0,color:h.color(h.torrent),variant:m.value?"flat":"text",size:"small"},{default:c(()=>[x(v(h.$t(h.emptyValueKey)),1)]),_:1},8,["color","variant"])):(n(!0),p(N,{key:1},X(i.value,B=>(n(),P(Te,{color:l.value?d(Qe)(B):h.color(h.torrent),variant:m.value?"flat":"text",size:"small"},{default:c(()=>[x(v(B),1)]),_:2},1032,["color","variant"]))),256))])])):I("",!0)}});Wt={class:"d-flex flex-column"};Zt={key:0,class:"text-caption text-grey"};Qt={class:"text-caption text-grey"};st=C({__name:"ItemData",props:{torrent:{},titleKey:{},value:{type:Function}},setup(y){const e=y,{useBinarySize:s}=U(F()),t=b(()=>e.value(e.torrent));return(o,i)=>(n(),p("div",Wt,[o.titleKey?(n(),p("div",Zt,v(o.$t(o.titleKey)),1)):I("",!0),g("div",null,[x(v(d(Ct)(t.value,d(s)))+" ",1),g("span",Qt,v(d(St)(t.value,d(s))),1)])]))}});Jt={class:"d-flex flex-column"};eo={key:0,class:"text-caption text-grey"};to={key:0};oo={key:1};it=C({__name:"ItemDateTime",props:{torrent:{},titleKey:{},value:{type:Function}},setup(y){const e=y,{dateFormat:s}=U(F()),t=b(()=>e.value(e.torrent));return(o,i)=>(n(),p("div",Jt,[o.titleKey?(n(),p("div",eo,v(o.$t(o.titleKey)),1)):I("",!0),g("div",null,[t.value>0?(n(),p("span",to,v(d(Je)(t.value,d(s))),1)):(n(),p("span",oo,v(o.$t("dashboard.not_complete")),1))])]))}});ao={class:"d-flex flex-column"};lo={key:0,class:"text-caption text-grey"};no={key:0};ro={key:1};dt=C({__name:"ItemDuration",props:{torrent:{},titleKey:{},unit:{},value:{type:Function}},setup(y){const e=y,s=b(()=>e.value(e.torrent)),t=b(()=>{const o=we.duration(s.value,e.unit),i=[o.years(),o.months(),o.days(),o.hours(),o.minutes(),o.seconds()],a=["Y","M","d","h","m","s"];let u=!1;return i.map((m,l)=>{if(u||m)return u=!0,`${m}${a[l]}`}).filter(m=>m).join(" ")});return(o,i)=>(n(),p("div",ao,[o.titleKey?(n(),p("div",lo,v(o.$t(o.titleKey)),1)):I("",!0),g("div",null,[s.value>0?(n(),p("span",no,v(t.value),1)):(n(),p("span",ro,v(o.$t("common.NA")),1))])]))}});so={class:"d-flex flex-column"};io={key:0,class:"text-caption text-grey"};ut=C({__name:"ItemPercent",props:{torrent:{},titleKey:{},value:{type:Function},color:{type:Function}},setup(y){const e=y,s=b(()=>e.value(e.torrent));return(t,o)=>(n(),p("div",so,[t.titleKey?(n(),p("div",io,v(t.$t(t.titleKey)),1)):I("",!0),r(tt,{"model-value":s.value,max:1,height:20,color:t.color(t.torrent),rounded:"sm",style:{width:"10em"}},{default:c(()=>[x(v(d(et)(s.value)),1)]),_:1},8,["model-value","color"])]))}});uo={class:"d-flex flex-column"};co={key:0,class:"text-caption text-grey"};ct=C({__name:"ItemRelativeTime",props:{torrent:{},titleKey:{},value:{type:Function}},setup(y){return(e,s)=>(n(),p("div",uo,[e.titleKey?(n(),p("div",co,v(e.$t(e.titleKey)),1)):I("",!0),g("div",null,[g("span",null,v(d(we)(e.value(e.torrent)*1e3).fromNow()),1)])]))}});mo={class:"d-flex flex-column"};po={key:0,class:"text-caption text-grey"};vo={class:"text-caption text-grey"};mt=C({__name:"ItemSpeed",props:{torrent:{},titleKey:{},value:{type:Function}},setup(y){const e=y,{useBitSpeed:s}=U(F()),t=b(()=>e.value(e.torrent));return(o,i)=>(n(),p("div",mo,[o.titleKey?(n(),p("div",po,v(o.$t(o.titleKey)),1)):I("",!0),g("div",null,[x(v(d(Vt)(t.value,d(s)))+" ",1),g("span",vo,v(d(wt)(t.value,d(s))),1)])]))}});ho={class:"d-flex flex-column"};fo={key:0,class:"text-caption text-grey"};pt=C({__name:"ItemText",props:{torrent:{},titleKey:{},value:{type:Function},color:{type:Function}},setup(y){const e=y,s=b(()=>e.value(e.torrent));return(t,o)=>(n(),p("div",ho,[t.titleKey?(n(),p("div",fo,v(t.$t(t.titleKey)),1)):I("",!0),g("div",{class:ne(t.color?t.color(s.value):"")},v(s.value),3)]))}});_o={class:"d-flex flex-gap flex-wrap"};yo=C({__name:"GridTorrent",props:{torrent:{}},emits:["onTorrentClick"],setup(y){const e=y,{current:s}=at(),t=Z(),o=F(),i=b(()=>(e.torrent.progress===1?o.doneGridProperties:o.busyGridProperties).filter(h=>h.active).sort((h,_)=>h.order-_.order)),a=l=>{switch(l){case D.AMOUNT:return nt;case D.CHIP:return rt;case D.DATA:return st;case D.DATETIME:return it;case D.DURATION:return dt;case D.PERCENT:return ut;case D.RELATIVE:return ct;case D.SPEED:return mt;case D.TEXT:default:return pt}},u=b(()=>t.isTorrentInSelection(e.torrent.hash)),m=b(()=>s.value.colors[`torrent-${e.torrent.state}`]);return(l,h)=>(n(),P(se,{class:"cursor-pointer",style:$e(`border-left: 6px solid ${m.value}`),height:"100%",color:u.value?`torrent-${l.torrent.state}-darken-3`:void 0,onClick:h[0]||(h[0]=_=>l.$emit("onTorrentClick",_,l.torrent))},{default:c(()=>[r(Le,{class:"text-wrap text-subtitle-1 pt-1 pb-0"},{default:c(()=>[x(v(l.torrent.name),1)]),_:1}),r(ve,null,{default:c(()=>[g("div",_o,[(n(!0),p(N,null,X(i.value,_=>(n(),p(N,null,[_.props?(n(),P(Be(a(_.type)),K({key:0,torrent:l.torrent,ref_for:!0},_.props),null,16,["torrent"])):I("",!0)],64))),256))])]),_:1})]),_:1},8,["style","color"]))}});bo={class:"d-flex align-center",style:{height:"100%",width:"100%"}};go=C({__name:"GridView",props:{paginatedTorrents:{}},emits:["onCheckboxClick","onTorrentClick","onTorrentDblClick","onTorrentRightClick","startPress","endPress"],setup(y){const e=lt(),s=Z();return(t,o)=>(n(),P(Ne,{id:"torrentList"},{default:c(()=>[(n(!0),p(N,null,X(t.paginatedTorrents,i=>(n(),P(ye,{cols:"12",lg:"3",md:"4",sm:"6",xl:"2",class:ne([d(e).mobile?"pb-2":"pb-4","pt-0"]),onContextmenu:a=>t.$emit("onTorrentRightClick",a,i),onTouchcancel:o[1]||(o[1]=a=>t.$emit("endPress")),onTouchend:o[2]||(o[2]=a=>t.$emit("endPress")),onTouchmove:o[3]||(o[3]=a=>t.$emit("endPress")),onTouchstart:a=>t.$emit("startPress",a.touches.item(0),i),onDblclick:a=>t.$emit("onTorrentDblClick",i)},{default:c(()=>[g("div",bo,[r(ot,null,{default:c(()=>[d(s).isSelectionMultiple?(n(),P(O,{key:0,color:`torrent-${i.state}`,icon:d(s).isTorrentInSelection(i.hash)?"mdi-checkbox-marked":"mdi-checkbox-blank-outline",class:"mr-2",variant:"text",onClick:a=>t.$emit("onCheckboxClick",i)},null,8,["color","icon","onClick"])):I("",!0)]),_:2},1024),r(yo,{torrent:i,onOnTorrentClick:o[0]||(o[0]=(a,u)=>t.$emit("onTorrentClick",a,u))},null,8,["torrent"])])]),_:2},1032,["class","onContextmenu","onTouchstart","onDblclick"]))),256))]),_:1}))}});To=Ue(go,[["__scopeId","data-v-8ab52227"]]);ko={class:"d-flex flex-gap flex-wrap"};$o=C({__name:"ListTorrent",props:{torrent:{}},emits:["onTorrentClick"],setup(y){const e=y,{current:s}=at(),t=Z(),o=F(),i=b(()=>(e.torrent.progress===1?o.doneTorrentProperties:o.busyTorrentProperties).filter(h=>h.active).sort((h,_)=>h.order-_.order)),a=l=>{switch(l){case D.AMOUNT:return nt;case D.CHIP:return rt;case D.DATA:return st;case D.DATETIME:return it;case D.DURATION:return dt;case D.PERCENT:return ut;case D.RELATIVE:return ct;case D.SPEED:return mt;case D.TEXT:default:return pt}},u=b(()=>t.isTorrentInSelection(e.torrent.hash)),m=b(()=>s.value.colors[`torrent-${e.torrent.state}`]);return(l,h)=>(n(),P(se,{class:"cursor-pointer",style:$e(`border-left: 6px solid ${m.value}`),width:"100%",color:u.value?`torrent-${l.torrent.state}-darken-3`:void 0,onClick:h[0]||(h[0]=_=>l.$emit("onTorrentClick",_,l.torrent))},{default:c(()=>[r(Le,{class:"text-wrap pt-1 pb-0 px-2 text-truncate",style:{"font-size":"0.97em"}},{default:c(()=>[x(v(l.torrent.name),1)]),_:1}),r(ve,{class:"pa-2 pt-0"},{default:c(()=>[g("div",ko,[(n(!0),p(N,null,X(i.value,_=>(n(),p(N,null,[_.props?(n(),P(Be(a(_.type)),K({key:0,torrent:l.torrent,ref_for:!0},_.props),null,16,["torrent"])):I("",!0)],64))),256))])]),_:1})]),_:1},8,["style","color"]))}});Co={class:"d-flex align-center"};So=C({__name:"ListView",props:{paginatedTorrents:{}},emits:["onCheckboxClick","onTorrentClick","onTorrentDblClick","onTorrentRightClick","startPress","endPress"],setup(y){const e=lt(),s=Z();return(t,o)=>(n(),P(je,{id:"torrentList",class:"pa-0"},{default:c(()=>[(n(!0),p(N,null,X(t.paginatedTorrents,i=>(n(),P(me,{id:`torrent-${i.hash}`,class:ne([d(e).mobile?"mb-2":"mb-4","pa-0"]),onContextmenu:a=>t.$emit("onTorrentRightClick",a,i),onTouchcancel:o[1]||(o[1]=a=>t.$emit("endPress")),onTouchend:o[2]||(o[2]=a=>t.$emit("endPress")),onTouchmove:o[3]||(o[3]=a=>t.$emit("endPress")),onTouchstart:a=>t.$emit("startPress",a.touches.item(0),i),onDblclick:a=>t.$emit("onTorrentDblClick",i)},{default:c(()=>[g("div",Co,[r(ot,null,{default:c(()=>[d(s).isSelectionMultiple?(n(),P(O,{key:0,color:`torrent-${i.state}`,icon:d(s).isTorrentInSelection(i.hash)?"mdi-checkbox-marked":"mdi-checkbox-blank-outline",class:"mr-2",variant:"text",onClick:a=>t.$emit("onCheckboxClick",i)},null,8,["color","icon","onClick"])):I("",!0)]),_:2},1024),r($o,{torrent:i,onOnTorrentClick:o[0]||(o[0]=(a,u)=>t.$emit("onTorrentClick",a,u))},null,8,["torrent"])])]),_:2},1032,["id","class","onContextmenu","onTouchstart","onDblclick"]))),256))]),_:1}))}});Vo=Ue(So,[["__scopeId","data-v-57c5171f"]]);wo={key:0};Eo=C({__name:"ItemAmount",props:{torrent:{},value:{type:Function},total:{type:Function}},setup(y){return(e,s)=>(n(),p("td",null,[x(v(e.value(e.torrent))+" ",1),e.total?(n(),p("span",wo," / "+v(e.total(e.torrent)),1)):I("",!0)]))}});Io={key:0,class:"d-flex flex-row flex-gap-column-small"};Do=C({__name:"ItemChip",props:{torrent:{},value:{},emptyValueKey:{},color:{},enableHashColor:{type:Boolean,default:!1}},setup(y){const e=y,{hideChipIfUnset:s,enableHashColors:t,hideColoredChip:o}=U(F()),i=b(()=>e.value(e.torrent)),a=b(()=>i.value.length<1||i.value[0]===""),u=b(()=>!(s.value&&a.value)),m=b(()=>!o.value),l=b(()=>t.value&&e.enableHashColor);return(h,_)=>(n(),p("td",null,[u.value?(n(),p("div",Io,[a.value?(n(),P(Te,{key:0,color:h.color(h.torrent),variant:m.value?"flat":"text",size:"small"},{default:c(()=>[x(v(h.$t(h.emptyValueKey)),1)]),_:1},8,["color","variant"])):(n(!0),p(N,{key:1},X(i.value,B=>(n(),P(Te,{color:l.value?d(Qe)(B):h.color(h.torrent),variant:m.value?"flat":"text",size:"small"},{default:c(()=>[x(v(B),1)]),_:2},1032,["color","variant"]))),256))])):I("",!0)]))}});Po=C({__name:"ItemData",props:{torrent:{},value:{type:Function}},setup(y){const{useBinarySize:e}=U(F());return(s,t)=>(n(),p("td",null,v(d(Et)(s.value(s.torrent),d(e))),1))}});Ao={key:0};Bo={key:1};xo=C({__name:"ItemDateTime",props:{torrent:{},value:{type:Function}},setup(y){const e=y,{dateFormat:s}=U(F()),t=b(()=>e.value(e.torrent));return(o,i)=>t.value>0?(n(),p("td",Ao,v(d(Je)(t.value,d(s))),1)):(n(),p("td",Bo,v(o.$t("dashboard.not_complete")),1))}});Lo={key:0};Oo={key:1};Mo=C({__name:"ItemDuration",props:{torrent:{},unit:{},value:{type:Function}},setup(y){const e=y,s=b(()=>e.value(e.torrent)),t=b(()=>{const o=we.duration(s.value,e.unit),i=[o.years(),o.months(),o.days(),o.hours(),o.minutes(),o.seconds()],a=["Y","M","d","h","m","s"];let u=!1;return i.map((m,l)=>{if(u||m)return u=!0,`${m}${a[l]}`}).filter(m=>m).join(" ")});return(o,i)=>s.value>0?(n(),p("td",Lo,v(t.value),1)):(n(),p("td",Oo,v(o.$t("common.NA")),1))}});Ro=C({__name:"ItemPercent",props:{torrent:{},value:{type:Function},color:{type:Function}},setup(y){const e=y,s=b(()=>e.value(e.torrent));return(t,o)=>(n(),p("td",null,[r(tt,{"model-value":s.value,max:1,height:20,color:t.color(t.torrent),rounded:"sm",style:{width:"10em"}},{default:c(()=>[x(v(d(et)(s.value)),1)]),_:1},8,["model-value","color"])]))}});No=C({__name:"ItemRelativeTime",props:{torrent:{},value:{type:Function}},setup(y){return(e,s)=>(n(),p("td",null,v(d(we)(e.value(e.torrent)*1e3).fromNow()),1))}});Uo=C({__name:"ItemSpeed",props:{torrent:{},value:{type:Function}},setup(y){const{useBitSpeed:e}=U(F());return(s,t)=>(n(),p("td",null,v(d(It)(s.value(s.torrent),d(e))),1))}});Fo=C({__name:"ItemText",props:{torrent:{},value:{type:Function},color:{type:Function}},setup(y){const e=y,s=b(()=>e.value(e.torrent));return(t,o)=>(n(),p("td",{class:ne(t.color?t.color(s.value):"")},v(s.value),3))}});Ko=C({__name:"TableTorrent",props:{torrent:{}},setup(y){const e=F(),s=b(()=>e.tableProperties.filter(o=>o.active).sort((o,i)=>o.order-i.order)),t=o=>{switch(o){case D.AMOUNT:return Eo;case D.CHIP:return Do;case D.DATA:return Po;case D.DATETIME:return xo;case D.DURATION:return Mo;case D.PERCENT:return Ro;case D.RELATIVE:return No;case D.SPEED:return Uo;case D.TEXT:default:return Fo}};return(o,i)=>(n(!0),p(N,null,X(s.value,a=>(n(),p(N,null,[a.props?(n(),P(Be(t(a.type)),K({key:0,torrent:o.torrent,ref_for:!0},a.props),null,16,["torrent"])):I("",!0)],64))),256))}});Ho=y=>(vt("data-v-13e3f0fc"),y=y(),ht(),y);Go=Ho(()=>g("th",{class:"px-1"},null,-1));zo={key:0};qo={class:"text-left"};Yo={class:"text-left"};Xo=["onContextmenu","onTouchstart","onClick","onDblclick"];jo={key:0};Wo=C({__name:"TableView",props:{paginatedTorrents:{}},emits:["onCheckboxClick","onTorrentClick","onTorrentDblClick","onTorrentRightClick","startPress","endPress"],setup(y){const e=Z(),s=F(),t=b(()=>s.tableProperties.filter(a=>a.active).sort((a,u)=>a.order-u.order));function o(a){return e.isTorrentInSelection(a.hash)}const i=a=>["cursor-pointer",o(a)?`bg-torrent-${a.state}-darken-3 selected`:""];return(a,u)=>(n(),P(Dt,{id:"torrentList",class:"pa-0",density:"compact"},{default:c(()=>[g("thead",null,[g("tr",null,[Go,d(e).isSelectionMultiple?(n(),p("th",zo)):I("",!0),g("th",qo,v(a.$t("torrent.properties.name")),1),(n(!0),p(N,null,X(t.value,m=>(n(),p("th",Yo,v(a.$t(m.props.titleKey)),1))),256))])]),g("tbody",null,[(n(!0),p(N,null,X(a.paginatedTorrents,m=>Xe((n(),p("tr",{class:ne(i(m)),onContextmenu:l=>a.$emit("onTorrentRightClick",l,m),onTouchcancel:u[0]||(u[0]=l=>a.$emit("endPress")),onTouchend:u[1]||(u[1]=l=>a.$emit("endPress")),onTouchmove:u[2]||(u[2]=l=>a.$emit("endPress")),onTouchstart:l=>a.$emit("startPress",l.touches.item(0),m),onClick:l=>a.$emit("onTorrentClick",l,m),onDblclick:l=>a.$emit("onTorrentDblClick",m)},[g("td",{class:ne(`pa-0 bg-torrent-${m.state}`)},null,2),d(e).isSelectionMultiple?(n(),p("td",jo,[r(be,{"model-value":o(m),color:`torrent-${m.state}`,variant:"text",onClick:J(l=>a.$emit("onCheckboxClick",m),["stop"])},null,8,["model-value","color","onClick"])])):I("",!0),g("td",null,v(m.name),1),r(Ko,{torrent:m},null,8,["torrent"])],42,Xo)),[[Pt]])),256))])]),_:1}))}});Zo=Ue(Wo,[["__scopeId","data-v-13e3f0fc"]]);Qo={class:"pt-4 px-1 px-sm-5"};Jo={class:"text-grey"};ea={key:0,class:"mt-5 text-xs-center"};ta={class:"text-grey"};oa={key:1};aa={key:5};ua=C({__name:"Dashboard",setup(y){const{t:e}=ke(),s=Ye(),t=Z(),{currentPage:o,isSelectionMultiple:i,selectedTorrents:a,displayMode:u}=U(t),m=We(),l=Ve(),h=re(),{filteredTorrents:_}=U(h),B=F(),A=b(()=>u.value===Y.LIST),T=b(()=>u.value===Y.GRID),S=b(()=>u.value===Y.TABLE),{paginatedResults:V,currentPage:k,pageCount:w}=Lt(_,B.paginationSize,o),G=b(()=>_.value.length<=a.value.length),j=ze({isVisible:!1,offset:[0,0]});function ie(){window.scrollTo({top:0,behavior:"smooth"})}function he($){if($)return Ie(()=>{document.getElementById("searchInput")?.focus()});Ie(()=>{document.getElementById("searchInput")?.blur()})}function Ee(){G.value?t.unselectAllTorrents():t.selectTorrents(..._.value.map($=>$.hash))}function de($){i.value||s.push({name:"torrentDetail",params:{hash:$.hash}})}function ue($){t.toggleSelect($.hash)}function te($,L){$.shiftKey?t.spanTorrentSelection(L.hash):(Ae($)||t.isSelectionMultiple)&&(t.isSelectionMultiple=!0,t.toggleSelect(L.hash))}async function oe($,L){j.isVisible&&(j.isVisible=!1,await Ie()),j.isVisible=!0,j.offset=[$.pageX,$.pageY],i.value?a.value.length===0&&t.selectTorrent(L.hash):(t.unselectAllTorrents(),t.selectTorrent(L.hash))}const fe=R();function Q($,L){fe.value=setTimeout(()=>{oe($,L)},500)}function ce(){clearTimeout(fe.value)}function _e($){if(m.hasActiveDialog)return!1;const L=$.target;if(Ae($)&&$.key==="a"&&L.tagName!=="INPUT")return t.unselectAllTorrents(),t.selectTorrents(..._.value.map(M=>M.hash)),$.preventDefault(),!0;if(Ae($)&&$.key==="f"){const M=document.getElementById("searchInput");if(document.activeElement!==M)return he(!0),$.preventDefault(),!0}if($.key==="Escape"){const M=document.getElementById("searchInput");return document.activeElement===M?he(!1):(i.value=!1,t.unselectAllTorrents()),$.preventDefault(),!0}if($.key==="Delete")return a.value.length===0?void 0:(m.createDialog(Ze,{hashes:a.value}),$.preventDefault(),!0);if($.key==="/"){const M=document.getElementById("searchInput");return document.activeElement!==M&&(s.push({name:"searchEngine"}),$.preventDefault()),!0}}return ft(()=>j.isVisible,$=>{!$&&!i.value&&t.unselectAllTorrents()}),Ce(async()=>{await l.fetchCategories(),await l.fetchTags()}),qe(()=>{document.addEventListener("keydown",_e),i.value=!1,ie()}),_t(()=>{document.removeEventListener("keydown",_e)}),($,L)=>(n(),p(N,null,[g("div",Qo,[r(Nt),r(Ne,{class:"ma-0 pa-0"},{default:c(()=>[r(At,null,{default:c(()=>[Xe(r(se,{color:"transparent"},{default:c(()=>[r(W,{text:d(e)("common.selectAll"),location:"bottom"},{activator:c(({props:M})=>[r(O,K({icon:G.value?"mdi-checkbox-marked":"mdi-checkbox-blank-outline",class:"text-grey",color:"transparent",style:{left:"-8px"}},M,{onClick:Ee}),null,16,["icon"])]),_:1},8,["text"]),g("span",Jo,v(d(e)("dashboard.selectAll")),1)]),_:1},512),[[yt,d(i)]])]),_:1})]),_:1}),d(_).length===0?(n(),p("div",ea,[g("p",ta,v(d(e)("common.emptyList")),1)])):I("",!0),d(B).isPaginationOnTop&&!d(B).isInfiniteScrollActive&&d(w)>1?(n(),p("div",oa,[r(Ke,{modelValue:d(k),"onUpdate:modelValue":L[0]||(L[0]=M=>pe(k)?k.value=M:null),length:d(w),"next-icon":"mdi-menu-right","prev-icon":"mdi-menu-left",onInput:ie},null,8,["modelValue","length"])])):I("",!0),A.value?(n(),P(Vo,{key:2,"paginated-torrents":d(V),onOnTorrentClick:te,onOnTorrentDblClick:de,onOnCheckboxClick:ue,onOnTorrentRightClick:oe,onStartPress:Q,onEndPress:ce},null,8,["paginated-torrents"])):T.value?(n(),P(To,{key:3,class:"mb-2","paginated-torrents":d(V),onOnTorrentClick:te,onOnTorrentDblClick:de,onOnCheckboxClick:ue,onOnTorrentRightClick:oe,onStartPress:Q,onEndPress:ce},null,8,["paginated-torrents"])):S.value?(n(),P(Zo,{key:4,"paginated-torrents":d(V),onOnTorrentClick:te,onOnTorrentDblClick:de,onOnCheckboxClick:ue,onOnTorrentRightClick:oe,onStartPress:Q,onEndPress:ce},null,8,["paginated-torrents"])):I("",!0),!d(B).isPaginationOnTop&&!d(B).isInfiniteScrollActive&&d(w)>1?(n(),p("div",aa,[r(Ke,{modelValue:d(k),"onUpdate:modelValue":L[1]||(L[1]=M=>pe(k)?k.value=M:null),length:d(w),"next-icon":"mdi-menu-right","prev-icon":"mdi-menu-left",onInput:ie},null,8,["modelValue","length"])])):I("",!0)]),r(Ht,{"right-click-properties":j},null,8,["right-click-properties"])],64))}})});export{ua as default,__tla};

View File

@@ -0,0 +1 @@
import{j as w,E as Te,$ as F,c as _,H as l,Q as m,U as k,n,u as i,J as c,W as $e,L as v,F as M,q as O,I,N as x,f as R,r as je,G as Ce,Y as qe,K,M as J,O as ge,P as pe,S as Xe,Z as Oe,V as q,_ as ne,a5 as Ee,a6 as Ye,a7 as vt,a8 as ht,w as ft,v as bt,x as De,a9 as _t}from"./vue-CfSjRv-x.js";import{aN as Q,aO as yt,$ as se,aP as gt,e as W,Q as Y,Y as kt,aQ as Tt,g as we,h as L,aR as j,k as Ie,q as Qe,s as me,a as Le,V as Ae,c as ve,d as Ke,f as Re,i as re,j as Me,Z as Ve,aS as $t,aT as Pe,p as Fe,r as _e,v as ye,E as Ze,ab as Ct,aU as Je,m as U,aV as wt,aW as Vt,aX as We,C as Se,aY as et,aZ as tt,a_ as St,a$ as xt,b0 as ee,b1 as D,b2 as at,ae as Ue,X as Dt,b3 as It,aJ as Pt,b4 as Ne,b5 as Bt,x as ze,b6 as Be,b7 as Et,__tla as __tla_0}from"./index-C0tfT_Qc.js";import{d as Lt}from"./index-BwjGcC1B.js";import{_ as He,a as At,b as ke,__tla as __tla_1}from"./ColoredChip.vue_vue_type_script_setup_true_lang-CBDbhtDT.js";import{a as ot,u as lt}from"./vuetify-PctCzU6r.js";import{u as Kt,__tla as __tla_2}from"./ArrayPagination-C54Dd5Tu.js";let ho;let __tla=Promise.all([(()=>{try{return __tla_0}catch{}})(),(()=>{try{return __tla_1}catch{}})(),(()=>{try{return __tla_2}catch{}})()]).then(async()=>{let Rt,Mt,Ft,Ut,Ot,le,G,Nt,Ge,zt,Ht,Gt,jt,qt,nt,Xt,Yt,Qt,st,Zt,Jt,Wt,rt,ea,ta,aa,oa,it,la,na,sa,ra,dt,ia,da,ut,ua,ca,ct,ma,pa,va,mt,ha,fa,pt,ba,_a,ya,ga,ka,Ta,$a,Ca,wa,Va,Sa,xa,Da,Ia,Pa,Ba,Ea,La,Aa,Ka,Ra,Ma,Fa,Ua,Oa,Na,za,Ha,Ga,ja,qa,Xa,Ya,Qa,Za,Ja,Wa,eo,to,ao,oo,lo,no,so,ro;Rt={class:"d-flex my-3"};Mt={class:"pa-0"};Ft={class:"d-flex align-center text-uppercase text-select",style:{"font-size":"0.8em"}};Ut=w({__name:"Toolbar",setup(h){const{t:e}=Te(),r=Q(),{torrentCountString:t,isSelectionMultiple:a,displayMode:d}=F(r),{isDrawerOpen:o}=F(yt()),u=se(),{sortCriterias:p}=F(u),s=[{value:"added_on",title:e("dashboard.sortBy.added_on")},{value:"amount_left",title:e("dashboard.sortBy.amount_left")},{value:"availability",title:e("dashboard.sortBy.availability")},{value:"available_peers",title:e("dashboard.sortBy.available_peers")},{value:"available_seeds",title:e("dashboard.sortBy.available_seeds")},{value:"avgDownloadSpeed",title:e("dashboard.sortBy.avg_download_speed")},{value:"avgUploadSpeed",title:e("dashboard.sortBy.avg_upload_speed")},{value:"basename_content_path",title:e("dashboard.sortBy.basename_content_path")},{value:"basename_download_path",title:e("dashboard.sortBy.basename_download_path")},{value:"basename_save_path",title:e("dashboard.sortBy.basename_save_path")},{value:"category",title:e("dashboard.sortBy.category")},{value:"completed_on",title:e("dashboard.sortBy.completion_on")},{value:"content_path",title:e("dashboard.sortBy.content_path")},{value:"dl_limit",title:e("dashboard.sortBy.dl_limit")},{value:"dlspeed",title:e("dashboard.sortBy.dlspeed")},{value:"download_path",title:e("dashboard.sortBy.download_path")},{value:"downloaded",title:e("dashboard.sortBy.downloaded")},{value:"downloaded_session",title:e("dashboard.sortBy.downloaded_session")},{value:"eta",title:e("dashboard.sortBy.eta")},{value:"globalSpeed",title:e("dashboard.sortBy.globalSpeed")},{value:"globalVolume",title:e("dashboard.sortBy.globalVolume")},{value:"hash",title:e("dashboard.sortBy.hash")},{value:"inactive_seeding_time_limit",title:e("dashboard.sortBy.inactive_seeding_time_limit")},{value:"infohash_v1",title:e("dashboard.sortBy.infohash_v1")},{value:"infohash_v2",title:e("dashboard.sortBy.infohash_v2")},{value:"last_activity",title:e("dashboard.sortBy.last_activity")},{value:"name",title:e("dashboard.sortBy.name")},{value:"num_leechs",title:e("dashboard.sortBy.num_leechs")},{value:"num_seeds",title:e("dashboard.sortBy.num_seeds")},{value:"priority",title:e("dashboard.sortBy.priority")},{value:"progress",title:e("dashboard.sortBy.progress")},{value:"ratio",title:e("dashboard.sortBy.ratio")},{value:"ratio_limit",title:e("dashboard.sortBy.ratio_limit")},{value:"savePath",title:e("dashboard.sortBy.save_path")},{value:"seeding_time",title:e("dashboard.sortBy.seeding_time")},{value:"seeding_time_limit",title:e("dashboard.sortBy.seeding_time_limit")},{value:"seen_complete",title:e("dashboard.sortBy.seen_complete")},{value:"size",title:e("dashboard.sortBy.size")},{value:"state",title:e("dashboard.sortBy.state")},{value:"tags",title:e("dashboard.sortBy.tags")},{value:"time_active",title:e("dashboard.sortBy.time_active")},{value:"total_size",title:e("dashboard.sortBy.total_size")},{value:"trackerDomain",title:e("dashboard.sortBy.tracker")},{value:"trackers_count",title:e("dashboard.sortBy.trackers_count")},{value:"up_limit",title:e("dashboard.sortBy.up_limit")},{value:"uploaded",title:e("dashboard.sortBy.uploaded")},{value:"uploaded_session",title:e("dashboard.sortBy.uploaded_session")},{value:"upspeed",title:e("dashboard.sortBy.upspeed")}].sort((C,$)=>gt.text.asc(C.title,$.title)),b=_({get:()=>p.value[0],set:C=>{p.value=[{value:C.value,reverse:C.reverse}]}});function f(){u.textFilter=""}const P=_({get:()=>u.textFilter,set:Lt(C=>{u.textFilter=C??""},300)});function A(){a.value&&r.unselectAllTorrents(),a.value=!a.value}return(C,$)=>(l(),m(M,null,[k("div",null,[n(W,{id:"searchInput",modelValue:P.value,"onUpdate:modelValue":$[0]||($[0]=y=>P.value=y),label:i(e)("dashboard.searchInputLabel"),clearable:"",density:"compact","single-line":"","hide-details":"","prepend-inner-icon":"mdi-magnify",variant:"solo","onClick:clear":$[1]||($[1]=y=>f())},null,8,["modelValue","label"])]),k("div",Rt,[n(Y,{text:i(e)("dashboard.toggleSelectMode"),location:"top"},{activator:c(({props:y})=>[n(L,O({icon:i(a)?"mdi-checkbox-marked":"mdi-checkbox-blank-outline"},y,{variant:"plain",onClick:A}),null,16,["icon"])]),_:1},8,["text"]),n(kt,null,{activator:c(({props:y})=>[n(Y,{text:C.$t("dashboard.displayMode.title"),location:"top"},{activator:c(({props:g})=>[n(L,O({icon:""},O(y,g),{variant:"plain"}),{default:c(()=>[i(d)===i(j).LIST?(l(),I(Ie,{key:0,icon:"mdi-view-list"})):x("",!0),i(d)===i(j).GRID?(l(),I(Ie,{key:1,icon:"mdi-view-grid"})):x("",!0),i(d)===i(j).TABLE?(l(),I(Ie,{key:2,icon:"mdi-table"})):x("",!0)]),_:2},1040)]),_:2},1032,["text"])]),default:c(()=>[n(Qe,null,{default:c(()=>[n(me,{title:C.$t("dashboard.displayMode.list"),"prepend-icon":"mdi-view-list",onClick:$[2]||($[2]=y=>d.value=i(j).LIST)},null,8,["title"]),n(me,{title:C.$t("dashboard.displayMode.grid"),"prepend-icon":"mdi-view-grid",onClick:$[3]||($[3]=y=>d.value=i(j).GRID)},null,8,["title"]),n(me,{title:C.$t("dashboard.displayMode.table"),"prepend-icon":"mdi-table",onClick:$[4]||($[4]=y=>d.value=i(j).TABLE)},null,8,["title"])]),_:1})]),_:1}),n(Y,{text:i(e)("dashboard.toggleSortOrder"),location:"top"},{activator:c(({props:y})=>[n(L,O({icon:b.value.reverse?"mdi-sort-descending":"mdi-sort-ascending"},y,{variant:"plain",onClick:$[5]||($[5]=g=>b.value.reverse=!b.value.reverse)}),null,16,["icon"])]),_:1},8,["text"]),k("div",Mt,[n(Tt,{modelValue:b.value.value,"onUpdate:modelValue":$[6]||($[6]=y=>b.value.value=y),items:i(s),label:i(e)("dashboard.sortLabel"),"auto-select-first":"",density:"compact","hide-details":"",variant:"solo-filled",style:$e(`width: ${C.$vuetify.display.xs||C.$vuetify.display.sm&&i(o)?140:260}px`)},null,8,["modelValue","items","label","style"])]),n(we),k("div",Ft,v(i(t)),1)])],64))}});Ot=w({__name:"RenameTorrentDialog",props:{guid:{},hash:{}},setup(h){const e=h,{isOpened:r}=Le(e.guid),{t}=Te(),a=se(),d=R(),o=R(),u=R(!1),p=je({newName:""}),s=[C=>!!C||t("dialogs.renameTorrent.required"),C=>C!==f.value||t("dialogs.renameTorrent.sameName")],b=_(()=>a.getTorrentByHash(e.hash)),f=_(()=>b.value?.name);async function P(){await o.value?.validate(),u.value&&(await a.renameTorrent(e.hash,p.newName),A())}const A=()=>{r.value=!1};return Ce(()=>{p.newName=b.value?.name||""}),qe(()=>{d.value?.select()}),(C,$)=>(l(),I(Me,{modelValue:i(r),"onUpdate:modelValue":$[3]||($[3]=y=>pe(r)?r.value=y:null)},{default:c(()=>[n(re,null,{default:c(()=>[n(Ae,null,{default:c(()=>[K(v(C.$t("dialogs.renameTorrent.title")),1)]),_:1}),n(ve,null,{default:c(()=>[n(i(Ke),{modelValue:u.value,"onUpdate:modelValue":$[1]||($[1]=y=>u.value=y),ref_key:"form",ref:o,onSubmit:$[2]||($[2]=J(()=>{},["prevent"]))},{default:c(()=>[f.value?(l(),I(W,{key:0,"model-value":f.value,disabled:"",label:C.$t("dialogs.renameTorrent.oldName")},null,8,["model-value","label"])):x("",!0),n(W,{modelValue:p.newName,"onUpdate:modelValue":$[0]||($[0]=y=>p.newName=y),ref_key:"field",ref:d,rules:s,autofocus:"",label:C.$t("dialogs.renameTorrent.newName"),onKeydown:ge(P,["enter"])},null,8,["modelValue","label"])]),_:1},8,["modelValue"])]),_:1}),n(Re,null,{default:c(()=>[n(we),n(L,{color:"error",onClick:A},{default:c(()=>[K(v(C.$t("common.cancel")),1)]),_:1}),n(L,{color:"accent",disabled:!u.value,onClick:P},{default:c(()=>[K(v(C.$t("common.save")),1)]),_:1},8,["disabled"])]),_:1})]),_:1})]),_:1},8,["modelValue"]))}});le=-2;G=-1;Nt=w({__name:"ShareLimitDialog",props:{guid:{},hashes:{}},setup(h){const e=h,{isOpened:r}=Le(e.guid),t=Ve(),a=se(),d=R(!1),o=R("global"),u=R(!1),p=R(0),s=R(!1),b=R(0),f=R(!1),P=R(0),A=_(()=>o.value!=="enabled");function C(){r.value=!1}async function $(){switch(o.value){case"global":await t.setShareLimit(e.hashes,le,le,le);break;case"disabled":await t.setShareLimit(e.hashes,G,G,G);break;case"enabled":await t.setShareLimit(e.hashes,u.value?p.value:G,s.value?b.value:G,f.value?P.value:G);break}C()}return Ce(async()=>{const y=a.getTorrentByHash(e.hashes[0]);if(!y)return C();const g=y.ratio_limit,V=y.seeding_time_limit,z=y.inactive_seeding_time_limit;g===le&&V===le&&z===le?o.value="global":g===G&&V===G&&z===G?o.value="disabled":(o.value="enabled",u.value=g>=0,p.value=u.value?g:0,s.value=V>=0,b.value=s.value?V:0,f.value=z>=0,P.value=f.value?z:0)}),(y,g)=>(l(),I(Me,{modelValue:i(r),"onUpdate:modelValue":g[9]||(g[9]=V=>pe(r)?r.value=V:null),"max-width":"500"},{default:c(()=>[n(re,{title:y.$t("dialogs.share_limit.title")},{default:c(()=>[n(ve,null,{default:c(()=>[n(Ke,{modelValue:d.value,"onUpdate:modelValue":g[7]||(g[7]=V=>d.value=V),onSubmit:g[8]||(g[8]=J(()=>{},["prevent"])),onKeydown:ge(J($,["prevent"]),["enter"])},{default:c(()=>[n($t,{modelValue:o.value,"onUpdate:modelValue":g[0]||(g[0]=V=>o.value=V)},{default:c(()=>[n(Pe,{label:y.$t("dialogs.share_limit.global"),value:"global"},null,8,["label"]),n(Pe,{label:y.$t("dialogs.share_limit.disabled"),value:"disabled"},null,8,["label"]),n(Pe,{label:y.$t("dialogs.share_limit.enabled"),value:"enabled"},null,8,["label"])]),_:1},8,["modelValue"]),n(Fe,null,{default:c(()=>[n(_e,{cols:"12",class:"d-flex align-center"},{default:c(()=>[k("span",null,[n(ye,{modelValue:u.value,"onUpdate:modelValue":g[1]||(g[1]=V=>u.value=V),disabled:A.value},null,8,["modelValue","disabled"])]),n(W,{modelValue:p.value,"onUpdate:modelValue":g[2]||(g[2]=V=>p.value=V),disabled:A.value||!u.value,density:"compact","hide-details":"",label:y.$t("dialogs.share_limit.ratio_limit")},null,8,["modelValue","disabled","label"])]),_:1}),n(_e,{cols:"12",class:"d-flex align-center"},{default:c(()=>[k("span",null,[n(ye,{modelValue:s.value,"onUpdate:modelValue":g[3]||(g[3]=V=>s.value=V),disabled:A.value},null,8,["modelValue","disabled"])]),n(W,{modelValue:b.value,"onUpdate:modelValue":g[4]||(g[4]=V=>b.value=V),disabled:A.value||!s.value,density:"compact","hide-details":"",label:y.$t("dialogs.share_limit.seeding_time_limit")},null,8,["modelValue","disabled","label"])]),_:1}),n(_e,{cols:"12",class:"d-flex align-center"},{default:c(()=>[k("span",null,[n(ye,{modelValue:f.value,"onUpdate:modelValue":g[5]||(g[5]=V=>f.value=V),disabled:A.value},null,8,["modelValue","disabled"])]),n(W,{modelValue:P.value,"onUpdate:modelValue":g[6]||(g[6]=V=>P.value=V),disabled:A.value||!f.value,density:"compact","hide-details":"",label:y.$t("dialogs.share_limit.inactive_seeding_time_limit")},null,8,["modelValue","disabled","label"])]),_:1})]),_:1})]),_:1},8,["modelValue","onKeydown"])]),_:1}),n(Re,null,{default:c(()=>[n(we),n(L,{color:"error",onClick:C},{default:c(()=>[K(v(y.$t("common.cancel")),1)]),_:1}),n(L,{color:"accent",disabled:!d.value,onClick:$},{default:c(()=>[K(v(y.$t("common.save")),1)]),_:1},8,["disabled"])]),_:1})]),_:1},8,["title"])]),_:1},8,["modelValue"]))}});Ge=w({__name:"SpeedLimitDialog",props:{guid:{},hashes:{},mode:{}},setup(h){const e=h,{isOpened:r}=Le(e.guid),t=Ve(),a=se(),d=R(!1),o=R(0);function u(){r.value=!1}async function p(){const s=Math.max(0,o.value)*1e3;switch(e.mode){case"download":await t.setDownloadLimit(s,e.hashes);break;case"upload":await t.setUploadLimit(s,e.hashes);break}u()}return Ce(async()=>{const s=a.getTorrentByHash(e.hashes[0]);if(!s)return u();switch(e.mode){case"download":o.value=Math.max(0,Math.round(s.dl_limit/1e3));break;case"upload":o.value=Math.max(0,Math.round(s.up_limit/1e3));break}}),(s,b)=>(l(),I(Me,{modelValue:i(r),"onUpdate:modelValue":b[3]||(b[3]=f=>pe(r)?r.value=f:null)},{default:c(()=>[n(re,{title:s.$t(`dialogs.speed_limit.${s.mode}`)},{default:c(()=>[n(ve,null,{default:c(()=>[n(Ke,{modelValue:d.value,"onUpdate:modelValue":b[1]||(b[1]=f=>d.value=f),onSubmit:b[2]||(b[2]=J(()=>{},["prevent"])),onKeydown:ge(J(p,["prevent"]),["enter"])},{default:c(()=>[n(W,{modelValue:o.value,"onUpdate:modelValue":b[0]||(b[0]=f=>o.value=f),modelModifiers:{number:!0},type:"number",autofocus:"",clearable:"",label:s.$t("dialogs.speed_limit.label"),"prepend-inner-icon":"mdi-speedometer",suffix:"kB/s",onKeydown:ge(J(p,["prevent"]),["enter"])},null,8,["modelValue","label","onKeydown"])]),_:1},8,["modelValue","onKeydown"])]),_:1}),n(Re,null,{default:c(()=>[n(we),n(L,{color:"error",onClick:u},{default:c(()=>[K(v(s.$t("common.cancel")),1)]),_:1}),n(L,{color:"accent",disabled:!d.value,onClick:p},{default:c(()=>[K(v(s.$t("common.save")),1)]),_:1},8,["disabled"])]),_:1})]),_:1},8,["title"])]),_:1},8,["modelValue"]))}});zt={class:"d-flex justify-space-around"};Ht=w({__name:"RightClick",props:{rightClickProperties:{}},setup(h){const{t:e}=Te(),r=Xe(),t=Q(),a=Ze(),d=Ve(),o=Ct(),u=se(),p=_(()=>t.selectedTorrents.length>1),s=_(()=>t.selectedTorrents),b=_(()=>s.value[0]),f=_(()=>u.getTorrentByHash(b.value)),P=_(()=>t.selectedTorrents.map(u.getTorrentByHash).filter(S=>!!S)),A=_(()=>[{name:""},...d.categories]);async function C(){await u.resumeTorrents(s)}async function $(){await u.forceResumeTorrents(s)}async function y(){await u.pauseTorrents(s)}function g(){a.createDialog(Je,{hashes:[...t.selectedTorrents]})}function V(){a.createDialog(He,{hashes:[...t.selectedTorrents],mode:"dl"})}function z(){a.createDialog(He,{hashes:[...t.selectedTorrents],mode:"save"})}function X(){a.createDialog(Ot,{hash:t.selectedTorrents[0]})}async function ie(){await u.recheckTorrents(s)}async function he(){await d.reannounceTorrents(s)}async function xe(){await d.toggleSeqDl(s)}async function de(){await d.toggleFLPiecePrio(s)}async function ue(){await d.toggleAutoTmm(s,!f.value?.auto_tmm)}function te(S){return P.value.every(H=>H&&H.tags&&H.tags.includes(S))}async function ae(){await u.removeTorrentTags(s.value)}async function fe(S){te(S)?await u.removeTorrentTags(s.value,[S]):await u.addTorrentTags(s.value,[S])}async function Z(S){try{await navigator.clipboard.writeText(S)}catch{Oe.error(e("toast.copy.error"));return}Oe.success(e("toast.copy.success"))}function ce(){a.createDialog(Ge,{hashes:s.value,mode:"download"})}function be(){a.createDialog(Ge,{hashes:s.value,mode:"upload"})}function T(){a.createDialog(Nt,{hashes:s.value})}async function B(){s.value.forEach(S=>{u.exportTorrent(S).then(H=>{const N=window.URL.createObjectURL(H),oe=document.createElement("a");oe.href=N,oe.style.opacity="0",oe.setAttribute("download",`${S}.torrent`),document.body.appendChild(oe),oe.click(),document.body.removeChild(oe)})})}const E=_(()=>[{text:e("dashboard.right_click.advanced.title"),icon:"mdi-head-cog",children:[{text:e("dashboard.right_click.advanced.download_path"),icon:"mdi-tray-arrow-down",action:V},{text:e("dashboard.right_click.advanced.save_path"),icon:"mdi-content-save",action:z},{text:e("dashboard.right_click.advanced.rename"),icon:"mdi-rename-box",hidden:p.value,action:X},{text:e("dashboard.right_click.advanced.recheck"),icon:"mdi-playlist-check",action:ie},{text:e("dashboard.right_click.advanced.reannounce"),icon:"mdi-bullhorn",action:he},{text:e("dashboard.right_click.advanced.seq_dl"),icon:f.value?.seq_dl?"mdi-checkbox-marked":"mdi-checkbox-blank-outline",action:xe},{text:e("dashboard.right_click.advanced.f_l_prio"),icon:f.value?.f_l_piece_prio?"mdi-checkbox-marked":"mdi-checkbox-blank-outline",action:de},{text:e("dashboard.right_click.advanced.auto_tmm"),icon:f.value?.auto_tmm?"mdi-checkbox-marked":"mdi-checkbox-blank-outline",action:ue}]},{text:e("dashboard.right_click.priority.title"),icon:"mdi-priority-high",hidden:!o.preferences?.queueing_enabled,children:[{text:e("dashboard.right_click.priority.top"),icon:"mdi-priority-high",action:async()=>await u.setTorrentPriority(s.value,"topPrio")},{text:e("dashboard.right_click.priority.increase"),icon:"mdi-arrow-up",action:async()=>await u.setTorrentPriority(s.value,"increasePrio")},{text:e("dashboard.right_click.priority.decrease"),icon:"mdi-arrow-down",action:async()=>await u.setTorrentPriority(s.value,"decreasePrio")},{text:e("dashboard.right_click.priority.bottom"),icon:"mdi-priority-low",action:async()=>await u.setTorrentPriority(s.value,"bottomPrio")}]},{text:e("dashboard.right_click.tags.title"),icon:"mdi-tag",disabled:d.tags.length===0,disabledText:e("dashboard.right_click.tags.disabled_title"),disabledIcon:"mdi-tag-off",children:[...f.value?.tags.length?[{text:e("dashboard.right_click.tags.remove_all"),action:ae,icon:"mdi-playlist-remove"}]:[],...d.tags.map(S=>({text:S,icon:te(S)?"mdi-checkbox-marked":"mdi-checkbox-blank-outline",action:async()=>await fe(S)}))]},{text:e("dashboard.right_click.category.title"),icon:"mdi-label",disabled:d.categories.length===0,disabledText:e("dashboard.right_click.category.disabled_title"),disabledIcon:"mdi-label-off",children:A.value.map(S=>({text:S.name===""?e("dashboard.right_click.category.clear"):S.name,action:async()=>await u.setTorrentCategory(s.value,S.name)}))},{text:e("dashboard.right_click.speed_limit.title"),icon:"mdi-speedometer-slow",children:[{text:e("dashboard.right_click.speed_limit.download"),icon:"mdi-download",action:ce},{text:e("dashboard.right_click.speed_limit.upload"),icon:"mdi-upload",action:be},{text:e("dashboard.right_click.speed_limit.share"),icon:"mdi-account-group",action:T}]},{text:e("dashboard.right_click.copy.title"),icon:"mdi-content-copy",hidden:p.value,children:[{text:e("dashboard.right_click.copy.name"),icon:"mdi-alphabetical-variant",action:async()=>f.value&&await Z(f.value.name)},{text:e("dashboard.right_click.copy.hash"),icon:"mdi-pound",action:async()=>await Z(b.value)},{text:e("dashboard.right_click.copy.magnet"),icon:"mdi-magnet",action:async()=>f.value&&await Z(f.value.magnet)}]},{text:e("dashboard.right_click.export",t.selectedTorrents.length),icon:p.value?"mdi-download-multiple":"mdi-download",action:B},{text:e("dashboard.right_click.info"),icon:"mdi-information",hidden:p.value,action:()=>r.push({name:"torrentDetail",params:{hash:b.value}})}]);return(S,H)=>(l(),m("div",{style:$e(`position: absolute; left: ${S.rightClickProperties.offset[0]}px; top: ${S.rightClickProperties.offset[1]}px;`)},[n(i(At),{modelValue:S.rightClickProperties.isVisible,"onUpdate:modelValue":H[0]||(H[0]=N=>S.rightClickProperties.isVisible=N),"menu-data":E.value},{top:c(()=>[n(me,null,{default:c(()=>[k("div",zt,[n(Y,{location:"top"},{activator:c(({props:N})=>[n(L,O({density:"compact",variant:"plain",icon:"mdi-play"},N,{onClick:C}),null,16)]),default:c(()=>[k("span",null,v(S.$t("dashboard.right_click.top.resume")),1)]),_:1}),n(Y,{location:"top"},{activator:c(({props:N})=>[n(L,O({density:"compact",variant:"plain",icon:"mdi-fast-forward"},N,{onClick:$}),null,16)]),default:c(()=>[k("span",null,v(S.$t("dashboard.right_click.top.force_resume")),1)]),_:1}),n(Y,{location:"top"},{activator:c(({props:N})=>[n(L,O({density:"compact",variant:"plain",icon:"mdi-pause"},N,{onClick:y}),null,16)]),default:c(()=>[k("span",null,v(S.$t("dashboard.right_click.top.pause")),1)]),_:1}),n(Y,{location:"top"},{activator:c(({props:N})=>[n(L,O({color:"red",density:"compact",variant:"plain",icon:"mdi-delete-forever"},N,{onClick:g}),null,16)]),default:c(()=>[k("span",null,v(S.$t("dashboard.right_click.top.delete")),1)]),_:1})])]),_:1})]),_:1},8,["modelValue","menu-data"])],4))}});Gt={class:"d-flex flex-column"};jt={key:0,class:"text-caption text-grey"};qt={key:0,class:"text-caption text-grey"};nt=w({__name:"ItemAmount",props:{torrent:{},titleKey:{},value:{type:Function},total:{type:Function}},setup(h){return(e,r)=>(l(),m("div",Gt,[e.titleKey?(l(),m("div",jt,v(e.$t(e.titleKey)),1)):x("",!0),k("div",null,[K(v(e.value(e.torrent))+" ",1),e.total?(l(),m("span",qt," / "+v(e.total(e.torrent)),1)):x("",!0)])]))}});Xt={key:0,class:"d-flex flex-column"};Yt={key:0,class:"text-caption text-grey"};Qt={class:"d-flex flex-row flex-gap-column-small"};st=w({__name:"ItemChip",props:{torrent:{},titleKey:{},value:{},emptyValueKey:{},color:{},enableHashColor:{type:Boolean,default:!1}},setup(h){const e=h,{hideChipIfUnset:r}=F(U()),t=_(()=>e.value(e.torrent)),a=_(()=>t.value.length<1||t.value[0]===""),d=_(()=>!(r.value&&a.value));return(o,u)=>d.value?(l(),m("div",Xt,[o.titleKey?(l(),m("div",Yt,v(o.$t(o.titleKey)),1)):x("",!0),k("div",Qt,[a.value?(l(),I(ke,{key:0,disabled:!0,"default-color":o.color(o.torrent),value:o.$t(o.emptyValueKey),size:"small"},null,8,["default-color","value"])):(l(!0),m(M,{key:1},q(t.value,p=>(l(),I(ke,{disabled:!o.enableHashColor,"default-color":o.color(o.torrent),value:p,size:"small"},null,8,["disabled","default-color","value"]))),256))])])):x("",!0)}});Zt={class:"d-flex flex-column"};Jt={key:0,class:"text-caption text-grey"};Wt={class:"text-caption text-grey"};rt=w({__name:"ItemData",props:{torrent:{},titleKey:{},value:{type:Function}},setup(h){const e=h,{useBinarySize:r}=F(U()),t=_(()=>e.value(e.torrent));return(a,d)=>(l(),m("div",Zt,[a.titleKey?(l(),m("div",Jt,v(a.$t(a.titleKey)),1)):x("",!0),k("div",null,[K(v(i(wt)(t.value,i(r)))+" ",1),k("span",Wt,v(i(Vt)(t.value,i(r))),1)])]))}});ea={class:"d-flex flex-column"};ta={key:0,class:"text-caption text-grey"};aa={key:0};oa={key:1};it=w({__name:"ItemDateTime",props:{torrent:{},titleKey:{},value:{type:Function}},setup(h){const e=h,{dateFormat:r}=F(U()),t=_(()=>e.value(e.torrent));return(a,d)=>(l(),m("div",ea,[a.titleKey?(l(),m("div",ta,v(a.$t(a.titleKey)),1)):x("",!0),k("div",null,[t.value>0?(l(),m("span",aa,v(i(We)(t.value,i(r))),1)):(l(),m("span",oa,v(a.$t("dashboard.not_complete")),1))])]))}});la={class:"d-flex flex-column"};na={key:0,class:"text-caption text-grey"};sa={key:0};ra={key:1};dt=w({__name:"ItemDuration",props:{torrent:{},titleKey:{},unit:{},value:{type:Function}},setup(h){const e=h,r=_(()=>e.value(e.torrent)),t=_(()=>{const a=Se.duration(r.value,e.unit),d=[a.years(),a.months(),a.days(),a.hours(),a.minutes(),a.seconds()],o=["Y","M","d","h","m","s"];let u=!1;return d.map((p,s)=>{if(u||p)return u=!0,`${p}${o[s]}`}).filter(p=>p).join(" ")});return(a,d)=>(l(),m("div",la,[a.titleKey?(l(),m("div",na,v(a.$t(a.titleKey)),1)):x("",!0),k("div",null,[r.value>0?(l(),m("span",sa,v(t.value),1)):(l(),m("span",ra,v(a.$t("common.NA")),1))])]))}});ia={class:"d-flex flex-column"};da={key:0,class:"text-caption text-grey"};ut=w({__name:"ItemPercent",props:{torrent:{},titleKey:{},value:{type:Function},color:{type:Function}},setup(h){const e=h,r=_(()=>e.value(e.torrent));return(t,a)=>(l(),m("div",ia,[t.titleKey?(l(),m("div",da,v(t.$t(t.titleKey)),1)):x("",!0),n(tt,{"model-value":r.value,max:1,height:20,color:t.color(t.torrent),rounded:"sm",style:{width:"10em"}},{default:c(()=>[K(v(i(et)(r.value)),1)]),_:1},8,["model-value","color"])]))}});ua={class:"d-flex flex-column"};ca={key:0,class:"text-caption text-grey"};ct=w({__name:"ItemRelativeTime",props:{torrent:{},titleKey:{},value:{type:Function}},setup(h){return(e,r)=>(l(),m("div",ua,[e.titleKey?(l(),m("div",ca,v(e.$t(e.titleKey)),1)):x("",!0),k("div",null,[k("span",null,v(i(Se)(e.value(e.torrent)*1e3).fromNow()),1)])]))}});ma={class:"d-flex flex-column"};pa={key:0,class:"text-caption text-grey"};va={class:"text-caption text-grey"};mt=w({__name:"ItemSpeed",props:{torrent:{},titleKey:{},value:{type:Function}},setup(h){const e=h,{useBitSpeed:r}=F(U()),t=_(()=>e.value(e.torrent));return(a,d)=>(l(),m("div",ma,[a.titleKey?(l(),m("div",pa,v(a.$t(a.titleKey)),1)):x("",!0),k("div",null,[K(v(i(St)(t.value,i(r)))+" ",1),k("span",va,v(i(xt)(t.value,i(r))),1)])]))}});ha={class:"d-flex flex-column"};fa={key:0,class:"text-caption text-grey"};pt=w({__name:"ItemText",props:{torrent:{},titleKey:{},value:{type:Function},color:{type:Function}},setup(h){const e=h,r=_(()=>e.value(e.torrent));return(t,a)=>(l(),m("div",ha,[t.titleKey?(l(),m("div",fa,v(t.$t(t.titleKey)),1)):x("",!0),k("div",{class:ne(t.color?t.color(r.value):"")},v(r.value),3)]))}});ba={class:"d-flex flex-gap flex-wrap"};_a=w({__name:"GridTorrent",props:{torrent:{}},emits:["onTorrentClick"],setup(h){const e=h,{current:r}=ot(),t=Q(),a=U(),d=_(()=>(e.torrent.progress===1?a.doneGridProperties:a.busyGridProperties).filter(b=>b.active).sort((b,f)=>b.order-f.order)),o=s=>{switch(s){case D.AMOUNT:return nt;case D.CHIP:return st;case D.DATA:return rt;case D.DATETIME:return it;case D.DURATION:return dt;case D.PERCENT:return ut;case D.RELATIVE:return ct;case D.SPEED:return mt;case D.TEXT:default:return pt}},u=_(()=>t.isTorrentInSelection(e.torrent.hash)),p=_(()=>r.value.colors[ee(e.torrent.state)]);return(s,b)=>(l(),I(re,{class:"cursor-pointer",style:$e(`border-left: 6px solid ${p.value}`),height:"100%",color:u.value?`${i(ee)(s.torrent.state)}-darken-3`:void 0,onClick:b[0]||(b[0]=f=>s.$emit("onTorrentClick",f,s.torrent))},{default:c(()=>[n(Ae,{class:"text-wrap text-subtitle-1 pt-1 pb-0"},{default:c(()=>[K(v(s.torrent.name),1)]),_:1}),n(ve,null,{default:c(()=>[k("div",ba,[(l(!0),m(M,null,q(d.value,f=>(l(),m(M,null,[f.props?(l(),I(Ee(o(f.type)),O({key:0,torrent:s.torrent,ref_for:!0},f.props),null,16,["torrent"])):x("",!0)],64))),256))])]),_:1})]),_:1},8,["style","color"]))}});ya={class:"d-flex align-center",style:{height:"100%",width:"100%"}};ga=w({__name:"GridView",props:{paginatedTorrents:{}},emits:["onCheckboxClick","onTorrentClick","onTorrentDblClick","onTorrentRightClick","startPress","endPress"],setup(h){const e=lt(),r=Q();return(t,a)=>(l(),I(Fe,{id:"torrentList"},{default:c(()=>[(l(!0),m(M,null,q(t.paginatedTorrents,d=>(l(),I(_e,{cols:"12",lg:"3",md:"4",sm:"6",xl:"2",class:ne([i(e).mobile?"pb-2":"pb-4","pt-0"]),onContextmenu:o=>t.$emit("onTorrentRightClick",o,d),onTouchcancel:a[1]||(a[1]=o=>t.$emit("endPress")),onTouchend:a[2]||(a[2]=o=>t.$emit("endPress")),onTouchmove:a[3]||(a[3]=o=>t.$emit("endPress")),onTouchstart:o=>t.$emit("startPress",o.touches.item(0),d),onDblclick:o=>t.$emit("onTorrentDblClick",d)},{default:c(()=>[k("div",ya,[n(at,null,{default:c(()=>[i(r).isSelectionMultiple?(l(),I(L,{key:0,color:i(ee)(d.state),icon:i(r).isTorrentInSelection(d.hash)?"mdi-checkbox-marked":"mdi-checkbox-blank-outline",class:"mr-2",variant:"text",onClick:o=>t.$emit("onCheckboxClick",d)},null,8,["color","icon","onClick"])):x("",!0)]),_:2},1024),n(_a,{torrent:d,onOnTorrentClick:a[0]||(a[0]=(o,u)=>t.$emit("onTorrentClick",o,u))},null,8,["torrent"])])]),_:2},1032,["class","onContextmenu","onTouchstart","onDblclick"]))),256))]),_:1}))}});ka=Ue(ga,[["__scopeId","data-v-d4d10d01"]]);Ta={class:"d-flex flex-gap flex-wrap"};$a=w({__name:"ListTorrent",props:{torrent:{}},emits:["onTorrentClick"],setup(h){const e=h,{current:r}=ot(),t=Q(),a=U(),d=_(()=>(e.torrent.progress===1?a.doneTorrentProperties:a.busyTorrentProperties).filter(b=>b.active).sort((b,f)=>b.order-f.order)),o=s=>{switch(s){case D.AMOUNT:return nt;case D.CHIP:return st;case D.DATA:return rt;case D.DATETIME:return it;case D.DURATION:return dt;case D.PERCENT:return ut;case D.RELATIVE:return ct;case D.SPEED:return mt;case D.TEXT:default:return pt}},u=_(()=>t.isTorrentInSelection(e.torrent.hash)),p=_(()=>r.value.colors[ee(e.torrent.state)]);return(s,b)=>(l(),I(re,{class:"cursor-pointer",style:$e(`border-left: 6px solid ${p.value}`),width:"100%",color:u.value?`${i(ee)(s.torrent.state)}-darken-3`:void 0,onClick:b[0]||(b[0]=f=>s.$emit("onTorrentClick",f,s.torrent))},{default:c(()=>[n(Ae,{class:"text-wrap pt-1 pb-0 px-2 text-truncate",style:{"font-size":"0.97em"}},{default:c(()=>[K(v(s.torrent.name),1)]),_:1}),n(ve,{class:"pa-2 pt-0"},{default:c(()=>[k("div",Ta,[(l(!0),m(M,null,q(d.value,f=>(l(),m(M,null,[f.props?(l(),I(Ee(o(f.type)),O({key:0,torrent:s.torrent,ref_for:!0},f.props),null,16,["torrent"])):x("",!0)],64))),256))])]),_:1})]),_:1},8,["style","color"]))}});Ca={class:"d-flex align-center"};wa=w({__name:"ListView",props:{paginatedTorrents:{}},emits:["onCheckboxClick","onTorrentClick","onTorrentDblClick","onTorrentRightClick","startPress","endPress"],setup(h){const e=lt(),r=Q();return(t,a)=>(l(),I(Qe,{id:"torrentList",class:"pa-0"},{default:c(()=>[(l(!0),m(M,null,q(t.paginatedTorrents,d=>(l(),I(me,{id:`torrent-${d.hash}`,class:ne([i(e).mobile?"mb-2":"mb-4","pa-0"]),onContextmenu:o=>t.$emit("onTorrentRightClick",o,d),onTouchcancel:a[1]||(a[1]=o=>t.$emit("endPress")),onTouchend:a[2]||(a[2]=o=>t.$emit("endPress")),onTouchmove:a[3]||(a[3]=o=>t.$emit("endPress")),onTouchstart:o=>t.$emit("startPress",o.touches.item(0),d),onDblclick:o=>t.$emit("onTorrentDblClick",d)},{default:c(()=>[k("div",Ca,[n(at,null,{default:c(()=>[i(r).isSelectionMultiple?(l(),I(L,{key:0,color:i(ee)(d.state),icon:i(r).isTorrentInSelection(d.hash)?"mdi-checkbox-marked":"mdi-checkbox-blank-outline",class:"mr-2",variant:"text",onClick:o=>t.$emit("onCheckboxClick",d)},null,8,["color","icon","onClick"])):x("",!0)]),_:2},1024),n($a,{torrent:d,onOnTorrentClick:a[0]||(a[0]=(o,u)=>t.$emit("onTorrentClick",o,u))},null,8,["torrent"])])]),_:2},1032,["id","class","onContextmenu","onTouchstart","onDblclick"]))),256))]),_:1}))}});Va=Ue(wa,[["__scopeId","data-v-8828dd56"]]);Sa={class:"text-no-wrap"};xa={key:0};Da=w({__name:"ItemAmount",props:{torrent:{},value:{type:Function},total:{type:Function}},setup(h){return(e,r)=>(l(),m("td",Sa,[K(v(e.value(e.torrent))+" ",1),e.total?(l(),m("span",xa," / "+v(e.total(e.torrent)),1)):x("",!0)]))}});Ia={key:0,class:"d-flex flex-row flex-gap-column-small"};Pa=w({__name:"ItemChip",props:{torrent:{},value:{},emptyValueKey:{},color:{},enableHashColor:{type:Boolean,default:!1}},setup(h){const e=h,{hideChipIfUnset:r}=F(U()),t=_(()=>e.value(e.torrent)),a=_(()=>t.value.length<1||t.value[0]===""),d=_(()=>!(r.value&&a.value));return(o,u)=>(l(),m("td",null,[d.value?(l(),m("div",Ia,[a.value?(l(),I(ke,{key:0,disabled:!0,"default-color":o.color(o.torrent),value:o.$t(o.emptyValueKey),size:"small"},null,8,["default-color","value"])):(l(!0),m(M,{key:1},q(t.value,p=>(l(),I(ke,{disabled:!o.enableHashColor,"default-color":o.color(o.torrent),value:p,size:"small"},null,8,["disabled","default-color","value"]))),256))])):x("",!0)]))}});Ba={class:"text-no-wrap"};Ea=w({__name:"ItemData",props:{torrent:{},value:{type:Function}},setup(h){const{useBinarySize:e}=F(U());return(r,t)=>(l(),m("td",Ba,v(i(Dt)(r.value(r.torrent),i(e))),1))}});La={key:0,class:"text-no-wrap"};Aa={key:1,class:"text-no-wrap"};Ka=w({__name:"ItemDateTime",props:{torrent:{},value:{type:Function}},setup(h){const e=h,{dateFormat:r}=F(U()),t=_(()=>e.value(e.torrent));return(a,d)=>t.value>0?(l(),m("td",La,v(i(We)(t.value,i(r))),1)):(l(),m("td",Aa,v(a.$t("dashboard.not_complete")),1))}});Ra={key:0,class:"text-no-wrap"};Ma={key:1,class:"text-no-wrap"};Fa=w({__name:"ItemDuration",props:{torrent:{},unit:{},value:{type:Function}},setup(h){const e=h,r=_(()=>e.value(e.torrent)),t=_(()=>{const a=Se.duration(r.value,e.unit),d=[a.years(),a.months(),a.days(),a.hours(),a.minutes(),a.seconds()],o=["Y","M","d","h","m","s"];let u=!1;return d.map((p,s)=>{if(u||p)return u=!0,`${p}${o[s]}`}).filter(p=>p).join(" ")});return(a,d)=>r.value>0?(l(),m("td",Ra,v(t.value),1)):(l(),m("td",Ma,v(a.$t("common.NA")),1))}});Ua=w({__name:"ItemPercent",props:{torrent:{},value:{type:Function},color:{type:Function}},setup(h){const e=h,r=_(()=>e.value(e.torrent));return(t,a)=>(l(),m("td",null,[n(tt,{"model-value":r.value,max:1,height:20,color:t.color(t.torrent),rounded:"sm",style:{width:"10em"}},{default:c(()=>[K(v(i(et)(r.value)),1)]),_:1},8,["model-value","color"])]))}});Oa={class:"text-no-wrap"};Na=w({__name:"ItemRelativeTime",props:{torrent:{},value:{type:Function}},setup(h){return(e,r)=>(l(),m("td",Oa,v(i(Se)(e.value(e.torrent)*1e3).fromNow()),1))}});za={class:"text-no-wrap"};Ha=w({__name:"ItemSpeed",props:{torrent:{},value:{type:Function}},setup(h){const{useBitSpeed:e}=F(U());return(r,t)=>(l(),m("td",za,v(i(It)(r.value(r.torrent),i(e))),1))}});Ga=w({__name:"ItemText",props:{torrent:{},value:{type:Function},color:{type:Function}},setup(h){const e=h,r=_(()=>e.value(e.torrent));return(t,a)=>(l(),m("td",{class:ne([t.color?t.color(r.value):"","text-no-wrap"])},v(r.value),3))}});ja=w({__name:"TableTorrent",props:{torrent:{}},setup(h){const e=U(),r=_(()=>e.tableProperties.filter(a=>a.active).sort((a,d)=>a.order-d.order)),t=a=>{switch(a){case D.AMOUNT:return Da;case D.CHIP:return Pa;case D.DATA:return Ea;case D.DATETIME:return Ka;case D.DURATION:return Fa;case D.PERCENT:return Ua;case D.RELATIVE:return Na;case D.SPEED:return Ha;case D.TEXT:default:return Ga}};return(a,d)=>(l(!0),m(M,null,q(r.value,o=>(l(),m(M,null,[o.props?(l(),I(Ee(t(o.type)),O({key:0,torrent:a.torrent,ref_for:!0},o.props),null,16,["torrent"])):x("",!0)],64))),256))}});qa=h=>(vt("data-v-403c3005"),h=h(),ht(),h);Xa=qa(()=>k("th",{class:"px-1"},null,-1));Ya={key:0};Qa={class:"text-left"};Za={class:"text-left"};Ja=["onContextmenu","onTouchstart","onClick","onDblclick"];Wa={key:0};eo=w({__name:"TableView",props:{paginatedTorrents:{}},emits:["onCheckboxClick","onTorrentClick","onTorrentDblClick","onTorrentRightClick","startPress","endPress"],setup(h){const e=Q(),r=U(),t=_(()=>r.tableProperties.filter(o=>o.active).sort((o,u)=>o.order-u.order));function a(o){return e.isTorrentInSelection(o.hash)}const d=o=>["cursor-pointer",a(o)?`bg-${ee(o.state)}-darken-3 selected`:""];return(o,u)=>(l(),I(Pt,{id:"torrentList",class:"pa-0",density:"compact"},{default:c(()=>[k("thead",null,[k("tr",null,[Xa,i(e).isSelectionMultiple?(l(),m("th",Ya)):x("",!0),k("th",Qa,v(o.$t("torrent.properties.name")),1),(l(!0),m(M,null,q(t.value,p=>(l(),m("th",Za,v(o.$t(p.props.titleKey)),1))),256))])]),k("tbody",null,[(l(!0),m(M,null,q(o.paginatedTorrents,p=>Ye((l(),m("tr",{class:ne(d(p)),onContextmenu:s=>o.$emit("onTorrentRightClick",s,p),onTouchcancel:u[0]||(u[0]=s=>o.$emit("endPress")),onTouchend:u[1]||(u[1]=s=>o.$emit("endPress")),onTouchmove:u[2]||(u[2]=s=>o.$emit("endPress")),onTouchstart:s=>o.$emit("startPress",s.touches.item(0),p),onClick:s=>o.$emit("onTorrentClick",s,p),onDblclick:s=>o.$emit("onTorrentDblClick",p)},[k("td",{class:ne(`pa-0 bg-torrent-${i(Ne)[p.state].toLowerCase()}`)},null,2),i(e).isSelectionMultiple?(l(),m("td",Wa,[n(ye,{"model-value":a(p),color:`torrent-${i(Ne)[p.state].toLowerCase()}`,variant:"text",onClick:J(s=>o.$emit("onCheckboxClick",p),["stop"])},null,8,["model-value","color","onClick"])])):x("",!0),k("td",null,v(p.name),1),n(ja,{torrent:p},null,8,["torrent"])],42,Ja)),[[Bt]])),256))])]),_:1}))}});to=Ue(eo,[["__scopeId","data-v-403c3005"]]);ao={class:"pt-4 px-1 px-sm-5"};oo={class:"text-grey"};lo={key:0,class:"mt-5 text-xs-center"};no={class:"text-grey"};so={key:1};ro={key:5};ho=w({__name:"Dashboard",setup(h){const{t:e}=Te(),r=Xe(),t=Q(),{currentPage:a,isSelectionMultiple:d,selectedTorrents:o,displayMode:u}=F(t),p=Ze(),s=Ve(),b=se(),{processedTorrents:f}=F(b),P=U(),A=_(()=>u.value===j.LIST),C=_(()=>u.value===j.GRID),$=_(()=>u.value===j.TABLE),{paginatedResults:y,currentPage:g,pageCount:V}=Kt(f,P.paginationSize,a),z=_(()=>f.value.length<=o.value.length),X=je({isVisible:!1,offset:[0,0]});function ie(){window.scrollTo({top:0,behavior:"smooth"})}function he(T){if(T)return De(()=>{document.getElementById("searchInput")?.focus()});De(()=>{document.getElementById("searchInput")?.blur()})}function xe(){z.value?t.unselectAllTorrents():t.selectTorrents(...f.value.map(T=>T.hash))}function de(T){d.value||r.push({name:"torrentDetail",params:{hash:T.hash}})}function ue(T){t.toggleSelect(T.hash)}function te(T,B){T.shiftKey?t.spanTorrentSelection(B.hash):(Be(T)||t.isSelectionMultiple)&&(t.isSelectionMultiple=!0,t.toggleSelect(B.hash))}async function ae(T,B){X.isVisible&&(X.isVisible=!1,await De()),X.isVisible=!0,X.offset=[T.pageX,T.pageY],d.value?o.value.length===0&&t.selectTorrent(B.hash):(t.unselectAllTorrents(),t.selectTorrent(B.hash))}const fe=R();function Z(T,B){fe.value=setTimeout(()=>{ae(T,B)},500)}function ce(){clearTimeout(fe.value)}function be(T){if(p.hasActiveDialog)return!1;const B=T.target;if(Be(T)&&T.key==="a"&&B.tagName!=="INPUT")return t.unselectAllTorrents(),t.selectTorrents(...f.value.map(E=>E.hash)),T.preventDefault(),!0;if(Be(T)&&T.key==="f"){const E=document.getElementById("searchInput");if(document.activeElement!==E)return he(!0),T.preventDefault(),!0}if(T.key==="Escape"){const E=document.getElementById("searchInput");return document.activeElement===E?he(!1):(d.value=!1,t.unselectAllTorrents()),T.preventDefault(),!0}if(T.key==="Delete"){if(o.value.length===0)return;const E=document.getElementById("searchInput");return document.activeElement!==E&&(p.createDialog(Je,{hashes:o.value}),T.preventDefault()),!0}if(T.key==="/"){const E=document.getElementById("searchInput");return document.activeElement!==E&&(r.push({name:"searchEngine"}),T.preventDefault()),!0}}return ft(()=>X.isVisible,T=>{!T&&!d.value&&t.unselectAllTorrents()}),Ce(async()=>{await s.fetchCategories(),await s.fetchTags()}),qe(()=>{document.addEventListener("keydown",be),d.value=!1,ie()}),bt(()=>{document.removeEventListener("keydown",be)}),(T,B)=>(l(),m(M,null,[k("div",ao,[n(Ut),n(Fe,{class:"ma-0 pa-0"},{default:c(()=>[n(Et,null,{default:c(()=>[Ye(n(re,{color:"transparent"},{default:c(()=>[n(Y,{text:i(e)("common.selectAll"),location:"bottom"},{activator:c(({props:E})=>[n(L,O({icon:z.value?"mdi-checkbox-marked":"mdi-checkbox-blank-outline",class:"text-grey",color:"transparent",style:{left:"-8px"}},E,{onClick:xe}),null,16,["icon"])]),_:1},8,["text"]),k("span",oo,v(i(e)("dashboard.selectAll")),1)]),_:1},512),[[_t,i(d)]])]),_:1})]),_:1}),i(f).length===0?(l(),m("div",lo,[k("p",no,v(i(e)("common.emptyList")),1)])):x("",!0),i(P).isPaginationOnTop&&!i(P).isInfiniteScrollActive&&i(V)>1?(l(),m("div",so,[n(ze,{modelValue:i(g),"onUpdate:modelValue":B[0]||(B[0]=E=>pe(g)?g.value=E:null),length:i(V),"next-icon":"mdi-menu-right","prev-icon":"mdi-menu-left",onInput:ie},null,8,["modelValue","length"])])):x("",!0),A.value?(l(),I(Va,{key:2,"paginated-torrents":i(y),onOnTorrentClick:te,onOnTorrentDblClick:de,onOnCheckboxClick:ue,onOnTorrentRightClick:ae,onStartPress:Z,onEndPress:ce},null,8,["paginated-torrents"])):C.value?(l(),I(ka,{key:3,class:"mb-2","paginated-torrents":i(y),onOnTorrentClick:te,onOnTorrentDblClick:de,onOnCheckboxClick:ue,onOnTorrentRightClick:ae,onStartPress:Z,onEndPress:ce},null,8,["paginated-torrents"])):$.value?(l(),I(to,{key:4,"paginated-torrents":i(y),onOnTorrentClick:te,onOnTorrentDblClick:de,onOnCheckboxClick:ue,onOnTorrentRightClick:ae,onStartPress:Z,onEndPress:ce},null,8,["paginated-torrents"])):x("",!0),!i(P).isPaginationOnTop&&!i(P).isInfiniteScrollActive&&i(V)>1?(l(),m("div",ro,[n(ze,{modelValue:i(g),"onUpdate:modelValue":B[1]||(B[1]=E=>pe(g)?g.value=E:null),length:i(V),"next-icon":"mdi-menu-right","prev-icon":"mdi-menu-left",onInput:ie},null,8,["modelValue","length"])])):x("",!0)]),n(Ht,{"right-click-properties":X},null,8,["right-click-properties"])],64))}})});export{ho as default,__tla};

View File

@@ -0,0 +1 @@
import{j as v,E as b,S as h,X as C,r as q,f as k,Y as x,a as S,H as K,I as A,J as s,n as e,K as m,L as p,u as l,M as f,O as _,Z as y}from"./vue-CfSjRv-x.js";import{_ as F,__tla as __tla_0}from"./PasswordField.vue_vue_type_script_setup_true_lang-D82vCg5_.js";import{F as T,G as B,V as I,H as M,c as O,d as U,e as E,k as H,f as L,h as N,i as R,__tla as __tla_1}from"./index-C0tfT_Qc.js";import"./vuetify-PctCzU6r.js";let Y;let __tla=Promise.all([(()=>{try{return __tla_0}catch{}})(),(()=>{try{return __tla_1}catch{}})()]).then(async()=>{Y=v({__name:"Login",setup(j){const{t:a}=b(),w=h(),o=C(),u=T(),r=q({username:"",password:""}),c=k(!1),V={username:[d=>!!d||a("login.rules.username_required")],password:[d=>!!d||a("login.rules.password_required")]},i=async()=>{c.value&&(await u.login(r.username,r.password),u.isAuthenticated?(y.success(a("login.success")),g()):y.error(a("login.error")))},g=()=>{o.query.redirect?w.push(o.query.redirect):w.push({name:"dashboard"})};return x(async()=>{o.query.username&&o.query.password&&await u.login(o.query.username,o.query.password)}),S(()=>{u.isAuthenticated&&g()}),(d,n)=>(K(),A(B,{class:"fill-height"},{default:s(()=>[e(R,{class:"mx-auto",rounded:"lg","min-width":"250"},{default:s(()=>[e(I,null,{default:s(()=>[m(p(l(a)("login.title")),1)]),_:1}),e(M,null,{default:s(()=>[m(p(l(a)("login.subtitle")),1)]),_:1}),e(O,null,{default:s(()=>[e(U,{modelValue:c.value,"onUpdate:modelValue":n[2]||(n[2]=t=>c.value=t),onSubmit:f(i,["prevent"])},{default:s(()=>[e(E,{modelValue:r.username,"onUpdate:modelValue":n[0]||(n[0]=t=>r.username=t),id:"username",name:"username",label:l(a)("login.username"),autofocus:"",rules:V.username,onKeydown:_(f(i,["prevent"]),["enter"]),variant:"outlined"},{prepend:s(()=>[e(H,{color:"accent",icon:"mdi-account"})]),_:1},8,["modelValue","label","rules","onKeydown"]),e(F,{modelValue:r.password,"onUpdate:modelValue":n[1]||(n[1]=t=>r.password=t),id:"password",label:l(a)("login.password"),rules:V.password,"prepend-icon":"mdi-lock",onKeydown:_(f(i,["prevent"]),["enter"]),variant:"outlined"},null,8,["modelValue","label","rules","onKeydown"])]),_:1},8,["modelValue"])]),_:1}),e(L,null,{default:s(()=>[e(N,{variant:"elevated",block:"",color:"accent",onClick:i},{default:s(()=>[m(p(l(a)("login.submit")),1)]),_:1})]),_:1})]),_:1})]),_:1}))}})});export{Y as default,__tla};

View File

@@ -1 +0,0 @@
import{h,E as v,S as b,X as C,r as q,f as k,Y as x,a as S,H as K,I as A,J as s,n as e,K as m,L as p,u as l,M as f,O as _,Z as y}from"./vue-BQgCUbk_.js";import{_ as F,__tla as __tla_0}from"./PasswordField.vue_vue_type_script_setup_true_lang-Ba8v8JPP.js";import{F as T,G as B,V as I,H as M,c as O,d as U,e as E,k as H,f as L,h as N,i as R,__tla as __tla_1}from"./index-DF2-l4SD.js";import"./vuetify-DWkLi8Ew.js";let Z;let __tla=Promise.all([(()=>{try{return __tla_0}catch{}})(),(()=>{try{return __tla_1}catch{}})()]).then(async()=>{Z=h({__name:"Login",setup(D){const{t:a}=v(),w=b(),o=C(),u=T(),r=q({username:"",password:""}),c=k(!1),V={username:[d=>!!d||a("login.rules.username_required")],password:[d=>!!d||a("login.rules.password_required")]},i=async()=>{c.value&&(await u.login(r.username,r.password),u.isAuthenticated?(y.success(a("login.success")),g()):y.error(a("login.error")))},g=()=>{o.query.redirect?w.push(o.query.redirect):w.push({name:"dashboard"})};return x(async()=>{o.query.username&&o.query.password&&await u.login(o.query.username,o.query.password)}),S(()=>{u.isAuthenticated&&g()}),(d,n)=>(K(),A(B,{class:"fill-height"},{default:s(()=>[e(R,{class:"mx-auto",rounded:"lg","min-width":"250"},{default:s(()=>[e(I,null,{default:s(()=>[m(p(l(a)("login.title")),1)]),_:1}),e(M,null,{default:s(()=>[m(p(l(a)("login.subtitle")),1)]),_:1}),e(O,null,{default:s(()=>[e(U,{modelValue:c.value,"onUpdate:modelValue":n[2]||(n[2]=t=>c.value=t),onSubmit:f(i,["prevent"])},{default:s(()=>[e(E,{modelValue:r.username,"onUpdate:modelValue":n[0]||(n[0]=t=>r.username=t),id:"username",name:"username",label:l(a)("login.username"),autofocus:"",rules:V.username,onKeydown:_(f(i,["prevent"]),["enter"]),variant:"outlined"},{prepend:s(()=>[e(H,{color:"accent",icon:"mdi-account"})]),_:1},8,["modelValue","label","rules","onKeydown"]),e(F,{modelValue:r.password,"onUpdate:modelValue":n[1]||(n[1]=t=>r.password=t),id:"password",label:l(a)("login.password"),rules:V.password,"prepend-icon":"mdi-lock",onKeydown:_(f(i,["prevent"]),["enter"]),variant:"outlined"},null,8,["modelValue","label","rules","onKeydown"])]),_:1},8,["modelValue"])]),_:1}),e(L,null,{default:s(()=>[e(N,{variant:"elevated",block:"",color:"accent",onClick:i},{default:s(()=>[m(p(l(a)("login.submit")),1)]),_:1})]),_:1})]),_:1})]),_:1}))}})});export{Z as default,__tla};

View File

@@ -1 +1 @@
import{u as K,__tla as __tla_0}from"./ArrayPagination-O41uS7-1.js";import{l as Q,m as J,T as X,L as l,n as Y,o as Z,p as A,q as ee,r as f,h as te,s as m,t as le,v as ae,w as c,e as se,x as R,y as ne,z as oe,A as ue,g as re,B as ie,C as de,__tla as __tla_1}from"./index-DF2-l4SD.js";import{h as me,S as ce,E as pe,c as p,f as T,G as ge,T as fe,H as r,Q as k,n as e,J as a,U as v,L as i,u as n,I as y,P as b,N as V,F,V as ve,W as B,K as E}from"./vue-BQgCUbk_.js";import{a as ye}from"./vuetify-DWkLi8Ew.js";let xe;let __tla=Promise.all([(()=>{try{return __tla_0}catch{}})(),(()=>{try{return __tla_1}catch{}})()]).then(async()=>{let Ve,he,Le,_e,Te;Ve={class:"pa-3"};he={style:{"font-size":"1.6em !important"},class:"subtitle-1 ml-2"};Le={class:"d-flex justify-end"};_e={class:"d-flex mr-8 overflow-hidden"};Te={class:"d-flex"};xe=me({__name:"Logs",setup(ke){const P=ce(),{t:O}=pe(),{current:U}=ye(),h=Q(),$=J(),G=p(()=>({light:{normal:"black",info:"blue",warning:"orange",critical:"red"},dark:{normal:"white",info:"deepskyblue",warning:"darkorange",critical:new X("darkred").lighten(12).toString()}})),L=T([{title:l[l.NORMAL],value:l.NORMAL},{title:l[l.INFO],value:l.INFO},{title:l[l.WARNING],value:l.WARNING},{title:l[l.CRITICAL],value:l.CRITICAL}]),u=T([l.NORMAL,l.INFO,l.WARNING,l.CRITICAL]),_=T(""),M=p(()=>h.logs),W=p(()=>M.value.filter(t=>u.value.includes(t.type))),C=p(()=>u.value.length>0),N=p(()=>u.value.length===L.value.length),{results:I}=Y(W,_,t=>t.message),{paginatedResults:j,currentPage:d,pageCount:g}=K(I,30),w=()=>{P.push({name:"dashboard"})},x=t=>`color: ${G.value[U.value.dark?"dark":"light"][l[t.type].toLowerCase()]}`,q=t=>l[t.type],z=t=>de(t.timestamp*1e3).format($.dateFormat),D=()=>{N.value?u.value=[]:u.value=L.value.map(t=>t.value)},S=t=>{t.key==="Escape"&&w()};return ge(async()=>{document.addEventListener("keydown",S),await h.cleanAndFetchLogs(),Z(h.fetchLogs,15e3)}),fe(()=>{document.removeEventListener("keydown",S)}),(t,o)=>(r(),k("div",Ve,[e(A,{"no-gutters":"",align:"center",justify:"center"},{default:a(()=>[e(f,null,{default:a(()=>[v("h1",he,i(n(O)("logs.title")),1)]),_:1}),e(f,null,{default:a(()=>[v("div",Le,[e(te,{icon:"mdi-close",variant:"plain",onClick:w})])]),_:1})]),_:1}),e(ee,null,{default:a(()=>[e(m,null,{default:a(()=>[e(A,null,{default:a(()=>[e(f,{cols:"6"},{default:a(()=>[e(le,{modelValue:u.value,"onUpdate:modelValue":o[0]||(o[0]=s=>u.value=s),items:L.value,label:t.$t("logs.filters.type"),"hide-details":"",multiple:"",chips:""},{"prepend-item":a(()=>[e(m,{title:t.$t("common.selectAll"),onClick:D},{prepend:a(()=>[e(ae,{indeterminate:C.value&&!N.value,"model-value":C.value},null,8,["indeterminate","model-value"])]),_:1},8,["title"]),e(c)]),_:1},8,["modelValue","items","label"])]),_:1}),e(f,{cols:"6"},{default:a(()=>[e(se,{modelValue:_.value,"onUpdate:modelValue":o[1]||(o[1]=s=>_.value=s),label:t.$t("logs.filters.query"),"hide-details":"",clearable:""},null,8,["modelValue","label"])]),_:1})]),_:1})]),_:1}),e(c,{class:"my-3",thickness:"5"}),n(g)>1?(r(),y(m,{key:0},{default:a(()=>[e(R,{modelValue:n(d),"onUpdate:modelValue":o[2]||(o[2]=s=>b(d)?d.value=s:null),length:n(g),"prev-icon":"mdi-menu-left","next-icon":"mdi-menu-right"},null,8,["modelValue","length"])]),_:1})):V("",!0),e(c),(r(!0),k(F,null,ve(n(j),(s,H)=>(r(),k(F,null,[H>0?(r(),y(c,{key:0})):V("",!0),e(m,{class:"pa-0"},{default:a(()=>[e(ne,{class:"p-0"},{default:a(()=>[e(oe,{class:"pa-0"},{default:a(()=>[e(ue,{class:"text-no-wrap",style:B(x(s))},{default:a(()=>[v("div",_e,"["+i(s.id)+"] "+i(s.message),1),e(re),v("div",Te,i(z(s)),1)]),_:2},1032,["style"]),e(ie,{class:"wrap-word text-select",style:B(x(s))},{default:a(()=>[E(" ["+i(q(s))+"] "+i(s.message),1)]),_:2},1032,["style"])]),_:2},1024)]),_:2},1024)]),_:2},1024)],64))),256)),n(I).length===0?(r(),y(m,{key:1},{default:a(()=>[E(i(t.$t("logs.emptyLogList")),1)]),_:1})):V("",!0),e(c),n(g)>1?(r(),y(m,{key:2},{default:a(()=>[e(R,{modelValue:n(d),"onUpdate:modelValue":o[3]||(o[3]=s=>b(d)?d.value=s:null),length:n(g),"prev-icon":"mdi-menu-left","next-icon":"mdi-menu-right"},null,8,["modelValue","length"])]),_:1})):V("",!0)]),_:1})]))}})});export{xe as default,__tla}; import{u as K,__tla as __tla_0}from"./ArrayPagination-C54Dd5Tu.js";import{l as Q,m as J,T as X,L as l,n as Y,o as Z,p as A,q as ee,r as f,h as te,s as m,t as le,v as ae,w as c,e as se,x as R,y as ne,z as oe,A as ue,g as re,B as ie,C as de,__tla as __tla_1}from"./index-C0tfT_Qc.js";import{j as me,S as ce,E as pe,c as p,f as T,G as ge,T as fe,H as r,Q as k,n as e,J as a,U as v,L as i,u as n,I as y,P as b,N as V,F,V as ve,W as B,K as E}from"./vue-CfSjRv-x.js";import{a as ye}from"./vuetify-PctCzU6r.js";let xe;let __tla=Promise.all([(()=>{try{return __tla_0}catch{}})(),(()=>{try{return __tla_1}catch{}})()]).then(async()=>{let Ve,he,Le,_e,Te;Ve={class:"pa-3"};he={style:{"font-size":"1.6em !important"},class:"subtitle-1 ml-2"};Le={class:"d-flex justify-end"};_e={class:"d-flex mr-8 overflow-hidden"};Te={class:"d-flex"};xe=me({__name:"Logs",setup(ke){const P=ce(),{t:O}=pe(),{current:U}=ye(),h=Q(),$=J(),j=p(()=>({light:{normal:"black",info:"blue",warning:"orange",critical:"red"},dark:{normal:"white",info:"deepskyblue",warning:"darkorange",critical:new X("darkred").lighten(12).toString()}})),L=T([{title:l[l.NORMAL],value:l.NORMAL},{title:l[l.INFO],value:l.INFO},{title:l[l.WARNING],value:l.WARNING},{title:l[l.CRITICAL],value:l.CRITICAL}]),u=T([l.NORMAL,l.INFO,l.WARNING,l.CRITICAL]),_=T(""),G=p(()=>h.logs),M=p(()=>G.value.filter(t=>u.value.includes(t.type))),C=p(()=>u.value.length>0),N=p(()=>u.value.length===L.value.length),{results:I}=Y(M,_,t=>t.message),{paginatedResults:W,currentPage:d,pageCount:g}=K(I,30),w=()=>{P.push({name:"dashboard"})},x=t=>`color: ${j.value[U.value.dark?"dark":"light"][l[t.type].toLowerCase()]}`,q=t=>l[t.type],z=t=>de(t.timestamp*1e3).format($.dateFormat),D=()=>{N.value?u.value=[]:u.value=L.value.map(t=>t.value)},S=t=>{t.key==="Escape"&&w()};return ge(async()=>{document.addEventListener("keydown",S),await h.cleanAndFetchLogs(),Z(h.fetchLogs,15e3)}),fe(()=>{document.removeEventListener("keydown",S)}),(t,o)=>(r(),k("div",Ve,[e(A,{"no-gutters":"",align:"center",justify:"center"},{default:a(()=>[e(f,null,{default:a(()=>[v("h1",he,i(n(O)("logs.title")),1)]),_:1}),e(f,null,{default:a(()=>[v("div",Le,[e(te,{icon:"mdi-close",variant:"plain",onClick:w})])]),_:1})]),_:1}),e(ee,null,{default:a(()=>[e(m,null,{default:a(()=>[e(A,null,{default:a(()=>[e(f,{cols:"6"},{default:a(()=>[e(le,{modelValue:u.value,"onUpdate:modelValue":o[0]||(o[0]=s=>u.value=s),items:L.value,label:t.$t("logs.filters.type"),"hide-details":"",multiple:"",chips:""},{"prepend-item":a(()=>[e(m,{title:t.$t("common.selectAll"),onClick:D},{prepend:a(()=>[e(ae,{indeterminate:C.value&&!N.value,"model-value":C.value},null,8,["indeterminate","model-value"])]),_:1},8,["title"]),e(c)]),_:1},8,["modelValue","items","label"])]),_:1}),e(f,{cols:"6"},{default:a(()=>[e(se,{modelValue:_.value,"onUpdate:modelValue":o[1]||(o[1]=s=>_.value=s),label:t.$t("logs.filters.query"),"hide-details":"",clearable:""},null,8,["modelValue","label"])]),_:1})]),_:1})]),_:1}),e(c,{class:"my-3",thickness:"5"}),n(g)>1?(r(),y(m,{key:0},{default:a(()=>[e(R,{modelValue:n(d),"onUpdate:modelValue":o[2]||(o[2]=s=>b(d)?d.value=s:null),length:n(g),"prev-icon":"mdi-menu-left","next-icon":"mdi-menu-right"},null,8,["modelValue","length"])]),_:1})):V("",!0),e(c),(r(!0),k(F,null,ve(n(W),(s,H)=>(r(),k(F,null,[H>0?(r(),y(c,{key:0})):V("",!0),e(m,{class:"pa-0"},{default:a(()=>[e(ne,{class:"p-0"},{default:a(()=>[e(oe,{class:"pa-0"},{default:a(()=>[e(ue,{class:"text-no-wrap",style:B(x(s))},{default:a(()=>[v("div",_e,"["+i(s.id)+"] "+i(s.message),1),e(re),v("div",Te,i(z(s)),1)]),_:2},1032,["style"]),e(ie,{class:"wrap-word text-select",style:B(x(s))},{default:a(()=>[E(" ["+i(q(s))+"] "+i(s.message),1)]),_:2},1032,["style"])]),_:2},1024)]),_:2},1024)]),_:2},1024)],64))),256)),n(I).length===0?(r(),y(m,{key:1},{default:a(()=>[E(i(t.$t("logs.emptyLogList")),1)]),_:1})):V("",!0),e(c),n(g)>1?(r(),y(m,{key:2},{default:a(()=>[e(R,{modelValue:n(d),"onUpdate:modelValue":o[3]||(o[3]=s=>b(d)?d.value=s:null),length:n(g),"prev-icon":"mdi-menu-left","next-icon":"mdi-menu-right"},null,8,["modelValue","length"])]),_:1})):V("",!0)]),_:1})]))}})});export{xe as default,__tla};

View File

@@ -1 +1 @@
import{D as r,E as n,_ as u,__tla as __tla_0}from"./index-DF2-l4SD.js";import{h as i,X as m,S as d,G as p}from"./vue-BQgCUbk_.js";import"./vuetify-DWkLi8Ew.js";let g;let __tla=Promise.all([(()=>{try{return __tla_0}catch{}})()]).then(async()=>{g=i({__name:"MagnetHandler",setup(c){const t=m(),s=d(),e=r(),a=n();return p(async()=>{const o=decodeURIComponent(t.params.url);o.startsWith("magnet:")&&(e.isFirstInit=!1,e.pushTorrentToQueue(o),a.createDialog(u)),await s.push({name:"dashboard"})}),()=>{}}})});export{g as default,__tla}; import{D as r,E as n,_ as u,__tla as __tla_0}from"./index-C0tfT_Qc.js";import{j as i,X as m,S as d,G as p}from"./vue-CfSjRv-x.js";import"./vuetify-PctCzU6r.js";let g;let __tla=Promise.all([(()=>{try{return __tla_0}catch{}})()]).then(async()=>{g=i({__name:"MagnetHandler",setup(c){const t=m(),s=d(),e=r(),a=n();return p(async()=>{const o=decodeURIComponent(t.params.url);o.startsWith("magnet:")&&(e.isFirstInit=!1,e.pushTorrentToQueue(o),a.createDialog(u)),await s.push({name:"dashboard"})}),()=>{}}})});export{g as default,__tla};

View File

@@ -0,0 +1 @@
import{k as r,h as u,__tla as __tla_0}from"./index-C0tfT_Qc.js";import{j as p,c as f,H as o,I as a,J as i,K as m,L as n,N as s,Q as b}from"./vue-CfSjRv-x.js";import{u as k}from"./vuetify-PctCzU6r.js";let x;let __tla=Promise.all([(()=>{try{return __tla_0}catch{}})()]).then(async()=>{let v;v={key:1,"data-testid":"mixedbtn-text"};x=p({__name:"MixedButton",props:{mobileOverride:{type:Boolean,default:!1},mobileValue:{type:Boolean},position:{},icon:{},text:{}},setup(c){const l=c,{mobile:d}=k(),t=f(()=>l.mobileOverride?l.mobileValue:d.value);return(e,y)=>(o(),a(u,{icon:t.value},{default:i(()=>[t.value||e.position==="left"?(o(),a(r,{key:0,"data-testid":"mixedbtn-icon-left"},{default:i(()=>[m(n(e.icon),1)]),_:1})):s("",!0),t.value?s("",!0):(o(),b("span",v,n(e.text),1)),!t.value&&e.position==="right"?(o(),a(r,{key:2,"data-testid":"mixedbtn-icon-right"},{default:i(()=>[m(n(e.icon),1)]),_:1})):s("",!0)]),_:1},8,["icon"]))}})});export{x as _,__tla};

View File

@@ -1 +0,0 @@
import{k as r,h as u,__tla as __tla_0}from"./index-DF2-l4SD.js";import{h as p,c as f,H as o,I as a,J as i,K as m,L as n,N as s,Q as b}from"./vue-BQgCUbk_.js";import{u as h}from"./vuetify-DWkLi8Ew.js";let x;let __tla=Promise.all([(()=>{try{return __tla_0}catch{}})()]).then(async()=>{let k;k={key:1,"data-testid":"mixedbtn-text"};x=p({__name:"MixedButton",props:{mobileOverride:{type:Boolean,default:!1},mobileValue:{type:Boolean},position:{},icon:{},text:{}},setup(c){const l=c,{mobile:d}=h(),t=f(()=>l.mobileOverride?l.mobileValue:d.value);return(e,v)=>(o(),a(u,{icon:t.value},{default:i(()=>[t.value||e.position==="left"?(o(),a(r,{key:0,"data-testid":"mixedbtn-icon-left"},{default:i(()=>[m(n(e.icon),1)]),_:1})):s("",!0),t.value?s("",!0):(o(),b("span",k,n(e.text),1)),!t.value&&e.position==="right"?(o(),a(r,{key:2,"data-testid":"mixedbtn-icon-right"},{default:i(()=>[m(n(e.icon),1)]),_:1})):s("",!0)]),_:1},8,["icon"]))}})});export{x as _,__tla};

View File

@@ -1 +0,0 @@
import{k as b,g as D,Y as I,q as K,s as H,a as U,Z as q,$ as L,V as A,c as O,d as j,e as G,K as J,M as Q,f as Y,h as B,i as Z,j as z,__tla as __tla_0}from"./index-DF2-l4SD.js";import{h as C,a0 as W,H as o,I as s,J as a,U as X,K as c,L as i,N as m,Q as g,n as l,V as R,q as E,F,a1 as x,a2 as ee,a3 as ae,E as oe,f as T,r as te,c as S,G as le,u as _,M as se,O as ne,P as re}from"./vue-BQgCUbk_.js";let he,pe;let __tla=Promise.all([(()=>{try{return __tla_0}catch{}})()]).then(async()=>{let de,ie,ue,me;de={class:"d-flex"};ie={key:2};ue={key:3};me=C({__name:"RightClickMenuEntry",props:{text:{},icon:{},action:{type:Function},hidden:{type:Boolean},disabled:{type:Boolean},disabledText:{},disabledIcon:{},children:{}},setup(f){const t=f,n=()=>{t.action&&t.action()};return(e,u)=>{const h=W("RightClickMenuEntry",!0);return e.hidden?m("",!0):(o(),s(H,{key:0,class:"px-3",disabled:e.disabled,onClick:n},{default:a(()=>[X("div",de,[e.disabled&&e.disabledIcon?(o(),s(b,{key:0,class:"mr-2"},{default:a(()=>[c(i(e.disabledIcon),1)]),_:1})):e.icon?(o(),s(b,{key:1,class:"mr-2"},{default:a(()=>[c(i(e.icon),1)]),_:1})):m("",!0),e.disabled&&e.disabledText?(o(),g("span",ie,i(e.disabledText),1)):(o(),g("span",ue,i(e.text),1)),l(D),!e.disabled&&e.children?(o(),s(b,{key:4},{default:a(()=>[c("mdi-chevron-right")]),_:1})):m("",!0)]),e.children?(o(),s(I,{key:0,activator:"parent","open-on-hover":"","open-on-click":"","close-delay":"10","open-delay":"0",location:"right"},{default:a(()=>[l(K,null,{default:a(()=>[(o(!0),g(F,null,R(e.children,v=>(o(),s(h,E({ref_for:!0},v),null,16))),256))]),_:1})]),_:1})):m("",!0)]),_:1},8,["disabled"]))}}});pe=C({__name:"RightClickMenu",props:x({menuData:{}},{modelValue:{type:Boolean,required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(f){const t=ee(f,"modelValue");return(n,e)=>t.value?(o(),s(I,{key:0,modelValue:t.value,"onUpdate:modelValue":e[0]||(e[0]=u=>t.value=u),activator:"parent","close-on-content-click":!0,transition:"slide-y-transition","scroll-strategy":"none"},{default:a(()=>[l(K,null,{default:a(()=>[ae(n.$slots,"top"),(o(!0),g(F,null,R(n.menuData,u=>(o(),s(me,E({ref_for:!0},u),null,16))),256))]),_:3})]),_:3},8,["modelValue"])):m("",!0)}});he=C({__name:"MoveTorrentDialog",props:{guid:{},hashes:{},mode:{}},setup(f){const t=f,{isOpened:n}=U(t.guid),{t:e}=oe(),u=q(),h=L(),v=T(),w=T(),V=T(!1),y=te({newPath:""}),N=[r=>!!r||e("dialogs.moveTorrent.required")],M=S(()=>t.hashes.map(h.getTorrentByHash)),k=S(()=>{switch(t.mode){case"dl":return M.value[0]?.download_path;case"save":return M.value[0]?.savePath}});async function P(){await v.value?.validate(),V.value&&(await u.toggleAutoTmm(t.hashes,!1),await h.moveTorrents(t.mode,t.hashes,y.newPath),w.value?.saveValueToHistory(),$())}const $=()=>{n.value=!1};return le(()=>{y.newPath=k.value||""}),(r,d)=>(o(),s(z,{modelValue:_(n),"onUpdate:modelValue":d[3]||(d[3]=p=>re(n)?n.value=p:null)},{default:a(()=>[l(Z,null,{default:a(()=>[l(A,null,{default:a(()=>[c(i(r.$t(`dialogs.moveTorrent.${r.mode}.title`)),1)]),_:1}),l(O,null,{default:a(()=>[l(_(j),{modelValue:V.value,"onUpdate:modelValue":d[1]||(d[1]=p=>V.value=p),ref_key:"form",ref:v,onSubmit:d[2]||(d[2]=se(()=>{},["prevent"]))},{default:a(()=>[k.value?(o(),s(G,{key:0,"model-value":k.value,disabled:"",label:r.$t("dialogs.moveTorrent.oldPath")},null,8,["model-value","label"])):m("",!0),l(J,{modelValue:y.newPath,"onUpdate:modelValue":d[0]||(d[0]=p=>y.newPath=p),historyKey:_(Q).TORRENT_PATH,ref_key:"field",ref:w,rules:N,autofocus:"",label:r.$t("dialogs.moveTorrent.newPath"),onKeydown:ne(P,["enter"])},null,8,["modelValue","historyKey","label"])]),_:1},8,["modelValue"])]),_:1}),l(Y,null,{default:a(()=>[l(D),l(B,{color:"error",onClick:$},{default:a(()=>[c(i(r.$t("common.cancel")),1)]),_:1}),l(B,{color:"accent",disabled:!V.value,onClick:P},{default:a(()=>[c(i(r.$t("common.save")),1)]),_:1},8,["disabled"])]),_:1})]),_:1})]),_:1},8,["modelValue"]))}})});export{he as _,pe as a,__tla};

View File

@@ -0,0 +1 @@
import{_ as o,__tla as __tla_0}from"./MoveTorrentFileDialog.vue_vue_type_script_setup_true_lang-C8uA-x2z.js";import"./vue-CfSjRv-x.js";import{__tla as __tla_1}from"./index-C0tfT_Qc.js";import"./vuetify-PctCzU6r.js";let __tla=Promise.all([(()=>{try{return __tla_0}catch{}})(),(()=>{try{return __tla_1}catch{}})()]).then(async()=>{});export{o as default,__tla};

View File

@@ -1 +0,0 @@
import{_ as o,__tla as __tla_0}from"./MoveTorrentFileDialog.vue_vue_type_script_setup_true_lang-DEnRCAW6.js";import"./vue-BQgCUbk_.js";import{__tla as __tla_1}from"./index-DF2-l4SD.js";import"./vuetify-DWkLi8Ew.js";let __tla=Promise.all([(()=>{try{return __tla_0}catch{}})(),(()=>{try{return __tla_1}catch{}})()]).then(async()=>{});export{o as default,__tla};

View File

@@ -0,0 +1 @@
import{j as I,E as S,f as u,r as h,G as x,x as g,H as F,I as T,J as t,n as l,K as m,L as f,u as V,M as B,N as D,O as M,P as O}from"./vue-CfSjRv-x.js";import{a as $,b as K,V as U,c as j,d as P,e as b,f as R,g as _,h as C,i as q,j as A,__tla as __tla_0}from"./index-C0tfT_Qc.js";let H;let __tla=Promise.all([(()=>{try{return __tla_0}catch{}})()]).then(async()=>{H=I({__name:"MoveTorrentFileDialog",props:{guid:{},hash:{},isFolder:{type:Boolean},oldName:{}},setup(k){const o=k,{isOpened:r}=$(o.guid),{t:c}=S(),N=K(),p=u(),i=u(),d=u(!1),n=h({newName:""}),y=[e=>!!e||c("dialogs.moveTorrent.required")];async function v(){await p.value?.validate(),d.value&&(o.isFolder?await N.renameTorrentFolder(o.hash,o.oldName,n.newName):await N.renameTorrentFile(o.hash,o.oldName,n.newName),w())}const w=()=>{r.value=!1};return x(()=>{if(n.newName=o.oldName,o.isFolder)g(()=>i.value?.select());else{const e=n.newName.lastIndexOf("/"),a=n.newName.lastIndexOf(".");g(()=>{i.value?.setSelectionRange(e+1,a==-1?n.newName.length:a)})}}),(e,a)=>(F(),T(A,{modelValue:V(r),"onUpdate:modelValue":a[3]||(a[3]=s=>O(r)?r.value=s:null)},{default:t(()=>[l(q,null,{default:t(()=>[l(U,null,{default:t(()=>[m(f(V(c)("dialogs.moveTorrentFile.title",1+Number(e.isFolder))),1)]),_:1}),l(j,null,{default:t(()=>[l(V(P),{modelValue:d.value,"onUpdate:modelValue":a[1]||(a[1]=s=>d.value=s),ref_key:"form",ref:p,onSubmit:a[2]||(a[2]=B(()=>{},["prevent"]))},{default:t(()=>[e.oldName?(F(),T(b,{key:0,"model-value":e.oldName,disabled:"",label:e.$t("dialogs.moveTorrentFile.oldName")},null,8,["model-value","label"])):D("",!0),l(b,{modelValue:n.newName,"onUpdate:modelValue":a[0]||(a[0]=s=>n.newName=s),ref_key:"input",ref:i,rules:y,autofocus:"",label:e.$t("dialogs.moveTorrent.newPath"),onKeydown:M(v,["enter"])},null,8,["modelValue","label"])]),_:1},8,["modelValue"])]),_:1}),l(R,null,{default:t(()=>[l(_),l(C,{color:"error",onClick:w},{default:t(()=>[m(f(e.$t("common.cancel")),1)]),_:1}),l(C,{color:"accent",disabled:!d.value,onClick:v},{default:t(()=>[m(f(e.$t("common.save")),1)]),_:1},8,["disabled"])]),_:1})]),_:1})]),_:1},8,["modelValue"]))}})});export{H as _,__tla};

View File

@@ -1 +0,0 @@
import{h,E as I,f as u,r as S,G as x,x as g,H as F,I as T,J as t,n as l,K as m,L as f,u as V,M as B,N as D,O as M,P as O}from"./vue-BQgCUbk_.js";import{a as $,b as K,V as U,c as P,d as R,e as b,f as _,g as j,h as C,i as q,j as A,__tla as __tla_0}from"./index-DF2-l4SD.js";let H;let __tla=Promise.all([(()=>{try{return __tla_0}catch{}})()]).then(async()=>{H=h({__name:"MoveTorrentFileDialog",props:{guid:{},hash:{},isFolder:{type:Boolean},oldName:{}},setup(k){const o=k,{isOpened:r}=$(o.guid),{t:c}=I(),N=K(),p=u(),i=u(),d=u(!1),n=S({newName:""}),y=[e=>!!e||c("dialogs.moveTorrent.required")];async function v(){await p.value?.validate(),d.value&&(o.isFolder?await N.renameTorrentFolder(o.hash,o.oldName,n.newName):await N.renameTorrentFile(o.hash,o.oldName,n.newName),w())}const w=()=>{r.value=!1};return x(()=>{if(n.newName=o.oldName,o.isFolder)g(()=>i.value?.select());else{const e=n.newName.lastIndexOf("/"),a=n.newName.lastIndexOf(".");g(()=>{i.value?.setSelectionRange(e+1,a==-1?n.newName.length:a)})}}),(e,a)=>(F(),T(A,{modelValue:V(r),"onUpdate:modelValue":a[3]||(a[3]=s=>O(r)?r.value=s:null)},{default:t(()=>[l(q,null,{default:t(()=>[l(U,null,{default:t(()=>[m(f(V(c)("dialogs.moveTorrentFile.title",1+Number(e.isFolder))),1)]),_:1}),l(P,null,{default:t(()=>[l(V(R),{modelValue:d.value,"onUpdate:modelValue":a[1]||(a[1]=s=>d.value=s),ref_key:"form",ref:p,onSubmit:a[2]||(a[2]=B(()=>{},["prevent"]))},{default:t(()=>[e.oldName?(F(),T(b,{key:0,"model-value":e.oldName,disabled:"",label:e.$t("dialogs.moveTorrentFile.oldName")},null,8,["model-value","label"])):D("",!0),l(b,{modelValue:n.newName,"onUpdate:modelValue":a[0]||(a[0]=s=>n.newName=s),ref_key:"input",ref:i,rules:y,autofocus:"",label:e.$t("dialogs.moveTorrent.newPath"),onKeydown:M(v,["enter"])},null,8,["modelValue","label"])]),_:1},8,["modelValue"])]),_:1}),l(_,null,{default:t(()=>[l(j),l(C,{color:"error",onClick:w},{default:t(()=>[m(f(e.$t("common.cancel")),1)]),_:1}),l(C,{color:"accent",disabled:!d.value,onClick:v},{default:t(()=>[m(f(e.$t("common.save")),1)]),_:1},8,["disabled"])]),_:1})]),_:1})]),_:1},8,["modelValue"]))}})});export{H as _,__tla};

View File

@@ -1 +1 @@
import{k as c,e as r,__tla as __tla_0}from"./index-DF2-l4SD.js";import{h as t,f as d,c as o,H as i,I as l,R as m,J as u,n as f}from"./vue-BQgCUbk_.js";let y;let __tla=Promise.all([(()=>{try{return __tla_0}catch{}})()]).then(async()=>{y=t({__name:"PasswordField",props:{hideIcon:{type:Boolean},prependIcon:{}},setup(I){const e=d(!1);function a(){e.value=!e.value}const p=o(()=>e.value?"text":"password"),s=o(()=>e.value?"mdi-eye":"mdi-eye-off");return(n,h)=>(i(),l(r,{name:"password",type:p.value,"append-inner-icon":n.hideIcon?"":s.value,"onClick:appendInner":a},m({_:2},[n.prependIcon?{name:"prepend",fn:u(()=>[f(c,{color:"accent",icon:n.prependIcon},null,8,["icon"])]),key:"0"}:void 0]),1032,["type","append-inner-icon"]))}})});export{y as _,__tla}; import{k as c,e as r,__tla as __tla_0}from"./index-C0tfT_Qc.js";import{j as t,f as d,c as o,H as i,I as l,R as m,J as u,n as f}from"./vue-CfSjRv-x.js";let _;let __tla=Promise.all([(()=>{try{return __tla_0}catch{}})()]).then(async()=>{_=t({__name:"PasswordField",props:{hideIcon:{type:Boolean},prependIcon:{}},setup(I){const e=d(!1);function a(){e.value=!e.value}const p=o(()=>e.value?"text":"password"),s=o(()=>e.value?"mdi-eye":"mdi-eye-off");return(n,v)=>(i(),l(r,{name:"password",type:p.value,"append-inner-icon":n.hideIcon?"":s.value,"onClick:appendInner":a},m({_:2},[n.prependIcon?{name:"prepend",fn:u(()=>[f(c,{color:"accent",icon:n.prependIcon},null,8,["icon"])]),key:"0"}:void 0]),1032,["type","append-inner-icon"]))}})});export{_,__tla};

View File

@@ -1 +1 @@
import{h as _,E as te,f as B,r as le,G as ae,H as r,I as b,J as t,n as e,K as w,L as h,u as A,M as j,O as fe,P as Z,U,Q as S,N as T,_ as ne,X as ke,c as L,V as J,F as M,q as N,S as be,Y as Fe,T as se,a2 as pe}from"./vue-BQgCUbk_.js";import{a as Re,a0 as q,i as z,V as W,c as x,d as Ae,e as P,f as oe,g as H,h as F,j as ee,a1 as ie,a2 as Se,s as G,D as Te,m as _e,x as ve,w as K,q as re,a3 as Ee,k as ge,Q as O,a4 as Ne,E as ue,a5 as he,a6 as Y,a7 as Me,p as Q,r as I,I as de,J as Ce,a8 as Le,Z as Oe,a9 as Ie,aa as Pe,ab as $e,ac as Be,ad as je,__tla as __tla_0}from"./index-DF2-l4SD.js";import{d as qe}from"./index-UntZWul-.js";import{u as Ge,__tla as __tla_1}from"./ArrayPagination-O41uS7-1.js";import{u as He}from"./vuetify-DWkLi8Ew.js";let bt;let __tla=Promise.all([(()=>{try{return __tla_0}catch{}})(),(()=>{try{return __tla_1}catch{}})()]).then(async()=>{var E=(p=>(p[p.LOADING=0]="LOADING",p[p.ERROR=1]="ERROR",p[p.UNREAD=2]="UNREAD",p[p.READ=3]="READ",p))(E||{});const Ke=_({__name:"RssFeedDialog",props:{guid:{},initialFeed:{}},setup(p){const f=p,{t:i}=te(),{isOpened:o}=Re(f.guid),l=q(),c=B(),v=B(!1),u=le({name:"",url:""}),R=[s=>!!s||i("dialogs.rss.feed.rules.name_required")],D=[s=>!!s||i("dialogs.rss.feed.rules.url_required")];async function d(){await c.value?.validate(),v.value&&(f.initialFeed?(u.url!==f.initialFeed.url&&await l.setFeedUrl(f.initialFeed.name,u.url),u.name!==f.initialFeed.name&&await l.renameFeed(f.initialFeed.name,u.name)):await l.createFeed(u.name,u.url),await l.fetchFeeds(),g())}const g=()=>{o.value=!1};return ae(()=>{f.initialFeed&&(u.name=f.initialFeed.name,u.url=f.initialFeed.url)}),(s,a)=>(r(),b(ee,{modelValue:A(o),"onUpdate:modelValue":a[4]||(a[4]=n=>Z(o)?o.value=n:null)},{default:t(()=>[e(z,null,{default:t(()=>[e(W,null,{default:t(()=>[w(h(s.$t(`dialogs.rss.feed.title.${s.initialFeed?"edit":"create"}`)),1)]),_:1}),e(x,null,{default:t(()=>[e(A(Ae),{modelValue:v.value,"onUpdate:modelValue":a[2]||(a[2]=n=>v.value=n),ref_key:"form",ref:c,onSubmit:a[3]||(a[3]=j(()=>{},["prevent"]))},{default:t(()=>[e(P,{modelValue:u.name,"onUpdate:modelValue":a[0]||(a[0]=n=>u.name=n),rules:R,label:s.$t("dialogs.rss.feed.name"),onKeydown:fe(d,["enter"])},null,8,["modelValue","label"]),e(P,{modelValue:u.url,"onUpdate:modelValue":a[1]||(a[1]=n=>u.url=n),rules:D,label:s.$t("dialogs.rss.feed.url"),onKeydown:fe(d,["enter"])},null,8,["modelValue","label"])]),_:1},8,["modelValue"])]),_:1}),e(oe,null,{default:t(()=>[e(H),e(F,{color:"error",onClick:g},{default:t(()=>[w(h(s.$t("common.cancel")),1)]),_:1}),e(F,{color:"accent",disabled:!v.value,onClick:d},{default:t(()=>[w(h(s.$t("common.save")),1)]),_:1},8,["disabled"])]),_:1})]),_:1})]),_:1},8,["modelValue"]))}}),ze={class:"d-flex"},Qe={key:0},Je={key:1},Xe={class:"d-flex flex-column"},Ye=_({__name:"Article",props:{value:{}},emits:["click","markAsRead","open","download"],setup(p){const f=q();return(i,o)=>(r(),b(G,{class:ne({"rss-read":i.value.isRead}),onClick:o[3]||(o[3]=l=>i.$emit("click")),onContextmenu:o[4]||(o[4]=l=>i.$emit("markAsRead"))},{default:t(()=>[U("div",ze,[U("div",null,[e(ie,{class:"wrap-anywhere",style:{"white-space":"unset"}},{default:t(()=>[w(h(i.value.title),1)]),_:1}),e(Se,{class:"d-block"},{default:t(()=>[U("div",null,h(i.value.parsedDate.toLocaleString()),1),U("div",null,h(i.$t("rssArticles.feeds.item.feedName",{name:A(f).getFeedNames(i.value.id).join(" | ")})),1),i.value.author?(r(),S("div",Qe,h(i.$t("rssArticles.feeds.item.author",{author:i.value.author})),1)):T("",!0),i.value.category?(r(),S("div",Je,h(i.$t("rssArticles.feeds.item.category",{category:i.value.category})),1)):T("",!0)]),_:1})]),e(H),U("div",Xe,[e(F,{icon:"mdi-open-in-new",variant:"text",onClick:o[0]||(o[0]=j(l=>i.$emit("open"),["stop"]))}),e(F,{color:"accent",icon:"mdi-check",variant:"text",onClick:o[1]||(o[1]=j(l=>i.$emit("markAsRead"),["stop"]))}),e(F,{icon:"mdi-download",variant:"text",onClick:o[2]||(o[2]=j(l=>i.$emit("download"),["stop"]))})])])]),_:1},8,["class"]))}}),Ve=_({__name:"ArticleList",props:{height:{}},emits:["articleClicked"],setup(p){const f=ke(),i=Te(),o=q(),l=_e(),c=L(()=>f.params.feedId),v=L(()=>o.filteredArticles.filter(a=>!c.value||c.value===a.feedId).sort((a,n)=>Number(n.parsedDate)-Number(a.parsedDate))),{paginatedResults:u,currentPage:R,pageCount:D}=Ge(v,15);function d(a){const n=l.useIdForRssLinks?a.id:a.link;window.open(n,"_blank","noreferrer")}function g(a){i.pushTorrentToQueue(a.torrentURL)}async function s(a){await o.markArticleAsRead(a.id)}return(a,n)=>(r(),b(re,{height:a.height},{default:t(()=>[v.value.length?(r(),b(G,{key:0},{default:t(()=>[e(ve,{modelValue:A(R),"onUpdate:modelValue":n[0]||(n[0]=m=>Z(R)?R.value=m:null),length:A(D),"next-icon":"mdi-menu-right","prev-icon":"mdi-menu-left"},null,8,["modelValue","length"])]),_:1})):T("",!0),(r(!0),S(M,null,J(A(u),(m,$)=>(r(),S(M,null,[$>0?(r(),b(K,{key:0})):T("",!0),e(Ye,{value:m,onClick:C=>a.$emit("articleClicked",m),onMarkAsRead:C=>s(m),onOpen:C=>d(m),onDownload:C=>g(m)},null,8,["value","onClick","onMarkAsRead","onOpen","onDownload"])],64))),256)),v.value.length===0?(r(),b(G,{key:1},{default:t(()=>[w(h(a.$t("common.emptyList")),1)]),_:1})):T("",!0),v.value.length?(r(),b(G,{key:2},{default:t(()=>[e(ve,{modelValue:A(R),"onUpdate:modelValue":n[1]||(n[1]=m=>Z(R)?R.value=m:null),length:A(D),"next-icon":"mdi-menu-right","prev-icon":"mdi-menu-left"},null,8,["modelValue","length"])]),_:1})):T("",!0)]),_:1},8,["height"]))}}),Ze={class:"mr-2"},we=_({__name:"FeedIcon",props:{state:{}},setup(p){return(f,i)=>(r(),S("span",Ze,[f.state===A(E).LOADING?(r(),b(Ee,{key:0,size:"24",width:"3",indeterminate:""})):f.state===A(E).ERROR?(r(),b(ge,{key:1,icon:"mdi-alert-circle-outline",color:"error"})):f.state===A(E).UNREAD?(r(),b(ge,{key:2,icon:"mdi-email"})):T("",!0)]))}}),We={class:"d-flex align-center"},xe=_({__name:"Feed",props:{title:{},state:{},unreadCount:{}},emits:["readFeed","refreshFeed","editFeed","deleteFeed"],setup(p){const f=p,i=L(()=>f.state===E.LOADING);return(o,l)=>(r(),S("div",We,[e(we,{state:o.state},null,8,["state"]),e(ie,null,{default:t(()=>[w(h(o.title),1)]),_:1}),e(H),e(O,{text:o.$t("rssArticles.feeds.markAsRead"),location:"top"},{activator:t(({props:c})=>[o.unreadCount>0?(r(),b(F,N({key:0},c,{icon:"mdi-email-open",density:"comfortable",variant:"plain",onClick:l[0]||(l[0]=j(v=>o.$emit("readFeed"),["stop"]))}),null,16)):T("",!0)]),_:1},8,["text"]),e(O,{text:o.$t("common.refresh"),location:"top"},{activator:t(({props:c})=>[i.value?T("",!0):(r(),b(F,N({key:0},c,{icon:"mdi-sync",density:"comfortable",variant:"plain",onClick:l[1]||(l[1]=j(v=>o.$emit("refreshFeed"),["stop"]))}),null,16))]),_:1},8,["text"]),e(O,{text:o.$t("common.edit"),location:"top"},{activator:t(({props:c})=>[e(F,N(c,{icon:"mdi-pencil",density:"comfortable",variant:"plain",onClick:l[2]||(l[2]=j(v=>o.$emit("editFeed"),["stop"]))}),null,16)]),_:1},8,["text"]),e(O,{text:o.$t("common.delete"),location:"top"},{activator:t(({props:c})=>[e(F,N(c,{icon:"mdi-delete",color:"red",density:"comfortable",variant:"plain",onClick:l[3]||(l[3]=j(v=>o.$emit("deleteFeed"),["stop"]))}),null,16)]),_:1},8,["text"])]))}}),et={class:"d-flex align-center"},ye=_({__name:"FeedList",props:{height:{}},emits:["update","createFeed","editFeed","deleteFeed","refreshFeed"],setup(p,{emit:f}){const i=f,o=be(),l=q(),c=L({get(){return o.currentRoute.value.params.feedId},set(n){o.replace({name:"rssArticles",params:{tab:"feeds",feedId:n}}),i("update",n)}}),v=Ne(()=>l.filteredArticles.map(n=>n.feedId));function u(n){return n?(n.articles??[]).reduce((m,$)=>m+ +!$.isRead,0):l.unreadArticles.length}function R(n){c.value=c.value!==n.uid?n.uid:void 0}async function D(n){await l.markFeedAsRead(n)}async function d(){await l.refreshAllFeeds(),l.resumeFeedTimer()}function g(n){const m=u(n);return(m?`${m} | `:"")+`${n?n.name:"All"}`}const s=L(()=>l.feeds.reduce((n,m)=>Math.min(n,a(m)),E.READ));function a(n){return n.isLoading?E.LOADING:n.hasError?E.ERROR:n.articles?.some(m=>!m.isRead)?E.UNREAD:E.READ}return(n,m)=>(r(),b(re,{height:n.height},{default:t(()=>[e(G,{active:!c.value,color:"accent",variant:"text",onClick:m[3]||(m[3]=$=>c.value=void 0)},{default:t(()=>[U("div",et,[e(we,{state:s.value},null,8,["state"]),e(ie,null,{default:t(()=>[w(h(g()),1)]),_:1}),e(H),e(O,{text:n.$t("rssArticles.feeds.markAllAsRead"),location:"top"},{activator:t(({props:$})=>[u()>0?(r(),b(F,N({key:0},$,{icon:"mdi-email-open",density:"comfortable",variant:"plain",onClick:m[0]||(m[0]=C=>A(l).markAllAsRead())}),null,16)):T("",!0)]),_:1},8,["text"]),e(O,{text:n.$t("rssArticles.feeds.refreshAllFeeds"),location:"top"},{activator:t(({props:$})=>[s.value!==A(E).LOADING?(r(),b(F,N({key:0},$,{icon:"mdi-sync",density:"comfortable",variant:"plain",onClick:m[1]||(m[1]=C=>d())}),null,16)):T("",!0)]),_:1},8,["text"]),e(O,{text:n.$t("rssArticles.feeds.empty.action"),location:"top"},{activator:t(({props:$})=>[e(F,N($,{icon:"mdi-plus",density:"comfortable",variant:"plain",onClick:m[2]||(m[2]=C=>n.$emit("createFeed"))}),null,16)]),_:1},8,["text"])])]),_:1},8,["active"]),e(K,{thickness:"3"}),(r(!0),S(M,null,J(A(l).feeds,$=>(r(),S(M,null,[(!A(l).filters.unread||A(l).filters.unread&&u($)>0)&&A(v).includes($.uid)?(r(),b(G,{key:0,active:c.value===$.uid,class:ne(u($)>0?"text-accent":""),color:"accent",variant:"text",onClick:C=>R($)},{default:t(()=>[e(xe,{title:g($),state:a($),"unread-count":u($),onReadFeed:C=>D($),onRefreshFeed:C=>n.$emit("refreshFeed",$),onEditFeed:C=>n.$emit("editFeed",$),onDeleteFeed:C=>n.$emit("deleteFeed",$)},null,8,["title","state","unread-count","onReadFeed","onRefreshFeed","onEditFeed","onDeleteFeed"])]),_:2},1032,["active","class","onClick"])):T("",!0)],64))),256))]),_:1},8,["height"]))}}),tt=_({__name:"Feeds",props:{height:{},mobile:{type:Boolean}},emits:["openArticle"],setup(p,{emit:f}){const i=p,o=ue(),l=q(),c=B(!1),v=L(()=>i.height-56-16-56-12*2),u=L({get:()=>l.filters.title,set:qe(g=>{l.filters.title=g??""},300)});function R(g){o.createDialog(Ke,{initialFeed:g},l.resumeFeedTimer)}async function D(g){await l.refreshFeed(g.name),l.resumeFeedTimer()}async function d(g){await l.deleteFeed(g.name),l.resumeFeedTimer()}return Fe(()=>{l.resumeFeedTimer()}),se(()=>{l.pauseFeedTimer()}),(g,s)=>A(l).feeds.length?(r(),b(z,{key:1,id:"rss-articles",class:"pa-3",height:g.height},{default:t(()=>[e(P,{modelValue:u.value,"onUpdate:modelValue":s[1]||(s[1]=a=>u.value=a),label:g.$t("rssArticles.feeds.filters.title"),clearable:"","hide-details":""},null,8,["modelValue","label"]),e(Y,{modelValue:A(l).filters.unread,"onUpdate:modelValue":s[2]||(s[2]=a=>A(l).filters.unread=a),label:g.$t("rssArticles.feeds.filters.unread"),"hide-details":""},null,8,["modelValue","label"]),g.mobile?(r(),S(M,{key:0},[e(Ve,{height:v.value,onArticleClicked:s[3]||(s[3]=a=>g.$emit("openArticle",a))},null,8,["height"]),e(Me,{modelValue:c.value,"onUpdate:modelValue":s[9]||(s[9]=a=>c.value=a),"max-height":"550"},{activator:t(({props:a})=>[e(F,N({class:"fab"},a,{color:"accent",icon:"mdi-format-list-bulleted",size:"large"}),null,16)]),default:t(()=>[e(ye,{onUpdate:s[4]||(s[4]=a=>c.value=!1),onCreateFeed:s[5]||(s[5]=()=>R()),onEditFeed:s[6]||(s[6]=a=>R(a)),onDeleteFeed:s[7]||(s[7]=a=>d(a)),onRefreshFeed:s[8]||(s[8]=a=>D(a))})]),_:1},8,["modelValue"])],64)):(r(),b(Q,{key:1},{default:t(()=>[e(I,{cols:"4"},{default:t(()=>[e(ye,{height:v.value,onCreateFeed:s[10]||(s[10]=()=>R()),onEditFeed:s[11]||(s[11]=a=>R(a)),onDeleteFeed:s[12]||(s[12]=a=>d(a)),onRefreshFeed:s[13]||(s[13]=a=>D(a))},null,8,["height"])]),_:1}),e(I,{cols:"8"},{default:t(()=>[e(Ve,{height:v.value,onArticleClicked:s[14]||(s[14]=a=>g.$emit("openArticle",a))},null,8,["height"])]),_:1})]),_:1}))]),_:1},8,["height"])):(r(),b(z,{key:0,height:g.height},{default:t(()=>[e(he,{title:g.$t("rssArticles.feeds.empty.value"),icon:"mdi-rss-off"},{actions:t(()=>[e(F,{text:g.$t("rssArticles.feeds.empty.action"),color:"accent",onClick:s[0]||(s[0]=a=>R())},null,8,["text"])]),_:1},8,["title"])]),_:1},8,["height"]))}}),lt=_({__name:"AddTorrentParamsDialog",props:{modelValue:{required:!0},modelModifiers:{},isOpened:{type:Boolean},isOpenedModifiers:{}},emits:["update:modelValue","update:isOpened"],setup(p){const f=pe(p,"modelValue"),i=pe(p,"isOpened"),{t:o}=te(),l=B();function c(){l.value?.saveFields(),i.value=!1}return(v,u)=>(r(),b(ee,{modelValue:i.value,"onUpdate:modelValue":u[1]||(u[1]=R=>i.value=R),class:ne(v.$vuetify.display.mobile?"":"w-75"),fullscreen:v.$vuetify.display.mobile,scrollable:""},{default:t(()=>[e(z,null,{default:t(()=>[e(W,{class:"ios-margin"},{default:t(()=>[e(de,{color:"transparent"},{default:t(()=>[e(Ce,null,{default:t(()=>[w(h(A(o)("dialogs.add.params.title")),1)]),_:1}),e(F,{icon:"mdi-close",onClick:c})]),_:1})]),_:1}),e(x,null,{default:t(()=>[e(Le,{modelValue:f.value,"onUpdate:modelValue":u[0]||(u[0]=R=>f.value=R)},null,8,["modelValue"])]),_:1}),e(oe,{class:"mb-2"},{default:t(()=>[e(H),e(F,{text:v.$t("common.close"),color:"",variant:"flat",onClick:c},null,8,["text"])]),_:1})]),_:1})]),_:1},8,["modelValue","class","fullscreen"]))}});function at(p){return{save_path:p?.save_path??"",skip_checking:!1,add_to_top_of_queue:p?.add_to_top_of_queue??!1,content_layout:p?.torrent_content_layout,stop_condition:p?.torrent_stop_condition,download_limit:p?.dl_limit,upload_limit:p?.up_limit,use_download_path:!!p?.temp_path,download_path:p?.temp_path?p?.temp_path:"",stopped:p?.start_paused_enabled,use_auto_tmm:p?.auto_tmm_enabled,ratio_limit:-2,seeding_time_limit:-2,inactive_seeding_time_limit:-2}}let nt,st,ot,it,rt,ut,dt,mt,ct,ft,pt,vt;nt={class:"d-flex"};st={class:"d-flex align-center"};ot={class:"v-card-title pa-0"};it=_({__name:"RssRuleDialog",props:{guid:{},initialRule:{}},setup(p){const f=p,i=L(()=>!!(f.initialRule&&f.initialRule.name)),{isOpened:o}=Re(f.guid),{t:l}=te(),c=Oe(),v=Ie(),u=q(),R=B(),D=B(!1),d=le(n()),g=B(""),s=B([]),a=L(()=>{if(d.lastMatch==="")return l("dialogs.rss.rule.lastMatch.unknownValue").toString();const y=new Date().getTime()-new Date(d.lastMatch).getTime();return l("dialogs.rss.rule.lastMatch.knownValue",Math.floor(y/(1e3*60*60*24)))});function n(){return{affectedFeeds:[],enabled:!0,episodeFilter:"",ignoreDays:0,lastMatch:"",mustContain:"",mustNotContain:"",name:"",priority:0,smartFilter:!1,useRegex:!1,previouslyMatchedEpisodes:i.value?f.initialRule.previouslyMatchedEpisodes:[],torrentParams:at(v.preferences)}}async function m(){if(g.value==="")return;const y=[],k=await u.fetchMatchingArticles(g.value);for(const V in k){const X=k[V];y.length>0&&y.push({type:"divider"}),y.push({type:"subheader",value:V});for(const De in X){const Ue=X[De];y.push({type:"item",value:Ue})}}s.value=y}async function $(){D.value&&((i.value||g.value!=="")&&g.value!==d.name&&await u.renameRule(g.value,d.name),await u.setRule(d.name,d),g.value=d.name,await u.fetchRules(),await m())}async function C(){d.affectedFeeds=[]}async function me(){d.affectedFeeds=u.feeds.map(y=>y.url)}const ce=()=>{o.value=!1};return ae(async()=>{await c.fetchCategories(),await u.fetchFeeds(),i.value&&(g.value=f.initialRule.name,Object.assign(d,f.initialRule)),await m()}),(y,k)=>(r(),b(ee,{modelValue:A(o),"onUpdate:modelValue":k[13]||(k[13]=V=>Z(o)?o.value=V:null)},{default:t(()=>[e(z,null,{default:t(()=>[e(W,null,{default:t(()=>[e(de,{color:"transparent",title:y.$t(`dialogs.rss.rule.title.${y.initialRule?"edit":"create"}`)},{default:t(()=>[e(F,{icon:"mdi-close",onClick:ce})]),_:1},8,["title"])]),_:1}),e(x,null,{default:t(()=>[e(A(Ae),{modelValue:D.value,"onUpdate:modelValue":k[11]||(k[11]=V=>D.value=V),ref_key:"form",ref:R,onSubmit:k[12]||(k[12]=j(()=>{},["prevent"]))},{default:t(()=>[e(Q,null,{default:t(()=>[e(I,{cols:"12",sm:"6",class:"scrollable-col"},{default:t(()=>[e(P,{modelValue:d.name,"onUpdate:modelValue":k[0]||(k[0]=V=>d.name=V),autofocus:"",required:"",label:y.$t("dialogs.rss.rule.name")},null,8,["modelValue","label"]),U("div",nt,[e(Pe,{modelValue:d.enabled,"onUpdate:modelValue":k[1]||(k[1]=V=>d.enabled=V),color:"accent",inset:"","hide-details":"",label:y.$t("dialogs.rss.rule.enabled")},null,8,["modelValue","label"]),e(H),U("div",st,[e(F,{class:"d-flex align-center justify-center",color:"accent"},{default:t(()=>[w(h(y.$t("dialogs.add.params.title"))+" ",1),e(lt,{modelValue:d.torrentParams,"onUpdate:modelValue":k[2]||(k[2]=V=>d.torrentParams=V),activator:"parent"},null,8,["modelValue"])]),_:1})])]),e(K),e(Y,{modelValue:d.useRegex,"onUpdate:modelValue":k[3]||(k[3]=V=>d.useRegex=V),"hide-details":"",label:y.$t("dialogs.rss.rule.useRegex")},null,8,["modelValue","label"]),e(P,{modelValue:d.mustContain,"onUpdate:modelValue":k[4]||(k[4]=V=>d.mustContain=V),label:y.$t("dialogs.rss.rule.mustContain")},null,8,["modelValue","label"]),e(P,{modelValue:d.mustNotContain,"onUpdate:modelValue":k[5]||(k[5]=V=>d.mustNotContain=V),label:y.$t("dialogs.rss.rule.mustNotContain")},null,8,["modelValue","label"]),e(Y,{modelValue:d.smartFilter,"onUpdate:modelValue":k[6]||(k[6]=V=>d.smartFilter=V),"hide-details":"",label:y.$t("dialogs.rss.rule.smartFilter")},null,8,["modelValue","label"]),e(P,{modelValue:d.episodeFilter,"onUpdate:modelValue":k[7]||(k[7]=V=>d.episodeFilter=V),placeholder:y.$t("dialogs.rss.rule.episodeFilterPlaceholder"),label:y.$t("dialogs.rss.rule.episodeFilter")},null,8,["modelValue","placeholder","label"]),e(K,{class:"mb-4"}),e(P,{modelValue:d.ignoreDays,"onUpdate:modelValue":k[8]||(k[8]=V=>d.ignoreDays=V),modelModifiers:{number:!0},type:"number",hint:y.$t("dialogs.rss.rule.ignoreDaysHint"),label:y.$t("dialogs.rss.rule.ignoreDays")},null,8,["modelValue","hint","label"]),e(P,{modelValue:a.value,"onUpdate:modelValue":k[9]||(k[9]=V=>a.value=V),disabled:"",label:y.$t("dialogs.rss.rule.lastMatch.label")},null,8,["modelValue","label"]),e(K),e($e,null,{default:t(()=>[w(h(y.$t("dialogs.rss.rule.affectedFeedsSubheader")),1)]),_:1}),e(Q,null,{default:t(()=>[e(I,{cols:"6",class:"d-flex align-center justify-center"},{default:t(()=>[e(F,{color:"accent",onClick:me},{default:t(()=>[w(h(y.$t("common.selectAll")),1)]),_:1})]),_:1}),e(I,{cols:"6",class:"d-flex align-center justify-center"},{default:t(()=>[e(F,{color:"primary",onClick:C},{default:t(()=>[w(h(y.$t("common.selectNone")),1)]),_:1})]),_:1})]),_:1}),(r(!0),S(M,null,J(A(u).feeds,V=>(r(),b(Y,{modelValue:d.affectedFeeds,"onUpdate:modelValue":k[10]||(k[10]=X=>d.affectedFeeds=X),multiple:"","hide-details":"",label:V.name,value:V.url},null,8,["modelValue","label","value"]))),256))]),_:1}),e(K,{vertical:!y.$vuetify.display.mobile},null,8,["vertical"]),e(I,{cols:"12",sm:"6",class:"scrollable-col"},{default:t(()=>[U("div",ot,h(y.$t("dialogs.rss.rule.matchingArticles.title")),1),e(re,null,{default:t(()=>[(r(!0),S(M,null,J(s.value,V=>(r(),S(M,null,[V.type==="divider"?(r(),b(K,{key:0})):V.type==="subheader"?(r(),b($e,{key:1,inset:""},{default:t(()=>[w(h(V.value),1)]),_:2},1024)):(r(),b(G,{key:2,class:"mb-3"},{default:t(()=>[w(h(V.value),1)]),_:2},1024))],64))),256)),s.value.length===0?(r(),b(G,{key:0,title:y.$t("dialogs.rss.rule.matchingArticles.noMatch")},null,8,["title"])):T("",!0)]),_:1})]),_:1})]),_:1})]),_:1},8,["modelValue"])]),_:1}),e(oe,null,{default:t(()=>[e(H),e(F,{color:"error",onClick:ce},{default:t(()=>[w(h(y.$t("common.close")),1)]),_:1}),e(F,{color:"accent",onClick:$},{default:t(()=>[w(h(y.$t("common.save")),1)]),_:1})]),_:1})]),_:1})]),_:1},8,["modelValue"]))}});rt=Be(it,[["__scopeId","data-v-d359259e"]]);ut={class:"pl-4"};dt=_({__name:"Rule",props:{value:{}},emits:["openRule"],setup(p){const f=q();async function i(l){await f.setRule(l.name,{...l,enabled:!l.enabled}),f.resumeRuleTimer()}async function o(l){await f.deleteRule(l.name),f.resumeRuleTimer()}return(l,c)=>(r(),b(je,{rounded:"xl",class:"d-flex align-center"},{default:t(()=>[U("div",ut,h(l.value.name),1),e(H),U("div",null,[e(F,{class:"my-2 mr-2",icon:l.value.enabled?"mdi-check":"mdi-cancel",color:l.value.enabled?"accent":"red",variant:"plain",density:"compact",onClick:c[0]||(c[0]=v=>i(l.value))},null,8,["icon","color"]),e(O,{text:l.$t("common.edit"),location:"top"},{activator:t(({props:v})=>[e(F,N(v,{class:"my-2 mr-2",icon:"mdi-pencil",variant:"plain",density:"compact",onClick:c[1]||(c[1]=u=>l.$emit("openRule",l.value))}),null,16)]),_:1},8,["text"]),e(O,{text:l.$t("common.delete"),location:"top"},{activator:t(({props:v})=>[e(F,N(v,{class:"my-2 mr-2",icon:"mdi-delete",color:"red",variant:"plain",density:"compact",onClick:c[2]||(c[2]=u=>o(l.value))}),null,16)]),_:1},8,["text"])])]),_:1}))}});mt=_({__name:"Rules",props:{height:{}},setup(p){const f=ue(),i=q();function o(l){f.createDialog(rt,{initialRule:l},i.resumeRuleTimer)}return ae(()=>{i.resumeRuleTimer()}),se(()=>{i.pauseRuleTimer()}),(l,c)=>A(i).rules.length?(r(),S(M,{key:1},[e(Q,{class:"mt-2"},{default:t(()=>[(r(!0),S(M,null,J(A(i).rules,v=>(r(),b(I,{cols:"12",sm:"6",lg:"3"},{default:t(()=>[e(dt,{value:v,onOpenRule:o},null,8,["value"])]),_:2},1024))),256))]),_:1}),e(Q,null,{default:t(()=>[e(I,{cols:"12",class:"d-flex align-center justify-center"},{default:t(()=>[e(F,{color:"accent",onClick:c[1]||(c[1]=v=>o())},{default:t(()=>[w(h(l.$t("rssArticles.rules.empty.action")),1)]),_:1})]),_:1})]),_:1})],64)):(r(),b(z,{key:0,height:l.height},{default:t(()=>[e(he,{title:l.$t("rssArticles.rules.empty.value"),icon:"mdi-rss-off"},{actions:t(()=>[e(F,{text:l.$t("rssArticles.rules.empty.action"),color:"accent",onClick:c[0]||(c[0]=v=>o())},null,8,["text"])]),_:1},8,["title"])]),_:1},8,["height"]))}});ct={class:"pa-3"};ft={class:"subtitle-1 ml-2",style:{"font-size":"1.6em !important"}};pt={class:"d-flex justify-end"};vt=["innerHTML"];bt=_({__name:"RssArticles",setup(p){const{height:f,mobile:i}=He({mobileBreakpoint:"md"}),o=ke(),l=be(),c=ue(),v=q(),u=B(!1),R=le({title:"",content:""}),D=L(()=>o.params.tab!=="rules"),d=L(()=>f.value-64-12*2-48);function g(m){m.description&&(R.title=m.title.trim(),R.content=m.description.trim(),u.value=!0)}function s(){const m=o.params.tab==="rules"?"feeds":"rules";l.replace({name:"rssArticles",params:{tab:m}}),v.lastView=m}function a(){l.push({name:"dashboard"})}function n(m){if(c.hasActiveDialog||u.value)return!1;m.key==="Escape"&&a()}return Fe(()=>{document.addEventListener("keydown",n)}),se(()=>{document.removeEventListener("keydown",n)}),(m,$)=>(r(),S(M,null,[U("div",ct,[e(Q,{align:"center",justify:"center","no-gutters":""},{default:t(()=>[e(I,null,{default:t(()=>[U("h1",ft,h(D.value?m.$t("rssArticles.feeds.title"):m.$t("rssArticles.rules.title")),1)]),_:1}),e(I,null,{default:t(()=>[U("div",pt,[e(O,{text:m.$t(D.value?"rssArticles.toggle.rules":"rssArticles.toggle.feeds"),location:"top"},{activator:t(({props:C})=>[e(F,N(C,{icon:"mdi-auto-download",variant:"plain",onClick:$[0]||($[0]=me=>s())}),null,16)]),_:1},8,["text"]),e(F,{icon:"mdi-close",variant:"plain",onClick:$[1]||($[1]=C=>a())})])]),_:1})]),_:1}),D.value?(r(),b(tt,{key:0,height:d.value,mobile:A(i),onOpenArticle:g},null,8,["height","mobile"])):(r(),b(mt,{key:1,height:d.value},null,8,["height"]))]),e(ee,{modelValue:u.value,"onUpdate:modelValue":$[3]||($[3]=C=>u.value=C)},{default:t(()=>[e(z,null,{default:t(()=>[e(W,null,{default:t(()=>[e(de,{color:"transparent"},{default:t(()=>[e(Ce,null,{default:t(()=>[w(h(R.title),1)]),_:1}),e(F,{icon:"mdi-close",onClick:$[2]||($[2]=C=>u.value=!1)})]),_:1})]),_:1}),e(x,null,{default:t(()=>[U("div",{class:"description-container",innerHTML:R.content},null,8,vt)]),_:1})]),_:1})]),_:1},8,["modelValue"])],64))}})});export{bt as default,__tla}; import{j as _,E as te,f as j,r as le,G as ae,H as r,I as b,J as t,n as e,K as w,L as h,u as A,M as B,O as fe,P as Z,U,Q as S,N as T,_ as ne,X as ke,c as L,V as J,F as M,q as N,S as be,Y as Fe,T as se,a2 as pe}from"./vue-CfSjRv-x.js";import{a as Re,a2 as q,i as z,V as W,c as x,d as Ae,e as P,f as oe,g as H,h as F,j as ee,a3 as ie,a4 as Se,s as G,D as Te,m as _e,x as ve,w as K,q as re,a5 as Ee,k as ge,Q as O,a6 as Ne,E as ue,a7 as he,a8 as Y,a9 as Me,p as Q,r as I,I as de,J as Ce,aa as Le,Z as Oe,ab as Ie,ac as Pe,ad as $e,ae as je,af as Be,__tla as __tla_0}from"./index-C0tfT_Qc.js";import{d as qe}from"./index-BwjGcC1B.js";import{u as Ge,__tla as __tla_1}from"./ArrayPagination-C54Dd5Tu.js";import{u as He}from"./vuetify-PctCzU6r.js";let bt;let __tla=Promise.all([(()=>{try{return __tla_0}catch{}})(),(()=>{try{return __tla_1}catch{}})()]).then(async()=>{var E=(p=>(p[p.LOADING=0]="LOADING",p[p.ERROR=1]="ERROR",p[p.UNREAD=2]="UNREAD",p[p.READ=3]="READ",p))(E||{});const Ke=_({__name:"RssFeedDialog",props:{guid:{},initialFeed:{}},setup(p){const f=p,{t:i}=te(),{isOpened:o}=Re(f.guid),l=q(),c=j(),v=j(!1),u=le({name:"",url:""}),R=[s=>!!s||i("dialogs.rss.feed.rules.name_required")],D=[s=>!!s||i("dialogs.rss.feed.rules.url_required")];async function d(){await c.value?.validate(),v.value&&(f.initialFeed?(u.url!==f.initialFeed.url&&await l.setFeedUrl(f.initialFeed.name,u.url),u.name!==f.initialFeed.name&&await l.renameFeed(f.initialFeed.name,u.name)):await l.createFeed(u.name,u.url),await l.fetchFeeds(),g())}const g=()=>{o.value=!1};return ae(()=>{f.initialFeed&&(u.name=f.initialFeed.name,u.url=f.initialFeed.url)}),(s,a)=>(r(),b(ee,{modelValue:A(o),"onUpdate:modelValue":a[4]||(a[4]=n=>Z(o)?o.value=n:null)},{default:t(()=>[e(z,null,{default:t(()=>[e(W,null,{default:t(()=>[w(h(s.$t(`dialogs.rss.feed.title.${s.initialFeed?"edit":"create"}`)),1)]),_:1}),e(x,null,{default:t(()=>[e(A(Ae),{modelValue:v.value,"onUpdate:modelValue":a[2]||(a[2]=n=>v.value=n),ref_key:"form",ref:c,onSubmit:a[3]||(a[3]=B(()=>{},["prevent"]))},{default:t(()=>[e(P,{modelValue:u.name,"onUpdate:modelValue":a[0]||(a[0]=n=>u.name=n),rules:R,label:s.$t("dialogs.rss.feed.name"),onKeydown:fe(d,["enter"])},null,8,["modelValue","label"]),e(P,{modelValue:u.url,"onUpdate:modelValue":a[1]||(a[1]=n=>u.url=n),rules:D,label:s.$t("dialogs.rss.feed.url"),onKeydown:fe(d,["enter"])},null,8,["modelValue","label"])]),_:1},8,["modelValue"])]),_:1}),e(oe,null,{default:t(()=>[e(H),e(F,{color:"error",onClick:g},{default:t(()=>[w(h(s.$t("common.cancel")),1)]),_:1}),e(F,{color:"accent",disabled:!v.value,onClick:d},{default:t(()=>[w(h(s.$t("common.save")),1)]),_:1},8,["disabled"])]),_:1})]),_:1})]),_:1},8,["modelValue"]))}}),ze={class:"d-flex"},Qe={key:0},Je={key:1},Xe={class:"d-flex flex-column"},Ye=_({__name:"Article",props:{value:{}},emits:["click","markAsRead","open","download"],setup(p){const f=q();return(i,o)=>(r(),b(G,{class:ne({"rss-read":i.value.isRead}),onClick:o[3]||(o[3]=l=>i.$emit("click")),onContextmenu:o[4]||(o[4]=l=>i.$emit("markAsRead"))},{default:t(()=>[U("div",ze,[U("div",null,[e(ie,{class:"wrap-anywhere",style:{"white-space":"unset"}},{default:t(()=>[w(h(i.value.title),1)]),_:1}),e(Se,{class:"d-block"},{default:t(()=>[U("div",null,h(i.value.parsedDate.toLocaleString()),1),U("div",null,h(i.$t("rssArticles.feeds.item.feedName",{name:A(f).getFeedNames(i.value.id).join(" | ")})),1),i.value.author?(r(),S("div",Qe,h(i.$t("rssArticles.feeds.item.author",{author:i.value.author})),1)):T("",!0),i.value.category?(r(),S("div",Je,h(i.$t("rssArticles.feeds.item.category",{category:i.value.category})),1)):T("",!0)]),_:1})]),e(H),U("div",Xe,[e(F,{icon:"mdi-open-in-new",variant:"text",onClick:o[0]||(o[0]=B(l=>i.$emit("open"),["stop"]))}),e(F,{color:"accent",icon:"mdi-check",variant:"text",onClick:o[1]||(o[1]=B(l=>i.$emit("markAsRead"),["stop"]))}),e(F,{icon:"mdi-download",variant:"text",onClick:o[2]||(o[2]=B(l=>i.$emit("download"),["stop"]))})])])]),_:1},8,["class"]))}}),Ve=_({__name:"ArticleList",props:{height:{}},emits:["articleClicked"],setup(p){const f=ke(),i=Te(),o=q(),l=_e(),c=L(()=>f.params.feedId),v=L(()=>o.filteredArticles.filter(a=>!c.value||c.value===a.feedId).sort((a,n)=>Number(n.parsedDate)-Number(a.parsedDate))),{paginatedResults:u,currentPage:R,pageCount:D}=Ge(v,15);function d(a){const n=l.useIdForRssLinks?a.id:a.link;window.open(n,"_blank","noreferrer")}function g(a){i.pushTorrentToQueue(a.torrentURL)}async function s(a){await o.markArticleAsRead(a.id)}return(a,n)=>(r(),b(re,{height:a.height},{default:t(()=>[v.value.length?(r(),b(G,{key:0},{default:t(()=>[e(ve,{modelValue:A(R),"onUpdate:modelValue":n[0]||(n[0]=m=>Z(R)?R.value=m:null),length:A(D),"next-icon":"mdi-menu-right","prev-icon":"mdi-menu-left"},null,8,["modelValue","length"])]),_:1})):T("",!0),(r(!0),S(M,null,J(A(u),(m,$)=>(r(),S(M,null,[$>0?(r(),b(K,{key:0})):T("",!0),e(Ye,{value:m,onClick:C=>a.$emit("articleClicked",m),onMarkAsRead:C=>s(m),onOpen:C=>d(m),onDownload:C=>g(m)},null,8,["value","onClick","onMarkAsRead","onOpen","onDownload"])],64))),256)),v.value.length===0?(r(),b(G,{key:1},{default:t(()=>[w(h(a.$t("common.emptyList")),1)]),_:1})):T("",!0),v.value.length?(r(),b(G,{key:2},{default:t(()=>[e(ve,{modelValue:A(R),"onUpdate:modelValue":n[1]||(n[1]=m=>Z(R)?R.value=m:null),length:A(D),"next-icon":"mdi-menu-right","prev-icon":"mdi-menu-left"},null,8,["modelValue","length"])]),_:1})):T("",!0)]),_:1},8,["height"]))}}),Ze={class:"mr-2"},we=_({__name:"FeedIcon",props:{state:{}},setup(p){return(f,i)=>(r(),S("span",Ze,[f.state===A(E).LOADING?(r(),b(Ee,{key:0,size:"24",width:"3",indeterminate:""})):f.state===A(E).ERROR?(r(),b(ge,{key:1,icon:"mdi-alert-circle-outline",color:"error"})):f.state===A(E).UNREAD?(r(),b(ge,{key:2,icon:"mdi-email"})):T("",!0)]))}}),We={class:"d-flex align-center"},xe=_({__name:"Feed",props:{title:{},state:{},unreadCount:{}},emits:["readFeed","refreshFeed","editFeed","deleteFeed"],setup(p){const f=p,i=L(()=>f.state===E.LOADING);return(o,l)=>(r(),S("div",We,[e(we,{state:o.state},null,8,["state"]),e(ie,null,{default:t(()=>[w(h(o.title),1)]),_:1}),e(H),e(O,{text:o.$t("rssArticles.feeds.markAsRead"),location:"top"},{activator:t(({props:c})=>[o.unreadCount>0?(r(),b(F,N({key:0},c,{icon:"mdi-email-open",density:"comfortable",variant:"plain",onClick:l[0]||(l[0]=B(v=>o.$emit("readFeed"),["stop"]))}),null,16)):T("",!0)]),_:1},8,["text"]),e(O,{text:o.$t("common.refresh"),location:"top"},{activator:t(({props:c})=>[i.value?T("",!0):(r(),b(F,N({key:0},c,{icon:"mdi-sync",density:"comfortable",variant:"plain",onClick:l[1]||(l[1]=B(v=>o.$emit("refreshFeed"),["stop"]))}),null,16))]),_:1},8,["text"]),e(O,{text:o.$t("common.edit"),location:"top"},{activator:t(({props:c})=>[e(F,N(c,{icon:"mdi-pencil",density:"comfortable",variant:"plain",onClick:l[2]||(l[2]=B(v=>o.$emit("editFeed"),["stop"]))}),null,16)]),_:1},8,["text"]),e(O,{text:o.$t("common.delete"),location:"top"},{activator:t(({props:c})=>[e(F,N(c,{icon:"mdi-delete",color:"red",density:"comfortable",variant:"plain",onClick:l[3]||(l[3]=B(v=>o.$emit("deleteFeed"),["stop"]))}),null,16)]),_:1},8,["text"])]))}}),et={class:"d-flex align-center"},ye=_({__name:"FeedList",props:{height:{}},emits:["update","createFeed","editFeed","deleteFeed","refreshFeed"],setup(p,{emit:f}){const i=f,o=be(),l=q(),c=L({get(){return o.currentRoute.value.params.feedId},set(n){o.replace({name:"rssArticles",params:{tab:"feeds",feedId:n}}),i("update",n)}}),v=Ne(()=>l.filteredArticles.map(n=>n.feedId));function u(n){return n?(n.articles??[]).reduce((m,$)=>m+ +!$.isRead,0):l.unreadArticles.length}function R(n){c.value=c.value!==n.uid?n.uid:void 0}async function D(n){await l.markFeedAsRead(n)}async function d(){await l.refreshAllFeeds(),l.resumeFeedTimer()}function g(n){const m=u(n);return(m?`${m} | `:"")+`${n?n.name:"All"}`}const s=L(()=>l.feeds.reduce((n,m)=>Math.min(n,a(m)),E.READ));function a(n){return n.isLoading?E.LOADING:n.hasError?E.ERROR:n.articles?.some(m=>!m.isRead)?E.UNREAD:E.READ}return(n,m)=>(r(),b(re,{height:n.height},{default:t(()=>[e(G,{active:!c.value,color:"accent",variant:"text",onClick:m[3]||(m[3]=$=>c.value=void 0)},{default:t(()=>[U("div",et,[e(we,{state:s.value},null,8,["state"]),e(ie,null,{default:t(()=>[w(h(g()),1)]),_:1}),e(H),e(O,{text:n.$t("rssArticles.feeds.markAllAsRead"),location:"top"},{activator:t(({props:$})=>[u()>0?(r(),b(F,N({key:0},$,{icon:"mdi-email-open",density:"comfortable",variant:"plain",onClick:m[0]||(m[0]=C=>A(l).markAllAsRead())}),null,16)):T("",!0)]),_:1},8,["text"]),e(O,{text:n.$t("rssArticles.feeds.refreshAllFeeds"),location:"top"},{activator:t(({props:$})=>[s.value!==A(E).LOADING?(r(),b(F,N({key:0},$,{icon:"mdi-sync",density:"comfortable",variant:"plain",onClick:m[1]||(m[1]=C=>d())}),null,16)):T("",!0)]),_:1},8,["text"]),e(O,{text:n.$t("rssArticles.feeds.empty.action"),location:"top"},{activator:t(({props:$})=>[e(F,N($,{icon:"mdi-plus",density:"comfortable",variant:"plain",onClick:m[2]||(m[2]=C=>n.$emit("createFeed"))}),null,16)]),_:1},8,["text"])])]),_:1},8,["active"]),e(K,{thickness:"3"}),(r(!0),S(M,null,J(A(l).feeds,$=>(r(),S(M,null,[(!A(l).filters.unread||A(l).filters.unread&&u($)>0)&&A(v).includes($.uid)?(r(),b(G,{key:0,active:c.value===$.uid,class:ne(u($)>0?"text-accent":""),color:"accent",variant:"text",onClick:C=>R($)},{default:t(()=>[e(xe,{title:g($),state:a($),"unread-count":u($),onReadFeed:C=>D($),onRefreshFeed:C=>n.$emit("refreshFeed",$),onEditFeed:C=>n.$emit("editFeed",$),onDeleteFeed:C=>n.$emit("deleteFeed",$)},null,8,["title","state","unread-count","onReadFeed","onRefreshFeed","onEditFeed","onDeleteFeed"])]),_:2},1032,["active","class","onClick"])):T("",!0)],64))),256))]),_:1},8,["height"]))}}),tt=_({__name:"Feeds",props:{height:{},mobile:{type:Boolean}},emits:["openArticle"],setup(p,{emit:f}){const i=p,o=ue(),l=q(),c=j(!1),v=L(()=>i.height-56-16-56-12*2),u=L({get:()=>l.filters.title,set:qe(g=>{l.filters.title=g??""},300)});function R(g){o.createDialog(Ke,{initialFeed:g},l.resumeFeedTimer)}async function D(g){await l.refreshFeed(g.name),l.resumeFeedTimer()}async function d(g){await l.deleteFeed(g.name),l.resumeFeedTimer()}return Fe(()=>{l.resumeFeedTimer()}),se(()=>{l.pauseFeedTimer()}),(g,s)=>A(l).feeds.length?(r(),b(z,{key:1,id:"rss-articles",class:"pa-3",height:g.height},{default:t(()=>[e(P,{modelValue:u.value,"onUpdate:modelValue":s[1]||(s[1]=a=>u.value=a),label:g.$t("rssArticles.feeds.filters.title"),clearable:"","hide-details":""},null,8,["modelValue","label"]),e(Y,{modelValue:A(l).filters.unread,"onUpdate:modelValue":s[2]||(s[2]=a=>A(l).filters.unread=a),label:g.$t("rssArticles.feeds.filters.unread"),"hide-details":""},null,8,["modelValue","label"]),g.mobile?(r(),S(M,{key:0},[e(Ve,{height:v.value,onArticleClicked:s[3]||(s[3]=a=>g.$emit("openArticle",a))},null,8,["height"]),e(Me,{modelValue:c.value,"onUpdate:modelValue":s[9]||(s[9]=a=>c.value=a),"max-height":"550"},{activator:t(({props:a})=>[e(F,N({class:"fab"},a,{color:"accent",icon:"mdi-format-list-bulleted",size:"large"}),null,16)]),default:t(()=>[e(ye,{onUpdate:s[4]||(s[4]=a=>c.value=!1),onCreateFeed:s[5]||(s[5]=()=>R()),onEditFeed:s[6]||(s[6]=a=>R(a)),onDeleteFeed:s[7]||(s[7]=a=>d(a)),onRefreshFeed:s[8]||(s[8]=a=>D(a))})]),_:1},8,["modelValue"])],64)):(r(),b(Q,{key:1},{default:t(()=>[e(I,{cols:"4"},{default:t(()=>[e(ye,{height:v.value,onCreateFeed:s[10]||(s[10]=()=>R()),onEditFeed:s[11]||(s[11]=a=>R(a)),onDeleteFeed:s[12]||(s[12]=a=>d(a)),onRefreshFeed:s[13]||(s[13]=a=>D(a))},null,8,["height"])]),_:1}),e(I,{cols:"8"},{default:t(()=>[e(Ve,{height:v.value,onArticleClicked:s[14]||(s[14]=a=>g.$emit("openArticle",a))},null,8,["height"])]),_:1})]),_:1}))]),_:1},8,["height"])):(r(),b(z,{key:0,height:g.height},{default:t(()=>[e(he,{title:g.$t("rssArticles.feeds.empty.value"),icon:"mdi-rss-off"},{actions:t(()=>[e(F,{text:g.$t("rssArticles.feeds.empty.action"),color:"accent",onClick:s[0]||(s[0]=a=>R())},null,8,["text"])]),_:1},8,["title"])]),_:1},8,["height"]))}}),lt=_({__name:"AddTorrentParamsDialog",props:{modelValue:{required:!0},modelModifiers:{},isOpened:{type:Boolean},isOpenedModifiers:{}},emits:["update:modelValue","update:isOpened"],setup(p){const f=pe(p,"modelValue"),i=pe(p,"isOpened"),{t:o}=te(),l=j();function c(){l.value?.saveFields(),i.value=!1}return(v,u)=>(r(),b(ee,{modelValue:i.value,"onUpdate:modelValue":u[1]||(u[1]=R=>i.value=R),class:ne(v.$vuetify.display.mobile?"":"w-75"),fullscreen:v.$vuetify.display.mobile,scrollable:""},{default:t(()=>[e(z,null,{default:t(()=>[e(W,{class:"ios-margin"},{default:t(()=>[e(de,{color:"transparent"},{default:t(()=>[e(Ce,null,{default:t(()=>[w(h(A(o)("dialogs.add.params.title")),1)]),_:1}),e(F,{icon:"mdi-close",onClick:c})]),_:1})]),_:1}),e(x,null,{default:t(()=>[e(Le,{modelValue:f.value,"onUpdate:modelValue":u[0]||(u[0]=R=>f.value=R)},null,8,["modelValue"])]),_:1}),e(oe,{class:"mb-2"},{default:t(()=>[e(H),e(F,{text:v.$t("common.close"),color:"",variant:"flat",onClick:c},null,8,["text"])]),_:1})]),_:1})]),_:1},8,["modelValue","class","fullscreen"]))}});function at(p){return{save_path:p?.save_path??"",skip_checking:!1,add_to_top_of_queue:p?.add_to_top_of_queue??!1,content_layout:p?.torrent_content_layout,stop_condition:p?.torrent_stop_condition,download_limit:p?.dl_limit,upload_limit:p?.up_limit,use_download_path:!!p?.temp_path,download_path:p?.temp_path?p?.temp_path:"",stopped:p?.start_paused_enabled,use_auto_tmm:p?.auto_tmm_enabled,ratio_limit:-2,seeding_time_limit:-2,inactive_seeding_time_limit:-2}}let nt,st,ot,it,rt,ut,dt,mt,ct,ft,pt,vt;nt={class:"d-flex"};st={class:"d-flex align-center"};ot={class:"v-card-title pa-0"};it=_({__name:"RssRuleDialog",props:{guid:{},initialRule:{}},setup(p){const f=p,i=L(()=>!!(f.initialRule&&f.initialRule.name)),{isOpened:o}=Re(f.guid),{t:l}=te(),c=Oe(),v=Ie(),u=q(),R=j(),D=j(!1),d=le(n()),g=j(""),s=j([]),a=L(()=>{if(d.lastMatch==="")return l("dialogs.rss.rule.lastMatch.unknownValue").toString();const y=new Date().getTime()-new Date(d.lastMatch).getTime();return l("dialogs.rss.rule.lastMatch.knownValue",Math.floor(y/(1e3*60*60*24)))});function n(){return{affectedFeeds:[],enabled:!0,episodeFilter:"",ignoreDays:0,lastMatch:"",mustContain:"",mustNotContain:"",name:"",priority:0,smartFilter:!1,useRegex:!1,previouslyMatchedEpisodes:i.value?f.initialRule.previouslyMatchedEpisodes:[],torrentParams:at(v.preferences)}}async function m(){if(g.value==="")return;const y=[],k=await u.fetchMatchingArticles(g.value);for(const V in k){const X=k[V];y.length>0&&y.push({type:"divider"}),y.push({type:"subheader",value:V});for(const De in X){const Ue=X[De];y.push({type:"item",value:Ue})}}s.value=y}async function $(){D.value&&((i.value||g.value!=="")&&g.value!==d.name&&await u.renameRule(g.value,d.name),await u.setRule(d.name,d),g.value=d.name,await u.fetchRules(),await m())}async function C(){d.affectedFeeds=[]}async function me(){d.affectedFeeds=u.feeds.map(y=>y.url)}const ce=()=>{o.value=!1};return ae(async()=>{await c.fetchCategories(),await u.fetchFeeds(),i.value&&(g.value=f.initialRule.name,Object.assign(d,f.initialRule)),await m()}),(y,k)=>(r(),b(ee,{modelValue:A(o),"onUpdate:modelValue":k[13]||(k[13]=V=>Z(o)?o.value=V:null)},{default:t(()=>[e(z,null,{default:t(()=>[e(W,null,{default:t(()=>[e(de,{color:"transparent",title:y.$t(`dialogs.rss.rule.title.${y.initialRule?"edit":"create"}`)},{default:t(()=>[e(F,{icon:"mdi-close",onClick:ce})]),_:1},8,["title"])]),_:1}),e(x,null,{default:t(()=>[e(A(Ae),{modelValue:D.value,"onUpdate:modelValue":k[11]||(k[11]=V=>D.value=V),ref_key:"form",ref:R,onSubmit:k[12]||(k[12]=B(()=>{},["prevent"]))},{default:t(()=>[e(Q,null,{default:t(()=>[e(I,{cols:"12",sm:"6",class:"scrollable-col"},{default:t(()=>[e(P,{modelValue:d.name,"onUpdate:modelValue":k[0]||(k[0]=V=>d.name=V),autofocus:"",required:"",label:y.$t("dialogs.rss.rule.name")},null,8,["modelValue","label"]),U("div",nt,[e(Pe,{modelValue:d.enabled,"onUpdate:modelValue":k[1]||(k[1]=V=>d.enabled=V),color:"accent",inset:"","hide-details":"",label:y.$t("dialogs.rss.rule.enabled")},null,8,["modelValue","label"]),e(H),U("div",st,[e(F,{class:"d-flex align-center justify-center",color:"accent"},{default:t(()=>[w(h(y.$t("dialogs.add.params.title"))+" ",1),e(lt,{modelValue:d.torrentParams,"onUpdate:modelValue":k[2]||(k[2]=V=>d.torrentParams=V),activator:"parent"},null,8,["modelValue"])]),_:1})])]),e(K),e(Y,{modelValue:d.useRegex,"onUpdate:modelValue":k[3]||(k[3]=V=>d.useRegex=V),"hide-details":"",label:y.$t("dialogs.rss.rule.useRegex")},null,8,["modelValue","label"]),e(P,{modelValue:d.mustContain,"onUpdate:modelValue":k[4]||(k[4]=V=>d.mustContain=V),label:y.$t("dialogs.rss.rule.mustContain")},null,8,["modelValue","label"]),e(P,{modelValue:d.mustNotContain,"onUpdate:modelValue":k[5]||(k[5]=V=>d.mustNotContain=V),label:y.$t("dialogs.rss.rule.mustNotContain")},null,8,["modelValue","label"]),e(Y,{modelValue:d.smartFilter,"onUpdate:modelValue":k[6]||(k[6]=V=>d.smartFilter=V),"hide-details":"",label:y.$t("dialogs.rss.rule.smartFilter")},null,8,["modelValue","label"]),e(P,{modelValue:d.episodeFilter,"onUpdate:modelValue":k[7]||(k[7]=V=>d.episodeFilter=V),placeholder:y.$t("dialogs.rss.rule.episodeFilterPlaceholder"),label:y.$t("dialogs.rss.rule.episodeFilter")},null,8,["modelValue","placeholder","label"]),e(K,{class:"mb-4"}),e(P,{modelValue:d.ignoreDays,"onUpdate:modelValue":k[8]||(k[8]=V=>d.ignoreDays=V),modelModifiers:{number:!0},type:"number",hint:y.$t("dialogs.rss.rule.ignoreDaysHint"),label:y.$t("dialogs.rss.rule.ignoreDays")},null,8,["modelValue","hint","label"]),e(P,{modelValue:a.value,"onUpdate:modelValue":k[9]||(k[9]=V=>a.value=V),disabled:"",label:y.$t("dialogs.rss.rule.lastMatch.label")},null,8,["modelValue","label"]),e(K),e($e,null,{default:t(()=>[w(h(y.$t("dialogs.rss.rule.affectedFeedsSubheader")),1)]),_:1}),e(Q,null,{default:t(()=>[e(I,{cols:"6",class:"d-flex align-center justify-center"},{default:t(()=>[e(F,{color:"accent",onClick:me},{default:t(()=>[w(h(y.$t("common.selectAll")),1)]),_:1})]),_:1}),e(I,{cols:"6",class:"d-flex align-center justify-center"},{default:t(()=>[e(F,{color:"primary",onClick:C},{default:t(()=>[w(h(y.$t("common.selectNone")),1)]),_:1})]),_:1})]),_:1}),(r(!0),S(M,null,J(A(u).feeds,V=>(r(),b(Y,{modelValue:d.affectedFeeds,"onUpdate:modelValue":k[10]||(k[10]=X=>d.affectedFeeds=X),multiple:"","hide-details":"",label:V.name,value:V.url},null,8,["modelValue","label","value"]))),256))]),_:1}),e(K,{vertical:!y.$vuetify.display.mobile},null,8,["vertical"]),e(I,{cols:"12",sm:"6",class:"scrollable-col"},{default:t(()=>[U("div",ot,h(y.$t("dialogs.rss.rule.matchingArticles.title")),1),e(re,null,{default:t(()=>[(r(!0),S(M,null,J(s.value,V=>(r(),S(M,null,[V.type==="divider"?(r(),b(K,{key:0})):V.type==="subheader"?(r(),b($e,{key:1,inset:""},{default:t(()=>[w(h(V.value),1)]),_:2},1024)):(r(),b(G,{key:2,class:"mb-3"},{default:t(()=>[w(h(V.value),1)]),_:2},1024))],64))),256)),s.value.length===0?(r(),b(G,{key:0,title:y.$t("dialogs.rss.rule.matchingArticles.noMatch")},null,8,["title"])):T("",!0)]),_:1})]),_:1})]),_:1})]),_:1},8,["modelValue"])]),_:1}),e(oe,null,{default:t(()=>[e(H),e(F,{color:"error",onClick:ce},{default:t(()=>[w(h(y.$t("common.close")),1)]),_:1}),e(F,{color:"accent",onClick:$},{default:t(()=>[w(h(y.$t("common.save")),1)]),_:1})]),_:1})]),_:1})]),_:1},8,["modelValue"]))}});rt=je(it,[["__scopeId","data-v-d359259e"]]);ut={class:"pl-4"};dt=_({__name:"Rule",props:{value:{}},emits:["openRule"],setup(p){const f=q();async function i(l){await f.setRule(l.name,{...l,enabled:!l.enabled}),f.resumeRuleTimer()}async function o(l){await f.deleteRule(l.name),f.resumeRuleTimer()}return(l,c)=>(r(),b(Be,{rounded:"xl",class:"d-flex align-center"},{default:t(()=>[U("div",ut,h(l.value.name),1),e(H),U("div",null,[e(F,{class:"my-2 mr-2",icon:l.value.enabled?"mdi-check":"mdi-cancel",color:l.value.enabled?"accent":"red",variant:"plain",density:"compact",onClick:c[0]||(c[0]=v=>i(l.value))},null,8,["icon","color"]),e(O,{text:l.$t("common.edit"),location:"top"},{activator:t(({props:v})=>[e(F,N(v,{class:"my-2 mr-2",icon:"mdi-pencil",variant:"plain",density:"compact",onClick:c[1]||(c[1]=u=>l.$emit("openRule",l.value))}),null,16)]),_:1},8,["text"]),e(O,{text:l.$t("common.delete"),location:"top"},{activator:t(({props:v})=>[e(F,N(v,{class:"my-2 mr-2",icon:"mdi-delete",color:"red",variant:"plain",density:"compact",onClick:c[2]||(c[2]=u=>o(l.value))}),null,16)]),_:1},8,["text"])])]),_:1}))}});mt=_({__name:"Rules",props:{height:{}},setup(p){const f=ue(),i=q();function o(l){f.createDialog(rt,{initialRule:l},i.resumeRuleTimer)}return ae(()=>{i.resumeRuleTimer()}),se(()=>{i.pauseRuleTimer()}),(l,c)=>A(i).rules.length?(r(),S(M,{key:1},[e(Q,{class:"mt-2"},{default:t(()=>[(r(!0),S(M,null,J(A(i).rules,v=>(r(),b(I,{cols:"12",sm:"6",lg:"3"},{default:t(()=>[e(dt,{value:v,onOpenRule:o},null,8,["value"])]),_:2},1024))),256))]),_:1}),e(Q,null,{default:t(()=>[e(I,{cols:"12",class:"d-flex align-center justify-center"},{default:t(()=>[e(F,{color:"accent",onClick:c[1]||(c[1]=v=>o())},{default:t(()=>[w(h(l.$t("rssArticles.rules.empty.action")),1)]),_:1})]),_:1})]),_:1})],64)):(r(),b(z,{key:0,height:l.height},{default:t(()=>[e(he,{title:l.$t("rssArticles.rules.empty.value"),icon:"mdi-rss-off"},{actions:t(()=>[e(F,{text:l.$t("rssArticles.rules.empty.action"),color:"accent",onClick:c[0]||(c[0]=v=>o())},null,8,["text"])]),_:1},8,["title"])]),_:1},8,["height"]))}});ct={class:"pa-3"};ft={class:"subtitle-1 ml-2",style:{"font-size":"1.6em !important"}};pt={class:"d-flex justify-end"};vt=["innerHTML"];bt=_({__name:"RssArticles",setup(p){const{height:f,mobile:i}=He({mobileBreakpoint:"md"}),o=ke(),l=be(),c=ue(),v=q(),u=j(!1),R=le({title:"",content:""}),D=L(()=>o.params.tab!=="rules"),d=L(()=>f.value-64-12*2-48);function g(m){m.description&&(R.title=m.title.trim(),R.content=m.description.trim(),u.value=!0)}function s(){const m=o.params.tab==="rules"?"feeds":"rules";l.replace({name:"rssArticles",params:{tab:m}}),v.lastView=m}function a(){l.push({name:"dashboard"})}function n(m){if(c.hasActiveDialog||u.value)return!1;m.key==="Escape"&&a()}return Fe(()=>{document.addEventListener("keydown",n)}),se(()=>{document.removeEventListener("keydown",n)}),(m,$)=>(r(),S(M,null,[U("div",ct,[e(Q,{align:"center",justify:"center","no-gutters":""},{default:t(()=>[e(I,null,{default:t(()=>[U("h1",ft,h(D.value?m.$t("rssArticles.feeds.title"):m.$t("rssArticles.rules.title")),1)]),_:1}),e(I,null,{default:t(()=>[U("div",pt,[e(O,{text:m.$t(D.value?"rssArticles.toggle.rules":"rssArticles.toggle.feeds"),location:"top"},{activator:t(({props:C})=>[e(F,N(C,{icon:"mdi-auto-download",variant:"plain",onClick:$[0]||($[0]=me=>s())}),null,16)]),_:1},8,["text"]),e(F,{icon:"mdi-close",variant:"plain",onClick:$[1]||($[1]=C=>a())})])]),_:1})]),_:1}),D.value?(r(),b(tt,{key:0,height:d.value,mobile:A(i),onOpenArticle:g},null,8,["height","mobile"])):(r(),b(mt,{key:1,height:d.value},null,8,["height"]))]),e(ee,{modelValue:u.value,"onUpdate:modelValue":$[3]||($[3]=C=>u.value=C)},{default:t(()=>[e(z,null,{default:t(()=>[e(W,null,{default:t(()=>[e(de,{color:"transparent"},{default:t(()=>[e(Ce,null,{default:t(()=>[w(h(R.title),1)]),_:1}),e(F,{icon:"mdi-close",onClick:$[2]||($[2]=C=>u.value=!1)})]),_:1})]),_:1}),e(x,null,{default:t(()=>[U("div",{class:"description-container",innerHTML:R.content},null,8,vt)]),_:1})]),_:1})]),_:1},8,["modelValue"])],64))}})});export{bt as default,__tla};

View File

@@ -1 +1 @@
import{h as X,E as Y,f as h,H as E,I as T,J as l,n as e,U as C,L as p,q as ie,u as g,M as R,K as S,P as oe,S as re,$ as ue,c as H,G as ce,v as de,Q as j,F as fe,V as me,O as ge}from"./vue-BQgCUbk_.js";import{a as pe,R as Z,i as A,V as ve,g as M,j as F,c as O,d as he,e as ee,f as Q,h as m,S as le,v as ye,k as Ve,D as ke,E as be,m as Ee,n as Se,p as P,q as we,r as b,G as Ce,U as _e,W as $e,s as G,K as Pe,M as Te,t as J,w as Me,X as Ie,__tla as __tla_0}from"./index-DF2-l4SD.js";import{_ as W,__tla as __tla_1}from"./MixedButton.vue_vue_type_script_setup_true_lang-QFpliKgB.js";import"./vuetify-DWkLi8Ew.js";let ze;let __tla=Promise.all([(()=>{try{return __tla_0}catch{}})(),(()=>{try{return __tla_1}catch{}})()]).then(async()=>{let Ne,Ue,De,qe,Le;Ne=["href","title"];Ue=X({__name:"PluginManagerDialog",props:{guid:{}},setup(B){const I=B,{isOpened:t}=pe(I.guid),{t:y}=Y(),c=Z(),d=[{title:y("dialogs.pluginManager.headers.enabled"),key:"enabled",sortable:!1},{title:y("dialogs.pluginManager.headers.name"),key:"fullName"},{title:y("dialogs.pluginManager.headers.version"),key:"version"},{title:y("dialogs.pluginManager.headers.url"),key:"url"},{title:y("dialogs.pluginManager.headers.actions"),key:"actions"}],V=h(!1),k=h(!1),w=h(!1),v=h(!1),u=h("");async function N(r){await c.toggleSearchPlugin(r),await c.fetchSearchPlugins()}async function _(){k.value=!0,await c.updatePlugins().then(()=>new Promise(r=>setTimeout(r,2e3))),await c.fetchSearchPlugins(),k.value=!1}async function U(){$(),V.value=!0,await c.installSearchPlugin(u.value),u.value="",setTimeout(()=>{c.fetchSearchPlugins().then(()=>{V.value=!1})},1e3)}async function D(r){V.value=!0,await c.uninstallSearchPlugin(r.name),await c.fetchSearchPlugins(),V.value=!1}const i=()=>{t.value=!1};function $(){w.value=!1}return(r,f)=>(E(),T(F,{modelValue:g(t),"onUpdate:modelValue":f[4]||(f[4]=n=>oe(t)?t.value=n:null)},{default:l(()=>[e(A,null,{default:l(()=>[e(ve,{class:"d-flex"},{default:l(()=>[C("div",null,p(r.$t("dialogs.pluginManager.title")),1),e(M),e(W,{icon:"mdi-update",text:r.$t("dialogs.pluginManager.update"),color:"accent",class:"mr-2",loading:k.value,onClick:_},null,8,["text","loading"]),e(F,{modelValue:w.value,"onUpdate:modelValue":f[3]||(f[3]=n=>w.value=n)},{activator:l(({props:n})=>[e(W,ie({icon:"mdi-toy-brick-plus",text:r.$t("dialogs.pluginManager.install.activator")},n,{color:"primary"}),null,16,["text"])]),default:l(()=>[e(A,{title:r.$t("dialogs.pluginManager.install.title")},{default:l(()=>[e(O,null,{default:l(()=>[e(g(he),{modelValue:v.value,"onUpdate:modelValue":f[1]||(f[1]=n=>v.value=n),onSubmit:f[2]||(f[2]=R(()=>{},["prevent"]))},{default:l(()=>[e(ee,{modelValue:u.value,"onUpdate:modelValue":f[0]||(f[0]=n=>u.value=n),autofocus:"",label:r.$t("dialogs.pluginManager.install.label")},null,8,["modelValue","label"])]),_:1},8,["modelValue"])]),_:1}),e(Q,null,{default:l(()=>[e(M),e(m,{color:"error",onClick:$},{default:l(()=>[S(p(r.$t("common.cancel")),1)]),_:1}),e(m,{color:"accent",onClick:U},{default:l(()=>[S(p(r.$t("common.ok")),1)]),_:1})]),_:1})]),_:1},8,["title"])]),_:1},8,["modelValue"])]),_:1}),e(O,null,{default:l(()=>[e(le,{mobile:null,headers:d,"items-per-page":"-1",items:g(c).searchPlugins,"sort-by":[{key:"fullName",order:"asc"}],loading:V.value},{"item.enabled":l(({item:n})=>[e(ye,{"model-value":n.enabled,onClick:q=>N(n)},null,8,["model-value","onClick"])]),"item.url":l(({item:n})=>[C("a",{href:n.url,title:n.name},p(n.url),9,Ne)]),"item.actions":l(({item:n})=>[e(Ve,{color:"red",icon:"mdi-delete",onClick:q=>D(n)},null,8,["onClick"])]),_:2},1032,["items","loading"])]),_:1}),e(Q,null,{default:l(()=>[e(M),e(m,{color:"accent",onClick:i},{default:l(()=>[S(p(r.$t("common.close")),1)]),_:1})]),_:1})]),_:1})]),_:1},8,["modelValue"]))}});De={class:"pa-3"};qe={style:{"font-size":"1.6em !important"},class:"subtitle-1 ml-2"};Le={class:"d-flex justify-end"};ze=X({__name:"SearchEngine",setup(B){const I=re(),{t}=Y(),y=ke(),c=be(),d=Z(),V=Ee(),k=h(),w=h(!1),v=h(0),{searchData:u}=ue(d),N=[{title:t("searchEngine.headers.fileName"),key:"fileName"},{title:t("searchEngine.headers.fileSize"),key:"fileSize"},{title:t("searchEngine.headers.nbSeeders"),key:"nbSeeders"},{title:t("searchEngine.headers.nbLeechers"),key:"nbLeechers"},{title:t("searchEngine.headers.siteUrl"),key:"siteUrl"},{title:"",key:"actions",sortable:!1}],_=[{title:t("searchEngine.filters.category.movies"),value:"movies"},{title:t("searchEngine.filters.category.tv"),value:"tv"},{title:t("searchEngine.filters.category.music"),value:"music"},{title:t("searchEngine.filters.category.games"),value:"games"},{title:t("searchEngine.filters.category.anime"),value:"anime"},{title:t("searchEngine.filters.category.software"),value:"software"},{title:t("searchEngine.filters.category.pictures"),value:"pictures"},{title:t("searchEngine.filters.category.books"),value:"books"}];_.sort((a,o)=>a.title.localeCompare(o.title));const U=[{title:t("searchEngine.filters.category.all"),value:"all"},..._],D=H(()=>{const a=[{title:t("searchEngine.filters.plugins.all"),value:"all"},{title:t("searchEngine.filters.plugins.enabled"),value:"enabled"}];return d.searchPlugins.filter(o=>o.enabled).forEach(o=>{a.push({title:o.name,value:o.name})}),a}),i=H(()=>u.value[v.value]??{}),{results:$}=Se(()=>i.value.results,()=>i.value.filters?.title,a=>a.fileName);function r(){d.createNewTab(),v.value=u.value.length-1,k.value?.focus()}function f(){u.value.length!==1&&(d.deleteTab(i.value.uniqueId),v.value=Math.min(v.value,u.value.length-1))}function n(a){y.pushTorrentToQueue(a.fileUrl)}function q(a){window.open(a.descrLink,"_blank","noreferrer")}async function x(){await d.runNewSearch(i.value),i.value.timer=setInterval(()=>te(i.value),1e3),k.value?.saveValueToHistory()}async function L(a){await d.stopSearch(a),a.timer&&clearInterval(a.timer)}function ae(){u.value.forEach(L)}async function te(a){await d.refreshResults(a)==="Stopped"&&await L(a)}const K=()=>{I.push({name:"dashboard"})};function ne(){c.createDialog(Ue)}function z(a){if(c.hasActiveDialog||w.value)return!1;a.key==="Escape"&&K()}return ce(async()=>{document.addEventListener("keydown",z),u.value.length===0?d.createNewTab():u.value.forEach(a=>{a.id&&a.id!==0&&(a.timer=setInterval(()=>d.refreshResults(a),1e3))}),await d.fetchSearchPlugins()}),de(()=>{document.removeEventListener("keydown",z),u.value.forEach(a=>{a.timer&&clearInterval(a.timer)})}),(a,o)=>(E(),j("div",De,[e(P,{"no-gutters":"",align:"center",justify:"center"},{default:l(()=>[e(b,null,{default:l(()=>[C("h1",qe,p(g(t)("searchEngine.title")),1)]),_:1}),e(b,null,{default:l(()=>[C("div",Le,[e(m,{icon:"mdi-stop",variant:"plain",color:"error",onClick:ae}),e(m,{icon:"mdi-toy-brick",variant:"plain",color:"primary",onClick:ne}),e(m,{icon:"mdi-close",variant:"plain",onClick:K})])]),_:1})]),_:1}),e(P,{class:"ma-0 pa-0"},{default:l(()=>[e(Ce,{class:"d-flex align-center justify-center ma-0 pa-0 bg-primary",fluid:""},{default:l(()=>[e(_e,{modelValue:v.value,"onUpdate:modelValue":o[0]||(o[0]=s=>v.value=s),class:"overflow-auto","bg-color":"primary","show-arrows":""},{default:l(()=>[(E(!0),j(fe,null,me(g(u),s=>(E(),T($e,{key:s.uniqueId},{default:l(()=>[C("h4",null,p(!s.query||s.query.length===0?a.$t("searchEngine.tabHeaderEmpty"):s.query),1)]),_:2},1024))),128))]),_:1},8,["modelValue"]),e(M),e(m,{icon:"mdi-plus-circle-outline",variant:"plain",color:"accent",onClick:r}),e(m,{icon:"mdi-minus-circle-outline",variant:"plain",color:"error",disabled:g(u).length===1,onClick:f},null,8,["disabled"])]),_:1})]),_:1}),e(we,null,{default:l(()=>[e(G,null,{default:l(()=>[e(P,{class:"mt-1"},{default:l(()=>[e(b,{cols:"12",md:"6"},{default:l(()=>[e(Pe,{modelValue:i.value.query,"onUpdate:modelValue":o[1]||(o[1]=s=>i.value.query=s),"history-key":g(Te).SEARCH_ENGINE_QUERY,ref_key:"queryInput",ref:k,autofocus:"",density:"compact","hide-details":"",clearable:"",label:a.$t("searchEngine.query"),onKeydown:ge(R(x,["prevent"]),["enter"])},null,8,["modelValue","history-key","label","onKeydown"])]),_:1}),e(b,{cols:"6",sm:"5",md:"2"},{default:l(()=>[e(J,{modelValue:i.value.filters.category,"onUpdate:modelValue":o[2]||(o[2]=s=>i.value.filters.category=s),height:"1",variant:"outlined",density:"compact","hide-details":"",items:U,label:a.$t("searchEngine.filters.category.label")},null,8,["modelValue","label"])]),_:1}),e(b,{cols:"6",sm:"5",md:"2"},{default:l(()=>[e(J,{modelValue:i.value.filters.plugin,"onUpdate:modelValue":o[3]||(o[3]=s=>i.value.filters.plugin=s),flat:"",density:"compact","hide-details":"",variant:"outlined",items:D.value,label:a.$t("searchEngine.filters.plugins.label")},null,8,["modelValue","items","label"])]),_:1}),e(b,{cols:"12",sm:"2",class:"d-flex align-center justify-center"},{default:l(()=>[i.value.id===0?(E(),T(m,{key:0,color:"accent",flat:"",class:"mx-auto px-4",onClick:x},{default:l(()=>[S(p(a.$t("searchEngine.runSearch")),1)]),_:1})):(E(),T(m,{key:1,color:"warning",flat:"",class:"mx-auto px-4",onClick:o[4]||(o[4]=s=>L(i.value))},{default:l(()=>[S(p(a.$t("searchEngine.stopSearch")),1)]),_:1}))]),_:1})]),_:1})]),_:1}),e(Me,{class:"my-3"}),e(G,{class:"text-select"},{default:l(()=>[e(le,{mobile:null,headers:N,items:g($),"footer-props":{itemsPerPageOptions:[10,25,50,100,-1]},"items-per-page":i.value.itemsPerPage},{top:l(()=>[e(P,null,{default:l(()=>[e(b,{cols:"12"},{default:l(()=>[e(ee,{modelValue:i.value.filters.title,"onUpdate:modelValue":o[5]||(o[5]=s=>i.value.filters.title=s),density:"compact","hide-details":"",label:a.$t("searchEngine.filters.title.label")},null,8,["modelValue","label"])]),_:1})]),_:1})]),"item.fileSize":l(({item:s})=>[S(p(g(Ie)(s.fileSize,g(V).useBinarySize)),1)]),"item.actions":l(({item:s})=>[e(m,{icon:"mdi-open-in-new",variant:"flat",density:"compact",onClick:R(se=>q(s),["stop"])},null,8,["onClick"]),e(m,{icon:"mdi-download",variant:"flat",density:"compact",onClick:se=>n(s)},null,8,["onClick"])]),_:2},1032,["items","items-per-page"])]),_:1})]),_:1})]))}})});export{ze as default,__tla}; import{j as X,E as Y,f as h,H as E,I as T,J as l,n as e,U as C,L as p,q as ie,u as g,M as R,K as S,P as oe,S as re,$ as ue,c as z,G as ce,v as de,Q as H,F as fe,V as me,O as ge}from"./vue-CfSjRv-x.js";import{a as pe,R as Z,i as A,V as ve,g as M,j as F,c as O,d as he,e as ee,f as Q,h as m,S as le,v as ye,k as Ve,D as ke,E as be,m as Ee,n as Se,p as P,q as we,r as b,G as Ce,U as _e,W as $e,s as G,K as Pe,M as Te,t as J,w as Me,X as Ie,__tla as __tla_0}from"./index-C0tfT_Qc.js";import{_ as W,__tla as __tla_1}from"./MixedButton.vue_vue_type_script_setup_true_lang-Br4NUWtV.js";import"./vuetify-PctCzU6r.js";let je;let __tla=Promise.all([(()=>{try{return __tla_0}catch{}})(),(()=>{try{return __tla_1}catch{}})()]).then(async()=>{let Ne,Ue,De,qe,Le;Ne=["href","title"];Ue=X({__name:"PluginManagerDialog",props:{guid:{}},setup(B){const I=B,{isOpened:t}=pe(I.guid),{t:y}=Y(),c=Z(),d=[{title:y("dialogs.pluginManager.headers.enabled"),key:"enabled",sortable:!1},{title:y("dialogs.pluginManager.headers.name"),key:"fullName"},{title:y("dialogs.pluginManager.headers.version"),key:"version"},{title:y("dialogs.pluginManager.headers.url"),key:"url"},{title:y("dialogs.pluginManager.headers.actions"),key:"actions"}],V=h(!1),k=h(!1),w=h(!1),v=h(!1),u=h("");async function N(r){await c.toggleSearchPlugin(r),await c.fetchSearchPlugins()}async function _(){k.value=!0,await c.updatePlugins().then(()=>new Promise(r=>setTimeout(r,2e3))),await c.fetchSearchPlugins(),k.value=!1}async function U(){$(),V.value=!0,await c.installSearchPlugin(u.value),u.value="",setTimeout(()=>{c.fetchSearchPlugins().then(()=>{V.value=!1})},1e3)}async function D(r){V.value=!0,await c.uninstallSearchPlugin(r.name),await c.fetchSearchPlugins(),V.value=!1}const i=()=>{t.value=!1};function $(){w.value=!1}return(r,f)=>(E(),T(F,{modelValue:g(t),"onUpdate:modelValue":f[4]||(f[4]=n=>oe(t)?t.value=n:null)},{default:l(()=>[e(A,null,{default:l(()=>[e(ve,{class:"d-flex"},{default:l(()=>[C("div",null,p(r.$t("dialogs.pluginManager.title")),1),e(M),e(W,{icon:"mdi-update",text:r.$t("dialogs.pluginManager.update"),color:"accent",class:"mr-2",loading:k.value,onClick:_},null,8,["text","loading"]),e(F,{modelValue:w.value,"onUpdate:modelValue":f[3]||(f[3]=n=>w.value=n)},{activator:l(({props:n})=>[e(W,ie({icon:"mdi-toy-brick-plus",text:r.$t("dialogs.pluginManager.install.activator")},n,{color:"primary"}),null,16,["text"])]),default:l(()=>[e(A,{title:r.$t("dialogs.pluginManager.install.title")},{default:l(()=>[e(O,null,{default:l(()=>[e(g(he),{modelValue:v.value,"onUpdate:modelValue":f[1]||(f[1]=n=>v.value=n),onSubmit:f[2]||(f[2]=R(()=>{},["prevent"]))},{default:l(()=>[e(ee,{modelValue:u.value,"onUpdate:modelValue":f[0]||(f[0]=n=>u.value=n),autofocus:"",label:r.$t("dialogs.pluginManager.install.label")},null,8,["modelValue","label"])]),_:1},8,["modelValue"])]),_:1}),e(Q,null,{default:l(()=>[e(M),e(m,{color:"error",onClick:$},{default:l(()=>[S(p(r.$t("common.cancel")),1)]),_:1}),e(m,{color:"accent",onClick:U},{default:l(()=>[S(p(r.$t("common.ok")),1)]),_:1})]),_:1})]),_:1},8,["title"])]),_:1},8,["modelValue"])]),_:1}),e(O,null,{default:l(()=>[e(le,{mobile:null,headers:d,"items-per-page":"-1",items:g(c).searchPlugins,"sort-by":[{key:"fullName",order:"asc"}],loading:V.value},{"item.enabled":l(({item:n})=>[e(ye,{"model-value":n.enabled,onClick:q=>N(n)},null,8,["model-value","onClick"])]),"item.url":l(({item:n})=>[C("a",{href:n.url,title:n.name},p(n.url),9,Ne)]),"item.actions":l(({item:n})=>[e(Ve,{color:"red",icon:"mdi-delete",onClick:q=>D(n)},null,8,["onClick"])]),_:2},1032,["items","loading"])]),_:1}),e(Q,null,{default:l(()=>[e(M),e(m,{color:"accent",onClick:i},{default:l(()=>[S(p(r.$t("common.close")),1)]),_:1})]),_:1})]),_:1})]),_:1},8,["modelValue"]))}});De={class:"pa-3"};qe={style:{"font-size":"1.6em !important"},class:"subtitle-1 ml-2"};Le={class:"d-flex justify-end"};je=X({__name:"SearchEngine",setup(B){const I=re(),{t}=Y(),y=ke(),c=be(),d=Z(),V=Ee(),k=h(),w=h(!1),v=h(0),{searchData:u}=ue(d),N=[{title:t("searchEngine.headers.fileName"),key:"fileName"},{title:t("searchEngine.headers.fileSize"),key:"fileSize"},{title:t("searchEngine.headers.nbSeeders"),key:"nbSeeders"},{title:t("searchEngine.headers.nbLeechers"),key:"nbLeechers"},{title:t("searchEngine.headers.siteUrl"),key:"siteUrl"},{title:"",key:"actions",sortable:!1}],_=[{title:t("searchEngine.filters.category.movies"),value:"movies"},{title:t("searchEngine.filters.category.tv"),value:"tv"},{title:t("searchEngine.filters.category.music"),value:"music"},{title:t("searchEngine.filters.category.games"),value:"games"},{title:t("searchEngine.filters.category.anime"),value:"anime"},{title:t("searchEngine.filters.category.software"),value:"software"},{title:t("searchEngine.filters.category.pictures"),value:"pictures"},{title:t("searchEngine.filters.category.books"),value:"books"}];_.sort((a,o)=>a.title.localeCompare(o.title));const U=[{title:t("searchEngine.filters.category.all"),value:"all"},..._],D=z(()=>{const a=[{title:t("searchEngine.filters.plugins.all"),value:"all"},{title:t("searchEngine.filters.plugins.enabled"),value:"enabled"}];return d.searchPlugins.filter(o=>o.enabled).forEach(o=>{a.push({title:o.name,value:o.name})}),a}),i=z(()=>u.value[v.value]??{}),{results:$}=Se(()=>i.value.results,()=>i.value.filters?.title,a=>a.fileName);function r(){d.createNewTab(),v.value=u.value.length-1,k.value?.focus()}function f(){u.value.length!==1&&(d.deleteTab(i.value.uniqueId),v.value=Math.min(v.value,u.value.length-1))}function n(a){y.pushTorrentToQueue(a.fileUrl)}function q(a){window.open(a.descrLink,"_blank","noreferrer")}async function x(){await d.runNewSearch(i.value),i.value.timer=setInterval(()=>te(i.value),1e3),k.value?.saveValueToHistory()}async function L(a){await d.stopSearch(a),a.timer&&clearInterval(a.timer)}function ae(){u.value.forEach(L)}async function te(a){await d.refreshResults(a)==="Stopped"&&await L(a)}const K=()=>{I.push({name:"dashboard"})};function ne(){c.createDialog(Ue)}function j(a){if(c.hasActiveDialog||w.value)return!1;a.key==="Escape"&&K()}return ce(async()=>{document.addEventListener("keydown",j),u.value.length===0?d.createNewTab():u.value.forEach(a=>{a.id&&a.id!==0&&(a.timer=setInterval(()=>d.refreshResults(a),1e3))}),await d.fetchSearchPlugins()}),de(()=>{document.removeEventListener("keydown",j),u.value.forEach(a=>{a.timer&&clearInterval(a.timer)})}),(a,o)=>(E(),H("div",De,[e(P,{"no-gutters":"",align:"center",justify:"center"},{default:l(()=>[e(b,null,{default:l(()=>[C("h1",qe,p(g(t)("searchEngine.title")),1)]),_:1}),e(b,null,{default:l(()=>[C("div",Le,[e(m,{icon:"mdi-stop",variant:"plain",color:"error",onClick:ae}),e(m,{icon:"mdi-toy-brick",variant:"plain",color:"primary",onClick:ne}),e(m,{icon:"mdi-close",variant:"plain",onClick:K})])]),_:1})]),_:1}),e(P,{class:"ma-0 pa-0"},{default:l(()=>[e(Ce,{class:"d-flex align-center justify-center ma-0 pa-0 bg-primary",fluid:""},{default:l(()=>[e(_e,{modelValue:v.value,"onUpdate:modelValue":o[0]||(o[0]=s=>v.value=s),class:"overflow-auto","bg-color":"primary","show-arrows":""},{default:l(()=>[(E(!0),H(fe,null,me(g(u),s=>(E(),T($e,{key:s.uniqueId},{default:l(()=>[C("h4",null,p(!s.query||s.query.length===0?a.$t("searchEngine.tabHeaderEmpty"):s.query),1)]),_:2},1024))),128))]),_:1},8,["modelValue"]),e(M),e(m,{icon:"mdi-plus-circle-outline",variant:"plain",color:"accent",onClick:r}),e(m,{icon:"mdi-minus-circle-outline",variant:"plain",color:"error",disabled:g(u).length===1,onClick:f},null,8,["disabled"])]),_:1})]),_:1}),e(we,null,{default:l(()=>[e(G,null,{default:l(()=>[e(P,{class:"mt-1"},{default:l(()=>[e(b,{cols:"12",md:"6"},{default:l(()=>[e(Pe,{modelValue:i.value.query,"onUpdate:modelValue":o[1]||(o[1]=s=>i.value.query=s),"history-key":g(Te).SEARCH_ENGINE_QUERY,ref_key:"queryInput",ref:k,autofocus:"",density:"compact","hide-details":"",clearable:"",label:a.$t("searchEngine.query"),onKeydown:ge(R(x,["prevent"]),["enter"])},null,8,["modelValue","history-key","label","onKeydown"])]),_:1}),e(b,{cols:"6",sm:"5",md:"2"},{default:l(()=>[e(J,{modelValue:i.value.filters.category,"onUpdate:modelValue":o[2]||(o[2]=s=>i.value.filters.category=s),height:"1",variant:"outlined",density:"compact","hide-details":"",items:U,label:a.$t("searchEngine.filters.category.label")},null,8,["modelValue","label"])]),_:1}),e(b,{cols:"6",sm:"5",md:"2"},{default:l(()=>[e(J,{modelValue:i.value.filters.plugin,"onUpdate:modelValue":o[3]||(o[3]=s=>i.value.filters.plugin=s),flat:"",density:"compact","hide-details":"",variant:"outlined",items:D.value,label:a.$t("searchEngine.filters.plugins.label")},null,8,["modelValue","items","label"])]),_:1}),e(b,{cols:"12",sm:"2",class:"d-flex align-center justify-center"},{default:l(()=>[i.value.id===0?(E(),T(m,{key:0,color:"accent",flat:"",class:"mx-auto px-4",onClick:x},{default:l(()=>[S(p(a.$t("searchEngine.runSearch")),1)]),_:1})):(E(),T(m,{key:1,color:"warning",flat:"",class:"mx-auto px-4",onClick:o[4]||(o[4]=s=>L(i.value))},{default:l(()=>[S(p(a.$t("searchEngine.stopSearch")),1)]),_:1}))]),_:1})]),_:1})]),_:1}),e(Me,{class:"my-3"}),e(G,{class:"text-select"},{default:l(()=>[e(le,{mobile:null,headers:N,items:g($),"footer-props":{itemsPerPageOptions:[10,25,50,100,-1]},"items-per-page":i.value.itemsPerPage},{top:l(()=>[e(P,null,{default:l(()=>[e(b,{cols:"12"},{default:l(()=>[e(ee,{modelValue:i.value.filters.title,"onUpdate:modelValue":o[5]||(o[5]=s=>i.value.filters.title=s),density:"compact","hide-details":"",label:a.$t("searchEngine.filters.title.label")},null,8,["modelValue","label"])]),_:1})]),_:1})]),"item.fileSize":l(({item:s})=>[S(p(g(Ie)(s.fileSize,g(V).useBinarySize)),1)]),"item.actions":l(({item:s})=>[e(m,{icon:"mdi-open-in-new",variant:"flat",density:"compact",onClick:R(se=>q(s),["stop"])},null,8,["onClick"]),e(m,{icon:"mdi-download",variant:"flat",density:"compact",onClick:se=>n(s)},null,8,["onClick"])]),_:2},1032,["items","items-per-page"])]),_:1})]),_:1})]))}})});export{je as default,__tla};

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -1,4 +1,4 @@
import{l as Re,M as g,o as Be,p as Ue,E as u,q as b,s as Ae,t as q,F as K,v as Ie,j as m,S as p,d as B,w as Y,x as Fe,b as H,B as k,h as U,u as C,i as _,R as w,y as Ee,a as De,C as S,z as Oe,G as ze,H as He,I as J,e as X,J as Le,P as We,c as Ve,D as Q,K as je,L as $e,__tla as __tla_0}from"./TorrentDetail-BZZ-B8cw.js";import{b as Ne,S as Z,G as ee,f as te,U as re,T as L,h as W,B as qe,i as Ke,R as se,__tla as __tla_1}from"./colorToUniform-pFJ8sYB5.js";let Bt,T,Rt,Ut,St,At,at,Pt,M,wt,Ct,Mt,Gt;let __tla=Promise.all([(()=>{try{return __tla_0}catch{}})(),(()=>{try{return __tla_1}catch{}})()]).then(async()=>{const ae=class A extends Ne{constructor(e){e={...A.defaultOptions,...e},super(e),this.enabled=!0,this._state=Z.for2d(),this.padding=e.padding,typeof e.antialias=="boolean"?this.antialias=e.antialias?"on":"off":this.antialias=e.antialias,this.resolution=e.resolution,this.blendRequired=e.blendRequired,this.addResource("uTexture",0,1)}apply(e,t,r,a){e.applyFilter(this,t,r,a)}get blendMode(){return this._state.blendMode}set blendMode(e){this._state.blendMode=e}static from(e){const{gpu:t,gl:r,...a}=e;let n,i;return t&&(n=ee.from(t)),r&&(i=te.from(r)),new A({gpuProgram:n,glProgram:i,...a})}};ae.defaultOptions={blendMode:"normal",resolution:1,padding:0,antialias:"off",blendRequired:!1};let Ye=ae;var Je=`in vec2 vMaskCoord; import{m as Re,M as g,o as Be,p as Ue,E as u,q as b,s as Ae,t as q,F as K,v as Ie,k as m,S as p,h as B,w as Y,x as Fe,c as H,B as k,i as U,u as C,j as _,R as w,y as Ee,a as De,C as S,z as Oe,G as ze,H as He,I as J,e as X,J as Le,P as We,d as Ve,D as Q,K as je,L as $e,N as Ne,__tla as __tla_0}from"./TorrentDetail-CKmHZcwa.js";import{b as qe,S as Z,G as ee,f as te,U as re,T as L,h as W,B as Ke,i as Ye,R as se,__tla as __tla_1}from"./colorToUniform-rMRo2qOn.js";let Ut,T,Bt,At,Pt,It,nt,Gt,M,St,wt,Ct,Rt;let __tla=Promise.all([(()=>{try{return __tla_0}catch{}})(),(()=>{try{return __tla_1}catch{}})()]).then(async()=>{const ae=class A extends qe{constructor(e){e={...A.defaultOptions,...e},super(e),this.enabled=!0,this._state=Z.for2d(),this.padding=e.padding,typeof e.antialias=="boolean"?this.antialias=e.antialias?"on":"off":this.antialias=e.antialias,this.resolution=e.resolution,this.blendRequired=e.blendRequired,this.addResource("uTexture",0,1)}apply(e,t,r,a){e.applyFilter(this,t,r,a)}get blendMode(){return this._state.blendMode}set blendMode(e){this._state.blendMode=e}static from(e){const{gpu:t,gl:r,...a}=e;let n,i;return t&&(n=ee.from(t)),r&&(i=te.from(r)),new A({gpuProgram:n,glProgram:i,...a})}};ae.defaultOptions={blendMode:"normal",resolution:1,padding:0,antialias:"off",blendRequired:!1};let Je=ae;var Xe=`in vec2 vMaskCoord;
in vec2 vTextureCoord; in vec2 vTextureCoord;
uniform sampler2D uTexture; uniform sampler2D uTexture;
@@ -27,7 +27,7 @@ void main(void)
finalColor = original; finalColor = original;
} }
`,Xe=`in vec2 aPosition; `,Qe=`in vec2 aPosition;
out vec2 vTextureCoord; out vec2 vTextureCoord;
out vec2 vMaskCoord; out vec2 vMaskCoord;
@@ -161,7 +161,7 @@ fn mainFragment(
var a = (alphaMul * mask.r) * clip; var a = (alphaMul * mask.r) * clip;
return vec4(source.rgb, source.a) * a; return vec4(source.rgb, source.a) * a;
}`;class Qe extends Ye{constructor(e){const{sprite:t,...r}=e,a=new Re(t.texture),n=new re({uFilterMatrix:{value:new g,type:"mat3x3<f32>"},uMaskClamp:{value:a.uClampFrame,type:"vec4<f32>"},uAlpha:{value:1,type:"f32"}}),i=ee.from({vertex:{source:V,entryPoint:"mainVertex"},fragment:{source:V,entryPoint:"mainFragment"}}),l=te.from({vertex:Xe,fragment:Je,name:"mask-filter"});super({...r,gpuProgram:i,glProgram:l,resources:{filterUniforms:n,uMaskTexture:t.texture.source}}),this.sprite=t,this._textureMatrix=a}apply(e,t,r,a){this._textureMatrix.texture=this.sprite.texture,e.calculateSpriteMatrix(this.resources.filterUniforms.uniforms.uFilterMatrix,this.sprite).prepend(this._textureMatrix.mapCoord),this.resources.uMaskTexture=this.sprite.texture.source,e.applyFilter(this,t,r,a)}}class ne{constructor(e,t){this.state=Z.for2d(),this._batches=Object.create(null),this._geometries=Object.create(null),this.renderer=e,this._adaptor=t,this._adaptor.init(this)}buildStart(e){if(!this._batches[e.uid]){const t=new Be;this._batches[e.uid]=t,this._geometries[t.uid]=new Ue}this._activeBatch=this._batches[e.uid],this._activeGeometry=this._geometries[this._activeBatch.uid],this._activeBatch.begin()}addToBatch(e){this._activeBatch.add(e)}break(e){this._activeBatch.break(e)}buildEnd(e){const t=this._activeBatch,r=this._activeGeometry;t.finish(e),r.indexBuffer.setDataWithSize(t.indexBuffer,t.indexSize,!0),r.buffers[0].setDataWithSize(t.attributeBuffer.float32View,t.attributeSize,!1)}upload(e){const t=this._batches[e.uid],r=this._geometries[t.uid];t.dirty&&(t.dirty=!1,r.buffers[0].update(t.attributeSize*4))}execute(e){if(e.action==="startBatch"){const t=e.batcher,r=this._geometries[t.uid];this._adaptor.start(this,r)}this._adaptor.execute(this,e)}destroy(){this.state=null,this.renderer=null,this._adaptor.destroy(),this._adaptor=null;for(const e in this._batches)this._batches[e].destroy();this._batches=null;for(const e in this._geometries)this._geometries[e].destroy();this._geometries=null}}ne.extension={type:[u.WebGLPipes,u.WebGPUPipes,u.CanvasPipes],name:"batch"};Mt={name:"texture-bit",vertex:{header:` }`;class Ze extends Je{constructor(e){const{sprite:t,...r}=e,a=new Re(t.texture),n=new re({uFilterMatrix:{value:new g,type:"mat3x3<f32>"},uMaskClamp:{value:a.uClampFrame,type:"vec4<f32>"},uAlpha:{value:1,type:"f32"}}),i=ee.from({vertex:{source:V,entryPoint:"mainVertex"},fragment:{source:V,entryPoint:"mainFragment"}}),l=te.from({vertex:Qe,fragment:Xe,name:"mask-filter"});super({...r,gpuProgram:i,glProgram:l,resources:{filterUniforms:n,uMaskTexture:t.texture.source}}),this.sprite=t,this._textureMatrix=a}apply(e,t,r,a){this._textureMatrix.texture=this.sprite.texture,e.calculateSpriteMatrix(this.resources.filterUniforms.uniforms.uFilterMatrix,this.sprite).prepend(this._textureMatrix.mapCoord),this.resources.uMaskTexture=this.sprite.texture.source,e.applyFilter(this,t,r,a)}}class ne{constructor(e,t){this.state=Z.for2d(),this._batches=Object.create(null),this._geometries=Object.create(null),this.renderer=e,this._adaptor=t,this._adaptor.init(this)}buildStart(e){if(!this._batches[e.uid]){const t=new Be;this._batches[e.uid]=t,this._geometries[t.uid]=new Ue}this._activeBatch=this._batches[e.uid],this._activeGeometry=this._geometries[this._activeBatch.uid],this._activeBatch.begin()}addToBatch(e){this._activeBatch.add(e)}break(e){this._activeBatch.break(e)}buildEnd(e){const t=this._activeBatch,r=this._activeGeometry;t.finish(e),r.indexBuffer.setDataWithSize(t.indexBuffer,t.indexSize,!0),r.buffers[0].setDataWithSize(t.attributeBuffer.float32View,t.attributeSize,!1)}upload(e){const t=this._batches[e.uid],r=this._geometries[t.uid];t.dirty&&(t.dirty=!1,r.buffers[0].update(t.attributeSize*4))}execute(e){if(e.action==="startBatch"){const t=e.batcher,r=this._geometries[t.uid];this._adaptor.start(this,r)}this._adaptor.execute(this,e)}destroy(){this.state=null,this.renderer=null,this._adaptor.destroy(),this._adaptor=null;for(const e in this._batches)this._batches[e].destroy();this._batches=null;for(const e in this._geometries)this._geometries[e].destroy();this._geometries=null}}ne.extension={type:[u.WebGLPipes,u.WebGPUPipes,u.CanvasPipes],name:"batch"};Ct={name:"texture-bit",vertex:{header:`
struct TextureUniforms { struct TextureUniforms {
uTextureMatrix:mat3x3<f32>, uTextureMatrix:mat3x3<f32>,
@@ -177,7 +177,7 @@ fn mainFragment(
`,main:` `,main:`
outColor = textureSample(uTexture, uSampler, vUV); outColor = textureSample(uTexture, uSampler, vUV);
`}};Ct={name:"texture-bit",vertex:{header:` `}};wt={name:"texture-bit",vertex:{header:`
uniform mat3 uTextureMatrix; uniform mat3 uTextureMatrix;
`,main:` `,main:`
uv = (uTextureMatrix * vec3(uv, 1.0)).xy; uv = (uTextureMatrix * vec3(uv, 1.0)).xy;
@@ -187,7 +187,7 @@ fn mainFragment(
`,main:` `,main:`
outColor = texture(uTexture, vUV); outColor = texture(uTexture, vUV);
`}};function Ze(s,e){const t=s.root,r=s.instructionSet;r.reset(),e.batch.buildStart(r),e.blendMode.buildStart(),e.colorMask.buildStart(),t.sortableChildren&&t.sortChildren(),ie(t,r,e,!0),e.batch.buildEnd(r),e.blendMode.buildEnd(r)}function P(s,e,t){s.globalDisplayStatus<7||!s.includeInBuild||(s.sortableChildren&&s.sortChildren(),s.isSimple?et(s,e,t):ie(s,e,t,!1))}function et(s,e,t){if(s.renderPipeId&&(t.blendMode.setBlendMode(s,s.groupBlendMode,e),s.didViewUpdate=!1,t[s.renderPipeId].addRenderable(s,e)),!s.renderGroup){const r=s.children,a=r.length;for(let n=0;n<a;n++)P(r[n],e,t)}}function ie(s,e,t,r){if(!r&&s.renderGroup)t.renderGroup.addRenderGroup(s.renderGroup,e);else{for(let i=0;i<s.effects.length;i++){const l=s.effects[i];t[l.pipe].push(l,s,e)}const a=s.renderPipeId;a&&(t.blendMode.setBlendMode(s,s.groupBlendMode,e),s.didViewUpdate=!1,t[a].addRenderable(s,e));const n=s.children;if(n.length)for(let i=0;i<n.length;i++)P(n[i],e,t);for(let i=s.effects.length-1;i>=0;i--){const l=s.effects[i];t[l.pipe].pop(l,s,e)}}}const tt=new q;class rt extends K{constructor(){super(),this.filters=[new Qe({sprite:new Ie(m.EMPTY)})]}get sprite(){return this.filters[0].sprite}set sprite(e){this.filters[0].sprite=e}}class oe{constructor(e){this._activeMaskStage=[],this._renderer=e}push(e,t,r){const a=this._renderer;if(a.renderPipes.batch.break(r),r.add({renderPipeId:"alphaMask",action:"pushMaskBegin",mask:e,canBundle:!1,maskedContainer:t}),e.renderMaskToTexture){const n=e.mask;n.includeInBuild=!0,P(n,r,a.renderPipes),n.includeInBuild=!1}a.renderPipes.batch.break(r),r.add({renderPipeId:"alphaMask",action:"pushMaskEnd",mask:e,maskedContainer:t,canBundle:!1})}pop(e,t,r){this._renderer.renderPipes.batch.break(r),r.add({renderPipeId:"alphaMask",action:"popMaskEnd",mask:e,canBundle:!1})}execute(e){const t=this._renderer,r=e.mask.renderMaskToTexture;if(e.action==="pushMaskBegin"){const a=b.get(rt);if(r){e.mask.mask.measurable=!0;const n=Ae(e.mask.mask,!0,tt);e.mask.mask.measurable=!1,n.ceil();const i=L.getOptimalTexture(n.width,n.height,1,!1);t.renderTarget.push(i,!0),t.globalUniforms.push({offset:n,worldColor:4294967295});const l=a.sprite;l.texture=i,l.worldTransform.tx=n.minX,l.worldTransform.ty=n.minY,this._activeMaskStage.push({filterEffect:a,maskedContainer:e.maskedContainer,filterTexture:i})}else a.sprite=e.mask.mask,this._activeMaskStage.push({filterEffect:a,maskedContainer:e.maskedContainer})}else if(e.action==="pushMaskEnd"){const a=this._activeMaskStage[this._activeMaskStage.length-1];r&&(t.renderTarget.pop(),t.globalUniforms.pop()),t.filter.push({renderPipeId:"filter",action:"pushFilter",container:a.maskedContainer,filterEffect:a.filterEffect,canBundle:!1})}else if(e.action==="popMaskEnd"){t.filter.pop();const a=this._activeMaskStage.pop();r&&L.returnTexture(a.filterTexture),b.return(a.filterEffect)}}destroy(){this._renderer=null,this._activeMaskStage=null}}oe.extension={type:[u.WebGLPipes,u.WebGPUPipes,u.CanvasPipes],name:"alphaMask"};class le{constructor(e){this._colorStack=[],this._colorStackIndex=0,this._currentColor=0,this._renderer=e}buildStart(){this._colorStack[0]=15,this._colorStackIndex=1,this._currentColor=15}push(e,t,r){this._renderer.renderPipes.batch.break(r);const n=this._colorStack;n[this._colorStackIndex]=n[this._colorStackIndex-1]&e.mask;const i=this._colorStack[this._colorStackIndex];i!==this._currentColor&&(this._currentColor=i,r.add({renderPipeId:"colorMask",colorMask:i,canBundle:!1})),this._colorStackIndex++}pop(e,t,r){this._renderer.renderPipes.batch.break(r);const n=this._colorStack;this._colorStackIndex--;const i=n[this._colorStackIndex-1];i!==this._currentColor&&(this._currentColor=i,r.add({renderPipeId:"colorMask",colorMask:i,canBundle:!1}))}execute(e){this._renderer.colorMask.setMask(e.colorMask)}destroy(){this._colorStack=null}}le.extension={type:[u.WebGLPipes,u.WebGPUPipes,u.CanvasPipes],name:"colorMask"};class ue{constructor(e){this._maskStackHash={},this._maskHash=new WeakMap,this._renderer=e}push(e,t,r){var a;const n=e,i=this._renderer;i.renderPipes.batch.break(r),i.renderPipes.blendMode.setBlendMode(n.mask,"none",r),r.add({renderPipeId:"stencilMask",action:"pushMaskBegin",mask:e,canBundle:!1});const l=n.mask;l.includeInBuild=!0,this._maskHash.has(n)||this._maskHash.set(n,{instructionsStart:0,instructionsLength:0});const o=this._maskHash.get(n);o.instructionsStart=r.instructionSize,P(l,r,i.renderPipes),l.includeInBuild=!1,i.renderPipes.batch.break(r),r.add({renderPipeId:"stencilMask",action:"pushMaskEnd",mask:e,canBundle:!1});const d=r.instructionSize-o.instructionsStart-1;o.instructionsLength=d;const c=i.renderTarget.renderTarget.uid;(a=this._maskStackHash)[c]??(a[c]=0)}pop(e,t,r){const a=e,n=this._renderer;n.renderPipes.batch.break(r),n.renderPipes.blendMode.setBlendMode(a.mask,"none",r),r.add({renderPipeId:"stencilMask",action:"popMaskBegin",canBundle:!1});const i=this._maskHash.get(e);for(let l=0;l<i.instructionsLength;l++)r.instructions[r.instructionSize++]=r.instructions[i.instructionsStart++];r.add({renderPipeId:"stencilMask",action:"popMaskEnd",canBundle:!1})}execute(e){var t;const r=this._renderer,a=r.renderTarget.renderTarget.uid;let n=(t=this._maskStackHash)[a]??(t[a]=0);e.action==="pushMaskBegin"?(r.renderTarget.ensureDepthStencil(),r.stencil.setStencilMode(p.RENDERING_MASK_ADD,n),n++,r.colorMask.setMask(0)):e.action==="pushMaskEnd"?(r.stencil.setStencilMode(p.MASK_ACTIVE,n),r.colorMask.setMask(15)):e.action==="popMaskBegin"?(r.colorMask.setMask(0),n!==0?r.stencil.setStencilMode(p.RENDERING_MASK_REMOVE,n):(r.renderTarget.clear(null,B.STENCIL),r.stencil.setStencilMode(p.DISABLED,n)),n--):e.action==="popMaskEnd"&&(r.stencil.setStencilMode(p.MASK_ACTIVE,n),r.colorMask.setMask(15)),this._maskStackHash[a]=n}destroy(){this._renderer=null,this._maskStackHash=null,this._maskHash=null}}ue.extension={type:[u.WebGLPipes,u.WebGPUPipes,u.CanvasPipes],name:"stencilMask"};wt=function(s,e){for(const t in s.attributes){const r=s.attributes[t],a=e[t];a?(r.location??(r.location=a.location),r.format??(r.format=a.format),r.offset??(r.offset=a.offset),r.instance??(r.instance=a.instance)):Y(`Attribute ${t} is not present in the shader, but is present in the geometry. Unable to infer attribute details.`)}st(s)};function st(s){const{buffers:e,attributes:t}=s,r={},a={};for(const n in e){const i=e[n];r[i.uid]=0,a[i.uid]=0}for(const n in t){const i=t[n];r[i.buffer.uid]+=W(i.format).stride}for(const n in t){const i=t[n];i.stride??(i.stride=r[i.buffer.uid]),i.start??(i.start=a[i.buffer.uid]),a[i.buffer.uid]+=W(i.format).stride}}T=[];T[p.NONE]=void 0;T[p.DISABLED]={stencilWriteMask:0,stencilReadMask:0};T[p.RENDERING_MASK_ADD]={stencilFront:{compare:"equal",passOp:"increment-clamp"},stencilBack:{compare:"equal",passOp:"increment-clamp"}};T[p.RENDERING_MASK_REMOVE]={stencilFront:{compare:"equal",passOp:"decrement-clamp"},stencilBack:{compare:"equal",passOp:"decrement-clamp"}};T[p.MASK_ACTIVE]={stencilWriteMask:0,stencilFront:{compare:"equal",passOp:"keep"},stencilBack:{compare:"equal",passOp:"keep"}};St=class{constructor(e){this._syncFunctionHash=Object.create(null),this._adaptor=e,this._systemCheck()}_systemCheck(){if(!Fe())throw new Error("Current environment does not allow unsafe-eval, please use pixi.js/unsafe-eval module to enable support.")}ensureUniformGroup(e){const t=this.getUniformGroupData(e);e.buffer||(e.buffer=new H({data:new Float32Array(t.layout.size/4),usage:k.UNIFORM|k.COPY_DST}))}getUniformGroupData(e){return this._syncFunctionHash[e._signature]||this._initUniformGroup(e)}_initUniformGroup(e){const t=e._signature;let r=this._syncFunctionHash[t];if(!r){const a=Object.keys(e.uniformStructures).map(l=>e.uniformStructures[l]),n=this._adaptor.createUboElements(a),i=this._generateUboSync(n.uboElements);r=this._syncFunctionHash[t]={layout:n,syncFunction:i}}return this._syncFunctionHash[t]}_generateUboSync(e){return this._adaptor.generateUboSync(e)}syncUniformGroup(e,t,r){const a=this.getUniformGroupData(e);return e.buffer||(e.buffer=new H({data:new Float32Array(a.layout.size/4),usage:k.UNIFORM|k.COPY_DST})),t||(t=e.buffer.data),r||(r=0),a.syncFunction(e.uniforms,t,r),!0}updateUniformGroup(e){if(e.isStatic&&!e._dirtyId)return!1;e._dirtyId=0;const t=this.syncUniformGroup(e);return e.buffer.update(),t}destroy(){this._syncFunctionHash=null}};M=[{type:"mat3x3<f32>",test:s=>s.value.a!==void 0,ubo:` `}};function et(s,e){const t=s.root,r=s.instructionSet;r.reset(),e.batch.buildStart(r),e.blendMode.buildStart(),e.colorMask.buildStart(),t.sortableChildren&&t.sortChildren(),ie(t,r,e,!0),e.batch.buildEnd(r),e.blendMode.buildEnd(r)}function P(s,e,t){s.globalDisplayStatus<7||!s.includeInBuild||(s.sortableChildren&&s.sortChildren(),s.isSimple?tt(s,e,t):ie(s,e,t,!1))}function tt(s,e,t){if(s.renderPipeId&&(t.blendMode.setBlendMode(s,s.groupBlendMode,e),s.didViewUpdate=!1,t[s.renderPipeId].addRenderable(s,e)),!s.renderGroup){const r=s.children,a=r.length;for(let n=0;n<a;n++)P(r[n],e,t)}}function ie(s,e,t,r){if(!r&&s.renderGroup)t.renderGroup.addRenderGroup(s.renderGroup,e);else{for(let i=0;i<s.effects.length;i++){const l=s.effects[i];t[l.pipe].push(l,s,e)}const a=s.renderPipeId;a&&(t.blendMode.setBlendMode(s,s.groupBlendMode,e),s.didViewUpdate=!1,t[a].addRenderable(s,e));const n=s.children;if(n.length)for(let i=0;i<n.length;i++)P(n[i],e,t);for(let i=s.effects.length-1;i>=0;i--){const l=s.effects[i];t[l.pipe].pop(l,s,e)}}}const rt=new q;class st extends K{constructor(){super(),this.filters=[new Ze({sprite:new Ie(m.EMPTY)})]}get sprite(){return this.filters[0].sprite}set sprite(e){this.filters[0].sprite=e}}class oe{constructor(e){this._activeMaskStage=[],this._renderer=e}push(e,t,r){const a=this._renderer;if(a.renderPipes.batch.break(r),r.add({renderPipeId:"alphaMask",action:"pushMaskBegin",mask:e,canBundle:!1,maskedContainer:t}),e.renderMaskToTexture){const n=e.mask;n.includeInBuild=!0,P(n,r,a.renderPipes),n.includeInBuild=!1}a.renderPipes.batch.break(r),r.add({renderPipeId:"alphaMask",action:"pushMaskEnd",mask:e,maskedContainer:t,canBundle:!1})}pop(e,t,r){this._renderer.renderPipes.batch.break(r),r.add({renderPipeId:"alphaMask",action:"popMaskEnd",mask:e,canBundle:!1})}execute(e){const t=this._renderer,r=e.mask.renderMaskToTexture;if(e.action==="pushMaskBegin"){const a=b.get(st);if(r){e.mask.mask.measurable=!0;const n=Ae(e.mask.mask,!0,rt);e.mask.mask.measurable=!1,n.ceil();const i=L.getOptimalTexture(n.width,n.height,1,!1);t.renderTarget.push(i,!0),t.globalUniforms.push({offset:n,worldColor:4294967295});const l=a.sprite;l.texture=i,l.worldTransform.tx=n.minX,l.worldTransform.ty=n.minY,this._activeMaskStage.push({filterEffect:a,maskedContainer:e.maskedContainer,filterTexture:i})}else a.sprite=e.mask.mask,this._activeMaskStage.push({filterEffect:a,maskedContainer:e.maskedContainer})}else if(e.action==="pushMaskEnd"){const a=this._activeMaskStage[this._activeMaskStage.length-1];r&&(t.renderTarget.pop(),t.globalUniforms.pop()),t.filter.push({renderPipeId:"filter",action:"pushFilter",container:a.maskedContainer,filterEffect:a.filterEffect,canBundle:!1})}else if(e.action==="popMaskEnd"){t.filter.pop();const a=this._activeMaskStage.pop();r&&L.returnTexture(a.filterTexture),b.return(a.filterEffect)}}destroy(){this._renderer=null,this._activeMaskStage=null}}oe.extension={type:[u.WebGLPipes,u.WebGPUPipes,u.CanvasPipes],name:"alphaMask"};class le{constructor(e){this._colorStack=[],this._colorStackIndex=0,this._currentColor=0,this._renderer=e}buildStart(){this._colorStack[0]=15,this._colorStackIndex=1,this._currentColor=15}push(e,t,r){this._renderer.renderPipes.batch.break(r);const n=this._colorStack;n[this._colorStackIndex]=n[this._colorStackIndex-1]&e.mask;const i=this._colorStack[this._colorStackIndex];i!==this._currentColor&&(this._currentColor=i,r.add({renderPipeId:"colorMask",colorMask:i,canBundle:!1})),this._colorStackIndex++}pop(e,t,r){this._renderer.renderPipes.batch.break(r);const n=this._colorStack;this._colorStackIndex--;const i=n[this._colorStackIndex-1];i!==this._currentColor&&(this._currentColor=i,r.add({renderPipeId:"colorMask",colorMask:i,canBundle:!1}))}execute(e){this._renderer.colorMask.setMask(e.colorMask)}destroy(){this._colorStack=null}}le.extension={type:[u.WebGLPipes,u.WebGPUPipes,u.CanvasPipes],name:"colorMask"};class ue{constructor(e){this._maskStackHash={},this._maskHash=new WeakMap,this._renderer=e}push(e,t,r){var a;const n=e,i=this._renderer;i.renderPipes.batch.break(r),i.renderPipes.blendMode.setBlendMode(n.mask,"none",r),r.add({renderPipeId:"stencilMask",action:"pushMaskBegin",mask:e,canBundle:!1});const l=n.mask;l.includeInBuild=!0,this._maskHash.has(n)||this._maskHash.set(n,{instructionsStart:0,instructionsLength:0});const o=this._maskHash.get(n);o.instructionsStart=r.instructionSize,P(l,r,i.renderPipes),l.includeInBuild=!1,i.renderPipes.batch.break(r),r.add({renderPipeId:"stencilMask",action:"pushMaskEnd",mask:e,canBundle:!1});const d=r.instructionSize-o.instructionsStart-1;o.instructionsLength=d;const c=i.renderTarget.renderTarget.uid;(a=this._maskStackHash)[c]??(a[c]=0)}pop(e,t,r){const a=e,n=this._renderer;n.renderPipes.batch.break(r),n.renderPipes.blendMode.setBlendMode(a.mask,"none",r),r.add({renderPipeId:"stencilMask",action:"popMaskBegin",canBundle:!1});const i=this._maskHash.get(e);for(let l=0;l<i.instructionsLength;l++)r.instructions[r.instructionSize++]=r.instructions[i.instructionsStart++];r.add({renderPipeId:"stencilMask",action:"popMaskEnd",canBundle:!1})}execute(e){var t;const r=this._renderer,a=r.renderTarget.renderTarget.uid;let n=(t=this._maskStackHash)[a]??(t[a]=0);e.action==="pushMaskBegin"?(r.renderTarget.ensureDepthStencil(),r.stencil.setStencilMode(p.RENDERING_MASK_ADD,n),n++,r.colorMask.setMask(0)):e.action==="pushMaskEnd"?(r.stencil.setStencilMode(p.MASK_ACTIVE,n),r.colorMask.setMask(15)):e.action==="popMaskBegin"?(r.colorMask.setMask(0),n!==0?r.stencil.setStencilMode(p.RENDERING_MASK_REMOVE,n):(r.renderTarget.clear(null,B.STENCIL),r.stencil.setStencilMode(p.DISABLED,n)),n--):e.action==="popMaskEnd"&&(r.stencil.setStencilMode(p.MASK_ACTIVE,n),r.colorMask.setMask(15)),this._maskStackHash[a]=n}destroy(){this._renderer=null,this._maskStackHash=null,this._maskHash=null}}ue.extension={type:[u.WebGLPipes,u.WebGPUPipes,u.CanvasPipes],name:"stencilMask"};St=function(s,e){for(const t in s.attributes){const r=s.attributes[t],a=e[t];a?(r.location??(r.location=a.location),r.format??(r.format=a.format),r.offset??(r.offset=a.offset),r.instance??(r.instance=a.instance)):Y(`Attribute ${t} is not present in the shader, but is present in the geometry. Unable to infer attribute details.`)}at(s)};function at(s){const{buffers:e,attributes:t}=s,r={},a={};for(const n in e){const i=e[n];r[i.uid]=0,a[i.uid]=0}for(const n in t){const i=t[n];r[i.buffer.uid]+=W(i.format).stride}for(const n in t){const i=t[n];i.stride??(i.stride=r[i.buffer.uid]),i.start??(i.start=a[i.buffer.uid]),a[i.buffer.uid]+=W(i.format).stride}}T=[];T[p.NONE]=void 0;T[p.DISABLED]={stencilWriteMask:0,stencilReadMask:0};T[p.RENDERING_MASK_ADD]={stencilFront:{compare:"equal",passOp:"increment-clamp"},stencilBack:{compare:"equal",passOp:"increment-clamp"}};T[p.RENDERING_MASK_REMOVE]={stencilFront:{compare:"equal",passOp:"decrement-clamp"},stencilBack:{compare:"equal",passOp:"decrement-clamp"}};T[p.MASK_ACTIVE]={stencilWriteMask:0,stencilFront:{compare:"equal",passOp:"keep"},stencilBack:{compare:"equal",passOp:"keep"}};Pt=class{constructor(e){this._syncFunctionHash=Object.create(null),this._adaptor=e,this._systemCheck()}_systemCheck(){if(!Fe())throw new Error("Current environment does not allow unsafe-eval, please use pixi.js/unsafe-eval module to enable support.")}ensureUniformGroup(e){const t=this.getUniformGroupData(e);e.buffer||(e.buffer=new H({data:new Float32Array(t.layout.size/4),usage:k.UNIFORM|k.COPY_DST}))}getUniformGroupData(e){return this._syncFunctionHash[e._signature]||this._initUniformGroup(e)}_initUniformGroup(e){const t=e._signature;let r=this._syncFunctionHash[t];if(!r){const a=Object.keys(e.uniformStructures).map(l=>e.uniformStructures[l]),n=this._adaptor.createUboElements(a),i=this._generateUboSync(n.uboElements);r=this._syncFunctionHash[t]={layout:n,syncFunction:i}}return this._syncFunctionHash[t]}_generateUboSync(e){return this._adaptor.generateUboSync(e)}syncUniformGroup(e,t,r){const a=this.getUniformGroupData(e);return e.buffer||(e.buffer=new H({data:new Float32Array(a.layout.size/4),usage:k.UNIFORM|k.COPY_DST})),t||(t=e.buffer.data),r||(r=0),a.syncFunction(e.uniforms,t,r),!0}updateUniformGroup(e){if(e.isStatic&&!e._dirtyId)return!1;e._dirtyId=0;const t=this.syncUniformGroup(e);return e.buffer.update(),t}destroy(){this._syncFunctionHash=null}};M=[{type:"mat3x3<f32>",test:s=>s.value.a!==void 0,ubo:`
var matrix = uv[name].toArray(true); var matrix = uv[name].toArray(true);
data[offset] = matrix[0]; data[offset] = matrix[0];
data[offset + 1] = matrix[1]; data[offset + 1] = matrix[1];
@@ -198,7 +198,7 @@ fn mainFragment(
data[offset + 8] = matrix[6]; data[offset + 8] = matrix[6];
data[offset + 9] = matrix[7]; data[offset + 9] = matrix[7];
data[offset + 10] = matrix[8]; data[offset + 10] = matrix[8];
`,uniform:` `,uniform:`
gl.uniformMatrix3fv(ud[name].location, false, uv[name].toArray(true)); gl.uniformMatrix3fv(ud[name].location, false, uv[name].toArray(true));
`},{type:"vec4<f32>",test:s=>s.type==="vec4<f32>"&&s.size===1&&s.value.width!==void 0,ubo:` `},{type:"vec4<f32>",test:s=>s.type==="vec4<f32>"&&s.size===1&&s.value.width!==void 0,ubo:`
v = uv[name]; v = uv[name];
@@ -258,7 +258,7 @@ fn mainFragment(
cv[2] = v.blue; cv[2] = v.blue;
gl.uniform3f(ud[name].location, v.red, v.green, v.blue); gl.uniform3f(ud[name].location, v.red, v.green, v.blue);
} }
`}];Pt=function(s,e,t,r){const a=[` `}];Gt=function(s,e,t,r){const a=[`
var v = null; var v = null;
var v2 = null; var v2 = null;
var t = 0; var t = 0;
@@ -274,7 +274,7 @@ fn mainFragment(
for (let i = 0; i < ${s*e}; i++) { for (let i = 0; i < ${s*e}; i++) {
data[offset + (((i / ${s})|0) * 4) + (i % ${s})] = v[i]; data[offset + (((i / ${s})|0) * 4) + (i % ${s})] = v[i];
} }
`}at={f32:` `}nt={f32:`
data[offset] = v;`,i32:` data[offset] = v;`,i32:`
data[offset] = v;`,"vec2<f32>":` data[offset] = v;`,"vec2<f32>":`
data[offset] = v[0]; data[offset] = v[0];
@@ -301,11 +301,11 @@ fn mainFragment(
data[offset + 10] = v[8];`,"mat4x4<f32>":` data[offset + 10] = v[8];`,"mat4x4<f32>":`
for (let i = 0; i < 16; i++) { for (let i = 0; i < 16; i++) {
data[offset + i] = v[i]; data[offset + i] = v[i];
}`,"mat3x2<f32>":x(3,2),"mat4x2<f32>":x(4,2),"mat2x3<f32>":x(2,3),"mat4x3<f32>":x(4,3),"mat2x4<f32>":x(2,4),"mat3x4<f32>":x(3,4)};Gt={...at,"mat2x2<f32>":` }`,"mat3x2<f32>":x(3,2),"mat4x2<f32>":x(4,2),"mat2x3<f32>":x(2,3),"mat4x3<f32>":x(4,3),"mat2x4<f32>":x(2,4),"mat3x4<f32>":x(3,4)};Rt={...nt,"mat2x2<f32>":`
data[offset] = v[0]; data[offset] = v[0];
data[offset + 1] = v[1]; data[offset + 1] = v[1];
data[offset + 2] = v[2]; data[offset + 2] = v[2];
data[offset + 3] = v[3]; data[offset + 3] = v[3];
`};function nt(s,e,t,r,a,n){const i=n?1:-1;return s.identity(),s.a=1/r*2,s.d=i*(1/a*2),s.tx=-1-e*s.a,s.ty=-i-t*s.d,s}const v=new Map;function de(s,e){if(!v.has(s)){const t=new m({source:new U({resource:s,...e})}),r=()=>{v.get(s)===t&&v.delete(s)};t.once("destroy",r),t.source.once("destroy",r),v.set(s,t)}return v.get(s)}function it(s){const e=s.colorTexture.source.resource;return globalThis.HTMLCanvasElement&&e instanceof HTMLCanvasElement&&document.body.contains(e)}const ce=class he{constructor(e={}){if(this.uid=C("renderTarget"),this.colorTextures=[],this.dirtyId=0,this.isRoot=!1,this._size=new Float32Array(2),this._managedColorTextures=!1,e={...he.defaultOptions,...e},this.stencil=e.stencil,this.depth=e.depth,this.isRoot=e.isRoot,typeof e.colorTextures=="number"){this._managedColorTextures=!0;for(let t=0;t<e.colorTextures;t++)this.colorTextures.push(new _({width:e.width,height:e.height,resolution:e.resolution,antialias:e.antialias}))}else{this.colorTextures=[...e.colorTextures.map(r=>r.source)];const t=this.colorTexture.source;this.resize(t.width,t.height,t._resolution)}this.colorTexture.source.on("resize",this.onSourceResize,this),(e.depthStencilTexture||this.stencil)&&(e.depthStencilTexture instanceof m||e.depthStencilTexture instanceof _?this.depthStencilTexture=e.depthStencilTexture.source:this.ensureDepthStencilTexture())}get size(){const e=this._size;return e[0]=this.pixelWidth,e[1]=this.pixelHeight,e}get width(){return this.colorTexture.source.width}get height(){return this.colorTexture.source.height}get pixelWidth(){return this.colorTexture.source.pixelWidth}get pixelHeight(){return this.colorTexture.source.pixelHeight}get resolution(){return this.colorTexture.source._resolution}get colorTexture(){return this.colorTextures[0]}onSourceResize(e){this.resize(e.width,e.height,e._resolution,!0)}ensureDepthStencilTexture(){this.depthStencilTexture||(this.depthStencilTexture=new _({width:this.width,height:this.height,resolution:this.resolution,format:"depth24plus-stencil8",autoGenerateMipmaps:!1,antialias:!1,mipLevelCount:1}))}resize(e,t,r=this.resolution,a=!1){this.dirtyId++,this.colorTextures.forEach((n,i)=>{a&&i===0||n.source.resize(e,t,r)}),this.depthStencilTexture&&this.depthStencilTexture.source.resize(e,t,r)}destroy(){this.colorTexture.source.off("resize",this.onSourceResize,this),this._managedColorTextures&&this.colorTextures.forEach(e=>{e.destroy()}),this.depthStencilTexture&&(this.depthStencilTexture.destroy(),delete this.depthStencilTexture)}};ce.defaultOptions={width:0,height:0,resolution:1,colorTextures:1,stencil:!1,depth:!1,antialias:!1,isRoot:!1};let I=ce;Rt=class{constructor(e){this.rootViewPort=new w,this.viewport=new w,this.onRenderTargetChange=new Ee("onRenderTargetChange"),this.projectionMatrix=new g,this.defaultClearColor=[0,0,0,0],this._renderSurfaceToRenderTargetHash=new Map,this._gpuRenderTargetHash=Object.create(null),this._renderTargetStack=[],this._renderer=e}finishRenderPass(){this.adaptor.finishRenderPass(this.renderTarget)}renderStart({target:e,clear:t,clearColor:r,frame:a}){this._renderTargetStack.length=0,this.push(e,t,r,a),this.rootViewPort.copyFrom(this.viewport),this.rootRenderTarget=this.renderTarget,this.renderingToScreen=it(this.rootRenderTarget)}bind(e,t=!0,r,a){const n=this.getRenderTarget(e),i=this.renderTarget!==n;this.renderTarget=n,this.renderSurface=e;const l=this.getGpuRenderTarget(n);(n.pixelWidth!==l.width||n.pixelHeight!==l.height)&&(this.adaptor.resizeGpuRenderTarget(n),l.width=n.pixelWidth,l.height=n.pixelHeight);const o=n.colorTexture,d=this.viewport,c=o.pixelWidth,h=o.pixelHeight;if(!a&&e instanceof m&&(a=e.frame),a){const f=o._resolution;d.x=a.x*f+.5|0,d.y=a.y*f+.5|0,d.width=a.width*f+.5|0,d.height=a.height*f+.5|0}else d.x=0,d.y=0,d.width=c,d.height=h;return nt(this.projectionMatrix,0,0,d.width/o.resolution,d.height/o.resolution,!n.isRoot),this.adaptor.startRenderPass(n,t,r,d),i&&this.onRenderTargetChange.emit(n),n}clear(e,t=B.ALL,r){t&&(e&&(e=this.getRenderTarget(e)),this.adaptor.clear(e||this.renderTarget,t,r,this.viewport))}contextChange(){this._gpuRenderTargetHash=Object.create(null)}push(e,t=B.ALL,r,a){const n=this.bind(e,t,r,a);return this._renderTargetStack.push({renderTarget:n,frame:a}),n}pop(){this._renderTargetStack.pop();const e=this._renderTargetStack[this._renderTargetStack.length-1];this.bind(e.renderTarget,!1,null,e.frame)}getRenderTarget(e){return e.isTexture&&(e=e.source),this._renderSurfaceToRenderTargetHash.get(e)??this._initRenderTarget(e)}copyToTexture(e,t,r,a,n){r.x<0&&(a.width+=r.x,n.x-=r.x,r.x=0),r.y<0&&(a.height+=r.y,n.y-=r.y,r.y=0);const{pixelWidth:i,pixelHeight:l}=e;return a.width=Math.min(a.width,i-r.x),a.height=Math.min(a.height,l-r.y),this.adaptor.copyToTexture(e,t,r,a,n)}ensureDepthStencil(){this.renderTarget.stencil||(this.renderTarget.stencil=!0,this.adaptor.startRenderPass(this.renderTarget,!1,null,this.viewport))}destroy(){this._renderer=null,this._renderSurfaceToRenderTargetHash.forEach((e,t)=>{e!==t&&e.destroy()}),this._renderSurfaceToRenderTargetHash.clear(),this._gpuRenderTargetHash=Object.create(null)}_initRenderTarget(e){let t=null;return U.test(e)&&(e=de(e).source),e instanceof I?t=e:e instanceof _&&(t=new I({colorTextures:[e]}),U.test(e.source.resource)&&(t.isRoot=!0),e.once("destroy",()=>{t.destroy();const r=this._gpuRenderTargetHash[t.uid];r&&(this._gpuRenderTargetHash[t.uid]=null,this.adaptor.destroyGpuRenderTarget(r))})),this._renderSurfaceToRenderTargetHash.set(e,t),t}getGpuRenderTarget(e){return this._gpuRenderTargetHash[e.uid]||(this._gpuRenderTargetHash[e.uid]=this.adaptor.initGpuRenderTarget(e))}};Bt=class extends De{constructor({buffer:e,offset:t,size:r}){super(),this.uid=C("buffer"),this._resourceType="bufferResource",this._touched=0,this._resourceId=C("resource"),this._bufferResource=!0,this.destroyed=!1,this.buffer=e,this.offset=t|0,this.size=r,this.buffer.on("change",this.onBufferChange,this)}onBufferChange(){this._resourceId=C("resource"),this.emit("change",this)}destroy(e=!1){this.destroyed=!0,e&&this.buffer.destroy(),this.emit("change",this),this.buffer=null}};class fe{constructor(e){this._renderer=e}addRenderable(e,t){this._renderer.renderPipes.batch.break(t),t.add(e)}execute(e){e.isRenderable&&e.render(this._renderer)}destroy(){this._renderer=null}}fe.extension={type:[u.WebGLPipes,u.WebGPUPipes,u.CanvasPipes],name:"customRender"};function pe(s,e){const t=s.instructionSet,r=t.instructions;for(let a=0;a<t.instructionSize;a++){const n=r[a];e[n.renderPipeId].execute(n)}}class me{constructor(e){this._renderer=e}addRenderGroup(e,t){this._renderer.renderPipes.batch.break(t),t.add(e)}execute(e){e.isRenderable&&(this._renderer.globalUniforms.push({worldTransformMatrix:e.worldTransform,worldColor:e.worldColorAlpha}),pe(e,this._renderer.renderPipes),this._renderer.globalUniforms.pop())}destroy(){this._renderer=null}}me.extension={type:[u.WebGLPipes,u.WebGPUPipes,u.CanvasPipes],name:"renderGroup"};function ge(s,e=[]){e.push(s);for(let t=0;t<s.renderGroupChildren.length;t++)ge(s.renderGroupChildren[t],e);return e}function ot(s,e,t){const r=s>>16&255,a=s>>8&255,n=s&255,i=e>>16&255,l=e>>8&255,o=e&255,d=r+(i-r)*t,c=a+(l-a)*t,h=n+(o-n)*t;return(d<<16)+(c<<8)+h}const G=16777215;function xe(s,e){return s===G||e===G?s+e-G:ot(s,e,.5)}const lt=new S;function ve(s,e=!1){ut(s);const t=s.childrenToUpdate,r=s.updateTick++;for(const a in t){const n=t[a],i=n.list,l=n.index;for(let o=0;o<l;o++){const d=i[o];d.parentRenderGroup===s&&be(d,r,0)}n.index=0}if(e)for(let a=0;a<s.renderGroupChildren.length;a++)ve(s.renderGroupChildren[a],e)}function ut(s){const e=s.root;let t;if(s.renderGroupParent){const r=s.renderGroupParent;s.worldTransform.appendFrom(e.relativeGroupTransform,r.worldTransform),s.worldColor=xe(e.groupColor,r.worldColor),t=e.groupAlpha*r.worldAlpha}else s.worldTransform.copyFrom(e.localTransform),s.worldColor=e.localColor,t=e.localAlpha;t=t<0?0:t>1?1:t,s.worldAlpha=t,s.worldColorAlpha=s.worldColor+((t*255|0)<<24)}function be(s,e,t){if(e===s.updateTick)return;s.updateTick=e,s.didChange=!1;const r=s.localTransform;s.updateLocalTransform();const a=s.parent;if(a&&!a.renderGroup?(t=t|s._updateFlags,s.relativeGroupTransform.appendFrom(r,a.relativeGroupTransform),t&&j(s,a,t)):(t=s._updateFlags,s.relativeGroupTransform.copyFrom(r),t&&j(s,lt,t)),!s.renderGroup){const n=s.children,i=n.length;for(let o=0;o<i;o++)be(n[o],e,t);const l=s.parentRenderGroup;s.renderPipeId&&!l.structureDidChange&&l.updateRenderable(s)}}function j(s,e,t){if(t&Oe){s.groupColor=xe(s.localColor,e.groupColor);let r=s.localAlpha*e.groupAlpha;r=r<0?0:r>1?1:r,s.groupAlpha=r,s.groupColorAlpha=s.groupColor+((r*255|0)<<24)}t&ze&&(s.groupBlendMode=s.localBlendMode==="inherit"?e.groupBlendMode:s.localBlendMode),t&He&&(s.globalDisplayStatus=s.localDisplayStatus&e.globalDisplayStatus),s._updateFlags=0}function dt(s,e){const{list:t,index:r}=s.childrenRenderablesToUpdate;let a=!1;for(let n=0;n<r;n++){const i=t[n];if(a=e[i.renderPipeId].validateRenderable(i),a)break}return s.structureDidChange=a,a}const ct=new g;class _e{constructor(e){this._renderer=e}render({container:e,transform:t}){e.isRenderGroup=!0;const r=e.parent,a=e.renderGroup.renderGroupParent;e.parent=null,e.renderGroup.renderGroupParent=null;const n=this._renderer,i=ge(e.renderGroup,[]);let l=ct;t&&(l=l.copyFrom(e.renderGroup.localTransform),e.renderGroup.localTransform.copyFrom(t));const o=n.renderPipes;for(let d=0;d<i.length;d++){const c=i[d];c.runOnRender(),c.instructionSet.renderPipes=o,c.structureDidChange||dt(c,o),ve(c),c.structureDidChange?(c.structureDidChange=!1,Ze(c,o)):ht(c),c.childrenRenderablesToUpdate.index=0,n.renderPipes.batch.upload(c.instructionSet)}n.globalUniforms.start({worldTransformMatrix:t?e.renderGroup.localTransform:e.renderGroup.worldTransform,worldColor:e.renderGroup.worldColorAlpha}),pe(e.renderGroup,o),o.uniformBatch&&o.uniformBatch.renderEnd(),t&&e.renderGroup.localTransform.copyFrom(l),e.parent=r,e.renderGroup.renderGroupParent=a}destroy(){this._renderer=null}}_e.extension={type:[u.WebGLSystem,u.WebGPUSystem,u.CanvasSystem],name:"renderGroup"};function ht(s){const{list:e,index:t}=s.childrenRenderablesToUpdate;for(let r=0;r<t;r++){const a=e[r];a.didViewUpdate&&s.updateRenderable(a)}}class ye{constructor(e){this._gpuSpriteHash=Object.create(null),this._renderer=e}addRenderable(e,t){const r=this._getGpuSprite(e);e._didSpriteUpdate&&this._updateBatchableSprite(e,r),this._renderer.renderPipes.batch.addToBatch(r)}updateRenderable(e){const t=this._gpuSpriteHash[e.uid];e._didSpriteUpdate&&this._updateBatchableSprite(e,t),t.batcher.updateElement(t)}validateRenderable(e){const t=e._texture,r=this._getGpuSprite(e);return r.texture._source!==t._source?!r.batcher.checkAndUpdateTexture(r,t):!1}destroyRenderable(e){const t=this._gpuSpriteHash[e.uid];b.return(t),this._gpuSpriteHash[e.uid]=null}_updateBatchableSprite(e,t){e._didSpriteUpdate=!1,t.bounds=e.bounds,t.texture=e._texture}_getGpuSprite(e){return this._gpuSpriteHash[e.uid]||this._initGPUSprite(e)}_initGPUSprite(e){const t=b.get(qe);return t.renderable=e,t.texture=e._texture,t.bounds=e.bounds,t.roundPixels=this._renderer._roundPixels|e._roundPixels,this._gpuSpriteHash[e.uid]=t,e._didSpriteUpdate=!1,e.on("destroyed",()=>{this.destroyRenderable(e)}),t}destroy(){for(const e in this._gpuSpriteHash)b.return(this._gpuSpriteHash[e]);this._gpuSpriteHash=null,this._renderer=null}}ye.extension={type:[u.WebGLPipes,u.WebGPUPipes,u.CanvasPipes],name:"sprite"};const F=class Te{constructor(){this.clearBeforeRender=!0,this._backgroundColor=new J(0),this.color=this._backgroundColor,this.alpha=1}init(e){e={...Te.defaultOptions,...e},this.clearBeforeRender=e.clearBeforeRender,this.color=e.background||e.backgroundColor||this._backgroundColor,this.alpha=e.backgroundAlpha,this._backgroundColor.setAlpha(e.backgroundAlpha)}get color(){return this._backgroundColor}set color(e){this._backgroundColor.setValue(e)}get alpha(){return this._backgroundColor.alpha}set alpha(e){this._backgroundColor.setAlpha(e)}get colorRgba(){return this._backgroundColor.toArray()}destroy(){}};F.extension={type:[u.WebGLSystem,u.WebGPUSystem,u.CanvasSystem],name:"background",priority:0};F.defaultOptions={backgroundAlpha:1,backgroundColor:0,clearBeforeRender:!0};let ft=F;const y={};X.handle(u.BlendMode,s=>{if(!s.name)throw new Error("BlendMode extension must have a name property");y[s.name]=s.ref},s=>{delete y[s.name]});class ke{constructor(e){this._isAdvanced=!1,this._filterHash=Object.create(null),this._renderer=e}setBlendMode(e,t,r){if(this._activeBlendMode===t){this._isAdvanced&&this._renderableList.push(e);return}this._activeBlendMode=t,this._isAdvanced&&this._endAdvancedBlendMode(r),this._isAdvanced=!!y[t],this._isAdvanced&&(this._beginAdvancedBlendMode(r),this._renderableList.push(e))}_beginAdvancedBlendMode(e){this._renderer.renderPipes.batch.break(e);const t=this._activeBlendMode;if(!y[t]){Y(`Unable to assign BlendMode: '${t}'. You may want to include: import 'pixi.js/advanced-blend-modes'`);return}let r=this._filterHash[t];r||(r=this._filterHash[t]=new K,r.filters=[new y[t]]);const a={renderPipeId:"filter",action:"pushFilter",renderables:[],filterEffect:r,canBundle:!1};this._renderableList=a.renderables,e.add(a)}_endAdvancedBlendMode(e){this._renderableList=null,this._renderer.renderPipes.batch.break(e),e.add({renderPipeId:"filter",action:"popFilter",canBundle:!1})}buildStart(){this._isAdvanced=!1}buildEnd(e){this._isAdvanced&&this._endAdvancedBlendMode(e)}destroy(){this._renderer=null,this._renderableList=null;for(const e in this._filterHash)this._filterHash[e].destroy();this._filterHash=null}}ke.extension={type:[u.WebGLPipes,u.WebGPUPipes,u.CanvasPipes],name:"blendMode"};const R={png:"image/png",jpg:"image/jpeg",webp:"image/webp"},E=class Me{constructor(e){this._renderer=e}_normalizeOptions(e,t={}){return e instanceof S||e instanceof m?{target:e,...t}:{...t,...e}}async image(e){const t=new Image;return t.src=await this.base64(e),t}async base64(e){e=this._normalizeOptions(e,Me.defaultImageOptions);const{format:t,quality:r}=e,a=this.canvas(e);if(a.toBlob!==void 0)return new Promise((n,i)=>{a.toBlob(l=>{if(!l){i(new Error("ICanvas.toBlob failed!"));return}const o=new FileReader;o.onload=()=>n(o.result),o.onerror=i,o.readAsDataURL(l)},R[t],r)});if(a.toDataURL!==void 0)return a.toDataURL(R[t],r);if(a.convertToBlob!==void 0){const n=await a.convertToBlob({type:R[t],quality:r});return new Promise((i,l)=>{const o=new FileReader;o.onload=()=>i(o.result),o.onerror=l,o.readAsDataURL(n)})}throw new Error("Extract.base64() requires ICanvas.toDataURL, ICanvas.toBlob, or ICanvas.convertToBlob to be implemented")}canvas(e){e=this._normalizeOptions(e);const t=e.target,r=this._renderer;if(t instanceof m)return r.texture.generateCanvas(t);const a=r.textureGenerator.generateTexture(e),n=r.texture.generateCanvas(a);return a.destroy(),n}pixels(e){e=this._normalizeOptions(e);const t=e.target,r=this._renderer,a=t instanceof m?t:r.textureGenerator.generateTexture(e),n=r.texture.getPixels(a);return t instanceof S&&a.destroy(),n}texture(e){return e=this._normalizeOptions(e),e.target instanceof m?e.target:this._renderer.textureGenerator.generateTexture(e)}download(e){e=this._normalizeOptions(e);const t=this.canvas(e),r=document.createElement("a");r.download=e.filename??"image.png",r.href=t.toDataURL("image/png"),document.body.appendChild(r),r.click(),document.body.removeChild(r)}log(e){const t=e.width??200;e=this._normalizeOptions(e);const r=this.canvas(e),a=r.toDataURL();console.log(`[Pixi Texture] ${r.width}px ${r.height}px`);const n=["font-size: 1px;",`padding: ${t}px 300px;`,`background: url(${a}) no-repeat;`,"background-size: contain;"].join(" ");console.log("%c ",n)}destroy(){this._renderer=null}};E.extension={type:[u.WebGLSystem,u.WebGPUSystem],name:"extract"};E.defaultImageOptions={format:"png",quality:1};let pt=E;class mt extends m{static create(e){return new m({source:new _(e)})}resize(e,t,r){return this.source.resize(e,t,r),this}}const gt=new w,xt=new q,vt=[0,0,0,0];class Ce{constructor(e){this._renderer=e}generateTexture(e){e instanceof S&&(e={target:e,frame:void 0,textureSourceOptions:{},resolution:void 0});const t=e.resolution||this._renderer.resolution,r=e.antialias||this._renderer.view.antialias,a=e.target;let n=e.clearColor;n?n=Array.isArray(n)&&n.length===4?n:J.shared.setValue(n).toArray():n=vt;const i=e.frame?.copyTo(gt)||Le(a,xt).rectangle;i.width=Math.max(i.width,1/t)|0,i.height=Math.max(i.height,1/t)|0;const l=mt.create({...e.textureSourceOptions,width:i.width,height:i.height,resolution:t,antialias:r}),o=g.shared.translate(-i.x,-i.y);return this._renderer.render({container:a,transform:o,target:l,clearColor:n}),l}destroy(){this._renderer=null}}Ce.extension={type:[u.WebGLSystem,u.WebGPUSystem],name:"textureGenerator"};class we{constructor(e){this._stackIndex=0,this._globalUniformDataStack=[],this._uniformsPool=[],this._activeUniforms=[],this._bindGroupPool=[],this._activeBindGroups=[],this._renderer=e}reset(){this._stackIndex=0;for(let e=0;e<this._activeUniforms.length;e++)this._uniformsPool.push(this._activeUniforms[e]);for(let e=0;e<this._activeBindGroups.length;e++)this._bindGroupPool.push(this._activeBindGroups[e]);this._activeUniforms.length=0,this._activeBindGroups.length=0}start(e){this.reset(),this.push(e)}bind({size:e,projectionMatrix:t,worldTransformMatrix:r,worldColor:a,offset:n}){const i=this._renderer.renderTarget.renderTarget,l=this._stackIndex?this._globalUniformDataStack[this._stackIndex-1]:{projectionData:i,worldTransformMatrix:new g,worldColor:4294967295,offset:new We},o={projectionMatrix:t||this._renderer.renderTarget.projectionMatrix,resolution:e||i.size,worldTransformMatrix:r||l.worldTransformMatrix,worldColor:a||l.worldColor,offset:n||l.offset,bindGroup:null},d=this._uniformsPool.pop()||this._createUniforms();this._activeUniforms.push(d);const c=d.uniforms;c.uProjectionMatrix=o.projectionMatrix,c.uResolution=o.resolution,c.uWorldTransformMatrix.copyFrom(o.worldTransformMatrix),c.uWorldTransformMatrix.tx-=o.offset.x,c.uWorldTransformMatrix.ty-=o.offset.y,Ke(o.worldColor,c.uWorldColorAlpha,0),d.update();let h;this._renderer.renderPipes.uniformBatch?h=this._renderer.renderPipes.uniformBatch.getUniformBindGroup(d,!1):(h=this._bindGroupPool.pop()||new Ve,this._activeBindGroups.push(h),h.setResource(d,0)),o.bindGroup=h,this._currentGlobalUniformData=o}push(e){this.bind(e),this._globalUniformDataStack[this._stackIndex++]=this._currentGlobalUniformData}pop(){this._currentGlobalUniformData=this._globalUniformDataStack[--this._stackIndex-1],this._renderer.type===se.WEBGL&&this._currentGlobalUniformData.bindGroup.resources[0].update()}get bindGroup(){return this._currentGlobalUniformData.bindGroup}get uniformGroup(){return this._currentGlobalUniformData.bindGroup.resources[0]}_createUniforms(){return new re({uProjectionMatrix:{value:new g,type:"mat3x3<f32>"},uWorldTransformMatrix:{value:new g,type:"mat3x3<f32>"},uWorldColorAlpha:{value:new Float32Array(4),type:"vec4<f32>"},uResolution:{value:[0,0],type:"vec2<f32>"}},{isStatic:!0})}destroy(){this._renderer=null}}we.extension={type:[u.WebGLSystem,u.WebGPUSystem,u.CanvasSystem],name:"globalUniforms"};let $=!1;const N="8.1.5";function bt(s){if(!$){if(Q.get().getNavigator().userAgent.toLowerCase().indexOf("chrome")>-1){const e=[`%c %c %c %c %c PixiJS %c v${N} (${s}) http://www.pixijs.com/ `};function it(s,e,t,r,a,n){const i=n?1:-1;return s.identity(),s.a=1/r*2,s.d=i*(1/a*2),s.tx=-1-e*s.a,s.ty=-i-t*s.d,s}const v=new Map;function de(s,e){if(!v.has(s)){const t=new m({source:new U({resource:s,...e})}),r=()=>{v.get(s)===t&&v.delete(s)};t.once("destroy",r),t.source.once("destroy",r),v.set(s,t)}return v.get(s)}function ot(s){const e=s.colorTexture.source.resource;return globalThis.HTMLCanvasElement&&e instanceof HTMLCanvasElement&&document.body.contains(e)}const ce=class he{constructor(e={}){if(this.uid=C("renderTarget"),this.colorTextures=[],this.dirtyId=0,this.isRoot=!1,this._size=new Float32Array(2),this._managedColorTextures=!1,e={...he.defaultOptions,...e},this.stencil=e.stencil,this.depth=e.depth,this.isRoot=e.isRoot,typeof e.colorTextures=="number"){this._managedColorTextures=!0;for(let t=0;t<e.colorTextures;t++)this.colorTextures.push(new _({width:e.width,height:e.height,resolution:e.resolution,antialias:e.antialias}))}else{this.colorTextures=[...e.colorTextures.map(r=>r.source)];const t=this.colorTexture.source;this.resize(t.width,t.height,t._resolution)}this.colorTexture.source.on("resize",this.onSourceResize,this),(e.depthStencilTexture||this.stencil)&&(e.depthStencilTexture instanceof m||e.depthStencilTexture instanceof _?this.depthStencilTexture=e.depthStencilTexture.source:this.ensureDepthStencilTexture())}get size(){const e=this._size;return e[0]=this.pixelWidth,e[1]=this.pixelHeight,e}get width(){return this.colorTexture.source.width}get height(){return this.colorTexture.source.height}get pixelWidth(){return this.colorTexture.source.pixelWidth}get pixelHeight(){return this.colorTexture.source.pixelHeight}get resolution(){return this.colorTexture.source._resolution}get colorTexture(){return this.colorTextures[0]}onSourceResize(e){this.resize(e.width,e.height,e._resolution,!0)}ensureDepthStencilTexture(){this.depthStencilTexture||(this.depthStencilTexture=new _({width:this.width,height:this.height,resolution:this.resolution,format:"depth24plus-stencil8",autoGenerateMipmaps:!1,antialias:!1,mipLevelCount:1}))}resize(e,t,r=this.resolution,a=!1){this.dirtyId++,this.colorTextures.forEach((n,i)=>{a&&i===0||n.source.resize(e,t,r)}),this.depthStencilTexture&&this.depthStencilTexture.source.resize(e,t,r)}destroy(){this.colorTexture.source.off("resize",this.onSourceResize,this),this._managedColorTextures&&this.colorTextures.forEach(e=>{e.destroy()}),this.depthStencilTexture&&(this.depthStencilTexture.destroy(),delete this.depthStencilTexture)}};ce.defaultOptions={width:0,height:0,resolution:1,colorTextures:1,stencil:!1,depth:!1,antialias:!1,isRoot:!1};let I=ce;Bt=class{constructor(e){this.rootViewPort=new w,this.viewport=new w,this.onRenderTargetChange=new Ee("onRenderTargetChange"),this.projectionMatrix=new g,this.defaultClearColor=[0,0,0,0],this._renderSurfaceToRenderTargetHash=new Map,this._gpuRenderTargetHash=Object.create(null),this._renderTargetStack=[],this._renderer=e}finishRenderPass(){this.adaptor.finishRenderPass(this.renderTarget)}renderStart({target:e,clear:t,clearColor:r,frame:a}){this._renderTargetStack.length=0,this.push(e,t,r,a),this.rootViewPort.copyFrom(this.viewport),this.rootRenderTarget=this.renderTarget,this.renderingToScreen=ot(this.rootRenderTarget)}bind(e,t=!0,r,a){const n=this.getRenderTarget(e),i=this.renderTarget!==n;this.renderTarget=n,this.renderSurface=e;const l=this.getGpuRenderTarget(n);(n.pixelWidth!==l.width||n.pixelHeight!==l.height)&&(this.adaptor.resizeGpuRenderTarget(n),l.width=n.pixelWidth,l.height=n.pixelHeight);const o=n.colorTexture,d=this.viewport,c=o.pixelWidth,h=o.pixelHeight;if(!a&&e instanceof m&&(a=e.frame),a){const f=o._resolution;d.x=a.x*f+.5|0,d.y=a.y*f+.5|0,d.width=a.width*f+.5|0,d.height=a.height*f+.5|0}else d.x=0,d.y=0,d.width=c,d.height=h;return it(this.projectionMatrix,0,0,d.width/o.resolution,d.height/o.resolution,!n.isRoot),this.adaptor.startRenderPass(n,t,r,d),i&&this.onRenderTargetChange.emit(n),n}clear(e,t=B.ALL,r){t&&(e&&(e=this.getRenderTarget(e)),this.adaptor.clear(e||this.renderTarget,t,r,this.viewport))}contextChange(){this._gpuRenderTargetHash=Object.create(null)}push(e,t=B.ALL,r,a){const n=this.bind(e,t,r,a);return this._renderTargetStack.push({renderTarget:n,frame:a}),n}pop(){this._renderTargetStack.pop();const e=this._renderTargetStack[this._renderTargetStack.length-1];this.bind(e.renderTarget,!1,null,e.frame)}getRenderTarget(e){return e.isTexture&&(e=e.source),this._renderSurfaceToRenderTargetHash.get(e)??this._initRenderTarget(e)}copyToTexture(e,t,r,a,n){r.x<0&&(a.width+=r.x,n.x-=r.x,r.x=0),r.y<0&&(a.height+=r.y,n.y-=r.y,r.y=0);const{pixelWidth:i,pixelHeight:l}=e;return a.width=Math.min(a.width,i-r.x),a.height=Math.min(a.height,l-r.y),this.adaptor.copyToTexture(e,t,r,a,n)}ensureDepthStencil(){this.renderTarget.stencil||(this.renderTarget.stencil=!0,this.adaptor.startRenderPass(this.renderTarget,!1,null,this.viewport))}destroy(){this._renderer=null,this._renderSurfaceToRenderTargetHash.forEach((e,t)=>{e!==t&&e.destroy()}),this._renderSurfaceToRenderTargetHash.clear(),this._gpuRenderTargetHash=Object.create(null)}_initRenderTarget(e){let t=null;return U.test(e)&&(e=de(e).source),e instanceof I?t=e:e instanceof _&&(t=new I({colorTextures:[e]}),U.test(e.source.resource)&&(t.isRoot=!0),e.once("destroy",()=>{t.destroy();const r=this._gpuRenderTargetHash[t.uid];r&&(this._gpuRenderTargetHash[t.uid]=null,this.adaptor.destroyGpuRenderTarget(r))})),this._renderSurfaceToRenderTargetHash.set(e,t),t}getGpuRenderTarget(e){return this._gpuRenderTargetHash[e.uid]||(this._gpuRenderTargetHash[e.uid]=this.adaptor.initGpuRenderTarget(e))}};Ut=class extends De{constructor({buffer:e,offset:t,size:r}){super(),this.uid=C("buffer"),this._resourceType="bufferResource",this._touched=0,this._resourceId=C("resource"),this._bufferResource=!0,this.destroyed=!1,this.buffer=e,this.offset=t|0,this.size=r,this.buffer.on("change",this.onBufferChange,this)}onBufferChange(){this._resourceId=C("resource"),this.emit("change",this)}destroy(e=!1){this.destroyed=!0,e&&this.buffer.destroy(),this.emit("change",this),this.buffer=null}};class fe{constructor(e){this._renderer=e}addRenderable(e,t){this._renderer.renderPipes.batch.break(t),t.add(e)}execute(e){e.isRenderable&&e.render(this._renderer)}destroy(){this._renderer=null}}fe.extension={type:[u.WebGLPipes,u.WebGPUPipes,u.CanvasPipes],name:"customRender"};function pe(s,e){const t=s.instructionSet,r=t.instructions;for(let a=0;a<t.instructionSize;a++){const n=r[a];e[n.renderPipeId].execute(n)}}class me{constructor(e){this._renderer=e}addRenderGroup(e,t){this._renderer.renderPipes.batch.break(t),t.add(e)}execute(e){e.isRenderable&&(this._renderer.globalUniforms.push({worldTransformMatrix:e.worldTransform,worldColor:e.worldColorAlpha}),pe(e,this._renderer.renderPipes),this._renderer.globalUniforms.pop())}destroy(){this._renderer=null}}me.extension={type:[u.WebGLPipes,u.WebGPUPipes,u.CanvasPipes],name:"renderGroup"};function ge(s,e=[]){e.push(s);for(let t=0;t<s.renderGroupChildren.length;t++)ge(s.renderGroupChildren[t],e);return e}function lt(s,e,t){const r=s>>16&255,a=s>>8&255,n=s&255,i=e>>16&255,l=e>>8&255,o=e&255,d=r+(i-r)*t,c=a+(l-a)*t,h=n+(o-n)*t;return(d<<16)+(c<<8)+h}const G=16777215;function xe(s,e){return s===G||e===G?s+e-G:lt(s,e,.5)}const ut=new S;function ve(s,e=!1){dt(s);const t=s.childrenToUpdate,r=s.updateTick++;for(const a in t){const n=t[a],i=n.list,l=n.index;for(let o=0;o<l;o++){const d=i[o];d.parentRenderGroup===s&&be(d,r,0)}n.index=0}if(e)for(let a=0;a<s.renderGroupChildren.length;a++)ve(s.renderGroupChildren[a],e)}function dt(s){const e=s.root;let t;if(s.renderGroupParent){const r=s.renderGroupParent;s.worldTransform.appendFrom(e.relativeGroupTransform,r.worldTransform),s.worldColor=xe(e.groupColor,r.worldColor),t=e.groupAlpha*r.worldAlpha}else s.worldTransform.copyFrom(e.localTransform),s.worldColor=e.localColor,t=e.localAlpha;t=t<0?0:t>1?1:t,s.worldAlpha=t,s.worldColorAlpha=s.worldColor+((t*255|0)<<24)}function be(s,e,t){if(e===s.updateTick)return;s.updateTick=e,s.didChange=!1;const r=s.localTransform;s.updateLocalTransform();const a=s.parent;if(a&&!a.renderGroup?(t=t|s._updateFlags,s.relativeGroupTransform.appendFrom(r,a.relativeGroupTransform),t&&j(s,a,t)):(t=s._updateFlags,s.relativeGroupTransform.copyFrom(r),t&&j(s,ut,t)),!s.renderGroup){const n=s.children,i=n.length;for(let o=0;o<i;o++)be(n[o],e,t);const l=s.parentRenderGroup;s.renderPipeId&&!l.structureDidChange&&l.updateRenderable(s)}}function j(s,e,t){if(t&Oe){s.groupColor=xe(s.localColor,e.groupColor);let r=s.localAlpha*e.groupAlpha;r=r<0?0:r>1?1:r,s.groupAlpha=r,s.groupColorAlpha=s.groupColor+((r*255|0)<<24)}t&ze&&(s.groupBlendMode=s.localBlendMode==="inherit"?e.groupBlendMode:s.localBlendMode),t&He&&(s.globalDisplayStatus=s.localDisplayStatus&e.globalDisplayStatus),s._updateFlags=0}function ct(s,e){const{list:t,index:r}=s.childrenRenderablesToUpdate;let a=!1;for(let n=0;n<r;n++){const i=t[n];if(a=e[i.renderPipeId].validateRenderable(i),a)break}return s.structureDidChange=a,a}const ht=new g;class _e{constructor(e){this._renderer=e}render({container:e,transform:t}){e.isRenderGroup=!0;const r=e.parent,a=e.renderGroup.renderGroupParent;e.parent=null,e.renderGroup.renderGroupParent=null;const n=this._renderer,i=ge(e.renderGroup,[]);let l=ht;t&&(l=l.copyFrom(e.renderGroup.localTransform),e.renderGroup.localTransform.copyFrom(t));const o=n.renderPipes;for(let d=0;d<i.length;d++){const c=i[d];c.runOnRender(),c.instructionSet.renderPipes=o,c.structureDidChange||ct(c,o),ve(c),c.structureDidChange?(c.structureDidChange=!1,et(c,o)):ft(c),c.childrenRenderablesToUpdate.index=0,n.renderPipes.batch.upload(c.instructionSet)}n.globalUniforms.start({worldTransformMatrix:t?e.renderGroup.localTransform:e.renderGroup.worldTransform,worldColor:e.renderGroup.worldColorAlpha}),pe(e.renderGroup,o),o.uniformBatch&&o.uniformBatch.renderEnd(),t&&e.renderGroup.localTransform.copyFrom(l),e.parent=r,e.renderGroup.renderGroupParent=a}destroy(){this._renderer=null}}_e.extension={type:[u.WebGLSystem,u.WebGPUSystem,u.CanvasSystem],name:"renderGroup"};function ft(s){const{list:e,index:t}=s.childrenRenderablesToUpdate;for(let r=0;r<t;r++){const a=e[r];a.didViewUpdate&&s.updateRenderable(a)}}class ye{constructor(e){this._gpuSpriteHash=Object.create(null),this._renderer=e}addRenderable(e,t){const r=this._getGpuSprite(e);e._didSpriteUpdate&&this._updateBatchableSprite(e,r),this._renderer.renderPipes.batch.addToBatch(r)}updateRenderable(e){const t=this._gpuSpriteHash[e.uid];e._didSpriteUpdate&&this._updateBatchableSprite(e,t),t.batcher.updateElement(t)}validateRenderable(e){const t=e._texture,r=this._getGpuSprite(e);return r.texture._source!==t._source?!r.batcher.checkAndUpdateTexture(r,t):!1}destroyRenderable(e){const t=this._gpuSpriteHash[e.uid];b.return(t),this._gpuSpriteHash[e.uid]=null}_updateBatchableSprite(e,t){e._didSpriteUpdate=!1,t.bounds=e.bounds,t.texture=e._texture}_getGpuSprite(e){return this._gpuSpriteHash[e.uid]||this._initGPUSprite(e)}_initGPUSprite(e){const t=b.get(Ke);return t.renderable=e,t.texture=e._texture,t.bounds=e.bounds,t.roundPixels=this._renderer._roundPixels|e._roundPixels,this._gpuSpriteHash[e.uid]=t,e._didSpriteUpdate=!1,e.on("destroyed",()=>{this.destroyRenderable(e)}),t}destroy(){for(const e in this._gpuSpriteHash)b.return(this._gpuSpriteHash[e]);this._gpuSpriteHash=null,this._renderer=null}}ye.extension={type:[u.WebGLPipes,u.WebGPUPipes,u.CanvasPipes],name:"sprite"};const F=class Te{constructor(){this.clearBeforeRender=!0,this._backgroundColor=new J(0),this.color=this._backgroundColor,this.alpha=1}init(e){e={...Te.defaultOptions,...e},this.clearBeforeRender=e.clearBeforeRender,this.color=e.background||e.backgroundColor||this._backgroundColor,this.alpha=e.backgroundAlpha,this._backgroundColor.setAlpha(e.backgroundAlpha)}get color(){return this._backgroundColor}set color(e){this._backgroundColor.setValue(e)}get alpha(){return this._backgroundColor.alpha}set alpha(e){this._backgroundColor.setAlpha(e)}get colorRgba(){return this._backgroundColor.toArray()}destroy(){}};F.extension={type:[u.WebGLSystem,u.WebGPUSystem,u.CanvasSystem],name:"background",priority:0};F.defaultOptions={backgroundAlpha:1,backgroundColor:0,clearBeforeRender:!0};let pt=F;const y={};X.handle(u.BlendMode,s=>{if(!s.name)throw new Error("BlendMode extension must have a name property");y[s.name]=s.ref},s=>{delete y[s.name]});class ke{constructor(e){this._isAdvanced=!1,this._filterHash=Object.create(null),this._renderer=e}setBlendMode(e,t,r){if(this._activeBlendMode===t){this._isAdvanced&&this._renderableList.push(e);return}this._activeBlendMode=t,this._isAdvanced&&this._endAdvancedBlendMode(r),this._isAdvanced=!!y[t],this._isAdvanced&&(this._beginAdvancedBlendMode(r),this._renderableList.push(e))}_beginAdvancedBlendMode(e){this._renderer.renderPipes.batch.break(e);const t=this._activeBlendMode;if(!y[t]){Y(`Unable to assign BlendMode: '${t}'. You may want to include: import 'pixi.js/advanced-blend-modes'`);return}let r=this._filterHash[t];r||(r=this._filterHash[t]=new K,r.filters=[new y[t]]);const a={renderPipeId:"filter",action:"pushFilter",renderables:[],filterEffect:r,canBundle:!1};this._renderableList=a.renderables,e.add(a)}_endAdvancedBlendMode(e){this._renderableList=null,this._renderer.renderPipes.batch.break(e),e.add({renderPipeId:"filter",action:"popFilter",canBundle:!1})}buildStart(){this._isAdvanced=!1}buildEnd(e){this._isAdvanced&&this._endAdvancedBlendMode(e)}destroy(){this._renderer=null,this._renderableList=null;for(const e in this._filterHash)this._filterHash[e].destroy();this._filterHash=null}}ke.extension={type:[u.WebGLPipes,u.WebGPUPipes,u.CanvasPipes],name:"blendMode"};const R={png:"image/png",jpg:"image/jpeg",webp:"image/webp"},E=class Me{constructor(e){this._renderer=e}_normalizeOptions(e,t={}){return e instanceof S||e instanceof m?{target:e,...t}:{...t,...e}}async image(e){const t=new Image;return t.src=await this.base64(e),t}async base64(e){e=this._normalizeOptions(e,Me.defaultImageOptions);const{format:t,quality:r}=e,a=this.canvas(e);if(a.toBlob!==void 0)return new Promise((n,i)=>{a.toBlob(l=>{if(!l){i(new Error("ICanvas.toBlob failed!"));return}const o=new FileReader;o.onload=()=>n(o.result),o.onerror=i,o.readAsDataURL(l)},R[t],r)});if(a.toDataURL!==void 0)return a.toDataURL(R[t],r);if(a.convertToBlob!==void 0){const n=await a.convertToBlob({type:R[t],quality:r});return new Promise((i,l)=>{const o=new FileReader;o.onload=()=>i(o.result),o.onerror=l,o.readAsDataURL(n)})}throw new Error("Extract.base64() requires ICanvas.toDataURL, ICanvas.toBlob, or ICanvas.convertToBlob to be implemented")}canvas(e){e=this._normalizeOptions(e);const t=e.target,r=this._renderer;if(t instanceof m)return r.texture.generateCanvas(t);const a=r.textureGenerator.generateTexture(e),n=r.texture.generateCanvas(a);return a.destroy(),n}pixels(e){e=this._normalizeOptions(e);const t=e.target,r=this._renderer,a=t instanceof m?t:r.textureGenerator.generateTexture(e),n=r.texture.getPixels(a);return t instanceof S&&a.destroy(),n}texture(e){return e=this._normalizeOptions(e),e.target instanceof m?e.target:this._renderer.textureGenerator.generateTexture(e)}download(e){e=this._normalizeOptions(e);const t=this.canvas(e),r=document.createElement("a");r.download=e.filename??"image.png",r.href=t.toDataURL("image/png"),document.body.appendChild(r),r.click(),document.body.removeChild(r)}log(e){const t=e.width??200;e=this._normalizeOptions(e);const r=this.canvas(e),a=r.toDataURL();console.log(`[Pixi Texture] ${r.width}px ${r.height}px`);const n=["font-size: 1px;",`padding: ${t}px 300px;`,`background: url(${a}) no-repeat;`,"background-size: contain;"].join(" ");console.log("%c ",n)}destroy(){this._renderer=null}};E.extension={type:[u.WebGLSystem,u.WebGPUSystem],name:"extract"};E.defaultImageOptions={format:"png",quality:1};let mt=E;class gt extends m{static create(e){return new m({source:new _(e)})}resize(e,t,r){return this.source.resize(e,t,r),this}}const xt=new w,vt=new q,bt=[0,0,0,0];class Ce{constructor(e){this._renderer=e}generateTexture(e){e instanceof S&&(e={target:e,frame:void 0,textureSourceOptions:{},resolution:void 0});const t=e.resolution||this._renderer.resolution,r=e.antialias||this._renderer.view.antialias,a=e.target;let n=e.clearColor;n?n=Array.isArray(n)&&n.length===4?n:J.shared.setValue(n).toArray():n=bt;const i=e.frame?.copyTo(xt)||Le(a,vt).rectangle;i.width=Math.max(i.width,1/t)|0,i.height=Math.max(i.height,1/t)|0;const l=gt.create({...e.textureSourceOptions,width:i.width,height:i.height,resolution:t,antialias:r}),o=g.shared.translate(-i.x,-i.y);return this._renderer.render({container:a,transform:o,target:l,clearColor:n}),l.source.updateMipmaps(),l}destroy(){this._renderer=null}}Ce.extension={type:[u.WebGLSystem,u.WebGPUSystem],name:"textureGenerator"};class we{constructor(e){this._stackIndex=0,this._globalUniformDataStack=[],this._uniformsPool=[],this._activeUniforms=[],this._bindGroupPool=[],this._activeBindGroups=[],this._renderer=e}reset(){this._stackIndex=0;for(let e=0;e<this._activeUniforms.length;e++)this._uniformsPool.push(this._activeUniforms[e]);for(let e=0;e<this._activeBindGroups.length;e++)this._bindGroupPool.push(this._activeBindGroups[e]);this._activeUniforms.length=0,this._activeBindGroups.length=0}start(e){this.reset(),this.push(e)}bind({size:e,projectionMatrix:t,worldTransformMatrix:r,worldColor:a,offset:n}){const i=this._renderer.renderTarget.renderTarget,l=this._stackIndex?this._globalUniformDataStack[this._stackIndex-1]:{projectionData:i,worldTransformMatrix:new g,worldColor:4294967295,offset:new We},o={projectionMatrix:t||this._renderer.renderTarget.projectionMatrix,resolution:e||i.size,worldTransformMatrix:r||l.worldTransformMatrix,worldColor:a||l.worldColor,offset:n||l.offset,bindGroup:null},d=this._uniformsPool.pop()||this._createUniforms();this._activeUniforms.push(d);const c=d.uniforms;c.uProjectionMatrix=o.projectionMatrix,c.uResolution=o.resolution,c.uWorldTransformMatrix.copyFrom(o.worldTransformMatrix),c.uWorldTransformMatrix.tx-=o.offset.x,c.uWorldTransformMatrix.ty-=o.offset.y,Ye(o.worldColor,c.uWorldColorAlpha,0),d.update();let h;this._renderer.renderPipes.uniformBatch?h=this._renderer.renderPipes.uniformBatch.getUniformBindGroup(d,!1):(h=this._bindGroupPool.pop()||new Ve,this._activeBindGroups.push(h),h.setResource(d,0)),o.bindGroup=h,this._currentGlobalUniformData=o}push(e){this.bind(e),this._globalUniformDataStack[this._stackIndex++]=this._currentGlobalUniformData}pop(){this._currentGlobalUniformData=this._globalUniformDataStack[--this._stackIndex-1],this._renderer.type===se.WEBGL&&this._currentGlobalUniformData.bindGroup.resources[0].update()}get bindGroup(){return this._currentGlobalUniformData.bindGroup}get uniformGroup(){return this._currentGlobalUniformData.bindGroup.resources[0]}_createUniforms(){return new re({uProjectionMatrix:{value:new g,type:"mat3x3<f32>"},uWorldTransformMatrix:{value:new g,type:"mat3x3<f32>"},uWorldColorAlpha:{value:new Float32Array(4),type:"vec4<f32>"},uResolution:{value:[0,0],type:"vec2<f32>"}},{isStatic:!0})}destroy(){this._renderer=null}}we.extension={type:[u.WebGLSystem,u.WebGPUSystem,u.CanvasSystem],name:"globalUniforms"};let $=!1;const N="8.2.0";function _t(s){if(!$){if(Q.get().getNavigator().userAgent.toLowerCase().indexOf("chrome")>-1){const e=[`%c %c %c %c %c PixiJS %c v${N} (${s}) http://www.pixijs.com/
`,"background: #E72264; padding:5px 0;","background: #6CA2EA; padding:5px 0;","background: #B5D33D; padding:5px 0;","background: #FED23F; padding:5px 0;","color: #FFFFFF; background: #E72264; padding:5px 0;","color: #E72264; background: #FFFFFF; padding:5px 0;"];globalThis.console.log(...e)}else globalThis.console&&globalThis.console.log(`PixiJS ${N} - ${s} - http://www.pixijs.com/`);$=!0}}class D{constructor(e){this._renderer=e}init(e){if(e.hello){let t=this._renderer.name;this._renderer.type===se.WEBGL&&(t+=` ${this._renderer.context.webGLVersion}`),bt(t)}}}D.extension={type:[u.WebGLSystem,u.WebGPUSystem,u.CanvasSystem],name:"hello",priority:-2};D.defaultOptions={hello:!1};const O=class Se{constructor(e){this._renderer=e,this.count=0,this.checkCount=0}init(e){e={...Se.defaultOptions,...e},this.checkCountMax=e.textureGCCheckCountMax,this.maxIdle=e.textureGCAMaxIdle,this.active=e.textureGCActive}postrender(){this._renderer.renderingToScreen&&(this.count++,this.active&&(this.checkCount++,this.checkCount>this.checkCountMax&&(this.checkCount=0,this.run())))}run(){const e=this._renderer.texture.managedTextures;for(let t=0;t<e.length;t++){const r=e[t];r.autoGarbageCollect&&r.resource&&r._touched>-1&&this.count-r._touched>this.maxIdle&&(r._touched=-1,r.unload())}}destroy(){this._renderer=null}};O.extension={type:[u.WebGLSystem,u.WebGPUSystem],name:"textureGC"};O.defaultOptions={textureGCActive:!0,textureGCAMaxIdle:60*60,textureGCCheckCountMax:600};let Pe=O;X.add(Pe);const z=class Ge{get resolution(){return this.texture.source._resolution}set resolution(e){this.texture.source.resize(this.texture.source.width,this.texture.source.height,e)}init(e){e={...Ge.defaultOptions,...e},e.view&&(je($e,"ViewSystem.view has been renamed to ViewSystem.canvas"),e.canvas=e.view),this.screen=new w(0,0,e.width,e.height),this.canvas=e.canvas||Q.get().createCanvas(),this.antialias=!!e.antialias,this.texture=de(this.canvas,e),this.renderTarget=new I({colorTextures:[this.texture],depth:!!e.depth,isRoot:!0}),this.texture.source.transparent=e.backgroundAlpha<1,this.multiView=!!e.multiView,this.autoDensity&&(this.canvas.style.width=`${this.texture.width}px`,this.canvas.style.height=`${this.texture.height}px`),this.resolution=e.resolution}resize(e,t,r){this.texture.source.resize(e,t,r),this.screen.width=this.texture.frame.width,this.screen.height=this.texture.frame.height,this.autoDensity&&(this.canvas.style.width=`${e}px`,this.canvas.style.height=`${t}px`)}destroy(e=!1){(typeof e=="boolean"?e:!!e?.removeView)&&this.canvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas)}};z.extension={type:[u.WebGLSystem,u.WebGPUSystem,u.CanvasSystem],name:"view",priority:0};z.defaultOptions={width:800,height:600,autoDensity:!1,antialias:!1};let _t=z;Ut=[ft,we,D,_t,_e,Pe,Ce,pt];At=[ke,ne,ye,me,oe,ue,le,fe]});export{Bt as B,T as G,Rt as R,Ut as S,St as U,At as a,at as b,Pt as c,M as d,wt as e,Ct as f,Mt as t,Gt as u,__tla}; `,"background: #E72264; padding:5px 0;","background: #6CA2EA; padding:5px 0;","background: #B5D33D; padding:5px 0;","background: #FED23F; padding:5px 0;","color: #FFFFFF; background: #E72264; padding:5px 0;","color: #E72264; background: #FFFFFF; padding:5px 0;"];globalThis.console.log(...e)}else globalThis.console&&globalThis.console.log(`PixiJS ${N} - ${s} - http://www.pixijs.com/`);$=!0}}class D{constructor(e){this._renderer=e}init(e){if(e.hello){let t=this._renderer.name;this._renderer.type===se.WEBGL&&(t+=` ${this._renderer.context.webGLVersion}`),_t(t)}}}D.extension={type:[u.WebGLSystem,u.WebGPUSystem,u.CanvasSystem],name:"hello",priority:-2};D.defaultOptions={hello:!1};const O=class Se{constructor(e){this._renderer=e,this.count=0,this.checkCount=0}init(e){e={...Se.defaultOptions,...e},this.checkCountMax=e.textureGCCheckCountMax,this.maxIdle=e.textureGCAMaxIdle,this.active=e.textureGCActive}postrender(){this._renderer.renderingToScreen&&(this.count++,this.active&&(this.checkCount++,this.checkCount>this.checkCountMax&&(this.checkCount=0,this.run())))}run(){const e=this._renderer.texture.managedTextures;for(let t=0;t<e.length;t++){const r=e[t];r.autoGarbageCollect&&r.resource&&r._touched>-1&&this.count-r._touched>this.maxIdle&&(r._touched=-1,r.unload())}}destroy(){this._renderer=null}};O.extension={type:[u.WebGLSystem,u.WebGPUSystem],name:"textureGC"};O.defaultOptions={textureGCActive:!0,textureGCAMaxIdle:60*60,textureGCCheckCountMax:600};let Pe=O;X.add(Pe);const z=class Ge{get resolution(){return this.texture.source._resolution}set resolution(e){this.texture.source.resize(this.texture.source.width,this.texture.source.height,e)}init(e){e={...Ge.defaultOptions,...e},e.view&&(je($e,"ViewSystem.view has been renamed to ViewSystem.canvas"),e.canvas=e.view),this.screen=new w(0,0,e.width,e.height),this.canvas=e.canvas||Q.get().createCanvas(),this.antialias=!!e.antialias,this.texture=de(this.canvas,e),this.renderTarget=new I({colorTextures:[this.texture],depth:!!e.depth,isRoot:!0}),this.texture.source.transparent=e.backgroundAlpha<1,this.multiView=!!e.multiView,this.autoDensity&&(this.canvas.style.width=`${this.texture.width}px`,this.canvas.style.height=`${this.texture.height}px`),this.resolution=e.resolution}resize(e,t,r){this.texture.source.resize(e,t,r),this.screen.width=this.texture.frame.width,this.screen.height=this.texture.frame.height,this.autoDensity&&(this.canvas.style.width=`${e}px`,this.canvas.style.height=`${t}px`)}destroy(e=!1){(typeof e=="boolean"?e:!!e?.removeView)&&this.canvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas)}};z.extension={type:[u.WebGLSystem,u.WebGPUSystem,u.CanvasSystem],name:"view",priority:0};z.defaultOptions={width:800,height:600,autoDensity:!1,antialias:!1};let yt=z;At=[pt,we,D,yt,_e,Pe,Ce,mt,Ne];It=[ke,ne,ye,me,oe,ue,le,fe]});export{Ut as B,T as G,Bt as R,At as S,Pt as U,It as a,nt as b,Gt as c,M as d,St as e,wt as f,Ct as t,Rt as u,__tla};

View File

@@ -1 +1 @@
.spacer[data-v-47f1c669]{margin-left:8px;margin-right:16px}[class*=v-theme--dark-] .selected[data-v-47f1c669]{background-color:rgb(var(--v-theme-surface));filter:brightness(135%)}[class*=v-theme--light-] .selected[data-v-47f1c669]{background-color:rgb(var(--v-theme-surface));filter:brightness(75%)}#_tree-root{font-size:medium;list-style-type:none}#_tree-root div.v-virtual-scroll__item{padding-top:8px}#_tree-root div.v-virtual-scroll__item:first-child{padding-top:0}#_tree-root div.v-virtual-scroll__item:last-child{padding-bottom:8px}canvas[data-v-212dd1f4]{height:100%;width:100%}[class*=v-theme--dark-] .tracker-disabled[data-v-12f0128d]{color:#c6c6c6}[class*=v-theme--dark-] .tracker-not_yet_contacted[data-v-12f0128d]{color:orange}[class*=v-theme--dark-] .tracker-working[data-v-12f0128d]{color:#90ee90}[class*=v-theme--dark-] .tracker-not_working[data-v-12f0128d]{color:#f08080}[class*=v-theme--dark-] .tracker-updating[data-v-12f0128d]{color:#add8e6}[class*=v-theme--light-] .tracker-disabled[data-v-12f0128d]{color:gray}[class*=v-theme--light-] .tracker-not_yet_contacted[data-v-12f0128d]{color:orange}[class*=v-theme--light-] .tracker-working[data-v-12f0128d]{color:green}[class*=v-theme--light-] .tracker-not_working[data-v-12f0128d]{color:red}[class*=v-theme--light-] .tracker-updating[data-v-12f0128d]{color:#1e90ff} .spacer[data-v-47f1c669]{margin-left:8px;margin-right:16px}[class*=v-theme--dark-] .selected[data-v-47f1c669]{background-color:rgb(var(--v-theme-surface));filter:brightness(135%)}[class*=v-theme--light-] .selected[data-v-47f1c669]{background-color:rgb(var(--v-theme-surface));filter:brightness(75%)}#_tree-root{font-size:medium;list-style-type:none}#_tree-root div.v-virtual-scroll__item{padding-top:8px}#_tree-root div.v-virtual-scroll__item:first-child{padding-top:0}#_tree-root div.v-virtual-scroll__item:last-child{padding-bottom:8px}canvas[data-v-2bc530c7]{height:100%;width:100%}[class*=v-theme--dark-] .tracker-disabled[data-v-12f0128d]{color:#c6c6c6}[class*=v-theme--dark-] .tracker-not_yet_contacted[data-v-12f0128d]{color:orange}[class*=v-theme--dark-] .tracker-working[data-v-12f0128d]{color:#90ee90}[class*=v-theme--dark-] .tracker-not_working[data-v-12f0128d]{color:#f08080}[class*=v-theme--dark-] .tracker-updating[data-v-12f0128d]{color:#add8e6}[class*=v-theme--light-] .tracker-disabled[data-v-12f0128d]{color:gray}[class*=v-theme--light-] .tracker-not_yet_contacted[data-v-12f0128d]{color:orange}[class*=v-theme--light-] .tracker-working[data-v-12f0128d]{color:green}[class*=v-theme--light-] .tracker-not_working[data-v-12f0128d]{color:red}[class*=v-theme--light-] .tracker-updating[data-v-12f0128d]{color:#1e90ff}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -1,4 +1,4 @@
import{m as K,E as l,B as A,D as G,w as m,N as Ae,j as S,i as $,S as p,R as H,d as B,M as z,e as v,A as Be,__tla as __tla_0}from"./TorrentDetail-BZZ-B8cw.js";import{S as U,j as O,k as Y,m as q,n as P,b as x,h as Z,f as Ne,U as F,o as Q,R as Ie,__tla as __tla_1}from"./colorToUniform-pFJ8sYB5.js";import{g as J,__tla as __tla_2}from"./getBatchSamplersUniformGroup-PJByx64R.js";import{e as De,G as ye,c as Ce,b as Ge,U as Ue,R as Oe,B as ee,d as N,f as Pe,S as Fe,a as Me,__tla as __tla_3}from"./SharedSystems-xfG8Wu9d.js";import{__tla as __tla_4}from"./MoveTorrentDialog.vue_vue_type_script_setup_true_lang-G1lEzMcG.js";import{__tla as __tla_5}from"./index-DF2-l4SD.js";import"./vue-BQgCUbk_.js";import"./vuetify-DWkLi8Ew.js";import{__tla as __tla_6}from"./MixedButton.vue_vue_type_script_setup_true_lang-QFpliKgB.js";import"./FileIcon-DH65fwz5.js";import{__tla as __tla_7}from"./MoveTorrentFileDialog.vue_vue_type_script_setup_true_lang-DEnRCAW6.js";let wt;let __tla=Promise.all([(()=>{try{return __tla_0}catch{}})(),(()=>{try{return __tla_1}catch{}})(),(()=>{try{return __tla_2}catch{}})(),(()=>{try{return __tla_3}catch{}})(),(()=>{try{return __tla_4}catch{}})(),(()=>{try{return __tla_5}catch{}})(),(()=>{try{return __tla_6}catch{}})(),(()=>{try{return __tla_7}catch{}})()]).then(async()=>{class te{constructor(){this._didUpload=!1,this._tempState=U.for2d()}init(e){const r=K(),s=O({name:"batch",bits:[Y,q(r),P]});this._shader=new x({glProgram:s,resources:{batchSamplers:J(r)}}),e.renderer.runners.contextChange.add(this)}contextChange(){this._didUpload=!1}start(e,r){const s=e.renderer;s.shader.bind(this._shader,this._didUpload),s.shader.updateUniformGroup(s.globalUniforms.uniformGroup),s.geometry.bind(r,this._shader.glProgram)}execute(e,r){const s=e.renderer;this._didUpload=!0,this._tempState.blendMode=r.blendMode,s.state.set(this._tempState);const n=r.textures.textures;for(let i=0;i<n.length;i++)s.texture.bind(n[i],i);s.geometry.draw("triangle-list",r.size,r.start)}destroy(){this._shader.destroy(!0),this._shader=null}}te.extension={type:[l.WebGLPipesAdaptor],name:"batch"};var T=(t=>(t[t.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",t[t.ARRAY_BUFFER=34962]="ARRAY_BUFFER",t[t.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER",t))(T||{});class Le{constructor(e,r){this.buffer=e||null,this.updateID=-1,this.byteLength=-1,this.type=r}}class re{constructor(e){this._gpuBuffers=Object.create(null),this._boundBufferBases=Object.create(null),this._renderer=e}destroy(){this._renderer=null,this._gl=null,this._gpuBuffers=null,this._boundBufferBases=null}contextChange(){this._gpuBuffers=Object.create(null),this._gl=this._renderer.gl}getGlBuffer(e){return this._gpuBuffers[e.uid]||this.createGLBuffer(e)}bind(e){const{_gl:r}=this,s=this.getGlBuffer(e);r.bindBuffer(s.type,s.buffer)}bindBufferBase(e,r){const{_gl:s}=this;if(this._boundBufferBases[r]!==e){const n=this.getGlBuffer(e);this._boundBufferBases[r]=e,s.bindBufferBase(s.UNIFORM_BUFFER,r,n.buffer)}}bindBufferRange(e,r,s){const{_gl:n}=this;s=s||0;const i=this.getGlBuffer(e);n.bindBufferRange(n.UNIFORM_BUFFER,r||0,i.buffer,s*256,256)}updateBuffer(e){const{_gl:r}=this,s=this.getGlBuffer(e);if(e._updateID===s.updateID)return s;s.updateID=e._updateID,r.bindBuffer(s.type,s.buffer);const n=e.data;if(s.byteLength>=e.data.byteLength)r.bufferSubData(s.type,0,n,0,e._updateSize/n.BYTES_PER_ELEMENT);else{const i=e.descriptor.usage&A.STATIC?r.STATIC_DRAW:r.DYNAMIC_DRAW;s.byteLength=n.byteLength,r.bufferData(s.type,n,i)}return s}destroyAll(){const e=this._gl;for(const r in this._gpuBuffers)e.deleteBuffer(this._gpuBuffers[r].buffer);this._gpuBuffers=Object.create(null)}onBufferDestroy(e,r){const s=this._gpuBuffers[e.uid],n=this._gl;r||n.deleteBuffer(s.buffer),this._gpuBuffers[e.uid]=null}createGLBuffer(e){const{_gl:r}=this;let s=T.ARRAY_BUFFER;e.descriptor.usage&A.INDEX?s=T.ELEMENT_ARRAY_BUFFER:e.descriptor.usage&A.UNIFORM&&(s=T.UNIFORM_BUFFER);const n=new Le(r.createBuffer(),s);return this._gpuBuffers[e.uid]=n,e.on("destroy",this.onBufferDestroy,this),n}}re.extension={type:[l.WebGLSystem],name:"buffer"};const M=class se{constructor(e){this.supports={uint32Indices:!0,uniformBufferObject:!0,vertexArrayObject:!0,srgbTextures:!0,nonPowOf2wrapping:!0,msaa:!0,nonPowOf2mipmaps:!0},this._renderer=e,this.extensions=Object.create(null),this.handleContextLost=this.handleContextLost.bind(this),this.handleContextRestored=this.handleContextRestored.bind(this)}get isLost(){return!this.gl||this.gl.isContextLost()}contextChange(e){this.gl=e,this._renderer.gl=e}init(e){if(e={...se.defaultOptions,...e},e.context)this.initFromContext(e.context);else{const r=this._renderer.background.alpha<1,s=e.premultipliedAlpha??!0,n=e.antialias&&!this._renderer.backBuffer.useBackBuffer;this.createContext(e.preferWebGLVersion,{alpha:r,premultipliedAlpha:s,antialias:n,stencil:!0,preserveDrawingBuffer:e.preserveDrawingBuffer,powerPreference:e.powerPreference??"default"})}}initFromContext(e){this.gl=e,this.webGLVersion=e instanceof G.get().getWebGLRenderingContext()?1:2,this.getExtensions(),this.validateContext(e),this._renderer.runners.contextChange.emit(e);const r=this._renderer.view.canvas;r.addEventListener("webglcontextlost",this.handleContextLost,!1),r.addEventListener("webglcontextrestored",this.handleContextRestored,!1)}createContext(e,r){let s;const n=this._renderer.view.canvas;if(e===2&&(s=n.getContext("webgl2",r)),!s&&(s=n.getContext("webgl",r),!s))throw new Error("This browser does not support WebGL. Try using the canvas renderer");this.gl=s,this.initFromContext(this.gl)}getExtensions(){const{gl:e}=this,r={anisotropicFiltering:e.getExtension("EXT_texture_filter_anisotropic"),floatTextureLinear:e.getExtension("OES_texture_float_linear"),s3tc:e.getExtension("WEBGL_compressed_texture_s3tc"),s3tc_sRGB:e.getExtension("WEBGL_compressed_texture_s3tc_srgb"),etc:e.getExtension("WEBGL_compressed_texture_etc"),etc1:e.getExtension("WEBGL_compressed_texture_etc1"),pvrtc:e.getExtension("WEBGL_compressed_texture_pvrtc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),atc:e.getExtension("WEBGL_compressed_texture_atc"),astc:e.getExtension("WEBGL_compressed_texture_astc"),bptc:e.getExtension("EXT_texture_compression_bptc"),rgtc:e.getExtension("EXT_texture_compression_rgtc"),loseContext:e.getExtension("WEBGL_lose_context")};if(this.webGLVersion===1)this.extensions={...r,drawBuffers:e.getExtension("WEBGL_draw_buffers"),depthTexture:e.getExtension("WEBGL_depth_texture"),vertexArrayObject:e.getExtension("OES_vertex_array_object")||e.getExtension("MOZ_OES_vertex_array_object")||e.getExtension("WEBKIT_OES_vertex_array_object"),uint32ElementIndex:e.getExtension("OES_element_index_uint"),floatTexture:e.getExtension("OES_texture_float"),floatTextureLinear:e.getExtension("OES_texture_float_linear"),textureHalfFloat:e.getExtension("OES_texture_half_float"),textureHalfFloatLinear:e.getExtension("OES_texture_half_float_linear"),vertexAttribDivisorANGLE:e.getExtension("ANGLE_instanced_arrays"),srgb:e.getExtension("EXT_sRGB")};else{this.extensions={...r,colorBufferFloat:e.getExtension("EXT_color_buffer_float")};const s=e.getExtension("WEBGL_provoking_vertex");s&&s.provokingVertexWEBGL(s.FIRST_VERTEX_CONVENTION_WEBGL)}}handleContextLost(e){e.preventDefault(),this._contextLossForced&&(this._contextLossForced=!1,setTimeout(()=>{this.gl.isContextLost()&&this.extensions.loseContext?.restoreContext()},0))}handleContextRestored(){this._renderer.runners.contextChange.emit(this.gl)}destroy(){const e=this._renderer.view.canvas;this._renderer=null,e.removeEventListener("webglcontextlost",this.handleContextLost),e.removeEventListener("webglcontextrestored",this.handleContextRestored),this.gl.useProgram(null),this.extensions.loseContext?.loseContext()}forceContextLoss(){this.extensions.loseContext?.loseContext(),this._contextLossForced=!0}validateContext(e){const r=e.getContextAttributes();r&&!r.stencil&&m("Provided WebGL context does not have a stencil buffer, masks may not render correctly");const s=this.supports,n=this.webGLVersion===2,i=this.extensions;s.uint32Indices=n||!!i.uint32ElementIndex,s.uniformBufferObject=n,s.vertexArrayObject=n||!!i.vertexArrayObject,s.srgbTextures=n||!!i.srgb,s.nonPowOf2wrapping=n,s.nonPowOf2mipmaps=n,s.msaa=n,s.uint32Indices||m("Provided WebGL context does not support 32 index buffer, large scenes may not render correctly")}};M.extension={type:[l.WebGLSystem],name:"context"};M.defaultOptions={context:null,premultipliedAlpha:!0,preserveDrawingBuffer:!1,powerPreference:void 0,preferWebGLVersion:2};let He=M;var y=(t=>(t[t.RGBA=6408]="RGBA",t[t.RGB=6407]="RGB",t[t.RG=33319]="RG",t[t.RED=6403]="RED",t[t.RGBA_INTEGER=36249]="RGBA_INTEGER",t[t.RGB_INTEGER=36248]="RGB_INTEGER",t[t.RG_INTEGER=33320]="RG_INTEGER",t[t.RED_INTEGER=36244]="RED_INTEGER",t[t.ALPHA=6406]="ALPHA",t[t.LUMINANCE=6409]="LUMINANCE",t[t.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",t[t.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",t[t.DEPTH_STENCIL=34041]="DEPTH_STENCIL",t))(y||{}),ne=(t=>(t[t.TEXTURE_2D=3553]="TEXTURE_2D",t[t.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",t[t.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY",t[t.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",t[t.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",t[t.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",t[t.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z",t))(ne||{}),f=(t=>(t[t.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",t[t.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",t[t.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",t[t.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",t[t.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",t[t.UNSIGNED_INT=5125]="UNSIGNED_INT",t[t.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV",t[t.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV",t[t.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8",t[t.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV",t[t.BYTE=5120]="BYTE",t[t.SHORT=5122]="SHORT",t[t.INT=5124]="INT",t[t.FLOAT=5126]="FLOAT",t[t.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV",t[t.HALF_FLOAT=36193]="HALF_FLOAT",t))(f||{});const w={uint8x2:f.UNSIGNED_BYTE,uint8x4:f.UNSIGNED_BYTE,sint8x2:f.BYTE,sint8x4:f.BYTE,unorm8x2:f.UNSIGNED_BYTE,unorm8x4:f.UNSIGNED_BYTE,snorm8x2:f.BYTE,snorm8x4:f.BYTE,uint16x2:f.UNSIGNED_SHORT,uint16x4:f.UNSIGNED_SHORT,sint16x2:f.SHORT,sint16x4:f.SHORT,unorm16x2:f.UNSIGNED_SHORT,unorm16x4:f.UNSIGNED_SHORT,snorm16x2:f.SHORT,snorm16x4:f.SHORT,float16x2:f.HALF_FLOAT,float16x4:f.HALF_FLOAT,float32:f.FLOAT,float32x2:f.FLOAT,float32x3:f.FLOAT,float32x4:f.FLOAT,uint32:f.UNSIGNED_INT,uint32x2:f.UNSIGNED_INT,uint32x3:f.UNSIGNED_INT,uint32x4:f.UNSIGNED_INT,sint32:f.INT,sint32x2:f.INT,sint32x3:f.INT,sint32x4:f.INT};function we(t){return w[t]??w.float32}const Ve={"point-list":0,"line-list":1,"line-strip":3,"triangle-list":4,"triangle-strip":5};class ie{constructor(e){this._geometryVaoHash=Object.create(null),this._renderer=e,this._activeGeometry=null,this._activeVao=null,this.hasVao=!0,this.hasInstance=!0}contextChange(){const e=this.gl=this._renderer.gl;if(!this._renderer.context.supports.vertexArrayObject)throw new Error("[PixiJS] Vertex Array Objects are not supported on this device");const r=this._renderer.context.extensions.vertexArrayObject;r&&(e.createVertexArray=()=>r.createVertexArrayOES(),e.bindVertexArray=n=>r.bindVertexArrayOES(n),e.deleteVertexArray=n=>r.deleteVertexArrayOES(n));const s=this._renderer.context.extensions.vertexAttribDivisorANGLE;s&&(e.drawArraysInstanced=(n,i,a,o)=>{s.drawArraysInstancedANGLE(n,i,a,o)},e.drawElementsInstanced=(n,i,a,o,c)=>{s.drawElementsInstancedANGLE(n,i,a,o,c)},e.vertexAttribDivisor=(n,i)=>s.vertexAttribDivisorANGLE(n,i)),this._activeGeometry=null,this._activeVao=null,this._geometryVaoHash=Object.create(null)}bind(e,r){const s=this.gl;this._activeGeometry=e;const n=this.getVao(e,r);this._activeVao!==n&&(this._activeVao=n,s.bindVertexArray(n)),this.updateBuffers()}reset(){this.unbind()}updateBuffers(){const e=this._activeGeometry,r=this._renderer.buffer;for(let s=0;s<e.buffers.length;s++){const n=e.buffers[s];r.updateBuffer(n)}}checkCompatibility(e,r){const s=e.attributes,n=r._attributeData;for(const i in n)if(!s[i])throw new Error(`shader and geometry incompatible, geometry missing the "${i}" attribute`)}getSignature(e,r){const s=e.attributes,n=r._attributeData,i=["g",e.uid];for(const a in s)n[a]&&i.push(a,n[a].location);return i.join("-")}getVao(e,r){return this._geometryVaoHash[e.uid]?.[r._key]||this.initGeometryVao(e,r)}initGeometryVao(e,r,s=!0){const n=this._renderer.gl,i=this._renderer.buffer;this._renderer.shader._getProgramData(r),this.checkCompatibility(e,r);const a=this.getSignature(e,r);this._geometryVaoHash[e.uid]||(this._geometryVaoHash[e.uid]=Object.create(null),e.on("destroy",this.onGeometryDestroy,this));const o=this._geometryVaoHash[e.uid];let c=o[a];if(c)return o[r._key]=c,c;De(e,r._attributeData);const u=e.buffers;c=n.createVertexArray(),n.bindVertexArray(c);for(let _=0;_<u.length;_++){const h=u[_];i.bind(h)}return this.activateVao(e,r),o[r._key]=c,o[a]=c,n.bindVertexArray(null),c}onGeometryDestroy(e,r){const s=this._geometryVaoHash[e.uid],n=this.gl;if(s){if(r)for(const i in s)this._activeVao!==s[i]&&this.unbind(),n.deleteVertexArray(s[i]);this._geometryVaoHash[e.uid]=null}}destroyAll(e=!1){const r=this.gl;for(const s in this._geometryVaoHash){if(e)for(const n in this._geometryVaoHash[s]){const i=this._geometryVaoHash[s];this._activeVao!==i&&this.unbind(),r.deleteVertexArray(i[n])}this._geometryVaoHash[s]=null}}activateVao(e,r){const s=this._renderer.gl,n=this._renderer.buffer,i=e.attributes;e.indexBuffer&&n.bind(e.indexBuffer);let a=null;for(const o in i){const c=i[o],u=c.buffer,_=n.getGlBuffer(u),h=r._attributeData[o];if(h){a!==_&&(n.bind(u),a=_);const d=c.location;s.enableVertexAttribArray(d);const E=Z(c.format),b=we(c.format);if(h.format?.substring(1,4)==="int"?s.vertexAttribIPointer(d,E.size,b,c.stride,c.offset):s.vertexAttribPointer(d,E.size,b,E.normalised,c.stride,c.offset),c.instance)if(this.hasInstance)s.vertexAttribDivisor(d,1);else throw new Error("geometry error, GPU Instancing is not supported on this device")}}}draw(e,r,s,n){const{gl:i}=this._renderer,a=this._activeGeometry,o=Ve[a.topology||e];if(n||(n=a.instanceCount),a.indexBuffer){const c=a.indexBuffer.data.BYTES_PER_ELEMENT,u=c===2?i.UNSIGNED_SHORT:i.UNSIGNED_INT;n>1?i.drawElementsInstanced(o,r||a.indexBuffer.data.length,u,(s||0)*c,n):i.drawElements(o,r||a.indexBuffer.data.length,u,(s||0)*c)}else n>1?i.drawArraysInstanced(o,s||0,r||a.getSize(),n):i.drawArrays(o,s||0,r||a.getSize());return this}unbind(){this.gl.bindVertexArray(null),this._activeVao=null,this._activeGeometry=null}destroy(){this._renderer=null,this.gl=null,this._activeVao=null,this._activeGeometry=null}}ie.extension={type:[l.WebGLSystem],name:"geometry"};const ke=new Ae({attributes:{aPosition:[-1,-1,3,-1,-1,3]}}),L=class ae{constructor(e){this.useBackBuffer=!1,this._useBackBufferThisRender=!1,this._renderer=e}init(e={}){const{useBackBuffer:r,antialias:s}={...ae.defaultOptions,...e};this.useBackBuffer=r,this._antialias=s,this._renderer.context.supports.msaa||(m("antialiasing, is not supported on when using the back buffer"),this._antialias=!1),this._state=U.for2d();const n=new Ne({vertex:` import{g as K,E as l,B,D as G,w as m,O as Ae,k as S,j as $,S as p,R as H,h as A,M as z,e as v,A as Ne,__tla as __tla_0}from"./TorrentDetail-CKmHZcwa.js";import{S as U,j as O,k as Y,m as q,n as P,b as x,h as Z,f as Ie,U as F,o as Q,R as ye,__tla as __tla_1}from"./colorToUniform-rMRo2qOn.js";import{g as J,__tla as __tla_2}from"./getBatchSamplersUniformGroup-B1Z3BKU1.js";import{e as De,G as Ce,c as Ge,b as Ue,U as Oe,R as Pe,B as ee,d as N,f as Fe,S as Me,a as Le,__tla as __tla_3}from"./SharedSystems-Bg8GzrJB.js";import{__tla as __tla_4}from"./ColoredChip.vue_vue_type_script_setup_true_lang-CBDbhtDT.js";import{__tla as __tla_5}from"./index-C0tfT_Qc.js";import"./vue-CfSjRv-x.js";import"./vuetify-PctCzU6r.js";import{__tla as __tla_6}from"./MixedButton.vue_vue_type_script_setup_true_lang-Br4NUWtV.js";import"./FileIcon-DH65fwz5.js";import{__tla as __tla_7}from"./MoveTorrentFileDialog.vue_vue_type_script_setup_true_lang-C8uA-x2z.js";let kt;let __tla=Promise.all([(()=>{try{return __tla_0}catch{}})(),(()=>{try{return __tla_1}catch{}})(),(()=>{try{return __tla_2}catch{}})(),(()=>{try{return __tla_3}catch{}})(),(()=>{try{return __tla_4}catch{}})(),(()=>{try{return __tla_5}catch{}})(),(()=>{try{return __tla_6}catch{}})(),(()=>{try{return __tla_7}catch{}})()]).then(async()=>{class te{constructor(){this._didUpload=!1,this._tempState=U.for2d()}init(e){const r=K(),s=O({name:"batch",bits:[Y,q(r),P]});this._shader=new x({glProgram:s,resources:{batchSamplers:J(r)}}),e.renderer.runners.contextChange.add(this)}contextChange(){this._didUpload=!1}start(e,r){const s=e.renderer;s.shader.bind(this._shader,this._didUpload),s.shader.updateUniformGroup(s.globalUniforms.uniformGroup),s.geometry.bind(r,this._shader.glProgram)}execute(e,r){const s=e.renderer;this._didUpload=!0,this._tempState.blendMode=r.blendMode,s.state.set(this._tempState);const n=r.textures.textures;for(let i=0;i<n.length;i++)s.texture.bind(n[i],i);s.geometry.draw("triangle-list",r.size,r.start)}destroy(){this._shader.destroy(!0),this._shader=null}}te.extension={type:[l.WebGLPipesAdaptor],name:"batch"};var T=(t=>(t[t.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",t[t.ARRAY_BUFFER=34962]="ARRAY_BUFFER",t[t.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER",t))(T||{});class He{constructor(e,r){this.buffer=e||null,this.updateID=-1,this.byteLength=-1,this.type=r}}class re{constructor(e){this._gpuBuffers=Object.create(null),this._boundBufferBases=Object.create(null),this._renderer=e}destroy(){this._renderer=null,this._gl=null,this._gpuBuffers=null,this._boundBufferBases=null}contextChange(){this._gpuBuffers=Object.create(null),this._gl=this._renderer.gl}getGlBuffer(e){return this._gpuBuffers[e.uid]||this.createGLBuffer(e)}bind(e){const{_gl:r}=this,s=this.getGlBuffer(e);r.bindBuffer(s.type,s.buffer)}bindBufferBase(e,r){const{_gl:s}=this;if(this._boundBufferBases[r]!==e){const n=this.getGlBuffer(e);this._boundBufferBases[r]=e,s.bindBufferBase(s.UNIFORM_BUFFER,r,n.buffer)}}bindBufferRange(e,r,s){const{_gl:n}=this;s=s||0;const i=this.getGlBuffer(e);n.bindBufferRange(n.UNIFORM_BUFFER,r||0,i.buffer,s*256,256)}updateBuffer(e){const{_gl:r}=this,s=this.getGlBuffer(e);if(e._updateID===s.updateID)return s;s.updateID=e._updateID,r.bindBuffer(s.type,s.buffer);const n=e.data;if(s.byteLength>=e.data.byteLength)r.bufferSubData(s.type,0,n,0,e._updateSize/n.BYTES_PER_ELEMENT);else{const i=e.descriptor.usage&B.STATIC?r.STATIC_DRAW:r.DYNAMIC_DRAW;s.byteLength=n.byteLength,r.bufferData(s.type,n,i)}return s}destroyAll(){const e=this._gl;for(const r in this._gpuBuffers)e.deleteBuffer(this._gpuBuffers[r].buffer);this._gpuBuffers=Object.create(null)}onBufferDestroy(e,r){const s=this._gpuBuffers[e.uid],n=this._gl;r||n.deleteBuffer(s.buffer),this._gpuBuffers[e.uid]=null}createGLBuffer(e){const{_gl:r}=this;let s=T.ARRAY_BUFFER;e.descriptor.usage&B.INDEX?s=T.ELEMENT_ARRAY_BUFFER:e.descriptor.usage&B.UNIFORM&&(s=T.UNIFORM_BUFFER);const n=new He(r.createBuffer(),s);return this._gpuBuffers[e.uid]=n,e.on("destroy",this.onBufferDestroy,this),n}}re.extension={type:[l.WebGLSystem],name:"buffer"};const M=class se{constructor(e){this.supports={uint32Indices:!0,uniformBufferObject:!0,vertexArrayObject:!0,srgbTextures:!0,nonPowOf2wrapping:!0,msaa:!0,nonPowOf2mipmaps:!0},this._renderer=e,this.extensions=Object.create(null),this.handleContextLost=this.handleContextLost.bind(this),this.handleContextRestored=this.handleContextRestored.bind(this)}get isLost(){return!this.gl||this.gl.isContextLost()}contextChange(e){this.gl=e,this._renderer.gl=e}init(e){if(e={...se.defaultOptions,...e},e.context)this.initFromContext(e.context);else{const r=this._renderer.background.alpha<1,s=e.premultipliedAlpha??!0,n=e.antialias&&!this._renderer.backBuffer.useBackBuffer;this.createContext(e.preferWebGLVersion,{alpha:r,premultipliedAlpha:s,antialias:n,stencil:!0,preserveDrawingBuffer:e.preserveDrawingBuffer,powerPreference:e.powerPreference??"default"})}}initFromContext(e){this.gl=e,this.webGLVersion=e instanceof G.get().getWebGLRenderingContext()?1:2,this.getExtensions(),this.validateContext(e),this._renderer.runners.contextChange.emit(e);const r=this._renderer.view.canvas;r.addEventListener("webglcontextlost",this.handleContextLost,!1),r.addEventListener("webglcontextrestored",this.handleContextRestored,!1)}createContext(e,r){let s;const n=this._renderer.view.canvas;if(e===2&&(s=n.getContext("webgl2",r)),!s&&(s=n.getContext("webgl",r),!s))throw new Error("This browser does not support WebGL. Try using the canvas renderer");this.gl=s,this.initFromContext(this.gl)}getExtensions(){const{gl:e}=this,r={anisotropicFiltering:e.getExtension("EXT_texture_filter_anisotropic"),floatTextureLinear:e.getExtension("OES_texture_float_linear"),s3tc:e.getExtension("WEBGL_compressed_texture_s3tc"),s3tc_sRGB:e.getExtension("WEBGL_compressed_texture_s3tc_srgb"),etc:e.getExtension("WEBGL_compressed_texture_etc"),etc1:e.getExtension("WEBGL_compressed_texture_etc1"),pvrtc:e.getExtension("WEBGL_compressed_texture_pvrtc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),atc:e.getExtension("WEBGL_compressed_texture_atc"),astc:e.getExtension("WEBGL_compressed_texture_astc"),bptc:e.getExtension("EXT_texture_compression_bptc"),rgtc:e.getExtension("EXT_texture_compression_rgtc"),loseContext:e.getExtension("WEBGL_lose_context")};if(this.webGLVersion===1)this.extensions={...r,drawBuffers:e.getExtension("WEBGL_draw_buffers"),depthTexture:e.getExtension("WEBGL_depth_texture"),vertexArrayObject:e.getExtension("OES_vertex_array_object")||e.getExtension("MOZ_OES_vertex_array_object")||e.getExtension("WEBKIT_OES_vertex_array_object"),uint32ElementIndex:e.getExtension("OES_element_index_uint"),floatTexture:e.getExtension("OES_texture_float"),floatTextureLinear:e.getExtension("OES_texture_float_linear"),textureHalfFloat:e.getExtension("OES_texture_half_float"),textureHalfFloatLinear:e.getExtension("OES_texture_half_float_linear"),vertexAttribDivisorANGLE:e.getExtension("ANGLE_instanced_arrays"),srgb:e.getExtension("EXT_sRGB")};else{this.extensions={...r,colorBufferFloat:e.getExtension("EXT_color_buffer_float")};const s=e.getExtension("WEBGL_provoking_vertex");s&&s.provokingVertexWEBGL(s.FIRST_VERTEX_CONVENTION_WEBGL)}}handleContextLost(e){e.preventDefault(),this._contextLossForced&&(this._contextLossForced=!1,setTimeout(()=>{this.gl.isContextLost()&&this.extensions.loseContext?.restoreContext()},0))}handleContextRestored(){this._renderer.runners.contextChange.emit(this.gl)}destroy(){const e=this._renderer.view.canvas;this._renderer=null,e.removeEventListener("webglcontextlost",this.handleContextLost),e.removeEventListener("webglcontextrestored",this.handleContextRestored),this.gl.useProgram(null),this.extensions.loseContext?.loseContext()}forceContextLoss(){this.extensions.loseContext?.loseContext(),this._contextLossForced=!0}validateContext(e){const r=e.getContextAttributes();r&&!r.stencil&&m("Provided WebGL context does not have a stencil buffer, masks may not render correctly");const s=this.supports,n=this.webGLVersion===2,i=this.extensions;s.uint32Indices=n||!!i.uint32ElementIndex,s.uniformBufferObject=n,s.vertexArrayObject=n||!!i.vertexArrayObject,s.srgbTextures=n||!!i.srgb,s.nonPowOf2wrapping=n,s.nonPowOf2mipmaps=n,s.msaa=n,s.uint32Indices||m("Provided WebGL context does not support 32 index buffer, large scenes may not render correctly")}};M.extension={type:[l.WebGLSystem],name:"context"};M.defaultOptions={context:null,premultipliedAlpha:!0,preserveDrawingBuffer:!1,powerPreference:void 0,preferWebGLVersion:2};let we=M;var D=(t=>(t[t.RGBA=6408]="RGBA",t[t.RGB=6407]="RGB",t[t.RG=33319]="RG",t[t.RED=6403]="RED",t[t.RGBA_INTEGER=36249]="RGBA_INTEGER",t[t.RGB_INTEGER=36248]="RGB_INTEGER",t[t.RG_INTEGER=33320]="RG_INTEGER",t[t.RED_INTEGER=36244]="RED_INTEGER",t[t.ALPHA=6406]="ALPHA",t[t.LUMINANCE=6409]="LUMINANCE",t[t.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",t[t.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",t[t.DEPTH_STENCIL=34041]="DEPTH_STENCIL",t))(D||{}),ne=(t=>(t[t.TEXTURE_2D=3553]="TEXTURE_2D",t[t.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",t[t.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY",t[t.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",t[t.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",t[t.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",t[t.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z",t))(ne||{}),f=(t=>(t[t.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",t[t.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",t[t.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",t[t.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",t[t.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",t[t.UNSIGNED_INT=5125]="UNSIGNED_INT",t[t.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV",t[t.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV",t[t.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8",t[t.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV",t[t.BYTE=5120]="BYTE",t[t.SHORT=5122]="SHORT",t[t.INT=5124]="INT",t[t.FLOAT=5126]="FLOAT",t[t.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV",t[t.HALF_FLOAT=36193]="HALF_FLOAT",t))(f||{});const w={uint8x2:f.UNSIGNED_BYTE,uint8x4:f.UNSIGNED_BYTE,sint8x2:f.BYTE,sint8x4:f.BYTE,unorm8x2:f.UNSIGNED_BYTE,unorm8x4:f.UNSIGNED_BYTE,snorm8x2:f.BYTE,snorm8x4:f.BYTE,uint16x2:f.UNSIGNED_SHORT,uint16x4:f.UNSIGNED_SHORT,sint16x2:f.SHORT,sint16x4:f.SHORT,unorm16x2:f.UNSIGNED_SHORT,unorm16x4:f.UNSIGNED_SHORT,snorm16x2:f.SHORT,snorm16x4:f.SHORT,float16x2:f.HALF_FLOAT,float16x4:f.HALF_FLOAT,float32:f.FLOAT,float32x2:f.FLOAT,float32x3:f.FLOAT,float32x4:f.FLOAT,uint32:f.UNSIGNED_INT,uint32x2:f.UNSIGNED_INT,uint32x3:f.UNSIGNED_INT,uint32x4:f.UNSIGNED_INT,sint32:f.INT,sint32x2:f.INT,sint32x3:f.INT,sint32x4:f.INT};function ke(t){return w[t]??w.float32}const Ve={"point-list":0,"line-list":1,"line-strip":3,"triangle-list":4,"triangle-strip":5};class ie{constructor(e){this._geometryVaoHash=Object.create(null),this._renderer=e,this._activeGeometry=null,this._activeVao=null,this.hasVao=!0,this.hasInstance=!0}contextChange(){const e=this.gl=this._renderer.gl;if(!this._renderer.context.supports.vertexArrayObject)throw new Error("[PixiJS] Vertex Array Objects are not supported on this device");const r=this._renderer.context.extensions.vertexArrayObject;r&&(e.createVertexArray=()=>r.createVertexArrayOES(),e.bindVertexArray=n=>r.bindVertexArrayOES(n),e.deleteVertexArray=n=>r.deleteVertexArrayOES(n));const s=this._renderer.context.extensions.vertexAttribDivisorANGLE;s&&(e.drawArraysInstanced=(n,i,a,o)=>{s.drawArraysInstancedANGLE(n,i,a,o)},e.drawElementsInstanced=(n,i,a,o,c)=>{s.drawElementsInstancedANGLE(n,i,a,o,c)},e.vertexAttribDivisor=(n,i)=>s.vertexAttribDivisorANGLE(n,i)),this._activeGeometry=null,this._activeVao=null,this._geometryVaoHash=Object.create(null)}bind(e,r){const s=this.gl;this._activeGeometry=e;const n=this.getVao(e,r);this._activeVao!==n&&(this._activeVao=n,s.bindVertexArray(n)),this.updateBuffers()}reset(){this.unbind()}updateBuffers(){const e=this._activeGeometry,r=this._renderer.buffer;for(let s=0;s<e.buffers.length;s++){const n=e.buffers[s];r.updateBuffer(n)}}checkCompatibility(e,r){const s=e.attributes,n=r._attributeData;for(const i in n)if(!s[i])throw new Error(`shader and geometry incompatible, geometry missing the "${i}" attribute`)}getSignature(e,r){const s=e.attributes,n=r._attributeData,i=["g",e.uid];for(const a in s)n[a]&&i.push(a,n[a].location);return i.join("-")}getVao(e,r){return this._geometryVaoHash[e.uid]?.[r._key]||this.initGeometryVao(e,r)}initGeometryVao(e,r,s=!0){const n=this._renderer.gl,i=this._renderer.buffer;this._renderer.shader._getProgramData(r),this.checkCompatibility(e,r);const a=this.getSignature(e,r);this._geometryVaoHash[e.uid]||(this._geometryVaoHash[e.uid]=Object.create(null),e.on("destroy",this.onGeometryDestroy,this));const o=this._geometryVaoHash[e.uid];let c=o[a];if(c)return o[r._key]=c,c;De(e,r._attributeData);const u=e.buffers;c=n.createVertexArray(),n.bindVertexArray(c);for(let _=0;_<u.length;_++){const h=u[_];i.bind(h)}return this.activateVao(e,r),o[r._key]=c,o[a]=c,n.bindVertexArray(null),c}onGeometryDestroy(e,r){const s=this._geometryVaoHash[e.uid],n=this.gl;if(s){if(r)for(const i in s)this._activeVao!==s[i]&&this.unbind(),n.deleteVertexArray(s[i]);this._geometryVaoHash[e.uid]=null}}destroyAll(e=!1){const r=this.gl;for(const s in this._geometryVaoHash){if(e)for(const n in this._geometryVaoHash[s]){const i=this._geometryVaoHash[s];this._activeVao!==i&&this.unbind(),r.deleteVertexArray(i[n])}this._geometryVaoHash[s]=null}}activateVao(e,r){const s=this._renderer.gl,n=this._renderer.buffer,i=e.attributes;e.indexBuffer&&n.bind(e.indexBuffer);let a=null;for(const o in i){const c=i[o],u=c.buffer,_=n.getGlBuffer(u),h=r._attributeData[o];if(h){a!==_&&(n.bind(u),a=_);const d=c.location;s.enableVertexAttribArray(d);const E=Z(c.format),b=ke(c.format);if(h.format?.substring(1,4)==="int"?s.vertexAttribIPointer(d,E.size,b,c.stride,c.offset):s.vertexAttribPointer(d,E.size,b,E.normalised,c.stride,c.offset),c.instance)if(this.hasInstance){const Be=c.divisor??1;s.vertexAttribDivisor(d,Be)}else throw new Error("geometry error, GPU Instancing is not supported on this device")}}}draw(e,r,s,n){const{gl:i}=this._renderer,a=this._activeGeometry,o=Ve[a.topology||e];if(n||(n=a.instanceCount),a.indexBuffer){const c=a.indexBuffer.data.BYTES_PER_ELEMENT,u=c===2?i.UNSIGNED_SHORT:i.UNSIGNED_INT;n>1?i.drawElementsInstanced(o,r||a.indexBuffer.data.length,u,(s||0)*c,n):i.drawElements(o,r||a.indexBuffer.data.length,u,(s||0)*c)}else n>1?i.drawArraysInstanced(o,s||0,r||a.getSize(),n):i.drawArrays(o,s||0,r||a.getSize());return this}unbind(){this.gl.bindVertexArray(null),this._activeVao=null,this._activeGeometry=null}destroy(){this._renderer=null,this.gl=null,this._activeVao=null,this._activeGeometry=null}}ie.extension={type:[l.WebGLSystem],name:"geometry"};const Xe=new Ae({attributes:{aPosition:[-1,-1,3,-1,-1,3]}}),L=class ae{constructor(e){this.useBackBuffer=!1,this._useBackBufferThisRender=!1,this._renderer=e}init(e={}){const{useBackBuffer:r,antialias:s}={...ae.defaultOptions,...e};this.useBackBuffer=r,this._antialias=s,this._renderer.context.supports.msaa||(m("antialiasing, is not supported on when using the back buffer"),this._antialias=!1),this._state=U.for2d();const n=new Ie({vertex:`
attribute vec2 aPosition; attribute vec2 aPosition;
out vec2 vUv; out vec2 vUv;
@@ -17,7 +17,7 @@ import{m as K,E as l,B as A,D as G,w as m,N as Ae,j as S,i as $,S as p,R as H,d
void main() { void main() {
finalColor = texture(uTexture, vUv); finalColor = texture(uTexture, vUv);
}`,name:"big-triangle"});this._bigTriangleShader=new x({glProgram:n,resources:{uTexture:S.WHITE.source}})}renderStart(e){const r=this._renderer.renderTarget.getRenderTarget(e.target);if(this._useBackBufferThisRender=this.useBackBuffer&&!!r.isRoot,this._useBackBufferThisRender){const s=this._renderer.renderTarget.getRenderTarget(e.target);this._targetTexture=s.colorTexture,e.target=this._getBackBufferTexture(s.colorTexture)}}renderEnd(){this._presentBackBuffer()}_presentBackBuffer(){const e=this._renderer;e.renderTarget.finishRenderPass(),this._useBackBufferThisRender&&(e.renderTarget.bind(this._targetTexture,!1),this._bigTriangleShader.resources.uTexture=this._backBufferTexture.source,e.encoder.draw({geometry:ke,shader:this._bigTriangleShader,state:this._state}))}_getBackBufferTexture(e){return this._backBufferTexture=this._backBufferTexture||new S({source:new $({width:e.width,height:e.height,resolution:e._resolution,antialias:this._antialias})}),this._backBufferTexture.source.resize(e.width,e.height,e._resolution),this._backBufferTexture}destroy(){this._backBufferTexture&&(this._backBufferTexture.destroy(),this._backBufferTexture=null)}};L.extension={type:[l.WebGLSystem],name:"backBuffer",priority:1};L.defaultOptions={useBackBuffer:!1};let Xe=L;class oe{constructor(e){this._colorMaskCache=15,this._renderer=e}setMask(e){this._colorMaskCache!==e&&(this._colorMaskCache=e,this._renderer.gl.colorMask(!!(e&8),!!(e&4),!!(e&2),!!(e&1)))}}oe.extension={type:[l.WebGLSystem],name:"colorMask"};class ce{constructor(e){this.commandFinished=Promise.resolve(),this._renderer=e}setGeometry(e,r){this._renderer.geometry.bind(e,r.glProgram)}finishRenderPass(){}draw(e){const r=this._renderer,{geometry:s,shader:n,state:i,skipSync:a,topology:o,size:c,start:u,instanceCount:_}=e;r.shader.bind(n,a),r.geometry.bind(s,r.shader._activeProgram),i&&r.state.set(i),r.geometry.draw(o,c,u,_??s.instanceCount)}destroy(){this._renderer=null}}ce.extension={type:[l.WebGLSystem],name:"encoder"};class We{constructor(){this.width=-1,this.height=-1,this.msaa=!1,this.msaaRenderBuffer=[]}}class ue{constructor(e){this._stencilCache={enabled:!1,stencilReference:0,stencilMode:p.NONE},this._renderTargetStencilState=Object.create(null),e.renderTarget.onRenderTargetChange.add(this)}contextChange(e){this._gl=e,this._comparisonFuncMapping={always:e.ALWAYS,never:e.NEVER,equal:e.EQUAL,"not-equal":e.NOTEQUAL,less:e.LESS,"less-equal":e.LEQUAL,greater:e.GREATER,"greater-equal":e.GEQUAL},this._stencilOpsMapping={keep:e.KEEP,zero:e.ZERO,replace:e.REPLACE,invert:e.INVERT,"increment-clamp":e.INCR,"decrement-clamp":e.DECR,"increment-wrap":e.INCR_WRAP,"decrement-wrap":e.DECR_WRAP},this._stencilCache.enabled=!1,this._stencilCache.stencilMode=p.NONE,this._stencilCache.stencilReference=0}onRenderTargetChange(e){if(this._activeRenderTarget===e)return;this._activeRenderTarget=e;let r=this._renderTargetStencilState[e.uid];r||(r=this._renderTargetStencilState[e.uid]={stencilMode:p.DISABLED,stencilReference:0}),this.setStencilMode(r.stencilMode,r.stencilReference)}setStencilMode(e,r){const s=this._renderTargetStencilState[this._activeRenderTarget.uid],n=this._gl,i=ye[e],a=this._stencilCache;if(s.stencilMode=e,s.stencilReference=r,e===p.DISABLED){this._stencilCache.enabled&&(this._stencilCache.enabled=!1,n.disable(n.STENCIL_TEST));return}this._stencilCache.enabled||(this._stencilCache.enabled=!0,n.enable(n.STENCIL_TEST)),(e!==a.stencilMode||a.stencilReference!==r)&&(a.stencilMode=e,a.stencilReference=r,n.stencilFunc(this._comparisonFuncMapping[i.stencilBack.compare],r,255),n.stencilOp(n.KEEP,n.KEEP,this._stencilOpsMapping[i.stencilBack.passOp]))}}ue.extension={type:[l.WebGLSystem],name:"stencil"};const _e={f32:4,"vec2<f32>":8,"vec3<f32>":12,"vec4<f32>":16,"mat2x2<f32>":16*2,"mat3x3<f32>":16*3,"mat4x4<f32>":16*4};function je(t){const e=t.map(i=>({data:i,offset:0,size:0}));let r=0,s=0,n=0;for(let i=0;i<e.length;i++){const a=e[i];if(r=_e[a.data.type],!r)throw new Error(`Unknown type ${a.data.type}`);if(a.data.size>1&&(r=Math.max(r,16)*a.data.size),a.size=r,s%r!==0&&s<16){const o=s%r%16;s+=o,n+=o}s+r>16?(n=Math.ceil(n/16)*16,a.offset=n,n+=r,s=r):(a.offset=n,s+=r,n+=r)}return n=Math.ceil(n/16)*16,{uboElements:e,size:n}}function Ke(t,e){const r=Math.max(_e[t.data.type]/16,1),s=t.data.value.length/t.data.size,n=(4-s%4)%4;return` }`,name:"big-triangle"});this._bigTriangleShader=new x({glProgram:n,resources:{uTexture:S.WHITE.source}})}renderStart(e){const r=this._renderer.renderTarget.getRenderTarget(e.target);if(this._useBackBufferThisRender=this.useBackBuffer&&!!r.isRoot,this._useBackBufferThisRender){const s=this._renderer.renderTarget.getRenderTarget(e.target);this._targetTexture=s.colorTexture,e.target=this._getBackBufferTexture(s.colorTexture)}}renderEnd(){this._presentBackBuffer()}_presentBackBuffer(){const e=this._renderer;e.renderTarget.finishRenderPass(),this._useBackBufferThisRender&&(e.renderTarget.bind(this._targetTexture,!1),this._bigTriangleShader.resources.uTexture=this._backBufferTexture.source,e.encoder.draw({geometry:Xe,shader:this._bigTriangleShader,state:this._state}))}_getBackBufferTexture(e){return this._backBufferTexture=this._backBufferTexture||new S({source:new $({width:e.width,height:e.height,resolution:e._resolution,antialias:this._antialias})}),this._backBufferTexture.source.resize(e.width,e.height,e._resolution),this._backBufferTexture}destroy(){this._backBufferTexture&&(this._backBufferTexture.destroy(),this._backBufferTexture=null)}};L.extension={type:[l.WebGLSystem],name:"backBuffer",priority:1};L.defaultOptions={useBackBuffer:!1};let We=L;class oe{constructor(e){this._colorMaskCache=15,this._renderer=e}setMask(e){this._colorMaskCache!==e&&(this._colorMaskCache=e,this._renderer.gl.colorMask(!!(e&8),!!(e&4),!!(e&2),!!(e&1)))}}oe.extension={type:[l.WebGLSystem],name:"colorMask"};class ce{constructor(e){this.commandFinished=Promise.resolve(),this._renderer=e}setGeometry(e,r){this._renderer.geometry.bind(e,r.glProgram)}finishRenderPass(){}draw(e){const r=this._renderer,{geometry:s,shader:n,state:i,skipSync:a,topology:o,size:c,start:u,instanceCount:_}=e;r.shader.bind(n,a),r.geometry.bind(s,r.shader._activeProgram),i&&r.state.set(i),r.geometry.draw(o,c,u,_??s.instanceCount)}destroy(){this._renderer=null}}ce.extension={type:[l.WebGLSystem],name:"encoder"};class je{constructor(){this.width=-1,this.height=-1,this.msaa=!1,this.msaaRenderBuffer=[]}}class ue{constructor(e){this._stencilCache={enabled:!1,stencilReference:0,stencilMode:p.NONE},this._renderTargetStencilState=Object.create(null),e.renderTarget.onRenderTargetChange.add(this)}contextChange(e){this._gl=e,this._comparisonFuncMapping={always:e.ALWAYS,never:e.NEVER,equal:e.EQUAL,"not-equal":e.NOTEQUAL,less:e.LESS,"less-equal":e.LEQUAL,greater:e.GREATER,"greater-equal":e.GEQUAL},this._stencilOpsMapping={keep:e.KEEP,zero:e.ZERO,replace:e.REPLACE,invert:e.INVERT,"increment-clamp":e.INCR,"decrement-clamp":e.DECR,"increment-wrap":e.INCR_WRAP,"decrement-wrap":e.DECR_WRAP},this._stencilCache.enabled=!1,this._stencilCache.stencilMode=p.NONE,this._stencilCache.stencilReference=0}onRenderTargetChange(e){if(this._activeRenderTarget===e)return;this._activeRenderTarget=e;let r=this._renderTargetStencilState[e.uid];r||(r=this._renderTargetStencilState[e.uid]={stencilMode:p.DISABLED,stencilReference:0}),this.setStencilMode(r.stencilMode,r.stencilReference)}setStencilMode(e,r){const s=this._renderTargetStencilState[this._activeRenderTarget.uid],n=this._gl,i=Ce[e],a=this._stencilCache;if(s.stencilMode=e,s.stencilReference=r,e===p.DISABLED){this._stencilCache.enabled&&(this._stencilCache.enabled=!1,n.disable(n.STENCIL_TEST));return}this._stencilCache.enabled||(this._stencilCache.enabled=!0,n.enable(n.STENCIL_TEST)),(e!==a.stencilMode||a.stencilReference!==r)&&(a.stencilMode=e,a.stencilReference=r,n.stencilFunc(this._comparisonFuncMapping[i.stencilBack.compare],r,255),n.stencilOp(n.KEEP,n.KEEP,this._stencilOpsMapping[i.stencilBack.passOp]))}}ue.extension={type:[l.WebGLSystem],name:"stencil"};const _e={f32:4,"vec2<f32>":8,"vec3<f32>":12,"vec4<f32>":16,"mat2x2<f32>":16*2,"mat3x3<f32>":16*3,"mat4x4<f32>":16*4};function Ke(t){const e=t.map(i=>({data:i,offset:0,size:0}));let r=0,s=0,n=0;for(let i=0;i<e.length;i++){const a=e[i];if(r=_e[a.data.type],!r)throw new Error(`Unknown type ${a.data.type}`);if(a.data.size>1&&(r=Math.max(r,16)*a.data.size),a.size=r,s%r!==0&&s<16){const o=s%r%16;s+=o,n+=o}s+r>16?(n=Math.ceil(n/16)*16,a.offset=n,n+=r,s=r):(a.offset=n,s+=r,n+=r)}return n=Math.ceil(n/16)*16,{uboElements:e,size:n}}function $e(t,e){const r=Math.max(_e[t.data.type]/16,1),s=t.data.value.length/t.data.size,n=(4-s%4)%4;return`
v = uv.${t.data.name}; v = uv.${t.data.name};
offset += ${e}; offset += ${e};
@@ -33,7 +33,7 @@ import{m as K,E as l,B as A,D as G,w as m,N as Ae,j as S,i as $,S as p,R as H,d
} }
${n!==0?`arrayOffset += ${n};`:""} ${n!==0?`arrayOffset += ${n};`:""}
} }
`}function $e(t){return Ce(t,"uboStd40",Ke,Ge)}class fe extends Ue{constructor(){super({createUboElements:je,generateUboSync:$e})}}fe.extension={type:[l.WebGLSystem],name:"ubo"};class ze{constructor(){this._clearColorCache=[0,0,0,0],this._viewPortCache=new H}init(e,r){this._renderer=e,this._renderTargetSystem=r,e.runners.contextChange.add(this)}contextChange(){this._clearColorCache=[0,0,0,0],this._viewPortCache=new H}copyToTexture(e,r,s,n,i){const a=this._renderTargetSystem,o=this._renderer,c=a.getGpuRenderTarget(e),u=o.gl;return this.finishRenderPass(e),u.bindFramebuffer(u.FRAMEBUFFER,c.resolveTargetFramebuffer),o.texture.bind(r,0),u.copyTexSubImage2D(u.TEXTURE_2D,0,i.x,i.y,s.x,s.y,n.width,n.height),r}startRenderPass(e,r=!0,s,n){const i=this._renderTargetSystem,a=e.colorTexture,o=i.getGpuRenderTarget(e);let c=n.y;e.isRoot&&(c=a.pixelHeight-n.height),e.colorTextures.forEach(h=>{this._renderer.texture.unbind(h)});const u=this._renderer.gl;u.bindFramebuffer(u.FRAMEBUFFER,o.framebuffer);const _=this._viewPortCache;(_.x!==n.x||_.y!==c||_.width!==n.width||_.height!==n.height)&&(_.x=n.x,_.y=c,_.width=n.width,_.height=n.height,u.viewport(n.x,c,n.width,n.height)),!o.depthStencilRenderBuffer&&(e.stencil||e.depth)&&this._initStencil(o),this.clear(e,r,s)}finishRenderPass(e){const s=this._renderTargetSystem.getGpuRenderTarget(e);if(!s.msaa)return;const n=this._renderer.gl;n.bindFramebuffer(n.FRAMEBUFFER,s.resolveTargetFramebuffer),n.bindFramebuffer(n.READ_FRAMEBUFFER,s.framebuffer),n.blitFramebuffer(0,0,s.width,s.height,0,0,s.width,s.height,n.COLOR_BUFFER_BIT,n.NEAREST),n.bindFramebuffer(n.FRAMEBUFFER,s.framebuffer)}initGpuRenderTarget(e){const r=this._renderer,s=r.gl,n=new We;return e.colorTexture.resource===r.gl.canvas?(n.framebuffer=null,n):(this._initColor(e,n),s.bindFramebuffer(s.FRAMEBUFFER,null),n)}destroyGpuRenderTarget(e){const r=this._renderer.gl;e.framebuffer&&(r.deleteFramebuffer(e.framebuffer),e.framebuffer=null),e.resolveTargetFramebuffer&&(r.deleteFramebuffer(e.resolveTargetFramebuffer),e.resolveTargetFramebuffer=null),e.depthStencilRenderBuffer&&(r.deleteRenderbuffer(e.depthStencilRenderBuffer),e.depthStencilRenderBuffer=null),e.msaaRenderBuffer.forEach(s=>{r.deleteRenderbuffer(s)}),e.msaaRenderBuffer=null}clear(e,r,s){if(!r)return;const n=this._renderTargetSystem;typeof r=="boolean"&&(r=r?B.ALL:B.NONE);const i=this._renderer.gl;if(r&B.COLOR){s??(s=n.defaultClearColor);const a=this._clearColorCache,o=s;(a[0]!==o[0]||a[1]!==o[1]||a[2]!==o[2]||a[3]!==o[3])&&(a[0]=o[0],a[1]=o[1],a[2]=o[2],a[3]=o[3],i.clearColor(o[0],o[1],o[2],o[3]))}i.clear(r)}resizeGpuRenderTarget(e){if(e.isRoot)return;const s=this._renderTargetSystem.getGpuRenderTarget(e);this._resizeColor(e,s),e.stencil&&this._resizeStencil(s)}_initColor(e,r){const s=this._renderer,n=s.gl,i=n.createFramebuffer();if(r.resolveTargetFramebuffer=i,n.bindFramebuffer(n.FRAMEBUFFER,i),r.width=e.colorTexture.source.pixelWidth,r.height=e.colorTexture.source.pixelHeight,e.colorTextures.forEach((a,o)=>{const c=a.source;c.antialias&&(s.context.supports.msaa?r.msaa=!0:m("[RenderTexture] Antialiasing on textures is not supported in WebGL1")),s.texture.bindSource(c,0);const _=s.texture.getGlSource(c).texture;n.framebufferTexture2D(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0+o,3553,_,0)}),r.msaa){const a=n.createFramebuffer();r.framebuffer=a,n.bindFramebuffer(n.FRAMEBUFFER,a),e.colorTextures.forEach((o,c)=>{const u=n.createRenderbuffer();r.msaaRenderBuffer[c]=u})}else r.framebuffer=i;this._resizeColor(e,r)}_resizeColor(e,r){const s=e.colorTexture.source;if(r.width=s.pixelWidth,r.height=s.pixelHeight,e.colorTextures.forEach((n,i)=>{i!==0&&n.source.resize(s.width,s.height,s._resolution)}),r.msaa){const n=this._renderer,i=n.gl,a=r.framebuffer;i.bindFramebuffer(i.FRAMEBUFFER,a),e.colorTextures.forEach((o,c)=>{const u=o.source;n.texture.bindSource(u,0);const h=n.texture.getGlSource(u).internalFormat,d=r.msaaRenderBuffer[c];i.bindRenderbuffer(i.RENDERBUFFER,d),i.renderbufferStorageMultisample(i.RENDERBUFFER,4,h,u.pixelWidth,u.pixelHeight),i.framebufferRenderbuffer(i.FRAMEBUFFER,i.COLOR_ATTACHMENT0+c,i.RENDERBUFFER,d)})}}_initStencil(e){if(e.framebuffer===null)return;const r=this._renderer.gl,s=r.createRenderbuffer();e.depthStencilRenderBuffer=s,r.bindRenderbuffer(r.RENDERBUFFER,s),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_STENCIL_ATTACHMENT,r.RENDERBUFFER,s),this._resizeStencil(e)}_resizeStencil(e){const r=this._renderer.gl;r.bindRenderbuffer(r.RENDERBUFFER,e.depthStencilRenderBuffer),e.msaa?r.renderbufferStorageMultisample(r.RENDERBUFFER,4,r.DEPTH24_STENCIL8,e.width,e.height):r.renderbufferStorage(r.RENDERBUFFER,this._renderer.context.webGLVersion===2?r.DEPTH24_STENCIL8:r.DEPTH_STENCIL,e.width,e.height)}}class he extends Oe{constructor(e){super(e),this.adaptor=new ze,this.adaptor.init(e,this)}}he.extension={type:[l.WebGLSystem],name:"renderTarget"};function Ye(t,e){const r=[],s=[` `}function ze(t){return Ge(t,"uboStd40",$e,Ue)}class fe extends Oe{constructor(){super({createUboElements:Ke,generateUboSync:ze})}}fe.extension={type:[l.WebGLSystem],name:"ubo"};class Ye{constructor(){this._clearColorCache=[0,0,0,0],this._viewPortCache=new H}init(e,r){this._renderer=e,this._renderTargetSystem=r,e.runners.contextChange.add(this)}contextChange(){this._clearColorCache=[0,0,0,0],this._viewPortCache=new H}copyToTexture(e,r,s,n,i){const a=this._renderTargetSystem,o=this._renderer,c=a.getGpuRenderTarget(e),u=o.gl;return this.finishRenderPass(e),u.bindFramebuffer(u.FRAMEBUFFER,c.resolveTargetFramebuffer),o.texture.bind(r,0),u.copyTexSubImage2D(u.TEXTURE_2D,0,i.x,i.y,s.x,s.y,n.width,n.height),r}startRenderPass(e,r=!0,s,n){const i=this._renderTargetSystem,a=e.colorTexture,o=i.getGpuRenderTarget(e);let c=n.y;e.isRoot&&(c=a.pixelHeight-n.height),e.colorTextures.forEach(h=>{this._renderer.texture.unbind(h)});const u=this._renderer.gl;u.bindFramebuffer(u.FRAMEBUFFER,o.framebuffer);const _=this._viewPortCache;(_.x!==n.x||_.y!==c||_.width!==n.width||_.height!==n.height)&&(_.x=n.x,_.y=c,_.width=n.width,_.height=n.height,u.viewport(n.x,c,n.width,n.height)),!o.depthStencilRenderBuffer&&(e.stencil||e.depth)&&this._initStencil(o),this.clear(e,r,s)}finishRenderPass(e){const s=this._renderTargetSystem.getGpuRenderTarget(e);if(!s.msaa)return;const n=this._renderer.gl;n.bindFramebuffer(n.FRAMEBUFFER,s.resolveTargetFramebuffer),n.bindFramebuffer(n.READ_FRAMEBUFFER,s.framebuffer),n.blitFramebuffer(0,0,s.width,s.height,0,0,s.width,s.height,n.COLOR_BUFFER_BIT,n.NEAREST),n.bindFramebuffer(n.FRAMEBUFFER,s.framebuffer)}initGpuRenderTarget(e){const r=this._renderer,s=r.gl,n=new je;return e.colorTexture.resource===r.gl.canvas?(n.framebuffer=null,n):(this._initColor(e,n),s.bindFramebuffer(s.FRAMEBUFFER,null),n)}destroyGpuRenderTarget(e){const r=this._renderer.gl;e.framebuffer&&(r.deleteFramebuffer(e.framebuffer),e.framebuffer=null),e.resolveTargetFramebuffer&&(r.deleteFramebuffer(e.resolveTargetFramebuffer),e.resolveTargetFramebuffer=null),e.depthStencilRenderBuffer&&(r.deleteRenderbuffer(e.depthStencilRenderBuffer),e.depthStencilRenderBuffer=null),e.msaaRenderBuffer.forEach(s=>{r.deleteRenderbuffer(s)}),e.msaaRenderBuffer=null}clear(e,r,s){if(!r)return;const n=this._renderTargetSystem;typeof r=="boolean"&&(r=r?A.ALL:A.NONE);const i=this._renderer.gl;if(r&A.COLOR){s??(s=n.defaultClearColor);const a=this._clearColorCache,o=s;(a[0]!==o[0]||a[1]!==o[1]||a[2]!==o[2]||a[3]!==o[3])&&(a[0]=o[0],a[1]=o[1],a[2]=o[2],a[3]=o[3],i.clearColor(o[0],o[1],o[2],o[3]))}i.clear(r)}resizeGpuRenderTarget(e){if(e.isRoot)return;const s=this._renderTargetSystem.getGpuRenderTarget(e);this._resizeColor(e,s),e.stencil&&this._resizeStencil(s)}_initColor(e,r){const s=this._renderer,n=s.gl,i=n.createFramebuffer();if(r.resolveTargetFramebuffer=i,n.bindFramebuffer(n.FRAMEBUFFER,i),r.width=e.colorTexture.source.pixelWidth,r.height=e.colorTexture.source.pixelHeight,e.colorTextures.forEach((a,o)=>{const c=a.source;c.antialias&&(s.context.supports.msaa?r.msaa=!0:m("[RenderTexture] Antialiasing on textures is not supported in WebGL1")),s.texture.bindSource(c,0);const _=s.texture.getGlSource(c).texture;n.framebufferTexture2D(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0+o,3553,_,0)}),r.msaa){const a=n.createFramebuffer();r.framebuffer=a,n.bindFramebuffer(n.FRAMEBUFFER,a),e.colorTextures.forEach((o,c)=>{const u=n.createRenderbuffer();r.msaaRenderBuffer[c]=u})}else r.framebuffer=i;this._resizeColor(e,r)}_resizeColor(e,r){const s=e.colorTexture.source;if(r.width=s.pixelWidth,r.height=s.pixelHeight,e.colorTextures.forEach((n,i)=>{i!==0&&n.source.resize(s.width,s.height,s._resolution)}),r.msaa){const n=this._renderer,i=n.gl,a=r.framebuffer;i.bindFramebuffer(i.FRAMEBUFFER,a),e.colorTextures.forEach((o,c)=>{const u=o.source;n.texture.bindSource(u,0);const h=n.texture.getGlSource(u).internalFormat,d=r.msaaRenderBuffer[c];i.bindRenderbuffer(i.RENDERBUFFER,d),i.renderbufferStorageMultisample(i.RENDERBUFFER,4,h,u.pixelWidth,u.pixelHeight),i.framebufferRenderbuffer(i.FRAMEBUFFER,i.COLOR_ATTACHMENT0+c,i.RENDERBUFFER,d)})}}_initStencil(e){if(e.framebuffer===null)return;const r=this._renderer.gl,s=r.createRenderbuffer();e.depthStencilRenderBuffer=s,r.bindRenderbuffer(r.RENDERBUFFER,s),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_STENCIL_ATTACHMENT,r.RENDERBUFFER,s),this._resizeStencil(e)}_resizeStencil(e){const r=this._renderer.gl;r.bindRenderbuffer(r.RENDERBUFFER,e.depthStencilRenderBuffer),e.msaa?r.renderbufferStorageMultisample(r.RENDERBUFFER,4,r.DEPTH24_STENCIL8,e.width,e.height):r.renderbufferStorage(r.RENDERBUFFER,this._renderer.context.webGLVersion===2?r.DEPTH24_STENCIL8:r.DEPTH_STENCIL,e.width,e.height)}}class he extends Pe{constructor(e){super(e),this.adaptor=new Ye,this.adaptor.init(e,this)}}he.extension={type:[l.WebGLSystem],name:"renderTarget"};function qe(t,e){const r=[],s=[`
var g = s.groups; var g = s.groups;
var sS = r.shader; var sS = r.shader;
var p = s.glProgram; var p = s.glProgram;
@@ -60,10 +60,10 @@ import{m as K,E as l,B as A,D as G,w as m,N as Ae,j as S,i as $,S as p,R as H,d
`)),e._gl.uniform1i(b.location,a),r.push(` `)),e._gl.uniform1i(b.location,a),r.push(`
tS.bind(resources[${h}], ${a}); tS.bind(resources[${h}], ${a});
`),a++)}}}const c=[...s,...r].join(` `),a++)}}}const c=[...s,...r].join(`
`);return new Function("r","s","sD",c)}class qe{constructor(e,r){this.program=e,this.uniformData=r,this.uniformGroups={},this.uniformDirtyGroups={},this.uniformBlockBindings={}}destroy(){this.uniformData=null,this.uniformGroups=null,this.uniformDirtyGroups=null,this.uniformBlockBindings=null,this.program=null}}function V(t,e,r){const s=t.createShader(e);return t.shaderSource(s,r),t.compileShader(s),s}function I(t){const e=new Array(t);for(let r=0;r<e.length;r++)e[r]=!1;return e}function le(t,e){switch(t){case"float":return 0;case"vec2":return new Float32Array(2*e);case"vec3":return new Float32Array(3*e);case"vec4":return new Float32Array(4*e);case"int":case"uint":case"sampler2D":case"sampler2DArray":return 0;case"ivec2":return new Int32Array(2*e);case"ivec3":return new Int32Array(3*e);case"ivec4":return new Int32Array(4*e);case"uvec2":return new Uint32Array(2*e);case"uvec3":return new Uint32Array(3*e);case"uvec4":return new Uint32Array(4*e);case"bool":return!1;case"bvec2":return I(2*e);case"bvec3":return I(3*e);case"bvec4":return I(4*e);case"mat2":return new Float32Array([1,0,0,1]);case"mat3":return new Float32Array([1,0,0,0,1,0,0,0,1]);case"mat4":return new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}return null}let g=null;const k={FLOAT:"float",FLOAT_VEC2:"vec2",FLOAT_VEC3:"vec3",FLOAT_VEC4:"vec4",INT:"int",INT_VEC2:"ivec2",INT_VEC3:"ivec3",INT_VEC4:"ivec4",UNSIGNED_INT:"uint",UNSIGNED_INT_VEC2:"uvec2",UNSIGNED_INT_VEC3:"uvec3",UNSIGNED_INT_VEC4:"uvec4",BOOL:"bool",BOOL_VEC2:"bvec2",BOOL_VEC3:"bvec3",BOOL_VEC4:"bvec4",FLOAT_MAT2:"mat2",FLOAT_MAT3:"mat3",FLOAT_MAT4:"mat4",SAMPLER_2D:"sampler2D",INT_SAMPLER_2D:"sampler2D",UNSIGNED_INT_SAMPLER_2D:"sampler2D",SAMPLER_CUBE:"samplerCube",INT_SAMPLER_CUBE:"samplerCube",UNSIGNED_INT_SAMPLER_CUBE:"samplerCube",SAMPLER_2D_ARRAY:"sampler2DArray",INT_SAMPLER_2D_ARRAY:"sampler2DArray",UNSIGNED_INT_SAMPLER_2D_ARRAY:"sampler2DArray"},Ze={float:"float32",vec2:"float32x2",vec3:"float32x3",vec4:"float32x4",int:"sint32",ivec2:"sint32x2",ivec3:"sint32x3",ivec4:"sint32x4",uint:"uint32",uvec2:"uint32x2",uvec3:"uint32x3",uvec4:"uint32x4",bool:"uint32",bvec2:"uint32x2",bvec3:"uint32x3",bvec4:"uint32x4"};function de(t,e){if(!g){const r=Object.keys(k);g={};for(let s=0;s<r.length;++s){const n=r[s];g[t[n]]=k[n]}}return g[e]}function Qe(t,e){const r=de(t,e);return Ze[r]||"float32"}function Je(t,e,r=!1){const s={},n=e.getProgramParameter(t,e.ACTIVE_ATTRIBUTES);for(let a=0;a<n;a++){const o=e.getActiveAttrib(t,a);if(o.name.startsWith("gl_"))continue;const c=Qe(e,o.type);s[o.name]={location:0,format:c,stride:Z(c).stride,offset:0,instance:!1,start:0}}const i=Object.keys(s);if(r){i.sort((a,o)=>a>o?1:-1);for(let a=0;a<i.length;a++)s[i[a]].location=a,e.bindAttribLocation(t,a,i[a]);e.linkProgram(t)}else for(let a=0;a<i.length;a++)s[i[a]].location=e.getAttribLocation(t,i[a]);return s}function et(t,e){if(!e.ACTIVE_UNIFORM_BLOCKS)return{};const r={},s=e.getProgramParameter(t,e.ACTIVE_UNIFORM_BLOCKS);for(let n=0;n<s;n++){const i=e.getActiveUniformBlockName(t,n),a=e.getUniformBlockIndex(t,i),o=e.getActiveUniformBlockParameter(t,n,e.UNIFORM_BLOCK_DATA_SIZE);r[i]={name:i,index:a,size:o}}return r}function tt(t,e){const r={},s=e.getProgramParameter(t,e.ACTIVE_UNIFORMS);for(let n=0;n<s;n++){const i=e.getActiveUniform(t,n),a=i.name.replace(/\[.*?\]$/,""),o=!!i.name.match(/\[.*?\]$/),c=de(e,i.type);r[a]={name:a,index:n,type:c,size:i.size,isArray:o,value:le(c,i.size)}}return r}function X(t,e){const r=t.getShaderSource(e).split(` `);return new Function("r","s","sD",c)}class Ze{constructor(e,r){this.program=e,this.uniformData=r,this.uniformGroups={},this.uniformDirtyGroups={},this.uniformBlockBindings={}}destroy(){this.uniformData=null,this.uniformGroups=null,this.uniformDirtyGroups=null,this.uniformBlockBindings=null,this.program=null}}function k(t,e,r){const s=t.createShader(e);return t.shaderSource(s,r),t.compileShader(s),s}function I(t){const e=new Array(t);for(let r=0;r<e.length;r++)e[r]=!1;return e}function le(t,e){switch(t){case"float":return 0;case"vec2":return new Float32Array(2*e);case"vec3":return new Float32Array(3*e);case"vec4":return new Float32Array(4*e);case"int":case"uint":case"sampler2D":case"sampler2DArray":return 0;case"ivec2":return new Int32Array(2*e);case"ivec3":return new Int32Array(3*e);case"ivec4":return new Int32Array(4*e);case"uvec2":return new Uint32Array(2*e);case"uvec3":return new Uint32Array(3*e);case"uvec4":return new Uint32Array(4*e);case"bool":return!1;case"bvec2":return I(2*e);case"bvec3":return I(3*e);case"bvec4":return I(4*e);case"mat2":return new Float32Array([1,0,0,1]);case"mat3":return new Float32Array([1,0,0,0,1,0,0,0,1]);case"mat4":return new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}return null}let g=null;const V={FLOAT:"float",FLOAT_VEC2:"vec2",FLOAT_VEC3:"vec3",FLOAT_VEC4:"vec4",INT:"int",INT_VEC2:"ivec2",INT_VEC3:"ivec3",INT_VEC4:"ivec4",UNSIGNED_INT:"uint",UNSIGNED_INT_VEC2:"uvec2",UNSIGNED_INT_VEC3:"uvec3",UNSIGNED_INT_VEC4:"uvec4",BOOL:"bool",BOOL_VEC2:"bvec2",BOOL_VEC3:"bvec3",BOOL_VEC4:"bvec4",FLOAT_MAT2:"mat2",FLOAT_MAT3:"mat3",FLOAT_MAT4:"mat4",SAMPLER_2D:"sampler2D",INT_SAMPLER_2D:"sampler2D",UNSIGNED_INT_SAMPLER_2D:"sampler2D",SAMPLER_CUBE:"samplerCube",INT_SAMPLER_CUBE:"samplerCube",UNSIGNED_INT_SAMPLER_CUBE:"samplerCube",SAMPLER_2D_ARRAY:"sampler2DArray",INT_SAMPLER_2D_ARRAY:"sampler2DArray",UNSIGNED_INT_SAMPLER_2D_ARRAY:"sampler2DArray"},Qe={float:"float32",vec2:"float32x2",vec3:"float32x3",vec4:"float32x4",int:"sint32",ivec2:"sint32x2",ivec3:"sint32x3",ivec4:"sint32x4",uint:"uint32",uvec2:"uint32x2",uvec3:"uint32x3",uvec4:"uint32x4",bool:"uint32",bvec2:"uint32x2",bvec3:"uint32x3",bvec4:"uint32x4"};function de(t,e){if(!g){const r=Object.keys(V);g={};for(let s=0;s<r.length;++s){const n=r[s];g[t[n]]=V[n]}}return g[e]}function Je(t,e){const r=de(t,e);return Qe[r]||"float32"}function et(t,e,r=!1){const s={},n=e.getProgramParameter(t,e.ACTIVE_ATTRIBUTES);for(let a=0;a<n;a++){const o=e.getActiveAttrib(t,a);if(o.name.startsWith("gl_"))continue;const c=Je(e,o.type);s[o.name]={location:0,format:c,stride:Z(c).stride,offset:0,instance:!1,start:0}}const i=Object.keys(s);if(r){i.sort((a,o)=>a>o?1:-1);for(let a=0;a<i.length;a++)s[i[a]].location=a,e.bindAttribLocation(t,a,i[a]);e.linkProgram(t)}else for(let a=0;a<i.length;a++)s[i[a]].location=e.getAttribLocation(t,i[a]);return s}function tt(t,e){if(!e.ACTIVE_UNIFORM_BLOCKS)return{};const r={},s=e.getProgramParameter(t,e.ACTIVE_UNIFORM_BLOCKS);for(let n=0;n<s;n++){const i=e.getActiveUniformBlockName(t,n),a=e.getUniformBlockIndex(t,i),o=e.getActiveUniformBlockParameter(t,n,e.UNIFORM_BLOCK_DATA_SIZE);r[i]={name:i,index:a,size:o}}return r}function rt(t,e){const r={},s=e.getProgramParameter(t,e.ACTIVE_UNIFORMS);for(let n=0;n<s;n++){const i=e.getActiveUniform(t,n),a=i.name.replace(/\[.*?\]$/,""),o=!!i.name.match(/\[.*?\]$/),c=de(e,i.type);r[a]={name:a,index:n,type:c,size:i.size,isArray:o,value:le(c,i.size)}}return r}function X(t,e){const r=t.getShaderSource(e).split(`
`).map((u,_)=>`${_}: ${u}`),s=t.getShaderInfoLog(e),n=s.split(` `).map((u,_)=>`${_}: ${u}`),s=t.getShaderInfoLog(e),n=s.split(`
`),i={},a=n.map(u=>parseFloat(u.replace(/^ERROR\: 0\:([\d]+)\:.*$/,"$1"))).filter(u=>u&&!i[u]?(i[u]=!0,!0):!1),o=[""];a.forEach(u=>{r[u-1]=`%c${r[u-1]}%c`,o.push("background: #FF0000; color:#FFFFFF; font-size: 10px","font-size: 10px")});const c=r.join(` `),i={},a=n.map(u=>parseFloat(u.replace(/^ERROR\: 0\:([\d]+)\:.*$/,"$1"))).filter(u=>u&&!i[u]?(i[u]=!0,!0):!1),o=[""];a.forEach(u=>{r[u-1]=`%c${r[u-1]}%c`,o.push("background: #FF0000; color:#FFFFFF; font-size: 10px","font-size: 10px")});const c=r.join(`
`);o[0]=c,console.error(s),console.groupCollapsed("click to view full shader code"),console.warn(...o),console.groupEnd()}function rt(t,e,r,s){t.getProgramParameter(e,t.LINK_STATUS)||(t.getShaderParameter(r,t.COMPILE_STATUS)||X(t,r),t.getShaderParameter(s,t.COMPILE_STATUS)||X(t,s),console.error("PixiJS Error: Could not initialize shader."),t.getProgramInfoLog(e)!==""&&console.warn("PixiJS Warning: gl.getProgramInfoLog()",t.getProgramInfoLog(e)))}function st(t,e){const r=V(t,t.VERTEX_SHADER,e.vertex),s=V(t,t.FRAGMENT_SHADER,e.fragment),n=t.createProgram();t.attachShader(n,r),t.attachShader(n,s);const i=e.transformFeedbackVaryings;i&&(typeof t.transformFeedbackVaryings!="function"?m("TransformFeedback is not supported but TransformFeedbackVaryings are given."):t.transformFeedbackVaryings(n,i.names,i.bufferMode==="separate"?t.SEPARATE_ATTRIBS:t.INTERLEAVED_ATTRIBS)),t.linkProgram(n),t.getProgramParameter(n,t.LINK_STATUS)||rt(t,n,r,s),e._attributeData=Je(n,t,!/^[ \t]*#[ \t]*version[ \t]+300[ \t]+es[ \t]*$/m.test(e.vertex)),e._uniformData=tt(n,t),e._uniformBlockData=et(n,t),t.deleteShader(r),t.deleteShader(s);const a={};for(const c in e._uniformData){const u=e._uniformData[c];a[c]={location:t.getUniformLocation(n,c),value:le(u.type,u.size)}}return new qe(n,a)}const R={textureCount:0,blockIndex:0};class me{constructor(e){this._activeProgram=null,this._programDataHash=Object.create(null),this._nextIndex=0,this._boundUniformsIdsToIndexHash=Object.create(null),this._boundIndexToUniformsHash=Object.create(null),this._shaderSyncFunctions=Object.create(null),this._renderer=e}contextChange(e){this._gl=e,this._maxBindings=e.MAX_UNIFORM_BUFFER_BINDINGS?e.getParameter(e.MAX_UNIFORM_BUFFER_BINDINGS):0,this._programDataHash=Object.create(null),this._boundUniformsIdsToIndexHash=Object.create(null),this._boundIndexToUniformsHash=Object.create(null),this._activeProgram=null}bind(e,r){if(this._setProgram(e.glProgram),r)return;R.textureCount=0,R.blockIndex=0;let s=this._shaderSyncFunctions[e.glProgram._key];s||(s=this._shaderSyncFunctions[e.glProgram._key]=this._generateShaderSync(e,this)),s(this._renderer,e,R)}updateUniformGroup(e){this._renderer.uniformGroup.updateUniformGroup(e,this._activeProgram,R)}bindUniformBlock(e,r,s=0){const n=this._renderer.buffer,i=this._getProgramData(this._activeProgram),a=e._bufferResource;a&&this._renderer.ubo.updateUniformGroup(e),n.updateBuffer(e.buffer);let o=this._boundUniformsIdsToIndexHash[e.uid];if(o===void 0){const _=this._nextIndex++%this._maxBindings,h=this._boundIndexToUniformsHash[_];h&&(this._boundUniformsIdsToIndexHash[h.uid]=void 0),o=this._boundUniformsIdsToIndexHash[e.uid]=_,this._boundIndexToUniformsHash[_]=e,a?n.bindBufferRange(e.buffer,_,e.offset):n.bindBufferBase(e.buffer,_)}const c=this._gl,u=this._activeProgram._uniformBlockData[r].index;i.uniformBlockBindings[s]!==o&&(i.uniformBlockBindings[s]=o,c.uniformBlockBinding(i.program,u,o))}_setProgram(e){if(this._activeProgram===e)return;this._activeProgram=e;const r=this._getProgramData(e);this._gl.useProgram(r.program)}_getProgramData(e){return this._programDataHash[e._key]||this._createProgramData(e)}_createProgramData(e){const r=e._key;return this._programDataHash[r]=st(this._gl,e),this._programDataHash[r]}destroy(){for(const e of Object.keys(this._programDataHash))this._programDataHash[e].destroy(),this._programDataHash[e]=null;this._programDataHash=null,this._boundUniformsIdsToIndexHash=null}_generateShaderSync(e,r){return Ye(e,r)}}me.extension={type:[l.WebGLSystem],name:"shader"};const nt={f32:`if (cv !== v) { `);o[0]=c,console.error(s),console.groupCollapsed("click to view full shader code"),console.warn(...o),console.groupEnd()}function st(t,e,r,s){t.getProgramParameter(e,t.LINK_STATUS)||(t.getShaderParameter(r,t.COMPILE_STATUS)||X(t,r),t.getShaderParameter(s,t.COMPILE_STATUS)||X(t,s),console.error("PixiJS Error: Could not initialize shader."),t.getProgramInfoLog(e)!==""&&console.warn("PixiJS Warning: gl.getProgramInfoLog()",t.getProgramInfoLog(e)))}function nt(t,e){const r=k(t,t.VERTEX_SHADER,e.vertex),s=k(t,t.FRAGMENT_SHADER,e.fragment),n=t.createProgram();t.attachShader(n,r),t.attachShader(n,s);const i=e.transformFeedbackVaryings;i&&(typeof t.transformFeedbackVaryings!="function"?m("TransformFeedback is not supported but TransformFeedbackVaryings are given."):t.transformFeedbackVaryings(n,i.names,i.bufferMode==="separate"?t.SEPARATE_ATTRIBS:t.INTERLEAVED_ATTRIBS)),t.linkProgram(n),t.getProgramParameter(n,t.LINK_STATUS)||st(t,n,r,s),e._attributeData=et(n,t,!/^[ \t]*#[ \t]*version[ \t]+300[ \t]+es[ \t]*$/m.test(e.vertex)),e._uniformData=rt(n,t),e._uniformBlockData=tt(n,t),t.deleteShader(r),t.deleteShader(s);const a={};for(const c in e._uniformData){const u=e._uniformData[c];a[c]={location:t.getUniformLocation(n,c),value:le(u.type,u.size)}}return new Ze(n,a)}const R={textureCount:0,blockIndex:0};class me{constructor(e){this._activeProgram=null,this._programDataHash=Object.create(null),this._nextIndex=0,this._boundUniformsIdsToIndexHash=Object.create(null),this._boundIndexToUniformsHash=Object.create(null),this._shaderSyncFunctions=Object.create(null),this._renderer=e}contextChange(e){this._gl=e,this._maxBindings=e.MAX_UNIFORM_BUFFER_BINDINGS?e.getParameter(e.MAX_UNIFORM_BUFFER_BINDINGS):0,this._programDataHash=Object.create(null),this._boundUniformsIdsToIndexHash=Object.create(null),this._boundIndexToUniformsHash=Object.create(null),this._shaderSyncFunctions=Object.create(null),this._activeProgram=null}bind(e,r){if(this._setProgram(e.glProgram),r)return;R.textureCount=0,R.blockIndex=0;let s=this._shaderSyncFunctions[e.glProgram._key];s||(s=this._shaderSyncFunctions[e.glProgram._key]=this._generateShaderSync(e,this)),s(this._renderer,e,R)}updateUniformGroup(e){this._renderer.uniformGroup.updateUniformGroup(e,this._activeProgram,R)}bindUniformBlock(e,r,s=0){const n=this._renderer.buffer,i=this._getProgramData(this._activeProgram),a=e._bufferResource;a&&this._renderer.ubo.updateUniformGroup(e),n.updateBuffer(e.buffer);let o=this._boundUniformsIdsToIndexHash[e.uid];if(o===void 0){const _=this._nextIndex++%this._maxBindings,h=this._boundIndexToUniformsHash[_];h&&(this._boundUniformsIdsToIndexHash[h.uid]=void 0),o=this._boundUniformsIdsToIndexHash[e.uid]=_,this._boundIndexToUniformsHash[_]=e,a?n.bindBufferRange(e.buffer,_,e.offset):n.bindBufferBase(e.buffer,_)}const c=this._gl,u=this._activeProgram._uniformBlockData[r].index;i.uniformBlockBindings[s]!==o&&(i.uniformBlockBindings[s]=o,c.uniformBlockBinding(i.program,u,o))}_setProgram(e){if(this._activeProgram===e)return;this._activeProgram=e;const r=this._getProgramData(e);this._gl.useProgram(r.program)}_getProgramData(e){return this._programDataHash[e._key]||this._createProgramData(e)}_createProgramData(e){const r=e._key;return this._programDataHash[r]=nt(this._gl,e),this._programDataHash[r]}destroy(){for(const e of Object.keys(this._programDataHash))this._programDataHash[e].destroy(),this._programDataHash[e]=null;this._programDataHash=null,this._boundUniformsIdsToIndexHash=null}_generateShaderSync(e,r){return qe(e,r)}}me.extension={type:[l.WebGLSystem],name:"shader"};const it={f32:`if (cv !== v) {
cu.value = v; cu.value = v;
gl.uniform1f(location, v); gl.uniform1f(location, v);
}`,"vec2<f32>":`if (cv[0] !== v[0] || cv[1] !== v[1]) { }`,"vec2<f32>":`if (cv[0] !== v[0] || cv[1] !== v[1]) {
@@ -135,7 +135,7 @@ import{m as K,E as l,B as A,D as G,w as m,N as Ae,j as S,i as $,S as p,R as H,d
cv[2] = v[2]; cv[2] = v[2];
cv[3] = v[3]; cv[3] = v[3];
gl.uniform4i(location, v[0], v[1], v[2], v[3]); gl.uniform4i(location, v[0], v[1], v[2], v[3]);
}`,"mat2x2<f32>":"gl.uniformMatrix2fv(location, false, v);","mat3x3<f32>":"gl.uniformMatrix3fv(location, false, v);","mat4x4<f32>":"gl.uniformMatrix4fv(location, false, v);"},it={f32:"gl.uniform1fv(location, v);","vec2<f32>":"gl.uniform2fv(location, v);","vec3<f32>":"gl.uniform3fv(location, v);","vec4<f32>":"gl.uniform4fv(location, v);","mat2x2<f32>":"gl.uniformMatrix2fv(location, false, v);","mat3x3<f32>":"gl.uniformMatrix3fv(location, false, v);","mat4x4<f32>":"gl.uniformMatrix4fv(location, false, v);",i32:"gl.uniform1iv(location, v);","vec2<i32>":"gl.uniform2iv(location, v);","vec3<i32>":"gl.uniform3iv(location, v);","vec4<i32>":"gl.uniform4iv(location, v);",u32:"gl.uniform1iv(location, v);","vec2<u32>":"gl.uniform2iv(location, v);","vec3<u32>":"gl.uniform3iv(location, v);","vec4<u32>":"gl.uniform4iv(location, v);",bool:"gl.uniform1iv(location, v);","vec2<bool>":"gl.uniform2iv(location, v);","vec3<bool>":"gl.uniform3iv(location, v);","vec4<bool>":"gl.uniform4iv(location, v);"};function at(t,e){const r=[` }`,"mat2x2<f32>":"gl.uniformMatrix2fv(location, false, v);","mat3x3<f32>":"gl.uniformMatrix3fv(location, false, v);","mat4x4<f32>":"gl.uniformMatrix4fv(location, false, v);"},at={f32:"gl.uniform1fv(location, v);","vec2<f32>":"gl.uniform2fv(location, v);","vec3<f32>":"gl.uniform3fv(location, v);","vec4<f32>":"gl.uniform4fv(location, v);","mat2x2<f32>":"gl.uniformMatrix2fv(location, false, v);","mat3x3<f32>":"gl.uniformMatrix3fv(location, false, v);","mat4x4<f32>":"gl.uniformMatrix4fv(location, false, v);",i32:"gl.uniform1iv(location, v);","vec2<i32>":"gl.uniform2iv(location, v);","vec3<i32>":"gl.uniform3iv(location, v);","vec4<i32>":"gl.uniform4iv(location, v);",u32:"gl.uniform1iv(location, v);","vec2<u32>":"gl.uniform2iv(location, v);","vec3<u32>":"gl.uniform3iv(location, v);","vec4<u32>":"gl.uniform4iv(location, v);",bool:"gl.uniform1iv(location, v);","vec2<bool>":"gl.uniform2iv(location, v);","vec3<bool>":"gl.uniform3iv(location, v);","vec4<bool>":"gl.uniform4iv(location, v);"};function ot(t,e){const r=[`
var v = null; var v = null;
var cv = null; var cv = null;
var cu = null; var cu = null;
@@ -148,9 +148,9 @@ import{m as K,E as l,B as A,D as G,w as m,N as Ae,j as S,i as $,S as p,R as H,d
renderer.shader.updateUniformGroup(uv.${s}); renderer.shader.updateUniformGroup(uv.${s});
`):t.uniforms[s]instanceof ee&&r.push(` `):t.uniforms[s]instanceof ee&&r.push(`
renderer.shader.bindBufferResource(uv.${s}, "${s}"); renderer.shader.bindBufferResource(uv.${s}, "${s}");
`);continue}const n=t.uniformStructures[s];let i=!1;for(let a=0;a<N.length;a++){const o=N[a];if(n.type===o.type&&o.test(n)){r.push(`name = "${s}";`,N[a].uniform),i=!0;break}}if(!i){const o=(n.size===1?nt:it)[n.type].replace("location",`ud["${s}"].location`);r.push(` `);continue}const n=t.uniformStructures[s];let i=!1;for(let a=0;a<N.length;a++){const o=N[a];if(n.type===o.type&&o.test(n)){r.push(`name = "${s}";`,N[a].uniform),i=!0;break}}if(!i){const o=(n.size===1?it:at)[n.type].replace("location",`ud["${s}"].location`);r.push(`
cu = ud["${s}"]; cu = ud["${s}"];
cv = cu.value; cv = cu.value;
v = uv["${s}"]; v = uv["${s}"];
${o};`)}}return new Function("ud","uv","renderer","syncData",r.join(` ${o};`)}}return new Function("ud","uv","renderer","syncData",r.join(`
`))}class Ee{constructor(e){this._cache={},this._uniformGroupSyncHash={},this._renderer=e,this.gl=null,this._cache={}}contextChange(e){this.gl=e}updateUniformGroup(e,r,s){const n=this._renderer.shader._getProgramData(r);(!e.isStatic||e._dirtyId!==n.uniformDirtyGroups[e.uid])&&(n.uniformDirtyGroups[e.uid]=e._dirtyId,this._getUniformSyncFunction(e,r)(n.uniformData,e.uniforms,this._renderer,s))}_getUniformSyncFunction(e,r){return this._uniformGroupSyncHash[e._signature]?.[r._key]||this._createUniformSyncFunction(e,r)}_createUniformSyncFunction(e,r){const s=this._uniformGroupSyncHash[e._signature]||(this._uniformGroupSyncHash[e._signature]={}),n=this._getSignature(e,r._uniformData,"u");return this._cache[n]||(this._cache[n]=this._generateUniformsSync(e,r._uniformData)),s[r._key]=this._cache[n],s[r._key]}_generateUniformsSync(e,r){return at(e,r)}_getSignature(e,r,s){const n=e.uniforms,i=[`${s}-`];for(const a in n)i.push(a),r[a]&&i.push(r[a].type);return i.join("-")}destroy(){this._renderer=null,this._cache=null}}Ee.extension={type:[l.WebGLSystem],name:"uniformGroup"};function ot(t){const e={};return e.normal=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e.add=[t.ONE,t.ONE],e.multiply=[t.DST_COLOR,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA],e.screen=[t.ONE,t.ONE_MINUS_SRC_COLOR,t.ONE,t.ONE_MINUS_SRC_ALPHA],e.none=[0,0],e["normal-npm"]=[t.SRC_ALPHA,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA],e["add-npm"]=[t.SRC_ALPHA,t.ONE,t.ONE,t.ONE],e["screen-npm"]=[t.SRC_ALPHA,t.ONE_MINUS_SRC_COLOR,t.ONE,t.ONE_MINUS_SRC_ALPHA],e.erase=[t.ZERO,t.ONE_MINUS_SRC_ALPHA],e}const ct=0,ut=1,_t=2,ft=3,ht=4,lt=5,be=class C{constructor(){this.gl=null,this.stateId=0,this.polygonOffset=0,this.blendMode="none",this._blendEq=!1,this.map=[],this.map[ct]=this.setBlend,this.map[ut]=this.setOffset,this.map[_t]=this.setCullFace,this.map[ft]=this.setDepthTest,this.map[ht]=this.setFrontFace,this.map[lt]=this.setDepthMask,this.checks=[],this.defaultState=U.for2d()}contextChange(e){this.gl=e,this.blendModesMap=ot(e),this.reset()}set(e){if(e=e||this.defaultState,this.stateId!==e.data){let r=this.stateId^e.data,s=0;for(;r;)r&1&&this.map[s].call(this,!!(e.data&1<<s)),r=r>>1,s++;this.stateId=e.data}for(let r=0;r<this.checks.length;r++)this.checks[r](this,e)}forceState(e){e=e||this.defaultState;for(let r=0;r<this.map.length;r++)this.map[r].call(this,!!(e.data&1<<r));for(let r=0;r<this.checks.length;r++)this.checks[r](this,e);this.stateId=e.data}setBlend(e){this._updateCheck(C._checkBlendMode,e),this.gl[e?"enable":"disable"](this.gl.BLEND)}setOffset(e){this._updateCheck(C._checkPolygonOffset,e),this.gl[e?"enable":"disable"](this.gl.POLYGON_OFFSET_FILL)}setDepthTest(e){this.gl[e?"enable":"disable"](this.gl.DEPTH_TEST)}setDepthMask(e){this.gl.depthMask(e)}setCullFace(e){this.gl[e?"enable":"disable"](this.gl.CULL_FACE)}setFrontFace(e){this.gl.frontFace(this.gl[e?"CW":"CCW"])}setBlendMode(e){if(this.blendModesMap[e]||(e="normal"),e===this.blendMode)return;this.blendMode=e;const r=this.blendModesMap[e],s=this.gl;r.length===2?s.blendFunc(r[0],r[1]):s.blendFuncSeparate(r[0],r[1],r[2],r[3]),r.length===6?(this._blendEq=!0,s.blendEquationSeparate(r[4],r[5])):this._blendEq&&(this._blendEq=!1,s.blendEquationSeparate(s.FUNC_ADD,s.FUNC_ADD))}setPolygonOffset(e,r){this.gl.polygonOffset(e,r)}reset(){this.gl.pixelStorei(this.gl.UNPACK_FLIP_Y_WEBGL,!1),this.forceState(this.defaultState),this._blendEq=!0,this.blendMode="",this.setBlendMode("normal")}_updateCheck(e,r){const s=this.checks.indexOf(e);r&&s===-1?this.checks.push(e):!r&&s!==-1&&this.checks.splice(s,1)}static _checkBlendMode(e,r){e.setBlendMode(r.blendMode)}static _checkPolygonOffset(e,r){e.setPolygonOffset(1,r.polygonOffset)}destroy(){this.gl=null,this.checks.length=0}};be.extension={type:[l.WebGLSystem],name:"state"};let dt=be;class mt{constructor(e){this.target=ne.TEXTURE_2D,this.texture=e,this.width=-1,this.height=-1,this.type=f.UNSIGNED_BYTE,this.internalFormat=y.RGBA,this.format=y.RGBA,this.samplerType=0}}const Et={id:"buffer",upload(t,e,r){e.width===t.width||e.height===t.height?r.texSubImage2D(r.TEXTURE_2D,0,0,0,t.width,t.height,e.format,e.type,t.resource):r.texImage2D(e.target,0,e.internalFormat,t.width,t.height,0,e.format,e.type,t.resource),e.width=t.width,e.height=t.height}},bt={"bc1-rgba-unorm":!0,"bc1-rgba-unorm-srgb":!0,"bc2-rgba-unorm":!0,"bc2-rgba-unorm-srgb":!0,"bc3-rgba-unorm":!0,"bc3-rgba-unorm-srgb":!0,"bc4-r-unorm":!0,"bc4-r-snorm":!0,"bc5-rg-unorm":!0,"bc5-rg-snorm":!0,"bc6h-rgb-ufloat":!0,"bc6h-rgb-float":!0,"bc7-rgba-unorm":!0,"bc7-rgba-unorm-srgb":!0,"etc2-rgb8unorm":!0,"etc2-rgb8unorm-srgb":!0,"etc2-rgb8a1unorm":!0,"etc2-rgb8a1unorm-srgb":!0,"etc2-rgba8unorm":!0,"etc2-rgba8unorm-srgb":!0,"eac-r11unorm":!0,"eac-r11snorm":!0,"eac-rg11unorm":!0,"eac-rg11snorm":!0,"astc-4x4-unorm":!0,"astc-4x4-unorm-srgb":!0,"astc-5x4-unorm":!0,"astc-5x4-unorm-srgb":!0,"astc-5x5-unorm":!0,"astc-5x5-unorm-srgb":!0,"astc-6x5-unorm":!0,"astc-6x5-unorm-srgb":!0,"astc-6x6-unorm":!0,"astc-6x6-unorm-srgb":!0,"astc-8x5-unorm":!0,"astc-8x5-unorm-srgb":!0,"astc-8x6-unorm":!0,"astc-8x6-unorm-srgb":!0,"astc-8x8-unorm":!0,"astc-8x8-unorm-srgb":!0,"astc-10x5-unorm":!0,"astc-10x5-unorm-srgb":!0,"astc-10x6-unorm":!0,"astc-10x6-unorm-srgb":!0,"astc-10x8-unorm":!0,"astc-10x8-unorm-srgb":!0,"astc-10x10-unorm":!0,"astc-10x10-unorm-srgb":!0,"astc-12x10-unorm":!0,"astc-12x10-unorm-srgb":!0,"astc-12x12-unorm":!0,"astc-12x12-unorm-srgb":!0},St={id:"compressed",upload(t,e,r){r.pixelStorei(r.UNPACK_ALIGNMENT,4);let s=t.pixelWidth,n=t.pixelHeight;const i=!!bt[t.format];for(let a=0;a<t.resource.length;a++){const o=t.resource[a];i?r.compressedTexImage2D(r.TEXTURE_2D,a,e.internalFormat,s,n,0,o):r.texImage2D(r.TEXTURE_2D,a,e.internalFormat,s,n,0,e.format,e.type,o),s=Math.max(s>>1,1),n=Math.max(n>>1,1)}}},Se={id:"image",upload(t,e,r,s){const n=t.alphaMode==="premultiply-alpha-on-upload";r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,n);const i=e.width,a=e.height,o=t.pixelWidth,c=t.pixelHeight,u=t.resourceWidth,_=t.resourceHeight;u<o||_<c?((i!==o||a!==c)&&r.texImage2D(e.target,0,e.internalFormat,o,c,0,e.format,e.type,null),s===2?r.texSubImage2D(r.TEXTURE_2D,0,0,0,u,_,e.format,e.type,t.resource):r.texSubImage2D(r.TEXTURE_2D,0,0,0,e.format,e.type,t.resource)):i===o||a===c?r.texSubImage2D(r.TEXTURE_2D,0,0,0,e.format,e.type,t.resource):s===2?r.texImage2D(e.target,0,e.internalFormat,o,c,0,e.format,e.type,t.resource):r.texImage2D(e.target,0,e.internalFormat,e.format,e.type,t.resource),e.width=o,e.height=c}},pt={id:"video",upload(t,e,r,s){if(!t.isValid){r.texImage2D(e.target,0,e.internalFormat,1,1,0,e.format,e.type,null);return}Se.upload(t,e,r,s)}},W={linear:9729,nearest:9728},gt={linear:{linear:9987,nearest:9985},nearest:{linear:9986,nearest:9984}},D={"clamp-to-edge":33071,repeat:10497,"mirror-repeat":33648},Rt={never:512,less:513,equal:514,"less-equal":515,greater:516,"not-equal":517,"greater-equal":518,always:519};function j(t,e,r,s,n,i,a,o){const c=i;if(!o||t.addressModeU!=="repeat"||t.addressModeV!=="repeat"||t.addressModeW!=="repeat"){const u=D[a?"clamp-to-edge":t.addressModeU],_=D[a?"clamp-to-edge":t.addressModeV],h=D[a?"clamp-to-edge":t.addressModeW];e[n](c,e.TEXTURE_WRAP_S,u),e[n](c,e.TEXTURE_WRAP_T,_),e.TEXTURE_WRAP_R&&e[n](c,e.TEXTURE_WRAP_R,h)}if((!o||t.magFilter!=="linear")&&e[n](c,e.TEXTURE_MAG_FILTER,W[t.magFilter]),r){if(!o||t.mipmapFilter!=="linear"){const u=gt[t.minFilter][t.mipmapFilter];e[n](c,e.TEXTURE_MIN_FILTER,u)}}else e[n](c,e.TEXTURE_MIN_FILTER,W[t.minFilter]);if(s&&t.maxAnisotropy>1){const u=Math.min(t.maxAnisotropy,e.getParameter(s.MAX_TEXTURE_MAX_ANISOTROPY_EXT));e[n](c,s.TEXTURE_MAX_ANISOTROPY_EXT,u)}t.compare&&e[n](c,e.TEXTURE_COMPARE_FUNC,Rt[t.compare])}function Tt(t){return{r8unorm:t.RED,r8snorm:t.RED,r8uint:t.RED,r8sint:t.RED,r16uint:t.RED,r16sint:t.RED,r16float:t.RED,rg8unorm:t.RG,rg8snorm:t.RG,rg8uint:t.RG,rg8sint:t.RG,r32uint:t.RED,r32sint:t.RED,r32float:t.RED,rg16uint:t.RG,rg16sint:t.RG,rg16float:t.RG,rgba8unorm:t.RGBA,"rgba8unorm-srgb":t.RGBA,rgba8snorm:t.RGBA,rgba8uint:t.RGBA,rgba8sint:t.RGBA,bgra8unorm:t.RGBA,"bgra8unorm-srgb":t.RGBA,rgb9e5ufloat:t.RGB,rgb10a2unorm:t.RGBA,rg11b10ufloat:t.RGB,rg32uint:t.RG,rg32sint:t.RG,rg32float:t.RG,rgba16uint:t.RGBA,rgba16sint:t.RGBA,rgba16float:t.RGBA,rgba32uint:t.RGBA,rgba32sint:t.RGBA,rgba32float:t.RGBA,stencil8:t.STENCIL_INDEX8,depth16unorm:t.DEPTH_COMPONENT,depth24plus:t.DEPTH_COMPONENT,"depth24plus-stencil8":t.DEPTH_STENCIL,depth32float:t.DEPTH_COMPONENT,"depth32float-stencil8":t.DEPTH_STENCIL}}function vt(t,e){let r={},s=t.RGBA;return t instanceof G.get().getWebGLRenderingContext()?e.srgb&&(r={"rgba8unorm-srgb":e.srgb.SRGB8_ALPHA8_EXT,"bgra8unorm-srgb":e.srgb.SRGB8_ALPHA8_EXT}):(r={"rgba8unorm-srgb":t.SRGB8_ALPHA8,"bgra8unorm-srgb":t.SRGB8_ALPHA8},s=t.RGBA8),{r8unorm:t.R8,r8snorm:t.R8_SNORM,r8uint:t.R8UI,r8sint:t.R8I,r16uint:t.R16UI,r16sint:t.R16I,r16float:t.R16F,rg8unorm:t.RG8,rg8snorm:t.RG8_SNORM,rg8uint:t.RG8UI,rg8sint:t.RG8I,r32uint:t.R32UI,r32sint:t.R32I,r32float:t.R32F,rg16uint:t.RG16UI,rg16sint:t.RG16I,rg16float:t.RG16F,rgba8unorm:t.RGBA,...r,rgba8snorm:t.RGBA8_SNORM,rgba8uint:t.RGBA8UI,rgba8sint:t.RGBA8I,bgra8unorm:s,rgb9e5ufloat:t.RGB9_E5,rgb10a2unorm:t.RGB10_A2,rg11b10ufloat:t.R11F_G11F_B10F,rg32uint:t.RG32UI,rg32sint:t.RG32I,rg32float:t.RG32F,rgba16uint:t.RGBA16UI,rgba16sint:t.RGBA16I,rgba16float:t.RGBA16F,rgba32uint:t.RGBA32UI,rgba32sint:t.RGBA32I,rgba32float:t.RGBA32F,stencil8:t.STENCIL_INDEX8,depth16unorm:t.DEPTH_COMPONENT16,depth24plus:t.DEPTH_COMPONENT24,"depth24plus-stencil8":t.DEPTH24_STENCIL8,depth32float:t.DEPTH_COMPONENT32F,"depth32float-stencil8":t.DEPTH32F_STENCIL8,...e.s3tc?{"bc1-rgba-unorm":e.s3tc.COMPRESSED_RGBA_S3TC_DXT1_EXT,"bc2-rgba-unorm":e.s3tc.COMPRESSED_RGBA_S3TC_DXT3_EXT,"bc3-rgba-unorm":e.s3tc.COMPRESSED_RGBA_S3TC_DXT5_EXT}:{},...e.s3tc_sRGB?{"bc1-rgba-unorm-srgb":e.s3tc_sRGB.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT,"bc2-rgba-unorm-srgb":e.s3tc_sRGB.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT,"bc3-rgba-unorm-srgb":e.s3tc_sRGB.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}:{},...e.rgtc?{"bc4-r-unorm":e.rgtc.COMPRESSED_RED_RGTC1_EXT,"bc4-r-snorm":e.rgtc.COMPRESSED_SIGNED_RED_RGTC1_EXT,"bc5-rg-unorm":e.rgtc.COMPRESSED_RED_GREEN_RGTC2_EXT,"bc5-rg-snorm":e.rgtc.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}:{},...e.bptc?{"bc6h-rgb-float":e.bptc.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT,"bc6h-rgb-ufloat":e.bptc.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT,"bc7-rgba-unorm":e.bptc.COMPRESSED_RGBA_BPTC_UNORM_EXT,"bc7-rgba-unorm-srgb":e.bptc.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT}:{},...e.etc?{"etc2-rgb8unorm":e.etc.COMPRESSED_RGB8_ETC2,"etc2-rgb8unorm-srgb":e.etc.COMPRESSED_SRGB8_ETC2,"etc2-rgb8a1unorm":e.etc.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2,"etc2-rgb8a1unorm-srgb":e.etc.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2,"etc2-rgba8unorm":e.etc.COMPRESSED_RGBA8_ETC2_EAC,"etc2-rgba8unorm-srgb":e.etc.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC,"eac-r11unorm":e.etc.COMPRESSED_R11_EAC,"eac-rg11unorm":e.etc.COMPRESSED_SIGNED_RG11_EAC}:{},...e.astc?{"astc-4x4-unorm":e.astc.COMPRESSED_RGBA_ASTC_4x4_KHR,"astc-4x4-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR,"astc-5x4-unorm":e.astc.COMPRESSED_RGBA_ASTC_5x4_KHR,"astc-5x4-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR,"astc-5x5-unorm":e.astc.COMPRESSED_RGBA_ASTC_5x5_KHR,"astc-5x5-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR,"astc-6x5-unorm":e.astc.COMPRESSED_RGBA_ASTC_6x5_KHR,"astc-6x5-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR,"astc-6x6-unorm":e.astc.COMPRESSED_RGBA_ASTC_6x6_KHR,"astc-6x6-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR,"astc-8x5-unorm":e.astc.COMPRESSED_RGBA_ASTC_8x5_KHR,"astc-8x5-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR,"astc-8x6-unorm":e.astc.COMPRESSED_RGBA_ASTC_8x6_KHR,"astc-8x6-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR,"astc-8x8-unorm":e.astc.COMPRESSED_RGBA_ASTC_8x8_KHR,"astc-8x8-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR,"astc-10x5-unorm":e.astc.COMPRESSED_RGBA_ASTC_10x5_KHR,"astc-10x5-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR,"astc-10x6-unorm":e.astc.COMPRESSED_RGBA_ASTC_10x6_KHR,"astc-10x6-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR,"astc-10x8-unorm":e.astc.COMPRESSED_RGBA_ASTC_10x8_KHR,"astc-10x8-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR,"astc-10x10-unorm":e.astc.COMPRESSED_RGBA_ASTC_10x10_KHR,"astc-10x10-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR,"astc-12x10-unorm":e.astc.COMPRESSED_RGBA_ASTC_12x10_KHR,"astc-12x10-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR,"astc-12x12-unorm":e.astc.COMPRESSED_RGBA_ASTC_12x12_KHR,"astc-12x12-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR}:{}}}function xt(t){return{r8unorm:t.UNSIGNED_BYTE,r8snorm:t.BYTE,r8uint:t.UNSIGNED_BYTE,r8sint:t.BYTE,r16uint:t.UNSIGNED_SHORT,r16sint:t.SHORT,r16float:t.HALF_FLOAT,rg8unorm:t.UNSIGNED_BYTE,rg8snorm:t.BYTE,rg8uint:t.UNSIGNED_BYTE,rg8sint:t.BYTE,r32uint:t.UNSIGNED_INT,r32sint:t.INT,r32float:t.FLOAT,rg16uint:t.UNSIGNED_SHORT,rg16sint:t.SHORT,rg16float:t.HALF_FLOAT,rgba8unorm:t.UNSIGNED_BYTE,"rgba8unorm-srgb":t.UNSIGNED_BYTE,rgba8snorm:t.BYTE,rgba8uint:t.UNSIGNED_BYTE,rgba8sint:t.BYTE,bgra8unorm:t.UNSIGNED_BYTE,"bgra8unorm-srgb":t.UNSIGNED_BYTE,rgb9e5ufloat:t.UNSIGNED_INT_5_9_9_9_REV,rgb10a2unorm:t.UNSIGNED_INT_2_10_10_10_REV,rg11b10ufloat:t.UNSIGNED_INT_10F_11F_11F_REV,rg32uint:t.UNSIGNED_INT,rg32sint:t.INT,rg32float:t.FLOAT,rgba16uint:t.UNSIGNED_SHORT,rgba16sint:t.SHORT,rgba16float:t.HALF_FLOAT,rgba32uint:t.UNSIGNED_INT,rgba32sint:t.INT,rgba32float:t.FLOAT,stencil8:t.UNSIGNED_BYTE,depth16unorm:t.UNSIGNED_SHORT,depth24plus:t.UNSIGNED_INT,"depth24plus-stencil8":t.UNSIGNED_INT_24_8,depth32float:t.FLOAT,"depth32float-stencil8":t.FLOAT_32_UNSIGNED_INT_24_8_REV}}const At=4;class pe{constructor(e){this.managedTextures=[],this._glTextures=Object.create(null),this._glSamplers=Object.create(null),this._boundTextures=[],this._activeTextureLocation=-1,this._boundSamplers=Object.create(null),this._uploads={image:Se,buffer:Et,video:pt,compressed:St},this._useSeparateSamplers=!1,this._renderer=e}contextChange(e){this._gl=e,this._mapFormatToInternalFormat||(this._mapFormatToInternalFormat=vt(e,this._renderer.context.extensions),this._mapFormatToType=xt(e),this._mapFormatToFormat=Tt(e)),this._glTextures=Object.create(null),this._glSamplers=Object.create(null),this._boundSamplers=Object.create(null);for(let r=0;r<16;r++)this.bind(S.EMPTY,r)}initSource(e){this.bind(e)}bind(e,r=0){const s=e.source;e?(this.bindSource(s,r),this._useSeparateSamplers&&this._bindSampler(s.style,r)):(this.bindSource(null,r),this._useSeparateSamplers&&this._bindSampler(null,r))}bindSource(e,r=0){const s=this._gl;if(e._touched=this._renderer.textureGC.count,this._boundTextures[r]!==e){this._boundTextures[r]=e,this._activateLocation(r),e=e||S.EMPTY.source;const n=this.getGlSource(e);s.bindTexture(n.target,n.texture)}}_bindSampler(e,r=0){const s=this._gl;if(!e){this._boundSamplers[r]=null,s.bindSampler(r,null);return}const n=this._getGlSampler(e);this._boundSamplers[r]!==n&&(this._boundSamplers[r]=n,s.bindSampler(r,n))}unbind(e){const r=e.source,s=this._boundTextures,n=this._gl;for(let i=0;i<s.length;i++)if(s[i]===r){this._activateLocation(i);const a=this.getGlSource(r);n.bindTexture(a.target,null),s[i]=null}}_activateLocation(e){this._activeTextureLocation!==e&&(this._activeTextureLocation=e,this._gl.activeTexture(this._gl.TEXTURE0+e))}_initSource(e){const r=this._gl,s=new mt(r.createTexture());if(s.type=this._mapFormatToType[e.format],s.internalFormat=this._mapFormatToInternalFormat[e.format],s.format=this._mapFormatToFormat[e.format],e.autoGenerateMipmaps&&(this._renderer.context.supports.nonPowOf2mipmaps||e.isPowerOfTwo)){const n=Math.max(e.width,e.height);e.mipLevelCount=Math.floor(Math.log2(n))+1}return this._glTextures[e.uid]=s,this.managedTextures.includes(e)||(e.on("update",this.onSourceUpdate,this),e.on("resize",this.onSourceUpdate,this),e.on("styleChange",this.onStyleChange,this),e.on("destroy",this.onSourceDestroy,this),e.on("unload",this.onSourceUnload,this),e.on("updateMipmaps",this.onUpdateMipmaps,this),this.managedTextures.push(e)),this.onSourceUpdate(e),this.updateStyle(e,!1),s}onStyleChange(e){this.updateStyle(e,!1)}updateStyle(e,r){const s=this._gl,n=this.getGlSource(e);s.bindTexture(s.TEXTURE_2D,n.texture),this._boundTextures[this._activeTextureLocation]=e,j(e.style,s,e.mipLevelCount>1,this._renderer.context.extensions.anisotropicFiltering,"texParameteri",s.TEXTURE_2D,!this._renderer.context.supports.nonPowOf2wrapping&&!e.isPowerOfTwo,r)}onSourceUnload(e){const r=this._glTextures[e.uid];r&&(this.unbind(e),this._glTextures[e.uid]=null,this._gl.deleteTexture(r.texture))}onSourceUpdate(e){const r=this._gl,s=this.getGlSource(e);r.bindTexture(r.TEXTURE_2D,s.texture),this._boundTextures[this._activeTextureLocation]=e,this._uploads[e.uploadMethodId]?this._uploads[e.uploadMethodId].upload(e,s,r,this._renderer.context.webGLVersion):r.texImage2D(r.TEXTURE_2D,0,r.RGBA,e.pixelWidth,e.pixelHeight,0,r.RGBA,r.UNSIGNED_BYTE,null),e.autoGenerateMipmaps&&e.mipLevelCount>1&&this.onUpdateMipmaps(e,!1)}onUpdateMipmaps(e,r=!0){r&&this.bindSource(e,0);const s=this.getGlSource(e);this._gl.generateMipmap(s.target)}onSourceDestroy(e){e.off("destroy",this.onSourceDestroy,this),e.off("update",this.onSourceUpdate,this),e.off("resize",this.onSourceUpdate,this),e.off("unload",this.onSourceUnload,this),e.off("styleChange",this.onStyleChange,this),e.off("updateMipmaps",this.onUpdateMipmaps,this),this.managedTextures.splice(this.managedTextures.indexOf(e),1),this.onSourceUnload(e)}_initSampler(e){const r=this._gl,s=this._gl.createSampler();return this._glSamplers[e._resourceId]=s,j(e,r,this._boundTextures[this._activeTextureLocation].mipLevelCount>1,this._renderer.context.extensions.anisotropicFiltering,"samplerParameteri",s,!1,!0),this._glSamplers[e._resourceId]}_getGlSampler(e){return this._glSamplers[e._resourceId]||this._initSampler(e)}getGlSource(e){return this._glTextures[e.uid]||this._initSource(e)}generateCanvas(e){const{pixels:r,width:s,height:n}=this.getPixels(e),i=G.get().createCanvas();i.width=s,i.height=n;const a=i.getContext("2d");if(a){const o=a.createImageData(s,n);o.data.set(r),a.putImageData(o,0,0)}return i}getPixels(e){const r=e.source.resolution,s=e.frame,n=Math.max(Math.round(s.width*r),1),i=Math.max(Math.round(s.height*r),1),a=new Uint8Array(At*n*i),o=this._renderer,c=o.renderTarget.getRenderTarget(e),u=o.renderTarget.getGpuRenderTarget(c),_=o.gl;return _.bindFramebuffer(_.FRAMEBUFFER,u.resolveTargetFramebuffer),_.readPixels(Math.round(s.x*r),Math.round(s.y*r),n,i,_.RGBA,_.UNSIGNED_BYTE,a),{pixels:new Uint8ClampedArray(a.buffer),width:n,height:i}}destroy(){this.managedTextures.slice().forEach(e=>this.onSourceDestroy(e)),this.managedTextures=null,this._renderer=null}}pe.extension={type:[l.WebGLSystem],name:"texture"};class ge{init(){const e=new F({uColor:{value:new Float32Array([1,1,1,1]),type:"vec4<f32>"},uTransformMatrix:{value:new z,type:"mat3x3<f32>"},uRound:{value:0,type:"f32"}}),r=K(),s=O({name:"graphics",bits:[Y,q(r),Q,P]});this.shader=new x({glProgram:s,resources:{localUniforms:e,batchSamplers:J(r)}})}execute(e,r){const s=r.context,n=s.customShader||this.shader,i=e.renderer,a=i.graphicsContext,{geometry:o,instructions:c}=a.getContextRenderData(s);n.groups[0]=i.globalUniforms.bindGroup,i.state.set(e.state),i.shader.bind(n),i.geometry.bind(o,n.glProgram);const u=c.instructions;for(let _=0;_<c.instructionSize;_++){const h=u[_];if(h.size){for(let d=0;d<h.textures.textures.length;d++)i.texture.bind(h.textures.textures[d],d);i.geometry.draw("triangle-list",h.size,h.start)}}}destroy(){this.shader.destroy(!0),this.shader=null}}ge.extension={type:[l.WebGLPipesAdaptor],name:"graphics"};class Re{init(){const e=O({name:"mesh",bits:[Q,Pe,P]});this._shader=new x({glProgram:e,resources:{uTexture:S.EMPTY.source,textureUniforms:{uTextureMatrix:{type:"mat3x3<f32>",value:new z}}}})}execute(e,r){const s=e.renderer;let n=r._shader;if(n){if(!n.glProgram){m("Mesh shader has no glProgram",r.shader);return}}else{n=this._shader;const i=r.texture,a=i.source;n.resources.uTexture=a,n.resources.uSampler=a.style,n.resources.textureUniforms.uniforms.uTextureMatrix=i.textureMatrix.mapCoord}n.groups[100]=s.globalUniforms.bindGroup,n.groups[101]=e.localUniformsBindGroup,s.encoder.draw({geometry:r._geometry,shader:n,state:r.state})}destroy(){this._shader.destroy(!0),this._shader=null}}Re.extension={type:[l.WebGLPipesAdaptor],name:"mesh"};const Bt=[...Fe,fe,Xe,He,re,pe,he,ie,Ee,me,ce,dt,ue,oe],Nt=[...Me],It=[te,Re,ge],Te=[],ve=[],xe=[];v.handleByNamedList(l.WebGLSystem,Te);v.handleByNamedList(l.WebGLPipes,ve);v.handleByNamedList(l.WebGLPipesAdaptor,xe);v.add(...Bt,...Nt,...It);wt=class extends Be{constructor(){const e={name:"webgl",type:Ie.WEBGL,systems:Te,renderPipes:ve,renderPipeAdaptors:xe};super(e)}}});export{wt as WebGLRenderer,__tla}; `))}class Ee{constructor(e){this._cache={},this._uniformGroupSyncHash={},this._renderer=e,this.gl=null,this._cache={}}contextChange(e){this.gl=e}updateUniformGroup(e,r,s){const n=this._renderer.shader._getProgramData(r);(!e.isStatic||e._dirtyId!==n.uniformDirtyGroups[e.uid])&&(n.uniformDirtyGroups[e.uid]=e._dirtyId,this._getUniformSyncFunction(e,r)(n.uniformData,e.uniforms,this._renderer,s))}_getUniformSyncFunction(e,r){return this._uniformGroupSyncHash[e._signature]?.[r._key]||this._createUniformSyncFunction(e,r)}_createUniformSyncFunction(e,r){const s=this._uniformGroupSyncHash[e._signature]||(this._uniformGroupSyncHash[e._signature]={}),n=this._getSignature(e,r._uniformData,"u");return this._cache[n]||(this._cache[n]=this._generateUniformsSync(e,r._uniformData)),s[r._key]=this._cache[n],s[r._key]}_generateUniformsSync(e,r){return ot(e,r)}_getSignature(e,r,s){const n=e.uniforms,i=[`${s}-`];for(const a in n)i.push(a),r[a]&&i.push(r[a].type);return i.join("-")}destroy(){this._renderer=null,this._cache=null}}Ee.extension={type:[l.WebGLSystem],name:"uniformGroup"};function ct(t){const e={};return e.normal=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e.add=[t.ONE,t.ONE],e.multiply=[t.DST_COLOR,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA],e.screen=[t.ONE,t.ONE_MINUS_SRC_COLOR,t.ONE,t.ONE_MINUS_SRC_ALPHA],e.none=[0,0],e["normal-npm"]=[t.SRC_ALPHA,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA],e["add-npm"]=[t.SRC_ALPHA,t.ONE,t.ONE,t.ONE],e["screen-npm"]=[t.SRC_ALPHA,t.ONE_MINUS_SRC_COLOR,t.ONE,t.ONE_MINUS_SRC_ALPHA],e.erase=[t.ZERO,t.ONE_MINUS_SRC_ALPHA],e}const ut=0,_t=1,ft=2,ht=3,lt=4,dt=5,be=class C{constructor(){this.gl=null,this.stateId=0,this.polygonOffset=0,this.blendMode="none",this._blendEq=!1,this.map=[],this.map[ut]=this.setBlend,this.map[_t]=this.setOffset,this.map[ft]=this.setCullFace,this.map[ht]=this.setDepthTest,this.map[lt]=this.setFrontFace,this.map[dt]=this.setDepthMask,this.checks=[],this.defaultState=U.for2d()}contextChange(e){this.gl=e,this.blendModesMap=ct(e),this.reset()}set(e){if(e=e||this.defaultState,this.stateId!==e.data){let r=this.stateId^e.data,s=0;for(;r;)r&1&&this.map[s].call(this,!!(e.data&1<<s)),r=r>>1,s++;this.stateId=e.data}for(let r=0;r<this.checks.length;r++)this.checks[r](this,e)}forceState(e){e=e||this.defaultState;for(let r=0;r<this.map.length;r++)this.map[r].call(this,!!(e.data&1<<r));for(let r=0;r<this.checks.length;r++)this.checks[r](this,e);this.stateId=e.data}setBlend(e){this._updateCheck(C._checkBlendMode,e),this.gl[e?"enable":"disable"](this.gl.BLEND)}setOffset(e){this._updateCheck(C._checkPolygonOffset,e),this.gl[e?"enable":"disable"](this.gl.POLYGON_OFFSET_FILL)}setDepthTest(e){this.gl[e?"enable":"disable"](this.gl.DEPTH_TEST)}setDepthMask(e){this.gl.depthMask(e)}setCullFace(e){this.gl[e?"enable":"disable"](this.gl.CULL_FACE)}setFrontFace(e){this.gl.frontFace(this.gl[e?"CW":"CCW"])}setBlendMode(e){if(this.blendModesMap[e]||(e="normal"),e===this.blendMode)return;this.blendMode=e;const r=this.blendModesMap[e],s=this.gl;r.length===2?s.blendFunc(r[0],r[1]):s.blendFuncSeparate(r[0],r[1],r[2],r[3]),r.length===6?(this._blendEq=!0,s.blendEquationSeparate(r[4],r[5])):this._blendEq&&(this._blendEq=!1,s.blendEquationSeparate(s.FUNC_ADD,s.FUNC_ADD))}setPolygonOffset(e,r){this.gl.polygonOffset(e,r)}reset(){this.gl.pixelStorei(this.gl.UNPACK_FLIP_Y_WEBGL,!1),this.forceState(this.defaultState),this._blendEq=!0,this.blendMode="",this.setBlendMode("normal")}_updateCheck(e,r){const s=this.checks.indexOf(e);r&&s===-1?this.checks.push(e):!r&&s!==-1&&this.checks.splice(s,1)}static _checkBlendMode(e,r){e.setBlendMode(r.blendMode)}static _checkPolygonOffset(e,r){e.setPolygonOffset(1,r.polygonOffset)}destroy(){this.gl=null,this.checks.length=0}};be.extension={type:[l.WebGLSystem],name:"state"};let mt=be;class Et{constructor(e){this.target=ne.TEXTURE_2D,this.texture=e,this.width=-1,this.height=-1,this.type=f.UNSIGNED_BYTE,this.internalFormat=D.RGBA,this.format=D.RGBA,this.samplerType=0}}const bt={id:"buffer",upload(t,e,r){e.width===t.width||e.height===t.height?r.texSubImage2D(r.TEXTURE_2D,0,0,0,t.width,t.height,e.format,e.type,t.resource):r.texImage2D(e.target,0,e.internalFormat,t.width,t.height,0,e.format,e.type,t.resource),e.width=t.width,e.height=t.height}},St={"bc1-rgba-unorm":!0,"bc1-rgba-unorm-srgb":!0,"bc2-rgba-unorm":!0,"bc2-rgba-unorm-srgb":!0,"bc3-rgba-unorm":!0,"bc3-rgba-unorm-srgb":!0,"bc4-r-unorm":!0,"bc4-r-snorm":!0,"bc5-rg-unorm":!0,"bc5-rg-snorm":!0,"bc6h-rgb-ufloat":!0,"bc6h-rgb-float":!0,"bc7-rgba-unorm":!0,"bc7-rgba-unorm-srgb":!0,"etc2-rgb8unorm":!0,"etc2-rgb8unorm-srgb":!0,"etc2-rgb8a1unorm":!0,"etc2-rgb8a1unorm-srgb":!0,"etc2-rgba8unorm":!0,"etc2-rgba8unorm-srgb":!0,"eac-r11unorm":!0,"eac-r11snorm":!0,"eac-rg11unorm":!0,"eac-rg11snorm":!0,"astc-4x4-unorm":!0,"astc-4x4-unorm-srgb":!0,"astc-5x4-unorm":!0,"astc-5x4-unorm-srgb":!0,"astc-5x5-unorm":!0,"astc-5x5-unorm-srgb":!0,"astc-6x5-unorm":!0,"astc-6x5-unorm-srgb":!0,"astc-6x6-unorm":!0,"astc-6x6-unorm-srgb":!0,"astc-8x5-unorm":!0,"astc-8x5-unorm-srgb":!0,"astc-8x6-unorm":!0,"astc-8x6-unorm-srgb":!0,"astc-8x8-unorm":!0,"astc-8x8-unorm-srgb":!0,"astc-10x5-unorm":!0,"astc-10x5-unorm-srgb":!0,"astc-10x6-unorm":!0,"astc-10x6-unorm-srgb":!0,"astc-10x8-unorm":!0,"astc-10x8-unorm-srgb":!0,"astc-10x10-unorm":!0,"astc-10x10-unorm-srgb":!0,"astc-12x10-unorm":!0,"astc-12x10-unorm-srgb":!0,"astc-12x12-unorm":!0,"astc-12x12-unorm-srgb":!0},pt={id:"compressed",upload(t,e,r){r.pixelStorei(r.UNPACK_ALIGNMENT,4);let s=t.pixelWidth,n=t.pixelHeight;const i=!!St[t.format];for(let a=0;a<t.resource.length;a++){const o=t.resource[a];i?r.compressedTexImage2D(r.TEXTURE_2D,a,e.internalFormat,s,n,0,o):r.texImage2D(r.TEXTURE_2D,a,e.internalFormat,s,n,0,e.format,e.type,o),s=Math.max(s>>1,1),n=Math.max(n>>1,1)}}},Se={id:"image",upload(t,e,r,s){const n=t.alphaMode==="premultiply-alpha-on-upload";r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,n);const i=e.width,a=e.height,o=t.pixelWidth,c=t.pixelHeight,u=t.resourceWidth,_=t.resourceHeight;u<o||_<c?((i!==o||a!==c)&&r.texImage2D(e.target,0,e.internalFormat,o,c,0,e.format,e.type,null),s===2?r.texSubImage2D(r.TEXTURE_2D,0,0,0,u,_,e.format,e.type,t.resource):r.texSubImage2D(r.TEXTURE_2D,0,0,0,e.format,e.type,t.resource)):i===o||a===c?r.texSubImage2D(r.TEXTURE_2D,0,0,0,e.format,e.type,t.resource):s===2?r.texImage2D(e.target,0,e.internalFormat,o,c,0,e.format,e.type,t.resource):r.texImage2D(e.target,0,e.internalFormat,e.format,e.type,t.resource),e.width=o,e.height=c}},gt={id:"video",upload(t,e,r,s){if(!t.isValid){r.texImage2D(e.target,0,e.internalFormat,1,1,0,e.format,e.type,null);return}Se.upload(t,e,r,s)}},W={linear:9729,nearest:9728},Rt={linear:{linear:9987,nearest:9985},nearest:{linear:9986,nearest:9984}},y={"clamp-to-edge":33071,repeat:10497,"mirror-repeat":33648},Tt={never:512,less:513,equal:514,"less-equal":515,greater:516,"not-equal":517,"greater-equal":518,always:519};function j(t,e,r,s,n,i,a,o){const c=i;if(!o||t.addressModeU!=="repeat"||t.addressModeV!=="repeat"||t.addressModeW!=="repeat"){const u=y[a?"clamp-to-edge":t.addressModeU],_=y[a?"clamp-to-edge":t.addressModeV],h=y[a?"clamp-to-edge":t.addressModeW];e[n](c,e.TEXTURE_WRAP_S,u),e[n](c,e.TEXTURE_WRAP_T,_),e.TEXTURE_WRAP_R&&e[n](c,e.TEXTURE_WRAP_R,h)}if((!o||t.magFilter!=="linear")&&e[n](c,e.TEXTURE_MAG_FILTER,W[t.magFilter]),r){if(!o||t.mipmapFilter!=="linear"){const u=Rt[t.minFilter][t.mipmapFilter];e[n](c,e.TEXTURE_MIN_FILTER,u)}}else e[n](c,e.TEXTURE_MIN_FILTER,W[t.minFilter]);if(s&&t.maxAnisotropy>1){const u=Math.min(t.maxAnisotropy,e.getParameter(s.MAX_TEXTURE_MAX_ANISOTROPY_EXT));e[n](c,s.TEXTURE_MAX_ANISOTROPY_EXT,u)}t.compare&&e[n](c,e.TEXTURE_COMPARE_FUNC,Tt[t.compare])}function vt(t){return{r8unorm:t.RED,r8snorm:t.RED,r8uint:t.RED,r8sint:t.RED,r16uint:t.RED,r16sint:t.RED,r16float:t.RED,rg8unorm:t.RG,rg8snorm:t.RG,rg8uint:t.RG,rg8sint:t.RG,r32uint:t.RED,r32sint:t.RED,r32float:t.RED,rg16uint:t.RG,rg16sint:t.RG,rg16float:t.RG,rgba8unorm:t.RGBA,"rgba8unorm-srgb":t.RGBA,rgba8snorm:t.RGBA,rgba8uint:t.RGBA,rgba8sint:t.RGBA,bgra8unorm:t.RGBA,"bgra8unorm-srgb":t.RGBA,rgb9e5ufloat:t.RGB,rgb10a2unorm:t.RGBA,rg11b10ufloat:t.RGB,rg32uint:t.RG,rg32sint:t.RG,rg32float:t.RG,rgba16uint:t.RGBA,rgba16sint:t.RGBA,rgba16float:t.RGBA,rgba32uint:t.RGBA,rgba32sint:t.RGBA,rgba32float:t.RGBA,stencil8:t.STENCIL_INDEX8,depth16unorm:t.DEPTH_COMPONENT,depth24plus:t.DEPTH_COMPONENT,"depth24plus-stencil8":t.DEPTH_STENCIL,depth32float:t.DEPTH_COMPONENT,"depth32float-stencil8":t.DEPTH_STENCIL}}function xt(t,e){let r={},s=t.RGBA;return t instanceof G.get().getWebGLRenderingContext()?e.srgb&&(r={"rgba8unorm-srgb":e.srgb.SRGB8_ALPHA8_EXT,"bgra8unorm-srgb":e.srgb.SRGB8_ALPHA8_EXT}):(r={"rgba8unorm-srgb":t.SRGB8_ALPHA8,"bgra8unorm-srgb":t.SRGB8_ALPHA8},s=t.RGBA8),{r8unorm:t.R8,r8snorm:t.R8_SNORM,r8uint:t.R8UI,r8sint:t.R8I,r16uint:t.R16UI,r16sint:t.R16I,r16float:t.R16F,rg8unorm:t.RG8,rg8snorm:t.RG8_SNORM,rg8uint:t.RG8UI,rg8sint:t.RG8I,r32uint:t.R32UI,r32sint:t.R32I,r32float:t.R32F,rg16uint:t.RG16UI,rg16sint:t.RG16I,rg16float:t.RG16F,rgba8unorm:t.RGBA,...r,rgba8snorm:t.RGBA8_SNORM,rgba8uint:t.RGBA8UI,rgba8sint:t.RGBA8I,bgra8unorm:s,rgb9e5ufloat:t.RGB9_E5,rgb10a2unorm:t.RGB10_A2,rg11b10ufloat:t.R11F_G11F_B10F,rg32uint:t.RG32UI,rg32sint:t.RG32I,rg32float:t.RG32F,rgba16uint:t.RGBA16UI,rgba16sint:t.RGBA16I,rgba16float:t.RGBA16F,rgba32uint:t.RGBA32UI,rgba32sint:t.RGBA32I,rgba32float:t.RGBA32F,stencil8:t.STENCIL_INDEX8,depth16unorm:t.DEPTH_COMPONENT16,depth24plus:t.DEPTH_COMPONENT24,"depth24plus-stencil8":t.DEPTH24_STENCIL8,depth32float:t.DEPTH_COMPONENT32F,"depth32float-stencil8":t.DEPTH32F_STENCIL8,...e.s3tc?{"bc1-rgba-unorm":e.s3tc.COMPRESSED_RGBA_S3TC_DXT1_EXT,"bc2-rgba-unorm":e.s3tc.COMPRESSED_RGBA_S3TC_DXT3_EXT,"bc3-rgba-unorm":e.s3tc.COMPRESSED_RGBA_S3TC_DXT5_EXT}:{},...e.s3tc_sRGB?{"bc1-rgba-unorm-srgb":e.s3tc_sRGB.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT,"bc2-rgba-unorm-srgb":e.s3tc_sRGB.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT,"bc3-rgba-unorm-srgb":e.s3tc_sRGB.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}:{},...e.rgtc?{"bc4-r-unorm":e.rgtc.COMPRESSED_RED_RGTC1_EXT,"bc4-r-snorm":e.rgtc.COMPRESSED_SIGNED_RED_RGTC1_EXT,"bc5-rg-unorm":e.rgtc.COMPRESSED_RED_GREEN_RGTC2_EXT,"bc5-rg-snorm":e.rgtc.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}:{},...e.bptc?{"bc6h-rgb-float":e.bptc.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT,"bc6h-rgb-ufloat":e.bptc.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT,"bc7-rgba-unorm":e.bptc.COMPRESSED_RGBA_BPTC_UNORM_EXT,"bc7-rgba-unorm-srgb":e.bptc.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT}:{},...e.etc?{"etc2-rgb8unorm":e.etc.COMPRESSED_RGB8_ETC2,"etc2-rgb8unorm-srgb":e.etc.COMPRESSED_SRGB8_ETC2,"etc2-rgb8a1unorm":e.etc.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2,"etc2-rgb8a1unorm-srgb":e.etc.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2,"etc2-rgba8unorm":e.etc.COMPRESSED_RGBA8_ETC2_EAC,"etc2-rgba8unorm-srgb":e.etc.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC,"eac-r11unorm":e.etc.COMPRESSED_R11_EAC,"eac-rg11unorm":e.etc.COMPRESSED_SIGNED_RG11_EAC}:{},...e.astc?{"astc-4x4-unorm":e.astc.COMPRESSED_RGBA_ASTC_4x4_KHR,"astc-4x4-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR,"astc-5x4-unorm":e.astc.COMPRESSED_RGBA_ASTC_5x4_KHR,"astc-5x4-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR,"astc-5x5-unorm":e.astc.COMPRESSED_RGBA_ASTC_5x5_KHR,"astc-5x5-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR,"astc-6x5-unorm":e.astc.COMPRESSED_RGBA_ASTC_6x5_KHR,"astc-6x5-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR,"astc-6x6-unorm":e.astc.COMPRESSED_RGBA_ASTC_6x6_KHR,"astc-6x6-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR,"astc-8x5-unorm":e.astc.COMPRESSED_RGBA_ASTC_8x5_KHR,"astc-8x5-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR,"astc-8x6-unorm":e.astc.COMPRESSED_RGBA_ASTC_8x6_KHR,"astc-8x6-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR,"astc-8x8-unorm":e.astc.COMPRESSED_RGBA_ASTC_8x8_KHR,"astc-8x8-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR,"astc-10x5-unorm":e.astc.COMPRESSED_RGBA_ASTC_10x5_KHR,"astc-10x5-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR,"astc-10x6-unorm":e.astc.COMPRESSED_RGBA_ASTC_10x6_KHR,"astc-10x6-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR,"astc-10x8-unorm":e.astc.COMPRESSED_RGBA_ASTC_10x8_KHR,"astc-10x8-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR,"astc-10x10-unorm":e.astc.COMPRESSED_RGBA_ASTC_10x10_KHR,"astc-10x10-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR,"astc-12x10-unorm":e.astc.COMPRESSED_RGBA_ASTC_12x10_KHR,"astc-12x10-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR,"astc-12x12-unorm":e.astc.COMPRESSED_RGBA_ASTC_12x12_KHR,"astc-12x12-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR}:{}}}function Bt(t){return{r8unorm:t.UNSIGNED_BYTE,r8snorm:t.BYTE,r8uint:t.UNSIGNED_BYTE,r8sint:t.BYTE,r16uint:t.UNSIGNED_SHORT,r16sint:t.SHORT,r16float:t.HALF_FLOAT,rg8unorm:t.UNSIGNED_BYTE,rg8snorm:t.BYTE,rg8uint:t.UNSIGNED_BYTE,rg8sint:t.BYTE,r32uint:t.UNSIGNED_INT,r32sint:t.INT,r32float:t.FLOAT,rg16uint:t.UNSIGNED_SHORT,rg16sint:t.SHORT,rg16float:t.HALF_FLOAT,rgba8unorm:t.UNSIGNED_BYTE,"rgba8unorm-srgb":t.UNSIGNED_BYTE,rgba8snorm:t.BYTE,rgba8uint:t.UNSIGNED_BYTE,rgba8sint:t.BYTE,bgra8unorm:t.UNSIGNED_BYTE,"bgra8unorm-srgb":t.UNSIGNED_BYTE,rgb9e5ufloat:t.UNSIGNED_INT_5_9_9_9_REV,rgb10a2unorm:t.UNSIGNED_INT_2_10_10_10_REV,rg11b10ufloat:t.UNSIGNED_INT_10F_11F_11F_REV,rg32uint:t.UNSIGNED_INT,rg32sint:t.INT,rg32float:t.FLOAT,rgba16uint:t.UNSIGNED_SHORT,rgba16sint:t.SHORT,rgba16float:t.HALF_FLOAT,rgba32uint:t.UNSIGNED_INT,rgba32sint:t.INT,rgba32float:t.FLOAT,stencil8:t.UNSIGNED_BYTE,depth16unorm:t.UNSIGNED_SHORT,depth24plus:t.UNSIGNED_INT,"depth24plus-stencil8":t.UNSIGNED_INT_24_8,depth32float:t.FLOAT,"depth32float-stencil8":t.FLOAT_32_UNSIGNED_INT_24_8_REV}}const At=4;class pe{constructor(e){this.managedTextures=[],this._glTextures=Object.create(null),this._glSamplers=Object.create(null),this._boundTextures=[],this._activeTextureLocation=-1,this._boundSamplers=Object.create(null),this._uploads={image:Se,buffer:bt,video:gt,compressed:pt},this._useSeparateSamplers=!1,this._renderer=e}contextChange(e){this._gl=e,this._mapFormatToInternalFormat||(this._mapFormatToInternalFormat=xt(e,this._renderer.context.extensions),this._mapFormatToType=Bt(e),this._mapFormatToFormat=vt(e)),this._glTextures=Object.create(null),this._glSamplers=Object.create(null),this._boundSamplers=Object.create(null);for(let r=0;r<16;r++)this.bind(S.EMPTY,r)}initSource(e){this.bind(e)}bind(e,r=0){const s=e.source;e?(this.bindSource(s,r),this._useSeparateSamplers&&this._bindSampler(s.style,r)):(this.bindSource(null,r),this._useSeparateSamplers&&this._bindSampler(null,r))}bindSource(e,r=0){const s=this._gl;if(e._touched=this._renderer.textureGC.count,this._boundTextures[r]!==e){this._boundTextures[r]=e,this._activateLocation(r),e=e||S.EMPTY.source;const n=this.getGlSource(e);s.bindTexture(n.target,n.texture)}}_bindSampler(e,r=0){const s=this._gl;if(!e){this._boundSamplers[r]=null,s.bindSampler(r,null);return}const n=this._getGlSampler(e);this._boundSamplers[r]!==n&&(this._boundSamplers[r]=n,s.bindSampler(r,n))}unbind(e){const r=e.source,s=this._boundTextures,n=this._gl;for(let i=0;i<s.length;i++)if(s[i]===r){this._activateLocation(i);const a=this.getGlSource(r);n.bindTexture(a.target,null),s[i]=null}}_activateLocation(e){this._activeTextureLocation!==e&&(this._activeTextureLocation=e,this._gl.activeTexture(this._gl.TEXTURE0+e))}_initSource(e){const r=this._gl,s=new Et(r.createTexture());if(s.type=this._mapFormatToType[e.format],s.internalFormat=this._mapFormatToInternalFormat[e.format],s.format=this._mapFormatToFormat[e.format],e.autoGenerateMipmaps&&(this._renderer.context.supports.nonPowOf2mipmaps||e.isPowerOfTwo)){const n=Math.max(e.width,e.height);e.mipLevelCount=Math.floor(Math.log2(n))+1}return this._glTextures[e.uid]=s,this.managedTextures.includes(e)||(e.on("update",this.onSourceUpdate,this),e.on("resize",this.onSourceUpdate,this),e.on("styleChange",this.onStyleChange,this),e.on("destroy",this.onSourceDestroy,this),e.on("unload",this.onSourceUnload,this),e.on("updateMipmaps",this.onUpdateMipmaps,this),this.managedTextures.push(e)),this.onSourceUpdate(e),this.updateStyle(e,!1),s}onStyleChange(e){this.updateStyle(e,!1)}updateStyle(e,r){const s=this._gl,n=this.getGlSource(e);s.bindTexture(s.TEXTURE_2D,n.texture),this._boundTextures[this._activeTextureLocation]=e,j(e.style,s,e.mipLevelCount>1,this._renderer.context.extensions.anisotropicFiltering,"texParameteri",s.TEXTURE_2D,!this._renderer.context.supports.nonPowOf2wrapping&&!e.isPowerOfTwo,r)}onSourceUnload(e){const r=this._glTextures[e.uid];r&&(this.unbind(e),this._glTextures[e.uid]=null,this._gl.deleteTexture(r.texture))}onSourceUpdate(e){const r=this._gl,s=this.getGlSource(e);r.bindTexture(r.TEXTURE_2D,s.texture),this._boundTextures[this._activeTextureLocation]=e,this._uploads[e.uploadMethodId]?this._uploads[e.uploadMethodId].upload(e,s,r,this._renderer.context.webGLVersion):r.texImage2D(r.TEXTURE_2D,0,r.RGBA,e.pixelWidth,e.pixelHeight,0,r.RGBA,r.UNSIGNED_BYTE,null),e.autoGenerateMipmaps&&e.mipLevelCount>1&&this.onUpdateMipmaps(e,!1)}onUpdateMipmaps(e,r=!0){r&&this.bindSource(e,0);const s=this.getGlSource(e);this._gl.generateMipmap(s.target)}onSourceDestroy(e){e.off("destroy",this.onSourceDestroy,this),e.off("update",this.onSourceUpdate,this),e.off("resize",this.onSourceUpdate,this),e.off("unload",this.onSourceUnload,this),e.off("styleChange",this.onStyleChange,this),e.off("updateMipmaps",this.onUpdateMipmaps,this),this.managedTextures.splice(this.managedTextures.indexOf(e),1),this.onSourceUnload(e)}_initSampler(e){const r=this._gl,s=this._gl.createSampler();return this._glSamplers[e._resourceId]=s,j(e,r,this._boundTextures[this._activeTextureLocation].mipLevelCount>1,this._renderer.context.extensions.anisotropicFiltering,"samplerParameteri",s,!1,!0),this._glSamplers[e._resourceId]}_getGlSampler(e){return this._glSamplers[e._resourceId]||this._initSampler(e)}getGlSource(e){return this._glTextures[e.uid]||this._initSource(e)}generateCanvas(e){const{pixels:r,width:s,height:n}=this.getPixels(e),i=G.get().createCanvas();i.width=s,i.height=n;const a=i.getContext("2d");if(a){const o=a.createImageData(s,n);o.data.set(r),a.putImageData(o,0,0)}return i}getPixels(e){const r=e.source.resolution,s=e.frame,n=Math.max(Math.round(s.width*r),1),i=Math.max(Math.round(s.height*r),1),a=new Uint8Array(At*n*i),o=this._renderer,c=o.renderTarget.getRenderTarget(e),u=o.renderTarget.getGpuRenderTarget(c),_=o.gl;return _.bindFramebuffer(_.FRAMEBUFFER,u.resolveTargetFramebuffer),_.readPixels(Math.round(s.x*r),Math.round(s.y*r),n,i,_.RGBA,_.UNSIGNED_BYTE,a),{pixels:new Uint8ClampedArray(a.buffer),width:n,height:i}}destroy(){this.managedTextures.slice().forEach(e=>this.onSourceDestroy(e)),this.managedTextures=null,this._renderer=null}}pe.extension={type:[l.WebGLSystem],name:"texture"};class ge{init(){const e=new F({uColor:{value:new Float32Array([1,1,1,1]),type:"vec4<f32>"},uTransformMatrix:{value:new z,type:"mat3x3<f32>"},uRound:{value:0,type:"f32"}}),r=K(),s=O({name:"graphics",bits:[Y,q(r),Q,P]});this.shader=new x({glProgram:s,resources:{localUniforms:e,batchSamplers:J(r)}})}execute(e,r){const s=r.context,n=s.customShader||this.shader,i=e.renderer,a=i.graphicsContext,{geometry:o,instructions:c}=a.getContextRenderData(s);n.groups[0]=i.globalUniforms.bindGroup,i.state.set(e.state),i.shader.bind(n),i.geometry.bind(o,n.glProgram);const u=c.instructions;for(let _=0;_<c.instructionSize;_++){const h=u[_];if(h.size){for(let d=0;d<h.textures.textures.length;d++)i.texture.bind(h.textures.textures[d],d);i.geometry.draw("triangle-list",h.size,h.start)}}}destroy(){this.shader.destroy(!0),this.shader=null}}ge.extension={type:[l.WebGLPipesAdaptor],name:"graphics"};class Re{init(){const e=O({name:"mesh",bits:[Q,Fe,P]});this._shader=new x({glProgram:e,resources:{uTexture:S.EMPTY.source,textureUniforms:{uTextureMatrix:{type:"mat3x3<f32>",value:new z}}}})}execute(e,r){const s=e.renderer;let n=r._shader;if(n){if(!n.glProgram){m("Mesh shader has no glProgram",r.shader);return}}else{n=this._shader;const i=r.texture,a=i.source;n.resources.uTexture=a,n.resources.uSampler=a.style,n.resources.textureUniforms.uniforms.uTextureMatrix=i.textureMatrix.mapCoord}n.groups[100]=s.globalUniforms.bindGroup,n.groups[101]=e.localUniformsBindGroup,s.encoder.draw({geometry:r._geometry,shader:n,state:r.state})}destroy(){this._shader.destroy(!0),this._shader=null}}Re.extension={type:[l.WebGLPipesAdaptor],name:"mesh"};const Nt=[...Me,fe,We,we,re,pe,he,ie,Ee,me,ce,mt,ue,oe],It=[...Le],yt=[te,Re,ge],Te=[],ve=[],xe=[];v.handleByNamedList(l.WebGLSystem,Te);v.handleByNamedList(l.WebGLPipes,ve);v.handleByNamedList(l.WebGLPipesAdaptor,xe);v.add(...Nt,...It,...yt);kt=class extends Ne{constructor(){const e={name:"webgl",type:ye.WEBGL,systems:Te,renderPipes:ve,renderPipeAdaptors:xe};super(e)}}});export{kt as WebGLRenderer,__tla};

View File

@@ -1,41 +0,0 @@
import{m as R,g as E,E as l,f as ie,S as P,B as S,b as ne,c as A,d as b,h as oe,i as ae,D as ue,M as k,j as M,w as ce,e as G,A as de,__tla as __tla_0}from"./TorrentDetail-BZZ-B8cw.js";import{S as D,c as T,a as z,g as L,r as C,b as v,d as he,U as pe,l as le,e as fe,R as me,__tla as __tla_1}from"./colorToUniform-pFJ8sYB5.js";import{c as ge,u as _e,U as be,B as ye,G as xe,e as Ge,R as Be,t as Se,S as Pe,a as Te,__tla as __tla_2}from"./SharedSystems-xfG8Wu9d.js";import{C as w,__tla as __tla_3}from"./CanvasPool-DIOMPpzz.js";import{__tla as __tla_4}from"./MoveTorrentDialog.vue_vue_type_script_setup_true_lang-G1lEzMcG.js";import{__tla as __tla_5}from"./index-DF2-l4SD.js";import"./vue-BQgCUbk_.js";import"./vuetify-DWkLi8Ew.js";import{__tla as __tla_6}from"./MixedButton.vue_vue_type_script_setup_true_lang-QFpliKgB.js";import"./FileIcon-DH65fwz5.js";import{__tla as __tla_7}from"./MoveTorrentFileDialog.vue_vue_type_script_setup_true_lang-DEnRCAW6.js";let tt;let __tla=Promise.all([(()=>{try{return __tla_0}catch{}})(),(()=>{try{return __tla_1}catch{}})(),(()=>{try{return __tla_2}catch{}})(),(()=>{try{return __tla_3}catch{}})(),(()=>{try{return __tla_4}catch{}})(),(()=>{try{return __tla_5}catch{}})(),(()=>{try{return __tla_6}catch{}})(),(()=>{try{return __tla_7}catch{}})()]).then(async()=>{const y=D.for2d();class O{init(){const e=T({name:"batch",bits:[z,L(R()),C]});this._shader=new v({gpuProgram:e,groups:{}})}start(e,t){const r=e.renderer,s=r.encoder,i=this._shader.gpuProgram;this._geometry=t,s.setGeometry(t),y.blendMode="normal",r.pipeline.getPipeline(t,i,y);const n=r.globalUniforms.bindGroup;s.resetBindGroup(1),s.setBindGroup(0,n,i)}execute(e,t){const r=this._shader.gpuProgram,s=e.renderer,i=s.encoder;if(!t.bindGroup){const u=t.textures;t.bindGroup=E(u.textures,u.count)}y.blendMode=t.blendMode;const n=s.bindGroup.getBindGroup(t.bindGroup,r,1),o=s.pipeline.getPipeline(this._geometry,r,y);t.bindGroup._touch(s.textureGC.count),i.setPipeline(o),i.renderPassEncoder.setBindGroup(1,n),i.renderPassEncoder.drawIndexed(t.size,1,t.start)}destroy(){this._shader.destroy(!0),this._shader=null}}O.extension={type:[l.WebGPUPipesAdaptor],name:"batch"};class H{constructor(e){this._hash=Object.create(null),this._renderer=e}contextChange(e){this._gpu=e}getBindGroup(e,t,r){return e._updateKey(),this._hash[e._key]||this._createBindGroup(e,t,r)}_createBindGroup(e,t,r){const s=this._gpu.device,i=t.layout[r],n=[],o=this._renderer;for(const f in i){const h=e.resources[f]??e.resources[i[f]];let p;if(h._resourceType==="uniformGroup"){const d=h;o.ubo.updateUniformGroup(d);const m=d.buffer;p={buffer:o.buffer.getGPUBuffer(m),offset:0,size:m.descriptor.size}}else if(h._resourceType==="buffer"){const d=h;p={buffer:o.buffer.getGPUBuffer(d),offset:0,size:d.descriptor.size}}else if(h._resourceType==="bufferResource"){const d=h;p={buffer:o.buffer.getGPUBuffer(d.buffer),offset:d.offset,size:d.size}}else if(h._resourceType==="textureSampler"){const d=h;p=o.texture.getGpuSampler(d)}else if(h._resourceType==="textureSource"){const d=h;p=o.texture.getGpuSource(d).createView({})}n.push({binding:i[f],resource:p})}const u=o.shader.getProgramData(t).bindGroups[r],c=s.createBindGroup({layout:u,entries:n});return this._hash[e._key]=c,c}destroy(){for(const e of Object.keys(this._hash))this._hash[e]=null;this._hash=null,this._renderer=null}}H.extension={type:[l.WebGPUSystem],name:"bindGroup"};class F{constructor(){this._gpuBuffers=Object.create(null),this._managedBuffers=[]}contextChange(e){this._gpu=e}getGPUBuffer(e){return this._gpuBuffers[e.uid]||this.createGPUBuffer(e)}updateBuffer(e){const t=this._gpuBuffers[e.uid]||this.createGPUBuffer(e),r=e.data;return e._updateID&&r&&(e._updateID=0,this._gpu.device.queue.writeBuffer(t,0,r.buffer,0,(e._updateSize||r.byteLength)+3&-4)),t}destroyAll(){for(const e in this._gpuBuffers)this._gpuBuffers[e].destroy();this._gpuBuffers={}}createGPUBuffer(e){this._gpuBuffers[e.uid]||(e.on("update",this.updateBuffer,this),e.on("change",this.onBufferChange,this),e.on("destroy",this.onBufferDestroy,this));const t=this._gpu.device.createBuffer(e.descriptor);return e._updateID=0,e.data&&(ie(e.data.buffer,t.getMappedRange()),t.unmap()),this._gpuBuffers[e.uid]=t,this._managedBuffers.push(e),t}onBufferChange(e){this._gpuBuffers[e.uid].destroy(),e._updateID=0,this._gpuBuffers[e.uid]=this.createGPUBuffer(e)}onBufferDestroy(e){this._managedBuffers.splice(this._managedBuffers.indexOf(e),1),this._destroyBuffer(e)}destroy(){this._managedBuffers.forEach(e=>this._destroyBuffer(e)),this._managedBuffers=null,this._gpuBuffers=null}_destroyBuffer(e){this._gpuBuffers[e.uid].destroy(),e.off("update",this.updateBuffer,this),e.off("change",this.onBufferChange,this),e.off("destroy",this.onBufferDestroy,this),this._gpuBuffers[e.uid]=null}}F.extension={type:[l.WebGPUSystem],name:"buffer"};class Ce{constructor({minUniformOffsetAlignment:e}){this._minUniformOffsetAlignment=256,this.byteIndex=0,this._minUniformOffsetAlignment=e,this.data=new Float32Array(65535)}clear(){this.byteIndex=0}addEmptyGroup(e){if(e>this._minUniformOffsetAlignment/4)throw new Error(`UniformBufferBatch: array is too large: ${e*4}`);const t=this.byteIndex;let r=t+e*4;if(r=Math.ceil(r/this._minUniformOffsetAlignment)*this._minUniformOffsetAlignment,r>this.data.length*4)throw new Error("UniformBufferBatch: ubo batch got too big");return this.byteIndex=r,t}addGroup(e){const t=this.addEmptyGroup(e.length);for(let r=0;r<e.length;r++)this.data[t/4+r]=e[r];return t}destroy(){this._buffer.destroy(),this._buffer=null,this.data=null}}class I{constructor(e){this._colorMaskCache=15,this._renderer=e}setMask(e){this._colorMaskCache!==e&&(this._colorMaskCache=e,this._renderer.pipeline.setColorMask(e))}destroy(){this._renderer=null,this._colorMaskCache=null}}I.extension={type:[l.WebGPUSystem],name:"colorMask"};class U{constructor(e){this._renderer=e}async init(e){return this._initPromise?this._initPromise:(this._initPromise=this._createDeviceAndAdaptor(e).then(t=>{this.gpu=t,this._renderer.runners.contextChange.emit(this.gpu)}),this._initPromise)}contextChange(e){this._renderer.gpu=e}async _createDeviceAndAdaptor(e){const t=await navigator.gpu.requestAdapter({powerPreference:e.powerPreference,forceFallbackAdapter:e.forceFallbackAdapter}),r=["texture-compression-bc","texture-compression-astc","texture-compression-etc2"].filter(i=>t.features.has(i)),s=await t.requestDevice({requiredFeatures:r});return{adapter:t,device:s}}destroy(){this.gpu=null,this._renderer=null}}U.extension={type:[l.WebGPUSystem],name:"device"};U.defaultOptions={powerPreference:void 0,forceFallbackAdapter:!1};class W{constructor(e){this._boundBindGroup=Object.create(null),this._boundVertexBuffer=Object.create(null),this._renderer=e}renderStart(){this.commandFinished=new Promise(e=>{this._resolveCommandFinished=e}),this.commandEncoder=this._renderer.gpu.device.createCommandEncoder()}beginRenderPass(e){this.endRenderPass(),this._clearCache(),this.renderPassEncoder=this.commandEncoder.beginRenderPass(e.descriptor)}endRenderPass(){this.renderPassEncoder&&this.renderPassEncoder.end(),this.renderPassEncoder=null}setViewport(e){this.renderPassEncoder.setViewport(e.x,e.y,e.width,e.height,0,1)}setPipelineFromGeometryProgramAndState(e,t,r,s){const i=this._renderer.pipeline.getPipeline(e,t,r,s);this.setPipeline(i)}setPipeline(e){this._boundPipeline!==e&&(this._boundPipeline=e,this.renderPassEncoder.setPipeline(e))}_setVertexBuffer(e,t){this._boundVertexBuffer[e]!==t&&(this._boundVertexBuffer[e]=t,this.renderPassEncoder.setVertexBuffer(e,this._renderer.buffer.updateBuffer(t)))}_setIndexBuffer(e){if(this._boundIndexBuffer===e)return;this._boundIndexBuffer=e;const t=e.data.BYTES_PER_ELEMENT===2?"uint16":"uint32";this.renderPassEncoder.setIndexBuffer(this._renderer.buffer.updateBuffer(e),t)}resetBindGroup(e){this._boundBindGroup[e]=null}setBindGroup(e,t,r){if(this._boundBindGroup[e]===t)return;this._boundBindGroup[e]=t,t._touch(this._renderer.textureGC.count);const s=this._renderer.bindGroup.getBindGroup(t,r,e);this.renderPassEncoder.setBindGroup(e,s)}setGeometry(e){for(const t in e.attributes){const r=e.attributes[t];this._setVertexBuffer(r.location,r.buffer)}e.indexBuffer&&this._setIndexBuffer(e.indexBuffer)}_setShaderBindGroups(e,t){for(const r in e.groups){const s=e.groups[r];t||this._syncBindGroup(s),this.setBindGroup(r,s,e.gpuProgram)}}_syncBindGroup(e){for(const t in e.resources){const r=e.resources[t];r.isUniformGroup&&this._renderer.ubo.updateUniformGroup(r)}}draw(e){const{geometry:t,shader:r,state:s,topology:i,size:n,start:o,instanceCount:u,skipSync:c}=e;this.setPipelineFromGeometryProgramAndState(t,r.gpuProgram,s,i),this.setGeometry(t),this._setShaderBindGroups(r,c),t.indexBuffer?this.renderPassEncoder.drawIndexed(n||t.indexBuffer.data.length,u||t.instanceCount,o||0):this.renderPassEncoder.draw(n||t.getSize(),u||t.instanceCount,o||0)}finishRenderPass(){this.renderPassEncoder&&(this.renderPassEncoder.end(),this.renderPassEncoder=null)}postrender(){this.finishRenderPass(),this._gpu.device.queue.submit([this.commandEncoder.finish()]),this._resolveCommandFinished(),this.commandEncoder=null}restoreRenderPass(){const e=this._renderer.renderTarget.adaptor.getDescriptor(this._renderer.renderTarget.renderTarget,!1,[0,0,0,1]);this.renderPassEncoder=this.commandEncoder.beginRenderPass(e);const t=this._boundPipeline,r={...this._boundVertexBuffer},s=this._boundIndexBuffer,i={...this._boundBindGroup};this._clearCache();const n=this._renderer.renderTarget.viewport;this.renderPassEncoder.setViewport(n.x,n.y,n.width,n.height,0,1),this.setPipeline(t);for(const o in r)this._setVertexBuffer(o,r[o]);for(const o in i)this.setBindGroup(o,i[o],null);this._setIndexBuffer(s)}_clearCache(){for(let e=0;e<16;e++)this._boundBindGroup[e]=null,this._boundVertexBuffer[e]=null;this._boundIndexBuffer=null,this._boundPipeline=null}destroy(){this._renderer=null,this._gpu=null,this._boundBindGroup=null,this._boundVertexBuffer=null,this._boundIndexBuffer=null,this._boundPipeline=null}contextChange(e){this._gpu=e}}W.extension={type:[l.WebGPUSystem],name:"encoder",priority:1};class V{constructor(e){this._renderTargetStencilState=Object.create(null),this._renderer=e,e.renderTarget.onRenderTargetChange.add(this)}onRenderTargetChange(e){let t=this._renderTargetStencilState[e.uid];t||(t=this._renderTargetStencilState[e.uid]={stencilMode:P.DISABLED,stencilReference:0}),this._activeRenderTarget=e,this.setStencilMode(t.stencilMode,t.stencilReference)}setStencilMode(e,t){const r=this._renderTargetStencilState[this._activeRenderTarget.uid];r.stencilMode=e,r.stencilReference=t;const s=this._renderer;s.pipeline.setStencilMode(e),s.encoder.renderPassEncoder.setStencilReference(t)}destroy(){this._renderer.renderTarget.onRenderTargetChange.remove(this),this._renderer=null,this._activeRenderTarget=null,this._renderTargetStencilState=null}}V.extension={type:[l.WebGPUSystem],name:"stencil"};const x={i32:{align:4,size:4},u32:{align:4,size:4},f32:{align:4,size:4},f16:{align:2,size:2},"vec2<i32>":{align:8,size:8},"vec2<u32>":{align:8,size:8},"vec2<f32>":{align:8,size:8},"vec2<f16>":{align:4,size:4},"vec3<i32>":{align:16,size:12},"vec3<u32>":{align:16,size:12},"vec3<f32>":{align:16,size:12},"vec3<f16>":{align:8,size:6},"vec4<i32>":{align:16,size:16},"vec4<u32>":{align:16,size:16},"vec4<f32>":{align:16,size:16},"vec4<f16>":{align:8,size:8},"mat2x2<f32>":{align:8,size:16},"mat2x2<f16>":{align:4,size:8},"mat3x2<f32>":{align:8,size:24},"mat3x2<f16>":{align:4,size:12},"mat4x2<f32>":{align:8,size:32},"mat4x2<f16>":{align:4,size:16},"mat2x3<f32>":{align:16,size:32},"mat2x3<f16>":{align:8,size:16},"mat3x3<f32>":{align:16,size:48},"mat3x3<f16>":{align:8,size:24},"mat4x3<f32>":{align:16,size:64},"mat4x3<f16>":{align:8,size:32},"mat2x4<f32>":{align:16,size:32},"mat2x4<f16>":{align:8,size:16},"mat3x4<f32>":{align:16,size:48},"mat3x4<f16>":{align:8,size:24},"mat4x4<f32>":{align:16,size:64},"mat4x4<f16>":{align:8,size:32}};function ve(a){const e=a.map(r=>({data:r,offset:0,size:0}));let t=0;for(let r=0;r<e.length;r++){const s=e[r];let i=x[s.data.type].size;const n=x[s.data.type].align;if(!x[s.data.type])throw new Error(`[Pixi.js] WebGPU UniformBuffer: Unknown type ${s.data.type}`);s.data.size>1&&(i=Math.max(i,n)*s.data.size),t=Math.ceil(t/n)*n,s.size=i,s.offset=t,t+=i}return t=Math.ceil(t/16)*16,{uboElements:e,size:t}}function Ue(a,e){const{size:t,align:r}=x[a.data.type],s=(r-t)/4;return`
v = uv.${a.data.name};
${e!==0?`offset += ${e};`:""}
arrayOffset = offset;
t = 0;
for(var i=0; i < ${a.data.size*(t/4)}; i++)
{
for(var j = 0; j < ${t/4}; j++)
{
data[arrayOffset++] = v[t++];
}
${s!==0?`arrayOffset += ${s};`:""}
}
`}function Me(a){return ge(a,"uboWgsl",Ue,_e)}class j extends be{constructor(){super({createUboElements:ve,generateUboSync:Me})}}j.extension={type:[l.WebGPUSystem],name:"ubo"};const _=128;class N{constructor(e){this._bindGroupHash=Object.create(null),this._buffers=[],this._bindGroups=[],this._bufferResources=[],this._renderer=e,this._batchBuffer=new Ce({minUniformOffsetAlignment:_});const t=256/_;for(let r=0;r<t;r++){let s=S.UNIFORM|S.COPY_DST;r===0&&(s|=S.COPY_SRC),this._buffers.push(new ne({data:this._batchBuffer.data,usage:s}))}}renderEnd(){this._uploadBindGroups(),this._resetBindGroups()}_resetBindGroups(){for(const e in this._bindGroupHash)this._bindGroupHash[e]=null;this._batchBuffer.clear()}getUniformBindGroup(e,t){if(!t&&this._bindGroupHash[e.uid])return this._bindGroupHash[e.uid];this._renderer.ubo.ensureUniformGroup(e);const r=e.buffer.data,s=this._batchBuffer.addEmptyGroup(r.length);return this._renderer.ubo.syncUniformGroup(e,this._batchBuffer.data,s/4),this._bindGroupHash[e.uid]=this._getBindGroup(s/_),this._bindGroupHash[e.uid]}getUboResource(e){this._renderer.ubo.updateUniformGroup(e);const t=e.buffer.data,r=this._batchBuffer.addGroup(t);return this._getBufferResource(r/_)}getArrayBindGroup(e){const t=this._batchBuffer.addGroup(e);return this._getBindGroup(t/_)}getArrayBufferResource(e){const r=this._batchBuffer.addGroup(e)/_;return this._getBufferResource(r)}_getBufferResource(e){if(!this._bufferResources[e]){const t=this._buffers[e%2];this._bufferResources[e]=new ye({buffer:t,offset:(e/2|0)*256,size:_})}return this._bufferResources[e]}_getBindGroup(e){if(!this._bindGroups[e]){const t=new A({0:this._getBufferResource(e)});this._bindGroups[e]=t}return this._bindGroups[e]}_uploadBindGroups(){const e=this._renderer.buffer,t=this._buffers[0];t.update(this._batchBuffer.byteIndex),e.updateBuffer(t);const r=this._renderer.gpu.device.createCommandEncoder();for(let s=1;s<this._buffers.length;s++){const i=this._buffers[s];r.copyBufferToBuffer(e.getGPUBuffer(t),_,e.getGPUBuffer(i),0,this._batchBuffer.byteIndex)}this._renderer.gpu.device.queue.submit([r.finish()])}destroy(){for(let e=0;e<this._bindGroups.length;e++)this._bindGroups[e].destroy();this._bindGroups=null,this._bindGroupHash=null;for(let e=0;e<this._buffers.length;e++)this._buffers[e].destroy();this._buffers=null;for(let e=0;e<this._bufferResources.length;e++)this._bufferResources[e].destroy();this._bufferResources=null,this._batchBuffer.destroy(),this._bindGroupHash=null,this._renderer=null}}N.extension={type:[l.WebGPUPipes],name:"uniformBatch"};const we={"point-list":0,"line-list":1,"line-strip":2,"triangle-list":3,"triangle-strip":4};function Re(a,e,t,r,s){return a<<24|e<<16|t<<10|r<<5|s}function Ee(a,e,t,r){return t<<6|a<<3|r<<1|e}class K{constructor(e){this._moduleCache=Object.create(null),this._bufferLayoutsCache=Object.create(null),this._pipeCache=Object.create(null),this._pipeStateCaches=Object.create(null),this._colorMask=15,this._multisampleCount=1,this._renderer=e}contextChange(e){this._gpu=e,this.setStencilMode(P.DISABLED),this._updatePipeHash()}setMultisampleCount(e){this._multisampleCount!==e&&(this._multisampleCount=e,this._updatePipeHash())}setRenderTarget(e){this._multisampleCount=e.msaaSamples,this._depthStencilAttachment=e.descriptor.depthStencilAttachment?1:0,this._updatePipeHash()}setColorMask(e){this._colorMask!==e&&(this._colorMask=e,this._updatePipeHash())}setStencilMode(e){this._stencilMode!==e&&(this._stencilMode=e,this._stencilState=xe[e],this._updatePipeHash())}setPipeline(e,t,r,s){const i=this.getPipeline(e,t,r);s.setPipeline(i)}getPipeline(e,t,r,s){e._layoutKey||(Ge(e,t.attributeData),this._generateBufferKey(e)),s=s||e.topology;const i=Re(e._layoutKey,t._layoutKey,r.data,r._blendModeId,we[s]);return this._pipeCache[i]?this._pipeCache[i]:(this._pipeCache[i]=this._createPipeline(e,t,r,s),this._pipeCache[i])}_createPipeline(e,t,r,s){const i=this._gpu.device,n=this._createVertexBufferLayouts(e),o=this._renderer.state.getColorTargets(r);o[0].writeMask=this._stencilMode===P.RENDERING_MASK_ADD?0:this._colorMask;const u=this._renderer.shader.getProgramData(t).pipeline,c={vertex:{module:this._getModule(t.vertex.source),entryPoint:t.vertex.entryPoint,buffers:n},fragment:{module:this._getModule(t.fragment.source),entryPoint:t.fragment.entryPoint,targets:o},primitive:{topology:s,cullMode:r.cullMode},layout:u,multisample:{count:this._multisampleCount},label:"PIXI Pipeline"};return this._depthStencilAttachment&&(c.depthStencil={...this._stencilState,format:"depth24plus-stencil8",depthWriteEnabled:r.depthTest,depthCompare:r.depthTest?"less":"always"}),i.createRenderPipeline(c)}_getModule(e){return this._moduleCache[e]||this._createModule(e)}_createModule(e){const t=this._gpu.device;return this._moduleCache[e]=t.createShaderModule({code:e}),this._moduleCache[e]}_generateBufferKey(e){const t=[];let r=0;const s=Object.keys(e.attributes).sort();for(let n=0;n<s.length;n++){const o=e.attributes[s[n]];t[r++]=o.location,t[r++]=o.offset,t[r++]=o.format,t[r++]=o.stride}const i=t.join("");return e._layoutKey=he(i,"geometry"),e._layoutKey}_createVertexBufferLayouts(e){if(this._bufferLayoutsCache[e._layoutKey])return this._bufferLayoutsCache[e._layoutKey];const t=[];return e.buffers.forEach(r=>{const s={arrayStride:0,stepMode:"vertex",attributes:[]},i=s.attributes;for(const n in e.attributes){const o=e.attributes[n];o.buffer===r&&(s.arrayStride=o.stride,s.stepMode=o.instance?"instance":"vertex",i.push({shaderLocation:o.location,offset:o.offset,format:o.format}))}i.length&&t.push(s)}),this._bufferLayoutsCache[e._layoutKey]=t,t}_updatePipeHash(){const e=Ee(this._stencilMode,this._multisampleCount,this._colorMask,this._depthStencilAttachment);this._pipeStateCaches[e]||(this._pipeStateCaches[e]=Object.create(null)),this._pipeCache=this._pipeStateCaches[e]}destroy(){this._renderer=null,this._bufferLayoutsCache=null}}K.extension={type:[l.WebGPUSystem],name:"pipeline"};class Ae{constructor(){this.contexts=[],this.msaaTextures=[],this.msaaSamples=1}}class ke{init(e,t){this._renderer=e,this._renderTargetSystem=t}copyToTexture(e,t,r,s,i){const n=this._renderer,o=this._getGpuColorTexture(e),u=n.texture.getGpuSource(t.source);return n.encoder.commandEncoder.copyTextureToTexture({texture:o,origin:r},{texture:u,origin:i},s),t}startRenderPass(e,t=!0,r,s){const n=this._renderTargetSystem.getGpuRenderTarget(e),o=this.getDescriptor(e,t,r);n.descriptor=o,this._renderer.pipeline.setRenderTarget(n),this._renderer.encoder.beginRenderPass(n),this._renderer.encoder.setViewport(s)}finishRenderPass(){this._renderer.encoder.endRenderPass()}_getGpuColorTexture(e){const t=this._renderTargetSystem.getGpuRenderTarget(e);return t.contexts[0]?t.contexts[0].getCurrentTexture():this._renderer.texture.getGpuSource(e.colorTextures[0].source)}getDescriptor(e,t,r){typeof t=="boolean"&&(t=t?b.ALL:b.NONE);const s=this._renderTargetSystem,i=s.getGpuRenderTarget(e),n=e.colorTextures.map((c,f)=>{const h=i.contexts[f];let p,d;h?p=h.getCurrentTexture().createView():p=this._renderer.texture.getGpuSource(c).createView({mipLevelCount:1}),i.msaaTextures[f]&&(d=p,p=this._renderer.texture.getTextureView(i.msaaTextures[f]));const m=t&b.COLOR?"clear":"load";return r??(r=s.defaultClearColor),{view:p,resolveTarget:d,clearValue:r,storeOp:"store",loadOp:m}});let o;if((e.stencil||e.depth)&&!e.depthStencilTexture&&(e.ensureDepthStencilTexture(),e.depthStencilTexture.source.sampleCount=i.msaa?4:1),e.depthStencilTexture){const c=t&b.STENCIL?"clear":"load",f=t&b.DEPTH?"clear":"load";o={view:this._renderer.texture.getGpuSource(e.depthStencilTexture.source).createView(),stencilStoreOp:"store",stencilLoadOp:c,depthClearValue:1,depthLoadOp:f,depthStoreOp:"store"}}return{colorAttachments:n,depthStencilAttachment:o}}clear(e,t=!0,r,s){if(!t)return;const{gpu:i,encoder:n}=this._renderer,o=i.device;if(n.commandEncoder===null){const c=o.createCommandEncoder(),f=this.getDescriptor(e,t,r),h=c.beginRenderPass(f);h.setViewport(s.x,s.y,s.width,s.height,0,1),h.end();const p=c.finish();o.queue.submit([p])}else this.startRenderPass(e,t,r,s)}initGpuRenderTarget(e){e.isRoot=!0;const t=new Ae;return e.colorTextures.forEach((r,s)=>{if(oe.test(r.resource)){const i=r.resource.getContext("webgpu"),n=r.transparent?"premultiplied":"opaque";try{i.configure({device:this._renderer.gpu.device,usage:GPUTextureUsage.TEXTURE_BINDING|GPUTextureUsage.COPY_DST|GPUTextureUsage.RENDER_ATTACHMENT|GPUTextureUsage.COPY_SRC,format:"bgra8unorm",alphaMode:n})}catch(o){console.error(o)}t.contexts[s]=i}if(t.msaa=r.source.antialias,r.source.antialias){const i=new ae({width:0,height:0,sampleCount:4});t.msaaTextures[s]=i}}),t.msaa&&(t.msaaSamples=4,e.depthStencilTexture&&(e.depthStencilTexture.source.sampleCount=4)),t}destroyGpuRenderTarget(e){e.contexts.forEach(t=>{t.unconfigure()}),e.msaaTextures.forEach(t=>{t.destroy()}),e.msaaTextures.length=0,e.contexts.length=0}ensureDepthStencilTexture(e){const t=this._renderTargetSystem.getGpuRenderTarget(e);e.depthStencilTexture&&t.msaa&&(e.depthStencilTexture.source.sampleCount=4)}resizeGpuRenderTarget(e){const t=this._renderTargetSystem.getGpuRenderTarget(e);t.width=e.width,t.height=e.height,t.msaa&&e.colorTextures.forEach((r,s)=>{t.msaaTextures[s]?.resize(r.source.width,r.source.height,r.source._resolution)})}}class q extends Be{constructor(e){super(e),this.adaptor=new ke,this.adaptor.init(e,this)}}q.extension={type:[l.WebGPUSystem],name:"renderTarget"};class Y{constructor(){this._gpuProgramData=Object.create(null)}contextChange(e){this._gpu=e}getProgramData(e){return this._gpuProgramData[e._layoutKey]||this._createGPUProgramData(e)}_createGPUProgramData(e){const t=this._gpu.device,r=e.gpuLayout.map(i=>t.createBindGroupLayout({entries:i})),s={bindGroupLayouts:r};return this._gpuProgramData[e._layoutKey]={bindGroups:r,pipeline:t.createPipelineLayout(s)},this._gpuProgramData[e._layoutKey]}destroy(){this._gpu=null,this._gpuProgramData=null}}Y.extension={type:[l.WebGPUSystem],name:"shader"};const g={};g.normal={alpha:{srcFactor:"one",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"one",dstFactor:"one-minus-src-alpha",operation:"add"}};g.add={alpha:{srcFactor:"src-alpha",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"one",dstFactor:"one",operation:"add"}};g.multiply={alpha:{srcFactor:"one",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"dst",dstFactor:"one-minus-src-alpha",operation:"add"}};g.screen={alpha:{srcFactor:"one",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"one",dstFactor:"one-minus-src",operation:"add"}};g.overlay={alpha:{srcFactor:"one",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"one",dstFactor:"one-minus-src",operation:"add"}};g.none={alpha:{srcFactor:"one",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"zero",dstFactor:"zero",operation:"add"}};g["normal-npm"]={alpha:{srcFactor:"one",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"src-alpha",dstFactor:"one-minus-src-alpha",operation:"add"}};g["add-npm"]={alpha:{srcFactor:"one",dstFactor:"one",operation:"add"},color:{srcFactor:"src-alpha",dstFactor:"one",operation:"add"}};g["screen-npm"]={alpha:{srcFactor:"one",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"src-alpha",dstFactor:"one-minus-src",operation:"add"}};g.erase={alpha:{srcFactor:"zero",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"zero",dstFactor:"one-minus-src",operation:"add"}};class ${constructor(){this.defaultState=new D,this.defaultState.blend=!0}contextChange(e){this.gpu=e}getColorTargets(e){return[{format:"bgra8unorm",writeMask:0,blend:g[e.blendMode]||g.normal}]}destroy(){this.gpu=null}}$.extension={type:[l.WebGPUSystem],name:"state"};const De={type:"image",upload(a,e,t){const r=a.resource,s=(a.pixelWidth|0)*(a.pixelHeight|0),i=r.byteLength/s;t.device.queue.writeTexture({texture:e},r,{offset:0,rowsPerImage:a.pixelHeight,bytesPerRow:a.pixelHeight*i},{width:a.pixelWidth,height:a.pixelHeight,depthOrArrayLayers:1})}},X={"bc1-rgba-unorm":{blockBytes:8,blockWidth:4,blockHeight:4},"bc2-rgba-unorm":{blockBytes:16,blockWidth:4,blockHeight:4},"bc3-rgba-unorm":{blockBytes:16,blockWidth:4,blockHeight:4},"bc7-rgba-unorm":{blockBytes:16,blockWidth:4,blockHeight:4},"etc1-rgb-unorm":{blockBytes:8,blockWidth:4,blockHeight:4},"etc2-rgba8unorm":{blockBytes:16,blockWidth:4,blockHeight:4},"astc-4x4-unorm":{blockBytes:16,blockWidth:4,blockHeight:4}},ze={blockBytes:4,blockWidth:1,blockHeight:1},Le={type:"compressed",upload(a,e,t){let r=a.pixelWidth,s=a.pixelHeight;const i=X[a.format]||ze;for(let n=0;n<a.resource.length;n++){const o=a.resource[n],u=Math.ceil(r/i.blockWidth)*i.blockBytes;t.device.queue.writeTexture({texture:e,mipLevel:n},o,{offset:0,bytesPerRow:u},{width:Math.ceil(r/i.blockWidth)*i.blockWidth,height:Math.ceil(s/i.blockHeight)*i.blockHeight,depthOrArrayLayers:1}),r=Math.max(r>>1,1),s=Math.max(s>>1,1)}}},Z={type:"image",upload(a,e,t){const r=a.resource;if(!r)return;const s=Math.min(e.width,a.resourceWidth||a.pixelWidth),i=Math.min(e.height,a.resourceHeight||a.pixelHeight),n=a.alphaMode==="premultiply-alpha-on-upload";t.device.queue.copyExternalImageToTexture({source:r},{texture:e,premultipliedAlpha:n},{width:s,height:i})}},Oe={type:"video",upload(a,e,t){Z.upload(a,e,t)}};class He{constructor(e){this.device=e,this.sampler=e.createSampler({minFilter:"linear"}),this.pipelines={}}_getMipmapPipeline(e){let t=this.pipelines[e];return t||(this.mipmapShaderModule||(this.mipmapShaderModule=this.device.createShaderModule({code:`
var<private> pos : array<vec2<f32>, 3> = array<vec2<f32>, 3>(
vec2<f32>(-1.0, -1.0), vec2<f32>(-1.0, 3.0), vec2<f32>(3.0, -1.0));
struct VertexOutput {
@builtin(position) position : vec4<f32>,
@location(0) texCoord : vec2<f32>,
};
@vertex
fn vertexMain(@builtin(vertex_index) vertexIndex : u32) -> VertexOutput {
var output : VertexOutput;
output.texCoord = pos[vertexIndex] * vec2<f32>(0.5, -0.5) + vec2<f32>(0.5);
output.position = vec4<f32>(pos[vertexIndex], 0.0, 1.0);
return output;
}
@group(0) @binding(0) var imgSampler : sampler;
@group(0) @binding(1) var img : texture_2d<f32>;
@fragment
fn fragmentMain(@location(0) texCoord : vec2<f32>) -> @location(0) vec4<f32> {
return textureSample(img, imgSampler, texCoord);
}
`})),t=this.device.createRenderPipeline({layout:"auto",vertex:{module:this.mipmapShaderModule,entryPoint:"vertexMain"},fragment:{module:this.mipmapShaderModule,entryPoint:"fragmentMain",targets:[{format:e}]}}),this.pipelines[e]=t),t}generateMipmap(e){const t=this._getMipmapPipeline(e.format);if(e.dimension==="3d"||e.dimension==="1d")throw new Error("Generating mipmaps for non-2d textures is currently unsupported!");let r=e;const s=e.depthOrArrayLayers||1,i=e.usage&GPUTextureUsage.RENDER_ATTACHMENT;if(!i){const u={size:{width:Math.ceil(e.width/2),height:Math.ceil(e.height/2),depthOrArrayLayers:s},format:e.format,usage:GPUTextureUsage.TEXTURE_BINDING|GPUTextureUsage.COPY_SRC|GPUTextureUsage.RENDER_ATTACHMENT,mipLevelCount:e.mipLevelCount-1};r=this.device.createTexture(u)}const n=this.device.createCommandEncoder({}),o=t.getBindGroupLayout(0);for(let u=0;u<s;++u){let c=e.createView({baseMipLevel:0,mipLevelCount:1,dimension:"2d",baseArrayLayer:u,arrayLayerCount:1}),f=i?1:0;for(let h=1;h<e.mipLevelCount;++h){const p=r.createView({baseMipLevel:f++,mipLevelCount:1,dimension:"2d",baseArrayLayer:u,arrayLayerCount:1}),d=n.beginRenderPass({colorAttachments:[{view:p,storeOp:"store",loadOp:"clear",clearValue:{r:0,g:0,b:0,a:0}}]}),m=this.device.createBindGroup({layout:o,entries:[{binding:0,resource:this.sampler},{binding:1,resource:c}]});d.setPipeline(t),d.setBindGroup(0,m),d.draw(3,1,0,0),d.end(),c=p}}if(!i){const u={width:Math.ceil(e.width/2),height:Math.ceil(e.height/2),depthOrArrayLayers:s};for(let c=1;c<e.mipLevelCount;++c)n.copyTextureToTexture({texture:r,mipLevel:c-1},{texture:e,mipLevel:c},u),u.width=Math.ceil(u.width/2),u.height=Math.ceil(u.height/2)}return this.device.queue.submit([n.finish()]),i||r.destroy(),e}}class J{constructor(e){this.managedTextures=[],this._gpuSources=Object.create(null),this._gpuSamplers=Object.create(null),this._bindGroupHash=Object.create(null),this._textureViewHash=Object.create(null),this._uploads={image:Z,buffer:De,video:Oe,compressed:Le},this._renderer=e}contextChange(e){this._gpu=e}initSource(e){if(e.autoGenerateMipmaps){const u=Math.max(e.pixelWidth,e.pixelHeight);e.mipLevelCount=Math.floor(Math.log2(u))+1}let t=GPUTextureUsage.TEXTURE_BINDING|GPUTextureUsage.COPY_DST;e.uploadMethodId!=="compressed"&&(t|=GPUTextureUsage.RENDER_ATTACHMENT,t|=GPUTextureUsage.COPY_SRC);const r=X[e.format]||{blockBytes:4,blockWidth:1,blockHeight:1},s=Math.ceil(e.pixelWidth/r.blockWidth)*r.blockWidth,i=Math.ceil(e.pixelHeight/r.blockHeight)*r.blockHeight,n={label:e.label,size:{width:s,height:i},format:e.format,sampleCount:e.sampleCount,mipLevelCount:e.mipLevelCount,dimension:e.dimension,usage:t},o=this._gpu.device.createTexture(n);return this._gpuSources[e.uid]=o,this.managedTextures.includes(e)||(e.on("update",this.onSourceUpdate,this),e.on("resize",this.onSourceResize,this),e.on("destroy",this.onSourceDestroy,this),e.on("unload",this.onSourceUnload,this),e.on("updateMipmaps",this.onUpdateMipmaps,this),this.managedTextures.push(e)),this.onSourceUpdate(e),o}onSourceUpdate(e){const t=this.getGpuSource(e);t&&(this._uploads[e.uploadMethodId]&&this._uploads[e.uploadMethodId].upload(e,t,this._gpu),e.autoGenerateMipmaps&&e.mipLevelCount>1&&this.onUpdateMipmaps(e))}onSourceUnload(e){const t=this._gpuSources[e.uid];t&&(this._gpuSources[e.uid]=null,t.destroy())}onUpdateMipmaps(e){this._mipmapGenerator||(this._mipmapGenerator=new He(this._gpu.device));const t=this.getGpuSource(e);this._mipmapGenerator.generateMipmap(t)}onSourceDestroy(e){e.off("update",this.onSourceUpdate,this),e.off("unload",this.onSourceUnload,this),e.off("destroy",this.onSourceDestroy,this),e.off("resize",this.onSourceResize,this),e.off("updateMipmaps",this.onUpdateMipmaps,this),this.managedTextures.splice(this.managedTextures.indexOf(e),1),this.onSourceUnload(e)}onSourceResize(e){const t=this._gpuSources[e.uid];t?(t.width!==e.pixelWidth||t.height!==e.pixelHeight)&&(this._textureViewHash[e.uid]=null,this._bindGroupHash[e.uid]=null,this.onSourceUnload(e),this.initSource(e)):this.initSource(e)}_initSampler(e){return this._gpuSamplers[e._resourceId]=this._gpu.device.createSampler(e),this._gpuSamplers[e._resourceId]}getGpuSampler(e){return this._gpuSamplers[e._resourceId]||this._initSampler(e)}getGpuSource(e){return this._gpuSources[e.uid]||this.initSource(e)}getTextureBindGroup(e){return this._bindGroupHash[e.uid]??this._createTextureBindGroup(e)}_createTextureBindGroup(e){const t=e.source,r=t.uid;return this._bindGroupHash[r]=new A({0:t,1:t.style}),this._bindGroupHash[r]}getTextureView(e){const t=e.source;return this._textureViewHash[t.uid]??this._createTextureView(t)}_createTextureView(e){return this._textureViewHash[e.uid]=this.getGpuSource(e).createView(),this._textureViewHash[e.uid]}generateCanvas(e){const t=this._renderer,r=t.gpu.device.createCommandEncoder(),s=ue.get().createCanvas();s.width=e.source.pixelWidth,s.height=e.source.pixelHeight;const i=s.getContext("webgpu");return i.configure({device:t.gpu.device,usage:GPUTextureUsage.COPY_DST|GPUTextureUsage.COPY_SRC,format:navigator.gpu.getPreferredCanvasFormat(),alphaMode:"premultiplied"}),r.copyTextureToTexture({texture:t.texture.getGpuSource(e.source),origin:{x:0,y:0}},{texture:i.getCurrentTexture()},{width:s.width,height:s.height}),t.gpu.device.queue.submit([r.finish()]),s}getPixels(e){const t=this.generateCanvas(e),r=w.getOptimalCanvasAndContext(t.width,t.height),s=r.context;s.drawImage(t,0,0);const{width:i,height:n}=t,o=s.getImageData(0,0,i,n),u=new Uint8ClampedArray(o.data.buffer);return w.returnCanvasAndContext(r),{pixels:u,width:i,height:n}}destroy(){this.managedTextures.slice().forEach(e=>this.onSourceDestroy(e)),this.managedTextures=null;for(const e of Object.keys(this._bindGroupHash)){const t=Number(e);this._bindGroupHash[t]?.destroy(),this._bindGroupHash[t]=null}this._gpu=null,this._mipmapGenerator=null,this._gpuSources=null,this._bindGroupHash=null,this._textureViewHash=null,this._gpuSamplers=null}}J.extension={type:[l.WebGPUSystem],name:"texture"};class Q{init(){const e=new pe({uTransformMatrix:{value:new k,type:"mat3x3<f32>"},uColor:{value:new Float32Array([1,1,1,1]),type:"vec4<f32>"},uRound:{value:0,type:"f32"}}),t=T({name:"graphics",bits:[z,L(R()),le,C]});this.shader=new v({gpuProgram:t,resources:{localUniforms:e}})}execute(e,t){const r=t.context,s=r.customShader||this.shader,i=e.renderer,n=i.graphicsContext,{geometry:o,instructions:u}=n.getContextRenderData(r),c=i.encoder;c.setPipelineFromGeometryProgramAndState(o,s.gpuProgram,e.state),c.setGeometry(o);const f=i.globalUniforms.bindGroup;c.setBindGroup(0,f,s.gpuProgram);const h=i.renderPipes.uniformBatch.getUniformBindGroup(s.resources.localUniforms,!0);c.setBindGroup(2,h,s.gpuProgram);const p=u.instructions;for(let d=0;d<u.instructionSize;d++){const m=p[d];if(s.groups[1]=m.bindGroup,!m.gpuBindGroup){const B=m.textures;m.bindGroup=E(B.textures,B.count),m.gpuBindGroup=i.bindGroup.getBindGroup(m.bindGroup,s.gpuProgram,1)}c.setBindGroup(1,m.bindGroup,s.gpuProgram),c.renderPassEncoder.drawIndexed(m.size,1,m.start)}}destroy(){this.shader.destroy(!0),this.shader=null}}Q.extension={type:[l.WebGPUPipesAdaptor],name:"graphics"};class ee{init(){const e=T({name:"mesh",bits:[fe,Se,C]});this._shader=new v({gpuProgram:e,resources:{uTexture:M.EMPTY._source,uSampler:M.EMPTY._source.style,textureUniforms:{uTextureMatrix:{type:"mat3x3<f32>",value:new k}}}})}execute(e,t){const r=e.renderer;let s=t._shader;if(!s)s=this._shader,s.resources.uTexture=t.texture.source,s.resources.uSampler=t.texture.source.style,s.resources.textureUniforms.uniforms.uTextureMatrix=t.texture.textureMatrix.mapCoord;else if(!s.gpuProgram){ce("Mesh shader has no gpuProgram",t.shader);return}const i=s.gpuProgram;if(i.autoAssignGlobalUniforms&&(s.groups[0]=r.globalUniforms.bindGroup),i.autoAssignLocalUniforms){const n=e.localUniforms;s.groups[1]=r.renderPipes.uniformBatch.getUniformBindGroup(n,!0)}r.encoder.draw({geometry:t._geometry,shader:s,state:t.state})}destroy(){this._shader.destroy(!0),this._shader=null}}ee.extension={type:[l.WebGPUPipesAdaptor],name:"mesh"};const Fe=[...Pe,j,W,U,F,J,q,Y,$,K,I,V,H],Ie=[...Te,N],We=[O,ee,Q],te=[],re=[],se=[];G.handleByNamedList(l.WebGPUSystem,te);G.handleByNamedList(l.WebGPUPipes,re);G.handleByNamedList(l.WebGPUPipesAdaptor,se);G.add(...Fe,...Ie,...We);tt=class extends de{constructor(){const e={name:"webgpu",type:me.WEBGPU,systems:te,renderPipes:re,renderPipeAdaptors:se};super(e)}}});export{tt as WebGPURenderer,__tla};

View File

@@ -0,0 +1,41 @@
import{g as R,b as E,E as l,f as ne,S as P,B as S,c as oe,d as A,w as k,h as b,i as ae,j as ue,D as ce,M as D,k as M,e as G,A as de,__tla as __tla_0}from"./TorrentDetail-CKmHZcwa.js";import{S as z,c as T,a as L,g as O,r as v,b as C,d as he,U as pe,l as le,e as fe,R as ge,__tla as __tla_1}from"./colorToUniform-rMRo2qOn.js";import{c as me,u as _e,U as be,B as ye,G as xe,e as Ge,R as Be,t as Se,S as Pe,a as Te,__tla as __tla_2}from"./SharedSystems-Bg8GzrJB.js";import{C as w,__tla as __tla_3}from"./CanvasPool-D00IADyo.js";import{__tla as __tla_4}from"./ColoredChip.vue_vue_type_script_setup_true_lang-CBDbhtDT.js";import{__tla as __tla_5}from"./index-C0tfT_Qc.js";import"./vue-CfSjRv-x.js";import"./vuetify-PctCzU6r.js";import{__tla as __tla_6}from"./MixedButton.vue_vue_type_script_setup_true_lang-Br4NUWtV.js";import"./FileIcon-DH65fwz5.js";import{__tla as __tla_7}from"./MoveTorrentFileDialog.vue_vue_type_script_setup_true_lang-C8uA-x2z.js";let tt;let __tla=Promise.all([(()=>{try{return __tla_0}catch{}})(),(()=>{try{return __tla_1}catch{}})(),(()=>{try{return __tla_2}catch{}})(),(()=>{try{return __tla_3}catch{}})(),(()=>{try{return __tla_4}catch{}})(),(()=>{try{return __tla_5}catch{}})(),(()=>{try{return __tla_6}catch{}})(),(()=>{try{return __tla_7}catch{}})()]).then(async()=>{const y=z.for2d();class H{init(){const e=T({name:"batch",bits:[L,O(R()),v]});this._shader=new C({gpuProgram:e,groups:{}})}start(e,t){const r=e.renderer,s=r.encoder,i=this._shader.gpuProgram;this._geometry=t,s.setGeometry(t),y.blendMode="normal",r.pipeline.getPipeline(t,i,y);const n=r.globalUniforms.bindGroup;s.resetBindGroup(1),s.setBindGroup(0,n,i)}execute(e,t){const r=this._shader.gpuProgram,s=e.renderer,i=s.encoder;if(!t.bindGroup){const u=t.textures;t.bindGroup=E(u.textures,u.count)}y.blendMode=t.blendMode;const n=s.bindGroup.getBindGroup(t.bindGroup,r,1),o=s.pipeline.getPipeline(this._geometry,r,y);t.bindGroup._touch(s.textureGC.count),i.setPipeline(o),i.renderPassEncoder.setBindGroup(1,n),i.renderPassEncoder.drawIndexed(t.size,1,t.start)}destroy(){this._shader.destroy(!0),this._shader=null}}H.extension={type:[l.WebGPUPipesAdaptor],name:"batch"};class F{constructor(e){this._hash=Object.create(null),this._renderer=e}contextChange(e){this._gpu=e}getBindGroup(e,t,r){return e._updateKey(),this._hash[e._key]||this._createBindGroup(e,t,r)}_createBindGroup(e,t,r){const s=this._gpu.device,i=t.layout[r],n=[],o=this._renderer;for(const f in i){const h=e.resources[f]??e.resources[i[f]];let p;if(h._resourceType==="uniformGroup"){const d=h;o.ubo.updateUniformGroup(d);const g=d.buffer;p={buffer:o.buffer.getGPUBuffer(g),offset:0,size:g.descriptor.size}}else if(h._resourceType==="buffer"){const d=h;p={buffer:o.buffer.getGPUBuffer(d),offset:0,size:d.descriptor.size}}else if(h._resourceType==="bufferResource"){const d=h;p={buffer:o.buffer.getGPUBuffer(d.buffer),offset:d.offset,size:d.size}}else if(h._resourceType==="textureSampler"){const d=h;p=o.texture.getGpuSampler(d)}else if(h._resourceType==="textureSource"){const d=h;p=o.texture.getGpuSource(d).createView({})}n.push({binding:i[f],resource:p})}const u=o.shader.getProgramData(t).bindGroups[r],c=s.createBindGroup({layout:u,entries:n});return this._hash[e._key]=c,c}destroy(){for(const e of Object.keys(this._hash))this._hash[e]=null;this._hash=null,this._renderer=null}}F.extension={type:[l.WebGPUSystem],name:"bindGroup"};class I{constructor(){this._gpuBuffers=Object.create(null),this._managedBuffers=[]}contextChange(e){this._gpu=e}getGPUBuffer(e){return this._gpuBuffers[e.uid]||this.createGPUBuffer(e)}updateBuffer(e){const t=this._gpuBuffers[e.uid]||this.createGPUBuffer(e),r=e.data;return e._updateID&&r&&(e._updateID=0,this._gpu.device.queue.writeBuffer(t,0,r.buffer,0,(e._updateSize||r.byteLength)+3&-4)),t}destroyAll(){for(const e in this._gpuBuffers)this._gpuBuffers[e].destroy();this._gpuBuffers={}}createGPUBuffer(e){this._gpuBuffers[e.uid]||(e.on("update",this.updateBuffer,this),e.on("change",this.onBufferChange,this),e.on("destroy",this.onBufferDestroy,this));const t=this._gpu.device.createBuffer(e.descriptor);return e._updateID=0,e.data&&(ne(e.data.buffer,t.getMappedRange()),t.unmap()),this._gpuBuffers[e.uid]=t,this._managedBuffers.push(e),t}onBufferChange(e){this._gpuBuffers[e.uid].destroy(),e._updateID=0,this._gpuBuffers[e.uid]=this.createGPUBuffer(e)}onBufferDestroy(e){this._managedBuffers.splice(this._managedBuffers.indexOf(e),1),this._destroyBuffer(e)}destroy(){this._managedBuffers.forEach(e=>this._destroyBuffer(e)),this._managedBuffers=null,this._gpuBuffers=null}_destroyBuffer(e){this._gpuBuffers[e.uid].destroy(),e.off("update",this.updateBuffer,this),e.off("change",this.onBufferChange,this),e.off("destroy",this.onBufferDestroy,this),this._gpuBuffers[e.uid]=null}}I.extension={type:[l.WebGPUSystem],name:"buffer"};class ve{constructor({minUniformOffsetAlignment:e}){this._minUniformOffsetAlignment=256,this.byteIndex=0,this._minUniformOffsetAlignment=e,this.data=new Float32Array(65535)}clear(){this.byteIndex=0}addEmptyGroup(e){if(e>this._minUniformOffsetAlignment/4)throw new Error(`UniformBufferBatch: array is too large: ${e*4}`);const t=this.byteIndex;let r=t+e*4;if(r=Math.ceil(r/this._minUniformOffsetAlignment)*this._minUniformOffsetAlignment,r>this.data.length*4)throw new Error("UniformBufferBatch: ubo batch got too big");return this.byteIndex=r,t}addGroup(e){const t=this.addEmptyGroup(e.length);for(let r=0;r<e.length;r++)this.data[t/4+r]=e[r];return t}destroy(){this._buffer.destroy(),this._buffer=null,this.data=null}}class W{constructor(e){this._colorMaskCache=15,this._renderer=e}setMask(e){this._colorMaskCache!==e&&(this._colorMaskCache=e,this._renderer.pipeline.setColorMask(e))}destroy(){this._renderer=null,this._colorMaskCache=null}}W.extension={type:[l.WebGPUSystem],name:"colorMask"};class U{constructor(e){this._renderer=e}async init(e){return this._initPromise?this._initPromise:(this._initPromise=this._createDeviceAndAdaptor(e).then(t=>{this.gpu=t,this._renderer.runners.contextChange.emit(this.gpu)}),this._initPromise)}contextChange(e){this._renderer.gpu=e}async _createDeviceAndAdaptor(e){const t=await navigator.gpu.requestAdapter({powerPreference:e.powerPreference,forceFallbackAdapter:e.forceFallbackAdapter}),r=["texture-compression-bc","texture-compression-astc","texture-compression-etc2"].filter(i=>t.features.has(i)),s=await t.requestDevice({requiredFeatures:r});return{adapter:t,device:s}}destroy(){this.gpu=null,this._renderer=null}}U.extension={type:[l.WebGPUSystem],name:"device"};U.defaultOptions={powerPreference:void 0,forceFallbackAdapter:!1};class V{constructor(e){this._boundBindGroup=Object.create(null),this._boundVertexBuffer=Object.create(null),this._renderer=e}renderStart(){this.commandFinished=new Promise(e=>{this._resolveCommandFinished=e}),this.commandEncoder=this._renderer.gpu.device.createCommandEncoder()}beginRenderPass(e){this.endRenderPass(),this._clearCache(),this.renderPassEncoder=this.commandEncoder.beginRenderPass(e.descriptor)}endRenderPass(){this.renderPassEncoder&&this.renderPassEncoder.end(),this.renderPassEncoder=null}setViewport(e){this.renderPassEncoder.setViewport(e.x,e.y,e.width,e.height,0,1)}setPipelineFromGeometryProgramAndState(e,t,r,s){const i=this._renderer.pipeline.getPipeline(e,t,r,s);this.setPipeline(i)}setPipeline(e){this._boundPipeline!==e&&(this._boundPipeline=e,this.renderPassEncoder.setPipeline(e))}_setVertexBuffer(e,t){this._boundVertexBuffer[e]!==t&&(this._boundVertexBuffer[e]=t,this.renderPassEncoder.setVertexBuffer(e,this._renderer.buffer.updateBuffer(t)))}_setIndexBuffer(e){if(this._boundIndexBuffer===e)return;this._boundIndexBuffer=e;const t=e.data.BYTES_PER_ELEMENT===2?"uint16":"uint32";this.renderPassEncoder.setIndexBuffer(this._renderer.buffer.updateBuffer(e),t)}resetBindGroup(e){this._boundBindGroup[e]=null}setBindGroup(e,t,r){if(this._boundBindGroup[e]===t)return;this._boundBindGroup[e]=t,t._touch(this._renderer.textureGC.count);const s=this._renderer.bindGroup.getBindGroup(t,r,e);this.renderPassEncoder.setBindGroup(e,s)}setGeometry(e){for(const t in e.attributes){const r=e.attributes[t];this._setVertexBuffer(r.location,r.buffer)}e.indexBuffer&&this._setIndexBuffer(e.indexBuffer)}_setShaderBindGroups(e,t){for(const r in e.groups){const s=e.groups[r];t||this._syncBindGroup(s),this.setBindGroup(r,s,e.gpuProgram)}}_syncBindGroup(e){for(const t in e.resources){const r=e.resources[t];r.isUniformGroup&&this._renderer.ubo.updateUniformGroup(r)}}draw(e){const{geometry:t,shader:r,state:s,topology:i,size:n,start:o,instanceCount:u,skipSync:c}=e;this.setPipelineFromGeometryProgramAndState(t,r.gpuProgram,s,i),this.setGeometry(t),this._setShaderBindGroups(r,c),t.indexBuffer?this.renderPassEncoder.drawIndexed(n||t.indexBuffer.data.length,u||t.instanceCount,o||0):this.renderPassEncoder.draw(n||t.getSize(),u||t.instanceCount,o||0)}finishRenderPass(){this.renderPassEncoder&&(this.renderPassEncoder.end(),this.renderPassEncoder=null)}postrender(){this.finishRenderPass(),this._gpu.device.queue.submit([this.commandEncoder.finish()]),this._resolveCommandFinished(),this.commandEncoder=null}restoreRenderPass(){const e=this._renderer.renderTarget.adaptor.getDescriptor(this._renderer.renderTarget.renderTarget,!1,[0,0,0,1]);this.renderPassEncoder=this.commandEncoder.beginRenderPass(e);const t=this._boundPipeline,r={...this._boundVertexBuffer},s=this._boundIndexBuffer,i={...this._boundBindGroup};this._clearCache();const n=this._renderer.renderTarget.viewport;this.renderPassEncoder.setViewport(n.x,n.y,n.width,n.height,0,1),this.setPipeline(t);for(const o in r)this._setVertexBuffer(o,r[o]);for(const o in i)this.setBindGroup(o,i[o],null);this._setIndexBuffer(s)}_clearCache(){for(let e=0;e<16;e++)this._boundBindGroup[e]=null,this._boundVertexBuffer[e]=null;this._boundIndexBuffer=null,this._boundPipeline=null}destroy(){this._renderer=null,this._gpu=null,this._boundBindGroup=null,this._boundVertexBuffer=null,this._boundIndexBuffer=null,this._boundPipeline=null}contextChange(e){this._gpu=e}}V.extension={type:[l.WebGPUSystem],name:"encoder",priority:1};class j{constructor(e){this._renderTargetStencilState=Object.create(null),this._renderer=e,e.renderTarget.onRenderTargetChange.add(this)}onRenderTargetChange(e){let t=this._renderTargetStencilState[e.uid];t||(t=this._renderTargetStencilState[e.uid]={stencilMode:P.DISABLED,stencilReference:0}),this._activeRenderTarget=e,this.setStencilMode(t.stencilMode,t.stencilReference)}setStencilMode(e,t){const r=this._renderTargetStencilState[this._activeRenderTarget.uid];r.stencilMode=e,r.stencilReference=t;const s=this._renderer;s.pipeline.setStencilMode(e),s.encoder.renderPassEncoder.setStencilReference(t)}destroy(){this._renderer.renderTarget.onRenderTargetChange.remove(this),this._renderer=null,this._activeRenderTarget=null,this._renderTargetStencilState=null}}j.extension={type:[l.WebGPUSystem],name:"stencil"};const x={i32:{align:4,size:4},u32:{align:4,size:4},f32:{align:4,size:4},f16:{align:2,size:2},"vec2<i32>":{align:8,size:8},"vec2<u32>":{align:8,size:8},"vec2<f32>":{align:8,size:8},"vec2<f16>":{align:4,size:4},"vec3<i32>":{align:16,size:12},"vec3<u32>":{align:16,size:12},"vec3<f32>":{align:16,size:12},"vec3<f16>":{align:8,size:6},"vec4<i32>":{align:16,size:16},"vec4<u32>":{align:16,size:16},"vec4<f32>":{align:16,size:16},"vec4<f16>":{align:8,size:8},"mat2x2<f32>":{align:8,size:16},"mat2x2<f16>":{align:4,size:8},"mat3x2<f32>":{align:8,size:24},"mat3x2<f16>":{align:4,size:12},"mat4x2<f32>":{align:8,size:32},"mat4x2<f16>":{align:4,size:16},"mat2x3<f32>":{align:16,size:32},"mat2x3<f16>":{align:8,size:16},"mat3x3<f32>":{align:16,size:48},"mat3x3<f16>":{align:8,size:24},"mat4x3<f32>":{align:16,size:64},"mat4x3<f16>":{align:8,size:32},"mat2x4<f32>":{align:16,size:32},"mat2x4<f16>":{align:8,size:16},"mat3x4<f32>":{align:16,size:48},"mat3x4<f16>":{align:8,size:24},"mat4x4<f32>":{align:16,size:64},"mat4x4<f16>":{align:8,size:32}};function Ce(a){const e=a.map(r=>({data:r,offset:0,size:0}));let t=0;for(let r=0;r<e.length;r++){const s=e[r];let i=x[s.data.type].size;const n=x[s.data.type].align;if(!x[s.data.type])throw new Error(`[Pixi.js] WebGPU UniformBuffer: Unknown type ${s.data.type}`);s.data.size>1&&(i=Math.max(i,n)*s.data.size),t=Math.ceil(t/n)*n,s.size=i,s.offset=t,t+=i}return t=Math.ceil(t/16)*16,{uboElements:e,size:t}}function Ue(a,e){const{size:t,align:r}=x[a.data.type],s=(r-t)/4;return`
v = uv.${a.data.name};
${e!==0?`offset += ${e};`:""}
arrayOffset = offset;
t = 0;
for(var i=0; i < ${a.data.size*(t/4)}; i++)
{
for(var j = 0; j < ${t/4}; j++)
{
data[arrayOffset++] = v[t++];
}
${s!==0?`arrayOffset += ${s};`:""}
}
`}function Me(a){return me(a,"uboWgsl",Ue,_e)}class N extends be{constructor(){super({createUboElements:Ce,generateUboSync:Me})}}N.extension={type:[l.WebGPUSystem],name:"ubo"};const _=128;class K{constructor(e){this._bindGroupHash=Object.create(null),this._buffers=[],this._bindGroups=[],this._bufferResources=[],this._renderer=e,this._batchBuffer=new ve({minUniformOffsetAlignment:_});const t=256/_;for(let r=0;r<t;r++){let s=S.UNIFORM|S.COPY_DST;r===0&&(s|=S.COPY_SRC),this._buffers.push(new oe({data:this._batchBuffer.data,usage:s}))}}renderEnd(){this._uploadBindGroups(),this._resetBindGroups()}_resetBindGroups(){for(const e in this._bindGroupHash)this._bindGroupHash[e]=null;this._batchBuffer.clear()}getUniformBindGroup(e,t){if(!t&&this._bindGroupHash[e.uid])return this._bindGroupHash[e.uid];this._renderer.ubo.ensureUniformGroup(e);const r=e.buffer.data,s=this._batchBuffer.addEmptyGroup(r.length);return this._renderer.ubo.syncUniformGroup(e,this._batchBuffer.data,s/4),this._bindGroupHash[e.uid]=this._getBindGroup(s/_),this._bindGroupHash[e.uid]}getUboResource(e){this._renderer.ubo.updateUniformGroup(e);const t=e.buffer.data,r=this._batchBuffer.addGroup(t);return this._getBufferResource(r/_)}getArrayBindGroup(e){const t=this._batchBuffer.addGroup(e);return this._getBindGroup(t/_)}getArrayBufferResource(e){const r=this._batchBuffer.addGroup(e)/_;return this._getBufferResource(r)}_getBufferResource(e){if(!this._bufferResources[e]){const t=this._buffers[e%2];this._bufferResources[e]=new ye({buffer:t,offset:(e/2|0)*256,size:_})}return this._bufferResources[e]}_getBindGroup(e){if(!this._bindGroups[e]){const t=new A({0:this._getBufferResource(e)});this._bindGroups[e]=t}return this._bindGroups[e]}_uploadBindGroups(){const e=this._renderer.buffer,t=this._buffers[0];t.update(this._batchBuffer.byteIndex),e.updateBuffer(t);const r=this._renderer.gpu.device.createCommandEncoder();for(let s=1;s<this._buffers.length;s++){const i=this._buffers[s];r.copyBufferToBuffer(e.getGPUBuffer(t),_,e.getGPUBuffer(i),0,this._batchBuffer.byteIndex)}this._renderer.gpu.device.queue.submit([r.finish()])}destroy(){for(let e=0;e<this._bindGroups.length;e++)this._bindGroups[e].destroy();this._bindGroups=null,this._bindGroupHash=null;for(let e=0;e<this._buffers.length;e++)this._buffers[e].destroy();this._buffers=null;for(let e=0;e<this._bufferResources.length;e++)this._bufferResources[e].destroy();this._bufferResources=null,this._batchBuffer.destroy(),this._bindGroupHash=null,this._renderer=null}}K.extension={type:[l.WebGPUPipes],name:"uniformBatch"};const we={"point-list":0,"line-list":1,"line-strip":2,"triangle-list":3,"triangle-strip":4};function Re(a,e,t,r,s){return a<<24|e<<16|t<<10|r<<5|s}function Ee(a,e,t,r){return t<<6|a<<3|r<<1|e}class q{constructor(e){this._moduleCache=Object.create(null),this._bufferLayoutsCache=Object.create(null),this._pipeCache=Object.create(null),this._pipeStateCaches=Object.create(null),this._colorMask=15,this._multisampleCount=1,this._renderer=e}contextChange(e){this._gpu=e,this.setStencilMode(P.DISABLED),this._updatePipeHash()}setMultisampleCount(e){this._multisampleCount!==e&&(this._multisampleCount=e,this._updatePipeHash())}setRenderTarget(e){this._multisampleCount=e.msaaSamples,this._depthStencilAttachment=e.descriptor.depthStencilAttachment?1:0,this._updatePipeHash()}setColorMask(e){this._colorMask!==e&&(this._colorMask=e,this._updatePipeHash())}setStencilMode(e){this._stencilMode!==e&&(this._stencilMode=e,this._stencilState=xe[e],this._updatePipeHash())}setPipeline(e,t,r,s){const i=this.getPipeline(e,t,r);s.setPipeline(i)}getPipeline(e,t,r,s){e._layoutKey||(Ge(e,t.attributeData),this._generateBufferKey(e)),s=s||e.topology;const i=Re(e._layoutKey,t._layoutKey,r.data,r._blendModeId,we[s]);return this._pipeCache[i]?this._pipeCache[i]:(this._pipeCache[i]=this._createPipeline(e,t,r,s),this._pipeCache[i])}_createPipeline(e,t,r,s){const i=this._gpu.device,n=this._createVertexBufferLayouts(e),o=this._renderer.state.getColorTargets(r);o[0].writeMask=this._stencilMode===P.RENDERING_MASK_ADD?0:this._colorMask;const u=this._renderer.shader.getProgramData(t).pipeline,c={vertex:{module:this._getModule(t.vertex.source),entryPoint:t.vertex.entryPoint,buffers:n},fragment:{module:this._getModule(t.fragment.source),entryPoint:t.fragment.entryPoint,targets:o},primitive:{topology:s,cullMode:r.cullMode},layout:u,multisample:{count:this._multisampleCount},label:"PIXI Pipeline"};return this._depthStencilAttachment&&(c.depthStencil={...this._stencilState,format:"depth24plus-stencil8",depthWriteEnabled:r.depthTest,depthCompare:r.depthTest?"less":"always"}),i.createRenderPipeline(c)}_getModule(e){return this._moduleCache[e]||this._createModule(e)}_createModule(e){const t=this._gpu.device;return this._moduleCache[e]=t.createShaderModule({code:e}),this._moduleCache[e]}_generateBufferKey(e){const t=[];let r=0;const s=Object.keys(e.attributes).sort();for(let n=0;n<s.length;n++){const o=e.attributes[s[n]];t[r++]=o.location,t[r++]=o.offset,t[r++]=o.format,t[r++]=o.stride}const i=t.join("");return e._layoutKey=he(i,"geometry"),e._layoutKey}_createVertexBufferLayouts(e){if(this._bufferLayoutsCache[e._layoutKey])return this._bufferLayoutsCache[e._layoutKey];const t=[];return e.buffers.forEach(r=>{const s={arrayStride:0,stepMode:"vertex",attributes:[]},i=s.attributes;for(const n in e.attributes){const o=e.attributes[n];(o.divisor??1)!==1&&k(`Attribute ${n} has an invalid divisor value of '${o.divisor}'. WebGPU only supports a divisor value of 1`),o.buffer===r&&(s.arrayStride=o.stride,s.stepMode=o.instance?"instance":"vertex",i.push({shaderLocation:o.location,offset:o.offset,format:o.format}))}i.length&&t.push(s)}),this._bufferLayoutsCache[e._layoutKey]=t,t}_updatePipeHash(){const e=Ee(this._stencilMode,this._multisampleCount,this._colorMask,this._depthStencilAttachment);this._pipeStateCaches[e]||(this._pipeStateCaches[e]=Object.create(null)),this._pipeCache=this._pipeStateCaches[e]}destroy(){this._renderer=null,this._bufferLayoutsCache=null}}q.extension={type:[l.WebGPUSystem],name:"pipeline"};class Ae{constructor(){this.contexts=[],this.msaaTextures=[],this.msaaSamples=1}}class ke{init(e,t){this._renderer=e,this._renderTargetSystem=t}copyToTexture(e,t,r,s,i){const n=this._renderer,o=this._getGpuColorTexture(e),u=n.texture.getGpuSource(t.source);return n.encoder.commandEncoder.copyTextureToTexture({texture:o,origin:r},{texture:u,origin:i},s),t}startRenderPass(e,t=!0,r,s){const n=this._renderTargetSystem.getGpuRenderTarget(e),o=this.getDescriptor(e,t,r);n.descriptor=o,this._renderer.pipeline.setRenderTarget(n),this._renderer.encoder.beginRenderPass(n),this._renderer.encoder.setViewport(s)}finishRenderPass(){this._renderer.encoder.endRenderPass()}_getGpuColorTexture(e){const t=this._renderTargetSystem.getGpuRenderTarget(e);return t.contexts[0]?t.contexts[0].getCurrentTexture():this._renderer.texture.getGpuSource(e.colorTextures[0].source)}getDescriptor(e,t,r){typeof t=="boolean"&&(t=t?b.ALL:b.NONE);const s=this._renderTargetSystem,i=s.getGpuRenderTarget(e),n=e.colorTextures.map((c,f)=>{const h=i.contexts[f];let p,d;h?p=h.getCurrentTexture().createView():p=this._renderer.texture.getGpuSource(c).createView({mipLevelCount:1}),i.msaaTextures[f]&&(d=p,p=this._renderer.texture.getTextureView(i.msaaTextures[f]));const g=t&b.COLOR?"clear":"load";return r??(r=s.defaultClearColor),{view:p,resolveTarget:d,clearValue:r,storeOp:"store",loadOp:g}});let o;if((e.stencil||e.depth)&&!e.depthStencilTexture&&(e.ensureDepthStencilTexture(),e.depthStencilTexture.source.sampleCount=i.msaa?4:1),e.depthStencilTexture){const c=t&b.STENCIL?"clear":"load",f=t&b.DEPTH?"clear":"load";o={view:this._renderer.texture.getGpuSource(e.depthStencilTexture.source).createView(),stencilStoreOp:"store",stencilLoadOp:c,depthClearValue:1,depthLoadOp:f,depthStoreOp:"store"}}return{colorAttachments:n,depthStencilAttachment:o}}clear(e,t=!0,r,s){if(!t)return;const{gpu:i,encoder:n}=this._renderer,o=i.device;if(n.commandEncoder===null){const c=o.createCommandEncoder(),f=this.getDescriptor(e,t,r),h=c.beginRenderPass(f);h.setViewport(s.x,s.y,s.width,s.height,0,1),h.end();const p=c.finish();o.queue.submit([p])}else this.startRenderPass(e,t,r,s)}initGpuRenderTarget(e){e.isRoot=!0;const t=new Ae;return e.colorTextures.forEach((r,s)=>{if(ae.test(r.resource)){const i=r.resource.getContext("webgpu"),n=r.transparent?"premultiplied":"opaque";try{i.configure({device:this._renderer.gpu.device,usage:GPUTextureUsage.TEXTURE_BINDING|GPUTextureUsage.COPY_DST|GPUTextureUsage.RENDER_ATTACHMENT|GPUTextureUsage.COPY_SRC,format:"bgra8unorm",alphaMode:n})}catch(o){console.error(o)}t.contexts[s]=i}if(t.msaa=r.source.antialias,r.source.antialias){const i=new ue({width:0,height:0,sampleCount:4});t.msaaTextures[s]=i}}),t.msaa&&(t.msaaSamples=4,e.depthStencilTexture&&(e.depthStencilTexture.source.sampleCount=4)),t}destroyGpuRenderTarget(e){e.contexts.forEach(t=>{t.unconfigure()}),e.msaaTextures.forEach(t=>{t.destroy()}),e.msaaTextures.length=0,e.contexts.length=0}ensureDepthStencilTexture(e){const t=this._renderTargetSystem.getGpuRenderTarget(e);e.depthStencilTexture&&t.msaa&&(e.depthStencilTexture.source.sampleCount=4)}resizeGpuRenderTarget(e){const t=this._renderTargetSystem.getGpuRenderTarget(e);t.width=e.width,t.height=e.height,t.msaa&&e.colorTextures.forEach((r,s)=>{t.msaaTextures[s]?.resize(r.source.width,r.source.height,r.source._resolution)})}}class Y extends Be{constructor(e){super(e),this.adaptor=new ke,this.adaptor.init(e,this)}}Y.extension={type:[l.WebGPUSystem],name:"renderTarget"};class ${constructor(){this._gpuProgramData=Object.create(null)}contextChange(e){this._gpu=e}getProgramData(e){return this._gpuProgramData[e._layoutKey]||this._createGPUProgramData(e)}_createGPUProgramData(e){const t=this._gpu.device,r=e.gpuLayout.map(i=>t.createBindGroupLayout({entries:i})),s={bindGroupLayouts:r};return this._gpuProgramData[e._layoutKey]={bindGroups:r,pipeline:t.createPipelineLayout(s)},this._gpuProgramData[e._layoutKey]}destroy(){this._gpu=null,this._gpuProgramData=null}}$.extension={type:[l.WebGPUSystem],name:"shader"};const m={};m.normal={alpha:{srcFactor:"one",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"one",dstFactor:"one-minus-src-alpha",operation:"add"}};m.add={alpha:{srcFactor:"src-alpha",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"one",dstFactor:"one",operation:"add"}};m.multiply={alpha:{srcFactor:"one",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"dst",dstFactor:"one-minus-src-alpha",operation:"add"}};m.screen={alpha:{srcFactor:"one",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"one",dstFactor:"one-minus-src",operation:"add"}};m.overlay={alpha:{srcFactor:"one",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"one",dstFactor:"one-minus-src",operation:"add"}};m.none={alpha:{srcFactor:"one",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"zero",dstFactor:"zero",operation:"add"}};m["normal-npm"]={alpha:{srcFactor:"one",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"src-alpha",dstFactor:"one-minus-src-alpha",operation:"add"}};m["add-npm"]={alpha:{srcFactor:"one",dstFactor:"one",operation:"add"},color:{srcFactor:"src-alpha",dstFactor:"one",operation:"add"}};m["screen-npm"]={alpha:{srcFactor:"one",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"src-alpha",dstFactor:"one-minus-src",operation:"add"}};m.erase={alpha:{srcFactor:"zero",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"zero",dstFactor:"one-minus-src",operation:"add"}};class X{constructor(){this.defaultState=new z,this.defaultState.blend=!0}contextChange(e){this.gpu=e}getColorTargets(e){return[{format:"bgra8unorm",writeMask:0,blend:m[e.blendMode]||m.normal}]}destroy(){this.gpu=null}}X.extension={type:[l.WebGPUSystem],name:"state"};const De={type:"image",upload(a,e,t){const r=a.resource,s=(a.pixelWidth|0)*(a.pixelHeight|0),i=r.byteLength/s;t.device.queue.writeTexture({texture:e},r,{offset:0,rowsPerImage:a.pixelHeight,bytesPerRow:a.pixelHeight*i},{width:a.pixelWidth,height:a.pixelHeight,depthOrArrayLayers:1})}},Z={"bc1-rgba-unorm":{blockBytes:8,blockWidth:4,blockHeight:4},"bc2-rgba-unorm":{blockBytes:16,blockWidth:4,blockHeight:4},"bc3-rgba-unorm":{blockBytes:16,blockWidth:4,blockHeight:4},"bc7-rgba-unorm":{blockBytes:16,blockWidth:4,blockHeight:4},"etc1-rgb-unorm":{blockBytes:8,blockWidth:4,blockHeight:4},"etc2-rgba8unorm":{blockBytes:16,blockWidth:4,blockHeight:4},"astc-4x4-unorm":{blockBytes:16,blockWidth:4,blockHeight:4}},ze={blockBytes:4,blockWidth:1,blockHeight:1},Le={type:"compressed",upload(a,e,t){let r=a.pixelWidth,s=a.pixelHeight;const i=Z[a.format]||ze;for(let n=0;n<a.resource.length;n++){const o=a.resource[n],u=Math.ceil(r/i.blockWidth)*i.blockBytes;t.device.queue.writeTexture({texture:e,mipLevel:n},o,{offset:0,bytesPerRow:u},{width:Math.ceil(r/i.blockWidth)*i.blockWidth,height:Math.ceil(s/i.blockHeight)*i.blockHeight,depthOrArrayLayers:1}),r=Math.max(r>>1,1),s=Math.max(s>>1,1)}}},J={type:"image",upload(a,e,t){const r=a.resource;if(!r)return;const s=Math.min(e.width,a.resourceWidth||a.pixelWidth),i=Math.min(e.height,a.resourceHeight||a.pixelHeight),n=a.alphaMode==="premultiply-alpha-on-upload";t.device.queue.copyExternalImageToTexture({source:r},{texture:e,premultipliedAlpha:n},{width:s,height:i})}},Oe={type:"video",upload(a,e,t){J.upload(a,e,t)}};class He{constructor(e){this.device=e,this.sampler=e.createSampler({minFilter:"linear"}),this.pipelines={}}_getMipmapPipeline(e){let t=this.pipelines[e];return t||(this.mipmapShaderModule||(this.mipmapShaderModule=this.device.createShaderModule({code:`
var<private> pos : array<vec2<f32>, 3> = array<vec2<f32>, 3>(
vec2<f32>(-1.0, -1.0), vec2<f32>(-1.0, 3.0), vec2<f32>(3.0, -1.0));
struct VertexOutput {
@builtin(position) position : vec4<f32>,
@location(0) texCoord : vec2<f32>,
};
@vertex
fn vertexMain(@builtin(vertex_index) vertexIndex : u32) -> VertexOutput {
var output : VertexOutput;
output.texCoord = pos[vertexIndex] * vec2<f32>(0.5, -0.5) + vec2<f32>(0.5);
output.position = vec4<f32>(pos[vertexIndex], 0.0, 1.0);
return output;
}
@group(0) @binding(0) var imgSampler : sampler;
@group(0) @binding(1) var img : texture_2d<f32>;
@fragment
fn fragmentMain(@location(0) texCoord : vec2<f32>) -> @location(0) vec4<f32> {
return textureSample(img, imgSampler, texCoord);
}
`})),t=this.device.createRenderPipeline({layout:"auto",vertex:{module:this.mipmapShaderModule,entryPoint:"vertexMain"},fragment:{module:this.mipmapShaderModule,entryPoint:"fragmentMain",targets:[{format:e}]}}),this.pipelines[e]=t),t}generateMipmap(e){const t=this._getMipmapPipeline(e.format);if(e.dimension==="3d"||e.dimension==="1d")throw new Error("Generating mipmaps for non-2d textures is currently unsupported!");let r=e;const s=e.depthOrArrayLayers||1,i=e.usage&GPUTextureUsage.RENDER_ATTACHMENT;if(!i){const u={size:{width:Math.ceil(e.width/2),height:Math.ceil(e.height/2),depthOrArrayLayers:s},format:e.format,usage:GPUTextureUsage.TEXTURE_BINDING|GPUTextureUsage.COPY_SRC|GPUTextureUsage.RENDER_ATTACHMENT,mipLevelCount:e.mipLevelCount-1};r=this.device.createTexture(u)}const n=this.device.createCommandEncoder({}),o=t.getBindGroupLayout(0);for(let u=0;u<s;++u){let c=e.createView({baseMipLevel:0,mipLevelCount:1,dimension:"2d",baseArrayLayer:u,arrayLayerCount:1}),f=i?1:0;for(let h=1;h<e.mipLevelCount;++h){const p=r.createView({baseMipLevel:f++,mipLevelCount:1,dimension:"2d",baseArrayLayer:u,arrayLayerCount:1}),d=n.beginRenderPass({colorAttachments:[{view:p,storeOp:"store",loadOp:"clear",clearValue:{r:0,g:0,b:0,a:0}}]}),g=this.device.createBindGroup({layout:o,entries:[{binding:0,resource:this.sampler},{binding:1,resource:c}]});d.setPipeline(t),d.setBindGroup(0,g),d.draw(3,1,0,0),d.end(),c=p}}if(!i){const u={width:Math.ceil(e.width/2),height:Math.ceil(e.height/2),depthOrArrayLayers:s};for(let c=1;c<e.mipLevelCount;++c)n.copyTextureToTexture({texture:r,mipLevel:c-1},{texture:e,mipLevel:c},u),u.width=Math.ceil(u.width/2),u.height=Math.ceil(u.height/2)}return this.device.queue.submit([n.finish()]),i||r.destroy(),e}}class Q{constructor(e){this.managedTextures=[],this._gpuSources=Object.create(null),this._gpuSamplers=Object.create(null),this._bindGroupHash=Object.create(null),this._textureViewHash=Object.create(null),this._uploads={image:J,buffer:De,video:Oe,compressed:Le},this._renderer=e}contextChange(e){this._gpu=e}initSource(e){if(e.autoGenerateMipmaps){const u=Math.max(e.pixelWidth,e.pixelHeight);e.mipLevelCount=Math.floor(Math.log2(u))+1}let t=GPUTextureUsage.TEXTURE_BINDING|GPUTextureUsage.COPY_DST;e.uploadMethodId!=="compressed"&&(t|=GPUTextureUsage.RENDER_ATTACHMENT,t|=GPUTextureUsage.COPY_SRC);const r=Z[e.format]||{blockBytes:4,blockWidth:1,blockHeight:1},s=Math.ceil(e.pixelWidth/r.blockWidth)*r.blockWidth,i=Math.ceil(e.pixelHeight/r.blockHeight)*r.blockHeight,n={label:e.label,size:{width:s,height:i},format:e.format,sampleCount:e.sampleCount,mipLevelCount:e.mipLevelCount,dimension:e.dimension,usage:t},o=this._gpu.device.createTexture(n);return this._gpuSources[e.uid]=o,this.managedTextures.includes(e)||(e.on("update",this.onSourceUpdate,this),e.on("resize",this.onSourceResize,this),e.on("destroy",this.onSourceDestroy,this),e.on("unload",this.onSourceUnload,this),e.on("updateMipmaps",this.onUpdateMipmaps,this),this.managedTextures.push(e)),this.onSourceUpdate(e),o}onSourceUpdate(e){const t=this.getGpuSource(e);t&&(this._uploads[e.uploadMethodId]&&this._uploads[e.uploadMethodId].upload(e,t,this._gpu),e.autoGenerateMipmaps&&e.mipLevelCount>1&&this.onUpdateMipmaps(e))}onSourceUnload(e){const t=this._gpuSources[e.uid];t&&(this._gpuSources[e.uid]=null,t.destroy())}onUpdateMipmaps(e){this._mipmapGenerator||(this._mipmapGenerator=new He(this._gpu.device));const t=this.getGpuSource(e);this._mipmapGenerator.generateMipmap(t)}onSourceDestroy(e){e.off("update",this.onSourceUpdate,this),e.off("unload",this.onSourceUnload,this),e.off("destroy",this.onSourceDestroy,this),e.off("resize",this.onSourceResize,this),e.off("updateMipmaps",this.onUpdateMipmaps,this),this.managedTextures.splice(this.managedTextures.indexOf(e),1),this.onSourceUnload(e)}onSourceResize(e){const t=this._gpuSources[e.uid];t?(t.width!==e.pixelWidth||t.height!==e.pixelHeight)&&(this._textureViewHash[e.uid]=null,this._bindGroupHash[e.uid]=null,this.onSourceUnload(e),this.initSource(e)):this.initSource(e)}_initSampler(e){return this._gpuSamplers[e._resourceId]=this._gpu.device.createSampler(e),this._gpuSamplers[e._resourceId]}getGpuSampler(e){return this._gpuSamplers[e._resourceId]||this._initSampler(e)}getGpuSource(e){return this._gpuSources[e.uid]||this.initSource(e)}getTextureBindGroup(e){return this._bindGroupHash[e.uid]??this._createTextureBindGroup(e)}_createTextureBindGroup(e){const t=e.source,r=t.uid;return this._bindGroupHash[r]=new A({0:t,1:t.style}),this._bindGroupHash[r]}getTextureView(e){const t=e.source;return this._textureViewHash[t.uid]??this._createTextureView(t)}_createTextureView(e){return this._textureViewHash[e.uid]=this.getGpuSource(e).createView(),this._textureViewHash[e.uid]}generateCanvas(e){const t=this._renderer,r=t.gpu.device.createCommandEncoder(),s=ce.get().createCanvas();s.width=e.source.pixelWidth,s.height=e.source.pixelHeight;const i=s.getContext("webgpu");return i.configure({device:t.gpu.device,usage:GPUTextureUsage.COPY_DST|GPUTextureUsage.COPY_SRC,format:navigator.gpu.getPreferredCanvasFormat(),alphaMode:"premultiplied"}),r.copyTextureToTexture({texture:t.texture.getGpuSource(e.source),origin:{x:0,y:0}},{texture:i.getCurrentTexture()},{width:s.width,height:s.height}),t.gpu.device.queue.submit([r.finish()]),s}getPixels(e){const t=this.generateCanvas(e),r=w.getOptimalCanvasAndContext(t.width,t.height),s=r.context;s.drawImage(t,0,0);const{width:i,height:n}=t,o=s.getImageData(0,0,i,n),u=new Uint8ClampedArray(o.data.buffer);return w.returnCanvasAndContext(r),{pixels:u,width:i,height:n}}destroy(){this.managedTextures.slice().forEach(e=>this.onSourceDestroy(e)),this.managedTextures=null;for(const e of Object.keys(this._bindGroupHash)){const t=Number(e);this._bindGroupHash[t]?.destroy(),this._bindGroupHash[t]=null}this._gpu=null,this._mipmapGenerator=null,this._gpuSources=null,this._bindGroupHash=null,this._textureViewHash=null,this._gpuSamplers=null}}Q.extension={type:[l.WebGPUSystem],name:"texture"};class ee{init(){const e=new pe({uTransformMatrix:{value:new D,type:"mat3x3<f32>"},uColor:{value:new Float32Array([1,1,1,1]),type:"vec4<f32>"},uRound:{value:0,type:"f32"}}),t=T({name:"graphics",bits:[L,O(R()),le,v]});this.shader=new C({gpuProgram:t,resources:{localUniforms:e}})}execute(e,t){const r=t.context,s=r.customShader||this.shader,i=e.renderer,n=i.graphicsContext,{geometry:o,instructions:u}=n.getContextRenderData(r),c=i.encoder;c.setPipelineFromGeometryProgramAndState(o,s.gpuProgram,e.state),c.setGeometry(o);const f=i.globalUniforms.bindGroup;c.setBindGroup(0,f,s.gpuProgram);const h=i.renderPipes.uniformBatch.getUniformBindGroup(s.resources.localUniforms,!0);c.setBindGroup(2,h,s.gpuProgram);const p=u.instructions;for(let d=0;d<u.instructionSize;d++){const g=p[d];if(s.groups[1]=g.bindGroup,!g.gpuBindGroup){const B=g.textures;g.bindGroup=E(B.textures,B.count),g.gpuBindGroup=i.bindGroup.getBindGroup(g.bindGroup,s.gpuProgram,1)}c.setBindGroup(1,g.bindGroup,s.gpuProgram),c.renderPassEncoder.drawIndexed(g.size,1,g.start)}}destroy(){this.shader.destroy(!0),this.shader=null}}ee.extension={type:[l.WebGPUPipesAdaptor],name:"graphics"};class te{init(){const e=T({name:"mesh",bits:[fe,Se,v]});this._shader=new C({gpuProgram:e,resources:{uTexture:M.EMPTY._source,uSampler:M.EMPTY._source.style,textureUniforms:{uTextureMatrix:{type:"mat3x3<f32>",value:new D}}}})}execute(e,t){const r=e.renderer;let s=t._shader;if(!s)s=this._shader,s.resources.uTexture=t.texture.source,s.resources.uSampler=t.texture.source.style,s.resources.textureUniforms.uniforms.uTextureMatrix=t.texture.textureMatrix.mapCoord;else if(!s.gpuProgram){k("Mesh shader has no gpuProgram",t.shader);return}const i=s.gpuProgram;if(i.autoAssignGlobalUniforms&&(s.groups[0]=r.globalUniforms.bindGroup),i.autoAssignLocalUniforms){const n=e.localUniforms;s.groups[1]=r.renderPipes.uniformBatch.getUniformBindGroup(n,!0)}r.encoder.draw({geometry:t._geometry,shader:s,state:t.state})}destroy(){this._shader.destroy(!0),this._shader=null}}te.extension={type:[l.WebGPUPipesAdaptor],name:"mesh"};const Fe=[...Pe,N,V,U,I,Q,Y,$,X,q,W,j,F],Ie=[...Te,K],We=[H,te,ee],re=[],se=[],ie=[];G.handleByNamedList(l.WebGPUSystem,re);G.handleByNamedList(l.WebGPUPipes,se);G.handleByNamedList(l.WebGPUPipesAdaptor,ie);G.add(...Fe,...Ie,...We);tt=class extends de{constructor(){const e={name:"webgpu",type:ge.WEBGPU,systems:re,renderPipes:se,renderPipeAdaptors:ie};super(e)}}});export{tt as WebGPURenderer,__tla};

View File

@@ -1 +0,0 @@
import{P as m,r as J,E as w,T as L,U as Q,a as ee,w as y,e as z,C as Z,__tla as __tla_0}from"./TorrentDetail-BZZ-B8cw.js";import{__tla as __tla_1}from"./webworkerAll-BwUJZEVj.js";import{__tla as __tla_2}from"./MoveTorrentDialog.vue_vue_type_script_setup_true_lang-G1lEzMcG.js";import{__tla as __tla_3}from"./index-DF2-l4SD.js";import"./vue-BQgCUbk_.js";import"./vuetify-DWkLi8Ew.js";import{__tla as __tla_4}from"./MixedButton.vue_vue_type_script_setup_true_lang-QFpliKgB.js";import"./FileIcon-DH65fwz5.js";import{__tla as __tla_5}from"./MoveTorrentFileDialog.vue_vue_type_script_setup_true_lang-DEnRCAW6.js";import{__tla as __tla_6}from"./colorToUniform-pFJ8sYB5.js";import{__tla as __tla_7}from"./CanvasPool-DIOMPpzz.js";import{__tla as __tla_8}from"./getBatchSamplersUniformGroup-PJByx64R.js";Promise.all([(()=>{try{return __tla_0}catch{}})(),(()=>{try{return __tla_1}catch{}})(),(()=>{try{return __tla_2}catch{}})(),(()=>{try{return __tla_3}catch{}})(),(()=>{try{return __tla_4}catch{}})(),(()=>{try{return __tla_5}catch{}})(),(()=>{try{return __tla_6}catch{}})(),(()=>{try{return __tla_7}catch{}})(),(()=>{try{return __tla_8}catch{}})()]).then(async()=>{class M{constructor(e){this.bubbles=!0,this.cancelBubble=!0,this.cancelable=!1,this.composed=!1,this.defaultPrevented=!1,this.eventPhase=M.prototype.NONE,this.propagationStopped=!1,this.propagationImmediatelyStopped=!1,this.layer=new m,this.page=new m,this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,this.manager=e}get layerX(){return this.layer.x}get layerY(){return this.layer.y}get pageX(){return this.page.x}get pageY(){return this.page.y}get data(){return this}composedPath(){return this.manager&&(!this.path||this.path[this.path.length-1]!==this.target)&&(this.path=this.target?this.manager.propagationPath(this.target):[]),this.path}initEvent(e,t,i){throw new Error("initEvent() is a legacy DOM API. It is not implemented in the Federated Events API.")}initUIEvent(e,t,i,n,s){throw new Error("initUIEvent() is a legacy DOM API. It is not implemented in the Federated Events API.")}preventDefault(){this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault(),this.defaultPrevented=!0}stopImmediatePropagation(){this.propagationImmediatelyStopped=!0}stopPropagation(){this.propagationStopped=!0}}var O=/iPhone/i,C=/iPod/i,S=/iPad/i,U=/\biOS-universal(?:.+)Mac\b/i,k=/\bAndroid(?:.+)Mobile\b/i,H=/Android/i,b=/(?:SD4930UR|\bSilk(?:.+)Mobile\b)/i,A=/Silk/i,g=/Windows Phone/i,X=/\bWindows(?:.+)ARM\b/i,R=/BlackBerry/i,F=/BB10/i,Y=/Opera Mini/i,K=/\b(CriOS|Chrome)(?:.+)Mobile/i,$=/Mobile(?:.+)Firefox\b/i,G=function(o){return typeof o<"u"&&o.platform==="MacIntel"&&typeof o.maxTouchPoints=="number"&&o.maxTouchPoints>1&&typeof MSStream>"u"};function te(o){return function(e){return e.test(o)}}function W(o){var e={userAgent:"",platform:"",maxTouchPoints:0};!o&&typeof navigator<"u"?e={userAgent:navigator.userAgent,platform:navigator.platform,maxTouchPoints:navigator.maxTouchPoints||0}:typeof o=="string"?e.userAgent=o:o&&o.userAgent&&(e={userAgent:o.userAgent,platform:o.platform,maxTouchPoints:o.maxTouchPoints||0});var t=e.userAgent,i=t.split("[FBAN");typeof i[1]<"u"&&(t=i[0]),i=t.split("Twitter"),typeof i[1]<"u"&&(t=i[0]);var n=te(t),s={apple:{phone:n(O)&&!n(g),ipod:n(C),tablet:!n(O)&&(n(S)||G(e))&&!n(g),universal:n(U),device:(n(O)||n(C)||n(S)||n(U)||G(e))&&!n(g)},amazon:{phone:n(b),tablet:!n(b)&&n(A),device:n(b)||n(A)},android:{phone:!n(g)&&n(b)||!n(g)&&n(k),tablet:!n(g)&&!n(b)&&!n(k)&&(n(A)||n(H)),device:!n(g)&&(n(b)||n(A)||n(k)||n(H))||n(/\bokhttp\b/i)},windows:{phone:n(g),tablet:n(X),device:n(g)||n(X)},other:{blackberry:n(R),blackberry10:n(F),opera:n(Y),firefox:n($),chrome:n(K),device:n(R)||n(F)||n(Y)||n($)||n(K)},any:!1,phone:!1,tablet:!1};return s.any=s.apple.device||s.android.device||s.windows.device||s.other.device,s.phone=s.apple.phone||s.android.phone||s.windows.phone,s.tablet=s.apple.tablet||s.android.tablet||s.windows.tablet,s}const ie=W.default??W,ne=ie(globalThis.navigator),se=9,I=100,oe=0,re=0,j=2,N=1,ae=-1e3,he=-1e3,le=2;class V{constructor(e,t=ne){this._mobileInfo=t,this.debug=!1,this._isActive=!1,this._isMobileAccessibility=!1,this._pool=[],this._renderId=0,this._children=[],this._androidUpdateCount=0,this._androidUpdateFrequency=500,this._hookDiv=null,(t.tablet||t.phone)&&this._createTouchHook();const i=document.createElement("div");i.style.width=`${I}px`,i.style.height=`${I}px`,i.style.position="absolute",i.style.top=`${oe}px`,i.style.left=`${re}px`,i.style.zIndex=j.toString(),this._div=i,this._renderer=e,this._onKeyDown=this._onKeyDown.bind(this),this._onMouseMove=this._onMouseMove.bind(this),globalThis.addEventListener("keydown",this._onKeyDown,!1)}get isActive(){return this._isActive}get isMobileAccessibility(){return this._isMobileAccessibility}get hookDiv(){return this._hookDiv}_createTouchHook(){const e=document.createElement("button");e.style.width=`${N}px`,e.style.height=`${N}px`,e.style.position="absolute",e.style.top=`${ae}px`,e.style.left=`${he}px`,e.style.zIndex=le.toString(),e.style.backgroundColor="#FF0000",e.title="select to enable accessibility for this content",e.addEventListener("focus",()=>{this._isMobileAccessibility=!0,this._activate(),this._destroyTouchHook()}),document.body.appendChild(e),this._hookDiv=e}_destroyTouchHook(){this._hookDiv&&(document.body.removeChild(this._hookDiv),this._hookDiv=null)}_activate(){this._isActive||(this._isActive=!0,globalThis.document.addEventListener("mousemove",this._onMouseMove,!0),globalThis.removeEventListener("keydown",this._onKeyDown,!1),this._renderer.runners.postrender.add(this),this._renderer.view.canvas.parentNode?.appendChild(this._div))}_deactivate(){!this._isActive||this._isMobileAccessibility||(this._isActive=!1,globalThis.document.removeEventListener("mousemove",this._onMouseMove,!0),globalThis.addEventListener("keydown",this._onKeyDown,!1),this._renderer.runners.postrender.remove(this),this._div.parentNode?.removeChild(this._div))}_updateAccessibleObjects(e){if(!e.visible||!e.accessibleChildren)return;e.accessible&&e.isInteractive()&&(e._accessibleActive||this._addChild(e),e._renderId=this._renderId);const t=e.children;if(t)for(let i=0;i<t.length;i++)this._updateAccessibleObjects(t[i])}init(e){this.debug=e?.debug??this.debug,this._renderer.runners.postrender.remove(this)}postrender(){const e=performance.now();if(this._mobileInfo.android.device&&e<this._androidUpdateCount||(this._androidUpdateCount=e+this._androidUpdateFrequency,!this._renderer.renderingToScreen||!this._renderer.view.canvas))return;this._renderer.lastObjectRendered&&this._updateAccessibleObjects(this._renderer.lastObjectRendered);const{x:t,y:i,width:n,height:s}=this._renderer.view.canvas.getBoundingClientRect(),{width:r,height:a,resolution:c}=this._renderer,p=n/r*c,h=s/a*c;let l=this._div;l.style.left=`${t}px`,l.style.top=`${i}px`,l.style.width=`${r}px`,l.style.height=`${a}px`;for(let d=0;d<this._children.length;d++){const u=this._children[d];if(u._renderId!==this._renderId)u._accessibleActive=!1,J(this._children,d,1),this._div.removeChild(u._accessibleDiv),this._pool.push(u._accessibleDiv),u._accessibleDiv=null,d--;else{l=u._accessibleDiv;let v=u.hitArea;const _=u.worldTransform;u.hitArea?(l.style.left=`${(_.tx+v.x*_.a)*p}px`,l.style.top=`${(_.ty+v.y*_.d)*h}px`,l.style.width=`${v.width*_.a*p}px`,l.style.height=`${v.height*_.d*h}px`):(v=u.getBounds().rectangle,this._capHitArea(v),l.style.left=`${v.x*p}px`,l.style.top=`${v.y*h}px`,l.style.width=`${v.width*p}px`,l.style.height=`${v.height*h}px`,l.title!==u.accessibleTitle&&u.accessibleTitle!==null&&(l.title=u.accessibleTitle||""),l.getAttribute("aria-label")!==u.accessibleHint&&u.accessibleHint!==null&&l.setAttribute("aria-label",u.accessibleHint||"")),(u.accessibleTitle!==l.title||u.tabIndex!==l.tabIndex)&&(l.title=u.accessibleTitle||"",l.tabIndex=u.tabIndex,this.debug&&this._updateDebugHTML(l))}}this._renderId++}_updateDebugHTML(e){e.innerHTML=`type: ${e.type}</br> title : ${e.title}</br> tabIndex: ${e.tabIndex}`}_capHitArea(e){e.x<0&&(e.width+=e.x,e.x=0),e.y<0&&(e.height+=e.y,e.y=0);const{width:t,height:i}=this._renderer;e.x+e.width>t&&(e.width=t-e.x),e.y+e.height>i&&(e.height=i-e.y)}_addChild(e){let t=this._pool.pop();t||(t=document.createElement("button"),t.style.width=`${I}px`,t.style.height=`${I}px`,t.style.backgroundColor=this.debug?"rgba(255,255,255,0.5)":"transparent",t.style.position="absolute",t.style.zIndex=j.toString(),t.style.borderStyle="none",navigator.userAgent.toLowerCase().includes("chrome")?t.setAttribute("aria-live","off"):t.setAttribute("aria-live","polite"),navigator.userAgent.match(/rv:.*Gecko\//)?t.setAttribute("aria-relevant","additions"):t.setAttribute("aria-relevant","text"),t.addEventListener("click",this._onClick.bind(this)),t.addEventListener("focus",this._onFocus.bind(this)),t.addEventListener("focusout",this._onFocusOut.bind(this))),t.style.pointerEvents=e.accessiblePointerEvents,t.type=e.accessibleType,e.accessibleTitle&&e.accessibleTitle!==null?t.title=e.accessibleTitle:(!e.accessibleHint||e.accessibleHint===null)&&(t.title=`container ${e.tabIndex}`),e.accessibleHint&&e.accessibleHint!==null&&t.setAttribute("aria-label",e.accessibleHint),this.debug&&this._updateDebugHTML(t),e._accessibleActive=!0,e._accessibleDiv=t,t.container=e,this._children.push(e),this._div.appendChild(e._accessibleDiv),e._accessibleDiv.tabIndex=e.tabIndex}_dispatchEvent(e,t){const{container:i}=e.target,n=this._renderer.events.rootBoundary,s=Object.assign(new M(n),{target:i});n.rootTarget=this._renderer.lastObjectRendered,t.forEach(r=>n.dispatchEvent(s,r))}_onClick(e){this._dispatchEvent(e,["click","pointertap","tap"])}_onFocus(e){e.target.getAttribute("aria-live")||e.target.setAttribute("aria-live","assertive"),this._dispatchEvent(e,["mouseover"])}_onFocusOut(e){e.target.getAttribute("aria-live")||e.target.setAttribute("aria-live","polite"),this._dispatchEvent(e,["mouseout"])}_onKeyDown(e){e.keyCode===se&&this._activate()}_onMouseMove(e){e.movementX===0&&e.movementY===0||this._deactivate()}destroy(){this._destroyTouchHook(),this._div=null,globalThis.document.removeEventListener("mousemove",this._onMouseMove,!0),globalThis.removeEventListener("keydown",this._onKeyDown),this._pool=null,this._children=null,this._renderer=null}}V.extension={type:[w.WebGLSystem,w.WebGPUSystem],name:"accessibility"};const ue={accessible:!1,accessibleTitle:null,accessibleHint:null,tabIndex:0,_accessibleActive:!1,_accessibleDiv:null,accessibleType:"button",accessiblePointerEvents:"auto",accessibleChildren:!0,_renderId:-1};class de{constructor(){this.interactionFrequency=10,this._deltaTime=0,this._didMove=!1,this._tickerAdded=!1,this._pauseUpdate=!0}init(e){this.removeTickerListener(),this.events=e,this.interactionFrequency=10,this._deltaTime=0,this._didMove=!1,this._tickerAdded=!1,this._pauseUpdate=!0}get pauseUpdate(){return this._pauseUpdate}set pauseUpdate(e){this._pauseUpdate=e}addTickerListener(){this._tickerAdded||!this.domElement||(L.system.add(this._tickerUpdate,this,Q.INTERACTION),this._tickerAdded=!0)}removeTickerListener(){this._tickerAdded&&(L.system.remove(this._tickerUpdate,this),this._tickerAdded=!1)}pointerMoved(){this._didMove=!0}_update(){if(!this.domElement||this._pauseUpdate)return;if(this._didMove){this._didMove=!1;return}const e=this.events._rootPointerEvent;this.events.supportsTouchEvents&&e.pointerType==="touch"||globalThis.document.dispatchEvent(new PointerEvent("pointermove",{clientX:e.clientX,clientY:e.clientY}))}_tickerUpdate(e){this._deltaTime+=e.deltaTime,!(this._deltaTime<this.interactionFrequency)&&(this._deltaTime=0,this._update())}}const E=new de;class D extends M{constructor(){super(...arguments),this.client=new m,this.movement=new m,this.offset=new m,this.global=new m,this.screen=new m}get clientX(){return this.client.x}get clientY(){return this.client.y}get x(){return this.clientX}get y(){return this.clientY}get movementX(){return this.movement.x}get movementY(){return this.movement.y}get offsetX(){return this.offset.x}get offsetY(){return this.offset.y}get globalX(){return this.global.x}get globalY(){return this.global.y}get screenX(){return this.screen.x}get screenY(){return this.screen.y}getLocalPosition(e,t,i){return e.worldTransform.applyInverse(i||this.global,t)}getModifierState(e){return"getModifierState"in this.nativeEvent&&this.nativeEvent.getModifierState(e)}initMouseEvent(e,t,i,n,s,r,a,c,p,h,l,d,u,v,_){throw new Error("Method not implemented.")}}class f extends D{constructor(){super(...arguments),this.width=0,this.height=0,this.isPrimary=!1}getCoalescedEvents(){return this.type==="pointermove"||this.type==="mousemove"||this.type==="touchmove"?[this]:[]}getPredictedEvents(){throw new Error("getPredictedEvents is not supported!")}}class T extends D{constructor(){super(...arguments),this.DOM_DELTA_PIXEL=0,this.DOM_DELTA_LINE=1,this.DOM_DELTA_PAGE=2}}T.DOM_DELTA_PIXEL=0;T.DOM_DELTA_LINE=1;T.DOM_DELTA_PAGE=2;const ce=2048,pe=new m,P=new m;class ve{constructor(e){this.dispatch=new ee,this.moveOnAll=!1,this.enableGlobalMoveEvents=!0,this.mappingState={trackingData:{}},this.eventPool=new Map,this._allInteractiveElements=[],this._hitElements=[],this._isPointerMoveEvent=!1,this.rootTarget=e,this.hitPruneFn=this.hitPruneFn.bind(this),this.hitTestFn=this.hitTestFn.bind(this),this.mapPointerDown=this.mapPointerDown.bind(this),this.mapPointerMove=this.mapPointerMove.bind(this),this.mapPointerOut=this.mapPointerOut.bind(this),this.mapPointerOver=this.mapPointerOver.bind(this),this.mapPointerUp=this.mapPointerUp.bind(this),this.mapPointerUpOutside=this.mapPointerUpOutside.bind(this),this.mapWheel=this.mapWheel.bind(this),this.mappingTable={},this.addEventMapping("pointerdown",this.mapPointerDown),this.addEventMapping("pointermove",this.mapPointerMove),this.addEventMapping("pointerout",this.mapPointerOut),this.addEventMapping("pointerleave",this.mapPointerOut),this.addEventMapping("pointerover",this.mapPointerOver),this.addEventMapping("pointerup",this.mapPointerUp),this.addEventMapping("pointerupoutside",this.mapPointerUpOutside),this.addEventMapping("wheel",this.mapWheel)}addEventMapping(e,t){this.mappingTable[e]||(this.mappingTable[e]=[]),this.mappingTable[e].push({fn:t,priority:0}),this.mappingTable[e].sort((i,n)=>i.priority-n.priority)}dispatchEvent(e,t){e.propagationStopped=!1,e.propagationImmediatelyStopped=!1,this.propagate(e,t),this.dispatch.emit(t||e.type,e)}mapEvent(e){if(!this.rootTarget)return;const t=this.mappingTable[e.type];if(t)for(let i=0,n=t.length;i<n;i++)t[i].fn(e);else y(`[EventBoundary]: Event mapping not defined for ${e.type}`)}hitTest(e,t){E.pauseUpdate=!0;const n=this._isPointerMoveEvent&&this.enableGlobalMoveEvents?"hitTestMoveRecursive":"hitTestRecursive",s=this[n](this.rootTarget,this.rootTarget.eventMode,pe.set(e,t),this.hitTestFn,this.hitPruneFn);return s&&s[0]}propagate(e,t){if(!e.target)return;const i=e.composedPath();e.eventPhase=e.CAPTURING_PHASE;for(let n=0,s=i.length-1;n<s;n++)if(e.currentTarget=i[n],this.notifyTarget(e,t),e.propagationStopped||e.propagationImmediatelyStopped)return;if(e.eventPhase=e.AT_TARGET,e.currentTarget=e.target,this.notifyTarget(e,t),!(e.propagationStopped||e.propagationImmediatelyStopped)){e.eventPhase=e.BUBBLING_PHASE;for(let n=i.length-2;n>=0;n--)if(e.currentTarget=i[n],this.notifyTarget(e,t),e.propagationStopped||e.propagationImmediatelyStopped)return}}all(e,t,i=this._allInteractiveElements){if(i.length===0)return;e.eventPhase=e.BUBBLING_PHASE;const n=Array.isArray(t)?t:[t];for(let s=i.length-1;s>=0;s--)n.forEach(r=>{e.currentTarget=i[s],this.notifyTarget(e,r)})}propagationPath(e){const t=[e];for(let i=0;i<ce&&e!==this.rootTarget&&e.parent;i++){if(!e.parent)throw new Error("Cannot find propagation path to disconnected target");t.push(e.parent),e=e.parent}return t.reverse(),t}hitTestMoveRecursive(e,t,i,n,s,r=!1){let a=!1;if(this._interactivePrune(e))return null;if((e.eventMode==="dynamic"||t==="dynamic")&&(E.pauseUpdate=!1),e.interactiveChildren&&e.children){const h=e.children;for(let l=h.length-1;l>=0;l--){const d=h[l],u=this.hitTestMoveRecursive(d,this._isInteractive(t)?t:d.eventMode,i,n,s,r||s(e,i));if(u){if(u.length>0&&!u[u.length-1].parent)continue;const v=e.isInteractive();(u.length>0||v)&&(v&&this._allInteractiveElements.push(e),u.push(e)),this._hitElements.length===0&&(this._hitElements=u),a=!0}}}const c=this._isInteractive(t),p=e.isInteractive();return p&&p&&this._allInteractiveElements.push(e),r||this._hitElements.length>0?null:a?this._hitElements:c&&!s(e,i)&&n(e,i)?p?[e]:[]:null}hitTestRecursive(e,t,i,n,s){if(this._interactivePrune(e)||s(e,i))return null;if((e.eventMode==="dynamic"||t==="dynamic")&&(E.pauseUpdate=!1),e.interactiveChildren&&e.children){const c=e.children,p=i;for(let h=c.length-1;h>=0;h--){const l=c[h],d=this.hitTestRecursive(l,this._isInteractive(t)?t:l.eventMode,p,n,s);if(d){if(d.length>0&&!d[d.length-1].parent)continue;const u=e.isInteractive();return(d.length>0||u)&&d.push(e),d}}}const r=this._isInteractive(t),a=e.isInteractive();return r&&n(e,i)?a?[e]:[]:null}_isInteractive(e){return e==="static"||e==="dynamic"}_interactivePrune(e){return!e||!e.visible||!e.renderable||!e.includeInBuild||!e.measurable||e.eventMode==="none"||e.eventMode==="passive"&&!e.interactiveChildren}hitPruneFn(e,t){if(e.hitArea&&(e.worldTransform.applyInverse(t,P),!e.hitArea.contains(P.x,P.y)))return!0;if(e.effects&&e.effects.length)for(let i=0;i<e.effects.length;i++){const n=e.effects[i];if(n.containsPoint&&!n.containsPoint(t,this.hitTestFn))return!0}return!1}hitTestFn(e,t){return e.hitArea?!0:e?.containsPoint?(e.worldTransform.applyInverse(t,P),e.containsPoint(P)):!1}notifyTarget(e,t){t=t??e.type;const i=`on${t}`;e.currentTarget[i]?.(e);const n=e.eventPhase===e.CAPTURING_PHASE||e.eventPhase===e.AT_TARGET?`${t}capture`:t;this._notifyListeners(e,n),e.eventPhase===e.AT_TARGET&&this._notifyListeners(e,t)}mapPointerDown(e){if(!(e instanceof f)){y("EventBoundary cannot map a non-pointer event as a pointer event");return}const t=this.createPointerEvent(e);if(this.dispatchEvent(t,"pointerdown"),t.pointerType==="touch")this.dispatchEvent(t,"touchstart");else if(t.pointerType==="mouse"||t.pointerType==="pen"){const n=t.button===2;this.dispatchEvent(t,n?"rightdown":"mousedown")}const i=this.trackingData(e.pointerId);i.pressTargetsByButton[e.button]=t.composedPath(),this.freeEvent(t)}mapPointerMove(e){if(!(e instanceof f)){y("EventBoundary cannot map a non-pointer event as a pointer event");return}this._allInteractiveElements.length=0,this._hitElements.length=0,this._isPointerMoveEvent=!0;const t=this.createPointerEvent(e);this._isPointerMoveEvent=!1;const i=t.pointerType==="mouse"||t.pointerType==="pen",n=this.trackingData(e.pointerId),s=this.findMountedTarget(n.overTargets);if(n.overTargets?.length>0&&s!==t.target){const c=e.type==="mousemove"?"mouseout":"pointerout",p=this.createPointerEvent(e,c,s);if(this.dispatchEvent(p,"pointerout"),i&&this.dispatchEvent(p,"mouseout"),!t.composedPath().includes(s)){const h=this.createPointerEvent(e,"pointerleave",s);for(h.eventPhase=h.AT_TARGET;h.target&&!t.composedPath().includes(h.target);)h.currentTarget=h.target,this.notifyTarget(h),i&&this.notifyTarget(h,"mouseleave"),h.target=h.target.parent;this.freeEvent(h)}this.freeEvent(p)}if(s!==t.target){const c=e.type==="mousemove"?"mouseover":"pointerover",p=this.clonePointerEvent(t,c);this.dispatchEvent(p,"pointerover"),i&&this.dispatchEvent(p,"mouseover");let h=s?.parent;for(;h&&h!==this.rootTarget.parent&&h!==t.target;)h=h.parent;if(!h||h===this.rootTarget.parent){const d=this.clonePointerEvent(t,"pointerenter");for(d.eventPhase=d.AT_TARGET;d.target&&d.target!==s&&d.target!==this.rootTarget.parent;)d.currentTarget=d.target,this.notifyTarget(d),i&&this.notifyTarget(d,"mouseenter"),d.target=d.target.parent;this.freeEvent(d)}this.freeEvent(p)}const r=[],a=this.enableGlobalMoveEvents??!0;this.moveOnAll?r.push("pointermove"):this.dispatchEvent(t,"pointermove"),a&&r.push("globalpointermove"),t.pointerType==="touch"&&(this.moveOnAll?r.splice(1,0,"touchmove"):this.dispatchEvent(t,"touchmove"),a&&r.push("globaltouchmove")),i&&(this.moveOnAll?r.splice(1,0,"mousemove"):this.dispatchEvent(t,"mousemove"),a&&r.push("globalmousemove"),this.cursor=t.target?.cursor),r.length>0&&this.all(t,r),this._allInteractiveElements.length=0,this._hitElements.length=0,n.overTargets=t.composedPath(),this.freeEvent(t)}mapPointerOver(e){if(!(e instanceof f)){y("EventBoundary cannot map a non-pointer event as a pointer event");return}const t=this.trackingData(e.pointerId),i=this.createPointerEvent(e),n=i.pointerType==="mouse"||i.pointerType==="pen";this.dispatchEvent(i,"pointerover"),n&&this.dispatchEvent(i,"mouseover"),i.pointerType==="mouse"&&(this.cursor=i.target?.cursor);const s=this.clonePointerEvent(i,"pointerenter");for(s.eventPhase=s.AT_TARGET;s.target&&s.target!==this.rootTarget.parent;)s.currentTarget=s.target,this.notifyTarget(s),n&&this.notifyTarget(s,"mouseenter"),s.target=s.target.parent;t.overTargets=i.composedPath(),this.freeEvent(i),this.freeEvent(s)}mapPointerOut(e){if(!(e instanceof f)){y("EventBoundary cannot map a non-pointer event as a pointer event");return}const t=this.trackingData(e.pointerId);if(t.overTargets){const i=e.pointerType==="mouse"||e.pointerType==="pen",n=this.findMountedTarget(t.overTargets),s=this.createPointerEvent(e,"pointerout",n);this.dispatchEvent(s),i&&this.dispatchEvent(s,"mouseout");const r=this.createPointerEvent(e,"pointerleave",n);for(r.eventPhase=r.AT_TARGET;r.target&&r.target!==this.rootTarget.parent;)r.currentTarget=r.target,this.notifyTarget(r),i&&this.notifyTarget(r,"mouseleave"),r.target=r.target.parent;t.overTargets=null,this.freeEvent(s),this.freeEvent(r)}this.cursor=null}mapPointerUp(e){if(!(e instanceof f)){y("EventBoundary cannot map a non-pointer event as a pointer event");return}const t=performance.now(),i=this.createPointerEvent(e);if(this.dispatchEvent(i,"pointerup"),i.pointerType==="touch")this.dispatchEvent(i,"touchend");else if(i.pointerType==="mouse"||i.pointerType==="pen"){const a=i.button===2;this.dispatchEvent(i,a?"rightup":"mouseup")}const n=this.trackingData(e.pointerId),s=this.findMountedTarget(n.pressTargetsByButton[e.button]);let r=s;if(s&&!i.composedPath().includes(s)){let a=s;for(;a&&!i.composedPath().includes(a);){if(i.currentTarget=a,this.notifyTarget(i,"pointerupoutside"),i.pointerType==="touch")this.notifyTarget(i,"touchendoutside");else if(i.pointerType==="mouse"||i.pointerType==="pen"){const c=i.button===2;this.notifyTarget(i,c?"rightupoutside":"mouseupoutside")}a=a.parent}delete n.pressTargetsByButton[e.button],r=a}if(r){const a=this.clonePointerEvent(i,"click");a.target=r,a.path=null,n.clicksByButton[e.button]||(n.clicksByButton[e.button]={clickCount:0,target:a.target,timeStamp:t});const c=n.clicksByButton[e.button];if(c.target===a.target&&t-c.timeStamp<200?++c.clickCount:c.clickCount=1,c.target=a.target,c.timeStamp=t,a.detail=c.clickCount,a.pointerType==="mouse"){const p=a.button===2;this.dispatchEvent(a,p?"rightclick":"click")}else a.pointerType==="touch"&&this.dispatchEvent(a,"tap");this.dispatchEvent(a,"pointertap"),this.freeEvent(a)}this.freeEvent(i)}mapPointerUpOutside(e){if(!(e instanceof f)){y("EventBoundary cannot map a non-pointer event as a pointer event");return}const t=this.trackingData(e.pointerId),i=this.findMountedTarget(t.pressTargetsByButton[e.button]),n=this.createPointerEvent(e);if(i){let s=i;for(;s;)n.currentTarget=s,this.notifyTarget(n,"pointerupoutside"),n.pointerType==="touch"?this.notifyTarget(n,"touchendoutside"):(n.pointerType==="mouse"||n.pointerType==="pen")&&this.notifyTarget(n,n.button===2?"rightupoutside":"mouseupoutside"),s=s.parent;delete t.pressTargetsByButton[e.button]}this.freeEvent(n)}mapWheel(e){if(!(e instanceof T)){y("EventBoundary cannot map a non-wheel event as a wheel event");return}const t=this.createWheelEvent(e);this.dispatchEvent(t),this.freeEvent(t)}findMountedTarget(e){if(!e)return null;let t=e[0];for(let i=1;i<e.length&&e[i].parent===t;i++)t=e[i];return t}createPointerEvent(e,t,i){const n=this.allocateEvent(f);return this.copyPointerData(e,n),this.copyMouseData(e,n),this.copyData(e,n),n.nativeEvent=e.nativeEvent,n.originalEvent=e,n.target=i??this.hitTest(n.global.x,n.global.y)??this._hitElements[0],typeof t=="string"&&(n.type=t),n}createWheelEvent(e){const t=this.allocateEvent(T);return this.copyWheelData(e,t),this.copyMouseData(e,t),this.copyData(e,t),t.nativeEvent=e.nativeEvent,t.originalEvent=e,t.target=this.hitTest(t.global.x,t.global.y),t}clonePointerEvent(e,t){const i=this.allocateEvent(f);return i.nativeEvent=e.nativeEvent,i.originalEvent=e.originalEvent,this.copyPointerData(e,i),this.copyMouseData(e,i),this.copyData(e,i),i.target=e.target,i.path=e.composedPath().slice(),i.type=t??i.type,i}copyWheelData(e,t){t.deltaMode=e.deltaMode,t.deltaX=e.deltaX,t.deltaY=e.deltaY,t.deltaZ=e.deltaZ}copyPointerData(e,t){e instanceof f&&t instanceof f&&(t.pointerId=e.pointerId,t.width=e.width,t.height=e.height,t.isPrimary=e.isPrimary,t.pointerType=e.pointerType,t.pressure=e.pressure,t.tangentialPressure=e.tangentialPressure,t.tiltX=e.tiltX,t.tiltY=e.tiltY,t.twist=e.twist)}copyMouseData(e,t){e instanceof D&&t instanceof D&&(t.altKey=e.altKey,t.button=e.button,t.buttons=e.buttons,t.client.copyFrom(e.client),t.ctrlKey=e.ctrlKey,t.metaKey=e.metaKey,t.movement.copyFrom(e.movement),t.screen.copyFrom(e.screen),t.shiftKey=e.shiftKey,t.global.copyFrom(e.global))}copyData(e,t){t.isTrusted=e.isTrusted,t.srcElement=e.srcElement,t.timeStamp=performance.now(),t.type=e.type,t.detail=e.detail,t.view=e.view,t.which=e.which,t.layer.copyFrom(e.layer),t.page.copyFrom(e.page)}trackingData(e){return this.mappingState.trackingData[e]||(this.mappingState.trackingData[e]={pressTargetsByButton:{},clicksByButton:{},overTarget:null}),this.mappingState.trackingData[e]}allocateEvent(e){this.eventPool.has(e)||this.eventPool.set(e,[]);const t=this.eventPool.get(e).pop()||new e(this);return t.eventPhase=t.NONE,t.currentTarget=null,t.path=null,t.target=null,t}freeEvent(e){if(e.manager!==this)throw new Error("It is illegal to free an event not managed by this EventBoundary!");const t=e.constructor;this.eventPool.has(t)||this.eventPool.set(t,[]),this.eventPool.get(t).push(e)}_notifyListeners(e,t){const i=e.currentTarget._events[t];if(i&&e.currentTarget.isInteractive())if("fn"in i)i.once&&e.currentTarget.removeListener(t,i.fn,void 0,!0),i.fn.call(i.context,e);else for(let n=0,s=i.length;n<s&&!e.propagationImmediatelyStopped;n++)i[n].once&&e.currentTarget.removeListener(t,i[n].fn,void 0,!0),i[n].fn.call(i[n].context,e)}}const fe=1,ge={touchstart:"pointerdown",touchend:"pointerup",touchendoutside:"pointerupoutside",touchmove:"pointermove",touchcancel:"pointercancel"},B=class x{constructor(e){this.supportsTouchEvents="ontouchstart"in globalThis,this.supportsPointerEvents=!!globalThis.PointerEvent,this.domElement=null,this.resolution=1,this.renderer=e,this.rootBoundary=new ve(null),E.init(this),this.autoPreventDefault=!0,this._eventsAdded=!1,this._rootPointerEvent=new f(null),this._rootWheelEvent=new T(null),this.cursorStyles={default:"inherit",pointer:"pointer"},this.features=new Proxy({...x.defaultEventFeatures},{set:(t,i,n)=>(i==="globalMove"&&(this.rootBoundary.enableGlobalMoveEvents=n),t[i]=n,!0)}),this._onPointerDown=this._onPointerDown.bind(this),this._onPointerMove=this._onPointerMove.bind(this),this._onPointerUp=this._onPointerUp.bind(this),this._onPointerOverOut=this._onPointerOverOut.bind(this),this.onWheel=this.onWheel.bind(this)}static get defaultEventMode(){return this._defaultEventMode}init(e){const{canvas:t,resolution:i}=this.renderer;this.setTargetElement(t),this.resolution=i,x._defaultEventMode=e.eventMode??"passive",Object.assign(this.features,e.eventFeatures??{}),this.rootBoundary.enableGlobalMoveEvents=this.features.globalMove}resolutionChange(e){this.resolution=e}destroy(){this.setTargetElement(null),this.renderer=null,this._currentCursor=null}setCursor(e){e=e||"default";let t=!0;if(globalThis.OffscreenCanvas&&this.domElement instanceof OffscreenCanvas&&(t=!1),this._currentCursor===e)return;this._currentCursor=e;const i=this.cursorStyles[e];if(i)switch(typeof i){case"string":t&&(this.domElement.style.cursor=i);break;case"function":i(e);break;case"object":t&&Object.assign(this.domElement.style,i);break}else t&&typeof e=="string"&&!Object.prototype.hasOwnProperty.call(this.cursorStyles,e)&&(this.domElement.style.cursor=e)}get pointer(){return this._rootPointerEvent}_onPointerDown(e){if(!this.features.click)return;this.rootBoundary.rootTarget=this.renderer.lastObjectRendered;const t=this._normalizeToPointerData(e);this.autoPreventDefault&&t[0].isNormalized&&(e.cancelable||!("cancelable"in e))&&e.preventDefault();for(let i=0,n=t.length;i<n;i++){const s=t[i],r=this._bootstrapEvent(this._rootPointerEvent,s);this.rootBoundary.mapEvent(r)}this.setCursor(this.rootBoundary.cursor)}_onPointerMove(e){if(!this.features.move)return;this.rootBoundary.rootTarget=this.renderer.lastObjectRendered,E.pointerMoved();const t=this._normalizeToPointerData(e);for(let i=0,n=t.length;i<n;i++){const s=this._bootstrapEvent(this._rootPointerEvent,t[i]);this.rootBoundary.mapEvent(s)}this.setCursor(this.rootBoundary.cursor)}_onPointerUp(e){if(!this.features.click)return;this.rootBoundary.rootTarget=this.renderer.lastObjectRendered;let t=e.target;e.composedPath&&e.composedPath().length>0&&(t=e.composedPath()[0]);const i=t!==this.domElement?"outside":"",n=this._normalizeToPointerData(e);for(let s=0,r=n.length;s<r;s++){const a=this._bootstrapEvent(this._rootPointerEvent,n[s]);a.type+=i,this.rootBoundary.mapEvent(a)}this.setCursor(this.rootBoundary.cursor)}_onPointerOverOut(e){if(!this.features.click)return;this.rootBoundary.rootTarget=this.renderer.lastObjectRendered;const t=this._normalizeToPointerData(e);for(let i=0,n=t.length;i<n;i++){const s=this._bootstrapEvent(this._rootPointerEvent,t[i]);this.rootBoundary.mapEvent(s)}this.setCursor(this.rootBoundary.cursor)}onWheel(e){if(!this.features.wheel)return;const t=this.normalizeWheelEvent(e);this.rootBoundary.rootTarget=this.renderer.lastObjectRendered,this.rootBoundary.mapEvent(t)}setTargetElement(e){this._removeEvents(),this.domElement=e,E.domElement=e,this._addEvents()}_addEvents(){if(this._eventsAdded||!this.domElement)return;E.addTickerListener();const e=this.domElement.style;e&&(globalThis.navigator.msPointerEnabled?(e.msContentZooming="none",e.msTouchAction="none"):this.supportsPointerEvents&&(e.touchAction="none")),this.supportsPointerEvents?(globalThis.document.addEventListener("pointermove",this._onPointerMove,!0),this.domElement.addEventListener("pointerdown",this._onPointerDown,!0),this.domElement.addEventListener("pointerleave",this._onPointerOverOut,!0),this.domElement.addEventListener("pointerover",this._onPointerOverOut,!0),globalThis.addEventListener("pointerup",this._onPointerUp,!0)):(globalThis.document.addEventListener("mousemove",this._onPointerMove,!0),this.domElement.addEventListener("mousedown",this._onPointerDown,!0),this.domElement.addEventListener("mouseout",this._onPointerOverOut,!0),this.domElement.addEventListener("mouseover",this._onPointerOverOut,!0),globalThis.addEventListener("mouseup",this._onPointerUp,!0),this.supportsTouchEvents&&(this.domElement.addEventListener("touchstart",this._onPointerDown,!0),this.domElement.addEventListener("touchend",this._onPointerUp,!0),this.domElement.addEventListener("touchmove",this._onPointerMove,!0))),this.domElement.addEventListener("wheel",this.onWheel,{passive:!0,capture:!0}),this._eventsAdded=!0}_removeEvents(){if(!this._eventsAdded||!this.domElement)return;E.removeTickerListener();const e=this.domElement.style;e&&(globalThis.navigator.msPointerEnabled?(e.msContentZooming="",e.msTouchAction=""):this.supportsPointerEvents&&(e.touchAction="")),this.supportsPointerEvents?(globalThis.document.removeEventListener("pointermove",this._onPointerMove,!0),this.domElement.removeEventListener("pointerdown",this._onPointerDown,!0),this.domElement.removeEventListener("pointerleave",this._onPointerOverOut,!0),this.domElement.removeEventListener("pointerover",this._onPointerOverOut,!0),globalThis.removeEventListener("pointerup",this._onPointerUp,!0)):(globalThis.document.removeEventListener("mousemove",this._onPointerMove,!0),this.domElement.removeEventListener("mousedown",this._onPointerDown,!0),this.domElement.removeEventListener("mouseout",this._onPointerOverOut,!0),this.domElement.removeEventListener("mouseover",this._onPointerOverOut,!0),globalThis.removeEventListener("mouseup",this._onPointerUp,!0),this.supportsTouchEvents&&(this.domElement.removeEventListener("touchstart",this._onPointerDown,!0),this.domElement.removeEventListener("touchend",this._onPointerUp,!0),this.domElement.removeEventListener("touchmove",this._onPointerMove,!0))),this.domElement.removeEventListener("wheel",this.onWheel,!0),this.domElement=null,this._eventsAdded=!1}mapPositionToPoint(e,t,i){const n=this.domElement.isConnected?this.domElement.getBoundingClientRect():{x:0,y:0,width:this.domElement.width,height:this.domElement.height,left:0,top:0},s=1/this.resolution;e.x=(t-n.left)*(this.domElement.width/n.width)*s,e.y=(i-n.top)*(this.domElement.height/n.height)*s}_normalizeToPointerData(e){const t=[];if(this.supportsTouchEvents&&e instanceof TouchEvent)for(let i=0,n=e.changedTouches.length;i<n;i++){const s=e.changedTouches[i];typeof s.button>"u"&&(s.button=0),typeof s.buttons>"u"&&(s.buttons=1),typeof s.isPrimary>"u"&&(s.isPrimary=e.touches.length===1&&e.type==="touchstart"),typeof s.width>"u"&&(s.width=s.radiusX||1),typeof s.height>"u"&&(s.height=s.radiusY||1),typeof s.tiltX>"u"&&(s.tiltX=0),typeof s.tiltY>"u"&&(s.tiltY=0),typeof s.pointerType>"u"&&(s.pointerType="touch"),typeof s.pointerId>"u"&&(s.pointerId=s.identifier||0),typeof s.pressure>"u"&&(s.pressure=s.force||.5),typeof s.twist>"u"&&(s.twist=0),typeof s.tangentialPressure>"u"&&(s.tangentialPressure=0),typeof s.layerX>"u"&&(s.layerX=s.offsetX=s.clientX),typeof s.layerY>"u"&&(s.layerY=s.offsetY=s.clientY),s.isNormalized=!0,s.type=e.type,t.push(s)}else if(!globalThis.MouseEvent||e instanceof MouseEvent&&(!this.supportsPointerEvents||!(e instanceof globalThis.PointerEvent))){const i=e;typeof i.isPrimary>"u"&&(i.isPrimary=!0),typeof i.width>"u"&&(i.width=1),typeof i.height>"u"&&(i.height=1),typeof i.tiltX>"u"&&(i.tiltX=0),typeof i.tiltY>"u"&&(i.tiltY=0),typeof i.pointerType>"u"&&(i.pointerType="mouse"),typeof i.pointerId>"u"&&(i.pointerId=fe),typeof i.pressure>"u"&&(i.pressure=.5),typeof i.twist>"u"&&(i.twist=0),typeof i.tangentialPressure>"u"&&(i.tangentialPressure=0),i.isNormalized=!0,t.push(i)}else t.push(e);return t}normalizeWheelEvent(e){const t=this._rootWheelEvent;return this._transferMouseData(t,e),t.deltaX=e.deltaX,t.deltaY=e.deltaY,t.deltaZ=e.deltaZ,t.deltaMode=e.deltaMode,this.mapPositionToPoint(t.screen,e.clientX,e.clientY),t.global.copyFrom(t.screen),t.offset.copyFrom(t.screen),t.nativeEvent=e,t.type=e.type,t}_bootstrapEvent(e,t){return e.originalEvent=null,e.nativeEvent=t,e.pointerId=t.pointerId,e.width=t.width,e.height=t.height,e.isPrimary=t.isPrimary,e.pointerType=t.pointerType,e.pressure=t.pressure,e.tangentialPressure=t.tangentialPressure,e.tiltX=t.tiltX,e.tiltY=t.tiltY,e.twist=t.twist,this._transferMouseData(e,t),this.mapPositionToPoint(e.screen,t.clientX,t.clientY),e.global.copyFrom(e.screen),e.offset.copyFrom(e.screen),e.isTrusted=t.isTrusted,e.type==="pointerleave"&&(e.type="pointerout"),e.type.startsWith("mouse")&&(e.type=e.type.replace("mouse","pointer")),e.type.startsWith("touch")&&(e.type=ge[e.type]||e.type),e}_transferMouseData(e,t){e.isTrusted=t.isTrusted,e.srcElement=t.srcElement,e.timeStamp=performance.now(),e.type=t.type,e.altKey=t.altKey,e.button=t.button,e.buttons=t.buttons,e.client.x=t.clientX,e.client.y=t.clientY,e.ctrlKey=t.ctrlKey,e.metaKey=t.metaKey,e.movement.x=t.movementX,e.movement.y=t.movementY,e.page.x=t.pageX,e.page.y=t.pageY,e.relatedTarget=null,e.shiftKey=t.shiftKey}};B.extension={name:"events",type:[w.WebGLSystem,w.CanvasSystem,w.WebGPUSystem],priority:-1};B.defaultEventFeatures={move:!0,globalMove:!0,click:!0,wheel:!0};let q=B;const me={onclick:null,onmousedown:null,onmouseenter:null,onmouseleave:null,onmousemove:null,onglobalmousemove:null,onmouseout:null,onmouseover:null,onmouseup:null,onmouseupoutside:null,onpointercancel:null,onpointerdown:null,onpointerenter:null,onpointerleave:null,onpointermove:null,onglobalpointermove:null,onpointerout:null,onpointerover:null,onpointertap:null,onpointerup:null,onpointerupoutside:null,onrightclick:null,onrightdown:null,onrightup:null,onrightupoutside:null,ontap:null,ontouchcancel:null,ontouchend:null,ontouchendoutside:null,ontouchmove:null,onglobaltouchmove:null,ontouchstart:null,onwheel:null,get interactive(){return this.eventMode==="dynamic"||this.eventMode==="static"},set interactive(o){this.eventMode=o?"static":"passive"},_internalEventMode:void 0,get eventMode(){return this._internalEventMode??q.defaultEventMode},set eventMode(o){this._internalEventMode=o},isInteractive(){return this.eventMode==="static"||this.eventMode==="dynamic"},interactiveChildren:!0,hitArea:null,addEventListener(o,e,t){const i=typeof t=="boolean"&&t||typeof t=="object"&&t.capture,n=typeof t=="object"?t.signal:void 0,s=typeof t=="object"?t.once===!0:!1,r=typeof e=="function"?void 0:e;o=i?`${o}capture`:o;const a=typeof e=="function"?e:e.handleEvent,c=this;n&&n.addEventListener("abort",()=>{c.off(o,a,r)}),s?c.once(o,a,r):c.on(o,a,r)},removeEventListener(o,e,t){const i=typeof t=="boolean"&&t||typeof t=="object"&&t.capture,n=typeof e=="function"?void 0:e;o=i?`${o}capture`:o,e=typeof e=="function"?e:e.handleEvent,this.off(o,e,n)},dispatchEvent(o){if(!(o instanceof M))throw new Error("Container cannot propagate events outside of the Federated Events API");return o.defaultPrevented=!1,o.path=null,o.target=this,o.manager.dispatchEvent(o),!o.defaultPrevented}};z.add(V);Z.mixin(ue);z.add(q);Z.mixin(me)});

View File

@@ -0,0 +1 @@
import{P as m,r as J,E as w,T as L,U as Q,a as ee,w as y,e as z,C as Z,__tla as __tla_0}from"./TorrentDetail-CKmHZcwa.js";import{__tla as __tla_1}from"./webworkerAll-L7cTVnAp.js";import{__tla as __tla_2}from"./ColoredChip.vue_vue_type_script_setup_true_lang-CBDbhtDT.js";import{__tla as __tla_3}from"./index-C0tfT_Qc.js";import"./vue-CfSjRv-x.js";import"./vuetify-PctCzU6r.js";import{__tla as __tla_4}from"./MixedButton.vue_vue_type_script_setup_true_lang-Br4NUWtV.js";import"./FileIcon-DH65fwz5.js";import{__tla as __tla_5}from"./MoveTorrentFileDialog.vue_vue_type_script_setup_true_lang-C8uA-x2z.js";import{__tla as __tla_6}from"./colorToUniform-rMRo2qOn.js";import{__tla as __tla_7}from"./CanvasPool-D00IADyo.js";import{__tla as __tla_8}from"./getBatchSamplersUniformGroup-B1Z3BKU1.js";Promise.all([(()=>{try{return __tla_0}catch{}})(),(()=>{try{return __tla_1}catch{}})(),(()=>{try{return __tla_2}catch{}})(),(()=>{try{return __tla_3}catch{}})(),(()=>{try{return __tla_4}catch{}})(),(()=>{try{return __tla_5}catch{}})(),(()=>{try{return __tla_6}catch{}})(),(()=>{try{return __tla_7}catch{}})(),(()=>{try{return __tla_8}catch{}})()]).then(async()=>{class M{constructor(e){this.bubbles=!0,this.cancelBubble=!0,this.cancelable=!1,this.composed=!1,this.defaultPrevented=!1,this.eventPhase=M.prototype.NONE,this.propagationStopped=!1,this.propagationImmediatelyStopped=!1,this.layer=new m,this.page=new m,this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,this.manager=e}get layerX(){return this.layer.x}get layerY(){return this.layer.y}get pageX(){return this.page.x}get pageY(){return this.page.y}get data(){return this}composedPath(){return this.manager&&(!this.path||this.path[this.path.length-1]!==this.target)&&(this.path=this.target?this.manager.propagationPath(this.target):[]),this.path}initEvent(e,t,i){throw new Error("initEvent() is a legacy DOM API. It is not implemented in the Federated Events API.")}initUIEvent(e,t,i,n,s){throw new Error("initUIEvent() is a legacy DOM API. It is not implemented in the Federated Events API.")}preventDefault(){this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault(),this.defaultPrevented=!0}stopImmediatePropagation(){this.propagationImmediatelyStopped=!0}stopPropagation(){this.propagationStopped=!0}}var O=/iPhone/i,C=/iPod/i,S=/iPad/i,U=/\biOS-universal(?:.+)Mac\b/i,k=/\bAndroid(?:.+)Mobile\b/i,H=/Android/i,b=/(?:SD4930UR|\bSilk(?:.+)Mobile\b)/i,A=/Silk/i,g=/Windows Phone/i,X=/\bWindows(?:.+)ARM\b/i,R=/BlackBerry/i,F=/BB10/i,Y=/Opera Mini/i,K=/\b(CriOS|Chrome)(?:.+)Mobile/i,$=/Mobile(?:.+)Firefox\b/i,G=function(o){return typeof o<"u"&&o.platform==="MacIntel"&&typeof o.maxTouchPoints=="number"&&o.maxTouchPoints>1&&typeof MSStream>"u"};function te(o){return function(e){return e.test(o)}}function W(o){var e={userAgent:"",platform:"",maxTouchPoints:0};!o&&typeof navigator<"u"?e={userAgent:navigator.userAgent,platform:navigator.platform,maxTouchPoints:navigator.maxTouchPoints||0}:typeof o=="string"?e.userAgent=o:o&&o.userAgent&&(e={userAgent:o.userAgent,platform:o.platform,maxTouchPoints:o.maxTouchPoints||0});var t=e.userAgent,i=t.split("[FBAN");typeof i[1]<"u"&&(t=i[0]),i=t.split("Twitter"),typeof i[1]<"u"&&(t=i[0]);var n=te(t),s={apple:{phone:n(O)&&!n(g),ipod:n(C),tablet:!n(O)&&(n(S)||G(e))&&!n(g),universal:n(U),device:(n(O)||n(C)||n(S)||n(U)||G(e))&&!n(g)},amazon:{phone:n(b),tablet:!n(b)&&n(A),device:n(b)||n(A)},android:{phone:!n(g)&&n(b)||!n(g)&&n(k),tablet:!n(g)&&!n(b)&&!n(k)&&(n(A)||n(H)),device:!n(g)&&(n(b)||n(A)||n(k)||n(H))||n(/\bokhttp\b/i)},windows:{phone:n(g),tablet:n(X),device:n(g)||n(X)},other:{blackberry:n(R),blackberry10:n(F),opera:n(Y),firefox:n($),chrome:n(K),device:n(R)||n(F)||n(Y)||n($)||n(K)},any:!1,phone:!1,tablet:!1};return s.any=s.apple.device||s.android.device||s.windows.device||s.other.device,s.phone=s.apple.phone||s.android.phone||s.windows.phone,s.tablet=s.apple.tablet||s.android.tablet||s.windows.tablet,s}const ie=W.default??W,ne=ie(globalThis.navigator),se=9,I=100,oe=0,re=0,j=2,N=1,ae=-1e3,he=-1e3,le=2;class V{constructor(e,t=ne){this._mobileInfo=t,this.debug=!1,this._isActive=!1,this._isMobileAccessibility=!1,this._pool=[],this._renderId=0,this._children=[],this._androidUpdateCount=0,this._androidUpdateFrequency=500,this._hookDiv=null,(t.tablet||t.phone)&&this._createTouchHook();const i=document.createElement("div");i.style.width=`${I}px`,i.style.height=`${I}px`,i.style.position="absolute",i.style.top=`${oe}px`,i.style.left=`${re}px`,i.style.zIndex=j.toString(),this._div=i,this._renderer=e,this._onKeyDown=this._onKeyDown.bind(this),this._onMouseMove=this._onMouseMove.bind(this),globalThis.addEventListener("keydown",this._onKeyDown,!1)}get isActive(){return this._isActive}get isMobileAccessibility(){return this._isMobileAccessibility}get hookDiv(){return this._hookDiv}_createTouchHook(){const e=document.createElement("button");e.style.width=`${N}px`,e.style.height=`${N}px`,e.style.position="absolute",e.style.top=`${ae}px`,e.style.left=`${he}px`,e.style.zIndex=le.toString(),e.style.backgroundColor="#FF0000",e.title="select to enable accessibility for this content",e.addEventListener("focus",()=>{this._isMobileAccessibility=!0,this._activate(),this._destroyTouchHook()}),document.body.appendChild(e),this._hookDiv=e}_destroyTouchHook(){this._hookDiv&&(document.body.removeChild(this._hookDiv),this._hookDiv=null)}_activate(){this._isActive||(this._isActive=!0,globalThis.document.addEventListener("mousemove",this._onMouseMove,!0),globalThis.removeEventListener("keydown",this._onKeyDown,!1),this._renderer.runners.postrender.add(this),this._renderer.view.canvas.parentNode?.appendChild(this._div))}_deactivate(){!this._isActive||this._isMobileAccessibility||(this._isActive=!1,globalThis.document.removeEventListener("mousemove",this._onMouseMove,!0),globalThis.addEventListener("keydown",this._onKeyDown,!1),this._renderer.runners.postrender.remove(this),this._div.parentNode?.removeChild(this._div))}_updateAccessibleObjects(e){if(!e.visible||!e.accessibleChildren)return;e.accessible&&e.isInteractive()&&(e._accessibleActive||this._addChild(e),e._renderId=this._renderId);const t=e.children;if(t)for(let i=0;i<t.length;i++)this._updateAccessibleObjects(t[i])}init(e){this.debug=e?.debug??this.debug,this._renderer.runners.postrender.remove(this)}postrender(){const e=performance.now();if(this._mobileInfo.android.device&&e<this._androidUpdateCount||(this._androidUpdateCount=e+this._androidUpdateFrequency,!this._renderer.renderingToScreen||!this._renderer.view.canvas))return;this._renderer.lastObjectRendered&&this._updateAccessibleObjects(this._renderer.lastObjectRendered);const{x:t,y:i,width:n,height:s}=this._renderer.view.canvas.getBoundingClientRect(),{width:r,height:a,resolution:c}=this._renderer,p=n/r*c,h=s/a*c;let l=this._div;l.style.left=`${t}px`,l.style.top=`${i}px`,l.style.width=`${r}px`,l.style.height=`${a}px`;for(let d=0;d<this._children.length;d++){const u=this._children[d];if(u._renderId!==this._renderId)u._accessibleActive=!1,J(this._children,d,1),this._div.removeChild(u._accessibleDiv),this._pool.push(u._accessibleDiv),u._accessibleDiv=null,d--;else{l=u._accessibleDiv;let v=u.hitArea;const _=u.worldTransform;u.hitArea?(l.style.left=`${(_.tx+v.x*_.a)*p}px`,l.style.top=`${(_.ty+v.y*_.d)*h}px`,l.style.width=`${v.width*_.a*p}px`,l.style.height=`${v.height*_.d*h}px`):(v=u.getBounds().rectangle,this._capHitArea(v),l.style.left=`${v.x*p}px`,l.style.top=`${v.y*h}px`,l.style.width=`${v.width*p}px`,l.style.height=`${v.height*h}px`,l.title!==u.accessibleTitle&&u.accessibleTitle!==null&&(l.title=u.accessibleTitle||""),l.getAttribute("aria-label")!==u.accessibleHint&&u.accessibleHint!==null&&l.setAttribute("aria-label",u.accessibleHint||"")),(u.accessibleTitle!==l.title||u.tabIndex!==l.tabIndex)&&(l.title=u.accessibleTitle||"",l.tabIndex=u.tabIndex,this.debug&&this._updateDebugHTML(l))}}this._renderId++}_updateDebugHTML(e){e.innerHTML=`type: ${e.type}</br> title : ${e.title}</br> tabIndex: ${e.tabIndex}`}_capHitArea(e){e.x<0&&(e.width+=e.x,e.x=0),e.y<0&&(e.height+=e.y,e.y=0);const{width:t,height:i}=this._renderer;e.x+e.width>t&&(e.width=t-e.x),e.y+e.height>i&&(e.height=i-e.y)}_addChild(e){let t=this._pool.pop();t||(t=document.createElement("button"),t.style.width=`${I}px`,t.style.height=`${I}px`,t.style.backgroundColor=this.debug?"rgba(255,255,255,0.5)":"transparent",t.style.position="absolute",t.style.zIndex=j.toString(),t.style.borderStyle="none",navigator.userAgent.toLowerCase().includes("chrome")?t.setAttribute("aria-live","off"):t.setAttribute("aria-live","polite"),navigator.userAgent.match(/rv:.*Gecko\//)?t.setAttribute("aria-relevant","additions"):t.setAttribute("aria-relevant","text"),t.addEventListener("click",this._onClick.bind(this)),t.addEventListener("focus",this._onFocus.bind(this)),t.addEventListener("focusout",this._onFocusOut.bind(this))),t.style.pointerEvents=e.accessiblePointerEvents,t.type=e.accessibleType,e.accessibleTitle&&e.accessibleTitle!==null?t.title=e.accessibleTitle:(!e.accessibleHint||e.accessibleHint===null)&&(t.title=`container ${e.tabIndex}`),e.accessibleHint&&e.accessibleHint!==null&&t.setAttribute("aria-label",e.accessibleHint),this.debug&&this._updateDebugHTML(t),e._accessibleActive=!0,e._accessibleDiv=t,t.container=e,this._children.push(e),this._div.appendChild(e._accessibleDiv),e._accessibleDiv.tabIndex=e.tabIndex}_dispatchEvent(e,t){const{container:i}=e.target,n=this._renderer.events.rootBoundary,s=Object.assign(new M(n),{target:i});n.rootTarget=this._renderer.lastObjectRendered,t.forEach(r=>n.dispatchEvent(s,r))}_onClick(e){this._dispatchEvent(e,["click","pointertap","tap"])}_onFocus(e){e.target.getAttribute("aria-live")||e.target.setAttribute("aria-live","assertive"),this._dispatchEvent(e,["mouseover"])}_onFocusOut(e){e.target.getAttribute("aria-live")||e.target.setAttribute("aria-live","polite"),this._dispatchEvent(e,["mouseout"])}_onKeyDown(e){e.keyCode===se&&this._activate()}_onMouseMove(e){e.movementX===0&&e.movementY===0||this._deactivate()}destroy(){this._destroyTouchHook(),this._div=null,globalThis.document.removeEventListener("mousemove",this._onMouseMove,!0),globalThis.removeEventListener("keydown",this._onKeyDown),this._pool=null,this._children=null,this._renderer=null}}V.extension={type:[w.WebGLSystem,w.WebGPUSystem],name:"accessibility"};const ue={accessible:!1,accessibleTitle:null,accessibleHint:null,tabIndex:0,_accessibleActive:!1,_accessibleDiv:null,accessibleType:"button",accessiblePointerEvents:"auto",accessibleChildren:!0,_renderId:-1};class de{constructor(){this.interactionFrequency=10,this._deltaTime=0,this._didMove=!1,this._tickerAdded=!1,this._pauseUpdate=!0}init(e){this.removeTickerListener(),this.events=e,this.interactionFrequency=10,this._deltaTime=0,this._didMove=!1,this._tickerAdded=!1,this._pauseUpdate=!0}get pauseUpdate(){return this._pauseUpdate}set pauseUpdate(e){this._pauseUpdate=e}addTickerListener(){this._tickerAdded||!this.domElement||(L.system.add(this._tickerUpdate,this,Q.INTERACTION),this._tickerAdded=!0)}removeTickerListener(){this._tickerAdded&&(L.system.remove(this._tickerUpdate,this),this._tickerAdded=!1)}pointerMoved(){this._didMove=!0}_update(){if(!this.domElement||this._pauseUpdate)return;if(this._didMove){this._didMove=!1;return}const e=this.events._rootPointerEvent;this.events.supportsTouchEvents&&e.pointerType==="touch"||globalThis.document.dispatchEvent(new PointerEvent("pointermove",{clientX:e.clientX,clientY:e.clientY}))}_tickerUpdate(e){this._deltaTime+=e.deltaTime,!(this._deltaTime<this.interactionFrequency)&&(this._deltaTime=0,this._update())}}const E=new de;class D extends M{constructor(){super(...arguments),this.client=new m,this.movement=new m,this.offset=new m,this.global=new m,this.screen=new m}get clientX(){return this.client.x}get clientY(){return this.client.y}get x(){return this.clientX}get y(){return this.clientY}get movementX(){return this.movement.x}get movementY(){return this.movement.y}get offsetX(){return this.offset.x}get offsetY(){return this.offset.y}get globalX(){return this.global.x}get globalY(){return this.global.y}get screenX(){return this.screen.x}get screenY(){return this.screen.y}getLocalPosition(e,t,i){return e.worldTransform.applyInverse(i||this.global,t)}getModifierState(e){return"getModifierState"in this.nativeEvent&&this.nativeEvent.getModifierState(e)}initMouseEvent(e,t,i,n,s,r,a,c,p,h,l,d,u,v,_){throw new Error("Method not implemented.")}}class f extends D{constructor(){super(...arguments),this.width=0,this.height=0,this.isPrimary=!1}getCoalescedEvents(){return this.type==="pointermove"||this.type==="mousemove"||this.type==="touchmove"?[this]:[]}getPredictedEvents(){throw new Error("getPredictedEvents is not supported!")}}class T extends D{constructor(){super(...arguments),this.DOM_DELTA_PIXEL=0,this.DOM_DELTA_LINE=1,this.DOM_DELTA_PAGE=2}}T.DOM_DELTA_PIXEL=0;T.DOM_DELTA_LINE=1;T.DOM_DELTA_PAGE=2;const ce=2048,pe=new m,P=new m;class ve{constructor(e){this.dispatch=new ee,this.moveOnAll=!1,this.enableGlobalMoveEvents=!0,this.mappingState={trackingData:{}},this.eventPool=new Map,this._allInteractiveElements=[],this._hitElements=[],this._isPointerMoveEvent=!1,this.rootTarget=e,this.hitPruneFn=this.hitPruneFn.bind(this),this.hitTestFn=this.hitTestFn.bind(this),this.mapPointerDown=this.mapPointerDown.bind(this),this.mapPointerMove=this.mapPointerMove.bind(this),this.mapPointerOut=this.mapPointerOut.bind(this),this.mapPointerOver=this.mapPointerOver.bind(this),this.mapPointerUp=this.mapPointerUp.bind(this),this.mapPointerUpOutside=this.mapPointerUpOutside.bind(this),this.mapWheel=this.mapWheel.bind(this),this.mappingTable={},this.addEventMapping("pointerdown",this.mapPointerDown),this.addEventMapping("pointermove",this.mapPointerMove),this.addEventMapping("pointerout",this.mapPointerOut),this.addEventMapping("pointerleave",this.mapPointerOut),this.addEventMapping("pointerover",this.mapPointerOver),this.addEventMapping("pointerup",this.mapPointerUp),this.addEventMapping("pointerupoutside",this.mapPointerUpOutside),this.addEventMapping("wheel",this.mapWheel)}addEventMapping(e,t){this.mappingTable[e]||(this.mappingTable[e]=[]),this.mappingTable[e].push({fn:t,priority:0}),this.mappingTable[e].sort((i,n)=>i.priority-n.priority)}dispatchEvent(e,t){e.propagationStopped=!1,e.propagationImmediatelyStopped=!1,this.propagate(e,t),this.dispatch.emit(t||e.type,e)}mapEvent(e){if(!this.rootTarget)return;const t=this.mappingTable[e.type];if(t)for(let i=0,n=t.length;i<n;i++)t[i].fn(e);else y(`[EventBoundary]: Event mapping not defined for ${e.type}`)}hitTest(e,t){E.pauseUpdate=!0;const n=this._isPointerMoveEvent&&this.enableGlobalMoveEvents?"hitTestMoveRecursive":"hitTestRecursive",s=this[n](this.rootTarget,this.rootTarget.eventMode,pe.set(e,t),this.hitTestFn,this.hitPruneFn);return s&&s[0]}propagate(e,t){if(!e.target)return;const i=e.composedPath();e.eventPhase=e.CAPTURING_PHASE;for(let n=0,s=i.length-1;n<s;n++)if(e.currentTarget=i[n],this.notifyTarget(e,t),e.propagationStopped||e.propagationImmediatelyStopped)return;if(e.eventPhase=e.AT_TARGET,e.currentTarget=e.target,this.notifyTarget(e,t),!(e.propagationStopped||e.propagationImmediatelyStopped)){e.eventPhase=e.BUBBLING_PHASE;for(let n=i.length-2;n>=0;n--)if(e.currentTarget=i[n],this.notifyTarget(e,t),e.propagationStopped||e.propagationImmediatelyStopped)return}}all(e,t,i=this._allInteractiveElements){if(i.length===0)return;e.eventPhase=e.BUBBLING_PHASE;const n=Array.isArray(t)?t:[t];for(let s=i.length-1;s>=0;s--)n.forEach(r=>{e.currentTarget=i[s],this.notifyTarget(e,r)})}propagationPath(e){const t=[e];for(let i=0;i<ce&&e!==this.rootTarget&&e.parent;i++){if(!e.parent)throw new Error("Cannot find propagation path to disconnected target");t.push(e.parent),e=e.parent}return t.reverse(),t}hitTestMoveRecursive(e,t,i,n,s,r=!1){let a=!1;if(this._interactivePrune(e))return null;if((e.eventMode==="dynamic"||t==="dynamic")&&(E.pauseUpdate=!1),e.interactiveChildren&&e.children){const h=e.children;for(let l=h.length-1;l>=0;l--){const d=h[l],u=this.hitTestMoveRecursive(d,this._isInteractive(t)?t:d.eventMode,i,n,s,r||s(e,i));if(u){if(u.length>0&&!u[u.length-1].parent)continue;const v=e.isInteractive();(u.length>0||v)&&(v&&this._allInteractiveElements.push(e),u.push(e)),this._hitElements.length===0&&(this._hitElements=u),a=!0}}}const c=this._isInteractive(t),p=e.isInteractive();return p&&p&&this._allInteractiveElements.push(e),r||this._hitElements.length>0?null:a?this._hitElements:c&&!s(e,i)&&n(e,i)?p?[e]:[]:null}hitTestRecursive(e,t,i,n,s){if(this._interactivePrune(e)||s(e,i))return null;if((e.eventMode==="dynamic"||t==="dynamic")&&(E.pauseUpdate=!1),e.interactiveChildren&&e.children){const c=e.children,p=i;for(let h=c.length-1;h>=0;h--){const l=c[h],d=this.hitTestRecursive(l,this._isInteractive(t)?t:l.eventMode,p,n,s);if(d){if(d.length>0&&!d[d.length-1].parent)continue;const u=e.isInteractive();return(d.length>0||u)&&d.push(e),d}}}const r=this._isInteractive(t),a=e.isInteractive();return r&&n(e,i)?a?[e]:[]:null}_isInteractive(e){return e==="static"||e==="dynamic"}_interactivePrune(e){return!e||!e.visible||!e.renderable||!e.includeInBuild||!e.measurable||e.eventMode==="none"||e.eventMode==="passive"&&!e.interactiveChildren}hitPruneFn(e,t){if(e.hitArea&&(e.worldTransform.applyInverse(t,P),!e.hitArea.contains(P.x,P.y)))return!0;if(e.effects&&e.effects.length)for(let i=0;i<e.effects.length;i++){const n=e.effects[i];if(n.containsPoint&&!n.containsPoint(t,this.hitTestFn))return!0}return!1}hitTestFn(e,t){return e.hitArea?!0:e?.containsPoint?(e.worldTransform.applyInverse(t,P),e.containsPoint(P)):!1}notifyTarget(e,t){t=t??e.type;const i=`on${t}`;e.currentTarget[i]?.(e);const n=e.eventPhase===e.CAPTURING_PHASE||e.eventPhase===e.AT_TARGET?`${t}capture`:t;this._notifyListeners(e,n),e.eventPhase===e.AT_TARGET&&this._notifyListeners(e,t)}mapPointerDown(e){if(!(e instanceof f)){y("EventBoundary cannot map a non-pointer event as a pointer event");return}const t=this.createPointerEvent(e);if(this.dispatchEvent(t,"pointerdown"),t.pointerType==="touch")this.dispatchEvent(t,"touchstart");else if(t.pointerType==="mouse"||t.pointerType==="pen"){const n=t.button===2;this.dispatchEvent(t,n?"rightdown":"mousedown")}const i=this.trackingData(e.pointerId);i.pressTargetsByButton[e.button]=t.composedPath(),this.freeEvent(t)}mapPointerMove(e){if(!(e instanceof f)){y("EventBoundary cannot map a non-pointer event as a pointer event");return}this._allInteractiveElements.length=0,this._hitElements.length=0,this._isPointerMoveEvent=!0;const t=this.createPointerEvent(e);this._isPointerMoveEvent=!1;const i=t.pointerType==="mouse"||t.pointerType==="pen",n=this.trackingData(e.pointerId),s=this.findMountedTarget(n.overTargets);if(n.overTargets?.length>0&&s!==t.target){const c=e.type==="mousemove"?"mouseout":"pointerout",p=this.createPointerEvent(e,c,s);if(this.dispatchEvent(p,"pointerout"),i&&this.dispatchEvent(p,"mouseout"),!t.composedPath().includes(s)){const h=this.createPointerEvent(e,"pointerleave",s);for(h.eventPhase=h.AT_TARGET;h.target&&!t.composedPath().includes(h.target);)h.currentTarget=h.target,this.notifyTarget(h),i&&this.notifyTarget(h,"mouseleave"),h.target=h.target.parent;this.freeEvent(h)}this.freeEvent(p)}if(s!==t.target){const c=e.type==="mousemove"?"mouseover":"pointerover",p=this.clonePointerEvent(t,c);this.dispatchEvent(p,"pointerover"),i&&this.dispatchEvent(p,"mouseover");let h=s?.parent;for(;h&&h!==this.rootTarget.parent&&h!==t.target;)h=h.parent;if(!h||h===this.rootTarget.parent){const d=this.clonePointerEvent(t,"pointerenter");for(d.eventPhase=d.AT_TARGET;d.target&&d.target!==s&&d.target!==this.rootTarget.parent;)d.currentTarget=d.target,this.notifyTarget(d),i&&this.notifyTarget(d,"mouseenter"),d.target=d.target.parent;this.freeEvent(d)}this.freeEvent(p)}const r=[],a=this.enableGlobalMoveEvents??!0;this.moveOnAll?r.push("pointermove"):this.dispatchEvent(t,"pointermove"),a&&r.push("globalpointermove"),t.pointerType==="touch"&&(this.moveOnAll?r.splice(1,0,"touchmove"):this.dispatchEvent(t,"touchmove"),a&&r.push("globaltouchmove")),i&&(this.moveOnAll?r.splice(1,0,"mousemove"):this.dispatchEvent(t,"mousemove"),a&&r.push("globalmousemove"),this.cursor=t.target?.cursor),r.length>0&&this.all(t,r),this._allInteractiveElements.length=0,this._hitElements.length=0,n.overTargets=t.composedPath(),this.freeEvent(t)}mapPointerOver(e){if(!(e instanceof f)){y("EventBoundary cannot map a non-pointer event as a pointer event");return}const t=this.trackingData(e.pointerId),i=this.createPointerEvent(e),n=i.pointerType==="mouse"||i.pointerType==="pen";this.dispatchEvent(i,"pointerover"),n&&this.dispatchEvent(i,"mouseover"),i.pointerType==="mouse"&&(this.cursor=i.target?.cursor);const s=this.clonePointerEvent(i,"pointerenter");for(s.eventPhase=s.AT_TARGET;s.target&&s.target!==this.rootTarget.parent;)s.currentTarget=s.target,this.notifyTarget(s),n&&this.notifyTarget(s,"mouseenter"),s.target=s.target.parent;t.overTargets=i.composedPath(),this.freeEvent(i),this.freeEvent(s)}mapPointerOut(e){if(!(e instanceof f)){y("EventBoundary cannot map a non-pointer event as a pointer event");return}const t=this.trackingData(e.pointerId);if(t.overTargets){const i=e.pointerType==="mouse"||e.pointerType==="pen",n=this.findMountedTarget(t.overTargets),s=this.createPointerEvent(e,"pointerout",n);this.dispatchEvent(s),i&&this.dispatchEvent(s,"mouseout");const r=this.createPointerEvent(e,"pointerleave",n);for(r.eventPhase=r.AT_TARGET;r.target&&r.target!==this.rootTarget.parent;)r.currentTarget=r.target,this.notifyTarget(r),i&&this.notifyTarget(r,"mouseleave"),r.target=r.target.parent;t.overTargets=null,this.freeEvent(s),this.freeEvent(r)}this.cursor=null}mapPointerUp(e){if(!(e instanceof f)){y("EventBoundary cannot map a non-pointer event as a pointer event");return}const t=performance.now(),i=this.createPointerEvent(e);if(this.dispatchEvent(i,"pointerup"),i.pointerType==="touch")this.dispatchEvent(i,"touchend");else if(i.pointerType==="mouse"||i.pointerType==="pen"){const a=i.button===2;this.dispatchEvent(i,a?"rightup":"mouseup")}const n=this.trackingData(e.pointerId),s=this.findMountedTarget(n.pressTargetsByButton[e.button]);let r=s;if(s&&!i.composedPath().includes(s)){let a=s;for(;a&&!i.composedPath().includes(a);){if(i.currentTarget=a,this.notifyTarget(i,"pointerupoutside"),i.pointerType==="touch")this.notifyTarget(i,"touchendoutside");else if(i.pointerType==="mouse"||i.pointerType==="pen"){const c=i.button===2;this.notifyTarget(i,c?"rightupoutside":"mouseupoutside")}a=a.parent}delete n.pressTargetsByButton[e.button],r=a}if(r){const a=this.clonePointerEvent(i,"click");a.target=r,a.path=null,n.clicksByButton[e.button]||(n.clicksByButton[e.button]={clickCount:0,target:a.target,timeStamp:t});const c=n.clicksByButton[e.button];if(c.target===a.target&&t-c.timeStamp<200?++c.clickCount:c.clickCount=1,c.target=a.target,c.timeStamp=t,a.detail=c.clickCount,a.pointerType==="mouse"){const p=a.button===2;this.dispatchEvent(a,p?"rightclick":"click")}else a.pointerType==="touch"&&this.dispatchEvent(a,"tap");this.dispatchEvent(a,"pointertap"),this.freeEvent(a)}this.freeEvent(i)}mapPointerUpOutside(e){if(!(e instanceof f)){y("EventBoundary cannot map a non-pointer event as a pointer event");return}const t=this.trackingData(e.pointerId),i=this.findMountedTarget(t.pressTargetsByButton[e.button]),n=this.createPointerEvent(e);if(i){let s=i;for(;s;)n.currentTarget=s,this.notifyTarget(n,"pointerupoutside"),n.pointerType==="touch"?this.notifyTarget(n,"touchendoutside"):(n.pointerType==="mouse"||n.pointerType==="pen")&&this.notifyTarget(n,n.button===2?"rightupoutside":"mouseupoutside"),s=s.parent;delete t.pressTargetsByButton[e.button]}this.freeEvent(n)}mapWheel(e){if(!(e instanceof T)){y("EventBoundary cannot map a non-wheel event as a wheel event");return}const t=this.createWheelEvent(e);this.dispatchEvent(t),this.freeEvent(t)}findMountedTarget(e){if(!e)return null;let t=e[0];for(let i=1;i<e.length&&e[i].parent===t;i++)t=e[i];return t}createPointerEvent(e,t,i){const n=this.allocateEvent(f);return this.copyPointerData(e,n),this.copyMouseData(e,n),this.copyData(e,n),n.nativeEvent=e.nativeEvent,n.originalEvent=e,n.target=i??this.hitTest(n.global.x,n.global.y)??this._hitElements[0],typeof t=="string"&&(n.type=t),n}createWheelEvent(e){const t=this.allocateEvent(T);return this.copyWheelData(e,t),this.copyMouseData(e,t),this.copyData(e,t),t.nativeEvent=e.nativeEvent,t.originalEvent=e,t.target=this.hitTest(t.global.x,t.global.y),t}clonePointerEvent(e,t){const i=this.allocateEvent(f);return i.nativeEvent=e.nativeEvent,i.originalEvent=e.originalEvent,this.copyPointerData(e,i),this.copyMouseData(e,i),this.copyData(e,i),i.target=e.target,i.path=e.composedPath().slice(),i.type=t??i.type,i}copyWheelData(e,t){t.deltaMode=e.deltaMode,t.deltaX=e.deltaX,t.deltaY=e.deltaY,t.deltaZ=e.deltaZ}copyPointerData(e,t){e instanceof f&&t instanceof f&&(t.pointerId=e.pointerId,t.width=e.width,t.height=e.height,t.isPrimary=e.isPrimary,t.pointerType=e.pointerType,t.pressure=e.pressure,t.tangentialPressure=e.tangentialPressure,t.tiltX=e.tiltX,t.tiltY=e.tiltY,t.twist=e.twist)}copyMouseData(e,t){e instanceof D&&t instanceof D&&(t.altKey=e.altKey,t.button=e.button,t.buttons=e.buttons,t.client.copyFrom(e.client),t.ctrlKey=e.ctrlKey,t.metaKey=e.metaKey,t.movement.copyFrom(e.movement),t.screen.copyFrom(e.screen),t.shiftKey=e.shiftKey,t.global.copyFrom(e.global))}copyData(e,t){t.isTrusted=e.isTrusted,t.srcElement=e.srcElement,t.timeStamp=performance.now(),t.type=e.type,t.detail=e.detail,t.view=e.view,t.which=e.which,t.layer.copyFrom(e.layer),t.page.copyFrom(e.page)}trackingData(e){return this.mappingState.trackingData[e]||(this.mappingState.trackingData[e]={pressTargetsByButton:{},clicksByButton:{},overTarget:null}),this.mappingState.trackingData[e]}allocateEvent(e){this.eventPool.has(e)||this.eventPool.set(e,[]);const t=this.eventPool.get(e).pop()||new e(this);return t.eventPhase=t.NONE,t.currentTarget=null,t.path=null,t.target=null,t}freeEvent(e){if(e.manager!==this)throw new Error("It is illegal to free an event not managed by this EventBoundary!");const t=e.constructor;this.eventPool.has(t)||this.eventPool.set(t,[]),this.eventPool.get(t).push(e)}_notifyListeners(e,t){const i=e.currentTarget._events[t];if(i&&e.currentTarget.isInteractive())if("fn"in i)i.once&&e.currentTarget.removeListener(t,i.fn,void 0,!0),i.fn.call(i.context,e);else for(let n=0,s=i.length;n<s&&!e.propagationImmediatelyStopped;n++)i[n].once&&e.currentTarget.removeListener(t,i[n].fn,void 0,!0),i[n].fn.call(i[n].context,e)}}const fe=1,ge={touchstart:"pointerdown",touchend:"pointerup",touchendoutside:"pointerupoutside",touchmove:"pointermove",touchcancel:"pointercancel"},B=class x{constructor(e){this.supportsTouchEvents="ontouchstart"in globalThis,this.supportsPointerEvents=!!globalThis.PointerEvent,this.domElement=null,this.resolution=1,this.renderer=e,this.rootBoundary=new ve(null),E.init(this),this.autoPreventDefault=!0,this._eventsAdded=!1,this._rootPointerEvent=new f(null),this._rootWheelEvent=new T(null),this.cursorStyles={default:"inherit",pointer:"pointer"},this.features=new Proxy({...x.defaultEventFeatures},{set:(t,i,n)=>(i==="globalMove"&&(this.rootBoundary.enableGlobalMoveEvents=n),t[i]=n,!0)}),this._onPointerDown=this._onPointerDown.bind(this),this._onPointerMove=this._onPointerMove.bind(this),this._onPointerUp=this._onPointerUp.bind(this),this._onPointerOverOut=this._onPointerOverOut.bind(this),this.onWheel=this.onWheel.bind(this)}static get defaultEventMode(){return this._defaultEventMode}init(e){const{canvas:t,resolution:i}=this.renderer;this.setTargetElement(t),this.resolution=i,x._defaultEventMode=e.eventMode??"passive",Object.assign(this.features,e.eventFeatures??{}),this.rootBoundary.enableGlobalMoveEvents=this.features.globalMove}resolutionChange(e){this.resolution=e}destroy(){this.setTargetElement(null),this.renderer=null,this._currentCursor=null}setCursor(e){e=e||"default";let t=!0;if(globalThis.OffscreenCanvas&&this.domElement instanceof OffscreenCanvas&&(t=!1),this._currentCursor===e)return;this._currentCursor=e;const i=this.cursorStyles[e];if(i)switch(typeof i){case"string":t&&(this.domElement.style.cursor=i);break;case"function":i(e);break;case"object":t&&Object.assign(this.domElement.style,i);break}else t&&typeof e=="string"&&!Object.prototype.hasOwnProperty.call(this.cursorStyles,e)&&(this.domElement.style.cursor=e)}get pointer(){return this._rootPointerEvent}_onPointerDown(e){if(!this.features.click)return;this.rootBoundary.rootTarget=this.renderer.lastObjectRendered;const t=this._normalizeToPointerData(e);this.autoPreventDefault&&t[0].isNormalized&&(e.cancelable||!("cancelable"in e))&&e.preventDefault();for(let i=0,n=t.length;i<n;i++){const s=t[i],r=this._bootstrapEvent(this._rootPointerEvent,s);this.rootBoundary.mapEvent(r)}this.setCursor(this.rootBoundary.cursor)}_onPointerMove(e){if(!this.features.move)return;this.rootBoundary.rootTarget=this.renderer.lastObjectRendered,E.pointerMoved();const t=this._normalizeToPointerData(e);for(let i=0,n=t.length;i<n;i++){const s=this._bootstrapEvent(this._rootPointerEvent,t[i]);this.rootBoundary.mapEvent(s)}this.setCursor(this.rootBoundary.cursor)}_onPointerUp(e){if(!this.features.click)return;this.rootBoundary.rootTarget=this.renderer.lastObjectRendered;let t=e.target;e.composedPath&&e.composedPath().length>0&&(t=e.composedPath()[0]);const i=t!==this.domElement?"outside":"",n=this._normalizeToPointerData(e);for(let s=0,r=n.length;s<r;s++){const a=this._bootstrapEvent(this._rootPointerEvent,n[s]);a.type+=i,this.rootBoundary.mapEvent(a)}this.setCursor(this.rootBoundary.cursor)}_onPointerOverOut(e){if(!this.features.click)return;this.rootBoundary.rootTarget=this.renderer.lastObjectRendered;const t=this._normalizeToPointerData(e);for(let i=0,n=t.length;i<n;i++){const s=this._bootstrapEvent(this._rootPointerEvent,t[i]);this.rootBoundary.mapEvent(s)}this.setCursor(this.rootBoundary.cursor)}onWheel(e){if(!this.features.wheel)return;const t=this.normalizeWheelEvent(e);this.rootBoundary.rootTarget=this.renderer.lastObjectRendered,this.rootBoundary.mapEvent(t)}setTargetElement(e){this._removeEvents(),this.domElement=e,E.domElement=e,this._addEvents()}_addEvents(){if(this._eventsAdded||!this.domElement)return;E.addTickerListener();const e=this.domElement.style;e&&(globalThis.navigator.msPointerEnabled?(e.msContentZooming="none",e.msTouchAction="none"):this.supportsPointerEvents&&(e.touchAction="none")),this.supportsPointerEvents?(globalThis.document.addEventListener("pointermove",this._onPointerMove,!0),this.domElement.addEventListener("pointerdown",this._onPointerDown,!0),this.domElement.addEventListener("pointerleave",this._onPointerOverOut,!0),this.domElement.addEventListener("pointerover",this._onPointerOverOut,!0),globalThis.addEventListener("pointerup",this._onPointerUp,!0)):(globalThis.document.addEventListener("mousemove",this._onPointerMove,!0),this.domElement.addEventListener("mousedown",this._onPointerDown,!0),this.domElement.addEventListener("mouseout",this._onPointerOverOut,!0),this.domElement.addEventListener("mouseover",this._onPointerOverOut,!0),globalThis.addEventListener("mouseup",this._onPointerUp,!0),this.supportsTouchEvents&&(this.domElement.addEventListener("touchstart",this._onPointerDown,!0),this.domElement.addEventListener("touchend",this._onPointerUp,!0),this.domElement.addEventListener("touchmove",this._onPointerMove,!0))),this.domElement.addEventListener("wheel",this.onWheel,{passive:!0,capture:!0}),this._eventsAdded=!0}_removeEvents(){if(!this._eventsAdded||!this.domElement)return;E.removeTickerListener();const e=this.domElement.style;e&&(globalThis.navigator.msPointerEnabled?(e.msContentZooming="",e.msTouchAction=""):this.supportsPointerEvents&&(e.touchAction="")),this.supportsPointerEvents?(globalThis.document.removeEventListener("pointermove",this._onPointerMove,!0),this.domElement.removeEventListener("pointerdown",this._onPointerDown,!0),this.domElement.removeEventListener("pointerleave",this._onPointerOverOut,!0),this.domElement.removeEventListener("pointerover",this._onPointerOverOut,!0),globalThis.removeEventListener("pointerup",this._onPointerUp,!0)):(globalThis.document.removeEventListener("mousemove",this._onPointerMove,!0),this.domElement.removeEventListener("mousedown",this._onPointerDown,!0),this.domElement.removeEventListener("mouseout",this._onPointerOverOut,!0),this.domElement.removeEventListener("mouseover",this._onPointerOverOut,!0),globalThis.removeEventListener("mouseup",this._onPointerUp,!0),this.supportsTouchEvents&&(this.domElement.removeEventListener("touchstart",this._onPointerDown,!0),this.domElement.removeEventListener("touchend",this._onPointerUp,!0),this.domElement.removeEventListener("touchmove",this._onPointerMove,!0))),this.domElement.removeEventListener("wheel",this.onWheel,!0),this.domElement=null,this._eventsAdded=!1}mapPositionToPoint(e,t,i){const n=this.domElement.isConnected?this.domElement.getBoundingClientRect():{x:0,y:0,width:this.domElement.width,height:this.domElement.height,left:0,top:0},s=1/this.resolution;e.x=(t-n.left)*(this.domElement.width/n.width)*s,e.y=(i-n.top)*(this.domElement.height/n.height)*s}_normalizeToPointerData(e){const t=[];if(this.supportsTouchEvents&&e instanceof TouchEvent)for(let i=0,n=e.changedTouches.length;i<n;i++){const s=e.changedTouches[i];typeof s.button>"u"&&(s.button=0),typeof s.buttons>"u"&&(s.buttons=1),typeof s.isPrimary>"u"&&(s.isPrimary=e.touches.length===1&&e.type==="touchstart"),typeof s.width>"u"&&(s.width=s.radiusX||1),typeof s.height>"u"&&(s.height=s.radiusY||1),typeof s.tiltX>"u"&&(s.tiltX=0),typeof s.tiltY>"u"&&(s.tiltY=0),typeof s.pointerType>"u"&&(s.pointerType="touch"),typeof s.pointerId>"u"&&(s.pointerId=s.identifier||0),typeof s.pressure>"u"&&(s.pressure=s.force||.5),typeof s.twist>"u"&&(s.twist=0),typeof s.tangentialPressure>"u"&&(s.tangentialPressure=0),typeof s.layerX>"u"&&(s.layerX=s.offsetX=s.clientX),typeof s.layerY>"u"&&(s.layerY=s.offsetY=s.clientY),s.isNormalized=!0,s.type=e.type,t.push(s)}else if(!globalThis.MouseEvent||e instanceof MouseEvent&&(!this.supportsPointerEvents||!(e instanceof globalThis.PointerEvent))){const i=e;typeof i.isPrimary>"u"&&(i.isPrimary=!0),typeof i.width>"u"&&(i.width=1),typeof i.height>"u"&&(i.height=1),typeof i.tiltX>"u"&&(i.tiltX=0),typeof i.tiltY>"u"&&(i.tiltY=0),typeof i.pointerType>"u"&&(i.pointerType="mouse"),typeof i.pointerId>"u"&&(i.pointerId=fe),typeof i.pressure>"u"&&(i.pressure=.5),typeof i.twist>"u"&&(i.twist=0),typeof i.tangentialPressure>"u"&&(i.tangentialPressure=0),i.isNormalized=!0,t.push(i)}else t.push(e);return t}normalizeWheelEvent(e){const t=this._rootWheelEvent;return this._transferMouseData(t,e),t.deltaX=e.deltaX,t.deltaY=e.deltaY,t.deltaZ=e.deltaZ,t.deltaMode=e.deltaMode,this.mapPositionToPoint(t.screen,e.clientX,e.clientY),t.global.copyFrom(t.screen),t.offset.copyFrom(t.screen),t.nativeEvent=e,t.type=e.type,t}_bootstrapEvent(e,t){return e.originalEvent=null,e.nativeEvent=t,e.pointerId=t.pointerId,e.width=t.width,e.height=t.height,e.isPrimary=t.isPrimary,e.pointerType=t.pointerType,e.pressure=t.pressure,e.tangentialPressure=t.tangentialPressure,e.tiltX=t.tiltX,e.tiltY=t.tiltY,e.twist=t.twist,this._transferMouseData(e,t),this.mapPositionToPoint(e.screen,t.clientX,t.clientY),e.global.copyFrom(e.screen),e.offset.copyFrom(e.screen),e.isTrusted=t.isTrusted,e.type==="pointerleave"&&(e.type="pointerout"),e.type.startsWith("mouse")&&(e.type=e.type.replace("mouse","pointer")),e.type.startsWith("touch")&&(e.type=ge[e.type]||e.type),e}_transferMouseData(e,t){e.isTrusted=t.isTrusted,e.srcElement=t.srcElement,e.timeStamp=performance.now(),e.type=t.type,e.altKey=t.altKey,e.button=t.button,e.buttons=t.buttons,e.client.x=t.clientX,e.client.y=t.clientY,e.ctrlKey=t.ctrlKey,e.metaKey=t.metaKey,e.movement.x=t.movementX,e.movement.y=t.movementY,e.page.x=t.pageX,e.page.y=t.pageY,e.relatedTarget=null,e.shiftKey=t.shiftKey}};B.extension={name:"events",type:[w.WebGLSystem,w.CanvasSystem,w.WebGPUSystem],priority:-1};B.defaultEventFeatures={move:!0,globalMove:!0,click:!0,wheel:!0};let q=B;const me={onclick:null,onmousedown:null,onmouseenter:null,onmouseleave:null,onmousemove:null,onglobalmousemove:null,onmouseout:null,onmouseover:null,onmouseup:null,onmouseupoutside:null,onpointercancel:null,onpointerdown:null,onpointerenter:null,onpointerleave:null,onpointermove:null,onglobalpointermove:null,onpointerout:null,onpointerover:null,onpointertap:null,onpointerup:null,onpointerupoutside:null,onrightclick:null,onrightdown:null,onrightup:null,onrightupoutside:null,ontap:null,ontouchcancel:null,ontouchend:null,ontouchendoutside:null,ontouchmove:null,onglobaltouchmove:null,ontouchstart:null,onwheel:null,get interactive(){return this.eventMode==="dynamic"||this.eventMode==="static"},set interactive(o){this.eventMode=o?"static":"passive"},_internalEventMode:void 0,get eventMode(){return this._internalEventMode??q.defaultEventMode},set eventMode(o){this._internalEventMode=o},isInteractive(){return this.eventMode==="static"||this.eventMode==="dynamic"},interactiveChildren:!0,hitArea:null,addEventListener(o,e,t){const i=typeof t=="boolean"&&t||typeof t=="object"&&t.capture,n=typeof t=="object"?t.signal:void 0,s=typeof t=="object"?t.once===!0:!1,r=typeof e=="function"?void 0:e;o=i?`${o}capture`:o;const a=typeof e=="function"?e:e.handleEvent,c=this;n&&n.addEventListener("abort",()=>{c.off(o,a,r)}),s?c.once(o,a,r):c.on(o,a,r)},removeEventListener(o,e,t){const i=typeof t=="boolean"&&t||typeof t=="object"&&t.capture,n=typeof e=="function"?void 0:e;o=i?`${o}capture`:o,e=typeof e=="function"?e:e.handleEvent,this.off(o,e,n)},dispatchEvent(o){if(!(o instanceof M))throw new Error("Container cannot propagate events outside of the Federated Events API");return o.defaultPrevented=!1,o.path=null,o.target=this,o.manager.dispatchEvent(o),!o.defaultPrevented}};z.add(V);Z.mixin(ue);z.add(q);Z.mixin(me)});

View File

@@ -1,4 +1,4 @@
import{k as mt,u as K,a as dt,c as T,i as ht,j as pt,n as X,w as gt,m as N,__tla as __tla_0}from"./TorrentDetail-BZZ-B8cw.js";let de,S,H,ee,re,Ft,se,ut,oe,W,D,nt,ae,St,he,ne,ie,fe,ue,le,me,ce;let __tla=Promise.all([(()=>{try{return __tla_0}catch{}})()]).then(async()=>{const C=Object.create(null),Y=Object.create(null);W=function(o,t){let e=Y[o];return e===void 0&&(C[t]===void 0&&(C[t]=1),Y[o]=e=C[t]++),e};let M;function xt(){if(!M){M="mediump";const o=mt();o&&o.getShaderPrecisionFormat&&(M=o.getShaderPrecisionFormat(o.FRAGMENT_SHADER,o.HIGH_FLOAT).precision?"highp":"mediump")}return M}function vt(o,t,e){return t?o:e?(o=o.replace("out vec4 finalColor;",""),` import{l as dt,u as K,a as mt,d as T,j as ht,k as pt,n as X,w as gt,g as N,__tla as __tla_0}from"./TorrentDetail-CKmHZcwa.js";let me,S,H,ee,re,Ft,se,ut,oe,W,D,nt,ae,St,he,ne,ie,fe,ue,le,de,ce;let __tla=Promise.all([(()=>{try{return __tla_0}catch{}})()]).then(async()=>{const C=Object.create(null),Y=Object.create(null);W=function(o,t){let e=Y[o];return e===void 0&&(C[t]===void 0&&(C[t]=1),Y[o]=e=C[t]++),e};let G;function xt(){if(!G){G="mediump";const o=dt();o&&o.getShaderPrecisionFormat&&(G=o.getShaderPrecisionFormat(o.FRAGMENT_SHADER,o.HIGH_FLOAT).precision?"highp":"mediump")}return G}function vt(o,t,e){return t?o:e?(o=o.replace("out vec4 finalColor;",""),`
#ifdef GL_ES // This checks if it is WebGL1 #ifdef GL_ES // This checks if it is WebGL1
#define in varying #define in varying
@@ -15,8 +15,8 @@ import{k as mt,u as K,a as dt,c as T,i as ht,j as pt,n as X,w as gt,m as N,__tla
${o} ${o}
`}function bt(o,t,e){const r=e?t.maxSupportedFragmentPrecision:t.maxSupportedVertexPrecision;if(o.substring(0,9)!=="precision"){let n=e?t.requestedFragmentPrecision:t.requestedVertexPrecision;return n==="highp"&&r!=="highp"&&(n="mediump"),`precision ${n} float; `}function bt(o,t,e){const r=e?t.maxSupportedFragmentPrecision:t.maxSupportedVertexPrecision;if(o.substring(0,9)!=="precision"){let n=e?t.requestedFragmentPrecision:t.requestedVertexPrecision;return n==="highp"&&r!=="highp"&&(n="mediump"),`precision ${n} float;
${o}`}else if(r!=="highp"&&o.substring(0,15)==="precision highp")return o.replace("precision highp","precision mediump");return o}function Pt(o,t){return t?`#version 300 es ${o}`}else if(r!=="highp"&&o.substring(0,15)==="precision highp")return o.replace("precision highp","precision mediump");return o}function Pt(o,t){return t?`#version 300 es
${o}`:o}const yt={},_t={};function Gt(o,{name:t="pixi-program"},e=!0){t=t.replace(/\s+/g,"-"),t+=e?"-fragment":"-vertex";const r=e?yt:_t;return r[t]?(r[t]++,t+=`-${r[t]}`):r[t]=1,o.indexOf("#define SHADER_NAME")!==-1?o:`${`#define SHADER_NAME ${t}`} ${o}`:o}const yt={},_t={};function Mt(o,{name:t="pixi-program"},e=!0){t=t.replace(/\s+/g,"-"),t+=e?"-fragment":"-vertex";const r=e?yt:_t;return r[t]?(r[t]++,t+=`-${r[t]}`):r[t]=1,o.indexOf("#define SHADER_NAME")!==-1?o:`${`#define SHADER_NAME ${t}`}
${o}`}function Mt(o,t){return t?o.replace("#version 300 es",""):o}const $={stripVersion:Mt,ensurePrecision:bt,addProgramDefines:vt,setProgramName:Gt,insertVersion:Pt},U=Object.create(null),ot=class L{constructor(t){t={...L.defaultOptions,...t};const e=t.fragment.indexOf("#version 300 es")!==-1,r={stripVersion:e,ensurePrecision:{requestedFragmentPrecision:t.preferredFragmentPrecision,requestedVertexPrecision:t.preferredVertexPrecision,maxSupportedVertexPrecision:"highp",maxSupportedFragmentPrecision:xt()},setProgramName:{name:t.name},addProgramDefines:e,insertVersion:e};let n=t.fragment,s=t.vertex;Object.keys($).forEach(a=>{const i=r[a];n=$[a](n,i,!0),s=$[a](s,i,!1)}),this.fragment=n,this.vertex=s,this._key=W(`${this.vertex}:${this.fragment}`,"gl-program")}destroy(){this.fragment=null,this.vertex=null,this._attributeData=null,this._uniformData=null,this._uniformBlockData=null,this.transformFeedbackVaryings=null}static from(t){const e=`${t.vertex}:${t.fragment}`;return U[e]||(U[e]=new L(t)),U[e]}};ot.defaultOptions={preferredVertexPrecision:"highp",preferredFragmentPrecision:"mediump"};nt=ot;const q={uint8x2:{size:2,stride:2,normalised:!1},uint8x4:{size:4,stride:4,normalised:!1},sint8x2:{size:2,stride:2,normalised:!1},sint8x4:{size:4,stride:4,normalised:!1},unorm8x2:{size:2,stride:2,normalised:!0},unorm8x4:{size:4,stride:4,normalised:!0},snorm8x2:{size:2,stride:2,normalised:!0},snorm8x4:{size:4,stride:4,normalised:!0},uint16x2:{size:2,stride:4,normalised:!1},uint16x4:{size:4,stride:8,normalised:!1},sint16x2:{size:2,stride:4,normalised:!1},sint16x4:{size:4,stride:8,normalised:!1},unorm16x2:{size:2,stride:4,normalised:!0},unorm16x4:{size:4,stride:8,normalised:!0},snorm16x2:{size:2,stride:4,normalised:!0},snorm16x4:{size:4,stride:8,normalised:!0},float16x2:{size:2,stride:4,normalised:!1},float16x4:{size:4,stride:8,normalised:!1},float32:{size:1,stride:4,normalised:!1},float32x2:{size:2,stride:8,normalised:!1},float32x3:{size:3,stride:12,normalised:!1},float32x4:{size:4,stride:16,normalised:!1},uint32:{size:1,stride:4,normalised:!1},uint32x2:{size:2,stride:8,normalised:!1},uint32x3:{size:3,stride:12,normalised:!1},uint32x4:{size:4,stride:16,normalised:!1},sint32:{size:1,stride:4,normalised:!1},sint32x2:{size:2,stride:8,normalised:!1},sint32x3:{size:3,stride:12,normalised:!1},sint32x4:{size:4,stride:16,normalised:!1}};St=function(o){return q[o]??q.float32};const Tt={f32:"float32","vec2<f32>":"float32x2","vec3<f32>":"float32x3","vec4<f32>":"float32x4",vec2f:"float32x2",vec3f:"float32x3",vec4f:"float32x4",i32:"sint32","vec2<i32>":"sint32x2","vec3<i32>":"sint32x3","vec4<i32>":"sint32x4",u32:"uint32","vec2<u32>":"uint32x2","vec3<u32>":"uint32x3","vec4<u32>":"uint32x4",bool:"uint32","vec2<bool>":"uint32x2","vec3<bool>":"uint32x3","vec4<bool>":"uint32x4"};function Ct({source:o,entryPoint:t}){const e={},r=o.indexOf(`fn ${t}`);if(r!==-1){const n=o.indexOf("->",r);if(n!==-1){const s=o.substring(r,n),a=/@location\((\d+)\)\s+([a-zA-Z0-9_]+)\s*:\s*([a-zA-Z0-9_<>]+)(?:,|\s|$)/g;let i;for(;(i=a.exec(s))!==null;){const u=Tt[i[3]]??"float32";e[i[2]]={location:parseInt(i[1],10),format:u,stride:St(u).stride,offset:0,instance:!1,start:0}}}}return e}function A(o){const t=/(^|[^/])@(group|binding)\(\d+\)[^;]+;/g,e=/@group\((\d+)\)/,r=/@binding\((\d+)\)/,n=/var(<[^>]+>)? (\w+)/,s=/:\s*(\w+)/,a=/struct\s+(\w+)\s*{([^}]+)}/g,i=/(\w+)\s*:\s*([\w\<\>]+)/g,u=/struct\s+(\w+)/,f=o.match(t)?.map(l=>({group:parseInt(l.match(e)[1],10),binding:parseInt(l.match(r)[1],10),name:l.match(n)[2],isUniform:l.match(n)[1]==="<uniform>",type:l.match(s)[1]}));if(!f)return{groups:[],structs:[]};const c=o.match(a)?.map(l=>{const m=l.match(u)[1],p=l.match(i).reduce((g,x)=>{const[v,b]=x.split(":");return g[v.trim()]=b.trim(),g},{});return p?{name:m,members:p}:null}).filter(({name:l})=>f.some(m=>m.type===l))??[];return{groups:f,structs:c}}var P=(o=>(o[o.VERTEX=1]="VERTEX",o[o.FRAGMENT=2]="FRAGMENT",o[o.COMPUTE=4]="COMPUTE",o))(P||{});function $t({groups:o}){const t=[];for(let e=0;e<o.length;e++){const r=o[e];t[r.group]||(t[r.group]=[]),r.isUniform?t[r.group].push({binding:r.binding,visibility:P.VERTEX|P.FRAGMENT,buffer:{type:"uniform"}}):r.type==="sampler"?t[r.group].push({binding:r.binding,visibility:P.FRAGMENT,sampler:{type:"filtering"}}):r.type==="texture_2d"&&t[r.group].push({binding:r.binding,visibility:P.FRAGMENT,texture:{sampleType:"float",viewDimension:"2d",multisampled:!1}})}return t}function Ut({groups:o}){const t=[];for(let e=0;e<o.length;e++){const r=o[e];t[r.group]||(t[r.group]={}),t[r.group][r.name]=r.binding}return t}function At(o,t){const e=new Set,r=new Set,n=[...o.structs,...t.structs].filter(a=>e.has(a.name)?!1:(e.add(a.name),!0)),s=[...o.groups,...t.groups].filter(a=>{const i=`${a.name}-${a.binding}`;return r.has(i)?!1:(r.add(i),!0)});return{structs:n,groups:s}}const E=Object.create(null);S=class{constructor(t){this._layoutKey=0;const{fragment:e,vertex:r,layout:n,gpuLayout:s,name:a}=t;if(this.name=a,this.fragment=e,this.vertex=r,e.source===r.source){const i=A(e.source);this.structsAndGroups=i}else{const i=A(r.source),u=A(e.source);this.structsAndGroups=At(i,u)}this.layout=n??Ut(this.structsAndGroups),this.gpuLayout=s??$t(this.structsAndGroups),this.autoAssignGlobalUniforms=this.layout[0]?.globalUniforms!==void 0,this.autoAssignLocalUniforms=this.layout[1]?.localUniforms!==void 0,this._generateProgramKey()}_generateProgramKey(){const{vertex:t,fragment:e}=this,r=t.source+e.source+t.entryPoint+e.entryPoint;this._layoutKey=W(r,"program")}get attributeData(){return this._attributeData??(this._attributeData=Ct(this.vertex)),this._attributeData}destroy(){this.gpuLayout=null,this.layout=null,this.structsAndGroups=null,this.fragment=null,this.vertex=null}static from(t){const e=`${t.vertex.source}:${t.fragment.source}:${t.fragment.entryPoint}:${t.vertex.entryPoint}`;return E[e]||(E[e]=new S(t)),E[e]}};const st=["f32","i32","vec2<f32>","vec3<f32>","vec4<f32>","mat2x2<f32>","mat3x3<f32>","mat4x4<f32>","mat3x2<f32>","mat4x2<f32>","mat2x3<f32>","mat4x3<f32>","mat2x4<f32>","mat3x4<f32>"],Et=st.reduce((o,t)=>(o[t]=!0,o),{});function wt(o,t){switch(o){case"f32":return 0;case"vec2<f32>":return new Float32Array(2*t);case"vec3<f32>":return new Float32Array(3*t);case"vec4<f32>":return new Float32Array(4*t);case"mat2x2<f32>":return new Float32Array([1,0,0,1]);case"mat3x3<f32>":return new Float32Array([1,0,0,0,1,0,0,0,1]);case"mat4x4<f32>":return new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}return null}const it=class at{constructor(t,e){this._touched=0,this.uid=K("uniform"),this._resourceType="uniformGroup",this._resourceId=K("resource"),this.isUniformGroup=!0,this._dirtyId=0,this.destroyed=!1,e={...at.defaultOptions,...e},this.uniformStructures=t;const r={};for(const n in t){const s=t[n];if(s.name=n,s.size=s.size??1,!Et[s.type])throw new Error(`Uniform type ${s.type} is not supported. Supported uniform types are: ${st.join(", ")}`);s.value??(s.value=wt(s.type,s.size)),r[n]=s.value}this.uniforms=r,this._dirtyId=1,this.ubo=e.ubo,this.isStatic=e.isStatic,this._signature=W(Object.keys(r).map(n=>`${n}-${t[n].type}`).join("-"),"uniform-group")}update(){this._dirtyId++}};it.defaultOptions={ubo:!1,isStatic:!1};Ft=it;H=(o=>(o[o.WEBGL=1]="WEBGL",o[o.WEBGPU=2]="WEBGPU",o[o.BOTH=3]="BOTH",o))(H||{});ut=class extends dt{constructor(t){super(),this._uniformBindMap=Object.create(null),this._ownedBindGroups=[];let{gpuProgram:e,glProgram:r,groups:n,resources:s,compatibleRenderers:a,groupMap:i}=t;this.gpuProgram=e,this.glProgram=r,a===void 0&&(a=0,e&&(a|=H.WEBGPU),r&&(a|=H.WEBGL)),this.compatibleRenderers=a;const u={};if(!s&&!n&&(s={}),s&&n)throw new Error("[Shader] Cannot have both resources and groups");if(!e&&n&&!i)throw new Error("[Shader] No group map or WebGPU shader provided - consider using resources instead.");if(!e&&n&&i)for(const f in i)for(const c in i[f]){const l=i[f][c];u[l]={group:f,binding:c,name:l}}else if(e&&n&&!i){const f=e.structsAndGroups.groups;i={},f.forEach(c=>{i[c.group]=i[c.group]||{},i[c.group][c.binding]=c.name,u[c.name]=c})}else if(s){if(e){const f=e.structsAndGroups.groups;i={},f.forEach(c=>{i[c.group]=i[c.group]||{},i[c.group][c.binding]=c.name,u[c.name]=c})}else{i={},n={99:new T},this._ownedBindGroups.push(n[99]);let f=0;for(const c in s)u[c]={group:99,binding:f,name:c},i[99]=i[99]||{},i[99][f]=c,f++}n={};for(const f in s){const c=f;let l=s[f];!l.source&&!l._resourceType&&(l=new Ft(l));const m=u[c];m&&(n[m.group]||(n[m.group]=new T,this._ownedBindGroups.push(n[m.group])),n[m.group].setResource(l,m.binding))}}this.groups=n,this._uniformBindMap=i,this.resources=this._buildResourceAccessor(n,u)}addResource(t,e,r){var n,s;(n=this._uniformBindMap)[e]||(n[e]={}),(s=this._uniformBindMap[e])[r]||(s[r]=t),this.groups[e]||(this.groups[e]=new T,this._ownedBindGroups.push(this.groups[e]))}_buildResourceAccessor(t,e){const r={};for(const n in e){const s=e[n];Object.defineProperty(r,s.name,{get(){return t[s.group].getResource(s.binding)},set(a){t[s.group].setResource(a,s.binding)}})}return r}destroy(t=!1){this.emit("destroy",this),t&&(this.gpuProgram?.destroy(),this.glProgram?.destroy()),this.gpuProgram=null,this.glProgram=null,this.removeAllListeners(),this._uniformBindMap=null,this._ownedBindGroups.forEach(e=>{e.destroy()}),this._ownedBindGroups=null,this.resources=null,this.groups=null}static from(t){const{gpu:e,gl:r,...n}=t;let s,a;return e&&(s=S.from(e)),r&&(a=nt.from(r)),new ut({gpuProgram:s,glProgram:a,...n})}};const zt={normal:0,add:1,multiply:2,screen:3,overlay:4,erase:5,"normal-npm":6,"add-npm":7,"screen-npm":8},w=0,F=1,z=2,O=3,R=4,B=5,V=class ct{constructor(){this.data=0,this.blendMode="normal",this.polygonOffset=0,this.blend=!0,this.depthMask=!0}get blend(){return!!(this.data&1<<w)}set blend(t){!!(this.data&1<<w)!==t&&(this.data^=1<<w)}get offsets(){return!!(this.data&1<<F)}set offsets(t){!!(this.data&1<<F)!==t&&(this.data^=1<<F)}set cullMode(t){if(t==="none"){this.culling=!1;return}this.culling=!0,this.clockwiseFrontFace=t==="front"}get cullMode(){return this.culling?this.clockwiseFrontFace?"front":"back":"none"}get culling(){return!!(this.data&1<<z)}set culling(t){!!(this.data&1<<z)!==t&&(this.data^=1<<z)}get depthTest(){return!!(this.data&1<<O)}set depthTest(t){!!(this.data&1<<O)!==t&&(this.data^=1<<O)}get depthMask(){return!!(this.data&1<<B)}set depthMask(t){!!(this.data&1<<B)!==t&&(this.data^=1<<B)}get clockwiseFrontFace(){return!!(this.data&1<<R)}set clockwiseFrontFace(t){!!(this.data&1<<R)!==t&&(this.data^=1<<R)}get blendMode(){return this._blendMode}set blendMode(t){this.blend=t!=="none",this._blendMode=t,this._blendModeId=zt[t]||0}get polygonOffset(){return this._polygonOffset}set polygonOffset(t){this.offsets=!!t,this._polygonOffset=t}toString(){return`[pixi.js/core:State blendMode=${this.blendMode} clockwiseFrontFace=${this.clockwiseFrontFace} culling=${this.culling} depthMask=${this.depthMask} polygonOffset=${this.polygonOffset}]`}static for2d(){const t=new ct;return t.depthTest=!1,t.blend=!0,t}};V.default2d=V.for2d();let Ot;ee=V;Ot=0;class Rt{constructor(t){this._poolKeyHash=Object.create(null),this._texturePool={},this.textureOptions=t||{},this.enableFullScreen=!1}createTexture(t,e,r){const n=new ht({...this.textureOptions,width:t,height:e,resolution:1,antialias:r,autoGarbageCollect:!0});return new pt({source:n,label:`texturePool_${Ot++}`})}getOptimalTexture(t,e,r=1,n){let s=Math.ceil(t*r-1e-6),a=Math.ceil(e*r-1e-6);s=X(s),a=X(a);const i=(s<<17)+(a<<1)+(n?1:0);this._texturePool[i]||(this._texturePool[i]=[]);let u=this._texturePool[i].pop();return u||(u=this.createTexture(s,a,n)),u.source._resolution=r,u.source.width=s/r,u.source.height=a/r,u.source.pixelWidth=s,u.source.pixelHeight=a,u.frame.x=0,u.frame.y=0,u.frame.width=t,u.frame.height=e,u.updateUvs(),this._poolKeyHash[u.uid]=i,u}getSameSizeTexture(t,e=!1){const r=t.source;return this.getOptimalTexture(t.width,t.height,r._resolution,e)}returnTexture(t){const e=this._poolKeyHash[t.uid];this._texturePool[e].push(t)}clear(t){if(t=t!==!1,t)for(const e in this._texturePool){const r=this._texturePool[e];if(r)for(let n=0;n<r.length;n++)r[n].destroy(!0)}this._texturePool={}}}re=new Rt;function Z(o,t,e){if(o)for(const r in o){const n=r.toLocaleLowerCase(),s=t[n];if(s){let a=o[r];r==="header"&&(a=a.replace(/@in\s+[^;]+;\s*/g,"").replace(/@out\s+[^;]+;\s*/g,"")),e&&s.push(`//----${e}----//`),s.push(a)}else gt(`${r} placement hook does not exist in shader`)}}const Bt=/\{\{(.*?)\}\}/g;function J(o){const t={};return(o.match(Bt)?.map(r=>r.replace(/[{()}]/g,""))??[]).forEach(r=>{t[r]=[]}),t}function Q(o,t){let e;const r=/@in\s+([^;]+);/g;for(;(e=r.exec(o))!==null;)t.push(e[1])}function tt(o,t,e=!1){const r=[];Q(t,r),o.forEach(i=>{i.header&&Q(i.header,r)});const n=r;e&&n.sort();const s=n.map((i,u)=>` @location(${u}) ${i},`).join(` ${o}`}function Gt(o,t){return t?o.replace("#version 300 es",""):o}const $={stripVersion:Gt,ensurePrecision:bt,addProgramDefines:vt,setProgramName:Mt,insertVersion:Pt},U=Object.create(null),ot=class L{constructor(t){t={...L.defaultOptions,...t};const e=t.fragment.indexOf("#version 300 es")!==-1,r={stripVersion:e,ensurePrecision:{requestedFragmentPrecision:t.preferredFragmentPrecision,requestedVertexPrecision:t.preferredVertexPrecision,maxSupportedVertexPrecision:"highp",maxSupportedFragmentPrecision:xt()},setProgramName:{name:t.name},addProgramDefines:e,insertVersion:e};let n=t.fragment,s=t.vertex;Object.keys($).forEach(a=>{const i=r[a];n=$[a](n,i,!0),s=$[a](s,i,!1)}),this.fragment=n,this.vertex=s,this._key=W(`${this.vertex}:${this.fragment}`,"gl-program")}destroy(){this.fragment=null,this.vertex=null,this._attributeData=null,this._uniformData=null,this._uniformBlockData=null,this.transformFeedbackVaryings=null}static from(t){const e=`${t.vertex}:${t.fragment}`;return U[e]||(U[e]=new L(t)),U[e]}};ot.defaultOptions={preferredVertexPrecision:"highp",preferredFragmentPrecision:"mediump"};nt=ot;const q={uint8x2:{size:2,stride:2,normalised:!1},uint8x4:{size:4,stride:4,normalised:!1},sint8x2:{size:2,stride:2,normalised:!1},sint8x4:{size:4,stride:4,normalised:!1},unorm8x2:{size:2,stride:2,normalised:!0},unorm8x4:{size:4,stride:4,normalised:!0},snorm8x2:{size:2,stride:2,normalised:!0},snorm8x4:{size:4,stride:4,normalised:!0},uint16x2:{size:2,stride:4,normalised:!1},uint16x4:{size:4,stride:8,normalised:!1},sint16x2:{size:2,stride:4,normalised:!1},sint16x4:{size:4,stride:8,normalised:!1},unorm16x2:{size:2,stride:4,normalised:!0},unorm16x4:{size:4,stride:8,normalised:!0},snorm16x2:{size:2,stride:4,normalised:!0},snorm16x4:{size:4,stride:8,normalised:!0},float16x2:{size:2,stride:4,normalised:!1},float16x4:{size:4,stride:8,normalised:!1},float32:{size:1,stride:4,normalised:!1},float32x2:{size:2,stride:8,normalised:!1},float32x3:{size:3,stride:12,normalised:!1},float32x4:{size:4,stride:16,normalised:!1},uint32:{size:1,stride:4,normalised:!1},uint32x2:{size:2,stride:8,normalised:!1},uint32x3:{size:3,stride:12,normalised:!1},uint32x4:{size:4,stride:16,normalised:!1},sint32:{size:1,stride:4,normalised:!1},sint32x2:{size:2,stride:8,normalised:!1},sint32x3:{size:3,stride:12,normalised:!1},sint32x4:{size:4,stride:16,normalised:!1}};St=function(o){return q[o]??q.float32};const Tt={f32:"float32","vec2<f32>":"float32x2","vec3<f32>":"float32x3","vec4<f32>":"float32x4",vec2f:"float32x2",vec3f:"float32x3",vec4f:"float32x4",i32:"sint32","vec2<i32>":"sint32x2","vec3<i32>":"sint32x3","vec4<i32>":"sint32x4",u32:"uint32","vec2<u32>":"uint32x2","vec3<u32>":"uint32x3","vec4<u32>":"uint32x4",bool:"uint32","vec2<bool>":"uint32x2","vec3<bool>":"uint32x3","vec4<bool>":"uint32x4"};function Ct({source:o,entryPoint:t}){const e={},r=o.indexOf(`fn ${t}`);if(r!==-1){const n=o.indexOf("->",r);if(n!==-1){const s=o.substring(r,n),a=/@location\((\d+)\)\s+([a-zA-Z0-9_]+)\s*:\s*([a-zA-Z0-9_<>]+)(?:,|\s|$)/g;let i;for(;(i=a.exec(s))!==null;){const u=Tt[i[3]]??"float32";e[i[2]]={location:parseInt(i[1],10),format:u,stride:St(u).stride,offset:0,instance:!1,start:0}}}}return e}function A(o){const t=/(^|[^/])@(group|binding)\(\d+\)[^;]+;/g,e=/@group\((\d+)\)/,r=/@binding\((\d+)\)/,n=/var(<[^>]+>)? (\w+)/,s=/:\s*(\w+)/,a=/struct\s+(\w+)\s*{([^}]+)}/g,i=/(\w+)\s*:\s*([\w\<\>]+)/g,u=/struct\s+(\w+)/,f=o.match(t)?.map(l=>({group:parseInt(l.match(e)[1],10),binding:parseInt(l.match(r)[1],10),name:l.match(n)[2],isUniform:l.match(n)[1]==="<uniform>",type:l.match(s)[1]}));if(!f)return{groups:[],structs:[]};const c=o.match(a)?.map(l=>{const d=l.match(u)[1],p=l.match(i).reduce((g,x)=>{const[v,b]=x.split(":");return g[v.trim()]=b.trim(),g},{});return p?{name:d,members:p}:null}).filter(({name:l})=>f.some(d=>d.type===l))??[];return{groups:f,structs:c}}var P=(o=>(o[o.VERTEX=1]="VERTEX",o[o.FRAGMENT=2]="FRAGMENT",o[o.COMPUTE=4]="COMPUTE",o))(P||{});function $t({groups:o}){const t=[];for(let e=0;e<o.length;e++){const r=o[e];t[r.group]||(t[r.group]=[]),r.isUniform?t[r.group].push({binding:r.binding,visibility:P.VERTEX|P.FRAGMENT,buffer:{type:"uniform"}}):r.type==="sampler"?t[r.group].push({binding:r.binding,visibility:P.FRAGMENT,sampler:{type:"filtering"}}):r.type==="texture_2d"&&t[r.group].push({binding:r.binding,visibility:P.FRAGMENT,texture:{sampleType:"float",viewDimension:"2d",multisampled:!1}})}return t}function Ut({groups:o}){const t=[];for(let e=0;e<o.length;e++){const r=o[e];t[r.group]||(t[r.group]={}),t[r.group][r.name]=r.binding}return t}function At(o,t){const e=new Set,r=new Set,n=[...o.structs,...t.structs].filter(a=>e.has(a.name)?!1:(e.add(a.name),!0)),s=[...o.groups,...t.groups].filter(a=>{const i=`${a.name}-${a.binding}`;return r.has(i)?!1:(r.add(i),!0)});return{structs:n,groups:s}}const E=Object.create(null);S=class{constructor(t){this._layoutKey=0;const{fragment:e,vertex:r,layout:n,gpuLayout:s,name:a}=t;if(this.name=a,this.fragment=e,this.vertex=r,e.source===r.source){const i=A(e.source);this.structsAndGroups=i}else{const i=A(r.source),u=A(e.source);this.structsAndGroups=At(i,u)}this.layout=n??Ut(this.structsAndGroups),this.gpuLayout=s??$t(this.structsAndGroups),this.autoAssignGlobalUniforms=this.layout[0]?.globalUniforms!==void 0,this.autoAssignLocalUniforms=this.layout[1]?.localUniforms!==void 0,this._generateProgramKey()}_generateProgramKey(){const{vertex:t,fragment:e}=this,r=t.source+e.source+t.entryPoint+e.entryPoint;this._layoutKey=W(r,"program")}get attributeData(){return this._attributeData??(this._attributeData=Ct(this.vertex)),this._attributeData}destroy(){this.gpuLayout=null,this.layout=null,this.structsAndGroups=null,this.fragment=null,this.vertex=null}static from(t){const e=`${t.vertex.source}:${t.fragment.source}:${t.fragment.entryPoint}:${t.vertex.entryPoint}`;return E[e]||(E[e]=new S(t)),E[e]}};const st=["f32","i32","vec2<f32>","vec3<f32>","vec4<f32>","mat2x2<f32>","mat3x3<f32>","mat4x4<f32>","mat3x2<f32>","mat4x2<f32>","mat2x3<f32>","mat4x3<f32>","mat2x4<f32>","mat3x4<f32>"],Et=st.reduce((o,t)=>(o[t]=!0,o),{});function wt(o,t){switch(o){case"f32":return 0;case"vec2<f32>":return new Float32Array(2*t);case"vec3<f32>":return new Float32Array(3*t);case"vec4<f32>":return new Float32Array(4*t);case"mat2x2<f32>":return new Float32Array([1,0,0,1]);case"mat3x3<f32>":return new Float32Array([1,0,0,0,1,0,0,0,1]);case"mat4x4<f32>":return new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}return null}const it=class at{constructor(t,e){this._touched=0,this.uid=K("uniform"),this._resourceType="uniformGroup",this._resourceId=K("resource"),this.isUniformGroup=!0,this._dirtyId=0,this.destroyed=!1,e={...at.defaultOptions,...e},this.uniformStructures=t;const r={};for(const n in t){const s=t[n];if(s.name=n,s.size=s.size??1,!Et[s.type])throw new Error(`Uniform type ${s.type} is not supported. Supported uniform types are: ${st.join(", ")}`);s.value??(s.value=wt(s.type,s.size)),r[n]=s.value}this.uniforms=r,this._dirtyId=1,this.ubo=e.ubo,this.isStatic=e.isStatic,this._signature=W(Object.keys(r).map(n=>`${n}-${t[n].type}`).join("-"),"uniform-group")}update(){this._dirtyId++}};it.defaultOptions={ubo:!1,isStatic:!1};Ft=it;H=(o=>(o[o.WEBGL=1]="WEBGL",o[o.WEBGPU=2]="WEBGPU",o[o.BOTH=3]="BOTH",o))(H||{});ut=class extends mt{constructor(t){super(),this._uniformBindMap=Object.create(null),this._ownedBindGroups=[];let{gpuProgram:e,glProgram:r,groups:n,resources:s,compatibleRenderers:a,groupMap:i}=t;this.gpuProgram=e,this.glProgram=r,a===void 0&&(a=0,e&&(a|=H.WEBGPU),r&&(a|=H.WEBGL)),this.compatibleRenderers=a;const u={};if(!s&&!n&&(s={}),s&&n)throw new Error("[Shader] Cannot have both resources and groups");if(!e&&n&&!i)throw new Error("[Shader] No group map or WebGPU shader provided - consider using resources instead.");if(!e&&n&&i)for(const f in i)for(const c in i[f]){const l=i[f][c];u[l]={group:f,binding:c,name:l}}else if(e&&n&&!i){const f=e.structsAndGroups.groups;i={},f.forEach(c=>{i[c.group]=i[c.group]||{},i[c.group][c.binding]=c.name,u[c.name]=c})}else if(s){if(e){const f=e.structsAndGroups.groups;i={},f.forEach(c=>{i[c.group]=i[c.group]||{},i[c.group][c.binding]=c.name,u[c.name]=c})}else{i={},n={99:new T},this._ownedBindGroups.push(n[99]);let f=0;for(const c in s)u[c]={group:99,binding:f,name:c},i[99]=i[99]||{},i[99][f]=c,f++}n={};for(const f in s){const c=f;let l=s[f];!l.source&&!l._resourceType&&(l=new Ft(l));const d=u[c];d&&(n[d.group]||(n[d.group]=new T,this._ownedBindGroups.push(n[d.group])),n[d.group].setResource(l,d.binding))}}this.groups=n,this._uniformBindMap=i,this.resources=this._buildResourceAccessor(n,u)}addResource(t,e,r){var n,s;(n=this._uniformBindMap)[e]||(n[e]={}),(s=this._uniformBindMap[e])[r]||(s[r]=t),this.groups[e]||(this.groups[e]=new T,this._ownedBindGroups.push(this.groups[e]))}_buildResourceAccessor(t,e){const r={};for(const n in e){const s=e[n];Object.defineProperty(r,s.name,{get(){return t[s.group].getResource(s.binding)},set(a){t[s.group].setResource(a,s.binding)}})}return r}destroy(t=!1){this.emit("destroy",this),t&&(this.gpuProgram?.destroy(),this.glProgram?.destroy()),this.gpuProgram=null,this.glProgram=null,this.removeAllListeners(),this._uniformBindMap=null,this._ownedBindGroups.forEach(e=>{e.destroy()}),this._ownedBindGroups=null,this.resources=null,this.groups=null}static from(t){const{gpu:e,gl:r,...n}=t;let s,a;return e&&(s=S.from(e)),r&&(a=nt.from(r)),new ut({gpuProgram:s,glProgram:a,...n})}};const zt={normal:0,add:1,multiply:2,screen:3,overlay:4,erase:5,"normal-npm":6,"add-npm":7,"screen-npm":8},w=0,F=1,z=2,O=3,B=4,R=5,V=class ct{constructor(){this.data=0,this.blendMode="normal",this.polygonOffset=0,this.blend=!0,this.depthMask=!0}get blend(){return!!(this.data&1<<w)}set blend(t){!!(this.data&1<<w)!==t&&(this.data^=1<<w)}get offsets(){return!!(this.data&1<<F)}set offsets(t){!!(this.data&1<<F)!==t&&(this.data^=1<<F)}set cullMode(t){if(t==="none"){this.culling=!1;return}this.culling=!0,this.clockwiseFrontFace=t==="front"}get cullMode(){return this.culling?this.clockwiseFrontFace?"front":"back":"none"}get culling(){return!!(this.data&1<<z)}set culling(t){!!(this.data&1<<z)!==t&&(this.data^=1<<z)}get depthTest(){return!!(this.data&1<<O)}set depthTest(t){!!(this.data&1<<O)!==t&&(this.data^=1<<O)}get depthMask(){return!!(this.data&1<<R)}set depthMask(t){!!(this.data&1<<R)!==t&&(this.data^=1<<R)}get clockwiseFrontFace(){return!!(this.data&1<<B)}set clockwiseFrontFace(t){!!(this.data&1<<B)!==t&&(this.data^=1<<B)}get blendMode(){return this._blendMode}set blendMode(t){this.blend=t!=="none",this._blendMode=t,this._blendModeId=zt[t]||0}get polygonOffset(){return this._polygonOffset}set polygonOffset(t){this.offsets=!!t,this._polygonOffset=t}toString(){return`[pixi.js/core:State blendMode=${this.blendMode} clockwiseFrontFace=${this.clockwiseFrontFace} culling=${this.culling} depthMask=${this.depthMask} polygonOffset=${this.polygonOffset}]`}static for2d(){const t=new ct;return t.depthTest=!1,t.blend=!0,t}};V.default2d=V.for2d();let Ot;ee=V;Ot=0;class Bt{constructor(t){this._poolKeyHash=Object.create(null),this._texturePool={},this.textureOptions=t||{},this.enableFullScreen=!1}createTexture(t,e,r){const n=new ht({...this.textureOptions,width:t,height:e,resolution:1,antialias:r,autoGarbageCollect:!0});return new pt({source:n,label:`texturePool_${Ot++}`})}getOptimalTexture(t,e,r=1,n){let s=Math.ceil(t*r-1e-6),a=Math.ceil(e*r-1e-6);s=X(s),a=X(a);const i=(s<<17)+(a<<1)+(n?1:0);this._texturePool[i]||(this._texturePool[i]=[]);let u=this._texturePool[i].pop();return u||(u=this.createTexture(s,a,n)),u.source._resolution=r,u.source.width=s/r,u.source.height=a/r,u.source.pixelWidth=s,u.source.pixelHeight=a,u.frame.x=0,u.frame.y=0,u.frame.width=t,u.frame.height=e,u.updateUvs(),this._poolKeyHash[u.uid]=i,u}getSameSizeTexture(t,e=!1){const r=t.source;return this.getOptimalTexture(t.width,t.height,r._resolution,e)}returnTexture(t){const e=this._poolKeyHash[t.uid];this._texturePool[e].push(t)}clear(t){if(t=t!==!1,t)for(const e in this._texturePool){const r=this._texturePool[e];if(r)for(let n=0;n<r.length;n++)r[n].destroy(!0)}this._texturePool={}}}re=new Bt;function Z(o,t,e){if(o)for(const r in o){const n=r.toLocaleLowerCase(),s=t[n];if(s){let a=o[r];r==="header"&&(a=a.replace(/@in\s+[^;]+;\s*/g,"").replace(/@out\s+[^;]+;\s*/g,"")),e&&s.push(`//----${e}----//`),s.push(a)}else gt(`${r} placement hook does not exist in shader`)}}const Rt=/\{\{(.*?)\}\}/g;function J(o){const t={};return(o.match(Rt)?.map(r=>r.replace(/[{()}]/g,""))??[]).forEach(r=>{t[r]=[]}),t}function Q(o,t){let e;const r=/@in\s+([^;]+);/g;for(;(e=r.exec(o))!==null;)t.push(e[1])}function tt(o,t,e=!1){const r=[];Q(t,r),o.forEach(i=>{i.header&&Q(i.header,r)});const n=r;e&&n.sort();const s=n.map((i,u)=>` @location(${u}) ${i},`).join(`
`);let a=t.replace(/@in\s+[^;]+;\s*/g,"");return a=a.replace("{{in}}",` `);let a=t.replace(/@in\s+[^;]+;\s*/g,"");return a=a.replace("{{in}}",`
${s} ${s}
`),a}function et(o,t){let e;const r=/@out\s+([^;]+);/g;for(;(e=r.exec(o))!==null;)t.push(e[1])}function jt(o){const e=/\b(\w+)\s*:/g.exec(o);return e?e[1]:""}function It(o){const t=/@.*?\s+/g;return o.replace(t,"")}function kt(o,t){const e=[];et(t,e),o.forEach(u=>{u.header&&et(u.header,e)});let r=0;const n=e.sort().map(u=>u.indexOf("builtin")>-1?u:`@location(${r++}) ${u}`).join(`, `),a}function et(o,t){let e;const r=/@out\s+([^;]+);/g;for(;(e=r.exec(o))!==null;)t.push(e[1])}function jt(o){const e=/\b(\w+)\s*:/g.exec(o);return e?e[1]:""}function It(o){const t=/@.*?\s+/g;return o.replace(t,"")}function kt(o,t){const e=[];et(t,e),o.forEach(u=>{u.header&&et(u.header,e)});let r=0;const n=e.sort().map(u=>u.indexOf("builtin")>-1?u:`@location(${r++}) ${u}`).join(`,
@@ -241,7 +241,7 @@ ${n.join(`
{ {
vPosition = vec4(roundPixels(vPosition.xy, globalUniforms.uResolution), vPosition.zw); vPosition = vec4(roundPixels(vPosition.xy, globalUniforms.uResolution), vPosition.zw);
} }
`}};fe={...D,vertex:{...D.vertex,header:D.vertex.header.replace("group(1)","group(2)")}};me={name:"local-uniform-bit",vertex:{header:` `}};fe={...D,vertex:{...D.vertex,header:D.vertex.header.replace("group(1)","group(2)")}};de={name:"local-uniform-bit",vertex:{header:`
uniform mat3 uTransformMatrix; uniform mat3 uTransformMatrix;
uniform vec4 uColor; uniform vec4 uColor;
@@ -254,4 +254,4 @@ ${n.join(`
{ {
gl_Position.xy = roundPixels(gl_Position.xy, uResolution); gl_Position.xy = roundPixels(gl_Position.xy, uResolution);
} }
`}};de=class{constructor(){this.vertexSize=4,this.indexSize=6,this.location=0,this.batcher=null,this.batch=null,this.roundPixels=0}get blendMode(){return this.renderable.groupBlendMode}packAttributes(t,e,r,n){const s=this.renderable,a=this.texture,i=s.groupTransform,u=i.a,f=i.b,c=i.c,l=i.d,m=i.tx,p=i.ty,g=this.bounds,x=g.maxX,v=g.minX,b=g.maxY,y=g.minY,d=a.uvs,_=s.groupColorAlpha,G=n<<16|this.roundPixels&65535;t[r+0]=u*v+c*y+m,t[r+1]=l*y+f*v+p,t[r+2]=d.x0,t[r+3]=d.y0,e[r+4]=_,e[r+5]=G,t[r+6]=u*x+c*y+m,t[r+7]=l*y+f*x+p,t[r+8]=d.x1,t[r+9]=d.y1,e[r+10]=_,e[r+11]=G,t[r+12]=u*x+c*b+m,t[r+13]=l*b+f*x+p,t[r+14]=d.x2,t[r+15]=d.y2,e[r+16]=_,e[r+17]=G,t[r+18]=u*v+c*b+m,t[r+19]=l*b+f*v+p,t[r+20]=d.x3,t[r+21]=d.y3,e[r+22]=_,e[r+23]=G}packIndex(t,e,r){t[e]=r+0,t[e+1]=r+1,t[e+2]=r+2,t[e+3]=r+0,t[e+4]=r+2,t[e+5]=r+3}reset(){this.renderable=null,this.texture=null,this.batcher=null,this.batch=null,this.bounds=null}};he=function(o,t,e){const r=(o>>24&255)/255;t[e++]=(o&255)/255*r,t[e++]=(o>>8&255)/255*r,t[e++]=(o>>16&255)/255*r,t[e++]=r}});export{de as B,S as G,H as R,ee as S,re as T,Ft as U,se as a,ut as b,oe as c,W as d,D as e,nt as f,ae as g,St as h,he as i,ne as j,ie as k,fe as l,ue as m,le as n,me as o,ce as r,__tla}; `}};me=class{constructor(){this.vertexSize=4,this.indexSize=6,this.location=0,this.batcher=null,this.batch=null,this.roundPixels=0}get blendMode(){return this.renderable.groupBlendMode}packAttributes(t,e,r,n){const s=this.renderable,a=this.texture,i=s.groupTransform,u=i.a,f=i.b,c=i.c,l=i.d,d=i.tx,p=i.ty,g=this.bounds,x=g.maxX,v=g.minX,b=g.maxY,y=g.minY,m=a.uvs,_=s.groupColorAlpha,M=n<<16|this.roundPixels&65535;t[r+0]=u*v+c*y+d,t[r+1]=l*y+f*v+p,t[r+2]=m.x0,t[r+3]=m.y0,e[r+4]=_,e[r+5]=M,t[r+6]=u*x+c*y+d,t[r+7]=l*y+f*x+p,t[r+8]=m.x1,t[r+9]=m.y1,e[r+10]=_,e[r+11]=M,t[r+12]=u*x+c*b+d,t[r+13]=l*b+f*x+p,t[r+14]=m.x2,t[r+15]=m.y2,e[r+16]=_,e[r+17]=M,t[r+18]=u*v+c*b+d,t[r+19]=l*b+f*v+p,t[r+20]=m.x3,t[r+21]=m.y3,e[r+22]=_,e[r+23]=M}packIndex(t,e,r){t[e]=r+0,t[e+1]=r+1,t[e+2]=r+2,t[e+3]=r+0,t[e+4]=r+2,t[e+5]=r+3}reset(){this.renderable=null,this.texture=null,this.batcher=null,this.batch=null,this.bounds=null}};he=function(o,t,e){const r=(o>>24&255)/255;t[e++]=(o&255)/255*r,t[e++]=(o>>8&255)/255*r,t[e++]=(o>>16&255)/255*r,t[e++]=r}});export{me as B,S as G,H as R,ee as S,re as T,Ft as U,se as a,ut as b,oe as c,W as d,D as e,nt as f,ae as g,St as h,he as i,ne as j,ie as k,fe as l,ue as m,le as n,de as o,ce as r,__tla};

View File

@@ -1 +1 @@
import{U as e,__tla as __tla_0}from"./colorToUniform-pFJ8sYB5.js";let a;let __tla=Promise.all([(()=>{try{return __tla_0}catch{}})()]).then(async()=>{const i={};a=function(r){let o=i[r];if(o)return o;const n=new Int32Array(r);for(let t=0;t<r;t++)n[t]=t;return o=i[r]=new e({uTextures:{value:n,type:"i32",size:r}},{isStatic:!0}),o}});export{a as g,__tla}; import{U as e,__tla as __tla_0}from"./colorToUniform-rMRo2qOn.js";let a;let __tla=Promise.all([(()=>{try{return __tla_0}catch{}})()]).then(async()=>{const i={};a=function(r){let o=i[r];if(o)return o;const n=new Int32Array(r);for(let t=0;t<r;t++)n[t]=t;return o=i[r]=new e({uTextures:{value:n,type:"i32",size:r}},{isStatic:!0}),o}});export{a as g,__tla};

View File

@@ -1 +1 @@
import{A as g,B as A}from"./vue-BQgCUbk_.js";var B="Expected a function",S=NaN,F="[object Symbol]",M=/^\s+|\s+$/g,N=/^[-+]0x[0-9a-f]+$/i,W=/^0b[01]+$/i,R=/^0o[0-7]+$/i,_=parseInt,D=typeof g=="object"&&g&&g.Object===Object&&g,G=typeof self=="object"&&self&&self.Object===Object&&self,P=D||G||Function("return this")(),H=Object.prototype,U=H.toString,X=Math.max,q=Math.min,T=function(){return P.Date.now()};function z(e,t,i){var a,s,l,c,r,f,u=0,x=!1,d=!1,y=!0;if(typeof e!="function")throw new TypeError(B);t=E(t)||0,v(i)&&(x=!!i.leading,d="maxWait"in i,l=d?X(E(i.maxWait)||0,t):l,y="trailing"in i?!!i.trailing:y);function p(n){var o=a,m=s;return a=s=void 0,u=n,c=e.apply(m,o),c}function k(n){return u=n,r=setTimeout(b,t),x?p(n):c}function C(n){var o=n-f,m=n-u,h=t-o;return d?q(h,l-m):h}function I(n){var o=n-f,m=n-u;return f===void 0||o>=t||o<0||d&&m>=l}function b(){var n=T();if(I(n))return O(n);r=setTimeout(b,C(n))}function O(n){return r=void 0,y&&a?p(n):(a=s=void 0,c)}function L(){r!==void 0&&clearTimeout(r),u=0,a=f=s=r=void 0}function $(){return r===void 0?c:O(T())}function j(){var n=T(),o=I(n);if(a=arguments,s=this,f=n,o){if(r===void 0)return k(f);if(d)return r=setTimeout(b,t),p(f)}return r===void 0&&(r=setTimeout(b,t)),c}return j.cancel=L,j.flush=$,j}function v(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function J(e){return!!e&&typeof e=="object"}function K(e){return typeof e=="symbol"||J(e)&&U.call(e)==F}function E(e){if(typeof e=="number")return e;if(K(e))return S;if(v(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=v(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=e.replace(M,"");var i=W.test(e);return i||R.test(e)?_(e.slice(2),i?2:8):N.test(e)?S:+e}var Q=z;const Y=A(Q);export{Y as d}; import{A as g,B as A}from"./vue-CfSjRv-x.js";var B="Expected a function",S=NaN,F="[object Symbol]",M=/^\s+|\s+$/g,N=/^[-+]0x[0-9a-f]+$/i,W=/^0b[01]+$/i,R=/^0o[0-7]+$/i,_=parseInt,D=typeof g=="object"&&g&&g.Object===Object&&g,G=typeof self=="object"&&self&&self.Object===Object&&self,P=D||G||Function("return this")(),H=Object.prototype,U=H.toString,X=Math.max,q=Math.min,T=function(){return P.Date.now()};function z(e,t,i){var a,s,l,c,r,f,u=0,x=!1,d=!1,y=!0;if(typeof e!="function")throw new TypeError(B);t=E(t)||0,v(i)&&(x=!!i.leading,d="maxWait"in i,l=d?X(E(i.maxWait)||0,t):l,y="trailing"in i?!!i.trailing:y);function p(n){var o=a,m=s;return a=s=void 0,u=n,c=e.apply(m,o),c}function k(n){return u=n,r=setTimeout(b,t),x?p(n):c}function C(n){var o=n-f,m=n-u,h=t-o;return d?q(h,l-m):h}function I(n){var o=n-f,m=n-u;return f===void 0||o>=t||o<0||d&&m>=l}function b(){var n=T();if(I(n))return O(n);r=setTimeout(b,C(n))}function O(n){return r=void 0,y&&a?p(n):(a=s=void 0,c)}function L(){r!==void 0&&clearTimeout(r),u=0,a=f=s=r=void 0}function $(){return r===void 0?c:O(T())}function j(){var n=T(),o=I(n);if(a=arguments,s=this,f=n,o){if(r===void 0)return k(f);if(d)return r=setTimeout(b,t),p(f)}return r===void 0&&(r=setTimeout(b,t)),c}return j.cancel=L,j.flush=$,j}function v(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function J(e){return!!e&&typeof e=="object"}function K(e){return typeof e=="symbol"||J(e)&&U.call(e)==F}function E(e){if(typeof e=="number")return e;if(K(e))return S;if(v(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=v(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=e.replace(M,"");var i=W.test(e);return i||R.test(e)?_(e.slice(2),i?2:8):N.test(e)?S:+e}var Q=z;const Y=A(Q);export{Y as d};

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -1,5 +0,0 @@
import{w as B,o as rn,e as on,s as P,F as mt,r as O,c as y,a as J,t as gt,b as ht,i as sn,C as an,d as yt,u as U,f as I,p as Z,g as S,h as un,j as cn,k as pt,l as ln,m as fn,n as E,q as dn,v as vt,x as me,y as mn,z as gn}from"./vue-BQgCUbk_.js";function hn(e,t){let n;function r(){n=on(),n.run(()=>t.length?t(()=>{n?.stop(),r()}):t())}B(e,o=>{o&&!n?r():o||(n?.stop(),n=void 0)},{immediate:!0}),rn(()=>{n?.stop()})}const D=typeof window<"u",wo=D&&"IntersectionObserver"in window,yn=D&&("ontouchstart"in window||window.navigator.maxTouchPoints>0),Do=D&&"EyeDropper"in window;function Le(e,t,n){pn(e,t),t.set(e,n)}function pn(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function vn(e,t,n){return e.set(bt(e,t),n),n}function R(e,t){return e.get(bt(e,t))}function bt(e,t,n){if(typeof e=="function"?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}function wt(e,t,n){const r=t.length-1;if(r<0)return e===void 0?n:e;for(let o=0;o<r;o++){if(e==null)return n;e=e[t[o]]}return e==null||e[t[r]]===void 0?n:e[t[r]]}function bn(e,t){if(e===t)return!0;if(e instanceof Date&&t instanceof Date&&e.getTime()!==t.getTime()||e!==Object(e)||t!==Object(t))return!1;const n=Object.keys(e);return n.length!==Object.keys(t).length?!1:n.every(r=>bn(e[r],t[r]))}function Se(e,t,n){return e==null||!t||typeof t!="string"?n:e[t]!==void 0?e[t]:(t=t.replace(/\[(\w+)\]/g,".$1"),t=t.replace(/^\./,""),wt(e,t.split("."),n))}function So(e,t,n){if(t===!0)return e===void 0?n:e;if(t==null||typeof t=="boolean")return n;if(e!==Object(e)){if(typeof t!="function")return n;const o=t(e,n);return typeof o>"u"?n:o}if(typeof t=="string")return Se(e,t,n);if(Array.isArray(t))return wt(e,t,n);if(typeof t!="function")return n;const r=t(e,n);return typeof r>"u"?n:r}function Dt(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return Array.from({length:e},(n,r)=>t+r)}function ne(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"px";if(!(e==null||e===""))return isNaN(+e)?String(e):isFinite(+e)?`${Number(e)}${t}`:void 0}function Ne(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function St(e){if(e&&"$el"in e){const t=e.$el;return t?.nodeType===Node.TEXT_NODE?t.nextElementSibling:t}return e}const xo=Object.freeze({enter:13,tab:9,delete:46,esc:27,space:32,up:38,down:40,left:37,right:39,end:35,home:36,del:46,backspace:8,insert:45,pageup:33,pagedown:34,shift:16}),Co=Object.freeze({enter:"Enter",tab:"Tab",delete:"Delete",esc:"Escape",space:"Space",up:"ArrowUp",down:"ArrowDown",left:"ArrowLeft",right:"ArrowRight",end:"End",home:"Home",del:"Delete",backspace:"Backspace",insert:"Insert",pageup:"PageUp",pagedown:"PageDown",shift:"Shift"});function To(e){return Object.keys(e)}function be(e,t){return t.every(n=>e.hasOwnProperty(n))}function wn(e,t){const n={},r=new Set(Object.keys(e));for(const o of t)r.has(o)&&(n[o]=e[o]);return n}function Be(e,t,n){const r=Object.create(null),o=Object.create(null);for(const s in e)t.some(a=>a instanceof RegExp?a.test(s):a===s)&&!n?.some(a=>a===s)?r[s]=e[s]:o[s]=e[s];return[r,o]}function Dn(e,t){const n={...e};return t.forEach(r=>delete n[r]),n}function Mo(e,t){const n={};return t.forEach(r=>n[r]=e[r]),n}const xt=/^on[^a-z]/,Ae=e=>xt.test(e),Sn=["onAfterscriptexecute","onAnimationcancel","onAnimationend","onAnimationiteration","onAnimationstart","onAuxclick","onBeforeinput","onBeforescriptexecute","onChange","onClick","onCompositionend","onCompositionstart","onCompositionupdate","onContextmenu","onCopy","onCut","onDblclick","onFocusin","onFocusout","onFullscreenchange","onFullscreenerror","onGesturechange","onGestureend","onGesturestart","onGotpointercapture","onInput","onKeydown","onKeypress","onKeyup","onLostpointercapture","onMousedown","onMousemove","onMouseout","onMouseover","onMouseup","onMousewheel","onPaste","onPointercancel","onPointerdown","onPointerenter","onPointerleave","onPointermove","onPointerout","onPointerover","onPointerup","onReset","onSelect","onSubmit","onTouchcancel","onTouchend","onTouchmove","onTouchstart","onTransitioncancel","onTransitionend","onTransitionrun","onTransitionstart","onWheel"],xn=["ArrowUp","ArrowDown","ArrowRight","ArrowLeft","Enter","Escape","Tab"," "];function ko(e){return e.isComposing&&xn.includes(e.key)}function Ao(e){const[t,n]=Be(e,[xt]),r=Dn(t,Sn),[o,s]=Be(n,["class","style","id",/^data-/]);return Object.assign(o,t),Object.assign(s,r),[o,s]}function Oo(e){return e==null?[]:Array.isArray(e)?e:[e]}function Eo(e,t){let n=0;const r=function(){for(var o=arguments.length,s=new Array(o),a=0;a<o;a++)s[a]=arguments[a];clearTimeout(n),n=setTimeout(()=>e(...s),U(t))};return r.clear=()=>{clearTimeout(n)},r.immediate=e,r}function Ct(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1;return Math.max(t,Math.min(n,e))}function Fo(e){const t=e.toString().trim();return t.includes(".")?t.length-t.indexOf(".")-1:0}function He(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"0";return e+n.repeat(Math.max(0,t-e.length))}function Ye(e,t){return(arguments.length>2&&arguments[2]!==void 0?arguments[2]:"0").repeat(Math.max(0,t-e.length))+e}function Cn(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;const n=[];let r=0;for(;r<e.length;)n.push(e.substr(r,t)),r+=t;return n}function Po(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1e3;if(e<t)return`${e} B`;const n=t===1024?["Ki","Mi","Gi"]:["k","M","G"];let r=-1;for(;Math.abs(e)>=t&&r<n.length-1;)e/=t,++r;return`${e.toFixed(1)} ${n[r]}B`}function w(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;const r={};for(const o in e)r[o]=e[o];for(const o in t){const s=e[o],a=t[o];if(Ne(s)&&Ne(a)){r[o]=w(s,a,n);continue}if(Array.isArray(s)&&Array.isArray(a)&&n){r[o]=n(s,a);continue}r[o]=a}return r}function Tn(e){return e.map(t=>t.type===mt?Tn(t.children):t).flat()}function N(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";if(N.cache.has(e))return N.cache.get(e);const t=e.replace(/[^a-z]/gi,"-").replace(/\B([A-Z])/g,"-$1").toLowerCase();return N.cache.set(e,t),t}N.cache=new Map;function X(e,t){if(!t||typeof t!="object")return[];if(Array.isArray(t))return t.map(n=>X(e,n)).flat(1);if(t.suspense)return X(e,t.ssContent);if(Array.isArray(t.children))return t.children.map(n=>X(e,n)).flat(1);if(t.component){if(Object.getOwnPropertySymbols(t.component.provides).includes(e))return[t.component];if(t.component.subTree)return X(e,t.component.subTree).flat(1)}return[]}var re=new WeakMap,V=new WeakMap;class Io{constructor(t){Le(this,re,[]),Le(this,V,0),this.size=t}push(t){R(re,this)[R(V,this)]=t,vn(V,this,(R(V,this)+1)%this.size)}values(){return R(re,this).slice(R(V,this)).concat(R(re,this).slice(0,R(V,this)))}}function $o(e){return"touches"in e?{clientX:e.touches[0].clientX,clientY:e.touches[0].clientY}:{clientX:e.clientX,clientY:e.clientY}}function Ro(e){const t=O({}),n=y(e);return J(()=>{for(const r in n.value)t[r]=n.value[r]},{flush:"sync"}),gt(t)}function xe(e,t){return e.includes(t)}function Tt(e){return e[2].toLowerCase()+e.slice(3)}const Lo=()=>[Function,Array];function No(e,t){return t="on"+ht(t),!!(e[t]||e[`${t}Once`]||e[`${t}Capture`]||e[`${t}OnceCapture`]||e[`${t}CaptureOnce`])}function Bo(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];if(Array.isArray(e))for(const o of e)o(...n);else typeof e=="function"&&e(...n)}function Mn(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;const n=["button","[href]",'input:not([type="hidden"])',"select","textarea","[tabindex]"].map(r=>`${r}${t?':not([tabindex="-1"])':""}:not([disabled])`).join(", ");return[...e.querySelectorAll(n)]}function kn(e,t,n){let r,o=e.indexOf(document.activeElement);const s=t==="next"?1:-1;do o+=s,r=e[o];while((!r||r.offsetParent==null||!(n?.(r)??!0))&&o<e.length&&o>=0);return r}function An(e,t){const n=Mn(e);if(!t)(e===document.activeElement||!e.contains(document.activeElement))&&n[0]?.focus();else if(t==="first")n[0]?.focus();else if(t==="last")n.at(-1)?.focus();else if(typeof t=="number")n[t]?.focus();else{const r=kn(n,t);r?r.focus():An(e,t==="next"?"first":"last")}}function Ho(e){return e==null||typeof e=="string"&&e.trim()===""}function Yo(){}function Vo(e,t){if(!(D&&typeof CSS<"u"&&typeof CSS.supports<"u"&&CSS.supports(`selector(${t})`)))return null;try{return!!e&&e.matches(t)}catch{return null}}function On(e){return e.some(t=>sn(t)?t.type===an?!1:t.type!==mt||On(t.children):!0)?e:null}function Wo(e,t){if(!D||e===0)return t(),()=>{};const n=window.setTimeout(t,e);return()=>window.clearTimeout(n)}function Ve(e,t){const n=P();return J(()=>{n.value=e()},{flush:"sync",...t}),yt(n)}function jo(e,t){const n=e.clientX,r=e.clientY,o=t.getBoundingClientRect(),s=o.left,a=o.top,i=o.right,u=o.bottom;return n>=s&&n<=i&&r>=a&&r<=u}function En(){const e=P(),t=n=>{e.value=n};return Object.defineProperty(t,"value",{enumerable:!0,get:()=>e.value,set:n=>e.value=n}),Object.defineProperty(t,"el",{enumerable:!0,get:()=>St(e.value)}),t}const Mt=["top","bottom"],Fn=["start","end","left","right"];function Uo(e,t){let[n,r]=e.split(" ");return r||(r=xe(Mt,n)?"start":xe(Fn,n)?"top":"center"),{side:We(n,t),align:We(r,t)}}function We(e,t){return e==="start"?t?"right":"left":e==="end"?t?"left":"right":e}function zo(e){return{side:{center:"center",top:"bottom",bottom:"top",left:"right",right:"left"}[e.side],align:e.align}}function Go(e){return{side:e.side,align:{center:"center",top:"bottom",bottom:"top",left:"right",right:"left"}[e.align]}}function Zo(e){return{side:e.align,align:e.side}}function Ko(e){return xe(Mt,e.side)?"y":"x"}class ie{constructor(t){let{x:n,y:r,width:o,height:s}=t;this.x=n,this.y=r,this.width=o,this.height=s}get top(){return this.y}get bottom(){return this.y+this.height}get left(){return this.x}get right(){return this.x+this.width}}function _o(e,t){return{x:{before:Math.max(0,t.left-e.left),after:Math.max(0,e.right-t.right)},y:{before:Math.max(0,t.top-e.top),after:Math.max(0,e.bottom-t.bottom)}}}function Xo(e){return Array.isArray(e)?new ie({x:e[0],y:e[1],width:0,height:0}):e.getBoundingClientRect()}function Qo(e){const t=e.getBoundingClientRect(),n=getComputedStyle(e),r=n.transform;if(r){let o,s,a,i,u;if(r.startsWith("matrix3d("))o=r.slice(9,-1).split(/, /),s=+o[0],a=+o[5],i=+o[12],u=+o[13];else if(r.startsWith("matrix("))o=r.slice(7,-1).split(/, /),s=+o[0],a=+o[3],i=+o[4],u=+o[5];else return new ie(t);const c=n.transformOrigin,l=t.x-i-(1-s)*parseFloat(c),f=t.y-u-(1-a)*parseFloat(c.slice(c.indexOf(" ")+1)),g=s?t.width/s:e.offsetWidth+1,h=a?t.height/a:e.offsetHeight+1;return new ie({x:l,y:f,width:g,height:h})}else return new ie(t)}function qo(e,t,n){if(typeof e.animate>"u")return{finished:Promise.resolve()};let r;try{r=e.animate(t,n)}catch{return{finished:Promise.resolve()}}return typeof r.finished>"u"&&(r.finished=new Promise(o=>{r.onfinish=()=>{o(r)}})),r}const ue=new WeakMap;function Jo(e,t){Object.keys(t).forEach(n=>{if(Ae(n)){const r=Tt(n),o=ue.get(e);if(t[n]==null)o?.forEach(s=>{const[a,i]=s;a===r&&(e.removeEventListener(r,i),o.delete(s))});else if(!o||![...o].some(s=>s[0]===r&&s[1]===t[n])){e.addEventListener(r,t[n]);const s=o||new Set;s.add([r,t[n]]),ue.has(e)||ue.set(e,s)}}else t[n]==null?e.removeAttribute(n):e.setAttribute(n,t[n])})}function es(e,t){Object.keys(t).forEach(n=>{if(Ae(n)){const r=Tt(n),o=ue.get(e);o?.forEach(s=>{const[a,i]=s;a===r&&(e.removeEventListener(r,i),o.delete(s))})}else e.removeAttribute(n)})}const W=2.4,je=.2126729,Ue=.7151522,ze=.072175,Pn=.55,In=.58,$n=.57,Rn=.62,oe=.03,Ge=1.45,Ln=5e-4,Nn=1.25,Bn=1.25,Ze=.078,Ke=12.82051282051282,se=.06,_e=.001;function Xe(e,t){const n=(e.r/255)**W,r=(e.g/255)**W,o=(e.b/255)**W,s=(t.r/255)**W,a=(t.g/255)**W,i=(t.b/255)**W;let u=n*je+r*Ue+o*ze,c=s*je+a*Ue+i*ze;if(u<=oe&&(u+=(oe-u)**Ge),c<=oe&&(c+=(oe-c)**Ge),Math.abs(c-u)<Ln)return 0;let l;if(c>u){const f=(c**Pn-u**In)*Nn;l=f<_e?0:f<Ze?f-f*Ke*se:f-se}else{const f=(c**Rn-u**$n)*Bn;l=f>-_e?0:f>-Ze?f-f*Ke*se:f+se}return l*100}function ts(e){}function ns(e,t){t=Array.isArray(t)?t.slice(0,-1).map(n=>`'${n}'`).join(", ")+` or '${t.at(-1)}'`:`'${t}'`}const le=.20689655172413793,Hn=e=>e>le**3?Math.cbrt(e):e/(3*le**2)+4/29,Yn=e=>e>le?e**3:3*le**2*(e-4/29);function kt(e){const t=Hn,n=t(e[1]);return[116*n-16,500*(t(e[0]/.95047)-n),200*(n-t(e[2]/1.08883))]}function At(e){const t=Yn,n=(e[0]+16)/116;return[t(n+e[1]/500)*.95047,t(n),t(n-e[2]/200)*1.08883]}const Vn=[[3.2406,-1.5372,-.4986],[-.9689,1.8758,.0415],[.0557,-.204,1.057]],Wn=e=>e<=.0031308?e*12.92:1.055*e**(1/2.4)-.055,jn=[[.4124,.3576,.1805],[.2126,.7152,.0722],[.0193,.1192,.9505]],Un=e=>e<=.04045?e/12.92:((e+.055)/1.055)**2.4;function Ot(e){const t=Array(3),n=Wn,r=Vn;for(let o=0;o<3;++o)t[o]=Math.round(Ct(n(r[o][0]*e[0]+r[o][1]*e[1]+r[o][2]*e[2]))*255);return{r:t[0],g:t[1],b:t[2]}}function Oe(e){let{r:t,g:n,b:r}=e;const o=[0,0,0],s=Un,a=jn;t=s(t/255),n=s(n/255),r=s(r/255);for(let i=0;i<3;++i)o[i]=a[i][0]*t+a[i][1]*n+a[i][2]*r;return o}function zn(e){return!!e&&/^(#|var\(--|(rgb|hsl)a?\()/.test(e)}function rs(e){return zn(e)&&!/^((rgb|hsl)a?\()?var\(--/.test(e)}const Qe=/^(?<fn>(?:rgb|hsl)a?)\((?<values>.+)\)/,Gn={rgb:(e,t,n,r)=>({r:e,g:t,b:n,a:r}),rgba:(e,t,n,r)=>({r:e,g:t,b:n,a:r}),hsl:(e,t,n,r)=>qe({h:e,s:t,l:n,a:r}),hsla:(e,t,n,r)=>qe({h:e,s:t,l:n,a:r}),hsv:(e,t,n,r)=>H({h:e,s:t,v:n,a:r}),hsva:(e,t,n,r)=>H({h:e,s:t,v:n,a:r})};function F(e){if(typeof e=="number")return{r:(e&16711680)>>16,g:(e&65280)>>8,b:e&255};if(typeof e=="string"&&Qe.test(e)){const{groups:t}=e.match(Qe),{fn:n,values:r}=t,o=r.split(/,\s*/).map(s=>s.endsWith("%")&&["hsl","hsla","hsv","hsva"].includes(n)?parseFloat(s)/100:parseFloat(s));return Gn[n](...o)}else if(typeof e=="string"){let t=e.startsWith("#")?e.slice(1):e;return[3,4].includes(t.length)?t=t.split("").map(n=>n+n).join(""):[6,8].includes(t.length),Pt(t)}else if(typeof e=="object"){if(be(e,["r","g","b"]))return e;if(be(e,["h","s","l"]))return H(Et(e));if(be(e,["h","s","v"]))return H(e)}throw new TypeError(`Invalid color: ${e==null?e:String(e)||e.constructor.name}
Expected #hex, #hexa, rgb(), rgba(), hsl(), hsla(), object or number`)}function H(e){const{h:t,s:n,v:r,a:o}=e,s=i=>{const u=(i+t/60)%6;return r-r*n*Math.max(Math.min(u,4-u,1),0)},a=[s(5),s(3),s(1)].map(i=>Math.round(i*255));return{r:a[0],g:a[1],b:a[2],a:o}}function qe(e){return H(Et(e))}function Zn(e){if(!e)return{h:0,s:1,v:1,a:1};const t=e.r/255,n=e.g/255,r=e.b/255,o=Math.max(t,n,r),s=Math.min(t,n,r);let a=0;o!==s&&(o===t?a=60*(0+(n-r)/(o-s)):o===n?a=60*(2+(r-t)/(o-s)):o===r&&(a=60*(4+(t-n)/(o-s)))),a<0&&(a=a+360);const i=o===0?0:(o-s)/o,u=[a,i,o];return{h:u[0],s:u[1],v:u[2],a:e.a}}function os(e){const{h:t,s:n,v:r,a:o}=e,s=r-r*n/2,a=s===1||s===0?0:(r-s)/Math.min(s,1-s);return{h:t,s:a,l:s,a:o}}function Et(e){const{h:t,s:n,l:r,a:o}=e,s=r+n*Math.min(r,1-r),a=s===0?0:2-2*r/s;return{h:t,s:a,v:s,a:o}}function Kn(e){let{r:t,g:n,b:r,a:o}=e;return o===void 0?`rgb(${t}, ${n}, ${r})`:`rgba(${t}, ${n}, ${r}, ${o})`}function ss(e){return Kn(H(e))}function ae(e){const t=Math.round(e).toString(16);return("00".substr(0,2-t.length)+t).toUpperCase()}function Ft(e){let{r:t,g:n,b:r,a:o}=e;return`#${[ae(t),ae(n),ae(r),o!==void 0?ae(Math.round(o*255)):""].join("")}`}function Pt(e){e=_n(e);let[t,n,r,o]=Cn(e,2).map(s=>parseInt(s,16));return o=o===void 0?o:o/255,{r:t,g:n,b:r,a:o}}function as(e){const t=Pt(e);return Zn(t)}function is(e){return Ft(H(e))}function _n(e){return e.startsWith("#")&&(e=e.slice(1)),e=e.replace(/([^0-9a-f])/gi,"F"),(e.length===3||e.length===4)&&(e=e.split("").map(t=>t+t).join("")),e.length!==6&&(e=He(He(e,6),8,"F")),e}function Xn(e,t){const n=kt(Oe(e));return n[0]=n[0]+t*10,Ot(At(n))}function Qn(e,t){const n=kt(Oe(e));return n[0]=n[0]-t*10,Ot(At(n))}function Ce(e){const t=F(e);return Oe(t)[1]}function us(e,t){const n=Ce(e),r=Ce(t),o=Math.max(n,r),s=Math.min(n,r);return(o+.05)/(s+.05)}function qn(e){const t=Math.abs(Xe(F(0),F(e)));return Math.abs(Xe(F(16777215),F(e)))>Math.min(t,50)?"#fff":"#000"}function Y(e,t){return n=>Object.keys(e).reduce((r,o)=>{const a=typeof e[o]=="object"&&e[o]!=null&&!Array.isArray(e[o])?e[o]:{type:e[o]};return n&&o in n?r[o]={...a,default:n[o]}:r[o]=a,t&&!r[o].source&&(r[o].source=t),r},{})}const Jn=Y({class:[String,Array,Object],style:{type:[String,Array,Object],default:null}},"component"),z=Symbol.for("vuetify:defaults");function er(e){return I(e)}function Ee(){const e=S(z);if(!e)throw new Error("[Vuetify] Could not find defaults instance");return e}function cs(e,t){const n=Ee(),r=I(e),o=y(()=>{if(U(t?.disabled))return n.value;const a=U(t?.scoped),i=U(t?.reset),u=U(t?.root);if(r.value==null&&!(a||i||u))return n.value;let c=w(r.value,{prev:n.value});if(a)return c;if(i||u){const l=Number(i||1/0);for(let f=0;f<=l&&!(!c||!("prev"in c));f++)c=c.prev;return c&&typeof u=="string"&&u in c&&(c=w(w(c,{prev:c}),c[u])),c}return c.prev?w(c.prev,c):c});return Z(z,o),o}function tr(e,t){return typeof e.props?.[t]<"u"||typeof e.props?.[N(t)]<"u"}function nr(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Ee();const r=k("useDefaults");if(t=t??r.type.name??r.type.__name,!t)throw new Error("[Vuetify] Could not determine component name");const o=y(()=>n.value?.[e._as??t]),s=new Proxy(e,{get(u,c){const l=Reflect.get(u,c);return c==="class"||c==="style"?[o.value?.[c],l].filter(f=>f!=null):typeof c=="string"&&!tr(r.vnode,c)?o.value?.[c]!==void 0?o.value?.[c]:n.value?.global?.[c]!==void 0?n.value?.global?.[c]:l:l}}),a=P();J(()=>{if(o.value){const u=Object.entries(o.value).filter(c=>{let[l]=c;return l.startsWith(l[0].toUpperCase())});a.value=u.length?Object.fromEntries(u):void 0}else a.value=void 0});function i(){const u=sr(z,r);Z(z,y(()=>a.value?w(u?.value??{},a.value):u?.value))}return{props:s,provideSubDefaults:i}}function ee(e){if(e._setup=e._setup??e.setup,!e.name)return e;if(e._setup){e.props=Y(e.props??{},e.name)();const t=Object.keys(e.props).filter(n=>n!=="class"&&n!=="style");e.filterProps=function(r){return wn(r,t)},e.props._as=String,e.setup=function(r,o){const s=Ee();if(!s.value)return e._setup(r,o);const{props:a,provideSubDefaults:i}=nr(r,r._as??e.name,s),u=e._setup(a,o);return i(),u}}return e}function It(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;return t=>(e?ee:un)(t)}function ls(e,t){return t.props=e,t}function fs(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"div",n=arguments.length>2?arguments[2]:void 0;return It()({name:n??ht(cn(e.replace(/__/g,"-"))),props:{tag:{type:String,default:t},...Jn()},setup(r,o){let{slots:s}=o;return()=>pt(r.tag,{class:[e,r.class],style:r.style},s.default?.())}})}function ds(e){if(typeof e.getRootNode!="function"){for(;e.parentNode;)e=e.parentNode;return e!==document?null:document}const t=e.getRootNode();return t!==document&&t.getRootNode({composed:!0})!==document?null:t}const ms="cubic-bezier(0.4, 0, 0.2, 1)",gs="cubic-bezier(0.0, 0, 0.2, 1)",hs="cubic-bezier(0.4, 0, 1, 1)";function ys(e,t,n){return Object.keys(e).filter(r=>Ae(r)&&r.endsWith(t)).reduce((r,o)=>(r[o.slice(0,-t.length)]=s=>e[o](s,n(s)),r),{})}function k(e,t){const n=ln();if(!n)throw new Error(`[Vuetify] ${e} must be called from inside a setup function`);return n}function rr(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"composables";const t=k(e).type;return N(t?.aliasName||t?.name)}let $t=0,ce=new WeakMap;function Fe(){const e=k("getUid");if(ce.has(e))return ce.get(e);{const t=$t++;return ce.set(e,t),t}}Fe.reset=()=>{$t=0,ce=new WeakMap};function ps(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;for(;e;){if(t?or(e):Rt(e))return e;e=e.parentElement}return document.scrollingElement}function vs(e,t){const n=[];if(t&&e&&!t.contains(e))return n;for(;e&&(Rt(e)&&n.push(e),e!==t);)e=e.parentElement;return n}function Rt(e){if(!e||e.nodeType!==Node.ELEMENT_NODE)return!1;const t=window.getComputedStyle(e);return t.overflowY==="scroll"||t.overflowY==="auto"&&e.scrollHeight>e.clientHeight}function or(e){if(!e||e.nodeType!==Node.ELEMENT_NODE)return!1;const t=window.getComputedStyle(e);return["scroll","auto"].includes(t.overflowY)}function sr(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:k("injectSelf");const{provides:n}=t;if(n&&e in n)return n[e]}function bs(e){for(;e;){if(window.getComputedStyle(e).position==="fixed")return!0;e=e.offsetParent}return!1}function ws(e){const t=k("useRender");t.render=e}function ar(e,t,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:f=>f,o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:f=>f;const s=k("useProxiedModel"),a=I(e[t]!==void 0?e[t]:n),i=N(t),c=i!==t?y(()=>(e[t],!!((s.vnode.props?.hasOwnProperty(t)||s.vnode.props?.hasOwnProperty(i))&&(s.vnode.props?.hasOwnProperty(`onUpdate:${t}`)||s.vnode.props?.hasOwnProperty(`onUpdate:${i}`))))):y(()=>(e[t],!!(s.vnode.props?.hasOwnProperty(t)&&s.vnode.props?.hasOwnProperty(`onUpdate:${t}`))));hn(()=>!c.value,()=>{B(()=>e[t],f=>{a.value=f})});const l=y({get(){const f=e[t];return r(c.value?f:a.value)},set(f){const g=o(f),h=fn(c.value?e[t]:a.value);h===g||r(h)===f||(a.value=g,s?.emit(`update:${t}`,g))}});return Object.defineProperty(l,"externalValue",{get:()=>c.value?e[t]:a.value}),l}const ir={badge:"Badge",open:"Open",close:"Close",dismiss:"Dismiss",confirmEdit:{ok:"OK",cancel:"Cancel"},dataIterator:{noResultsText:"No matching records found",loadingText:"Loading items..."},dataTable:{itemsPerPageText:"Rows per page:",ariaLabel:{sortDescending:"Sorted descending.",sortAscending:"Sorted ascending.",sortNone:"Not sorted.",activateNone:"Activate to remove sorting.",activateDescending:"Activate to sort descending.",activateAscending:"Activate to sort ascending."},sortBy:"Sort by"},dataFooter:{itemsPerPageText:"Items per page:",itemsPerPageAll:"All",nextPage:"Next page",prevPage:"Previous page",firstPage:"First page",lastPage:"Last page",pageText:"{0}-{1} of {2}"},dateRangeInput:{divider:"to"},datePicker:{itemsSelected:"{0} selected",range:{title:"Select dates",header:"Enter dates"},title:"Select date",header:"Enter date",input:{placeholder:"Enter date"}},noDataText:"No data available",carousel:{prev:"Previous visual",next:"Next visual",ariaLabel:{delimiter:"Carousel slide {0} of {1}"}},calendar:{moreEvents:"{0} more",today:"Today"},input:{clear:"Clear {0}",prependAction:"{0} prepended action",appendAction:"{0} appended action",otp:"Please enter OTP character {0}"},fileInput:{counter:"{0} files",counterSize:"{0} files ({1} in total)"},timePicker:{am:"AM",pm:"PM",title:"Select Time"},pagination:{ariaLabel:{root:"Pagination Navigation",next:"Next page",previous:"Previous page",page:"Go to page {0}",currentPage:"Page {0}, Current page",first:"First page",last:"Last page"}},stepper:{next:"Next",prev:"Previous"},rating:{ariaLabel:{item:"Rating {0} of {1}"}},loading:"Loading...",infiniteScroll:{loadMore:"Load more",empty:"No more"}},Je="$vuetify.",et=(e,t)=>e.replace(/\{(\d+)\}/g,(n,r)=>String(t[+r])),Lt=(e,t,n)=>function(r){for(var o=arguments.length,s=new Array(o>1?o-1:0),a=1;a<o;a++)s[a-1]=arguments[a];if(!r.startsWith(Je))return et(r,s);const i=r.replace(Je,""),u=e.value&&n.value[e.value],c=t.value&&n.value[t.value];let l=Se(u,i,null);return l||(`${r}${e.value}`,l=Se(c,i,null)),l||(l=r),typeof l!="string"&&(l=r),et(l,s)};function Nt(e,t){return(n,r)=>new Intl.NumberFormat([e.value,t.value],r).format(n)}function we(e,t,n){const r=ar(e,t,e[t]??n.value);return r.value=e[t]??n.value,B(n,o=>{e[t]==null&&(r.value=n.value)}),r}function Bt(e){return t=>{const n=we(t,"locale",e.current),r=we(t,"fallback",e.fallback),o=we(t,"messages",e.messages);return{name:"vuetify",current:n,fallback:r,messages:o,t:Lt(n,r,o),n:Nt(n,r),provide:Bt({current:n,fallback:r,messages:o})}}}function ur(e){const t=P(e?.locale??"en"),n=P(e?.fallback??"en"),r=I({en:ir,...e?.messages});return{name:"vuetify",current:t,fallback:n,messages:r,t:Lt(t,n,r),n:Nt(t,n),provide:Bt({current:t,fallback:n,messages:r})}}const G=Symbol.for("vuetify:locale");function cr(e){return e.name!=null}function lr(e){const t=e?.adapter&&cr(e?.adapter)?e?.adapter:ur(e),n=mr(t,e);return{...t,...n}}function fr(){const e=S(G);if(!e)throw new Error("[Vuetify] Could not find injected locale instance");return e}function Ds(e){const t=S(G);if(!t)throw new Error("[Vuetify] Could not find injected locale instance");const n=t.provide(e),r=gr(n,t.rtl,e),o={...n,...r};return Z(G,o),o}function dr(){return{af:!1,ar:!0,bg:!1,ca:!1,ckb:!1,cs:!1,de:!1,el:!1,en:!1,es:!1,et:!1,fa:!0,fi:!1,fr:!1,hr:!1,hu:!1,he:!0,id:!1,it:!1,ja:!1,km:!1,ko:!1,lv:!1,lt:!1,nl:!1,no:!1,pl:!1,pt:!1,ro:!1,ru:!1,sk:!1,sl:!1,srCyrl:!1,srLatn:!1,sv:!1,th:!1,tr:!1,az:!1,uk:!1,vi:!1,zhHans:!1,zhHant:!1}}function mr(e,t){const n=I(t?.rtl??dr()),r=y(()=>n.value[e.current.value]??!1);return{isRtl:r,rtl:n,rtlClasses:y(()=>`v-locale--is-${r.value?"rtl":"ltr"}`)}}function gr(e,t,n){const r=y(()=>n.rtl??t.value[e.current.value]??!1);return{isRtl:r,rtl:t,rtlClasses:y(()=>`v-locale--is-${r.value?"rtl":"ltr"}`)}}function hr(){const e=S(G);if(!e)throw new Error("[Vuetify] Could not find injected rtl instance");return{isRtl:e.isRtl,rtlClasses:e.rtlClasses}}const Q={"001":1,AD:1,AE:6,AF:6,AG:0,AI:1,AL:1,AM:1,AN:1,AR:1,AS:0,AT:1,AU:1,AX:1,AZ:1,BA:1,BD:0,BE:1,BG:1,BH:6,BM:1,BN:1,BR:0,BS:0,BT:0,BW:0,BY:1,BZ:0,CA:0,CH:1,CL:1,CM:1,CN:1,CO:0,CR:1,CY:1,CZ:1,DE:1,DJ:6,DK:1,DM:0,DO:0,DZ:6,EC:1,EE:1,EG:6,ES:1,ET:0,FI:1,FJ:1,FO:1,FR:1,GB:1,"GB-alt-variant":0,GE:1,GF:1,GP:1,GR:1,GT:0,GU:0,HK:0,HN:0,HR:1,HU:1,ID:0,IE:1,IL:0,IN:0,IQ:6,IR:6,IS:1,IT:1,JM:0,JO:6,JP:0,KE:0,KG:1,KH:0,KR:0,KW:6,KZ:1,LA:0,LB:1,LI:1,LK:1,LT:1,LU:1,LV:1,LY:6,MC:1,MD:1,ME:1,MH:0,MK:1,MM:0,MN:1,MO:0,MQ:1,MT:0,MV:5,MX:0,MY:1,MZ:0,NI:0,NL:1,NO:1,NP:0,NZ:1,OM:6,PA:0,PE:0,PH:0,PK:0,PL:1,PR:0,PT:0,PY:0,QA:6,RE:1,RO:1,RS:1,RU:1,SA:0,SD:6,SE:1,SG:0,SI:1,SK:1,SM:1,SV:0,SY:6,TH:0,TJ:1,TM:1,TR:1,TT:0,TW:0,UA:1,UM:0,US:0,UY:1,UZ:1,VA:1,VE:0,VI:0,VN:1,WS:0,XK:1,YE:0,ZA:0,ZW:0};function yr(e,t){const n=[];let r=[];const o=Ht(e),s=Yt(e),a=(o.getDay()-Q[t.slice(-2).toUpperCase()]+7)%7,i=(s.getDay()-Q[t.slice(-2).toUpperCase()]+7)%7;for(let u=0;u<a;u++){const c=new Date(o);c.setDate(c.getDate()-(a-u)),r.push(c)}for(let u=1;u<=s.getDate();u++){const c=new Date(e.getFullYear(),e.getMonth(),u);r.push(c),r.length===7&&(n.push(r),r=[])}for(let u=1;u<7-i;u++){const c=new Date(s);c.setDate(c.getDate()+u),r.push(c)}return r.length>0&&n.push(r),n}function pr(e,t){const n=new Date(e);for(;n.getDay()!==(Q[t.slice(-2).toUpperCase()]??0);)n.setDate(n.getDate()-1);return n}function vr(e,t){const n=new Date(e),r=((Q[t.slice(-2).toUpperCase()]??0)+6)%7;for(;n.getDay()!==r;)n.setDate(n.getDate()+1);return n}function Ht(e){return new Date(e.getFullYear(),e.getMonth(),1)}function Yt(e){return new Date(e.getFullYear(),e.getMonth()+1,0)}function br(e){const t=e.split("-").map(Number);return new Date(t[0],t[1]-1,t[2])}const wr=/^([12]\d{3}-([1-9]|0[1-9]|1[0-2])-([1-9]|0[1-9]|[12]\d|3[01]))$/;function Vt(e){if(e==null)return new Date;if(e instanceof Date)return e;if(typeof e=="string"){let t;if(wr.test(e))return br(e);if(t=Date.parse(e),!isNaN(t))return new Date(t)}return null}const tt=new Date(2e3,0,2);function Dr(e){const t=Q[e.slice(-2).toUpperCase()];return Dt(7).map(n=>{const r=new Date(tt);return r.setDate(tt.getDate()+t+n),new Intl.DateTimeFormat(e,{weekday:"narrow"}).format(r)})}function Sr(e,t,n,r){const o=Vt(e)??new Date,s=r?.[t];if(typeof s=="function")return s(o,t,n);let a={};switch(t){case"fullDate":a={year:"numeric",month:"long",day:"numeric"};break;case"fullDateWithWeekday":a={weekday:"long",year:"numeric",month:"long",day:"numeric"};break;case"normalDate":const i=o.getDate(),u=new Intl.DateTimeFormat(n,{month:"long"}).format(o);return`${i} ${u}`;case"normalDateWithWeekday":a={weekday:"short",day:"numeric",month:"short"};break;case"shortDate":a={month:"short",day:"numeric"};break;case"year":a={year:"numeric"};break;case"month":a={month:"long"};break;case"monthShort":a={month:"short"};break;case"monthAndYear":a={month:"long",year:"numeric"};break;case"monthAndDate":a={month:"long",day:"numeric"};break;case"weekday":a={weekday:"long"};break;case"weekdayShort":a={weekday:"short"};break;case"dayOfMonth":return new Intl.NumberFormat(n).format(o.getDate());case"hours12h":a={hour:"numeric",hour12:!0};break;case"hours24h":a={hour:"numeric",hour12:!1};break;case"minutes":a={minute:"numeric"};break;case"seconds":a={second:"numeric"};break;case"fullTime":a={hour:"numeric",minute:"numeric",second:"numeric",hour12:!0};break;case"fullTime12h":a={hour:"numeric",minute:"numeric",second:"numeric",hour12:!0};break;case"fullTime24h":a={hour:"numeric",minute:"numeric",second:"numeric",hour12:!1};break;case"fullDateTime":a={year:"numeric",month:"long",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric",hour12:!0};break;case"fullDateTime12h":a={year:"numeric",month:"long",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric",hour12:!0};break;case"fullDateTime24h":a={year:"numeric",month:"long",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric",hour12:!1};break;case"keyboardDate":a={year:"numeric",month:"2-digit",day:"2-digit"};break;case"keyboardDateTime":a={year:"numeric",month:"2-digit",day:"2-digit",hour:"numeric",minute:"numeric",second:"numeric",hour12:!1};break;case"keyboardDateTime12h":a={year:"numeric",month:"2-digit",day:"2-digit",hour:"numeric",minute:"numeric",second:"numeric",hour12:!0};break;case"keyboardDateTime24h":a={year:"numeric",month:"2-digit",day:"2-digit",hour:"numeric",minute:"numeric",second:"numeric",hour12:!1};break;default:a=s??{timeZone:"UTC",timeZoneName:"short"}}return new Intl.DateTimeFormat(n,a).format(o)}function xr(e,t){const n=e.toJsDate(t),r=n.getFullYear(),o=Ye(String(n.getMonth()+1),2,"0"),s=Ye(String(n.getDate()),2,"0");return`${r}-${o}-${s}`}function Cr(e){const[t,n,r]=e.split("-").map(Number);return new Date(t,n-1,r)}function Tr(e,t){const n=new Date(e);return n.setMinutes(n.getMinutes()+t),n}function Mr(e,t){const n=new Date(e);return n.setHours(n.getHours()+t),n}function kr(e,t){const n=new Date(e);return n.setDate(n.getDate()+t),n}function Ar(e,t){const n=new Date(e);return n.setDate(n.getDate()+t*7),n}function Or(e,t){const n=new Date(e);return n.setDate(1),n.setMonth(n.getMonth()+t),n}function Er(e){return e.getFullYear()}function Fr(e){return e.getMonth()}function Pr(e){return e.getDate()}function Ir(e){return new Date(e.getFullYear(),e.getMonth()+1,1)}function $r(e){return new Date(e.getFullYear(),e.getMonth()-1,1)}function Rr(e){return e.getHours()}function Lr(e){return e.getMinutes()}function Nr(e){return new Date(e.getFullYear(),0,1)}function Br(e){return new Date(e.getFullYear(),11,31)}function Hr(e,t){return fe(e,t[0])&&Wr(e,t[1])}function Yr(e){const t=new Date(e);return t instanceof Date&&!isNaN(t.getTime())}function fe(e,t){return e.getTime()>t.getTime()}function Vr(e,t){return fe(Te(e),Te(t))}function Wr(e,t){return e.getTime()<t.getTime()}function nt(e,t){return e.getTime()===t.getTime()}function jr(e,t){return e.getDate()===t.getDate()&&e.getMonth()===t.getMonth()&&e.getFullYear()===t.getFullYear()}function Ur(e,t){return e.getMonth()===t.getMonth()&&e.getFullYear()===t.getFullYear()}function zr(e,t){return e.getFullYear()===t.getFullYear()}function Gr(e,t,n){const r=new Date(e),o=new Date(t);switch(n){case"years":return r.getFullYear()-o.getFullYear();case"quarters":return Math.floor((r.getMonth()-o.getMonth()+(r.getFullYear()-o.getFullYear())*12)/4);case"months":return r.getMonth()-o.getMonth()+(r.getFullYear()-o.getFullYear())*12;case"weeks":return Math.floor((r.getTime()-o.getTime())/(1e3*60*60*24*7));case"days":return Math.floor((r.getTime()-o.getTime())/(1e3*60*60*24));case"hours":return Math.floor((r.getTime()-o.getTime())/(1e3*60*60));case"minutes":return Math.floor((r.getTime()-o.getTime())/(1e3*60));case"seconds":return Math.floor((r.getTime()-o.getTime())/1e3);default:return r.getTime()-o.getTime()}}function Zr(e,t){const n=new Date(e);return n.setHours(t),n}function Kr(e,t){const n=new Date(e);return n.setMinutes(t),n}function _r(e,t){const n=new Date(e);return n.setMonth(t),n}function Xr(e,t){const n=new Date(e);return n.setDate(t),n}function Qr(e,t){const n=new Date(e);return n.setFullYear(t),n}function Te(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate(),0,0,0,0)}function qr(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate(),23,59,59,999)}class Jr{constructor(t){this.locale=t.locale,this.formats=t.formats}date(t){return Vt(t)}toJsDate(t){return t}toISO(t){return xr(this,t)}parseISO(t){return Cr(t)}addMinutes(t,n){return Tr(t,n)}addHours(t,n){return Mr(t,n)}addDays(t,n){return kr(t,n)}addWeeks(t,n){return Ar(t,n)}addMonths(t,n){return Or(t,n)}getWeekArray(t){return yr(t,this.locale)}startOfWeek(t){return pr(t,this.locale)}endOfWeek(t){return vr(t,this.locale)}startOfMonth(t){return Ht(t)}endOfMonth(t){return Yt(t)}format(t,n){return Sr(t,n,this.locale,this.formats)}isEqual(t,n){return nt(t,n)}isValid(t){return Yr(t)}isWithinRange(t,n){return Hr(t,n)}isAfter(t,n){return fe(t,n)}isAfterDay(t,n){return Vr(t,n)}isBefore(t,n){return!fe(t,n)&&!nt(t,n)}isSameDay(t,n){return jr(t,n)}isSameMonth(t,n){return Ur(t,n)}isSameYear(t,n){return zr(t,n)}setMinutes(t,n){return Kr(t,n)}setHours(t,n){return Zr(t,n)}setMonth(t,n){return _r(t,n)}setDate(t,n){return Xr(t,n)}setYear(t,n){return Qr(t,n)}getDiff(t,n,r){return Gr(t,n,r)}getWeekdays(){return Dr(this.locale)}getYear(t){return Er(t)}getMonth(t){return Fr(t)}getDate(t){return Pr(t)}getNextMonth(t){return Ir(t)}getPreviousMonth(t){return $r(t)}getHours(t){return Rr(t)}getMinutes(t){return Lr(t)}startOfDay(t){return Te(t)}endOfDay(t){return qr(t)}startOfYear(t){return Nr(t)}endOfYear(t){return Br(t)}}const Wt=Symbol.for("vuetify:date-options"),rt=Symbol.for("vuetify:date-adapter");function eo(e,t){const n=w({adapter:Jr,locale:{af:"af-ZA",bg:"bg-BG",ca:"ca-ES",ckb:"",cs:"cs-CZ",de:"de-DE",el:"el-GR",en:"en-US",et:"et-EE",fa:"fa-IR",fi:"fi-FI",hr:"hr-HR",hu:"hu-HU",he:"he-IL",id:"id-ID",it:"it-IT",ja:"ja-JP",ko:"ko-KR",lv:"lv-LV",lt:"lt-LT",nl:"nl-NL",no:"no-NO",pl:"pl-PL",pt:"pt-PT",ro:"ro-RO",ru:"ru-RU",sk:"sk-SK",sl:"sl-SI",srCyrl:"sr-SP",srLatn:"sr-SP",sv:"sv-SE",th:"th-TH",tr:"tr-TR",az:"az-AZ",uk:"uk-UA",vi:"vi-VN",zhHans:"zh-CN",zhHant:"zh-TW"}},e);return{options:n,instance:jt(n,t)}}function jt(e,t){const n=O(typeof e.adapter=="function"?new e.adapter({locale:e.locale[t.current.value]??t.current.value,formats:e.formats}):e.adapter);return B(t.current,r=>{n.locale=e.locale[r]??r??n.locale}),n}function Ss(){const e=S(Wt);if(!e)throw new Error("[Vuetify] Could not find injected date options");const t=fr();return jt(e,t)}function xs(e,t){const n=e.toJsDate(t);let r=n.getFullYear(),o=new Date(r,0,1);if(n<o)r=r-1,o=new Date(r,0,1);else{const i=new Date(r+1,0,1);n>=i&&(r=r+1,o=i)}const s=Math.abs(n.getTime()-o.getTime()),a=Math.ceil(s/(1e3*60*60*24));return Math.floor(a/7)+1}const Cs=["sm","md","lg","xl","xxl"],Me=Symbol.for("vuetify:display"),ot={mobileBreakpoint:"lg",thresholds:{xs:0,sm:600,md:960,lg:1280,xl:1920,xxl:2560}},to=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:ot;return w(ot,e)};function st(e){return D&&!e?window.innerWidth:typeof e=="object"&&e.clientWidth||0}function at(e){return D&&!e?window.innerHeight:typeof e=="object"&&e.clientHeight||0}function it(e){const t=D&&!e?window.navigator.userAgent:"ssr";function n(d){return!!t.match(d)}const r=n(/android/i),o=n(/iphone|ipad|ipod/i),s=n(/cordova/i),a=n(/electron/i),i=n(/chrome/i),u=n(/edge/i),c=n(/firefox/i),l=n(/opera/i),f=n(/win/i),g=n(/mac/i),h=n(/linux/i);return{android:r,ios:o,cordova:s,electron:a,chrome:i,edge:u,firefox:c,opera:l,win:f,mac:g,linux:h,touch:yn,ssr:t==="ssr"}}function no(e,t){const{thresholds:n,mobileBreakpoint:r}=to(e),o=P(at(t)),s=P(it(t)),a=O({}),i=P(st(t));function u(){o.value=at(),i.value=st()}function c(){u(),s.value=it()}return J(()=>{const l=i.value<n.sm,f=i.value<n.md&&!l,g=i.value<n.lg&&!(f||l),h=i.value<n.xl&&!(g||f||l),d=i.value<n.xxl&&!(h||g||f||l),m=i.value>=n.xxl,p=l?"xs":f?"sm":g?"md":h?"lg":d?"xl":"xxl",C=typeof r=="number"?r:n[r],T=i.value<C;a.xs=l,a.sm=f,a.md=g,a.lg=h,a.xl=d,a.xxl=m,a.smAndUp=!l,a.mdAndUp=!(l||f),a.lgAndUp=!(l||f||g),a.xlAndUp=!(l||f||g||h),a.smAndDown=!(g||h||d||m),a.mdAndDown=!(h||d||m),a.lgAndDown=!(d||m),a.xlAndDown=!m,a.name=p,a.height=o.value,a.width=i.value,a.mobile=T,a.mobileBreakpoint=r,a.platform=s.value,a.thresholds=n}),D&&window.addEventListener("resize",u,{passive:!0}),{...gt(a),update:c,ssr:!!t}}const Ts=Y({mobile:{type:Boolean,default:!1},mobileBreakpoint:[Number,String]},"display");function Ms(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:rr();const n=S(Me);if(!n)throw new Error("Could not find Vuetify display injection");const r=y(()=>{if(e.mobile!=null)return e.mobile;if(!e.mobileBreakpoint)return n.mobile.value;const s=typeof e.mobileBreakpoint=="number"?e.mobileBreakpoint:n.thresholds.value[e.mobileBreakpoint];return n.width.value<s}),o=y(()=>t?{[`${t}--mobile`]:r.value}:{});return{...n,displayClasses:o,mobile:r}}const Ut=Symbol.for("vuetify:goto");function zt(){return{container:void 0,duration:300,layout:!1,offset:0,easing:"easeInOutCubic",patterns:{linear:e=>e,easeInQuad:e=>e**2,easeOutQuad:e=>e*(2-e),easeInOutQuad:e=>e<.5?2*e**2:-1+(4-2*e)*e,easeInCubic:e=>e**3,easeOutCubic:e=>--e**3+1,easeInOutCubic:e=>e<.5?4*e**3:(e-1)*(2*e-2)*(2*e-2)+1,easeInQuart:e=>e**4,easeOutQuart:e=>1- --e**4,easeInOutQuart:e=>e<.5?8*e**4:1-8*--e**4,easeInQuint:e=>e**5,easeOutQuint:e=>1+--e**5,easeInOutQuint:e=>e<.5?16*e**5:1+16*--e**5}}}function ro(e){return Pe(e)??(document.scrollingElement||document.body)}function Pe(e){return typeof e=="string"?document.querySelector(e):St(e)}function De(e,t,n){if(typeof e=="number")return t&&n?-e:e;let r=Pe(e),o=0;for(;r;)o+=t?r.offsetLeft:r.offsetTop,r=r.offsetParent;return o}function oo(e,t){return{rtl:t.isRtl,options:w(zt(),e)}}async function ut(e,t,n,r){const o=n?"scrollLeft":"scrollTop",s=w(r?.options??zt(),t),a=r?.rtl.value,i=(typeof e=="number"?e:Pe(e))??0,u=s.container==="parent"&&i instanceof HTMLElement?i.parentElement:ro(s.container),c=typeof s.easing=="function"?s.easing:s.patterns[s.easing];if(!c)throw new TypeError(`Easing function "${s.easing}" not found.`);let l;if(typeof i=="number")l=De(i,n,a);else if(l=De(i,n,a)-De(u,n,a),s.layout){const d=window.getComputedStyle(i).getPropertyValue("--v-layout-top");d&&(l-=parseInt(d,10))}l+=s.offset,l=so(u,l,!!a,!!n);const f=u[o]??0;if(l===f)return Promise.resolve(l);const g=performance.now();return new Promise(h=>requestAnimationFrame(function d(m){const C=(m-g)/s.duration,T=Math.floor(f+(l-f)*c(Ct(C,0,1)));if(u[o]=T,C>=1&&Math.abs(T-u[o])<10)return h(l);if(C>2)return h(u[o]);requestAnimationFrame(d)}))}function ks(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const t=S(Ut),{isRtl:n}=hr();if(!t)throw new Error("[Vuetify] Could not find injected goto instance");const r={...t,rtl:y(()=>t.rtl.value||n.value)};async function o(s,a){return ut(s,w(e,a),!1,r)}return o.horizontal=async(s,a)=>ut(s,w(e,a),!0,r),o}function so(e,t,n,r){const{scrollWidth:o,scrollHeight:s}=e,[a,i]=e===document.scrollingElement?[window.innerWidth,window.innerHeight]:[e.offsetWidth,e.offsetHeight];let u,c;return r?n?(u=-(o-a),c=0):(u=0,c=o-a):(u=0,c=s+-i),Math.max(Math.min(t,c),u)}const ao={collapse:"mdi-chevron-up",complete:"mdi-check",cancel:"mdi-close-circle",close:"mdi-close",delete:"mdi-close-circle",clear:"mdi-close-circle",success:"mdi-check-circle",info:"mdi-information",warning:"mdi-alert-circle",error:"mdi-close-circle",prev:"mdi-chevron-left",next:"mdi-chevron-right",checkboxOn:"mdi-checkbox-marked",checkboxOff:"mdi-checkbox-blank-outline",checkboxIndeterminate:"mdi-minus-box",delimiter:"mdi-circle",sortAsc:"mdi-arrow-up",sortDesc:"mdi-arrow-down",expand:"mdi-chevron-down",menu:"mdi-menu",subgroup:"mdi-menu-down",dropdown:"mdi-menu-down",radioOn:"mdi-radiobox-marked",radioOff:"mdi-radiobox-blank",edit:"mdi-pencil",ratingEmpty:"mdi-star-outline",ratingFull:"mdi-star",ratingHalf:"mdi-star-half-full",loading:"mdi-cached",first:"mdi-page-first",last:"mdi-page-last",unfold:"mdi-unfold-more-horizontal",file:"mdi-paperclip",plus:"mdi-plus",minus:"mdi-minus",calendar:"mdi-calendar",treeviewCollapse:"mdi-menu-down",treeviewExpand:"mdi-menu-right",eyeDropper:"mdi-eyedropper"},io={component:e=>pt(Zt,{...e,class:"mdi"})},uo=[String,Function,Object,Array],ke=Symbol.for("vuetify:icons"),ge=Y({icon:{type:uo},tag:{type:String,required:!0}},"icon"),ct=It()({name:"VComponentIcon",props:ge(),setup(e,t){let{slots:n}=t;return()=>{const r=e.icon;return E(e.tag,null,{default:()=>[e.icon?E(r,null,null):n.default?.()]})}}}),Gt=ee({name:"VSvgIcon",inheritAttrs:!1,props:ge(),setup(e,t){let{attrs:n}=t;return()=>E(e.tag,dn(n,{style:null}),{default:()=>[E("svg",{class:"v-icon__svg",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",role:"img","aria-hidden":"true"},[Array.isArray(e.icon)?e.icon.map(r=>Array.isArray(r)?E("path",{d:r[0],"fill-opacity":r[1]},null):E("path",{d:r},null)):E("path",{d:e.icon},null)])]})}}),As=ee({name:"VLigatureIcon",props:ge(),setup(e){return()=>E(e.tag,null,{default:()=>[e.icon]})}}),Zt=ee({name:"VClassIcon",props:ge(),setup(e){return()=>E(e.tag,{class:e.icon},null)}});function co(){return{svg:{component:Gt},class:{component:Zt}}}function lo(e){const t=co(),n=e?.defaultSet??"mdi";return n==="mdi"&&!t.mdi&&(t.mdi=io),w({defaultSet:n,sets:t,aliases:{...ao,vuetify:["M8.2241 14.2009L12 21L22 3H14.4459L8.2241 14.2009Z",["M7.26303 12.4733L7.00113 12L2 3H12.5261C12.5261 3 12.5261 3 12.5261 3L7.26303 12.4733Z",.6]],"vuetify-outline":"svg:M7.26 12.47 12.53 3H2L7.26 12.47ZM14.45 3 8.22 14.2 12 21 22 3H14.45ZM18.6 5 12 16.88 10.51 14.2 15.62 5ZM7.26 8.35 5.4 5H9.13L7.26 8.35Z","vuetify-play":["m6.376 13.184-4.11-7.192C1.505 4.66 2.467 3 4.003 3h8.532l-.953 1.576-.006.01-.396.677c-.429.732-.214 1.507.194 2.015.404.503 1.092.878 1.869.806a3.72 3.72 0 0 1 1.005.022c.276.053.434.143.523.237.138.146.38.635-.25 2.09-.893 1.63-1.553 1.722-1.847 1.677-.213-.033-.468-.158-.756-.406a4.95 4.95 0 0 1-.8-.927c-.39-.564-1.04-.84-1.66-.846-.625-.006-1.316.27-1.693.921l-.478.826-.911 1.506Z",["M9.093 11.552c.046-.079.144-.15.32-.148a.53.53 0 0 1 .43.207c.285.414.636.847 1.046 1.2.405.35.914.662 1.516.754 1.334.205 2.502-.698 3.48-2.495l.014-.028.013-.03c.687-1.574.774-2.852-.005-3.675-.37-.391-.861-.586-1.333-.676a5.243 5.243 0 0 0-1.447-.044c-.173.016-.393-.073-.54-.257-.145-.18-.127-.316-.082-.392l.393-.672L14.287 3h5.71c1.536 0 2.499 1.659 1.737 2.992l-7.997 13.996c-.768 1.344-2.706 1.344-3.473 0l-3.037-5.314 1.377-2.278.004-.006.004-.007.481-.831Z",.6]]}},e)}const Os=e=>{const t=S(ke);if(!t)throw new Error("Missing Vuetify Icons provide!");return{iconData:y(()=>{const r=U(e);if(!r)return{component:ct};let o=r;if(typeof o=="string"&&(o=o.trim(),o.startsWith("$")&&(o=t.aliases?.[o.slice(1)])),Array.isArray(o))return{component:Gt,icon:o};if(typeof o!="string")return{component:ct,icon:o};const s=Object.keys(t.sets).find(u=>typeof o=="string"&&o.startsWith(`${u}:`)),a=s?o.slice(s.length+1):o;return{component:t.sets[s??t.defaultSet].component,icon:a}})}},q=Symbol.for("vuetify:theme"),Es=Y({theme:String},"theme");function lt(){return{defaultTheme:"light",variations:{colors:[],lighten:0,darken:0},themes:{light:{dark:!1,colors:{background:"#FFFFFF",surface:"#FFFFFF","surface-bright":"#FFFFFF","surface-light":"#EEEEEE","surface-variant":"#424242","on-surface-variant":"#EEEEEE",primary:"#1867C0","primary-darken-1":"#1F5592",secondary:"#48A9A6","secondary-darken-1":"#018786",error:"#B00020",info:"#2196F3",success:"#4CAF50",warning:"#FB8C00"},variables:{"border-color":"#000000","border-opacity":.12,"high-emphasis-opacity":.87,"medium-emphasis-opacity":.6,"disabled-opacity":.38,"idle-opacity":.04,"hover-opacity":.04,"focus-opacity":.12,"selected-opacity":.08,"activated-opacity":.12,"pressed-opacity":.12,"dragged-opacity":.08,"theme-kbd":"#212529","theme-on-kbd":"#FFFFFF","theme-code":"#F5F5F5","theme-on-code":"#000000"}},dark:{dark:!0,colors:{background:"#121212",surface:"#212121","surface-bright":"#ccbfd6","surface-light":"#424242","surface-variant":"#a3a3a3","on-surface-variant":"#424242",primary:"#2196F3","primary-darken-1":"#277CC1",secondary:"#54B6B2","secondary-darken-1":"#48A9A6",error:"#CF6679",info:"#2196F3",success:"#4CAF50",warning:"#FB8C00"},variables:{"border-color":"#FFFFFF","border-opacity":.12,"high-emphasis-opacity":1,"medium-emphasis-opacity":.7,"disabled-opacity":.5,"idle-opacity":.1,"hover-opacity":.04,"focus-opacity":.12,"selected-opacity":.08,"activated-opacity":.12,"pressed-opacity":.16,"dragged-opacity":.08,"theme-kbd":"#212529","theme-on-kbd":"#FFFFFF","theme-code":"#343434","theme-on-code":"#CCCCCC"}}}}}function fo(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:lt();const t=lt();if(!e)return{...t,isDisabled:!0};const n={};for(const[r,o]of Object.entries(e.themes??{})){const s=o.dark||r==="dark"?t.themes?.dark:t.themes?.light;n[r]=w(s,o)}return w(t,{...e,themes:n})}function mo(e){const t=fo(e),n=I(t.defaultTheme),r=I(t.themes),o=y(()=>{const l={};for(const[f,g]of Object.entries(r.value)){const h=l[f]={...g,colors:{...g.colors}};if(t.variations)for(const d of t.variations.colors){const m=h.colors[d];if(m)for(const p of["lighten","darken"]){const C=p==="lighten"?Xn:Qn;for(const T of Dt(t.variations[p],1))h.colors[`${d}-${p}-${T}`]=Ft(C(F(m),T))}}for(const d of Object.keys(h.colors)){if(/^on-[a-z]/.test(d)||h.colors[`on-${d}`])continue;const m=`on-${d}`,p=F(h.colors[d]);h.colors[m]=qn(p)}}return l}),s=y(()=>o.value[n.value]),a=y(()=>{const l=[];s.value?.dark&&L(l,":root",["color-scheme: dark"]),L(l,":root",ft(s.value));for(const[d,m]of Object.entries(o.value))L(l,`.v-theme--${d}`,[`color-scheme: ${m.dark?"dark":"normal"}`,...ft(m)]);const f=[],g=[],h=new Set(Object.values(o.value).flatMap(d=>Object.keys(d.colors)));for(const d of h)/^on-[a-z]/.test(d)?L(g,`.${d}`,[`color: rgb(var(--v-theme-${d})) !important`]):(L(f,`.bg-${d}`,[`--v-theme-overlay-multiplier: var(--v-theme-${d}-overlay-multiplier)`,`background-color: rgb(var(--v-theme-${d})) !important`,`color: rgb(var(--v-theme-on-${d})) !important`]),L(g,`.text-${d}`,[`color: rgb(var(--v-theme-${d})) !important`]),L(g,`.border-${d}`,[`--v-border-color: var(--v-theme-${d})`]));return l.push(...f,...g),l.map((d,m)=>m===0?d:` ${d}`).join("")});function i(){return{style:[{children:a.value,id:"vuetify-theme-stylesheet",nonce:t.cspNonce||!1}]}}function u(l){if(t.isDisabled)return;const f=l._context.provides.usehead;if(f)if(f.push){const g=f.push(i);D&&B(a,()=>{g.patch(i)})}else D?(f.addHeadObjs(y(i)),J(()=>f.updateDOM())):f.addHeadObjs(i());else{let h=function(){if(typeof document<"u"&&!g){const d=document.createElement("style");d.type="text/css",d.id="vuetify-theme-stylesheet",t.cspNonce&&d.setAttribute("nonce",t.cspNonce),g=d,document.head.appendChild(g)}g&&(g.innerHTML=a.value)},g=D?document.getElementById("vuetify-theme-stylesheet"):null;D?B(a,h,{immediate:!0}):h()}}const c=y(()=>t.isDisabled?void 0:`v-theme--${n.value}`);return{install:u,isDisabled:t.isDisabled,name:n,themes:r,current:s,computedThemes:o,themeClasses:c,styles:a,global:{name:n,current:s}}}function Fs(e){k("provideTheme");const t=S(q,null);if(!t)throw new Error("Could not find Vuetify theme injection");const n=y(()=>e.theme??t.name.value),r=y(()=>t.themes.value[n.value]),o=y(()=>t.isDisabled?void 0:`v-theme--${n.value}`),s={...t,name:n,current:r,themeClasses:o};return Z(q,s),s}function Ps(){k("useTheme");const e=S(q,null);if(!e)throw new Error("Could not find Vuetify theme injection");return e}function L(e,t,n){e.push(`${t} {
`,...n.map(r=>` ${r};
`),`}
`)}function ft(e){const t=e.dark?2:1,n=e.dark?1:2,r=[];for(const[o,s]of Object.entries(e.colors)){const a=F(s);r.push(`--v-theme-${o}: ${a.r},${a.g},${a.b}`),o.startsWith("on-")||r.push(`--v-theme-${o}-overlay-multiplier: ${Ce(s)>.18?t:n}`)}for(const[o,s]of Object.entries(e.variables)){const a=typeof s=="string"&&s.startsWith("#")?F(s):void 0,i=a?`${a.r}, ${a.g}, ${a.b}`:void 0;r.push(`--v-${o}: ${i??s}`)}return r}function go(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"content";const n=En(),r=I();if(D){const o=new ResizeObserver(s=>{e?.(s,o),s.length&&(t==="content"?r.value=s[0].contentRect:r.value=s[0].target.getBoundingClientRect())});vt(()=>{o.disconnect()}),B(()=>n.el,(s,a)=>{a&&(o.unobserve(a),r.value=void 0),s&&o.observe(s)},{flush:"post"})}return{resizeRef:n,contentRect:yt(r)}}const de=Symbol.for("vuetify:layout"),Kt=Symbol.for("vuetify:layout-item"),dt=1e3,Is=Y({overlaps:{type:Array,default:()=>[]},fullHeight:Boolean},"layout"),$s=Y({name:{type:String},order:{type:[Number,String],default:0},absolute:Boolean},"layout-item");function Rs(){const e=S(de);if(!e)throw new Error("[Vuetify] Could not find injected layout");return{layoutIsReady:me(),getLayoutItem:e.getLayoutItem,mainRect:e.mainRect,mainStyles:e.mainStyles}}function Ls(e){const t=S(de);if(!t)throw new Error("[Vuetify] Could not find injected layout");const n=e.id??`layout-item-${Fe()}`,r=k("useLayoutItem");Z(Kt,{id:n});const o=P(!1);mn(()=>o.value=!0),gn(()=>o.value=!1);const s=me(),{layoutItemStyles:a,layoutItemScrimStyles:i}=t.register(r,{...e,active:y(()=>o.value?!1:e.active.value),id:n});return vt(()=>t.unregister(n)),{layoutItemStyles:a,layoutRect:t.layoutRect,layoutItemScrimStyles:i,layoutIsReady:s}}const ho=(e,t,n,r)=>{let o={top:0,left:0,right:0,bottom:0};const s=[{id:"",layer:{...o}}];for(const a of e){const i=t.get(a),u=n.get(a),c=r.get(a);if(!i||!u||!c)continue;const l={...o,[i.value]:parseInt(o[i.value],10)+(c.value?parseInt(u.value,10):0)};s.push({id:a,layer:l}),o=l}return s};function Ns(e){const t=S(de,null),n=y(()=>t?t.rootZIndex.value-100:dt),r=I([]),o=O(new Map),s=O(new Map),a=O(new Map),i=O(new Map),u=O(new Map),{resizeRef:c,contentRect:l}=go(),f=Ve(()=>{const b=[...new Set([...a.values()].map(v=>v.value))].sort((v,$)=>v-$),M=[];for(const v of b){const $=r.value.filter(x=>a.get(x)?.value===v);M.push(...$)}return ho(M,o,s,i)}),g=y(()=>!Array.from(u.values()).some(b=>b.value)),h=y(()=>f.value[f.value.length-1].layer),d=y(()=>({"--v-layout-left":ne(h.value.left),"--v-layout-right":ne(h.value.right),"--v-layout-top":ne(h.value.top),"--v-layout-bottom":ne(h.value.bottom),...g.value?void 0:{transition:"none"}})),m=Ve(()=>f.value.slice(1).map((b,M)=>{let{id:v}=b;const{layer:$}=f.value[M],x=s.get(v),te=o.get(v);return{id:v,...$,size:Number(x.value),position:te.value}})),p=b=>m.value.find(M=>M.id===b),C=k("createLayout"),T=me();Z(de,{register:(b,M)=>{let{id:v,order:$,position:x,layoutSize:te,elementSize:K,active:Ie,disableTransitions:$e,absolute:Qt}=M;a.set(v,$),o.set(v,x),s.set(v,te),i.set(v,Ie),$e&&u.set(v,$e);const Re=X(Kt,C?.vnode).indexOf(b);Re>-1?r.value.splice(Re,0,v):r.value.push(v);const he=y(()=>m.value.findIndex(_=>_.id===v)),ye=y(()=>n.value+f.value.length*2-he.value*2),qt=y(()=>{const _=x.value==="left"||x.value==="right",pe=x.value==="right",en=x.value==="bottom",ve=K.value??te.value,tn=ve===0?"%":"px",nn={[x.value]:0,zIndex:ye.value,transform:`translate${_?"X":"Y"}(${(Ie.value?0:-(ve===0?100:ve))*(pe||en?-1:1)}${tn})`,position:Qt.value||n.value!==dt?"absolute":"fixed",...g.value?void 0:{transition:"none"}};if(he.value<0)throw new Error(`Layout item "${v}" is missing`);const A=m.value[he.value];if(!A)throw new Error(`[Vuetify] Could not find layout item "${v}"`);return{...nn,height:_?`calc(100% - ${A.top}px - ${A.bottom}px)`:K.value?`${K.value}px`:void 0,left:pe?void 0:`${A.left}px`,right:pe?`${A.right}px`:void 0,top:x.value!=="bottom"?`${A.top}px`:void 0,bottom:x.value!=="top"?`${A.bottom}px`:void 0,width:_?K.value?`${K.value}px`:void 0:`calc(100% - ${A.left}px - ${A.right}px)`}}),Jt=y(()=>({zIndex:ye.value-1}));return{layoutItemStyles:qt,layoutItemScrimStyles:Jt,zIndex:ye}},unregister:b=>{a.delete(b),o.delete(b),s.delete(b),i.delete(b),u.delete(b),r.value=r.value.filter(M=>M!==b)},mainRect:h,mainStyles:d,getLayoutItem:p,items:m,layoutRect:l,rootZIndex:n,layoutIsReady:T});const _t=y(()=>["v-layout",{"v-layout--full-height":e.fullHeight}]),Xt=y(()=>({zIndex:t?n.value:void 0,position:t?"relative":void 0,overflow:t?"hidden":void 0}));return{layoutClasses:_t,layoutStyles:Xt,getLayoutItem:p,items:m,layoutRect:l,layoutIsReady:T,layoutRef:c}}function yo(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const{blueprint:t,...n}=e,r=w(t,n),{aliases:o={},components:s={},directives:a={}}=r,i=er(r.defaults),u=no(r.display,r.ssr),c=mo(r.theme),l=lo(r.icons),f=lr(r.locale),g=eo(r.date,f),h=oo(r.goTo,f);return{install:m=>{for(const p in a)m.directive(p,a[p]);for(const p in s)m.component(p,s[p]);for(const p in o)m.component(p,ee({...o[p],name:p,aliasName:o[p].name}));if(c.install(m),m.provide(z,i),m.provide(Me,u),m.provide(q,c),m.provide(ke,l),m.provide(G,f),m.provide(Wt,g.options),m.provide(rt,g.instance),m.provide(Ut,h),D&&r.ssr)if(m.$nuxt)m.$nuxt.hook("app:suspense:resolve",()=>{u.update()});else{const{mount:p}=m;m.mount=function(){const C=p(...arguments);return me(()=>u.update()),m.mount=p,C}}Fe.reset(),m.mixin({computed:{$vuetify(){return O({defaults:j.call(this,z),display:j.call(this,Me),theme:j.call(this,q),icons:j.call(this,ke),locale:j.call(this,G),date:j.call(this,rt)})}}})},defaults:i,display:u,theme:c,icons:l,locale:f,date:g,goTo:h}}const po="3.6.7";yo.version=po;function j(e){const t=this.$,n=t.parent?.provides??t.vnode.appContext?.provides;if(n&&e in n)return n[e]}export{An as $,Ao as A,Vo as B,Dn as C,fr as D,Lo as E,qo as F,gs as G,ms as H,uo as I,hs as J,Xo as K,Qo as L,hn as M,Mo as N,hr as O,X as P,Ts as Q,go as R,wo as S,ks as T,D as U,Mn as V,No as W,ee as X,fs as Y,ns as Z,So as _,Ps as a,ct as a$,bs as a0,Uo as a1,zo as a2,Go as a3,Zo as a4,vs as a5,ie as a6,Ko as a7,_o as a8,Ct as a9,Zn as aA,os as aB,Et as aC,is as aD,as as aE,be as aF,Fo as aG,Dt as aH,Co as aI,Do as aJ,ss as aK,Kn as aL,us as aM,Se as aN,Ho as aO,ls as aP,ts as aQ,ys as aR,Ss as aS,xs as aT,Ds as aU,Rs as aV,Io as aW,We as aX,St as aY,de as aZ,Zt as a_,Rt as aa,Wo as ab,En as ac,Jo as ad,es as ae,ds as af,ps as ag,jo as ah,kn as ai,Ae as aj,wn as ak,Bo as al,Eo as am,On as an,Yo as ao,ko as ap,Cs as aq,Po as ar,$s as as,Ls as at,To as au,Is as av,Ns as aw,Be as ax,$o as ay,H as az,Y as b,As as b0,Gt as b1,yo as b2,rs as c,Ro as d,F as e,qn as f,It as g,rr as h,zn as i,xe as j,ne as k,Es as l,Jn as m,Fs as n,Os as o,cs as p,ws as q,Tn as r,k as s,bn as t,Ms as u,ar as v,Fe as w,Ne as x,xo as y,Oo as z};

View File

@@ -0,0 +1,5 @@
import{w as B,o as rn,e as on,s as P,F as mt,r as O,c as y,a as J,t as gt,b as ht,i as sn,C as an,d as yt,u as U,g as un,f as I,p as Z,h as S,j as cn,k as ln,l as pt,m as fn,n as E,q as dn,v as vt,x as me,y as mn,z as gn}from"./vue-CfSjRv-x.js";function hn(e,t){let n;function r(){n=on(),n.run(()=>t.length?t(()=>{n?.stop(),r()}):t())}B(e,o=>{o&&!n?r():o||(n?.stop(),n=void 0)},{immediate:!0}),rn(()=>{n?.stop()})}const D=typeof window<"u",wo=D&&"IntersectionObserver"in window,yn=D&&("ontouchstart"in window||window.navigator.maxTouchPoints>0),Do=D&&"EyeDropper"in window;function Le(e,t,n){pn(e,t),t.set(e,n)}function pn(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function vn(e,t,n){return e.set(bt(e,t),n),n}function R(e,t){return e.get(bt(e,t))}function bt(e,t,n){if(typeof e=="function"?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}function wt(e,t,n){const r=t.length-1;if(r<0)return e===void 0?n:e;for(let o=0;o<r;o++){if(e==null)return n;e=e[t[o]]}return e==null||e[t[r]]===void 0?n:e[t[r]]}function bn(e,t){if(e===t)return!0;if(e instanceof Date&&t instanceof Date&&e.getTime()!==t.getTime()||e!==Object(e)||t!==Object(t))return!1;const n=Object.keys(e);return n.length!==Object.keys(t).length?!1:n.every(r=>bn(e[r],t[r]))}function Se(e,t,n){return e==null||!t||typeof t!="string"?n:e[t]!==void 0?e[t]:(t=t.replace(/\[(\w+)\]/g,".$1"),t=t.replace(/^\./,""),wt(e,t.split("."),n))}function So(e,t,n){if(t===!0)return e===void 0?n:e;if(t==null||typeof t=="boolean")return n;if(e!==Object(e)){if(typeof t!="function")return n;const o=t(e,n);return typeof o>"u"?n:o}if(typeof t=="string")return Se(e,t,n);if(Array.isArray(t))return wt(e,t,n);if(typeof t!="function")return n;const r=t(e,n);return typeof r>"u"?n:r}function Dt(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return Array.from({length:e},(n,r)=>t+r)}function ne(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"px";if(!(e==null||e===""))return isNaN(+e)?String(e):isFinite(+e)?`${Number(e)}${t}`:void 0}function Ne(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function St(e){if(e&&"$el"in e){const t=e.$el;return t?.nodeType===Node.TEXT_NODE?t.nextElementSibling:t}return e}const xo=Object.freeze({enter:13,tab:9,delete:46,esc:27,space:32,up:38,down:40,left:37,right:39,end:35,home:36,del:46,backspace:8,insert:45,pageup:33,pagedown:34,shift:16}),Co=Object.freeze({enter:"Enter",tab:"Tab",delete:"Delete",esc:"Escape",space:"Space",up:"ArrowUp",down:"ArrowDown",left:"ArrowLeft",right:"ArrowRight",end:"End",home:"Home",del:"Delete",backspace:"Backspace",insert:"Insert",pageup:"PageUp",pagedown:"PageDown",shift:"Shift"});function To(e){return Object.keys(e)}function be(e,t){return t.every(n=>e.hasOwnProperty(n))}function wn(e,t){const n={},r=new Set(Object.keys(e));for(const o of t)r.has(o)&&(n[o]=e[o]);return n}function Be(e,t,n){const r=Object.create(null),o=Object.create(null);for(const s in e)t.some(a=>a instanceof RegExp?a.test(s):a===s)&&!n?.some(a=>a===s)?r[s]=e[s]:o[s]=e[s];return[r,o]}function Dn(e,t){const n={...e};return t.forEach(r=>delete n[r]),n}function Mo(e,t){const n={};return t.forEach(r=>n[r]=e[r]),n}const xt=/^on[^a-z]/,Ae=e=>xt.test(e),Sn=["onAfterscriptexecute","onAnimationcancel","onAnimationend","onAnimationiteration","onAnimationstart","onAuxclick","onBeforeinput","onBeforescriptexecute","onChange","onClick","onCompositionend","onCompositionstart","onCompositionupdate","onContextmenu","onCopy","onCut","onDblclick","onFocusin","onFocusout","onFullscreenchange","onFullscreenerror","onGesturechange","onGestureend","onGesturestart","onGotpointercapture","onInput","onKeydown","onKeypress","onKeyup","onLostpointercapture","onMousedown","onMousemove","onMouseout","onMouseover","onMouseup","onMousewheel","onPaste","onPointercancel","onPointerdown","onPointerenter","onPointerleave","onPointermove","onPointerout","onPointerover","onPointerup","onReset","onSelect","onSubmit","onTouchcancel","onTouchend","onTouchmove","onTouchstart","onTransitioncancel","onTransitionend","onTransitionrun","onTransitionstart","onWheel"],xn=["ArrowUp","ArrowDown","ArrowRight","ArrowLeft","Enter","Escape","Tab"," "];function ko(e){return e.isComposing&&xn.includes(e.key)}function Ao(e){const[t,n]=Be(e,[xt]),r=Dn(t,Sn),[o,s]=Be(n,["class","style","id",/^data-/]);return Object.assign(o,t),Object.assign(s,r),[o,s]}function Oo(e){return e==null?[]:Array.isArray(e)?e:[e]}function Eo(e,t){let n=0;const r=function(){for(var o=arguments.length,s=new Array(o),a=0;a<o;a++)s[a]=arguments[a];clearTimeout(n),n=setTimeout(()=>e(...s),U(t))};return r.clear=()=>{clearTimeout(n)},r.immediate=e,r}function Ct(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1;return Math.max(t,Math.min(n,e))}function Fo(e){const t=e.toString().trim();return t.includes(".")?t.length-t.indexOf(".")-1:0}function He(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"0";return e+n.repeat(Math.max(0,t-e.length))}function Ye(e,t){return(arguments.length>2&&arguments[2]!==void 0?arguments[2]:"0").repeat(Math.max(0,t-e.length))+e}function Cn(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;const n=[];let r=0;for(;r<e.length;)n.push(e.substr(r,t)),r+=t;return n}function Po(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1e3;if(e<t)return`${e} B`;const n=t===1024?["Ki","Mi","Gi"]:["k","M","G"];let r=-1;for(;Math.abs(e)>=t&&r<n.length-1;)e/=t,++r;return`${e.toFixed(1)} ${n[r]}B`}function w(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;const r={};for(const o in e)r[o]=e[o];for(const o in t){const s=e[o],a=t[o];if(Ne(s)&&Ne(a)){r[o]=w(s,a,n);continue}if(Array.isArray(s)&&Array.isArray(a)&&n){r[o]=n(s,a);continue}r[o]=a}return r}function Tn(e){return e.map(t=>t.type===mt?Tn(t.children):t).flat()}function N(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";if(N.cache.has(e))return N.cache.get(e);const t=e.replace(/[^a-z]/gi,"-").replace(/\B([A-Z])/g,"-$1").toLowerCase();return N.cache.set(e,t),t}N.cache=new Map;function X(e,t){if(!t||typeof t!="object")return[];if(Array.isArray(t))return t.map(n=>X(e,n)).flat(1);if(t.suspense)return X(e,t.ssContent);if(Array.isArray(t.children))return t.children.map(n=>X(e,n)).flat(1);if(t.component){if(Object.getOwnPropertySymbols(t.component.provides).includes(e))return[t.component];if(t.component.subTree)return X(e,t.component.subTree).flat(1)}return[]}var re=new WeakMap,V=new WeakMap;class Io{constructor(t){Le(this,re,[]),Le(this,V,0),this.size=t}push(t){R(re,this)[R(V,this)]=t,vn(V,this,(R(V,this)+1)%this.size)}values(){return R(re,this).slice(R(V,this)).concat(R(re,this).slice(0,R(V,this)))}}function $o(e){return"touches"in e?{clientX:e.touches[0].clientX,clientY:e.touches[0].clientY}:{clientX:e.clientX,clientY:e.clientY}}function Ro(e){const t=O({}),n=y(e);return J(()=>{for(const r in n.value)t[r]=n.value[r]},{flush:"sync"}),gt(t)}function xe(e,t){return e.includes(t)}function Tt(e){return e[2].toLowerCase()+e.slice(3)}const Lo=()=>[Function,Array];function No(e,t){return t="on"+ht(t),!!(e[t]||e[`${t}Once`]||e[`${t}Capture`]||e[`${t}OnceCapture`]||e[`${t}CaptureOnce`])}function Bo(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];if(Array.isArray(e))for(const o of e)o(...n);else typeof e=="function"&&e(...n)}function Mn(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;const n=["button","[href]",'input:not([type="hidden"])',"select","textarea","[tabindex]"].map(r=>`${r}${t?':not([tabindex="-1"])':""}:not([disabled])`).join(", ");return[...e.querySelectorAll(n)]}function kn(e,t,n){let r,o=e.indexOf(document.activeElement);const s=t==="next"?1:-1;do o+=s,r=e[o];while((!r||r.offsetParent==null||!(n?.(r)??!0))&&o<e.length&&o>=0);return r}function An(e,t){const n=Mn(e);if(!t)(e===document.activeElement||!e.contains(document.activeElement))&&n[0]?.focus();else if(t==="first")n[0]?.focus();else if(t==="last")n.at(-1)?.focus();else if(typeof t=="number")n[t]?.focus();else{const r=kn(n,t);r?r.focus():An(e,t==="next"?"first":"last")}}function Ho(e){return e==null||typeof e=="string"&&e.trim()===""}function Yo(){}function Vo(e,t){if(!(D&&typeof CSS<"u"&&typeof CSS.supports<"u"&&CSS.supports(`selector(${t})`)))return null;try{return!!e&&e.matches(t)}catch{return null}}function On(e){return e.some(t=>sn(t)?t.type===an?!1:t.type!==mt||On(t.children):!0)?e:null}function Wo(e,t){if(!D||e===0)return t(),()=>{};const n=window.setTimeout(t,e);return()=>window.clearTimeout(n)}function Ve(e,t){const n=P();return J(()=>{n.value=e()},{flush:"sync",...t}),yt(n)}function jo(e,t){const n=e.clientX,r=e.clientY,o=t.getBoundingClientRect(),s=o.left,a=o.top,i=o.right,u=o.bottom;return n>=s&&n<=i&&r>=a&&r<=u}function En(){const e=P(),t=n=>{e.value=n};return Object.defineProperty(t,"value",{enumerable:!0,get:()=>e.value,set:n=>e.value=n}),Object.defineProperty(t,"el",{enumerable:!0,get:()=>St(e.value)}),t}const Mt=["top","bottom"],Fn=["start","end","left","right"];function Uo(e,t){let[n,r]=e.split(" ");return r||(r=xe(Mt,n)?"start":xe(Fn,n)?"top":"center"),{side:We(n,t),align:We(r,t)}}function We(e,t){return e==="start"?t?"right":"left":e==="end"?t?"left":"right":e}function zo(e){return{side:{center:"center",top:"bottom",bottom:"top",left:"right",right:"left"}[e.side],align:e.align}}function Go(e){return{side:e.side,align:{center:"center",top:"bottom",bottom:"top",left:"right",right:"left"}[e.align]}}function Zo(e){return{side:e.align,align:e.side}}function Ko(e){return xe(Mt,e.side)?"y":"x"}class ie{constructor(t){let{x:n,y:r,width:o,height:s}=t;this.x=n,this.y=r,this.width=o,this.height=s}get top(){return this.y}get bottom(){return this.y+this.height}get left(){return this.x}get right(){return this.x+this.width}}function _o(e,t){return{x:{before:Math.max(0,t.left-e.left),after:Math.max(0,e.right-t.right)},y:{before:Math.max(0,t.top-e.top),after:Math.max(0,e.bottom-t.bottom)}}}function Xo(e){return Array.isArray(e)?new ie({x:e[0],y:e[1],width:0,height:0}):e.getBoundingClientRect()}function Qo(e){const t=e.getBoundingClientRect(),n=getComputedStyle(e),r=n.transform;if(r){let o,s,a,i,u;if(r.startsWith("matrix3d("))o=r.slice(9,-1).split(/, /),s=+o[0],a=+o[5],i=+o[12],u=+o[13];else if(r.startsWith("matrix("))o=r.slice(7,-1).split(/, /),s=+o[0],a=+o[3],i=+o[4],u=+o[5];else return new ie(t);const c=n.transformOrigin,l=t.x-i-(1-s)*parseFloat(c),f=t.y-u-(1-a)*parseFloat(c.slice(c.indexOf(" ")+1)),g=s?t.width/s:e.offsetWidth+1,h=a?t.height/a:e.offsetHeight+1;return new ie({x:l,y:f,width:g,height:h})}else return new ie(t)}function qo(e,t,n){if(typeof e.animate>"u")return{finished:Promise.resolve()};let r;try{r=e.animate(t,n)}catch{return{finished:Promise.resolve()}}return typeof r.finished>"u"&&(r.finished=new Promise(o=>{r.onfinish=()=>{o(r)}})),r}const ue=new WeakMap;function Jo(e,t){Object.keys(t).forEach(n=>{if(Ae(n)){const r=Tt(n),o=ue.get(e);if(t[n]==null)o?.forEach(s=>{const[a,i]=s;a===r&&(e.removeEventListener(r,i),o.delete(s))});else if(!o||![...o].some(s=>s[0]===r&&s[1]===t[n])){e.addEventListener(r,t[n]);const s=o||new Set;s.add([r,t[n]]),ue.has(e)||ue.set(e,s)}}else t[n]==null?e.removeAttribute(n):e.setAttribute(n,t[n])})}function es(e,t){Object.keys(t).forEach(n=>{if(Ae(n)){const r=Tt(n),o=ue.get(e);o?.forEach(s=>{const[a,i]=s;a===r&&(e.removeEventListener(r,i),o.delete(s))})}else e.removeAttribute(n)})}const W=2.4,je=.2126729,Ue=.7151522,ze=.072175,Pn=.55,In=.58,$n=.57,Rn=.62,oe=.03,Ge=1.45,Ln=5e-4,Nn=1.25,Bn=1.25,Ze=.078,Ke=12.82051282051282,se=.06,_e=.001;function Xe(e,t){const n=(e.r/255)**W,r=(e.g/255)**W,o=(e.b/255)**W,s=(t.r/255)**W,a=(t.g/255)**W,i=(t.b/255)**W;let u=n*je+r*Ue+o*ze,c=s*je+a*Ue+i*ze;if(u<=oe&&(u+=(oe-u)**Ge),c<=oe&&(c+=(oe-c)**Ge),Math.abs(c-u)<Ln)return 0;let l;if(c>u){const f=(c**Pn-u**In)*Nn;l=f<_e?0:f<Ze?f-f*Ke*se:f-se}else{const f=(c**Rn-u**$n)*Bn;l=f>-_e?0:f>-Ze?f-f*Ke*se:f+se}return l*100}function ts(e){}function ns(e,t){t=Array.isArray(t)?t.slice(0,-1).map(n=>`'${n}'`).join(", ")+` or '${t.at(-1)}'`:`'${t}'`}const le=.20689655172413793,Hn=e=>e>le**3?Math.cbrt(e):e/(3*le**2)+4/29,Yn=e=>e>le?e**3:3*le**2*(e-4/29);function kt(e){const t=Hn,n=t(e[1]);return[116*n-16,500*(t(e[0]/.95047)-n),200*(n-t(e[2]/1.08883))]}function At(e){const t=Yn,n=(e[0]+16)/116;return[t(n+e[1]/500)*.95047,t(n),t(n-e[2]/200)*1.08883]}const Vn=[[3.2406,-1.5372,-.4986],[-.9689,1.8758,.0415],[.0557,-.204,1.057]],Wn=e=>e<=.0031308?e*12.92:1.055*e**(1/2.4)-.055,jn=[[.4124,.3576,.1805],[.2126,.7152,.0722],[.0193,.1192,.9505]],Un=e=>e<=.04045?e/12.92:((e+.055)/1.055)**2.4;function Ot(e){const t=Array(3),n=Wn,r=Vn;for(let o=0;o<3;++o)t[o]=Math.round(Ct(n(r[o][0]*e[0]+r[o][1]*e[1]+r[o][2]*e[2]))*255);return{r:t[0],g:t[1],b:t[2]}}function Oe(e){let{r:t,g:n,b:r}=e;const o=[0,0,0],s=Un,a=jn;t=s(t/255),n=s(n/255),r=s(r/255);for(let i=0;i<3;++i)o[i]=a[i][0]*t+a[i][1]*n+a[i][2]*r;return o}function zn(e){return!!e&&/^(#|var\(--|(rgb|hsl)a?\()/.test(e)}function rs(e){return zn(e)&&!/^((rgb|hsl)a?\()?var\(--/.test(e)}const Qe=/^(?<fn>(?:rgb|hsl)a?)\((?<values>.+)\)/,Gn={rgb:(e,t,n,r)=>({r:e,g:t,b:n,a:r}),rgba:(e,t,n,r)=>({r:e,g:t,b:n,a:r}),hsl:(e,t,n,r)=>qe({h:e,s:t,l:n,a:r}),hsla:(e,t,n,r)=>qe({h:e,s:t,l:n,a:r}),hsv:(e,t,n,r)=>H({h:e,s:t,v:n,a:r}),hsva:(e,t,n,r)=>H({h:e,s:t,v:n,a:r})};function F(e){if(typeof e=="number")return{r:(e&16711680)>>16,g:(e&65280)>>8,b:e&255};if(typeof e=="string"&&Qe.test(e)){const{groups:t}=e.match(Qe),{fn:n,values:r}=t,o=r.split(/,\s*/).map(s=>s.endsWith("%")&&["hsl","hsla","hsv","hsva"].includes(n)?parseFloat(s)/100:parseFloat(s));return Gn[n](...o)}else if(typeof e=="string"){let t=e.startsWith("#")?e.slice(1):e;return[3,4].includes(t.length)?t=t.split("").map(n=>n+n).join(""):[6,8].includes(t.length),Pt(t)}else if(typeof e=="object"){if(be(e,["r","g","b"]))return e;if(be(e,["h","s","l"]))return H(Et(e));if(be(e,["h","s","v"]))return H(e)}throw new TypeError(`Invalid color: ${e==null?e:String(e)||e.constructor.name}
Expected #hex, #hexa, rgb(), rgba(), hsl(), hsla(), object or number`)}function H(e){const{h:t,s:n,v:r,a:o}=e,s=i=>{const u=(i+t/60)%6;return r-r*n*Math.max(Math.min(u,4-u,1),0)},a=[s(5),s(3),s(1)].map(i=>Math.round(i*255));return{r:a[0],g:a[1],b:a[2],a:o}}function qe(e){return H(Et(e))}function Zn(e){if(!e)return{h:0,s:1,v:1,a:1};const t=e.r/255,n=e.g/255,r=e.b/255,o=Math.max(t,n,r),s=Math.min(t,n,r);let a=0;o!==s&&(o===t?a=60*(0+(n-r)/(o-s)):o===n?a=60*(2+(r-t)/(o-s)):o===r&&(a=60*(4+(t-n)/(o-s)))),a<0&&(a=a+360);const i=o===0?0:(o-s)/o,u=[a,i,o];return{h:u[0],s:u[1],v:u[2],a:e.a}}function os(e){const{h:t,s:n,v:r,a:o}=e,s=r-r*n/2,a=s===1||s===0?0:(r-s)/Math.min(s,1-s);return{h:t,s:a,l:s,a:o}}function Et(e){const{h:t,s:n,l:r,a:o}=e,s=r+n*Math.min(r,1-r),a=s===0?0:2-2*r/s;return{h:t,s:a,v:s,a:o}}function Kn(e){let{r:t,g:n,b:r,a:o}=e;return o===void 0?`rgb(${t}, ${n}, ${r})`:`rgba(${t}, ${n}, ${r}, ${o})`}function ss(e){return Kn(H(e))}function ae(e){const t=Math.round(e).toString(16);return("00".substr(0,2-t.length)+t).toUpperCase()}function Ft(e){let{r:t,g:n,b:r,a:o}=e;return`#${[ae(t),ae(n),ae(r),o!==void 0?ae(Math.round(o*255)):""].join("")}`}function Pt(e){e=_n(e);let[t,n,r,o]=Cn(e,2).map(s=>parseInt(s,16));return o=o===void 0?o:o/255,{r:t,g:n,b:r,a:o}}function as(e){const t=Pt(e);return Zn(t)}function is(e){return Ft(H(e))}function _n(e){return e.startsWith("#")&&(e=e.slice(1)),e=e.replace(/([^0-9a-f])/gi,"F"),(e.length===3||e.length===4)&&(e=e.split("").map(t=>t+t).join("")),e.length!==6&&(e=He(He(e,6),8,"F")),e}function Xn(e,t){const n=kt(Oe(e));return n[0]=n[0]+t*10,Ot(At(n))}function Qn(e,t){const n=kt(Oe(e));return n[0]=n[0]-t*10,Ot(At(n))}function Ce(e){const t=F(e);return Oe(t)[1]}function us(e,t){const n=Ce(e),r=Ce(t),o=Math.max(n,r),s=Math.min(n,r);return(o+.05)/(s+.05)}function qn(e){const t=Math.abs(Xe(F(0),F(e)));return Math.abs(Xe(F(16777215),F(e)))>Math.min(t,50)?"#fff":"#000"}function Y(e,t){return n=>Object.keys(e).reduce((r,o)=>{const a=typeof e[o]=="object"&&e[o]!=null&&!Array.isArray(e[o])?e[o]:{type:e[o]};return n&&o in n?r[o]={...a,default:n[o]}:r[o]=a,t&&!r[o].source&&(r[o].source=t),r},{})}const Jn=Y({class:[String,Array,Object],style:{type:[String,Array,Object],default:null}},"component");function k(e,t){const n=un();if(!n)throw new Error(`[Vuetify] ${e} must be called from inside a setup function`);return n}function er(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"composables";const t=k(e).type;return N(t?.aliasName||t?.name)}let It=0,ce=new WeakMap;function Ee(){const e=k("getUid");if(ce.has(e))return ce.get(e);{const t=It++;return ce.set(e,t),t}}Ee.reset=()=>{It=0,ce=new WeakMap};function tr(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:k("injectSelf");const{provides:n}=t;if(n&&e in n)return n[e]}const z=Symbol.for("vuetify:defaults");function nr(e){return I(e)}function Fe(){const e=S(z);if(!e)throw new Error("[Vuetify] Could not find defaults instance");return e}function cs(e,t){const n=Fe(),r=I(e),o=y(()=>{if(U(t?.disabled))return n.value;const a=U(t?.scoped),i=U(t?.reset),u=U(t?.root);if(r.value==null&&!(a||i||u))return n.value;let c=w(r.value,{prev:n.value});if(a)return c;if(i||u){const l=Number(i||1/0);for(let f=0;f<=l&&!(!c||!("prev"in c));f++)c=c.prev;return c&&typeof u=="string"&&u in c&&(c=w(w(c,{prev:c}),c[u])),c}return c.prev?w(c.prev,c):c});return Z(z,o),o}function rr(e,t){return typeof e.props?.[t]<"u"||typeof e.props?.[N(t)]<"u"}function or(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Fe();const r=k("useDefaults");if(t=t??r.type.name??r.type.__name,!t)throw new Error("[Vuetify] Could not determine component name");const o=y(()=>n.value?.[e._as??t]),s=new Proxy(e,{get(u,c){const l=Reflect.get(u,c);return c==="class"||c==="style"?[o.value?.[c],l].filter(f=>f!=null):typeof c=="string"&&!rr(r.vnode,c)?o.value?.[c]!==void 0?o.value?.[c]:n.value?.global?.[c]!==void 0?n.value?.global?.[c]:l:l}}),a=P();J(()=>{if(o.value){const u=Object.entries(o.value).filter(c=>{let[l]=c;return l.startsWith(l[0].toUpperCase())});a.value=u.length?Object.fromEntries(u):void 0}else a.value=void 0});function i(){const u=tr(z,r);Z(z,y(()=>a.value?w(u?.value??{},a.value):u?.value))}return{props:s,provideSubDefaults:i}}function ee(e){if(e._setup=e._setup??e.setup,!e.name)return e;if(e._setup){e.props=Y(e.props??{},e.name)();const t=Object.keys(e.props).filter(n=>n!=="class"&&n!=="style");e.filterProps=function(r){return wn(r,t)},e.props._as=String,e.setup=function(r,o){const s=Fe();if(!s.value)return e._setup(r,o);const{props:a,provideSubDefaults:i}=or(r,r._as??e.name,s),u=e._setup(a,o);return i(),u}}return e}function $t(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;return t=>(e?ee:cn)(t)}function ls(e,t){return t.props=e,t}function fs(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"div",n=arguments.length>2?arguments[2]:void 0;return $t()({name:n??ht(ln(e.replace(/__/g,"-"))),props:{tag:{type:String,default:t},...Jn()},setup(r,o){let{slots:s}=o;return()=>pt(r.tag,{class:[e,r.class],style:r.style},s.default?.())}})}function ds(e){if(typeof e.getRootNode!="function"){for(;e.parentNode;)e=e.parentNode;return e!==document?null:document}const t=e.getRootNode();return t!==document&&t.getRootNode({composed:!0})!==document?null:t}const ms="cubic-bezier(0.4, 0, 0.2, 1)",gs="cubic-bezier(0.0, 0, 0.2, 1)",hs="cubic-bezier(0.4, 0, 1, 1)";function ys(e,t,n){return Object.keys(e).filter(r=>Ae(r)&&r.endsWith(t)).reduce((r,o)=>(r[o.slice(0,-t.length)]=s=>e[o](s,n(s)),r),{})}function ps(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;for(;e;){if(t?sr(e):Rt(e))return e;e=e.parentElement}return document.scrollingElement}function vs(e,t){const n=[];if(t&&e&&!t.contains(e))return n;for(;e&&(Rt(e)&&n.push(e),e!==t);)e=e.parentElement;return n}function Rt(e){if(!e||e.nodeType!==Node.ELEMENT_NODE)return!1;const t=window.getComputedStyle(e);return t.overflowY==="scroll"||t.overflowY==="auto"&&e.scrollHeight>e.clientHeight}function sr(e){if(!e||e.nodeType!==Node.ELEMENT_NODE)return!1;const t=window.getComputedStyle(e);return["scroll","auto"].includes(t.overflowY)}function bs(e){for(;e;){if(window.getComputedStyle(e).position==="fixed")return!0;e=e.offsetParent}return!1}function ws(e){const t=k("useRender");t.render=e}function ar(e,t,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:f=>f,o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:f=>f;const s=k("useProxiedModel"),a=I(e[t]!==void 0?e[t]:n),i=N(t),c=i!==t?y(()=>(e[t],!!((s.vnode.props?.hasOwnProperty(t)||s.vnode.props?.hasOwnProperty(i))&&(s.vnode.props?.hasOwnProperty(`onUpdate:${t}`)||s.vnode.props?.hasOwnProperty(`onUpdate:${i}`))))):y(()=>(e[t],!!(s.vnode.props?.hasOwnProperty(t)&&s.vnode.props?.hasOwnProperty(`onUpdate:${t}`))));hn(()=>!c.value,()=>{B(()=>e[t],f=>{a.value=f})});const l=y({get(){const f=e[t];return r(c.value?f:a.value)},set(f){const g=o(f),h=fn(c.value?e[t]:a.value);h===g||r(h)===f||(a.value=g,s?.emit(`update:${t}`,g))}});return Object.defineProperty(l,"externalValue",{get:()=>c.value?e[t]:a.value}),l}const ir={badge:"Badge",open:"Open",close:"Close",dismiss:"Dismiss",confirmEdit:{ok:"OK",cancel:"Cancel"},dataIterator:{noResultsText:"No matching records found",loadingText:"Loading items..."},dataTable:{itemsPerPageText:"Rows per page:",ariaLabel:{sortDescending:"Sorted descending.",sortAscending:"Sorted ascending.",sortNone:"Not sorted.",activateNone:"Activate to remove sorting.",activateDescending:"Activate to sort descending.",activateAscending:"Activate to sort ascending."},sortBy:"Sort by"},dataFooter:{itemsPerPageText:"Items per page:",itemsPerPageAll:"All",nextPage:"Next page",prevPage:"Previous page",firstPage:"First page",lastPage:"Last page",pageText:"{0}-{1} of {2}"},dateRangeInput:{divider:"to"},datePicker:{itemsSelected:"{0} selected",range:{title:"Select dates",header:"Enter dates"},title:"Select date",header:"Enter date",input:{placeholder:"Enter date"}},noDataText:"No data available",carousel:{prev:"Previous visual",next:"Next visual",ariaLabel:{delimiter:"Carousel slide {0} of {1}"}},calendar:{moreEvents:"{0} more",today:"Today"},input:{clear:"Clear {0}",prependAction:"{0} prepended action",appendAction:"{0} appended action",otp:"Please enter OTP character {0}"},fileInput:{counter:"{0} files",counterSize:"{0} files ({1} in total)"},timePicker:{am:"AM",pm:"PM",title:"Select Time"},pagination:{ariaLabel:{root:"Pagination Navigation",next:"Next page",previous:"Previous page",page:"Go to page {0}",currentPage:"Page {0}, Current page",first:"First page",last:"Last page"}},stepper:{next:"Next",prev:"Previous"},rating:{ariaLabel:{item:"Rating {0} of {1}"}},loading:"Loading...",infiniteScroll:{loadMore:"Load more",empty:"No more"}},Je="$vuetify.",et=(e,t)=>e.replace(/\{(\d+)\}/g,(n,r)=>String(t[+r])),Lt=(e,t,n)=>function(r){for(var o=arguments.length,s=new Array(o>1?o-1:0),a=1;a<o;a++)s[a-1]=arguments[a];if(!r.startsWith(Je))return et(r,s);const i=r.replace(Je,""),u=e.value&&n.value[e.value],c=t.value&&n.value[t.value];let l=Se(u,i,null);return l||(`${r}${e.value}`,l=Se(c,i,null)),l||(l=r),typeof l!="string"&&(l=r),et(l,s)};function Nt(e,t){return(n,r)=>new Intl.NumberFormat([e.value,t.value],r).format(n)}function we(e,t,n){const r=ar(e,t,e[t]??n.value);return r.value=e[t]??n.value,B(n,o=>{e[t]==null&&(r.value=n.value)}),r}function Bt(e){return t=>{const n=we(t,"locale",e.current),r=we(t,"fallback",e.fallback),o=we(t,"messages",e.messages);return{name:"vuetify",current:n,fallback:r,messages:o,t:Lt(n,r,o),n:Nt(n,r),provide:Bt({current:n,fallback:r,messages:o})}}}function ur(e){const t=P(e?.locale??"en"),n=P(e?.fallback??"en"),r=I({en:ir,...e?.messages});return{name:"vuetify",current:t,fallback:n,messages:r,t:Lt(t,n,r),n:Nt(t,n),provide:Bt({current:t,fallback:n,messages:r})}}const G=Symbol.for("vuetify:locale");function cr(e){return e.name!=null}function lr(e){const t=e?.adapter&&cr(e?.adapter)?e?.adapter:ur(e),n=mr(t,e);return{...t,...n}}function fr(){const e=S(G);if(!e)throw new Error("[Vuetify] Could not find injected locale instance");return e}function Ds(e){const t=S(G);if(!t)throw new Error("[Vuetify] Could not find injected locale instance");const n=t.provide(e),r=gr(n,t.rtl,e),o={...n,...r};return Z(G,o),o}function dr(){return{af:!1,ar:!0,bg:!1,ca:!1,ckb:!1,cs:!1,de:!1,el:!1,en:!1,es:!1,et:!1,fa:!0,fi:!1,fr:!1,hr:!1,hu:!1,he:!0,id:!1,it:!1,ja:!1,km:!1,ko:!1,lv:!1,lt:!1,nl:!1,no:!1,pl:!1,pt:!1,ro:!1,ru:!1,sk:!1,sl:!1,srCyrl:!1,srLatn:!1,sv:!1,th:!1,tr:!1,az:!1,uk:!1,vi:!1,zhHans:!1,zhHant:!1}}function mr(e,t){const n=I(t?.rtl??dr()),r=y(()=>n.value[e.current.value]??!1);return{isRtl:r,rtl:n,rtlClasses:y(()=>`v-locale--is-${r.value?"rtl":"ltr"}`)}}function gr(e,t,n){const r=y(()=>n.rtl??t.value[e.current.value]??!1);return{isRtl:r,rtl:t,rtlClasses:y(()=>`v-locale--is-${r.value?"rtl":"ltr"}`)}}function hr(){const e=S(G);if(!e)throw new Error("[Vuetify] Could not find injected rtl instance");return{isRtl:e.isRtl,rtlClasses:e.rtlClasses}}const Q={"001":1,AD:1,AE:6,AF:6,AG:0,AI:1,AL:1,AM:1,AN:1,AR:1,AS:0,AT:1,AU:1,AX:1,AZ:1,BA:1,BD:0,BE:1,BG:1,BH:6,BM:1,BN:1,BR:0,BS:0,BT:0,BW:0,BY:1,BZ:0,CA:0,CH:1,CL:1,CM:1,CN:1,CO:0,CR:1,CY:1,CZ:1,DE:1,DJ:6,DK:1,DM:0,DO:0,DZ:6,EC:1,EE:1,EG:6,ES:1,ET:0,FI:1,FJ:1,FO:1,FR:1,GB:1,"GB-alt-variant":0,GE:1,GF:1,GP:1,GR:1,GT:0,GU:0,HK:0,HN:0,HR:1,HU:1,ID:0,IE:1,IL:0,IN:0,IQ:6,IR:6,IS:1,IT:1,JM:0,JO:6,JP:0,KE:0,KG:1,KH:0,KR:0,KW:6,KZ:1,LA:0,LB:1,LI:1,LK:1,LT:1,LU:1,LV:1,LY:6,MC:1,MD:1,ME:1,MH:0,MK:1,MM:0,MN:1,MO:0,MQ:1,MT:0,MV:5,MX:0,MY:1,MZ:0,NI:0,NL:1,NO:1,NP:0,NZ:1,OM:6,PA:0,PE:0,PH:0,PK:0,PL:1,PR:0,PT:0,PY:0,QA:6,RE:1,RO:1,RS:1,RU:1,SA:0,SD:6,SE:1,SG:0,SI:1,SK:1,SM:1,SV:0,SY:6,TH:0,TJ:1,TM:1,TR:1,TT:0,TW:0,UA:1,UM:0,US:0,UY:1,UZ:1,VA:1,VE:0,VI:0,VN:1,WS:0,XK:1,YE:0,ZA:0,ZW:0};function yr(e,t){const n=[];let r=[];const o=Ht(e),s=Yt(e),a=(o.getDay()-Q[t.slice(-2).toUpperCase()]+7)%7,i=(s.getDay()-Q[t.slice(-2).toUpperCase()]+7)%7;for(let u=0;u<a;u++){const c=new Date(o);c.setDate(c.getDate()-(a-u)),r.push(c)}for(let u=1;u<=s.getDate();u++){const c=new Date(e.getFullYear(),e.getMonth(),u);r.push(c),r.length===7&&(n.push(r),r=[])}for(let u=1;u<7-i;u++){const c=new Date(s);c.setDate(c.getDate()+u),r.push(c)}return r.length>0&&n.push(r),n}function pr(e,t){const n=new Date(e);for(;n.getDay()!==(Q[t.slice(-2).toUpperCase()]??0);)n.setDate(n.getDate()-1);return n}function vr(e,t){const n=new Date(e),r=((Q[t.slice(-2).toUpperCase()]??0)+6)%7;for(;n.getDay()!==r;)n.setDate(n.getDate()+1);return n}function Ht(e){return new Date(e.getFullYear(),e.getMonth(),1)}function Yt(e){return new Date(e.getFullYear(),e.getMonth()+1,0)}function br(e){const t=e.split("-").map(Number);return new Date(t[0],t[1]-1,t[2])}const wr=/^([12]\d{3}-([1-9]|0[1-9]|1[0-2])-([1-9]|0[1-9]|[12]\d|3[01]))$/;function Vt(e){if(e==null)return new Date;if(e instanceof Date)return e;if(typeof e=="string"){let t;if(wr.test(e))return br(e);if(t=Date.parse(e),!isNaN(t))return new Date(t)}return null}const tt=new Date(2e3,0,2);function Dr(e){const t=Q[e.slice(-2).toUpperCase()];return Dt(7).map(n=>{const r=new Date(tt);return r.setDate(tt.getDate()+t+n),new Intl.DateTimeFormat(e,{weekday:"narrow"}).format(r)})}function Sr(e,t,n,r){const o=Vt(e)??new Date,s=r?.[t];if(typeof s=="function")return s(o,t,n);let a={};switch(t){case"fullDate":a={year:"numeric",month:"long",day:"numeric"};break;case"fullDateWithWeekday":a={weekday:"long",year:"numeric",month:"long",day:"numeric"};break;case"normalDate":const i=o.getDate(),u=new Intl.DateTimeFormat(n,{month:"long"}).format(o);return`${i} ${u}`;case"normalDateWithWeekday":a={weekday:"short",day:"numeric",month:"short"};break;case"shortDate":a={month:"short",day:"numeric"};break;case"year":a={year:"numeric"};break;case"month":a={month:"long"};break;case"monthShort":a={month:"short"};break;case"monthAndYear":a={month:"long",year:"numeric"};break;case"monthAndDate":a={month:"long",day:"numeric"};break;case"weekday":a={weekday:"long"};break;case"weekdayShort":a={weekday:"short"};break;case"dayOfMonth":return new Intl.NumberFormat(n).format(o.getDate());case"hours12h":a={hour:"numeric",hour12:!0};break;case"hours24h":a={hour:"numeric",hour12:!1};break;case"minutes":a={minute:"numeric"};break;case"seconds":a={second:"numeric"};break;case"fullTime":a={hour:"numeric",minute:"numeric",second:"numeric",hour12:!0};break;case"fullTime12h":a={hour:"numeric",minute:"numeric",second:"numeric",hour12:!0};break;case"fullTime24h":a={hour:"numeric",minute:"numeric",second:"numeric",hour12:!1};break;case"fullDateTime":a={year:"numeric",month:"long",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric",hour12:!0};break;case"fullDateTime12h":a={year:"numeric",month:"long",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric",hour12:!0};break;case"fullDateTime24h":a={year:"numeric",month:"long",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric",hour12:!1};break;case"keyboardDate":a={year:"numeric",month:"2-digit",day:"2-digit"};break;case"keyboardDateTime":a={year:"numeric",month:"2-digit",day:"2-digit",hour:"numeric",minute:"numeric",second:"numeric",hour12:!1};break;case"keyboardDateTime12h":a={year:"numeric",month:"2-digit",day:"2-digit",hour:"numeric",minute:"numeric",second:"numeric",hour12:!0};break;case"keyboardDateTime24h":a={year:"numeric",month:"2-digit",day:"2-digit",hour:"numeric",minute:"numeric",second:"numeric",hour12:!1};break;default:a=s??{timeZone:"UTC",timeZoneName:"short"}}return new Intl.DateTimeFormat(n,a).format(o)}function xr(e,t){const n=e.toJsDate(t),r=n.getFullYear(),o=Ye(String(n.getMonth()+1),2,"0"),s=Ye(String(n.getDate()),2,"0");return`${r}-${o}-${s}`}function Cr(e){const[t,n,r]=e.split("-").map(Number);return new Date(t,n-1,r)}function Tr(e,t){const n=new Date(e);return n.setMinutes(n.getMinutes()+t),n}function Mr(e,t){const n=new Date(e);return n.setHours(n.getHours()+t),n}function kr(e,t){const n=new Date(e);return n.setDate(n.getDate()+t),n}function Ar(e,t){const n=new Date(e);return n.setDate(n.getDate()+t*7),n}function Or(e,t){const n=new Date(e);return n.setDate(1),n.setMonth(n.getMonth()+t),n}function Er(e){return e.getFullYear()}function Fr(e){return e.getMonth()}function Pr(e){return e.getDate()}function Ir(e){return new Date(e.getFullYear(),e.getMonth()+1,1)}function $r(e){return new Date(e.getFullYear(),e.getMonth()-1,1)}function Rr(e){return e.getHours()}function Lr(e){return e.getMinutes()}function Nr(e){return new Date(e.getFullYear(),0,1)}function Br(e){return new Date(e.getFullYear(),11,31)}function Hr(e,t){return fe(e,t[0])&&Wr(e,t[1])}function Yr(e){const t=new Date(e);return t instanceof Date&&!isNaN(t.getTime())}function fe(e,t){return e.getTime()>t.getTime()}function Vr(e,t){return fe(Te(e),Te(t))}function Wr(e,t){return e.getTime()<t.getTime()}function nt(e,t){return e.getTime()===t.getTime()}function jr(e,t){return e.getDate()===t.getDate()&&e.getMonth()===t.getMonth()&&e.getFullYear()===t.getFullYear()}function Ur(e,t){return e.getMonth()===t.getMonth()&&e.getFullYear()===t.getFullYear()}function zr(e,t){return e.getFullYear()===t.getFullYear()}function Gr(e,t,n){const r=new Date(e),o=new Date(t);switch(n){case"years":return r.getFullYear()-o.getFullYear();case"quarters":return Math.floor((r.getMonth()-o.getMonth()+(r.getFullYear()-o.getFullYear())*12)/4);case"months":return r.getMonth()-o.getMonth()+(r.getFullYear()-o.getFullYear())*12;case"weeks":return Math.floor((r.getTime()-o.getTime())/(1e3*60*60*24*7));case"days":return Math.floor((r.getTime()-o.getTime())/(1e3*60*60*24));case"hours":return Math.floor((r.getTime()-o.getTime())/(1e3*60*60));case"minutes":return Math.floor((r.getTime()-o.getTime())/(1e3*60));case"seconds":return Math.floor((r.getTime()-o.getTime())/1e3);default:return r.getTime()-o.getTime()}}function Zr(e,t){const n=new Date(e);return n.setHours(t),n}function Kr(e,t){const n=new Date(e);return n.setMinutes(t),n}function _r(e,t){const n=new Date(e);return n.setMonth(t),n}function Xr(e,t){const n=new Date(e);return n.setDate(t),n}function Qr(e,t){const n=new Date(e);return n.setFullYear(t),n}function Te(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate(),0,0,0,0)}function qr(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate(),23,59,59,999)}class Jr{constructor(t){this.locale=t.locale,this.formats=t.formats}date(t){return Vt(t)}toJsDate(t){return t}toISO(t){return xr(this,t)}parseISO(t){return Cr(t)}addMinutes(t,n){return Tr(t,n)}addHours(t,n){return Mr(t,n)}addDays(t,n){return kr(t,n)}addWeeks(t,n){return Ar(t,n)}addMonths(t,n){return Or(t,n)}getWeekArray(t){return yr(t,this.locale)}startOfWeek(t){return pr(t,this.locale)}endOfWeek(t){return vr(t,this.locale)}startOfMonth(t){return Ht(t)}endOfMonth(t){return Yt(t)}format(t,n){return Sr(t,n,this.locale,this.formats)}isEqual(t,n){return nt(t,n)}isValid(t){return Yr(t)}isWithinRange(t,n){return Hr(t,n)}isAfter(t,n){return fe(t,n)}isAfterDay(t,n){return Vr(t,n)}isBefore(t,n){return!fe(t,n)&&!nt(t,n)}isSameDay(t,n){return jr(t,n)}isSameMonth(t,n){return Ur(t,n)}isSameYear(t,n){return zr(t,n)}setMinutes(t,n){return Kr(t,n)}setHours(t,n){return Zr(t,n)}setMonth(t,n){return _r(t,n)}setDate(t,n){return Xr(t,n)}setYear(t,n){return Qr(t,n)}getDiff(t,n,r){return Gr(t,n,r)}getWeekdays(){return Dr(this.locale)}getYear(t){return Er(t)}getMonth(t){return Fr(t)}getDate(t){return Pr(t)}getNextMonth(t){return Ir(t)}getPreviousMonth(t){return $r(t)}getHours(t){return Rr(t)}getMinutes(t){return Lr(t)}startOfDay(t){return Te(t)}endOfDay(t){return qr(t)}startOfYear(t){return Nr(t)}endOfYear(t){return Br(t)}}const Wt=Symbol.for("vuetify:date-options"),rt=Symbol.for("vuetify:date-adapter");function eo(e,t){const n=w({adapter:Jr,locale:{af:"af-ZA",bg:"bg-BG",ca:"ca-ES",ckb:"",cs:"cs-CZ",de:"de-DE",el:"el-GR",en:"en-US",et:"et-EE",fa:"fa-IR",fi:"fi-FI",hr:"hr-HR",hu:"hu-HU",he:"he-IL",id:"id-ID",it:"it-IT",ja:"ja-JP",ko:"ko-KR",lv:"lv-LV",lt:"lt-LT",nl:"nl-NL",no:"no-NO",pl:"pl-PL",pt:"pt-PT",ro:"ro-RO",ru:"ru-RU",sk:"sk-SK",sl:"sl-SI",srCyrl:"sr-SP",srLatn:"sr-SP",sv:"sv-SE",th:"th-TH",tr:"tr-TR",az:"az-AZ",uk:"uk-UA",vi:"vi-VN",zhHans:"zh-CN",zhHant:"zh-TW"}},e);return{options:n,instance:jt(n,t)}}function jt(e,t){const n=O(typeof e.adapter=="function"?new e.adapter({locale:e.locale[t.current.value]??t.current.value,formats:e.formats}):e.adapter);return B(t.current,r=>{n.locale=e.locale[r]??r??n.locale}),n}function Ss(){const e=S(Wt);if(!e)throw new Error("[Vuetify] Could not find injected date options");const t=fr();return jt(e,t)}function xs(e,t){const n=e.toJsDate(t);let r=n.getFullYear(),o=new Date(r,0,1);if(n<o)r=r-1,o=new Date(r,0,1);else{const i=new Date(r+1,0,1);n>=i&&(r=r+1,o=i)}const s=Math.abs(n.getTime()-o.getTime()),a=Math.ceil(s/(1e3*60*60*24));return Math.floor(a/7)+1}const Cs=["sm","md","lg","xl","xxl"],Me=Symbol.for("vuetify:display"),ot={mobileBreakpoint:"lg",thresholds:{xs:0,sm:600,md:960,lg:1280,xl:1920,xxl:2560}},to=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:ot;return w(ot,e)};function st(e){return D&&!e?window.innerWidth:typeof e=="object"&&e.clientWidth||0}function at(e){return D&&!e?window.innerHeight:typeof e=="object"&&e.clientHeight||0}function it(e){const t=D&&!e?window.navigator.userAgent:"ssr";function n(d){return!!t.match(d)}const r=n(/android/i),o=n(/iphone|ipad|ipod/i),s=n(/cordova/i),a=n(/electron/i),i=n(/chrome/i),u=n(/edge/i),c=n(/firefox/i),l=n(/opera/i),f=n(/win/i),g=n(/mac/i),h=n(/linux/i);return{android:r,ios:o,cordova:s,electron:a,chrome:i,edge:u,firefox:c,opera:l,win:f,mac:g,linux:h,touch:yn,ssr:t==="ssr"}}function no(e,t){const{thresholds:n,mobileBreakpoint:r}=to(e),o=P(at(t)),s=P(it(t)),a=O({}),i=P(st(t));function u(){o.value=at(),i.value=st()}function c(){u(),s.value=it()}return J(()=>{const l=i.value<n.sm,f=i.value<n.md&&!l,g=i.value<n.lg&&!(f||l),h=i.value<n.xl&&!(g||f||l),d=i.value<n.xxl&&!(h||g||f||l),m=i.value>=n.xxl,p=l?"xs":f?"sm":g?"md":h?"lg":d?"xl":"xxl",C=typeof r=="number"?r:n[r],T=i.value<C;a.xs=l,a.sm=f,a.md=g,a.lg=h,a.xl=d,a.xxl=m,a.smAndUp=!l,a.mdAndUp=!(l||f),a.lgAndUp=!(l||f||g),a.xlAndUp=!(l||f||g||h),a.smAndDown=!(g||h||d||m),a.mdAndDown=!(h||d||m),a.lgAndDown=!(d||m),a.xlAndDown=!m,a.name=p,a.height=o.value,a.width=i.value,a.mobile=T,a.mobileBreakpoint=r,a.platform=s.value,a.thresholds=n}),D&&window.addEventListener("resize",u,{passive:!0}),{...gt(a),update:c,ssr:!!t}}const Ts=Y({mobile:{type:Boolean,default:!1},mobileBreakpoint:[Number,String]},"display");function Ms(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:er();const n=S(Me);if(!n)throw new Error("Could not find Vuetify display injection");const r=y(()=>{if(e.mobile!=null)return e.mobile;if(!e.mobileBreakpoint)return n.mobile.value;const s=typeof e.mobileBreakpoint=="number"?e.mobileBreakpoint:n.thresholds.value[e.mobileBreakpoint];return n.width.value<s}),o=y(()=>t?{[`${t}--mobile`]:r.value}:{});return{...n,displayClasses:o,mobile:r}}const Ut=Symbol.for("vuetify:goto");function zt(){return{container:void 0,duration:300,layout:!1,offset:0,easing:"easeInOutCubic",patterns:{linear:e=>e,easeInQuad:e=>e**2,easeOutQuad:e=>e*(2-e),easeInOutQuad:e=>e<.5?2*e**2:-1+(4-2*e)*e,easeInCubic:e=>e**3,easeOutCubic:e=>--e**3+1,easeInOutCubic:e=>e<.5?4*e**3:(e-1)*(2*e-2)*(2*e-2)+1,easeInQuart:e=>e**4,easeOutQuart:e=>1- --e**4,easeInOutQuart:e=>e<.5?8*e**4:1-8*--e**4,easeInQuint:e=>e**5,easeOutQuint:e=>1+--e**5,easeInOutQuint:e=>e<.5?16*e**5:1+16*--e**5}}}function ro(e){return Pe(e)??(document.scrollingElement||document.body)}function Pe(e){return typeof e=="string"?document.querySelector(e):St(e)}function De(e,t,n){if(typeof e=="number")return t&&n?-e:e;let r=Pe(e),o=0;for(;r;)o+=t?r.offsetLeft:r.offsetTop,r=r.offsetParent;return o}function oo(e,t){return{rtl:t.isRtl,options:w(zt(),e)}}async function ut(e,t,n,r){const o=n?"scrollLeft":"scrollTop",s=w(r?.options??zt(),t),a=r?.rtl.value,i=(typeof e=="number"?e:Pe(e))??0,u=s.container==="parent"&&i instanceof HTMLElement?i.parentElement:ro(s.container),c=typeof s.easing=="function"?s.easing:s.patterns[s.easing];if(!c)throw new TypeError(`Easing function "${s.easing}" not found.`);let l;if(typeof i=="number")l=De(i,n,a);else if(l=De(i,n,a)-De(u,n,a),s.layout){const d=window.getComputedStyle(i).getPropertyValue("--v-layout-top");d&&(l-=parseInt(d,10))}l+=s.offset,l=so(u,l,!!a,!!n);const f=u[o]??0;if(l===f)return Promise.resolve(l);const g=performance.now();return new Promise(h=>requestAnimationFrame(function d(m){const C=(m-g)/s.duration,T=Math.floor(f+(l-f)*c(Ct(C,0,1)));if(u[o]=T,C>=1&&Math.abs(T-u[o])<10)return h(l);if(C>2)return h(u[o]);requestAnimationFrame(d)}))}function ks(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const t=S(Ut),{isRtl:n}=hr();if(!t)throw new Error("[Vuetify] Could not find injected goto instance");const r={...t,rtl:y(()=>t.rtl.value||n.value)};async function o(s,a){return ut(s,w(e,a),!1,r)}return o.horizontal=async(s,a)=>ut(s,w(e,a),!0,r),o}function so(e,t,n,r){const{scrollWidth:o,scrollHeight:s}=e,[a,i]=e===document.scrollingElement?[window.innerWidth,window.innerHeight]:[e.offsetWidth,e.offsetHeight];let u,c;return r?n?(u=-(o-a),c=0):(u=0,c=o-a):(u=0,c=s+-i),Math.max(Math.min(t,c),u)}const ao={collapse:"mdi-chevron-up",complete:"mdi-check",cancel:"mdi-close-circle",close:"mdi-close",delete:"mdi-close-circle",clear:"mdi-close-circle",success:"mdi-check-circle",info:"mdi-information",warning:"mdi-alert-circle",error:"mdi-close-circle",prev:"mdi-chevron-left",next:"mdi-chevron-right",checkboxOn:"mdi-checkbox-marked",checkboxOff:"mdi-checkbox-blank-outline",checkboxIndeterminate:"mdi-minus-box",delimiter:"mdi-circle",sortAsc:"mdi-arrow-up",sortDesc:"mdi-arrow-down",expand:"mdi-chevron-down",menu:"mdi-menu",subgroup:"mdi-menu-down",dropdown:"mdi-menu-down",radioOn:"mdi-radiobox-marked",radioOff:"mdi-radiobox-blank",edit:"mdi-pencil",ratingEmpty:"mdi-star-outline",ratingFull:"mdi-star",ratingHalf:"mdi-star-half-full",loading:"mdi-cached",first:"mdi-page-first",last:"mdi-page-last",unfold:"mdi-unfold-more-horizontal",file:"mdi-paperclip",plus:"mdi-plus",minus:"mdi-minus",calendar:"mdi-calendar",treeviewCollapse:"mdi-menu-down",treeviewExpand:"mdi-menu-right",eyeDropper:"mdi-eyedropper"},io={component:e=>pt(Zt,{...e,class:"mdi"})},uo=[String,Function,Object,Array],ke=Symbol.for("vuetify:icons"),ge=Y({icon:{type:uo},tag:{type:String,required:!0}},"icon"),ct=$t()({name:"VComponentIcon",props:ge(),setup(e,t){let{slots:n}=t;return()=>{const r=e.icon;return E(e.tag,null,{default:()=>[e.icon?E(r,null,null):n.default?.()]})}}}),Gt=ee({name:"VSvgIcon",inheritAttrs:!1,props:ge(),setup(e,t){let{attrs:n}=t;return()=>E(e.tag,dn(n,{style:null}),{default:()=>[E("svg",{class:"v-icon__svg",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",role:"img","aria-hidden":"true"},[Array.isArray(e.icon)?e.icon.map(r=>Array.isArray(r)?E("path",{d:r[0],"fill-opacity":r[1]},null):E("path",{d:r},null)):E("path",{d:e.icon},null)])]})}}),As=ee({name:"VLigatureIcon",props:ge(),setup(e){return()=>E(e.tag,null,{default:()=>[e.icon]})}}),Zt=ee({name:"VClassIcon",props:ge(),setup(e){return()=>E(e.tag,{class:e.icon},null)}});function co(){return{svg:{component:Gt},class:{component:Zt}}}function lo(e){const t=co(),n=e?.defaultSet??"mdi";return n==="mdi"&&!t.mdi&&(t.mdi=io),w({defaultSet:n,sets:t,aliases:{...ao,vuetify:["M8.2241 14.2009L12 21L22 3H14.4459L8.2241 14.2009Z",["M7.26303 12.4733L7.00113 12L2 3H12.5261C12.5261 3 12.5261 3 12.5261 3L7.26303 12.4733Z",.6]],"vuetify-outline":"svg:M7.26 12.47 12.53 3H2L7.26 12.47ZM14.45 3 8.22 14.2 12 21 22 3H14.45ZM18.6 5 12 16.88 10.51 14.2 15.62 5ZM7.26 8.35 5.4 5H9.13L7.26 8.35Z","vuetify-play":["m6.376 13.184-4.11-7.192C1.505 4.66 2.467 3 4.003 3h8.532l-.953 1.576-.006.01-.396.677c-.429.732-.214 1.507.194 2.015.404.503 1.092.878 1.869.806a3.72 3.72 0 0 1 1.005.022c.276.053.434.143.523.237.138.146.38.635-.25 2.09-.893 1.63-1.553 1.722-1.847 1.677-.213-.033-.468-.158-.756-.406a4.95 4.95 0 0 1-.8-.927c-.39-.564-1.04-.84-1.66-.846-.625-.006-1.316.27-1.693.921l-.478.826-.911 1.506Z",["M9.093 11.552c.046-.079.144-.15.32-.148a.53.53 0 0 1 .43.207c.285.414.636.847 1.046 1.2.405.35.914.662 1.516.754 1.334.205 2.502-.698 3.48-2.495l.014-.028.013-.03c.687-1.574.774-2.852-.005-3.675-.37-.391-.861-.586-1.333-.676a5.243 5.243 0 0 0-1.447-.044c-.173.016-.393-.073-.54-.257-.145-.18-.127-.316-.082-.392l.393-.672L14.287 3h5.71c1.536 0 2.499 1.659 1.737 2.992l-7.997 13.996c-.768 1.344-2.706 1.344-3.473 0l-3.037-5.314 1.377-2.278.004-.006.004-.007.481-.831Z",.6]]}},e)}const Os=e=>{const t=S(ke);if(!t)throw new Error("Missing Vuetify Icons provide!");return{iconData:y(()=>{const r=U(e);if(!r)return{component:ct};let o=r;if(typeof o=="string"&&(o=o.trim(),o.startsWith("$")&&(o=t.aliases?.[o.slice(1)])),Array.isArray(o))return{component:Gt,icon:o};if(typeof o!="string")return{component:ct,icon:o};const s=Object.keys(t.sets).find(u=>typeof o=="string"&&o.startsWith(`${u}:`)),a=s?o.slice(s.length+1):o;return{component:t.sets[s??t.defaultSet].component,icon:a}})}},q=Symbol.for("vuetify:theme"),Es=Y({theme:String},"theme");function lt(){return{defaultTheme:"light",variations:{colors:[],lighten:0,darken:0},themes:{light:{dark:!1,colors:{background:"#FFFFFF",surface:"#FFFFFF","surface-bright":"#FFFFFF","surface-light":"#EEEEEE","surface-variant":"#424242","on-surface-variant":"#EEEEEE",primary:"#1867C0","primary-darken-1":"#1F5592",secondary:"#48A9A6","secondary-darken-1":"#018786",error:"#B00020",info:"#2196F3",success:"#4CAF50",warning:"#FB8C00"},variables:{"border-color":"#000000","border-opacity":.12,"high-emphasis-opacity":.87,"medium-emphasis-opacity":.6,"disabled-opacity":.38,"idle-opacity":.04,"hover-opacity":.04,"focus-opacity":.12,"selected-opacity":.08,"activated-opacity":.12,"pressed-opacity":.12,"dragged-opacity":.08,"theme-kbd":"#212529","theme-on-kbd":"#FFFFFF","theme-code":"#F5F5F5","theme-on-code":"#000000"}},dark:{dark:!0,colors:{background:"#121212",surface:"#212121","surface-bright":"#ccbfd6","surface-light":"#424242","surface-variant":"#a3a3a3","on-surface-variant":"#424242",primary:"#2196F3","primary-darken-1":"#277CC1",secondary:"#54B6B2","secondary-darken-1":"#48A9A6",error:"#CF6679",info:"#2196F3",success:"#4CAF50",warning:"#FB8C00"},variables:{"border-color":"#FFFFFF","border-opacity":.12,"high-emphasis-opacity":1,"medium-emphasis-opacity":.7,"disabled-opacity":.5,"idle-opacity":.1,"hover-opacity":.04,"focus-opacity":.12,"selected-opacity":.08,"activated-opacity":.12,"pressed-opacity":.16,"dragged-opacity":.08,"theme-kbd":"#212529","theme-on-kbd":"#FFFFFF","theme-code":"#343434","theme-on-code":"#CCCCCC"}}}}}function fo(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:lt();const t=lt();if(!e)return{...t,isDisabled:!0};const n={};for(const[r,o]of Object.entries(e.themes??{})){const s=o.dark||r==="dark"?t.themes?.dark:t.themes?.light;n[r]=w(s,o)}return w(t,{...e,themes:n})}function mo(e){const t=fo(e),n=I(t.defaultTheme),r=I(t.themes),o=y(()=>{const l={};for(const[f,g]of Object.entries(r.value)){const h=l[f]={...g,colors:{...g.colors}};if(t.variations)for(const d of t.variations.colors){const m=h.colors[d];if(m)for(const p of["lighten","darken"]){const C=p==="lighten"?Xn:Qn;for(const T of Dt(t.variations[p],1))h.colors[`${d}-${p}-${T}`]=Ft(C(F(m),T))}}for(const d of Object.keys(h.colors)){if(/^on-[a-z]/.test(d)||h.colors[`on-${d}`])continue;const m=`on-${d}`,p=F(h.colors[d]);h.colors[m]=qn(p)}}return l}),s=y(()=>o.value[n.value]),a=y(()=>{const l=[];s.value?.dark&&L(l,":root",["color-scheme: dark"]),L(l,":root",ft(s.value));for(const[d,m]of Object.entries(o.value))L(l,`.v-theme--${d}`,[`color-scheme: ${m.dark?"dark":"normal"}`,...ft(m)]);const f=[],g=[],h=new Set(Object.values(o.value).flatMap(d=>Object.keys(d.colors)));for(const d of h)/^on-[a-z]/.test(d)?L(g,`.${d}`,[`color: rgb(var(--v-theme-${d})) !important`]):(L(f,`.bg-${d}`,[`--v-theme-overlay-multiplier: var(--v-theme-${d}-overlay-multiplier)`,`background-color: rgb(var(--v-theme-${d})) !important`,`color: rgb(var(--v-theme-on-${d})) !important`]),L(g,`.text-${d}`,[`color: rgb(var(--v-theme-${d})) !important`]),L(g,`.border-${d}`,[`--v-border-color: var(--v-theme-${d})`]));return l.push(...f,...g),l.map((d,m)=>m===0?d:` ${d}`).join("")});function i(){return{style:[{children:a.value,id:"vuetify-theme-stylesheet",nonce:t.cspNonce||!1}]}}function u(l){if(t.isDisabled)return;const f=l._context.provides.usehead;if(f)if(f.push){const g=f.push(i);D&&B(a,()=>{g.patch(i)})}else D?(f.addHeadObjs(y(i)),J(()=>f.updateDOM())):f.addHeadObjs(i());else{let h=function(){if(typeof document<"u"&&!g){const d=document.createElement("style");d.type="text/css",d.id="vuetify-theme-stylesheet",t.cspNonce&&d.setAttribute("nonce",t.cspNonce),g=d,document.head.appendChild(g)}g&&(g.innerHTML=a.value)},g=D?document.getElementById("vuetify-theme-stylesheet"):null;D?B(a,h,{immediate:!0}):h()}}const c=y(()=>t.isDisabled?void 0:`v-theme--${n.value}`);return{install:u,isDisabled:t.isDisabled,name:n,themes:r,current:s,computedThemes:o,themeClasses:c,styles:a,global:{name:n,current:s}}}function Fs(e){k("provideTheme");const t=S(q,null);if(!t)throw new Error("Could not find Vuetify theme injection");const n=y(()=>e.theme??t.name.value),r=y(()=>t.themes.value[n.value]),o=y(()=>t.isDisabled?void 0:`v-theme--${n.value}`),s={...t,name:n,current:r,themeClasses:o};return Z(q,s),s}function Ps(){k("useTheme");const e=S(q,null);if(!e)throw new Error("Could not find Vuetify theme injection");return e}function L(e,t,n){e.push(`${t} {
`,...n.map(r=>` ${r};
`),`}
`)}function ft(e){const t=e.dark?2:1,n=e.dark?1:2,r=[];for(const[o,s]of Object.entries(e.colors)){const a=F(s);r.push(`--v-theme-${o}: ${a.r},${a.g},${a.b}`),o.startsWith("on-")||r.push(`--v-theme-${o}-overlay-multiplier: ${Ce(s)>.18?t:n}`)}for(const[o,s]of Object.entries(e.variables)){const a=typeof s=="string"&&s.startsWith("#")?F(s):void 0,i=a?`${a.r}, ${a.g}, ${a.b}`:void 0;r.push(`--v-${o}: ${i??s}`)}return r}function go(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"content";const n=En(),r=I();if(D){const o=new ResizeObserver(s=>{e?.(s,o),s.length&&(t==="content"?r.value=s[0].contentRect:r.value=s[0].target.getBoundingClientRect())});vt(()=>{o.disconnect()}),B(()=>n.el,(s,a)=>{a&&(o.unobserve(a),r.value=void 0),s&&o.observe(s)},{flush:"post"})}return{resizeRef:n,contentRect:yt(r)}}const de=Symbol.for("vuetify:layout"),Kt=Symbol.for("vuetify:layout-item"),dt=1e3,Is=Y({overlaps:{type:Array,default:()=>[]},fullHeight:Boolean},"layout"),$s=Y({name:{type:String},order:{type:[Number,String],default:0},absolute:Boolean},"layout-item");function Rs(){const e=S(de);if(!e)throw new Error("[Vuetify] Could not find injected layout");return{layoutIsReady:me(),getLayoutItem:e.getLayoutItem,mainRect:e.mainRect,mainStyles:e.mainStyles}}function Ls(e){const t=S(de);if(!t)throw new Error("[Vuetify] Could not find injected layout");const n=e.id??`layout-item-${Ee()}`,r=k("useLayoutItem");Z(Kt,{id:n});const o=P(!1);mn(()=>o.value=!0),gn(()=>o.value=!1);const s=me(),{layoutItemStyles:a,layoutItemScrimStyles:i}=t.register(r,{...e,active:y(()=>o.value?!1:e.active.value),id:n});return vt(()=>t.unregister(n)),{layoutItemStyles:a,layoutRect:t.layoutRect,layoutItemScrimStyles:i,layoutIsReady:s}}const ho=(e,t,n,r)=>{let o={top:0,left:0,right:0,bottom:0};const s=[{id:"",layer:{...o}}];for(const a of e){const i=t.get(a),u=n.get(a),c=r.get(a);if(!i||!u||!c)continue;const l={...o,[i.value]:parseInt(o[i.value],10)+(c.value?parseInt(u.value,10):0)};s.push({id:a,layer:l}),o=l}return s};function Ns(e){const t=S(de,null),n=y(()=>t?t.rootZIndex.value-100:dt),r=I([]),o=O(new Map),s=O(new Map),a=O(new Map),i=O(new Map),u=O(new Map),{resizeRef:c,contentRect:l}=go(),f=Ve(()=>{const b=[...new Set([...a.values()].map(v=>v.value))].sort((v,$)=>v-$),M=[];for(const v of b){const $=r.value.filter(x=>a.get(x)?.value===v);M.push(...$)}return ho(M,o,s,i)}),g=y(()=>!Array.from(u.values()).some(b=>b.value)),h=y(()=>f.value[f.value.length-1].layer),d=y(()=>({"--v-layout-left":ne(h.value.left),"--v-layout-right":ne(h.value.right),"--v-layout-top":ne(h.value.top),"--v-layout-bottom":ne(h.value.bottom),...g.value?void 0:{transition:"none"}})),m=Ve(()=>f.value.slice(1).map((b,M)=>{let{id:v}=b;const{layer:$}=f.value[M],x=s.get(v),te=o.get(v);return{id:v,...$,size:Number(x.value),position:te.value}})),p=b=>m.value.find(M=>M.id===b),C=k("createLayout"),T=me();Z(de,{register:(b,M)=>{let{id:v,order:$,position:x,layoutSize:te,elementSize:K,active:Ie,disableTransitions:$e,absolute:Qt}=M;a.set(v,$),o.set(v,x),s.set(v,te),i.set(v,Ie),$e&&u.set(v,$e);const Re=X(Kt,C?.vnode).indexOf(b);Re>-1?r.value.splice(Re,0,v):r.value.push(v);const he=y(()=>m.value.findIndex(_=>_.id===v)),ye=y(()=>n.value+f.value.length*2-he.value*2),qt=y(()=>{const _=x.value==="left"||x.value==="right",pe=x.value==="right",en=x.value==="bottom",ve=K.value??te.value,tn=ve===0?"%":"px",nn={[x.value]:0,zIndex:ye.value,transform:`translate${_?"X":"Y"}(${(Ie.value?0:-(ve===0?100:ve))*(pe||en?-1:1)}${tn})`,position:Qt.value||n.value!==dt?"absolute":"fixed",...g.value?void 0:{transition:"none"}};if(he.value<0)throw new Error(`Layout item "${v}" is missing`);const A=m.value[he.value];if(!A)throw new Error(`[Vuetify] Could not find layout item "${v}"`);return{...nn,height:_?`calc(100% - ${A.top}px - ${A.bottom}px)`:K.value?`${K.value}px`:void 0,left:pe?void 0:`${A.left}px`,right:pe?`${A.right}px`:void 0,top:x.value!=="bottom"?`${A.top}px`:void 0,bottom:x.value!=="top"?`${A.bottom}px`:void 0,width:_?K.value?`${K.value}px`:void 0:`calc(100% - ${A.left}px - ${A.right}px)`}}),Jt=y(()=>({zIndex:ye.value-1}));return{layoutItemStyles:qt,layoutItemScrimStyles:Jt,zIndex:ye}},unregister:b=>{a.delete(b),o.delete(b),s.delete(b),i.delete(b),u.delete(b),r.value=r.value.filter(M=>M!==b)},mainRect:h,mainStyles:d,getLayoutItem:p,items:m,layoutRect:l,rootZIndex:n,layoutIsReady:T});const _t=y(()=>["v-layout",{"v-layout--full-height":e.fullHeight}]),Xt=y(()=>({zIndex:t?n.value:void 0,position:t?"relative":void 0,overflow:t?"hidden":void 0}));return{layoutClasses:_t,layoutStyles:Xt,getLayoutItem:p,items:m,layoutRect:l,layoutIsReady:T,layoutRef:c}}function yo(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const{blueprint:t,...n}=e,r=w(t,n),{aliases:o={},components:s={},directives:a={}}=r,i=nr(r.defaults),u=no(r.display,r.ssr),c=mo(r.theme),l=lo(r.icons),f=lr(r.locale),g=eo(r.date,f),h=oo(r.goTo,f);return{install:m=>{for(const p in a)m.directive(p,a[p]);for(const p in s)m.component(p,s[p]);for(const p in o)m.component(p,ee({...o[p],name:p,aliasName:o[p].name}));if(c.install(m),m.provide(z,i),m.provide(Me,u),m.provide(q,c),m.provide(ke,l),m.provide(G,f),m.provide(Wt,g.options),m.provide(rt,g.instance),m.provide(Ut,h),D&&r.ssr)if(m.$nuxt)m.$nuxt.hook("app:suspense:resolve",()=>{u.update()});else{const{mount:p}=m;m.mount=function(){const C=p(...arguments);return me(()=>u.update()),m.mount=p,C}}Ee.reset(),m.mixin({computed:{$vuetify(){return O({defaults:j.call(this,z),display:j.call(this,Me),theme:j.call(this,q),icons:j.call(this,ke),locale:j.call(this,G),date:j.call(this,rt)})}}})},defaults:i,display:u,theme:c,icons:l,locale:f,date:g,goTo:h}}const po="3.6.10";yo.version=po;function j(e){const t=this.$,n=t.parent?.provides??t.vnode.appContext?.provides;if(n&&e in n)return n[e]}export{An as $,Ao as A,Vo as B,Dn as C,fr as D,Lo as E,qo as F,gs as G,ms as H,uo as I,hs as J,Xo as K,Qo as L,hn as M,Mo as N,hr as O,X as P,Ts as Q,go as R,wo as S,ks as T,D as U,Mn as V,No as W,ee as X,fs as Y,ns as Z,So as _,Ps as a,ct as a$,bs as a0,Uo as a1,zo as a2,Go as a3,Zo as a4,vs as a5,ie as a6,Ko as a7,_o as a8,Ct as a9,Zn as aA,os as aB,Et as aC,is as aD,as as aE,be as aF,Fo as aG,Dt as aH,Co as aI,Do as aJ,ss as aK,Kn as aL,us as aM,Se as aN,Ho as aO,ls as aP,ts as aQ,ys as aR,Ss as aS,xs as aT,Ds as aU,Rs as aV,Io as aW,We as aX,St as aY,de as aZ,Zt as a_,Rt as aa,Wo as ab,En as ac,Jo as ad,es as ae,ds as af,ps as ag,jo as ah,kn as ai,Ae as aj,wn as ak,Bo as al,Eo as am,On as an,Yo as ao,ko as ap,Cs as aq,Po as ar,$s as as,Ls as at,To as au,Is as av,Ns as aw,Be as ax,$o as ay,H as az,Y as b,As as b0,Gt as b1,yo as b2,rs as c,Ro as d,F as e,qn as f,$t as g,er as h,zn as i,xe as j,ne as k,Es as l,Jn as m,Fs as n,Os as o,cs as p,ws as q,Tn as r,k as s,bn as t,Ms as u,ar as v,Ee as w,Ne as x,xo as y,Oo as z};

View File

@@ -1,162 +0,0 @@
import{E as S,U as yt,T as pe,O as Q,M as I,N as Re,c as Ae,w as K,j as W,P as wt,t as We,K as M,L as A,b as Z,B as D,D as L,a as Ue,Q as ge,V as me,W as ze,I as H,X as Tt,R as X,Y as vt,Z as R,q as B,_ as Ct,$ as Bt,a0 as J,a1 as Ft,m as Pt,a2 as kt,a3 as se,n as xe,e as F,a4 as Mt,__tla as __tla_0}from"./TorrentDetail-BZZ-B8cw.js";import{U as V,T as z,R as ae,S as Ie,i as oe,b as He,c as Ge,j as Le,e as Rt,r as Oe,o as At,n as De,a as Wt,g as Ut,k as zt,m as It,B as Ee,__tla as __tla_1}from"./colorToUniform-pFJ8sYB5.js";import{C as O,__tla as __tla_2}from"./CanvasPool-DIOMPpzz.js";import{g as Ht,__tla as __tla_3}from"./getBatchSamplersUniformGroup-PJByx64R.js";import{__tla as __tla_4}from"./MoveTorrentDialog.vue_vue_type_script_setup_true_lang-G1lEzMcG.js";import{__tla as __tla_5}from"./index-DF2-l4SD.js";import"./vue-BQgCUbk_.js";import"./vuetify-DWkLi8Ew.js";import{__tla as __tla_6}from"./MixedButton.vue_vue_type_script_setup_true_lang-QFpliKgB.js";import"./FileIcon-DH65fwz5.js";import{__tla as __tla_7}from"./MoveTorrentFileDialog.vue_vue_type_script_setup_true_lang-DEnRCAW6.js";let __tla=Promise.all([(()=>{try{return __tla_0}catch{}})(),(()=>{try{return __tla_1}catch{}})(),(()=>{try{return __tla_2}catch{}})(),(()=>{try{return __tla_3}catch{}})(),(()=>{try{return __tla_4}catch{}})(),(()=>{try{return __tla_5}catch{}})(),(()=>{try{return __tla_6}catch{}})(),(()=>{try{return __tla_7}catch{}})()]).then(async()=>{class $e{static init(e){Object.defineProperty(this,"resizeTo",{set(t){globalThis.removeEventListener("resize",this.queueResize),this._resizeTo=t,t&&(globalThis.addEventListener("resize",this.queueResize),this.resize())},get(){return this._resizeTo}}),this.queueResize=()=>{this._resizeTo&&(this._cancelResize(),this._resizeId=requestAnimationFrame(()=>this.resize()))},this._cancelResize=()=>{this._resizeId&&(cancelAnimationFrame(this._resizeId),this._resizeId=null)},this.resize=()=>{if(!this._resizeTo)return;this._cancelResize();let t,r;if(this._resizeTo===globalThis.window)t=globalThis.innerWidth,r=globalThis.innerHeight;else{const{clientWidth:i,clientHeight:n}=this._resizeTo;t=i,r=n}this.renderer.resize(t,r),this.render()},this._resizeId=null,this._resizeTo=null,this.resizeTo=e.resizeTo||null}static destroy(){globalThis.removeEventListener("resize",this.queueResize),this._cancelResize(),this._cancelResize=null,this.queueResize=null,this.resizeTo=null,this.resize=null}}$e.extension=S.Application;class Ke{static init(e){e=Object.assign({autoStart:!0,sharedTicker:!1},e),Object.defineProperty(this,"ticker",{set(t){this._ticker&&this._ticker.remove(this.render,this),this._ticker=t,t&&t.add(this.render,this,yt.LOW)},get(){return this._ticker}}),this.stop=()=>{this._ticker.stop()},this.start=()=>{this._ticker.start()},this._ticker=null,this.ticker=e.sharedTicker?pe.shared:new pe,e.autoStart&&this.start()}static destroy(){if(this._ticker){const e=this._ticker;this.ticker=null,e.destroy()}}}Ke.extension=S.Application;class Ve{constructor(e){this._renderer=e}push(e,t,r){this._renderer.renderPipes.batch.break(r),r.add({renderPipeId:"filter",canBundle:!1,action:"pushFilter",container:t,filterEffect:e})}pop(e,t,r){this._renderer.renderPipes.batch.break(r),r.add({renderPipeId:"filter",action:"popFilter",canBundle:!1})}execute(e){e.action==="pushFilter"?this._renderer.filter.push(e):e.action==="popFilter"&&this._renderer.filter.pop()}destroy(){this._renderer=null}}Ve.extension={type:[S.WebGLPipes,S.WebGPUPipes,S.CanvasPipes],name:"filter"};const Gt=new I;function Lt(s,e){return e.clear(),Ye(s,e),e.isValid||e.set(0,0,0,0),s.renderGroup?e.applyMatrix(s.renderGroup.localTransform):e.applyMatrix(s.parentRenderGroup.worldTransform),e}function Ye(s,e){if(s.localDisplayStatus!==7||!s.measurable)return;const t=!!s.effects.length;let r=e;if((s.renderGroup||t)&&(r=Q.get().clear()),s.boundsArea)e.addRect(s.boundsArea,s.worldTransform);else{if(s.renderPipeId){const n=s.bounds;r.addFrame(n.minX,n.minY,n.maxX,n.maxY,s.groupTransform)}const i=s.children;for(let n=0;n<i.length;n++)Ye(i[n],r)}if(t){let i=!1;for(let n=0;n<s.effects.length;n++)s.effects[n].addBounds&&(i||(i=!0,r.applyMatrix(s.parentRenderGroup.worldTransform)),s.effects[n].addBounds(r,!0));i&&(r.applyMatrix(s.parentRenderGroup.worldTransform.copyTo(Gt).invert()),e.addBounds(r,s.relativeGroupTransform)),e.addBounds(r),Q.return(r)}else s.renderGroup&&(e.addBounds(r,s.relativeGroupTransform),Q.return(r))}function Ot(s,e){e.clear();const t=e.matrix;for(let r=0;r<s.length;r++){const i=s[r];i.globalDisplayStatus<7||(e.matrix=i.worldTransform,i.addBounds(e))}return e.matrix=t,e}const Dt=new Re({attributes:{aPosition:{buffer:new Float32Array([0,0,1,0,1,1,0,1]),location:0,format:"float32x2",stride:2*4,offset:0}},indexBuffer:new Uint32Array([0,1,2,0,2,3])});class je{constructor(e){this._filterStackIndex=0,this._filterStack=[],this._filterGlobalUniforms=new V({uInputSize:{value:new Float32Array(4),type:"vec4<f32>"},uInputPixel:{value:new Float32Array(4),type:"vec4<f32>"},uInputClamp:{value:new Float32Array(4),type:"vec4<f32>"},uOutputFrame:{value:new Float32Array(4),type:"vec4<f32>"},uGlobalFrame:{value:new Float32Array(4),type:"vec4<f32>"},uOutputTexture:{value:new Float32Array(4),type:"vec4<f32>"}}),this._globalFilterBindGroup=new Ae({}),this.renderer=e}get activeBackTexture(){return this._activeFilterData?.backTexture}push(e){const t=this.renderer,r=e.filterEffect.filters;this._filterStack[this._filterStackIndex]||(this._filterStack[this._filterStackIndex]=this._getFilterData());const i=this._filterStack[this._filterStackIndex];if(this._filterStackIndex++,r.length===0){i.skip=!0;return}const n=i.bounds;e.renderables?Ot(e.renderables,n):e.filterEffect.filterArea?(n.clear(),n.addRect(e.filterEffect.filterArea),n.applyMatrix(e.container.worldTransform)):Lt(e.container,n);const a=t.renderTarget.rootRenderTarget.colorTexture.source;let o=a._resolution,c=0,h=a.antialias,l=!1,d=!1;for(let u=0;u<r.length;u++){const p=r[u];if(o=Math.min(o,p.resolution),c+=p.padding,p.antialias!=="inherit"&&(p.antialias==="on"?h=!0:h=!1),!!!(p.compatibleRenderers&t.type)){d=!1;break}if(p.blendRequired&&!(t.backBuffer?.useBackBuffer??!0)){K("Blend filter requires backBuffer on WebGL renderer to be enabled. Set `useBackBuffer: true` in the renderer options."),d=!1;break}d=p.enabled||d,l=l||p.blendRequired}if(!d){i.skip=!0;return}const f=t.renderTarget.rootViewPort;if(n.scale(o).fitBounds(0,f.width,0,f.height).scale(1/o).pad(c).ceil(),!n.isPositive){i.skip=!0;return}i.skip=!1,i.bounds=n,i.blendRequired=l,i.container=e.container,i.filterEffect=e.filterEffect,i.previousRenderSurface=t.renderTarget.renderSurface,i.inputTexture=z.getOptimalTexture(n.width,n.height,o,h),t.renderTarget.bind(i.inputTexture,!0),t.globalUniforms.push({offset:n})}pop(){const e=this.renderer;this._filterStackIndex--;const t=this._filterStack[this._filterStackIndex];if(t.skip)return;this._activeFilterData=t;const r=t.inputTexture,i=t.bounds;let n=W.EMPTY;if(e.renderTarget.finishRenderPass(),t.blendRequired){const o=this._filterStackIndex>0?this._filterStack[this._filterStackIndex-1].bounds:null,c=e.renderTarget.getRenderTarget(t.previousRenderSurface);n=this.getBackTexture(c,i,o)}t.backTexture=n;const a=t.filterEffect.filters;if(this._globalFilterBindGroup.setResource(r.source.style,2),this._globalFilterBindGroup.setResource(n.source,3),e.globalUniforms.pop(),a.length===1)a[0].apply(this,r,t.previousRenderSurface,!1),z.returnTexture(r);else{let o=t.inputTexture,c=z.getOptimalTexture(i.width,i.height,o.source._resolution,!1),h=0;for(h=0;h<a.length-1;++h){a[h].apply(this,o,c,!0);const d=o;o=c,c=d}a[h].apply(this,o,t.previousRenderSurface,!1),z.returnTexture(o),z.returnTexture(c)}t.blendRequired&&z.returnTexture(n)}getBackTexture(e,t,r){const i=e.colorTexture.source._resolution,n=z.getOptimalTexture(t.width,t.height,i,!1);let a=t.minX,o=t.minY;r&&(a-=r.minX,o-=r.minY),a=Math.floor(a*i),o=Math.floor(o*i);const c=Math.ceil(t.width*i),h=Math.ceil(t.height*i);return this.renderer.renderTarget.copyToTexture(e,n,{x:a,y:o},{width:c,height:h},{x:0,y:0}),n}applyFilter(e,t,r,i){const n=this.renderer,a=this._filterStack[this._filterStackIndex],o=a.bounds,c=wt.shared,l=a.previousRenderSurface===r;let d=this.renderer.renderTarget.rootRenderTarget.colorTexture.source._resolution,f=this._filterStackIndex-1;for(;f>0&&this._filterStack[f].skip;)--f;f>0&&(d=this._filterStack[f].inputTexture.source._resolution);const u=this._filterGlobalUniforms,p=u.uniforms,x=p.uOutputFrame,m=p.uInputSize,_=p.uInputPixel,w=p.uInputClamp,b=p.uGlobalFrame,y=p.uOutputTexture;if(l){let v=this._filterStackIndex;for(;v>0;){v--;const k=this._filterStack[this._filterStackIndex-1];if(!k.skip){c.x=k.bounds.minX,c.y=k.bounds.minY;break}}x[0]=o.minX-c.x,x[1]=o.minY-c.y}else x[0]=0,x[1]=0;x[2]=t.frame.width,x[3]=t.frame.height,m[0]=t.source.width,m[1]=t.source.height,m[2]=1/m[0],m[3]=1/m[1],_[0]=t.source.pixelWidth,_[1]=t.source.pixelHeight,_[2]=1/_[0],_[3]=1/_[1],w[0]=.5*_[2],w[1]=.5*_[3],w[2]=t.frame.width*m[2]-.5*_[2],w[3]=t.frame.height*m[3]-.5*_[3];const T=this.renderer.renderTarget.rootRenderTarget.colorTexture;b[0]=c.x*d,b[1]=c.y*d,b[2]=T.source.width*d,b[3]=T.source.height*d;const P=this.renderer.renderTarget.getRenderTarget(r);if(n.renderTarget.bind(r,!!i),r instanceof W?(y[0]=r.frame.width,y[1]=r.frame.height):(y[0]=P.width,y[1]=P.height),y[2]=P.isRoot?-1:1,u.update(),n.renderPipes.uniformBatch){const v=n.renderPipes.uniformBatch.getUboResource(u);this._globalFilterBindGroup.setResource(v,0)}else this._globalFilterBindGroup.setResource(u,0);this._globalFilterBindGroup.setResource(t.source,1),this._globalFilterBindGroup.setResource(t.source.style,2),e.groups[0]=this._globalFilterBindGroup,n.encoder.draw({geometry:Dt,shader:e,state:e._state,topology:"triangle-list"}),n.type===ae.WEBGL&&n.renderTarget.finishRenderPass()}_getFilterData(){return{skip:!1,inputTexture:null,bounds:new We,container:null,filterEffect:null,blendRequired:!1,previousRenderSurface:null}}calculateSpriteMatrix(e,t){const r=this._activeFilterData,i=e.set(r.inputTexture._source.width,0,0,r.inputTexture._source.height,r.bounds.minX,r.bounds.minY),n=t.worldTransform.copyTo(I.shared);return n.invert(),i.prepend(n),i.scale(1/t.texture.frame.width,1/t.texture.frame.height),i.translate(t.anchor.x,t.anchor.y),i}}je.extension={type:[S.WebGLSystem,S.WebGPUSystem],name:"filter"};const Xe=class Ne extends Re{constructor(...e){let t=e[0]??{};t instanceof Float32Array&&(M(A,"use new MeshGeometry({ positions, uvs, indices }) instead"),t={positions:t,uvs:e[1],indices:e[2]}),t={...Ne.defaultOptions,...t};const r=t.positions||new Float32Array([0,0,1,0,1,1,0,1]),i=t.uvs||new Float32Array([0,0,1,0,1,1,0,1]),n=t.indices||new Uint32Array([0,1,2,0,2,3]),a=t.shrinkBuffersToFit,o=new Z({data:r,label:"attribute-mesh-positions",shrinkToFit:a,usage:D.VERTEX|D.COPY_DST}),c=new Z({data:i,label:"attribute-mesh-uvs",shrinkToFit:a,usage:D.VERTEX|D.COPY_DST}),h=new Z({data:n,label:"index-mesh-buffer",shrinkToFit:a,usage:D.INDEX|D.COPY_DST});super({attributes:{aPosition:{buffer:o,format:"float32x2",stride:2*4,offset:0},aUV:{buffer:c,format:"float32x2",stride:2*4,offset:0}},indexBuffer:h,topology:t.topology}),this.batchMode="auto"}get positions(){return this.attributes.aPosition.buffer.data}set positions(e){this.attributes.aPosition.buffer.data=e}get uvs(){return this.attributes.aUV.buffer.data}set uvs(e){this.attributes.aUV.buffer.data=e}get indices(){return this.indexBuffer.data}set indices(e){this.indexBuffer.data=e}};Xe.defaultOptions={topology:"triangle-list",shrinkBuffersToFit:!1};let ce=Xe;const Et=["serif","sans-serif","monospace","cursive","fantasy","system-ui"];function N(s){const e=typeof s.fontSize=="number"?`${s.fontSize}px`:s.fontSize;let t=s.fontFamily;Array.isArray(s.fontFamily)||(t=s.fontFamily.split(","));for(let r=t.length-1;r>=0;r--){let i=t[r].trim();!/([\"\'])[^\'\"]+\1/.test(i)&&!Et.includes(i)&&(i=`"${i}"`),t[r]=i}return`${s.fontStyle} ${s.fontVariant} ${s.fontWeight} ${e} ${t.join(",")}`}const ee={willReadFrequently:!0},U=class g{static get experimentalLetterSpacingSupported(){let e=g._experimentalLetterSpacingSupported;if(e!==void 0){const t=L.get().getCanvasRenderingContext2D().prototype;e=g._experimentalLetterSpacingSupported="letterSpacing"in t||"textLetterSpacing"in t}return e}constructor(e,t,r,i,n,a,o,c,h){this.text=e,this.style=t,this.width=r,this.height=i,this.lines=n,this.lineWidths=a,this.lineHeight=o,this.maxLineWidth=c,this.fontProperties=h}static measureText(e=" ",t,r=g._canvas,i=t.wordWrap){const n=`${e}:${t.styleKey}`;if(g._measurementCache[n])return g._measurementCache[n];const a=N(t),o=g.measureFont(a);o.fontSize===0&&(o.fontSize=t.fontSize,o.ascent=t.fontSize);const c=g.__context;c.font=a;const l=(i?g._wordWrap(e,t,r):e).split(/(?:\r\n|\r|\n)/),d=new Array(l.length);let f=0;for(let w=0;w<l.length;w++){const b=g._measureText(l[w],t.letterSpacing,c);d[w]=b,f=Math.max(f,b)}const u=t._stroke?.width||0;let p=f+u;t.dropShadow&&(p+=t.dropShadow.distance);const x=t.lineHeight||o.fontSize+u;let m=Math.max(x,o.fontSize+u*2)+(l.length-1)*(x+t.leading);return t.dropShadow&&(m+=t.dropShadow.distance),new g(e,t,p,m,l,d,x+t.leading,f,o)}static _measureText(e,t,r){let i=!1;g.experimentalLetterSpacingSupported&&(g.experimentalLetterSpacing?(r.letterSpacing=`${t}px`,r.textLetterSpacing=`${t}px`,i=!0):(r.letterSpacing="0px",r.textLetterSpacing="0px"));let n=r.measureText(e).width;return n>0&&(i?n-=t:n+=(g.graphemeSegmenter(e).length-1)*t),n}static _wordWrap(e,t,r=g._canvas){const i=r.getContext("2d",ee);let n=0,a="",o="";const c=Object.create(null),{letterSpacing:h,whiteSpace:l}=t,d=g._collapseSpaces(l),f=g._collapseNewlines(l);let u=!d;const p=t.wordWrapWidth+h,x=g._tokenize(e);for(let m=0;m<x.length;m++){let _=x[m];if(g._isNewline(_)){if(!f){o+=g._addLine(a),u=!d,a="",n=0;continue}_=" "}if(d){const b=g.isBreakingSpace(_),y=g.isBreakingSpace(a[a.length-1]);if(b&&y)continue}const w=g._getFromCache(_,h,c,i);if(w>p)if(a!==""&&(o+=g._addLine(a),a="",n=0),g.canBreakWords(_,t.breakWords)){const b=g.wordWrapSplit(_);for(let y=0;y<b.length;y++){let T=b[y],P=T,v=1;for(;b[y+v];){const C=b[y+v];if(!g.canBreakChars(P,C,_,y,t.breakWords))T+=C;else break;P=C,v++}y+=v-1;const k=g._getFromCache(T,h,c,i);k+n>p&&(o+=g._addLine(a),u=!1,a="",n=0),a+=T,n+=k}}else{a.length>0&&(o+=g._addLine(a),a="",n=0);const b=m===x.length-1;o+=g._addLine(_,!b),u=!1,a="",n=0}else w+n>p&&(u=!1,o+=g._addLine(a),a="",n=0),(a.length>0||!g.isBreakingSpace(_)||u)&&(a+=_,n+=w)}return o+=g._addLine(a,!1),o}static _addLine(e,t=!0){return e=g._trimRight(e),e=t?`${e}
`:e,e}static _getFromCache(e,t,r,i){let n=r[e];return typeof n!="number"&&(n=g._measureText(e,t,i)+t,r[e]=n),n}static _collapseSpaces(e){return e==="normal"||e==="pre-line"}static _collapseNewlines(e){return e==="normal"}static _trimRight(e){if(typeof e!="string")return"";for(let t=e.length-1;t>=0;t--){const r=e[t];if(!g.isBreakingSpace(r))break;e=e.slice(0,-1)}return e}static _isNewline(e){return typeof e!="string"?!1:g._newlines.includes(e.charCodeAt(0))}static isBreakingSpace(e,t){return typeof e!="string"?!1:g._breakingSpaces.includes(e.charCodeAt(0))}static _tokenize(e){const t=[];let r="";if(typeof e!="string")return t;for(let i=0;i<e.length;i++){const n=e[i],a=e[i+1];if(g.isBreakingSpace(n,a)||g._isNewline(n)){r!==""&&(t.push(r),r=""),t.push(n);continue}r+=n}return r!==""&&t.push(r),t}static canBreakWords(e,t){return t}static canBreakChars(e,t,r,i,n){return!0}static wordWrapSplit(e){return g.graphemeSegmenter(e)}static measureFont(e){if(g._fonts[e])return g._fonts[e];const t=g._context;t.font=e;const r=t.measureText(g.METRICS_STRING+g.BASELINE_SYMBOL),i={ascent:r.actualBoundingBoxAscent,descent:r.actualBoundingBoxDescent,fontSize:r.actualBoundingBoxAscent+r.actualBoundingBoxDescent};return g._fonts[e]=i,i}static clearMetrics(e=""){e?delete g._fonts[e]:g._fonts={}}static get _canvas(){if(!g.__canvas){let e;try{const t=new OffscreenCanvas(0,0);if(t.getContext("2d",ee)?.measureText)return g.__canvas=t,t;e=L.get().createCanvas()}catch{e=L.get().createCanvas()}e.width=e.height=10,g.__canvas=e}return g.__canvas}static get _context(){return g.__context||(g.__context=g._canvas.getContext("2d",ee)),g.__context}};U.METRICS_STRING="|\xc9q\xc5";U.BASELINE_SYMBOL="M";U.BASELINE_MULTIPLIER=1.4;U.HEIGHT_MULTIPLIER=2;U.graphemeSegmenter=(()=>{if(typeof Intl?.Segmenter=="function"){const s=new Intl.Segmenter;return e=>[...s.segment(e)].map(t=>t.segment)}return s=>[...s]})();U.experimentalLetterSpacing=!1;U._fonts={};U._newlines=[10,13];U._breakingSpaces=[9,32,8192,8193,8194,8195,8196,8197,8198,8200,8201,8202,8287,12288];U._measurementCache={};let G=U;const _e=["_fontFamily","_fontStyle","_fontSize","_fontVariant","_fontWeight","_breakWords","_align","_leading","_letterSpacing","_lineHeight","_textBaseline","_whiteSpace","_wordWrap","_wordWrapWidth","_padding","_cssOverrides","_trim"];function qe(s){const e=[];let t=0;for(let r=0;r<_e.length;r++){const i=_e[r];e[t++]=s[i]}return t=Qe(s._fill,e,t),t=$t(s._stroke,e,t),e.join("-")}function Qe(s,e,t){return s&&(e[t++]=s.color,e[t++]=s.alpha,e[t++]=s.fill?.uid),t}function $t(s,e,t){return s&&(t=Qe(s,e,t),e[t++]=s.width,e[t++]=s.alignment,e[t++]=s.cap,e[t++]=s.join,e[t++]=s.miterLimit),t}const le=class E extends Ue{constructor(e={}){super(),Kt(e);const t={...E.defaultTextStyle,...e};for(const r in t){const i=r;this[i]=t[r]}this.update()}get align(){return this._align}set align(e){this._align=e,this.update()}get breakWords(){return this._breakWords}set breakWords(e){this._breakWords=e,this.update()}get dropShadow(){return this._dropShadow}set dropShadow(e){e!==null&&typeof e=="object"?this._dropShadow={...E.defaultDropShadow,...e}:this._dropShadow=e?{...E.defaultDropShadow}:null,this.update()}get fontFamily(){return this._fontFamily}set fontFamily(e){this._fontFamily=e,this.update()}get fontSize(){return this._fontSize}set fontSize(e){typeof e=="string"?this._fontSize=parseInt(e,10):this._fontSize=e,this.update()}get fontStyle(){return this._fontStyle}set fontStyle(e){this._fontStyle=e,this.update()}get fontVariant(){return this._fontVariant}set fontVariant(e){this._fontVariant=e,this.update()}get fontWeight(){return this._fontWeight}set fontWeight(e){this._fontWeight=e,this.update()}get leading(){return this._leading}set leading(e){this._leading=e,this.update()}get letterSpacing(){return this._letterSpacing}set letterSpacing(e){this._letterSpacing=e,this.update()}get lineHeight(){return this._lineHeight}set lineHeight(e){this._lineHeight=e,this.update()}get padding(){return this._padding}set padding(e){this._padding=e,this.update()}get trim(){return this._trim}set trim(e){this._trim=e,this.update()}get textBaseline(){return this._textBaseline}set textBaseline(e){this._textBaseline=e,this.update()}get whiteSpace(){return this._whiteSpace}set whiteSpace(e){this._whiteSpace=e,this.update()}get wordWrap(){return this._wordWrap}set wordWrap(e){this._wordWrap=e,this.update()}get wordWrapWidth(){return this._wordWrapWidth}set wordWrapWidth(e){this._wordWrapWidth=e,this.update()}get fill(){return this._originalFill}set fill(e){e!==this._originalFill&&(this._originalFill=e,this._fill=ge(e===0?"black":e,me.defaultFillStyle),this.update())}get stroke(){return this._originalStroke}set stroke(e){e!==this._originalStroke&&(this._originalStroke=e,this._stroke=ge(e,me.defaultStrokeStyle),this.update())}_generateKey(){return this._styleKey=qe(this),this._styleKey}update(){this._styleKey=null,this.emit("update",this)}reset(){const e=E.defaultTextStyle;for(const t in e)this[t]=e[t]}get styleKey(){return this._styleKey||this._generateKey()}clone(){return new E({align:this.align,breakWords:this.breakWords,dropShadow:this.dropShadow,fill:this._fill,fontFamily:this.fontFamily,fontSize:this.fontSize,fontStyle:this.fontStyle,fontVariant:this.fontVariant,fontWeight:this.fontWeight,leading:this.leading,letterSpacing:this.letterSpacing,lineHeight:this.lineHeight,padding:this.padding,stroke:this._stroke,textBaseline:this.textBaseline,whiteSpace:this.whiteSpace,wordWrap:this.wordWrap,wordWrapWidth:this.wordWrapWidth})}destroy(e=!1){if(this.removeAllListeners(),typeof e=="boolean"?e:e?.texture){const r=typeof e=="boolean"?e:e?.textureSource;this._fill?.texture&&this._fill.texture.destroy(r),this._originalFill?.texture&&this._originalFill.texture.destroy(r),this._stroke?.texture&&this._stroke.texture.destroy(r),this._originalStroke?.texture&&this._originalStroke.texture.destroy(r)}this._fill=null,this._stroke=null,this.dropShadow=null,this._originalStroke=null,this._originalFill=null}};le.defaultDropShadow={alpha:1,angle:Math.PI/6,blur:0,color:"black",distance:5};le.defaultTextStyle={align:"left",breakWords:!1,dropShadow:null,fill:"black",fontFamily:"Arial",fontSize:26,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",leading:0,letterSpacing:0,lineHeight:0,padding:0,stroke:null,textBaseline:"alphabetic",trim:!1,whiteSpace:"pre",wordWrap:!1,wordWrapWidth:100};let $=le;function Kt(s){const e=s;if(typeof e.dropShadow=="boolean"&&e.dropShadow){const t=$.defaultDropShadow;s.dropShadow={alpha:e.dropShadowAlpha??t.alpha,angle:e.dropShadowAngle??t.angle,blur:e.dropShadowBlur??t.blur,color:e.dropShadowColor??t.color,distance:e.dropShadowDistance??t.distance}}if(e.strokeThickness!==void 0){M(A,"strokeThickness is now a part of stroke");const t=e.stroke;s.stroke={color:t,width:e.strokeThickness}}if(Array.isArray(e.fill)){M(A,"gradient fill is now a fill pattern: `new FillGradient(...)`");const t=new ze(0,0,0,s.fontSize*1.7),r=e.fill.map(i=>H.shared.setValue(i).toNumber());r.forEach((i,n)=>{const a=e.fillGradientStops[n]??n/r.length;t.addColorStop(a,i)}),s.fill={fill:t}}}function q(s,e){if(s.texture===W.WHITE&&!s.fill)return H.shared.setValue(s.color).toHex();if(s.fill){if(s.fill instanceof Tt){const t=s.fill,r=e.createPattern(t.texture.source.resource,"repeat"),i=t.transform.copyTo(I.shared);return i.scale(t.texture.frame.width,t.texture.frame.height),r.setTransform(i),r}else if(s.fill instanceof ze){const t=s.fill;if(t.type==="linear"){const r=e.createLinearGradient(t.x0,t.y0,t.x1,t.y1);return t.gradientStops.forEach(i=>{r.addColorStop(i.offset,H.shared.setValue(i.color).toHex())}),r}}}else{const t=e.createPattern(s.texture.source.resource,"repeat"),r=s.matrix.copyTo(I.shared);return r.scale(s.texture.frame.width,s.texture.frame.height),t.setTransform(r),t}return K("FillStyle not recognised",s),"red"}class Ze extends Ue{constructor(){super(...arguments),this.chars=Object.create(null),this.lineHeight=0,this.fontFamily="",this.fontMetrics={fontSize:0,ascent:0,descent:0},this.baseLineOffset=0,this.distanceField={type:"none",range:0},this.pages=[],this.baseMeasurementFontSize=100,this.baseRenderedFontSize=100}get font(){return M(A,"BitmapFont.font is deprecated, please use BitmapFont.fontFamily instead."),this.fontFamily}get pageTextures(){return M(A,"BitmapFont.pageTextures is deprecated, please use BitmapFont.pages instead."),this.pages}get size(){return M(A,"BitmapFont.size is deprecated, please use BitmapFont.fontMetrics.fontSize instead."),this.fontMetrics.fontSize}get distanceFieldRange(){return M(A,"BitmapFont.distanceFieldRange is deprecated, please use BitmapFont.distanceField.range instead."),this.distanceField.range}get distanceFieldType(){return M(A,"BitmapFont.distanceFieldType is deprecated, please use BitmapFont.distanceField.type instead."),this.distanceField.type}destroy(e=!1){this.emit("destroy",this),this.removeAllListeners();for(const t in this.chars)this.chars[t].texture.destroy();this.chars=null,e&&(this.pages.forEach(t=>t.texture.destroy(!0)),this.pages=null)}}function Je(s){if(s==="")return[];typeof s=="string"&&(s=[s]);const e=[];for(let t=0,r=s.length;t<r;t++){const i=s[t];if(Array.isArray(i)){if(i.length!==2)throw new Error(`[BitmapFont]: Invalid character range length, expecting 2 got ${i.length}.`);if(i[0].length===0||i[1].length===0)throw new Error("[BitmapFont]: Invalid character delimiter.");const n=i[0].charCodeAt(0),a=i[1].charCodeAt(0);if(a<n)throw new Error("[BitmapFont]: Invalid character range.");for(let o=n,c=a;o<=c;o++)e.push(String.fromCharCode(o))}else e.push(...Array.from(i))}if(e.length===0)throw new Error("[BitmapFont]: Empty set when resolving characters.");return e}class be extends Ze{constructor(e){super(),this.resolution=1,this.pages=[],this._padding=4,this._measureCache=Object.create(null),this._currentChars=[],this._currentX=0,this._currentY=0,this._currentPageIndex=-1,this._skipKerning=!1;const t=e,r=t.style.clone();t.overrideFill&&(r._fill.color=16777215,r._fill.alpha=1,r._fill.texture=W.WHITE,r._fill.fill=null);const i=r.fontSize;r.fontSize=this.baseMeasurementFontSize;const n=N(r);t.overrideSize?r._stroke&&(r._stroke.width*=this.baseRenderedFontSize/i):r.fontSize=this.baseRenderedFontSize=i,this._style=r,this._skipKerning=t.skipKerning??!1,this.resolution=t.resolution??1,this._padding=t.padding??4,this.fontMetrics=G.measureFont(n),this.lineHeight=r.lineHeight||this.fontMetrics.fontSize||r.fontSize}ensureCharacters(e){const t=Je(e).filter(x=>!this._currentChars.includes(x)).filter((x,m,_)=>_.indexOf(x)===m);if(!t.length)return;this._currentChars=[...this._currentChars,...t];let r;this._currentPageIndex===-1?r=this._nextPage():r=this.pages[this._currentPageIndex];let{canvas:i,context:n}=r.canvasAndContext,a=r.texture.source;const o=this._style;let c=this._currentX,h=this._currentY;const l=this.baseRenderedFontSize/this.baseMeasurementFontSize,d=this._padding*l,f=o.fontStyle==="italic"?2:1;let u=0,p=!1;for(let x=0;x<t.length;x++){const m=t[x],_=G.measureText(m,o,i,!1);_.lineHeight=_.height;const w=f*_.width*l,b=_.height*l,y=w+d*2,T=b+d*2;if(p=!1,m!==`
`&&m!=="\r"&&m!==" "&&m!==" "&&(p=!0,u=Math.ceil(Math.max(T,u))),c+y>512&&(h+=u,u=T,c=0,h+u>512)){a.update();const v=this._nextPage();i=v.canvasAndContext.canvas,n=v.canvasAndContext.context,a=v.texture.source,h=0}const P=w/l-(o.dropShadow?.distance??0)-(o._stroke?.width??0);if(this.chars[m]={id:m.codePointAt(0),xOffset:-this._padding,yOffset:-this._padding,xAdvance:P,kerning:{}},p){this._drawGlyph(n,_,c+d,h+d,l,o);const v=a.width*l,k=a.height*l,C=new X(c/v*a.width,h/k*a.height,y/v*a.width,T/k*a.height);this.chars[m].texture=new W({source:a,frame:C}),c+=Math.ceil(y)}}a.update(),this._currentX=c,this._currentY=h,this._skipKerning&&this._applyKerning(t,n)}get pageTextures(){return M(A,"BitmapFont.pageTextures is deprecated, please use BitmapFont.pages instead."),this.pages}_applyKerning(e,t){const r=this._measureCache;for(let i=0;i<e.length;i++){const n=e[i];for(let a=0;a<this._currentChars.length;a++){const o=this._currentChars[a];let c=r[n];c||(c=r[n]=t.measureText(n).width);let h=r[o];h||(h=r[o]=t.measureText(o).width);let l=t.measureText(n+o).width,d=l-(c+h);d&&(this.chars[n].kerning[o]=d),l=t.measureText(n+o).width,d=l-(c+h),d&&(this.chars[o].kerning[n]=d)}}}_nextPage(){this._currentPageIndex++;const e=this.resolution,t=O.getOptimalCanvasAndContext(512,512,e);this._setupContext(t.context,this._style,e);const r=e*(this.baseRenderedFontSize/this.baseMeasurementFontSize),i=new W({source:new vt({resource:t.canvas,resolution:r,alphaMode:"premultiply-alpha-on-upload"})}),n={canvasAndContext:t,texture:i};return this.pages[this._currentPageIndex]=n,n}_setupContext(e,t,r){t.fontSize=this.baseRenderedFontSize,e.scale(r,r),e.font=N(t),t.fontSize=this.baseMeasurementFontSize,e.textBaseline=t.textBaseline;const i=t._stroke,n=i?.width??0;if(i&&(e.lineWidth=n,e.lineJoin=i.join,e.miterLimit=i.miterLimit,e.strokeStyle=q(i,e)),t._fill&&(e.fillStyle=q(t._fill,e)),t.dropShadow){const a=t.dropShadow,o=H.shared.setValue(a.color).toArray(),c=a.blur*r,h=a.distance*r;e.shadowColor=`rgba(${o[0]*255},${o[1]*255},${o[2]*255},${a.alpha})`,e.shadowBlur=c,e.shadowOffsetX=Math.cos(a.angle)*h,e.shadowOffsetY=Math.sin(a.angle)*h}else e.shadowColor="black",e.shadowBlur=0,e.shadowOffsetX=0,e.shadowOffsetY=0}_drawGlyph(e,t,r,i,n,a){const o=t.text,c=t.fontProperties,l=(a._stroke?.width??0)*n,d=r+l/2,f=i-l/2,u=c.descent*n,p=t.lineHeight*n;a.stroke&&l&&e.strokeText(o,d,f+p-u),a._fill&&e.fillText(o,d,f+p-u)}destroy(){super.destroy();for(let e=0;e<this.pages.length;e++){const{canvasAndContext:t,texture:r}=this.pages[e];O.returnCanvasAndContext(t),r.destroy(!0)}this.pages=null}}function et(s,e,t){const r={width:0,height:0,offsetY:0,scale:e.fontSize/t.baseMeasurementFontSize,lines:[{width:0,charPositions:[],spaceWidth:0,spacesIndex:[],chars:[]}]};r.offsetY=t.baseLineOffset;let i=r.lines[0],n=null,a=!0;const o={spaceWord:!1,width:0,start:0,index:0,positions:[],chars:[]},c=u=>{const p=i.width;for(let x=0;x<o.index;x++){const m=u.positions[x];i.chars.push(u.chars[x]),i.charPositions.push(m+p)}i.width+=u.width,a=!1,o.width=0,o.index=0,o.chars.length=0},h=()=>{let u=i.chars.length-1,p=i.chars[u];for(;p===" ";)i.width-=t.chars[p].xAdvance,p=i.chars[--u];r.width=Math.max(r.width,i.width),i={width:0,charPositions:[],chars:[],spaceWidth:0,spacesIndex:[]},a=!0,r.lines.push(i),r.height+=t.lineHeight},l=t.baseMeasurementFontSize/e.fontSize,d=e.letterSpacing*l,f=e.wordWrapWidth*l;for(let u=0;u<s.length+1;u++){let p;const x=u===s.length;x||(p=s[u]);const m=t.chars[p]||t.chars[" "];if(/(?:\s)/.test(p)||p==="\r"||p===`
`||x){if(!a&&e.wordWrap&&i.width+o.width-d>f?(h(),c(o),x||i.charPositions.push(0)):(o.start=i.width,c(o),x||i.charPositions.push(0)),p==="\r"||p===`
`)i.width!==0&&h();else if(!x){const y=m.xAdvance+(m.kerning[n]||0)+d;i.width+=y,i.spaceWidth=y,i.spacesIndex.push(i.charPositions.length),i.chars.push(p)}}else{const b=m.kerning[n]||0,y=m.xAdvance+b+d;o.positions[o.index++]=o.width+b,o.chars.push(p),o.width+=y}n=p}return h(),e.align==="center"?Vt(r):e.align==="right"?Yt(r):e.align==="justify"&&jt(r),r}function Vt(s){for(let e=0;e<s.lines.length;e++){const t=s.lines[e],r=s.width/2-t.width/2;for(let i=0;i<t.charPositions.length;i++)t.charPositions[i]+=r}}function Yt(s){for(let e=0;e<s.lines.length;e++){const t=s.lines[e],r=s.width-t.width;for(let i=0;i<t.charPositions.length;i++)t.charPositions[i]+=r}}function jt(s){const e=s.width;for(let t=0;t<s.lines.length;t++){const r=s.lines[t];let i=0,n=r.spacesIndex[i++],a=0;const o=r.spacesIndex.length,h=(e-r.width)/o;for(let l=0;l<r.charPositions.length;l++)l===n&&(n=r.spacesIndex[i++],a+=h),r.charPositions[l]+=a}}class Xt{constructor(){this.ALPHA=[["a","z"],["A","Z"]," "],this.NUMERIC=[["0","9"]],this.ALPHANUMERIC=[["a","z"],["A","Z"],["0","9"]," "],this.ASCII=[[" ","~"]],this.defaultOptions={chars:this.ALPHANUMERIC,resolution:1,padding:4,skipKerning:!1}}getFont(e,t){let r=`${t.fontFamily}-bitmap`,i=!0;if(t._fill.fill&&(r+=t._fill.fill.uid,i=!1),!R.has(r)){const a=new be({style:t,overrideFill:i,overrideSize:!0,...this.defaultOptions});a.once("destroy",()=>R.remove(r)),R.set(r,a)}const n=R.get(r);return n.ensureCharacters?.(e),n}getLayout(e,t){const r=this.getFont(e,t);return et([...e],t,r)}measureText(e,t){return this.getLayout(e,t)}install(...e){let t=e[0];typeof t=="string"&&(t={name:t,style:e[1],chars:e[2]?.chars,resolution:e[2]?.resolution,padding:e[2]?.padding,skipKerning:e[2]?.skipKerning},M(A,"BitmapFontManager.install(name, style, options) is deprecated, use BitmapFontManager.install({name, style, ...options})"));const r=t?.name;if(!r)throw new Error("[BitmapFontManager] Property `name` is required.");t={...this.defaultOptions,...t};const i=t.style,n=i instanceof $?i:new $(i),a=n._fill.fill!==null&&n._fill.fill!==void 0,o=new be({style:n,overrideFill:a,skipKerning:t.skipKerning,padding:t.padding,resolution:t.resolution,overrideSize:!1}),c=Je(t.chars);return o.ensureCharacters(c.join("")),R.set(`${r}-bitmap`,o),o.once("destroy",()=>R.remove(`${r}-bitmap`)),o}uninstall(e){const t=`${e}-bitmap`,r=R.get(t);r&&(R.remove(t),r.destroy())}}const ne=new Xt;function Nt(s){const e=s._stroke,t=s._fill,i=[`div { ${[`color: ${H.shared.setValue(t.color).toHex()}`,`font-size: ${s.fontSize}px`,`font-family: ${s.fontFamily}`,`font-weight: ${s.fontWeight}`,`font-style: ${s.fontStyle}`,`font-variant: ${s.fontVariant}`,`letter-spacing: ${s.letterSpacing}px`,`text-align: ${s.align}`,`padding: ${s.padding}px`,`white-space: ${s.whiteSpace==="pre"&&s.wordWrap?"pre-wrap":s.whiteSpace}`,...s.lineHeight?[`line-height: ${s.lineHeight}px`]:[],...s.wordWrap?[`word-wrap: ${s.breakWords?"break-all":"break-word"}`,`max-width: ${s.wordWrapWidth}px`]:[],...e?[rt(e)]:[],...s.dropShadow?[tt(s.dropShadow)]:[],...s.cssOverrides].join(";")} }`];return qt(s.tagStyles,i),i.join(" ")}function tt(s){const e=H.shared.setValue(s.color).setAlpha(s.alpha).toHexa(),t=Math.round(Math.cos(s.angle)*s.distance),r=Math.round(Math.sin(s.angle)*s.distance),i=`${t}px ${r}px`;return s.blur>0?`text-shadow: ${i} ${s.blur}px ${e}`:`text-shadow: ${i} ${e}`}function rt(s){return[`-webkit-text-stroke-width: ${s.width}px`,`-webkit-text-stroke-color: ${H.shared.setValue(s.color).toHex()}`,`text-stroke-width: ${s.width}px`,`text-stroke-color: ${H.shared.setValue(s.color).toHex()}`,"paint-order: stroke"].join(";")}const Se={fontSize:"font-size: {{VALUE}}px",fontFamily:"font-family: {{VALUE}}",fontWeight:"font-weight: {{VALUE}}",fontStyle:"font-style: {{VALUE}}",fontVariant:"font-variant: {{VALUE}}",letterSpacing:"letter-spacing: {{VALUE}}px",align:"text-align: {{VALUE}}",padding:"padding: {{VALUE}}px",whiteSpace:"white-space: {{VALUE}}",lineHeight:"line-height: {{VALUE}}px",wordWrapWidth:"max-width: {{VALUE}}px"},ye={fill:s=>`color: ${H.shared.setValue(s).toHex()}`,breakWords:s=>`word-wrap: ${s?"break-all":"break-word"}`,stroke:rt,dropShadow:tt};function qt(s,e){for(const t in s){const r=s[t],i=[];for(const n in r)ye[n]?i.push(ye[n](r[n])):Se[n]&&i.push(Se[n].replace("{{VALUE}}",r[n]));e.push(`${t} { ${i.join(";")} }`)}}class he extends ${constructor(e={}){super(e),this._cssOverrides=[],this.cssOverrides??(this.cssOverrides=e.cssOverrides),this.tagStyles=e.tagStyles??{}}set cssOverrides(e){this._cssOverrides=e instanceof Array?e:[e],this.update()}get cssOverrides(){return this._cssOverrides}_generateKey(){return this._styleKey=qe(this)+this._cssOverrides.join("-"),this._styleKey}update(){this._cssStyle=null,super.update()}clone(){return new he({align:this.align,breakWords:this.breakWords,dropShadow:this.dropShadow,fill:this._fill,fontFamily:this.fontFamily,fontSize:this.fontSize,fontStyle:this.fontStyle,fontVariant:this.fontVariant,fontWeight:this.fontWeight,letterSpacing:this.letterSpacing,lineHeight:this.lineHeight,padding:this.padding,stroke:this._stroke,whiteSpace:this.whiteSpace,wordWrap:this.wordWrap,wordWrapWidth:this.wordWrapWidth,cssOverrides:this.cssOverrides})}get cssStyle(){return this._cssStyle||(this._cssStyle=Nt(this)),this._cssStyle}addOverride(...e){const t=e.filter(r=>!this.cssOverrides.includes(r));t.length>0&&(this.cssOverrides.push(...t),this.update())}removeOverride(...e){const t=e.filter(r=>this.cssOverrides.includes(r));t.length>0&&(this.cssOverrides=this.cssOverrides.filter(r=>!t.includes(r)),this.update())}set fill(e){typeof e!="string"&&typeof e!="number"&&K("[HTMLTextStyle] only color fill is not supported by HTMLText"),super.fill=e}set stroke(e){e&&typeof e!="string"&&typeof e!="number"&&K("[HTMLTextStyle] only color stroke is not supported by HTMLText"),super.stroke=e}}const we="http://www.w3.org/2000/svg",Te="http://www.w3.org/1999/xhtml";class it{constructor(){this.svgRoot=document.createElementNS(we,"svg"),this.foreignObject=document.createElementNS(we,"foreignObject"),this.domElement=document.createElementNS(Te,"div"),this.styleElement=document.createElementNS(Te,"style"),this.image=new Image;const{foreignObject:e,svgRoot:t,styleElement:r,domElement:i}=this;e.setAttribute("width","10000"),e.setAttribute("height","10000"),e.style.overflow="hidden",t.appendChild(e),e.appendChild(r),e.appendChild(i)}}let ve;function Qt(s,e,t,r){r=r||ve||(ve=new it);const{domElement:i,styleElement:n,svgRoot:a}=r;i.innerHTML=`<style>${e.cssStyle}</style><div>${s}</div>`,i.setAttribute("style","transform-origin: top left; display: inline-block"),t&&(n.textContent=t),document.body.appendChild(a);const o=i.getBoundingClientRect();a.remove();const c=G.measureFont(e.fontStyle).descent;return{width:o.width,height:o.height+c}}class st{constructor(e,t){this.state=Ie.for2d(),this._graphicsBatchesHash=Object.create(null),this.renderer=e,this._adaptor=t,this._adaptor.init()}validateRenderable(e){const t=e.context,r=!!this._graphicsBatchesHash[e.uid],i=this.renderer.graphicsContext.updateGpuContext(t);return!!(i.isBatchable||r!==i.isBatchable)}addRenderable(e,t){const r=this.renderer.graphicsContext.updateGpuContext(e.context);e._didGraphicsUpdate&&(e._didGraphicsUpdate=!1,this._rebuild(e)),r.isBatchable?this._addToBatcher(e,t):(this.renderer.renderPipes.batch.break(t),t.add(e))}updateRenderable(e){const t=this._graphicsBatchesHash[e.uid];if(t)for(let r=0;r<t.length;r++){const i=t[r];i.batcher.updateElement(i)}}destroyRenderable(e){this._graphicsBatchesHash[e.uid]&&this._removeBatchForRenderable(e.uid)}execute(e){if(!e.isRenderable)return;const t=this.renderer,r=e.context;if(!t.graphicsContext.getGpuContext(r).batches.length)return;const n=r.customShader||this._adaptor.shader;this.state.blendMode=e.groupBlendMode;const a=n.resources.localUniforms.uniforms;a.uTransformMatrix=e.groupTransform,a.uRound=t._roundPixels|e._roundPixels,oe(e.groupColorAlpha,a.uColor,0),this._adaptor.execute(this,e)}_rebuild(e){const t=!!this._graphicsBatchesHash[e.uid],r=this.renderer.graphicsContext.updateGpuContext(e.context);t&&this._removeBatchForRenderable(e.uid),r.isBatchable&&this._initBatchesForRenderable(e),e.batched=r.isBatchable}_addToBatcher(e,t){const r=this.renderer.renderPipes.batch,i=this._getBatchesForRenderable(e);for(let n=0;n<i.length;n++){const a=i[n];r.addToBatch(a,t)}}_getBatchesForRenderable(e){return this._graphicsBatchesHash[e.uid]||this._initBatchesForRenderable(e)}_initBatchesForRenderable(e){const t=e.context,r=this.renderer.graphicsContext.getGpuContext(t),i=this.renderer._roundPixels|e._roundPixels,n=r.batches.map(a=>{const o=B.get(Ct);return a.copyTo(o),o.renderable=e,o.roundPixels=i,o});return this._graphicsBatchesHash[e.uid]===void 0&&e.on("destroyed",()=>{this.destroyRenderable(e)}),this._graphicsBatchesHash[e.uid]=n,n}_removeBatchForRenderable(e){this._graphicsBatchesHash[e].forEach(t=>{B.return(t)}),this._graphicsBatchesHash[e]=null}destroy(){this.renderer=null,this._adaptor.destroy(),this._adaptor=null,this.state=null;for(const e in this._graphicsBatchesHash)this._removeBatchForRenderable(e);this._graphicsBatchesHash=null}}st.extension={type:[S.WebGLPipes,S.WebGPUPipes,S.CanvasPipes],name:"graphics"};const nt=class at extends ce{constructor(...e){super({});let t=e[0]??{};typeof t=="number"&&(M(A,"PlaneGeometry constructor changed please use { width, height, verticesX, verticesY } instead"),t={width:t,height:e[1],verticesX:e[2],verticesY:e[3]}),this.build(t)}build(e){e={...at.defaultOptions,...e},this.verticesX=this.verticesX??e.verticesX,this.verticesY=this.verticesY??e.verticesY,this.width=this.width??e.width,this.height=this.height??e.height;const t=this.verticesX*this.verticesY,r=[],i=[],n=[],a=this.verticesX-1,o=this.verticesY-1,c=this.width/a,h=this.height/o;for(let d=0;d<t;d++){const f=d%this.verticesX,u=d/this.verticesX|0;r.push(f*c,u*h),i.push(f/a,u/o)}const l=a*o;for(let d=0;d<l;d++){const f=d%a,u=d/a|0,p=u*this.verticesX+f,x=u*this.verticesX+f+1,m=(u+1)*this.verticesX+f,_=(u+1)*this.verticesX+f+1;n.push(p,x,m,x,_,m)}this.buffers[0].data=new Float32Array(r),this.buffers[1].data=new Float32Array(i),this.indexBuffer.data=new Uint32Array(n),this.buffers[0].update(),this.buffers[1].update(),this.indexBuffer.update()}};nt.defaultOptions={width:100,height:100,verticesX:10,verticesY:10};let Zt=nt;class de{constructor(){this.batcher=null,this.batch=null,this.roundPixels=0,this._uvUpdateId=-1,this._textureMatrixUpdateId=-1}get blendMode(){return this.mesh.groupBlendMode}reset(){this.mesh=null,this.texture=null,this.batcher=null,this.batch=null}packIndex(e,t,r){const i=this.geometry.indices;for(let n=0;n<i.length;n++)e[t++]=i[n]+r}packAttributes(e,t,r,i){const n=this.mesh,a=this.geometry,o=n.groupTransform,c=i<<16|this.roundPixels&65535,h=o.a,l=o.b,d=o.c,f=o.d,u=o.tx,p=o.ty,x=a.positions,m=a.getBuffer("aUV"),_=m.data;let w=_;const b=this.texture.textureMatrix;b.isSimple||(w=this._transformedUvs,(this._textureMatrixUpdateId!==b._updateID||this._uvUpdateId!==m._updateID)&&((!w||w.length<_.length)&&(w=this._transformedUvs=new Float32Array(_.length)),this._textureMatrixUpdateId=b._updateID,this._uvUpdateId=m._updateID,b.multiplyUvs(_,w)));const y=n.groupColorAlpha;for(let T=0;T<x.length;T+=2){const P=x[T],v=x[T+1];e[r]=h*P+d*v+u,e[r+1]=l*P+f*v+p,e[r+2]=w[T],e[r+3]=w[T+1],t[r+4]=y,t[r+5]=c,r+=6}}get vertexSize(){return this.geometry.positions.length/2}get indexSize(){return this.geometry.indices.length}}class ot{constructor(e,t){this.localUniforms=new V({uTransformMatrix:{value:new I,type:"mat3x3<f32>"},uColor:{value:new Float32Array([1,1,1,1]),type:"vec4<f32>"},uRound:{value:0,type:"f32"}}),this.localUniformsBindGroup=new Ae({0:this.localUniforms}),this._meshDataHash=Object.create(null),this._gpuBatchableMeshHash=Object.create(null),this.renderer=e,this._adaptor=t,this._adaptor.init()}validateRenderable(e){const t=this._getMeshData(e),r=t.batched,i=e.batched;if(t.batched=i,r!==i)return!0;if(i){const n=e._geometry;if(n.indices.length!==t.indexSize||n.positions.length!==t.vertexSize)return t.indexSize=n.indices.length,t.vertexSize=n.positions.length,!0;const a=this._getBatchableMesh(e),o=e.texture;if(a.texture._source!==o._source&&a.texture._source!==o._source)return!a.batcher.checkAndUpdateTexture(a,o)}return!1}addRenderable(e,t){const r=this.renderer.renderPipes.batch,{batched:i}=this._getMeshData(e);if(i){const n=this._getBatchableMesh(e);n.texture=e._texture,n.geometry=e._geometry,r.addToBatch(n)}else r.break(t),t.add({renderPipeId:"mesh",mesh:e})}updateRenderable(e){if(e.batched){const t=this._gpuBatchableMeshHash[e.uid];t.texture=e._texture,t.geometry=e._geometry,t.batcher.updateElement(t)}}destroyRenderable(e){this._meshDataHash[e.uid]=null;const t=this._gpuBatchableMeshHash[e.uid];t&&(B.return(t),this._gpuBatchableMeshHash[e.uid]=null)}execute({mesh:e}){if(!e.isRenderable)return;e.state.blendMode=e.groupBlendMode;const t=this.localUniforms;t.uniforms.uTransformMatrix=e.groupTransform,t.uniforms.uRound=this.renderer._roundPixels|e._roundPixels,t.update(),oe(e.groupColorAlpha,t.uniforms.uColor,0),this._adaptor.execute(this,e)}_getMeshData(e){return this._meshDataHash[e.uid]||this._initMeshData(e)}_initMeshData(e){return this._meshDataHash[e.uid]={batched:e.batched,indexSize:e._geometry.indices?.length,vertexSize:e._geometry.positions?.length},e.on("destroyed",()=>{this.destroyRenderable(e)}),this._meshDataHash[e.uid]}_getBatchableMesh(e){return this._gpuBatchableMeshHash[e.uid]||this._initBatchableMesh(e)}_initBatchableMesh(e){const t=B.get(de);return t.mesh=e,t.texture=e._texture,t.roundPixels=this.renderer._roundPixels|e._roundPixels,this._gpuBatchableMeshHash[e.uid]=t,t.mesh=e,t}destroy(){for(const e in this._gpuBatchableMeshHash)this._gpuBatchableMeshHash[e]&&B.return(this._gpuBatchableMeshHash[e]);this._gpuBatchableMeshHash=null,this._meshDataHash=null,this.localUniforms=null,this.localUniformsBindGroup=null,this._adaptor.destroy(),this._adaptor=null,this.renderer=null}}ot.extension={type:[S.WebGLPipes,S.WebGPUPipes,S.CanvasPipes],name:"mesh"};const ct=class lt extends Zt{constructor(e={}){e={...lt.defaultOptions,...e},super({width:e.width,height:e.height,verticesX:4,verticesY:4}),this.update(e)}update(e){this.width=e.width??this.width,this.height=e.height??this.height,this._originalWidth=e.originalWidth??this._originalWidth,this._originalHeight=e.originalHeight??this._originalHeight,this._leftWidth=e.leftWidth??this._leftWidth,this._rightWidth=e.rightWidth??this._rightWidth,this._topHeight=e.topHeight??this._topHeight,this._bottomHeight=e.bottomHeight??this._bottomHeight,this.updateUvs(),this.updatePositions()}updatePositions(){const e=this.positions,t=this._leftWidth+this._rightWidth,r=this.width>t?1:this.width/t,i=this._topHeight+this._bottomHeight,n=this.height>i?1:this.height/i,a=Math.min(r,n);e[9]=e[11]=e[13]=e[15]=this._topHeight*a,e[17]=e[19]=e[21]=e[23]=this.height-this._bottomHeight*a,e[25]=e[27]=e[29]=e[31]=this.height,e[2]=e[10]=e[18]=e[26]=this._leftWidth*a,e[4]=e[12]=e[20]=e[28]=this.width-this._rightWidth*a,e[6]=e[14]=e[22]=e[30]=this.width,this.getBuffer("aPosition").update()}updateUvs(){const e=this.uvs;e[0]=e[8]=e[16]=e[24]=0,e[1]=e[3]=e[5]=e[7]=0,e[6]=e[14]=e[22]=e[30]=1,e[25]=e[27]=e[29]=e[31]=1;const t=1/this._originalWidth,r=1/this._originalHeight;e[2]=e[10]=e[18]=e[26]=t*this._leftWidth,e[9]=e[11]=e[13]=e[15]=r*this._topHeight,e[4]=e[12]=e[20]=e[28]=1-t*this._rightWidth,e[17]=e[19]=e[21]=e[23]=1-r*this._bottomHeight,this.getBuffer("aUV").update()}};ct.defaultOptions={width:100,height:100,leftWidth:10,topHeight:10,rightWidth:10,bottomHeight:10,originalWidth:100,originalHeight:100};let Jt=ct;class ht{constructor(e){this._gpuSpriteHash=Object.create(null),this._renderer=e}addRenderable(e,t){const r=this._getGpuSprite(e);e._didSpriteUpdate&&this._updateBatchableSprite(e,r),this._renderer.renderPipes.batch.addToBatch(r)}updateRenderable(e){const t=this._gpuSpriteHash[e.uid];e._didSpriteUpdate&&this._updateBatchableSprite(e,t),t.batcher.updateElement(t)}validateRenderable(e){const t=e._texture,r=this._getGpuSprite(e);return r.texture._source!==t._source?!r.batcher.checkAndUpdateTexture(r,t):!1}destroyRenderable(e){const t=this._gpuSpriteHash[e.uid];B.return(t),this._gpuSpriteHash[e.uid]=null}_updateBatchableSprite(e,t){e._didSpriteUpdate=!1,t.geometry.update(e),t.texture=e._texture}_getGpuSprite(e){return this._gpuSpriteHash[e.uid]||this._initGPUSprite(e)}_initGPUSprite(e){const t=new de;return t.geometry=new Jt,t.mesh=e,t.texture=e._texture,t.roundPixels=this._renderer._roundPixels|e._roundPixels,this._gpuSpriteHash[e.uid]=t,e.on("destroyed",()=>{this.destroyRenderable(e)}),t}destroy(){for(const e in this._gpuSpriteHash)this._gpuSpriteHash[e].geometry.destroy();this._gpuSpriteHash=null,this._renderer=null}}ht.extension={type:[S.WebGLPipes,S.WebGPUPipes,S.CanvasPipes],name:"nineSliceSprite"};const er={name:"tiling-bit",vertex:{header:`
struct TilingUniforms {
uMapCoord:mat3x3<f32>,
uClampFrame:vec4<f32>,
uClampOffset:vec2<f32>,
uTextureTransform:mat3x3<f32>,
uSizeAnchor:vec4<f32>
};
@group(2) @binding(0) var<uniform> tilingUniforms: TilingUniforms;
@group(2) @binding(1) var uTexture: texture_2d<f32>;
@group(2) @binding(2) var uSampler: sampler;
`,main:`
uv = (tilingUniforms.uTextureTransform * vec3(uv, 1.0)).xy;
position = (position - tilingUniforms.uSizeAnchor.zw) * tilingUniforms.uSizeAnchor.xy;
`},fragment:{header:`
struct TilingUniforms {
uMapCoord:mat3x3<f32>,
uClampFrame:vec4<f32>,
uClampOffset:vec2<f32>,
uTextureTransform:mat3x3<f32>,
uSizeAnchor:vec4<f32>
};
@group(2) @binding(0) var<uniform> tilingUniforms: TilingUniforms;
@group(2) @binding(1) var uTexture: texture_2d<f32>;
@group(2) @binding(2) var uSampler: sampler;
`,main:`
var coord = vUV + ceil(tilingUniforms.uClampOffset - vUV);
coord = (tilingUniforms.uMapCoord * vec3(coord, 1.0)).xy;
var unclamped = coord;
coord = clamp(coord, tilingUniforms.uClampFrame.xy, tilingUniforms.uClampFrame.zw);
var bias = 0.;
if(unclamped.x == coord.x && unclamped.y == coord.y)
{
bias = -32.;
}
outColor = textureSampleBias(uTexture, uSampler, coord, bias);
`}},tr={name:"tiling-bit",vertex:{header:`
uniform mat3 uTextureTransform;
uniform vec4 uSizeAnchor;
`,main:`
uv = (uTextureTransform * vec3(aUV, 1.0)).xy;
position = (position - uSizeAnchor.zw) * uSizeAnchor.xy;
`},fragment:{header:`
uniform sampler2D uTexture;
uniform mat3 uMapCoord;
uniform vec4 uClampFrame;
uniform vec2 uClampOffset;
`,main:`
vec2 coord = vUV + ceil(uClampOffset - vUV);
coord = (uMapCoord * vec3(coord, 1.0)).xy;
vec2 unclamped = coord;
coord = clamp(coord, uClampFrame.xy, uClampFrame.zw);
outColor = texture(uTexture, coord, unclamped == coord ? 0.0 : -32.0);// lod-bias very negative to force lod 0
`}};let te,re;class rr extends He{constructor(){te??(te=Ge({name:"tiling-sprite-shader",bits:[Rt,er,Oe]})),re??(re=Le({name:"tiling-sprite-shader",bits:[At,tr,De]}));const e=new V({uMapCoord:{value:new I,type:"mat3x3<f32>"},uClampFrame:{value:new Float32Array([0,0,1,1]),type:"vec4<f32>"},uClampOffset:{value:new Float32Array([0,0]),type:"vec2<f32>"},uTextureTransform:{value:new I,type:"mat3x3<f32>"},uSizeAnchor:{value:new Float32Array([100,100,.5,.5]),type:"vec4<f32>"}});super({glProgram:re,gpuProgram:te,resources:{localUniforms:new V({uTransformMatrix:{value:new I,type:"mat3x3<f32>"},uColor:{value:new Float32Array([1,1,1,1]),type:"vec4<f32>"},uRound:{value:0,type:"f32"}}),tilingUniforms:e,uTexture:W.EMPTY.source,uSampler:W.EMPTY.source.style}})}updateUniforms(e,t,r,i,n,a){const o=this.resources.tilingUniforms,c=a.width,h=a.height,l=a.textureMatrix,d=o.uniforms.uTextureTransform;d.set(r.a*c/e,r.b*c/t,r.c*h/e,r.d*h/t,r.tx/e,r.ty/t),d.invert(),o.uniforms.uMapCoord=l.mapCoord,o.uniforms.uClampFrame=l.uClampFrame,o.uniforms.uClampOffset=l.uClampOffset,o.uniforms.uTextureTransform=d,o.uniforms.uSizeAnchor[0]=e,o.uniforms.uSizeAnchor[1]=t,o.uniforms.uSizeAnchor[2]=i,o.uniforms.uSizeAnchor[3]=n,a&&(this.resources.uTexture=a.source,this.resources.uSampler=a.source.style)}}class ir extends ce{constructor(){super({positions:new Float32Array([0,0,1,0,1,1,0,1]),uvs:new Float32Array([0,0,1,0,1,1,0,1]),indices:new Uint32Array([0,1,2,0,2,3])})}}function sr(s,e){const t=s.anchor.x,r=s.anchor.y;e[0]=-t*s.width,e[1]=-r*s.height,e[2]=(1-t)*s.width,e[3]=-r*s.height,e[4]=(1-t)*s.width,e[5]=(1-r)*s.height,e[6]=-t*s.width,e[7]=(1-r)*s.height}function nr(s,e,t,r){let i=0;const n=s.length/e,a=r.a,o=r.b,c=r.c,h=r.d,l=r.tx,d=r.ty;for(t*=e;i<n;){const f=s[t],u=s[t+1];s[t]=a*f+c*u+l,s[t+1]=o*f+h*u+d,t+=e,i++}}function ar(s,e){const t=s.texture,r=t.frame.width,i=t.frame.height;let n=0,a=0;s._applyAnchorToTexture&&(n=s.anchor.x,a=s.anchor.y),e[0]=e[6]=-n,e[2]=e[4]=1-n,e[1]=e[3]=-a,e[5]=e[7]=1-a;const o=I.shared;o.copyFrom(s._tileTransform.matrix),o.tx/=s.width,o.ty/=s.height,o.invert(),o.scale(s.width/r,s.height/i),nr(e,2,0,o)}const Y=new ir;class dt{constructor(e){this._tilingSpriteDataHash=Object.create(null),this._renderer=e}validateRenderable(e){const t=this._getTilingSpriteData(e),r=t.canBatch;this._updateCanBatch(e);const i=t.canBatch;if(i&&i===r){const{batchableMesh:n}=t;if(n.texture._source!==e.texture._source)return!n.batcher.checkAndUpdateTexture(n,e.texture)}return r!==i}addRenderable(e,t){const r=this._renderer.renderPipes.batch;this._updateCanBatch(e);const i=this._getTilingSpriteData(e),{geometry:n,canBatch:a}=i;if(a){i.batchableMesh||(i.batchableMesh=new de);const o=i.batchableMesh;e._didTilingSpriteUpdate&&(e._didTilingSpriteUpdate=!1,this._updateBatchableMesh(e),o.geometry=n,o.mesh=e,o.texture=e._texture),o.roundPixels=this._renderer._roundPixels|e._roundPixels,r.addToBatch(o)}else r.break(t),i.shader||(i.shader=new rr),this.updateRenderable(e),t.add(e)}execute(e){const{shader:t}=this._tilingSpriteDataHash[e.uid];t.groups[0]=this._renderer.globalUniforms.bindGroup;const r=t.resources.localUniforms.uniforms;r.uTransformMatrix=e.groupTransform,r.uRound=this._renderer._roundPixels|e._roundPixels,oe(e.groupColorAlpha,r.uColor,0),this._renderer.encoder.draw({geometry:Y,shader:t,state:Ie.default2d})}updateRenderable(e){const t=this._getTilingSpriteData(e),{canBatch:r}=t;if(r){const{batchableMesh:i}=t;e._didTilingSpriteUpdate&&this._updateBatchableMesh(e),i.batcher.updateElement(i)}else if(e._didTilingSpriteUpdate){const{shader:i}=t;i.updateUniforms(e.width,e.height,e._tileTransform.matrix,e.anchor.x,e.anchor.y,e.texture)}e._didTilingSpriteUpdate=!1}destroyRenderable(e){const t=this._getTilingSpriteData(e);t.batchableMesh=null,t.shader?.destroy(),this._tilingSpriteDataHash[e.uid]=null}_getTilingSpriteData(e){return this._tilingSpriteDataHash[e.uid]||this._initTilingSpriteData(e)}_initTilingSpriteData(e){const t=new ce({indices:Y.indices,positions:Y.positions.slice(),uvs:Y.uvs.slice()});return this._tilingSpriteDataHash[e.uid]={canBatch:!0,renderable:e,geometry:t},e.on("destroyed",()=>{this.destroyRenderable(e)}),this._tilingSpriteDataHash[e.uid]}_updateBatchableMesh(e){const t=this._getTilingSpriteData(e),{geometry:r}=t,i=e.texture.source.style;i.addressMode!=="repeat"&&(i.addressMode="repeat",i.update()),ar(e,r.uvs),sr(e,r.positions)}destroy(){for(const e in this._tilingSpriteDataHash)this.destroyRenderable(this._tilingSpriteDataHash[e].renderable);this._tilingSpriteDataHash=null,this._renderer=null}_updateCanBatch(e){const t=this._getTilingSpriteData(e),r=e.texture;let i=!0;return this._renderer.type===ae.WEBGL&&(i=this._renderer.context.supports.nonPowOf2wrapping),t.canBatch=r.textureMatrix.isSimple&&(i||r.source.isPowerOfTwo),t.canBatch}}dt.extension={type:[S.WebGLPipes,S.WebGPUPipes,S.CanvasPipes],name:"tilingSprite"};const ie={test(s){return typeof s=="string"&&s.startsWith("info face=")},parse(s){const e=s.match(/^[a-z]+\s+.+$/gm),t={info:[],common:[],page:[],char:[],chars:[],kerning:[],kernings:[],distanceField:[]};for(const d in e){const f=e[d].match(/^[a-z]+/gm)[0],u=e[d].match(/[a-zA-Z]+=([^\s"']+|"([^"]*)")/gm),p={};for(const x in u){const m=u[x].split("="),_=m[0],w=m[1].replace(/"/gm,""),b=parseFloat(w),y=isNaN(b)?w:b;p[_]=y}t[f].push(p)}const r={chars:{},pages:[],lineHeight:0,fontSize:0,fontFamily:"",distanceField:null,baseLineOffset:0},[i]=t.info,[n]=t.common,[a]=t.distanceField??[];a&&(r.distanceField={range:parseInt(a.distanceRange,10),type:a.fieldType}),r.fontSize=parseInt(i.size,10),r.fontFamily=i.face,r.lineHeight=parseInt(n.lineHeight,10);const o=t.page;for(let d=0;d<o.length;d++)r.pages.push({id:parseInt(o[d].id,10)||0,file:o[d].file});const c={};r.baseLineOffset=r.lineHeight-parseInt(n.base,10);const h=t.char;for(let d=0;d<h.length;d++){const f=h[d],u=parseInt(f.id,10);let p=f.letter??f.char??String.fromCharCode(u);p==="space"&&(p=" "),c[u]=p,r.chars[p]={id:u,page:parseInt(f.page,10)||0,x:parseInt(f.x,10),y:parseInt(f.y,10),width:parseInt(f.width,10),height:parseInt(f.height,10),xOffset:parseInt(f.xoffset,10),yOffset:parseInt(f.yoffset,10),xAdvance:parseInt(f.xadvance,10),kerning:{}}}const l=t.kerning||[];for(let d=0;d<l.length;d++){const f=parseInt(l[d].first,10),u=parseInt(l[d].second,10),p=parseInt(l[d].amount,10);r.chars[c[u]].kerning[c[f]]=p}return r}},Ce={test(s){const e=s;return typeof e!="string"&&"getElementsByTagName"in e&&e.getElementsByTagName("page").length&&e.getElementsByTagName("info")[0].getAttribute("face")!==null},parse(s){const e={chars:{},pages:[],lineHeight:0,fontSize:0,fontFamily:"",distanceField:null,baseLineOffset:0},t=s.getElementsByTagName("info")[0],r=s.getElementsByTagName("common")[0],i=s.getElementsByTagName("distanceField")[0];i&&(e.distanceField={type:i.getAttribute("fieldType"),range:parseInt(i.getAttribute("distanceRange"),10)});const n=s.getElementsByTagName("page"),a=s.getElementsByTagName("char"),o=s.getElementsByTagName("kerning");e.fontSize=parseInt(t.getAttribute("size"),10),e.fontFamily=t.getAttribute("face"),e.lineHeight=parseInt(r.getAttribute("lineHeight"),10);for(let h=0;h<n.length;h++)e.pages.push({id:parseInt(n[h].getAttribute("id"),10)||0,file:n[h].getAttribute("file")});const c={};e.baseLineOffset=e.lineHeight-parseInt(r.getAttribute("base"),10);for(let h=0;h<a.length;h++){const l=a[h],d=parseInt(l.getAttribute("id"),10);let f=l.getAttribute("letter")??l.getAttribute("char")??String.fromCharCode(d);f==="space"&&(f=" "),c[d]=f,e.chars[f]={id:d,page:parseInt(l.getAttribute("page"),10)||0,x:parseInt(l.getAttribute("x"),10),y:parseInt(l.getAttribute("y"),10),width:parseInt(l.getAttribute("width"),10),height:parseInt(l.getAttribute("height"),10),xOffset:parseInt(l.getAttribute("xoffset"),10),yOffset:parseInt(l.getAttribute("yoffset"),10),xAdvance:parseInt(l.getAttribute("xadvance"),10),kerning:{}}}for(let h=0;h<o.length;h++){const l=parseInt(o[h].getAttribute("first"),10),d=parseInt(o[h].getAttribute("second"),10),f=parseInt(o[h].getAttribute("amount"),10);e.chars[c[d]].kerning[c[l]]=f}return e}},Be={test(s){return typeof s=="string"&&s.includes("<font>")?Ce.test(L.get().parseXML(s)):!1},parse(s){return Ce.parse(L.get().parseXML(s))}};class ut extends Ze{constructor(e,t){super();const{textures:r,data:i}=e;Object.keys(i.pages).forEach(n=>{const a=i.pages[parseInt(n,10)],o=r[a.id];this.pages.push({texture:o})}),Object.keys(i.chars).forEach(n=>{const a=i.chars[n],{frame:o,source:c}=r[a.page],h=new X(a.x+o.x,a.y+o.y,a.width,a.height),l=new W({source:c,frame:h});this.chars[n]={id:n.codePointAt(0),xOffset:a.xOffset,yOffset:a.yOffset,xAdvance:a.xAdvance,kerning:a.kerning??{},texture:l}}),this.baseRenderedFontSize=i.fontSize,this.baseMeasurementFontSize=i.fontSize,this.fontMetrics={ascent:0,descent:0,fontSize:i.fontSize},this.baseLineOffset=i.baseLineOffset,this.lineHeight=i.lineHeight,this.fontFamily=i.fontFamily,this.distanceField=i.distanceField??{type:"none",range:0},this.url=t}destroy(){super.destroy();for(let e=0;e<this.pages.length;e++){const{texture:t}=this.pages[e];t.destroy(!0)}this.pages=null}static install(e){ne.install(e)}static uninstall(e){ne.uninstall(e)}}const or=[".xml",".fnt"],cr={extension:S.CacheParser,test:s=>s instanceof ut,getCacheableAssets(s,e){const t={};return s.forEach(r=>{t[r]=e}),t[`${e.fontFamily}-bitmap`]=e,t}},lr={extension:{type:S.LoadParser,priority:Bt.Normal},test(s){return or.includes(J.extname(s).toLowerCase())},async testParse(s){return ie.test(s)||Be.test(s)},async parse(s,e,t){const r=ie.test(s)?ie.parse(s):Be.parse(s),{src:i}=e,{pages:n}=r,a=[];for(let l=0;l<n.length;++l){const d=n[l].file;let f=J.join(J.dirname(i),d);f=Ft(f,i),a.push(f)}const o=await t.load(a),c=a.map(l=>o[l]);return new ut({data:r,textures:c},i)},async load(s,e){return await (await L.get().fetch(s)).text()},async unload(s,e,t){await Promise.all(s.pages.map(r=>t.unload(r.texture.source._sourceOrigin))),s.destroy()}},hr={name:"local-uniform-msdf-bit",vertex:{header:`
struct LocalUniforms {
uColor:vec4<f32>,
uTransformMatrix:mat3x3<f32>,
uDistance: f32,
uRound:f32,
}
@group(2) @binding(0) var<uniform> localUniforms : LocalUniforms;
`,main:`
vColor *= localUniforms.uColor;
modelMatrix *= localUniforms.uTransformMatrix;
`,end:`
if(localUniforms.uRound == 1)
{
vPosition = vec4(roundPixels(vPosition.xy, globalUniforms.uResolution), vPosition.zw);
}
`},fragment:{header:`
struct LocalUniforms {
uColor:vec4<f32>,
uTransformMatrix:mat3x3<f32>,
uDistance: f32
}
@group(2) @binding(0) var<uniform> localUniforms : LocalUniforms;
`,main:`
outColor = vColor * calculateMSDFAlpha(outColor, localUniforms.uDistance);
`}},dr={name:"local-uniform-msdf-bit",vertex:{header:`
uniform mat3 uTransformMatrix;
uniform vec4 uColor;
uniform float uRound;
`,main:`
vColor *= uColor;
modelMatrix *= uTransformMatrix;
`,end:`
if(uRound == 1.)
{
gl_Position.xy = roundPixels(gl_Position.xy, uResolution);
}
`},fragment:{header:`
uniform float uDistance;
`,main:`
outColor = vColor * calculateMSDFAlpha(outColor, uDistance);
`}},ur={name:"msdf-bit",fragment:{header:`
fn calculateMSDFAlpha(msdfColor:vec4<f32>, distance:f32) -> f32 {
// MSDF
var median = msdfColor.r + msdfColor.g + msdfColor.b -
min(msdfColor.r, min(msdfColor.g, msdfColor.b)) -
max(msdfColor.r, max(msdfColor.g, msdfColor.b));
// SDF
median = min(median, msdfColor.a);
var screenPxDistance = distance * (median - 0.5);
var alpha = clamp(screenPxDistance + 0.5, 0.0, 1.0);
if (median < 0.01) {
alpha = 0.0;
} else if (median > 0.99) {
alpha = 1.0;
}
return alpha;
}
`}},fr={name:"msdf-bit",fragment:{header:`
float calculateMSDFAlpha(vec4 msdfColor, float distance) {
// MSDF
float median = msdfColor.r + msdfColor.g + msdfColor.b -
min(msdfColor.r, min(msdfColor.g, msdfColor.b)) -
max(msdfColor.r, max(msdfColor.g, msdfColor.b));
// SDF
median = min(median, msdfColor.a);
float screenPxDistance = distance * (median - 0.5);
float alpha = clamp(screenPxDistance + 0.5, 0.0, 1.0);
if (median < 0.01) {
alpha = 0.0;
} else if (median > 0.99) {
alpha = 1.0;
}
return alpha;
}
`}};class pr extends He{constructor(){const e=new V({uColor:{value:new Float32Array([1,1,1,1]),type:"vec4<f32>"},uTransformMatrix:{value:new I,type:"mat3x3<f32>"},uDistance:{value:4,type:"f32"},uRound:{value:0,type:"f32"}}),t=Pt(),r=Ge({name:"sdf-shader",bits:[Wt,Ut(t),hr,ur,Oe]}),i=Le({name:"sdf-shader",bits:[zt,It(t),dr,fr,De]});super({glProgram:i,gpuProgram:r,resources:{localUniforms:e,batchSamplers:Ht(t)}})}}class ft{constructor(e){this._gpuBitmapText={},this._renderer=e}validateRenderable(e){const t=this._getGpuBitmapText(e);return e._didTextUpdate&&(e._didTextUpdate=!1,this._updateContext(e,t)),this._renderer.renderPipes.graphics.validateRenderable(t)}addRenderable(e,t){const r=this._getGpuBitmapText(e);Fe(e,r),e._didTextUpdate&&(e._didTextUpdate=!1,this._updateContext(e,r)),this._renderer.renderPipes.graphics.addRenderable(r,t),r.context.customShader&&this._updateDistanceField(e)}destroyRenderable(e){this._destroyRenderableByUid(e.uid)}_destroyRenderableByUid(e){B.return(this._gpuBitmapText[e]),this._gpuBitmapText[e]=null}updateRenderable(e){const t=this._getGpuBitmapText(e);Fe(e,t),this._renderer.renderPipes.graphics.updateRenderable(t),t.context.customShader&&this._updateDistanceField(e)}_updateContext(e,t){const{context:r}=t,i=ne.getFont(e.text,e._style);r.clear(),i.distanceField.type!=="none"&&(r.customShader||(this._sdfShader||(this._sdfShader=new pr),r.customShader=this._sdfShader));const n=Array.from(e.text),a=e._style;let o=(a._stroke?.width||0)/2;o+=i.baseLineOffset;const c=et(n,a,i);let h=0;const l=a.padding,d=c.scale;r.translate(-e._anchor._x*c.width-l,-e._anchor._y*(c.height+c.offsetY)-l).scale(d,d);const f=a._fill.color;for(let u=0;u<c.lines.length;u++){const p=c.lines[u];for(let x=0;x<p.charPositions.length;x++){const m=n[h++],_=i.chars[m];_?.texture&&r.texture(_.texture,f||"black",Math.round(p.charPositions[x]+_.xOffset),Math.round(o+_.yOffset))}o+=i.lineHeight}}_getGpuBitmapText(e){return this._gpuBitmapText[e.uid]||this.initGpuText(e)}initGpuText(e){const t=B.get(kt);return this._gpuBitmapText[e.uid]=t,this._updateContext(e,t),e.on("destroyed",()=>{this.destroyRenderable(e)}),this._gpuBitmapText[e.uid]}_updateDistanceField(e){const t=this._getGpuBitmapText(e).context,r=e._style.fontFamily,i=R.get(`${r}-bitmap`),{a:n,b:a,c:o,d:c}=e.groupTransform,h=Math.sqrt(n*n+a*a),l=Math.sqrt(o*o+c*c),d=(Math.abs(h)+Math.abs(l))/2,f=i.baseRenderedFontSize/e._style.fontSize,u=e.resolution??this._renderer.resolution,p=d*i.distanceField.range*(1/f)*u;t.customShader.resources.localUniforms.uniforms.uDistance=p}destroy(){for(const e in this._gpuBitmapText)this._destroyRenderableByUid(e);this._gpuBitmapText=null,this._sdfShader?.destroy(!0),this._sdfShader=null,this._renderer=null}}ft.extension={type:[S.WebGLPipes,S.WebGPUPipes,S.CanvasPipes],name:"bitmapText"};function Fe(s,e){e.groupTransform=s.groupTransform,e.groupColorAlpha=s.groupColorAlpha,e.groupColor=s.groupColor,e.groupBlendMode=s.groupBlendMode,e.globalDisplayStatus=s.globalDisplayStatus,e.groupTransform=s.groupTransform,e.localDisplayStatus=s.localDisplayStatus,e.groupAlpha=s.groupAlpha,e._roundPixels=s._roundPixels}class pt{constructor(e){this._gpuText=Object.create(null),this._renderer=e}validateRenderable(e){const t=this._getGpuText(e),r=e._getKey();return t.textureNeedsUploading?(t.textureNeedsUploading=!1,!0):t.currentKey!==r}addRenderable(e){const r=this._getGpuText(e).batchableSprite;e._didTextUpdate&&this._updateText(e),this._renderer.renderPipes.batch.addToBatch(r)}updateRenderable(e){const r=this._getGpuText(e).batchableSprite;e._didTextUpdate&&this._updateText(e),r.batcher.updateElement(r)}destroyRenderable(e){this._destroyRenderableById(e.uid)}_destroyRenderableById(e){const t=this._gpuText[e];this._renderer.htmlText.decreaseReferenceCount(t.currentKey),B.return(t.batchableSprite),this._gpuText[e]=null}_updateText(e){const t=e._getKey(),r=this._getGpuText(e),i=r.batchableSprite;r.currentKey!==t&&this._updateGpuText(e).catch(a=>{console.error(a)}),e._didTextUpdate=!1;const n=e._style.padding;se(i.bounds,e._anchor,i.texture,n)}async _updateGpuText(e){e._didTextUpdate=!1;const t=this._getGpuText(e);if(t.generatingTexture)return;const r=e._getKey();this._renderer.htmlText.decreaseReferenceCount(t.currentKey),t.generatingTexture=!0,t.currentKey=r;const i=e.resolution??this._renderer.resolution,n=await this._renderer.htmlText.getManagedTexture(e.text,i,e._style,e._getKey()),a=t.batchableSprite;a.texture=t.texture=n,t.generatingTexture=!1,t.textureNeedsUploading=!0,e.onViewUpdate();const o=e._style.padding;se(a.bounds,e._anchor,a.texture,o)}_getGpuText(e){return this._gpuText[e.uid]||this.initGpuText(e)}initGpuText(e){const t={texture:W.EMPTY,currentKey:"--",batchableSprite:B.get(Ee),textureNeedsUploading:!1,generatingTexture:!1},r=t.batchableSprite;return r.renderable=e,r.texture=W.EMPTY,r.bounds={minX:0,maxX:1,minY:0,maxY:0},r.roundPixels=this._renderer._roundPixels|e._roundPixels,this._gpuText[e.uid]=t,e.on("destroyed",()=>{this.destroyRenderable(e)}),t}destroy(){for(const e in this._gpuText)this._destroyRenderableById(e);this._gpuText=null,this._renderer=null}}pt.extension={type:[S.WebGLPipes,S.WebGPUPipes,S.CanvasPipes],name:"htmlText"};function gr(){const{userAgent:s}=L.get().getNavigator();return/^((?!chrome|android).)*safari/i.test(s)}const mr=new We;function gt(s,e,t,r){const i=mr;i.minX=0,i.minY=0,i.maxX=s.width/r|0,i.maxY=s.height/r|0;const n=z.getOptimalTexture(i.width,i.height,r,!1);return n.source.uploadMethodId="image",n.source.resource=s,n.source.alphaMode="premultiply-alpha-on-upload",n.frame.width=e/r,n.frame.height=t/r,n.source.emit("update",n.source),n.updateUvs(),n}function xr(s,e){const t=e.fontFamily,r=[],i={},n=/font-family:([^;"\s]+)/g,a=s.match(n);function o(c){i[c]||(r.push(c),i[c]=!0)}if(Array.isArray(t))for(let c=0;c<t.length;c++)o(t[c]);else o(t);a&&a.forEach(c=>{const h=c.split(":")[1].trim();o(h)});for(const c in e.tagStyles){const h=e.tagStyles[c].fontFamily;o(h)}return r}async function _r(s){const t=await (await L.get().fetch(s)).blob(),r=new FileReader;return await new Promise((n,a)=>{r.onloadend=()=>n(r.result),r.onerror=a,r.readAsDataURL(t)})}async function Pe(s,e){const t=await _r(e);return`@font-face {
font-family: "${s.fontFamily}";
src: url('${t}');
font-weight: ${s.fontWeight};
font-style: ${s.fontStyle};
}`}const j=new Map;async function br(s,e,t){const r=s.filter(i=>R.has(`${i}-and-url`)).map((i,n)=>{if(!j.has(i)){const{url:a}=R.get(`${i}-and-url`);n===0?j.set(i,Pe(e,a)):j.set(i,Pe({fontWeight:t.fontWeight,fontStyle:t.fontStyle,fontFamily:i},a))}return j.get(i)});return(await Promise.all(r)).join(`
`)}function Sr(s,e,t,r,i){const{domElement:n,styleElement:a,svgRoot:o}=i;n.innerHTML=`<style>${e.cssStyle}</style><div>${s}</div>`,n.setAttribute("style",`transform: scale(${t});transform-origin: top left; display: inline-block`),a.textContent=r;const{width:c,height:h}=i.image;return o.setAttribute("width",c.toString()),o.setAttribute("height",h.toString()),new XMLSerializer().serializeToString(o)}function yr(s,e){const t=O.getOptimalCanvasAndContext(s.width,s.height,e),{context:r}=t;return r.clearRect(0,0,s.width,s.height),r.drawImage(s,0,0),O.returnCanvasAndContext(t),t.canvas}function wr(s,e,t){return new Promise(async r=>{t&&await new Promise(i=>setTimeout(i,100)),s.onload=()=>{r()},s.src=`data:image/svg+xml;charset=utf8,${encodeURIComponent(e)}`,s.crossOrigin="anonymous"})}class ue{constructor(e){this._activeTextures={},this._renderer=e,this._createCanvas=e.type===ae.WEBGPU}getTexture(e){return this._buildTexturePromise(e.text,e.resolution,e.style)}getManagedTexture(e,t,r,i){if(this._activeTextures[i])return this._increaseReferenceCount(i),this._activeTextures[i].promise;const n=this._buildTexturePromise(e,t,r).then(a=>(this._activeTextures[i].texture=a,a));return this._activeTextures[i]={texture:null,promise:n,usageCount:1},n}async _buildTexturePromise(e,t,r){const i=B.get(it),n=xr(e,r),a=await br(n,r,he.defaultTextStyle),o=Qt(e,r,a,i),c=Math.ceil(Math.ceil(Math.max(1,o.width)+r.padding*2)*t),h=Math.ceil(Math.ceil(Math.max(1,o.height)+r.padding*2)*t),l=i.image;l.width=c|0,l.height=h|0;const d=Sr(e,r,t,a,i);await wr(l,d,gr()&&n.length>0);let f=l;this._createCanvas&&(f=yr(l,t));const u=gt(f,l.width,l.height,t);return this._createCanvas&&this._renderer.texture.initSource(u.source),B.return(i),u}_increaseReferenceCount(e){this._activeTextures[e].usageCount++}decreaseReferenceCount(e){const t=this._activeTextures[e];t&&(t.usageCount--,t.usageCount===0&&(t.texture?this._cleanUp(t):t.promise.then(r=>{t.texture=r,this._cleanUp(t)}).catch(()=>{K("HTMLTextSystem: Failed to clean texture")}),this._activeTextures[e]=null))}_cleanUp(e){z.returnTexture(e.texture),e.texture.source.resource=null,e.texture.source.uploadMethodId="unknown"}getReferenceCount(e){return this._activeTextures[e].usageCount}destroy(){this._activeTextures=null}}ue.extension={type:[S.WebGLSystem,S.WebGPUSystem,S.CanvasSystem],name:"htmlText"};ue.defaultFontOptions={fontFamily:"Arial",fontStyle:"normal",fontWeight:"normal"};class mt{constructor(e){this._gpuText=Object.create(null),this._renderer=e}validateRenderable(e){const t=this._getGpuText(e),r=e._getKey();if(t.currentKey!==r){const i=e.resolution??this._renderer.resolution,{width:n,height:a}=this._renderer.canvasText.getTextureSize(e.text,i,e._style);return!(this._renderer.canvasText.getReferenceCount(t.currentKey)===1&&n===t.texture._source.width&&a===t.texture._source.height)}return!1}addRenderable(e,t){const i=this._getGpuText(e).batchableSprite;e._didTextUpdate&&this._updateText(e),this._renderer.renderPipes.batch.addToBatch(i)}updateRenderable(e){const r=this._getGpuText(e).batchableSprite;e._didTextUpdate&&this._updateText(e),r.batcher.updateElement(r)}destroyRenderable(e){this._destroyRenderableById(e.uid)}_destroyRenderableById(e){const t=this._gpuText[e];this._renderer.canvasText.decreaseReferenceCount(t.currentKey),B.return(t.batchableSprite),this._gpuText[e]=null}_updateText(e){const t=e._getKey(),r=this._getGpuText(e),i=r.batchableSprite;r.currentKey!==t&&this._updateGpuText(e),e._didTextUpdate=!1;const n=e._style.padding;se(i.bounds,e._anchor,i.texture,n)}_updateGpuText(e){const t=this._getGpuText(e),r=t.batchableSprite;t.texture&&this._renderer.canvasText.decreaseReferenceCount(t.currentKey),t.texture=r.texture=this._renderer.canvasText.getManagedTexture(e),t.currentKey=e._getKey(),r.texture=t.texture}_getGpuText(e){return this._gpuText[e.uid]||this.initGpuText(e)}initGpuText(e){const t={texture:null,currentKey:"--",batchableSprite:B.get(Ee)};return t.batchableSprite.renderable=e,t.batchableSprite.bounds={minX:0,maxX:1,minY:0,maxY:0},t.batchableSprite.roundPixels=this._renderer._roundPixels|e._roundPixels,this._gpuText[e.uid]=t,this._updateText(e),e.on("destroyed",()=>{this.destroyRenderable(e)}),t}destroy(){for(const e in this._gpuText)this._destroyRenderableById(e);this._gpuText=null,this._renderer=null}}mt.extension={type:[S.WebGLPipes,S.WebGPUPipes,S.CanvasPipes],name:"text"};function ke(s,e,t){for(let r=0,i=4*t*e;r<e;++r,i+=4)if(s[i+3]!==0)return!1;return!0}function Me(s,e,t,r,i){const n=4*e;for(let a=r,o=r*n+4*t;a<=i;++a,o+=n)if(s[o+3]!==0)return!1;return!0}function Tr(s,e=1){const{width:t,height:r}=s,i=s.getContext("2d",{willReadFrequently:!0});if(i===null)throw new TypeError("Failed to get canvas 2D context");const a=i.getImageData(0,0,t,r).data;let o=0,c=0,h=t-1,l=r-1;for(;c<r&&ke(a,t,c);)++c;if(c===r)return X.EMPTY;for(;ke(a,t,l);)--l;for(;Me(a,t,o,c,l);)++o;for(;Me(a,t,h,c,l);)--h;return++h,++l,new X(o/e,c/e,(h-o)/e,(l-c)/e)}class xt{constructor(e){this._activeTextures={},this._renderer=e}getTextureSize(e,t,r){const i=G.measureText(e||" ",r);let n=Math.ceil(Math.ceil(Math.max(1,i.width)+r.padding*2)*t),a=Math.ceil(Math.ceil(Math.max(1,i.height)+r.padding*2)*t);return n=Math.ceil(n-1e-6),a=Math.ceil(a-1e-6),n=xe(n),a=xe(a),{width:n,height:a}}getTexture(e,t,r,i){typeof e=="string"&&(M("8.0.0","CanvasTextSystem.getTexture: Use object TextOptions instead of separate arguments"),e={text:e,style:r,resolution:t}),e.style instanceof $||(e.style=new $(e.style));const{texture:n,canvasAndContext:a}=this.createTextureAndCanvas(e);return this._renderer.texture.initSource(n._source),O.returnCanvasAndContext(a),n}createTextureAndCanvas(e){const{text:t,style:r}=e,i=e.resolution??this._renderer.resolution,n=G.measureText(t||" ",r),a=Math.ceil(Math.ceil(Math.max(1,n.width)+r.padding*2)*i),o=Math.ceil(Math.ceil(Math.max(1,n.height)+r.padding*2)*i),c=O.getOptimalCanvasAndContext(a,o),{canvas:h}=c;this.renderTextToCanvas(t,r,i,c);const l=gt(h,a,o,i);if(r.trim){const d=Tr(h,i);l.frame.copyFrom(d),l.updateUvs()}return{texture:l,canvasAndContext:c}}getManagedTexture(e){const t=e._getKey();if(this._activeTextures[t])return this._increaseReferenceCount(t),this._activeTextures[t].texture;const{texture:r,canvasAndContext:i}=this.createTextureAndCanvas(e);return this._activeTextures[t]={canvasAndContext:i,texture:r,usageCount:1},r}_increaseReferenceCount(e){this._activeTextures[e].usageCount++}decreaseReferenceCount(e){const t=this._activeTextures[e];if(t.usageCount--,t.usageCount===0){O.returnCanvasAndContext(t.canvasAndContext),z.returnTexture(t.texture);const r=t.texture.source;r.resource=null,r.uploadMethodId="unknown",r.alphaMode="no-premultiply-alpha",this._activeTextures[e]=null}}getReferenceCount(e){return this._activeTextures[e].usageCount}renderTextToCanvas(e,t,r,i){const{canvas:n,context:a}=i,o=N(t),c=G.measureText(e||" ",t),h=c.lines,l=c.lineHeight,d=c.lineWidths,f=c.maxLineWidth,u=c.fontProperties,p=n.height;a.resetTransform(),a.scale(r,r);const x=t.padding*2;if(a.clearRect(0,0,c.width+4+x,c.height+4+x),t._stroke?.width){const b=t._stroke;a.lineWidth=b.width,a.miterLimit=b.miterLimit,a.lineJoin=b.join,a.lineCap=b.cap}a.font=o;let m,_;const w=t.dropShadow?2:1;for(let b=0;b<w;++b){const y=t.dropShadow&&b===0,T=y?Math.ceil(Math.max(1,p)+t.padding*2):0,P=T*r;if(y){a.fillStyle="black",a.strokeStyle="black";const C=t.dropShadow,_t=C.color,bt=C.alpha;a.shadowColor=H.shared.setValue(_t).setAlpha(bt).toRgbaString();const St=C.blur*r,fe=C.distance*r;a.shadowBlur=St,a.shadowOffsetX=Math.cos(C.angle)*fe,a.shadowOffsetY=Math.sin(C.angle)*fe+P}else a.globalAlpha=t._fill?.alpha??1,a.fillStyle=t._fill?q(t._fill,a):null,t._stroke?.width&&(a.strokeStyle=q(t._stroke,a)),a.shadowColor="black";let v=(l-u.fontSize)/2;l-u.fontSize<0&&(v=0);const k=t._stroke?.width??0;for(let C=0;C<h.length;C++)m=k/2,_=k/2+C*l+u.ascent+v,t.align==="right"?m+=f-d[C]:t.align==="center"&&(m+=(f-d[C])/2),t._stroke?.width&&this._drawLetterSpacing(h[C],t,i,m+t.padding,_+t.padding-T,!0),t._fill!==void 0&&this._drawLetterSpacing(h[C],t,i,m+t.padding,_+t.padding-T)}}_drawLetterSpacing(e,t,r,i,n,a=!1){const{context:o}=r,c=t.letterSpacing;let h=!1;if(G.experimentalLetterSpacingSupported&&(G.experimentalLetterSpacing?(o.letterSpacing=`${c}px`,o.textLetterSpacing=`${c}px`,h=!0):(o.letterSpacing="0px",o.textLetterSpacing="0px")),c===0||h){a?o.strokeText(e,i,n):o.fillText(e,i,n);return}let l=i;const d=G.graphemeSegmenter(e);let f=o.measureText(e).width,u=0;for(let p=0;p<d.length;++p){const x=d[p];a?o.strokeText(x,l,n):o.fillText(x,l,n);let m="";for(let _=p+1;_<d.length;++_)m+=d[_];u=o.measureText(m).width,l+=f-u+c,f=u}}destroy(){this._activeTextures=null}}xt.extension={type:[S.WebGLSystem,S.WebGPUSystem,S.CanvasSystem],name:"canvasText"};F.add($e);F.add(Ke);F.add(st);F.add(Mt);F.add(ot);F.add(xt);F.add(mt);F.add(ft,lr,cr);F.add(ue);F.add(pt);F.add(dt);F.add(ht);F.add(je);F.add(Ve)});export{__tla};

View File

@@ -0,0 +1,173 @@
import{E as S,U as yt,T as xe,a as We,K as R,L as U,I as M,Q as O,V as _e,W as be,X as q,Y as le,D as Y,k as G,M as H,w as K,R as ae,Z as Tt,_ as W,$ as Z,O as Ue,d as Ae,P as vt,t as ze,c as ee,B as E,q as B,a0 as Ct,a1 as Ge,g as Bt,a2 as Ft,a3 as oe,n as Se,e as F,a4 as Pt,__tla as __tla_0}from"./TorrentDetail-CKmHZcwa.js";import{U as V,T as z,R as he,S as He,i as ce,b as Le,c as De,j as Ie,e as Mt,r as Oe,o as kt,n as Ee,a as Rt,g as Wt,k as Ut,m as At,B as $e,__tla as __tla_1}from"./colorToUniform-rMRo2qOn.js";import{C as I,__tla as __tla_2}from"./CanvasPool-D00IADyo.js";import{g as zt,__tla as __tla_3}from"./getBatchSamplersUniformGroup-B1Z3BKU1.js";import{__tla as __tla_4}from"./ColoredChip.vue_vue_type_script_setup_true_lang-CBDbhtDT.js";import{__tla as __tla_5}from"./index-C0tfT_Qc.js";import"./vue-CfSjRv-x.js";import"./vuetify-PctCzU6r.js";import{__tla as __tla_6}from"./MixedButton.vue_vue_type_script_setup_true_lang-Br4NUWtV.js";import"./FileIcon-DH65fwz5.js";import{__tla as __tla_7}from"./MoveTorrentFileDialog.vue_vue_type_script_setup_true_lang-C8uA-x2z.js";let __tla=Promise.all([(()=>{try{return __tla_0}catch{}})(),(()=>{try{return __tla_1}catch{}})(),(()=>{try{return __tla_2}catch{}})(),(()=>{try{return __tla_3}catch{}})(),(()=>{try{return __tla_4}catch{}})(),(()=>{try{return __tla_5}catch{}})(),(()=>{try{return __tla_6}catch{}})(),(()=>{try{return __tla_7}catch{}})()]).then(async()=>{class Ke{static init(e){Object.defineProperty(this,"resizeTo",{set(t){globalThis.removeEventListener("resize",this.queueResize),this._resizeTo=t,t&&(globalThis.addEventListener("resize",this.queueResize),this.resize())},get(){return this._resizeTo}}),this.queueResize=()=>{this._resizeTo&&(this._cancelResize(),this._resizeId=requestAnimationFrame(()=>this.resize()))},this._cancelResize=()=>{this._resizeId&&(cancelAnimationFrame(this._resizeId),this._resizeId=null)},this.resize=()=>{if(!this._resizeTo)return;this._cancelResize();let t,r;if(this._resizeTo===globalThis.window)t=globalThis.innerWidth,r=globalThis.innerHeight;else{const{clientWidth:i,clientHeight:n}=this._resizeTo;t=i,r=n}this.renderer.resize(t,r),this.render()},this._resizeId=null,this._resizeTo=null,this.resizeTo=e.resizeTo||null}static destroy(){globalThis.removeEventListener("resize",this.queueResize),this._cancelResize(),this._cancelResize=null,this.queueResize=null,this.resizeTo=null,this.resize=null}}Ke.extension=S.Application;class Ye{static init(e){e=Object.assign({autoStart:!0,sharedTicker:!1},e),Object.defineProperty(this,"ticker",{set(t){this._ticker&&this._ticker.remove(this.render,this),this._ticker=t,t&&t.add(this.render,this,yt.LOW)},get(){return this._ticker}}),this.stop=()=>{this._ticker.stop()},this.start=()=>{this._ticker.start()},this._ticker=null,this.ticker=e.sharedTicker?xe.shared:new xe,e.autoStart&&this.start()}static destroy(){if(this._ticker){const e=this._ticker;this.ticker=null,e.destroy()}}}Ye.extension=S.Application;class Gt extends We{constructor(){super(...arguments),this.chars=Object.create(null),this.lineHeight=0,this.fontFamily="",this.fontMetrics={fontSize:0,ascent:0,descent:0},this.baseLineOffset=0,this.distanceField={type:"none",range:0},this.pages=[],this.applyFillAsTint=!0,this.baseMeasurementFontSize=100,this.baseRenderedFontSize=100}get font(){return R(U,"BitmapFont.font is deprecated, please use BitmapFont.fontFamily instead."),this.fontFamily}get pageTextures(){return R(U,"BitmapFont.pageTextures is deprecated, please use BitmapFont.pages instead."),this.pages}get size(){return R(U,"BitmapFont.size is deprecated, please use BitmapFont.fontMetrics.fontSize instead."),this.fontMetrics.fontSize}get distanceFieldRange(){return R(U,"BitmapFont.distanceFieldRange is deprecated, please use BitmapFont.distanceField.range instead."),this.distanceField.range}get distanceFieldType(){return R(U,"BitmapFont.distanceFieldType is deprecated, please use BitmapFont.distanceField.type instead."),this.distanceField.type}destroy(e=!1){this.emit("destroy",this),this.removeAllListeners();for(const t in this.chars)this.chars[t].texture?.destroy();this.chars=null,e&&(this.pages.forEach(t=>t.texture.destroy(!0)),this.pages=null)}}const we=["align","breakWords","cssOverrides","fontVariant","fontWeight","leading","letterSpacing","lineHeight","padding","textBaseline","trim","whiteSpace","wordWrap","wordWrapWidth","fontFamily","fontStyle","fontSize"];function Ve(s){const e=[];let t=0;for(let r=0;r<we.length;r++){const i=`_${we[r]}`;e[t++]=s[i]}return t=je(s._fill,e,t),t=Ht(s._stroke,e,t),t=Lt(s.dropShadow,e,t),e.join("-")}function je(s,e,t){return s&&(e[t++]=s.color,e[t++]=s.alpha,e[t++]=s.fill?.styleKey),t}function Ht(s,e,t){return s&&(t=je(s,e,t),e[t++]=s.width,e[t++]=s.alignment,e[t++]=s.cap,e[t++]=s.join,e[t++]=s.miterLimit),t}function Lt(s,e,t){return s&&(e[t++]=s.alpha,e[t++]=s.angle,e[t++]=s.blur,e[t++]=s.distance,e[t++]=M.shared.setValue(s.color).toNumber()),t}const de=class $ extends We{constructor(e={}){super(),Dt(e);const t={...$.defaultTextStyle,...e};for(const r in t){const i=r;this[i]=t[r]}this.update()}get align(){return this._align}set align(e){this._align=e,this.update()}get breakWords(){return this._breakWords}set breakWords(e){this._breakWords=e,this.update()}get dropShadow(){return this._dropShadow}set dropShadow(e){e!==null&&typeof e=="object"?this._dropShadow=this._createProxy({...$.defaultDropShadow,...e}):this._dropShadow=e?this._createProxy({...$.defaultDropShadow}):null,this.update()}get fontFamily(){return this._fontFamily}set fontFamily(e){this._fontFamily=e,this.update()}get fontSize(){return this._fontSize}set fontSize(e){typeof e=="string"?this._fontSize=parseInt(e,10):this._fontSize=e,this.update()}get fontStyle(){return this._fontStyle}set fontStyle(e){this._fontStyle=e,this.update()}get fontVariant(){return this._fontVariant}set fontVariant(e){this._fontVariant=e,this.update()}get fontWeight(){return this._fontWeight}set fontWeight(e){this._fontWeight=e,this.update()}get leading(){return this._leading}set leading(e){this._leading=e,this.update()}get letterSpacing(){return this._letterSpacing}set letterSpacing(e){this._letterSpacing=e,this.update()}get lineHeight(){return this._lineHeight}set lineHeight(e){this._lineHeight=e,this.update()}get padding(){return this._padding}set padding(e){this._padding=e,this.update()}get trim(){return this._trim}set trim(e){this._trim=e,this.update()}get textBaseline(){return this._textBaseline}set textBaseline(e){this._textBaseline=e,this.update()}get whiteSpace(){return this._whiteSpace}set whiteSpace(e){this._whiteSpace=e,this.update()}get wordWrap(){return this._wordWrap}set wordWrap(e){this._wordWrap=e,this.update()}get wordWrapWidth(){return this._wordWrapWidth}set wordWrapWidth(e){this._wordWrapWidth=e,this.update()}get fill(){return this._originalFill}set fill(e){e!==this._originalFill&&(this._originalFill=e,this._isFillStyle(e)&&(this._originalFill=this._createProxy({...O.defaultFillStyle,...e},()=>{this._fill=_e({...this._originalFill},O.defaultFillStyle)})),this._fill=_e(e===0?"black":e,O.defaultFillStyle),this.update())}get stroke(){return this._originalStroke}set stroke(e){e!==this._originalStroke&&(this._originalStroke=e,this._isFillStyle(e)&&(this._originalStroke=this._createProxy({...O.defaultStrokeStyle,...e},()=>{this._stroke=be({...this._originalStroke},O.defaultStrokeStyle)})),this._stroke=be(e,O.defaultStrokeStyle),this.update())}_generateKey(){return this._styleKey=Ve(this),this._styleKey}update(){this._styleKey=null,this.emit("update",this)}reset(){const e=$.defaultTextStyle;for(const t in e)this[t]=e[t]}get styleKey(){return this._styleKey||this._generateKey()}clone(){return new $({align:this.align,breakWords:this.breakWords,dropShadow:this._dropShadow?{...this._dropShadow}:null,fill:this._fill,fontFamily:this.fontFamily,fontSize:this.fontSize,fontStyle:this.fontStyle,fontVariant:this.fontVariant,fontWeight:this.fontWeight,leading:this.leading,letterSpacing:this.letterSpacing,lineHeight:this.lineHeight,padding:this.padding,stroke:this._stroke,textBaseline:this.textBaseline,whiteSpace:this.whiteSpace,wordWrap:this.wordWrap,wordWrapWidth:this.wordWrapWidth})}destroy(e=!1){if(this.removeAllListeners(),typeof e=="boolean"?e:e?.texture){const r=typeof e=="boolean"?e:e?.textureSource;this._fill?.texture&&this._fill.texture.destroy(r),this._originalFill?.texture&&this._originalFill.texture.destroy(r),this._stroke?.texture&&this._stroke.texture.destroy(r),this._originalStroke?.texture&&this._originalStroke.texture.destroy(r)}this._fill=null,this._stroke=null,this.dropShadow=null,this._originalStroke=null,this._originalFill=null}_createProxy(e,t){return new Proxy(e,{set:(r,i,n)=>(r[i]=n,t?.(i,n),this.update(),!0)})}_isFillStyle(e){return(e??null)!==null&&!(M.isColorLike(e)||e instanceof q||e instanceof le)}};de.defaultDropShadow={alpha:1,angle:Math.PI/6,blur:0,color:"black",distance:5};de.defaultTextStyle={align:"left",breakWords:!1,dropShadow:null,fill:"black",fontFamily:"Arial",fontSize:26,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",leading:0,letterSpacing:0,lineHeight:0,padding:0,stroke:null,textBaseline:"alphabetic",trim:!1,whiteSpace:"pre",wordWrap:!1,wordWrapWidth:100};let D=de;function Dt(s){const e=s;if(typeof e.dropShadow=="boolean"&&e.dropShadow){const t=D.defaultDropShadow;s.dropShadow={alpha:e.dropShadowAlpha??t.alpha,angle:e.dropShadowAngle??t.angle,blur:e.dropShadowBlur??t.blur,color:e.dropShadowColor??t.color,distance:e.dropShadowDistance??t.distance}}if(e.strokeThickness!==void 0){R(U,"strokeThickness is now a part of stroke");const t=e.stroke;let r={};if(M.isColorLike(t))r.color=t;else if(t instanceof q||t instanceof le)r.fill=t;else if(Object.hasOwnProperty.call(t,"color")||Object.hasOwnProperty.call(t,"fill"))r=t;else throw new Error("Invalid stroke value.");s.stroke={...r,width:e.strokeThickness}}if(Array.isArray(e.fillGradientStops)){R(U,"gradient fill is now a fill pattern: `new FillGradient(...)`");let t;s.fontSize==null?s.fontSize=D.defaultTextStyle.fontSize:typeof s.fontSize=="string"?t=parseInt(s.fontSize,10):t=s.fontSize;const r=new q(0,0,0,t*1.7),i=e.fillGradientStops.map(n=>M.shared.setValue(n).toNumber());i.forEach((n,a)=>{const o=a/(i.length-1);r.addColorStop(o,n)}),s.fill={fill:r}}}const It=["serif","sans-serif","monospace","cursive","fantasy","system-ui"];function Q(s){const e=typeof s.fontSize=="number"?`${s.fontSize}px`:s.fontSize;let t=s.fontFamily;Array.isArray(s.fontFamily)||(t=s.fontFamily.split(","));for(let r=t.length-1;r>=0;r--){let i=t[r].trim();!/([\"\'])[^\'\"]+\1/.test(i)&&!It.includes(i)&&(i=`"${i}"`),t[r]=i}return`${s.fontStyle} ${s.fontVariant} ${s.fontWeight} ${e} ${t.join(",")}`}const te={willReadFrequently:!0},A=class p{static get experimentalLetterSpacingSupported(){let e=p._experimentalLetterSpacingSupported;if(e!==void 0){const t=Y.get().getCanvasRenderingContext2D().prototype;e=p._experimentalLetterSpacingSupported="letterSpacing"in t||"textLetterSpacing"in t}return e}constructor(e,t,r,i,n,a,o,l,c){this.text=e,this.style=t,this.width=r,this.height=i,this.lines=n,this.lineWidths=a,this.lineHeight=o,this.maxLineWidth=l,this.fontProperties=c}static measureText(e=" ",t,r=p._canvas,i=t.wordWrap){const n=`${e}:${t.styleKey}`;if(p._measurementCache[n])return p._measurementCache[n];const a=Q(t),o=p.measureFont(a);o.fontSize===0&&(o.fontSize=t.fontSize,o.ascent=t.fontSize);const l=p.__context;l.font=a;const h=(i?p._wordWrap(e,t,r):e).split(/(?:\r\n|\r|\n)/),d=new Array(h.length);let _=0;for(let y=0;y<h.length;y++){const b=p._measureText(h[y],t.letterSpacing,l);d[y]=b,_=Math.max(_,b)}const u=t._stroke?.width||0;let f=_+u;t.dropShadow&&(f+=t.dropShadow.distance);const m=t.lineHeight||o.fontSize;let g=Math.max(m,o.fontSize+u)+(h.length-1)*(m+t.leading);return t.dropShadow&&(g+=t.dropShadow.distance),new p(e,t,f,g,h,d,m+t.leading,_,o)}static _measureText(e,t,r){let i=!1;p.experimentalLetterSpacingSupported&&(p.experimentalLetterSpacing?(r.letterSpacing=`${t}px`,r.textLetterSpacing=`${t}px`,i=!0):(r.letterSpacing="0px",r.textLetterSpacing="0px"));let n=r.measureText(e).width;return n>0&&(i?n-=t:n+=(p.graphemeSegmenter(e).length-1)*t),n}static _wordWrap(e,t,r=p._canvas){const i=r.getContext("2d",te);let n=0,a="",o="";const l=Object.create(null),{letterSpacing:c,whiteSpace:h}=t,d=p._collapseSpaces(h),_=p._collapseNewlines(h);let u=!d;const f=t.wordWrapWidth+c,m=p._tokenize(e);for(let g=0;g<m.length;g++){let x=m[g];if(p._isNewline(x)){if(!_){o+=p._addLine(a),u=!d,a="",n=0;continue}x=" "}if(d){const b=p.isBreakingSpace(x),w=p.isBreakingSpace(a[a.length-1]);if(b&&w)continue}const y=p._getFromCache(x,c,l,i);if(y>f)if(a!==""&&(o+=p._addLine(a),a="",n=0),p.canBreakWords(x,t.breakWords)){const b=p.wordWrapSplit(x);for(let w=0;w<b.length;w++){let T=b[w],P=T,v=1;for(;b[w+v];){const C=b[w+v];if(!p.canBreakChars(P,C,x,w,t.breakWords))T+=C;else break;P=C,v++}w+=v-1;const k=p._getFromCache(T,c,l,i);k+n>f&&(o+=p._addLine(a),u=!1,a="",n=0),a+=T,n+=k}}else{a.length>0&&(o+=p._addLine(a),a="",n=0);const b=g===m.length-1;o+=p._addLine(x,!b),u=!1,a="",n=0}else y+n>f&&(u=!1,o+=p._addLine(a),a="",n=0),(a.length>0||!p.isBreakingSpace(x)||u)&&(a+=x,n+=y)}return o+=p._addLine(a,!1),o}static _addLine(e,t=!0){return e=p._trimRight(e),e=t?`${e}
`:e,e}static _getFromCache(e,t,r,i){let n=r[e];return typeof n!="number"&&(n=p._measureText(e,t,i)+t,r[e]=n),n}static _collapseSpaces(e){return e==="normal"||e==="pre-line"}static _collapseNewlines(e){return e==="normal"}static _trimRight(e){if(typeof e!="string")return"";for(let t=e.length-1;t>=0;t--){const r=e[t];if(!p.isBreakingSpace(r))break;e=e.slice(0,-1)}return e}static _isNewline(e){return typeof e!="string"?!1:p._newlines.includes(e.charCodeAt(0))}static isBreakingSpace(e,t){return typeof e!="string"?!1:p._breakingSpaces.includes(e.charCodeAt(0))}static _tokenize(e){const t=[];let r="";if(typeof e!="string")return t;for(let i=0;i<e.length;i++){const n=e[i],a=e[i+1];if(p.isBreakingSpace(n,a)||p._isNewline(n)){r!==""&&(t.push(r),r=""),t.push(n);continue}r+=n}return r!==""&&t.push(r),t}static canBreakWords(e,t){return t}static canBreakChars(e,t,r,i,n){return!0}static wordWrapSplit(e){return p.graphemeSegmenter(e)}static measureFont(e){if(p._fonts[e])return p._fonts[e];const t=p._context;t.font=e;const r=t.measureText(p.METRICS_STRING+p.BASELINE_SYMBOL),i={ascent:r.actualBoundingBoxAscent,descent:r.actualBoundingBoxDescent,fontSize:r.actualBoundingBoxAscent+r.actualBoundingBoxDescent};return p._fonts[e]=i,i}static clearMetrics(e=""){e?delete p._fonts[e]:p._fonts={}}static get _canvas(){if(!p.__canvas){let e;try{const t=new OffscreenCanvas(0,0);if(t.getContext("2d",te)?.measureText)return p.__canvas=t,t;e=Y.get().createCanvas()}catch{e=Y.get().createCanvas()}e.width=e.height=10,p.__canvas=e}return p.__canvas}static get _context(){return p.__context||(p.__context=p._canvas.getContext("2d",te)),p.__context}};A.METRICS_STRING="|\xc9q\xc5";A.BASELINE_SYMBOL="M";A.BASELINE_MULTIPLIER=1.4;A.HEIGHT_MULTIPLIER=2;A.graphemeSegmenter=(()=>{if(typeof Intl?.Segmenter=="function"){const s=new Intl.Segmenter;return e=>[...s.segment(e)].map(t=>t.segment)}return s=>[...s]})();A.experimentalLetterSpacing=!1;A._fonts={};A._newlines=[10,13];A._breakingSpaces=[9,32,8192,8193,8194,8195,8196,8197,8198,8200,8201,8202,8287,12288];A._measurementCache={};let L=A;function J(s,e){if(s.texture===G.WHITE&&!s.fill)return M.shared.setValue(s.color).toHex();if(s.fill){if(s.fill instanceof le){const t=s.fill,r=e.createPattern(t.texture.source.resource,"repeat"),i=t.transform.copyTo(H.shared);return i.scale(t.texture.frame.width,t.texture.frame.height),r.setTransform(i),r}else if(s.fill instanceof q){const t=s.fill;if(t.type==="linear"){const r=e.createLinearGradient(t.x0,t.y0,t.x1,t.y1);return t.gradientStops.forEach(i=>{r.addColorStop(i.offset,M.shared.setValue(i.color).toHex())}),r}}}else{const t=e.createPattern(s.texture.source.resource,"repeat"),r=s.matrix.copyTo(H.shared);return r.scale(s.texture.frame.width,s.texture.frame.height),t.setTransform(r),t}return K("FillStyle not recognised",s),"red"}function Xe(s){if(s==="")return[];typeof s=="string"&&(s=[s]);const e=[];for(let t=0,r=s.length;t<r;t++){const i=s[t];if(Array.isArray(i)){if(i.length!==2)throw new Error(`[BitmapFont]: Invalid character range length, expecting 2 got ${i.length}.`);if(i[0].length===0||i[1].length===0)throw new Error("[BitmapFont]: Invalid character delimiter.");const n=i[0].charCodeAt(0),a=i[1].charCodeAt(0);if(a<n)throw new Error("[BitmapFont]: Invalid character range.");for(let o=n,l=a;o<=l;o++)e.push(String.fromCharCode(o))}else e.push(...Array.from(i))}if(e.length===0)throw new Error("[BitmapFont]: Empty set when resolving characters.");return e}const Ne=class qe extends Gt{constructor(e){super(),this.resolution=1,this.pages=[],this._padding=0,this._measureCache=Object.create(null),this._currentChars=[],this._currentX=0,this._currentY=0,this._currentPageIndex=-1,this._skipKerning=!1;const t={...qe.defaultOptions,...e};this._textureSize=t.textureSize,this._mipmap=t.mipmap;const r=t.style.clone();t.overrideFill&&(r._fill.color=16777215,r._fill.alpha=1,r._fill.texture=G.WHITE,r._fill.fill=null),this.applyFillAsTint=t.overrideFill;const i=r.fontSize;r.fontSize=this.baseMeasurementFontSize;const n=Q(r);t.overrideSize?r._stroke&&(r._stroke.width*=this.baseRenderedFontSize/i):r.fontSize=this.baseRenderedFontSize=i,this._style=r,this._skipKerning=t.skipKerning??!1,this.resolution=t.resolution??1,this._padding=t.padding??4,this.fontMetrics=L.measureFont(n),this.lineHeight=r.lineHeight||this.fontMetrics.fontSize||r.fontSize}ensureCharacters(e){const t=Xe(e).filter(m=>!this._currentChars.includes(m)).filter((m,g,x)=>x.indexOf(m)===g);if(!t.length)return;this._currentChars=[...this._currentChars,...t];let r;this._currentPageIndex===-1?r=this._nextPage():r=this.pages[this._currentPageIndex];let{canvas:i,context:n}=r.canvasAndContext,a=r.texture.source;const o=this._style;let l=this._currentX,c=this._currentY;const h=this.baseRenderedFontSize/this.baseMeasurementFontSize,d=this._padding*h,_=o.fontStyle==="italic"?2:1;let u=0,f=!1;for(let m=0;m<t.length;m++){const g=t[m],x=L.measureText(g,o,i,!1);x.lineHeight=x.height;const y=_*x.width*h,b=x.height*h,w=y+d*2,T=b+d*2;if(f=!1,g!==`
`&&g!=="\r"&&g!==" "&&g!==" "&&(f=!0,u=Math.ceil(Math.max(T,u))),l+w>this._textureSize&&(c+=u,u=T,l=0,c+u>this._textureSize)){a.update();const v=this._nextPage();i=v.canvasAndContext.canvas,n=v.canvasAndContext.context,a=v.texture.source,c=0}const P=y/h-(o.dropShadow?.distance??0)-(o._stroke?.width??0);if(this.chars[g]={id:g.codePointAt(0),xOffset:-this._padding,yOffset:-this._padding,xAdvance:P,kerning:{}},f){this._drawGlyph(n,x,l+d,c+d,h,o);const v=a.width*h,k=a.height*h,C=new ae(l/v*a.width,c/k*a.height,w/v*a.width,T/k*a.height);this.chars[g].texture=new G({source:a,frame:C}),l+=Math.ceil(w)}}a.update(),this._currentX=l,this._currentY=c,this._skipKerning&&this._applyKerning(t,n)}get pageTextures(){return R(U,"BitmapFont.pageTextures is deprecated, please use BitmapFont.pages instead."),this.pages}_applyKerning(e,t){const r=this._measureCache;for(let i=0;i<e.length;i++){const n=e[i];for(let a=0;a<this._currentChars.length;a++){const o=this._currentChars[a];let l=r[n];l||(l=r[n]=t.measureText(n).width);let c=r[o];c||(c=r[o]=t.measureText(o).width);let h=t.measureText(n+o).width,d=h-(l+c);d&&(this.chars[n].kerning[o]=d),h=t.measureText(n+o).width,d=h-(l+c),d&&(this.chars[o].kerning[n]=d)}}}_nextPage(){this._currentPageIndex++;const e=this.resolution,t=I.getOptimalCanvasAndContext(this._textureSize,this._textureSize,e);this._setupContext(t.context,this._style,e);const r=e*(this.baseRenderedFontSize/this.baseMeasurementFontSize),i=new G({source:new Tt({resource:t.canvas,resolution:r,alphaMode:"premultiply-alpha-on-upload",autoGenerateMipmaps:this._mipmap})}),n={canvasAndContext:t,texture:i};return this.pages[this._currentPageIndex]=n,n}_setupContext(e,t,r){t.fontSize=this.baseRenderedFontSize,e.scale(r,r),e.font=Q(t),t.fontSize=this.baseMeasurementFontSize,e.textBaseline=t.textBaseline;const i=t._stroke,n=i?.width??0;if(i&&(e.lineWidth=n,e.lineJoin=i.join,e.miterLimit=i.miterLimit,e.strokeStyle=J(i,e)),t._fill&&(e.fillStyle=J(t._fill,e)),t.dropShadow){const a=t.dropShadow,o=M.shared.setValue(a.color).toArray(),l=a.blur*r,c=a.distance*r;e.shadowColor=`rgba(${o[0]*255},${o[1]*255},${o[2]*255},${a.alpha})`,e.shadowBlur=l,e.shadowOffsetX=Math.cos(a.angle)*c,e.shadowOffsetY=Math.sin(a.angle)*c}else e.shadowColor="black",e.shadowBlur=0,e.shadowOffsetX=0,e.shadowOffsetY=0}_drawGlyph(e,t,r,i,n,a){const o=t.text,l=t.fontProperties,h=(a._stroke?.width??0)*n,d=r+h/2,_=i-h/2,u=l.descent*n,f=t.lineHeight*n;a.stroke&&h&&e.strokeText(o,d,_+f-u),a._fill&&e.fillText(o,d,_+f-u)}destroy(){super.destroy();for(let e=0;e<this.pages.length;e++){const{canvasAndContext:t,texture:r}=this.pages[e];t.canvas.width=t.canvas.width,I.returnCanvasAndContext(t),r.destroy(!0)}this.pages=null}};Ne.defaultOptions={textureSize:512,style:new D,mipmap:!0};let ye=Ne;function Qe(s,e,t){const r={width:0,height:0,offsetY:0,scale:e.fontSize/t.baseMeasurementFontSize,lines:[{width:0,charPositions:[],spaceWidth:0,spacesIndex:[],chars:[]}]};r.offsetY=t.baseLineOffset;let i=r.lines[0],n=null,a=!0;const o={spaceWord:!1,width:0,start:0,index:0,positions:[],chars:[]},l=u=>{const f=i.width;for(let m=0;m<o.index;m++){const g=u.positions[m];i.chars.push(u.chars[m]),i.charPositions.push(g+f)}i.width+=u.width,a=!1,o.width=0,o.index=0,o.chars.length=0},c=()=>{let u=i.chars.length-1,f=i.chars[u];for(;f===" ";)i.width-=t.chars[f].xAdvance,f=i.chars[--u];r.width=Math.max(r.width,i.width),i={width:0,charPositions:[],chars:[],spaceWidth:0,spacesIndex:[]},a=!0,r.lines.push(i),r.height+=t.lineHeight},h=t.baseMeasurementFontSize/e.fontSize,d=e.letterSpacing*h,_=e.wordWrapWidth*h;for(let u=0;u<s.length+1;u++){let f;const m=u===s.length;m||(f=s[u]);const g=t.chars[f]||t.chars[" "];if(/(?:\s)/.test(f)||f==="\r"||f===`
`||m){if(!a&&e.wordWrap&&i.width+o.width-d>_?(c(),l(o),m||i.charPositions.push(0)):(o.start=i.width,l(o),m||i.charPositions.push(0)),f==="\r"||f===`
`)i.width!==0&&c();else if(!m){const w=g.xAdvance+(g.kerning[n]||0)+d;i.width+=w,i.spaceWidth=w,i.spacesIndex.push(i.charPositions.length),i.chars.push(f)}}else{const b=g.kerning[n]||0,w=g.xAdvance+b+d;o.positions[o.index++]=o.width+b,o.chars.push(f),o.width+=w}n=f}return c(),e.align==="center"?Ot(r):e.align==="right"?Et(r):e.align==="justify"&&$t(r),r}function Ot(s){for(let e=0;e<s.lines.length;e++){const t=s.lines[e],r=s.width/2-t.width/2;for(let i=0;i<t.charPositions.length;i++)t.charPositions[i]+=r}}function Et(s){for(let e=0;e<s.lines.length;e++){const t=s.lines[e],r=s.width-t.width;for(let i=0;i<t.charPositions.length;i++)t.charPositions[i]+=r}}function $t(s){const e=s.width;for(let t=0;t<s.lines.length;t++){const r=s.lines[t];let i=0,n=r.spacesIndex[i++],a=0;const o=r.spacesIndex.length,c=(e-r.width)/o;for(let h=0;h<r.charPositions.length;h++)h===n&&(n=r.spacesIndex[i++],a+=c),r.charPositions[h]+=a}}let j=0;class Kt{constructor(){this.ALPHA=[["a","z"],["A","Z"]," "],this.NUMERIC=[["0","9"]],this.ALPHANUMERIC=[["a","z"],["A","Z"],["0","9"]," "],this.ASCII=[[" ","~"]],this.defaultOptions={chars:this.ALPHANUMERIC,resolution:1,padding:4,skipKerning:!1}}getFont(e,t){let r=`${t.fontFamily}-bitmap`,i=!0;if(t._fill.fill&&!t._stroke)r+=t._fill.fill.styleKey,i=!1;else if(t._stroke||t.dropShadow){let a=t.styleKey;a=a.substring(0,a.lastIndexOf("-")),r=`${a}-bitmap`,i=!1}if(!W.has(r)){const a=new ye({style:t,overrideFill:i,overrideSize:!0,...this.defaultOptions});j++,j>50&&K("BitmapText",`You have dynamically created ${j} bitmap fonts, this can be inefficient. Try pre installing your font styles using \`BitmapFont.install({name:"style1", style})\``),a.once("destroy",()=>{j--,W.remove(r)}),W.set(r,a)}const n=W.get(r);return n.ensureCharacters?.(e),n}getLayout(e,t){const r=this.getFont(e,t);return Qe([...e],t,r)}measureText(e,t){return this.getLayout(e,t)}install(...e){let t=e[0];typeof t=="string"&&(t={name:t,style:e[1],chars:e[2]?.chars,resolution:e[2]?.resolution,padding:e[2]?.padding,skipKerning:e[2]?.skipKerning},R(U,"BitmapFontManager.install(name, style, options) is deprecated, use BitmapFontManager.install({name, style, ...options})"));const r=t?.name;if(!r)throw new Error("[BitmapFontManager] Property `name` is required.");t={...this.defaultOptions,...t};const i=t.style,n=i instanceof D?i:new D(i),a=n._fill.fill!==null&&n._fill.fill!==void 0,o=new ye({style:n,overrideFill:a,skipKerning:t.skipKerning,padding:t.padding,resolution:t.resolution,overrideSize:!1}),l=Xe(t.chars);return o.ensureCharacters(l.join("")),W.set(`${r}-bitmap`,o),o.once("destroy",()=>W.remove(`${r}-bitmap`)),o}uninstall(e){const t=`${e}-bitmap`,r=W.get(t);r&&(W.remove(t),r.destroy())}}const Yt=new Kt;class Je{constructor(e){this._renderer=e}push(e,t,r){this._renderer.renderPipes.batch.break(r),r.add({renderPipeId:"filter",canBundle:!1,action:"pushFilter",container:t,filterEffect:e})}pop(e,t,r){this._renderer.renderPipes.batch.break(r),r.add({renderPipeId:"filter",action:"popFilter",canBundle:!1})}execute(e){e.action==="pushFilter"?this._renderer.filter.push(e):e.action==="popFilter"&&this._renderer.filter.pop()}destroy(){this._renderer=null}}Je.extension={type:[S.WebGLPipes,S.WebGPUPipes,S.CanvasPipes],name:"filter"};const Vt=new H;function jt(s,e){return e.clear(),Ze(s,e),e.isValid||e.set(0,0,0,0),s.renderGroup?e.applyMatrix(s.renderGroup.localTransform):e.applyMatrix(s.parentRenderGroup.worldTransform),e}function Ze(s,e){if(s.localDisplayStatus!==7||!s.measurable)return;const t=!!s.effects.length;let r=e;if((s.renderGroup||t)&&(r=Z.get().clear()),s.boundsArea)e.addRect(s.boundsArea,s.worldTransform);else{if(s.renderPipeId){const n=s.bounds;r.addFrame(n.minX,n.minY,n.maxX,n.maxY,s.groupTransform)}const i=s.children;for(let n=0;n<i.length;n++)Ze(i[n],r)}if(t){let i=!1;for(let n=0;n<s.effects.length;n++)s.effects[n].addBounds&&(i||(i=!0,r.applyMatrix(s.parentRenderGroup.worldTransform)),s.effects[n].addBounds(r,!0));i&&(r.applyMatrix(s.parentRenderGroup.worldTransform.copyTo(Vt).invert()),e.addBounds(r,s.relativeGroupTransform)),e.addBounds(r),Z.return(r)}else s.renderGroup&&(e.addBounds(r,s.relativeGroupTransform),Z.return(r))}function Xt(s,e){e.clear();const t=e.matrix;for(let r=0;r<s.length;r++){const i=s[r];i.globalDisplayStatus<7||(e.matrix=i.worldTransform,i.addBounds(e))}return e.matrix=t,e}const Nt=new Ue({attributes:{aPosition:{buffer:new Float32Array([0,0,1,0,1,1,0,1]),location:0,format:"float32x2",stride:2*4,offset:0}},indexBuffer:new Uint32Array([0,1,2,0,2,3])});class et{constructor(e){this._filterStackIndex=0,this._filterStack=[],this._filterGlobalUniforms=new V({uInputSize:{value:new Float32Array(4),type:"vec4<f32>"},uInputPixel:{value:new Float32Array(4),type:"vec4<f32>"},uInputClamp:{value:new Float32Array(4),type:"vec4<f32>"},uOutputFrame:{value:new Float32Array(4),type:"vec4<f32>"},uGlobalFrame:{value:new Float32Array(4),type:"vec4<f32>"},uOutputTexture:{value:new Float32Array(4),type:"vec4<f32>"}}),this._globalFilterBindGroup=new Ae({}),this.renderer=e}get activeBackTexture(){return this._activeFilterData?.backTexture}push(e){const t=this.renderer,r=e.filterEffect.filters;this._filterStack[this._filterStackIndex]||(this._filterStack[this._filterStackIndex]=this._getFilterData());const i=this._filterStack[this._filterStackIndex];if(this._filterStackIndex++,r.length===0){i.skip=!0;return}const n=i.bounds;e.renderables?Xt(e.renderables,n):e.filterEffect.filterArea?(n.clear(),n.addRect(e.filterEffect.filterArea),n.applyMatrix(e.container.worldTransform)):jt(e.container,n);const a=t.renderTarget.rootRenderTarget.colorTexture.source;let o=a._resolution,l=0,c=a.antialias,h=!1,d=!1;for(let u=0;u<r.length;u++){const f=r[u];if(o=Math.min(o,f.resolution),l+=f.padding,f.antialias!=="inherit"&&(f.antialias==="on"?c=!0:c=!1),!!!(f.compatibleRenderers&t.type)){d=!1;break}if(f.blendRequired&&!(t.backBuffer?.useBackBuffer??!0)){K("Blend filter requires backBuffer on WebGL renderer to be enabled. Set `useBackBuffer: true` in the renderer options."),d=!1;break}d=f.enabled||d,h=h||f.blendRequired}if(!d){i.skip=!0;return}const _=t.renderTarget.rootViewPort;if(n.scale(o).fitBounds(0,_.width,0,_.height).scale(1/o).pad(l).ceil(),!n.isPositive){i.skip=!0;return}i.skip=!1,i.bounds=n,i.blendRequired=h,i.container=e.container,i.filterEffect=e.filterEffect,i.previousRenderSurface=t.renderTarget.renderSurface,i.inputTexture=z.getOptimalTexture(n.width,n.height,o,c),t.renderTarget.bind(i.inputTexture,!0),t.globalUniforms.push({offset:n})}pop(){const e=this.renderer;this._filterStackIndex--;const t=this._filterStack[this._filterStackIndex];if(t.skip)return;this._activeFilterData=t;const r=t.inputTexture,i=t.bounds;let n=G.EMPTY;if(e.renderTarget.finishRenderPass(),t.blendRequired){const o=this._filterStackIndex>0?this._filterStack[this._filterStackIndex-1].bounds:null,l=e.renderTarget.getRenderTarget(t.previousRenderSurface);n=this.getBackTexture(l,i,o)}t.backTexture=n;const a=t.filterEffect.filters;if(this._globalFilterBindGroup.setResource(r.source.style,2),this._globalFilterBindGroup.setResource(n.source,3),e.globalUniforms.pop(),a.length===1)a[0].apply(this,r,t.previousRenderSurface,!1),z.returnTexture(r);else{let o=t.inputTexture,l=z.getOptimalTexture(i.width,i.height,o.source._resolution,!1),c=0;for(c=0;c<a.length-1;++c){a[c].apply(this,o,l,!0);const d=o;o=l,l=d}a[c].apply(this,o,t.previousRenderSurface,!1),z.returnTexture(o),z.returnTexture(l)}t.blendRequired&&z.returnTexture(n)}getBackTexture(e,t,r){const i=e.colorTexture.source._resolution,n=z.getOptimalTexture(t.width,t.height,i,!1);let a=t.minX,o=t.minY;r&&(a-=r.minX,o-=r.minY),a=Math.floor(a*i),o=Math.floor(o*i);const l=Math.ceil(t.width*i),c=Math.ceil(t.height*i);return this.renderer.renderTarget.copyToTexture(e,n,{x:a,y:o},{width:l,height:c},{x:0,y:0}),n}applyFilter(e,t,r,i){const n=this.renderer,a=this._filterStack[this._filterStackIndex],o=a.bounds,l=vt.shared,h=a.previousRenderSurface===r;let d=this.renderer.renderTarget.rootRenderTarget.colorTexture.source._resolution,_=this._filterStackIndex-1;for(;_>0&&this._filterStack[_].skip;)--_;_>0&&(d=this._filterStack[_].inputTexture.source._resolution);const u=this._filterGlobalUniforms,f=u.uniforms,m=f.uOutputFrame,g=f.uInputSize,x=f.uInputPixel,y=f.uInputClamp,b=f.uGlobalFrame,w=f.uOutputTexture;if(h){let v=this._filterStackIndex;for(;v>0;){v--;const k=this._filterStack[this._filterStackIndex-1];if(!k.skip){l.x=k.bounds.minX,l.y=k.bounds.minY;break}}m[0]=o.minX-l.x,m[1]=o.minY-l.y}else m[0]=0,m[1]=0;m[2]=t.frame.width,m[3]=t.frame.height,g[0]=t.source.width,g[1]=t.source.height,g[2]=1/g[0],g[3]=1/g[1],x[0]=t.source.pixelWidth,x[1]=t.source.pixelHeight,x[2]=1/x[0],x[3]=1/x[1],y[0]=.5*x[2],y[1]=.5*x[3],y[2]=t.frame.width*g[2]-.5*x[2],y[3]=t.frame.height*g[3]-.5*x[3];const T=this.renderer.renderTarget.rootRenderTarget.colorTexture;b[0]=l.x*d,b[1]=l.y*d,b[2]=T.source.width*d,b[3]=T.source.height*d;const P=this.renderer.renderTarget.getRenderTarget(r);if(n.renderTarget.bind(r,!!i),r instanceof G?(w[0]=r.frame.width,w[1]=r.frame.height):(w[0]=P.width,w[1]=P.height),w[2]=P.isRoot?-1:1,u.update(),n.renderPipes.uniformBatch){const v=n.renderPipes.uniformBatch.getUboResource(u);this._globalFilterBindGroup.setResource(v,0)}else this._globalFilterBindGroup.setResource(u,0);this._globalFilterBindGroup.setResource(t.source,1),this._globalFilterBindGroup.setResource(t.source.style,2),e.groups[0]=this._globalFilterBindGroup,n.encoder.draw({geometry:Nt,shader:e,state:e._state,topology:"triangle-list"}),n.type===he.WEBGL&&n.renderTarget.finishRenderPass()}_getFilterData(){return{skip:!1,inputTexture:null,bounds:new ze,container:null,filterEffect:null,blendRequired:!1,previousRenderSurface:null}}calculateSpriteMatrix(e,t){const r=this._activeFilterData,i=e.set(r.inputTexture._source.width,0,0,r.inputTexture._source.height,r.bounds.minX,r.bounds.minY),n=t.worldTransform.copyTo(H.shared);return n.invert(),i.prepend(n),i.scale(1/t.texture.frame.width,1/t.texture.frame.height),i.translate(t.anchor.x,t.anchor.y),i}}et.extension={type:[S.WebGLSystem,S.WebGPUSystem],name:"filter"};const tt=class rt extends Ue{constructor(...e){let t=e[0]??{};t instanceof Float32Array&&(R(U,"use new MeshGeometry({ positions, uvs, indices }) instead"),t={positions:t,uvs:e[1],indices:e[2]}),t={...rt.defaultOptions,...t};const r=t.positions||new Float32Array([0,0,1,0,1,1,0,1]),i=t.uvs||new Float32Array([0,0,1,0,1,1,0,1]),n=t.indices||new Uint32Array([0,1,2,0,2,3]),a=t.shrinkBuffersToFit,o=new ee({data:r,label:"attribute-mesh-positions",shrinkToFit:a,usage:E.VERTEX|E.COPY_DST}),l=new ee({data:i,label:"attribute-mesh-uvs",shrinkToFit:a,usage:E.VERTEX|E.COPY_DST}),c=new ee({data:n,label:"index-mesh-buffer",shrinkToFit:a,usage:E.INDEX|E.COPY_DST});super({attributes:{aPosition:{buffer:o,format:"float32x2",stride:2*4,offset:0},aUV:{buffer:l,format:"float32x2",stride:2*4,offset:0}},indexBuffer:c,topology:t.topology}),this.batchMode="auto"}get positions(){return this.attributes.aPosition.buffer.data}set positions(e){this.attributes.aPosition.buffer.data=e}get uvs(){return this.attributes.aUV.buffer.data}set uvs(e){this.attributes.aUV.buffer.data=e}get indices(){return this.indexBuffer.data}set indices(e){this.indexBuffer.data=e}};tt.defaultOptions={topology:"triangle-list",shrinkBuffersToFit:!1};let ue=tt;function qt(s){const e=s._stroke,t=s._fill,i=[`div { ${[`color: ${M.shared.setValue(t.color).toHex()}`,`font-size: ${s.fontSize}px`,`font-family: ${s.fontFamily}`,`font-weight: ${s.fontWeight}`,`font-style: ${s.fontStyle}`,`font-variant: ${s.fontVariant}`,`letter-spacing: ${s.letterSpacing}px`,`text-align: ${s.align}`,`padding: ${s.padding}px`,`white-space: ${s.whiteSpace==="pre"&&s.wordWrap?"pre-wrap":s.whiteSpace}`,...s.lineHeight?[`line-height: ${s.lineHeight}px`]:[],...s.wordWrap?[`word-wrap: ${s.breakWords?"break-all":"break-word"}`,`max-width: ${s.wordWrapWidth}px`]:[],...e?[st(e)]:[],...s.dropShadow?[it(s.dropShadow)]:[],...s.cssOverrides].join(";")} }`];return Qt(s.tagStyles,i),i.join(" ")}function it(s){const e=M.shared.setValue(s.color).setAlpha(s.alpha).toHexa(),t=Math.round(Math.cos(s.angle)*s.distance),r=Math.round(Math.sin(s.angle)*s.distance),i=`${t}px ${r}px`;return s.blur>0?`text-shadow: ${i} ${s.blur}px ${e}`:`text-shadow: ${i} ${e}`}function st(s){return[`-webkit-text-stroke-width: ${s.width}px`,`-webkit-text-stroke-color: ${M.shared.setValue(s.color).toHex()}`,`text-stroke-width: ${s.width}px`,`text-stroke-color: ${M.shared.setValue(s.color).toHex()}`,"paint-order: stroke"].join(";")}const Te={fontSize:"font-size: {{VALUE}}px",fontFamily:"font-family: {{VALUE}}",fontWeight:"font-weight: {{VALUE}}",fontStyle:"font-style: {{VALUE}}",fontVariant:"font-variant: {{VALUE}}",letterSpacing:"letter-spacing: {{VALUE}}px",align:"text-align: {{VALUE}}",padding:"padding: {{VALUE}}px",whiteSpace:"white-space: {{VALUE}}",lineHeight:"line-height: {{VALUE}}px",wordWrapWidth:"max-width: {{VALUE}}px"},ve={fill:s=>`color: ${M.shared.setValue(s).toHex()}`,breakWords:s=>`word-wrap: ${s?"break-all":"break-word"}`,stroke:st,dropShadow:it};function Qt(s,e){for(const t in s){const r=s[t],i=[];for(const n in r)ve[n]?i.push(ve[n](r[n])):Te[n]&&i.push(Te[n].replace("{{VALUE}}",r[n]));e.push(`${t} { ${i.join(";")} }`)}}class fe extends D{constructor(e={}){super(e),this._cssOverrides=[],this.cssOverrides??(this.cssOverrides=e.cssOverrides),this.tagStyles=e.tagStyles??{}}set cssOverrides(e){this._cssOverrides=e instanceof Array?e:[e],this.update()}get cssOverrides(){return this._cssOverrides}_generateKey(){return this._styleKey=Ve(this)+this._cssOverrides.join("-"),this._styleKey}update(){this._cssStyle=null,super.update()}clone(){return new fe({align:this.align,breakWords:this.breakWords,dropShadow:this.dropShadow?{...this.dropShadow}:null,fill:this._fill,fontFamily:this.fontFamily,fontSize:this.fontSize,fontStyle:this.fontStyle,fontVariant:this.fontVariant,fontWeight:this.fontWeight,letterSpacing:this.letterSpacing,lineHeight:this.lineHeight,padding:this.padding,stroke:this._stroke,whiteSpace:this.whiteSpace,wordWrap:this.wordWrap,wordWrapWidth:this.wordWrapWidth,cssOverrides:this.cssOverrides})}get cssStyle(){return this._cssStyle||(this._cssStyle=qt(this)),this._cssStyle}addOverride(...e){const t=e.filter(r=>!this.cssOverrides.includes(r));t.length>0&&(this.cssOverrides.push(...t),this.update())}removeOverride(...e){const t=e.filter(r=>this.cssOverrides.includes(r));t.length>0&&(this.cssOverrides=this.cssOverrides.filter(r=>!t.includes(r)),this.update())}set fill(e){typeof e!="string"&&typeof e!="number"&&K("[HTMLTextStyle] only color fill is not supported by HTMLText"),super.fill=e}set stroke(e){e&&typeof e!="string"&&typeof e!="number"&&K("[HTMLTextStyle] only color stroke is not supported by HTMLText"),super.stroke=e}}const Ce="http://www.w3.org/2000/svg",Be="http://www.w3.org/1999/xhtml";class nt{constructor(){this.svgRoot=document.createElementNS(Ce,"svg"),this.foreignObject=document.createElementNS(Ce,"foreignObject"),this.domElement=document.createElementNS(Be,"div"),this.styleElement=document.createElementNS(Be,"style"),this.image=new Image;const{foreignObject:e,svgRoot:t,styleElement:r,domElement:i}=this;e.setAttribute("width","10000"),e.setAttribute("height","10000"),e.style.overflow="hidden",t.appendChild(e),e.appendChild(r),e.appendChild(i)}}let Fe;function Jt(s,e,t,r){r=r||Fe||(Fe=new nt);const{domElement:i,styleElement:n,svgRoot:a}=r;i.innerHTML=`<style>${e.cssStyle}</style><div>${s}</div>`,i.setAttribute("style","transform-origin: top left; display: inline-block"),t&&(n.textContent=t),document.body.appendChild(a);const o=i.getBoundingClientRect();a.remove();const l=L.measureFont(e.fontStyle).descent;return{width:o.width,height:o.height+l}}class at{constructor(e,t){this.state=He.for2d(),this._graphicsBatchesHash=Object.create(null),this.renderer=e,this._adaptor=t,this._adaptor.init()}validateRenderable(e){const t=e.context,r=!!this._graphicsBatchesHash[e.uid],i=this.renderer.graphicsContext.updateGpuContext(t);return!!(i.isBatchable||r!==i.isBatchable)}addRenderable(e,t){const r=this.renderer.graphicsContext.updateGpuContext(e.context);e._didGraphicsUpdate&&(e._didGraphicsUpdate=!1,this._rebuild(e)),r.isBatchable?this._addToBatcher(e,t):(this.renderer.renderPipes.batch.break(t),t.add(e))}updateRenderable(e){const t=this._graphicsBatchesHash[e.uid];if(t)for(let r=0;r<t.length;r++){const i=t[r];i.batcher.updateElement(i)}}destroyRenderable(e){this._graphicsBatchesHash[e.uid]&&this._removeBatchForRenderable(e.uid)}execute(e){if(!e.isRenderable)return;const t=this.renderer,r=e.context;if(!t.graphicsContext.getGpuContext(r).batches.length)return;const n=r.customShader||this._adaptor.shader;this.state.blendMode=e.groupBlendMode;const a=n.resources.localUniforms.uniforms;a.uTransformMatrix=e.groupTransform,a.uRound=t._roundPixels|e._roundPixels,ce(e.groupColorAlpha,a.uColor,0),this._adaptor.execute(this,e)}_rebuild(e){const t=!!this._graphicsBatchesHash[e.uid],r=this.renderer.graphicsContext.updateGpuContext(e.context);t&&this._removeBatchForRenderable(e.uid),r.isBatchable&&this._initBatchesForRenderable(e),e.batched=r.isBatchable}_addToBatcher(e,t){const r=this.renderer.renderPipes.batch,i=this._getBatchesForRenderable(e);for(let n=0;n<i.length;n++){const a=i[n];r.addToBatch(a,t)}}_getBatchesForRenderable(e){return this._graphicsBatchesHash[e.uid]||this._initBatchesForRenderable(e)}_initBatchesForRenderable(e){const t=e.context,r=this.renderer.graphicsContext.getGpuContext(t),i=this.renderer._roundPixels|e._roundPixels,n=r.batches.map(a=>{const o=B.get(Ct);return a.copyTo(o),o.renderable=e,o.roundPixels=i,o});return this._graphicsBatchesHash[e.uid]===void 0&&e.on("destroyed",()=>{this.destroyRenderable(e)}),this._graphicsBatchesHash[e.uid]=n,n}_removeBatchForRenderable(e){this._graphicsBatchesHash[e].forEach(t=>{B.return(t)}),this._graphicsBatchesHash[e]=null}destroy(){this.renderer=null,this._adaptor.destroy(),this._adaptor=null,this.state=null;for(const e in this._graphicsBatchesHash)this._removeBatchForRenderable(e);this._graphicsBatchesHash=null}}at.extension={type:[S.WebGLPipes,S.WebGPUPipes,S.CanvasPipes],name:"graphics"};const ot=class lt extends ue{constructor(...e){super({});let t=e[0]??{};typeof t=="number"&&(R(U,"PlaneGeometry constructor changed please use { width, height, verticesX, verticesY } instead"),t={width:t,height:e[1],verticesX:e[2],verticesY:e[3]}),this.build(t)}build(e){e={...lt.defaultOptions,...e},this.verticesX=this.verticesX??e.verticesX,this.verticesY=this.verticesY??e.verticesY,this.width=this.width??e.width,this.height=this.height??e.height;const t=this.verticesX*this.verticesY,r=[],i=[],n=[],a=this.verticesX-1,o=this.verticesY-1,l=this.width/a,c=this.height/o;for(let d=0;d<t;d++){const _=d%this.verticesX,u=d/this.verticesX|0;r.push(_*l,u*c),i.push(_/a,u/o)}const h=a*o;for(let d=0;d<h;d++){const _=d%a,u=d/a|0,f=u*this.verticesX+_,m=u*this.verticesX+_+1,g=(u+1)*this.verticesX+_,x=(u+1)*this.verticesX+_+1;n.push(f,m,g,m,x,g)}this.buffers[0].data=new Float32Array(r),this.buffers[1].data=new Float32Array(i),this.indexBuffer.data=new Uint32Array(n),this.buffers[0].update(),this.buffers[1].update(),this.indexBuffer.update()}};ot.defaultOptions={width:100,height:100,verticesX:10,verticesY:10};let Zt=ot;class pe{constructor(){this.batcher=null,this.batch=null,this.roundPixels=0,this._uvUpdateId=-1,this._textureMatrixUpdateId=-1}get blendMode(){return this.mesh.groupBlendMode}reset(){this.mesh=null,this.texture=null,this.batcher=null,this.batch=null}packIndex(e,t,r){const i=this.geometry.indices;for(let n=0;n<i.length;n++)e[t++]=i[n]+r}packAttributes(e,t,r,i){const n=this.mesh,a=this.geometry,o=n.groupTransform,l=i<<16|this.roundPixels&65535,c=o.a,h=o.b,d=o.c,_=o.d,u=o.tx,f=o.ty,m=a.positions,g=a.getBuffer("aUV"),x=g.data;let y=x;const b=this.texture.textureMatrix;b.isSimple||(y=this._transformedUvs,(this._textureMatrixUpdateId!==b._updateID||this._uvUpdateId!==g._updateID)&&((!y||y.length<x.length)&&(y=this._transformedUvs=new Float32Array(x.length)),this._textureMatrixUpdateId=b._updateID,this._uvUpdateId=g._updateID,b.multiplyUvs(x,y)));const w=n.groupColorAlpha;for(let T=0;T<m.length;T+=2){const P=m[T],v=m[T+1];e[r]=c*P+d*v+u,e[r+1]=h*P+_*v+f,e[r+2]=y[T],e[r+3]=y[T+1],t[r+4]=w,t[r+5]=l,r+=6}}get vertexSize(){return this.geometry.positions.length/2}get indexSize(){return this.geometry.indices.length}}class ht{constructor(e,t){this.localUniforms=new V({uTransformMatrix:{value:new H,type:"mat3x3<f32>"},uColor:{value:new Float32Array([1,1,1,1]),type:"vec4<f32>"},uRound:{value:0,type:"f32"}}),this.localUniformsBindGroup=new Ae({0:this.localUniforms}),this._meshDataHash=Object.create(null),this._gpuBatchableMeshHash=Object.create(null),this.renderer=e,this._adaptor=t,this._adaptor.init()}validateRenderable(e){const t=this._getMeshData(e),r=t.batched,i=e.batched;if(t.batched=i,r!==i)return!0;if(i){const n=e._geometry;if(n.indices.length!==t.indexSize||n.positions.length!==t.vertexSize)return t.indexSize=n.indices.length,t.vertexSize=n.positions.length,!0;const a=this._getBatchableMesh(e),o=e.texture;if(a.texture._source!==o._source&&a.texture._source!==o._source)return!a.batcher.checkAndUpdateTexture(a,o)}return!1}addRenderable(e,t){const r=this.renderer.renderPipes.batch,{batched:i}=this._getMeshData(e);if(i){const n=this._getBatchableMesh(e);n.texture=e._texture,n.geometry=e._geometry,r.addToBatch(n)}else r.break(t),t.add({renderPipeId:"mesh",mesh:e})}updateRenderable(e){if(e.batched){const t=this._gpuBatchableMeshHash[e.uid];t.texture=e._texture,t.geometry=e._geometry,t.batcher.updateElement(t)}}destroyRenderable(e){this._meshDataHash[e.uid]=null;const t=this._gpuBatchableMeshHash[e.uid];t&&(B.return(t),this._gpuBatchableMeshHash[e.uid]=null)}execute({mesh:e}){if(!e.isRenderable)return;e.state.blendMode=Ge(e.groupBlendMode,e.texture._source);const t=this.localUniforms;t.uniforms.uTransformMatrix=e.groupTransform,t.uniforms.uRound=this.renderer._roundPixels|e._roundPixels,t.update(),ce(e.groupColorAlpha,t.uniforms.uColor,0),this._adaptor.execute(this,e)}_getMeshData(e){return this._meshDataHash[e.uid]||this._initMeshData(e)}_initMeshData(e){return this._meshDataHash[e.uid]={batched:e.batched,indexSize:e._geometry.indices?.length,vertexSize:e._geometry.positions?.length},e.on("destroyed",()=>{this.destroyRenderable(e)}),this._meshDataHash[e.uid]}_getBatchableMesh(e){return this._gpuBatchableMeshHash[e.uid]||this._initBatchableMesh(e)}_initBatchableMesh(e){const t=B.get(pe);return t.mesh=e,t.texture=e._texture,t.roundPixels=this.renderer._roundPixels|e._roundPixels,this._gpuBatchableMeshHash[e.uid]=t,t.mesh=e,t}destroy(){for(const e in this._gpuBatchableMeshHash)this._gpuBatchableMeshHash[e]&&B.return(this._gpuBatchableMeshHash[e]);this._gpuBatchableMeshHash=null,this._meshDataHash=null,this.localUniforms=null,this.localUniformsBindGroup=null,this._adaptor.destroy(),this._adaptor=null,this.renderer=null}}ht.extension={type:[S.WebGLPipes,S.WebGPUPipes,S.CanvasPipes],name:"mesh"};const ct=class dt extends Zt{constructor(e={}){e={...dt.defaultOptions,...e},super({width:e.width,height:e.height,verticesX:4,verticesY:4}),this.update(e)}update(e){this.width=e.width??this.width,this.height=e.height??this.height,this._originalWidth=e.originalWidth??this._originalWidth,this._originalHeight=e.originalHeight??this._originalHeight,this._leftWidth=e.leftWidth??this._leftWidth,this._rightWidth=e.rightWidth??this._rightWidth,this._topHeight=e.topHeight??this._topHeight,this._bottomHeight=e.bottomHeight??this._bottomHeight,this.updateUvs(),this.updatePositions()}updatePositions(){const e=this.positions,t=this._leftWidth+this._rightWidth,r=this.width>t?1:this.width/t,i=this._topHeight+this._bottomHeight,n=this.height>i?1:this.height/i,a=Math.min(r,n);e[9]=e[11]=e[13]=e[15]=this._topHeight*a,e[17]=e[19]=e[21]=e[23]=this.height-this._bottomHeight*a,e[25]=e[27]=e[29]=e[31]=this.height,e[2]=e[10]=e[18]=e[26]=this._leftWidth*a,e[4]=e[12]=e[20]=e[28]=this.width-this._rightWidth*a,e[6]=e[14]=e[22]=e[30]=this.width,this.getBuffer("aPosition").update()}updateUvs(){const e=this.uvs;e[0]=e[8]=e[16]=e[24]=0,e[1]=e[3]=e[5]=e[7]=0,e[6]=e[14]=e[22]=e[30]=1,e[25]=e[27]=e[29]=e[31]=1;const t=1/this._originalWidth,r=1/this._originalHeight;e[2]=e[10]=e[18]=e[26]=t*this._leftWidth,e[9]=e[11]=e[13]=e[15]=r*this._topHeight,e[4]=e[12]=e[20]=e[28]=1-t*this._rightWidth,e[17]=e[19]=e[21]=e[23]=1-r*this._bottomHeight,this.getBuffer("aUV").update()}};ct.defaultOptions={width:100,height:100,leftWidth:10,topHeight:10,rightWidth:10,bottomHeight:10,originalWidth:100,originalHeight:100};let er=ct;class ut{constructor(e){this._gpuSpriteHash=Object.create(null),this._renderer=e}addRenderable(e,t){const r=this._getGpuSprite(e);e._didSpriteUpdate&&this._updateBatchableSprite(e,r),this._renderer.renderPipes.batch.addToBatch(r)}updateRenderable(e){const t=this._gpuSpriteHash[e.uid];e._didSpriteUpdate&&this._updateBatchableSprite(e,t),t.batcher.updateElement(t)}validateRenderable(e){const t=e._texture,r=this._getGpuSprite(e);return r.texture._source!==t._source?!r.batcher.checkAndUpdateTexture(r,t):!1}destroyRenderable(e){const t=this._gpuSpriteHash[e.uid];B.return(t),this._gpuSpriteHash[e.uid]=null}_updateBatchableSprite(e,t){e._didSpriteUpdate=!1,t.geometry.update(e),t.texture=e._texture}_getGpuSprite(e){return this._gpuSpriteHash[e.uid]||this._initGPUSprite(e)}_initGPUSprite(e){const t=new pe;return t.geometry=new er,t.mesh=e,t.texture=e._texture,t.roundPixels=this._renderer._roundPixels|e._roundPixels,this._gpuSpriteHash[e.uid]=t,e.on("destroyed",()=>{this.destroyRenderable(e)}),t}destroy(){for(const e in this._gpuSpriteHash)this._gpuSpriteHash[e].geometry.destroy();this._gpuSpriteHash=null,this._renderer=null}}ut.extension={type:[S.WebGLPipes,S.WebGPUPipes,S.CanvasPipes],name:"nineSliceSprite"};const tr={name:"tiling-bit",vertex:{header:`
struct TilingUniforms {
uMapCoord:mat3x3<f32>,
uClampFrame:vec4<f32>,
uClampOffset:vec2<f32>,
uTextureTransform:mat3x3<f32>,
uSizeAnchor:vec4<f32>
};
@group(2) @binding(0) var<uniform> tilingUniforms: TilingUniforms;
@group(2) @binding(1) var uTexture: texture_2d<f32>;
@group(2) @binding(2) var uSampler: sampler;
`,main:`
uv = (tilingUniforms.uTextureTransform * vec3(uv, 1.0)).xy;
position = (position - tilingUniforms.uSizeAnchor.zw) * tilingUniforms.uSizeAnchor.xy;
`},fragment:{header:`
struct TilingUniforms {
uMapCoord:mat3x3<f32>,
uClampFrame:vec4<f32>,
uClampOffset:vec2<f32>,
uTextureTransform:mat3x3<f32>,
uSizeAnchor:vec4<f32>
};
@group(2) @binding(0) var<uniform> tilingUniforms: TilingUniforms;
@group(2) @binding(1) var uTexture: texture_2d<f32>;
@group(2) @binding(2) var uSampler: sampler;
`,main:`
var coord = vUV + ceil(tilingUniforms.uClampOffset - vUV);
coord = (tilingUniforms.uMapCoord * vec3(coord, 1.0)).xy;
var unclamped = coord;
coord = clamp(coord, tilingUniforms.uClampFrame.xy, tilingUniforms.uClampFrame.zw);
var bias = 0.;
if(unclamped.x == coord.x && unclamped.y == coord.y)
{
bias = -32.;
}
outColor = textureSampleBias(uTexture, uSampler, coord, bias);
`}},rr={name:"tiling-bit",vertex:{header:`
uniform mat3 uTextureTransform;
uniform vec4 uSizeAnchor;
`,main:`
uv = (uTextureTransform * vec3(aUV, 1.0)).xy;
position = (position - uSizeAnchor.zw) * uSizeAnchor.xy;
`},fragment:{header:`
uniform sampler2D uTexture;
uniform mat3 uMapCoord;
uniform vec4 uClampFrame;
uniform vec2 uClampOffset;
`,main:`
vec2 coord = vUV + ceil(uClampOffset - vUV);
coord = (uMapCoord * vec3(coord, 1.0)).xy;
vec2 unclamped = coord;
coord = clamp(coord, uClampFrame.xy, uClampFrame.zw);
outColor = texture(uTexture, coord, unclamped == coord ? 0.0 : -32.0);// lod-bias very negative to force lod 0
`}};let re,ie;class ir extends Le{constructor(){re??(re=De({name:"tiling-sprite-shader",bits:[Mt,tr,Oe]})),ie??(ie=Ie({name:"tiling-sprite-shader",bits:[kt,rr,Ee]}));const e=new V({uMapCoord:{value:new H,type:"mat3x3<f32>"},uClampFrame:{value:new Float32Array([0,0,1,1]),type:"vec4<f32>"},uClampOffset:{value:new Float32Array([0,0]),type:"vec2<f32>"},uTextureTransform:{value:new H,type:"mat3x3<f32>"},uSizeAnchor:{value:new Float32Array([100,100,.5,.5]),type:"vec4<f32>"}});super({glProgram:ie,gpuProgram:re,resources:{localUniforms:new V({uTransformMatrix:{value:new H,type:"mat3x3<f32>"},uColor:{value:new Float32Array([1,1,1,1]),type:"vec4<f32>"},uRound:{value:0,type:"f32"}}),tilingUniforms:e,uTexture:G.EMPTY.source,uSampler:G.EMPTY.source.style}})}updateUniforms(e,t,r,i,n,a){const o=this.resources.tilingUniforms,l=a.width,c=a.height,h=a.textureMatrix,d=o.uniforms.uTextureTransform;d.set(r.a*l/e,r.b*l/t,r.c*c/e,r.d*c/t,r.tx/e,r.ty/t),d.invert(),o.uniforms.uMapCoord=h.mapCoord,o.uniforms.uClampFrame=h.uClampFrame,o.uniforms.uClampOffset=h.uClampOffset,o.uniforms.uTextureTransform=d,o.uniforms.uSizeAnchor[0]=e,o.uniforms.uSizeAnchor[1]=t,o.uniforms.uSizeAnchor[2]=i,o.uniforms.uSizeAnchor[3]=n,a&&(this.resources.uTexture=a.source,this.resources.uSampler=a.source.style)}}class sr extends ue{constructor(){super({positions:new Float32Array([0,0,1,0,1,1,0,1]),uvs:new Float32Array([0,0,1,0,1,1,0,1]),indices:new Uint32Array([0,1,2,0,2,3])})}}function nr(s,e){const t=s.anchor.x,r=s.anchor.y;e[0]=-t*s.width,e[1]=-r*s.height,e[2]=(1-t)*s.width,e[3]=-r*s.height,e[4]=(1-t)*s.width,e[5]=(1-r)*s.height,e[6]=-t*s.width,e[7]=(1-r)*s.height}function ar(s,e,t,r){let i=0;const n=s.length/e,a=r.a,o=r.b,l=r.c,c=r.d,h=r.tx,d=r.ty;for(t*=e;i<n;){const _=s[t],u=s[t+1];s[t]=a*_+l*u+h,s[t+1]=o*_+c*u+d,t+=e,i++}}function or(s,e){const t=s.texture,r=t.frame.width,i=t.frame.height;let n=0,a=0;s._applyAnchorToTexture&&(n=s.anchor.x,a=s.anchor.y),e[0]=e[6]=-n,e[2]=e[4]=1-n,e[1]=e[3]=-a,e[5]=e[7]=1-a;const o=H.shared;o.copyFrom(s._tileTransform.matrix),o.tx/=s.width,o.ty/=s.height,o.invert(),o.scale(s.width/r,s.height/i),ar(e,2,0,o)}const X=new sr;class ft{constructor(e){this._state=He.default2d,this._tilingSpriteDataHash=Object.create(null),this._renderer=e}validateRenderable(e){const t=this._getTilingSpriteData(e),r=t.canBatch;this._updateCanBatch(e);const i=t.canBatch;if(i&&i===r){const{batchableMesh:n}=t;if(n&&n.texture._source!==e.texture._source)return!n.batcher.checkAndUpdateTexture(n,e.texture)}return r!==i}addRenderable(e,t){const r=this._renderer.renderPipes.batch;this._updateCanBatch(e);const i=this._getTilingSpriteData(e),{geometry:n,canBatch:a}=i;if(a){i.batchableMesh||(i.batchableMesh=new pe);const o=i.batchableMesh;e._didTilingSpriteUpdate&&(e._didTilingSpriteUpdate=!1,this._updateBatchableMesh(e),o.geometry=n,o.mesh=e,o.texture=e._texture),o.roundPixels=this._renderer._roundPixels|e._roundPixels,r.addToBatch(o)}else r.break(t),i.shader||(i.shader=new ir),this.updateRenderable(e),t.add(e)}execute(e){const{shader:t}=this._tilingSpriteDataHash[e.uid];t.groups[0]=this._renderer.globalUniforms.bindGroup;const r=t.resources.localUniforms.uniforms;r.uTransformMatrix=e.groupTransform,r.uRound=this._renderer._roundPixels|e._roundPixels,ce(e.groupColorAlpha,r.uColor,0),this._state.blendMode=Ge(e.groupBlendMode,e.texture._source),this._renderer.encoder.draw({geometry:X,shader:t,state:this._state})}updateRenderable(e){const t=this._getTilingSpriteData(e),{canBatch:r}=t;if(r){const{batchableMesh:i}=t;e._didTilingSpriteUpdate&&this._updateBatchableMesh(e),i.batcher.updateElement(i)}else if(e._didTilingSpriteUpdate){const{shader:i}=t;i.updateUniforms(e.width,e.height,e._tileTransform.matrix,e.anchor.x,e.anchor.y,e.texture)}e._didTilingSpriteUpdate=!1}destroyRenderable(e){const t=this._getTilingSpriteData(e);t.batchableMesh=null,t.shader?.destroy(),this._tilingSpriteDataHash[e.uid]=null}_getTilingSpriteData(e){return this._tilingSpriteDataHash[e.uid]||this._initTilingSpriteData(e)}_initTilingSpriteData(e){const t=new ue({indices:X.indices,positions:X.positions.slice(),uvs:X.uvs.slice()});return this._tilingSpriteDataHash[e.uid]={canBatch:!0,renderable:e,geometry:t},e.on("destroyed",()=>{this.destroyRenderable(e)}),this._tilingSpriteDataHash[e.uid]}_updateBatchableMesh(e){const t=this._getTilingSpriteData(e),{geometry:r}=t,i=e.texture.source.style;i.addressMode!=="repeat"&&(i.addressMode="repeat",i.update()),or(e,r.uvs),nr(e,r.positions)}destroy(){for(const e in this._tilingSpriteDataHash)this.destroyRenderable(this._tilingSpriteDataHash[e].renderable);this._tilingSpriteDataHash=null,this._renderer=null}_updateCanBatch(e){const t=this._getTilingSpriteData(e),r=e.texture;let i=!0;return this._renderer.type===he.WEBGL&&(i=this._renderer.context.supports.nonPowOf2wrapping),t.canBatch=r.textureMatrix.isSimple&&(i||r.source.isPowerOfTwo),t.canBatch}}ft.extension={type:[S.WebGLPipes,S.WebGPUPipes,S.CanvasPipes],name:"tilingSprite"};const lr={name:"local-uniform-msdf-bit",vertex:{header:`
struct LocalUniforms {
uColor:vec4<f32>,
uTransformMatrix:mat3x3<f32>,
uDistance: f32,
uRound:f32,
}
@group(2) @binding(0) var<uniform> localUniforms : LocalUniforms;
`,main:`
vColor *= localUniforms.uColor;
modelMatrix *= localUniforms.uTransformMatrix;
`,end:`
if(localUniforms.uRound == 1)
{
vPosition = vec4(roundPixels(vPosition.xy, globalUniforms.uResolution), vPosition.zw);
}
`},fragment:{header:`
struct LocalUniforms {
uColor:vec4<f32>,
uTransformMatrix:mat3x3<f32>,
uDistance: f32
}
@group(2) @binding(0) var<uniform> localUniforms : LocalUniforms;
`,main:`
outColor = vec4<f32>(calculateMSDFAlpha(outColor, localUniforms.uColor, localUniforms.uDistance));
`}},hr={name:"local-uniform-msdf-bit",vertex:{header:`
uniform mat3 uTransformMatrix;
uniform vec4 uColor;
uniform float uRound;
`,main:`
vColor *= uColor;
modelMatrix *= uTransformMatrix;
`,end:`
if(uRound == 1.)
{
gl_Position.xy = roundPixels(gl_Position.xy, uResolution);
}
`},fragment:{header:`
uniform float uDistance;
`,main:`
outColor = vec4(calculateMSDFAlpha(outColor, vColor, uDistance));
`}},cr={name:"msdf-bit",fragment:{header:`
fn calculateMSDFAlpha(msdfColor:vec4<f32>, shapeColor:vec4<f32>, distance:f32) -> f32 {
// MSDF
var median = msdfColor.r + msdfColor.g + msdfColor.b -
min(msdfColor.r, min(msdfColor.g, msdfColor.b)) -
max(msdfColor.r, max(msdfColor.g, msdfColor.b));
// SDF
median = min(median, msdfColor.a);
var screenPxDistance = distance * (median - 0.5);
var alpha = clamp(screenPxDistance + 0.5, 0.0, 1.0);
if (median < 0.01) {
alpha = 0.0;
} else if (median > 0.99) {
alpha = 1.0;
}
// Gamma correction for coverage-like alpha
var luma: f32 = dot(shapeColor.rgb, vec3<f32>(0.299, 0.587, 0.114));
var gamma: f32 = mix(1.0, 1.0 / 2.2, luma);
var coverage: f32 = pow(shapeColor.a * alpha, gamma);
return coverage;
}
`}},dr={name:"msdf-bit",fragment:{header:`
float calculateMSDFAlpha(vec4 msdfColor, vec4 shapeColor, float distance) {
// MSDF
float median = msdfColor.r + msdfColor.g + msdfColor.b -
min(msdfColor.r, min(msdfColor.g, msdfColor.b)) -
max(msdfColor.r, max(msdfColor.g, msdfColor.b));
// SDF
median = min(median, msdfColor.a);
float screenPxDistance = distance * (median - 0.5);
float alpha = clamp(screenPxDistance + 0.5, 0.0, 1.0);
if (median < 0.01) {
alpha = 0.0;
} else if (median > 0.99) {
alpha = 1.0;
}
// Gamma correction for coverage-like alpha
float luma = dot(shapeColor.rgb, vec3(0.299, 0.587, 0.114));
float gamma = mix(1.0, 1.0 / 2.2, luma);
float coverage = pow(shapeColor.a * alpha, gamma);
return coverage;
}
`}};let se,ne;class ur extends Le{constructor(){const e=new V({uColor:{value:new Float32Array([1,1,1,1]),type:"vec4<f32>"},uTransformMatrix:{value:new H,type:"mat3x3<f32>"},uDistance:{value:4,type:"f32"},uRound:{value:0,type:"f32"}}),t=Bt();se??(se=De({name:"sdf-shader",bits:[Rt,Wt(t),lr,cr,Oe]})),ne??(ne=Ie({name:"sdf-shader",bits:[Ut,At(t),hr,dr,Ee]})),super({glProgram:ne,gpuProgram:se,resources:{localUniforms:e,batchSamplers:zt(t)}})}}class pt{constructor(e){this._gpuBitmapText={},this._renderer=e}validateRenderable(e){const t=this._getGpuBitmapText(e);return e._didTextUpdate&&(e._didTextUpdate=!1,this._updateContext(e,t)),this._renderer.renderPipes.graphics.validateRenderable(t)}addRenderable(e,t){const r=this._getGpuBitmapText(e);Pe(e,r),e._didTextUpdate&&(e._didTextUpdate=!1,this._updateContext(e,r)),this._renderer.renderPipes.graphics.addRenderable(r,t),r.context.customShader&&this._updateDistanceField(e)}destroyRenderable(e){this._destroyRenderableByUid(e.uid)}_destroyRenderableByUid(e){const t=this._gpuBitmapText[e].context;t.customShader&&(B.return(t.customShader),t.customShader=null),B.return(this._gpuBitmapText[e]),this._gpuBitmapText[e]=null}updateRenderable(e){const t=this._getGpuBitmapText(e);Pe(e,t),this._renderer.renderPipes.graphics.updateRenderable(t),t.context.customShader&&this._updateDistanceField(e)}_updateContext(e,t){const{context:r}=t,i=Yt.getFont(e.text,e._style);r.clear(),i.distanceField.type!=="none"&&(r.customShader||(r.customShader=B.get(ur)));const n=Array.from(e.text),a=e._style;let o=i.baseLineOffset;const l=Qe(n,a,i);let c=0;const h=a.padding,d=l.scale;r.translate(-e._anchor._x*l.width-h,-e._anchor._y*(l.height+l.offsetY)-h).scale(d,d);const _=i.applyFillAsTint?a._fill.color:16777215;for(let u=0;u<l.lines.length;u++){const f=l.lines[u];for(let m=0;m<f.charPositions.length;m++){const g=n[c++],x=i.chars[g];x?.texture&&r.texture(x.texture,_||"black",Math.round(f.charPositions[m]+x.xOffset),Math.round(o+x.yOffset))}o+=i.lineHeight}}_getGpuBitmapText(e){return this._gpuBitmapText[e.uid]||this.initGpuText(e)}initGpuText(e){const t=B.get(Ft);return this._gpuBitmapText[e.uid]=t,this._updateContext(e,t),e.on("destroyed",()=>{this.destroyRenderable(e)}),this._gpuBitmapText[e.uid]}_updateDistanceField(e){const t=this._getGpuBitmapText(e).context,r=e._style.fontFamily,i=W.get(`${r}-bitmap`),{a:n,b:a,c:o,d:l}=e.groupTransform,c=Math.sqrt(n*n+a*a),h=Math.sqrt(o*o+l*l),d=(Math.abs(c)+Math.abs(h))/2,_=i.baseRenderedFontSize/e._style.fontSize,u=d*i.distanceField.range*(1/_);t.customShader.resources.localUniforms.uniforms.uDistance=u}destroy(){for(const e in this._gpuBitmapText)this._destroyRenderableByUid(e);this._gpuBitmapText=null,this._renderer=null}}pt.extension={type:[S.WebGLPipes,S.WebGPUPipes,S.CanvasPipes],name:"bitmapText"};function Pe(s,e){e.groupTransform=s.groupTransform,e.groupColorAlpha=s.groupColorAlpha,e.groupColor=s.groupColor,e.groupBlendMode=s.groupBlendMode,e.globalDisplayStatus=s.globalDisplayStatus,e.groupTransform=s.groupTransform,e.localDisplayStatus=s.localDisplayStatus,e.groupAlpha=s.groupAlpha,e._roundPixels=s._roundPixels}class gt{constructor(e){this._gpuText=Object.create(null),this._renderer=e}validateRenderable(e){const t=this._getGpuText(e),r=e._getKey();return t.textureNeedsUploading?(t.textureNeedsUploading=!1,!0):t.currentKey!==r}addRenderable(e){const r=this._getGpuText(e).batchableSprite;e._didTextUpdate&&this._updateText(e),this._renderer.renderPipes.batch.addToBatch(r)}updateRenderable(e){const r=this._getGpuText(e).batchableSprite;e._didTextUpdate&&this._updateText(e),r.batcher.updateElement(r)}destroyRenderable(e){this._destroyRenderableById(e.uid)}_destroyRenderableById(e){const t=this._gpuText[e];this._renderer.htmlText.decreaseReferenceCount(t.currentKey),B.return(t.batchableSprite),this._gpuText[e]=null}_updateText(e){const t=e._getKey(),r=this._getGpuText(e),i=r.batchableSprite;r.currentKey!==t&&this._updateGpuText(e).catch(a=>{console.error(a)}),e._didTextUpdate=!1;const n=e._style.padding;oe(i.bounds,e._anchor,i.texture,n)}async _updateGpuText(e){e._didTextUpdate=!1;const t=this._getGpuText(e);if(t.generatingTexture)return;const r=e._getKey();this._renderer.htmlText.decreaseReferenceCount(t.currentKey),t.generatingTexture=!0,t.currentKey=r;const i=e.resolution??this._renderer.resolution,n=await this._renderer.htmlText.getManagedTexture(e.text,i,e._style,e._getKey()),a=t.batchableSprite;a.texture=t.texture=n,t.generatingTexture=!1,t.textureNeedsUploading=!0,e.onViewUpdate();const o=e._style.padding;oe(a.bounds,e._anchor,a.texture,o)}_getGpuText(e){return this._gpuText[e.uid]||this.initGpuText(e)}initGpuText(e){const t={texture:G.EMPTY,currentKey:"--",batchableSprite:B.get($e),textureNeedsUploading:!1,generatingTexture:!1},r=t.batchableSprite;return r.renderable=e,r.texture=G.EMPTY,r.bounds={minX:0,maxX:1,minY:0,maxY:0},r.roundPixels=this._renderer._roundPixels|e._roundPixels,this._gpuText[e.uid]=t,e.on("destroyed",()=>{this.destroyRenderable(e)}),t}destroy(){for(const e in this._gpuText)this._destroyRenderableById(e);this._gpuText=null,this._renderer=null}}gt.extension={type:[S.WebGLPipes,S.WebGPUPipes,S.CanvasPipes],name:"htmlText"};function fr(){const{userAgent:s}=Y.get().getNavigator();return/^((?!chrome|android).)*safari/i.test(s)}const pr=new ze;function mt(s,e,t,r){const i=pr;i.minX=0,i.minY=0,i.maxX=s.width/r|0,i.maxY=s.height/r|0;const n=z.getOptimalTexture(i.width,i.height,r,!1);return n.source.uploadMethodId="image",n.source.resource=s,n.source.alphaMode="premultiply-alpha-on-upload",n.frame.width=e/r,n.frame.height=t/r,n.source.emit("update",n.source),n.updateUvs(),n}function gr(s,e){const t=e.fontFamily,r=[],i={},n=/font-family:([^;"\s]+)/g,a=s.match(n);function o(l){i[l]||(r.push(l),i[l]=!0)}if(Array.isArray(t))for(let l=0;l<t.length;l++)o(t[l]);else o(t);a&&a.forEach(l=>{const c=l.split(":")[1].trim();o(c)});for(const l in e.tagStyles){const c=e.tagStyles[l].fontFamily;o(c)}return r}async function mr(s){const t=await (await Y.get().fetch(s)).blob(),r=new FileReader;return await new Promise((n,a)=>{r.onloadend=()=>n(r.result),r.onerror=a,r.readAsDataURL(t)})}async function Me(s,e){const t=await mr(e);return`@font-face {
font-family: "${s.fontFamily}";
src: url('${t}');
font-weight: ${s.fontWeight};
font-style: ${s.fontStyle};
}`}const N=new Map;async function xr(s,e,t){const r=s.filter(i=>W.has(`${i}-and-url`)).map((i,n)=>{if(!N.has(i)){const{url:a}=W.get(`${i}-and-url`);n===0?N.set(i,Me(e,a)):N.set(i,Me({fontWeight:t.fontWeight,fontStyle:t.fontStyle,fontFamily:i},a))}return N.get(i)});return(await Promise.all(r)).join(`
`)}function _r(s,e,t,r,i){const{domElement:n,styleElement:a,svgRoot:o}=i;n.innerHTML=`<style>${e.cssStyle}</style><div>${s}</div>`,n.setAttribute("style",`transform: scale(${t});transform-origin: top left; display: inline-block`),a.textContent=r;const{width:l,height:c}=i.image;return o.setAttribute("width",l.toString()),o.setAttribute("height",c.toString()),new XMLSerializer().serializeToString(o)}function br(s,e){const t=I.getOptimalCanvasAndContext(s.width,s.height,e),{context:r}=t;return r.clearRect(0,0,s.width,s.height),r.drawImage(s,0,0),I.returnCanvasAndContext(t),t.canvas}function Sr(s,e,t){return new Promise(async r=>{t&&await new Promise(i=>setTimeout(i,100)),s.onload=()=>{r()},s.src=`data:image/svg+xml;charset=utf8,${encodeURIComponent(e)}`,s.crossOrigin="anonymous"})}class ge{constructor(e){this._activeTextures={},this._renderer=e,this._createCanvas=e.type===he.WEBGPU}getTexture(e){return this._buildTexturePromise(e.text,e.resolution,e.style)}getManagedTexture(e,t,r,i){if(this._activeTextures[i])return this._increaseReferenceCount(i),this._activeTextures[i].promise;const n=this._buildTexturePromise(e,t,r).then(a=>(this._activeTextures[i].texture=a,a));return this._activeTextures[i]={texture:null,promise:n,usageCount:1},n}async _buildTexturePromise(e,t,r){const i=B.get(nt),n=gr(e,r),a=await xr(n,r,fe.defaultTextStyle),o=Jt(e,r,a,i),l=Math.ceil(Math.ceil(Math.max(1,o.width)+r.padding*2)*t),c=Math.ceil(Math.ceil(Math.max(1,o.height)+r.padding*2)*t),h=i.image;h.width=l|0,h.height=c|0;const d=_r(e,r,t,a,i);await Sr(h,d,fr()&&n.length>0);let _=h;this._createCanvas&&(_=br(h,t));const u=mt(_,h.width,h.height,t);return this._createCanvas&&this._renderer.texture.initSource(u.source),B.return(i),u}_increaseReferenceCount(e){this._activeTextures[e].usageCount++}decreaseReferenceCount(e){const t=this._activeTextures[e];t&&(t.usageCount--,t.usageCount===0&&(t.texture?this._cleanUp(t):t.promise.then(r=>{t.texture=r,this._cleanUp(t)}).catch(()=>{K("HTMLTextSystem: Failed to clean texture")}),this._activeTextures[e]=null))}_cleanUp(e){z.returnTexture(e.texture),e.texture.source.resource=null,e.texture.source.uploadMethodId="unknown"}getReferenceCount(e){return this._activeTextures[e].usageCount}destroy(){this._activeTextures=null}}ge.extension={type:[S.WebGLSystem,S.WebGPUSystem,S.CanvasSystem],name:"htmlText"};ge.defaultFontOptions={fontFamily:"Arial",fontStyle:"normal",fontWeight:"normal"};class xt{constructor(e){this._gpuText=Object.create(null),this._renderer=e}validateRenderable(e){const t=this._getGpuText(e),r=e._getKey();if(t.currentKey!==r){const i=e.resolution??this._renderer.resolution,{width:n,height:a}=this._renderer.canvasText.getTextureSize(e.text,i,e._style);return!(this._renderer.canvasText.getReferenceCount(t.currentKey)===1&&n===t.texture._source.width&&a===t.texture._source.height)}return!1}addRenderable(e,t){const i=this._getGpuText(e).batchableSprite;e._didTextUpdate&&this._updateText(e),this._renderer.renderPipes.batch.addToBatch(i)}updateRenderable(e){const r=this._getGpuText(e).batchableSprite;e._didTextUpdate&&this._updateText(e),r.batcher.updateElement(r)}destroyRenderable(e){this._destroyRenderableById(e.uid)}_destroyRenderableById(e){const t=this._gpuText[e];this._renderer.canvasText.decreaseReferenceCount(t.currentKey),B.return(t.batchableSprite),this._gpuText[e]=null}_updateText(e){const t=e._getKey(),r=this._getGpuText(e),i=r.batchableSprite;r.currentKey!==t&&this._updateGpuText(e),e._didTextUpdate=!1;const n=e._style.padding;oe(i.bounds,e._anchor,i.texture,n)}_updateGpuText(e){const t=this._getGpuText(e),r=t.batchableSprite;t.texture&&this._renderer.canvasText.decreaseReferenceCount(t.currentKey),t.texture=r.texture=this._renderer.canvasText.getManagedTexture(e),t.currentKey=e._getKey(),r.texture=t.texture}_getGpuText(e){return this._gpuText[e.uid]||this.initGpuText(e)}initGpuText(e){const t={texture:null,currentKey:"--",batchableSprite:B.get($e)};return t.batchableSprite.renderable=e,t.batchableSprite.bounds={minX:0,maxX:1,minY:0,maxY:0},t.batchableSprite.roundPixels=this._renderer._roundPixels|e._roundPixels,this._gpuText[e.uid]=t,this._updateText(e),e.on("destroyed",()=>{this.destroyRenderable(e)}),t}destroy(){for(const e in this._gpuText)this._destroyRenderableById(e);this._gpuText=null,this._renderer=null}}xt.extension={type:[S.WebGLPipes,S.WebGPUPipes,S.CanvasPipes],name:"text"};function ke(s,e,t){for(let r=0,i=4*t*e;r<e;++r,i+=4)if(s[i+3]!==0)return!1;return!0}function Re(s,e,t,r,i){const n=4*e;for(let a=r,o=r*n+4*t;a<=i;++a,o+=n)if(s[o+3]!==0)return!1;return!0}function wr(s,e=1){const{width:t,height:r}=s,i=s.getContext("2d",{willReadFrequently:!0});if(i===null)throw new TypeError("Failed to get canvas 2D context");const a=i.getImageData(0,0,t,r).data;let o=0,l=0,c=t-1,h=r-1;for(;l<r&&ke(a,t,l);)++l;if(l===r)return ae.EMPTY;for(;ke(a,t,h);)--h;for(;Re(a,t,o,l,h);)++o;for(;Re(a,t,c,l,h);)--c;return++c,++h,new ae(o/e,l/e,(c-o)/e,(h-l)/e)}class _t{constructor(e){this._activeTextures={},this._renderer=e}getTextureSize(e,t,r){const i=L.measureText(e||" ",r);let n=Math.ceil(Math.ceil(Math.max(1,i.width)+r.padding*2)*t),a=Math.ceil(Math.ceil(Math.max(1,i.height)+r.padding*2)*t);return n=Math.ceil(n-1e-6),a=Math.ceil(a-1e-6),n=Se(n),a=Se(a),{width:n,height:a}}getTexture(e,t,r,i){typeof e=="string"&&(R("8.0.0","CanvasTextSystem.getTexture: Use object TextOptions instead of separate arguments"),e={text:e,style:r,resolution:t}),e.style instanceof D||(e.style=new D(e.style));const{texture:n,canvasAndContext:a}=this.createTextureAndCanvas(e);return this._renderer.texture.initSource(n._source),I.returnCanvasAndContext(a),n}createTextureAndCanvas(e){const{text:t,style:r}=e,i=e.resolution??this._renderer.resolution,n=L.measureText(t||" ",r),a=Math.ceil(Math.ceil(Math.max(1,n.width)+r.padding*2)*i),o=Math.ceil(Math.ceil(Math.max(1,n.height)+r.padding*2)*i),l=I.getOptimalCanvasAndContext(a,o),{canvas:c}=l;this.renderTextToCanvas(t,r,i,l);const h=mt(c,a,o,i);if(r.trim){const d=wr(c,i);h.frame.copyFrom(d),h.updateUvs()}return{texture:h,canvasAndContext:l}}getManagedTexture(e){const t=e._getKey();if(this._activeTextures[t])return this._increaseReferenceCount(t),this._activeTextures[t].texture;const{texture:r,canvasAndContext:i}=this.createTextureAndCanvas(e);return this._activeTextures[t]={canvasAndContext:i,texture:r,usageCount:1},r}_increaseReferenceCount(e){this._activeTextures[e].usageCount++}decreaseReferenceCount(e){const t=this._activeTextures[e];if(t.usageCount--,t.usageCount===0){I.returnCanvasAndContext(t.canvasAndContext),z.returnTexture(t.texture);const r=t.texture.source;r.resource=null,r.uploadMethodId="unknown",r.alphaMode="no-premultiply-alpha",this._activeTextures[e]=null}}getReferenceCount(e){return this._activeTextures[e].usageCount}renderTextToCanvas(e,t,r,i){const{canvas:n,context:a}=i,o=Q(t),l=L.measureText(e||" ",t),c=l.lines,h=l.lineHeight,d=l.lineWidths,_=l.maxLineWidth,u=l.fontProperties,f=n.height;a.resetTransform(),a.scale(r,r);const m=t.padding*2;if(a.clearRect(0,0,l.width+4+m,l.height+4+m),t._stroke?.width){const b=t._stroke;a.lineWidth=b.width,a.miterLimit=b.miterLimit,a.lineJoin=b.join,a.lineCap=b.cap}a.font=o;let g,x;const y=t.dropShadow?2:1;for(let b=0;b<y;++b){const w=t.dropShadow&&b===0,T=w?Math.ceil(Math.max(1,f)+t.padding*2):0,P=T*r;if(w){a.fillStyle="black",a.strokeStyle="black";const C=t.dropShadow,bt=C.color,St=C.alpha;a.shadowColor=M.shared.setValue(bt).setAlpha(St).toRgbaString();const wt=C.blur*r,me=C.distance*r;a.shadowBlur=wt,a.shadowOffsetX=Math.cos(C.angle)*me,a.shadowOffsetY=Math.sin(C.angle)*me+P}else a.globalAlpha=t._fill?.alpha??1,a.fillStyle=t._fill?J(t._fill,a):null,t._stroke?.width&&(a.strokeStyle=J(t._stroke,a)),a.shadowColor="black";let v=(h-u.fontSize)/2;h-u.fontSize<0&&(v=0);const k=t._stroke?.width??0;for(let C=0;C<c.length;C++)g=k/2,x=k/2+C*h+u.ascent+v,t.align==="right"?g+=_-d[C]:t.align==="center"&&(g+=(_-d[C])/2),t._stroke?.width&&this._drawLetterSpacing(c[C],t,i,g+t.padding,x+t.padding-T,!0),t._fill!==void 0&&this._drawLetterSpacing(c[C],t,i,g+t.padding,x+t.padding-T)}}_drawLetterSpacing(e,t,r,i,n,a=!1){const{context:o}=r,l=t.letterSpacing;let c=!1;if(L.experimentalLetterSpacingSupported&&(L.experimentalLetterSpacing?(o.letterSpacing=`${l}px`,o.textLetterSpacing=`${l}px`,c=!0):(o.letterSpacing="0px",o.textLetterSpacing="0px")),l===0||c){a?o.strokeText(e,i,n):o.fillText(e,i,n);return}let h=i;const d=L.graphemeSegmenter(e);let _=o.measureText(e).width,u=0;for(let f=0;f<d.length;++f){const m=d[f];a?o.strokeText(m,h,n):o.fillText(m,h,n);let g="";for(let x=f+1;x<d.length;++x)g+=d[x];u=o.measureText(g).width,h+=_-u+l,_=u}}destroy(){this._activeTextures=null}}_t.extension={type:[S.WebGLSystem,S.WebGPUSystem,S.CanvasSystem],name:"canvasText"};F.add(Ke);F.add(Ye);F.add(at);F.add(Pt);F.add(ht);F.add(_t);F.add(xt);F.add(pt);F.add(ge);F.add(gt);F.add(ft);F.add(ut);F.add(et);F.add(Je)});export{__tla};

View File

@@ -17,10 +17,10 @@
<!-- PWA setup --> <!-- PWA setup -->
<link rel="manifest" href="manifest.webmanifest" crossorigin="use-credentials" /> <link rel="manifest" href="manifest.webmanifest" crossorigin="use-credentials" />
<script src="registerSW.js"></script> <script src="registerSW.js"></script>
<script type="module" crossorigin src="./assets/index-DF2-l4SD.js"></script> <script type="module" crossorigin src="./assets/index-C0tfT_Qc.js"></script>
<link rel="modulepreload" crossorigin href="./assets/vue-BQgCUbk_.js"> <link rel="modulepreload" crossorigin href="./assets/vue-CfSjRv-x.js">
<link rel="modulepreload" crossorigin href="./assets/vuetify-DWkLi8Ew.js"> <link rel="modulepreload" crossorigin href="./assets/vuetify-PctCzU6r.js">
<link rel="stylesheet" crossorigin href="./assets/index-HjzIuaZ3.css"> <link rel="stylesheet" crossorigin href="./assets/index-DrdRrMdo.css">
</head> </head>
<body> <body>

View File

@@ -1 +1 @@
2.9.0 2.10.2