diff --git "a/assets/index-uL9EtCRr.js" "b/assets/index-uL9EtCRr.js" deleted file mode 100644--- "a/assets/index-uL9EtCRr.js" +++ /dev/null @@ -1,3608 +0,0 @@ -var fg=Object.defineProperty;var hg=(r,e,t)=>e in r?fg(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var gc=(r,e,t)=>hg(r,typeof e!="symbol"?e+"":e,t);import{g as cu,e as Nn,f as dg,d as De,h as le,i as Ve,j as Wo,k as wd,l as qo,m as pg,w as Ge,p as $t,q as Ht,o as de,c as xe,s as Td,t as mg,v as ut,r as gg,x as lt,y as Ue,a as Fe,z as K,A as Jt,B as dt,C as Kr,D as we,b as Y,E as tt,F as It,G as Sd,I as Ed,H as fu,V as Me,S as Ni,U as hu,J as vg,T as yg,K as Ad,R as _g,P as Cd,M as Tn,L as du,N as Un,O as xg,Q as Id,W as gr,X as _t,Y as Yo,Z as Md,_ as Jr,$ as Ln,a0 as pu,a1 as kd,a2 as Pd,a3 as bg,a4 as mu,a5 as wg,a6 as hn,a7 as Ko,a8 as Tg,a9 as Ci,aa as gu,ab as Sg,ac as Cr,ad as Io,ae as Dn,af as zr,ag as vc,ah as hr,ai as Eg,aj as Ag,ak as Cg,al as Ig,am as Rd,an as Od,ao as ys,ap as Mo,aq as Ka,ar as ur,as as Fd,at as Za,au as Dr,av as yc,aw as cr,ax as Br,ay as _s,az as Mg,aA as kg,aB as Pg,aC as Rg,aD as Og,aE as Ld,aF as Nd,aG as ko,aH as Dd,aI as vu,aJ as Po,aK as Bd,aL as Zo,aM as Fg,aN as Lg,aO as _c,n as Zr,aP as Ng,aQ as Ja,aR as Ud,aS as Dg,aT as wi,aU as zd,aV as Sn,aW as Bg,aX as Ug,aY as zg,aZ as Ii,a_ as gn,a$ as jg,b0 as Vg,b1 as yu,b2 as Gg,b3 as $g,b4 as Hg,b5 as xs,b6 as Xg,b7 as jd,b8 as Wg,b9 as qg,ba as Yg,bb as Kg,bc as Zg,bd as bs,be as Jg,bf as Qg,bg as ev,bh as xc,bi as tv,bj as bc,bk as wc,bl as Tc,bm as nv,bn as rv,bo as iv,bp as Jo,bq as Qr,br as En,bs as ei,bt as ov,bu as sv,bv as av,bw as Ti,bx as jr,by as Vd,bz as zn,bA as vr,bB as Gd,bC as $d,bD as lv,bE as uv,bF as cv,bG as fv,bH as Hd,bI as en,bJ as Xd,bK as hv,bL as Wd,bM as qd,bN as jn,bO as dv,bP as pv,bQ as mv,bR as wo,bS as gv,bT as vv,bU as yv,bV as _v,bW as xv,bX as xr,bY as bv,bZ as wv,b_ as Yd}from"./index-CDOcJgli.js";import{E as Tv,a as Sv,b as Ev,c as Av,d as Cv,e as Iv,f as Kd,g as Mv,u as kv,h as Pv,i as Rv,l as Ov,j as Fv,k as Lv,_ as Zd}from"./queues-CsN4-ClH.js";import{V as Nv,a as Dv,c as Bv,b as Qa,d as Uv,e as Sc}from"./index-BPLLncXW.js";import{u as ws}from"./queue-CeT6u4ef.js";import{_ as Qo}from"./_plugin-vue_export-helper-DlAUqK2U.js";/*! - * @pixi/constants - v6.5.10 - * Compiled Thu, 06 Jul 2023 15:25:11 UTC - * - * @pixi/constants is licensed under the MIT License. - * http://www.opensource.org/licenses/mit-license - */var An;(function(r){r[r.WEBGL_LEGACY=0]="WEBGL_LEGACY",r[r.WEBGL=1]="WEBGL",r[r.WEBGL2=2]="WEBGL2"})(An||(An={}));var Mi;(function(r){r[r.UNKNOWN=0]="UNKNOWN",r[r.WEBGL=1]="WEBGL",r[r.CANVAS=2]="CANVAS"})(Mi||(Mi={}));var Ro;(function(r){r[r.COLOR=16384]="COLOR",r[r.DEPTH=256]="DEPTH",r[r.STENCIL=1024]="STENCIL"})(Ro||(Ro={}));var Ie;(function(r){r[r.NORMAL=0]="NORMAL",r[r.ADD=1]="ADD",r[r.MULTIPLY=2]="MULTIPLY",r[r.SCREEN=3]="SCREEN",r[r.OVERLAY=4]="OVERLAY",r[r.DARKEN=5]="DARKEN",r[r.LIGHTEN=6]="LIGHTEN",r[r.COLOR_DODGE=7]="COLOR_DODGE",r[r.COLOR_BURN=8]="COLOR_BURN",r[r.HARD_LIGHT=9]="HARD_LIGHT",r[r.SOFT_LIGHT=10]="SOFT_LIGHT",r[r.DIFFERENCE=11]="DIFFERENCE",r[r.EXCLUSION=12]="EXCLUSION",r[r.HUE=13]="HUE",r[r.SATURATION=14]="SATURATION",r[r.COLOR=15]="COLOR",r[r.LUMINOSITY=16]="LUMINOSITY",r[r.NORMAL_NPM=17]="NORMAL_NPM",r[r.ADD_NPM=18]="ADD_NPM",r[r.SCREEN_NPM=19]="SCREEN_NPM",r[r.NONE=20]="NONE",r[r.SRC_OVER=0]="SRC_OVER",r[r.SRC_IN=21]="SRC_IN",r[r.SRC_OUT=22]="SRC_OUT",r[r.SRC_ATOP=23]="SRC_ATOP",r[r.DST_OVER=24]="DST_OVER",r[r.DST_IN=25]="DST_IN",r[r.DST_OUT=26]="DST_OUT",r[r.DST_ATOP=27]="DST_ATOP",r[r.ERASE=26]="ERASE",r[r.SUBTRACT=28]="SUBTRACT",r[r.XOR=29]="XOR"})(Ie||(Ie={}));var ki;(function(r){r[r.POINTS=0]="POINTS",r[r.LINES=1]="LINES",r[r.LINE_LOOP=2]="LINE_LOOP",r[r.LINE_STRIP=3]="LINE_STRIP",r[r.TRIANGLES=4]="TRIANGLES",r[r.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",r[r.TRIANGLE_FAN=6]="TRIANGLE_FAN"})(ki||(ki={}));var Te;(function(r){r[r.RGBA=6408]="RGBA",r[r.RGB=6407]="RGB",r[r.RG=33319]="RG",r[r.RED=6403]="RED",r[r.RGBA_INTEGER=36249]="RGBA_INTEGER",r[r.RGB_INTEGER=36248]="RGB_INTEGER",r[r.RG_INTEGER=33320]="RG_INTEGER",r[r.RED_INTEGER=36244]="RED_INTEGER",r[r.ALPHA=6406]="ALPHA",r[r.LUMINANCE=6409]="LUMINANCE",r[r.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",r[r.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",r[r.DEPTH_STENCIL=34041]="DEPTH_STENCIL"})(Te||(Te={}));var dr;(function(r){r[r.TEXTURE_2D=3553]="TEXTURE_2D",r[r.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",r[r.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY",r[r.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",r[r.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",r[r.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",r[r.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",r[r.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",r[r.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z"})(dr||(dr={}));var $e;(function(r){r[r.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",r[r.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",r[r.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",r[r.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",r[r.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",r[r.UNSIGNED_INT=5125]="UNSIGNED_INT",r[r.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV",r[r.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV",r[r.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8",r[r.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV",r[r.BYTE=5120]="BYTE",r[r.SHORT=5122]="SHORT",r[r.INT=5124]="INT",r[r.FLOAT=5126]="FLOAT",r[r.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV",r[r.HALF_FLOAT=36193]="HALF_FLOAT"})($e||($e={}));var Oo;(function(r){r[r.FLOAT=0]="FLOAT",r[r.INT=1]="INT",r[r.UINT=2]="UINT"})(Oo||(Oo={}));var zt;(function(r){r[r.NEAREST=0]="NEAREST",r[r.LINEAR=1]="LINEAR"})(zt||(zt={}));var Fo;(function(r){r[r.CLAMP=33071]="CLAMP",r[r.REPEAT=10497]="REPEAT",r[r.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT"})(Fo||(Fo={}));var dn;(function(r){r[r.OFF=0]="OFF",r[r.POW2=1]="POW2",r[r.ON=2]="ON",r[r.ON_MANUAL=3]="ON_MANUAL"})(dn||(dn={}));var Vn;(function(r){r[r.NPM=0]="NPM",r[r.UNPACK=1]="UNPACK",r[r.PMA=2]="PMA",r[r.NO_PREMULTIPLIED_ALPHA=0]="NO_PREMULTIPLIED_ALPHA",r[r.PREMULTIPLY_ON_UPLOAD=1]="PREMULTIPLY_ON_UPLOAD",r[r.PREMULTIPLY_ALPHA=2]="PREMULTIPLY_ALPHA",r[r.PREMULTIPLIED_ALPHA=2]="PREMULTIPLIED_ALPHA"})(Vn||(Vn={}));var rn;(function(r){r[r.NO=0]="NO",r[r.YES=1]="YES",r[r.AUTO=2]="AUTO",r[r.BLEND=0]="BLEND",r[r.CLEAR=1]="CLEAR",r[r.BLIT=2]="BLIT"})(rn||(rn={}));var Lo;(function(r){r[r.AUTO=0]="AUTO",r[r.MANUAL=1]="MANUAL"})(Lo||(Lo={}));var jt;(function(r){r.LOW="lowp",r.MEDIUM="mediump",r.HIGH="highp"})(jt||(jt={}));var gt;(function(r){r[r.NONE=0]="NONE",r[r.SCISSOR=1]="SCISSOR",r[r.STENCIL=2]="STENCIL",r[r.SPRITE=3]="SPRITE",r[r.COLOR=4]="COLOR"})(gt||(gt={}));var Ec;(function(r){r[r.RED=1]="RED",r[r.GREEN=2]="GREEN",r[r.BLUE=4]="BLUE",r[r.ALPHA=8]="ALPHA"})(Ec||(Ec={}));var pt;(function(r){r[r.NONE=0]="NONE",r[r.LOW=2]="LOW",r[r.MEDIUM=4]="MEDIUM",r[r.HIGH=8]="HIGH"})(pt||(pt={}));var fn;(function(r){r[r.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",r[r.ARRAY_BUFFER=34962]="ARRAY_BUFFER",r[r.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER"})(fn||(fn={}));/*! - * @pixi/settings - v6.5.10 - * Compiled Thu, 06 Jul 2023 15:25:11 UTC - * - * @pixi/settings is licensed under the MIT License. - * http://www.opensource.org/licenses/mit-license - */var zv={createCanvas:function(r,e){var t=document.createElement("canvas");return t.width=r,t.height=e,t},getWebGLRenderingContext:function(){return WebGLRenderingContext},getNavigator:function(){return navigator},getBaseUrl:function(){var r;return(r=document.baseURI)!==null&&r!==void 0?r:window.location.href},fetch:function(r,e){return fetch(r,e)}},Ts=/iPhone/i,Ac=/iPod/i,Cc=/iPad/i,Ic=/\biOS-universal(?:.+)Mac\b/i,Ss=/\bAndroid(?:.+)Mobile\b/i,Mc=/Android/i,Ir=/(?:SD4930UR|\bSilk(?:.+)Mobile\b)/i,$i=/Silk/i,vn=/Windows Phone/i,kc=/\bWindows(?:.+)ARM\b/i,Pc=/BlackBerry/i,Rc=/BB10/i,Oc=/Opera Mini/i,Fc=/\b(CriOS|Chrome)(?:.+)Mobile/i,Lc=/Mobile(?:.+)Firefox\b/i,Nc=function(r){return typeof r<"u"&&r.platform==="MacIntel"&&typeof r.maxTouchPoints=="number"&&r.maxTouchPoints>1&&typeof MSStream>"u"};function jv(r){return function(e){return e.test(r)}}function Vv(r){var e={userAgent:"",platform:"",maxTouchPoints:0};!r&&typeof navigator<"u"?e={userAgent:navigator.userAgent,platform:navigator.platform,maxTouchPoints:navigator.maxTouchPoints||0}:typeof r=="string"?e.userAgent=r:r&&r.userAgent&&(e={userAgent:r.userAgent,platform:r.platform,maxTouchPoints:r.maxTouchPoints||0});var t=e.userAgent,n=t.split("[FBAN");typeof n[1]<"u"&&(t=n[0]),n=t.split("Twitter"),typeof n[1]<"u"&&(t=n[0]);var i=jv(t),o={apple:{phone:i(Ts)&&!i(vn),ipod:i(Ac),tablet:!i(Ts)&&(i(Cc)||Nc(e))&&!i(vn),universal:i(Ic),device:(i(Ts)||i(Ac)||i(Cc)||i(Ic)||Nc(e))&&!i(vn)},amazon:{phone:i(Ir),tablet:!i(Ir)&&i($i),device:i(Ir)||i($i)},android:{phone:!i(vn)&&i(Ir)||!i(vn)&&i(Ss),tablet:!i(vn)&&!i(Ir)&&!i(Ss)&&(i($i)||i(Mc)),device:!i(vn)&&(i(Ir)||i($i)||i(Ss)||i(Mc))||i(/\bokhttp\b/i)},windows:{phone:i(vn),tablet:i(kc),device:i(vn)||i(kc)},other:{blackberry:i(Pc),blackberry10:i(Rc),opera:i(Oc),firefox:i(Lc),chrome:i(Fc),device:i(Pc)||i(Rc)||i(Oc)||i(Lc)||i(Fc)},any:!1,phone:!1,tablet:!1};return o.any=o.apple.device||o.android.device||o.windows.device||o.other.device,o.phone=o.apple.phone||o.android.phone||o.windows.phone,o.tablet=o.apple.tablet||o.android.tablet||o.windows.tablet,o}var fr=Vv(globalThis.navigator);function Gv(){return!fr.apple.device}function $v(r){var e=!0;if(fr.tablet||fr.phone){if(fr.apple.device){var t=navigator.userAgent.match(/OS (\d+)_(\d+)?/);if(t){var n=parseInt(t[1],10);n<11&&(e=!1)}}if(fr.android.device){var t=navigator.userAgent.match(/Android\s([0-9.]*)/);if(t){var n=parseInt(t[1],10);n<7&&(e=!1)}}}return e?r:4}var Se={ADAPTER:zv,MIPMAP_TEXTURES:dn.POW2,ANISOTROPIC_LEVEL:0,RESOLUTION:1,FILTER_RESOLUTION:1,FILTER_MULTISAMPLE:pt.NONE,SPRITE_MAX_TEXTURES:$v(32),SPRITE_BATCH_SIZE:4096,RENDER_OPTIONS:{view:null,width:800,height:600,autoDensity:!1,backgroundColor:0,backgroundAlpha:1,useContextAlpha:!0,clearBeforeRender:!0,antialias:!1,preserveDrawingBuffer:!1},GC_MODE:Lo.AUTO,GC_MAX_IDLE:60*60,GC_MAX_CHECK_COUNT:60*10,WRAP_MODE:Fo.CLAMP,SCALE_MODE:zt.LINEAR,PRECISION_VERTEX:jt.HIGH,PRECISION_FRAGMENT:fr.apple.device?jt.HIGH:jt.MEDIUM,CAN_UPLOAD_SAME_BUFFER:Gv(),CREATE_IMAGE_BITMAP:!1,ROUND_PIXELS:!1},Es={exports:{}},Dc;function Hv(){return Dc||(Dc=1,function(r){var e=Object.prototype.hasOwnProperty,t="~";function n(){}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(t=!1));function i(l,u,c){this.fn=l,this.context=u,this.once=c||!1}function o(l,u,c,f,d){if(typeof c!="function")throw new TypeError("The listener must be a function");var h=new i(c,f||l,d),g=t?t+u:u;return l._events[g]?l._events[g].fn?l._events[g]=[l._events[g],h]:l._events[g].push(h):(l._events[g]=h,l._eventsCount++),l}function s(l,u){--l._eventsCount===0?l._events=new n:delete l._events[u]}function a(){this._events=new n,this._eventsCount=0}a.prototype.eventNames=function(){var u=[],c,f;if(this._eventsCount===0)return u;for(f in c=this._events)e.call(c,f)&&u.push(t?f.slice(1):f);return Object.getOwnPropertySymbols?u.concat(Object.getOwnPropertySymbols(c)):u},a.prototype.listeners=function(u){var c=t?t+u:u,f=this._events[c];if(!f)return[];if(f.fn)return[f.fn];for(var d=0,h=f.length,g=new Array(h);d80*L){P=Q=O[0],J=ce=O[1];for(var B=L;BQ&&(Q=pe),te>ce&&(ce=te);R=Math.max(Q-P,ce-J),R=R!==0?32767/R:0}return n(N,V,L,P,J,R,0),V}function e(O,D,L,$,k){var N,V;if(k===G(O,D,L,$)>0)for(N=D;N=D;N-=$)V=A(N,O[N],O[N+1],V);return V&&C(V,V.next)&&(X(V),V=V.next),V}function t(O,D){if(!O)return O;D||(D=O);var L=O,$;do if($=!1,!L.steiner&&(C(L,L.next)||_(L.prev,L,L.next)===0)){if(X(L),L=D=L.prev,L===L.next)break;$=!0}else L=L.next;while($||L!==D);return D}function n(O,D,L,$,k,N,V){if(O){!V&&N&&h(O,$,k,N);for(var P=O,J,Q;O.prev!==O.next;){if(J=O.prev,Q=O.next,N?o(O,$,k,N):i(O)){D.push(J.i/L|0),D.push(O.i/L|0),D.push(Q.i/L|0),X(O),O=Q.next,P=Q.next;continue}if(O=Q,O===P){V?V===1?(O=s(t(O),D,L),n(O,D,L,$,k,N,2)):V===2&&a(O,D,L,$,k,N):n(t(O),D,L,$,k,N,1);break}}}}function i(O){var D=O.prev,L=O,$=O.next;if(_(D,L,$)>=0)return!1;for(var k=D.x,N=L.x,V=$.x,P=D.y,J=L.y,Q=$.y,ce=kN?k>V?k:V:N>V?N:V,R=P>J?P>Q?P:Q:J>Q?J:Q,B=$.next;B!==D;){if(B.x>=ce&&B.x<=te&&B.y>=pe&&B.y<=R&&m(k,P,N,J,V,Q,B.x,B.y)&&_(B.prev,B,B.next)>=0)return!1;B=B.next}return!0}function o(O,D,L,$){var k=O.prev,N=O,V=O.next;if(_(k,N,V)>=0)return!1;for(var P=k.x,J=N.x,Q=V.x,ce=k.y,pe=N.y,te=V.y,R=PJ?P>Q?P:Q:J>Q?J:Q,oe=ce>pe?ce>te?ce:te:pe>te?pe:te,ie=v(R,B,D,L,$),E=v(W,oe,D,L,$),Z=O.prevZ,H=O.nextZ;Z&&Z.z>=ie&&H&&H.z<=E;){if(Z.x>=R&&Z.x<=W&&Z.y>=B&&Z.y<=oe&&Z!==k&&Z!==V&&m(P,ce,J,pe,Q,te,Z.x,Z.y)&&_(Z.prev,Z,Z.next)>=0||(Z=Z.prevZ,H.x>=R&&H.x<=W&&H.y>=B&&H.y<=oe&&H!==k&&H!==V&&m(P,ce,J,pe,Q,te,H.x,H.y)&&_(H.prev,H,H.next)>=0))return!1;H=H.nextZ}for(;Z&&Z.z>=ie;){if(Z.x>=R&&Z.x<=W&&Z.y>=B&&Z.y<=oe&&Z!==k&&Z!==V&&m(P,ce,J,pe,Q,te,Z.x,Z.y)&&_(Z.prev,Z,Z.next)>=0)return!1;Z=Z.prevZ}for(;H&&H.z<=E;){if(H.x>=R&&H.x<=W&&H.y>=B&&H.y<=oe&&H!==k&&H!==V&&m(P,ce,J,pe,Q,te,H.x,H.y)&&_(H.prev,H,H.next)>=0)return!1;H=H.nextZ}return!0}function s(O,D,L){var $=O;do{var k=$.prev,N=$.next.next;!C(k,N)&&b(k,$,$.next,N)&&T(k,N)&&T(N,k)&&(D.push(k.i/L|0),D.push($.i/L|0),D.push(N.i/L|0),X($),X($.next),$=O=N),$=$.next}while($!==O);return t($)}function a(O,D,L,$,k,N){var V=O;do{for(var P=V.next.next;P!==V.prev;){if(V.i!==P.i&&y(V,P)){var J=F(V,P);V=t(V,V.next),J=t(J,J.next),n(V,D,L,$,k,N,0),n(J,D,L,$,k,N,0);return}P=P.next}V=V.next}while(V!==O)}function l(O,D,L,$){var k=[],N,V,P,J,Q;for(N=0,V=D.length;N=L.next.y&&L.next.y!==L.y){var P=L.x+(k-L.y)*(L.next.x-L.x)/(L.next.y-L.y);if(P<=$&&P>N&&(N=P,V=L.x=L.x&&L.x>=Q&&$!==L.x&&m(kV.x||L.x===V.x&&d(V,L)))&&(V=L,pe=te)),L=L.next;while(L!==J);return V}function d(O,D){return _(O.prev,O,D.prev)<0&&_(D.next,O,O.next)<0}function h(O,D,L,$){var k=O;do k.z===0&&(k.z=v(k.x,k.y,D,L,$)),k.prevZ=k.prev,k.nextZ=k.next,k=k.next;while(k!==O);k.prevZ.nextZ=null,k.prevZ=null,g(k)}function g(O){var D,L,$,k,N,V,P,J,Q=1;do{for(L=O,O=null,N=null,V=0;L;){for(V++,$=L,P=0,D=0;D0||J>0&&$;)P!==0&&(J===0||!$||L.z<=$.z)?(k=L,L=L.nextZ,P--):(k=$,$=$.nextZ,J--),N?N.nextZ=k:O=k,k.prevZ=N,N=k;L=$}N.nextZ=null,Q*=2}while(V>1);return O}function v(O,D,L,$,k){return O=(O-L)*k|0,D=(D-$)*k|0,O=(O|O<<8)&16711935,O=(O|O<<4)&252645135,O=(O|O<<2)&858993459,O=(O|O<<1)&1431655765,D=(D|D<<8)&16711935,D=(D|D<<4)&252645135,D=(D|D<<2)&858993459,D=(D|D<<1)&1431655765,O|D<<1}function p(O){var D=O,L=O;do(D.x=(O-V)*(N-P)&&(O-V)*($-P)>=(L-V)*(D-P)&&(L-V)*(N-P)>=(k-V)*($-P)}function y(O,D){return O.next.i!==D.i&&O.prev.i!==D.i&&!M(O,D)&&(T(O,D)&&T(D,O)&&I(O,D)&&(_(O.prev,O,D.prev)||_(O,D.prev,D))||C(O,D)&&_(O.prev,O,O.next)>0&&_(D.prev,D,D.next)>0)}function _(O,D,L){return(D.y-O.y)*(L.x-D.x)-(D.x-O.x)*(L.y-D.y)}function C(O,D){return O.x===D.x&&O.y===D.y}function b(O,D,L,$){var k=w(_(O,D,L)),N=w(_(O,D,$)),V=w(_(L,$,O)),P=w(_(L,$,D));return!!(k!==N&&V!==P||k===0&&x(O,L,D)||N===0&&x(O,$,D)||V===0&&x(L,O,$)||P===0&&x(L,D,$))}function x(O,D,L){return D.x<=Math.max(O.x,L.x)&&D.x>=Math.min(O.x,L.x)&&D.y<=Math.max(O.y,L.y)&&D.y>=Math.min(O.y,L.y)}function w(O){return O>0?1:O<0?-1:0}function M(O,D){var L=O;do{if(L.i!==O.i&&L.next.i!==O.i&&L.i!==D.i&&L.next.i!==D.i&&b(L,L.next,O,D))return!0;L=L.next}while(L!==O);return!1}function T(O,D){return _(O.prev,O,O.next)<0?_(O,D,O.next)>=0&&_(O,O.prev,D)>=0:_(O,D,O.prev)<0||_(O,O.next,D)<0}function I(O,D){var L=O,$=!1,k=(O.x+D.x)/2,N=(O.y+D.y)/2;do L.y>N!=L.next.y>N&&L.next.y!==L.y&&k<(L.next.x-L.x)*(N-L.y)/(L.next.y-L.y)+L.x&&($=!$),L=L.next;while(L!==O);return $}function F(O,D){var L=new S(O.i,O.x,O.y),$=new S(D.i,D.x,D.y),k=O.next,N=D.prev;return O.next=D,D.prev=O,L.next=k,k.prev=L,$.next=L,L.prev=$,N.next=$,$.prev=N,$}function A(O,D,L,$){var k=new S(O,D,L);return $?(k.next=$.next,k.prev=$,$.next.prev=k,$.next=k):(k.prev=k,k.next=k),k}function X(O){O.next.prev=O.prev,O.prev.next=O.next,O.prevZ&&(O.prevZ.nextZ=O.nextZ),O.nextZ&&(O.nextZ.prevZ=O.prevZ)}function S(O,D,L){this.i=O,this.x=D,this.y=L,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}r.deviation=function(O,D,L,$){var k=D&&D.length,N=k?D[0]*L:O.length,V=Math.abs(G(O,0,N,L));if(k)for(var P=0,J=D.length;P0&&($+=O[k-1].length,L.holes.push($))}return L},Hi.exports}Wv();var qn={},gi={exports:{}};/*! https://mths.be/punycode v1.4.1 by @mathias */var qv=gi.exports,Uc;function Yv(){return Uc||(Uc=1,function(r,e){(function(t){var n=e&&!e.nodeType&&e,i=!r.nodeType&&r,o=typeof Nn=="object"&&Nn;(o.global===o||o.window===o||o.self===o)&&(t=o);var s,a=2147483647,l=36,u=1,c=26,f=38,d=700,h=72,g=128,v="-",p=/^xn--/,m=/[^\x20-\x7E]/,y=/[\x2E\u3002\uFF0E\uFF61]/g,_={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},C=l-u,b=Math.floor,x=String.fromCharCode,w;function M(k){throw new RangeError(_[k])}function T(k,N){for(var V=k.length,P=[];V--;)P[V]=N(k[V]);return P}function I(k,N){var V=k.split("@"),P="";V.length>1&&(P=V[0]+"@",k=V[1]),k=k.replace(y,".");var J=k.split("."),Q=T(J,N).join(".");return P+Q}function F(k){for(var N=[],V=0,P=k.length,J,Q;V=55296&&J<=56319&&V65535&&(N-=65536,V+=x(N>>>10&1023|55296),N=56320|N&1023),V+=x(N),V}).join("")}function X(k){return k-48<10?k-22:k-65<26?k-65:k-97<26?k-97:l}function S(k,N){return k+22+75*(k<26)-((N!=0)<<5)}function G(k,N,V){var P=0;for(k=V?b(k/d):k>>1,k+=b(k/N);k>C*c>>1;P+=l)k=b(k/C);return b(P+(C+1)*k/(k+f))}function O(k){var N=[],V=k.length,P,J=0,Q=g,ce=h,pe,te,R,B,W,oe,ie,E,Z;for(pe=k.lastIndexOf(v),pe<0&&(pe=0),te=0;te=128&&M("not-basic"),N.push(k.charCodeAt(te));for(R=pe>0?pe+1:0;R=V&&M("invalid-input"),ie=X(k.charCodeAt(R++)),(ie>=l||ie>b((a-J)/W))&&M("overflow"),J+=ie*W,E=oe<=ce?u:oe>=ce+c?c:oe-ce,!(ieb(a/Z)&&M("overflow"),W*=Z;P=N.length+1,ce=G(J-B,P,B==0),b(J/P)>a-Q&&M("overflow"),Q+=b(J/P),J%=P,N.splice(J++,0,Q)}return A(N)}function D(k){var N,V,P,J,Q,ce,pe,te,R,B,W,oe=[],ie,E,Z,H;for(k=F(k),ie=k.length,N=g,V=0,Q=h,ce=0;ce=N&&Wb((a-V)/E)&&M("overflow"),V+=(pe-N)*E,N=pe,ce=0;cea&&M("overflow"),W==N){for(te=V,R=l;B=R<=Q?u:R>=Q+c?c:R-Q,!(te"u"||!v?r:v(Uint8Array),y={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?r:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?r:ArrayBuffer,"%ArrayIteratorPrototype%":h&&v?v([][Symbol.iterator]()):r,"%AsyncFromSyncIteratorPrototype%":r,"%AsyncFunction%":p,"%AsyncGenerator%":p,"%AsyncGeneratorFunction%":p,"%AsyncIteratorPrototype%":p,"%Atomics%":typeof Atomics>"u"?r:Atomics,"%BigInt%":typeof BigInt>"u"?r:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?r:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?r:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?r:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":e,"%eval%":eval,"%EvalError%":t,"%Float32Array%":typeof Float32Array>"u"?r:Float32Array,"%Float64Array%":typeof Float64Array>"u"?r:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?r:FinalizationRegistry,"%Function%":l,"%GeneratorFunction%":p,"%Int8Array%":typeof Int8Array>"u"?r:Int8Array,"%Int16Array%":typeof Int16Array>"u"?r:Int16Array,"%Int32Array%":typeof Int32Array>"u"?r:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":h&&v?v(v([][Symbol.iterator]())):r,"%JSON%":typeof JSON=="object"?JSON:r,"%Map%":typeof Map>"u"?r:Map,"%MapIteratorPrototype%":typeof Map>"u"||!h||!v?r:v(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?r:Promise,"%Proxy%":typeof Proxy>"u"?r:Proxy,"%RangeError%":n,"%ReferenceError%":i,"%Reflect%":typeof Reflect>"u"?r:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?r:Set,"%SetIteratorPrototype%":typeof Set>"u"||!h||!v?r:v(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?r:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":h&&v?v(""[Symbol.iterator]()):r,"%Symbol%":h?Symbol:r,"%SyntaxError%":o,"%ThrowTypeError%":d,"%TypedArray%":m,"%TypeError%":s,"%Uint8Array%":typeof Uint8Array>"u"?r:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?r:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?r:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?r:Uint32Array,"%URIError%":a,"%WeakMap%":typeof WeakMap>"u"?r:WeakMap,"%WeakRef%":typeof WeakRef>"u"?r:WeakRef,"%WeakSet%":typeof WeakSet>"u"?r:WeakSet};if(v)try{null.error}catch(D){var _=v(v(D));y["%Error.prototype%"]=_}var C=function D(L){var $;if(L==="%AsyncFunction%")$=u("async function () {}");else if(L==="%GeneratorFunction%")$=u("function* () {}");else if(L==="%AsyncGeneratorFunction%")$=u("async function* () {}");else if(L==="%AsyncGenerator%"){var k=D("%AsyncGeneratorFunction%");k&&($=k.prototype)}else if(L==="%AsyncIteratorPrototype%"){var N=D("%AsyncGenerator%");N&&v&&($=v(N.prototype))}return y[L]=$,$},b={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},x=_u(),w=oy(),M=x.call(Function.call,Array.prototype.concat),T=x.call(Function.apply,Array.prototype.splice),I=x.call(Function.call,String.prototype.replace),F=x.call(Function.call,String.prototype.slice),A=x.call(Function.call,RegExp.prototype.exec),X=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,S=/\\(\\)?/g,G=function(L){var $=F(L,0,1),k=F(L,-1);if($==="%"&&k!=="%")throw new o("invalid intrinsic syntax, expected closing `%`");if(k==="%"&&$!=="%")throw new o("invalid intrinsic syntax, expected opening `%`");var N=[];return I(L,X,function(V,P,J,Q){N[N.length]=J?I(Q,S,"$1"):P||V}),N},O=function(L,$){var k=L,N;if(w(b,k)&&(N=b[k],k="%"+N[0]+"%"),w(y,k)){var V=y[k];if(V===p&&(V=C(k)),typeof V>"u"&&!$)throw new s("intrinsic "+L+" exists, but is not available. Please file an issue!");return{alias:N,name:k,value:V}}throw new o("intrinsic "+L+" does not exist!")};return Us=function(L,$){if(typeof L!="string"||L.length===0)throw new s("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof $!="boolean")throw new s('"allowMissing" argument must be a boolean');if(A(/^%?[^%]*%?$/,L)===null)throw new o("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var k=G(L),N=k.length>0?k[0]:"",V=O("%"+N+"%",$),P=V.name,J=V.value,Q=!1,ce=V.alias;ce&&(N=ce[0],T(k,M([0,1],ce)));for(var pe=1,te=!0;pe=k.length){var oe=c(J,R);te=!!oe,te&&"get"in oe&&!("originalValue"in oe.get)?J=oe.get:J=J[R]}else te=w(J,R),J=J[R];te&&!Q&&(y[P]=J)}}return J},Us}var zs={exports:{}},js,ef;function xu(){if(ef)return js;ef=1;var r=ti(),e=r("%Object.defineProperty%",!0)||!1;if(e)try{e({},"a",{value:1})}catch{e=!1}return js=e,js}var Vs,tf;function Qd(){if(tf)return Vs;tf=1;var r=ti(),e=r("%Object.getOwnPropertyDescriptor%",!0);if(e)try{e([],"length")}catch{e=null}return Vs=e,Vs}var Gs,nf;function sy(){if(nf)return Gs;nf=1;var r=xu(),e=Jd(),t=Di(),n=Qd();return Gs=function(o,s,a){if(!o||typeof o!="object"&&typeof o!="function")throw new t("`obj` must be an object or a function`");if(typeof s!="string"&&typeof s!="symbol")throw new t("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new t("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new t("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new t("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new t("`loose`, if provided, must be a boolean");var l=arguments.length>3?arguments[3]:null,u=arguments.length>4?arguments[4]:null,c=arguments.length>5?arguments[5]:null,f=arguments.length>6?arguments[6]:!1,d=!!n&&n(o,s);if(r)r(o,s,{configurable:c===null&&d?d.configurable:!c,enumerable:l===null&&d?d.enumerable:!l,value:a,writable:u===null&&d?d.writable:!u});else if(f||!l&&!u&&!c)o[s]=a;else throw new e("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},Gs}var $s,rf;function ay(){if(rf)return $s;rf=1;var r=xu(),e=function(){return!!r};return e.hasArrayLengthDefineBug=function(){if(!r)return null;try{return r([],"length",{value:1}).length!==1}catch{return!0}},$s=e,$s}var Hs,of;function ly(){if(of)return Hs;of=1;var r=ti(),e=sy(),t=ay()(),n=Qd(),i=Di(),o=r("%Math.floor%");return Hs=function(a,l){if(typeof a!="function")throw new i("`fn` is not a function");if(typeof l!="number"||l<0||l>4294967295||o(l)!==l)throw new i("`length` must be a positive 32-bit integer");var u=arguments.length>2&&!!arguments[2],c=!0,f=!0;if("length"in a&&n){var d=n(a,"length");d&&!d.configurable&&(c=!1),d&&!d.writable&&(f=!1)}return(c||f||!u)&&(t?e(a,"length",l,!0,!0):e(a,"length",l)),a},Hs}var sf;function uy(){return sf||(sf=1,function(r){var e=_u(),t=ti(),n=ly(),i=Di(),o=t("%Function.prototype.apply%"),s=t("%Function.prototype.call%"),a=t("%Reflect.apply%",!0)||e.call(s,o),l=xu(),u=t("%Math.max%");r.exports=function(d){if(typeof d!="function")throw new i("a function is required");var h=a(e,s,arguments);return n(h,1+u(0,d.length-(arguments.length-1)),!0)};var c=function(){return a(e,o,arguments)};l?l(r.exports,"apply",{value:c}):r.exports.apply=c}(zs)),zs.exports}var Xs,af;function cy(){if(af)return Xs;af=1;var r=ti(),e=uy(),t=e(r("String.prototype.indexOf"));return Xs=function(i,o){var s=r(i,!!o);return typeof s=="function"&&t(i,".prototype.")>-1?e(s):s},Xs}const fy={},hy=Object.freeze(Object.defineProperty({__proto__:null,default:fy},Symbol.toStringTag,{value:"Module"})),dy=dg(hy);var Ws,lf;function py(){if(lf)return Ws;lf=1;var r=typeof Map=="function"&&Map.prototype,e=Object.getOwnPropertyDescriptor&&r?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,t=r&&e&&typeof e.get=="function"?e.get:null,n=r&&Map.prototype.forEach,i=typeof Set=="function"&&Set.prototype,o=Object.getOwnPropertyDescriptor&&i?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,s=i&&o&&typeof o.get=="function"?o.get:null,a=i&&Set.prototype.forEach,l=typeof WeakMap=="function"&&WeakMap.prototype,u=l?WeakMap.prototype.has:null,c=typeof WeakSet=="function"&&WeakSet.prototype,f=c?WeakSet.prototype.has:null,d=typeof WeakRef=="function"&&WeakRef.prototype,h=d?WeakRef.prototype.deref:null,g=Boolean.prototype.valueOf,v=Object.prototype.toString,p=Function.prototype.toString,m=String.prototype.match,y=String.prototype.slice,_=String.prototype.replace,C=String.prototype.toUpperCase,b=String.prototype.toLowerCase,x=RegExp.prototype.test,w=Array.prototype.concat,M=Array.prototype.join,T=Array.prototype.slice,I=Math.floor,F=typeof BigInt=="function"?BigInt.prototype.valueOf:null,A=Object.getOwnPropertySymbols,X=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,S=typeof Symbol=="function"&&typeof Symbol.iterator=="object",G=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===S||!0)?Symbol.toStringTag:null,O=Object.prototype.propertyIsEnumerable,D=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(re){return re.__proto__}:null);function L(re,U){if(re===1/0||re===-1/0||re!==re||re&&re>-1e3&&re<1e3||x.call(/e/,U))return U;var ue=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof re=="number"){var _e=re<0?-I(-re):I(re);if(_e!==re){var Ee=String(_e),Ae=y.call(U,Ee.length+1);return _.call(Ee,ue,"$&_")+"."+_.call(_.call(Ae,/([0-9]{3})/g,"$&_"),/_$/,"")}}return _.call(U,ue,"$&_")}var $=dy,k=$.custom,N=ie(k)?k:null,V={__proto__:null,double:'"',single:"'"},P={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};Ws=function re(U,ue,_e,Ee){var Ae=ue||{};if(H(Ae,"quoteStyle")&&!H(V,Ae.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(H(Ae,"maxStringLength")&&(typeof Ae.maxStringLength=="number"?Ae.maxStringLength<0&&Ae.maxStringLength!==1/0:Ae.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var it=H(Ae,"customInspect")?Ae.customInspect:!0;if(typeof it!="boolean"&&it!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(H(Ae,"indent")&&Ae.indent!==null&&Ae.indent!==" "&&!(parseInt(Ae.indent,10)===Ae.indent&&Ae.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(H(Ae,"numericSeparator")&&typeof Ae.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var wt=Ae.numericSeparator;if(typeof U>"u")return"undefined";if(U===null)return"null";if(typeof U=="boolean")return U?"true":"false";if(typeof U=="string")return ne(U,Ae);if(typeof U=="number"){if(U===0)return 1/0/U>0?"0":"-0";var ht=String(U);return wt?L(U,ht):ht}if(typeof U=="bigint"){var Tt=String(U)+"n";return wt?L(U,Tt):Tt}var Nt=typeof Ae.depth>"u"?5:Ae.depth;if(typeof _e>"u"&&(_e=0),_e>=Nt&&Nt>0&&typeof U=="object")return ce(U)?"[Array]":"[Object]";var Xt=et(Ae,_e);if(typeof Ee>"u")Ee=[];else if(q(Ee,U)>=0)return"[Circular]";function St(Ar,Gi,cg){if(Gi&&(Ee=T.call(Ee),Ee.push(Gi)),cg){var mc={depth:Ae.depth};return H(Ae,"quoteStyle")&&(mc.quoteStyle=Ae.quoteStyle),re(Ar,mc,_e+1,Ee)}return re(Ar,Ae,_e+1,Ee)}if(typeof U=="function"&&!te(U)){var In=z(U),Wn=ft(U,St);return"[Function"+(In?": "+In:" (anonymous)")+"]"+(Wn.length>0?" { "+M.call(Wn,", ")+" }":"")}if(ie(U)){var cc=S?_.call(String(U),/^(Symbol\(.*\))_[^)]*$/,"$1"):X.call(U);return typeof U=="object"&&!S?ge(cc):cc}if(me(U)){for(var oi="<"+b.call(String(U.nodeName)),hs=U.attributes||[],Vi=0;Vi",oi}if(ce(U)){if(U.length===0)return"[]";var ds=ft(U,St);return Xt&&!Xe(ds)?"["+Le(ds,Xt)+"]":"[ "+M.call(ds,", ")+" ]"}if(R(U)){var ps=ft(U,St);return!("cause"in Error.prototype)&&"cause"in U&&!O.call(U,"cause")?"{ ["+String(U)+"] "+M.call(w.call("[cause]: "+St(U.cause),ps),", ")+" }":ps.length===0?"["+String(U)+"]":"{ ["+String(U)+"] "+M.call(ps,", ")+" }"}if(typeof U=="object"&&it){if(N&&typeof U[N]=="function"&&$)return $(U,{depth:Nt-_e});if(it!=="symbol"&&typeof U.inspect=="function")return U.inspect()}if(se(U)){var fc=[];return n&&n.call(U,function(Ar,Gi){fc.push(St(Gi,U,!0)+" => "+St(Ar,U))}),Pe("Map",t.call(U),fc,Xt)}if(he(U)){var hc=[];return a&&a.call(U,function(Ar){hc.push(St(Ar,U))}),Pe("Set",s.call(U),hc,Xt)}if(ae(U))return be("WeakMap");if(ye(U))return be("WeakSet");if(ee(U))return be("WeakRef");if(W(U))return ge(St(Number(U)));if(E(U))return ge(St(F.call(U)));if(oe(U))return ge(g.call(U));if(B(U))return ge(St(String(U)));if(typeof window<"u"&&U===window)return"{ [object Window] }";if(typeof globalThis<"u"&&U===globalThis||typeof Nn<"u"&&U===Nn)return"{ [object globalThis] }";if(!pe(U)&&!te(U)){var ms=ft(U,St),dc=D?D(U)===Object.prototype:U instanceof Object||U.constructor===Object,gs=U instanceof Object?"":"null prototype",pc=!dc&&G&&Object(U)===U&&G in U?y.call(j(U),8,-1):gs?"Object":"",ug=dc||typeof U.constructor!="function"?"":U.constructor.name?U.constructor.name+" ":"",vs=ug+(pc||gs?"["+M.call(w.call([],pc||[],gs||[]),": ")+"] ":"");return ms.length===0?vs+"{}":Xt?vs+"{"+Le(ms,Xt)+"}":vs+"{ "+M.call(ms,", ")+" }"}return String(U)};function J(re,U,ue){var _e=ue.quoteStyle||U,Ee=V[_e];return Ee+re+Ee}function Q(re){return _.call(String(re),/"/g,""")}function ce(re){return j(re)==="[object Array]"&&(!G||!(typeof re=="object"&&G in re))}function pe(re){return j(re)==="[object Date]"&&(!G||!(typeof re=="object"&&G in re))}function te(re){return j(re)==="[object RegExp]"&&(!G||!(typeof re=="object"&&G in re))}function R(re){return j(re)==="[object Error]"&&(!G||!(typeof re=="object"&&G in re))}function B(re){return j(re)==="[object String]"&&(!G||!(typeof re=="object"&&G in re))}function W(re){return j(re)==="[object Number]"&&(!G||!(typeof re=="object"&&G in re))}function oe(re){return j(re)==="[object Boolean]"&&(!G||!(typeof re=="object"&&G in re))}function ie(re){if(S)return re&&typeof re=="object"&&re instanceof Symbol;if(typeof re=="symbol")return!0;if(!re||typeof re!="object"||!X)return!1;try{return X.call(re),!0}catch{}return!1}function E(re){if(!re||typeof re!="object"||!F)return!1;try{return F.call(re),!0}catch{}return!1}var Z=Object.prototype.hasOwnProperty||function(re){return re in this};function H(re,U){return Z.call(re,U)}function j(re){return v.call(re)}function z(re){if(re.name)return re.name;var U=m.call(p.call(re),/^function\s*([\w$]+)/);return U?U[1]:null}function q(re,U){if(re.indexOf)return re.indexOf(U);for(var ue=0,_e=re.length;ue<_e;ue++)if(re[ue]===U)return ue;return-1}function se(re){if(!t||!re||typeof re!="object")return!1;try{t.call(re);try{s.call(re)}catch{return!0}return re instanceof Map}catch{}return!1}function ae(re){if(!u||!re||typeof re!="object")return!1;try{u.call(re,u);try{f.call(re,f)}catch{return!0}return re instanceof WeakMap}catch{}return!1}function ee(re){if(!h||!re||typeof re!="object")return!1;try{return h.call(re),!0}catch{}return!1}function he(re){if(!s||!re||typeof re!="object")return!1;try{s.call(re);try{t.call(re)}catch{return!0}return re instanceof Set}catch{}return!1}function ye(re){if(!f||!re||typeof re!="object")return!1;try{f.call(re,f);try{u.call(re,u)}catch{return!0}return re instanceof WeakSet}catch{}return!1}function me(re){return!re||typeof re!="object"?!1:typeof HTMLElement<"u"&&re instanceof HTMLElement?!0:typeof re.nodeName=="string"&&typeof re.getAttribute=="function"}function ne(re,U){if(re.length>U.maxStringLength){var ue=re.length-U.maxStringLength,_e="... "+ue+" more character"+(ue>1?"s":"");return ne(y.call(re,0,U.maxStringLength),U)+_e}var Ee=P[U.quoteStyle||"single"];Ee.lastIndex=0;var Ae=_.call(_.call(re,Ee,"\\$1"),/[\x00-\x1f]/g,fe);return J(Ae,"single",U)}function fe(re){var U=re.charCodeAt(0),ue={8:"b",9:"t",10:"n",12:"f",13:"r"}[U];return ue?"\\"+ue:"\\x"+(U<16?"0":"")+C.call(U.toString(16))}function ge(re){return"Object("+re+")"}function be(re){return re+" { ? }"}function Pe(re,U,ue,_e){var Ee=_e?Le(ue,_e):M.call(ue,", ");return re+" ("+U+") {"+Ee+"}"}function Xe(re){for(var U=0;U=0)return!1;return!0}function et(re,U){var ue;if(re.indent===" ")ue=" ";else if(typeof re.indent=="number"&&re.indent>0)ue=M.call(Array(re.indent+1)," ");else return null;return{base:ue,prev:M.call(Array(U+1),ue)}}function Le(re,U){if(re.length===0)return"";var ue=` -`+U.prev+U.base;return ue+M.call(re,","+ue)+` -`+U.prev}function ft(re,U){var ue=ce(re),_e=[];if(ue){_e.length=re.length;for(var Ee=0;Ee1;){var y=m.pop(),_=y.obj[y.prop];if(t(_)){for(var C=[],b=0;b<_.length;++b)typeof _[b]<"u"&&C.push(_[b]);y.obj[y.prop]=C}}},o=function(m,y){for(var _=y&&y.plainObjects?{__proto__:null}:{},C=0;C=u?x.slice(M,M+u):x,I=[],F=0;F=48&&A<=57||A>=65&&A<=90||A>=97&&A<=122||b===r.RFC1738&&(A===40||A===41)){I[I.length]=T.charAt(F);continue}if(A<128){I[I.length]=n[A];continue}if(A<2048){I[I.length]=n[192|A>>6]+n[128|A&63];continue}if(A<55296||A>=57344){I[I.length]=n[224|A>>12]+n[128|A>>6&63]+n[128|A&63];continue}F+=1,A=65536+((A&1023)<<10|T.charCodeAt(F)&1023),I[I.length]=n[240|A>>18]+n[128|A>>12&63]+n[128|A>>6&63]+n[128|A&63]}w+=I.join("")}return w},f=function(m){for(var y=[{obj:{o:m},prop:"o"}],_=[],C=0;C"u"&&(k=0)}if(typeof T=="function"?L=T(m,L):L instanceof Date?L=A(L):y==="comma"&&o(L)&&(L=e.maybeMap(L,function(Z){return Z instanceof Date?A(Z):Z})),L===null){if(b)return M&&!G?M(m,c.encoder,O,"key",X):m;L=""}if(f(L)||e.isBuffer(L)){if(M){var P=G?m:M(m,c.encoder,O,"key",X);return[S(P)+"="+S(M(L,c.encoder,O,"value",X))]}return[S(m)+"="+S(String(L))]}var J=[];if(typeof L>"u")return J;var Q;if(y==="comma"&&o(L))G&&M&&(L=e.maybeMap(L,M)),Q=[{value:L.length>0?L.join(",")||null:void 0}];else if(o(T))Q=T;else{var ce=Object.keys(L);Q=I?ce.sort(I):ce}var pe=w?String(m).replace(/\./g,"%2E"):String(m),te=_&&o(L)&&L.length===1?pe+"[]":pe;if(C&&o(L)&&L.length===0)return te+"[]";for(var R=0;R"u"?p.encodeDotInKeys===!0?!0:c.allowDots:!!p.allowDots;return{addQueryPrefix:typeof p.addQueryPrefix=="boolean"?p.addQueryPrefix:c.addQueryPrefix,allowDots:x,allowEmptyArrays:typeof p.allowEmptyArrays=="boolean"?!!p.allowEmptyArrays:c.allowEmptyArrays,arrayFormat:b,charset:m,charsetSentinel:typeof p.charsetSentinel=="boolean"?p.charsetSentinel:c.charsetSentinel,commaRoundTrip:!!p.commaRoundTrip,delimiter:typeof p.delimiter>"u"?c.delimiter:p.delimiter,encode:typeof p.encode=="boolean"?p.encode:c.encode,encodeDotInKeys:typeof p.encodeDotInKeys=="boolean"?p.encodeDotInKeys:c.encodeDotInKeys,encoder:typeof p.encoder=="function"?p.encoder:c.encoder,encodeValuesOnly:typeof p.encodeValuesOnly=="boolean"?p.encodeValuesOnly:c.encodeValuesOnly,filter:C,format:y,formatter:_,serializeDate:typeof p.serializeDate=="function"?p.serializeDate:c.serializeDate,skipNulls:typeof p.skipNulls=="boolean"?p.skipNulls:c.skipNulls,sort:typeof p.sort=="function"?p.sort:null,strictNullHandling:typeof p.strictNullHandling=="boolean"?p.strictNullHandling:c.strictNullHandling}};return Zs=function(v,p){var m=v,y=g(p),_,C;typeof y.filter=="function"?(C=y.filter,m=C("",m)):o(y.filter)&&(C=y.filter,_=C);var b=[];if(typeof m!="object"||m===null)return"";var x=i[y.arrayFormat],w=x==="comma"&&y.commaRoundTrip;_||(_=Object.keys(m)),y.sort&&_.sort(y.sort);for(var M=r(),T=0;T<_.length;++T){var I=_[T],F=m[I];y.skipNulls&&F===null||a(b,h(F,I,x,w,y.allowEmptyArrays,y.strictNullHandling,y.skipNulls,y.encodeDotInKeys,y.encode?y.encoder:null,y.filter,y.sort,y.allowDots,y.serializeDate,y.format,y.formatter,y.encodeValuesOnly,y.charset,M))}var A=b.join(y.delimiter),X=y.addQueryPrefix===!0?"?":"";return y.charsetSentinel&&(y.charset==="iso-8859-1"?X+="utf8=%26%2310003%3B&":X+="utf8=%E2%9C%93&"),A.length>0?X+A:""},Zs}var Js,df;function vy(){if(df)return Js;df=1;var r=ep(),e=Object.prototype.hasOwnProperty,t=Array.isArray,n={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:r.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictNullHandling:!1},i=function(d){return d.replace(/&#(\d+);/g,function(h,g){return String.fromCharCode(parseInt(g,10))})},o=function(d,h){return d&&typeof d=="string"&&h.comma&&d.indexOf(",")>-1?d.split(","):d},s="utf8=%26%2310003%3B",a="utf8=%E2%9C%93",l=function(h,g){var v={__proto__:null},p=g.ignoreQueryPrefix?h.replace(/^\?/,""):h;p=p.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var m=g.parameterLimit===1/0?void 0:g.parameterLimit,y=p.split(g.delimiter,m),_=-1,C,b=g.charset;if(g.charsetSentinel)for(C=0;C-1&&(I=t(I)?[I]:I);var F=e.call(v,T);F&&g.duplicates==="combine"?v[T]=r.combine(v[T],I):(!F||g.duplicates==="last")&&(v[T]=I)}return v},u=function(d,h,g,v){for(var p=v?h:o(h,g),m=d.length-1;m>=0;--m){var y,_=d[m];if(_==="[]"&&g.parseArrays)y=g.allowEmptyArrays&&(p===""||g.strictNullHandling&&p===null)?[]:[].concat(p);else{y=g.plainObjects?{__proto__:null}:{};var C=_.charAt(0)==="["&&_.charAt(_.length-1)==="]"?_.slice(1,-1):_,b=g.decodeDotInKeys?C.replace(/%2E/g,"."):C,x=parseInt(b,10);!g.parseArrays&&b===""?y={0:p}:!isNaN(x)&&_!==b&&String(x)===b&&x>=0&&g.parseArrays&&x<=g.arrayLimit?(y=[],y[x]=p):b!=="__proto__"&&(y[b]=p)}p=y}return p},c=function(h,g,v,p){if(h){var m=v.allowDots?h.replace(/\.([^.[]+)/g,"[$1]"):h,y=/(\[[^[\]]*])/,_=/(\[[^[\]]*])/g,C=v.depth>0&&y.exec(m),b=C?m.slice(0,C.index):m,x=[];if(b){if(!v.plainObjects&&e.call(Object.prototype,b)&&!v.allowPrototypes)return;x.push(b)}for(var w=0;v.depth>0&&(C=_.exec(m))!==null&&w"u"?n.charset:h.charset,v=typeof h.duplicates>"u"?n.duplicates:h.duplicates;if(v!=="combine"&&v!=="first"&&v!=="last")throw new TypeError("The duplicates option must be either combine, first, or last");var p=typeof h.allowDots>"u"?h.decodeDotInKeys===!0?!0:n.allowDots:!!h.allowDots;return{allowDots:p,allowEmptyArrays:typeof h.allowEmptyArrays=="boolean"?!!h.allowEmptyArrays:n.allowEmptyArrays,allowPrototypes:typeof h.allowPrototypes=="boolean"?h.allowPrototypes:n.allowPrototypes,allowSparse:typeof h.allowSparse=="boolean"?h.allowSparse:n.allowSparse,arrayLimit:typeof h.arrayLimit=="number"?h.arrayLimit:n.arrayLimit,charset:g,charsetSentinel:typeof h.charsetSentinel=="boolean"?h.charsetSentinel:n.charsetSentinel,comma:typeof h.comma=="boolean"?h.comma:n.comma,decodeDotInKeys:typeof h.decodeDotInKeys=="boolean"?h.decodeDotInKeys:n.decodeDotInKeys,decoder:typeof h.decoder=="function"?h.decoder:n.decoder,delimiter:typeof h.delimiter=="string"||r.isRegExp(h.delimiter)?h.delimiter:n.delimiter,depth:typeof h.depth=="number"||h.depth===!1?+h.depth:n.depth,duplicates:v,ignoreQueryPrefix:h.ignoreQueryPrefix===!0,interpretNumericEntities:typeof h.interpretNumericEntities=="boolean"?h.interpretNumericEntities:n.interpretNumericEntities,parameterLimit:typeof h.parameterLimit=="number"?h.parameterLimit:n.parameterLimit,parseArrays:h.parseArrays!==!1,plainObjects:typeof h.plainObjects=="boolean"?h.plainObjects:n.plainObjects,strictDepth:typeof h.strictDepth=="boolean"?!!h.strictDepth:n.strictDepth,strictNullHandling:typeof h.strictNullHandling=="boolean"?h.strictNullHandling:n.strictNullHandling}};return Js=function(d,h){var g=f(h);if(d===""||d===null||typeof d>"u")return g.plainObjects?{__proto__:null}:{};for(var v=typeof d=="string"?l(d,g):d,p=g.plainObjects?{__proto__:null}:{},m=Object.keys(v),y=0;y",'"',"`"," ","\r",` -`," "],s=["{","}","|","\\","^","`"].concat(o),a=["'"].concat(s),l=["%","/","?",";","#"].concat(a),u=["/","?","#"],c=255,f=/^[+a-z0-9A-Z_-]{0,63}$/,d=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,h={javascript:!0,"javascript:":!0},g={javascript:!0,"javascript:":!0},v={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},p=yy();function m(b,x,w){if(b&&typeof b=="object"&&b instanceof e)return b;var M=new e;return M.parse(b,x,w),M}e.prototype.parse=function(b,x,w){if(typeof b!="string")throw new TypeError("Parameter 'url' must be a string, not "+typeof b);var M=b.indexOf("?"),T=M!==-1&&M127?ce+="x":ce+=Q[pe];if(!ce.match(f)){var R=P.slice(0,L),B=P.slice(L+1),W=Q.match(d);W&&(R.push(W[1]),B.unshift(W[2])),B.length&&(A="/"+B.join(".")+A),this.hostname=R.join(".");break}}}this.hostname.length>c?this.hostname="":this.hostname=this.hostname.toLowerCase(),V||(this.hostname=r.toASCII(this.hostname));var oe=this.port?":"+this.port:"",ie=this.hostname||"";this.host=ie+oe,this.href+=this.host,V&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),A[0]!=="/"&&(A="/"+A))}if(!h[G])for(var L=0,J=a.length;L0?w.host.split("@"):!1;ce&&(w.auth=ce.shift(),w.hostname=ce.shift(),w.host=w.hostname)}return w.search=b.search,w.query=b.query,(w.pathname!==null||w.search!==null)&&(w.path=(w.pathname?w.pathname:"")+(w.search?w.search:"")),w.href=w.format(),w}if(!P.length)return w.pathname=null,w.search?w.path="/"+w.search:w.path=null,w.href=w.format(),w;for(var pe=P.slice(-1)[0],te=(w.host||b.host||P.length>1)&&(pe==="."||pe==="..")||pe==="",R=0,B=P.length;B>=0;B--)pe=P[B],pe==="."?P.splice(B,1):pe===".."?(P.splice(B,1),R++):R&&(P.splice(B,1),R--);if(!N&&!V)for(;R--;R)P.unshift("..");N&&P[0]!==""&&(!P[0]||P[0].charAt(0)!=="/")&&P.unshift(""),te&&P.join("/").substr(-1)!=="/"&&P.push("");var W=P[0]===""||P[0]&&P[0].charAt(0)==="/";if(Q){w.hostname=W?"":P.length?P.shift():"",w.host=w.hostname;var ce=w.host&&w.host.indexOf("@")>0?w.host.split("@"):!1;ce&&(w.auth=ce.shift(),w.hostname=ce.shift(),w.host=w.hostname)}return N=N||w.host&&P.length,N&&!W&&P.unshift(""),P.length>0?w.pathname=P.join("/"):(w.pathname=null,w.path=null),(w.pathname!==null||w.search!==null)&&(w.path=(w.pathname?w.pathname:"")+(w.search?w.search:"")),w.auth=b.auth||w.auth,w.slashes=w.slashes||b.slashes,w.href=w.format(),w},e.prototype.parseHost=function(){var b=this.host,x=n.exec(b);x&&(x=x[0],x!==":"&&(this.port=x.substr(1)),b=b.substr(0,b.length-x.length)),b&&(this.hostname=b)},qn.parse=m,qn.resolve=_,qn.resolveObject=C,qn.format=y,qn.Url=e,qn}var ea=_y();/*! - * @pixi/utils - v6.5.10 - * Compiled Thu, 06 Jul 2023 15:25:11 UTC - * - * @pixi/utils is licensed under the MIT License. - * http://www.opensource.org/licenses/mit-license - */var es={parse:ea.parse,format:ea.format,resolve:ea.resolve};Se.RETINA_PREFIX=/@([0-9\.]+)x/;Se.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT=!1;var gf=!1,vf="6.5.10";function xy(r){var e;if(!gf){if(Se.ADAPTER.getNavigator().userAgent.toLowerCase().indexOf("chrome")>-1){var t=[` - %c %c %c PixiJS `+vf+" - ✰ "+r+` ✰ %c %c http://www.pixijs.com/ %c %c ♥%c♥%c♥ - -`,"background: #ff66a5; padding:5px 0;","background: #ff66a5; padding:5px 0;","color: #ff66a5; background: #030307; padding:5px 0;","background: #ff66a5; padding:5px 0;","background: #ffc3dc; padding:5px 0;","background: #ff66a5; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;"];(e=globalThis.console).log.apply(e,t)}else globalThis.console&&globalThis.console.log("PixiJS "+vf+" - "+r+" - http://www.pixijs.com/");gf=!0}}var ta;function by(){return typeof ta>"u"&&(ta=function(){var e={stencil:!0,failIfMajorPerformanceCaveat:Se.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT};try{if(!Se.ADAPTER.getWebGLRenderingContext())return!1;var t=Se.ADAPTER.createCanvas(),n=t.getContext("webgl",e)||t.getContext("experimental-webgl",e),i=!!(n&&n.getContextAttributes().stencil);if(n){var o=n.getExtension("WEBGL_lose_context");o&&o.loseContext()}return n=null,i}catch{return!1}}()),ta}function tn(r,e){return e===void 0&&(e=[]),e[0]=(r>>16&255)/255,e[1]=(r>>8&255)/255,e[2]=(r&255)/255,e}function wy(r){var e=r.toString(16);return e="000000".substring(0,6-e.length)+e,"#"+e}function on(r){return(r[0]*255<<16)+(r[1]*255<<8)+(r[2]*255|0)}function Ty(){for(var r=[],e=[],t=0;t<32;t++)r[t]=t,e[t]=t;r[Ie.NORMAL_NPM]=Ie.NORMAL,r[Ie.ADD_NPM]=Ie.ADD,r[Ie.SCREEN_NPM]=Ie.SCREEN,e[Ie.NORMAL]=Ie.NORMAL_NPM,e[Ie.ADD]=Ie.ADD_NPM,e[Ie.SCREEN]=Ie.SCREEN_NPM;var n=[];return n.push(e),n.push(r),n}var Sy=Ty();function Ey(r,e){if(e===1)return(e*255<<24)+r;if(e===0)return 0;var t=r>>16&255,n=r>>8&255,i=r&255;return t=t*e+.5|0,n=n*e+.5|0,i=i*e+.5|0,(e*255<<24)+(t<<16)+(n<<8)+i}function tp(r){if(r.BYTES_PER_ELEMENT===4)return r instanceof Float32Array?"Float32Array":r instanceof Uint32Array?"Uint32Array":"Int32Array";if(r.BYTES_PER_ELEMENT===2){if(r instanceof Uint16Array)return"Uint16Array"}else if(r.BYTES_PER_ELEMENT===1&&r instanceof Uint8Array)return"Uint8Array";return null}function No(r){return r+=r===0?1:0,--r,r|=r>>>1,r|=r>>>2,r|=r>>>4,r|=r>>>8,r|=r>>>16,r+1}function yf(r){return!(r&r-1)&&!!r}function _f(r){var e=(r>65535?1:0)<<4;r>>>=e;var t=(r>255?1:0)<<3;return r>>>=t,e|=t,t=(r>15?1:0)<<2,r>>>=t,e|=t,t=(r>3?1:0)<<1,r>>>=t,e|=t,e|r>>1}function To(r,e,t){var n=r.length,i;if(!(e>=n||t===0)){t=e+t>n?n-e:t;var o=n-t;for(i=e;i"u"?console.warn("PixiJS Deprecation Warning: ",e+` -Deprecated since v`+r):(n=n.split(` -`).splice(t).join(` -`),console.groupCollapsed?(console.groupCollapsed("%cPixiJS Deprecation Warning: %c%s","color:#614108;background:#fffbe6","font-weight:normal;color:#614108;background:#fffbe6",e+` -Deprecated since v`+r),console.warn(n),console.groupEnd()):(console.warn("PixiJS Deprecation Warning: ",e+` -Deprecated since v`+r),console.warn(n))),xf[e]=!0}}var bf={},xn=Object.create(null),Yn=Object.create(null);(function(){function r(e,t,n){this.canvas=Se.ADAPTER.createCanvas(),this.context=this.canvas.getContext("2d"),this.resolution=n||Se.RESOLUTION,this.resize(e,t)}return r.prototype.clear=function(){this.context.setTransform(1,0,0,1,0,0),this.context.clearRect(0,0,this.canvas.width,this.canvas.height)},r.prototype.resize=function(e,t){this.canvas.width=Math.round(e*this.resolution),this.canvas.height=Math.round(t*this.resolution)},r.prototype.destroy=function(){this.context=null,this.canvas=null},Object.defineProperty(r.prototype,"width",{get:function(){return this.canvas.width},set:function(e){this.canvas.width=Math.round(e)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"height",{get:function(){return this.canvas.height},set:function(e){this.canvas.height=Math.round(e)},enumerable:!1,configurable:!0}),r})();var Xi;function Cy(r,e){if(e===void 0&&(e=globalThis.location),r.indexOf("data:")===0)return"";e=e||globalThis.location,Xi||(Xi=document.createElement("a")),Xi.href=r;var t=es.parse(Xi.href),n=!t.port&&e.port===""||t.port===e.port;return t.hostname!==e.hostname||!n||t.protocol!==e.protocol?"anonymous":""}function wf(r,e){var t=Se.RETINA_PREFIX.exec(r);return t?parseFloat(t[1]):e!==void 0?e:1}/*! - * @pixi/extensions - v6.5.10 - * Compiled Thu, 06 Jul 2023 15:25:11 UTC - * - * @pixi/extensions is licensed under the MIT License. - * http://www.opensource.org/licenses/mit-license - *//*! ***************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */var Si=function(){return Si=Object.assign||function(e){for(var t=arguments,n,i=1,o=arguments.length;i8)throw new Error("max arguments reached");var u=this,c=u.name,f=u.items;this._aliasCount++;for(var d=0,h=f.length;d0&&this.items.length>1&&(this._aliasCount=0,this.items=this.items.slice(0))},r.prototype.add=function(e){return e[this._name]&&(this.ensureNonAliasedItems(),this.remove(e),this.items.push(e)),this},r.prototype.remove=function(e){var t=this.items.indexOf(e);return t!==-1&&(this.ensureNonAliasedItems(),this.items.splice(t,1)),this},r.prototype.contains=function(e){return this.items.indexOf(e)!==-1},r.prototype.removeAll=function(){return this.ensureNonAliasedItems(),this.items.length=0,this},r.prototype.destroy=function(){this.removeAll(),this.items=null,this._name=null},Object.defineProperty(r.prototype,"empty",{get:function(){return this.items.length===0},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"name",{get:function(){return this._name},enumerable:!1,configurable:!0}),r}();Object.defineProperties(At.prototype,{dispatch:{value:At.prototype.emit},run:{value:At.prototype.emit}});/*! - * @pixi/ticker - v6.5.10 - * Compiled Thu, 06 Jul 2023 15:25:11 UTC - * - * @pixi/ticker is licensed under the MIT License. - * http://www.opensource.org/licenses/mit-license - */Se.TARGET_FPMS=.06;var Ri;(function(r){r[r.INTERACTION=50]="INTERACTION",r[r.HIGH=25]="HIGH",r[r.NORMAL=0]="NORMAL",r[r.LOW=-25]="LOW",r[r.UTILITY=-50]="UTILITY"})(Ri||(Ri={}));var na=function(){function r(e,t,n,i){t===void 0&&(t=null),n===void 0&&(n=0),i===void 0&&(i=!1),this.next=null,this.previous=null,this._destroyed=!1,this.fn=e,this.context=t,this.priority=n,this.once=i}return r.prototype.match=function(e,t){return t===void 0&&(t=null),this.fn===e&&this.context===t},r.prototype.emit=function(e){this.fn&&(this.context?this.fn.call(this.context,e):this.fn(e));var t=this.next;return this.once&&this.destroy(!0),this._destroyed&&(this.next=null),t},r.prototype.connect=function(e){this.previous=e,e.next&&(e.next.previous=this),this.next=e.next,e.next=this},r.prototype.destroy=function(e){e===void 0&&(e=!1),this._destroyed=!0,this.fn=null,this.context=null,this.previous&&(this.previous.next=this.next),this.next&&(this.next.previous=this.previous);var t=this.next;return this.next=e?null:t,this.previous=null,t},r}(),wn=function(){function r(){var e=this;this.autoStart=!1,this.deltaTime=1,this.lastTime=-1,this.speed=1,this.started=!1,this._requestId=null,this._maxElapsedMS=100,this._minElapsedMS=0,this._protected=!1,this._lastFrame=-1,this._head=new na(null,null,1/0),this.deltaMS=1/Se.TARGET_FPMS,this.elapsedMS=1/Se.TARGET_FPMS,this._tick=function(t){e._requestId=null,e.started&&(e.update(t),e.started&&e._requestId===null&&e._head.next&&(e._requestId=requestAnimationFrame(e._tick)))}}return r.prototype._requestIfNeeded=function(){this._requestId===null&&this._head.next&&(this.lastTime=performance.now(),this._lastFrame=this.lastTime,this._requestId=requestAnimationFrame(this._tick))},r.prototype._cancelIfNeeded=function(){this._requestId!==null&&(cancelAnimationFrame(this._requestId),this._requestId=null)},r.prototype._startIfPossible=function(){this.started?this._requestIfNeeded():this.autoStart&&this.start()},r.prototype.add=function(e,t,n){return n===void 0&&(n=Ri.NORMAL),this._addListener(new na(e,t,n))},r.prototype.addOnce=function(e,t,n){return n===void 0&&(n=Ri.NORMAL),this._addListener(new na(e,t,n,!0))},r.prototype._addListener=function(e){var t=this._head.next,n=this._head;if(!t)e.connect(n);else{for(;t;){if(e.priority>t.priority){e.connect(n);break}n=t,t=t.next}e.previous||e.connect(n)}return this._startIfPossible(),this},r.prototype.remove=function(e,t){for(var n=this._head.next;n;)n.match(e,t)?n=n.destroy():n=n.next;return this._head.next||this._cancelIfNeeded(),this},Object.defineProperty(r.prototype,"count",{get:function(){if(!this._head)return 0;for(var e=0,t=this._head;t=t.next;)e++;return e},enumerable:!1,configurable:!0}),r.prototype.start=function(){this.started||(this.started=!0,this._requestIfNeeded())},r.prototype.stop=function(){this.started&&(this.started=!1,this._cancelIfNeeded())},r.prototype.destroy=function(){if(!this._protected){this.stop();for(var e=this._head.next;e;)e=e.destroy(!0);this._head.destroy(),this._head=null}},r.prototype.update=function(e){e===void 0&&(e=performance.now());var t;if(e>this.lastTime){if(t=this.elapsedMS=e-this.lastTime,t>this._maxElapsedMS&&(t=this._maxElapsedMS),t*=this.speed,this._minElapsedMS){var n=e-this._lastFrame|0;if(n=this.x&&e=this.y&&te.right?e.right:this.right;if(i<=n)return!1;var o=this.ye.bottom?e.bottom:this.bottom;return s>o}var a=this.left,l=this.right,u=this.top,c=this.bottom;if(l<=a||c<=u)return!1;var f=Wi[0].set(e.left,e.top),d=Wi[1].set(e.left,e.bottom),h=Wi[2].set(e.right,e.top),g=Wi[3].set(e.right,e.bottom);if(h.x<=f.x||d.y<=f.y)return!1;var v=Math.sign(t.a*t.d-t.b*t.c);if(v===0||(t.apply(f,f),t.apply(d,d),t.apply(h,h),t.apply(g,g),Math.max(f.x,d.x,h.x,g.x)<=a||Math.min(f.x,d.x,h.x,g.x)>=l||Math.max(f.y,d.y,h.y,g.y)<=u||Math.min(f.y,d.y,h.y,g.y)>=c))return!1;var p=v*(d.y-f.y),m=v*(f.x-d.x),y=p*a+m*u,_=p*l+m*u,C=p*a+m*c,b=p*l+m*c;if(Math.max(y,_,C,b)<=p*f.x+m*f.y||Math.min(y,_,C,b)>=p*g.x+m*g.y)return!1;var x=v*(f.y-h.y),w=v*(h.x-f.x),M=x*a+w*u,T=x*l+w*u,I=x*a+w*c,F=x*l+w*c;return!(Math.max(M,T,I,F)<=x*f.x+w*f.y||Math.min(M,T,I,F)>=x*g.x+w*g.y)},r.prototype.pad=function(e,t){return e===void 0&&(e=0),t===void 0&&(t=e),this.x-=e,this.y-=t,this.width+=e*2,this.height+=t*2,this},r.prototype.fit=function(e){var t=Math.max(this.x,e.x),n=Math.min(this.x+this.width,e.x+e.width),i=Math.max(this.y,e.y),o=Math.min(this.y+this.height,e.y+e.height);return this.x=t,this.width=Math.max(n-t,0),this.y=i,this.height=Math.max(o-i,0),this},r.prototype.ceil=function(e,t){e===void 0&&(e=1),t===void 0&&(t=.001);var n=Math.ceil((this.x+this.width-t)*e)/e,i=Math.ceil((this.y+this.height-t)*e)/e;return this.x=Math.floor((this.x+t)*e)/e,this.y=Math.floor((this.y+t)*e)/e,this.width=n-this.x,this.height=i-this.y,this},r.prototype.enlarge=function(e){var t=Math.min(this.x,e.x),n=Math.max(this.x+this.width,e.x+e.width),i=Math.min(this.y,e.y),o=Math.max(this.y+this.height,e.y+e.height);return this.x=t,this.width=n-t,this.y=i,this.height=o-i,this},r.prototype.toString=function(){return"[@pixi/math:Rectangle x="+this.x+" y="+this.y+" width="+this.width+" height="+this.height+"]"},r}(),Ur=function(){function r(e,t,n,i){n===void 0&&(n=0),i===void 0&&(i=0),this._x=n,this._y=i,this.cb=e,this.scope=t}return r.prototype.clone=function(e,t){return e===void 0&&(e=this.cb),t===void 0&&(t=this.scope),new r(e,t,this._x,this._y)},r.prototype.set=function(e,t){return e===void 0&&(e=0),t===void 0&&(t=e),(this._x!==e||this._y!==t)&&(this._x=e,this._y=t,this.cb.call(this.scope)),this},r.prototype.copyFrom=function(e){return(this._x!==e.x||this._y!==e.y)&&(this._x=e.x,this._y=e.y,this.cb.call(this.scope)),this},r.prototype.copyTo=function(e){return e.set(this._x,this._y),e},r.prototype.equals=function(e){return e.x===this._x&&e.y===this._y},r.prototype.toString=function(){return"[@pixi/math:ObservablePoint x=0 y=0 scope="+this.scope+"]"},Object.defineProperty(r.prototype,"x",{get:function(){return this._x},set:function(e){this._x!==e&&(this._x=e,this.cb.call(this.scope))},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"y",{get:function(){return this._y},set:function(e){this._y!==e&&(this._y=e,this.cb.call(this.scope))},enumerable:!1,configurable:!0}),r}(),Ct=function(){function r(e,t,n,i,o,s){e===void 0&&(e=1),t===void 0&&(t=0),n===void 0&&(n=0),i===void 0&&(i=1),o===void 0&&(o=0),s===void 0&&(s=0),this.array=null,this.a=e,this.b=t,this.c=n,this.d=i,this.tx=o,this.ty=s}return r.prototype.fromArray=function(e){this.a=e[0],this.b=e[1],this.c=e[3],this.d=e[4],this.tx=e[2],this.ty=e[5]},r.prototype.set=function(e,t,n,i,o,s){return this.a=e,this.b=t,this.c=n,this.d=i,this.tx=o,this.ty=s,this},r.prototype.toArray=function(e,t){this.array||(this.array=new Float32Array(9));var n=t||this.array;return e?(n[0]=this.a,n[1]=this.b,n[2]=0,n[3]=this.c,n[4]=this.d,n[5]=0,n[6]=this.tx,n[7]=this.ty,n[8]=1):(n[0]=this.a,n[1]=this.c,n[2]=this.tx,n[3]=this.b,n[4]=this.d,n[5]=this.ty,n[6]=0,n[7]=0,n[8]=1),n},r.prototype.apply=function(e,t){t=t||new at;var n=e.x,i=e.y;return t.x=this.a*n+this.c*i+this.tx,t.y=this.b*n+this.d*i+this.ty,t},r.prototype.applyInverse=function(e,t){t=t||new at;var n=1/(this.a*this.d+this.c*-this.b),i=e.x,o=e.y;return t.x=this.d*n*i+-this.c*n*o+(this.ty*this.c-this.tx*this.d)*n,t.y=this.a*n*o+-this.b*n*i+(-this.ty*this.a+this.tx*this.b)*n,t},r.prototype.translate=function(e,t){return this.tx+=e,this.ty+=t,this},r.prototype.scale=function(e,t){return this.a*=e,this.d*=t,this.c*=e,this.b*=t,this.tx*=e,this.ty*=t,this},r.prototype.rotate=function(e){var t=Math.cos(e),n=Math.sin(e),i=this.a,o=this.c,s=this.tx;return this.a=i*t-this.b*n,this.b=i*n+this.b*t,this.c=o*t-this.d*n,this.d=o*n+this.d*t,this.tx=s*t-this.ty*n,this.ty=s*n+this.ty*t,this},r.prototype.append=function(e){var t=this.a,n=this.b,i=this.c,o=this.d;return this.a=e.a*t+e.b*i,this.b=e.a*n+e.b*o,this.c=e.c*t+e.d*i,this.d=e.c*n+e.d*o,this.tx=e.tx*t+e.ty*i+this.tx,this.ty=e.tx*n+e.ty*o+this.ty,this},r.prototype.setTransform=function(e,t,n,i,o,s,a,l,u){return this.a=Math.cos(a+u)*o,this.b=Math.sin(a+u)*o,this.c=-Math.sin(a-l)*s,this.d=Math.cos(a-l)*s,this.tx=e-(n*this.a+i*this.c),this.ty=t-(n*this.b+i*this.d),this},r.prototype.prepend=function(e){var t=this.tx;if(e.a!==1||e.b!==0||e.c!==0||e.d!==1){var n=this.a,i=this.c;this.a=n*e.a+this.b*e.c,this.b=n*e.b+this.b*e.d,this.c=i*e.a+this.d*e.c,this.d=i*e.b+this.d*e.d}return this.tx=t*e.a+this.ty*e.c+e.tx,this.ty=t*e.b+this.ty*e.d+e.ty,this},r.prototype.decompose=function(e){var t=this.a,n=this.b,i=this.c,o=this.d,s=e.pivot,a=-Math.atan2(-i,o),l=Math.atan2(n,t),u=Math.abs(a+l);return u<1e-5||Math.abs(My-u)<1e-5?(e.rotation=l,e.skew.x=e.skew.y=0):(e.rotation=0,e.skew.x=a,e.skew.y=l),e.scale.x=Math.sqrt(t*t+n*n),e.scale.y=Math.sqrt(i*i+o*o),e.position.x=this.tx+(s.x*t+s.y*i),e.position.y=this.ty+(s.x*n+s.y*o),e},r.prototype.invert=function(){var e=this.a,t=this.b,n=this.c,i=this.d,o=this.tx,s=e*i-t*n;return this.a=i/s,this.b=-t/s,this.c=-n/s,this.d=e/s,this.tx=(n*this.ty-i*o)/s,this.ty=-(e*this.ty-t*o)/s,this},r.prototype.identity=function(){return this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0,this},r.prototype.clone=function(){var e=new r;return e.a=this.a,e.b=this.b,e.c=this.c,e.d=this.d,e.tx=this.tx,e.ty=this.ty,e},r.prototype.copyTo=function(e){return e.a=this.a,e.b=this.b,e.c=this.c,e.d=this.d,e.tx=this.tx,e.ty=this.ty,e},r.prototype.copyFrom=function(e){return this.a=e.a,this.b=e.b,this.c=e.c,this.d=e.d,this.tx=e.tx,this.ty=e.ty,this},r.prototype.toString=function(){return"[@pixi/math:Matrix a="+this.a+" b="+this.b+" c="+this.c+" d="+this.d+" tx="+this.tx+" ty="+this.ty+"]"},Object.defineProperty(r,"IDENTITY",{get:function(){return new r},enumerable:!1,configurable:!0}),Object.defineProperty(r,"TEMP_MATRIX",{get:function(){return new r},enumerable:!1,configurable:!0}),r}(),tr=[1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1],nr=[0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1],rr=[0,-1,-1,-1,0,1,1,1,0,1,1,1,0,-1,-1,-1],ir=[1,1,0,-1,-1,-1,0,1,-1,-1,0,1,1,1,0,-1],tl=[],np=[],qi=Math.sign;function Py(){for(var r=0;r<16;r++){var e=[];tl.push(e);for(var t=0;t<16;t++)for(var n=qi(tr[r]*tr[t]+rr[r]*nr[t]),i=qi(nr[r]*tr[t]+ir[r]*nr[t]),o=qi(tr[r]*rr[t]+rr[r]*ir[t]),s=qi(nr[r]*rr[t]+ir[r]*ir[t]),a=0;a<16;a++)if(tr[a]===n&&nr[a]===i&&rr[a]===o&&ir[a]===s){e.push(a);break}}for(var r=0;r<16;r++){var l=new Ct;l.set(tr[r],nr[r],rr[r],ir[r],0,0),np.push(l)}}Py();var ot={E:0,SE:1,S:2,SW:3,W:4,NW:5,N:6,NE:7,MIRROR_VERTICAL:8,MAIN_DIAGONAL:10,MIRROR_HORIZONTAL:12,REVERSE_DIAGONAL:14,uX:function(r){return tr[r]},uY:function(r){return nr[r]},vX:function(r){return rr[r]},vY:function(r){return ir[r]},inv:function(r){return r&8?r&15:-r&7},add:function(r,e){return tl[r][e]},sub:function(r,e){return tl[r][ot.inv(e)]},rotate180:function(r){return r^4},isVertical:function(r){return(r&3)===2},byDirection:function(r,e){return Math.abs(r)*2<=Math.abs(e)?e>=0?ot.S:ot.N:Math.abs(e)*2<=Math.abs(r)?r>0?ot.E:ot.W:e>0?r>0?ot.SE:ot.SW:r>0?ot.NE:ot.NW},matrixAppendRotationInv:function(r,e,t,n){t===void 0&&(t=0),n===void 0&&(n=0);var i=np[ot.inv(e)];i.tx=t,i.ty=n,r.append(i)}},rp=function(){function r(){this.worldTransform=new Ct,this.localTransform=new Ct,this.position=new Ur(this.onChange,this,0,0),this.scale=new Ur(this.onChange,this,1,1),this.pivot=new Ur(this.onChange,this,0,0),this.skew=new Ur(this.updateSkew,this,0,0),this._rotation=0,this._cx=1,this._sx=0,this._cy=0,this._sy=1,this._localID=0,this._currentLocalID=0,this._worldID=0,this._parentID=0}return r.prototype.onChange=function(){this._localID++},r.prototype.updateSkew=function(){this._cx=Math.cos(this._rotation+this.skew.y),this._sx=Math.sin(this._rotation+this.skew.y),this._cy=-Math.sin(this._rotation-this.skew.x),this._sy=Math.cos(this._rotation-this.skew.x),this._localID++},r.prototype.toString=function(){return"[@pixi/math:Transform "+("position=("+this.position.x+", "+this.position.y+") ")+("rotation="+this.rotation+" ")+("scale=("+this.scale.x+", "+this.scale.y+") ")+("skew=("+this.skew.x+", "+this.skew.y+") ")+"]"},r.prototype.updateLocalTransform=function(){var e=this.localTransform;this._localID!==this._currentLocalID&&(e.a=this._cx*this.scale.x,e.b=this._sx*this.scale.x,e.c=this._cy*this.scale.y,e.d=this._sy*this.scale.y,e.tx=this.position.x-(this.pivot.x*e.a+this.pivot.y*e.c),e.ty=this.position.y-(this.pivot.x*e.b+this.pivot.y*e.d),this._currentLocalID=this._localID,this._parentID=-1)},r.prototype.updateTransform=function(e){var t=this.localTransform;if(this._localID!==this._currentLocalID&&(t.a=this._cx*this.scale.x,t.b=this._sx*this.scale.x,t.c=this._cy*this.scale.y,t.d=this._sy*this.scale.y,t.tx=this.position.x-(this.pivot.x*t.a+this.pivot.y*t.c),t.ty=this.position.y-(this.pivot.x*t.b+this.pivot.y*t.d),this._currentLocalID=this._localID,this._parentID=-1),this._parentID!==e._worldID){var n=e.worldTransform,i=this.worldTransform;i.a=t.a*n.a+t.b*n.c,i.b=t.a*n.b+t.b*n.d,i.c=t.c*n.a+t.d*n.c,i.d=t.c*n.b+t.d*n.d,i.tx=t.tx*n.a+t.ty*n.c+n.tx,i.ty=t.tx*n.b+t.ty*n.d+n.ty,this._parentID=e._worldID,this._worldID++}},r.prototype.setFromMatrix=function(e){e.decompose(this),this._localID++},Object.defineProperty(r.prototype,"rotation",{get:function(){return this._rotation},set:function(e){this._rotation!==e&&(this._rotation=e,this.updateSkew())},enumerable:!1,configurable:!0}),r.IDENTITY=new r,r}();/*! - * @pixi/core - v6.5.10 - * Compiled Thu, 06 Jul 2023 15:25:11 UTC - * - * @pixi/core is licensed under the MIT License. - * http://www.opensource.org/licenses/mit-license - */Se.PREFER_ENV=fr.any?An.WEBGL:An.WEBGL2;Se.STRICT_TEXTURE_CACHE=!1;var nl=[];function ip(r,e){if(!r)return null;var t="";if(typeof r=="string"){var n=/\.(\w{3,4})(?:$|\?|#)/i.exec(r);n&&(t=n[1].toLowerCase())}for(var i=nl.length-1;i>=0;--i){var o=nl[i];if(o.test&&o.test(r,t))return new o(r,e)}throw new Error("Unrecognized source type to auto-detect Resource")}/*! ***************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */var rl=function(r,e){return rl=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)n.hasOwnProperty(i)&&(t[i]=n[i])},rl(r,e)};function Qe(r,e){rl(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var il=function(){return il=Object.assign||function(e){for(var t=arguments,n,i=1,o=arguments.length;i0&&c>0,i.textureCacheIds=[],i.destroyed=!1,i.resource=null,i._batchEnabled=0,i._batchLocation=0,i.parentTextureArray=null,i.setResource(t),i}return Object.defineProperty(e.prototype,"realWidth",{get:function(){return Math.round(this.width*this.resolution)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"realHeight",{get:function(){return Math.round(this.height*this.resolution)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"mipmap",{get:function(){return this._mipmap},set:function(t){this._mipmap!==t&&(this._mipmap=t,this.dirtyStyleId++)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"scaleMode",{get:function(){return this._scaleMode},set:function(t){this._scaleMode!==t&&(this._scaleMode=t,this.dirtyStyleId++)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"wrapMode",{get:function(){return this._wrapMode},set:function(t){this._wrapMode!==t&&(this._wrapMode=t,this.dirtyStyleId++)},enumerable:!1,configurable:!0}),e.prototype.setStyle=function(t,n){var i;return t!==void 0&&t!==this.scaleMode&&(this.scaleMode=t,i=!0),n!==void 0&&n!==this.mipmap&&(this.mipmap=n,i=!0),i&&this.dirtyStyleId++,this},e.prototype.setSize=function(t,n,i){return i=i||this.resolution,this.setRealSize(t*i,n*i,i)},e.prototype.setRealSize=function(t,n,i){return this.resolution=i||this.resolution,this.width=Math.round(t)/this.resolution,this.height=Math.round(n)/this.resolution,this._refreshPOT(),this.update(),this},e.prototype._refreshPOT=function(){this.isPowerOfTwo=yf(this.realWidth)&&yf(this.realHeight)},e.prototype.setResolution=function(t){var n=this.resolution;return n===t?this:(this.resolution=t,this.valid&&(this.width=Math.round(this.width*n)/t,this.height=Math.round(this.height*n)/t,this.emit("update",this)),this._refreshPOT(),this)},e.prototype.setResource=function(t){if(this.resource===t)return this;if(this.resource)throw new Error("Resource can be set only once");return t.bind(this),this.resource=t,this},e.prototype.update=function(){this.valid?(this.dirtyId++,this.dirtyStyleId++,this.emit("update",this)):this.width>0&&this.height>0&&(this.valid=!0,this.emit("loaded",this),this.emit("update",this))},e.prototype.onError=function(t){this.emit("error",this,t)},e.prototype.destroy=function(){this.resource&&(this.resource.unbind(this),this.resource.internal&&this.resource.destroy(),this.resource=null),this.cacheId&&(delete Yn[this.cacheId],delete xn[this.cacheId],this.cacheId=null),this.dispose(),e.removeFromCache(this),this.textureCacheIds=null,this.destroyed=!0},e.prototype.dispose=function(){this.emit("dispose",this)},e.prototype.castToBaseTexture=function(){return this},e.from=function(t,n,i){i===void 0&&(i=Se.STRICT_TEXTURE_CACHE);var o=typeof t=="string",s=null;if(o)s=t;else{if(!t._pixiId){var a=n&&n.pixiIdPrefix||"pixiid";t._pixiId=a+"_"+Pi()}s=t._pixiId}var l=Yn[s];if(o&&i&&!l)throw new Error('The cacheId "'+s+'" does not exist in BaseTextureCache.');return l||(l=new e(t,n),l.cacheId=s,e.addToCache(l,s)),l},e.fromBuffer=function(t,n,i,o){t=t||new Float32Array(n*i*4);var s=new wu(t,{width:n,height:i}),a=t instanceof Float32Array?$e.FLOAT:$e.UNSIGNED_BYTE;return new e(s,Object.assign({},Oy,o||{width:n,height:i,type:a}))},e.addToCache=function(t,n){n&&(t.textureCacheIds.indexOf(n)===-1&&t.textureCacheIds.push(n),Yn[n]&&console.warn("BaseTexture added to the cache with an id ["+n+"] that already had an entry"),Yn[n]=t)},e.removeFromCache=function(t){if(typeof t=="string"){var n=Yn[t];if(n){var i=n.textureCacheIds.indexOf(t);return i>-1&&n.textureCacheIds.splice(i,1),delete Yn[t],n}}else if(t&&t.textureCacheIds){for(var o=0;o0)if(t.resource)this.addResourceAt(t.resource,n);else throw new Error("CubeResource does not support copying of renderTexture.");else t.target=dr.TEXTURE_CUBE_MAP_POSITIVE_X+n,t.parentTextureArray=this.baseTexture,this.items[n]=t;return t.valid&&!this.valid&&this.resize(t.realWidth,t.realHeight),this.items[n]=t,this},e.prototype.upload=function(t,n,i){for(var o=this.itemDirtyIds,s=0;s)?\s*()]*-->)?\s*\]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*>/i,e}(Gn),By=function(r){Qe(e,r);function e(t,n){var i=this;if(n=n||{},!(t instanceof HTMLVideoElement)){var o=document.createElement("video");o.setAttribute("preload","auto"),o.setAttribute("webkit-playsinline",""),o.setAttribute("playsinline",""),typeof t=="string"&&(t=[t]);var s=t[0].src||t[0];Gn.crossOrigin(o,s,n.crossorigin);for(var a=0;a2},e.prototype._onPlayStart=function(){this.valid||this._onCanPlay(),this.autoUpdate&&!this._isConnectedToTicker&&(wn.shared.add(this.update,this),this._isConnectedToTicker=!0)},e.prototype._onPlayStop=function(){this._isConnectedToTicker&&(wn.shared.remove(this.update,this),this._isConnectedToTicker=!1)},e.prototype._onCanPlay=function(){var t=this.source;t.removeEventListener("canplay",this._onCanPlay),t.removeEventListener("canplaythrough",this._onCanPlay);var n=this.valid;this.resize(t.videoWidth,t.videoHeight),!n&&this._resolve&&(this._resolve(this),this._resolve=null),this._isSourcePlaying()?this._onPlayStart():this.autoPlay&&t.play()},e.prototype.dispose=function(){this._isConnectedToTicker&&(wn.shared.remove(this.update,this),this._isConnectedToTicker=!1);var t=this.source;t&&(t.removeEventListener("error",this._onError,!0),t.pause(),t.src="",t.load()),r.prototype.dispose.call(this)},Object.defineProperty(e.prototype,"autoUpdate",{get:function(){return this._autoUpdate},set:function(t){t!==this._autoUpdate&&(this._autoUpdate=t,!this._autoUpdate&&this._isConnectedToTicker?(wn.shared.remove(this.update,this),this._isConnectedToTicker=!1):this._autoUpdate&&!this._isConnectedToTicker&&this._isSourcePlaying()&&(wn.shared.add(this.update,this),this._isConnectedToTicker=!0))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"updateFPS",{get:function(){return this._updateFPS},set:function(t){t!==this._updateFPS&&(this._updateFPS=t)},enumerable:!1,configurable:!0}),e.test=function(t,n){return globalThis.HTMLVideoElement&&t instanceof HTMLVideoElement||e.TYPES.indexOf(n)>-1},e.TYPES=["mp4","m4v","webm","ogg","ogv","h264","avi","mov"],e.MIME_TYPES={ogv:"video/ogg",mov:"video/quicktime",m4v:"video/mp4"},e}(Gn),Uy=function(r){Qe(e,r);function e(t){return r.call(this,t)||this}return e.test=function(t){return!!globalThis.createImageBitmap&&typeof ImageBitmap<"u"&&t instanceof ImageBitmap},e}(Gn);nl.push(sp,Uy,Ly,By,Dy,wu,Ny,Fy);var zy=function(r){Qe(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.upload=function(t,n,i){var o=t.gl;o.pixelStorei(o.UNPACK_PREMULTIPLY_ALPHA_WEBGL,n.alphaMode===Vn.UNPACK);var s=n.realWidth,a=n.realHeight;return i.width===s&&i.height===a?o.texSubImage2D(n.target,0,0,0,s,a,n.format,i.type,this.data):(i.width=s,i.height=a,o.texImage2D(n.target,0,i.internalFormat,s,a,0,n.format,i.type,this.data)),!0},e}(wu),ol=function(){function r(e,t){this.width=Math.round(e||100),this.height=Math.round(t||100),this.stencil=!1,this.depth=!1,this.dirtyId=0,this.dirtyFormat=0,this.dirtySize=0,this.depthTexture=null,this.colorTextures=[],this.glFramebuffers={},this.disposeRunner=new At("disposeFramebuffer"),this.multisample=pt.NONE}return Object.defineProperty(r.prototype,"colorTexture",{get:function(){return this.colorTextures[0]},enumerable:!1,configurable:!0}),r.prototype.addColorTexture=function(e,t){return e===void 0&&(e=0),this.colorTextures[e]=t||new xt(null,{scaleMode:zt.NEAREST,resolution:1,mipmap:dn.OFF,width:this.width,height:this.height}),this.dirtyId++,this.dirtyFormat++,this},r.prototype.addDepthTexture=function(e){return this.depthTexture=e||new xt(new zy(null,{width:this.width,height:this.height}),{scaleMode:zt.NEAREST,resolution:1,width:this.width,height:this.height,mipmap:dn.OFF,format:Te.DEPTH_COMPONENT,type:$e.UNSIGNED_SHORT}),this.dirtyId++,this.dirtyFormat++,this},r.prototype.enableDepth=function(){return this.depth=!0,this.dirtyId++,this.dirtyFormat++,this},r.prototype.enableStencil=function(){return this.stencil=!0,this.dirtyId++,this.dirtyFormat++,this},r.prototype.resize=function(e,t){if(e=Math.round(e),t=Math.round(t),!(e===this.width&&t===this.height)){this.width=e,this.height=t,this.dirtyId++,this.dirtySize++;for(var n=0;n-1&&n.textureCacheIds.splice(i,1),delete xn[t],n}}else if(t&&t.textureCacheIds){for(var o=0;othis.baseTexture.width,l=i+s>this.baseTexture.height;if(a||l){var u=a&&l?"and":"or",c="X: "+n+" + "+o+" = "+(n+o)+" > "+this.baseTexture.width,f="Y: "+i+" + "+s+" = "+(i+s)+" > "+this.baseTexture.height;throw new Error("Texture Error: frame does not fit inside the base Texture dimensions: "+(c+" "+u+" "+f))}this.valid=o&&s&&this.baseTexture.valid,!this.trim&&!this.rotate&&(this.orig=t),this.valid&&this.updateUvs()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"rotate",{get:function(){return this._rotate},set:function(t){this._rotate=t,this.valid&&this.updateUvs()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"width",{get:function(){return this.orig.width},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this.orig.height},enumerable:!1,configurable:!0}),e.prototype.castToBaseTexture=function(){return this.baseTexture},Object.defineProperty(e,"EMPTY",{get:function(){return e._EMPTY||(e._EMPTY=new e(new xt),Yi(e._EMPTY),Yi(e._EMPTY.baseTexture)),e._EMPTY},enumerable:!1,configurable:!0}),Object.defineProperty(e,"WHITE",{get:function(){if(!e._WHITE){var t=Se.ADAPTER.createCanvas(16,16),n=t.getContext("2d");t.width=16,t.height=16,n.fillStyle="white",n.fillRect(0,0,16,16),e._WHITE=new e(xt.from(t)),Yi(e._WHITE),Yi(e._WHITE.baseTexture)}return e._WHITE},enumerable:!1,configurable:!0}),e}(br),Tu=function(r){Qe(e,r);function e(t,n){var i=r.call(this,t,n)||this;return i.valid=!0,i.filterFrame=null,i.filterPoolKey=null,i.updateUvs(),i}return Object.defineProperty(e.prototype,"framebuffer",{get:function(){return this.baseTexture.framebuffer},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"multisample",{get:function(){return this.framebuffer.multisample},set:function(t){this.framebuffer.multisample=t},enumerable:!1,configurable:!0}),e.prototype.resize=function(t,n,i){i===void 0&&(i=!0);var o=this.baseTexture.resolution,s=Math.round(t*o)/o,a=Math.round(n*o)/o;this.valid=s>0&&a>0,this._frame.width=this.orig.width=s,this._frame.height=this.orig.height=a,i&&this.baseTexture.resize(s,a),this.updateUvs()},e.prototype.setResolution=function(t){var n=this.baseTexture;n.resolution!==t&&(n.setResolution(t),this.resize(n.width,n.height,!1))},e.create=function(t){for(var n=arguments,i=[],o=1;o>>0,i>1&&(o+=i*4294967296)):o=i>1?-i:-1,this.texturePool[o]||(this.texturePool[o]=[]);var s=this.texturePool[o].pop();return s||(s=this.createTexture(e,t,i)),s.filterPoolKey=o,s.setResolution(n),s},r.prototype.getFilterTexture=function(e,t,n){var i=this.getOptimalTexture(e.width,e.height,t||e.resolution,n||pt.NONE);return i.filterFrame=e.filterFrame,i},r.prototype.returnTexture=function(e){var t=e.filterPoolKey;e.filterFrame=null,this.texturePool[t].push(e)},r.prototype.returnFilterTexture=function(e){this.returnTexture(e)},r.prototype.clear=function(e){if(e=e!==!1,e)for(var t in this.texturePool){var n=this.texturePool[t];if(n)for(var i=0;i0&&e.height>0;for(var t in this.texturePool)if(Number(t)<0){var n=this.texturePool[t];if(n)for(var i=0;i1){for(var c=0;c1&&(f=this.getOptimalFilterTexture(c.width,c.height,t.resolution),f.filterFrame=c.filterFrame),n[d].apply(this,c,f,rn.CLEAR,t);var h=c;c=f,f=h}n[d].apply(this,c,u.renderTexture,rn.BLEND,t),d>1&&t.multisample>1&&this.returnFilterTexture(t.renderTexture),this.returnFilterTexture(c),this.returnFilterTexture(f)}t.clear(),this.statePool.push(t)},r.prototype.bindAndClear=function(e,t){t===void 0&&(t=rn.CLEAR);var n=this.renderer,i=n.renderTexture,o=n.state;if(e===this.defaultFilterStack[this.defaultFilterStack.length-1].renderTexture?this.renderer.projection.transform=this.activeState.transform:this.renderer.projection.transform=null,e&&e.filterFrame){var s=this.tempRect;s.x=0,s.y=0,s.width=e.filterFrame.width,s.height=e.filterFrame.height,i.bind(e,e.filterFrame,s)}else e!==this.defaultFilterStack[this.defaultFilterStack.length-1].renderTexture?i.bind(e):this.renderer.renderTexture.bind(e,this.activeState.bindingSourceFrame,this.activeState.bindingDestinationFrame);var a=o.stateId&1||this.forceClear;(t===rn.CLEAR||t===rn.BLIT&&a)&&this.renderer.framebuffer.clear(0,0,0,0)},r.prototype.applyFilter=function(e,t,n,i){var o=this.renderer;o.state.set(e.state),this.bindAndClear(n,i),e.uniforms.uSampler=t,e.uniforms.filterGlobals=this.globalUniforms,o.shader.bind(e),e.legacy=!!e.program.attributeData.aTextureCoord,e.legacy?(this.quadUv.map(t._frame,t.filterFrame),o.geometry.bind(this.quadUv),o.geometry.draw(ki.TRIANGLES)):(o.geometry.bind(this.quad),o.geometry.draw(ki.TRIANGLE_STRIP))},r.prototype.calculateSpriteMatrix=function(e,t){var n=this.activeState,i=n.sourceFrame,o=n.destinationFrame,s=t._texture.orig,a=e.set(o.width,0,0,o.height,i.x,i.y),l=t.worldTransform.copyTo(Ct.TEMP_MATRIX);return l.invert(),a.prepend(l),a.scale(1/s.width,1/s.height),a.translate(t.anchor.x,t.anchor.y),a},r.prototype.destroy=function(){this.renderer=null,this.texturePool.clear(!1)},r.prototype.getOptimalFilterTexture=function(e,t,n,i){return n===void 0&&(n=1),i===void 0&&(i=pt.NONE),this.texturePool.getOptimalTexture(e,t,n,i)},r.prototype.getFilterTexture=function(e,t,n){if(typeof e=="number"){var i=e;e=t,t=i}e=e||this.activeState.renderTexture;var o=this.texturePool.getOptimalTexture(e.width,e.height,t||e.resolution,n||pt.NONE);return o.filterFrame=e.filterFrame,o},r.prototype.returnFilterTexture=function(e){this.texturePool.returnTexture(e)},r.prototype.emptyPool=function(){this.texturePool.clear(!0)},r.prototype.resize=function(){this.texturePool.setScreenSize(this.renderer.view)},r.prototype.transformAABB=function(e,t){var n=Ki[0],i=Ki[1],o=Ki[2],s=Ki[3];n.set(t.left,t.top),i.set(t.left,t.bottom),o.set(t.right,t.top),s.set(t.right,t.bottom),e.apply(n,n),e.apply(i,i),e.apply(o,o),e.apply(s,s);var a=Math.min(n.x,i.x,o.x,s.x),l=Math.min(n.y,i.y,o.y,s.y),u=Math.max(n.x,i.x,o.x,s.x),c=Math.max(n.y,i.y,o.y,s.y);t.x=a,t.y=l,t.width=u-a,t.height=c-l},r.prototype.roundFrame=function(e,t,n,i,o){if(!(e.width<=0||e.height<=0||n.width<=0||n.height<=0)){if(o){var s=o.a,a=o.b,l=o.c,u=o.d;if((Math.abs(a)>1e-4||Math.abs(l)>1e-4)&&(Math.abs(s)>1e-4||Math.abs(u)>1e-4))return}o=o?ra.copyFrom(o):ra.identity(),o.translate(-n.x,-n.y).scale(i.width/n.width,i.height/n.height).translate(i.x,i.y),this.transformAABB(o,e),e.ceil(t),this.transformAABB(o.invert(),e)}},r}(),up=function(){function r(e){this.renderer=e}return r.prototype.flush=function(){},r.prototype.destroy=function(){this.renderer=null},r.prototype.start=function(){},r.prototype.stop=function(){this.flush()},r.prototype.render=function(e){},r}(),Jy=function(){function r(e){this.renderer=e,this.emptyRenderer=new up(e),this.currentRenderer=this.emptyRenderer}return r.prototype.setObjectRenderer=function(e){this.currentRenderer!==e&&(this.currentRenderer.stop(),this.currentRenderer=e,this.currentRenderer.start())},r.prototype.flush=function(){this.setObjectRenderer(this.emptyRenderer)},r.prototype.reset=function(){this.setObjectRenderer(this.emptyRenderer)},r.prototype.copyBoundTextures=function(e,t){for(var n=this.renderer.texture.boundTextures,i=t-1;i>=0;--i)e[i]=n[i]||null,e[i]&&(e[i]._batchLocation=i)},r.prototype.boundArray=function(e,t,n,i){for(var o=e.elements,s=e.ids,a=e.count,l=0,u=0;u=0&&f=An.WEBGL2&&(n=e.getContext("webgl2",t)),n)this.webGLVersion=2;else if(this.webGLVersion=1,n=e.getContext("webgl",t)||e.getContext("experimental-webgl",t),!n)throw new Error("This browser does not support WebGL. Try using the canvas renderer");return this.gl=n,this.getExtensions(),this.gl},r.prototype.getExtensions=function(){var e=this.gl,t={loseContext:e.getExtension("WEBGL_lose_context"),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")};this.webGLVersion===1?Object.assign(this.extensions,t,{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")}):this.webGLVersion===2&&Object.assign(this.extensions,t,{colorBufferFloat:e.getExtension("EXT_color_buffer_float")})},r.prototype.handleContextLost=function(e){var t=this;e.preventDefault(),setTimeout(function(){t.gl.isContextLost()&&t.extensions.loseContext&&t.extensions.loseContext.restoreContext()},0)},r.prototype.handleContextRestored=function(){this.renderer.runners.contextChange.emit(this.gl)},r.prototype.destroy=function(){var e=this.renderer.view;this.renderer=null,e.removeEventListener("webglcontextlost",this.handleContextLost),e.removeEventListener("webglcontextrestored",this.handleContextRestored),this.gl.useProgram(null),this.extensions.loseContext&&this.extensions.loseContext.loseContext()},r.prototype.postrender=function(){this.renderer.renderingToScreen&&this.gl.flush()},r.prototype.validateContext=function(e){var t=e.getContextAttributes(),n="WebGL2RenderingContext"in globalThis&&e instanceof globalThis.WebGL2RenderingContext;n&&(this.webGLVersion=2),t&&!t.stencil&&console.warn("Provided WebGL context does not have a stencil buffer, masks may not render correctly");var i=n||!!e.getExtension("OES_element_index_uint");this.supports.uint32Indices=i,i||console.warn("Provided WebGL context does not support 32 index buffer, complex graphics may not render correctly")},r}(),e0=function(){function r(e){this.framebuffer=e,this.stencil=null,this.dirtyId=-1,this.dirtyFormat=-1,this.dirtySize=-1,this.multisample=pt.NONE,this.msaaBuffer=null,this.blitFramebuffer=null,this.mipLevel=0}return r}(),t0=new mt,n0=function(){function r(e){this.renderer=e,this.managedFramebuffers=[],this.unknownFramebuffer=new ol(10,10),this.msaaSamples=null}return r.prototype.contextChange=function(){this.disposeAll(!0);var e=this.gl=this.renderer.gl;if(this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.current=this.unknownFramebuffer,this.viewport=new mt,this.hasMRT=!0,this.writeDepthTexture=!0,this.renderer.context.webGLVersion===1){var t=this.renderer.context.extensions.drawBuffers,n=this.renderer.context.extensions.depthTexture;Se.PREFER_ENV===An.WEBGL_LEGACY&&(t=null,n=null),t?e.drawBuffers=function(i){return t.drawBuffersWEBGL(i)}:(this.hasMRT=!1,e.drawBuffers=function(){}),n||(this.writeDepthTexture=!1)}else this.msaaSamples=e.getInternalformatParameter(e.RENDERBUFFER,e.RGBA8,e.SAMPLES)},r.prototype.bind=function(e,t,n){n===void 0&&(n=0);var i=this.gl;if(e){var o=e.glFramebuffers[this.CONTEXT_UID]||this.initFramebuffer(e);this.current!==e&&(this.current=e,i.bindFramebuffer(i.FRAMEBUFFER,o.framebuffer)),o.mipLevel!==n&&(e.dirtyId++,e.dirtyFormat++,o.mipLevel=n),o.dirtyId!==e.dirtyId&&(o.dirtyId=e.dirtyId,o.dirtyFormat!==e.dirtyFormat?(o.dirtyFormat=e.dirtyFormat,o.dirtySize=e.dirtySize,this.updateFramebuffer(e,n)):o.dirtySize!==e.dirtySize&&(o.dirtySize=e.dirtySize,this.resizeFramebuffer(e)));for(var s=0;s>n,u=t.height>>n,c=l/t.width;this.setViewport(t.x*c,t.y*c,l,u)}else{var l=e.width>>n,u=e.height>>n;this.setViewport(0,0,l,u)}}else this.current&&(this.current=null,i.bindFramebuffer(i.FRAMEBUFFER,null)),t?this.setViewport(t.x,t.y,t.width,t.height):this.setViewport(0,0,this.renderer.width,this.renderer.height)},r.prototype.setViewport=function(e,t,n,i){var o=this.viewport;e=Math.round(e),t=Math.round(t),n=Math.round(n),i=Math.round(i),(o.width!==n||o.height!==i||o.x!==e||o.y!==t)&&(o.x=e,o.y=t,o.width=n,o.height=i,this.gl.viewport(e,t,n,i))},Object.defineProperty(r.prototype,"size",{get:function(){return this.current?{x:0,y:0,width:this.current.width,height:this.current.height}:{x:0,y:0,width:this.renderer.width,height:this.renderer.height}},enumerable:!1,configurable:!0}),r.prototype.clear=function(e,t,n,i,o){o===void 0&&(o=Ro.COLOR|Ro.DEPTH);var s=this.gl;s.clearColor(e,t,n,i),s.clear(o)},r.prototype.initFramebuffer=function(e){var t=this.gl,n=new e0(t.createFramebuffer());return n.multisample=this.detectSamples(e.multisample),e.glFramebuffers[this.CONTEXT_UID]=n,this.managedFramebuffers.push(e),e.disposeRunner.add(this),n},r.prototype.resizeFramebuffer=function(e){var t=this.gl,n=e.glFramebuffers[this.CONTEXT_UID];n.msaaBuffer&&(t.bindRenderbuffer(t.RENDERBUFFER,n.msaaBuffer),t.renderbufferStorageMultisample(t.RENDERBUFFER,n.multisample,t.RGBA8,e.width,e.height)),n.stencil&&(t.bindRenderbuffer(t.RENDERBUFFER,n.stencil),n.msaaBuffer?t.renderbufferStorageMultisample(t.RENDERBUFFER,n.multisample,t.DEPTH24_STENCIL8,e.width,e.height):t.renderbufferStorage(t.RENDERBUFFER,t.DEPTH_STENCIL,e.width,e.height));var i=e.colorTextures,o=i.length;t.drawBuffers||(o=Math.min(o,1));for(var s=0;s1&&this.canMultisampleFramebuffer(e)?(i.msaaBuffer=i.msaaBuffer||n.createRenderbuffer(),n.bindRenderbuffer(n.RENDERBUFFER,i.msaaBuffer),n.renderbufferStorageMultisample(n.RENDERBUFFER,i.multisample,n.RGBA8,e.width,e.height),n.framebufferRenderbuffer(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0,n.RENDERBUFFER,i.msaaBuffer)):i.msaaBuffer&&(n.deleteRenderbuffer(i.msaaBuffer),i.msaaBuffer=null,i.blitFramebuffer&&(i.blitFramebuffer.dispose(),i.blitFramebuffer=null));for(var a=[],l=0;l1&&n.drawBuffers(a),e.depthTexture){var f=this.writeDepthTexture;if(f){var d=e.depthTexture;this.renderer.texture.bind(d,0),n.framebufferTexture2D(n.FRAMEBUFFER,n.DEPTH_ATTACHMENT,n.TEXTURE_2D,d._glTextures[this.CONTEXT_UID].texture,t)}}(e.stencil||e.depth)&&!(e.depthTexture&&this.writeDepthTexture)?(i.stencil=i.stencil||n.createRenderbuffer(),n.bindRenderbuffer(n.RENDERBUFFER,i.stencil),i.msaaBuffer?n.renderbufferStorageMultisample(n.RENDERBUFFER,i.multisample,n.DEPTH24_STENCIL8,e.width,e.height):n.renderbufferStorage(n.RENDERBUFFER,n.DEPTH_STENCIL,e.width,e.height),n.framebufferRenderbuffer(n.FRAMEBUFFER,n.DEPTH_STENCIL_ATTACHMENT,n.RENDERBUFFER,i.stencil)):i.stencil&&(n.deleteRenderbuffer(i.stencil),i.stencil=null)},r.prototype.canMultisampleFramebuffer=function(e){return this.renderer.context.webGLVersion!==1&&e.colorTextures.length<=1&&!e.depthTexture},r.prototype.detectSamples=function(e){var t=this.msaaSamples,n=pt.NONE;if(e<=1||t===null)return n;for(var i=0;i=0&&this.managedFramebuffers.splice(o,1),e.disposeRunner.remove(this),t||(i.deleteFramebuffer(n.framebuffer),n.msaaBuffer&&i.deleteRenderbuffer(n.msaaBuffer),n.stencil&&i.deleteRenderbuffer(n.stencil)),n.blitFramebuffer&&n.blitFramebuffer.dispose()}},r.prototype.disposeAll=function(e){var t=this.managedFramebuffers;this.managedFramebuffers=[];for(var n=0;n=An.WEBGL2&&(e=r.getContext("webgl2",{})),e||(e=r.getContext("webgl",{})||r.getContext("experimental-webgl",{}),e?e.getExtension("WEBGL_draw_buffers"):e=null),si=e}return si}var Zi;function a0(){if(!Zi){Zi=jt.MEDIUM;var r=s0();if(r&&r.getShaderPrecisionFormat){var e=r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.HIGH_FLOAT);Zi=e.precision?jt.HIGH:jt.MEDIUM}}return Zi}function kf(r,e,t){if(r.substring(0,9)!=="precision"){var n=e;return e===jt.HIGH&&t!==jt.HIGH&&(n=jt.MEDIUM),"precision "+n+` float; -`+r}else if(t!==jt.HIGH&&r.substring(0,15)==="precision highp")return r.replace("precision highp","precision mediump");return r}var l0={float:1,vec2:2,vec3:3,vec4:4,int:1,ivec2:2,ivec3:3,ivec4:4,uint:1,uvec2:2,uvec3:3,uvec4:4,bool:1,bvec2:2,bvec3:3,bvec4:4,mat2:4,mat3:9,mat4:16,sampler2D:1};function hp(r){return l0[r]}var Ji=null,Pf={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"};function dp(r,e){if(!Ji){var t=Object.keys(Pf);Ji={};for(var n=0;n0&&(e+=` -else `),t"u"?.5:t,this.isSimple=!1}return Object.defineProperty(r.prototype,"texture",{get:function(){return this._texture},set:function(e){this._texture=e,this._textureID=-1},enumerable:!1,configurable:!0}),r.prototype.multiplyUvs=function(e,t){t===void 0&&(t=e);for(var n=this.mapCoord,i=0;i0?this.maskStack[this.maskStack.length-1]._colorMask:15;n!==t&&this.renderer.gl.colorMask((n&1)!==0,(n&2)!==0,(n&4)!==0,(n&8)!==0)},r.prototype.destroy=function(){this.renderer=null},r}(),mp=function(){function r(e){this.renderer=e,this.maskStack=[],this.glConst=0}return r.prototype.getStackLength=function(){return this.maskStack.length},r.prototype.setMaskStack=function(e){var t=this.renderer.gl,n=this.getStackLength();this.maskStack=e;var i=this.getStackLength();i!==n&&(i===0?t.disable(this.glConst):(t.enable(this.glConst),this._useCurrent()))},r.prototype._useCurrent=function(){},r.prototype.destroy=function(){this.renderer=null,this.maskStack=null},r}(),Of=new Ct,Ff=[],A0=function(r){Qe(e,r);function e(t){var n=r.call(this,t)||this;return n.glConst=Se.ADAPTER.getWebGLRenderingContext().SCISSOR_TEST,n}return e.prototype.getStackLength=function(){var t=this.maskStack[this.maskStack.length-1];return t?t._scissorCounter:0},e.prototype.calcScissorRect=function(t){var n;if(!t._scissorRectLocal){var i=t._scissorRect,o=t.maskObject,s=this.renderer,a=s.renderTexture,l=o.getBounds(!0,(n=Ff.pop())!==null&&n!==void 0?n:new mt);this.roundFrameToPixels(l,a.current?a.current.resolution:s.resolution,a.sourceFrame,a.destinationFrame,s.projection.transform),i&&l.fit(i),t._scissorRectLocal=l}},e.isMatrixRotated=function(t){if(!t)return!1;var n=t.a,i=t.b,o=t.c,s=t.d;return(Math.abs(i)>1e-4||Math.abs(o)>1e-4)&&(Math.abs(n)>1e-4||Math.abs(s)>1e-4)},e.prototype.testScissor=function(t){var n=t.maskObject;if(!n.isFastRect||!n.isFastRect()||e.isMatrixRotated(n.worldTransform)||e.isMatrixRotated(this.renderer.projection.transform))return!1;this.calcScissorRect(t);var i=t._scissorRectLocal;return i.width>0&&i.height>0},e.prototype.roundFrameToPixels=function(t,n,i,o,s){e.isMatrixRotated(s)||(s=s?Of.copyFrom(s):Of.identity(),s.translate(-i.x,-i.y).scale(o.width/i.width,o.height/i.height).translate(o.x,o.y),this.renderer.filter.transformAABB(s,t),t.fit(o),t.x=Math.round(t.x*n),t.y=Math.round(t.y*n),t.width=Math.round(t.width*n),t.height=Math.round(t.height*n))},e.prototype.push=function(t){t._scissorRectLocal||this.calcScissorRect(t);var n=this.renderer.gl;t._scissorRect||n.enable(n.SCISSOR_TEST),t._scissorCounter++,t._scissorRect=t._scissorRectLocal,this._useCurrent()},e.prototype.pop=function(t){var n=this.renderer.gl;t&&Ff.push(t._scissorRectLocal),this.getStackLength()>0?this._useCurrent():n.disable(n.SCISSOR_TEST)},e.prototype._useCurrent=function(){var t=this.maskStack[this.maskStack.length-1]._scissorRect,n;this.renderer.renderTexture.current?n=t.y:n=this.renderer.height-t.height-t.y,this.renderer.gl.scissor(t.x,n,t.width,t.height)},e}(mp),C0=function(r){Qe(e,r);function e(t){var n=r.call(this,t)||this;return n.glConst=Se.ADAPTER.getWebGLRenderingContext().STENCIL_TEST,n}return e.prototype.getStackLength=function(){var t=this.maskStack[this.maskStack.length-1];return t?t._stencilCounter:0},e.prototype.push=function(t){var n=t.maskObject,i=this.renderer.gl,o=t._stencilCounter;o===0&&(this.renderer.framebuffer.forceStencil(),i.clearStencil(0),i.clear(i.STENCIL_BUFFER_BIT),i.enable(i.STENCIL_TEST)),t._stencilCounter++;var s=t._colorMask;s!==0&&(t._colorMask=0,i.colorMask(!1,!1,!1,!1)),i.stencilFunc(i.EQUAL,o,4294967295),i.stencilOp(i.KEEP,i.KEEP,i.INCR),n.renderable=!0,n.render(this.renderer),this.renderer.batch.flush(),n.renderable=!1,s!==0&&(t._colorMask=s,i.colorMask((s&1)!==0,(s&2)!==0,(s&4)!==0,(s&8)!==0)),this._useCurrent()},e.prototype.pop=function(t){var n=this.renderer.gl;if(this.getStackLength()===0)n.disable(n.STENCIL_TEST);else{var i=this.maskStack.length!==0?this.maskStack[this.maskStack.length-1]:null,o=i?i._colorMask:15;o!==0&&(i._colorMask=0,n.colorMask(!1,!1,!1,!1)),n.stencilOp(n.KEEP,n.KEEP,n.DECR),t.renderable=!0,t.render(this.renderer),this.renderer.batch.flush(),t.renderable=!1,o!==0&&(i._colorMask=o,n.colorMask((o&1)!==0,(o&2)!==0,(o&4)!==0,(o&8)!==0)),this._useCurrent()}},e.prototype._useCurrent=function(){var t=this.renderer.gl;t.stencilFunc(t.EQUAL,this.getStackLength(),4294967295),t.stencilOp(t.KEEP,t.KEEP,t.KEEP)},e}(mp),I0=function(){function r(e){this.renderer=e,this.destinationFrame=null,this.sourceFrame=null,this.defaultFrame=null,this.projectionMatrix=new Ct,this.transform=null}return r.prototype.update=function(e,t,n,i){this.destinationFrame=e||this.destinationFrame||this.defaultFrame,this.sourceFrame=t||this.sourceFrame||e,this.calculateProjection(this.destinationFrame,this.sourceFrame,n,i),this.transform&&this.projectionMatrix.append(this.transform);var o=this.renderer;o.globalUniforms.uniforms.projectionMatrix=this.projectionMatrix,o.globalUniforms.update(),o.shader.shader&&o.shader.syncUniformGroup(o.shader.shader.uniforms.globals)},r.prototype.calculateProjection=function(e,t,n,i){var o=this.projectionMatrix,s=i?-1:1;o.identity(),o.a=1/t.width*2,o.d=s*(1/t.height*2),o.tx=-1-t.x*o.a,o.ty=-s-t.y*o.d},r.prototype.setTransform=function(e){},r.prototype.destroy=function(){this.renderer=null},r}(),Kn=new mt,li=new mt,M0=function(){function r(e){this.renderer=e,this.clearColor=e._backgroundColorRgba,this.defaultMaskStack=[],this.current=null,this.sourceFrame=new mt,this.destinationFrame=new mt,this.viewportFrame=new mt}return r.prototype.bind=function(e,t,n){e===void 0&&(e=null);var i=this.renderer;this.current=e;var o,s,a;e?(o=e.baseTexture,a=o.resolution,t||(Kn.width=e.frame.width,Kn.height=e.frame.height,t=Kn),n||(li.x=e.frame.x,li.y=e.frame.y,li.width=t.width,li.height=t.height,n=li),s=o.framebuffer):(a=i.resolution,t||(Kn.width=i.screen.width,Kn.height=i.screen.height,t=Kn),n||(n=Kn,n.width=t.width,n.height=t.height));var l=this.viewportFrame;l.x=n.x*a,l.y=n.y*a,l.width=n.width*a,l.height=n.height*a,e||(l.y=i.view.height-(l.y+l.height)),l.ceil(),this.renderer.framebuffer.bind(s,l),this.renderer.projection.update(n,t,a,!s),e?this.renderer.mask.setMaskStack(o.maskStack):this.renderer.mask.setMaskStack(this.defaultMaskStack),this.sourceFrame.copyFrom(t),this.destinationFrame.copyFrom(n)},r.prototype.clear=function(e,t){this.current?e=e||this.current.baseTexture.clearColor:e=e||this.clearColor;var n=this.destinationFrame,i=this.current?this.current.baseTexture:this.renderer.screen,o=n.width!==i.width||n.height!==i.height;if(o){var s=this.viewportFrame,a=s.x,l=s.y,u=s.width,c=s.height;a=Math.round(a),l=Math.round(l),u=Math.round(u),c=Math.round(c),this.renderer.gl.enable(this.renderer.gl.SCISSOR_TEST),this.renderer.gl.scissor(a,l,u,c)}this.renderer.framebuffer.clear(e[0],e[1],e[2],e[3],t),o&&this.renderer.scissor.pop()},r.prototype.resize=function(){this.bind(null)},r.prototype.reset=function(){this.bind(null)},r.prototype.destroy=function(){this.renderer=null},r}();function k0(r,e,t,n,i){t.buffer.update(i)}var P0={float:` - data[offset] = v; - `,vec2:` - data[offset] = v[0]; - data[offset+1] = v[1]; - `,vec3:` - data[offset] = v[0]; - data[offset+1] = v[1]; - data[offset+2] = v[2]; - - `,vec4:` - data[offset] = v[0]; - data[offset+1] = v[1]; - data[offset+2] = v[2]; - data[offset+3] = v[3]; - `,mat2:` - data[offset] = v[0]; - data[offset+1] = v[1]; - - data[offset+4] = v[2]; - data[offset+5] = v[3]; - `,mat3:` - data[offset] = v[0]; - data[offset+1] = v[1]; - data[offset+2] = v[2]; - - data[offset + 4] = v[3]; - data[offset + 5] = v[4]; - data[offset + 6] = v[5]; - - data[offset + 8] = v[6]; - data[offset + 9] = v[7]; - data[offset + 10] = v[8]; - `,mat4:` - for(var i = 0; i < 16; i++) - { - data[offset + i] = v[i]; - } - `},gp={float:4,vec2:8,vec3:12,vec4:16,int:4,ivec2:8,ivec3:12,ivec4:16,uint:4,uvec2:8,uvec3:12,uvec4:16,bool:4,bvec2:8,bvec3:12,bvec4:16,mat2:16*2,mat3:16*3,mat4:16*4};function R0(r){for(var e=r.map(function(l){return{data:l,offset:0,dataLen:0,dirty:0}}),t=0,n=0,i=0,o=0;o1&&(t=Math.max(t,16)*s.data.size),s.dataLen=t,n%t!==0&&n<16){var a=n%t%16;n+=a,i+=a}n+t>16?(i=Math.ceil(i/16)*16,s.offset=i,i+=t,n=t):(s.offset=i,n+=t,i+=t)}return i=Math.ceil(i/16)*16,{uboElements:e,size:i}}function O0(r,e){var t=[];for(var n in r)e[n]&&t.push(e[n]);return t.sort(function(i,o){return i.index-o.index}),t}function F0(r,e){if(!r.autoManage)return{size:0,syncFunc:k0};for(var t=O0(r.uniforms,e),n=R0(t),i=n.uboElements,o=n.size,s=[` - var v = null; - var v2 = null; - var cv = null; - var t = 0; - var gl = renderer.gl - var index = 0; - var data = buffer.data; - `],a=0;a1){var g=hp(l.data.type),v=Math.max(gp[l.data.type]/16,1),p=g/v,m=(4-p%4)%4;s.push(` - cv = ud.`+c+`.value; - v = uv.`+c+`; - offset = `+l.offset/4+`; - - t = 0; - - for(var i=0; i < `+l.data.size*v+`; i++) - { - for(var j = 0; j < `+p+`; j++) - { - data[offset++] = v[t++]; - } - offset += `+m+`; - } - - `)}else{var y=P0[l.data.type];s.push(` - cv = ud.`+c+`.value; - v = uv.`+c+`; - offset = `+l.offset/4+`; - `+y+`; - `)}}return s.push(` - renderer.buffer.update(buffer); - `),{size:o,syncFunc:new Function("ud","uv","renderer","syncData","buffer",s.join(` -`))}}var L0=function(){function r(e,t){this.program=e,this.uniformData=t,this.uniformGroups={},this.uniformDirtyGroups={},this.uniformBufferBindings={}}return r.prototype.destroy=function(){this.uniformData=null,this.uniformGroups=null,this.uniformDirtyGroups=null,this.uniformBufferBindings=null,this.program=null},r}();function N0(r,e){for(var t={},n=e.getProgramParameter(r,e.ACTIVE_ATTRIBUTES),i=0;if?1:-1});for(var s=0;s>1,n++;this.stateId=e.data}for(var n=0;nthis.checkCountMax&&(this.checkCount=0,this.run())))},r.prototype.run=function(){for(var e=this.renderer.texture,t=e.managedTextures,n=!1,i=0;ithis.maxIdle&&(e.destroyTexture(o,!0),t[i]=null,n=!0)}if(n){for(var s=0,i=0;i=0;i--)this.unload(e.children[i])},r.prototype.destroy=function(){this.renderer=null},r}();function K0(r){var e,t,n,i,o,s,a,l,u,c,f,d,h,g,v,p,m,y,_,C,b,x,w;return"WebGL2RenderingContext"in globalThis&&r instanceof globalThis.WebGL2RenderingContext?w=(e={},e[$e.UNSIGNED_BYTE]=(t={},t[Te.RGBA]=r.RGBA8,t[Te.RGB]=r.RGB8,t[Te.RG]=r.RG8,t[Te.RED]=r.R8,t[Te.RGBA_INTEGER]=r.RGBA8UI,t[Te.RGB_INTEGER]=r.RGB8UI,t[Te.RG_INTEGER]=r.RG8UI,t[Te.RED_INTEGER]=r.R8UI,t[Te.ALPHA]=r.ALPHA,t[Te.LUMINANCE]=r.LUMINANCE,t[Te.LUMINANCE_ALPHA]=r.LUMINANCE_ALPHA,t),e[$e.BYTE]=(n={},n[Te.RGBA]=r.RGBA8_SNORM,n[Te.RGB]=r.RGB8_SNORM,n[Te.RG]=r.RG8_SNORM,n[Te.RED]=r.R8_SNORM,n[Te.RGBA_INTEGER]=r.RGBA8I,n[Te.RGB_INTEGER]=r.RGB8I,n[Te.RG_INTEGER]=r.RG8I,n[Te.RED_INTEGER]=r.R8I,n),e[$e.UNSIGNED_SHORT]=(i={},i[Te.RGBA_INTEGER]=r.RGBA16UI,i[Te.RGB_INTEGER]=r.RGB16UI,i[Te.RG_INTEGER]=r.RG16UI,i[Te.RED_INTEGER]=r.R16UI,i[Te.DEPTH_COMPONENT]=r.DEPTH_COMPONENT16,i),e[$e.SHORT]=(o={},o[Te.RGBA_INTEGER]=r.RGBA16I,o[Te.RGB_INTEGER]=r.RGB16I,o[Te.RG_INTEGER]=r.RG16I,o[Te.RED_INTEGER]=r.R16I,o),e[$e.UNSIGNED_INT]=(s={},s[Te.RGBA_INTEGER]=r.RGBA32UI,s[Te.RGB_INTEGER]=r.RGB32UI,s[Te.RG_INTEGER]=r.RG32UI,s[Te.RED_INTEGER]=r.R32UI,s[Te.DEPTH_COMPONENT]=r.DEPTH_COMPONENT24,s),e[$e.INT]=(a={},a[Te.RGBA_INTEGER]=r.RGBA32I,a[Te.RGB_INTEGER]=r.RGB32I,a[Te.RG_INTEGER]=r.RG32I,a[Te.RED_INTEGER]=r.R32I,a),e[$e.FLOAT]=(l={},l[Te.RGBA]=r.RGBA32F,l[Te.RGB]=r.RGB32F,l[Te.RG]=r.RG32F,l[Te.RED]=r.R32F,l[Te.DEPTH_COMPONENT]=r.DEPTH_COMPONENT32F,l),e[$e.HALF_FLOAT]=(u={},u[Te.RGBA]=r.RGBA16F,u[Te.RGB]=r.RGB16F,u[Te.RG]=r.RG16F,u[Te.RED]=r.R16F,u),e[$e.UNSIGNED_SHORT_5_6_5]=(c={},c[Te.RGB]=r.RGB565,c),e[$e.UNSIGNED_SHORT_4_4_4_4]=(f={},f[Te.RGBA]=r.RGBA4,f),e[$e.UNSIGNED_SHORT_5_5_5_1]=(d={},d[Te.RGBA]=r.RGB5_A1,d),e[$e.UNSIGNED_INT_2_10_10_10_REV]=(h={},h[Te.RGBA]=r.RGB10_A2,h[Te.RGBA_INTEGER]=r.RGB10_A2UI,h),e[$e.UNSIGNED_INT_10F_11F_11F_REV]=(g={},g[Te.RGB]=r.R11F_G11F_B10F,g),e[$e.UNSIGNED_INT_5_9_9_9_REV]=(v={},v[Te.RGB]=r.RGB9_E5,v),e[$e.UNSIGNED_INT_24_8]=(p={},p[Te.DEPTH_STENCIL]=r.DEPTH24_STENCIL8,p),e[$e.FLOAT_32_UNSIGNED_INT_24_8_REV]=(m={},m[Te.DEPTH_STENCIL]=r.DEPTH32F_STENCIL8,m),e):w=(y={},y[$e.UNSIGNED_BYTE]=(_={},_[Te.RGBA]=r.RGBA,_[Te.RGB]=r.RGB,_[Te.ALPHA]=r.ALPHA,_[Te.LUMINANCE]=r.LUMINANCE,_[Te.LUMINANCE_ALPHA]=r.LUMINANCE_ALPHA,_),y[$e.UNSIGNED_SHORT_5_6_5]=(C={},C[Te.RGB]=r.RGB,C),y[$e.UNSIGNED_SHORT_4_4_4_4]=(b={},b[Te.RGBA]=r.RGBA,b),y[$e.UNSIGNED_SHORT_5_5_5_1]=(x={},x[Te.RGBA]=r.RGBA,x),y),w}var ha=function(){function r(e){this.texture=e,this.width=-1,this.height=-1,this.dirtyId=-1,this.dirtyStyleId=-1,this.mipmap=!1,this.wrapMode=33071,this.type=$e.UNSIGNED_BYTE,this.internalFormat=Te.RGBA,this.samplerType=0}return r}(),Z0=function(){function r(e){this.renderer=e,this.boundTextures=[],this.currentLocation=-1,this.managedTextures=[],this._unknownBoundTextures=!1,this.unknownTexture=new xt,this.hasIntegerTextures=!1}return r.prototype.contextChange=function(){var e=this.gl=this.renderer.gl;this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.webGLVersion=this.renderer.context.webGLVersion,this.internalFormats=K0(e);var t=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS);this.boundTextures.length=t;for(var n=0;n=0;--s){var a=n[s];if(a){var l=a._glTextures[o];l.samplerType!==Oo.FLOAT&&this.renderer.texture.unbind(a)}}},r.prototype.initTexture=function(e){var t=new ha(this.gl.createTexture());return t.dirtyId=-1,e._glTextures[this.CONTEXT_UID]=t,this.managedTextures.push(e),e.on("dispose",this.destroyTexture,this),t},r.prototype.initTextureType=function(e,t){var n,i;t.internalFormat=(i=(n=this.internalFormats[e.type])===null||n===void 0?void 0:n[e.format])!==null&&i!==void 0?i:e.format,this.webGLVersion===2&&e.type===$e.HALF_FLOAT?t.type=this.gl.HALF_FLOAT:t.type=e.type},r.prototype.updateTexture=function(e){var t=e._glTextures[this.CONTEXT_UID];if(t){var n=this.renderer;if(this.initTextureType(e,t),e.resource&&e.resource.upload(n,e,t))t.samplerType!==Oo.FLOAT&&(this.hasIntegerTextures=!0);else{var i=e.realWidth,o=e.realHeight,s=n.gl;(t.width!==i||t.height!==o||t.dirtyId<0)&&(t.width=i,t.height=o,s.texImage2D(e.target,0,t.internalFormat,i,o,0,e.format,t.type,null))}e.dirtyStyleId!==t.dirtyStyleId&&this.updateTextureStyle(e),t.dirtyId=e.dirtyId}},r.prototype.destroyTexture=function(e,t){var n=this.gl;if(e=e.castToBaseTexture(),e._glTextures[this.CONTEXT_UID]&&(this.unbind(e),n.deleteTexture(e._glTextures[this.CONTEXT_UID].texture),e.off("dispose",this.destroyTexture,this),delete e._glTextures[this.CONTEXT_UID],!t)){var i=this.managedTextures.indexOf(e);i!==-1&&To(this.managedTextures,i,1)}},r.prototype.updateTextureStyle=function(e){var t=e._glTextures[this.CONTEXT_UID];t&&((e.mipmap===dn.POW2||this.webGLVersion!==2)&&!e.isPowerOfTwo?t.mipmap=!1:t.mipmap=e.mipmap>=1,this.webGLVersion!==2&&!e.isPowerOfTwo?t.wrapMode=Fo.CLAMP:t.wrapMode=e.wrapMode,e.resource&&e.resource.style(this.renderer,e,t)||this.setStyle(e,t),t.dirtyStyleId=e.dirtyStyleId)},r.prototype.setStyle=function(e,t){var n=this.gl;if(t.mipmap&&e.mipmap!==dn.ON_MANUAL&&n.generateMipmap(e.target),n.texParameteri(e.target,n.TEXTURE_WRAP_S,t.wrapMode),n.texParameteri(e.target,n.TEXTURE_WRAP_T,t.wrapMode),t.mipmap){n.texParameteri(e.target,n.TEXTURE_MIN_FILTER,e.scaleMode===zt.LINEAR?n.LINEAR_MIPMAP_LINEAR:n.NEAREST_MIPMAP_NEAREST);var i=this.renderer.context.extensions.anisotropicFiltering;if(i&&e.anisotropicLevel>0&&e.scaleMode===zt.LINEAR){var o=Math.min(e.anisotropicLevel,n.getParameter(i.MAX_TEXTURE_MAX_ANISOTROPY_EXT));n.texParameterf(e.target,i.TEXTURE_MAX_ANISOTROPY_EXT,o)}}else n.texParameteri(e.target,n.TEXTURE_MIN_FILTER,e.scaleMode===zt.LINEAR?n.LINEAR:n.NEAREST);n.texParameteri(e.target,n.TEXTURE_MAG_FILTER,e.scaleMode===zt.LINEAR?n.LINEAR:n.NEAREST)},r.prototype.destroy=function(){this.renderer=null},r}(),da=new Ct,J0=function(r){Qe(e,r);function e(t,n){t===void 0&&(t=Mi.UNKNOWN);var i=r.call(this)||this;return n=Object.assign({},Se.RENDER_OPTIONS,n),i.options=n,i.type=t,i.screen=new mt(0,0,n.width,n.height),i.view=n.view||Se.ADAPTER.createCanvas(),i.resolution=n.resolution||Se.RESOLUTION,i.useContextAlpha=n.useContextAlpha,i.autoDensity=!!n.autoDensity,i.preserveDrawingBuffer=n.preserveDrawingBuffer,i.clearBeforeRender=n.clearBeforeRender,i._backgroundColor=0,i._backgroundColorRgba=[0,0,0,1],i._backgroundColorString="#000000",i.backgroundColor=n.backgroundColor||i._backgroundColor,i.backgroundAlpha=n.backgroundAlpha,n.transparent!==void 0&&(pr("6.0.0","Option transparent is deprecated, please use backgroundAlpha instead."),i.useContextAlpha=n.transparent,i.backgroundAlpha=n.transparent?0:1),i._lastObjectRendered=null,i.plugins={},i}return e.prototype.initPlugins=function(t){for(var n in t)this.plugins[n]=new t[n](this)},Object.defineProperty(e.prototype,"width",{get:function(){return this.view.width},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this.view.height},enumerable:!1,configurable:!0}),e.prototype.resize=function(t,n){this.view.width=Math.round(t*this.resolution),this.view.height=Math.round(n*this.resolution);var i=this.view.width/this.resolution,o=this.view.height/this.resolution;this.screen.width=i,this.screen.height=o,this.autoDensity&&(this.view.style.width=i+"px",this.view.style.height=o+"px"),this.emit("resize",i,o)},e.prototype.generateTexture=function(t,n,i,o){n===void 0&&(n={}),typeof n=="number"&&(pr("6.1.0","generateTexture options (scaleMode, resolution, region) are now object options."),n={scaleMode:n,resolution:i,region:o});var s=n.region,a=Ry(n,["region"]);o=s||t.getLocalBounds(null,!0),o.width===0&&(o.width=1),o.height===0&&(o.height=1);var l=Tu.create(il({width:o.width,height:o.height},a));return da.tx=-o.x,da.ty=-o.y,this.render(t,{renderTexture:l,clear:!1,transform:da,skipUpdateTransform:!!t.parent}),l},e.prototype.destroy=function(t){for(var n in this.plugins)this.plugins[n].destroy(),this.plugins[n]=null;t&&this.view.parentNode&&this.view.parentNode.removeChild(this.view);var i=this;i.plugins=null,i.type=Mi.UNKNOWN,i.view=null,i.screen=null,i._tempDisplayObjectParent=null,i.options=null,this._backgroundColorRgba=null,this._backgroundColorString=null,this._lastObjectRendered=null},Object.defineProperty(e.prototype,"backgroundColor",{get:function(){return this._backgroundColor},set:function(t){this._backgroundColor=t,this._backgroundColorString=wy(t),tn(t,this._backgroundColorRgba)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"backgroundAlpha",{get:function(){return this._backgroundColorRgba[3]},set:function(t){this._backgroundColorRgba[3]=t},enumerable:!1,configurable:!0}),e}(br),Q0=function(){function r(e){this.buffer=e||null,this.updateID=-1,this.byteLength=-1,this.refCount=0}return r}(),e_=function(){function r(e){this.renderer=e,this.managedBuffers={},this.boundBufferBases={}}return r.prototype.destroy=function(){this.renderer=null},r.prototype.contextChange=function(){this.disposeAll(!0),this.gl=this.renderer.gl,this.CONTEXT_UID=this.renderer.CONTEXT_UID},r.prototype.bind=function(e){var t=this,n=t.gl,i=t.CONTEXT_UID,o=e._glBuffers[i]||this.createGLBuffer(e);n.bindBuffer(e.type,o.buffer)},r.prototype.bindBufferBase=function(e,t){var n=this,i=n.gl,o=n.CONTEXT_UID;if(this.boundBufferBases[t]!==e){var s=e._glBuffers[o]||this.createGLBuffer(e);this.boundBufferBases[t]=e,i.bindBufferBase(i.UNIFORM_BUFFER,t,s.buffer)}},r.prototype.bindBufferRange=function(e,t,n){var i=this,o=i.gl,s=i.CONTEXT_UID;n=n||0;var a=e._glBuffers[s]||this.createGLBuffer(e);o.bindBufferRange(o.UNIFORM_BUFFER,t||0,a.buffer,n*256,256)},r.prototype.update=function(e){var t=this,n=t.gl,i=t.CONTEXT_UID,o=e._glBuffers[i];if(e._updateID!==o.updateID)if(o.updateID=e._updateID,n.bindBuffer(e.type,o.buffer),o.byteLength>=e.data.byteLength)n.bufferSubData(e.type,0,e.data);else{var s=e.static?n.STATIC_DRAW:n.DYNAMIC_DRAW;o.byteLength=e.data.byteLength,n.bufferData(e.type,e.data,s)}},r.prototype.dispose=function(e,t){if(this.managedBuffers[e.id]){delete this.managedBuffers[e.id];var n=e._glBuffers[this.CONTEXT_UID],i=this.gl;e.disposeRunner.remove(this),n&&(t||i.deleteBuffer(n.buffer),delete e._glBuffers[this.CONTEXT_UID])}},r.prototype.disposeAll=function(e){for(var t=Object.keys(this.managedBuffers),n=0;n=pt.HIGH?this.multisample=pt.HIGH:n>=pt.MEDIUM?this.multisample=pt.MEDIUM:n>=pt.LOW?this.multisample=pt.LOW:this.multisample=pt.NONE},e.prototype.addSystem=function(t,n){var i=new t(this);if(this[n])throw new Error('Whoops! The name "'+n+'" is already in use');this[n]=i;for(var o in this.runners)this.runners[o].add(i);return this},e.prototype.render=function(t,n){var i,o,s,a;if(n&&(n instanceof Tu?(pr("6.0.0","Renderer#render arguments changed, use options instead."),i=n,o=arguments[2],s=arguments[3],a=arguments[4]):(i=n.renderTexture,o=n.clear,s=n.transform,a=n.skipUpdateTransform)),this.renderingToScreen=!i,this.runners.prerender.emit(),this.emit("prerender"),this.projection.transform=s,!this.context.isLost){if(i||(this._lastObjectRendered=t),!a){var l=t.enableTempParent();t.updateTransform(),t.disableTempParent(l)}this.renderTexture.bind(i),this.batch.currentRenderer.start(),(o!==void 0?o:this.clearBeforeRender)&&this.renderTexture.clear(),t.render(this),this.batch.currentRenderer.flush(),i&&i.baseTexture.update(),this.runners.postrender.emit(),this.projection.transform=null,this.emit("postrender")}},e.prototype.generateTexture=function(t,n,i,o){n===void 0&&(n={});var s=r.prototype.generateTexture.call(this,t,n,i,o);return this.framebuffer.blit(),s},e.prototype.resize=function(t,n){r.prototype.resize.call(this,t,n),this.runners.resize.emit(this.screen.height,this.screen.width)},e.prototype.reset=function(){return this.runners.reset.emit(),this},e.prototype.clear=function(){this.renderTexture.bind(),this.renderTexture.clear()},e.prototype.destroy=function(t){this.runners.destroy.emit();for(var n in this.runners)this.runners[n].destroy();r.prototype.destroy.call(this,t),this.gl=null},Object.defineProperty(e.prototype,"extract",{get:function(){return pr("6.0.0","Renderer#extract has been deprecated, please use Renderer#plugins.extract instead."),this.plugins.extract},enumerable:!1,configurable:!0}),e.registerPlugin=function(t,n){pr("6.5.0","Renderer.registerPlugin() has been deprecated, please use extensions.add() instead."),ni.add({name:t,type:pn.RendererPlugin,ref:n})},e.__plugins={},e}(J0);ni.handleByMap(pn.RendererPlugin,vp.__plugins);function t_(r){return vp.create(r)}var n_=`attribute vec2 aVertexPosition; -attribute vec2 aTextureCoord; - -uniform mat3 projectionMatrix; - -varying vec2 vTextureCoord; - -void main(void) -{ - gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0); - vTextureCoord = aTextureCoord; -}`,r_=n_,i_=function(){function r(){this.texArray=null,this.blend=0,this.type=ki.TRIANGLES,this.start=0,this.size=0,this.data=null}return r}(),o_=function(){function r(){this.elements=[],this.ids=[],this.count=0}return r.prototype.clear=function(){for(var e=0;ethis.size&&this.flush(),this._vertexCount+=t.vertexData.length/2,this._indexCount+=t.indices.length,this._bufferedTextures[this._bufferSize]=t._texture.baseTexture,this._bufferedElements[this._bufferSize++]=t)},e.prototype.buildTexturesAndDrawCalls=function(){var t=this,n=t._bufferedTextures,i=t.MAX_TEXTURES,o=e._textureArrayPool,s=this.renderer.batch,a=this._tempBoundTextures,l=this.renderer.textureGC.count,u=++xt._globalBatch,c=0,f=o[0],d=0;s.copyBoundTextures(a,i);for(var h=0;h=i&&(s.boundArray(f,a,u,i),this.buildDrawCalls(f,d,h),d=h,f=o[++c],++u),g._batchEnabled=u,g.touched=l,f.elements[f.count++]=g)}f.count>0&&(s.boundArray(f,a,u,i),this.buildDrawCalls(f,d,this._bufferSize),++c,++u);for(var h=0;h0&&(t+=` -else `),nthis.maxX||this.minY>this.maxY},r.prototype.clear=function(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0},r.prototype.getRectangle=function(e){return this.minX>this.maxX||this.minY>this.maxY?mt.EMPTY:(e=e||new mt(0,0,1,1),e.x=this.minX,e.y=this.minY,e.width=this.maxX-this.minX,e.height=this.maxY-this.minY,e)},r.prototype.addPoint=function(e){this.minX=Math.min(this.minX,e.x),this.maxX=Math.max(this.maxX,e.x),this.minY=Math.min(this.minY,e.y),this.maxY=Math.max(this.maxY,e.y)},r.prototype.addPointMatrix=function(e,t){var n=e.a,i=e.b,o=e.c,s=e.d,a=e.tx,l=e.ty,u=n*t.x+o*t.y+a,c=i*t.x+s*t.y+l;this.minX=Math.min(this.minX,u),this.maxX=Math.max(this.maxX,u),this.minY=Math.min(this.minY,c),this.maxY=Math.max(this.maxY,c)},r.prototype.addQuad=function(e){var t=this.minX,n=this.minY,i=this.maxX,o=this.maxY,s=e[0],a=e[1];t=si?s:i,o=a>o?a:o,s=e[2],a=e[3],t=si?s:i,o=a>o?a:o,s=e[4],a=e[5],t=si?s:i,o=a>o?a:o,s=e[6],a=e[7],t=si?s:i,o=a>o?a:o,this.minX=t,this.minY=n,this.maxX=i,this.maxY=o},r.prototype.addFrame=function(e,t,n,i,o){this.addFrameMatrix(e.worldTransform,t,n,i,o)},r.prototype.addFrameMatrix=function(e,t,n,i,o){var s=e.a,a=e.b,l=e.c,u=e.d,c=e.tx,f=e.ty,d=this.minX,h=this.minY,g=this.maxX,v=this.maxY,p=s*t+l*n+c,m=a*t+u*n+f;d=pg?p:g,v=m>v?m:v,p=s*i+l*n+c,m=a*i+u*n+f,d=pg?p:g,v=m>v?m:v,p=s*t+l*o+c,m=a*t+u*o+f,d=pg?p:g,v=m>v?m:v,p=s*i+l*o+c,m=a*i+u*o+f,d=pg?p:g,v=m>v?m:v,this.minX=d,this.minY=h,this.maxX=g,this.maxY=v},r.prototype.addVertexData=function(e,t,n){for(var i=this.minX,o=this.minY,s=this.maxX,a=this.maxY,l=t;ls?u:s,a=c>a?c:a}this.minX=i,this.minY=o,this.maxX=s,this.maxY=a},r.prototype.addVertices=function(e,t,n,i){this.addVerticesMatrix(e.worldTransform,t,n,i)},r.prototype.addVerticesMatrix=function(e,t,n,i,o,s){o===void 0&&(o=0),s===void 0&&(s=o);for(var a=e.a,l=e.b,u=e.c,c=e.d,f=e.tx,d=e.ty,h=this.minX,g=this.minY,v=this.maxX,p=this.maxY,m=n;mi?e.maxX:i,this.maxY=e.maxY>o?e.maxY:o},r.prototype.addBoundsMask=function(e,t){var n=e.minX>t.minX?e.minX:t.minX,i=e.minY>t.minY?e.minY:t.minY,o=e.maxXu?o:u,this.maxY=s>c?s:c}},r.prototype.addBoundsMatrix=function(e,t){this.addFrameMatrix(t,e.minX,e.minY,e.maxX,e.maxY)},r.prototype.addBoundsArea=function(e,t){var n=e.minX>t.x?e.minX:t.x,i=e.minY>t.y?e.minY:t.y,o=e.maxXu?o:u,this.maxY=s>c?s:c}},r.prototype.pad=function(e,t){e===void 0&&(e=0),t===void 0&&(t=e),this.isEmpty()||(this.minX-=e,this.maxX+=e,this.minY-=t,this.maxY+=t)},r.prototype.addFramePad=function(e,t,n,i,o,s){e-=o,t-=s,n+=o,i+=s,this.minX=this.minXn?this.maxX:n,this.minY=this.minYi?this.maxY:i},r}();/*! ***************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */var sl=function(r,e){return sl=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)n.hasOwnProperty(i)&&(t[i]=n[i])},sl(r,e)};function Cu(r,e){sl(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var Do=function(r){Cu(e,r);function e(){var t=r.call(this)||this;return t.tempDisplayObjectParent=null,t.transform=new rp,t.alpha=1,t.visible=!0,t.renderable=!0,t.cullable=!1,t.cullArea=null,t.parent=null,t.worldAlpha=1,t._lastSortedIndex=0,t._zIndex=0,t.filterArea=null,t.filters=null,t._enabledFilters=null,t._bounds=new Df,t._localBounds=null,t._boundsID=0,t._boundsRect=null,t._localBoundsRect=null,t._mask=null,t._maskRefCount=0,t._destroyed=!1,t.isSprite=!1,t.isMask=!1,t}return e.mixin=function(t){for(var n=Object.keys(t),i=0;i1)for(var o=0;othis.children.length)throw new Error(t+"addChildAt: The index "+n+" supplied is out of bounds "+this.children.length);return t.parent&&t.parent.removeChild(t),t.parent=this,this.sortDirty=!0,t.transform._parentID=-1,this.children.splice(n,0,t),this._boundsID++,this.onChildrenChange(n),t.emit("added",this),this.emit("childAdded",t,this,n),t},e.prototype.swapChildren=function(t,n){if(t!==n){var i=this.getChildIndex(t),o=this.getChildIndex(n);this.children[i]=n,this.children[o]=t,this.onChildrenChange(i=this.children.length)throw new Error("The index "+n+" supplied is out of bounds "+this.children.length);var i=this.getChildIndex(t);To(this.children,i,1),this.children.splice(n,0,t),this.onChildrenChange(n)},e.prototype.getChildAt=function(t){if(t<0||t>=this.children.length)throw new Error("getChildAt: Index ("+t+") does not exist.");return this.children[t]},e.prototype.removeChild=function(){for(var t=arguments,n=[],i=0;i1)for(var o=0;o0&&s<=o){a=this.children.splice(i,s);for(var l=0;l1&&this.children.sort(d_),this.sortDirty=!1},e.prototype.updateTransform=function(){this.sortableChildren&&this.sortDirty&&this.sortChildren(),this._boundsID++,this.transform.updateTransform(this.parent.transform),this.worldAlpha=this.alpha*this.parent.worldAlpha;for(var t=0,n=this.children.length;t0&&n.height>0){var i,o;if(this.cullArea?(i=this.cullArea,o=this.worldTransform):this._render!==e.prototype._render&&(i=this.getBounds(!0)),i&&n.intersects(i,o))this._render(t);else if(this.cullArea)return;for(var s=0,a=this.children.length;s 0.0) { - c.rgb /= c.a; - - vec3 rgb = pow(c.rgb, vec3(1. / gamma)); - rgb = mix(vec3(.5), mix(vec3(dot(vec3(.2125, .7154, .0721), rgb)), rgb, saturation), contrast); - rgb.r *= red; - rgb.g *= green; - rgb.b *= blue; - c.rgb = rgb * brightness; - - c.rgb *= c.a; - } - - gl_FragColor = c * alpha; -} -`;(function(r){m_(e,r);function e(t){var n=r.call(this,g_,v_)||this;return n.gamma=1,n.saturation=1,n.contrast=1,n.brightness=1,n.red=1,n.green=1,n.blue=1,n.alpha=1,Object.assign(n,t),n}return e.prototype.apply=function(t,n,i,o){this.uniforms.gamma=Math.max(this.gamma,1e-4),this.uniforms.saturation=this.saturation,this.uniforms.contrast=this.contrast,this.uniforms.brightness=this.brightness,this.uniforms.red=this.red,this.uniforms.green=this.green,this.uniforms.blue=this.blue,this.uniforms.alpha=this.alpha,t.applyFilter(this,n,i,o)},e})(Be);/*! - * @pixi/filter-kawase-blur - v4.2.0 - * Compiled Fri, 05 Aug 2022 19:53:35 UTC - * - * @pixi/filter-kawase-blur is licensed under the MIT License. - * http://www.opensource.org/licenses/mit-license - *//*! ***************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */var ll=function(r,e){return ll=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])},ll(r,e)};function y_(r,e){ll(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var __=`attribute vec2 aVertexPosition; -attribute vec2 aTextureCoord; - -uniform mat3 projectionMatrix; - -varying vec2 vTextureCoord; - -void main(void) -{ - gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0); - vTextureCoord = aTextureCoord; -}`,x_=` -varying vec2 vTextureCoord; -uniform sampler2D uSampler; - -uniform vec2 uOffset; - -void main(void) -{ - vec4 color = vec4(0.0); - - // Sample top left pixel - color += texture2D(uSampler, vec2(vTextureCoord.x - uOffset.x, vTextureCoord.y + uOffset.y)); - - // Sample top right pixel - color += texture2D(uSampler, vec2(vTextureCoord.x + uOffset.x, vTextureCoord.y + uOffset.y)); - - // Sample bottom right pixel - color += texture2D(uSampler, vec2(vTextureCoord.x + uOffset.x, vTextureCoord.y - uOffset.y)); - - // Sample bottom left pixel - color += texture2D(uSampler, vec2(vTextureCoord.x - uOffset.x, vTextureCoord.y - uOffset.y)); - - // Average - color *= 0.25; - - gl_FragColor = color; -}`,b_=` -varying vec2 vTextureCoord; -uniform sampler2D uSampler; - -uniform vec2 uOffset; -uniform vec4 filterClamp; - -void main(void) -{ - vec4 color = vec4(0.0); - - // Sample top left pixel - color += texture2D(uSampler, clamp(vec2(vTextureCoord.x - uOffset.x, vTextureCoord.y + uOffset.y), filterClamp.xy, filterClamp.zw)); - - // Sample top right pixel - color += texture2D(uSampler, clamp(vec2(vTextureCoord.x + uOffset.x, vTextureCoord.y + uOffset.y), filterClamp.xy, filterClamp.zw)); - - // Sample bottom right pixel - color += texture2D(uSampler, clamp(vec2(vTextureCoord.x + uOffset.x, vTextureCoord.y - uOffset.y), filterClamp.xy, filterClamp.zw)); - - // Sample bottom left pixel - color += texture2D(uSampler, clamp(vec2(vTextureCoord.x - uOffset.x, vTextureCoord.y - uOffset.y), filterClamp.xy, filterClamp.zw)); - - // Average - color *= 0.25; - - gl_FragColor = color; -} -`,Uo=function(r){y_(e,r);function e(t,n,i){t===void 0&&(t=4),n===void 0&&(n=3),i===void 0&&(i=!1);var o=r.call(this,__,i?b_:x_)||this;return o._kernels=[],o._blur=4,o._quality=3,o.uniforms.uOffset=new Float32Array(2),o._pixelSize=new at,o.pixelSize=1,o._clamp=i,Array.isArray(t)?o.kernels=t:(o._blur=t,o.quality=n),o}return e.prototype.apply=function(t,n,i,o){var s=this._pixelSize.x/n._frame.width,a=this._pixelSize.y/n._frame.height,l;if(this._quality===1||this._blur===0)l=this._kernels[0]+.5,this.uniforms.uOffset[0]=l*s,this.uniforms.uOffset[1]=l*a,t.applyFilter(this,n,i,o);else{for(var u=t.getFilterTexture(),c=n,f=u,d=void 0,h=this._quality-1,g=0;g0)for(var o=t,s=t/n,a=1;a0?(this._kernels=t,this._quality=t.length,this._blur=Math.max.apply(Math,t)):(this._kernels=[0],this._quality=1)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"clamp",{get:function(){return this._clamp},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"pixelSize",{get:function(){return this._pixelSize},set:function(t){typeof t=="number"?(this._pixelSize.x=t,this._pixelSize.y=t):Array.isArray(t)?(this._pixelSize.x=t[0],this._pixelSize.y=t[1]):t instanceof at?(this._pixelSize.x=t.x,this._pixelSize.y=t.y):(this._pixelSize.x=1,this._pixelSize.y=1)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"quality",{get:function(){return this._quality},set:function(t){this._quality=Math.max(1,Math.round(t)),this._generateKernels()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"blur",{get:function(){return this._blur},set:function(t){this._blur=t,this._generateKernels()},enumerable:!1,configurable:!0}),e}(Be);/*! - * @pixi/filter-advanced-bloom - v4.2.0 - * Compiled Fri, 05 Aug 2022 19:53:35 UTC - * - * @pixi/filter-advanced-bloom is licensed under the MIT License. - * http://www.opensource.org/licenses/mit-license - *//*! ***************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */var ul=function(r,e){return ul=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])},ul(r,e)};function _p(r,e){ul(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var xp=`attribute vec2 aVertexPosition; -attribute vec2 aTextureCoord; - -uniform mat3 projectionMatrix; - -varying vec2 vTextureCoord; - -void main(void) -{ - gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0); - vTextureCoord = aTextureCoord; -}`,w_=` -uniform sampler2D uSampler; -varying vec2 vTextureCoord; - -uniform float threshold; - -void main() { - vec4 color = texture2D(uSampler, vTextureCoord); - - // A simple & fast algorithm for getting brightness. - // It's inaccuracy , but good enought for this feature. - float _max = max(max(color.r, color.g), color.b); - float _min = min(min(color.r, color.g), color.b); - float brightness = (_max + _min) * 0.5; - - if(brightness > threshold) { - gl_FragColor = color; - } else { - gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0); - } -} -`,T_=function(r){_p(e,r);function e(t){t===void 0&&(t=.5);var n=r.call(this,xp,w_)||this;return n.threshold=t,n}return Object.defineProperty(e.prototype,"threshold",{get:function(){return this.uniforms.threshold},set:function(t){this.uniforms.threshold=t},enumerable:!1,configurable:!0}),e}(Be),S_=`uniform sampler2D uSampler; -varying vec2 vTextureCoord; - -uniform sampler2D bloomTexture; -uniform float bloomScale; -uniform float brightness; - -void main() { - vec4 color = texture2D(uSampler, vTextureCoord); - color.rgb *= brightness; - vec4 bloomColor = vec4(texture2D(bloomTexture, vTextureCoord).rgb, 0.0); - bloomColor.rgb *= bloomScale; - gl_FragColor = color + bloomColor; -} -`;(function(r){_p(e,r);function e(t){var n=r.call(this,xp,S_)||this;n.bloomScale=1,n.brightness=1,n._resolution=Se.FILTER_RESOLUTION,typeof t=="number"&&(t={threshold:t});var i=Object.assign(e.defaults,t);n.bloomScale=i.bloomScale,n.brightness=i.brightness;var o=i.kernels,s=i.blur,a=i.quality,l=i.pixelSize,u=i.resolution;return n._extractFilter=new T_(i.threshold),n._extractFilter.resolution=u,n._blurFilter=o?new Uo(o):new Uo(s,a),n.pixelSize=l,n.resolution=u,n}return e.prototype.apply=function(t,n,i,o,s){var a=t.getFilterTexture();this._extractFilter.apply(t,n,a,1,s);var l=t.getFilterTexture();this._blurFilter.apply(t,a,l,1),this.uniforms.bloomScale=this.bloomScale,this.uniforms.brightness=this.brightness,this.uniforms.bloomTexture=l,t.applyFilter(this,n,i,o),t.returnFilterTexture(l),t.returnFilterTexture(a)},Object.defineProperty(e.prototype,"resolution",{get:function(){return this._resolution},set:function(t){this._resolution=t,this._extractFilter&&(this._extractFilter.resolution=t),this._blurFilter&&(this._blurFilter.resolution=t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"threshold",{get:function(){return this._extractFilter.threshold},set:function(t){this._extractFilter.threshold=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"kernels",{get:function(){return this._blurFilter.kernels},set:function(t){this._blurFilter.kernels=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"blur",{get:function(){return this._blurFilter.blur},set:function(t){this._blurFilter.blur=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"quality",{get:function(){return this._blurFilter.quality},set:function(t){this._blurFilter.quality=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"pixelSize",{get:function(){return this._blurFilter.pixelSize},set:function(t){this._blurFilter.pixelSize=t},enumerable:!1,configurable:!0}),e.defaults={threshold:.5,bloomScale:1,brightness:1,kernels:null,blur:8,quality:4,pixelSize:1,resolution:Se.FILTER_RESOLUTION},e})(Be);/*! - * @pixi/filter-ascii - v4.2.0 - * Compiled Fri, 05 Aug 2022 19:53:35 UTC - * - * @pixi/filter-ascii is licensed under the MIT License. - * http://www.opensource.org/licenses/mit-license - *//*! ***************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */var cl=function(r,e){return cl=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])},cl(r,e)};function E_(r,e){cl(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var A_=`attribute vec2 aVertexPosition; -attribute vec2 aTextureCoord; - -uniform mat3 projectionMatrix; - -varying vec2 vTextureCoord; - -void main(void) -{ - gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0); - vTextureCoord = aTextureCoord; -}`,C_=`varying vec2 vTextureCoord; - -uniform vec4 filterArea; -uniform float pixelSize; -uniform sampler2D uSampler; - -vec2 mapCoord( vec2 coord ) -{ - coord *= filterArea.xy; - coord += filterArea.zw; - - return coord; -} - -vec2 unmapCoord( vec2 coord ) -{ - coord -= filterArea.zw; - coord /= filterArea.xy; - - return coord; -} - -vec2 pixelate(vec2 coord, vec2 size) -{ - return floor( coord / size ) * size; -} - -vec2 getMod(vec2 coord, vec2 size) -{ - return mod( coord , size) / size; -} - -float character(float n, vec2 p) -{ - p = floor(p*vec2(4.0, -4.0) + 2.5); - - if (clamp(p.x, 0.0, 4.0) == p.x) - { - if (clamp(p.y, 0.0, 4.0) == p.y) - { - if (int(mod(n/exp2(p.x + 5.0*p.y), 2.0)) == 1) return 1.0; - } - } - return 0.0; -} - -void main() -{ - vec2 coord = mapCoord(vTextureCoord); - - // get the rounded color.. - vec2 pixCoord = pixelate(coord, vec2(pixelSize)); - pixCoord = unmapCoord(pixCoord); - - vec4 color = texture2D(uSampler, pixCoord); - - // determine the character to use - float gray = (color.r + color.g + color.b) / 3.0; - - float n = 65536.0; // . - if (gray > 0.2) n = 65600.0; // : - if (gray > 0.3) n = 332772.0; // * - if (gray > 0.4) n = 15255086.0; // o - if (gray > 0.5) n = 23385164.0; // & - if (gray > 0.6) n = 15252014.0; // 8 - if (gray > 0.7) n = 13199452.0; // @ - if (gray > 0.8) n = 11512810.0; // # - - // get the mod.. - vec2 modd = getMod(coord, vec2(pixelSize)); - - gl_FragColor = color * character( n, vec2(-1.0) + modd * 2.0); - -} -`;(function(r){E_(e,r);function e(t){t===void 0&&(t=8);var n=r.call(this,A_,C_)||this;return n.size=t,n}return Object.defineProperty(e.prototype,"size",{get:function(){return this.uniforms.pixelSize},set:function(t){this.uniforms.pixelSize=t},enumerable:!1,configurable:!0}),e})(Be);/*! - * @pixi/filter-bevel - v4.2.0 - * Compiled Fri, 05 Aug 2022 19:53:35 UTC - * - * @pixi/filter-bevel is licensed under the MIT License. - * http://www.opensource.org/licenses/mit-license - *//*! ***************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */var fl=function(r,e){return fl=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])},fl(r,e)};function I_(r,e){fl(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var M_=`attribute vec2 aVertexPosition; -attribute vec2 aTextureCoord; - -uniform mat3 projectionMatrix; - -varying vec2 vTextureCoord; - -void main(void) -{ - gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0); - vTextureCoord = aTextureCoord; -}`,k_=`precision mediump float; - -varying vec2 vTextureCoord; -uniform sampler2D uSampler; -uniform vec4 filterArea; - -uniform float transformX; -uniform float transformY; -uniform vec3 lightColor; -uniform float lightAlpha; -uniform vec3 shadowColor; -uniform float shadowAlpha; - -void main(void) { - vec2 transform = vec2(1.0 / filterArea) * vec2(transformX, transformY); - vec4 color = texture2D(uSampler, vTextureCoord); - float light = texture2D(uSampler, vTextureCoord - transform).a; - float shadow = texture2D(uSampler, vTextureCoord + transform).a; - - color.rgb = mix(color.rgb, lightColor, clamp((color.a - light) * lightAlpha, 0.0, 1.0)); - color.rgb = mix(color.rgb, shadowColor, clamp((color.a - shadow) * shadowAlpha, 0.0, 1.0)); - gl_FragColor = vec4(color.rgb * color.a, color.a); -} -`;(function(r){I_(e,r);function e(t){var n=r.call(this,M_,k_)||this;return n._thickness=2,n._angle=0,n.uniforms.lightColor=new Float32Array(3),n.uniforms.shadowColor=new Float32Array(3),Object.assign(n,{rotation:45,thickness:2,lightColor:16777215,lightAlpha:.7,shadowColor:0,shadowAlpha:.7},t),n.padding=1,n}return e.prototype._updateTransform=function(){this.uniforms.transformX=this._thickness*Math.cos(this._angle),this.uniforms.transformY=this._thickness*Math.sin(this._angle)},Object.defineProperty(e.prototype,"rotation",{get:function(){return this._angle/yr},set:function(t){this._angle=t*yr,this._updateTransform()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"thickness",{get:function(){return this._thickness},set:function(t){this._thickness=t,this._updateTransform()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"lightColor",{get:function(){return on(this.uniforms.lightColor)},set:function(t){tn(t,this.uniforms.lightColor)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"lightAlpha",{get:function(){return this.uniforms.lightAlpha},set:function(t){this.uniforms.lightAlpha=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"shadowColor",{get:function(){return on(this.uniforms.shadowColor)},set:function(t){tn(t,this.uniforms.shadowColor)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"shadowAlpha",{get:function(){return this.uniforms.shadowAlpha},set:function(t){this.uniforms.shadowAlpha=t},enumerable:!1,configurable:!0}),e})(Be);/*! - * @pixi/filter-alpha - v6.5.10 - * Compiled Thu, 06 Jul 2023 15:25:11 UTC - * - * @pixi/filter-alpha is licensed under the MIT License. - * http://www.opensource.org/licenses/mit-license - *//*! ***************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */var hl=function(r,e){return hl=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)n.hasOwnProperty(i)&&(t[i]=n[i])},hl(r,e)};function P_(r,e){hl(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var R_=`varying vec2 vTextureCoord; - -uniform sampler2D uSampler; -uniform float uAlpha; - -void main(void) -{ - gl_FragColor = texture2D(uSampler, vTextureCoord) * uAlpha; -} -`,O_=function(r){P_(e,r);function e(t){t===void 0&&(t=1);var n=r.call(this,r_,R_,{uAlpha:1})||this;return n.alpha=t,n}return Object.defineProperty(e.prototype,"alpha",{get:function(){return this.uniforms.uAlpha},set:function(t){this.uniforms.uAlpha=t},enumerable:!1,configurable:!0}),e}(Be);/*! - * @pixi/filter-blur - v6.5.10 - * Compiled Thu, 06 Jul 2023 15:25:11 UTC - * - * @pixi/filter-blur is licensed under the MIT License. - * http://www.opensource.org/licenses/mit-license - *//*! ***************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */var dl=function(r,e){return dl=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)n.hasOwnProperty(i)&&(t[i]=n[i])},dl(r,e)};function bp(r,e){dl(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var F_=` - attribute vec2 aVertexPosition; - - uniform mat3 projectionMatrix; - - uniform float strength; - - varying vec2 vBlurTexCoords[%size%]; - - uniform vec4 inputSize; - uniform vec4 outputFrame; - - vec4 filterVertexPosition( void ) - { - vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy; - - return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0); - } - - vec2 filterTextureCoord( void ) - { - return aVertexPosition * (outputFrame.zw * inputSize.zw); - } - - void main(void) - { - gl_Position = filterVertexPosition(); - - vec2 textureCoord = filterTextureCoord(); - %blur% - }`;function L_(r,e){var t=Math.ceil(r/2),n=F_,i="",o;e?o="vBlurTexCoords[%index%] = textureCoord + vec2(%sampleIndex% * strength, 0.0);":o="vBlurTexCoords[%index%] = textureCoord + vec2(0.0, %sampleIndex% * strength);";for(var s=0;s=t&&(s=r-a-1),l=l.replace("%value%",e[s].toString()),i+=l,i+=` -`}return n=n.replace("%blur%",i),n=n.replace("%size%",r.toString()),n}var zo=function(r){bp(e,r);function e(t,n,i,o,s){n===void 0&&(n=8),i===void 0&&(i=4),o===void 0&&(o=Se.FILTER_RESOLUTION),s===void 0&&(s=5);var a=this,l=L_(s,t),u=B_(s);return a=r.call(this,l,u)||this,a.horizontal=t,a.resolution=o,a._quality=0,a.quality=i,a.blur=n,a}return e.prototype.apply=function(t,n,i,o){if(i?this.horizontal?this.uniforms.strength=1/i.width*(i.width/n.width):this.uniforms.strength=1/i.height*(i.height/n.height):this.horizontal?this.uniforms.strength=1/t.renderer.width*(t.renderer.width/n.width):this.uniforms.strength=1/t.renderer.height*(t.renderer.height/n.height),this.uniforms.strength*=this.strength,this.uniforms.strength/=this.passes,this.passes===1)t.applyFilter(this,n,i,o);else{var s=t.getFilterTexture(),a=t.renderer,l=n,u=s;this.state.blend=!1,t.applyFilter(this,l,u,rn.CLEAR);for(var c=1;c 0.0) { - coord *= mix(1.0, smoothstep(0.0, radius / distance, percent), strength * 0.75); - } else { - coord *= mix(1.0, pow(percent, 1.0 + strength * 0.75) * radius / distance, 1.0 - percent); - } - } - coord += center * dimensions.xy; - coord /= filterArea.xy; - vec2 clampedCoord = clamp(coord, filterClamp.xy, filterClamp.zw); - vec4 color = texture2D(uSampler, clampedCoord); - if (coord != clampedCoord) { - color *= max(0.0, 1.0 - length(coord - clampedCoord)); - } - - gl_FragColor = color; -} -`;(function(r){z_(e,r);function e(t){var n=r.call(this,j_,V_)||this;return n.uniforms.dimensions=new Float32Array(2),Object.assign(n,e.defaults,t),n}return e.prototype.apply=function(t,n,i,o){var s=n.filterFrame,a=s.width,l=s.height;this.uniforms.dimensions[0]=a,this.uniforms.dimensions[1]=l,t.applyFilter(this,n,i,o)},Object.defineProperty(e.prototype,"radius",{get:function(){return this.uniforms.radius},set:function(t){this.uniforms.radius=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"strength",{get:function(){return this.uniforms.strength},set:function(t){this.uniforms.strength=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"center",{get:function(){return this.uniforms.center},set:function(t){this.uniforms.center=t},enumerable:!1,configurable:!0}),e.defaults={center:[.5,.5],radius:100,strength:1},e})(Be);/*! - * @pixi/filter-color-map - v4.2.0 - * Compiled Fri, 05 Aug 2022 19:53:35 UTC - * - * @pixi/filter-color-map is licensed under the MIT License. - * http://www.opensource.org/licenses/mit-license - *//*! ***************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */var gl=function(r,e){return gl=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])},gl(r,e)};function G_(r,e){gl(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var $_=`attribute vec2 aVertexPosition; -attribute vec2 aTextureCoord; - -uniform mat3 projectionMatrix; - -varying vec2 vTextureCoord; - -void main(void) -{ - gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0); - vTextureCoord = aTextureCoord; -}`,H_=`varying vec2 vTextureCoord; -uniform sampler2D uSampler; -uniform sampler2D colorMap; -uniform float _mix; -uniform float _size; -uniform float _sliceSize; -uniform float _slicePixelSize; -uniform float _sliceInnerSize; -void main() { - vec4 color = texture2D(uSampler, vTextureCoord.xy); - - vec4 adjusted; - if (color.a > 0.0) { - color.rgb /= color.a; - float innerWidth = _size - 1.0; - float zSlice0 = min(floor(color.b * innerWidth), innerWidth); - float zSlice1 = min(zSlice0 + 1.0, innerWidth); - float xOffset = _slicePixelSize * 0.5 + color.r * _sliceInnerSize; - float s0 = xOffset + (zSlice0 * _sliceSize); - float s1 = xOffset + (zSlice1 * _sliceSize); - float yOffset = _sliceSize * 0.5 + color.g * (1.0 - _sliceSize); - vec4 slice0Color = texture2D(colorMap, vec2(s0,yOffset)); - vec4 slice1Color = texture2D(colorMap, vec2(s1,yOffset)); - float zOffset = fract(color.b * innerWidth); - adjusted = mix(slice0Color, slice1Color, zOffset); - - color.rgb *= color.a; - } - gl_FragColor = vec4(mix(color, adjusted, _mix).rgb, color.a); - -}`;(function(r){G_(e,r);function e(t,n,i){n===void 0&&(n=!1),i===void 0&&(i=1);var o=r.call(this,$_,H_)||this;return o.mix=1,o._size=0,o._sliceSize=0,o._slicePixelSize=0,o._sliceInnerSize=0,o._nearest=!1,o._scaleMode=null,o._colorMap=null,o._scaleMode=null,o.nearest=n,o.mix=i,o.colorMap=t,o}return e.prototype.apply=function(t,n,i,o){this.uniforms._mix=this.mix,t.applyFilter(this,n,i,o)},Object.defineProperty(e.prototype,"colorSize",{get:function(){return this._size},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"colorMap",{get:function(){return this._colorMap},set:function(t){var n;t&&(t instanceof mr||(t=mr.from(t)),!((n=t)===null||n===void 0)&&n.baseTexture&&(t.baseTexture.scaleMode=this._scaleMode,t.baseTexture.mipmap=dn.OFF,this._size=t.height,this._sliceSize=1/this._size,this._slicePixelSize=this._sliceSize/this._size,this._sliceInnerSize=this._slicePixelSize*(this._size-1),this.uniforms._size=this._size,this.uniforms._sliceSize=this._sliceSize,this.uniforms._slicePixelSize=this._slicePixelSize,this.uniforms._sliceInnerSize=this._sliceInnerSize,this.uniforms.colorMap=t),this._colorMap=t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"nearest",{get:function(){return this._nearest},set:function(t){this._nearest=t,this._scaleMode=t?zt.NEAREST:zt.LINEAR;var n=this._colorMap;n&&n.baseTexture&&(n.baseTexture._glTextures={},n.baseTexture.scaleMode=this._scaleMode,n.baseTexture.mipmap=dn.OFF,n._updateID++,n.baseTexture.emit("update",n.baseTexture))},enumerable:!1,configurable:!0}),e.prototype.updateColorMap=function(){var t=this._colorMap;t&&t.baseTexture&&(t._updateID++,t.baseTexture.emit("update",t.baseTexture),this.colorMap=t)},e.prototype.destroy=function(t){t===void 0&&(t=!1),this._colorMap&&this._colorMap.destroy(t),r.prototype.destroy.call(this)},e})(Be);/*! - * @pixi/filter-color-overlay - v4.2.0 - * Compiled Fri, 05 Aug 2022 19:53:35 UTC - * - * @pixi/filter-color-overlay is licensed under the MIT License. - * http://www.opensource.org/licenses/mit-license - *//*! ***************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */var vl=function(r,e){return vl=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])},vl(r,e)};function X_(r,e){vl(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var W_=`attribute vec2 aVertexPosition; -attribute vec2 aTextureCoord; - -uniform mat3 projectionMatrix; - -varying vec2 vTextureCoord; - -void main(void) -{ - gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0); - vTextureCoord = aTextureCoord; -}`,q_=`varying vec2 vTextureCoord; -uniform sampler2D uSampler; -uniform vec3 color; -uniform float alpha; - -void main(void) { - vec4 currentColor = texture2D(uSampler, vTextureCoord); - gl_FragColor = vec4(mix(currentColor.rgb, color.rgb, currentColor.a * alpha), currentColor.a); -} -`;(function(r){X_(e,r);function e(t,n){t===void 0&&(t=0),n===void 0&&(n=1);var i=r.call(this,W_,q_)||this;return i._color=0,i._alpha=1,i.uniforms.color=new Float32Array(3),i.color=t,i.alpha=n,i}return Object.defineProperty(e.prototype,"color",{get:function(){return this._color},set:function(t){var n=this.uniforms.color;typeof t=="number"?(tn(t,n),this._color=t):(n[0]=t[0],n[1]=t[1],n[2]=t[2],this._color=on(n))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"alpha",{get:function(){return this._alpha},set:function(t){this.uniforms.alpha=t,this._alpha=t},enumerable:!1,configurable:!0}),e})(Be);/*! - * @pixi/filter-color-replace - v4.2.0 - * Compiled Fri, 05 Aug 2022 19:53:35 UTC - * - * @pixi/filter-color-replace is licensed under the MIT License. - * http://www.opensource.org/licenses/mit-license - *//*! ***************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */var yl=function(r,e){return yl=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])},yl(r,e)};function Y_(r,e){yl(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var K_=`attribute vec2 aVertexPosition; -attribute vec2 aTextureCoord; - -uniform mat3 projectionMatrix; - -varying vec2 vTextureCoord; - -void main(void) -{ - gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0); - vTextureCoord = aTextureCoord; -}`,Z_=`varying vec2 vTextureCoord; -uniform sampler2D uSampler; -uniform vec3 originalColor; -uniform vec3 newColor; -uniform float epsilon; -void main(void) { - vec4 currentColor = texture2D(uSampler, vTextureCoord); - vec3 colorDiff = originalColor - (currentColor.rgb / max(currentColor.a, 0.0000000001)); - float colorDistance = length(colorDiff); - float doReplace = step(colorDistance, epsilon); - gl_FragColor = vec4(mix(currentColor.rgb, (newColor + colorDiff) * currentColor.a, doReplace), currentColor.a); -} -`;(function(r){Y_(e,r);function e(t,n,i){t===void 0&&(t=16711680),n===void 0&&(n=0),i===void 0&&(i=.4);var o=r.call(this,K_,Z_)||this;return o._originalColor=16711680,o._newColor=0,o.uniforms.originalColor=new Float32Array(3),o.uniforms.newColor=new Float32Array(3),o.originalColor=t,o.newColor=n,o.epsilon=i,o}return Object.defineProperty(e.prototype,"originalColor",{get:function(){return this._originalColor},set:function(t){var n=this.uniforms.originalColor;typeof t=="number"?(tn(t,n),this._originalColor=t):(n[0]=t[0],n[1]=t[1],n[2]=t[2],this._originalColor=on(n))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"newColor",{get:function(){return this._newColor},set:function(t){var n=this.uniforms.newColor;typeof t=="number"?(tn(t,n),this._newColor=t):(n[0]=t[0],n[1]=t[1],n[2]=t[2],this._newColor=on(n))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"epsilon",{get:function(){return this.uniforms.epsilon},set:function(t){this.uniforms.epsilon=t},enumerable:!1,configurable:!0}),e})(Be);/*! - * @pixi/filter-convolution - v4.2.0 - * Compiled Fri, 05 Aug 2022 19:53:35 UTC - * - * @pixi/filter-convolution is licensed under the MIT License. - * http://www.opensource.org/licenses/mit-license - *//*! ***************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */var _l=function(r,e){return _l=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])},_l(r,e)};function J_(r,e){_l(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var Q_=`attribute vec2 aVertexPosition; -attribute vec2 aTextureCoord; - -uniform mat3 projectionMatrix; - -varying vec2 vTextureCoord; - -void main(void) -{ - gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0); - vTextureCoord = aTextureCoord; -}`,ex=`precision mediump float; - -varying mediump vec2 vTextureCoord; - -uniform sampler2D uSampler; -uniform vec2 texelSize; -uniform float matrix[9]; - -void main(void) -{ - vec4 c11 = texture2D(uSampler, vTextureCoord - texelSize); // top left - vec4 c12 = texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y - texelSize.y)); // top center - vec4 c13 = texture2D(uSampler, vec2(vTextureCoord.x + texelSize.x, vTextureCoord.y - texelSize.y)); // top right - - vec4 c21 = texture2D(uSampler, vec2(vTextureCoord.x - texelSize.x, vTextureCoord.y)); // mid left - vec4 c22 = texture2D(uSampler, vTextureCoord); // mid center - vec4 c23 = texture2D(uSampler, vec2(vTextureCoord.x + texelSize.x, vTextureCoord.y)); // mid right - - vec4 c31 = texture2D(uSampler, vec2(vTextureCoord.x - texelSize.x, vTextureCoord.y + texelSize.y)); // bottom left - vec4 c32 = texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y + texelSize.y)); // bottom center - vec4 c33 = texture2D(uSampler, vTextureCoord + texelSize); // bottom right - - gl_FragColor = - c11 * matrix[0] + c12 * matrix[1] + c13 * matrix[2] + - c21 * matrix[3] + c22 * matrix[4] + c23 * matrix[5] + - c31 * matrix[6] + c32 * matrix[7] + c33 * matrix[8]; - - gl_FragColor.a = c22.a; -} -`;(function(r){J_(e,r);function e(t,n,i){n===void 0&&(n=200),i===void 0&&(i=200);var o=r.call(this,Q_,ex)||this;return o.uniforms.texelSize=new Float32Array(2),o.uniforms.matrix=new Float32Array(9),t!==void 0&&(o.matrix=t),o.width=n,o.height=i,o}return Object.defineProperty(e.prototype,"matrix",{get:function(){return this.uniforms.matrix},set:function(t){var n=this;t.forEach(function(i,o){n.uniforms.matrix[o]=i})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"width",{get:function(){return 1/this.uniforms.texelSize[0]},set:function(t){this.uniforms.texelSize[0]=1/t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return 1/this.uniforms.texelSize[1]},set:function(t){this.uniforms.texelSize[1]=1/t},enumerable:!1,configurable:!0}),e})(Be);/*! - * @pixi/filter-cross-hatch - v4.2.0 - * Compiled Fri, 05 Aug 2022 19:53:35 UTC - * - * @pixi/filter-cross-hatch is licensed under the MIT License. - * http://www.opensource.org/licenses/mit-license - *//*! ***************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */var xl=function(r,e){return xl=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])},xl(r,e)};function tx(r,e){xl(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var nx=`attribute vec2 aVertexPosition; -attribute vec2 aTextureCoord; - -uniform mat3 projectionMatrix; - -varying vec2 vTextureCoord; - -void main(void) -{ - gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0); - vTextureCoord = aTextureCoord; -}`,rx=`precision mediump float; - -varying vec2 vTextureCoord; - -uniform sampler2D uSampler; - -void main(void) -{ - float lum = length(texture2D(uSampler, vTextureCoord.xy).rgb); - - gl_FragColor = vec4(1.0, 1.0, 1.0, 1.0); - - if (lum < 1.00) - { - if (mod(gl_FragCoord.x + gl_FragCoord.y, 10.0) == 0.0) - { - gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0); - } - } - - if (lum < 0.75) - { - if (mod(gl_FragCoord.x - gl_FragCoord.y, 10.0) == 0.0) - { - gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0); - } - } - - if (lum < 0.50) - { - if (mod(gl_FragCoord.x + gl_FragCoord.y - 5.0, 10.0) == 0.0) - { - gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0); - } - } - - if (lum < 0.3) - { - if (mod(gl_FragCoord.x - gl_FragCoord.y - 5.0, 10.0) == 0.0) - { - gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0); - } - } -} -`;(function(r){tx(e,r);function e(){return r.call(this,nx,rx)||this}return e})(Be);/*! - * @pixi/filter-crt - v4.2.0 - * Compiled Fri, 05 Aug 2022 19:53:35 UTC - * - * @pixi/filter-crt is licensed under the MIT License. - * http://www.opensource.org/licenses/mit-license - *//*! ***************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */var bl=function(r,e){return bl=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])},bl(r,e)};function ix(r,e){bl(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var ox=`attribute vec2 aVertexPosition; -attribute vec2 aTextureCoord; - -uniform mat3 projectionMatrix; - -varying vec2 vTextureCoord; - -void main(void) -{ - gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0); - vTextureCoord = aTextureCoord; -}`,sx=`varying vec2 vTextureCoord; -uniform sampler2D uSampler; - -uniform vec4 filterArea; -uniform vec2 dimensions; - -const float SQRT_2 = 1.414213; - -const float light = 1.0; - -uniform float curvature; -uniform float lineWidth; -uniform float lineContrast; -uniform bool verticalLine; -uniform float noise; -uniform float noiseSize; - -uniform float vignetting; -uniform float vignettingAlpha; -uniform float vignettingBlur; - -uniform float seed; -uniform float time; - -float rand(vec2 co) { - return fract(sin(dot(co.xy, vec2(12.9898, 78.233))) * 43758.5453); -} - -void main(void) -{ - vec2 pixelCoord = vTextureCoord.xy * filterArea.xy; - vec2 dir = vec2(vTextureCoord.xy * filterArea.xy / dimensions - vec2(0.5, 0.5)); - - gl_FragColor = texture2D(uSampler, vTextureCoord); - vec3 rgb = gl_FragColor.rgb; - - if (noise > 0.0 && noiseSize > 0.0) - { - pixelCoord.x = floor(pixelCoord.x / noiseSize); - pixelCoord.y = floor(pixelCoord.y / noiseSize); - float _noise = rand(pixelCoord * noiseSize * seed) - 0.5; - rgb += _noise * noise; - } - - if (lineWidth > 0.0) - { - float _c = curvature > 0. ? curvature : 1.; - float k = curvature > 0. ?(length(dir * dir) * 0.25 * _c * _c + 0.935 * _c) : 1.; - vec2 uv = dir * k; - - float v = (verticalLine ? uv.x * dimensions.x : uv.y * dimensions.y) * min(1.0, 2.0 / lineWidth ) / _c; - float j = 1. + cos(v * 1.2 - time) * 0.5 * lineContrast; - rgb *= j; - float segment = verticalLine ? mod((dir.x + .5) * dimensions.x, 4.) : mod((dir.y + .5) * dimensions.y, 4.); - rgb *= 0.99 + ceil(segment) * 0.015; - } - - if (vignetting > 0.0) - { - float outter = SQRT_2 - vignetting * SQRT_2; - float darker = clamp((outter - length(dir) * SQRT_2) / ( 0.00001 + vignettingBlur * SQRT_2), 0.0, 1.0); - rgb *= darker + (1.0 - darker) * (1.0 - vignettingAlpha); - } - - gl_FragColor.rgb = rgb; -} -`;(function(r){ix(e,r);function e(t){var n=r.call(this,ox,sx)||this;return n.time=0,n.seed=0,n.uniforms.dimensions=new Float32Array(2),Object.assign(n,e.defaults,t),n}return e.prototype.apply=function(t,n,i,o){var s=n.filterFrame,a=s.width,l=s.height;this.uniforms.dimensions[0]=a,this.uniforms.dimensions[1]=l,this.uniforms.seed=this.seed,this.uniforms.time=this.time,t.applyFilter(this,n,i,o)},Object.defineProperty(e.prototype,"curvature",{get:function(){return this.uniforms.curvature},set:function(t){this.uniforms.curvature=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"lineWidth",{get:function(){return this.uniforms.lineWidth},set:function(t){this.uniforms.lineWidth=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"lineContrast",{get:function(){return this.uniforms.lineContrast},set:function(t){this.uniforms.lineContrast=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"verticalLine",{get:function(){return this.uniforms.verticalLine},set:function(t){this.uniforms.verticalLine=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"noise",{get:function(){return this.uniforms.noise},set:function(t){this.uniforms.noise=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"noiseSize",{get:function(){return this.uniforms.noiseSize},set:function(t){this.uniforms.noiseSize=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"vignetting",{get:function(){return this.uniforms.vignetting},set:function(t){this.uniforms.vignetting=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"vignettingAlpha",{get:function(){return this.uniforms.vignettingAlpha},set:function(t){this.uniforms.vignettingAlpha=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"vignettingBlur",{get:function(){return this.uniforms.vignettingBlur},set:function(t){this.uniforms.vignettingBlur=t},enumerable:!1,configurable:!0}),e.defaults={curvature:1,lineWidth:1,lineContrast:.25,verticalLine:!1,noise:0,noiseSize:1,seed:0,vignetting:.3,vignettingAlpha:1,vignettingBlur:.3,time:0},e})(Be);/*! - * @pixi/filter-dot - v4.2.0 - * Compiled Fri, 05 Aug 2022 19:53:35 UTC - * - * @pixi/filter-dot is licensed under the MIT License. - * http://www.opensource.org/licenses/mit-license - *//*! ***************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */var wl=function(r,e){return wl=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])},wl(r,e)};function ax(r,e){wl(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var lx=`attribute vec2 aVertexPosition; -attribute vec2 aTextureCoord; - -uniform mat3 projectionMatrix; - -varying vec2 vTextureCoord; - -void main(void) -{ - gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0); - vTextureCoord = aTextureCoord; -}`,ux=`precision mediump float; - -varying vec2 vTextureCoord; -varying vec4 vColor; - -uniform vec4 filterArea; -uniform sampler2D uSampler; - -uniform float angle; -uniform float scale; - -float pattern() -{ - float s = sin(angle), c = cos(angle); - vec2 tex = vTextureCoord * filterArea.xy; - vec2 point = vec2( - c * tex.x - s * tex.y, - s * tex.x + c * tex.y - ) * scale; - return (sin(point.x) * sin(point.y)) * 4.0; -} - -void main() -{ - vec4 color = texture2D(uSampler, vTextureCoord); - float average = (color.r + color.g + color.b) / 3.0; - gl_FragColor = vec4(vec3(average * 10.0 - 5.0 + pattern()), color.a); -} -`;(function(r){ax(e,r);function e(t,n){t===void 0&&(t=1),n===void 0&&(n=5);var i=r.call(this,lx,ux)||this;return i.scale=t,i.angle=n,i}return Object.defineProperty(e.prototype,"scale",{get:function(){return this.uniforms.scale},set:function(t){this.uniforms.scale=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"angle",{get:function(){return this.uniforms.angle},set:function(t){this.uniforms.angle=t},enumerable:!1,configurable:!0}),e})(Be);/*! - * @pixi/filter-drop-shadow - v4.2.0 - * Compiled Fri, 05 Aug 2022 19:53:35 UTC - * - * @pixi/filter-drop-shadow is licensed under the MIT License. - * http://www.opensource.org/licenses/mit-license - *//*! ***************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */var Tl=function(r,e){return Tl=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])},Tl(r,e)};function cx(r,e){Tl(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var jo=function(){return jo=Object.assign||function(e){for(var t=arguments,n,i=1,o=arguments.length;i 1.0 || coord.y > 1.0) { - return; - } - - float cx = coord.x - 0.5; - float cy = (coord.y - 0.5) * aspect; - float ny = (-sinDir * cx + cosDir * cy) / aspect + 0.5; - - // displacementMap: repeat - // ny = ny > 1.0 ? ny - 1.0 : (ny < 0.0 ? 1.0 + ny : ny); - - // displacementMap: mirror - ny = ny > 1.0 ? 2.0 - ny : (ny < 0.0 ? -ny : ny); - - vec4 dc = texture2D(displacementMap, vec2(0.5, ny)); - - float displacement = (dc.r - dc.g) * (offset / filterArea.x); - - coord = vTextureCoord + vec2(cosDir * displacement, sinDir * displacement * aspect); - - if (fillMode == CLAMP) { - coord = clamp(coord, filterClamp.xy, filterClamp.zw); - } else { - if( coord.x > filterClamp.z ) { - if (fillMode == TRANSPARENT) { - discard; - } else if (fillMode == LOOP) { - coord.x -= filterClamp.z; - } else if (fillMode == MIRROR) { - coord.x = filterClamp.z * 2.0 - coord.x; - } - } else if( coord.x < filterClamp.x ) { - if (fillMode == TRANSPARENT) { - discard; - } else if (fillMode == LOOP) { - coord.x += filterClamp.z; - } else if (fillMode == MIRROR) { - coord.x *= -filterClamp.z; - } - } - - if( coord.y > filterClamp.w ) { - if (fillMode == TRANSPARENT) { - discard; - } else if (fillMode == LOOP) { - coord.y -= filterClamp.w; - } else if (fillMode == MIRROR) { - coord.y = filterClamp.w * 2.0 - coord.y; - } - } else if( coord.y < filterClamp.y ) { - if (fillMode == TRANSPARENT) { - discard; - } else if (fillMode == LOOP) { - coord.y += filterClamp.w; - } else if (fillMode == MIRROR) { - coord.y *= -filterClamp.w; - } - } - } - - gl_FragColor.r = texture2D(uSampler, coord + red * (1.0 - seed * 0.4) / filterArea.xy).r; - gl_FragColor.g = texture2D(uSampler, coord + green * (1.0 - seed * 0.3) / filterArea.xy).g; - gl_FragColor.b = texture2D(uSampler, coord + blue * (1.0 - seed * 0.2) / filterArea.xy).b; - gl_FragColor.a = texture2D(uSampler, coord).a; -} -`;(function(r){vx(e,r);function e(t){var n=r.call(this,yx,_x)||this;return n.offset=100,n.fillMode=e.TRANSPARENT,n.average=!1,n.seed=0,n.minSize=8,n.sampleSize=512,n._slices=0,n._offsets=new Float32Array(1),n._sizes=new Float32Array(1),n._direction=-1,n.uniforms.dimensions=new Float32Array(2),n._canvas=document.createElement("canvas"),n._canvas.width=4,n._canvas.height=n.sampleSize,n.texture=mr.from(n._canvas,{scaleMode:zt.NEAREST}),Object.assign(n,e.defaults,t),n}return e.prototype.apply=function(t,n,i,o){var s=n.filterFrame,a=s.width,l=s.height;this.uniforms.dimensions[0]=a,this.uniforms.dimensions[1]=l,this.uniforms.aspect=l/a,this.uniforms.seed=this.seed,this.uniforms.offset=this.offset,this.uniforms.fillMode=this.fillMode,t.applyFilter(this,n,i,o)},e.prototype._randomizeSizes=function(){var t=this._sizes,n=this._slices-1,i=this.sampleSize,o=Math.min(this.minSize/i,.9/this._slices);if(this.average){for(var s=this._slices,a=1,l=0;l0;i--){var o=Math.random()*i>>0,s=t[i];t[i]=t[o],t[o]=s}},e.prototype._randomizeOffsets=function(){for(var t=0;t0?o:0,c=o<0?-o:0;i.fillStyle="rgba("+u+", "+c+", 0, 1)",i.fillRect(0,s>>0,t,l+1>>0),s+=l}n.baseTexture.update(),this.uniforms.displacementMap=n},Object.defineProperty(e.prototype,"sizes",{get:function(){return this._sizes},set:function(t){for(var n=Math.min(this._slices,t.length),i=0;i>0)+1},Object.defineProperty(e.prototype,"offset",{get:function(){return this.uniforms.uOffset},set:function(t){this.uniforms.uOffset=t},enumerable:!1,configurable:!0}),e})(Be);/*! - * @pixi/filter-multi-color-replace - v4.2.0 - * Compiled Fri, 05 Aug 2022 19:53:35 UTC - * - * @pixi/filter-multi-color-replace is licensed under the MIT License. - * http://www.opensource.org/licenses/mit-license - *//*! ***************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */var Ml=function(r,e){return Ml=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])},Ml(r,e)};function kx(r,e){Ml(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var Px=`attribute vec2 aVertexPosition; -attribute vec2 aTextureCoord; - -uniform mat3 projectionMatrix; - -varying vec2 vTextureCoord; - -void main(void) -{ - gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0); - vTextureCoord = aTextureCoord; -}`,Rx=`varying vec2 vTextureCoord; -uniform sampler2D uSampler; - -uniform float epsilon; - -const int MAX_COLORS = %maxColors%; - -uniform vec3 originalColors[MAX_COLORS]; -uniform vec3 targetColors[MAX_COLORS]; - -void main(void) -{ - gl_FragColor = texture2D(uSampler, vTextureCoord); - - float alpha = gl_FragColor.a; - if (alpha < 0.0001) - { - return; - } - - vec3 color = gl_FragColor.rgb / alpha; - - for(int i = 0; i < MAX_COLORS; i++) - { - vec3 origColor = originalColors[i]; - if (origColor.r < 0.0) - { - break; - } - vec3 colorDiff = origColor - color; - if (length(colorDiff) < epsilon) - { - vec3 targetColor = targetColors[i]; - gl_FragColor = vec4((targetColor + colorDiff) * alpha, alpha); - return; - } - } -} -`;(function(r){kx(e,r);function e(t,n,i){n===void 0&&(n=.05),i===void 0&&(i=t.length);var o=r.call(this,Px,Rx.replace(/%maxColors%/g,i.toFixed(0)))||this;return o._replacements=[],o._maxColors=0,o.epsilon=n,o._maxColors=i,o.uniforms.originalColors=new Float32Array(i*3),o.uniforms.targetColors=new Float32Array(i*3),o.replacements=t,o}return Object.defineProperty(e.prototype,"replacements",{get:function(){return this._replacements},set:function(t){var n=this.uniforms.originalColors,i=this.uniforms.targetColors,o=t.length;if(o>this._maxColors)throw new Error("Length of replacements ("+o+") exceeds the maximum colors length ("+this._maxColors+")");n[o*3]=-1;for(var s=0;s 0.5) then: 1 - 2 * (1 - dst) * (1 - src) - return vec3((dst.x <= 0.5) ? (2.0 * src.x * dst.x) : (1.0 - 2.0 * (1.0 - dst.x) * (1.0 - src.x)), - (dst.y <= 0.5) ? (2.0 * src.y * dst.y) : (1.0 - 2.0 * (1.0 - dst.y) * (1.0 - src.y)), - (dst.z <= 0.5) ? (2.0 * src.z * dst.z) : (1.0 - 2.0 * (1.0 - dst.z) * (1.0 - src.z))); -} - - -void main() -{ - gl_FragColor = texture2D(uSampler, vTextureCoord); - vec3 color = gl_FragColor.rgb; - - if (sepia > 0.0) - { - float gray = (color.x + color.y + color.z) / 3.0; - vec3 grayscale = vec3(gray); - - color = Overlay(SEPIA_RGB, grayscale); - - color = grayscale + sepia * (color - grayscale); - } - - vec2 coord = vTextureCoord * filterArea.xy / dimensions.xy; - - if (vignetting > 0.0) - { - float outter = SQRT_2 - vignetting * SQRT_2; - vec2 dir = vec2(vec2(0.5, 0.5) - coord); - dir.y *= dimensions.y / dimensions.x; - float darker = clamp((outter - length(dir) * SQRT_2) / ( 0.00001 + vignettingBlur * SQRT_2), 0.0, 1.0); - color.rgb *= darker + (1.0 - darker) * (1.0 - vignettingAlpha); - } - - if (scratchDensity > seed && scratch != 0.0) - { - float phase = seed * 256.0; - float s = mod(floor(phase), 2.0); - float dist = 1.0 / scratchDensity; - float d = distance(coord, vec2(seed * dist, abs(s - seed * dist))); - if (d < seed * 0.6 + 0.4) - { - highp float period = scratchDensity * 10.0; - - float xx = coord.x * period + phase; - float aa = abs(mod(xx, 0.5) * 4.0); - float bb = mod(floor(xx / 0.5), 2.0); - float yy = (1.0 - bb) * aa + bb * (2.0 - aa); - - float kk = 2.0 * period; - float dw = scratchWidth / dimensions.x * (0.75 + seed); - float dh = dw * kk; - - float tine = (yy - (2.0 - dh)); - - if (tine > 0.0) { - float _sign = sign(scratch); - - tine = s * tine / period + scratch + 0.1; - tine = clamp(tine + 1.0, 0.5 + _sign * 0.5, 1.5 + _sign * 0.5); - - color.rgb *= tine; - } - } - } - - if (noise > 0.0 && noiseSize > 0.0) - { - vec2 pixelCoord = vTextureCoord.xy * filterArea.xy; - pixelCoord.x = floor(pixelCoord.x / noiseSize); - pixelCoord.y = floor(pixelCoord.y / noiseSize); - // vec2 d = pixelCoord * noiseSize * vec2(1024.0 + seed * 512.0, 1024.0 - seed * 512.0); - // float _noise = snoise(d) * 0.5; - float _noise = rand(pixelCoord * noiseSize * seed) - 0.5; - color += _noise * noise; - } - - gl_FragColor.rgb = color; -} -`;(function(r){Ox(e,r);function e(t,n){n===void 0&&(n=0);var i=r.call(this,Fx,Lx)||this;return i.seed=0,i.uniforms.dimensions=new Float32Array(2),typeof t=="number"?(i.seed=t,t=void 0):i.seed=n,Object.assign(i,e.defaults,t),i}return e.prototype.apply=function(t,n,i,o){var s,a;this.uniforms.dimensions[0]=(s=n.filterFrame)===null||s===void 0?void 0:s.width,this.uniforms.dimensions[1]=(a=n.filterFrame)===null||a===void 0?void 0:a.height,this.uniforms.seed=this.seed,t.applyFilter(this,n,i,o)},Object.defineProperty(e.prototype,"sepia",{get:function(){return this.uniforms.sepia},set:function(t){this.uniforms.sepia=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"noise",{get:function(){return this.uniforms.noise},set:function(t){this.uniforms.noise=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"noiseSize",{get:function(){return this.uniforms.noiseSize},set:function(t){this.uniforms.noiseSize=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"scratch",{get:function(){return this.uniforms.scratch},set:function(t){this.uniforms.scratch=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"scratchDensity",{get:function(){return this.uniforms.scratchDensity},set:function(t){this.uniforms.scratchDensity=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"scratchWidth",{get:function(){return this.uniforms.scratchWidth},set:function(t){this.uniforms.scratchWidth=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"vignetting",{get:function(){return this.uniforms.vignetting},set:function(t){this.uniforms.vignetting=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"vignettingAlpha",{get:function(){return this.uniforms.vignettingAlpha},set:function(t){this.uniforms.vignettingAlpha=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"vignettingBlur",{get:function(){return this.uniforms.vignettingBlur},set:function(t){this.uniforms.vignettingBlur=t},enumerable:!1,configurable:!0}),e.defaults={sepia:.3,noise:.3,noiseSize:1,scratch:.5,scratchDensity:.3,scratchWidth:1,vignetting:.3,vignettingAlpha:1,vignettingBlur:.3},e})(Be);/*! - * @pixi/filter-outline - v4.2.0 - * Compiled Fri, 05 Aug 2022 19:53:35 UTC - * - * @pixi/filter-outline is licensed under the MIT License. - * http://www.opensource.org/licenses/mit-license - *//*! ***************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */var Pl=function(r,e){return Pl=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])},Pl(r,e)};function Nx(r,e){Pl(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var Dx=`attribute vec2 aVertexPosition; -attribute vec2 aTextureCoord; - -uniform mat3 projectionMatrix; - -varying vec2 vTextureCoord; - -void main(void) -{ - gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0); - vTextureCoord = aTextureCoord; -}`,Bx=`varying vec2 vTextureCoord; -uniform sampler2D uSampler; - -uniform vec2 thickness; -uniform vec4 outlineColor; -uniform vec4 filterClamp; - -const float DOUBLE_PI = 3.14159265358979323846264 * 2.; - -void main(void) { - vec4 ownColor = texture2D(uSampler, vTextureCoord); - vec4 curColor; - float maxAlpha = 0.; - vec2 displaced; - for (float angle = 0.; angle <= DOUBLE_PI; angle += \${angleStep}) { - displaced.x = vTextureCoord.x + thickness.x * cos(angle); - displaced.y = vTextureCoord.y + thickness.y * sin(angle); - curColor = texture2D(uSampler, clamp(displaced, filterClamp.xy, filterClamp.zw)); - maxAlpha = max(maxAlpha, curColor.a); - } - float resultAlpha = max(maxAlpha, ownColor.a); - gl_FragColor = vec4((ownColor.rgb + outlineColor.rgb * (1. - ownColor.a)) * resultAlpha, resultAlpha); -} -`;(function(r){Nx(e,r);function e(t,n,i){t===void 0&&(t=1),n===void 0&&(n=0),i===void 0&&(i=.1);var o=r.call(this,Dx,Bx.replace(/\$\{angleStep\}/,e.getAngleStep(i)))||this;return o._thickness=1,o.uniforms.thickness=new Float32Array([0,0]),o.uniforms.outlineColor=new Float32Array([0,0,0,1]),Object.assign(o,{thickness:t,color:n,quality:i}),o}return e.getAngleStep=function(t){var n=Math.max(t*e.MAX_SAMPLES,e.MIN_SAMPLES);return(Math.PI*2/n).toFixed(7)},e.prototype.apply=function(t,n,i,o){this.uniforms.thickness[0]=this._thickness/n._frame.width,this.uniforms.thickness[1]=this._thickness/n._frame.height,t.applyFilter(this,n,i,o)},Object.defineProperty(e.prototype,"color",{get:function(){return on(this.uniforms.outlineColor)},set:function(t){tn(t,this.uniforms.outlineColor)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"thickness",{get:function(){return this._thickness},set:function(t){this._thickness=t,this.padding=t},enumerable:!1,configurable:!0}),e.MIN_SAMPLES=1,e.MAX_SAMPLES=100,e})(Be);/*! - * @pixi/filter-pixelate - v4.2.0 - * Compiled Fri, 05 Aug 2022 19:53:35 UTC - * - * @pixi/filter-pixelate is licensed under the MIT License. - * http://www.opensource.org/licenses/mit-license - *//*! ***************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */var Rl=function(r,e){return Rl=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])},Rl(r,e)};function Ux(r,e){Rl(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var zx=`attribute vec2 aVertexPosition; -attribute vec2 aTextureCoord; - -uniform mat3 projectionMatrix; - -varying vec2 vTextureCoord; - -void main(void) -{ - gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0); - vTextureCoord = aTextureCoord; -}`,jx=`precision mediump float; - -varying vec2 vTextureCoord; - -uniform vec2 size; -uniform sampler2D uSampler; - -uniform vec4 filterArea; - -vec2 mapCoord( vec2 coord ) -{ - coord *= filterArea.xy; - coord += filterArea.zw; - - return coord; -} - -vec2 unmapCoord( vec2 coord ) -{ - coord -= filterArea.zw; - coord /= filterArea.xy; - - return coord; -} - -vec2 pixelate(vec2 coord, vec2 size) -{ - return floor( coord / size ) * size; -} - -void main(void) -{ - vec2 coord = mapCoord(vTextureCoord); - - coord = pixelate(coord, size); - - coord = unmapCoord(coord); - - gl_FragColor = texture2D(uSampler, coord); -} -`;(function(r){Ux(e,r);function e(t){t===void 0&&(t=10);var n=r.call(this,zx,jx)||this;return n.size=t,n}return Object.defineProperty(e.prototype,"size",{get:function(){return this.uniforms.size},set:function(t){typeof t=="number"&&(t=[t,t]),this.uniforms.size=t},enumerable:!1,configurable:!0}),e})(Be);/*! - * @pixi/filter-radial-blur - v4.2.0 - * Compiled Fri, 05 Aug 2022 19:53:35 UTC - * - * @pixi/filter-radial-blur is licensed under the MIT License. - * http://www.opensource.org/licenses/mit-license - *//*! ***************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */var Ol=function(r,e){return Ol=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])},Ol(r,e)};function Vx(r,e){Ol(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var Gx=`attribute vec2 aVertexPosition; -attribute vec2 aTextureCoord; - -uniform mat3 projectionMatrix; - -varying vec2 vTextureCoord; - -void main(void) -{ - gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0); - vTextureCoord = aTextureCoord; -}`,$x=`varying vec2 vTextureCoord; -uniform sampler2D uSampler; -uniform vec4 filterArea; - -uniform float uRadian; -uniform vec2 uCenter; -uniform float uRadius; -uniform int uKernelSize; - -const int MAX_KERNEL_SIZE = 2048; - -void main(void) -{ - vec4 color = texture2D(uSampler, vTextureCoord); - - if (uKernelSize == 0) - { - gl_FragColor = color; - return; - } - - float aspect = filterArea.y / filterArea.x; - vec2 center = uCenter.xy / filterArea.xy; - float gradient = uRadius / filterArea.x * 0.3; - float radius = uRadius / filterArea.x - gradient * 0.5; - int k = uKernelSize - 1; - - vec2 coord = vTextureCoord; - vec2 dir = vec2(center - coord); - float dist = length(vec2(dir.x, dir.y * aspect)); - - float radianStep = uRadian; - if (radius >= 0.0 && dist > radius) { - float delta = dist - radius; - float gap = gradient; - float scale = 1.0 - abs(delta / gap); - if (scale <= 0.0) { - gl_FragColor = color; - return; - } - radianStep *= scale; - } - radianStep /= float(k); - - float s = sin(radianStep); - float c = cos(radianStep); - mat2 rotationMatrix = mat2(vec2(c, -s), vec2(s, c)); - - for(int i = 0; i < MAX_KERNEL_SIZE - 1; i++) { - if (i == k) { - break; - } - - coord -= center; - coord.y *= aspect; - coord = rotationMatrix * coord; - coord.y /= aspect; - coord += center; - - vec4 sample = texture2D(uSampler, coord); - - // switch to pre-multiplied alpha to correctly blur transparent images - // sample.rgb *= sample.a; - - color += sample; - } - - gl_FragColor = color / float(uKernelSize); -} -`;(function(r){Vx(e,r);function e(t,n,i,o){t===void 0&&(t=0),n===void 0&&(n=[0,0]),i===void 0&&(i=5),o===void 0&&(o=-1);var s=r.call(this,Gx,$x)||this;return s._angle=0,s.angle=t,s.center=n,s.kernelSize=i,s.radius=o,s}return e.prototype.apply=function(t,n,i,o){this.uniforms.uKernelSize=this._angle!==0?this.kernelSize:0,t.applyFilter(this,n,i,o)},Object.defineProperty(e.prototype,"angle",{get:function(){return this._angle},set:function(t){this._angle=t,this.uniforms.uRadian=t*Math.PI/180},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"center",{get:function(){return this.uniforms.uCenter},set:function(t){this.uniforms.uCenter=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"radius",{get:function(){return this.uniforms.uRadius},set:function(t){(t<0||t===1/0)&&(t=-1),this.uniforms.uRadius=t},enumerable:!1,configurable:!0}),e})(Be);/*! - * @pixi/filter-reflection - v4.2.0 - * Compiled Fri, 05 Aug 2022 19:53:35 UTC - * - * @pixi/filter-reflection is licensed under the MIT License. - * http://www.opensource.org/licenses/mit-license - *//*! ***************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */var Fl=function(r,e){return Fl=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])},Fl(r,e)};function Hx(r,e){Fl(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var Xx=`attribute vec2 aVertexPosition; -attribute vec2 aTextureCoord; - -uniform mat3 projectionMatrix; - -varying vec2 vTextureCoord; - -void main(void) -{ - gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0); - vTextureCoord = aTextureCoord; -}`,Wx=`varying vec2 vTextureCoord; -uniform sampler2D uSampler; - -uniform vec4 filterArea; -uniform vec4 filterClamp; -uniform vec2 dimensions; - -uniform bool mirror; -uniform float boundary; -uniform vec2 amplitude; -uniform vec2 waveLength; -uniform vec2 alpha; -uniform float time; - -float rand(vec2 co) { - return fract(sin(dot(co.xy, vec2(12.9898, 78.233))) * 43758.5453); -} - -void main(void) -{ - vec2 pixelCoord = vTextureCoord.xy * filterArea.xy; - vec2 coord = pixelCoord / dimensions; - - if (coord.y < boundary) { - gl_FragColor = texture2D(uSampler, vTextureCoord); - return; - } - - float k = (coord.y - boundary) / (1. - boundary + 0.0001); - float areaY = boundary * dimensions.y / filterArea.y; - float v = areaY + areaY - vTextureCoord.y; - float y = mirror ? v : vTextureCoord.y; - - float _amplitude = ((amplitude.y - amplitude.x) * k + amplitude.x ) / filterArea.x; - float _waveLength = ((waveLength.y - waveLength.x) * k + waveLength.x) / filterArea.y; - float _alpha = (alpha.y - alpha.x) * k + alpha.x; - - float x = vTextureCoord.x + cos(v * 6.28 / _waveLength - time) * _amplitude; - x = clamp(x, filterClamp.x, filterClamp.z); - - vec4 color = texture2D(uSampler, vec2(x, y)); - - gl_FragColor = color * _alpha; -} -`;(function(r){Hx(e,r);function e(t){var n=r.call(this,Xx,Wx)||this;return n.time=0,n.uniforms.amplitude=new Float32Array(2),n.uniforms.waveLength=new Float32Array(2),n.uniforms.alpha=new Float32Array(2),n.uniforms.dimensions=new Float32Array(2),Object.assign(n,e.defaults,t),n}return e.prototype.apply=function(t,n,i,o){var s,a;this.uniforms.dimensions[0]=(s=n.filterFrame)===null||s===void 0?void 0:s.width,this.uniforms.dimensions[1]=(a=n.filterFrame)===null||a===void 0?void 0:a.height,this.uniforms.time=this.time,t.applyFilter(this,n,i,o)},Object.defineProperty(e.prototype,"mirror",{get:function(){return this.uniforms.mirror},set:function(t){this.uniforms.mirror=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"boundary",{get:function(){return this.uniforms.boundary},set:function(t){this.uniforms.boundary=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"amplitude",{get:function(){return this.uniforms.amplitude},set:function(t){this.uniforms.amplitude[0]=t[0],this.uniforms.amplitude[1]=t[1]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"waveLength",{get:function(){return this.uniforms.waveLength},set:function(t){this.uniforms.waveLength[0]=t[0],this.uniforms.waveLength[1]=t[1]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"alpha",{get:function(){return this.uniforms.alpha},set:function(t){this.uniforms.alpha[0]=t[0],this.uniforms.alpha[1]=t[1]},enumerable:!1,configurable:!0}),e.defaults={mirror:!0,boundary:.5,amplitude:[0,20],waveLength:[30,100],alpha:[1,1],time:0},e})(Be);/*! - * @pixi/filter-rgb-split - v4.2.0 - * Compiled Fri, 05 Aug 2022 19:53:35 UTC - * - * @pixi/filter-rgb-split is licensed under the MIT License. - * http://www.opensource.org/licenses/mit-license - *//*! ***************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */var Ll=function(r,e){return Ll=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])},Ll(r,e)};function qx(r,e){Ll(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var Yx=`attribute vec2 aVertexPosition; -attribute vec2 aTextureCoord; - -uniform mat3 projectionMatrix; - -varying vec2 vTextureCoord; - -void main(void) -{ - gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0); - vTextureCoord = aTextureCoord; -}`,Kx=`precision mediump float; - -varying vec2 vTextureCoord; - -uniform sampler2D uSampler; -uniform vec4 filterArea; -uniform vec2 red; -uniform vec2 green; -uniform vec2 blue; - -void main(void) -{ - gl_FragColor.r = texture2D(uSampler, vTextureCoord + red/filterArea.xy).r; - gl_FragColor.g = texture2D(uSampler, vTextureCoord + green/filterArea.xy).g; - gl_FragColor.b = texture2D(uSampler, vTextureCoord + blue/filterArea.xy).b; - gl_FragColor.a = texture2D(uSampler, vTextureCoord).a; -} -`;(function(r){qx(e,r);function e(t,n,i){t===void 0&&(t=[-10,0]),n===void 0&&(n=[0,10]),i===void 0&&(i=[0,0]);var o=r.call(this,Yx,Kx)||this;return o.red=t,o.green=n,o.blue=i,o}return Object.defineProperty(e.prototype,"red",{get:function(){return this.uniforms.red},set:function(t){this.uniforms.red=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"green",{get:function(){return this.uniforms.green},set:function(t){this.uniforms.green=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"blue",{get:function(){return this.uniforms.blue},set:function(t){this.uniforms.blue=t},enumerable:!1,configurable:!0}),e})(Be);/*! - * @pixi/filter-shockwave - v4.2.0 - * Compiled Fri, 05 Aug 2022 19:53:35 UTC - * - * @pixi/filter-shockwave is licensed under the MIT License. - * http://www.opensource.org/licenses/mit-license - *//*! ***************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */var Nl=function(r,e){return Nl=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])},Nl(r,e)};function Zx(r,e){Nl(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var Jx=`attribute vec2 aVertexPosition; -attribute vec2 aTextureCoord; - -uniform mat3 projectionMatrix; - -varying vec2 vTextureCoord; - -void main(void) -{ - gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0); - vTextureCoord = aTextureCoord; -}`,Qx=`varying vec2 vTextureCoord; -uniform sampler2D uSampler; -uniform vec4 filterArea; -uniform vec4 filterClamp; - -uniform vec2 center; - -uniform float amplitude; -uniform float wavelength; -// uniform float power; -uniform float brightness; -uniform float speed; -uniform float radius; - -uniform float time; - -const float PI = 3.14159; - -void main() -{ - float halfWavelength = wavelength * 0.5 / filterArea.x; - float maxRadius = radius / filterArea.x; - float currentRadius = time * speed / filterArea.x; - - float fade = 1.0; - - if (maxRadius > 0.0) { - if (currentRadius > maxRadius) { - gl_FragColor = texture2D(uSampler, vTextureCoord); - return; - } - fade = 1.0 - pow(currentRadius / maxRadius, 2.0); - } - - vec2 dir = vec2(vTextureCoord - center / filterArea.xy); - dir.y *= filterArea.y / filterArea.x; - float dist = length(dir); - - if (dist <= 0.0 || dist < currentRadius - halfWavelength || dist > currentRadius + halfWavelength) { - gl_FragColor = texture2D(uSampler, vTextureCoord); - return; - } - - vec2 diffUV = normalize(dir); - - float diff = (dist - currentRadius) / halfWavelength; - - float p = 1.0 - pow(abs(diff), 2.0); - - // float powDiff = diff * pow(p, 2.0) * ( amplitude * fade ); - float powDiff = 1.25 * sin(diff * PI) * p * ( amplitude * fade ); - - vec2 offset = diffUV * powDiff / filterArea.xy; - - // Do clamp : - vec2 coord = vTextureCoord + offset; - vec2 clampedCoord = clamp(coord, filterClamp.xy, filterClamp.zw); - vec4 color = texture2D(uSampler, clampedCoord); - if (coord != clampedCoord) { - color *= max(0.0, 1.0 - length(coord - clampedCoord)); - } - - // No clamp : - // gl_FragColor = texture2D(uSampler, vTextureCoord + offset); - - color.rgb *= 1.0 + (brightness - 1.0) * p * fade; - - gl_FragColor = color; -} -`;(function(r){Zx(e,r);function e(t,n,i){t===void 0&&(t=[0,0]),i===void 0&&(i=0);var o=r.call(this,Jx,Qx)||this;return o.center=t,Object.assign(o,e.defaults,n),o.time=i,o}return e.prototype.apply=function(t,n,i,o){this.uniforms.time=this.time,t.applyFilter(this,n,i,o)},Object.defineProperty(e.prototype,"center",{get:function(){return this.uniforms.center},set:function(t){this.uniforms.center=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"amplitude",{get:function(){return this.uniforms.amplitude},set:function(t){this.uniforms.amplitude=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"wavelength",{get:function(){return this.uniforms.wavelength},set:function(t){this.uniforms.wavelength=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"brightness",{get:function(){return this.uniforms.brightness},set:function(t){this.uniforms.brightness=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"speed",{get:function(){return this.uniforms.speed},set:function(t){this.uniforms.speed=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"radius",{get:function(){return this.uniforms.radius},set:function(t){this.uniforms.radius=t},enumerable:!1,configurable:!0}),e.defaults={amplitude:30,wavelength:160,brightness:1,speed:500,radius:-1},e})(Be);/*! - * @pixi/filter-simple-lightmap - v4.2.0 - * Compiled Fri, 05 Aug 2022 19:53:35 UTC - * - * @pixi/filter-simple-lightmap is licensed under the MIT License. - * http://www.opensource.org/licenses/mit-license - *//*! ***************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */var Dl=function(r,e){return Dl=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])},Dl(r,e)};function eb(r,e){Dl(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var tb=`attribute vec2 aVertexPosition; -attribute vec2 aTextureCoord; - -uniform mat3 projectionMatrix; - -varying vec2 vTextureCoord; - -void main(void) -{ - gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0); - vTextureCoord = aTextureCoord; -}`,nb=`varying vec2 vTextureCoord; -uniform sampler2D uSampler; -uniform sampler2D uLightmap; -uniform vec4 filterArea; -uniform vec2 dimensions; -uniform vec4 ambientColor; -void main() { - vec4 diffuseColor = texture2D(uSampler, vTextureCoord); - vec2 lightCoord = (vTextureCoord * filterArea.xy) / dimensions; - vec4 light = texture2D(uLightmap, lightCoord); - vec3 ambient = ambientColor.rgb * ambientColor.a; - vec3 intensity = ambient + light.rgb; - vec3 finalColor = diffuseColor.rgb * intensity; - gl_FragColor = vec4(finalColor, diffuseColor.a); -} -`;(function(r){eb(e,r);function e(t,n,i){n===void 0&&(n=0),i===void 0&&(i=1);var o=r.call(this,tb,nb)||this;return o._color=0,o.uniforms.dimensions=new Float32Array(2),o.uniforms.ambientColor=new Float32Array([0,0,0,i]),o.texture=t,o.color=n,o}return e.prototype.apply=function(t,n,i,o){var s,a;this.uniforms.dimensions[0]=(s=n.filterFrame)===null||s===void 0?void 0:s.width,this.uniforms.dimensions[1]=(a=n.filterFrame)===null||a===void 0?void 0:a.height,t.applyFilter(this,n,i,o)},Object.defineProperty(e.prototype,"texture",{get:function(){return this.uniforms.uLightmap},set:function(t){this.uniforms.uLightmap=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"color",{get:function(){return this._color},set:function(t){var n=this.uniforms.ambientColor;typeof t=="number"?(tn(t,n),this._color=t):(n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],this._color=on(n))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"alpha",{get:function(){return this.uniforms.ambientColor[3]},set:function(t){this.uniforms.ambientColor[3]=t},enumerable:!1,configurable:!0}),e})(Be);/*! - * @pixi/filter-tilt-shift - v4.2.0 - * Compiled Fri, 05 Aug 2022 19:53:35 UTC - * - * @pixi/filter-tilt-shift is licensed under the MIT License. - * http://www.opensource.org/licenses/mit-license - *//*! ***************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */var Bl=function(r,e){return Bl=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])},Bl(r,e)};function ts(r,e){Bl(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var rb=`attribute vec2 aVertexPosition; -attribute vec2 aTextureCoord; - -uniform mat3 projectionMatrix; - -varying vec2 vTextureCoord; - -void main(void) -{ - gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0); - vTextureCoord = aTextureCoord; -}`,ib=`varying vec2 vTextureCoord; - -uniform sampler2D uSampler; -uniform float blur; -uniform float gradientBlur; -uniform vec2 start; -uniform vec2 end; -uniform vec2 delta; -uniform vec2 texSize; - -float random(vec3 scale, float seed) -{ - return fract(sin(dot(gl_FragCoord.xyz + seed, scale)) * 43758.5453 + seed); -} - -void main(void) -{ - vec4 color = vec4(0.0); - float total = 0.0; - - float offset = random(vec3(12.9898, 78.233, 151.7182), 0.0); - vec2 normal = normalize(vec2(start.y - end.y, end.x - start.x)); - float radius = smoothstep(0.0, 1.0, abs(dot(vTextureCoord * texSize - start, normal)) / gradientBlur) * blur; - - for (float t = -30.0; t <= 30.0; t++) - { - float percent = (t + offset - 0.5) / 30.0; - float weight = 1.0 - abs(percent); - vec4 sample = texture2D(uSampler, vTextureCoord + delta / texSize * percent * radius); - sample.rgb *= sample.a; - color += sample * weight; - total += weight; - } - - color /= total; - color.rgb /= color.a + 0.00001; - - gl_FragColor = color; -} -`,wp=function(r){ts(e,r);function e(t,n,i,o){t===void 0&&(t=100),n===void 0&&(n=600);var s=r.call(this,rb,ib)||this;return s.uniforms.blur=t,s.uniforms.gradientBlur=n,s.uniforms.start=i||new at(0,window.innerHeight/2),s.uniforms.end=o||new at(600,window.innerHeight/2),s.uniforms.delta=new at(30,30),s.uniforms.texSize=new at(window.innerWidth,window.innerHeight),s.updateDelta(),s}return e.prototype.updateDelta=function(){this.uniforms.delta.x=0,this.uniforms.delta.y=0},Object.defineProperty(e.prototype,"blur",{get:function(){return this.uniforms.blur},set:function(t){this.uniforms.blur=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"gradientBlur",{get:function(){return this.uniforms.gradientBlur},set:function(t){this.uniforms.gradientBlur=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"start",{get:function(){return this.uniforms.start},set:function(t){this.uniforms.start=t,this.updateDelta()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"end",{get:function(){return this.uniforms.end},set:function(t){this.uniforms.end=t,this.updateDelta()},enumerable:!1,configurable:!0}),e}(Be),ob=function(r){ts(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.updateDelta=function(){var t=this.uniforms.end.x-this.uniforms.start.x,n=this.uniforms.end.y-this.uniforms.start.y,i=Math.sqrt(t*t+n*n);this.uniforms.delta.x=t/i,this.uniforms.delta.y=n/i},e}(wp),sb=function(r){ts(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.updateDelta=function(){var t=this.uniforms.end.x-this.uniforms.start.x,n=this.uniforms.end.y-this.uniforms.start.y,i=Math.sqrt(t*t+n*n);this.uniforms.delta.x=-n/i,this.uniforms.delta.y=t/i},e}(wp);(function(r){ts(e,r);function e(t,n,i,o){t===void 0&&(t=100),n===void 0&&(n=600);var s=r.call(this)||this;return s.tiltShiftXFilter=new ob(t,n,i,o),s.tiltShiftYFilter=new sb(t,n,i,o),s}return e.prototype.apply=function(t,n,i,o){var s=t.getFilterTexture();this.tiltShiftXFilter.apply(t,n,s,1),this.tiltShiftYFilter.apply(t,s,i,o),t.returnFilterTexture(s)},Object.defineProperty(e.prototype,"blur",{get:function(){return this.tiltShiftXFilter.blur},set:function(t){this.tiltShiftXFilter.blur=this.tiltShiftYFilter.blur=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"gradientBlur",{get:function(){return this.tiltShiftXFilter.gradientBlur},set:function(t){this.tiltShiftXFilter.gradientBlur=this.tiltShiftYFilter.gradientBlur=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"start",{get:function(){return this.tiltShiftXFilter.start},set:function(t){this.tiltShiftXFilter.start=this.tiltShiftYFilter.start=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"end",{get:function(){return this.tiltShiftXFilter.end},set:function(t){this.tiltShiftXFilter.end=this.tiltShiftYFilter.end=t},enumerable:!1,configurable:!0}),e})(Be);/*! - * @pixi/filter-twist - v4.2.0 - * Compiled Fri, 05 Aug 2022 19:53:35 UTC - * - * @pixi/filter-twist is licensed under the MIT License. - * http://www.opensource.org/licenses/mit-license - *//*! ***************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */var Ul=function(r,e){return Ul=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])},Ul(r,e)};function ab(r,e){Ul(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var lb=`attribute vec2 aVertexPosition; -attribute vec2 aTextureCoord; - -uniform mat3 projectionMatrix; - -varying vec2 vTextureCoord; - -void main(void) -{ - gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0); - vTextureCoord = aTextureCoord; -}`,ub=`varying vec2 vTextureCoord; - -uniform sampler2D uSampler; -uniform float radius; -uniform float angle; -uniform vec2 offset; -uniform vec4 filterArea; - -vec2 mapCoord( vec2 coord ) -{ - coord *= filterArea.xy; - coord += filterArea.zw; - - return coord; -} - -vec2 unmapCoord( vec2 coord ) -{ - coord -= filterArea.zw; - coord /= filterArea.xy; - - return coord; -} - -vec2 twist(vec2 coord) -{ - coord -= offset; - - float dist = length(coord); - - if (dist < radius) - { - float ratioDist = (radius - dist) / radius; - float angleMod = ratioDist * ratioDist * angle; - float s = sin(angleMod); - float c = cos(angleMod); - coord = vec2(coord.x * c - coord.y * s, coord.x * s + coord.y * c); - } - - coord += offset; - - return coord; -} - -void main(void) -{ - - vec2 coord = mapCoord(vTextureCoord); - - coord = twist(coord); - - coord = unmapCoord(coord); - - gl_FragColor = texture2D(uSampler, coord ); - -} -`;(function(r){ab(e,r);function e(t){var n=r.call(this,lb,ub)||this;return Object.assign(n,e.defaults,t),n}return Object.defineProperty(e.prototype,"offset",{get:function(){return this.uniforms.offset},set:function(t){this.uniforms.offset=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"radius",{get:function(){return this.uniforms.radius},set:function(t){this.uniforms.radius=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"angle",{get:function(){return this.uniforms.angle},set:function(t){this.uniforms.angle=t},enumerable:!1,configurable:!0}),e.defaults={radius:200,angle:4,padding:20,offset:new at},e})(Be);/*! - * @pixi/filter-zoom-blur - v4.2.0 - * Compiled Fri, 05 Aug 2022 19:53:35 UTC - * - * @pixi/filter-zoom-blur is licensed under the MIT License. - * http://www.opensource.org/licenses/mit-license - *//*! ***************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */var zl=function(r,e){return zl=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])},zl(r,e)};function cb(r,e){zl(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}function fb(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i= 0.0 && dist > radius) { // radius < 0 means it's infinity - delta = dist - radius; - gap = gradient; - } - - if (delta > 0.0) { - float normalCount = gap / filterArea.x; - delta = (normalCount - delta) / normalCount; - countLimit *= delta; - strength *= delta; - if (countLimit < 1.0) - { - gl_FragColor = texture2D(uSampler, vTextureCoord); - return; - } - } - - // randomize the lookup values to hide the fixed number of samples - float offset = rand(vTextureCoord, 0.0); - - float total = 0.0; - vec4 color = vec4(0.0); - - dir *= strength; - - for (float t = 0.0; t < MAX_KERNEL_SIZE; t++) { - float percent = (t + offset) / MAX_KERNEL_SIZE; - float weight = 4.0 * (percent - percent * percent); - vec2 p = vTextureCoord + dir * percent; - vec4 sample = texture2D(uSampler, p); - - // switch to pre-multiplied alpha to correctly blur transparent images - // sample.rgb *= sample.a; - - color += sample * weight; - total += weight; - - if (t > countLimit){ - break; - } - } - - color /= total; - // switch back from pre-multiplied alpha - // color.rgb /= color.a + 0.00001; - - gl_FragColor = color; -} -`;(function(r){cb(e,r);function e(t){var n=this,i=Object.assign(e.defaults,t),o=i.maxKernelSize,s=fb(i,["maxKernelSize"]);return n=r.call(this,hb,db.replace("${maxKernelSize}",o.toFixed(1)))||this,Object.assign(n,s),n}return Object.defineProperty(e.prototype,"center",{get:function(){return this.uniforms.uCenter},set:function(t){this.uniforms.uCenter=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"strength",{get:function(){return this.uniforms.uStrength},set:function(t){this.uniforms.uStrength=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"innerRadius",{get:function(){return this.uniforms.uInnerRadius},set:function(t){this.uniforms.uInnerRadius=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"radius",{get:function(){return this.uniforms.uRadius},set:function(t){(t<0||t===1/0)&&(t=-1),this.uniforms.uRadius=t},enumerable:!1,configurable:!0}),e.defaults={strength:.1,center:[0,0],innerRadius:0,radius:-1,maxKernelSize:32},e})(Be);var Zn=Math.pow,st=(r,e,t)=>new Promise((n,i)=>{var o=l=>{try{a(t.next(l))}catch(u){i(u)}},s=l=>{try{a(t.throw(l))}catch(u){i(u)}},a=l=>l.done?n(l.value):Promise.resolve(l.value).then(o,s);a((t=t.apply(r,e)).next())});class Iu{constructor(){this._breathParameters=[],this._currentTime=0}static create(){return new Iu}setParameters(e){this._breathParameters=e}getParameters(){return this._breathParameters}updateParameters(e,t){this._currentTime+=t;const n=this._currentTime*2*3.14159;for(let i=0;i=1&&(n=1,this._blinkingState=qt.EyeState_Closed,this._stateStartTimeSeconds=this._userTimeSeconds),t=1-n;break;case qt.EyeState_Closed:n=(this._userTimeSeconds-this._stateStartTimeSeconds)/this._closedSeconds,n>=1&&(this._blinkingState=qt.EyeState_Opening,this._stateStartTimeSeconds=this._userTimeSeconds),t=0;break;case qt.EyeState_Opening:n=(this._userTimeSeconds-this._stateStartTimeSeconds)/this._openingSeconds,n>=1&&(n=1,this._blinkingState=qt.EyeState_Interval,this._nextBlinkingTime=this.determinNextBlinkingTiming()),t=n;break;case qt.EyeState_Interval:this._nextBlinkingTime(r[r.EyeState_First=0]="EyeState_First",r[r.EyeState_Interval=1]="EyeState_Interval",r[r.EyeState_Closing=2]="EyeState_Closing",r[r.EyeState_Closed=3]="EyeState_Closed",r[r.EyeState_Opening=4]="EyeState_Opening",r))(qt||{});const pb=.001,Bf=.5;class Mu{static create(e){const t=new Mu;typeof e.FadeInTime=="number"&&(t._fadeTimeSeconds=e.FadeInTime,t._fadeTimeSeconds<=0&&(t._fadeTimeSeconds=Bf));const n=e.Groups,i=n.length;for(let o=0;opb){if(o>=0)break;o=u,s=e.getPartOpacityByIndex(c),s+=t/this._fadeTimeSeconds,s>1&&(s=1)}}o<0&&(o=0,s=1);for(let u=n;ul&&(d=1-l/(1-s)),f>d&&(f=d),e.setPartOpacityByIndex(c,f)}}}constructor(){this._fadeTimeSeconds=Bf,this._lastModel=void 0,this._partGroups=[],this._partGroupCounts=[]}}class Vo{constructor(e){this.parameterIndex=0,this.partIndex=0,this.partId="",this.link=[],e!=null&&this.assignment(e)}assignment(e){return this.partId=e.partId,this.link=e.link.map(t=>t.clone()),this}initialize(e){this.parameterIndex=e.getParameterIndex(this.partId),this.partIndex=e.getPartIndex(this.partId),e.setParameterValueByIndex(this.parameterIndex,1)}clone(){const e=new Vo;return e.partId=this.partId,e.parameterIndex=this.parameterIndex,e.partIndex=this.partIndex,e.link=this.link.map(t=>t.clone()),e}}class Oe{constructor(e,t){this.x=e||0,this.y=t||0}add(e){const t=new Oe(0,0);return t.x=this.x+e.x,t.y=this.y+e.y,t}substract(e){const t=new Oe(0,0);return t.x=this.x-e.x,t.y=this.y-e.y,t}multiply(e){const t=new Oe(0,0);return t.x=this.x*e.x,t.y=this.y*e.y,t}multiplyByScaler(e){return this.multiply(new Oe(e,e))}division(e){const t=new Oe(0,0);return t.x=this.x/e.x,t.y=this.y/e.y,t}divisionByScalar(e){return this.division(new Oe(e,e))}getLength(){return Math.sqrt(this.x*this.x+this.y*this.y)}getDistanceWith(e){return Math.sqrt((this.x-e.x)*(this.x-e.x)+(this.y-e.y)*(this.y-e.y))}dot(e){return this.x*e.x+this.y*e.y}normalize(){const e=Math.pow(this.x*this.x+this.y*this.y,.5);this.x=this.x/e,this.y=this.y/e}isEqual(e){return this.x==e.x&&this.y==e.y}isNotEqual(e){return!this.isEqual(e)}}const So=class{static range(r,e,t){return rt&&(r=t),r}static sin(r){return Math.sin(r)}static cos(r){return Math.cos(r)}static abs(r){return Math.abs(r)}static sqrt(r){return Math.sqrt(r)}static cbrt(r){if(r===0)return r;let e=r;const t=e<0;t&&(e=-e);let n;return e===1/0?n=1/0:(n=Math.exp(Math.log(e)/3),n=(e/(n*n)+2*n)/3),t?-n:n}static getEasingSine(r){return r<0?0:r>1?1:.5-.5*this.cos(r*Math.PI)}static max(r,e){return r>e?r:e}static min(r,e){return r>e?e:r}static degreesToRadian(r){return r/180*Math.PI}static radianToDegrees(r){return r*180/Math.PI}static directionToRadian(r,e){const t=Math.atan2(e.y,e.x),n=Math.atan2(r.y,r.x);let i=t-n;for(;i<-Math.PI;)i+=Math.PI*2;for(;i>Math.PI;)i-=Math.PI*2;return i}static directionToDegrees(r,e){const t=this.directionToRadian(r,e);let n=this.radianToDegrees(t);return e.x-r.x>0&&(n=-n),n}static radianToDirection(r){const e=new Oe;return e.x=this.sin(r),e.y=this.cos(r),e}static quadraticEquation(r,e,t){return this.abs(r)1&&(e=1),t<0?t=0:t>1&&(t=1),n<0?n=0:n>1&&(n=1),i<0?i=0:i>1&&(i=1),this._modelColor.R=e,this._modelColor.G=t,this._modelColor.B=n,this._modelColor.A=i}getModelColor(){return Object.assign({},this._modelColor)}setIsPremultipliedAlpha(e){this._isPremultipliedAlpha=e}isPremultipliedAlpha(){return this._isPremultipliedAlpha}setIsCulling(e){this._isCulling=e}isCulling(){return this._isCulling}setAnisotropy(e){this._anisortopy=e}getAnisotropy(){return this._anisortopy}getModel(){return this._model}constructor(){this._isCulling=!1,this._isPremultipliedAlpha=!1,this._anisortopy=0,this._modelColor=new vi,this._mvpMatrix4x4=new Qt,this._mvpMatrix4x4.loadIdentity()}}var Bn=(r=>(r[r.CubismBlendMode_Normal=0]="CubismBlendMode_Normal",r[r.CubismBlendMode_Additive=1]="CubismBlendMode_Additive",r[r.CubismBlendMode_Multiplicative=2]="CubismBlendMode_Multiplicative",r))(Bn||{});class vi{constructor(){this.R=1,this.G=1,this.B=1,this.A=1}}let sn=!1,Mr=!1,kr;const pa={vertexOffset:0,vertexStep:2};class Fi{static startUp(e){if(sn)return ci("CubismFramework.startUp() is already done."),sn;if(Live2DCubismCore._isStarted)return sn=!0,!0;if(Live2DCubismCore._isStarted=!0,kr=e,kr&&Live2DCubismCore.Logging.csmSetLogFunction(kr.logFunction),sn=!0,sn){const t=Live2DCubismCore.Version.csmGetVersion(),n=(t&4278190080)>>24,i=(t&16711680)>>16,o=t&65535,s=t;ci("Live2D Cubism Core version: {0}.{1}.{2} ({3})",("00"+n).slice(-2),("00"+i).slice(-2),("0000"+o).slice(-4),s)}return ci("CubismFramework.startUp() is complete."),sn}static cleanUp(){sn=!1,Mr=!1,kr=void 0}static initialize(){if(!sn){yi("CubismFramework is not started.");return}if(Mr){yi("CubismFramework.initialize() skipped, already initialized.");return}Mr=!0,ci("CubismFramework.initialize() is complete.")}static dispose(){if(!sn){yi("CubismFramework is not started.");return}if(!Mr){yi("CubismFramework.dispose() skipped, not initialized.");return}ku.staticRelease(),Mr=!1,ci("CubismFramework.dispose() is complete.")}static isStarted(){return sn}static isInitialized(){return Mr}static coreLogFunction(e){Live2DCubismCore.Logging.csmGetLogFunction()&&Live2DCubismCore.Logging.csmGetLogFunction()(e)}static getLoggingLevel(){return kr!=null?kr.loggingLevel:wr.LogLevel_Off}constructor(){}}var wr=(r=>(r[r.LogLevel_Verbose=0]="LogLevel_Verbose",r[r.LogLevel_Debug=1]="LogLevel_Debug",r[r.LogLevel_Info=2]="LogLevel_Info",r[r.LogLevel_Warning=3]="LogLevel_Warning",r[r.LogLevel_Error=4]="LogLevel_Error",r[r.LogLevel_Off=5]="LogLevel_Off",r))(wr||{});const to=()=>{};function Uf(r,...e){ns.print(wr.LogLevel_Debug,"[CSM][D]"+r+` -`,e)}function ci(r,...e){ns.print(wr.LogLevel_Info,"[CSM][I]"+r+` -`,e)}function yi(r,...e){ns.print(wr.LogLevel_Warning,"[CSM][W]"+r+` -`,e)}function Nr(r,...e){ns.print(wr.LogLevel_Error,"[CSM][E]"+r+` -`,e)}class ns{static print(e,t,n){if(en[a]);i(o)}static dumpBytes(e,t,n){for(let i=0;i0?this.print(e,` -`):i%8==0&&i>0&&this.print(e," "),this.print(e,"{0} ",[t[i]&255]);this.print(e,` -`)}constructor(){}}class mb{update(){this._model.update(),this._model.drawables.resetDynamicFlags()}getCanvasWidth(){return this._model==null?0:this._model.canvasinfo.CanvasWidth/this._model.canvasinfo.PixelsPerUnit}getCanvasHeight(){return this._model==null?0:this._model.canvasinfo.CanvasHeight/this._model.canvasinfo.PixelsPerUnit}saveParameters(){const e=this._model.parameters.count,t=this._savedParameters.length;for(let n=0;nt&&(t=this._model.parameters.minimumValues[e]),this._parameterValues[e]=n==1?t:this._parameterValues[e]=this._parameterValues[e]*(1-n)+t*n}setParameterValueById(e,t,n=1){const i=this.getParameterIndex(e);this.setParameterValueByIndex(i,t,n)}addParameterValueByIndex(e,t,n=1){this.setParameterValueByIndex(e,this.getParameterValueByIndex(e)+t*n)}addParameterValueById(e,t,n=1){const i=this.getParameterIndex(e);this.addParameterValueByIndex(i,t,n)}multiplyParameterValueById(e,t,n=1){const i=this.getParameterIndex(e);this.multiplyParameterValueByIndex(i,t,n)}multiplyParameterValueByIndex(e,t,n=1){this.setParameterValueByIndex(e,this.getParameterValueByIndex(e)*(1+(t-1)*n))}getDrawableIds(){return this._drawableIds.slice()}getDrawableIndex(e){const t=this._model.drawables.count;for(let n=0;nt&&(e=t);for(let n=0;n0&&t.getEndTime()(r[r.ExpressionBlendType_Add=0]="ExpressionBlendType_Add",r[r.ExpressionBlendType_Multiply=1]="ExpressionBlendType_Multiply",r[r.ExpressionBlendType_Overwrite=2]="ExpressionBlendType_Overwrite",r))(or||{}),Li;(r=>{r.supportMoreMaskDivisions=!0,r.setOpacityFromMotion=!1})(Li||(Li={}));var sr=(r=>(r[r.CubismMotionCurveTarget_Model=0]="CubismMotionCurveTarget_Model",r[r.CubismMotionCurveTarget_Parameter=1]="CubismMotionCurveTarget_Parameter",r[r.CubismMotionCurveTarget_PartOpacity=2]="CubismMotionCurveTarget_PartOpacity",r))(sr||{}),an=(r=>(r[r.CubismMotionSegmentType_Linear=0]="CubismMotionSegmentType_Linear",r[r.CubismMotionSegmentType_Bezier=1]="CubismMotionSegmentType_Bezier",r[r.CubismMotionSegmentType_Stepped=2]="CubismMotionSegmentType_Stepped",r[r.CubismMotionSegmentType_InverseStepped=3]="CubismMotionSegmentType_InverseStepped",r))(an||{});class On{constructor(e=0,t=0){this.time=e,this.value=t}}class gb{constructor(){this.basePointIndex=0,this.segmentType=0}}class vb{constructor(){this.id="",this.type=0,this.segmentCount=0,this.baseSegmentIndex=0,this.fadeInTime=0,this.fadeOutTime=0}}class yb{constructor(){this.fireTime=0,this.value=""}}class _b{constructor(){this.duration=0,this.loop=!1,this.curveCount=0,this.eventCount=0,this.fps=0,this.curves=[],this.segments=[],this.points=[],this.events=[]}}class Ep{constructor(e){this._json=e}release(){this._json=void 0}getMotionDuration(){return this._json.Meta.Duration}isMotionLoop(){return this._json.Meta.Loop||!1}getEvaluationOptionFlag(e){return Ou.EvaluationOptionFlag_AreBeziersRistricted==e?!!this._json.Meta.AreBeziersRestricted:!1}getMotionCurveCount(){return this._json.Meta.CurveCount}getMotionFps(){return this._json.Meta.Fps}getMotionTotalSegmentCount(){return this._json.Meta.TotalSegmentCount}getMotionTotalPointCount(){return this._json.Meta.TotalPointCount}getMotionFadeInTime(){return this._json.Meta.FadeInTime}getMotionFadeOutTime(){return this._json.Meta.FadeOutTime}getMotionCurveTarget(e){return this._json.Curves[e].Target}getMotionCurveId(e){return this._json.Curves[e].Id}getMotionCurveFadeInTime(e){return this._json.Curves[e].FadeInTime}getMotionCurveFadeOutTime(e){return this._json.Curves[e].FadeOutTime}getMotionCurveSegmentCount(e){return this._json.Curves[e].Segments.length}getMotionCurveSegment(e,t){return this._json.Curves[e].Segments[t]}getEventCount(){return this._json.Meta.UserDataCount||0}getTotalEventValueSize(){return this._json.Meta.TotalUserDataSize}getEventTime(e){return this._json.UserData[e].Time}getEventValue(e){return this._json.UserData[e].Value}}var Ou=(r=>(r[r.EvaluationOptionFlag_AreBeziersRistricted=0]="EvaluationOptionFlag_AreBeziersRistricted",r))(Ou||{});const xb="EyeBlink",bb="LipSync",wb="Model",Tb="Parameter",Sb="PartOpacity",Eb=!1;function Kt(r,e,t){const n=new On;return n.time=r.time+(e.time-r.time)*t,n.value=r.value+(e.value-r.value)*t,n}function Ab(r,e){let t=(e-r[0].time)/(r[1].time-r[0].time);return t<0&&(t=0),r[0].value+(r[1].value-r[0].value)*t}function Cb(r,e){let t=(e-r[0].time)/(r[3].time-r[0].time);t<0&&(t=0);const n=Kt(r[0],r[1],t),i=Kt(r[1],r[2],t),o=Kt(r[2],r[3],t),s=Kt(n,i,t),a=Kt(i,o,t);return Kt(s,a,t).value}function Ib(r,e){const t=e,n=r[0].time,i=r[3].time,o=r[1].time,s=r[2].time,a=i-3*s+3*o-n,l=3*s-6*o+3*n,u=3*o-3*n,c=n-t,f=Ze.cardanoAlgorithmForBezier(a,l,u,c),d=Kt(r[0],r[1],f),h=Kt(r[1],r[2],f),g=Kt(r[2],r[3],f),v=Kt(d,h,f),p=Kt(h,g,f);return Kt(v,p,f).value}function Mb(r,e){return r[0].value}function kb(r,e){return r[1].value}function ma(r,e,t){const n=r.curves[e];let i=-1;const o=n.baseSegmentIndex+n.segmentCount;let s=0;for(let l=n.baseSegmentIndex;lt){i=l;break}if(i==-1)return r.points[s].value;const a=r.segments[i];return a.evaluate(r.points.slice(a.basePointIndex),t)}class Fu extends Sp{constructor(){super(),this._eyeBlinkParameterIds=[],this._lipSyncParameterIds=[],this._sourceFrameRate=30,this._loopDurationSeconds=-1,this._isLoop=!1,this._isLoopFadeIn=!0,this._lastWeight=0}static create(e,t){const n=new Fu;return n.parse(e),n._sourceFrameRate=n._motionData.fps,n._loopDurationSeconds=n._motionData.duration,n._onFinishedMotion=t,n}doUpdateParameters(e,t,n,i){this._modelCurveIdEyeBlink==null&&(this._modelCurveIdEyeBlink=xb),this._modelCurveIdLipSync==null&&(this._modelCurveIdLipSync=bb);let o=t-i.getStartTime();o<0&&(o=0);let s=Number.MAX_VALUE,a=Number.MAX_VALUE;const l=64;let u=0,c=0;this._eyeBlinkParameterIds.length>l&&Uf("too many eye blink targets : {0}",this._eyeBlinkParameterIds.length),this._lipSyncParameterIds.length>l&&Uf("too many lip sync targets : {0}",this._lipSyncParameterIds.length);const f=this._fadeInSeconds<=0?1:Ze.getEasingSine((t-i.getFadeInStartTime())/this._fadeInSeconds),d=this._fadeOutSeconds<=0||i.getEndTime()<0?1:Ze.getEasingSine((i.getEndTime()-t)/this._fadeOutSeconds);let h,g,v,p=o;if(this._isLoop)for(;p>this._motionData.duration;)p-=this._motionData.duration;const m=this._motionData.curves;for(g=0;g>y&1)continue;const C=_+(a-_)*n;e.setParameterValueById(this._eyeBlinkParameterIds[y],C)}if(s!=Number.MAX_VALUE)for(let y=0;y>y&1)continue;const C=_+(s-_)*n;e.setParameterValueById(this._lipSyncParameterIds[y],C)}}for(;g=this._motionData.duration&&(this._isLoop?(i.setStartTime(t),this._isLoopFadeIn&&i.setFadeInStartTime(t)):(this._onFinishedMotion&&this._onFinishedMotion(this),i.setIsFinished(!0))),this._lastWeight=n}setIsLoop(e){this._isLoop=e}isLoop(){return this._isLoop}setIsLoopFadeIn(e){this._isLoopFadeIn=e}isLoopFadeIn(){return this._isLoopFadeIn}getDuration(){return this._isLoop?-1:this._loopDurationSeconds}getLoopDuration(){return this._loopDurationSeconds}setParameterFadeInTime(e,t){const n=this._motionData.curves;for(let i=0;inew vb),this._motionData.segments=Array.from({length:t.getMotionTotalSegmentCount()}).map(()=>new gb),this._motionData.events=Array.from({length:this._motionData.eventCount}).map(()=>new yb),this._motionData.points=[];let s=0,a=0;for(let l=0;le&&this._motionData.events[n].fireTime<=t&&this._firedEventValues.push(this._motionData.events[n].value);return this._firedEventValues}}class Pb{constructor(){this._autoDelete=!1,this._available=!0,this._finished=!1,this._started=!1,this._startTimeSeconds=-1,this._fadeInStartTimeSeconds=0,this._endTimeSeconds=-1,this._stateTimeSeconds=0,this._stateWeight=0,this._lastEventCheckSeconds=0,this._motionQueueEntryHandle=this,this._fadeOutSeconds=0,this._isTriggeredFadeOut=!1}release(){this._autoDelete&&this._motion&&this._motion.release()}setFadeOut(e){this._fadeOutSeconds=e,this._isTriggeredFadeOut=!0}startFadeOut(e,t){const n=t+e;this._isTriggeredFadeOut=!0,(this._endTimeSeconds<0||nt!=null&&t._motionQueueEntryHandle==e)}setEventCallback(e,t=null){this._eventCallBack=e,this._eventCustomData=t}doUpdateMotion(e,t){let n=!1,i=0;for(;i(r[r.CubismPhysicsTargetType_Parameter=0]="CubismPhysicsTargetType_Parameter",r))(Vl||{}),ar=(r=>(r[r.CubismPhysicsSource_X=0]="CubismPhysicsSource_X",r[r.CubismPhysicsSource_Y=1]="CubismPhysicsSource_Y",r[r.CubismPhysicsSource_Angle=2]="CubismPhysicsSource_Angle",r))(ar||{});class Ob{constructor(){this.initialPosition=new Oe(0,0),this.position=new Oe(0,0),this.lastPosition=new Oe(0,0),this.lastGravity=new Oe(0,0),this.force=new Oe(0,0),this.velocity=new Oe(0,0)}}class Fb{constructor(){this.normalizationPosition={},this.normalizationAngle={}}}class Lb{constructor(){this.source={}}}class Nb{constructor(){this.destination={},this.translationScale=new Oe(0,0)}}class Db{constructor(){this.settings=[],this.inputs=[],this.outputs=[],this.particles=[],this.gravity=new Oe(0,0),this.wind=new Oe(0,0)}}class Bb{constructor(e){this._json=e}release(){this._json=void 0}getGravity(){const e=new Oe(0,0);return e.x=this._json.Meta.EffectiveForces.Gravity.X,e.y=this._json.Meta.EffectiveForces.Gravity.Y,e}getWind(){const e=new Oe(0,0);return e.x=this._json.Meta.EffectiveForces.Wind.X,e.y=this._json.Meta.EffectiveForces.Wind.Y,e}getSubRigCount(){return this._json.Meta.PhysicsSettingCount}getTotalInputCount(){return this._json.Meta.TotalInputCount}getTotalOutputCount(){return this._json.Meta.TotalOutputCount}getVertexCount(){return this._json.Meta.VertexCount}getNormalizationPositionMinimumValue(e){return this._json.PhysicsSettings[e].Normalization.Position.Minimum}getNormalizationPositionMaximumValue(e){return this._json.PhysicsSettings[e].Normalization.Position.Maximum}getNormalizationPositionDefaultValue(e){return this._json.PhysicsSettings[e].Normalization.Position.Default}getNormalizationAngleMinimumValue(e){return this._json.PhysicsSettings[e].Normalization.Angle.Minimum}getNormalizationAngleMaximumValue(e){return this._json.PhysicsSettings[e].Normalization.Angle.Maximum}getNormalizationAngleDefaultValue(e){return this._json.PhysicsSettings[e].Normalization.Angle.Default}getInputCount(e){return this._json.PhysicsSettings[e].Input.length}getInputWeight(e,t){return this._json.PhysicsSettings[e].Input[t].Weight}getInputReflect(e,t){return this._json.PhysicsSettings[e].Input[t].Reflect}getInputType(e,t){return this._json.PhysicsSettings[e].Input[t].Type}getInputSourceId(e,t){return this._json.PhysicsSettings[e].Input[t].Source.Id}getOutputCount(e){return this._json.PhysicsSettings[e].Output.length}getOutputVertexIndex(e,t){return this._json.PhysicsSettings[e].Output[t].VertexIndex}getOutputAngleScale(e,t){return this._json.PhysicsSettings[e].Output[t].Scale}getOutputWeight(e,t){return this._json.PhysicsSettings[e].Output[t].Weight}getOutputDestinationId(e,t){return this._json.PhysicsSettings[e].Output[t].Destination.Id}getOutputType(e,t){return this._json.PhysicsSettings[e].Output[t].Type}getOutputReflect(e,t){return this._json.PhysicsSettings[e].Output[t].Reflect}getParticleCount(e){return this._json.PhysicsSettings[e].Vertices.length}getParticleMobility(e,t){return this._json.PhysicsSettings[e].Vertices[t].Mobility}getParticleDelay(e,t){return this._json.PhysicsSettings[e].Vertices[t].Delay}getParticleAcceleration(e,t){return this._json.PhysicsSettings[e].Vertices[t].Acceleration}getParticleRadius(e,t){return this._json.PhysicsSettings[e].Vertices[t].Radius}getParticlePosition(e,t){const n=new Oe(0,0);return n.x=this._json.PhysicsSettings[e].Vertices[t].Position.X,n.y=this._json.PhysicsSettings[e].Vertices[t].Position.Y,n}}const jf="X",Vf="Y",Gf="Angle",Ub=5,Cp=100,zb=.001;class Lu{static create(e){const t=new Lu;return t.parse(e),t._physicsRig.gravity.y=0,t}evaluate(e,t){let n,i,o,s;const a=new Oe;let l,u,c,f,d,h,g,v;d=e.getModel().parameters.values,h=e.getModel().parameters.maximumValues,g=e.getModel().parameters.minimumValues,v=e.getModel().parameters.defaultValues;for(let p=0;p=l.particleCount)break;c[m].destinationParameterIndex==-1&&(c[m].destinationParameterIndex=e.getParameterIndex(c[m].destination.id));const _=new Oe;_.x=f[y].position.x-f[y-1].position.x,_.y=f[y].position.y-f[y-1].position.y,s=c[m].getValue(_,f,y,c[m].reflect,this._options.gravity);const C=c[m].destinationParameterIndex,b=!Float32Array.prototype.slice&&"subarray"in Float32Array.prototype?JSON.parse(JSON.stringify(d.subarray(C))):d.slice(C);e1(b,g[C],h[C],s,c[m]);for(let x=C,w=0;x=2?i=e[t-1].position.substract(e[t-2].position):i=i.multiplyByScaler(-1),o=Ze.directionToRadian(i,r),n&&(o*=-1),o}function qb(r,e){return Math.abs(Math.max(r,e)-Math.min(r,e))}function Yb(r,e){return Math.min(r,e)+qb(r,e)/2}function Kb(r,e){return r.x}function Zb(r,e){return r.y}function Jb(r,e){return e}function Qb(r,e,t,n,i,o,s,a){let l,u,c,f,d=new Oe(0,0),h=new Oe(0,0),g=new Oe(0,0),v=new Oe(0,0);r[0].position=new Oe(t.x,t.y),l=Ze.degreesToRadian(n),f=Ze.radianToDirection(l),f.normalize();for(let p=1;pt&&(s>i.valueExceededMaximum&&(i.valueExceededMaximum=s),s=t),a=i.weight/Cp,a>=1||(s=r[0]*(1-a)+s*a),r[0]=s}function Nu(r,e,t,n,i,o,s,a){let l=0;const u=Ze.max(t,e);ur&&(r=c);const f=Ze.min(i,o),d=Ze.max(i,o),h=s,g=Yb(c,u),v=r-g;switch(Math.sign(v)){case 1:{const p=d-h,m=u-g;m!=0&&(l=v*(p/m),l+=h);break}case-1:{const p=f-h,m=c-g;m!=0&&(l=v*(p/m),l+=h);break}case 0:{l=h;break}}return a?l:l*-1}class Gl{constructor(e=0,t=0,n=0,i=0){this.x=e,this.y=t,this.width=n,this.height=i}getCenterX(){return this.x+.5*this.width}getCenterY(){return this.y+.5*this.height}getRight(){return this.x+this.width}getBottom(){return this.y+this.height}setRect(e){this.x=e.x,this.y=e.y,this.width=e.width,this.height=e.height}expand(e,t){this.x-=e,this.y-=t,this.width+=e*2,this.height+=t*2}}const ga=4,t1=10;let Jn,_i,$l;class va{getChannelFlagAsColor(e){return this._channelColors[e]}getMaskRenderTexture(){let e=0;if(this._maskTexture&&this._maskTexture.texture!=0&&(this._maskTexture.frameNo=this._currentFrameNo,e=this._maskTexture.texture),e==0){const t=this._clippingMaskBufferSize;this._colorBuffer=this.gl.createTexture(),this.gl.bindTexture(this.gl.TEXTURE_2D,this._colorBuffer),this.gl.texImage2D(this.gl.TEXTURE_2D,0,this.gl.RGBA,t,t,0,this.gl.RGBA,this.gl.UNSIGNED_BYTE,null),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_S,this.gl.CLAMP_TO_EDGE),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_T,this.gl.CLAMP_TO_EDGE),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_MIN_FILTER,this.gl.LINEAR),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_MAG_FILTER,this.gl.LINEAR),this.gl.bindTexture(this.gl.TEXTURE_2D,null),e=this.gl.createFramebuffer(),this.gl.bindFramebuffer(this.gl.FRAMEBUFFER,e),this.gl.framebufferTexture2D(this.gl.FRAMEBUFFER,this.gl.COLOR_ATTACHMENT0,this.gl.TEXTURE_2D,this._colorBuffer,0),this.gl.bindFramebuffer(this.gl.FRAMEBUFFER,$l),this._maskTexture=new n1(this._currentFrameNo,e)}return e}setGL(e){this.gl=e}calcClippedDrawTotalBounds(e,t){let n=Number.MAX_VALUE,i=Number.MAX_VALUE,o=Number.MIN_VALUE,s=Number.MIN_VALUE;const a=t._clippedDrawableIndexList.length;for(let l=0;lg&&(g=y),_v&&(v=_)}if(d!=Number.MAX_VALUE)if(do&&(o=g),v>s&&(s=v),n==Number.MAX_VALUE)t._allClippedDrawRect.x=0,t._allClippedDrawRect.y=0,t._allClippedDrawRect.width=0,t._allClippedDrawRect.height=0,t._isUsing=!1;else{t._isUsing=!0;const m=o-n,y=s-i;t._allClippedDrawRect.x=n,t._allClippedDrawRect.y=i,t._allClippedDrawRect.width=m,t._allClippedDrawRect.height=y}}}constructor(){this._maskRenderTexture=null,this._colorBuffer=null,this._currentFrameNo=0,this._clippingMaskBufferSize=256,this._clippingContextListForMask=[],this._clippingContextListForDraw=[],this._channelColors=[],this._tmpBoundsOnModel=new Gl,this._tmpMatrix=new Qt,this._tmpMatrixForMask=new Qt,this._tmpMatrixForDraw=new Qt;let e=new vi;e.R=1,e.G=0,e.B=0,e.A=0,this._channelColors.push(e),e=new vi,e.R=0,e.G=1,e.B=0,e.A=0,this._channelColors.push(e),e=new vi,e.R=0,e.G=0,e.B=1,e.A=0,this._channelColors.push(e),e=new vi,e.R=0,e.G=0,e.B=0,e.A=1,this._channelColors.push(e)}release(){var e,t,n;const i=this;for(let o=0;o0){this.gl.viewport(0,0,this._clippingMaskBufferSize,this._clippingMaskBufferSize),this._maskRenderTexture=this.getMaskRenderTexture(),t.getMvpMatrix(),t.preDraw(),this.setupLayoutBounds(n),this.gl.bindFramebuffer(this.gl.FRAMEBUFFER,this._maskRenderTexture),this.gl.clearColor(1,1,1,1),this.gl.clear(this.gl.COLOR_BUFFER_BIT);for(let i=0;i(r[r.ShaderNames_SetupMask=0]="ShaderNames_SetupMask",r[r.ShaderNames_NormalPremultipliedAlpha=1]="ShaderNames_NormalPremultipliedAlpha",r[r.ShaderNames_NormalMaskedPremultipliedAlpha=2]="ShaderNames_NormalMaskedPremultipliedAlpha",r[r.ShaderNames_NomralMaskedInvertedPremultipliedAlpha=3]="ShaderNames_NomralMaskedInvertedPremultipliedAlpha",r[r.ShaderNames_AddPremultipliedAlpha=4]="ShaderNames_AddPremultipliedAlpha",r[r.ShaderNames_AddMaskedPremultipliedAlpha=5]="ShaderNames_AddMaskedPremultipliedAlpha",r[r.ShaderNames_AddMaskedPremultipliedAlphaInverted=6]="ShaderNames_AddMaskedPremultipliedAlphaInverted",r[r.ShaderNames_MultPremultipliedAlpha=7]="ShaderNames_MultPremultipliedAlpha",r[r.ShaderNames_MultMaskedPremultipliedAlpha=8]="ShaderNames_MultMaskedPremultipliedAlpha",r[r.ShaderNames_MultMaskedPremultipliedAlphaInverted=9]="ShaderNames_MultMaskedPremultipliedAlphaInverted",r))(xi||{});const i1="attribute vec4 a_position;attribute vec2 a_texCoord;varying vec2 v_texCoord;varying vec4 v_myPos;uniform mat4 u_clipMatrix;void main(){ gl_Position = u_clipMatrix * a_position; v_myPos = u_clipMatrix * a_position; v_texCoord = a_texCoord; v_texCoord.y = 1.0 - v_texCoord.y;}",o1="precision mediump float;varying vec2 v_texCoord;varying vec4 v_myPos;uniform vec4 u_baseColor;uniform vec4 u_channelFlag;uniform sampler2D s_texture0;void main(){ float isInside = step(u_baseColor.x, v_myPos.x/v_myPos.w) * step(u_baseColor.y, v_myPos.y/v_myPos.w) * step(v_myPos.x/v_myPos.w, u_baseColor.z) * step(v_myPos.y/v_myPos.w, u_baseColor.w); gl_FragColor = u_channelFlag * texture2D(s_texture0, v_texCoord).a * isInside;}",s1="attribute vec4 a_position;attribute vec2 a_texCoord;varying vec2 v_texCoord;uniform mat4 u_matrix;void main(){ gl_Position = u_matrix * a_position; v_texCoord = a_texCoord; v_texCoord.y = 1.0 - v_texCoord.y;}",$f="attribute vec4 a_position;attribute vec2 a_texCoord;varying vec2 v_texCoord;varying vec4 v_clipPos;uniform mat4 u_matrix;uniform mat4 u_clipMatrix;void main(){ gl_Position = u_matrix * a_position; v_clipPos = u_clipMatrix * a_position; v_texCoord = a_texCoord; v_texCoord.y = 1.0 - v_texCoord.y;}",a1="precision mediump float;varying vec2 v_texCoord;uniform vec4 u_baseColor;uniform sampler2D s_texture0;void main(){ gl_FragColor = texture2D(s_texture0 , v_texCoord) * u_baseColor;}",l1="precision mediump float;varying vec2 v_texCoord;varying vec4 v_clipPos;uniform vec4 u_baseColor;uniform vec4 u_channelFlag;uniform sampler2D s_texture0;uniform sampler2D s_texture1;void main(){ vec4 col_formask = texture2D(s_texture0 , v_texCoord) * u_baseColor; vec4 clipMask = (1.0 - texture2D(s_texture1, v_clipPos.xy / v_clipPos.w)) * u_channelFlag; float maskVal = clipMask.r + clipMask.g + clipMask.b + clipMask.a; col_formask = col_formask * maskVal; gl_FragColor = col_formask;}",u1="precision mediump float;varying vec2 v_texCoord;varying vec4 v_clipPos;uniform sampler2D s_texture0;uniform sampler2D s_texture1;uniform vec4 u_channelFlag;uniform vec4 u_baseColor;void main(){vec4 col_formask = texture2D(s_texture0, v_texCoord) * u_baseColor;vec4 clipMask = (1.0 - texture2D(s_texture1, v_clipPos.xy / v_clipPos.w)) * u_channelFlag;float maskVal = clipMask.r + clipMask.g + clipMask.b + clipMask.a;col_formask = col_formask * (1.0 - maskVal);gl_FragColor = col_formask;}";class Ip extends ku{constructor(){super(),this._clippingContextBufferForMask=null,this._clippingContextBufferForDraw=null,this._clippingManager=new va,this.firstDraw=!0,this._textures={},this._sortedDrawableIndexList=[],this._bufferData={vertex:null,uv:null,index:null}}initialize(e){e.isUsingMasking()&&(this._clippingManager=new va,this._clippingManager.initialize(e,e.getDrawableCount(),e.getDrawableMasks(),e.getDrawableMaskCounts()));for(let t=e.getDrawableCount()-1;t>=0;t--)this._sortedDrawableIndexList[t]=0;super.initialize(e)}bindTexture(e,t){this._textures[e]=t}getBindedTextures(){return this._textures}setClippingMaskBufferSize(e){this._clippingManager.release(),this._clippingManager=new va,this._clippingManager.setClippingMaskBufferSize(e),this._clippingManager.initialize(this.getModel(),this.getModel().getDrawableCount(),this.getModel().getDrawableMasks(),this.getModel().getDrawableMaskCounts())}getClippingMaskBufferSize(){return this._clippingManager.getClippingMaskBufferSize()}release(){var e,t,n;const i=this;this._clippingManager.release(),i._clippingManager=void 0,(e=this.gl)==null||e.deleteBuffer(this._bufferData.vertex),this._bufferData.vertex=null,(t=this.gl)==null||t.deleteBuffer(this._bufferData.uv),this._bufferData.uv=null,(n=this.gl)==null||n.deleteBuffer(this._bufferData.index),this._bufferData.index=null,i._bufferData=void 0,i._textures=void 0}doDrawModel(){this.preDraw(),this._clippingManager!=null&&this._clippingManager.setupClippingContext(this.getModel(),this);const e=this.getModel().getDrawableCount(),t=this.getModel().getDrawableRenderOrders();for(let n=0;n{Ip.doStaticRelease()};class Mp{constructor(e){this.groups=e.Groups,this.hitAreas=e.HitAreas,this.layout=e.Layout,this.moc=e.FileReferences.Moc,this.expressions=e.FileReferences.Expressions,this.motions=e.FileReferences.Motions,this.textures=e.FileReferences.Textures,this.physics=e.FileReferences.Physics,this.pose=e.FileReferences.Pose}getEyeBlinkParameters(){var e,t;return(t=(e=this.groups)==null?void 0:e.find(n=>n.Name==="EyeBlink"))==null?void 0:t.Ids}getLipSyncParameters(){var e,t;return(t=(e=this.groups)==null?void 0:e.find(n=>n.Name==="LipSync"))==null?void 0:t.Ids}}const c1="ParamAngleX",f1="ParamAngleY",h1="ParamAngleZ",d1="ParamEyeBallX",p1="ParamEyeBallY",m1="ParamBodyAngleX",g1="ParamBreath",Hf=2,Xf=2;var Ut;(r=>{r.LOG_LEVEL_VERBOSE=0,r.LOG_LEVEL_WARNING=1,r.LOG_LEVEL_ERROR=2,r.LOG_LEVEL_NONE=999,r.logLevel=r.LOG_LEVEL_WARNING,r.sound=!0,r.motionSync=!0,r.motionFadingDuration=500,r.idleMotionFadingDuration=2e3,r.expressionFadingDuration=500,r.preserveExpressionOnMotion=!0,r.cubism4=Li})(Ut||(Ut={}));const Ye={log(r,...e){Ut.logLevel<=Ut.LOG_LEVEL_VERBOSE&&console.log(`[${r}]`,...e)},warn(r,...e){Ut.logLevel<=Ut.LOG_LEVEL_WARNING&&console.warn(`[${r}]`,...e)},error(r,...e){Ut.logLevel<=Ut.LOG_LEVEL_ERROR&&console.error(`[${r}]`,...e)}};function Wf(r,e,t){return rt?t:r}function kp(r,e){e.forEach(t=>{Object.getOwnPropertyNames(t.prototype).forEach(n=>{n!=="constructor"&&Object.defineProperty(r.prototype,n,Object.getOwnPropertyDescriptor(t.prototype,n))})})}function v1(r){let e=r.lastIndexOf("/");return e!=-1&&(r=r.slice(0,e)),e=r.lastIndexOf("/"),e!==-1&&(r=r.slice(e+1)),r}function y1(r,e){const t=r.indexOf(e);t!==-1&&r.splice(t,1)}class Pp extends br{constructor(e,t){super(),this.expressions=[],this.reserveExpressionIndex=-1,this.destroyed=!1,this.settings=e,this.tag=`ExpressionManager(${e.name})`}init(){this.defaultExpression=this.createExpression({},void 0),this.currentExpression=this.defaultExpression,this.stopAllExpressions()}loadExpression(e){return st(this,null,function*(){if(!this.definitions[e]){Ye.warn(this.tag,`Undefined expression at [${e}]`);return}if(this.expressions[e]===null){Ye.warn(this.tag,`Cannot set expression at [${e}] because it's already failed in loading.`);return}if(this.expressions[e])return this.expressions[e];const t=yield this._loadExpression(e);return this.expressions[e]=t,t})}_loadExpression(e){throw new Error("Not implemented.")}setRandomExpression(){return st(this,null,function*(){if(this.definitions.length){const e=[];for(let t=0;t-1&&eu&&(s*=u/l,a*=u/l),this.vx+=s,this.vy+=a;const c=Math.sqrt(Zn(this.vx,2)+Zn(this.vy,2)),f=.5*(Math.sqrt(Zn(u,2)+8*u*i)-u);c>f&&(this.vx*=f/c,this.vy*=f/c),this.x+=this.vx,this.y+=this.vy}}class Du{constructor(e){this.json=e;let t=e.url;if(typeof t!="string")throw new TypeError("The `url` field in settings JSON must be defined as a string.");this.url=t,this.name=v1(this.url)}resolveURL(e){return es.resolve(this.url,e)}replaceFiles(e){this.moc=e(this.moc,"moc"),this.pose!==void 0&&(this.pose=e(this.pose,"pose")),this.physics!==void 0&&(this.physics=e(this.physics,"physics"));for(let t=0;t(e.push(t),t)),e}validateFiles(e){const t=(o,s)=>{const a=this.resolveURL(o);if(!e.includes(a)){if(s)throw new Error(`File "${o}" is defined in settings, but doesn't exist in given files`);return!1}return!0};return[this.moc,...this.textures].forEach(o=>t(o,!0)),this.getDefinedFiles().filter(o=>t(o,!1))}}var Go=(r=>(r[r.NONE=0]="NONE",r[r.IDLE=1]="IDLE",r[r.NORMAL=2]="NORMAL",r[r.FORCE=3]="FORCE",r))(Go||{});class w1{constructor(){this.debug=!1,this.currentPriority=0,this.reservePriority=0}reserve(e,t,n){if(n<=0)return Ye.log(this.tag,"Cannot start a motion with MotionPriority.NONE."),!1;if(e===this.currentGroup&&t===this.currentIndex)return Ye.log(this.tag,"Motion is already playing.",this.dump(e,t)),!1;if(e===this.reservedGroup&&t===this.reservedIndex||e===this.reservedIdleGroup&&t===this.reservedIdleIndex)return Ye.log(this.tag,"Motion is already reserved.",this.dump(e,t)),!1;if(n===1){if(this.currentPriority!==0)return Ye.log(this.tag,"Cannot start idle motion because another motion is playing.",this.dump(e,t)),!1;if(this.reservedIdleGroup!==void 0)return Ye.log(this.tag,"Cannot start idle motion because another idle motion has reserved.",this.dump(e,t)),!1;this.setReservedIdle(e,t)}else{if(n<3){if(n<=this.currentPriority)return Ye.log(this.tag,"Cannot start motion because another motion is playing as an equivalent or higher priority.",this.dump(e,t)),!1;if(n<=this.reservePriority)return Ye.log(this.tag,"Cannot start motion because another motion has reserved as an equivalent or higher priority.",this.dump(e,t)),!1}this.setReserved(e,t,n)}return!0}start(e,t,n,i){if(i===1){if(this.setReservedIdle(void 0,void 0),this.currentPriority!==0)return Ye.log(this.tag,"Cannot start idle motion because another motion is playing.",this.dump(t,n)),!1}else{if(t!==this.reservedGroup||n!==this.reservedIndex)return Ye.log(this.tag,"Cannot start motion because another motion has taken the place.",this.dump(t,n)),!1;this.setReserved(void 0,void 0,0)}return e?(this.setCurrent(t,n,i),!0):!1}complete(){this.setCurrent(void 0,void 0,0)}setCurrent(e,t,n){this.currentPriority=n,this.currentGroup=e,this.currentIndex=t}setReserved(e,t,n){this.reservePriority=n,this.reservedGroup=e,this.reservedIndex=t}setReservedIdle(e,t){this.reservedIdleGroup=e,this.reservedIdleIndex=t}isActive(e,t){return e===this.currentGroup&&t===this.currentIndex||e===this.reservedGroup&&t===this.reservedIndex||e===this.reservedIdleGroup&&t===this.reservedIdleIndex}reset(){this.setCurrent(void 0,void 0,0),this.setReserved(void 0,void 0,0),this.setReservedIdle(void 0,void 0)}shouldRequestIdleMotion(){return this.currentGroup===void 0&&this.reservedIdleGroup===void 0}shouldOverrideExpression(){return!Ut.preserveExpressionOnMotion&&this.currentPriority>1}dump(e,t){if(this.debug){const n=["currentPriority","reservePriority","currentGroup","currentIndex","reservedGroup","reservedIndex","reservedIdleGroup","reservedIdleIndex"];return` - group = "${e}", index = ${t} -`+n.map(i=>"["+i+"] "+this[i]).join(` -`)}return""}}const T1="SoundManager",S1=.5;class lr{static get volume(){return this._volume}static set volume(e){this._volume=(e>1?1:e<0?0:e)||0,this.audios.forEach(t=>t.volume=this._volume)}static add(e,t,n){const i=new Audio(e);return i.volume=this._volume,i.preload="auto",i.addEventListener("ended",()=>{this.dispose(i),t==null||t()}),i.addEventListener("error",o=>{this.dispose(i),Ye.warn(T1,`Error occurred on "${e}"`,o.error),n==null||n(o.error)}),this.audios.push(i),i}static play(e){return new Promise((t,n)=>{var i;(i=e.play())==null||i.catch(o=>{e.dispatchEvent(new ErrorEvent("error",{error:o})),n(o)}),e.readyState===e.HAVE_ENOUGH_DATA?t():e.addEventListener("canplaythrough",t)})}static dispose(e){e.pause(),e.removeAttribute("src"),y1(this.audios,e)}static destroy(){for(let e=this.audios.length-1;e>=0;e--)this.dispose(this.audios[e])}}lr.audios=[];lr._volume=S1;var Rp=(r=>(r.ALL="ALL",r.IDLE="IDLE",r.NONE="NONE",r))(Rp||{});class Bu extends br{constructor(e,t){super(),this.motionGroups={},this.state=new w1,this.playing=!1,this.destroyed=!1,this.settings=e,this.tag=`MotionManager(${e.name})`,this.state.tag=this.tag}init(e){e!=null&&e.idleMotionGroup&&(this.groups.idle=e.idleMotionGroup),this.setupMotions(e),this.stopAllMotions()}setupMotions(e){for(const n of Object.keys(this.definitions))this.motionGroups[n]=[];let t;switch(e==null?void 0:e.motionPreload){case"NONE":return;case"ALL":t=Object.keys(this.definitions);break;case"IDLE":default:t=[this.groups.idle];break}for(const n of t)if(this.definitions[n])for(let i=0;ithis.currentAudio=void 0,()=>this.currentAudio=void 0),this.currentAudio=l}catch(f){Ye.warn(this.tag,"Failed to create audio",c,f)}}const u=yield this.loadMotion(n,i);if(l){const c=lr.play(l).catch(f=>Ye.warn(this.tag,"Failed to play audio",l.src,f));Ut.motionSync&&(yield c)}return this.state.start(u,n,i,o)?(Ye.log(this.tag,"Start motion:",this.getMotionName(a)),this.emit("motionStart",n,i,l),this.state.shouldOverrideExpression()&&this.expressionManager&&this.expressionManager.resetExpression(),this.playing=!0,this._startMotion(u),!0):(l&&(lr.dispose(l),this.currentAudio=void 0),!1)})}startRandomMotion(e,t){return st(this,null,function*(){const n=this.definitions[e];if(n!=null&&n.length){const i=[];for(let o=0;ot.index>=0);for(const t of e)this.hitAreas[t.name]=t}hitTest(e,t){return Object.keys(this.hitAreas).filter(n=>this.isHit(n,e,t))}isHit(e,t,n){if(!this.hitAreas[e])return!1;const i=this.hitAreas[e].index,o=this.getDrawableBounds(i,E1);return o.x<=t&&t<=o.x+o.width&&o.y<=n&&n<=o.y+o.height}getDrawableBounds(e,t){const n=this.getDrawableVertices(e);let i=n[0],o=n[0],s=n[1],a=n[1];for(let l=0;l{(o.status===200||o.status===0)&&o.response?n(o.response):o.onerror()},o.onerror=()=>{Ye.warn(C1,`Failed to load resource as ${o.responseType} (Status ${o.status}): ${e}`),i(new Yf("Network error.",e,o.status))},o.onabort=()=>i(new Yf("Aborted.",e,o.status,!0)),o.onloadend=()=>{var s;Mt.allXhrSet.delete(o),r&&((s=Mt.xhrMap.get(r))==null||s.delete(o))},o}static cancelXHRs(){var r;(r=Mt.xhrMap.get(this))==null||r.forEach(e=>{e.abort(),Mt.allXhrSet.delete(e)}),Mt.xhrMap.delete(this)}static release(){Mt.allXhrSet.forEach(r=>r.abort()),Mt.allXhrSet.clear(),Mt.xhrMap=new WeakMap}};let rs=Mt;rs.xhrMap=new WeakMap;rs.allXhrSet=new Set;rs.loader=(r,e)=>new Promise((t,n)=>{Mt.createXHR(r.target,r.settings?r.settings.resolveURL(r.url):r.url,r.type,o=>{r.result=o,t()},n).send()});function Op(r,e){let t=-1;return n(0);function n(i,o){if(o)return Promise.reject(o);if(i<=t)return Promise.reject(new Error("next() called multiple times"));t=i;const s=r[i];if(!s)return Promise.resolve();try{return Promise.resolve(s(e,n.bind(null,i+1)))}catch(a){return Promise.reject(a)}}}class $n{static load(e){return Op(this.middlewares,e).then(()=>e.result)}}$n.middlewares=[rs.loader];function I1(r,e={}){var t;const n={resourceOptions:{crossorigin:e.crossOrigin}};if(mr.fromURL)return mr.fromURL(r,n).catch(s=>{if(s instanceof Error)throw s;const a=new Error("Texture loading error");throw a.event=s,a});n.resourceOptions.autoLoad=!1;const i=mr.from(r,n);if(i.baseTexture.valid)return Promise.resolve(i);const o=i.baseTexture.resource;return(t=o._live2d_load)!=null||(o._live2d_load=new Promise((s,a)=>{const l=u=>{o.source.removeEventListener("error",l);const c=new Error("Texture loading error");c.event=u,a(c)};o.source.addEventListener("error",l),o.load().then(()=>s(i)).catch(l)})),o._live2d_load}const Kf="Live2DFactory",Fp=(r,e)=>st(void 0,null,function*(){if(typeof r.source=="string"){const t=yield $n.load({url:r.source,type:"json",target:r.live2dModel});t.url=r.source,r.source=t,r.live2dModel.emit("settingsJSONLoaded",t)}return e()}),Lp=(r,e)=>st(void 0,null,function*(){if(r.source instanceof Du)return r.settings=r.source,e();if(typeof r.source=="object"){const t=ct.findRuntime(r.source);if(t){const n=t.createModelSettings(r.source);return r.settings=n,r.live2dModel.emit("settingsLoaded",n),e()}}throw new TypeError("Unknown settings format.")}),Np=(r,e)=>{if(r.settings){const t=ct.findRuntime(r.settings);if(t)return t.ready().then(e)}return e()},Dp=(r,e)=>st(void 0,null,function*(){yield e();const t=r.internalModel;if(t){const n=r.settings,i=ct.findRuntime(n);if(i){const o=[];n.pose&&o.push($n.load({settings:n,url:n.pose,type:"json",target:t}).then(s=>{t.pose=i.createPose(t.coreModel,s),r.live2dModel.emit("poseLoaded",t.pose)}).catch(s=>{r.live2dModel.emit("poseLoadError",s),Ye.warn(Kf,"Failed to load pose.",s)})),n.physics&&o.push($n.load({settings:n,url:n.physics,type:"json",target:t}).then(s=>{t.physics=i.createPhysics(t.coreModel,s),r.live2dModel.emit("physicsLoaded",t.physics)}).catch(s=>{r.live2dModel.emit("physicsLoadError",s),Ye.warn(Kf,"Failed to load physics.",s)})),o.length&&(yield Promise.all(o))}}}),Bp=(r,e)=>st(void 0,null,function*(){if(r.settings){const t=r.live2dModel,n=r.settings.textures.map(i=>{const o=r.settings.resolveURL(i);return I1(o,{crossOrigin:r.options.crossOrigin})});if(yield e(),r.internalModel)t.internalModel=r.internalModel,t.emit("modelLoaded",r.internalModel);else throw new TypeError("Missing internal model.");t.textures=yield Promise.all(n),t.emit("textureLoaded",t.textures)}else throw new TypeError("Missing settings.")}),Up=(r,e)=>st(void 0,null,function*(){const t=r.settings;if(t instanceof Du){const n=ct.findRuntime(t);if(!n)throw new TypeError("Unknown model settings.");const i=yield $n.load({settings:t,url:t.moc,type:"arraybuffer",target:r.live2dModel});if(!n.isValidMoc(i))throw new Error("Invalid moc data");const o=n.createCoreModel(i);return r.internalModel=n.createInternalModel(o,t,r.options),e()}throw new TypeError("Missing settings.")}),Et=class{static registerRuntime(r){Et.runtimes.push(r),Et.runtimes.sort((e,t)=>t.version-e.version)}static findRuntime(r){for(const e of Et.runtimes)if(e.test(r))return e}static setupLive2DModel(r,e,t){return st(this,null,function*(){const n=new Promise(s=>r.once("textureLoaded",s)),i=new Promise(s=>r.once("modelLoaded",s)),o=Promise.all([n,i]).then(()=>r.emit("ready"));yield Op(Et.live2DModelMiddlewares,{live2dModel:r,source:e,options:t||{}}),yield o,r.emit("load")})}static loadMotion(r,e,t){var n,i;const o=s=>r.emit("motionLoadError",e,t,s);try{const s=(n=r.definitions[e])==null?void 0:n[t];if(!s)return Promise.resolve(void 0);r.listeners("destroy").includes(Et.releaseTasks)||r.once("destroy",Et.releaseTasks);let a=Et.motionTasksMap.get(r);a||(a={},Et.motionTasksMap.set(r,a));let l=a[e];l||(l=[],a[e]=l);const u=r.getMotionFile(s);return(i=l[t])!=null||(l[t]=$n.load({url:u,settings:r.settings,type:r.motionDataType,target:r}).then(c=>{var f;const d=(f=Et.motionTasksMap.get(r))==null?void 0:f[e];d&&delete d[t];const h=r.createMotion(c,e,s);return r.emit("motionLoaded",e,t,h),h}).catch(c=>{Ye.warn(r.tag,`Failed to load motion: ${u} -`,c),o(c)})),l[t]}catch(s){Ye.warn(r.tag,`Failed to load motion at "${e}"[${t}] -`,s),o(s)}return Promise.resolve(void 0)}static loadExpression(r,e){var t;const n=i=>r.emit("expressionLoadError",e,i);try{const i=r.definitions[e];if(!i)return Promise.resolve(void 0);r.listeners("destroy").includes(Et.releaseTasks)||r.once("destroy",Et.releaseTasks);let o=Et.expressionTasksMap.get(r);o||(o=[],Et.expressionTasksMap.set(r,o));const s=r.getExpressionFile(i);return(t=o[e])!=null||(o[e]=$n.load({url:s,settings:r.settings,type:"json",target:r}).then(a=>{const l=Et.expressionTasksMap.get(r);l&&delete l[e];const u=r.createExpression(a,i);return r.emit("expressionLoaded",e,u),u}).catch(a=>{Ye.warn(r.tag,`Failed to load expression: ${s} -`,a),n(a)})),o[e]}catch(i){Ye.warn(r.tag,`Failed to load expression at [${e}] -`,i),n(i)}return Promise.resolve(void 0)}static releaseTasks(){this instanceof Bu?Et.motionTasksMap.delete(this):Et.expressionTasksMap.delete(this)}};let ct=Et;ct.runtimes=[];ct.urlToJSON=Fp;ct.jsonToSettings=Lp;ct.waitUntilReady=Np;ct.setupOptionals=Dp;ct.setupEssentials=Bp;ct.createInternalModel=Up;ct.live2DModelMiddlewares=[Fp,Lp,Np,Dp,Bp,Up];ct.motionTasksMap=new WeakMap;ct.expressionTasksMap=new WeakMap;Bu.prototype._loadMotion=function(r,e){return ct.loadMotion(this,r,e)};Pp.prototype._loadExpression=function(r){return ct.loadExpression(this,r)};class M1{constructor(){this._autoInteract=!1}get autoInteract(){return this._autoInteract}set autoInteract(e){e!==this._autoInteract&&(e?this.on("pointertap",Zf,this):this.off("pointertap",Zf,this),this._autoInteract=e)}registerInteraction(e){e!==this.interactionManager&&(this.unregisterInteraction(),this._autoInteract&&e&&(this.interactionManager=e,e.on("pointermove",Jf,this)))}unregisterInteraction(){var e;this.interactionManager&&((e=this.interactionManager)==null||e.off("pointermove",Jf,this),this.interactionManager=void 0)}}function Zf(r){this.tap(r.data.global.x,r.data.global.y)}function Jf(r){this.focus(r.data.global.x,r.data.global.y)}class k1 extends rp{}const Wt=new at,P1=new Ct;let Mn;class Hl extends Bo{constructor(e){super(),this.tag="Live2DModel(uninitialized)",this.textures=[],this.transform=new k1,this.anchor=new Ur(this.onAnchorChange,this,0,0),this.glContextID=-1,this.elapsedTime=performance.now(),this.deltaTime=0,this._autoUpdate=!1,this.once("modelLoaded",()=>this.init(e))}static from(e,t){const n=new this(t);return ct.setupLive2DModel(n,e,t).then(()=>n)}static fromSync(e,t){const n=new this(t);return ct.setupLive2DModel(n,e,t).then(t==null?void 0:t.onLoad).catch(t==null?void 0:t.onError),n}static registerTicker(e){Mn=e}get autoUpdate(){return this._autoUpdate}set autoUpdate(e){var t;Mn||(Mn=(t=window.PIXI)==null?void 0:t.Ticker),e?this._destroyed||(Mn?(Mn.shared.add(this.onTickerUpdate,this),this._autoUpdate=!0):Ye.warn(this.tag,"No Ticker registered, please call Live2DModel.registerTicker(Ticker).")):(Mn==null||Mn.shared.remove(this.onTickerUpdate,this),this._autoUpdate=!1)}init(e){this.tag=`Live2DModel(${this.internalModel.settings.name})`;const t=Object.assign({autoUpdate:!0,autoInteract:!0},e);t.autoInteract&&(this.interactive=!0),this.autoInteract=t.autoInteract,this.autoUpdate=t.autoUpdate}onAnchorChange(){this.pivot.set(this.anchor.x*this.internalModel.width,this.anchor.y*this.internalModel.height)}motion(e,t,n){return t===void 0?this.internalModel.motionManager.startRandomMotion(e,n):this.internalModel.motionManager.startMotion(e,t,n)}expression(e){return this.internalModel.motionManager.expressionManager?e===void 0?this.internalModel.motionManager.expressionManager.setRandomExpression():this.internalModel.motionManager.expressionManager.setExpression(e):Promise.resolve(!1)}focus(e,t,n=!1){Wt.x=e,Wt.y=t,this.toModelPosition(Wt,Wt,!0);let i=Wt.x/this.internalModel.originalWidth*2-1,o=Wt.y/this.internalModel.originalHeight*2-1,s=Math.atan2(o,i);this.internalModel.focusController.focus(Math.cos(s),-Math.sin(s),n)}tap(e,t){const n=this.hitTest(e,t);n.length&&(Ye.log(this.tag,"Hit",n),this.emit("hit",n))}hitTest(e,t){return Wt.x=e,Wt.y=t,this.toModelPosition(Wt,Wt),this.internalModel.hitTest(Wt.x,Wt.y)}toModelPosition(e,t=e.clone(),n){return n||(this._recursivePostUpdateTransform(),this.parent?this.displayObjectUpdateTransform():(this.parent=this._tempDisplayObjectParent,this.displayObjectUpdateTransform(),this.parent=null)),this.transform.worldTransform.applyInverse(e,t),this.internalModel.localTransform.applyInverse(t,t),t}containsPoint(e){return this.getBounds(!0).contains(e.x,e.y)}_calculateBounds(){this._bounds.addFrame(this.transform,0,0,this.internalModel.width,this.internalModel.height)}onTickerUpdate(){this.update(Mn.shared.deltaMS)}update(e){this.deltaTime+=e,this.elapsedTime+=e}_render(e){this.registerInteraction(e.plugins.interaction),e.batch.reset(),e.geometry.reset(),e.shader.reset(),e.state.reset();let t=!1;this.glContextID!==e.CONTEXT_UID&&(this.glContextID=e.CONTEXT_UID,this.internalModel.updateWebGLContext(e.gl,this.glContextID),t=!0);for(let o=0;ot.destroy(e.baseTexture)),this.internalModel.destroy(),super.destroy(e)}}kp(Hl,[M1]);const un=class{static resolveURL(r,e){var t;const n=(t=un.filesMap[r])==null?void 0:t[e];if(n===void 0)throw new Error("Cannot find this file from uploaded files: "+e);return n}static upload(r,e){return st(this,null,function*(){const t={};for(const n of e.getDefinedFiles()){const i=decodeURI(es.resolve(e.url,n)),o=r.find(s=>s.webkitRelativePath===i);o&&(t[n]=URL.createObjectURL(o))}un.filesMap[e._objectURL]=t})}static createSettings(r){return st(this,null,function*(){const e=r.find(s=>s.name.endsWith("model.json")||s.name.endsWith("model3.json"));if(!e)throw new TypeError("Settings file not found");const t=yield un.readText(e),n=JSON.parse(t);n.url=e.webkitRelativePath;const i=ct.findRuntime(n);if(!i)throw new Error("Unknown settings JSON");const o=i.createModelSettings(n);return o._objectURL=URL.createObjectURL(e),o})}static readText(r){return st(this,null,function*(){return new Promise((e,t)=>{const n=new FileReader;n.onload=()=>e(n.result),n.onerror=t,n.readAsText(r,"utf8")})})}};let Uu=un;Uu.filesMap={};Uu.factory=(r,e)=>st(void 0,null,function*(){if(Array.isArray(r.source)&&r.source[0]instanceof File){const t=r.source;let n=t.settings;if(!n)n=yield un.createSettings(t);else if(!n._objectURL)throw new Error('"_objectURL" must be specified in ModelSettings');n.validateFiles(t.map(i=>encodeURI(i.webkitRelativePath))),yield un.upload(t,n),n.resolveURL=function(i){return un.resolveURL(this._objectURL,i)},r.source=n,r.live2dModel.once("modelLoaded",i=>{i.once("destroy",function(){const o=this.settings._objectURL;if(URL.revokeObjectURL(o),un.filesMap[o])for(const s of Object.values(un.filesMap[o]))URL.revokeObjectURL(s);delete un.filesMap[o]})})}return e()});ct.live2DModelMiddlewares.unshift(Uu.factory);const Ot=class{static unzip(r,e){return st(this,null,function*(){const t=yield Ot.getFilePaths(r),n=[];for(const o of e.getDefinedFiles()){const s=decodeURI(es.resolve(e.url,o));t.includes(s)&&n.push(s)}const i=yield Ot.getFiles(r,n);for(let o=0;os.endsWith("model.json")||s.endsWith("model3.json"));if(!t)throw new Error("Settings file not found");const n=yield Ot.readText(r,t);if(!n)throw new Error("Empty settings file: "+t);const i=JSON.parse(n);i.url=t;const o=ct.findRuntime(i);if(!o)throw new Error("Unknown settings JSON");return o.createModelSettings(i)})}static zipReader(r,e){return st(this,null,function*(){throw new Error("Not implemented")})}static getFilePaths(r){return st(this,null,function*(){throw new Error("Not implemented")})}static getFiles(r,e){return st(this,null,function*(){throw new Error("Not implemented")})}static readText(r,e){return st(this,null,function*(){throw new Error("Not implemented")})}static releaseReader(r){}};let Hn=Ot;Hn.ZIP_PROTOCOL="zip://";Hn.uid=0;Hn.factory=(r,e)=>st(void 0,null,function*(){const t=r.source;let n,i,o;if(typeof t=="string"&&(t.endsWith(".zip")||t.startsWith(Ot.ZIP_PROTOCOL))?(t.startsWith(Ot.ZIP_PROTOCOL)?n=t.slice(Ot.ZIP_PROTOCOL.length):n=t,i=yield $n.load({url:n,type:"blob",target:r.live2dModel})):Array.isArray(t)&&t.length===1&&t[0]instanceof File&&t[0].name.endsWith(".zip")&&(i=t[0],n=URL.createObjectURL(i),o=t.settings),i){if(!i.size)throw new Error("Empty zip file");const s=yield Ot.zipReader(i,n);o||(o=yield Ot.createSettings(s)),o._objectURL=Ot.ZIP_PROTOCOL+Ot.uid+"/"+o.url;const a=yield Ot.unzip(s,o);a.settings=o,r.source=a,n.startsWith("blob:")&&r.live2dModel.once("modelLoaded",l=>{l.once("destroy",function(){URL.revokeObjectURL(n)})}),Ot.releaseReader(s)}return e()});ct.live2DModelMiddlewares.unshift(Hn.factory);if(!window.Live2DCubismCore)throw new Error("Could not find Cubism 4 runtime. This plugin requires live2dcubismcore.js to be loaded.");class R1 extends Pp{constructor(e,t){var n;super(e,t),this.queueManager=new Ap,this.definitions=(n=e.expressions)!=null?n:[],this.init()}isFinished(){return this.queueManager.isFinished()}getExpressionIndex(e){return this.definitions.findIndex(t=>t.Name===e)}getExpressionFile(e){return e.File}createExpression(e,t){return Ru.create(e)}_setExpression(e){return this.queueManager.startMotion(e,!1,performance.now())}stopAllExpressions(){this.queueManager.stopAllMotions()}updateParameters(e,t){return this.queueManager.doUpdateMotion(e,t)}}class Hr extends Du{constructor(e){if(super(e),!Hr.isValidJSON(e))throw new TypeError("Invalid JSON.");Object.assign(this,new Mp(e))}static isValidJSON(e){var t;return!!(e!=null&&e.FileReferences)&&typeof e.FileReferences.Moc=="string"&&((t=e.FileReferences.Textures)==null?void 0:t.length)>0&&e.FileReferences.Textures.every(n=>typeof n=="string")}replaceFiles(e){if(super.replaceFiles(e),this.motions)for(const[t,n]of Object.entries(this.motions))for(let i=0;i{this.emit("motion:"+n)})}isFinished(){return this.queueManager.isFinished()}_startMotion(e,t){return e.setFinishedMotionHandler(t),this.queueManager.stopAllMotions(),this.queueManager.startMotion(e,!1,performance.now())}_stopAllMotions(){this.queueManager.stopAllMotions()}createMotion(e,t,n){const i=Fu.create(e),o=new Ep(e),s=(t===this.groups.idle?Ut.idleMotionFadingDuration:Ut.motionFadingDuration)/1e3;return o.getMotionFadeInTime()===void 0&&i.setFadeInTime(n.FadeInTime>0?n.FadeInTime:s),o.getMotionFadeOutTime()===void 0&&i.setFadeOutTime(n.FadeOutTime>0?n.FadeOutTime:s),i.setEffectIds(this.eyeBlinkIds,this.lipSyncIds),i}getMotionFile(e){return e.File}getMotionName(e){return e.File}getSoundFile(e){return e.Sound}updateParameters(e,t){return this.queueManager.doUpdateMotion(e,t)}destroy(){super.destroy(),this.queueManager.release(),this.queueManager=void 0}}const Qf=new Qt;class F1 extends A1{constructor(e,t,n){super(),this.lipSync=!0,this.breath=Iu.create(),this.renderer=new Ip,this.idParamAngleX=c1,this.idParamAngleY=f1,this.idParamAngleZ=h1,this.idParamEyeBallX=d1,this.idParamEyeBallY=p1,this.idParamBodyAngleX=m1,this.idParamBreath=g1,this.pixelsPerUnit=1,this.centeringTransform=new Ct,this.coreModel=e,this.settings=t,this.motionManager=new O1(t,n),this.init()}init(){var e;super.init(),((e=this.settings.getEyeBlinkParameters())==null?void 0:e.length)>0&&(this.eyeBlink=Tp.create(this.settings)),this.breath.setParameters([new ui(this.idParamAngleX,0,15,6.5345,.5),new ui(this.idParamAngleY,0,8,3.5345,.5),new ui(this.idParamAngleZ,0,10,5.5345,.5),new ui(this.idParamBodyAngleX,0,4,15.5345,.5),new ui(this.idParamBreath,0,.5,3.2345,.5)]),this.renderer.initialize(this.coreModel),this.renderer.setIsPremultipliedAlpha(!0)}getSize(){return[this.coreModel.getModel().canvasinfo.CanvasWidth,this.coreModel.getModel().canvasinfo.CanvasHeight]}getLayout(){const e={};if(this.settings.layout)for(const t of Object.keys(this.settings.layout)){const n=t.charAt(0).toLowerCase()+t.slice(1);e[n]=this.settings.layout[t]}return e}setupLayout(){super.setupLayout(),this.pixelsPerUnit=this.coreModel.getModel().canvasinfo.PixelsPerUnit,this.centeringTransform.scale(this.pixelsPerUnit,this.pixelsPerUnit).translate(this.originalWidth/2,this.originalHeight/2)}updateWebGLContext(e,t){this.renderer.firstDraw=!0,this.renderer._bufferData={vertex:null,uv:null,index:null},this.renderer.startUp(e),this.renderer._clippingManager._currentFrameNo=t,this.renderer._clippingManager._maskTexture=void 0,$r.getInstance()._shaderSets=[]}bindTexture(e,t){this.renderer.bindTexture(e,t)}getHitAreaDefs(){var e,t;return(t=(e=this.settings.hitAreas)==null?void 0:e.map(n=>({id:n.Id,name:n.Name,index:this.coreModel.getDrawableIndex(n.Id)})))!=null?t:[]}getDrawableIDs(){return this.coreModel.getDrawableIds()}getDrawableIndex(e){return this.coreModel.getDrawableIndex(e)}getDrawableVertices(e){if(typeof e=="string"&&(e=this.coreModel.getDrawableIndex(e),e===-1))throw new TypeError("Unable to find drawable ID: "+e);const t=this.coreModel.getDrawableVertices(e).slice();for(let n=0;n{function t(){try{N1(),r()}catch(n){if(eh--,eh<0){const i=new Error("Failed to start up Cubism 4 framework.");i.cause=n,e(i);return}Ye.log("Cubism4","Startup failed, retrying 10ms later..."),setTimeout(t,10)}}t()})),no)}function N1(r){r=Object.assign({logFunction:console.log,loggingLevel:wr.LogLevel_Verbose},r),Fi.startUp(r),Fi.initialize()}ct.registerRuntime({version:4,ready:L1,test(r){return r instanceof Hr||Hr.isValidJSON(r)},isValidMoc(r){if(r.byteLength<4)return!1;const e=new Int8Array(r,0,4);return String.fromCharCode(...e)==="MOC3"},createModelSettings(r){return new Hr(r)},createCoreModel(r){const e=Pu.create(r);try{const t=e.createModel();return t.__moc=e,t}catch(t){try{e.release()}catch{}throw t}},createInternalModel(r,e,t){const n=new F1(r,e,t),i=r;return i.__moc&&(n.__moc=i.__moc,delete i.__moc,n.once("destroy",D1)),n},createPhysics(r,e){return Lu.create(e)},createPose(r,e){return Mu.create(e)}});function D1(){var r;(r=this.__moc)==null||r.release()}const B1=De({__name:"Viewer",props:{model:null,mouthOpenSize:{default:0}},setup(r,{expose:e}){const t=r,n=le(),i=le(),o=le(),s=le(),a=le(0),l=le(0),u=Ve(()=>Math.max(0,Math.min(100,t.mouthOpenSize))),c=Wo(),f=wd(Td),d=Ve(()=>f.between("sm","md").value||f.smaller("sm").value),{height:h,width:g}=qo(n,{immediate:!0,windowResize:!0,reset:!0});function v(){return s.value.internalModel.coreModel}function p(b){if(!b.value)return;let x=2.2;d.value&&(x=2.2);const w=h.value*.95/l.value*x,M=g.value*.95/a.value*x,T=Math.min(w,M);b.value.scale.set(T,T)}async function m(b){Hl.registerTicker(wn),ni.add(Iy),i.value=new yp({width:g.value,height:h.value,backgroundAlpha:0}),o.value=i.value.view,o.value.style.objectFit="contain",b.appendChild(i.value.view),s.value=await Hl.from(t.model,{motionPreload:Rp.ALL}),i.value.stage.addChild(s.value),a.value=s.value.width,l.value=s.value.height,s.value.x=g.value/2,s.value.y=h.value,s.value.rotation=Math.PI,s.value.skew.x=Math.PI,s.value.anchor.set(.5,.5),p(s),s.value.on("hit",w=>{s.value&&w.includes("body")&&s.value.motion("tap_body")}),s.value.internalModel.coreModel.setParameterValueById("ParamMouthOpenY",u.value)}async function y(b){await s.value.motion(b,void 0,Go.FORCE)}const _=pg(()=>{i.value&&i.value.renderer.resize(g.value,h.value),o.value&&(o.value.width=g.value,o.value.height=h.value),s.value&&(s.value.x=g.value/2,s.value.y=h.value,p(s))},100);function C(){s.value&&(s.value.filters=[new dx({color:c.value?10053247:14662098,alpha:.3,blur:0,distance:20,rotation:45})])}return Ge([g,h],()=>{_()}),Ge(c,C,{immediate:!0}),Ge(s,C),$t(C),$t(async()=>{n.value&&await m(n.value)}),Ht(()=>{var b;(b=i.value)==null||b.destroy()}),Ge(u,b=>{v().setParameterValueById("ParamMouthOpenY",b)}),e({setMotion:y}),(b,x)=>(de(),xe("div",{ref_key:"containerRef",ref:n,"h-full":"","w-full":""},null,512))}}),zp=De({__name:"Screen",setup(r){const e=le(),t=wd(Td),{width:n,height:i}=mg(),o=qo(e,{immediate:!0,windowResize:!0,reset:!0}),s=Ve(()=>t.between("sm","md").value||t.smaller("sm").value),a=Ve(()=>t.between("md","lg").value),l=Ve(()=>t.greaterOrEqual("lg").value),u=Ve(()=>l.value?o.width.value:s.value||a.value?n.value-16:o.width.value),c=le(0);return Ge([n,i,e],()=>{var d,h;const f=(h=(d=e.value)==null?void 0:d.parentElement)==null?void 0:h.getBoundingClientRect();l.value||s.value||a.value?c.value=(f==null?void 0:f.height)||0:c.value=600}),Ge([o.width,o.height],()=>{l.value||s.value||a.value?c.value=o.height.value:c.value=600}),$t(async()=>{e.value&&o.update()}),(f,d)=>(de(),xe("div",{ref_key:"containerRef",ref:e,"h-full":"","w-full":""},[ut(f.$slots,"default",{width:u.value,height:c.value})],512))}}),U1={absolute:"",bottom:"2",right:"2"},z1={flex:"~ row",bg:"zinc-100 dark:zinc-700",text:"sm zinc-400 dark:zinc-500","h-fit":"","w-fit":"","appearance-none":"","gap-1":"","rounded-lg":"","rounded-md":"","border-none":""},j1=["checked","aria-checked"],V1={key:0,absolute:"","w-full":"","min-w":"50vw",z:"{var o;await((o=t.value)==null?void 0:o.setMotion(i))}}),(i,o)=>{const s=gg("TransitionVertical");return de(),lt(zp,{relative:""},{default:Ue(({width:a,height:l})=>[Fe(B1,{ref_key:"modelRef",ref:t,"canvas-width":a,"canvas-height":l,model:r.model,"mouth-open-size":r.mouthOpenSize},null,8,["canvas-width","canvas-height","model","mouth-open-size"]),K("div",U1,[K("div",z1,[K("label",{"h-fit":"","cursor-pointer":"",class:Jt([n.value?"bg-zinc-300 text-zinc-900 dark:bg-zinc-200 dark:text-zinc-800":""]),transition:"all ease-in-out duration-500","rounded-md":"","px-2":"","py-2":"",z:"n.value=u),checked:n.value,"aria-checked":n.value,name:"showLive2DViewerInspector",type:"checkbox",hidden:"","appearance-none":"","outline-none":""},null,8,j1),[[Kr,n.value]]),o[8]||(o[8]=K("div",{"select-none":""},[K("div",{"i-solar:bug-bold-duotone":"",text:"text-zinc-900 dark:text-zinc-800"})],-1))],2)]),Fe(s,null,{default:Ue(()=>[n.value?(de(),xe("div",V1,[K("div",G1,[K("div",$1,[K("span",null,we(i.$t("stage.viewers.debug-menu.emotions")),1)]),K("div",H1,[K("button",{"rounded-lg":"",bg:"zinc-100/70 dark:zinc-800/50","px-2":"","py-1":"","backdrop-blur-sm":"",onClick:o[1]||(o[1]=u=>{var c;return(c=t.value)==null?void 0:c.setMotion(Y(Tv))})},we(i.$t("stage.viewers.debug-menu.emotions-btn.surprised")),1),K("button",{"rounded-lg":"",bg:"zinc-100/70 dark:zinc-800/50","px-2":"","py-1":"","backdrop-blur-sm":"",onClick:o[2]||(o[2]=u=>{var c;return(c=t.value)==null?void 0:c.setMotion(Y(Sv))})},we(i.$t("stage.viewers.debug-menu.emotions-btn.sad")),1),K("button",{"rounded-lg":"",bg:"zinc-100/70 dark:zinc-800/50","px-2":"","py-1":"","backdrop-blur-sm":"",onClick:o[3]||(o[3]=u=>{var c;return(c=t.value)==null?void 0:c.setMotion(Y(Ev))})},we(i.$t("stage.viewers.debug-menu.emotions-btn.angry")),1),K("button",{"rounded-lg":"",bg:"zinc-100/70 dark:zinc-800/50","px-2":"","py-1":"","backdrop-blur-sm":"",onClick:o[4]||(o[4]=u=>{var c;return(c=t.value)==null?void 0:c.setMotion(Y(Av))})},we(i.$t("stage.viewers.debug-menu.emotions-btn.happy")),1),K("button",{"rounded-lg":"",bg:"zinc-100/70 dark:zinc-800/50","px-2":"","py-1":"","backdrop-blur-sm":"",onClick:o[5]||(o[5]=u=>{var c;return(c=t.value)==null?void 0:c.setMotion(Y(Cv))})},we(i.$t("stage.viewers.debug-menu.emotions-btn.awkward")),1),K("button",{"rounded-lg":"",bg:"zinc-100/70 dark:zinc-800/50","px-2":"","py-1":"","backdrop-blur-sm":"",onClick:o[6]||(o[6]=u=>{var c;return(c=t.value)==null?void 0:c.setMotion(Y(Iv))})},we(i.$t("stage.viewers.debug-menu.emotions-btn.question")),1),K("button",{"rounded-lg":"",bg:"zinc-100/70 dark:zinc-800/50","px-2":"","py-1":"","backdrop-blur-sm":"",onClick:o[7]||(o[7]=u=>{var c;return(c=t.value)==null?void 0:c.setMotion(Y(Kd))})},we(i.$t("stage.viewers.debug-menu.emotions-btn.think")),1)])])])):tt("",!0)]),_:1})])]),_:1})}}});var W1=Object.defineProperty,q1=(r,e,t)=>e in r?W1(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,Y1=(r,e,t)=>q1(r,e+"",t);function K1(r){return Rd()?(Od(r),!0):!1}function jp(r){return typeof r=="function"?r():Y(r)}const Z1=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const J1=Object.prototype.toString,Q1=r=>J1.call(r)==="[object Object]",ew=()=>{},tw=Z1?window:void 0;function nw(r){var e;const t=jp(r);return(e=t==null?void 0:t.$el)!=null?e:t}function ya(...r){let e,t,n,i;if(typeof r[0]=="string"||Array.isArray(r[0])?([t,n,i]=r,e=tw):[e,t,n,i]=r,!e)return ew;Array.isArray(t)||(t=[t]),Array.isArray(n)||(n=[n]);const o=[],s=()=>{o.forEach(c=>c()),o.length=0},a=(c,f,d,h)=>(c.addEventListener(f,d,h),()=>c.removeEventListener(f,d,h)),l=Ge(()=>[nw(e),jp(i)],([c,f])=>{if(s(),!c)return;const d=Q1(f)?{...f}:f;o.push(...t.flatMap(h=>n.map(g=>a(c,h,g,d))))},{immediate:!0,flush:"post"}),u=()=>{l(),s()};return K1(u),u}function Vp(r,e,t,n){const i=class extends Ni{constructor(o={}){const s=Object.entries(r);super({uniforms:s.reduce((a,[l,u])=>{const c=hu.clone({[l]:{value:u}});return{...a,...c}},{}),vertexShader:e,fragmentShader:t}),Y1(this,"key",""),s.forEach(([a])=>Object.defineProperty(this,a,{get:()=>this.uniforms[a].value,set:l=>this.uniforms[a].value=l})),Object.assign(this,o)}};return i.key=gr.generateUUID(),i}Vp({color:new It("white"),scale:new _t(1,1),imageBounds:new _t(1,1),resolution:1024,map:null,zoom:1,radius:0,grayscale:0,opacity:1},` - varying vec2 vUv; - varying vec2 vPos; - void main() { - gl_Position = projectionMatrix * viewMatrix * modelMatrix * vec4(position, 1.); - vUv = uv; - vPos = position.xy; - } - `,` - // mostly from https://gist.github.com/statico/df64c5d167362ecf7b34fca0b1459a44 - varying vec2 vUv; - varying vec2 vPos; - uniform vec2 scale; - uniform vec2 imageBounds; - uniform float resolution; - uniform vec3 color; - uniform sampler2D map; - uniform float radius; - uniform float zoom; - uniform float grayscale; - uniform float opacity; - const vec3 luma = vec3(.299, 0.587, 0.114); - vec4 toGrayscale(vec4 color, float intensity) { - return vec4(mix(color.rgb, vec3(dot(color.rgb, luma)), intensity), color.a); - } - vec2 aspect(vec2 size) { - return size / min(size.x, size.y); - } - - const float PI = 3.14159265; - - // from https://iquilezles.org/articles/distfunctions - float udRoundBox( vec2 p, vec2 b, float r ) { - return length(max(abs(p)-b+r,0.0))-r; - } - - void main() { - vec2 s = aspect(scale); - vec2 i = aspect(imageBounds); - float rs = s.x / s.y; - float ri = i.x / i.y; - vec2 new = rs < ri ? vec2(i.x * s.y / i.y, s.y) : vec2(s.x, i.y * s.x / i.x); - vec2 offset = (rs < ri ? vec2((new.x - s.x) / 2.0, 0.0) : vec2(0.0, (new.y - s.y) / 2.0)) / new; - vec2 uv = vUv * s / new + offset; - vec2 zUv = (uv - vec2(0.5, 0.5)) / zoom + vec2(0.5, 0.5); - - vec2 res = vec2(scale * resolution); - vec2 halfRes = 0.5 * res; - float b = udRoundBox(vUv.xy * res - halfRes, halfRes, resolution * radius); - vec3 a = mix(vec3(1.0,0.0,0.0), vec3(0.0,0.0,0.0), smoothstep(0.0, 1.0, b)); - gl_FragColor = toGrayscale(texture2D(map, zUv) * vec4(color, opacity * a), grayscale); - - #include - #include - } - `);const zu=parseInt(Tg.replace(/\D+/g,""));var rw=Object.defineProperty,iw=(r,e,t)=>e in r?rw(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,ow=(r,e,t)=>(iw(r,e+"",t),t);async function th(r){const e=await r.arrayBuffer(),t=btoa(String.fromCharCode(...new Uint8Array(e)));return`data:${r.type||""};base64,${t}`}let ro,_a,Pr,io;function xa(r,e=1/0,t=null){_a||(_a=new kd(2,2,1,1)),Pr||(Pr=new Ni({uniforms:{blitTexture:new Rg(r)},vertexShader:` - varying vec2 vUv; - void main(){ - vUv = uv; - gl_Position = vec4(position.xy * 1.0,0.,.999999); - } - `,fragmentShader:` - uniform sampler2D blitTexture; - varying vec2 vUv; - - void main(){ - gl_FragColor = vec4(vUv.xy, 0, 1); - - #ifdef IS_SRGB - gl_FragColor = LinearTosRGB( texture2D( blitTexture, vUv) ); - #else - gl_FragColor = texture2D( blitTexture, vUv); - #endif - } - `})),Pr.uniforms.blitTexture.value=r,Pr.defines.IS_SRGB="colorSpace"in r?r.colorSpace==="srgb":r.encoding===3001,Pr.needsUpdate=!0,io||(io=new hr(_a,Pr),io.frustrumCulled=!1);const n=new Dn,i=new Za;i.add(io),t||(t=ro=new Og({antialias:!1})),t.setSize(Math.min(r.image.width,e),Math.min(r.image.height,e)),t.clear(),t.render(i,n);const o=new Mo(t.domElement);return o.minFilter=r.minFilter,o.magFilter=r.magFilter,o.wrapS=r.wrapS,o.wrapT=r.wrapT,o.name=r.name,ro&&(ro.dispose(),ro=null),o}const nh={POSITION:["byte","byte normalized","unsigned byte","unsigned byte normalized","short","short normalized","unsigned short","unsigned short normalized"],NORMAL:["byte normalized","short normalized"],TANGENT:["byte normalized","short normalized"],TEXCOORD:["byte","byte normalized","unsigned byte","short","short normalized","unsigned short"]};class Gp{constructor(){this.pluginCallbacks=[],this.register(function(e){return new mw(e)}),this.register(function(e){return new gw(e)}),this.register(function(e){return new _w(e)}),this.register(function(e){return new xw(e)}),this.register(function(e){return new bw(e)}),this.register(function(e){return new ww(e)}),this.register(function(e){return new vw(e)}),this.register(function(e){return new yw(e)}),this.register(function(e){return new Tw(e)}),this.register(function(e){return new Sw(e)}),this.register(function(e){return new Ew(e)})}register(e){return this.pluginCallbacks.indexOf(e)===-1&&this.pluginCallbacks.push(e),this}unregister(e){return this.pluginCallbacks.indexOf(e)!==-1&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(e),1),this}parse(e,t,n,i){const o=new pw,s=[];for(let a=0,l=this.pluginCallbacks.length;ar.times[r.times.length-1]){if(Math.abs(r.times[r.times.length-1]-e)<.001)return r.times.length-1;n[n.length-1]=e,n.set(r.times,0),i.set(r.values,0),i.set(o.evaluate(e),r.values.length),s=n.length-1}else for(let a=0;ae){n.set(r.times.slice(0,a+1),0),n[a+1]=e,n.set(r.times.slice(a+1),a+2),i.set(r.values.slice(0,(a+1)*t),0),i.set(o.evaluate(e),(a+1)*t),i.set(r.values.slice((a+1)*t),(a+2)*t),s=a+1;break}}return r.times=n,r.values=i,s},mergeMorphTargetTracks:function(r,e){const t=[],n={},i=r.tracks;for(let o=0;o4?s=r.array[i*r.itemSize+o]:(o===0?s=r.getX(i):o===1?s=r.getY(i):o===2?s=r.getZ(i):o===3&&(s=r.getW(i)),r.normalized===!0&&(s=gr.normalize(s,r.array))),n.min[o]=Math.min(n.min[o],s),n.max[o]=Math.max(n.max[o],s)}return n}function $p(r){return Math.ceil(r/4)*4}function wa(r,e=0){const t=$p(r.byteLength);if(t!==r.byteLength){const n=new Uint8Array(t);if(n.set(new Uint8Array(r)),e!==0)for(let i=r.byteLength;i"u"&&typeof OffscreenCanvas<"u"?new OffscreenCanvas(1,1):document.createElement("canvas")}function ah(r,e){if(r.toBlob!==void 0)return new Promise(n=>r.toBlob(n,e));let t;return e==="image/jpeg"?t=.92:e==="image/webp"&&(t=.8),r.convertToBlob({type:e,quality:t})}let pw=class{constructor(){this.plugins=[],this.options={},this.pending=[],this.buffers=[],this.byteOffset=0,this.buffers=[],this.nodeMap=new Map,this.skins=[],this.extensionsUsed={},this.extensionsRequired={},this.uids=new Map,this.uid=0,this.json={asset:{version:"2.0",generator:"THREE.GLTFExporter"}},this.cache={meshes:new Map,attributes:new Map,attributesNormalized:new Map,materials:new Map,textures:new Map,images:new Map}}setPlugins(e){this.plugins=e}async write(e,t,n={}){this.options=Object.assign({binary:!1,trs:!1,onlyVisible:!0,maxTextureSize:1/0,animations:[],includeCustomExtensions:!1},n),this.options.animations.length>0&&(this.options.trs=!0),this.processInput(e),await Promise.all(this.pending);const i=this,o=i.buffers,s=i.json;n=i.options;const a=i.extensionsUsed,l=i.extensionsRequired,u=new Blob(o,{type:"application/octet-stream"}),c=Object.keys(a),f=Object.keys(l);c.length>0&&(s.extensionsUsed=c),f.length>0&&(s.extensionsRequired=f),s.buffers&&s.buffers.length>0&&(s.buffers[0].byteLength=u.size),n.binary===!0?u.arrayBuffer().then(d=>{const h=wa(d),g=new DataView(new ArrayBuffer(oh));g.setUint32(0,h.byteLength,!0),g.setUint32(4,cw,!0);const v=wa(fw(JSON.stringify(s)),32),p=new DataView(new ArrayBuffer(oh));p.setUint32(0,v.byteLength,!0),p.setUint32(4,uw,!0);const m=new ArrayBuffer(ih),y=new DataView(m);y.setUint32(0,aw,!0),y.setUint32(4,lw,!0);const _=ih+p.byteLength+v.byteLength+g.byteLength+h.byteLength;y.setUint32(8,_,!0),new Blob([m,p,v,g,h],{type:"application/octet-stream"}).arrayBuffer().then(t)}):s.buffers&&s.buffers.length>0?th(u).then(d=>{s.buffers[0].uri=d,t(s)}):t(s)}serializeUserData(e,t){if(Object.keys(e.userData).length===0)return;const n=this.options,i=this.extensionsUsed;try{const o=JSON.parse(JSON.stringify(e.userData));if(n.includeCustomExtensions&&o.gltfExtensions){t.extensions===void 0&&(t.extensions={});for(const s in o.gltfExtensions)t.extensions[s]=o.gltfExtensions[s],i[s]=!0;delete o.gltfExtensions}Object.keys(o).length>0&&(t.extras=o)}catch(o){console.warn("THREE.GLTFExporter: userData of '"+e.name+"' won't be serialized because of JSON.stringify error - "+o.message)}}getUID(e,t=!1){if(this.uids.has(e)===!1){const n=new Map;n.set(!0,this.uid++),n.set(!1,this.uid++),this.uids.set(e,n)}return this.uids.get(e).get(t)}isNormalizedNormalAttribute(e){if(this.cache.attributesNormalized.has(e))return!1;const t=new Me;for(let n=0,i=e.count;n5e-4)return!1;return!0}createNormalizedNormalAttribute(e){const t=this.cache;if(t.attributesNormalized.has(e))return t.attributesNormalized.get(e);const n=e.clone(),i=new Me;for(let o=0,s=n.count;o4?g=e.array[d*e.itemSize+h]:(h===0?g=e.getX(d):h===1?g=e.getY(d):h===2?g=e.getZ(d):h===3&&(g=e.getW(d)),e.normalized===!0&&(g=gr.normalize(g,e.array))),t===je.FLOAT?u.setFloat32(c,g,!0):t===je.INT?u.setInt32(c,g,!0):t===je.UNSIGNED_INT?u.setUint32(c,g,!0):t===je.SHORT?u.setInt16(c,g,!0):t===je.UNSIGNED_SHORT?u.setUint16(c,g,!0):t===je.BYTE?u.setInt8(c,g):t===je.UNSIGNED_BYTE&&u.setUint8(c,g),c+=a}const f={buffer:this.processBuffer(u.buffer),byteOffset:this.byteOffset,byteLength:l};return o!==void 0&&(f.target=o),o===je.ARRAY_BUFFER&&(f.byteStride=e.itemSize*a),this.byteOffset+=l,s.bufferViews.push(f),{id:s.bufferViews.length-1,byteLength:0}}processBufferViewImage(e){const t=this,n=t.json;return n.bufferViews||(n.bufferViews=[]),e.arrayBuffer().then(i=>{const o=wa(i),s={buffer:t.processBuffer(o),byteOffset:t.byteOffset,byteLength:o.byteLength};return t.byteOffset+=o.byteLength,n.bufferViews.push(s)-1})}processAccessor(e,t,n,i){const o=this.json,s={1:"SCALAR",2:"VEC2",3:"VEC3",4:"VEC4",9:"MAT3",16:"MAT4"};let a;if(e.array.constructor===Float32Array)a=je.FLOAT;else if(e.array.constructor===Int32Array)a=je.INT;else if(e.array.constructor===Uint32Array)a=je.UNSIGNED_INT;else if(e.array.constructor===Int16Array)a=je.SHORT;else if(e.array.constructor===Uint16Array)a=je.UNSIGNED_SHORT;else if(e.array.constructor===Int8Array)a=je.BYTE;else if(e.array.constructor===Uint8Array)a=je.UNSIGNED_BYTE;else throw new Error("THREE.GLTFExporter: Unsupported bufferAttribute component type: "+e.array.constructor.name);if(n===void 0&&(n=0),i===void 0&&(i=e.count),i===0)return null;const l=dw(e,n,i);let u;t!==void 0&&(u=e===t.index?je.ELEMENT_ARRAY_BUFFER:je.ARRAY_BUFFER);const c=this.processBufferView(e,a,n,i,u),f={bufferView:c.id,byteOffset:c.byteOffset,componentType:a,count:i,max:l.max,min:l.min,type:s[e.itemSize]};return e.normalized===!0&&(f.normalized=!0),o.accessors||(o.accessors=[]),o.accessors.push(f)-1}processImage(e,t,n,i="image/png"){if(e!==null){const o=this,s=o.cache,a=o.json,l=o.options,u=o.pending;s.images.has(e)||s.images.set(e,{});const c=s.images.get(e),f=i+":flipY/"+n.toString();if(c[f]!==void 0)return c[f];a.images||(a.images=[]);const d={mimeType:i},h=sh();h.width=Math.min(e.width,l.maxTextureSize),h.height=Math.min(e.height,l.maxTextureSize);const g=h.getContext("2d");if(n===!0&&(g.translate(0,h.height),g.scale(1,-1)),e.data!==void 0){t!==Ka&&console.error("GLTFExporter: Only RGBAFormat is supported.",t),(e.width>l.maxTextureSize||e.height>l.maxTextureSize)&&console.warn("GLTFExporter: Image size is bigger than maxTextureSize",e);const p=new Uint8ClampedArray(e.height*e.width*4);for(let m=0;mo.processBufferViewImage(p)).then(p=>{d.bufferView=p})):h.toDataURL!==void 0?d.uri=h.toDataURL(i):u.push(ah(h,i).then(th).then(p=>{d.uri=p}));const v=a.images.push(d)-1;return c[f]=v,v}else throw new Error("THREE.GLTFExporter: No valid image data found. Unable to process texture.")}processSampler(e){const t=this.json;t.samplers||(t.samplers=[]);const n={magFilter:Vt[e.magFilter],minFilter:Vt[e.minFilter],wrapS:Vt[e.wrapS],wrapT:Vt[e.wrapT]};return t.samplers.push(n)-1}processTexture(e){const t=this.options,n=this.cache,i=this.json;if(n.textures.has(e))return n.textures.get(e);i.textures||(i.textures=[]),e instanceof ys&&(e=xa(e,t.maxTextureSize));let o=e.userData.mimeType;o==="image/webp"&&(o="image/png");const s={sampler:this.processSampler(e),source:this.processImage(e.image,e.format,e.flipY,o)};e.name&&(s.name=e.name),this._invokeAll(function(l){l.writeTexture&&l.writeTexture(e,s)});const a=i.textures.push(s)-1;return n.textures.set(e,a),a}processMaterial(e){const t=this.cache,n=this.json;if(t.materials.has(e))return t.materials.get(e);if(e.isShaderMaterial)return console.warn("GLTFExporter: THREE.ShaderMaterial not supported."),null;n.materials||(n.materials=[]);const i={pbrMetallicRoughness:{}};e.isMeshStandardMaterial!==!0&&e.isMeshBasicMaterial!==!0&&console.warn("GLTFExporter: Use MeshStandardMaterial or MeshBasicMaterial for best results.");const o=e.color.toArray().concat([e.opacity]);if(bi(o,[1,1,1,1])||(i.pbrMetallicRoughness.baseColorFactor=o),e.isMeshStandardMaterial?(i.pbrMetallicRoughness.metallicFactor=e.metalness,i.pbrMetallicRoughness.roughnessFactor=e.roughness):(i.pbrMetallicRoughness.metallicFactor=.5,i.pbrMetallicRoughness.roughnessFactor=.5),e.metalnessMap||e.roughnessMap){const a=this.buildMetalRoughTexture(e.metalnessMap,e.roughnessMap),l={index:this.processTexture(a),channel:a.channel};this.applyTextureTransform(l,a),i.pbrMetallicRoughness.metallicRoughnessTexture=l}if(e.map){const a={index:this.processTexture(e.map),texCoord:e.map.channel};this.applyTextureTransform(a,e.map),i.pbrMetallicRoughness.baseColorTexture=a}if(e.emissive){const a=e.emissive;if(Math.max(a.r,a.g,a.b)>0&&(i.emissiveFactor=e.emissive.toArray()),e.emissiveMap){const l={index:this.processTexture(e.emissiveMap),texCoord:e.emissiveMap.channel};this.applyTextureTransform(l,e.emissiveMap),i.emissiveTexture=l}}if(e.normalMap){const a={index:this.processTexture(e.normalMap),texCoord:e.normalMap.channel};e.normalScale&&e.normalScale.x!==1&&(a.scale=e.normalScale.x),this.applyTextureTransform(a,e.normalMap),i.normalTexture=a}if(e.aoMap){const a={index:this.processTexture(e.aoMap),texCoord:e.aoMap.channel};e.aoMapIntensity!==1&&(a.strength=e.aoMapIntensity),this.applyTextureTransform(a,e.aoMap),i.occlusionTexture=a}e.transparent?i.alphaMode="BLEND":e.alphaTest>0&&(i.alphaMode="MASK",i.alphaCutoff=e.alphaTest),e.side===Ko&&(i.doubleSided=!0),e.name!==""&&(i.name=e.name),this.serializeUserData(e,i),this._invokeAll(function(a){a.writeMaterial&&a.writeMaterial(e,i)});const s=n.materials.push(i)-1;return t.materials.set(e,s),s}processMesh(e){const t=this.cache,n=this.json,i=[e.geometry.uuid];if(Array.isArray(e.material))for(let _=0,C=e.material.length;_=152?{uv:"TEXCOORD_0",uv1:"TEXCOORD_1",uv2:"TEXCOORD_2",uv3:"TEXCOORD_3"}:{uv:"TEXCOORD_0",uv2:"TEXCOORD_1"},color:"COLOR_0",skinWeight:"WEIGHTS_0",skinIndex:"JOINTS_0"},h=s.getAttribute("normal");h!==void 0&&!this.isNormalizedNormalAttribute(h)&&(console.warn("THREE.GLTFExporter: Creating normalized normal attribute from the non-normalized one."),s.setAttribute("normal",this.createNormalizedNormalAttribute(h)));let g=null;for(let _ in s.attributes){if(_.slice(0,5)==="morph")continue;const C=s.attributes[_];if(_=d[_]||_.toUpperCase(),/^(POSITION|NORMAL|TANGENT|TEXCOORD_\d+|COLOR_\d+|JOINTS_\d+|WEIGHTS_\d+)$/.test(_)||(_="_"+_),t.attributes.has(this.getUID(C))){u[_]=t.attributes.get(this.getUID(C));continue}g=null;const b=C.array;_==="JOINTS_0"&&!(b instanceof Uint16Array)&&!(b instanceof Uint8Array)&&(console.warn('GLTFExporter: Attribute "skinIndex" converted to type UNSIGNED_SHORT.'),g=new ur(new Uint16Array(b),C.itemSize,C.normalized));const x=this.processAccessor(g||C,s);x!==null&&(_.startsWith("_")||this.detectMeshQuantization(_,C),u[_]=x,t.attributes.set(this.getUID(C),x))}if(h!==void 0&&s.setAttribute("normal",h),Object.keys(u).length===0)return null;if(e.morphTargetInfluences!==void 0&&e.morphTargetInfluences.length>0){const _=[],C=[],b={};if(e.morphTargetDictionary!==void 0)for(const x in e.morphTargetDictionary)b[e.morphTargetDictionary[x]]=x;for(let x=0;x0&&(l.extras={},l.extras.targetNames=C)}const v=Array.isArray(e.material);if(v&&s.groups.length===0)return null;const p=v?e.material:[e.material],m=v?s.groups:[{materialIndex:0,start:void 0,count:void 0}];for(let _=0,C=m.length;_0&&(b.targets=f),s.index!==null){let w=this.getUID(s.index);(m[_].start!==void 0||m[_].count!==void 0)&&(w+=":"+m[_].start+":"+m[_].count),t.attributes.has(w)?b.indices=t.attributes.get(w):(b.indices=this.processAccessor(s.index,s,m[_].start,m[_].count),t.attributes.set(w,b.indices)),b.indices===null&&delete b.indices}const x=this.processMaterial(p[m[_].materialIndex]);x!==null&&(b.material=x),c.push(b)}l.primitives=c,n.meshes||(n.meshes=[]),this._invokeAll(function(_){_.writeMesh&&_.writeMesh(e,l)});const y=n.meshes.push(l)-1;return t.meshes.set(o,y),y}detectMeshQuantization(e,t){if(this.extensionsUsed[ba])return;let n;switch(t.array.constructor){case Int8Array:n="byte";break;case Uint8Array:n="unsigned byte";break;case Int16Array:n="short";break;case Uint16Array:n="unsigned short";break;default:return}t.normalized&&(n+=" normalized");const i=e.split("_",1)[0];nh[i]&&nh[i].includes(n)&&(this.extensionsUsed[ba]=!0,this.extensionsRequired[ba]=!0)}processCamera(e){const t=this.json;t.cameras||(t.cameras=[]);const n=e.isOrthographicCamera,i={type:n?"orthographic":"perspective"};return n?i.orthographic={xmag:e.right*2,ymag:e.top*2,zfar:e.far<=0?.001:e.far,znear:e.near<0?0:e.near}:i.perspective={aspectRatio:e.aspect,yfov:gr.degToRad(e.fov),zfar:e.far<=0?.001:e.far,znear:e.near<0?0:e.near},e.name!==""&&(i.name=e.type),t.cameras.push(i)-1}processAnimation(e,t){const n=this.json,i=this.nodeMap;n.animations||(n.animations=[]),e=Gp.Utils.mergeMorphTargetTracks(e.clone(),t);const o=e.tracks,s=[],a=[];for(let l=0;l0){const a=[];for(let l=0,u=e.children.length;l0&&(o.children=a)}this._invokeAll(function(a){a.writeNode&&a.writeNode(e,o)});const s=t.nodes.push(o)-1;return i.set(e,s),s}processScene(e){const t=this.json,n=this.options;t.scenes||(t.scenes=[],t.scene=0);const i={};e.name!==""&&(i.name=e.name),t.scenes.push(i);const o=[];for(let s=0,a=e.children.length;s0&&(i.nodes=o),this.serializeUserData(e,i)}processObjects(e){const t=new Za;t.name="AuxScene";for(let n=0;n0&&this.processObjects(n);for(let i=0;i0&&(s.range=e.distance)):e.isSpotLight&&(s.type="spot",e.distance>0&&(s.range=e.distance),s.spot={},s.spot.innerConeAngle=(e.penumbra-1)*e.angle*-1,s.spot.outerConeAngle=e.angle),e.decay!==void 0&&e.decay!==2&&console.warn("THREE.GLTFExporter: Light decay may be lost. glTF is physically-based, and expects light.decay=2."),e.target&&(e.target.parent!==e||e.target.position.x!==0||e.target.position.y!==0||e.target.position.z!==-1)&&console.warn("THREE.GLTFExporter: Light direction may be lost. For best results, make light.target a child of the light with position 0,0,-1."),o[this.name]||(i.extensions=i.extensions||{},i.extensions[this.name]={lights:[]},o[this.name]=!0);const a=i.extensions[this.name].lights;a.push(s),t.extensions=t.extensions||{},t.extensions[this.name]={light:a.length-1}}}let gw=class{constructor(r){this.writer=r,this.name="KHR_materials_unlit"}writeMaterial(r,e){if(!r.isMeshBasicMaterial)return;const t=this.writer.extensionsUsed;e.extensions=e.extensions||{},e.extensions[this.name]={},t[this.name]=!0,e.pbrMetallicRoughness.metallicFactor=0,e.pbrMetallicRoughness.roughnessFactor=.9}},vw=class{constructor(r){this.writer=r,this.name="KHR_materials_clearcoat"}writeMaterial(r,e){if(!r.isMeshPhysicalMaterial||r.clearcoat===0)return;const t=this.writer,n=t.extensionsUsed,i={};if(i.clearcoatFactor=r.clearcoat,r.clearcoatMap){const o={index:t.processTexture(r.clearcoatMap),texCoord:r.clearcoatMap.channel};t.applyTextureTransform(o,r.clearcoatMap),i.clearcoatTexture=o}if(i.clearcoatRoughnessFactor=r.clearcoatRoughness,r.clearcoatRoughnessMap){const o={index:t.processTexture(r.clearcoatRoughnessMap),texCoord:r.clearcoatRoughnessMap.channel};t.applyTextureTransform(o,r.clearcoatRoughnessMap),i.clearcoatRoughnessTexture=o}if(r.clearcoatNormalMap){const o={index:t.processTexture(r.clearcoatNormalMap),texCoord:r.clearcoatNormalMap.channel};t.applyTextureTransform(o,r.clearcoatNormalMap),i.clearcoatNormalTexture=o}e.extensions=e.extensions||{},e.extensions[this.name]=i,n[this.name]=!0}},yw=class{constructor(r){this.writer=r,this.name="KHR_materials_iridescence"}writeMaterial(r,e){if(!r.isMeshPhysicalMaterial||r.iridescence===0)return;const t=this.writer,n=t.extensionsUsed,i={};if(i.iridescenceFactor=r.iridescence,r.iridescenceMap){const o={index:t.processTexture(r.iridescenceMap),texCoord:r.iridescenceMap.channel};t.applyTextureTransform(o,r.iridescenceMap),i.iridescenceTexture=o}if(i.iridescenceIor=r.iridescenceIOR,i.iridescenceThicknessMinimum=r.iridescenceThicknessRange[0],i.iridescenceThicknessMaximum=r.iridescenceThicknessRange[1],r.iridescenceThicknessMap){const o={index:t.processTexture(r.iridescenceThicknessMap),texCoord:r.iridescenceThicknessMap.channel};t.applyTextureTransform(o,r.iridescenceThicknessMap),i.iridescenceThicknessTexture=o}e.extensions=e.extensions||{},e.extensions[this.name]=i,n[this.name]=!0}},_w=class{constructor(e){this.writer=e,this.name="KHR_materials_transmission"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.transmission===0)return;const n=this.writer,i=n.extensionsUsed,o={};if(o.transmissionFactor=e.transmission,e.transmissionMap){const s={index:n.processTexture(e.transmissionMap),texCoord:e.transmissionMap.channel};n.applyTextureTransform(s,e.transmissionMap),o.transmissionTexture=s}t.extensions=t.extensions||{},t.extensions[this.name]=o,i[this.name]=!0}},xw=class{constructor(r){this.writer=r,this.name="KHR_materials_volume"}writeMaterial(r,e){if(!r.isMeshPhysicalMaterial||r.transmission===0)return;const t=this.writer,n=t.extensionsUsed,i={};if(i.thicknessFactor=r.thickness,r.thicknessMap){const o={index:t.processTexture(r.thicknessMap),texCoord:r.thicknessMap.channel};t.applyTextureTransform(o,r.thicknessMap),i.thicknessTexture=o}i.attenuationDistance=r.attenuationDistance,i.attenuationColor=r.attenuationColor.toArray(),e.extensions=e.extensions||{},e.extensions[this.name]=i,n[this.name]=!0}},bw=class{constructor(r){this.writer=r,this.name="KHR_materials_ior"}writeMaterial(r,e){if(!r.isMeshPhysicalMaterial||r.ior===1.5)return;const t=this.writer.extensionsUsed,n={};n.ior=r.ior,e.extensions=e.extensions||{},e.extensions[this.name]=n,t[this.name]=!0}},ww=class{constructor(r){this.writer=r,this.name="KHR_materials_specular"}writeMaterial(r,e){if(!r.isMeshPhysicalMaterial||r.specularIntensity===1&&r.specularColor.equals(sw)&&!r.specularIntensityMap&&!r.specularColorTexture)return;const t=this.writer,n=t.extensionsUsed,i={};if(r.specularIntensityMap){const o={index:t.processTexture(r.specularIntensityMap),texCoord:r.specularIntensityMap.channel};t.applyTextureTransform(o,r.specularIntensityMap),i.specularTexture=o}if(r.specularColorMap){const o={index:t.processTexture(r.specularColorMap),texCoord:r.specularColorMap.channel};t.applyTextureTransform(o,r.specularColorMap),i.specularColorTexture=o}i.specularFactor=r.specularIntensity,i.specularColorFactor=r.specularColor.toArray(),e.extensions=e.extensions||{},e.extensions[this.name]=i,n[this.name]=!0}},Tw=class{constructor(e){this.writer=e,this.name="KHR_materials_sheen"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.sheen==0)return;const n=this.writer,i=n.extensionsUsed,o={};if(e.sheenRoughnessMap){const s={index:n.processTexture(e.sheenRoughnessMap),texCoord:e.sheenRoughnessMap.channel};n.applyTextureTransform(s,e.sheenRoughnessMap),o.sheenRoughnessTexture=s}if(e.sheenColorMap){const s={index:n.processTexture(e.sheenColorMap),texCoord:e.sheenColorMap.channel};n.applyTextureTransform(s,e.sheenColorMap),o.sheenColorTexture=s}o.sheenRoughnessFactor=e.sheenRoughness,o.sheenColorFactor=e.sheenColor.toArray(),t.extensions=t.extensions||{},t.extensions[this.name]=o,i[this.name]=!0}},Sw=class{constructor(r){this.writer=r,this.name="KHR_materials_anisotropy"}writeMaterial(r,e){if(!r.isMeshPhysicalMaterial||r.anisotropy==0)return;const t=this.writer,n=t.extensionsUsed,i={};if(r.anisotropyMap){const o={index:t.processTexture(r.anisotropyMap)};t.applyTextureTransform(o,r.anisotropyMap),i.anisotropyTexture=o}i.anisotropyStrength=r.anisotropy,i.anisotropyRotation=r.anisotropyRotation,e.extensions=e.extensions||{},e.extensions[this.name]=i,n[this.name]=!0}},Ew=class{constructor(r){this.writer=r,this.name="KHR_materials_emissive_strength"}writeMaterial(r,e){if(!r.isMeshStandardMaterial||r.emissiveIntensity===1)return;const t=this.writer.extensionsUsed,n={};n.emissiveStrength=r.emissiveIntensity,e.extensions=e.extensions||{},e.extensions[this.name]=n,t[this.name]=!0}};var Bi=Uint8Array,Hp=Uint16Array,Aw=Uint32Array,Cw=new Bi([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),Iw=new Bi([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),Xp=function(r,e){for(var t=new Hp(31),n=0;n<31;++n)t[n]=e+=1<>>1|(nt&21845)<<1;kn=(kn&52428)>>>2|(kn&13107)<<2,kn=(kn&61680)>>>4|(kn&3855)<<4,Pw[nt]=((kn&65280)>>>8|(kn&255)<<8)>>>1}var is=new Bi(288);for(var nt=0;nt<144;++nt)is[nt]=8;for(var nt=144;nt<256;++nt)is[nt]=9;for(var nt=256;nt<280;++nt)is[nt]=7;for(var nt=280;nt<288;++nt)is[nt]=8;var Rw=new Bi(32);for(var nt=0;nt<32;++nt)Rw[nt]=5;var Ow=new Bi(0),Fw=typeof TextDecoder<"u"&&new TextDecoder,Lw=0;try{Fw.decode(Ow,{stream:!0}),Lw=1}catch{}var Nw=Object.defineProperty,Dw=(r,e,t)=>e in r?Nw(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,Bw=(r,e,t)=>(Dw(r,e+"",t),t);const qp=class extends hr{constructor(r,e={}){super(r),this.isReflector=!0,this.type="Reflector",this.camera=new Dn;const t=this,n=e.color!==void 0?new It(e.color):new It(8355711),i=e.textureWidth||512,o=e.textureHeight||512,s=e.clipBias||0,a=e.shader||qp.ReflectorShader,l=e.multisample!==void 0?e.multisample:4,u=new Cd,c=new Me,f=new Me,d=new Me,h=new Tn,g=new Me(0,0,-1),v=new Un,p=new Me,m=new Me,y=new Un,_=new Tn,C=this.camera,b=new Eg(i,o,{samples:l,type:Ag}),x=new Ni({uniforms:hu.clone(a.uniforms),fragmentShader:a.fragmentShader,vertexShader:a.vertexShader});x.uniforms.tDiffuse.value=b.texture,x.uniforms.color.value=n,x.uniforms.textureMatrix.value=_,this.material=x,this.onBeforeRender=function(w,M,T){if(f.setFromMatrixPosition(t.matrixWorld),d.setFromMatrixPosition(T.matrixWorld),h.extractRotation(t.matrixWorld),c.set(0,0,1),c.applyMatrix4(h),p.subVectors(f,d),p.dot(c)>0)return;p.reflect(c).negate(),p.add(f),h.extractRotation(T.matrixWorld),g.set(0,0,-1),g.applyMatrix4(h),g.add(d),m.subVectors(f,g),m.reflect(c).negate(),m.add(f),C.position.copy(p),C.up.set(0,1,0),C.up.applyMatrix4(h),C.up.reflect(c),C.lookAt(m),C.far=T.far,C.updateMatrixWorld(),C.projectionMatrix.copy(T.projectionMatrix),_.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),_.multiply(C.projectionMatrix),_.multiply(C.matrixWorldInverse),_.multiply(t.matrixWorld),u.setFromNormalAndCoplanarPoint(c,f),u.applyMatrix4(C.matrixWorldInverse),v.set(u.normal.x,u.normal.y,u.normal.z,u.constant);const I=C.projectionMatrix;y.x=(Math.sign(v.x)+I.elements[8])/I.elements[0],y.y=(Math.sign(v.y)+I.elements[9])/I.elements[5],y.z=-1,y.w=(1+I.elements[10])/I.elements[14],v.multiplyScalar(2/v.dot(y)),I.elements[2]=v.x,I.elements[6]=v.y,I.elements[10]=v.z+1-s,I.elements[14]=v.w,t.visible=!1;const F=w.getRenderTarget(),A=w.xr.enabled,X=w.shadowMap.autoUpdate,S=w.toneMapping;let G=!1;"outputColorSpace"in w?G=w.outputColorSpace==="srgb":G=w.outputEncoding===3001,w.xr.enabled=!1,w.shadowMap.autoUpdate=!1,"outputColorSpace"in w?w.outputColorSpace="srgb-linear":w.outputEncoding=3e3,w.toneMapping=Cg,w.setRenderTarget(b),w.state.buffers.depth.setMask(!0),w.autoClear===!1&&w.clear(),w.render(M,C),w.xr.enabled=A,w.shadowMap.autoUpdate=X,w.toneMapping=S,"outputColorSpace"in w?w.outputColorSpace=G?"srgb":"srgb-linear":w.outputEncoding=G?3001:3e3,w.setRenderTarget(F);const O=T.viewport;O!==void 0&&w.state.viewport(O),t.visible=!0},this.getRenderTarget=function(){return b},this.dispose=function(){b.dispose(),t.material.dispose()}}};let Xl=qp;Bw(Xl,"ReflectorShader",{uniforms:{color:{value:null},tDiffuse:{value:null},textureMatrix:{value:null}},vertexShader:` - uniform mat4 textureMatrix; - varying vec4 vUv; - - #include - #include - - void main() { - - vUv = textureMatrix * vec4( position, 1.0 ); - - gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 ); - - #include - - }`,fragmentShader:` - uniform vec3 color; - uniform sampler2D tDiffuse; - varying vec4 vUv; - - #include - - float blendOverlay( float base, float blend ) { - - return( base < 0.5 ? ( 2.0 * base * blend ) : ( 1.0 - 2.0 * ( 1.0 - base ) * ( 1.0 - blend ) ) ); - - } - - vec3 blendOverlay( vec3 base, vec3 blend ) { - - return vec3( blendOverlay( base.r, blend.r ), blendOverlay( base.g, blend.g ), blendOverlay( base.b, blend.b ) ); - - } - - void main() { - - #include - - vec4 base = texture2DProj( tDiffuse, vUv ); - gl_FragColor = vec4( blendOverlay( base.rgb, color ), 1.0 ); - - #include - #include <${zu>=154?"colorspace_fragment":"encodings_fragment"}> - - }`});var Uw=Object.defineProperty,zw=(r,e,t)=>e in r?Uw(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,Yp=(r,e,t)=>(zw(r,typeof e!="symbol"?e+"":e,t),t);const os=new Sd,jw=new Float32Array([-1,-1,0,0,0,1,-1,0,1,0,1,1,0,1,1,-1,1,0,0,1]),Kp=new Ed(jw,5);os.setIndex([0,1,2,0,2,3]);os.setAttribute("position",new fu(Kp,3,0,!1));os.setAttribute("uv",new fu(Kp,2,3,!1));const Wl=class extends hr{constructor(){super(Wl.Geometry,new Dr({opacity:0,transparent:!0})),this.isLensflare=!0,this.type="Lensflare",this.frustumCulled=!1,this.renderOrder=1/0;const r=new Me,e=new Me,t=new yc(new Uint8Array(16*16*3),16,16,Ka);t.minFilter=cr,t.magFilter=cr,t.wrapS=Br,t.wrapT=Br;const n=new yc(new Uint8Array(16*16*3),16,16,Ka);n.minFilter=cr,n.magFilter=cr,n.wrapS=Br,n.wrapT=Br;const i=Wl.Geometry,o=new _s({uniforms:{scale:{value:null},screenPosition:{value:null}},vertexShader:` - - precision highp float; - - uniform vec3 screenPosition; - uniform vec2 scale; - - attribute vec3 position; - - void main() { - - gl_Position = vec4( position.xy * scale + screenPosition.xy, screenPosition.z, 1.0 ); - - }`,fragmentShader:` - - precision highp float; - - void main() { - - gl_FragColor = vec4( 1.0, 0.0, 1.0, 1.0 ); - - }`,depthTest:!0,depthWrite:!1,transparent:!1}),s=new _s({uniforms:{map:{value:t},scale:{value:null},screenPosition:{value:null}},vertexShader:` - - precision highp float; - - uniform vec3 screenPosition; - uniform vec2 scale; - - attribute vec3 position; - attribute vec2 uv; - - varying vec2 vUV; - - void main() { - - vUV = uv; - - gl_Position = vec4( position.xy * scale + screenPosition.xy, screenPosition.z, 1.0 ); - - }`,fragmentShader:` - - precision highp float; - - uniform sampler2D map; - - varying vec2 vUV; - - void main() { - - gl_FragColor = texture2D( map, vUV ); - - }`,depthTest:!1,depthWrite:!1,transparent:!1}),a=new hr(i,o),l=[],u=Zp.Shader,c=new _s({uniforms:{map:{value:null},occlusionMap:{value:n},color:{value:new It(16777215)},scale:{value:new _t},screenPosition:{value:new Me}},vertexShader:u.vertexShader,fragmentShader:u.fragmentShader,blending:Mg,transparent:!0,depthWrite:!1}),f=new hr(i,c);this.addElement=function(p){l.push(p)};const d=new _t,h=new _t,g=new kg,v=new Un;this.onBeforeRender=function(p,m,y){p.getCurrentViewport(v);const _=v.w/v.z,C=v.z/2,b=v.w/2;let x=16/v.w;if(d.set(x*_,x),g.min.set(v.x,v.y),g.max.set(v.x+(v.z-16),v.y+(v.w-16)),e.setFromMatrixPosition(this.matrixWorld),e.applyMatrix4(y.matrixWorldInverse),!(e.z>0)&&(r.copy(e).applyMatrix4(y.projectionMatrix),h.x=v.x+r.x*C+C-8,h.y=v.y+r.y*b+b-8,g.containsPoint(h))){p.copyFramebufferToTexture(h,t);let w=o.uniforms;w.scale.value=d,w.screenPosition.value=r,p.renderBufferDirect(y,null,i,o,a,null),p.copyFramebufferToTexture(h,n),w=s.uniforms,w.scale.value=d,w.screenPosition.value=r,p.renderBufferDirect(y,null,i,s,a,null);const M=-r.x*2,T=-r.y*2;for(let I=0,F=l.length;Ie in r?Gw(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,Jp=(r,e,t)=>($w(r,typeof e!="symbol"?e+"":e,t),t);const Eo={uniforms:{turbidity:{value:2},rayleigh:{value:1},mieCoefficient:{value:.005},mieDirectionalG:{value:.8},sunPosition:{value:new Me},up:{value:new Me(0,1,0)}},vertexShader:` - uniform vec3 sunPosition; - uniform float rayleigh; - uniform float turbidity; - uniform float mieCoefficient; - uniform vec3 up; - - varying vec3 vWorldPosition; - varying vec3 vSunDirection; - varying float vSunfade; - varying vec3 vBetaR; - varying vec3 vBetaM; - varying float vSunE; - - // constants for atmospheric scattering - const float e = 2.71828182845904523536028747135266249775724709369995957; - const float pi = 3.141592653589793238462643383279502884197169; - - // wavelength of used primaries, according to preetham - const vec3 lambda = vec3( 680E-9, 550E-9, 450E-9 ); - // this pre-calcuation replaces older TotalRayleigh(vec3 lambda) function: - // (8.0 * pow(pi, 3.0) * pow(pow(n, 2.0) - 1.0, 2.0) * (6.0 + 3.0 * pn)) / (3.0 * N * pow(lambda, vec3(4.0)) * (6.0 - 7.0 * pn)) - const vec3 totalRayleigh = vec3( 5.804542996261093E-6, 1.3562911419845635E-5, 3.0265902468824876E-5 ); - - // mie stuff - // K coefficient for the primaries - const float v = 4.0; - const vec3 K = vec3( 0.686, 0.678, 0.666 ); - // MieConst = pi * pow( ( 2.0 * pi ) / lambda, vec3( v - 2.0 ) ) * K - const vec3 MieConst = vec3( 1.8399918514433978E14, 2.7798023919660528E14, 4.0790479543861094E14 ); - - // earth shadow hack - // cutoffAngle = pi / 1.95; - const float cutoffAngle = 1.6110731556870734; - const float steepness = 1.5; - const float EE = 1000.0; - - float sunIntensity( float zenithAngleCos ) { - zenithAngleCos = clamp( zenithAngleCos, -1.0, 1.0 ); - return EE * max( 0.0, 1.0 - pow( e, -( ( cutoffAngle - acos( zenithAngleCos ) ) / steepness ) ) ); - } - - vec3 totalMie( float T ) { - float c = ( 0.2 * T ) * 10E-18; - return 0.434 * c * MieConst; - } - - void main() { - - vec4 worldPosition = modelMatrix * vec4( position, 1.0 ); - vWorldPosition = worldPosition.xyz; - - gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 ); - gl_Position.z = gl_Position.w; // set z to camera.far - - vSunDirection = normalize( sunPosition ); - - vSunE = sunIntensity( dot( vSunDirection, up ) ); - - vSunfade = 1.0 - clamp( 1.0 - exp( ( sunPosition.y / 450000.0 ) ), 0.0, 1.0 ); - - float rayleighCoefficient = rayleigh - ( 1.0 * ( 1.0 - vSunfade ) ); - - // extinction (absorbtion + out scattering) - // rayleigh coefficients - vBetaR = totalRayleigh * rayleighCoefficient; - - // mie coefficients - vBetaM = totalMie( turbidity ) * mieCoefficient; - - } - `,fragmentShader:` - varying vec3 vWorldPosition; - varying vec3 vSunDirection; - varying float vSunfade; - varying vec3 vBetaR; - varying vec3 vBetaM; - varying float vSunE; - - uniform float mieDirectionalG; - uniform vec3 up; - - const vec3 cameraPos = vec3( 0.0, 0.0, 0.0 ); - - // constants for atmospheric scattering - const float pi = 3.141592653589793238462643383279502884197169; - - const float n = 1.0003; // refractive index of air - const float N = 2.545E25; // number of molecules per unit volume for air at 288.15K and 1013mb (sea level -45 celsius) - - // optical length at zenith for molecules - const float rayleighZenithLength = 8.4E3; - const float mieZenithLength = 1.25E3; - // 66 arc seconds -> degrees, and the cosine of that - const float sunAngularDiameterCos = 0.999956676946448443553574619906976478926848692873900859324; - - // 3.0 / ( 16.0 * pi ) - const float THREE_OVER_SIXTEENPI = 0.05968310365946075; - // 1.0 / ( 4.0 * pi ) - const float ONE_OVER_FOURPI = 0.07957747154594767; - - float rayleighPhase( float cosTheta ) { - return THREE_OVER_SIXTEENPI * ( 1.0 + pow( cosTheta, 2.0 ) ); - } - - float hgPhase( float cosTheta, float g ) { - float g2 = pow( g, 2.0 ); - float inverse = 1.0 / pow( 1.0 - 2.0 * g * cosTheta + g2, 1.5 ); - return ONE_OVER_FOURPI * ( ( 1.0 - g2 ) * inverse ); - } - - void main() { - - vec3 direction = normalize( vWorldPosition - cameraPos ); - - // optical length - // cutoff angle at 90 to avoid singularity in next formula. - float zenithAngle = acos( max( 0.0, dot( up, direction ) ) ); - float inverse = 1.0 / ( cos( zenithAngle ) + 0.15 * pow( 93.885 - ( ( zenithAngle * 180.0 ) / pi ), -1.253 ) ); - float sR = rayleighZenithLength * inverse; - float sM = mieZenithLength * inverse; - - // combined extinction factor - vec3 Fex = exp( -( vBetaR * sR + vBetaM * sM ) ); - - // in scattering - float cosTheta = dot( direction, vSunDirection ); - - float rPhase = rayleighPhase( cosTheta * 0.5 + 0.5 ); - vec3 betaRTheta = vBetaR * rPhase; - - float mPhase = hgPhase( cosTheta, mieDirectionalG ); - vec3 betaMTheta = vBetaM * mPhase; - - vec3 Lin = pow( vSunE * ( ( betaRTheta + betaMTheta ) / ( vBetaR + vBetaM ) ) * ( 1.0 - Fex ), vec3( 1.5 ) ); - Lin *= mix( vec3( 1.0 ), pow( vSunE * ( ( betaRTheta + betaMTheta ) / ( vBetaR + vBetaM ) ) * Fex, vec3( 1.0 / 2.0 ) ), clamp( pow( 1.0 - dot( up, vSunDirection ), 5.0 ), 0.0, 1.0 ) ); - - // nightsky - float theta = acos( direction.y ); // elevation --> y-axis, [-pi/2, pi/2] - float phi = atan( direction.z, direction.x ); // azimuth --> x-axis [-pi/2, pi/2] - vec2 uv = vec2( phi, theta ) / vec2( 2.0 * pi, pi ) + vec2( 0.5, 0.0 ); - vec3 L0 = vec3( 0.1 ) * Fex; - - // composition + solar disc - float sundisk = smoothstep( sunAngularDiameterCos, sunAngularDiameterCos + 0.00002, cosTheta ); - L0 += ( vSunE * 19000.0 * Fex ) * sundisk; - - vec3 texColor = ( Lin + L0 ) * 0.04 + vec3( 0.0, 0.0003, 0.00075 ); - - vec3 retColor = pow( texColor, vec3( 1.0 / ( 1.2 + ( 1.2 * vSunfade ) ) ) ); - - gl_FragColor = vec4( retColor, 1.0 ); - - #include - #include <${zu>=154?"colorspace_fragment":"encodings_fragment"}> - - } - `},Qp=new Ni({name:"SkyShader",fragmentShader:Eo.fragmentShader,vertexShader:Eo.vertexShader,uniforms:hu.clone(Eo.uniforms),side:vg,depthWrite:!1});let em=class extends hr{constructor(){super(new Ig(1,1,1),Qp)}};Jp(em,"SkyShader",Eo);Jp(em,"material",Qp);new yg;new Me;new Ad(0,0,0,"YXZ");new Me;var Hw=Object.defineProperty,Xw=(r,e,t)=>e in r?Hw(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,Ce=(r,e,t)=>(Xw(r,typeof e!="symbol"?e+"":e,t),t);const oo=new _g,lh=new Cd,Ww=Math.cos(70*(Math.PI/180)),uh=(r,e)=>(r%e+e)%e;class qw extends Sg{constructor(e,t){super(),Ce(this,"object"),Ce(this,"domElement"),Ce(this,"enabled",!0),Ce(this,"target",new Me),Ce(this,"minDistance",0),Ce(this,"maxDistance",1/0),Ce(this,"minZoom",0),Ce(this,"maxZoom",1/0),Ce(this,"minPolarAngle",0),Ce(this,"maxPolarAngle",Math.PI),Ce(this,"minAzimuthAngle",-1/0),Ce(this,"maxAzimuthAngle",1/0),Ce(this,"enableDamping",!1),Ce(this,"dampingFactor",.05),Ce(this,"enableZoom",!0),Ce(this,"zoomSpeed",1),Ce(this,"enableRotate",!0),Ce(this,"rotateSpeed",1),Ce(this,"enablePan",!0),Ce(this,"panSpeed",1),Ce(this,"screenSpacePanning",!0),Ce(this,"keyPanSpeed",7),Ce(this,"zoomToCursor",!1),Ce(this,"autoRotate",!1),Ce(this,"autoRotateSpeed",2),Ce(this,"reverseOrbit",!1),Ce(this,"reverseHorizontalOrbit",!1),Ce(this,"reverseVerticalOrbit",!1),Ce(this,"keys",{LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"}),Ce(this,"mouseButtons",{LEFT:Cr.ROTATE,MIDDLE:Cr.DOLLY,RIGHT:Cr.PAN}),Ce(this,"touches",{ONE:Ln.ROTATE,TWO:Ln.DOLLY_PAN}),Ce(this,"target0"),Ce(this,"position0"),Ce(this,"zoom0"),Ce(this,"_domElementKeyEvents",null),Ce(this,"getPolarAngle"),Ce(this,"getAzimuthalAngle"),Ce(this,"setPolarAngle"),Ce(this,"setAzimuthalAngle"),Ce(this,"getDistance"),Ce(this,"getZoomScale"),Ce(this,"listenToKeyEvents"),Ce(this,"stopListenToKeyEvents"),Ce(this,"saveState"),Ce(this,"reset"),Ce(this,"update"),Ce(this,"connect"),Ce(this,"dispose"),Ce(this,"dollyIn"),Ce(this,"dollyOut"),Ce(this,"getScale"),Ce(this,"setScale"),this.object=e,this.domElement=t,this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this.getPolarAngle=()=>c.phi,this.getAzimuthalAngle=()=>c.theta,this.setPolarAngle=U=>{let ue=uh(U,2*Math.PI),_e=c.phi;_e<0&&(_e+=2*Math.PI),ue<0&&(ue+=2*Math.PI);let Ee=Math.abs(ue-_e);2*Math.PI-Ee{let ue=uh(U,2*Math.PI),_e=c.theta;_e<0&&(_e+=2*Math.PI),ue<0&&(ue+=2*Math.PI);let Ee=Math.abs(ue-_e);2*Math.PI-Een.object.position.distanceTo(n.target),this.listenToKeyEvents=U=>{U.addEventListener("keydown",ge),this._domElementKeyEvents=U},this.stopListenToKeyEvents=()=>{this._domElementKeyEvents.removeEventListener("keydown",ge),this._domElementKeyEvents=null},this.saveState=()=>{n.target0.copy(n.target),n.position0.copy(n.object.position),n.zoom0=n.object.zoom},this.reset=()=>{n.target.copy(n.target0),n.object.position.copy(n.position0),n.object.zoom=n.zoom0,n.object.updateProjectionMatrix(),n.dispatchEvent(i),n.update(),l=a.NONE},this.update=(()=>{const U=new Me,ue=new Me(0,1,0),_e=new Io().setFromUnitVectors(e.up,ue),Ee=_e.clone().invert(),Ae=new Me,it=new Io,wt=2*Math.PI;return function(){const ht=n.object.position;_e.setFromUnitVectors(e.up,ue),Ee.copy(_e).invert(),U.copy(ht).sub(n.target),U.applyQuaternion(_e),c.setFromVector3(U),n.autoRotate&&l===a.NONE&&S(A()),n.enableDamping?(c.theta+=f.theta*n.dampingFactor,c.phi+=f.phi*n.dampingFactor):(c.theta+=f.theta,c.phi+=f.phi);let Tt=n.minAzimuthAngle,Nt=n.maxAzimuthAngle;isFinite(Tt)&&isFinite(Nt)&&(Tt<-Math.PI?Tt+=wt:Tt>Math.PI&&(Tt-=wt),Nt<-Math.PI?Nt+=wt:Nt>Math.PI&&(Nt-=wt),Tt<=Nt?c.theta=Math.max(Tt,Math.min(Nt,c.theta)):c.theta=c.theta>(Tt+Nt)/2?Math.max(Tt,c.theta):Math.min(Nt,c.theta)),c.phi=Math.max(n.minPolarAngle,Math.min(n.maxPolarAngle,c.phi)),c.makeSafe(),n.enableDamping===!0?n.target.addScaledVector(h,n.dampingFactor):n.target.add(h),n.zoomToCursor&&T||n.object.isOrthographicCamera?c.radius=P(c.radius):c.radius=P(c.radius*d),U.setFromSpherical(c),U.applyQuaternion(Ee),ht.copy(n.target).add(U),n.object.matrixAutoUpdate||n.object.updateMatrix(),n.object.lookAt(n.target),n.enableDamping===!0?(f.theta*=1-n.dampingFactor,f.phi*=1-n.dampingFactor,h.multiplyScalar(1-n.dampingFactor)):(f.set(0,0,0),h.set(0,0,0));let Xt=!1;if(n.zoomToCursor&&T){let St=null;if(n.object instanceof Dn&&n.object.isPerspectiveCamera){const In=U.length();St=P(In*d);const Wn=In-St;n.object.position.addScaledVector(w,Wn),n.object.updateMatrixWorld()}else if(n.object.isOrthographicCamera){const In=new Me(M.x,M.y,0);In.unproject(n.object),n.object.zoom=Math.max(n.minZoom,Math.min(n.maxZoom,n.object.zoom/d)),n.object.updateProjectionMatrix(),Xt=!0;const Wn=new Me(M.x,M.y,0);Wn.unproject(n.object),n.object.position.sub(Wn).add(In),n.object.updateMatrixWorld(),St=U.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),n.zoomToCursor=!1;St!==null&&(n.screenSpacePanning?n.target.set(0,0,-1).transformDirection(n.object.matrix).multiplyScalar(St).add(n.object.position):(oo.origin.copy(n.object.position),oo.direction.set(0,0,-1).transformDirection(n.object.matrix),Math.abs(n.object.up.dot(oo.direction))u||8*(1-it.dot(n.object.quaternion))>u?(n.dispatchEvent(i),Ae.copy(n.object.position),it.copy(n.object.quaternion),Xt=!1,!0):!1}})(),this.connect=U=>{n.domElement=U,n.domElement.style.touchAction="none",n.domElement.addEventListener("contextmenu",Xe),n.domElement.addEventListener("pointerdown",ee),n.domElement.addEventListener("pointercancel",ye),n.domElement.addEventListener("wheel",fe)},this.dispose=()=>{var U,ue,_e,Ee,Ae,it;n.domElement&&(n.domElement.style.touchAction="auto"),(U=n.domElement)==null||U.removeEventListener("contextmenu",Xe),(ue=n.domElement)==null||ue.removeEventListener("pointerdown",ee),(_e=n.domElement)==null||_e.removeEventListener("pointercancel",ye),(Ee=n.domElement)==null||Ee.removeEventListener("wheel",fe),(Ae=n.domElement)==null||Ae.ownerDocument.removeEventListener("pointermove",he),(it=n.domElement)==null||it.ownerDocument.removeEventListener("pointerup",ye),n._domElementKeyEvents!==null&&n._domElementKeyEvents.removeEventListener("keydown",ge)};const n=this,i={type:"change"},o={type:"start"},s={type:"end"},a={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6};let l=a.NONE;const u=1e-6,c=new vc,f=new vc;let d=1;const h=new Me,g=new _t,v=new _t,p=new _t,m=new _t,y=new _t,_=new _t,C=new _t,b=new _t,x=new _t,w=new Me,M=new _t;let T=!1;const I=[],F={};function A(){return 2*Math.PI/60/60*n.autoRotateSpeed}function X(){return Math.pow(.95,n.zoomSpeed)}function S(U){n.reverseOrbit||n.reverseHorizontalOrbit?f.theta+=U:f.theta-=U}function G(U){n.reverseOrbit||n.reverseVerticalOrbit?f.phi+=U:f.phi-=U}const O=(()=>{const U=new Me;return function(ue,_e){U.setFromMatrixColumn(_e,0),U.multiplyScalar(-ue),h.add(U)}})(),D=(()=>{const U=new Me;return function(ue,_e){n.screenSpacePanning===!0?U.setFromMatrixColumn(_e,1):(U.setFromMatrixColumn(_e,0),U.crossVectors(n.object.up,U)),U.multiplyScalar(ue),h.add(U)}})(),L=(()=>{const U=new Me;return function(ue,_e){const Ee=n.domElement;if(Ee&&n.object instanceof Dn&&n.object.isPerspectiveCamera){const Ae=n.object.position;U.copy(Ae).sub(n.target);let it=U.length();it*=Math.tan(n.object.fov/2*Math.PI/180),O(2*ue*it/Ee.clientHeight,n.object.matrix),D(2*_e*it/Ee.clientHeight,n.object.matrix)}else Ee&&n.object instanceof zr&&n.object.isOrthographicCamera?(O(ue*(n.object.right-n.object.left)/n.object.zoom/Ee.clientWidth,n.object.matrix),D(_e*(n.object.top-n.object.bottom)/n.object.zoom/Ee.clientHeight,n.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),n.enablePan=!1)}})();function $(U){n.object instanceof Dn&&n.object.isPerspectiveCamera||n.object instanceof zr&&n.object.isOrthographicCamera?d=U:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),n.enableZoom=!1)}function k(U){$(d/U)}function N(U){$(d*U)}function V(U){if(!n.zoomToCursor||!n.domElement)return;T=!0;const ue=n.domElement.getBoundingClientRect(),_e=U.clientX-ue.left,Ee=U.clientY-ue.top,Ae=ue.width,it=ue.height;M.x=_e/Ae*2-1,M.y=-(Ee/it)*2+1,w.set(M.x,M.y,1).unproject(n.object).sub(n.object.position).normalize()}function P(U){return Math.max(n.minDistance,Math.min(n.maxDistance,U))}function J(U){g.set(U.clientX,U.clientY)}function Q(U){V(U),C.set(U.clientX,U.clientY)}function ce(U){m.set(U.clientX,U.clientY)}function pe(U){v.set(U.clientX,U.clientY),p.subVectors(v,g).multiplyScalar(n.rotateSpeed);const ue=n.domElement;ue&&(S(2*Math.PI*p.x/ue.clientHeight),G(2*Math.PI*p.y/ue.clientHeight)),g.copy(v),n.update()}function te(U){b.set(U.clientX,U.clientY),x.subVectors(b,C),x.y>0?k(X()):x.y<0&&N(X()),C.copy(b),n.update()}function R(U){y.set(U.clientX,U.clientY),_.subVectors(y,m).multiplyScalar(n.panSpeed),L(_.x,_.y),m.copy(y),n.update()}function B(U){V(U),U.deltaY<0?N(X()):U.deltaY>0&&k(X()),n.update()}function W(U){let ue=!1;switch(U.code){case n.keys.UP:L(0,n.keyPanSpeed),ue=!0;break;case n.keys.BOTTOM:L(0,-n.keyPanSpeed),ue=!0;break;case n.keys.LEFT:L(n.keyPanSpeed,0),ue=!0;break;case n.keys.RIGHT:L(-n.keyPanSpeed,0),ue=!0;break}ue&&(U.preventDefault(),n.update())}function oe(){if(I.length==1)g.set(I[0].pageX,I[0].pageY);else{const U=.5*(I[0].pageX+I[1].pageX),ue=.5*(I[0].pageY+I[1].pageY);g.set(U,ue)}}function ie(){if(I.length==1)m.set(I[0].pageX,I[0].pageY);else{const U=.5*(I[0].pageX+I[1].pageX),ue=.5*(I[0].pageY+I[1].pageY);m.set(U,ue)}}function E(){const U=I[0].pageX-I[1].pageX,ue=I[0].pageY-I[1].pageY,_e=Math.sqrt(U*U+ue*ue);C.set(0,_e)}function Z(){n.enableZoom&&E(),n.enablePan&&ie()}function H(){n.enableZoom&&E(),n.enableRotate&&oe()}function j(U){if(I.length==1)v.set(U.pageX,U.pageY);else{const _e=re(U),Ee=.5*(U.pageX+_e.x),Ae=.5*(U.pageY+_e.y);v.set(Ee,Ae)}p.subVectors(v,g).multiplyScalar(n.rotateSpeed);const ue=n.domElement;ue&&(S(2*Math.PI*p.x/ue.clientHeight),G(2*Math.PI*p.y/ue.clientHeight)),g.copy(v)}function z(U){if(I.length==1)y.set(U.pageX,U.pageY);else{const ue=re(U),_e=.5*(U.pageX+ue.x),Ee=.5*(U.pageY+ue.y);y.set(_e,Ee)}_.subVectors(y,m).multiplyScalar(n.panSpeed),L(_.x,_.y),m.copy(y)}function q(U){const ue=re(U),_e=U.pageX-ue.x,Ee=U.pageY-ue.y,Ae=Math.sqrt(_e*_e+Ee*Ee);b.set(0,Ae),x.set(0,Math.pow(b.y/C.y,n.zoomSpeed)),k(x.y),C.copy(b)}function se(U){n.enableZoom&&q(U),n.enablePan&&z(U)}function ae(U){n.enableZoom&&q(U),n.enableRotate&&j(U)}function ee(U){var ue,_e;n.enabled!==!1&&(I.length===0&&((ue=n.domElement)==null||ue.ownerDocument.addEventListener("pointermove",he),(_e=n.domElement)==null||_e.ownerDocument.addEventListener("pointerup",ye)),et(U),U.pointerType==="touch"?be(U):me(U))}function he(U){n.enabled!==!1&&(U.pointerType==="touch"?Pe(U):ne(U))}function ye(U){var ue,_e,Ee;Le(U),I.length===0&&((ue=n.domElement)==null||ue.releasePointerCapture(U.pointerId),(_e=n.domElement)==null||_e.ownerDocument.removeEventListener("pointermove",he),(Ee=n.domElement)==null||Ee.ownerDocument.removeEventListener("pointerup",ye)),n.dispatchEvent(s),l=a.NONE}function me(U){let ue;switch(U.button){case 0:ue=n.mouseButtons.LEFT;break;case 1:ue=n.mouseButtons.MIDDLE;break;case 2:ue=n.mouseButtons.RIGHT;break;default:ue=-1}switch(ue){case Cr.DOLLY:if(n.enableZoom===!1)return;Q(U),l=a.DOLLY;break;case Cr.ROTATE:if(U.ctrlKey||U.metaKey||U.shiftKey){if(n.enablePan===!1)return;ce(U),l=a.PAN}else{if(n.enableRotate===!1)return;J(U),l=a.ROTATE}break;case Cr.PAN:if(U.ctrlKey||U.metaKey||U.shiftKey){if(n.enableRotate===!1)return;J(U),l=a.ROTATE}else{if(n.enablePan===!1)return;ce(U),l=a.PAN}break;default:l=a.NONE}l!==a.NONE&&n.dispatchEvent(o)}function ne(U){if(n.enabled!==!1)switch(l){case a.ROTATE:if(n.enableRotate===!1)return;pe(U);break;case a.DOLLY:if(n.enableZoom===!1)return;te(U);break;case a.PAN:if(n.enablePan===!1)return;R(U);break}}function fe(U){n.enabled===!1||n.enableZoom===!1||l!==a.NONE&&l!==a.ROTATE||(U.preventDefault(),n.dispatchEvent(o),B(U),n.dispatchEvent(s))}function ge(U){n.enabled===!1||n.enablePan===!1||W(U)}function be(U){switch(ft(U),I.length){case 1:switch(n.touches.ONE){case Ln.ROTATE:if(n.enableRotate===!1)return;oe(),l=a.TOUCH_ROTATE;break;case Ln.PAN:if(n.enablePan===!1)return;ie(),l=a.TOUCH_PAN;break;default:l=a.NONE}break;case 2:switch(n.touches.TWO){case Ln.DOLLY_PAN:if(n.enableZoom===!1&&n.enablePan===!1)return;Z(),l=a.TOUCH_DOLLY_PAN;break;case Ln.DOLLY_ROTATE:if(n.enableZoom===!1&&n.enableRotate===!1)return;H(),l=a.TOUCH_DOLLY_ROTATE;break;default:l=a.NONE}break;default:l=a.NONE}l!==a.NONE&&n.dispatchEvent(o)}function Pe(U){switch(ft(U),l){case a.TOUCH_ROTATE:if(n.enableRotate===!1)return;j(U),n.update();break;case a.TOUCH_PAN:if(n.enablePan===!1)return;z(U),n.update();break;case a.TOUCH_DOLLY_PAN:if(n.enableZoom===!1&&n.enablePan===!1)return;se(U),n.update();break;case a.TOUCH_DOLLY_ROTATE:if(n.enableZoom===!1&&n.enableRotate===!1)return;ae(U),n.update();break;default:l=a.NONE}}function Xe(U){n.enabled!==!1&&U.preventDefault()}function et(U){I.push(U)}function Le(U){delete F[U.pointerId];for(let ue=0;ue{N(U),n.update()},this.dollyOut=(U=X())=>{k(U),n.update()},this.getScale=()=>d,this.setScale=U=>{$(U),n.update()},this.getZoomScale=()=>X(),t!==void 0&&this.connect(t),this.update()}}new Tn;new Me;new Ad;new Me;var Yw=Object.defineProperty,Kw=(r,e,t)=>e in r?Yw(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,ju=(r,e,t)=>(Kw(r,typeof e!="symbol"?e+"":e,t),t);class tm{constructor(e){ju(this,"data"),this.data=e}generateShapes(e,t=100,n){const i=[],o={letterSpacing:0,lineHeight:1,...n},s=Zw(e,t,this.data,o);for(let a=0,l=s.length;a - #include - #include - uniform float thickness; - uniform bool screenspace; - uniform vec2 size; - void main() { - #if defined (USE_SKINNING) - #include - #include - #include - #include - #include - #endif - #include - #include - #include - #include - vec4 tNormal = vec4(normal, 0.0); - vec4 tPosition = vec4(transformed, 1.0); - #ifdef USE_INSTANCING - tNormal = instanceMatrix * tNormal; - tPosition = instanceMatrix * tPosition; - #endif - if (screenspace) { - vec3 newPosition = tPosition.xyz + tNormal.xyz * thickness; - gl_Position = projectionMatrix * modelViewMatrix * vec4(newPosition, 1.0); - } else { - vec4 clipPosition = projectionMatrix * modelViewMatrix * tPosition; - vec4 clipNormal = projectionMatrix * modelViewMatrix * tNormal; - vec2 offset = normalize(clipNormal.xy) * thickness / size * clipPosition.w * 2.0; - clipPosition.xy += offset; - gl_Position = clipPosition; - } - }`,`uniform vec3 color; - uniform float opacity; - void main(){ - gl_FragColor = vec4(color, opacity); - #include - #include - }`);const Qw=["args","material-uniforms-color-value"];Xl.ReflectorShader;new Me;new Me;new Me;var Ta;/Mac/.test((Ta=globalThis==null?void 0:globalThis.navigator)===null||Ta===void 0?void 0:Ta.platform);const eT=["target","auto-rotate","auto-rotate-speed","enable-damping","damping-factor","enable-pan","key-pan-speed","keys","max-azimuth-angle","min-azimuth-angle","max-polar-angle","min-polar-angle","min-distance","max-distance","min-zoom","max-zoom","touches","enable-zoom","zoom-speed","enable-rotate","rotate-speed","args"],tT=De({__name:"OrbitControls",props:{makeDefault:{type:Boolean,default:!1},camera:{},domElement:{},target:{default:()=>[0,0,0]},enableDamping:{type:Boolean,default:!0},dampingFactor:{default:.05},autoRotate:{type:Boolean,default:!1},autoRotateSpeed:{default:2},enablePan:{type:Boolean,default:!0},keyPanSpeed:{default:7},keys:{},maxAzimuthAngle:{default:Number.POSITIVE_INFINITY},minAzimuthAngle:{default:Number.NEGATIVE_INFINITY},maxPolarAngle:{default:Math.PI},minPolarAngle:{default:0},minDistance:{default:0},maxDistance:{default:Number.POSITIVE_INFINITY},minZoom:{default:0},maxZoom:{default:Number.POSITIVE_INFINITY},touches:{default:()=>({ONE:Ln.ROTATE,TWO:Ln.DOLLY_PAN})},enableZoom:{type:Boolean,default:!0},zoomSpeed:{default:1},enableRotate:{type:Boolean,default:!0},rotateSpeed:{default:1}},emits:["change","start","end"],setup(r,{expose:e,emit:t}){const n=r,i=t,{makeDefault:o,autoRotate:s,autoRotateSpeed:a,enableDamping:l,dampingFactor:u,enablePan:c,keyPanSpeed:f,maxAzimuthAngle:d,minAzimuthAngle:h,maxPolarAngle:g,minPolarAngle:v,minDistance:p,maxDistance:m,minZoom:y,maxZoom:_,enableZoom:C,zoomSpeed:b,enableRotate:x,touches:w,rotateSpeed:M,target:T}=Jr(n),{camera:I,renderer:F,extend:A,controls:X,invalidate:S}=Yo(),G=Md(null);A({OrbitControls:qw}),Ge(G,L=>{O(),L&&o.value?X.value=L:X.value=null});function O(){ya(G.value,"change",()=>{i("change",G.value),S()}),ya(G.value,"start",()=>i("start",G.value)),ya(G.value,"end",()=>i("end",G.value))}const{onBeforeRender:D}=pu();return D(({invalidate:L})=>{G.value&&(l.value||s.value)&&(G.value.update(),s.value&&L())}),Ht(()=>{G.value&&G.value.dispose()}),e({instance:G}),(L,$)=>(L.camera||Y(I))&&(L.domElement||Y(F))?(de(),xe("TresOrbitControls",{key:0,ref_key:"controlsRef",ref:G,target:Y(T),"auto-rotate":Y(s),"auto-rotate-speed":Y(a),"enable-damping":Y(l),"damping-factor":Y(u),"enable-pan":Y(c),"key-pan-speed":Y(f),keys:L.keys,"max-azimuth-angle":Y(d),"min-azimuth-angle":Y(h),"max-polar-angle":Y(g),"min-polar-angle":Y(v),"min-distance":Y(p),"max-distance":Y(m),"min-zoom":Y(y),"max-zoom":Y(_),touches:Y(w),"enable-zoom":Y(C),"zoom-speed":Y(b),"enable-rotate":Y(x),"rotate-speed":Y(M),args:[L.camera||Y(I),L.domElement||Y(F).domElement]},null,8,eT)):tt("",!0)}});function so(r){throw new Error('Could not dynamically require "'+r+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var ch={exports:{}},fh;function nT(){return fh||(fh=1,function(r,e){(function(t){r.exports=t()})(function(){return function t(n,i,o){function s(u,c){if(!i[u]){if(!n[u]){var f=typeof so=="function"&&so;if(!c&&f)return f(u,!0);if(a)return a(u,!0);throw new Error("Cannot find module '"+u+"'")}c=i[u]={exports:{}},n[u][0].call(c.exports,function(d){var h=n[u][1][d];return s(h||d)},c,c.exports,t,n,i,o)}return i[u].exports}for(var a=typeof so=="function"&&so,l=0;l>16),G((65280&I)>>8),G(255&I);return F==2?G(255&(I=w(M.charAt(T))<<2|w(M.charAt(T+1))>>4)):F==1&&(G((I=w(M.charAt(T))<<10|w(M.charAt(T+1))<<4|w(M.charAt(T+2))>>2)>>8&255),G(255&I)),A},g.fromByteArray=function(M){var T,I,F,A,X=M.length%3,S="";function G(O){return"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(O)}for(T=0,F=M.length-X;T>18&63)+G(A>>12&63)+G(A>>6&63)+G(63&A);switch(X){case 1:S=(S+=G((I=M[M.length-1])>>2))+G(I<<4&63)+"==";break;case 2:S=(S=(S+=G((I=(M[M.length-2]<<8)+M[M.length-1])>>10))+G(I>>4&63))+G(I<<2&63)+"="}return S}})(i===void 0?this.base64js={}:i)}).call(this,t("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},t("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/base64-js/lib/b64.js","/node_modules/gulp-browserify/node_modules/base64-js/lib")},{buffer:3,lYpoI2:11}],3:[function(t,n,i){(function(o,s,p,l,u,c,f,d,h){var g=t("base64-js"),v=t("ieee754");function p(R,B,W){if(!(this instanceof p))return new p(R,B,W);var oe,ie,E,Z,H=typeof R;if(B==="base64"&&H=="string")for(R=(Z=R).trim?Z.trim():Z.replace(/^\s+|\s+$/g,"");R.length%4!=0;)R+="=";if(H=="number")oe=L(R);else if(H=="string")oe=p.byteLength(R,B);else{if(H!="object")throw new Error("First argument needs to be a number, array or string.");oe=L(R.length)}if(p._useTypedArrays?ie=p._augment(new Uint8Array(oe)):((ie=this).length=oe,ie._isBuffer=!0),p._useTypedArrays&&typeof R.byteLength=="number")ie._set(R);else if($(Z=R)||p.isBuffer(Z)||Z&&typeof Z=="object"&&typeof Z.length=="number")for(E=0;E>8,Z=Z%256,H.push(Z),H.push(E);return H}(B),R,W,oe)}function _(R,B,W){var oe="";W=Math.min(R.length,W);for(var ie=B;ie>>0)):(B+1>>0),ie}function x(R,B,W,oe){if(oe||(te(typeof W=="boolean","missing or invalid endian"),te(B!=null,"missing offset"),te(B+1>>8*(oe?E:1-E)}function F(R,B,W,oe,ie){if(ie||(te(B!=null,"missing value"),te(typeof oe=="boolean","missing or invalid endian"),te(W!=null,"missing offset"),te(W+3>>8*(oe?E:3-E)&255}function A(R,B,W,oe,ie){ie||(te(B!=null,"missing value"),te(typeof oe=="boolean","missing or invalid endian"),te(W!=null,"missing offset"),te(W+1this.length&&(oe=this.length);var ie=(oe=R.length-B=this.length))return this[R]},p.prototype.readUInt16LE=function(R,B){return C(this,R,!0,B)},p.prototype.readUInt16BE=function(R,B){return C(this,R,!1,B)},p.prototype.readUInt32LE=function(R,B){return b(this,R,!0,B)},p.prototype.readUInt32BE=function(R,B){return b(this,R,!1,B)},p.prototype.readInt8=function(R,B){if(B||(te(R!=null,"missing offset"),te(R=this.length))return 128&this[R]?-1*(255-this[R]+1):this[R]},p.prototype.readInt16LE=function(R,B){return x(this,R,!0,B)},p.prototype.readInt16BE=function(R,B){return x(this,R,!1,B)},p.prototype.readInt32LE=function(R,B){return w(this,R,!0,B)},p.prototype.readInt32BE=function(R,B){return w(this,R,!1,B)},p.prototype.readFloatLE=function(R,B){return M(this,R,!0,B)},p.prototype.readFloatBE=function(R,B){return M(this,R,!1,B)},p.prototype.readDoubleLE=function(R,B){return T(this,R,!0,B)},p.prototype.readDoubleBE=function(R,B){return T(this,R,!1,B)},p.prototype.writeUInt8=function(R,B,W){W||(te(R!=null,"missing value"),te(B!=null,"missing offset"),te(B=this.length||(this[B]=R)},p.prototype.writeUInt16LE=function(R,B,W){I(this,R,B,!0,W)},p.prototype.writeUInt16BE=function(R,B,W){I(this,R,B,!1,W)},p.prototype.writeUInt32LE=function(R,B,W){F(this,R,B,!0,W)},p.prototype.writeUInt32BE=function(R,B,W){F(this,R,B,!1,W)},p.prototype.writeInt8=function(R,B,W){W||(te(R!=null,"missing value"),te(B!=null,"missing offset"),te(B=this.length||(0<=R?this.writeUInt8(R,B,W):this.writeUInt8(255+R+1,B,W))},p.prototype.writeInt16LE=function(R,B,W){A(this,R,B,!0,W)},p.prototype.writeInt16BE=function(R,B,W){A(this,R,B,!1,W)},p.prototype.writeInt32LE=function(R,B,W){X(this,R,B,!0,W)},p.prototype.writeInt32BE=function(R,B,W){X(this,R,B,!1,W)},p.prototype.writeFloatLE=function(R,B,W){S(this,R,B,!0,W)},p.prototype.writeFloatBE=function(R,B,W){S(this,R,B,!1,W)},p.prototype.writeDoubleLE=function(R,B,W){G(this,R,B,!0,W)},p.prototype.writeDoubleBE=function(R,B,W){G(this,R,B,!1,W)},p.prototype.fill=function(R,B,W){if(B=B||0,W=W||this.length,te(typeof(R=typeof(R=R||0)=="string"?R.charCodeAt(0):R)=="number"&&!isNaN(R),"value is not a number"),te(B<=W,"end < start"),W!==B&&this.length!==0){te(0<=B&&B"},p.prototype.toArrayBuffer=function(){if(typeof Uint8Array>"u")throw new Error("Buffer.toArrayBuffer not supported in this browser");if(p._useTypedArrays)return new p(this).buffer;for(var R=new Uint8Array(this.length),B=0,W=R.length;B=B.length||ie>=R.length);ie++)B[ie+W]=R[ie];return ie}function J(R){try{return decodeURIComponent(R)}catch{return"�"}}function Q(R,B){te(typeof R=="number","cannot write a non-number as a number"),te(0<=R,"specified a negative value for writing an unsigned value"),te(R<=B,"value is larger than maximum value for type"),te(Math.floor(R)===R,"value has a fractional component")}function ce(R,B,W){te(typeof R=="number","cannot write a non-number as a number"),te(R<=B,"value larger than maximum allowed value"),te(W<=R,"value smaller than minimum allowed value"),te(Math.floor(R)===R,"value has a fractional component")}function pe(R,B,W){te(typeof R=="number","cannot write a non-number as a number"),te(R<=B,"value larger than maximum allowed value"),te(W<=R,"value smaller than minimum allowed value")}function te(R,B){if(!R)throw new Error(B||"Failed assertion")}p._augment=function(R){return R._isBuffer=!0,R._get=R.get,R._set=R.set,R.get=O.get,R.set=O.set,R.write=O.write,R.toString=O.toString,R.toLocaleString=O.toString,R.toJSON=O.toJSON,R.copy=O.copy,R.slice=O.slice,R.readUInt8=O.readUInt8,R.readUInt16LE=O.readUInt16LE,R.readUInt16BE=O.readUInt16BE,R.readUInt32LE=O.readUInt32LE,R.readUInt32BE=O.readUInt32BE,R.readInt8=O.readInt8,R.readInt16LE=O.readInt16LE,R.readInt16BE=O.readInt16BE,R.readInt32LE=O.readInt32LE,R.readInt32BE=O.readInt32BE,R.readFloatLE=O.readFloatLE,R.readFloatBE=O.readFloatBE,R.readDoubleLE=O.readDoubleLE,R.readDoubleBE=O.readDoubleBE,R.writeUInt8=O.writeUInt8,R.writeUInt16LE=O.writeUInt16LE,R.writeUInt16BE=O.writeUInt16BE,R.writeUInt32LE=O.writeUInt32LE,R.writeUInt32BE=O.writeUInt32BE,R.writeInt8=O.writeInt8,R.writeInt16LE=O.writeInt16LE,R.writeInt16BE=O.writeInt16BE,R.writeInt32LE=O.writeInt32LE,R.writeInt32BE=O.writeInt32BE,R.writeFloatLE=O.writeFloatLE,R.writeFloatBE=O.writeFloatBE,R.writeDoubleLE=O.writeDoubleLE,R.writeDoubleBE=O.writeDoubleBE,R.fill=O.fill,R.inspect=O.inspect,R.toArrayBuffer=O.toArrayBuffer,R}}).call(this,t("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},t("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/buffer/index.js","/node_modules/gulp-browserify/node_modules/buffer")},{"base64-js":2,buffer:3,ieee754:10,lYpoI2:11}],4:[function(t,n,i){(function(o,s,g,l,u,c,f,d,h){var g=t("buffer").Buffer,v=4,p=new g(v);p.fill(0),n.exports={hash:function(m,y,_,C){for(var b=y(function(I,F){I.length%v!=0&&(A=I.length+(v-I.length%v),I=g.concat([I,p],A));for(var A,X=[],S=F?I.readInt32BE:I.readInt32LE,G=0;G_?D=O(D):D.length<_&&(D=g.concat([D,C],_));for(var $=new g(_),k=new g(_),N=0;N<_;N++)$[N]=54^D[N],k[N]=92^D[N];return L=O(g.concat([$,L])),O(g.concat([k,L]))}(A,F,G):A(G);return X=null,S?G.toString(S):G}}}function x(){var I=[].slice.call(arguments).join(" ");throw new Error([I,"we accept pull requests","http://github.com/dominictarr/crypto-browserify"].join(` -`))}C.fill(0),i.createHash=function(I){return b(I)},i.createHmac=b,i.randomBytes=function(I,F){if(!F||!F.call)return new g(m(I));try{F.call(this,void 0,new g(m(I)))}catch(A){F(A)}};var w,M=["createCredentials","createCipher","createCipheriv","createDecipher","createDecipheriv","createSign","createVerify","createDiffieHellman","pbkdf2"],T=function(I){i[I]=function(){x("sorry,",I,"is not implemented yet")}};for(w in M)T(M[w])}).call(this,t("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},t("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/index.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{"./md5":6,"./rng":7,"./sha":8,"./sha256":9,buffer:3,lYpoI2:11}],6:[function(t,n,i){(function(o,s,a,l,u,c,f,d,h){var g=t("./helpers");function v(x,w){x[w>>5]|=128<>>9<<4)]=w;for(var M=1732584193,T=-271733879,I=-1732584194,F=271733878,A=0;A>>32-I,M)}function m(x,w,M,T,I,F,A){return p(w&M|~w&T,x,w,I,F,A)}function y(x,w,M,T,I,F,A){return p(w&T|M&~T,x,w,I,F,A)}function _(x,w,M,T,I,F,A){return p(w^M^T,x,w,I,F,A)}function C(x,w,M,T,I,F,A){return p(M^(w|~T),x,w,I,F,A)}function b(x,w){var M=(65535&x)+(65535&w);return(x>>16)+(w>>16)+(M>>16)<<16|65535&M}n.exports=function(x){return g.hash(x,v,16)}}).call(this,t("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},t("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/md5.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{"./helpers":4,buffer:3,lYpoI2:11}],7:[function(t,n,i){(function(o,s,a,l,u,c,f,d,h){n.exports=function(g){for(var v,p=new Array(g),m=0;m>>((3&m)<<3)&255;return p}}).call(this,t("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},t("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/rng.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{buffer:3,lYpoI2:11}],8:[function(t,n,i){(function(o,s,a,l,u,c,f,d,h){var g=t("./helpers");function v(y,_){y[_>>5]|=128<<24-_%32,y[15+(_+64>>9<<4)]=_;for(var C,b,x,w=Array(80),M=1732584193,T=-271733879,I=-1732584194,F=271733878,A=-1009589776,X=0;X>16)+(_>>16)+(C>>16)<<16|65535&C}function m(y,_){return y<<_|y>>>32-_}n.exports=function(y){return g.hash(y,v,20,!0)}}).call(this,t("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},t("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/sha.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{"./helpers":4,buffer:3,lYpoI2:11}],9:[function(t,n,i){(function(o,s,a,l,u,c,f,d,h){function g(_,C){var b=(65535&_)+(65535&C);return(_>>16)+(C>>16)+(b>>16)<<16|65535&b}function v(_,C){var b,x=new Array(1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298),w=new Array(1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225),M=new Array(64);_[C>>5]|=128<<24-C%32,_[15+(C+64>>9<<4)]=C;for(var T,I,F=0;F<_.length;F+=16){for(var A=w[0],X=w[1],S=w[2],G=w[3],O=w[4],D=w[5],L=w[6],$=w[7],k=0;k<64;k++)M[k]=k<16?_[k+F]:g(g(g((I=M[k-2],m(I,17)^m(I,19)^y(I,10)),M[k-7]),(I=M[k-15],m(I,7)^m(I,18)^y(I,3))),M[k-16]),b=g(g(g(g($,m(I=O,6)^m(I,11)^m(I,25)),O&D^~O&L),x[k]),M[k]),T=g(m(T=A,2)^m(T,13)^m(T,22),A&X^A&S^X&S),$=L,L=D,D=O,O=g(G,b),G=S,S=X,X=A,A=g(b,T);w[0]=g(A,w[0]),w[1]=g(X,w[1]),w[2]=g(S,w[2]),w[3]=g(G,w[3]),w[4]=g(O,w[4]),w[5]=g(D,w[5]),w[6]=g(L,w[6]),w[7]=g($,w[7])}return w}var p=t("./helpers"),m=function(_,C){return _>>>C|_<<32-C},y=function(_,C){return _>>>C};n.exports=function(_){return p.hash(_,v,32,!0)}}).call(this,t("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},t("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/sha256.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{"./helpers":4,buffer:3,lYpoI2:11}],10:[function(t,n,i){(function(o,s,a,l,u,c,f,d,h){i.read=function(g,v,p,m,F){var _,C,b=8*F-m-1,x=(1<>1,M=-7,T=p?F-1:0,I=p?-1:1,F=g[v+T];for(T+=I,_=F&(1<<-M)-1,F>>=-M,M+=b;0>=-M,M+=m;0>1,T=y===23?Math.pow(2,-24)-Math.pow(2,-77):0,I=m?0:A-1,F=m?1:-1,A=v<0||v===0&&1/v<0?1:0;for(v=Math.abs(v),isNaN(v)||v===1/0?(b=isNaN(v)?1:0,C=w):(C=Math.floor(Math.log(v)/Math.LN2),v*(m=Math.pow(2,-C))<1&&(C--,m*=2),2<=(v+=1<=C+M?T/m:T*Math.pow(2,1-M))*m&&(C++,m/=2),w<=C+M?(b=0,C=w):1<=C+M?(b=(v*m-1)*Math.pow(2,y),C+=M):(b=v*Math.pow(2,M-1)*Math.pow(2,y),C=0));8<=y;g[p+I]=255&b,I+=F,b/=256,y-=8);for(C=C<>=","++","--","<<",">>","<=",">=","==","!=","&&","||","+=","-=","*=","/=","%=","&=","^^","^=","|=","(",")","[","]",".","!","~","*","/","%","+","-","<",">","&","^","|","?",":","=",",",";","{","}"]),ph}var gh,vh;function rm(){return vh||(vh=1,gh=["abs","acos","all","any","asin","atan","ceil","clamp","cos","cross","dFdx","dFdy","degrees","distance","dot","equal","exp","exp2","faceforward","floor","fract","gl_BackColor","gl_BackLightModelProduct","gl_BackLightProduct","gl_BackMaterial","gl_BackSecondaryColor","gl_ClipPlane","gl_ClipVertex","gl_Color","gl_DepthRange","gl_DepthRangeParameters","gl_EyePlaneQ","gl_EyePlaneR","gl_EyePlaneS","gl_EyePlaneT","gl_Fog","gl_FogCoord","gl_FogFragCoord","gl_FogParameters","gl_FragColor","gl_FragCoord","gl_FragData","gl_FragDepth","gl_FragDepthEXT","gl_FrontColor","gl_FrontFacing","gl_FrontLightModelProduct","gl_FrontLightProduct","gl_FrontMaterial","gl_FrontSecondaryColor","gl_LightModel","gl_LightModelParameters","gl_LightModelProducts","gl_LightProducts","gl_LightSource","gl_LightSourceParameters","gl_MaterialParameters","gl_MaxClipPlanes","gl_MaxCombinedTextureImageUnits","gl_MaxDrawBuffers","gl_MaxFragmentUniformComponents","gl_MaxLights","gl_MaxTextureCoords","gl_MaxTextureImageUnits","gl_MaxTextureUnits","gl_MaxVaryingFloats","gl_MaxVertexAttribs","gl_MaxVertexTextureImageUnits","gl_MaxVertexUniformComponents","gl_ModelViewMatrix","gl_ModelViewMatrixInverse","gl_ModelViewMatrixInverseTranspose","gl_ModelViewMatrixTranspose","gl_ModelViewProjectionMatrix","gl_ModelViewProjectionMatrixInverse","gl_ModelViewProjectionMatrixInverseTranspose","gl_ModelViewProjectionMatrixTranspose","gl_MultiTexCoord0","gl_MultiTexCoord1","gl_MultiTexCoord2","gl_MultiTexCoord3","gl_MultiTexCoord4","gl_MultiTexCoord5","gl_MultiTexCoord6","gl_MultiTexCoord7","gl_Normal","gl_NormalMatrix","gl_NormalScale","gl_ObjectPlaneQ","gl_ObjectPlaneR","gl_ObjectPlaneS","gl_ObjectPlaneT","gl_Point","gl_PointCoord","gl_PointParameters","gl_PointSize","gl_Position","gl_ProjectionMatrix","gl_ProjectionMatrixInverse","gl_ProjectionMatrixInverseTranspose","gl_ProjectionMatrixTranspose","gl_SecondaryColor","gl_TexCoord","gl_TextureEnvColor","gl_TextureMatrix","gl_TextureMatrixInverse","gl_TextureMatrixInverseTranspose","gl_TextureMatrixTranspose","gl_Vertex","greaterThan","greaterThanEqual","inversesqrt","length","lessThan","lessThanEqual","log","log2","matrixCompMult","max","min","mix","mod","normalize","not","notEqual","pow","radians","reflect","refract","sign","sin","smoothstep","sqrt","step","tan","texture2D","texture2DLod","texture2DProj","texture2DProjLod","textureCube","textureCubeLod","texture2DLodEXT","texture2DProjLodEXT","textureCubeLodEXT","texture2DGradEXT","texture2DProjGradEXT","textureCubeGradEXT"]),gh}var Sa,yh;function iT(){if(yh)return Sa;yh=1;var r=nm();return Sa=r.slice().concat(["layout","centroid","smooth","case","mat2x2","mat2x3","mat2x4","mat3x2","mat3x3","mat3x4","mat4x2","mat4x3","mat4x4","uvec2","uvec3","uvec4","samplerCubeShadow","sampler2DArray","sampler2DArrayShadow","isampler2D","isampler3D","isamplerCube","isampler2DArray","usampler2D","usampler3D","usamplerCube","usampler2DArray","coherent","restrict","readonly","writeonly","resource","atomic_uint","noperspective","patch","sample","subroutine","common","partition","active","filter","image1D","image2D","image3D","imageCube","iimage1D","iimage2D","iimage3D","iimageCube","uimage1D","uimage2D","uimage3D","uimageCube","image1DArray","image2DArray","iimage1DArray","iimage2DArray","uimage1DArray","uimage2DArray","image1DShadow","image2DShadow","image1DArrayShadow","image2DArrayShadow","imageBuffer","iimageBuffer","uimageBuffer","sampler1DArray","sampler1DArrayShadow","isampler1D","isampler1DArray","usampler1D","usampler1DArray","isampler2DRect","usampler2DRect","samplerBuffer","isamplerBuffer","usamplerBuffer","sampler2DMS","isampler2DMS","usampler2DMS","sampler2DMSArray","isampler2DMSArray","usampler2DMSArray"]),Sa}var Ea,_h;function oT(){if(_h)return Ea;_h=1;var r=rm();return r=r.slice().filter(function(e){return!/^(gl\_|texture)/.test(e)}),Ea=r.concat(["gl_VertexID","gl_InstanceID","gl_Position","gl_PointSize","gl_FragCoord","gl_FrontFacing","gl_FragDepth","gl_PointCoord","gl_MaxVertexAttribs","gl_MaxVertexUniformVectors","gl_MaxVertexOutputVectors","gl_MaxFragmentInputVectors","gl_MaxVertexTextureImageUnits","gl_MaxCombinedTextureImageUnits","gl_MaxTextureImageUnits","gl_MaxFragmentUniformVectors","gl_MaxDrawBuffers","gl_MinProgramTexelOffset","gl_MaxProgramTexelOffset","gl_DepthRangeParameters","gl_DepthRange","trunc","round","roundEven","isnan","isinf","floatBitsToInt","floatBitsToUint","intBitsToFloat","uintBitsToFloat","packSnorm2x16","unpackSnorm2x16","packUnorm2x16","unpackUnorm2x16","packHalf2x16","unpackHalf2x16","outerProduct","transpose","determinant","inverse","texture","textureSize","textureProj","textureLod","textureOffset","texelFetch","texelFetchOffset","textureProjOffset","textureLodOffset","textureProjLod","textureProjLodOffset","textureGrad","textureGradOffset","textureProjGrad","textureProjGradOffset"]),Ea}var Aa,xh;function sT(){if(xh)return Aa;xh=1,Aa=C;var r=nm(),e=rT(),t=rm(),n=iT(),i=oT(),o=999,s=9999,a=0,l=1,u=2,c=3,f=4,d=5,h=6,g=7,v=8,p=9,m=10,y=11,_=["block-comment","line-comment","preprocessor","operator","integer","float","ident","builtin","keyword","whitespace","eof","integer"];function C(b){var x=0,w=0,M=o,T,I,F=[],A=[],X=1,S=0,G=0,O=!1,D=!1,L="",$;b=b||{};var k=t,N=r;b.version==="300 es"&&(k=i,N=n);for(var V={},P={},x=0;x0)continue;ae=z.slice(0,1).join("")}return J(ae),G+=ae.length,F=F.slice(ae.length),F.length}while(!0)}function E(){return/[^a-fA-F0-9]/.test(T)?(J(F.join("")),M=o,x):(F.push(T),I=T,x+1)}function Z(){return T==="."||/[eE]/.test(T)?(F.push(T),M=d,I=T,x+1):T==="x"&&F.length===1&&F[0]==="0"?(M=y,F.push(T),I=T,x+1):/[^\d]/.test(T)?(J(F.join("")),M=o,x):(F.push(T),I=T,x+1)}function H(){return T==="f"&&(F.push(T),I=T,x+=1),/[eE]/.test(T)||(T==="-"||T==="+")&&/[eE]/.test(I)?(F.push(T),I=T,x+1):/[^\d]/.test(T)?(J(F.join("")),M=o,x):(F.push(T),I=T,x+1)}function j(){if(/[^\d\w_]/.test(T)){var z=F.join("");return P[z]?M=v:V[z]?M=g:M=h,J(F.join("")),M=o,x}return F.push(T),I=T,x+1}}return Aa}var Ca,bh;function aT(){if(bh)return Ca;bh=1;var r=sT();Ca=e;function e(t,n){var i=r(n),o=[];return o=o.concat(i(t)),o=o.concat(i(null)),o}return Ca}aT();function lT(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function uT(r){var e=lT(r,"string");return typeof e=="symbol"?e:String(e)}function qe(r,e,t){return e=uT(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}var Re={position:"csm_Position",positionRaw:"csm_PositionRaw",pointSize:"csm_PointSize",fragColor:"csm_FragColor",diffuseColor:"csm_DiffuseColor",normal:"csm_Normal",roughness:"csm_Roughness",metalness:"csm_Metalness",emissive:"csm_Emissive",ao:"csm_AO",bump:"csm_Bump",depthAlpha:"csm_DepthAlpha"},kt,Rr;kt={},qe(kt,"".concat(Re.normal),{"#include ":` - vec3 objectNormal = `.concat(Re.normal,`; - #ifdef USE_TANGENT - vec3 objectTangent = vec3( tangent.xyz ); - #endif - `)}),qe(kt,"".concat(Re.position),{"#include ":` - vec3 transformed = `.concat(Re.position,`; - `)}),qe(kt,"".concat(Re.positionRaw),{"#include ":` - vec4 csm_internal_positionUnprojected = `.concat(Re.positionRaw,`; - mat4x4 csm_internal_unprojectMatrix = projectionMatrix * modelViewMatrix; - #ifdef USE_INSTANCING - csm_internal_unprojectMatrix = csm_internal_unprojectMatrix * instanceMatrix; - #endif - csm_internal_positionUnprojected = inverse(csm_internal_unprojectMatrix) * csm_internal_positionUnprojected; - vec3 transformed = csm_internal_positionUnprojected.xyz; - `)}),qe(kt,"".concat(Re.pointSize),{"gl_PointSize = size;":` - gl_PointSize = `.concat(Re.pointSize,`; - `)}),qe(kt,"".concat(Re.diffuseColor),{"#include ":` - #include - diffuseColor = `.concat(Re.diffuseColor,`; - `)}),qe(kt,"".concat(Re.fragColor),{"#include ":` - #include - gl_FragColor = `.concat(Re.fragColor,`; - `)}),qe(kt,"".concat(Re.emissive),{"vec3 totalEmissiveRadiance = emissive;":` - vec3 totalEmissiveRadiance = `.concat(Re.emissive,`; - `)}),qe(kt,"".concat(Re.roughness),{"#include ":` - #include - roughnessFactor = `.concat(Re.roughness,`; - `)}),qe(kt,"".concat(Re.metalness),{"#include ":` - #include - metalnessFactor = `.concat(Re.metalness,`; - `)}),qe(kt,"".concat(Re.ao),{"#include ":` - #include - reflectedLight.indirectDiffuse *= 1. - `.concat(Re.ao,`; - `)}),qe(kt,"".concat(Re.bump),{"#include ":` - #include - - vec3 csm_internal_orthogonal = `.concat(Re.bump," - (dot(").concat(Re.bump,`, normal) * normal); - vec3 csm_internal_projectedbump = mat3(csm_internal_vModelViewMatrix) * csm_internal_orthogonal; - normal = normalize(normal - csm_internal_projectedbump); - `)}),qe(kt,"".concat(Re.depthAlpha),{"gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );":` - gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity * `.concat(Re.depthAlpha,` ); - `),"gl_FragColor = packDepthToRGBA( fragCoordZ );":` - gl_FragColor = packDepthToRGBA( fragCoordZ ); - gl_FragColor.a *= `.concat(Re.depthAlpha,`; - `)});Rr={},qe(Rr,"".concat(Re.position),{"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );":` - gl_Position = projectionMatrix * modelViewMatrix * vec4( `.concat(Re.position,`, 1.0 ); - `)}),qe(Rr,"".concat(Re.positionRaw),{"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );":` - gl_Position = `.concat(Re.position,`; - `)}),qe(Rr,"".concat(Re.diffuseColor),{"gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );":` - gl_FragColor = `.concat(Re.diffuseColor,`; - `)}),qe(Rr,"".concat(Re.fragColor),{"gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );":` - gl_FragColor = `.concat(Re.fragColor,`; - `)});var Pt;Pt={},qe(Pt,"".concat(Re.position),"*"),qe(Pt,"".concat(Re.positionRaw),"*"),qe(Pt,"".concat(Re.normal),"*"),qe(Pt,"".concat(Re.pointSize),["PointsMaterial"]),qe(Pt,"".concat(Re.diffuseColor),"*"),qe(Pt,"".concat(Re.fragColor),"*"),qe(Pt,"".concat(Re.emissive),["MeshStandardMaterial","MeshPhysicalMaterial"]),qe(Pt,"".concat(Re.roughness),["MeshStandardMaterial","MeshPhysicalMaterial"]),qe(Pt,"".concat(Re.metalness),["MeshStandardMaterial","MeshPhysicalMaterial"]),qe(Pt,"".concat(Re.ao),["MeshStandardMaterial","MeshPhysicalMaterial","MeshBasicMaterial","MeshLambertMaterial","MeshPhongMaterial","MeshToonMaterial"]),qe(Pt,"".concat(Re.bump),["MeshLambertMaterial","MeshMatcapMaterial","MeshNormalMaterial","MeshPhongMaterial","MeshPhysicalMaterial","MeshStandardMaterial","MeshToonMaterial","ShadowMaterial"]),qe(Pt,"".concat(Re.depthAlpha),"*");var cT=`void main() { - gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0); -}`,fT=`#include - -void main() { - vec2 center = vec2(0., 1.); - float rotation = 0.0; - - - - float size = 0.03; - - vec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 ); - vec2 scale; - scale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) ); - scale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) ); - - bool isPerspective = isPerspectiveMatrix( projectionMatrix ); - if ( isPerspective ) scale *= - mvPosition.z; - - vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale * size; - vec2 rotatedPosition; - rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y; - rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y; - mvPosition.xy += rotatedPosition; - - gl_Position = projectionMatrix * mvPosition; -}`;const Ui=new Me(0,0,0),Vu=new Me(0,0,0),hT=new Me(0,0,0);function wh(r,e,t){const n=Ui.setFromMatrixPosition(r.matrixWorld);n.project(e);const i=t.width/2,o=t.height/2;return[(Number.isNaN(n.x)?0:n.x)*i+i,-(n.y*o)+o]}function dT(r,e){const t=Ui.setFromMatrixPosition(r.matrixWorld),n=Vu.setFromMatrixPosition(e.matrixWorld),i=t.sub(n),o=e.getWorldDirection(hT);return i.angleTo(o)>Math.PI/2}function pT(r,e,t,n){const i=Ui.setFromMatrixPosition(r.matrixWorld),o=i.clone();o.project(e),t.setFromCamera(new _t(o.x,o.y),e);const s=t.intersectObjects(n,!0);if(s.length>0){const a=s[0].distance;return i.distanceTo(t.ray.origin)Math.abs(r)<1e-10?0:r;function im(r,e,t=""){let n="matrix3d(";for(let i=0;i!==16;i++)n+=ql(e[i]*r.elements[i])+(i!==15?",":")");return t+n}const vT=(r=>e=>im(e,r))([1,-1,1,1,1,-1,1,1,1,-1,1,1,1,-1,1,1]),yT=(r=>(e,t)=>im(e,r(t),"translate(-50%,-50%)"))(r=>[1/r,1/r,1/r,1,-1/r,-1/r,-1/r,-1,1/r,1/r,1/r,1,1,1,1,1]),_T=["geometry","material"];new kd;var Yl={exports:{}},xT=Yl.exports,Th;function bT(){return Th||(Th=1,function(r,e){(function(t,n){r.exports=n()})(xT,function(){var t=function(){function n(h){return s.appendChild(h.dom),h}function i(h){for(var g=0;gl+1e3&&(c.update(1e3*u/(h-l),100),l=h,u=0,d)){var g=performance.memory;d.update(g.usedJSHeapSize/1048576,g.jsHeapSizeLimit/1048576)}return h},update:function(){a=this.end()},domElement:s,setMode:i}};return t.Panel=function(n,i,o){var s=1/0,a=0,l=Math.round,u=l(window.devicePixelRatio||1),c=80*u,f=48*u,d=3*u,h=2*u,g=3*u,v=15*u,p=74*u,m=30*u,y=document.createElement("canvas");y.width=c,y.height=f,y.style.cssText="width:80px;height:48px";var _=y.getContext("2d");return _.font="bold "+9*u+"px Helvetica,Arial,sans-serif",_.textBaseline="top",_.fillStyle=o,_.fillRect(0,0,c,f),_.fillStyle=i,_.fillText(n,d,h),_.fillRect(g,v,p,m),_.fillStyle=o,_.globalAlpha=.9,_.fillRect(g,v,p,m),{dom:y,update:function(C,b){s=Math.min(s,C),a=Math.max(a,C),_.fillStyle=o,_.globalAlpha=1,_.fillRect(0,0,c,v),_.fillStyle=i,_.fillText(l(C)+" "+n+" ("+l(s)+"-"+l(a)+")",d,h),_.drawImage(y,g+u,v,p-u,m,g,v,p-u,m),_.fillRect(g+p-u,v,u,m),_.fillStyle=o,_.globalAlpha=.9,_.fillRect(g+p-u,v,u,l((1-C/b)*m))}}},t})}(Yl)),Yl.exports}bT();const wT={key:0,args:[0,1,64]},TT={key:1,args:[.5,1,64]},ST={key:2},ET=["tone-mapped","map","side","color"];new It(16777215);const yn="0px",ss=De({__name:"TransitionVertical",props:{duration:{default:250},easingEnter:{default:"ease-in-out"},easingLeave:{default:"ease-in-out"},opacityClosed:{default:0},opacityOpened:{default:1}},setup(r){const e=r;function t(l){return{height:l.style.height,width:l.style.width,position:l.style.position,visibility:l.style.visibility,overflow:l.style.overflow,paddingTop:l.style.paddingTop,paddingBottom:l.style.paddingBottom,borderTopWidth:l.style.borderTopWidth,borderBottomWidth:l.style.borderBottomWidth,marginTop:l.style.marginTop,marginBottom:l.style.marginBottom}}function n(l,u){const{width:c}=getComputedStyle(l);l.style.width=c,l.style.position="absolute",l.style.visibility="hidden",l.style.height="";const{height:f}=getComputedStyle(l);return l.style.width=u.width,l.style.position=u.position,l.style.visibility=u.visibility,l.style.height=yn,l.style.overflow="hidden",u.height&&u.height!==yn?u.height:f}function i(l,u,c,f,d){const h=l.animate(f,d);l.style.height=u.height,h.onfinish=()=>{l.style.overflow=u.overflow,c()}}function o(l,u){return[{height:yn,opacity:e.opacityClosed,paddingTop:yn,paddingBottom:yn,borderTopWidth:yn,borderBottomWidth:yn,marginTop:yn,marginBottom:yn},{height:l,opacity:e.opacityOpened,paddingTop:u.paddingTop,paddingBottom:u.paddingBottom,borderTopWidth:u.borderTopWidth,borderBottomWidth:u.borderBottomWidth,marginTop:u.marginTop,marginBottom:u.marginBottom}]}function s(l,u){const c=l,f=t(c),d=n(c,f),h=o(d,f),g={duration:e.duration,easing:e.easingEnter};i(c,f,u,h,g)}function a(l,u){const c=l,f=t(c),{height:d}=getComputedStyle(c);c.style.height=d,c.style.overflow="hidden";const h=o(d,f).reverse(),g={duration:e.duration,easing:e.easingLeave};i(c,f,u,h,g)}return(l,u)=>(de(),lt(Zo,{css:!1,onEnter:s,onLeave:a},{default:Ue(()=>[ut(l.$slots,"default")]),_:3}))}}),AT={flex:"~ col",border:"~ gray/25 rounded-lg",divide:"y dashed gray/25","of-clip":"","shadow-sm":""},CT={op50:""},IT={key:0,"w-full":""},Sh=De({__name:"Collapsable",props:Fg({default:{type:Boolean},label:null},{modelValue:{type:Boolean,default:!1},modelModifiers:{}}),emits:["update:modelValue"],setup(r){const e=r,t=Lg(r,"modelValue");return hn(()=>{e.default!=null&&(t.value=!!e.default)}),(n,i)=>(de(),xe("div",AT,[K("button",{sticky:"","top-0":"","z-10":"",flex:"","items-center":"","justify-between":"",px2:"",py1:"","text-sm":"","backdrop-blur-xl":"",onClick:i[0]||(i[0]=o=>t.value=!t.value)},[K("span",null,[ut(n.$slots,"label",{},()=>[_c(we(e.label??"Collapsable"),1)])]),i[1]||(i[1]=_c()),K("span",CT,we(t.value?"▲":"▼"),1)]),Fe(ss,null,{default:Ue(()=>[t.value?(de(),xe("div",IT,[ut(n.$slots,"default")])):tt("",!0)]),_:3})]))}}),Or=De({__name:"Range",props:{modelValue:null,min:{default:0},max:{default:100},step:{default:1},disabled:{type:Boolean,default:!1}},emits:["update:modelValue","mousedown"],setup(r,{emit:e}){const t=r,n=e,i=le(null);function o(g,v,p){return Math.min(Math.max(g,v),p)}function s(g){const v=g.toString();return v.includes("e-")?Number.parseInt(v.split("e-")[1],10):v.includes(".")?v.split(".")[1].length:0}function a(g,v){const p=s(v),m=10**(p+3);return Number.parseFloat((g*m/m).toFixed(p))}const l=Ve(()=>a(o(t.modelValue,t.min,t.max),t.step)),u=Ve(()=>{const g=(l.value-t.min)/(t.max-t.min)*100;return{width:`${g}%`,backgroundSize:`${g}% 100%`}});function c(g){if(!i.value)return l.value;const v=i.value.getBoundingClientRect(),m=(g.clientX-v.left)/v.width,y=t.max-t.min,_=t.min+y*m,C=Math.round(_/t.step)*t.step;return Math.min(Math.max(C,t.min),t.max)}function f(g){if(t.disabled)return;const v=c(g);n("update:modelValue",v)}function d(g){if(t.disabled)return;g.preventDefault();const v=c(g);n("update:modelValue",v),window.addEventListener("mousemove",f),window.addEventListener("mouseup",h)}function h(g){window.removeEventListener("mousemove",f),window.removeEventListener("mouseup",h)}return Ht(()=>{window.removeEventListener("mousemove",f),window.removeEventListener("mouseup",h)}),(g,v)=>(de(),xe("span",{ref_key:"sliderRef",ref:i,class:Jt(["range-slider disabled:pointer-events-none disabled:cursor-default disabled:opacity-50",{disabled:r.disabled}]),bg:"[#e6e1fc] dark:[#676085]","touch-action-none":"",relative:"","inline-block":"","w-full":"","cursor-ew-resize":"","rounded-sm":"",onMousedown:d},[K("span",{style:Zr(u.value),bg:"[#cabeff] dark:[#4e34b9]",relative:"",block:"","rounded-sm":"",h:"[14px]"},null,4),K("span",{role:"slider",class:"slider-thumb",style:Zr({left:`${(l.value-r.min)/(r.max-r.min)*100}%`}),absolute:"","rounded-sm":"",w:"[1px]",h:"[14px]",bg:"zinc-100 dark:zinc-400",top:"50%",transform:"translate-x-[50%] translate-y-[-50%]"},null,4)],34))}});function fi(r,e){return r+Math.random()*(e-r)}function Eh(r,e){if(e===Ng)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),r;if(e===Ja||e===Ud){let t=r.getIndex();if(t===null){const s=[],a=r.getAttribute("position");if(a!==void 0){for(let l=0;l=2.0 are supported."));return}const u=new l2(o,{path:t||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});u.fileLoader.setRequestHeader(this.requestHeader);for(let c=0;c=0&&a[f]===void 0&&console.warn('THREE.GLTFLoader: Unknown extension "'+f+'".')}}u.setExtensions(s),u.setPlugins(a),u.parse(n,i)}parseAsync(e,t){const n=this;return new Promise(function(i,o){n.parse(e,t,i,o)})}}function kT(){let r={};return{get:function(e){return r[e]},add:function(e,t){r[e]=t},remove:function(e){delete r[e]},removeAll:function(){r={}}}}const ze={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_DISPERSION:"KHR_materials_dispersion",KHR_MATERIALS_IOR:"KHR_materials_ior",KHR_MATERIALS_SHEEN:"KHR_materials_sheen",KHR_MATERIALS_SPECULAR:"KHR_materials_specular",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_IRIDESCENCE:"KHR_materials_iridescence",KHR_MATERIALS_ANISOTROPY:"KHR_materials_anisotropy",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_MATERIALS_VOLUME:"KHR_materials_volume",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",KHR_MATERIALS_EMISSIVE_STRENGTH:"KHR_materials_emissive_strength",EXT_MATERIALS_BUMP:"EXT_materials_bump",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_TEXTURE_AVIF:"EXT_texture_avif",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression",EXT_MESH_GPU_INSTANCING:"EXT_mesh_gpu_instancing"};class PT{constructor(e){this.parser=e,this.name=ze.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){const e=this.parser,t=this.parser.json.nodes||[];for(let n=0,i=t.length;n=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return t.loadTextureImage(e,o.source,s)}}class HT{constructor(e){this.parser=e,this.name=ze.EXT_TEXTURE_WEBP,this.isSupported=null}loadTexture(e){const t=this.name,n=this.parser,i=n.json,o=i.textures[e];if(!o.extensions||!o.extensions[t])return null;const s=o.extensions[t],a=i.images[s.source];let l=n.textureLoader;if(a.uri){const u=n.options.manager.getHandler(a.uri);u!==null&&(l=u)}return this.detectSupport().then(function(u){if(u)return n.loadTextureImage(e,s.source,l);if(i.extensionsRequired&&i.extensionsRequired.indexOf(t)>=0)throw new Error("THREE.GLTFLoader: WebP required by asset but unsupported.");return n.loadTexture(e)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(e){const t=new Image;t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",t.onload=t.onerror=function(){e(t.height===1)}})),this.isSupported}}class XT{constructor(e){this.parser=e,this.name=ze.EXT_TEXTURE_AVIF,this.isSupported=null}loadTexture(e){const t=this.name,n=this.parser,i=n.json,o=i.textures[e];if(!o.extensions||!o.extensions[t])return null;const s=o.extensions[t],a=i.images[s.source];let l=n.textureLoader;if(a.uri){const u=n.options.manager.getHandler(a.uri);u!==null&&(l=u)}return this.detectSupport().then(function(u){if(u)return n.loadTextureImage(e,s.source,l);if(i.extensionsRequired&&i.extensionsRequired.indexOf(t)>=0)throw new Error("THREE.GLTFLoader: AVIF required by asset but unsupported.");return n.loadTexture(e)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(e){const t=new Image;t.src="data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAABcAAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAEAAAABAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQAMAAAAABNjb2xybmNseAACAAIABoAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAAB9tZGF0EgAKCBgABogQEDQgMgkQAAAAB8dSLfI=",t.onload=t.onerror=function(){e(t.height===1)}})),this.isSupported}}class WT{constructor(e){this.name=ze.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){const t=this.parser.json,n=t.bufferViews[e];if(n.extensions&&n.extensions[this.name]){const i=n.extensions[this.name],o=this.parser.getDependency("buffer",i.buffer),s=this.parser.options.meshoptDecoder;if(!s||!s.supported){if(t.extensionsRequired&&t.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return o.then(function(a){const l=i.byteOffset||0,u=i.byteLength||0,c=i.count,f=i.byteStride,d=new Uint8Array(a,l,u);return s.decodeGltfBufferAsync?s.decodeGltfBufferAsync(c,f,d,i.mode,i.filter).then(function(h){return h.buffer}):s.ready.then(function(){const h=new ArrayBuffer(c*f);return s.decodeGltfBuffer(new Uint8Array(h),c,f,d,i.mode,i.filter),h})})}else return null}}class qT{constructor(e){this.name=ze.EXT_MESH_GPU_INSTANCING,this.parser=e}createNodeMesh(e){const t=this.parser.json,n=t.nodes[e];if(!n.extensions||!n.extensions[this.name]||n.mesh===void 0)return null;const i=t.meshes[n.mesh];for(const u of i.primitives)if(u.mode!==Yt.TRIANGLES&&u.mode!==Yt.TRIANGLE_STRIP&&u.mode!==Yt.TRIANGLE_FAN&&u.mode!==void 0)return null;const s=n.extensions[this.name].attributes,a=[],l={};for(const u in s)a.push(this.parser.getDependency("accessor",s[u]).then(c=>(l[u]=c,l[u])));return a.length<1?null:(a.push(this.parser.createNodeMesh(e)),Promise.all(a).then(u=>{const c=u.pop(),f=c.isGroup?c.children:[c],d=u[0].count,h=[];for(const g of f){const v=new Tn,p=new Me,m=new Io,y=new Me(1,1,1),_=new jg(g.geometry,g.material,d);for(let C=0;C0||r.search(/^data\:image\/jpeg/)===0?"image/jpeg":r.search(/\.webp($|\?)/i)>0||r.search(/^data\:image\/webp/)===0?"image/webp":r.search(/\.ktx2($|\?)/i)>0||r.search(/^data\:image\/ktx2/)===0?"image/ktx2":"image/png"}const a2=new Tn;class l2{constructor(e={},t={}){this.json=e,this.extensions={},this.plugins={},this.options=t,this.cache=new kT,this.associations=new Map,this.primitiveCache={},this.nodeCache={},this.meshCache={refs:{},uses:{}},this.cameraCache={refs:{},uses:{}},this.lightCache={refs:{},uses:{}},this.sourceCache={},this.textureCache={},this.nodeNamesUsed={};let n=!1,i=-1,o=!1,s=-1;if(typeof navigator<"u"){const a=navigator.userAgent;n=/^((?!chrome|android).)*safari/i.test(a)===!0;const l=a.match(/Version\/(\d+)/);i=n&&l?parseInt(l[1],10):-1,o=a.indexOf("Firefox")>-1,s=o?a.match(/Firefox\/([0-9]+)\./)[1]:-1}typeof createImageBitmap>"u"||n&&i<17||o&&s<98?this.textureLoader=new Gg(this.options.manager):this.textureLoader=new $g(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new zd(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),this.options.crossOrigin==="use-credentials"&&this.fileLoader.setWithCredentials(!0)}setExtensions(e){this.extensions=e}setPlugins(e){this.plugins=e}parse(e,t){const n=this,i=this.json,o=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll(function(s){return s._markDefs&&s._markDefs()}),Promise.all(this._invokeAll(function(s){return s.beforeRoot&&s.beforeRoot()})).then(function(){return Promise.all([n.getDependencies("scene"),n.getDependencies("animation"),n.getDependencies("camera")])}).then(function(s){const a={scene:s[0][i.scene||0],scenes:s[0],animations:s[1],cameras:s[2],asset:i.asset,parser:n,userData:{}};return Qn(o,a,i),bn(a,i),Promise.all(n._invokeAll(function(l){return l.afterRoot&&l.afterRoot(a)})).then(function(){for(const l of a.scenes)l.updateMatrixWorld();e(a)})}).catch(t)}_markDefs(){const e=this.json.nodes||[],t=this.json.skins||[],n=this.json.meshes||[];for(let i=0,o=t.length;i{const l=this.associations.get(s);l!=null&&this.associations.set(a,l);for(const[u,c]of s.children.entries())o(c,a.children[u])};return o(n,i),i.name+="_instance_"+e.uses[t]++,i}_invokeOne(e){const t=Object.values(this.plugins);t.push(this);for(let n=0;n=2&&p.setY(T,x[w*l+1]),l>=3&&p.setZ(T,x[w*l+2]),l>=4&&p.setW(T,x[w*l+3]),l>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}p.normalized=g}return p})}loadTexture(e){const t=this.json,n=this.options,o=t.textures[e].source,s=t.images[o];let a=this.textureLoader;if(s.uri){const l=n.manager.getHandler(s.uri);l!==null&&(a=l)}return this.loadTextureImage(e,o,a)}loadTextureImage(e,t,n){const i=this,o=this.json,s=o.textures[e],a=o.images[t],l=(a.uri||a.bufferView)+":"+s.sampler;if(this.textureCache[l])return this.textureCache[l];const u=this.loadImageSource(t,n).then(function(c){c.flipY=!1,c.name=s.name||a.name||"",c.name===""&&typeof a.uri=="string"&&a.uri.startsWith("data:image/")===!1&&(c.name=a.uri);const d=(o.samplers||{})[s.sampler]||{};return c.magFilter=Ch[d.magFilter]||ko,c.minFilter=Ch[d.minFilter]||vu,c.wrapS=Ih[d.wrapS]||Po,c.wrapT=Ih[d.wrapT]||Po,c.generateMipmaps=!c.isCompressedTexture&&c.minFilter!==cr&&c.minFilter!==ko,i.associations.set(c,{textures:e}),c}).catch(function(){return null});return this.textureCache[l]=u,u}loadImageSource(e,t){const n=this,i=this.json,o=this.options;if(this.sourceCache[e]!==void 0)return this.sourceCache[e].then(f=>f.clone());const s=i.images[e],a=self.URL||self.webkitURL;let l=s.uri||"",u=!1;if(s.bufferView!==void 0)l=n.getDependency("bufferView",s.bufferView).then(function(f){u=!0;const d=new Blob([f],{type:s.mimeType});return l=a.createObjectURL(d),l});else if(s.uri===void 0)throw new Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");const c=Promise.resolve(l).then(function(f){return new Promise(function(d,h){let g=d;t.isImageBitmapLoader===!0&&(g=function(v){const p=new Mo(v);p.needsUpdate=!0,d(p)}),t.load(wi.resolveURL(f,o.path),g,void 0,h)})}).then(function(f){return u===!0&&a.revokeObjectURL(l),bn(f,s),f.userData.mimeType=s.mimeType||s2(s.uri),f}).catch(function(f){throw console.error("THREE.GLTFLoader: Couldn't load texture",l),f});return this.sourceCache[e]=c,c}assignTexture(e,t,n,i){const o=this;return this.getDependency("texture",n.index).then(function(s){if(!s)return null;if(n.texCoord!==void 0&&n.texCoord>0&&(s=s.clone(),s.channel=n.texCoord),o.extensions[ze.KHR_TEXTURE_TRANSFORM]){const a=n.extensions!==void 0?n.extensions[ze.KHR_TEXTURE_TRANSFORM]:void 0;if(a){const l=o.associations.get(s);s=o.extensions[ze.KHR_TEXTURE_TRANSFORM].extendTexture(s,a),o.associations.set(s,l)}}return i!==void 0&&(s.colorSpace=i),e[t]=s,s})}assignFinalMaterial(e){const t=e.geometry;let n=e.material;const i=t.attributes.tangent===void 0,o=t.attributes.color!==void 0,s=t.attributes.normal===void 0;if(e.isPoints){const a="PointsMaterial:"+n.uuid;let l=this.cache.get(a);l||(l=new Hg,xs.prototype.copy.call(l,n),l.color.copy(n.color),l.map=n.map,l.sizeAttenuation=!1,this.cache.add(a,l)),n=l}else if(e.isLine){const a="LineBasicMaterial:"+n.uuid;let l=this.cache.get(a);l||(l=new Xg,xs.prototype.copy.call(l,n),l.color.copy(n.color),l.map=n.map,this.cache.add(a,l)),n=l}if(i||o||s){let a="ClonedMaterial:"+n.uuid+":";i&&(a+="derivative-tangents:"),o&&(a+="vertex-colors:"),s&&(a+="flat-shading:");let l=this.cache.get(a);l||(l=n.clone(),o&&(l.vertexColors=!0),s&&(l.flatShading=!0),i&&(l.normalScale&&(l.normalScale.y*=-1),l.clearcoatNormalScale&&(l.clearcoatNormalScale.y*=-1)),this.cache.add(a,l),this.associations.set(l,this.associations.get(n))),n=l}e.material=n}getMaterialType(){return jd}loadMaterial(e){const t=this,n=this.json,i=this.extensions,o=n.materials[e];let s;const a={},l=o.extensions||{},u=[];if(l[ze.KHR_MATERIALS_UNLIT]){const f=i[ze.KHR_MATERIALS_UNLIT];s=f.getMaterialType(),u.push(f.extendParams(a,o,t))}else{const f=o.pbrMetallicRoughness||{};if(a.color=new It(1,1,1),a.opacity=1,Array.isArray(f.baseColorFactor)){const d=f.baseColorFactor;a.color.setRGB(d[0],d[1],d[2],Sn),a.opacity=d[3]}f.baseColorTexture!==void 0&&u.push(t.assignTexture(a,"map",f.baseColorTexture,Ii)),a.metalness=f.metallicFactor!==void 0?f.metallicFactor:1,a.roughness=f.roughnessFactor!==void 0?f.roughnessFactor:1,f.metallicRoughnessTexture!==void 0&&(u.push(t.assignTexture(a,"metalnessMap",f.metallicRoughnessTexture)),u.push(t.assignTexture(a,"roughnessMap",f.metallicRoughnessTexture))),s=this._invokeOne(function(d){return d.getMaterialType&&d.getMaterialType(e)}),u.push(Promise.all(this._invokeAll(function(d){return d.extendMaterialParams&&d.extendMaterialParams(e,a)})))}o.doubleSided===!0&&(a.side=Ko);const c=o.alphaMode||Ma.OPAQUE;if(c===Ma.BLEND?(a.transparent=!0,a.depthWrite=!1):(a.transparent=!1,c===Ma.MASK&&(a.alphaTest=o.alphaCutoff!==void 0?o.alphaCutoff:.5)),o.normalTexture!==void 0&&s!==Dr&&(u.push(t.assignTexture(a,"normalMap",o.normalTexture)),a.normalScale=new _t(1,1),o.normalTexture.scale!==void 0)){const f=o.normalTexture.scale;a.normalScale.set(f,f)}if(o.occlusionTexture!==void 0&&s!==Dr&&(u.push(t.assignTexture(a,"aoMap",o.occlusionTexture)),o.occlusionTexture.strength!==void 0&&(a.aoMapIntensity=o.occlusionTexture.strength)),o.emissiveFactor!==void 0&&s!==Dr){const f=o.emissiveFactor;a.emissive=new It().setRGB(f[0],f[1],f[2],Sn)}return o.emissiveTexture!==void 0&&s!==Dr&&u.push(t.assignTexture(a,"emissiveMap",o.emissiveTexture,Ii)),Promise.all(u).then(function(){const f=new s(a);return o.name&&(f.name=o.name),bn(f,o),t.associations.set(f,{materials:e}),o.extensions&&Qn(i,f,o),f})}createUniqueName(e){const t=Ci.sanitizeNodeName(e||"");return t in this.nodeNamesUsed?t+"_"+ ++this.nodeNamesUsed[t]:(this.nodeNamesUsed[t]=0,t)}loadGeometries(e){const t=this,n=this.extensions,i=this.primitiveCache;function o(a){return n[ze.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(a,t).then(function(l){return Mh(l,a,t)})}const s=[];for(let a=0,l=e.length;a0&&i2(m,o),m.name=t.createUniqueName(o.name||"mesh_"+e),bn(m,o),p.extensions&&Qn(i,m,p),t.assignFinalMaterial(m),f.push(m)}for(let h=0,g=f.length;h1?c=new bs:u.length===1?c=u[0]:c=new yu,c!==u[0])for(let f=0,d=u.length;f{const f=new Map;for(const[d,h]of i.associations)(d instanceof xs||d instanceof Mo)&&f.set(d,h);return c.traverse(d=>{const h=i.associations.get(d);h!=null&&f.set(d,h)}),f};return i.associations=u(o),o})}_createAnimationTracks(e,t,n,i,o){const s=[],a=e.name?e.name:e.uuid,l=[];Pn[o.path]===Pn.weights?e.traverse(function(d){d.morphTargetInfluences&&l.push(d.name?d.name:d.uuid)}):l.push(a);let u;switch(Pn[o.path]){case Pn.weights:u=wc;break;case Pn.rotation:u=Tc;break;case Pn.position:case Pn.scale:u=bc;break;default:switch(n.itemSize){case 1:u=wc;break;case 2:case 3:default:u=bc;break}break}const c=i.interpolation!==void 0?t2[i.interpolation]:gu,f=this._getArrayFromAccessor(n);for(let d=0,h=l.length;dnew Nv(r)),er.register(r=>new Dv(r)),er)}async function c2(r){const n=(await am().loadAsync(r)).userData;if(!n.vrmAnimations){console.warn("No VRM animations found in the .vrma file");return}if(n.vrmAnimations.length===0){console.warn("No VRM animations found in the .vrma file");return}return n.vrmAnimations[0]}async function f2(r,e){if(!r){console.warn("No VRM found");return}if(e)return Bv(e,r)}function h2(){const r=le(!1),e=le(0),t=le(0),n=.2,i=1,o=6,s=le(Math.random()*(o-i)+i);function a(l,u){if(l!=null&&l.expressionManager&&(t.value+=u,!r.value&&t.value>=s.value&&(r.value=!0,e.value=0),r.value)){e.value+=u/n;const c=Math.sin(Math.PI*e.value);l.expressionManager.setValue("blink",c),e.value>=1&&(r.value=!1,t.value=0,l.expressionManager.setValue("blink",0),s.value=Math.random()*(o-i)+i)}}return{update:a}}function d2(){let r=-1,e,t=0;const n=400,i=[[.075,800],[.11,0],[.125,0],[.14,0],[.125,0],[.05,0],[.04,0],[.03,0],[.02,0],[1,0]];for(let l=1;l=r?(s(),t=0,r=o()/1e3):e||s(),l.lookAt.target||(l.lookAt.target=new yu),l.lookAt.target.position.lerp(e,fi(.2,.5)),(c=l.lookAt)==null||c.update(u),t+=u)}return{update:a}}async function p2(r,e){const i=(await am().loadAsync(r,s=>{var a;return(a=e==null?void 0:e.onProgress)==null?void 0:a.call(e,s)})).userData;if(!i.vrm)return;const o=i.vrm;if(Qa.removeUnnecessaryVertices(o.scene),Qa.combineSkeletons(o.scene),o.scene.traverse(s=>{s.frustumCulled=!1}),o.lookAt){const s=new Uv(o.lookAt);s.name="lookAtQuaternionProxy",o.scene.add(s)}return e!=null&&e.scene&&e.scene.add(o.scene),e!=null&&e.position&&o.scene.position.set(...e.position),o}function m2(r){const e=le(null),t=le(!1),n=le(0),i=le(new Map),o=le(new Map),s=le(),a=(m,y,_)=>m+(y-m)*_,l=m=>m<.5?4*m*m*m:1-(-2*m+2)**3/2,u=new Map([["happy",{expression:[{name:"happy",value:1,duration:.3},{name:"aa",value:.3}],blendDuration:.3}],["sad",{expression:[{name:"sad",value:1},{name:"oh",value:.2}],blendDuration:.3}],["angry",{expression:[{name:"angry",value:1},{name:"ee",value:.4}],blendDuration:.2}],["surprised",{expression:[{name:"Surprised",value:1},{name:"oh",value:.6}],blendDuration:.1}],["neutral",{expression:[{name:"neutral",value:1}],blendDuration:.5}]]),c=()=>{s.value&&(clearTimeout(s.value),s.value=void 0)},f=m=>{var _;if(c(),!u.has(m)){console.warn(`Emotion ${m} not found`);return}const y=u.get(m);if(e.value=m,t.value=!0,n.value=0,r.expressionManager){const C=Object.keys(r.expressionManager.expressionMap);for(const b of C)r.expressionManager.setValue(b,0)}i.value.clear(),o.value.clear();for(const C of y.expression||[]){const b=((_=r.expressionManager)==null?void 0:_.getValue(C.name))||0;i.value.set(C.name,b),o.value.set(C.name,C.value)}};return{currentEmotion:e,isTransitioning:t,setEmotion:f,setEmotionWithResetAfter:(m,y)=>{c(),f(m),s.value=setTimeout(()=>{f("neutral"),s.value=void 0},y)},update:m=>{var C;if(!t.value||!e.value)return;const _=u.get(e.value).blendDuration||.3;n.value+=m/_,n.value>=1&&(n.value=1,t.value=!1);for(const[b,x]of o.value){const w=i.value.get(b)||0,M=a(w,x,l(n.value));(C=r.expressionManager)==null||C.setValue(b,M)}},addEmotionState:(m,y)=>{u.set(m,y)},removeEmotionState:m=>{u.delete(m)},dispose:()=>{c()}}}const g2=De({__name:"Model",props:{model:null,idleAnimation:null,loadAnimations:null,position:null},emits:["loadModelProgress","error"],setup(r,{expose:e,emit:t}){const n=r,i=t;let o;const s=le(),a=le(),{scene:l}=Yo(),{onBeforeRender:u}=pu(),c=h2(),f=d2(),d=le();return Ge(()=>n.position,([h,g,v])=>{s.value&&s.value.scene.position.set(h,g,v)}),$t(async()=>{if(l.value)try{const h=await p2(n.model,{scene:l.value,lookAt:!0,position:n.position,onProgress:p=>i("loadModelProgress",Number.parseFloat((100*(p.loaded/p.total)).toFixed(2)))});if(!h){console.warn("No VRM model loaded");return}const g=await c2(n.idleAnimation),v=await f2(h,g);if(!v){console.warn("No VRM animation loaded");return}a.value=new rv(h.scene),a.value.clipAction(v).play(),d.value=m2(h),s.value=h,o=u(({delta:p})=>{var m,y,_;(m=a.value)==null||m.update(p),(y=s.value)==null||y.update(p),c.update(s.value,p),f.update(s.value,p),(_=d.value)==null||_.update(p)}).off}catch(h){i("error",h)}}),Ht(()=>{o==null||o(),s.value&&(s.value.scene.removeFromParent(),Qa.deepDispose(s.value.scene))}),e({setExpression(h){var g;(g=d.value)==null||g.setEmotionWithResetAfter(h,1e3)}}),(h,g)=>ut(h.$slots,"default")}}),v2=["position"],y2={absolute:"",bottom:"2",right:"2"},_2={flex:"~ row",bg:"zinc-100 dark:zinc-700",text:"sm zinc-400 dark:zinc-500","h-fit":"","w-fit":"","appearance-none":"","gap-1":"","rounded-lg":"","rounded-md":"","border-none":""},x2=["checked","aria-checked"],b2={key:0,absolute:"","w-full":"","min-w":"50vw",z:"{var g;(g=d.value)==null||g.setExpression(h)}}),(h,g)=>(de(),lt(zp,{relative:""},{default:Ue(({height:v,width:p})=>[Fe(Y(iv),{alpha:!0,antialias:!0,width:p,height:v},{default:Ue(()=>[Fe(Y(tT)),K("TresPerspectiveCamera",{position:[s.value,a.value,l.value]},null,8,v2),g[14]||(g[14]=K("TresDirectionalLight",{color:16777215,intensity:1.2,position:[1,1,1]},null,-1)),g[15]||(g[15]=K("TresAmbientLight",{color:16777215,intensity:1.5},null,-1)),Fe(g2,{ref_key:"modelRef",ref:d,model:n.model,"idle-animation":n.idleAnimation,position:[u.value,c.value,f.value],onLoadModelProgress:g[0]||(g[0]=m=>i("loadModelProgress",m)),onError:g[1]||(g[1]=m=>i("error",m))},null,8,["model","idle-animation","position"])]),_:2},1032,["width","height"]),K("div",y2,[K("div",_2,[K("label",{"h-fit":"","cursor-pointer":"",class:Jt([o.value?"bg-zinc-300 text-zinc-900 dark:bg-zinc-200 dark:text-zinc-800":""]),transition:"all ease-in-out duration-500","rounded-md":"","px-2":"","py-2":"",z:"o.value=m),checked:o.value,"aria-checked":o.value,name:"showLive2DViewerInspector",type:"checkbox",hidden:"","appearance-none":"","outline-none":""},null,8,x2),[[Kr,o.value]]),g[16]||(g[16]=K("div",{"select-none":""},[K("div",{"i-solar:bug-bold-duotone":"",text:"text-zinc-900 dark:text-zinc-800"})],-1))],2)]),Fe(ss,null,{default:Ue(()=>[o.value?(de(),xe("div",b2,[K("div",w2,[K("div",T2,[K("span",null,we(h.$t("stage.viewers.debug-menu.vrm.model.title")),1)]),Fe(Sh,{"h-fit":"","w-full":""},{label:Ue(()=>[K("span",S2,we(h.$t("stage.viewers.debug-menu.vrm.camera")),1)]),default:Ue(()=>[K("div",E2,[g[17]||(g[17]=K("div",{text:"zinc-400 dark:zinc-500"},[K("span",null,"X")],-1)),K("label",A2,[Fe(Or,{modelValue:s.value,"onUpdate:modelValue":g[3]||(g[3]=m=>s.value=m),min:-10,max:10,step:.01},null,8,["modelValue"])]),K("div",C2,[K("span",null,we(s.value),1)]),g[18]||(g[18]=K("div",{text:"zinc-400 dark:zinc-500"},[K("span",null,"Y")],-1)),K("label",I2,[Fe(Or,{modelValue:a.value,"onUpdate:modelValue":g[4]||(g[4]=m=>a.value=m),min:-10,max:10,step:.01},null,8,["modelValue"])]),K("div",M2,[K("span",null,we(a.value),1)]),g[19]||(g[19]=K("div",{text:"zinc-400 dark:zinc-500"},[K("span",null,"Z")],-1)),K("label",k2,[Fe(Or,{modelValue:l.value,"onUpdate:modelValue":g[5]||(g[5]=m=>l.value=m),min:-10,max:10,step:.01},null,8,["modelValue"])]),K("div",P2,[K("span",null,we(l.value),1)])])]),_:1}),Fe(Sh,{"h-fit":"","w-full":""},{label:Ue(()=>[K("span",R2,we(h.$t("stage.viewers.debug-menu.vrm.model.title")),1)]),default:Ue(()=>[K("div",O2,[g[20]||(g[20]=K("div",{text:"zinc-400 dark:zinc-500"},[K("span",null,"X")],-1)),K("label",F2,[Fe(Or,{modelValue:u.value,"onUpdate:modelValue":g[6]||(g[6]=m=>u.value=m),min:-10,max:10,step:.01},null,8,["modelValue"])]),K("div",L2,[K("span",null,we(u.value),1)]),g[21]||(g[21]=K("div",{text:"zinc-400 dark:zinc-500"},[K("span",null,"Y")],-1)),K("label",N2,[Fe(Or,{modelValue:c.value,"onUpdate:modelValue":g[7]||(g[7]=m=>c.value=m),min:-10,max:10,step:.01},null,8,["modelValue"])]),K("div",D2,[K("span",null,we(c.value),1)]),g[22]||(g[22]=K("div",{text:"zinc-400 dark:zinc-500"},[K("span",null,"Z")],-1)),K("label",B2,[Fe(Or,{modelValue:f.value,"onUpdate:modelValue":g[8]||(g[8]=m=>f.value=m),min:-10,max:10,step:.01},null,8,["modelValue"])]),K("div",U2,[K("span",null,we(f.value),1)])])]),_:1}),K("div",z2,[K("span",null,we(h.$t("stage.viewers.debug-menu.emotions")),1)]),K("div",j2,[K("button",{"rounded-lg":"",bg:"zinc-100/70 dark:zinc-800/50","px-2":"","py-1":"","backdrop-blur-sm":"",onClick:g[9]||(g[9]=m=>{var y;return(y=d.value)==null?void 0:y.setExpression("neutral")})},we(h.$t("stage.viewers.debug-menu.emotions-btn.neutral")),1),K("button",{"rounded-lg":"",bg:"zinc-100/70 dark:zinc-800/50","px-2":"","py-1":"","backdrop-blur-sm":"",onClick:g[10]||(g[10]=m=>{var y;return(y=d.value)==null?void 0:y.setExpression("surprised")})},we(h.$t("stage.viewers.debug-menu.emotions-btn.surprised")),1),K("button",{"rounded-lg":"",bg:"zinc-100/70 dark:zinc-800/50","px-2":"","py-1":"","backdrop-blur-sm":"",onClick:g[11]||(g[11]=m=>{var y;return(y=d.value)==null?void 0:y.setExpression("sad")})},we(h.$t("stage.viewers.debug-menu.emotions-btn.sad")),1),K("button",{"rounded-lg":"",bg:"zinc-100/70 dark:zinc-800/50","px-2":"","py-1":"","backdrop-blur-sm":"",onClick:g[12]||(g[12]=m=>{var y;return(y=d.value)==null?void 0:y.setExpression("angry")})},we(h.$t("stage.viewers.debug-menu.emotions-btn.angry")),1),K("button",{"rounded-lg":"",bg:"zinc-100/70 dark:zinc-800/50","px-2":"","py-1":"","backdrop-blur-sm":"",onClick:g[13]||(g[13]=m=>{var y;return(y=d.value)==null?void 0:y.setExpression("happy")})},we(h.$t("stage.viewers.debug-menu.emotions-btn.happy")),1)])])])):tt("",!0)]),_:1})])]),_:1}))}});class Pa extends Error{constructor(t,n){super(t);gc(this,"response");this.name="XSAIError",this.response=n}}const G2=r=>r.replace(/[A-Z]/g,e=>`_${e.toLowerCase()}`),Ao=r=>Object.fromEntries(Object.entries(r).map(([e,t])=>[G2(e),t])),lm=r=>Object.fromEntries(Object.entries(r).filter(([,e])=>e!==void 0)),um=r=>JSON.stringify(Ao(lm({...r,abortSignal:void 0,apiKey:void 0,baseURL:void 0,fetch:void 0,headers:void 0}))),Gu=(r,e)=>lm({Authorization:e!==void 0?`Bearer ${e}`:void 0,...r}),$u=(r,e)=>{const t=e.toString();return new URL(r,t.endsWith("/")?t:`${t}/`)},Hu=async r=>{if(!r.ok){const e=new Pa(`Remote sent ${r.status} response`,r);throw e.cause=new Error(await r.text()),e}if(!r.body)throw new Pa("Response body is empty from remote server",r);if(!(r.body instanceof ReadableStream)){const e=new Pa(`Expected Response body to be a ReadableStream, but got ${String(r.body)}`,r);throw e.cause=new Error(`Content-Type is ${r.headers.get("Content-Type")}`),e}return r},$2=async r=>Hu(r).then(async e=>e.json()),H2=async r=>(r.fetch??globalThis.fetch)($u("audio/speech",r.baseURL),{body:um(r),headers:Gu({"Content-Type":"application/json",...r.headers},r.apiKey),method:"POST",signal:r.abortSignal}).then(Hu).then(async e=>e.arrayBuffer()),cm=(r,{apiKey:e,baseURL:t,headers:n})=>({apiKey:e,baseURL:t,headers:n,model:r}),X2=r=>{const e={...r,baseURL:new URL("http://localhost:11434/v1/")},t=n=>cm(n,e);return{chat:t,embed:t,model:()=>e}};X2();const W2=r=>{const e=({applyTextNormalization:t,languageCode:n,nextRequestIds:i,nextText:o,previousRequestIds:s,previousText:a,pronunciationDictionaryLocators:l,seed:u,voiceSettings:c})=>({extraBody:Ao({applyTextNormalization:t,languageCode:n,nextRequestIds:i,nextText:o,previousRequestIds:s,previousText:a,pronunciationDictionaryLocators:l?l.map(f=>Ao(f)):void 0,seed:u,voiceSettings:c?Ao(c):void 0})});return{speech:(t,n)=>({...n?e(n):{},...cm(`elevenlabs/${t}`,{...r,baseURL:(r==null?void 0:r.baseURL)??new URL("http://localhost:5933/v1/")})})}},q2=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"];class zi{constructor(e,t,n){this.property=e,this.normal=t,n&&(this.space=n)}}zi.prototype.property={};zi.prototype.normal={};zi.prototype.space=null;function fm(r,e){const t={},n={};let i=-1;for(;++i4&&t.slice(0,4)==="data"&&Q2.test(e)){if(e.charAt(4)==="-"){const o=e.slice(5).replace(Ph,rS);n="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=e.slice(4);if(!Ph.test(o)){let s=o.replace(eS,nS);s.charAt(0)!=="-"&&(s="-"+s),e="data"+s}}i=Xu}return new i(n,e)}function nS(r){return"-"+r.toLowerCase()}function rS(r){return r.charAt(1).toUpperCase()}const iS=fm([pm,dm,vm,ym,Z2],"html"),_m=fm([pm,dm,vm,ym,J2],"svg"),Rh={}.hasOwnProperty;function oS(r,e){const t=e;function n(i,...o){let s=n.invalid;const a=n.handlers;if(i&&Rh.call(i,r)){const l=String(i[r]);s=Rh.call(a,l)?a[l]:n.unknown}if(s)return s.call(this,i,...o)}return n.handlers=t.handlers||{},n.invalid=t.invalid,n.unknown=t.unknown,n}const sS=/["&'<>`]/g,aS=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,lS=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,uS=/[|\\{}()[\]^$+*?.]/g,Oh=new WeakMap;function cS(r,e){if(r=r.replace(e.subset?fS(e.subset):sS,n),e.subset||e.escapeOnly)return r;return r.replace(aS,t).replace(lS,n);function t(i,o,s){return e.format((i.charCodeAt(0)-55296)*1024+i.charCodeAt(1)-56320+65536,s.charCodeAt(o+2),e)}function n(i,o,s){return e.format(i.charCodeAt(0),s.charCodeAt(o+1),e)}}function fS(r){let e=Oh.get(r);return e||(e=hS(r),Oh.set(r,e)),e}function hS(r){const e=[];let t=-1;for(;++t",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",circ:"ˆ",tilde:"˜",ensp:" ",emsp:" ",thinsp:" ",zwnj:"‌",zwj:"‍",lrm:"‎",rlm:"‏",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",permil:"‰",lsaquo:"‹",rsaquo:"›",euro:"€"},yS=["cent","copy","divide","gt","lt","not","para","times"],xm={}.hasOwnProperty,eu={};let ao;for(ao in Oa)xm.call(Oa,ao)&&(eu[Oa[ao]]=ao);const _S=/[^\dA-Za-z]/;function xS(r,e,t,n){const i=String.fromCharCode(r);if(xm.call(eu,i)){const o=eu[i],s="&"+o;return t&&vS.includes(o)&&!yS.includes(o)&&(!n||e&&e!==61&&_S.test(String.fromCharCode(e)))?s:s+";"}return""}function bS(r,e,t){let n=pS(r,e,t.omitOptionalSemicolons),i;if((t.useNamedReferences||t.useShortestReferences)&&(i=xS(r,e,t.omitOptionalSemicolons,t.attribute)),(t.useShortestReferences||!i)&&t.useShortestReferences){const o=gS(r,e,t.omitOptionalSemicolons);o.length|^->||--!>|"],SS=["<",">"];function ES(r,e,t,n){return n.settings.bogusComments?"":"";function i(o){return qr(o,Object.assign({},n.settings.characterReferences,{subset:SS}))}}function AS(r,e,t,n){return""}function Fh(r,e){const t=String(r);if(typeof e!="string")throw new TypeError("Expected character");let n=0,i=t.indexOf(e);for(;i!==-1;)n++,i=t.indexOf(e,i+e.length);return n}function CS(r,e){const t=e||{};return(r[r.length-1]===""?[...r,""]:r).join((t.padRight?" ":"")+","+(t.padLeft===!1?"":" ")).trim()}function IS(r){return r.join(" ").trim()}const MS=/[ \t\n\f\r]/g;function Wu(r){return typeof r=="object"?r.type==="text"?Lh(r.value):!1:Lh(r)}function Lh(r){return r.replace(MS,"")===""}const bt=wm(1),bm=wm(-1),kS=[];function wm(r){return e;function e(t,n,i){const o=t?t.children:kS;let s=(n||0)+r,a=o[s];if(!i)for(;a&&Wu(a);)s+=r,a=o[s];return a}}const PS={}.hasOwnProperty;function Tm(r){return e;function e(t,n,i){return PS.call(r,t.tagName)&&r[t.tagName](t,n,i)}}const qu=Tm({body:OS,caption:Fa,colgroup:Fa,dd:DS,dt:NS,head:Fa,html:RS,li:LS,optgroup:BS,option:US,p:FS,rp:Nh,rt:Nh,tbody:jS,td:Dh,tfoot:VS,th:Dh,thead:zS,tr:GS});function Fa(r,e,t){const n=bt(t,e,!0);return!n||n.type!=="comment"&&!(n.type==="text"&&Wu(n.value.charAt(0)))}function RS(r,e,t){const n=bt(t,e);return!n||n.type!=="comment"}function OS(r,e,t){const n=bt(t,e);return!n||n.type!=="comment"}function FS(r,e,t){const n=bt(t,e);return n?n.type==="element"&&(n.tagName==="address"||n.tagName==="article"||n.tagName==="aside"||n.tagName==="blockquote"||n.tagName==="details"||n.tagName==="div"||n.tagName==="dl"||n.tagName==="fieldset"||n.tagName==="figcaption"||n.tagName==="figure"||n.tagName==="footer"||n.tagName==="form"||n.tagName==="h1"||n.tagName==="h2"||n.tagName==="h3"||n.tagName==="h4"||n.tagName==="h5"||n.tagName==="h6"||n.tagName==="header"||n.tagName==="hgroup"||n.tagName==="hr"||n.tagName==="main"||n.tagName==="menu"||n.tagName==="nav"||n.tagName==="ol"||n.tagName==="p"||n.tagName==="pre"||n.tagName==="section"||n.tagName==="table"||n.tagName==="ul"):!t||!(t.type==="element"&&(t.tagName==="a"||t.tagName==="audio"||t.tagName==="del"||t.tagName==="ins"||t.tagName==="map"||t.tagName==="noscript"||t.tagName==="video"))}function LS(r,e,t){const n=bt(t,e);return!n||n.type==="element"&&n.tagName==="li"}function NS(r,e,t){const n=bt(t,e);return!!(n&&n.type==="element"&&(n.tagName==="dt"||n.tagName==="dd"))}function DS(r,e,t){const n=bt(t,e);return!n||n.type==="element"&&(n.tagName==="dt"||n.tagName==="dd")}function Nh(r,e,t){const n=bt(t,e);return!n||n.type==="element"&&(n.tagName==="rp"||n.tagName==="rt")}function BS(r,e,t){const n=bt(t,e);return!n||n.type==="element"&&n.tagName==="optgroup"}function US(r,e,t){const n=bt(t,e);return!n||n.type==="element"&&(n.tagName==="option"||n.tagName==="optgroup")}function zS(r,e,t){const n=bt(t,e);return!!(n&&n.type==="element"&&(n.tagName==="tbody"||n.tagName==="tfoot"))}function jS(r,e,t){const n=bt(t,e);return!n||n.type==="element"&&(n.tagName==="tbody"||n.tagName==="tfoot")}function VS(r,e,t){return!bt(t,e)}function GS(r,e,t){const n=bt(t,e);return!n||n.type==="element"&&n.tagName==="tr"}function Dh(r,e,t){const n=bt(t,e);return!n||n.type==="element"&&(n.tagName==="td"||n.tagName==="th")}const $S=Tm({body:WS,colgroup:qS,head:XS,html:HS,tbody:YS});function HS(r){const e=bt(r,-1);return!e||e.type!=="comment"}function XS(r){const e=new Set;for(const n of r.children)if(n.type==="element"&&(n.tagName==="base"||n.tagName==="title")){if(e.has(n.tagName))return!1;e.add(n.tagName)}const t=r.children[0];return!t||t.type==="element"}function WS(r){const e=bt(r,-1,!0);return!e||e.type!=="comment"&&!(e.type==="text"&&Wu(e.value.charAt(0)))&&!(e.type==="element"&&(e.tagName==="meta"||e.tagName==="link"||e.tagName==="script"||e.tagName==="style"||e.tagName==="template"))}function qS(r,e,t){const n=bm(t,e),i=bt(r,-1,!0);return t&&n&&n.type==="element"&&n.tagName==="colgroup"&&qu(n,t.children.indexOf(n),t)?!1:!!(i&&i.type==="element"&&i.tagName==="col")}function YS(r,e,t){const n=bm(t,e),i=bt(r,-1);return t&&n&&n.type==="element"&&(n.tagName==="thead"||n.tagName==="tbody")&&qu(n,t.children.indexOf(n),t)?!1:!!(i&&i.type==="element"&&i.tagName==="tr")}const lo={name:[[` -\f\r &/=>`.split(""),` -\f\r "&'/=>\``.split("")],[`\0 -\f\r "&'/<=>`.split(""),`\0 -\f\r "&'/<=>\``.split("")]],unquoted:[[` -\f\r &>`.split(""),`\0 -\f\r "&'<=>\``.split("")],[`\0 -\f\r "&'<=>\``.split(""),`\0 -\f\r "&'<=>\``.split("")]],single:[["&'".split(""),"\"&'`".split("")],["\0&'".split(""),"\0\"&'`".split("")]],double:[['"&'.split(""),"\"&'`".split("")],['\0"&'.split(""),"\0\"&'`".split("")]]};function KS(r,e,t,n){const i=n.schema,o=i.space==="svg"?!1:n.settings.omitOptionalTags;let s=i.space==="svg"?n.settings.closeEmptyElements:n.settings.voids.includes(r.tagName.toLowerCase());const a=[];let l;i.space==="html"&&r.tagName==="svg"&&(n.schema=_m);const u=ZS(n,r.properties),c=n.all(i.space==="html"&&r.tagName==="template"?r.content:r);return n.schema=i,c&&(s=!1),(u||!o||!$S(r,e,t))&&(a.push("<",r.tagName,u?" "+u:""),s&&(i.space==="svg"||n.settings.closeSelfClosing)&&(l=u.charAt(u.length-1),(!n.settings.tightSelfClosing||l==="/"||l&&l!=='"'&&l!=="'")&&a.push(" "),a.push("/")),a.push(">")),a.push(c),!s&&(!o||!qu(r,e,t))&&a.push(""),a.join("")}function ZS(r,e){const t=[];let n=-1,i;if(e){for(i in e)if(e[i]!==null&&e[i]!==void 0){const o=JS(r,i,e[i]);o&&t.push(o)}}for(;++nFh(t,r.alternative)&&(s=r.alternative),a=s+qr(t,Object.assign({},r.settings.characterReferences,{subset:(s==="'"?lo.single:lo.double)[i][o],attribute:!0}))+s),l+(a&&"="+a))}const QS=["<","&"];function Sm(r,e,t,n){return t&&t.type==="element"&&(t.tagName==="script"||t.tagName==="style")?r.value:qr(r.value,Object.assign({},n.settings.characterReferences,{subset:QS}))}function eE(r,e,t,n){return n.settings.allowDangerousHtml?r.value:Sm(r,e,t,n)}function tE(r,e,t,n){return n.all(r)}const nE=oS("type",{invalid:rE,unknown:iE,handlers:{comment:ES,doctype:AS,element:KS,raw:eE,root:tE,text:Sm}});function rE(r){throw new Error("Expected node, not `"+r+"`")}function iE(r){const e=r;throw new Error("Cannot compile unknown node `"+e.type+"`")}const oE={},sE=[];function aE(r,e){const t=e,n=t.quote||'"',i=n==='"'?"'":'"';if(n!=='"'&&n!=="'")throw new Error("Invalid quote `"+n+"`, expected `'` or `\"`");return{one:lE,all:uE,settings:{omitOptionalTags:t.omitOptionalTags||!1,allowParseErrors:t.allowParseErrors||!1,allowDangerousCharacters:t.allowDangerousCharacters||!1,quoteSmart:t.quoteSmart||!1,preferUnquoted:t.preferUnquoted||!1,tightAttributes:t.tightAttributes||!1,upperDoctype:t.upperDoctype||!1,tightDoctype:t.tightDoctype||!1,bogusComments:t.bogusComments||!1,tightCommaSeparatedLists:t.tightCommaSeparatedLists||!1,tightSelfClosing:t.tightSelfClosing||!1,collapseEmptyAttributes:t.collapseEmptyAttributes||!1,allowDangerousHtml:t.allowDangerousHtml||!1,voids:t.voids||q2,characterReferences:t.characterReferences||oE,closeSelfClosing:t.closeSelfClosing||!1,closeEmptyElements:t.closeEmptyElements||!1},schema:t.space==="svg"?_m:iS,quote:n,alternative:i}.one(Array.isArray(r)?{type:"root",children:r}:r,void 0,void 0)}function lE(r,e,t){return nE(r,e,t,this)}function uE(r){const e=[],t=r&&r.children||sE;let n=-1;for(;++ni?0:i+e:e=e>i?i:e,t=t>0?t:0,n.length<1e4)s=Array.from(n),s.unshift(e,t),r.splice(...s);else for(t&&r.splice(e,t);o0?(mn(r,r.length,0,e),r):e}const zh={}.hasOwnProperty;function pE(r){const e={};let t=-1;for(;++t13&&t<32||t>126&&t<160||t>55295&&t<57344||t>64975&&t<65008||(t&65535)===65535||(t&65535)===65534||t>1114111?"�":String.fromCodePoint(t)}function Yr(r){return r.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const cn=Xn(/[A-Za-z]/),Gt=Xn(/[\dA-Za-z]/),vE=Xn(/[#-'*+\--9=?A-Z^-~]/);function tu(r){return r!==null&&(r<32||r===127)}const nu=Xn(/\d/),yE=Xn(/[\dA-Fa-f]/),_E=Xn(/[!-/:-@[-`{-~]/);function ke(r){return r!==null&&r<-2}function Ft(r){return r!==null&&(r<0||r===32)}function He(r){return r===-2||r===-1||r===32}const xE=Xn(new RegExp("\\p{P}|\\p{S}","u")),bE=Xn(/\s/);function Xn(r){return e;function e(t){return t!==null&&t>-1&&r.test(String.fromCharCode(t))}}function ii(r){const e=[];let t=-1,n=0,i=0;for(;++t55295&&o<57344){const a=r.charCodeAt(t+1);o<56320&&a>56319&&a<57344?(s=String.fromCharCode(o,a),i=1):s="�"}else s=String.fromCharCode(o);s&&(e.push(r.slice(n,t),encodeURIComponent(s)),n=t+i+1,s=""),i&&(t+=i,i=0)}return e.join("")+r.slice(n)}function Je(r,e,t,n){const i=n?n-1:Number.POSITIVE_INFINITY;let o=0;return s;function s(l){return He(l)?(r.enter(t),a(l)):e(l)}function a(l){return He(l)&&o++s))return;const w=e.events.length;let M=w,T,I;for(;M--;)if(e.events[M][0]==="exit"&&e.events[M][1].type==="chunkFlow"){if(T){I=e.events[M][1].end;break}T=!0}for(m(n),x=w;x_;){const b=t[C];e.containerState=b[1],b[0].exit.call(e,r)}t.length=_}function y(){i.write([null]),o=void 0,i=void 0,e.containerState._closeFlow=void 0}}function AE(r,e,t){return Je(r,r.attempt(this.parser.constructs.document,e,t),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Vh(r){if(r===null||Ft(r)||bE(r))return 1;if(xE(r))return 2}function Ku(r,e,t){const n=[];let i=-1;for(;++i1&&r[t][1].end.offset-r[t][1].start.offset>1?2:1;const f={...r[n][1].end},d={...r[t][1].start};Gh(f,-l),Gh(d,l),s={type:l>1?"strongSequence":"emphasisSequence",start:f,end:{...r[n][1].end}},a={type:l>1?"strongSequence":"emphasisSequence",start:{...r[t][1].start},end:d},o={type:l>1?"strongText":"emphasisText",start:{...r[n][1].end},end:{...r[t][1].start}},i={type:l>1?"strong":"emphasis",start:{...s.start},end:{...a.end}},r[n][1].end={...s.start},r[t][1].start={...a.end},u=[],r[n][1].end.offset-r[n][1].start.offset&&(u=Zt(u,[["enter",r[n][1],e],["exit",r[n][1],e]])),u=Zt(u,[["enter",i,e],["enter",s,e],["exit",s,e],["enter",o,e]]),u=Zt(u,Ku(e.parser.constructs.insideSpan.null,r.slice(n+1,t),e)),u=Zt(u,[["exit",o,e],["enter",a,e],["exit",a,e],["exit",i,e]]),r[t][1].end.offset-r[t][1].start.offset?(c=2,u=Zt(u,[["enter",r[t][1],e],["exit",r[t][1],e]])):c=0,mn(r,n-1,t-n+3,u),t=n+u.length-c-2;break}}for(t=-1;++t0&&He(x)?Je(r,y,"linePrefix",o+1)(x):y(x)}function y(x){return x===null||ke(x)?r.check($h,v,C)(x):(r.enter("codeFlowValue"),_(x))}function _(x){return x===null||ke(x)?(r.exit("codeFlowValue"),y(x)):(r.consume(x),_)}function C(x){return r.exit("codeFenced"),e(x)}function b(x,w,M){let T=0;return I;function I(G){return x.enter("lineEnding"),x.consume(G),x.exit("lineEnding"),F}function F(G){return x.enter("codeFencedFence"),He(G)?Je(x,A,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(G):A(G)}function A(G){return G===a?(x.enter("codeFencedFenceSequence"),X(G)):M(G)}function X(G){return G===a?(T++,x.consume(G),X):T>=s?(x.exit("codeFencedFenceSequence"),He(G)?Je(x,S,"whitespace")(G):S(G)):M(G)}function S(G){return G===null||ke(G)?(x.exit("codeFencedFence"),w(G)):M(G)}}}function BE(r,e,t){const n=this;return i;function i(s){return s===null?t(s):(r.enter("lineEnding"),r.consume(s),r.exit("lineEnding"),o)}function o(s){return n.parser.lazy[n.now().line]?t(s):e(s)}}const La={name:"codeIndented",tokenize:zE},UE={partial:!0,tokenize:jE};function zE(r,e,t){const n=this;return i;function i(u){return r.enter("codeIndented"),Je(r,o,"linePrefix",5)(u)}function o(u){const c=n.events[n.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?s(u):t(u)}function s(u){return u===null?l(u):ke(u)?r.attempt(UE,s,l)(u):(r.enter("codeFlowValue"),a(u))}function a(u){return u===null||ke(u)?(r.exit("codeFlowValue"),s(u)):(r.consume(u),a)}function l(u){return r.exit("codeIndented"),e(u)}}function jE(r,e,t){const n=this;return i;function i(s){return n.parser.lazy[n.now().line]?t(s):ke(s)?(r.enter("lineEnding"),r.consume(s),r.exit("lineEnding"),i):Je(r,o,"linePrefix",5)(s)}function o(s){const a=n.events[n.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?e(s):ke(s)?i(s):t(s)}}const VE={name:"codeText",previous:$E,resolve:GE,tokenize:HE};function GE(r){let e=r.length-4,t=3,n,i;if((r[t][1].type==="lineEnding"||r[t][1].type==="space")&&(r[e][1].type==="lineEnding"||r[e][1].type==="space")){for(n=t;++n=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return ethis.left.length)return this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse();const i=this.left.slice(e);return i.push(...this.right.slice(this.right.length-n+this.left.length).reverse()),i}splice(e,t,n){const i=t||0;this.setCursor(Math.trunc(e));const o=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return n&&di(this.left,n),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(e){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(e)}pushMany(e){this.setCursor(Number.POSITIVE_INFINITY),di(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),di(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0))if(e=4?e(s):r.interrupt(n.parser.constructs.flow,t,e)(s)}}function Pm(r,e,t,n,i,o,s,a,l){const u=l||Number.POSITIVE_INFINITY;let c=0;return f;function f(m){return m===60?(r.enter(n),r.enter(i),r.enter(o),r.consume(m),r.exit(o),d):m===null||m===32||m===41||tu(m)?t(m):(r.enter(n),r.enter(s),r.enter(a),r.enter("chunkString",{contentType:"string"}),v(m))}function d(m){return m===62?(r.enter(o),r.consume(m),r.exit(o),r.exit(i),r.exit(n),e):(r.enter(a),r.enter("chunkString",{contentType:"string"}),h(m))}function h(m){return m===62?(r.exit("chunkString"),r.exit(a),d(m)):m===null||m===60||ke(m)?t(m):(r.consume(m),m===92?g:h)}function g(m){return m===60||m===62||m===92?(r.consume(m),h):h(m)}function v(m){return!c&&(m===null||m===41||Ft(m))?(r.exit("chunkString"),r.exit(a),r.exit(s),r.exit(n),e(m)):c999||h===null||h===91||h===93&&!l||h===94&&!a&&"_hiddenFootnoteSupport"in s.parser.constructs?t(h):h===93?(r.exit(o),r.enter(i),r.consume(h),r.exit(i),r.exit(n),e):ke(h)?(r.enter("lineEnding"),r.consume(h),r.exit("lineEnding"),c):(r.enter("chunkString",{contentType:"string"}),f(h))}function f(h){return h===null||h===91||h===93||ke(h)||a++>999?(r.exit("chunkString"),c(h)):(r.consume(h),l||(l=!He(h)),h===92?d:f)}function d(h){return h===91||h===92||h===93?(r.consume(h),a++,f):f(h)}}function Om(r,e,t,n,i,o){let s;return a;function a(d){return d===34||d===39||d===40?(r.enter(n),r.enter(i),r.consume(d),r.exit(i),s=d===40?41:d,l):t(d)}function l(d){return d===s?(r.enter(i),r.consume(d),r.exit(i),r.exit(n),e):(r.enter(o),u(d))}function u(d){return d===s?(r.exit(o),l(s)):d===null?t(d):ke(d)?(r.enter("lineEnding"),r.consume(d),r.exit("lineEnding"),Je(r,u,"linePrefix")):(r.enter("chunkString",{contentType:"string"}),c(d))}function c(d){return d===s||d===null||ke(d)?(r.exit("chunkString"),u(d)):(r.consume(d),d===92?f:c)}function f(d){return d===s||d===92?(r.consume(d),c):c(d)}}function Ei(r,e){let t;return n;function n(i){return ke(i)?(r.enter("lineEnding"),r.consume(i),r.exit("lineEnding"),t=!0,n):He(i)?Je(r,n,t?"linePrefix":"lineSuffix")(i):e(i)}}const QE={name:"definition",tokenize:tA},eA={partial:!0,tokenize:nA};function tA(r,e,t){const n=this;let i;return o;function o(h){return r.enter("definition"),s(h)}function s(h){return Rm.call(n,r,a,t,"definitionLabel","definitionLabelMarker","definitionLabelString")(h)}function a(h){return i=Yr(n.sliceSerialize(n.events[n.events.length-1][1]).slice(1,-1)),h===58?(r.enter("definitionMarker"),r.consume(h),r.exit("definitionMarker"),l):t(h)}function l(h){return Ft(h)?Ei(r,u)(h):u(h)}function u(h){return Pm(r,c,t,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(h)}function c(h){return r.attempt(eA,f,f)(h)}function f(h){return He(h)?Je(r,d,"whitespace")(h):d(h)}function d(h){return h===null||ke(h)?(r.exit("definition"),n.parser.defined.push(i),e(h)):t(h)}}function nA(r,e,t){return n;function n(a){return Ft(a)?Ei(r,i)(a):t(a)}function i(a){return Om(r,o,t,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function o(a){return He(a)?Je(r,s,"whitespace")(a):s(a)}function s(a){return a===null||ke(a)?e(a):t(a)}}const rA={name:"hardBreakEscape",tokenize:iA};function iA(r,e,t){return n;function n(o){return r.enter("hardBreakEscape"),r.consume(o),i}function i(o){return ke(o)?(r.exit("hardBreakEscape"),e(o)):t(o)}}const oA={name:"headingAtx",resolve:sA,tokenize:aA};function sA(r,e){let t=r.length-2,n=3,i,o;return r[n][1].type==="whitespace"&&(n+=2),t-2>n&&r[t][1].type==="whitespace"&&(t-=2),r[t][1].type==="atxHeadingSequence"&&(n===t-1||t-4>n&&r[t-2][1].type==="whitespace")&&(t-=n+1===t?2:4),t>n&&(i={type:"atxHeadingText",start:r[n][1].start,end:r[t][1].end},o={type:"chunkText",start:r[n][1].start,end:r[t][1].end,contentType:"text"},mn(r,n,t-n+1,[["enter",i,e],["enter",o,e],["exit",o,e],["exit",i,e]])),r}function aA(r,e,t){let n=0;return i;function i(c){return r.enter("atxHeading"),o(c)}function o(c){return r.enter("atxHeadingSequence"),s(c)}function s(c){return c===35&&n++<6?(r.consume(c),s):c===null||Ft(c)?(r.exit("atxHeadingSequence"),a(c)):t(c)}function a(c){return c===35?(r.enter("atxHeadingSequence"),l(c)):c===null||ke(c)?(r.exit("atxHeading"),e(c)):He(c)?Je(r,a,"whitespace")(c):(r.enter("atxHeadingText"),u(c))}function l(c){return c===35?(r.consume(c),l):(r.exit("atxHeadingSequence"),a(c))}function u(c){return c===null||c===35||Ft(c)?(r.exit("atxHeadingText"),a(c)):(r.consume(c),u)}}const lA=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],Xh=["pre","script","style","textarea"],uA={concrete:!0,name:"htmlFlow",resolveTo:hA,tokenize:dA},cA={partial:!0,tokenize:mA},fA={partial:!0,tokenize:pA};function hA(r){let e=r.length;for(;e--&&!(r[e][0]==="enter"&&r[e][1].type==="htmlFlow"););return e>1&&r[e-2][1].type==="linePrefix"&&(r[e][1].start=r[e-2][1].start,r[e+1][1].start=r[e-2][1].start,r.splice(e-2,2)),r}function dA(r,e,t){const n=this;let i,o,s,a,l;return u;function u(P){return c(P)}function c(P){return r.enter("htmlFlow"),r.enter("htmlFlowData"),r.consume(P),f}function f(P){return P===33?(r.consume(P),d):P===47?(r.consume(P),o=!0,v):P===63?(r.consume(P),i=3,n.interrupt?e:k):cn(P)?(r.consume(P),s=String.fromCharCode(P),p):t(P)}function d(P){return P===45?(r.consume(P),i=2,h):P===91?(r.consume(P),i=5,a=0,g):cn(P)?(r.consume(P),i=4,n.interrupt?e:k):t(P)}function h(P){return P===45?(r.consume(P),n.interrupt?e:k):t(P)}function g(P){const J="CDATA[";return P===J.charCodeAt(a++)?(r.consume(P),a===J.length?n.interrupt?e:A:g):t(P)}function v(P){return cn(P)?(r.consume(P),s=String.fromCharCode(P),p):t(P)}function p(P){if(P===null||P===47||P===62||Ft(P)){const J=P===47,Q=s.toLowerCase();return!J&&!o&&Xh.includes(Q)?(i=1,n.interrupt?e(P):A(P)):lA.includes(s.toLowerCase())?(i=6,J?(r.consume(P),m):n.interrupt?e(P):A(P)):(i=7,n.interrupt&&!n.parser.lazy[n.now().line]?t(P):o?y(P):_(P))}return P===45||Gt(P)?(r.consume(P),s+=String.fromCharCode(P),p):t(P)}function m(P){return P===62?(r.consume(P),n.interrupt?e:A):t(P)}function y(P){return He(P)?(r.consume(P),y):I(P)}function _(P){return P===47?(r.consume(P),I):P===58||P===95||cn(P)?(r.consume(P),C):He(P)?(r.consume(P),_):I(P)}function C(P){return P===45||P===46||P===58||P===95||Gt(P)?(r.consume(P),C):b(P)}function b(P){return P===61?(r.consume(P),x):He(P)?(r.consume(P),b):_(P)}function x(P){return P===null||P===60||P===61||P===62||P===96?t(P):P===34||P===39?(r.consume(P),l=P,w):He(P)?(r.consume(P),x):M(P)}function w(P){return P===l?(r.consume(P),l=null,T):P===null||ke(P)?t(P):(r.consume(P),w)}function M(P){return P===null||P===34||P===39||P===47||P===60||P===61||P===62||P===96||Ft(P)?b(P):(r.consume(P),M)}function T(P){return P===47||P===62||He(P)?_(P):t(P)}function I(P){return P===62?(r.consume(P),F):t(P)}function F(P){return P===null||ke(P)?A(P):He(P)?(r.consume(P),F):t(P)}function A(P){return P===45&&i===2?(r.consume(P),O):P===60&&i===1?(r.consume(P),D):P===62&&i===4?(r.consume(P),N):P===63&&i===3?(r.consume(P),k):P===93&&i===5?(r.consume(P),$):ke(P)&&(i===6||i===7)?(r.exit("htmlFlowData"),r.check(cA,V,X)(P)):P===null||ke(P)?(r.exit("htmlFlowData"),X(P)):(r.consume(P),A)}function X(P){return r.check(fA,S,V)(P)}function S(P){return r.enter("lineEnding"),r.consume(P),r.exit("lineEnding"),G}function G(P){return P===null||ke(P)?X(P):(r.enter("htmlFlowData"),A(P))}function O(P){return P===45?(r.consume(P),k):A(P)}function D(P){return P===47?(r.consume(P),s="",L):A(P)}function L(P){if(P===62){const J=s.toLowerCase();return Xh.includes(J)?(r.consume(P),N):A(P)}return cn(P)&&s.length<8?(r.consume(P),s+=String.fromCharCode(P),L):A(P)}function $(P){return P===93?(r.consume(P),k):A(P)}function k(P){return P===62?(r.consume(P),N):P===45&&i===2?(r.consume(P),k):A(P)}function N(P){return P===null||ke(P)?(r.exit("htmlFlowData"),V(P)):(r.consume(P),N)}function V(P){return r.exit("htmlFlow"),e(P)}}function pA(r,e,t){const n=this;return i;function i(s){return ke(s)?(r.enter("lineEnding"),r.consume(s),r.exit("lineEnding"),o):t(s)}function o(s){return n.parser.lazy[n.now().line]?t(s):e(s)}}function mA(r,e,t){return n;function n(i){return r.enter("lineEnding"),r.consume(i),r.exit("lineEnding"),r.attempt(as,e,t)}}const gA={name:"htmlText",tokenize:vA};function vA(r,e,t){const n=this;let i,o,s;return a;function a(k){return r.enter("htmlText"),r.enter("htmlTextData"),r.consume(k),l}function l(k){return k===33?(r.consume(k),u):k===47?(r.consume(k),b):k===63?(r.consume(k),_):cn(k)?(r.consume(k),M):t(k)}function u(k){return k===45?(r.consume(k),c):k===91?(r.consume(k),o=0,g):cn(k)?(r.consume(k),y):t(k)}function c(k){return k===45?(r.consume(k),h):t(k)}function f(k){return k===null?t(k):k===45?(r.consume(k),d):ke(k)?(s=f,D(k)):(r.consume(k),f)}function d(k){return k===45?(r.consume(k),h):f(k)}function h(k){return k===62?O(k):k===45?d(k):f(k)}function g(k){const N="CDATA[";return k===N.charCodeAt(o++)?(r.consume(k),o===N.length?v:g):t(k)}function v(k){return k===null?t(k):k===93?(r.consume(k),p):ke(k)?(s=v,D(k)):(r.consume(k),v)}function p(k){return k===93?(r.consume(k),m):v(k)}function m(k){return k===62?O(k):k===93?(r.consume(k),m):v(k)}function y(k){return k===null||k===62?O(k):ke(k)?(s=y,D(k)):(r.consume(k),y)}function _(k){return k===null?t(k):k===63?(r.consume(k),C):ke(k)?(s=_,D(k)):(r.consume(k),_)}function C(k){return k===62?O(k):_(k)}function b(k){return cn(k)?(r.consume(k),x):t(k)}function x(k){return k===45||Gt(k)?(r.consume(k),x):w(k)}function w(k){return ke(k)?(s=w,D(k)):He(k)?(r.consume(k),w):O(k)}function M(k){return k===45||Gt(k)?(r.consume(k),M):k===47||k===62||Ft(k)?T(k):t(k)}function T(k){return k===47?(r.consume(k),O):k===58||k===95||cn(k)?(r.consume(k),I):ke(k)?(s=T,D(k)):He(k)?(r.consume(k),T):O(k)}function I(k){return k===45||k===46||k===58||k===95||Gt(k)?(r.consume(k),I):F(k)}function F(k){return k===61?(r.consume(k),A):ke(k)?(s=F,D(k)):He(k)?(r.consume(k),F):T(k)}function A(k){return k===null||k===60||k===61||k===62||k===96?t(k):k===34||k===39?(r.consume(k),i=k,X):ke(k)?(s=A,D(k)):He(k)?(r.consume(k),A):(r.consume(k),S)}function X(k){return k===i?(r.consume(k),i=void 0,G):k===null?t(k):ke(k)?(s=X,D(k)):(r.consume(k),X)}function S(k){return k===null||k===34||k===39||k===60||k===61||k===96?t(k):k===47||k===62||Ft(k)?T(k):(r.consume(k),S)}function G(k){return k===47||k===62||Ft(k)?T(k):t(k)}function O(k){return k===62?(r.consume(k),r.exit("htmlTextData"),r.exit("htmlText"),e):t(k)}function D(k){return r.exit("htmlTextData"),r.enter("lineEnding"),r.consume(k),r.exit("lineEnding"),L}function L(k){return He(k)?Je(r,$,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(k):$(k)}function $(k){return r.enter("htmlTextData"),s(k)}}const Zu={name:"labelEnd",resolveAll:bA,resolveTo:wA,tokenize:TA},yA={tokenize:SA},_A={tokenize:EA},xA={tokenize:AA};function bA(r){let e=-1;const t=[];for(;++e=3&&(u===null||ke(u))?(r.exit("thematicBreak"),e(u)):t(u)}function l(u){return u===i?(r.consume(u),n++,l):(r.exit("thematicBreakSequence"),He(u)?Je(r,a,"whitespace")(u):a(u))}}const Rt={continuation:{tokenize:NA},exit:BA,name:"list",tokenize:LA},OA={partial:!0,tokenize:UA},FA={partial:!0,tokenize:DA};function LA(r,e,t){const n=this,i=n.events[n.events.length-1];let o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,s=0;return a;function a(h){const g=n.containerState.type||(h===42||h===43||h===45?"listUnordered":"listOrdered");if(g==="listUnordered"?!n.containerState.marker||h===n.containerState.marker:nu(h)){if(n.containerState.type||(n.containerState.type=g,r.enter(g,{_container:!0})),g==="listUnordered")return r.enter("listItemPrefix"),h===42||h===45?r.check(Co,t,u)(h):u(h);if(!n.interrupt||h===49)return r.enter("listItemPrefix"),r.enter("listItemValue"),l(h)}return t(h)}function l(h){return nu(h)&&++s<10?(r.consume(h),l):(!n.interrupt||s<2)&&(n.containerState.marker?h===n.containerState.marker:h===41||h===46)?(r.exit("listItemValue"),u(h)):t(h)}function u(h){return r.enter("listItemMarker"),r.consume(h),r.exit("listItemMarker"),n.containerState.marker=n.containerState.marker||h,r.check(as,n.interrupt?t:c,r.attempt(OA,d,f))}function c(h){return n.containerState.initialBlankLine=!0,o++,d(h)}function f(h){return He(h)?(r.enter("listItemPrefixWhitespace"),r.consume(h),r.exit("listItemPrefixWhitespace"),d):t(h)}function d(h){return n.containerState.size=o+n.sliceSerialize(r.exit("listItemPrefix"),!0).length,e(h)}}function NA(r,e,t){const n=this;return n.containerState._closeFlow=void 0,r.check(as,i,o);function i(a){return n.containerState.furtherBlankLines=n.containerState.furtherBlankLines||n.containerState.initialBlankLine,Je(r,e,"listItemIndent",n.containerState.size+1)(a)}function o(a){return n.containerState.furtherBlankLines||!He(a)?(n.containerState.furtherBlankLines=void 0,n.containerState.initialBlankLine=void 0,s(a)):(n.containerState.furtherBlankLines=void 0,n.containerState.initialBlankLine=void 0,r.attempt(FA,e,s)(a))}function s(a){return n.containerState._closeFlow=!0,n.interrupt=void 0,Je(r,r.attempt(Rt,e,t),"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function DA(r,e,t){const n=this;return Je(r,i,"listItemIndent",n.containerState.size+1);function i(o){const s=n.events[n.events.length-1];return s&&s[1].type==="listItemIndent"&&s[2].sliceSerialize(s[1],!0).length===n.containerState.size?e(o):t(o)}}function BA(r){r.exit(this.containerState.type)}function UA(r,e,t){const n=this;return Je(r,i,"listItemPrefixWhitespace",n.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(o){const s=n.events[n.events.length-1];return!He(o)&&s&&s[1].type==="listItemPrefixWhitespace"?e(o):t(o)}}const Wh={name:"setextUnderline",resolveTo:zA,tokenize:jA};function zA(r,e){let t=r.length,n,i,o;for(;t--;)if(r[t][0]==="enter"){if(r[t][1].type==="content"){n=t;break}r[t][1].type==="paragraph"&&(i=t)}else r[t][1].type==="content"&&r.splice(t,1),!o&&r[t][1].type==="definition"&&(o=t);const s={type:"setextHeading",start:{...r[i][1].start},end:{...r[r.length-1][1].end}};return r[i][1].type="setextHeadingText",o?(r.splice(i,0,["enter",s,e]),r.splice(o+1,0,["exit",r[n][1],e]),r[n][1].end={...r[o][1].end}):r[n][1]=s,r.push(["exit",s,e]),r}function jA(r,e,t){const n=this;let i;return o;function o(u){let c=n.events.length,f;for(;c--;)if(n.events[c][1].type!=="lineEnding"&&n.events[c][1].type!=="linePrefix"&&n.events[c][1].type!=="content"){f=n.events[c][1].type==="paragraph";break}return!n.parser.lazy[n.now().line]&&(n.interrupt||f)?(r.enter("setextHeadingLine"),i=u,s(u)):t(u)}function s(u){return r.enter("setextHeadingLineSequence"),a(u)}function a(u){return u===i?(r.consume(u),a):(r.exit("setextHeadingLineSequence"),He(u)?Je(r,l,"lineSuffix")(u):l(u))}function l(u){return u===null||ke(u)?(r.exit("setextHeadingLine"),e(u)):t(u)}}const VA={tokenize:GA};function GA(r){const e=this,t=r.attempt(as,n,r.attempt(this.parser.constructs.flowInitial,i,Je(r,r.attempt(this.parser.constructs.flow,i,r.attempt(qE,i)),"linePrefix")));return t;function n(o){if(o===null){r.consume(o);return}return r.enter("lineEndingBlank"),r.consume(o),r.exit("lineEndingBlank"),e.currentConstruct=void 0,t}function i(o){if(o===null){r.consume(o);return}return r.enter("lineEnding"),r.consume(o),r.exit("lineEnding"),e.currentConstruct=void 0,t}}const $A={resolveAll:Lm()},HA=Fm("string"),XA=Fm("text");function Fm(r){return{resolveAll:Lm(r==="text"?WA:void 0),tokenize:e};function e(t){const n=this,i=this.parser.constructs[r],o=t.attempt(i,s,a);return s;function s(c){return u(c)?o(c):a(c)}function a(c){if(c===null){t.consume(c);return}return t.enter("data"),t.consume(c),l}function l(c){return u(c)?(t.exit("data"),o(c)):(t.consume(c),l)}function u(c){if(c===null)return!0;const f=i[c];let d=-1;if(f)for(;++d-1){const a=s[0];typeof a=="string"?s[0]=a.slice(n):s.shift()}o>0&&s.push(r[i].slice(0,o))}return s}function sC(r,e){let t=-1;const n=[];let i;for(;++t0){const Xe=ge.tokenStack[ge.tokenStack.length-1];(Xe[1]||Zh).call(ge,void 0,Xe[0])}for(fe.position={start:Rn(ne.length>0?ne[0][1].start:{line:1,column:1,offset:0}),end:Rn(ne.length>0?ne[ne.length-2][1].end:{line:1,column:1,offset:0})},Pe=-1;++Pe1?"-"+a:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(s)}]};r.patch(e,l);const u={type:"element",tagName:"sup",properties:{},children:[l]};return r.patch(e,u),r.applyData(e,u)}function TC(r,e){const t={type:"element",tagName:"h"+e.depth,properties:{},children:r.all(e)};return r.patch(e,t),r.applyData(e,t)}function SC(r,e){if(r.options.allowDangerousHtml){const t={type:"raw",value:e.value};return r.patch(e,t),r.applyData(e,t)}}function Bm(r,e){const t=e.referenceType;let n="]";if(t==="collapsed"?n+="[]":t==="full"&&(n+="["+(e.label||e.identifier)+"]"),e.type==="imageReference")return[{type:"text",value:"!["+e.alt+n}];const i=r.all(e),o=i[0];o&&o.type==="text"?o.value="["+o.value:i.unshift({type:"text",value:"["});const s=i[i.length-1];return s&&s.type==="text"?s.value+=n:i.push({type:"text",value:n}),i}function EC(r,e){const t=String(e.identifier).toUpperCase(),n=r.definitionById.get(t);if(!n)return Bm(r,e);const i={src:ii(n.url||""),alt:e.alt};n.title!==null&&n.title!==void 0&&(i.title=n.title);const o={type:"element",tagName:"img",properties:i,children:[]};return r.patch(e,o),r.applyData(e,o)}function AC(r,e){const t={src:ii(e.url)};e.alt!==null&&e.alt!==void 0&&(t.alt=e.alt),e.title!==null&&e.title!==void 0&&(t.title=e.title);const n={type:"element",tagName:"img",properties:t,children:[]};return r.patch(e,n),r.applyData(e,n)}function CC(r,e){const t={type:"text",value:e.value.replace(/\r?\n|\r/g," ")};r.patch(e,t);const n={type:"element",tagName:"code",properties:{},children:[t]};return r.patch(e,n),r.applyData(e,n)}function IC(r,e){const t=String(e.identifier).toUpperCase(),n=r.definitionById.get(t);if(!n)return Bm(r,e);const i={href:ii(n.url||"")};n.title!==null&&n.title!==void 0&&(i.title=n.title);const o={type:"element",tagName:"a",properties:i,children:r.all(e)};return r.patch(e,o),r.applyData(e,o)}function MC(r,e){const t={href:ii(e.url)};e.title!==null&&e.title!==void 0&&(t.title=e.title);const n={type:"element",tagName:"a",properties:t,children:r.all(e)};return r.patch(e,n),r.applyData(e,n)}function kC(r,e,t){const n=r.all(e),i=t?PC(t):Um(e),o={},s=[];if(typeof e.checked=="boolean"){const c=n[0];let f;c&&c.type==="element"&&c.tagName==="p"?f=c:(f={type:"element",tagName:"p",properties:{},children:[]},n.unshift(f)),f.children.length>0&&f.children.unshift({type:"text",value:" "}),f.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:e.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let a=-1;for(;++a1}function RC(r,e){const t={},n=r.all(e);let i=-1;for(typeof e.start=="number"&&e.start!==1&&(t.start=e.start);++i0&&typeof n.column=="number"&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset=="number"&&n.offset>-1?n.offset:void 0}}}function NC(r){const e=jm(r),t=zm(r);if(e&&t)return{start:e,end:t}}function DC(r,e){const t=r.all(e),n=t.shift(),i=[];if(n){const s={type:"element",tagName:"thead",properties:{},children:r.wrap([n],!0)};r.patch(e.children[0],s),i.push(s)}if(t.length>0){const s={type:"element",tagName:"tbody",properties:{},children:r.wrap(t,!0)},a=jm(e.children[1]),l=zm(e.children[e.children.length-1]);a&&l&&(s.position={start:a,end:l}),i.push(s)}const o={type:"element",tagName:"table",properties:{},children:r.wrap(i,!0)};return r.patch(e,o),r.applyData(e,o)}function BC(r,e,t){const n=t?t.children:void 0,o=(n?n.indexOf(e):1)===0?"th":"td",s=t&&t.type==="table"?t.align:void 0,a=s?s.length:e.children.length;let l=-1;const u=[];for(;++l0,!0),n[0]),i=n.index+n[0].length,n=t.exec(e);return o.push(ed(e.slice(i),i>0,!1)),o.join("")}function ed(r,e,t){let n=0,i=r.length;if(e){let o=r.codePointAt(n);for(;o===Jh||o===Qh;)n++,o=r.codePointAt(n)}if(t){let o=r.codePointAt(i-1);for(;o===Jh||o===Qh;)i--,o=r.codePointAt(i-1)}return i>n?r.slice(n,i):""}function jC(r,e){const t={type:"text",value:zC(String(e.value))};return r.patch(e,t),r.applyData(e,t)}function VC(r,e){const t={type:"element",tagName:"hr",properties:{},children:[]};return r.patch(e,t),r.applyData(e,t)}const GC={blockquote:vC,break:yC,code:_C,delete:xC,emphasis:bC,footnoteReference:wC,heading:TC,html:SC,imageReference:EC,image:AC,inlineCode:CC,linkReference:IC,link:MC,listItem:kC,list:RC,paragraph:OC,root:FC,strong:LC,table:DC,tableCell:UC,tableRow:BC,text:jC,thematicBreak:VC,toml:uo,yaml:uo,definition:uo,footnoteDefinition:uo};function uo(){}const Gm=-1,ls=0,$o=1,Ho=2,Ju=3,Qu=4,ec=5,tc=6,$m=7,Hm=8,td=typeof self=="object"?self:globalThis,$C=(r,e)=>{const t=(i,o)=>(r.set(o,i),i),n=i=>{if(r.has(i))return r.get(i);const[o,s]=e[i];switch(o){case ls:case Gm:return t(s,i);case $o:{const a=t([],i);for(const l of s)a.push(n(l));return a}case Ho:{const a=t({},i);for(const[l,u]of s)a[n(l)]=n(u);return a}case Ju:return t(new Date(s),i);case Qu:{const{source:a,flags:l}=s;return t(new RegExp(a,l),i)}case ec:{const a=t(new Map,i);for(const[l,u]of s)a.set(n(l),n(u));return a}case tc:{const a=t(new Set,i);for(const l of s)a.add(n(l));return a}case $m:{const{name:a,message:l}=s;return t(new td[a](l),i)}case Hm:return t(BigInt(s),i);case"BigInt":return t(Object(BigInt(s)),i)}return t(new td[o](s),i)};return n},nd=r=>$C(new Map,r)(0),Fr="",{toString:HC}={},{keys:XC}=Object,pi=r=>{const e=typeof r;if(e!=="object"||!r)return[ls,e];const t=HC.call(r).slice(8,-1);switch(t){case"Array":return[$o,Fr];case"Object":return[Ho,Fr];case"Date":return[Ju,Fr];case"RegExp":return[Qu,Fr];case"Map":return[ec,Fr];case"Set":return[tc,Fr]}return t.includes("Array")?[$o,t]:t.includes("Error")?[$m,t]:[Ho,t]},co=([r,e])=>r===ls&&(e==="function"||e==="symbol"),WC=(r,e,t,n)=>{const i=(s,a)=>{const l=n.push(s)-1;return t.set(a,l),l},o=s=>{if(t.has(s))return t.get(s);let[a,l]=pi(s);switch(a){case ls:{let c=s;switch(l){case"bigint":a=Hm,c=s.toString();break;case"function":case"symbol":if(r)throw new TypeError("unable to serialize "+l);c=null;break;case"undefined":return i([Gm],s)}return i([a,c],s)}case $o:{if(l)return i([l,[...s]],s);const c=[],f=i([a,c],s);for(const d of s)c.push(o(d));return f}case Ho:{if(l)switch(l){case"BigInt":return i([l,s.toString()],s);case"Boolean":case"Number":case"String":return i([l,s.valueOf()],s)}if(e&&"toJSON"in s)return o(s.toJSON());const c=[],f=i([a,c],s);for(const d of XC(s))(r||!co(pi(s[d])))&&c.push([o(d),o(s[d])]);return f}case Ju:return i([a,s.toISOString()],s);case Qu:{const{source:c,flags:f}=s;return i([a,{source:c,flags:f}],s)}case ec:{const c=[],f=i([a,c],s);for(const[d,h]of s)(r||!(co(pi(d))||co(pi(h))))&&c.push([o(d),o(h)]);return f}case tc:{const c=[],f=i([a,c],s);for(const d of s)(r||!co(pi(d)))&&c.push(o(d));return f}}const{message:u}=s;return i([a,{name:l,message:u}],s)};return o},rd=(r,{json:e,lossy:t}={})=>{const n=[];return WC(!(e||t),!!e,new Map,n)(r),n},Xo=typeof structuredClone=="function"?(r,e)=>e&&("json"in e||"lossy"in e)?nd(rd(r,e)):structuredClone(r):(r,e)=>nd(rd(r,e));function qC(r,e){const t=[{type:"text",value:"↩"}];return e>1&&t.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(e)}]}),t}function YC(r,e){return"Back to reference "+(r+1)+(e>1?"-"+e:"")}function KC(r){const e=typeof r.options.clobberPrefix=="string"?r.options.clobberPrefix:"user-content-",t=r.options.footnoteBackContent||qC,n=r.options.footnoteBackLabel||YC,i=r.options.footnoteLabel||"Footnotes",o=r.options.footnoteLabelTagName||"h2",s=r.options.footnoteLabelProperties||{className:["sr-only"]},a=[];let l=-1;for(;++l0&&g.push({type:"text",value:" "});let y=typeof t=="string"?t:t(l,h);typeof y=="string"&&(y={type:"text",value:y}),g.push({type:"element",tagName:"a",properties:{href:"#"+e+"fnref-"+d+(h>1?"-"+h:""),dataFootnoteBackref:"",ariaLabel:typeof n=="string"?n:n(l,h),className:["data-footnote-backref"]},children:Array.isArray(y)?y:[y]})}const p=c[c.length-1];if(p&&p.type==="element"&&p.tagName==="p"){const y=p.children[p.children.length-1];y&&y.type==="text"?y.value+=" ":p.children.push({type:"text",value:" "}),p.children.push(...g)}else c.push(...g);const m={type:"element",tagName:"li",properties:{id:e+"fn-"+d},children:r.wrap(c,!0)};r.patch(u,m),a.push(m)}if(a.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...Xo(s),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:` -`},{type:"element",tagName:"ol",properties:{},children:r.wrap(a,!0)},{type:"text",value:` -`}]}}const Xm=function(r){if(r==null)return eI;if(typeof r=="function")return us(r);if(typeof r=="object")return Array.isArray(r)?ZC(r):JC(r);if(typeof r=="string")return QC(r);throw new Error("Expected function, string, or object as test")};function ZC(r){const e=[];let t=-1;for(;++t":""))+")"})}return d;function d(){let h=Wm,g,v,p;if((!e||o(l,u,c[c.length-1]||void 0))&&(h=oI(t(l,c)),h[0]===id))return h;if("children"in l&&l.children){const m=l;if(m.children&&h[0]!==rI)for(v=(n?m.children.length:-1)+s,p=c.concat(m);v>-1&&v0&&t.push({type:"text",value:` -`}),t}function od(r){let e=0,t=r.charCodeAt(e);for(;t===9||t===32;)e++,t=r.charCodeAt(e);return r.slice(e)}function sd(r,e){const t=lI(r,e),n=t.one(r,void 0),i=KC(t),o=Array.isArray(n)?{type:"root",children:n}:n||{type:"root",children:[]};return i&&o.children.push({type:"text",value:` -`},i),o}function dI(r,e){return r&&"run"in r?async function(t,n){const i=sd(t,{file:n,...e});await r.run(i,n)}:function(t,n){return sd(t,{file:n,...r||e})}}function ad(r){if(r)throw r}var Da,ld;function pI(){if(ld)return Da;ld=1;var r=Object.prototype.hasOwnProperty,e=Object.prototype.toString,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,i=function(u){return typeof Array.isArray=="function"?Array.isArray(u):e.call(u)==="[object Array]"},o=function(u){if(!u||e.call(u)!=="[object Object]")return!1;var c=r.call(u,"constructor"),f=u.constructor&&u.constructor.prototype&&r.call(u.constructor.prototype,"isPrototypeOf");if(u.constructor&&!c&&!f)return!1;var d;for(d in u);return typeof d>"u"||r.call(u,d)},s=function(u,c){t&&c.name==="__proto__"?t(u,c.name,{enumerable:!0,configurable:!0,value:c.newValue,writable:!0}):u[c.name]=c.newValue},a=function(u,c){if(c==="__proto__")if(r.call(u,c)){if(n)return n(u,c).value}else return;return u[c]};return Da=function l(){var u,c,f,d,h,g,v=arguments[0],p=1,m=arguments.length,y=!1;for(typeof v=="boolean"&&(y=v,v=arguments[1]||{},p=2),(v==null||typeof v!="object"&&typeof v!="function")&&(v={});ps.length;let l;a&&s.push(i);try{l=r.apply(this,s)}catch(u){const c=u;if(a&&t)throw c;return i(c)}a||(l&&l.then&&typeof l.then=="function"?l.then(o,i):l instanceof Error?i(l):o(l))}function i(s,...a){t||(t=!0,e(s,...a))}function o(s){i(null,s)}}class Lt extends Error{constructor(e,t,n){super(),typeof t=="string"&&(n=t,t=void 0);let i="",o={},s=!1;if(t&&("line"in t&&"column"in t?o={place:t}:"start"in t&&"end"in t?o={place:t}:"type"in t?o={ancestors:[t],place:t.position}:o={...t}),typeof e=="string"?i=e:!o.cause&&e&&(s=!0,i=e.message,o.cause=e),!o.ruleId&&!o.source&&typeof n=="string"){const l=n.indexOf(":");l===-1?o.ruleId=n:(o.source=n.slice(0,l),o.ruleId=n.slice(l+1))}if(!o.place&&o.ancestors&&o.ancestors){const l=o.ancestors[o.ancestors.length-1];l&&(o.place=l.position)}const a=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file,this.message=i,this.line=a?a.line:void 0,this.name=Ai(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=s&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual,this.expected,this.note,this.url}}Lt.prototype.file="";Lt.prototype.name="";Lt.prototype.reason="";Lt.prototype.message="";Lt.prototype.stack="";Lt.prototype.column=void 0;Lt.prototype.line=void 0;Lt.prototype.ancestors=void 0;Lt.prototype.cause=void 0;Lt.prototype.fatal=void 0;Lt.prototype.place=void 0;Lt.prototype.ruleId=void 0;Lt.prototype.source=void 0;const ln={basename:yI,dirname:_I,extname:xI,join:bI,sep:"/"};function yI(r,e){if(e!==void 0&&typeof e!="string")throw new TypeError('"ext" argument must be a string');ji(r);let t=0,n=-1,i=r.length,o;if(e===void 0||e.length===0||e.length>r.length){for(;i--;)if(r.codePointAt(i)===47){if(o){t=i+1;break}}else n<0&&(o=!0,n=i+1);return n<0?"":r.slice(t,n)}if(e===r)return"";let s=-1,a=e.length-1;for(;i--;)if(r.codePointAt(i)===47){if(o){t=i+1;break}}else s<0&&(o=!0,s=i+1),a>-1&&(r.codePointAt(i)===e.codePointAt(a--)?a<0&&(n=i):(a=-1,n=s));return t===n?n=s:n<0&&(n=r.length),r.slice(t,n)}function _I(r){if(ji(r),r.length===0)return".";let e=-1,t=r.length,n;for(;--t;)if(r.codePointAt(t)===47){if(n){e=t;break}}else n||(n=!0);return e<0?r.codePointAt(0)===47?"/":".":e===1&&r.codePointAt(0)===47?"//":r.slice(0,e)}function xI(r){ji(r);let e=r.length,t=-1,n=0,i=-1,o=0,s;for(;e--;){const a=r.codePointAt(e);if(a===47){if(s){n=e+1;break}continue}t<0&&(s=!0,t=e+1),a===46?i<0?i=e:o!==1&&(o=1):i>-1&&(o=-1)}return i<0||t<0||o===0||o===1&&i===t-1&&i===n+1?"":r.slice(i,t)}function bI(...r){let e=-1,t;for(;++e0&&r.codePointAt(r.length-1)===47&&(t+="/"),e?"/"+t:t}function TI(r,e){let t="",n=0,i=-1,o=0,s=-1,a,l;for(;++s<=r.length;){if(s2){if(l=t.lastIndexOf("/"),l!==t.length-1){l<0?(t="",n=0):(t=t.slice(0,l),n=t.length-1-t.lastIndexOf("/")),i=s,o=0;continue}}else if(t.length>0){t="",n=0,i=s,o=0;continue}}e&&(t=t.length>0?t+"/..":"..",n=2)}else t.length>0?t+="/"+r.slice(i+1,s):t=r.slice(i+1,s),n=s-i-1;i=s,o=0}else a===46&&o>-1?o++:o=-1}return t}function ji(r){if(typeof r!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(r))}const SI={cwd:EI};function EI(){return"/"}function au(r){return!!(r!==null&&typeof r=="object"&&"href"in r&&r.href&&"protocol"in r&&r.protocol&&r.auth===void 0)}function AI(r){if(typeof r=="string")r=new URL(r);else if(!au(r)){const e=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+r+"`");throw e.code="ERR_INVALID_ARG_TYPE",e}if(r.protocol!=="file:"){const e=new TypeError("The URL must be of scheme file");throw e.code="ERR_INVALID_URL_SCHEME",e}return CI(r)}function CI(r){if(r.hostname!==""){const n=new TypeError('File URL host must be "localhost" or empty on darwin');throw n.code="ERR_INVALID_FILE_URL_HOST",n}const e=r.pathname;let t=-1;for(;++t0){let[h,...g]=c;const v=n[d][1];su(v)&&su(h)&&(h=Ba(!0,v,h)),n[d]=[u,h,...g]}}}}const RI=new nc().freeze();function Va(r,e){if(typeof e!="function")throw new TypeError("Cannot `"+r+"` without `parser`")}function Ga(r,e){if(typeof e!="function")throw new TypeError("Cannot `"+r+"` without `compiler`")}function $a(r,e){if(e)throw new Error("Cannot call `"+r+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function cd(r){if(!su(r)||typeof r.type!="string")throw new TypeError("Expected node, got `"+r+"`")}function fd(r,e,t){if(!t)throw new Error("`"+r+"` finished async. Use `"+e+"` instead")}function fo(r){return OI(r)?r:new II(r)}function OI(r){return!!(r&&typeof r=="object"&&"message"in r&&"messages"in r)}function FI(r){return typeof r=="string"||LI(r)}function LI(r){return!!(r&&typeof r=="object"&&"byteLength"in r&&"byteOffset"in r)}function rc(){const r=RI().use(gC).use(dI).use(cE);return{process:e=>r.processSync(e).toString()}}function NI(r,e){return{role:"system",content:[r,Mv.map(t=>`- ${t}`).join(` -`),e].join(` - -`)}}function DI(r){const e=new Uint8Array(r.frequencyBinCount);r.getByteFrequencyData(e);const t=[];for(let i=0;i<700;i+=80)t.push(e[i]);return e.map(i=>i**1.2).map(i=>i*1.2).reduce((i,o)=>i+o,0)/e.length/100}function BI(r){const e=new Uint8Array(r.frequencyBinCount);r.getByteFrequencyData(e);const t=[];for(let u=0;u<700;u+=80)t.push(e[u]);const n=e.map(u=>u**1.5),i=Math.min(...n),s=Math.max(...n)-i;let a;return s===0?a=n.map(()=>0):a=n.map(u=>(u-i)/s),a.reduce((u,c)=>u+c,0)/e.length}function UI(r,e="linear"){switch(e){case"linear":return DI(r);case"minmax":return BI(r)}}const qm=Jo("AudioContext",()=>({audioContext:new AudioContext,calculateVolume:UI})),zI=Jo("SpeakingStore",()=>{const t=le(0),n=le(!1),i=Ve(()=>n.value?(30+70*t.value)/100:30);return{mouthOpenSize:t,nowSpeaking:n,nowSpeakingAvatarBorderOpacity:i}});function ho(r,e,t){return e+t<0||e+t>=r.length-1?"":r[e+t]}function jI(r){let e="literal",t="";return{async consume(n){var i,o,s;for(let a=0;a"?(l+=ho(n,a,1),u="literal",a++):l==="<"?u="special":l===">"&&(u="literal"),e==="literal"&&u==="special"?t!==""&&(await((i=r.onLiteral)==null?void 0:i.call(r,t)),t=""):e==="special"&&u==="literal"&&t!==""&&(t+=l,await((o=r.onSpecial)==null?void 0:o.call(r,t)),t=""),e==="literal"&&u==="literal"?(await((s=r.onLiteral)==null?void 0:s.call(r,l)),t=""):e==="special"&&u==="literal"?t="":t+=l,e=u}},async end(){var n,i;t!==""&&(e==="literal"?await((n=r.onLiteral)==null?void 0:n.call(r,t)):t.endsWith("|>")&&await((i=r.onSpecial)==null?void 0:i.call(r,t)))}}}const VI=async r=>(r.fetch??globalThis.fetch)($u("models",r.baseURL),{headers:Gu({"Content-Type":"application/json",...r.headers},r.apiKey),signal:r.abortSignal}).then($2).then(({data:e})=>e),GI=async r=>{var e;return(r.fetch??globalThis.fetch)($u("chat/completions",r.baseURL),{body:um({...r,tools:(e=r.tools)==null?void 0:e.map(t=>({function:t.function,type:"function"}))}),headers:Gu({"Content-Type":"application/json",...r.headers},r.apiKey),method:"POST",signal:r.abortSignal}).then(Hu)},hd="data:",$I=async r=>GI({...r,stream:!0}).then(async e=>{const t=new TextDecoder;let n,i;const o=async(f,d)=>{if(!f||!f.startsWith(hd))return;const h=f.slice(hd.length),g=h.startsWith(" ")?h.slice(1):h;if(g==="[DONE]")return d.terminate(),!0;if(g.startsWith("{")&&g.includes('"error":'))return d.error(new Error(`Error from server: ${g}`)),!0;const v=JSON.parse(g);d.enqueue(v),r.onChunk&&await r.onChunk(v),v.choices[0].finish_reason!==void 0&&(n=v.choices[0].finish_reason),v.usage!==void 0&&(i=v.usage)};let s="";const a=e.body.pipeThrough(new TransformStream({transform:async(f,d)=>{const h=t.decode(f,{stream:!0});s+=h;const g=s.split(` -`);s=g.pop()??"";for(const v of g)if(await o(v,d))break}})),[l,u]=a.tee(),c=u.pipeThrough(new TransformStream({transform:(f,d)=>d.enqueue(f.choices[0].delta.content)}));return{chunkStream:l,finishReason:n,textStream:c,usage:i}}),ic=Jo("llm",()=>{async function r(t,n,i,o){return await $I({baseURL:t.endsWith("/")?t:`${t}/`,apiKey:n,model:i,messages:o,streamOptions:{usage:!0}})}async function e(t,n){if(t==="")return[];try{return await VI({baseURL:t.endsWith("/")?t:`${t}/`,apiKey:n})}catch(i){if(String(i).includes("Failed to construct 'URL': Invalid URL"))return[];throw i}}return{models:e,stream:r}});async function*HI(r,e){const t=r.getReader();try{for(;;){const{done:n,value:i}=await t.read();if(n)return;yield e(i)}}finally{t.releaseLock()}}const _r=Jo("chat",()=>{const{stream:r}=ic(),{t:e}=Qr(),{openAiApiBaseURL:t,openAiApiKey:n,openAiModel:i}=En(ei()),o=le([]),s=le([]),a=le([]),l=le([]),u=le([]),c=le([]),f=le([]);function d(x){o.value.push(x)}function h(x){s.value.push(x)}function g(x){a.value.push(x)}function v(x){l.value.push(x)}function p(x){u.value.push(x)}function m(x){c.value.push(x)}function y(x){f.value.push(x)}const _=le([NI(e("prompt.prefix"),e("prompt.suffix"))]),C=le({role:"assistant",content:""});async function b(x,w){if(!x)return;for(const G of o.value)await G(x);const{baseUrl:M=t.value,apiKey:T=n.value,model:I=i.value}=w??{};C.value={role:"assistant",content:""},_.value.push({role:"user",content:x}),_.value.push(C.value);const F=_.value.slice(0,_.value.length-1);for(const G of s.value)await G(x);for(const G of a.value)await G(x);const A=await r(M,T,I.id,F);for(const G of l.value)await G(x);let X="";const S=jI({onLiteral:async G=>{for(const O of u.value)await O(G);C.value.content+=G},onSpecial:async G=>{for(const O of c.value)await O(G)}});for await(const G of HI(A.textStream,async O=>O))X+=G,await S.consume(G);await S.end();for(const G of f.value)await G();console.debug("LLM output:",X)}return{messages:_,streamingMessage:C,send:b,onBeforeMessageComposed:d,onAfterMessageComposed:h,onBeforeSend:g,onAfterSend:v,onTokenLiteral:p,onTokenSpecial:m,onStreamEnd:y}});function po(r){throw new Error('Could not dynamically require "'+r+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Ha={exports:{}};/*! - -JSZip v3.10.1 - A JavaScript class for generating and reading zip files - - -(c) 2009-2016 Stuart Knightley -Dual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/jszip/main/LICENSE.markdown. - -JSZip uses the library pako released under the MIT license : -https://github.com/nodeca/pako/blob/main/LICENSE -*/var dd;function XI(){return dd||(dd=1,function(r,e){(function(t){r.exports=t()})(function(){return function t(n,i,o){function s(u,c){if(!i[u]){if(!n[u]){var f=typeof po=="function"&&po;if(!c&&f)return f(u,!0);if(a)return a(u,!0);var d=new Error("Cannot find module '"+u+"'");throw d.code="MODULE_NOT_FOUND",d}var h=i[u]={exports:{}};n[u][0].call(h.exports,function(g){var v=n[u][1][g];return s(v||g)},h,h.exports,t,n,i,o)}return i[u].exports}for(var a=typeof po=="function"&&po,l=0;l>2,h=(3&u)<<4|c>>4,g=1<_?(15&c)<<2|f>>6:64,v=2<_?63&f:64,p.push(a.charAt(d)+a.charAt(h)+a.charAt(g)+a.charAt(v));return p.join("")},i.decode=function(l){var u,c,f,d,h,g,v=0,p=0,m="data:";if(l.substr(0,m.length)===m)throw new Error("Invalid base64 input, it looks like a data url.");var y,_=3*(l=l.replace(/[^A-Za-z0-9+/=]/g,"")).length/4;if(l.charAt(l.length-1)===a.charAt(64)&&_--,l.charAt(l.length-2)===a.charAt(64)&&_--,_%1!=0)throw new Error("Invalid base64 input, bad content length.");for(y=s.uint8array?new Uint8Array(0|_):new Array(0|_);v>4,c=(15&d)<<4|(h=a.indexOf(l.charAt(v++)))>>2,f=(3&h)<<6|(g=a.indexOf(l.charAt(v++))),y[p++]=u,h!==64&&(y[p++]=c),g!==64&&(y[p++]=f);return y}},{"./support":30,"./utils":32}],2:[function(t,n,i){var o=t("./external"),s=t("./stream/DataWorker"),a=t("./stream/Crc32Probe"),l=t("./stream/DataLengthProbe");function u(c,f,d,h,g){this.compressedSize=c,this.uncompressedSize=f,this.crc32=d,this.compression=h,this.compressedContent=g}u.prototype={getContentWorker:function(){var c=new s(o.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new l("data_length")),f=this;return c.on("end",function(){if(this.streamInfo.data_length!==f.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),c},getCompressedWorker:function(){return new s(o.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},u.createWorkerFrom=function(c,f,d){return c.pipe(new a).pipe(new l("uncompressedSize")).pipe(f.compressWorker(d)).pipe(new l("compressedSize")).withStreamInfo("compression",f)},n.exports=u},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(t,n,i){var o=t("./stream/GenericWorker");i.STORE={magic:"\0\0",compressWorker:function(){return new o("STORE compression")},uncompressWorker:function(){return new o("STORE decompression")}},i.DEFLATE=t("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(t,n,i){var o=t("./utils"),s=function(){for(var a,l=[],u=0;u<256;u++){a=u;for(var c=0;c<8;c++)a=1&a?3988292384^a>>>1:a>>>1;l[u]=a}return l}();n.exports=function(a,l){return a!==void 0&&a.length?o.getTypeOf(a)!=="string"?function(u,c,f,d){var h=s,g=d+f;u^=-1;for(var v=d;v>>8^h[255&(u^c[v])];return-1^u}(0|l,a,a.length,0):function(u,c,f,d){var h=s,g=d+f;u^=-1;for(var v=d;v>>8^h[255&(u^c.charCodeAt(v))];return-1^u}(0|l,a,a.length,0):0}},{"./utils":32}],5:[function(t,n,i){i.base64=!1,i.binary=!1,i.dir=!1,i.createFolders=!0,i.date=null,i.compression=null,i.compressionOptions=null,i.comment=null,i.unixPermissions=null,i.dosPermissions=null},{}],6:[function(t,n,i){var o=null;o=typeof Promise<"u"?Promise:t("lie"),n.exports={Promise:o}},{lie:37}],7:[function(t,n,i){var o=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",s=t("pako"),a=t("./utils"),l=t("./stream/GenericWorker"),u=o?"uint8array":"array";function c(f,d){l.call(this,"FlateWorker/"+f),this._pako=null,this._pakoAction=f,this._pakoOptions=d,this.meta={}}i.magic="\b\0",a.inherits(c,l),c.prototype.processChunk=function(f){this.meta=f.meta,this._pako===null&&this._createPako(),this._pako.push(a.transformTo(u,f.data),!1)},c.prototype.flush=function(){l.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},c.prototype.cleanUp=function(){l.prototype.cleanUp.call(this),this._pako=null},c.prototype._createPako=function(){this._pako=new s[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var f=this;this._pako.onData=function(d){f.push({data:d,meta:f.meta})}},i.compressWorker=function(f){return new c("Deflate",f)},i.uncompressWorker=function(){return new c("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(t,n,i){function o(h,g){var v,p="";for(v=0;v>>=8;return p}function s(h,g,v,p,m,y){var _,C,b=h.file,x=h.compression,w=y!==u.utf8encode,M=a.transformTo("string",y(b.name)),T=a.transformTo("string",u.utf8encode(b.name)),I=b.comment,F=a.transformTo("string",y(I)),A=a.transformTo("string",u.utf8encode(I)),X=T.length!==b.name.length,S=A.length!==I.length,G="",O="",D="",L=b.dir,$=b.date,k={crc32:0,compressedSize:0,uncompressedSize:0};g&&!v||(k.crc32=h.crc32,k.compressedSize=h.compressedSize,k.uncompressedSize=h.uncompressedSize);var N=0;g&&(N|=8),w||!X&&!S||(N|=2048);var V=0,P=0;L&&(V|=16),m==="UNIX"?(P=798,V|=function(Q,ce){var pe=Q;return Q||(pe=ce?16893:33204),(65535&pe)<<16}(b.unixPermissions,L)):(P=20,V|=function(Q){return 63&(Q||0)}(b.dosPermissions)),_=$.getUTCHours(),_<<=6,_|=$.getUTCMinutes(),_<<=5,_|=$.getUTCSeconds()/2,C=$.getUTCFullYear()-1980,C<<=4,C|=$.getUTCMonth()+1,C<<=5,C|=$.getUTCDate(),X&&(O=o(1,1)+o(c(M),4)+T,G+="up"+o(O.length,2)+O),S&&(D=o(1,1)+o(c(F),4)+A,G+="uc"+o(D.length,2)+D);var J="";return J+=` -\0`,J+=o(N,2),J+=x.magic,J+=o(_,2),J+=o(C,2),J+=o(k.crc32,4),J+=o(k.compressedSize,4),J+=o(k.uncompressedSize,4),J+=o(M.length,2),J+=o(G.length,2),{fileRecord:f.LOCAL_FILE_HEADER+J+M+G,dirRecord:f.CENTRAL_FILE_HEADER+o(P,2)+J+o(F.length,2)+"\0\0\0\0"+o(V,4)+o(p,4)+M+G+F}}var a=t("../utils"),l=t("../stream/GenericWorker"),u=t("../utf8"),c=t("../crc32"),f=t("../signature");function d(h,g,v,p){l.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=g,this.zipPlatform=v,this.encodeFileName=p,this.streamFiles=h,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}a.inherits(d,l),d.prototype.push=function(h){var g=h.meta.percent||0,v=this.entriesCount,p=this._sources.length;this.accumulate?this.contentBuffer.push(h):(this.bytesWritten+=h.data.length,l.prototype.push.call(this,{data:h.data,meta:{currentFile:this.currentFile,percent:v?(g+100*(v-p-1))/v:100}}))},d.prototype.openedSource=function(h){this.currentSourceOffset=this.bytesWritten,this.currentFile=h.file.name;var g=this.streamFiles&&!h.file.dir;if(g){var v=s(h,g,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:v.fileRecord,meta:{percent:0}})}else this.accumulate=!0},d.prototype.closedSource=function(h){this.accumulate=!1;var g=this.streamFiles&&!h.file.dir,v=s(h,g,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(v.dirRecord),g)this.push({data:function(p){return f.DATA_DESCRIPTOR+o(p.crc32,4)+o(p.compressedSize,4)+o(p.uncompressedSize,4)}(h),meta:{percent:100}});else for(this.push({data:v.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},d.prototype.flush=function(){for(var h=this.bytesWritten,g=0;g=this.index;l--)u=(u<<8)+this.byteAt(l);return this.index+=a,u},readString:function(a){return o.transformTo("string",this.readData(a))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var a=this.readInt(4);return new Date(Date.UTC(1980+(a>>25&127),(a>>21&15)-1,a>>16&31,a>>11&31,a>>5&63,(31&a)<<1))}},n.exports=s},{"../utils":32}],19:[function(t,n,i){var o=t("./Uint8ArrayReader");function s(a){o.call(this,a)}t("../utils").inherits(s,o),s.prototype.readData=function(a){this.checkOffset(a);var l=this.data.slice(this.zero+this.index,this.zero+this.index+a);return this.index+=a,l},n.exports=s},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(t,n,i){var o=t("./DataReader");function s(a){o.call(this,a)}t("../utils").inherits(s,o),s.prototype.byteAt=function(a){return this.data.charCodeAt(this.zero+a)},s.prototype.lastIndexOfSignature=function(a){return this.data.lastIndexOf(a)-this.zero},s.prototype.readAndCheckSignature=function(a){return a===this.readData(4)},s.prototype.readData=function(a){this.checkOffset(a);var l=this.data.slice(this.zero+this.index,this.zero+this.index+a);return this.index+=a,l},n.exports=s},{"../utils":32,"./DataReader":18}],21:[function(t,n,i){var o=t("./ArrayReader");function s(a){o.call(this,a)}t("../utils").inherits(s,o),s.prototype.readData=function(a){if(this.checkOffset(a),a===0)return new Uint8Array(0);var l=this.data.subarray(this.zero+this.index,this.zero+this.index+a);return this.index+=a,l},n.exports=s},{"../utils":32,"./ArrayReader":17}],22:[function(t,n,i){var o=t("../utils"),s=t("../support"),a=t("./ArrayReader"),l=t("./StringReader"),u=t("./NodeBufferReader"),c=t("./Uint8ArrayReader");n.exports=function(f){var d=o.getTypeOf(f);return o.checkSupport(d),d!=="string"||s.uint8array?d==="nodebuffer"?new u(f):s.uint8array?new c(o.transformTo("uint8array",f)):new a(o.transformTo("array",f)):new l(f)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(t,n,i){i.LOCAL_FILE_HEADER="PK",i.CENTRAL_FILE_HEADER="PK",i.CENTRAL_DIRECTORY_END="PK",i.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x07",i.ZIP64_CENTRAL_DIRECTORY_END="PK",i.DATA_DESCRIPTOR="PK\x07\b"},{}],24:[function(t,n,i){var o=t("./GenericWorker"),s=t("../utils");function a(l){o.call(this,"ConvertWorker to "+l),this.destType=l}s.inherits(a,o),a.prototype.processChunk=function(l){this.push({data:s.transformTo(this.destType,l.data),meta:l.meta})},n.exports=a},{"../utils":32,"./GenericWorker":28}],25:[function(t,n,i){var o=t("./GenericWorker"),s=t("../crc32");function a(){o.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}t("../utils").inherits(a,o),a.prototype.processChunk=function(l){this.streamInfo.crc32=s(l.data,this.streamInfo.crc32||0),this.push(l)},n.exports=a},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(t,n,i){var o=t("../utils"),s=t("./GenericWorker");function a(l){s.call(this,"DataLengthProbe for "+l),this.propName=l,this.withStreamInfo(l,0)}o.inherits(a,s),a.prototype.processChunk=function(l){if(l){var u=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=u+l.data.length}s.prototype.processChunk.call(this,l)},n.exports=a},{"../utils":32,"./GenericWorker":28}],27:[function(t,n,i){var o=t("../utils"),s=t("./GenericWorker");function a(l){s.call(this,"DataWorker");var u=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,l.then(function(c){u.dataIsReady=!0,u.data=c,u.max=c&&c.length||0,u.type=o.getTypeOf(c),u.isPaused||u._tickAndRepeat()},function(c){u.error(c)})}o.inherits(a,s),a.prototype.cleanUp=function(){s.prototype.cleanUp.call(this),this.data=null},a.prototype.resume=function(){return!!s.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,o.delay(this._tickAndRepeat,[],this)),!0)},a.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(o.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},a.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var l=null,u=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":l=this.data.substring(this.index,u);break;case"uint8array":l=this.data.subarray(this.index,u);break;case"array":case"nodebuffer":l=this.data.slice(this.index,u)}return this.index=u,this.push({data:l,meta:{percent:this.max?this.index/this.max*100:0}})},n.exports=a},{"../utils":32,"./GenericWorker":28}],28:[function(t,n,i){function o(s){this.name=s||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}o.prototype={push:function(s){this.emit("data",s)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(s){this.emit("error",s)}return!0},error:function(s){return!this.isFinished&&(this.isPaused?this.generatedError=s:(this.isFinished=!0,this.emit("error",s),this.previous&&this.previous.error(s),this.cleanUp()),!0)},on:function(s,a){return this._listeners[s].push(a),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(s,a){if(this._listeners[s])for(var l=0;l "+s:s}},n.exports=o},{}],29:[function(t,n,i){var o=t("../utils"),s=t("./ConvertWorker"),a=t("./GenericWorker"),l=t("../base64"),u=t("../support"),c=t("../external"),f=null;if(u.nodestream)try{f=t("../nodejs/NodejsStreamOutputAdapter")}catch{}function d(g,v){return new c.Promise(function(p,m){var y=[],_=g._internalType,C=g._outputType,b=g._mimeType;g.on("data",function(x,w){y.push(x),v&&v(w)}).on("error",function(x){y=[],m(x)}).on("end",function(){try{var x=function(w,M,T){switch(w){case"blob":return o.newBlob(o.transformTo("arraybuffer",M),T);case"base64":return l.encode(M);default:return o.transformTo(w,M)}}(C,function(w,M){var T,I=0,F=null,A=0;for(T=0;T"u")i.blob=!1;else{var o=new ArrayBuffer(0);try{i.blob=new Blob([o],{type:"application/zip"}).size===0}catch{try{var s=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);s.append(o),i.blob=s.getBlob("application/zip").size===0}catch{i.blob=!1}}}try{i.nodestream=!!t("readable-stream").Readable}catch{i.nodestream=!1}},{"readable-stream":16}],31:[function(t,n,i){for(var o=t("./utils"),s=t("./support"),a=t("./nodejsUtils"),l=t("./stream/GenericWorker"),u=new Array(256),c=0;c<256;c++)u[c]=252<=c?6:248<=c?5:240<=c?4:224<=c?3:192<=c?2:1;u[254]=u[254]=1;function f(){l.call(this,"utf-8 decode"),this.leftOver=null}function d(){l.call(this,"utf-8 encode")}i.utf8encode=function(h){return s.nodebuffer?a.newBufferFrom(h,"utf-8"):function(g){var v,p,m,y,_,C=g.length,b=0;for(y=0;y>>6:(p<65536?v[_++]=224|p>>>12:(v[_++]=240|p>>>18,v[_++]=128|p>>>12&63),v[_++]=128|p>>>6&63),v[_++]=128|63&p);return v}(h)},i.utf8decode=function(h){return s.nodebuffer?o.transformTo("nodebuffer",h).toString("utf-8"):function(g){var v,p,m,y,_=g.length,C=new Array(2*_);for(v=p=0;v<_;)if((m=g[v++])<128)C[p++]=m;else if(4<(y=u[m]))C[p++]=65533,v+=y-1;else{for(m&=y===2?31:y===3?15:7;1>10&1023,C[p++]=56320|1023&m)}return C.length!==p&&(C.subarray?C=C.subarray(0,p):C.length=p),o.applyFromCharCode(C)}(h=o.transformTo(s.uint8array?"uint8array":"array",h))},o.inherits(f,l),f.prototype.processChunk=function(h){var g=o.transformTo(s.uint8array?"uint8array":"array",h.data);if(this.leftOver&&this.leftOver.length){if(s.uint8array){var v=g;(g=new Uint8Array(v.length+this.leftOver.length)).set(this.leftOver,0),g.set(v,this.leftOver.length)}else g=this.leftOver.concat(g);this.leftOver=null}var p=function(y,_){var C;for((_=_||y.length)>y.length&&(_=y.length),C=_-1;0<=C&&(192&y[C])==128;)C--;return C<0||C===0?_:C+u[y[C]]>_?C:_}(g),m=g;p!==g.length&&(s.uint8array?(m=g.subarray(0,p),this.leftOver=g.subarray(p,g.length)):(m=g.slice(0,p),this.leftOver=g.slice(p,g.length))),this.push({data:i.utf8decode(m),meta:h.meta})},f.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:i.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},i.Utf8DecodeWorker=f,o.inherits(d,l),d.prototype.processChunk=function(h){this.push({data:i.utf8encode(h.data),meta:h.meta})},i.Utf8EncodeWorker=d},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(t,n,i){var o=t("./support"),s=t("./base64"),a=t("./nodejsUtils"),l=t("./external");function u(v){return v}function c(v,p){for(var m=0;m>8;this.dir=!!(16&this.externalFileAttributes),h==0&&(this.dosPermissions=63&this.externalFileAttributes),h==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!=="/"||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var h=o(this.extraFields[1].value);this.uncompressedSize===s.MAX_VALUE_32BITS&&(this.uncompressedSize=h.readInt(8)),this.compressedSize===s.MAX_VALUE_32BITS&&(this.compressedSize=h.readInt(8)),this.localHeaderOffset===s.MAX_VALUE_32BITS&&(this.localHeaderOffset=h.readInt(8)),this.diskNumberStart===s.MAX_VALUE_32BITS&&(this.diskNumberStart=h.readInt(4))}},readExtraFields:function(h){var g,v,p,m=h.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});h.index+4>>6:(h<65536?d[p++]=224|h>>>12:(d[p++]=240|h>>>18,d[p++]=128|h>>>12&63),d[p++]=128|h>>>6&63),d[p++]=128|63&h);return d},i.buf2binstring=function(f){return c(f,f.length)},i.binstring2buf=function(f){for(var d=new o.Buf8(f.length),h=0,g=d.length;h>10&1023,y[g++]=56320|1023&v)}return c(y,g)},i.utf8border=function(f,d){var h;for((d=d||f.length)>f.length&&(d=f.length),h=d-1;0<=h&&(192&f[h])==128;)h--;return h<0||h===0?d:h+l[f[h]]>d?h:d}},{"./common":41}],43:[function(t,n,i){n.exports=function(o,s,a,l){for(var u=65535&o|0,c=o>>>16&65535|0,f=0;a!==0;){for(a-=f=2e3>>1:s>>>1;a[l]=s}return a}();n.exports=function(s,a,l,u){var c=o,f=u+l;s^=-1;for(var d=u;d>>8^c[255&(s^a[d])];return-1^s}},{}],46:[function(t,n,i){var o,s=t("../utils/common"),a=t("./trees"),l=t("./adler32"),u=t("./crc32"),c=t("./messages"),f=0,d=4,h=0,g=-2,v=-1,p=4,m=2,y=8,_=9,C=286,b=30,x=19,w=2*C+1,M=15,T=3,I=258,F=I+T+1,A=42,X=113,S=1,G=2,O=3,D=4;function L(E,Z){return E.msg=c[Z],Z}function $(E){return(E<<1)-(4E.avail_out&&(H=E.avail_out),H!==0&&(s.arraySet(E.output,Z.pending_buf,Z.pending_out,H,E.next_out),E.next_out+=H,Z.pending_out+=H,E.total_out+=H,E.avail_out-=H,Z.pending-=H,Z.pending===0&&(Z.pending_out=0))}function V(E,Z){a._tr_flush_block(E,0<=E.block_start?E.block_start:-1,E.strstart-E.block_start,Z),E.block_start=E.strstart,N(E.strm)}function P(E,Z){E.pending_buf[E.pending++]=Z}function J(E,Z){E.pending_buf[E.pending++]=Z>>>8&255,E.pending_buf[E.pending++]=255&Z}function Q(E,Z){var H,j,z=E.max_chain_length,q=E.strstart,se=E.prev_length,ae=E.nice_match,ee=E.strstart>E.w_size-F?E.strstart-(E.w_size-F):0,he=E.window,ye=E.w_mask,me=E.prev,ne=E.strstart+I,fe=he[q+se-1],ge=he[q+se];E.prev_length>=E.good_match&&(z>>=2),ae>E.lookahead&&(ae=E.lookahead);do if(he[(H=Z)+se]===ge&&he[H+se-1]===fe&&he[H]===he[q]&&he[++H]===he[q+1]){q+=2,H++;do;while(he[++q]===he[++H]&&he[++q]===he[++H]&&he[++q]===he[++H]&&he[++q]===he[++H]&&he[++q]===he[++H]&&he[++q]===he[++H]&&he[++q]===he[++H]&&he[++q]===he[++H]&&qee&&--z!=0);return se<=E.lookahead?se:E.lookahead}function ce(E){var Z,H,j,z,q,se,ae,ee,he,ye,me=E.w_size;do{if(z=E.window_size-E.lookahead-E.strstart,E.strstart>=me+(me-F)){for(s.arraySet(E.window,E.window,me,me,0),E.match_start-=me,E.strstart-=me,E.block_start-=me,Z=H=E.hash_size;j=E.head[--Z],E.head[Z]=me<=j?j-me:0,--H;);for(Z=H=me;j=E.prev[--Z],E.prev[Z]=me<=j?j-me:0,--H;);z+=me}if(E.strm.avail_in===0)break;if(se=E.strm,ae=E.window,ee=E.strstart+E.lookahead,he=z,ye=void 0,ye=se.avail_in,he=T)for(q=E.strstart-E.insert,E.ins_h=E.window[q],E.ins_h=(E.ins_h<=T&&(E.ins_h=(E.ins_h<=T)if(j=a._tr_tally(E,E.strstart-E.match_start,E.match_length-T),E.lookahead-=E.match_length,E.match_length<=E.max_lazy_match&&E.lookahead>=T){for(E.match_length--;E.strstart++,E.ins_h=(E.ins_h<=T&&(E.ins_h=(E.ins_h<=T&&E.match_length<=E.prev_length){for(z=E.strstart+E.lookahead-T,j=a._tr_tally(E,E.strstart-1-E.prev_match,E.prev_length-T),E.lookahead-=E.prev_length-1,E.prev_length-=2;++E.strstart<=z&&(E.ins_h=(E.ins_h<E.pending_buf_size-5&&(H=E.pending_buf_size-5);;){if(E.lookahead<=1){if(ce(E),E.lookahead===0&&Z===f)return S;if(E.lookahead===0)break}E.strstart+=E.lookahead,E.lookahead=0;var j=E.block_start+H;if((E.strstart===0||E.strstart>=j)&&(E.lookahead=E.strstart-j,E.strstart=j,V(E,!1),E.strm.avail_out===0)||E.strstart-E.block_start>=E.w_size-F&&(V(E,!1),E.strm.avail_out===0))return S}return E.insert=0,Z===d?(V(E,!0),E.strm.avail_out===0?O:D):(E.strstart>E.block_start&&(V(E,!1),E.strm.avail_out),S)}),new R(4,4,8,4,pe),new R(4,5,16,8,pe),new R(4,6,32,32,pe),new R(4,4,16,16,te),new R(8,16,32,32,te),new R(8,16,128,128,te),new R(8,32,128,256,te),new R(32,128,258,1024,te),new R(32,258,258,4096,te)],i.deflateInit=function(E,Z){return ie(E,Z,y,15,8,0)},i.deflateInit2=ie,i.deflateReset=oe,i.deflateResetKeep=W,i.deflateSetHeader=function(E,Z){return E&&E.state?E.state.wrap!==2?g:(E.state.gzhead=Z,h):g},i.deflate=function(E,Z){var H,j,z,q;if(!E||!E.state||5>8&255),P(j,j.gzhead.time>>16&255),P(j,j.gzhead.time>>24&255),P(j,j.level===9?2:2<=j.strategy||j.level<2?4:0),P(j,255&j.gzhead.os),j.gzhead.extra&&j.gzhead.extra.length&&(P(j,255&j.gzhead.extra.length),P(j,j.gzhead.extra.length>>8&255)),j.gzhead.hcrc&&(E.adler=u(E.adler,j.pending_buf,j.pending,0)),j.gzindex=0,j.status=69):(P(j,0),P(j,0),P(j,0),P(j,0),P(j,0),P(j,j.level===9?2:2<=j.strategy||j.level<2?4:0),P(j,3),j.status=X);else{var se=y+(j.w_bits-8<<4)<<8;se|=(2<=j.strategy||j.level<2?0:j.level<6?1:j.level===6?2:3)<<6,j.strstart!==0&&(se|=32),se+=31-se%31,j.status=X,J(j,se),j.strstart!==0&&(J(j,E.adler>>>16),J(j,65535&E.adler)),E.adler=1}if(j.status===69)if(j.gzhead.extra){for(z=j.pending;j.gzindex<(65535&j.gzhead.extra.length)&&(j.pending!==j.pending_buf_size||(j.gzhead.hcrc&&j.pending>z&&(E.adler=u(E.adler,j.pending_buf,j.pending-z,z)),N(E),z=j.pending,j.pending!==j.pending_buf_size));)P(j,255&j.gzhead.extra[j.gzindex]),j.gzindex++;j.gzhead.hcrc&&j.pending>z&&(E.adler=u(E.adler,j.pending_buf,j.pending-z,z)),j.gzindex===j.gzhead.extra.length&&(j.gzindex=0,j.status=73)}else j.status=73;if(j.status===73)if(j.gzhead.name){z=j.pending;do{if(j.pending===j.pending_buf_size&&(j.gzhead.hcrc&&j.pending>z&&(E.adler=u(E.adler,j.pending_buf,j.pending-z,z)),N(E),z=j.pending,j.pending===j.pending_buf_size)){q=1;break}q=j.gzindexz&&(E.adler=u(E.adler,j.pending_buf,j.pending-z,z)),q===0&&(j.gzindex=0,j.status=91)}else j.status=91;if(j.status===91)if(j.gzhead.comment){z=j.pending;do{if(j.pending===j.pending_buf_size&&(j.gzhead.hcrc&&j.pending>z&&(E.adler=u(E.adler,j.pending_buf,j.pending-z,z)),N(E),z=j.pending,j.pending===j.pending_buf_size)){q=1;break}q=j.gzindexz&&(E.adler=u(E.adler,j.pending_buf,j.pending-z,z)),q===0&&(j.status=103)}else j.status=103;if(j.status===103&&(j.gzhead.hcrc?(j.pending+2>j.pending_buf_size&&N(E),j.pending+2<=j.pending_buf_size&&(P(j,255&E.adler),P(j,E.adler>>8&255),E.adler=0,j.status=X)):j.status=X),j.pending!==0){if(N(E),E.avail_out===0)return j.last_flush=-1,h}else if(E.avail_in===0&&$(Z)<=$(H)&&Z!==d)return L(E,-5);if(j.status===666&&E.avail_in!==0)return L(E,-5);if(E.avail_in!==0||j.lookahead!==0||Z!==f&&j.status!==666){var ae=j.strategy===2?function(ee,he){for(var ye;;){if(ee.lookahead===0&&(ce(ee),ee.lookahead===0)){if(he===f)return S;break}if(ee.match_length=0,ye=a._tr_tally(ee,0,ee.window[ee.strstart]),ee.lookahead--,ee.strstart++,ye&&(V(ee,!1),ee.strm.avail_out===0))return S}return ee.insert=0,he===d?(V(ee,!0),ee.strm.avail_out===0?O:D):ee.last_lit&&(V(ee,!1),ee.strm.avail_out===0)?S:G}(j,Z):j.strategy===3?function(ee,he){for(var ye,me,ne,fe,ge=ee.window;;){if(ee.lookahead<=I){if(ce(ee),ee.lookahead<=I&&he===f)return S;if(ee.lookahead===0)break}if(ee.match_length=0,ee.lookahead>=T&&0ee.lookahead&&(ee.match_length=ee.lookahead)}if(ee.match_length>=T?(ye=a._tr_tally(ee,1,ee.match_length-T),ee.lookahead-=ee.match_length,ee.strstart+=ee.match_length,ee.match_length=0):(ye=a._tr_tally(ee,0,ee.window[ee.strstart]),ee.lookahead--,ee.strstart++),ye&&(V(ee,!1),ee.strm.avail_out===0))return S}return ee.insert=0,he===d?(V(ee,!0),ee.strm.avail_out===0?O:D):ee.last_lit&&(V(ee,!1),ee.strm.avail_out===0)?S:G}(j,Z):o[j.level].func(j,Z);if(ae!==O&&ae!==D||(j.status=666),ae===S||ae===O)return E.avail_out===0&&(j.last_flush=-1),h;if(ae===G&&(Z===1?a._tr_align(j):Z!==5&&(a._tr_stored_block(j,0,0,!1),Z===3&&(k(j.head),j.lookahead===0&&(j.strstart=0,j.block_start=0,j.insert=0))),N(E),E.avail_out===0))return j.last_flush=-1,h}return Z!==d?h:j.wrap<=0?1:(j.wrap===2?(P(j,255&E.adler),P(j,E.adler>>8&255),P(j,E.adler>>16&255),P(j,E.adler>>24&255),P(j,255&E.total_in),P(j,E.total_in>>8&255),P(j,E.total_in>>16&255),P(j,E.total_in>>24&255)):(J(j,E.adler>>>16),J(j,65535&E.adler)),N(E),0=H.w_size&&(q===0&&(k(H.head),H.strstart=0,H.block_start=0,H.insert=0),he=new s.Buf8(H.w_size),s.arraySet(he,Z,ye-H.w_size,H.w_size,0),Z=he,ye=H.w_size),se=E.avail_in,ae=E.next_in,ee=E.input,E.avail_in=ye,E.next_in=0,E.input=Z,ce(H);H.lookahead>=T;){for(j=H.strstart,z=H.lookahead-(T-1);H.ins_h=(H.ins_h<>>=T=M>>>24,_-=T,(T=M>>>16&255)===0)G[c++]=65535&M;else{if(!(16&T)){if(!(64&T)){M=C[(65535&M)+(y&(1<>>=T,_-=T),_<15&&(y+=S[l++]<<_,_+=8,y+=S[l++]<<_,_+=8),M=b[y&w];n:for(;;){if(y>>>=T=M>>>24,_-=T,!(16&(T=M>>>16&255))){if(!(64&T)){M=b[(65535&M)+(y&(1<>>=T,_-=T,(T=c-f)>3,y&=(1<<(_-=I<<3))-1,o.next_in=l,o.next_out=c,o.avail_in=l>>24&255)+(A>>>8&65280)+((65280&A)<<8)+((255&A)<<24)}function y(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new o.Buf16(320),this.work=new o.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function _(A){var X;return A&&A.state?(X=A.state,A.total_in=A.total_out=X.total=0,A.msg="",X.wrap&&(A.adler=1&X.wrap),X.mode=g,X.last=0,X.havedict=0,X.dmax=32768,X.head=null,X.hold=0,X.bits=0,X.lencode=X.lendyn=new o.Buf32(v),X.distcode=X.distdyn=new o.Buf32(p),X.sane=1,X.back=-1,d):h}function C(A){var X;return A&&A.state?((X=A.state).wsize=0,X.whave=0,X.wnext=0,_(A)):h}function b(A,X){var S,G;return A&&A.state?(G=A.state,X<0?(S=0,X=-X):(S=1+(X>>4),X<48&&(X&=15)),X&&(X<8||15=D.wsize?(o.arraySet(D.window,X,S-D.wsize,D.wsize,0),D.wnext=0,D.whave=D.wsize):(G<(O=D.wsize-D.wnext)&&(O=G),o.arraySet(D.window,X,S-G,O,D.wnext),(G-=O)?(o.arraySet(D.window,X,S-G,G,0),D.wnext=G,D.whave=D.wsize):(D.wnext+=O,D.wnext===D.wsize&&(D.wnext=0),D.whave>>8&255,S.check=a(S.check,q,2,0),V=N=0,S.mode=2;break}if(S.flags=0,S.head&&(S.head.done=!1),!(1&S.wrap)||(((255&N)<<8)+(N>>8))%31){A.msg="incorrect header check",S.mode=30;break}if((15&N)!=8){A.msg="unknown compression method",S.mode=30;break}if(V-=4,E=8+(15&(N>>>=4)),S.wbits===0)S.wbits=E;else if(E>S.wbits){A.msg="invalid window size",S.mode=30;break}S.dmax=1<>8&1),512&S.flags&&(q[0]=255&N,q[1]=N>>>8&255,S.check=a(S.check,q,2,0)),V=N=0,S.mode=3;case 3:for(;V<32;){if($===0)break e;$--,N+=G[D++]<>>8&255,q[2]=N>>>16&255,q[3]=N>>>24&255,S.check=a(S.check,q,4,0)),V=N=0,S.mode=4;case 4:for(;V<16;){if($===0)break e;$--,N+=G[D++]<>8),512&S.flags&&(q[0]=255&N,q[1]=N>>>8&255,S.check=a(S.check,q,2,0)),V=N=0,S.mode=5;case 5:if(1024&S.flags){for(;V<16;){if($===0)break e;$--,N+=G[D++]<>>8&255,S.check=a(S.check,q,2,0)),V=N=0}else S.head&&(S.head.extra=null);S.mode=6;case 6:if(1024&S.flags&&($<(Q=S.length)&&(Q=$),Q&&(S.head&&(E=S.head.extra_len-S.length,S.head.extra||(S.head.extra=new Array(S.head.extra_len)),o.arraySet(S.head.extra,G,D,Q,E)),512&S.flags&&(S.check=a(S.check,G,Q,D)),$-=Q,D+=Q,S.length-=Q),S.length))break e;S.length=0,S.mode=7;case 7:if(2048&S.flags){if($===0)break e;for(Q=0;E=G[D+Q++],S.head&&E&&S.length<65536&&(S.head.name+=String.fromCharCode(E)),E&&Q<$;);if(512&S.flags&&(S.check=a(S.check,G,Q,D)),$-=Q,D+=Q,E)break e}else S.head&&(S.head.name=null);S.length=0,S.mode=8;case 8:if(4096&S.flags){if($===0)break e;for(Q=0;E=G[D+Q++],S.head&&E&&S.length<65536&&(S.head.comment+=String.fromCharCode(E)),E&&Q<$;);if(512&S.flags&&(S.check=a(S.check,G,Q,D)),$-=Q,D+=Q,E)break e}else S.head&&(S.head.comment=null);S.mode=9;case 9:if(512&S.flags){for(;V<16;){if($===0)break e;$--,N+=G[D++]<>9&1,S.head.done=!0),A.adler=S.check=0,S.mode=12;break;case 10:for(;V<32;){if($===0)break e;$--,N+=G[D++]<>>=7&V,V-=7&V,S.mode=27;break}for(;V<3;){if($===0)break e;$--,N+=G[D++]<>>=1)){case 0:S.mode=14;break;case 1:if(I(S),S.mode=20,X!==6)break;N>>>=2,V-=2;break e;case 2:S.mode=17;break;case 3:A.msg="invalid block type",S.mode=30}N>>>=2,V-=2;break;case 14:for(N>>>=7&V,V-=7&V;V<32;){if($===0)break e;$--,N+=G[D++]<>>16^65535)){A.msg="invalid stored block lengths",S.mode=30;break}if(S.length=65535&N,V=N=0,S.mode=15,X===6)break e;case 15:S.mode=16;case 16:if(Q=S.length){if($>>=5,V-=5,S.ndist=1+(31&N),N>>>=5,V-=5,S.ncode=4+(15&N),N>>>=4,V-=4,286>>=3,V-=3}for(;S.have<19;)S.lens[se[S.have++]]=0;if(S.lencode=S.lendyn,S.lenbits=7,H={bits:S.lenbits},Z=u(0,S.lens,0,19,S.lencode,0,S.work,H),S.lenbits=H.bits,Z){A.msg="invalid code lengths set",S.mode=30;break}S.have=0,S.mode=19;case 19:for(;S.have>>16&255,B=65535&z,!((te=z>>>24)<=V);){if($===0)break e;$--,N+=G[D++]<>>=te,V-=te,S.lens[S.have++]=B;else{if(B===16){for(j=te+2;V>>=te,V-=te,S.have===0){A.msg="invalid bit length repeat",S.mode=30;break}E=S.lens[S.have-1],Q=3+(3&N),N>>>=2,V-=2}else if(B===17){for(j=te+3;V>>=te)),N>>>=3,V-=3}else{for(j=te+7;V>>=te)),N>>>=7,V-=7}if(S.have+Q>S.nlen+S.ndist){A.msg="invalid bit length repeat",S.mode=30;break}for(;Q--;)S.lens[S.have++]=E}}if(S.mode===30)break;if(S.lens[256]===0){A.msg="invalid code -- missing end-of-block",S.mode=30;break}if(S.lenbits=9,H={bits:S.lenbits},Z=u(c,S.lens,0,S.nlen,S.lencode,0,S.work,H),S.lenbits=H.bits,Z){A.msg="invalid literal/lengths set",S.mode=30;break}if(S.distbits=6,S.distcode=S.distdyn,H={bits:S.distbits},Z=u(f,S.lens,S.nlen,S.ndist,S.distcode,0,S.work,H),S.distbits=H.bits,Z){A.msg="invalid distances set",S.mode=30;break}if(S.mode=20,X===6)break e;case 20:S.mode=21;case 21:if(6<=$&&258<=k){A.next_out=L,A.avail_out=k,A.next_in=D,A.avail_in=$,S.hold=N,S.bits=V,l(A,J),L=A.next_out,O=A.output,k=A.avail_out,D=A.next_in,G=A.input,$=A.avail_in,N=S.hold,V=S.bits,S.mode===12&&(S.back=-1);break}for(S.back=0;R=(z=S.lencode[N&(1<>>16&255,B=65535&z,!((te=z>>>24)<=V);){if($===0)break e;$--,N+=G[D++]<>W)])>>>16&255,B=65535&z,!(W+(te=z>>>24)<=V);){if($===0)break e;$--,N+=G[D++]<>>=W,V-=W,S.back+=W}if(N>>>=te,V-=te,S.back+=te,S.length=B,R===0){S.mode=26;break}if(32&R){S.back=-1,S.mode=12;break}if(64&R){A.msg="invalid literal/length code",S.mode=30;break}S.extra=15&R,S.mode=22;case 22:if(S.extra){for(j=S.extra;V>>=S.extra,V-=S.extra,S.back+=S.extra}S.was=S.length,S.mode=23;case 23:for(;R=(z=S.distcode[N&(1<>>16&255,B=65535&z,!((te=z>>>24)<=V);){if($===0)break e;$--,N+=G[D++]<>W)])>>>16&255,B=65535&z,!(W+(te=z>>>24)<=V);){if($===0)break e;$--,N+=G[D++]<>>=W,V-=W,S.back+=W}if(N>>>=te,V-=te,S.back+=te,64&R){A.msg="invalid distance code",S.mode=30;break}S.offset=B,S.extra=15&R,S.mode=24;case 24:if(S.extra){for(j=S.extra;V>>=S.extra,V-=S.extra,S.back+=S.extra}if(S.offset>S.dmax){A.msg="invalid distance too far back",S.mode=30;break}S.mode=25;case 25:if(k===0)break e;if(Q=J-k,S.offset>Q){if((Q=S.offset-Q)>S.whave&&S.sane){A.msg="invalid distance too far back",S.mode=30;break}ce=Q>S.wnext?(Q-=S.wnext,S.wsize-Q):S.wnext-Q,Q>S.length&&(Q=S.length),pe=S.window}else pe=O,ce=L-S.offset,Q=S.length;for(kw?(T=ce[pe+p[X]],V[P+p[X]]):(T=96,0),y=1<>L)+(_-=y)]=M<<24|T<<16|I|0,_!==0;);for(y=1<>=1;if(y!==0?(N&=y-1,N+=y):N=0,X++,--J[A]==0){if(A===G)break;A=f[d+p[X]]}if(O>>7)]}function P(z,q){z.pending_buf[z.pending++]=255&q,z.pending_buf[z.pending++]=q>>>8&255}function J(z,q,se){z.bi_valid>m-se?(z.bi_buf|=q<>m-z.bi_valid,z.bi_valid+=se-m):(z.bi_buf|=q<>>=1,se<<=1,0<--q;);return se>>>1}function pe(z,q,se){var ae,ee,he=new Array(p+1),ye=0;for(ae=1;ae<=p;ae++)he[ae]=ye=ye+se[ae-1]<<1;for(ee=0;ee<=q;ee++){var me=z[2*ee+1];me!==0&&(z[2*ee]=ce(he[me]++,me))}}function te(z){var q;for(q=0;q>1;1<=se;se--)W(z,he,se);for(ee=ne;se=z.heap[1],z.heap[1]=z.heap[z.heap_len--],W(z,he,1),ae=z.heap[1],z.heap[--z.heap_max]=se,z.heap[--z.heap_max]=ae,he[2*ee]=he[2*se]+he[2*ae],z.depth[ee]=(z.depth[se]>=z.depth[ae]?z.depth[se]:z.depth[ae])+1,he[2*se+1]=he[2*ae+1]=ee,z.heap[1]=ee++,W(z,he,1),2<=z.heap_len;);z.heap[--z.heap_max]=z.heap[1],function(ge,be){var Pe,Xe,et,Le,ft,re,U=be.dyn_tree,ue=be.max_code,_e=be.stat_desc.static_tree,Ee=be.stat_desc.has_stree,Ae=be.stat_desc.extra_bits,it=be.stat_desc.extra_base,wt=be.stat_desc.max_length,ht=0;for(Le=0;Le<=p;Le++)ge.bl_count[Le]=0;for(U[2*ge.heap[ge.heap_max]+1]=0,Pe=ge.heap_max+1;Pe>=7;ee>>=1)if(1&fe&&me.dyn_ltree[2*ne]!==0)return s;if(me.dyn_ltree[18]!==0||me.dyn_ltree[20]!==0||me.dyn_ltree[26]!==0)return a;for(ne=32;ne>>3,(he=z.static_len+3+7>>>3)<=ee&&(ee=he)):ee=he=se+5,se+4<=ee&&q!==-1?j(z,q,se,ae):z.strategy===4||he===ee?(J(z,2+(ae?1:0),3),oe(z,F,A)):(J(z,4+(ae?1:0),3),function(me,ne,fe,ge){var be;for(J(me,ne-257,5),J(me,fe-1,5),J(me,ge-4,4),be=0;be>>8&255,z.pending_buf[z.d_buf+2*z.last_lit+1]=255&q,z.pending_buf[z.l_buf+z.last_lit]=255&se,z.last_lit++,q===0?z.dyn_ltree[2*se]++:(z.matches++,q--,z.dyn_ltree[2*(S[se]+f+1)]++,z.dyn_dtree[2*V(q)]++),z.last_lit===z.lit_bufsize-1},i._tr_align=function(z){J(z,2,3),Q(z,_,F),function(q){q.bi_valid===16?(P(q,q.bi_buf),q.bi_buf=0,q.bi_valid=0):8<=q.bi_valid&&(q.pending_buf[q.pending++]=255&q.bi_buf,q.bi_buf>>=8,q.bi_valid-=8)}(z)}},{"../utils/common":41}],53:[function(t,n,i){n.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(t,n,i){(function(o){(function(s,a){if(!s.setImmediate){var l,u,c,f,d=1,h={},g=!1,v=s.document,p=Object.getPrototypeOf&&Object.getPrototypeOf(s);p=p&&p.setTimeout?p:s,l={}.toString.call(s.process)==="[object process]"?function(C){process.nextTick(function(){y(C)})}:function(){if(s.postMessage&&!s.importScripts){var C=!0,b=s.onmessage;return s.onmessage=function(){C=!1},s.postMessage("","*"),s.onmessage=b,C}}()?(f="setImmediate$"+Math.random()+"$",s.addEventListener?s.addEventListener("message",_,!1):s.attachEvent("onmessage",_),function(C){s.postMessage(f+C,"*")}):s.MessageChannel?((c=new MessageChannel).port1.onmessage=function(C){y(C.data)},function(C){c.port2.postMessage(C)}):v&&"onreadystatechange"in v.createElement("script")?(u=v.documentElement,function(C){var b=v.createElement("script");b.onreadystatechange=function(){y(C),b.onreadystatechange=null,u.removeChild(b),b=null},u.appendChild(b)}):function(C){setTimeout(y,0,C)},p.setImmediate=function(C){typeof C!="function"&&(C=new Function(""+C));for(var b=new Array(arguments.length-1),x=0;x"u"?o===void 0?this:o:self)}).call(this,typeof Nn<"u"?Nn:typeof self<"u"?self:typeof window<"u"?window:{})},{}]},{},[10])(10)})}(Ha)),Ha.exports}var WI=XI();const qI=cu(WI);Hn.zipReader=(r,e)=>qI.loadAsync(r);Hn.readText=(r,e)=>{const t=r.file(e);if(!t)throw new Error(`Cannot find file: ${e}`);return t.async("text")};Hn.getFilePaths=r=>{const e=[];return r.forEach(t=>e.push(t)),Promise.resolve(e)};Hn.getFiles=(r,e)=>Promise.all(e.map(async t=>{const n=t.slice(t.lastIndexOf("/")+1),i=await r.file(t).async("blob");return new File([i],n)}));const YI={relative:""},KI={"h-full":"","w-full":""},ZI={key:0,class:"animate-stripe",absolute:"",left:"1/2",bottom:"20%",z:"20","rounded-2xl":"",text:"pink-600","px-2":"","py-2":"",transform:"translate-x--1/2"},JI={bg:"pink-50","rounded-xl":"","px-10":"","py-6":""},QI=["innerHTML"],eM=De({__name:"Stage",setup(r){const e=le(),t=le(),{stageView:n,elevenLabsApiKey:i,elevenlabsVoiceEnglish:o,elevenlabsVoiceJapanese:s}=En(ei()),{mouthOpenSize:a}=En(zI()),{audioContext:l,calculateVolume:u}=qm(),{onBeforeMessageComposed:c,onBeforeSend:f,onTokenLiteral:d,onTokenSpecial:h,onStreamEnd:g,streamingMessage:v}=_r(),{process:p}=rc(),{locale:m}=Qr(),y=le(),_=le(!1),C=le(!1),b=ws({handlers:[S=>new Promise(G=>{const O=l.createBufferSource();O.buffer=S.data.audioBuffer,O.connect(l.destination),O.connect(y.value),_.value=!0,O.start(0),O.onended=()=>{_.value=!1,G()}})]}),x=ws({handlers:[async S=>{let G=ov.Camilla_KM;m.value==="jp"||m.value==="jp-JP"?G=s.value:G=o.value;const O=Date.now(),D=W2({apiKey:i.value,baseURL:"https://unspeech.hyp3r.link/v1/"}),L=await H2({...D.speech("eleven_multilingual_v2",{voiceSettings:{stability:.4,similarityBoost:.5}}),input:S.data,voice:sv[G]}),$=Date.now()-O;console.debug("TTS took",$,"ms");const k=await l.decodeAudioData(L);await b.add({audioBuffer:k,text:S.data})}]});x.on("add",S=>{console.debug("ttsQueue added",S)});const w=kv(x),M=ws({handlers:[async S=>{if(n.value==="3d"){const G=Fv[S.data];if(!G)return;await t.value.setExpression(G)}else n.value==="2d"&&await e.value.setMotion(Lv[S.data])}]}),T=Pv(M);T.onHandlerEvent("emotion",S=>{console.debug("emotion detected",S)});const I=Rv();I.onHandlerEvent("delay",S=>{console.debug("delay detected",S)});function F(){requestAnimationFrame(F),_.value&&(a.value=u(y.value,"linear"))}function A(){C.value||(F(),l.resume(),C.value=!0)}function X(){y.value||(y.value=l.createAnalyser())}return c(async()=>{X(),A()}),f(async()=>{var S;(S=e.value)==null||S.setMotion(Kd)}),d(async S=>{await w.add(S)}),h(async S=>{await I.add(S),await T.add(S)}),g(async()=>{await I.add(Ov)}),Ht(()=>{C.value=!1}),(S,G)=>(de(),xe("div",YI,[K("div",KI,[Y(n)==="2d"?(de(),lt(X1,{key:0,ref_key:"live2DViewerRef",ref:e,"mouth-open-size":Y(a),model:"./assets/live2d/models/hiyori_pro_zh.zip","min-w":"50% =a.value&&(v.value+=a.value),n.value&&(n.value.style.transform=`translateX(${v.value}px)`),h=requestAnimationFrame(p)}return Ge(()=>[e.height,e.amplitude,e.waveLength,e.fillColor,e.direction],()=>{o.value=e.height,s.value=e.amplitude,a.value=e.waveLength,u.value=e.fillColor,c.value=e.direction,d()},{immediate:!0}),av("resize",d),$t(()=>{d(),p()}),Ht(()=>{cancelAnimationFrame(h)}),(m,y)=>(de(),xe("div",sM,[ut(m.$slots,"default"),K("div",{ref_key:"container",ref:t,absolute:"","left-0":"","right-0":"","top-0":"","w-full":"","overflow-hidden":""},[c.value==="down"?(de(),xe("div",{key:0,style:Zr({backgroundColor:u.value,height:`${o.value}px`}),"w-full":""},null,4)):tt("",!0),(de(),xe("svg",{ref_key:"svg",ref:n,width:a.value*Math.ceil(i.value*2/a.value),height:o.value,viewBox:`0 0 ${a.value*Math.ceil(i.value*2/a.value)} ${o.value}`,xmlns:"http://www.w3.org/2000/svg",h:"[100%]",w:"[200%]",style:{willChange:"transform"}},[K("path",{d:l.value,fill:u.value},null,8,lM)],8,aM)),c.value==="up"?(de(),xe("div",{key:1,style:Zr({backgroundColor:u.value,height:`${o.value}px`}),"w-full":""},null,4)):tt("",!0)],512)]))}}),cM={flex:"~","gap-2":""},fM={flex:"~ row",bg:"zinc-100 dark:zinc-700",text:"sm zinc-400 dark:zinc-500","appearance-none":"","gap-1":"","rounded-lg":"","rounded-md":"","border-none":"","p-1":""},hM=["checked","aria-checked"],dM=["checked","aria-checked"],pM={relative:""},mM={flex:"~ row",bg:"zinc-100 dark:zinc-700",text:"sm zinc-400 dark:zinc-500","h-fit":"","w-fit":"","appearance-none":"","gap-1":"","rounded-lg":"","rounded-md":"","border-none":"","p-1":""},gM=["checked","aria-checked"],vM={key:0,w:"120 y.id===p.value);if(!m){l.value=void 0;return}l.value=m}function g(v){const p=v.target.value;switch(t.value){case"en":case"en-US":f.value=p;break;case"zh":case"zh-CN":case"zh-TW":case"zh-HK":f.value=p;break;case"jp":case"jp-JP":d.value=p;break}}return Ge([u,c],async([v,p])=>{if(!v||!p){s.value=[];return}s.value=await a(v,p)}),$t(async()=>{!u.value||!c.value||(s.value=await a(u.value,c.value))}),(v,p)=>(de(),xe("div",cM,[K("fieldset",fM,[K("label",{"h-fit":"","cursor-pointer":"",class:Jt([Y(n).stageView==="2d"?"bg-zinc-300 text-zinc-900 dark:bg-zinc-200 dark:text-zinc-800":""]),"rounded-md":"","px-4":"","py-2":""},[dt(K("input",{"onUpdate:modelValue":p[0]||(p[0]=m=>Y(n).stageView=m),checked:Y(n).stageView==="2d","aria-checked":Y(n).stageView==="2d",name:"settings.stageView",type:"radio",role:"radio",value:"2d",hidden:"","appearance-none":"","outline-none":""},null,8,hM),[[Ti,Y(n).stageView]]),K("div",{"select-none":"",class:Jt([Y(n).stageView==="2d"?"font-semibold":""])}," 2D ",2)],2),K("label",{"h-fit":"","cursor-pointer":"",class:Jt([Y(n).stageView==="3d"?"bg-zinc-300 text-zinc-900 dark:bg-zinc-200 dark:text-zinc-800":""]),"rounded-md":"","px-4":"","py-2":""},[dt(K("input",{"onUpdate:modelValue":p[1]||(p[1]=m=>Y(n).stageView=m),checked:Y(n).stageView==="3d","aria-checked":Y(n).stageView==="3d",name:"stageView",type:"radio",role:"radio",value:"3d",hidden:"","appearance-none":"","outline-none":""},null,8,dM),[[Ti,Y(n).stageView]]),K("div",{"select-none":"",class:Jt([Y(n).stageView==="3d"?"font-semibold":""])}," 3D ",2)],2)]),K("div",pM,[K("div",mM,[K("label",{"h-fit":"","cursor-pointer":"",class:Jt([i.value?"bg-zinc-300 text-zinc-900 dark:bg-zinc-200 dark:text-zinc-800":""]),transition:"all ease-in-out duration-500","rounded-md":"","px-2":"","py-2":""},[dt(K("input",{"onUpdate:modelValue":p[2]||(p[2]=m=>i.value=m),checked:i.value,"aria-checked":i.value,name:"stageView",type:"checkbox",hidden:"","appearance-none":"","outline-none":""},null,8,gM),[[Kr,i.value]]),p[8]||(p[8]=K("div",{"select-none":""},[K("div",{"i-solar:settings-minimalistic-bold-duotone":"",text:"text-zinc-900 dark:text-zinc-800 lg"})],-1))],2)]),Fe(Y(ss),null,{default:Ue(()=>[i.value?(de(),xe("div",vM,[K("div",yM,[K("span",null,we(Y(e)("settings.openai-base-url.label")),1)]),K("div",_M,[dt(K("input",{"onUpdate:modelValue":p[3]||(p[3]=m=>Y(n).openAiApiBaseURL=m),type:"text",placeholder:Y(e)("settings.openai-base-url.placeholder"),bg:"zinc-200 dark:zinc-800/50","w-full":"","rounded-md":"","px-2":"","py-1":"","font-mono":"","outline-none":""},null,8,xM),[[jr,Y(n).openAiApiBaseURL]])]),K("div",bM,[K("span",null,we(Y(e)("settings.openai-api-key.label")),1)]),K("div",wM,[dt(K("input",{"onUpdate:modelValue":p[4]||(p[4]=m=>Y(n).openAiApiKey=m),type:"text",placeholder:Y(e)("settings.openai-api-key.placeholder"),bg:"zinc-200 dark:zinc-800/50","w-full":"","rounded-md":"","px-2":"","py-1":"","font-mono":"","outline-none":""},null,8,TM),[[jr,Y(n).openAiApiKey]])]),K("div",SM,[K("span",null,we(Y(e)("settings.elevenlabs-api-key.label")),1)]),K("div",EM,[dt(K("input",{"onUpdate:modelValue":p[5]||(p[5]=m=>Y(n).elevenLabsApiKey=m),type:"text",placeholder:Y(e)("settings.elevenlabs-api-key.placeholder"),bg:"zinc-200 dark:zinc-800/50","w-full":"","rounded-md":"","px-2":"","py-1":"","font-mono":"","outline-none":""},null,8,AM),[[jr,Y(n).elevenLabsApiKey]])]),K("div",CM,[K("span",null,we(Y(e)("settings.language.title")),1)]),K("div",IM,[dt(K("select",{"onUpdate:modelValue":p[6]||(p[6]=m=>Y(n).language=m),bg:"zinc-200 dark:zinc-800/50","w-full":"","rounded-md":"","px-2":"","py-1":"","font-mono":"","outline-none":""},[K("option",MM,we(v.$t("settings.language.english")),1),K("option",kM,we(v.$t("settings.language.chinese")),1)],512),[[Vd,Y(n).language]])]),K("div",PM,[K("span",null,we(Y(e)("settings.models")),1)]),K("div",RM,[K("select",{bg:"zinc-200 dark:zinc-800/50","w-full":"","rounded-md":"","px-2":"","py-1":"","font-mono":"","outline-none":"",onChange:h},[K("option",OM,we(Y(e)("stage.select-a-model")),1),Y(n).openAiModel?(de(),xe("option",{key:0,value:Y(n).openAiModel.id},we("name"in Y(n).openAiModel?`${Y(n).openAiModel.name} (${Y(n).openAiModel.id})`:Y(n).openAiModel.id),9,FM)):tt("",!0),(de(!0),xe(zn,null,vr(s.value,m=>(de(),xe("option",{key:m.id,value:m.id},we("name"in m?`${m.name} (${m.id})`:m.id),9,LM))),128))],32)]),K("div",NM,[K("span",null,we(Y(e)("settings.voices")),1)]),K("div",DM,[K("select",{bg:"zinc-200 dark:zinc-800/50","w-full":"","rounded-md":"","px-2":"","py-1":"","font-mono":"","outline-none":"",onChange:g},[K("option",BM,we(Y(e)("stage.select-a-voice")),1),["en","en-US"].indexOf(Y(t))!==-1&&Y(f)?(de(),xe("option",{key:0,value:Y(f)},we(Y(f)),9,UM)):tt("",!0),["zh","zh-CN","zh-TW","zh-HK"].indexOf(Y(t))!==-1&&Y(f)?(de(),xe("option",{key:1,value:Y(f)},we(Y(f)),9,zM)):tt("",!0),["jp","jp-JP"].indexOf(Y(t))!==-1&&Y(d)?(de(),xe("option",{key:2,value:Y(d)},we(Y(d)),9,jM)):tt("",!0),(de(!0),xe(zn,null,vr(Y(Gd)[Y(t)],(m,y)=>(de(),xe("option",{key:y,value:m},we(m),9,VM))),128))],32)])])):tt("",!0)]),_:1})]),K("div",null,[K("div",GM,[K("label",$M,[dt(K("input",{"onUpdate:modelValue":p[7]||(p[7]=m=>mu(o)?o.value=m:null),checked:Y(o),"aria-checked":Y(o),name:"stageView",type:"checkbox",hidden:"","appearance-none":"","outline-none":""},null,8,HM),[[Kr,Y(o)]]),K("div",XM,[Fe(Zo,{name:"slide-away",mode:"out-in"},{default:Ue(()=>[Y(o)?(de(),xe("div",WM)):(de(),xe("div",qM))]),_:1})])])])])]))}}),KM={"mb-1":"","w-full":"","gap-2":""},ZM=De({__name:"Header",setup(r){return(e,t)=>(de(),xe("header",KM,[t[0]||(t[0]=K("a",{href:"https://github.com/moeru-ai/airi",rel:"noreferrer noopener",target:"_blank",flex:"~ 1","w-full":"","items-center":"","gap-2":"","px-2":"","text-nowrap":"","text-2xl":""},[K("div",{"i-solar:cat-outline":"",text:"[#ed869d]"}),K("div",{"font-cute":""},[K("span",null,"アイリ")])],-1)),Fe(YM)]))}});function Ym(r,e){const t=$d(e??{},{...Sc.getDefaultRealTimeVADOptions("v5"),preSpeechPadFrames:30,positiveSpeechThreshold:.5,negativeSpeechThreshold:.35,minSpeechFrames:30,auto:!0}),n=le(),i=lv("microphone");async function o(){if(n.value&&(n.value.destroy(),n.value=void 0,console.warn("existing MicVAD destroyed")),!i.value)return;const s=Y(r);if(!s)return;const a=await navigator.mediaDevices.getUserMedia({audio:{deviceId:s}});n.value=await Sc.MicVAD.new({...t,stream:a}),t.auto&&n.value.start()}return Ge(i,o,{immediate:!0}),Ge(uv(r),o,{immediate:!0}),cv(o),Ht(()=>{n.value&&(n.value.destroy(),n.value=void 0)}),{destroy:()=>{n.value&&(n.value.destroy(),n.value=void 0)},start:()=>{n.value&&n.value.start()}}}function JM(r,e){const t=$d(e,{onLoading:()=>{},onInitiate:()=>{},onProgress:()=>{},onDone:()=>{},onReady:()=>{},onStart:()=>{},onUpdate:()=>{},onComplete:()=>{}}),{post:n,data:i,terminate:o}=fv(r,{type:"module"}),s=le(null),a=le(""),l=le([]),u=le(!1),c=le(0),f=le("");return Ge(i,d=>{var h,g,v,p,m,y,_,C;switch(d.status){case"loading":s.value="loading",a.value=d.data,(h=t.onLoading)==null||h.call(t,d.data);break;case"initiate":l.value.push(d),(g=t.onInitiate)==null||g.call(t,d);break;case"progress":l.value=l.value.map(b=>b.file===d.file?{...b,...d}:b),(v=t.onProgress)==null||v.call(t,d);break;case"done":l.value=l.value.filter(b=>b.file!==d.file),(p=t.onDone)==null||p.call(t,d);break;case"ready":s.value="ready",(m=t.onReady)==null||m.call(t);break;case"start":u.value=!0,(y=t.onStart)==null||y.call(t);break;case"update":c.value=d.tps,(_=t.onUpdate)==null||_.call(t,d.tps);break;case"complete":u.value=!1,f.value=d.output[0]||"",console.debug("Whisper result:",f.value),(C=t.onComplete)==null||C.call(t,d.output[0]);break}}),Ht(()=>{o()}),{transcribe:d=>n(d),status:s,loadingMessage:a,loadingProgress:l,transcribing:u,tps:c,result:f,load:()=>n({type:"load"}),terminate:o}}const QM="/assets/worker-Dc_51xfg.js";async function ek(r,e){const t=new ArrayBuffer(44+r.length*2),n=new DataView(t);mo(n,0,"RIFF"),n.setUint32(4,36+r.length*2,!0),mo(n,8,"WAVE"),mo(n,12,"fmt "),n.setUint32(16,16,!0),n.setUint16(20,1,!0),n.setUint16(22,1,!0),n.setUint32(24,e,!0),n.setUint32(28,e*2,!0),n.setUint16(32,2,!0),n.setUint16(34,16,!0),mo(n,36,"data"),n.setUint32(40,r.length*2,!0),tk(n,44,r);const i=new Blob([n],{type:"audio/wav"});return new Promise((o,s)=>{const a=new FileReader;a.onload=()=>{const l=a.result.split(",")[1];o(l)},a.onerror=s,a.readAsDataURL(i)})}function mo(r,e,t){for(let n=0;n{en().then(()=>{n.update(),i.value=n.height.value})}),a(async()=>{en().then(()=>{n.update(),i.value=n.height.value})}),(l,u)=>{const c=Xd("auto-animate");return de(),xe("div",nk,[u[1]||(u[1]=K("div",{"flex-1":""},null,-1)),dt((de(),xe("div",{ref_key:"chatHistoryRef",ref:e,"h-full":"","w-full":"",flex:"~ col","overflow-scroll":""},[u[0]||(u[0]=K("div",{"flex-1":""},null,-1)),(de(!0),xe(zn,null,vr(Y(t),(f,d)=>(de(),xe("div",{key:d,"mb-2":""},[f.role==="assistant"?(de(),xe("div",rk,[K("div",ik,[K("div",null,[K("span",ok,we(l.$t("stage.chat.message.character-name.airi")),1)]),f.content?(de(),xe("div",{key:0,class:"markdown-content",text:"base {await u(w)}});async function m(){await u(e.value)}const{destroy:y,start:_}=Ym(l,{onSpeechStart:()=>{t.value=!0},onVADMisfire:()=>{t.value=!1},onSpeechEnd:w=>{t.value=!1,b(w)},auto:!1});function C(){v.value!=="loading"&&(g(),_())}async function b(w){await f.resume();const M=await ek(w,f.sampleRate);h({type:"generate",data:{audio:M,language:"en"}})}async function x(w){const M=w.target,T=o.value.find(I=>I.deviceId===M.value);if(!T){s.value=void 0;return}s.value=T}return Ge(a,async w=>{w==="false"&&(y(),p())}),c(async()=>{e.value=""}),(w,M)=>(de(),xe("div",pk,[K("fieldset",mk,[K("label",{class:Jt([n.value==="chat"?"bg-pink-100 dark:bg-[#3c2632]":"bg-white dark:bg-[#121212]",n.value==="chat"?"text-pink-500 dark:text-pink-500":""]),flex:"~ row",checked:n.value==="chat","aria-checked":n.value==="chat",border:"solid l-2 t-2 b-2 pink-100 dark:[#3c2632]",bg:"hover:pink-100 dark:hover:[#3c2632]",text:"pink-300 hover:pink-500 dark:pink-300/50 dark:hover:pink-500",transition:"all duration-250 ease-in-out","cursor-pointer":"","items-center":"","gap-1":"","rounded-l-lg":"","px-2":""},[dt(K("input",{"onUpdate:modelValue":M[0]||(M[0]=T=>n.value=T),type:"radio",name:"tab",value:"chat",hidden:""},null,512),[[Ti,n.value]]),M[5]||(M[5]=K("div",{"i-solar:dialog-2-bold-duotone":"",text:"2xl",transform:"translate-y--2"},null,-1)),K("div",vk,[K("span",yk,we(w.$t("stage.chat.tabs.chat")),1)])],10,gk),K("label",{class:Jt([n.value==="custom"?"bg-pink-100 dark:bg-[#3c2632]":"bg-white dark:bg-[#121212]",n.value==="custom"?"text-pink-500 dark:text-pink-500":""]),flex:"~ row",checked:n.value==="custom","aria-checked":n.value==="custom",border:"solid t-2 b-2 pink-100 dark:[#3c2632]",bg:"hover:pink-100 dark:hover:[#3c2632]",text:"pink-300 hover:pink-500 dark:pink-300/50 dark:hover:pink-500",transition:"all duration-250 ease-in-out","cursor-pointer":"","items-center":"","gap-1":"","px-2":""},[dt(K("input",{"onUpdate:modelValue":M[1]||(M[1]=T=>n.value=T),type:"radio",name:"tab",value:"custom",hidden:""},null,512),[[Ti,n.value]]),M[6]||(M[6]=K("div",{"i-solar:star-fall-2-bold-duotone":"",text:"2xl",transform:"translate-y--2"},null,-1)),K("div",xk,[K("span",null,we(w.$t("stage.chat.tabs.custom")),1)])],10,_k),K("label",{class:Jt([n.value==="clothes"?"bg-pink-100 dark:bg-[#3c2632]":"bg-white dark:bg-[#121212]",n.value==="clothes"?"text-pink-500 dark:text-pink-500":""]),flex:"~ row",checked:n.value==="clothes","aria-checked":n.value==="clothes",border:"solid r-2 t-2 b-2 pink-100 dark:[#3c2632]",bg:"hover:pink-100 dark:hover:[#3c2632]",text:"pink-300 hover:pink-500 dark:pink-300/50 dark:hover:pink-500",transition:"all duration-250 ease-in-out","cursor-pointer":"","items-center":"","gap-1":"","rounded-r-lg":"","px-2":""},[dt(K("input",{"onUpdate:modelValue":M[2]||(M[2]=T=>n.value=T),type:"radio",name:"tab",value:"clothes",hidden:""},null,512),[[Ti,n.value]]),M[7]||(M[7]=K("div",{"i-solar:magic-stick-3-bold-duotone":"",text:"2xl",transform:"translate-y--2"},null,-1)),K("div",wk,[K("span",null,we(w.$t("stage.chat.tabs.clothes")),1)])],10,bk)]),K("div",Tk,[K("div",Sk,[Fe(dk,{"h-full":"","flex-1":"","p-4":"",w:"full","max-h":"e.value=T),placeholder:Y(d)("stage.message"),text:"pink-300 hover:pink-500 dark:pink-300/50 dark:hover:pink-500 placeholder:pink-300 placeholder:hover:pink-500 placeholder:dark:pink-300/50 placeholder:dark:hover:pink-500",bg:"pink-100 dark:pink-400/20","min-h":"[100px]","w-full":"","rounded-t-xl":"","p-4":"","font-medium":"","outline-none":"",transition:"all duration-250 ease-in-out placeholder:all placeholder:duration-250 placeholder:ease-in-out",onSubmit:m},null,8,["modelValue","placeholder"])])])]),K("div",Ak,[K("button",{bg:"cyan-100 hover:cyan-200 dark:cyan-800 dark:hover:cyan-700",transition:"all duration-250 ease-in-out",text:"cyan-400","mb-6":"",flex:"","cursor-pointer":"","items-center":"","justify-center":"","gap-2":"","rounded-full":"","px-4":"","py-2":"",onClick:C},[Fe(Zo,{mode:"out-in"},{default:Ue(()=>[Y(v)===null?(de(),xe("div",Ck,we(w.$t("stage.operations.load-models")),1)):Y(v)==="loading"?(de(),xe("div",Ik,[M[8]||(M[8]=K("div",{"i-svg-spinners:bouncing-ball":"",class:"text-cyan"},null,-1)),K("span",null,we(w.$t("stage.operations.load-models-status.loading")),1)])):Y(v)==="ready"?(de(),xe("div",Mk,[M[9]||(M[9]=K("div",{"i-lucide:check":"",class:"text-cyan"},null,-1)),K("span",null,we(w.$t("stage.operations.load-models-status.ready")),1)])):tt("",!0)]),_:1})]),K("div",kk,[Fe(Y(ss),null,{default:Ue(()=>[i.value?(de(),xe("fieldset",Pk,[(de(!0),xe(zn,null,vr(Y(o),(T,I)=>(de(),xe("label",{key:I,class:"[&_div_span]:dark:hover:bg-cyan-300 [&_div_span]:dark:hover:bg-cyan-900"},[K("input",{type:"radio",name:"audioInput",value:T.deviceId,hidden:"",onChange:x},null,40,Rk),K("div",Ok,[K("div",Fk,[T.deviceId===Y(l)?(de(),xe("div",Lk)):tt("",!0)]),K("span",{"inline-block":"",class:Jt([T.deviceId===Y(l)?"cyan-400 dark:text-white":"cyan-400/50 dark:text-white/50"]),transition:"all duration-250 ease-in-out"},we(T.label),3)])]))),128))])):tt("",!0)]),_:1}),K("label",Nk,[dt(K("input",{"onUpdate:modelValue":M[4]||(M[4]=T=>i.value=T),type:"checkbox",hidden:""},null,512),[[Kr,i.value]]),M[10]||(M[10]=K("div",{"i-solar:microphone-2-bold-duotone":""},null,-1)),K("div",null,[t.value?(de(),xe("span",Bk,"Listening...")):(de(),xe("span",Dk,we(w.$t("settings.microphone")),1))])])])])]))}}),zk=Qo(Uk,[["__scopeId","data-v-1e87e6ee"]]),jk={},Vk={"mb-1":"","w-full":"","gap-2":""};function Gk(r,e){return de(),xe("header",Vk,e[0]||(e[0]=[K("div",{flex:"~ 1","w-full":"","items-center":"","justify-center":"","gap-2":"","px-2":"","text-nowrap":"","text-lg":""},[K("div",{"i-solar:cat-outline":"",text:"[#ed869d]"}),K("div",{"font-cute":""},[K("span",null,"アイリ")])],-1)]))}const $k=Qo(jk,[["render",Gk]]);function oc(r,e){const t=typeof r=="string"&&!e?`${r}Context`:e,n=Symbol(t);return[i=>{const o=vv(n,i);if(o||o===null)return o;throw new Error(`Injection \`${n.toString()}\` not found. Component must be used within ${Array.isArray(r)?`one of the following components: ${r.join(", ")}`:`\`${r}\``}`)},i=>(yv(n,i),i)]}function Km(r,e,t){const n=t.originalEvent.target,i=new CustomEvent(r,{bubbles:!1,cancelable:!0,detail:t});e&&n.addEventListener(r,e,{once:!0}),n.dispatchEvent(i)}function Zm(r){return Rd()?(Od(r),!0):!1}function Hk(r){let e=!1,t;const n=qd(!0);return(...i)=>(e||(t=n.run(()=>r(...i)),e=!0),t)}function Xk(r){let e=0,t,n;const i=()=>{e-=1,n&&e<=0&&(n.stop(),t=void 0,n=void 0)};return(...o)=>(e+=1,t||(n=qd(!0),t=n.run(()=>r(...o))),Zm(i),t)}function sc(r){return typeof r=="function"?r():Y(r)}const Sr=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const Wk=r=>typeof r<"u",qk=Object.prototype.toString,Yk=r=>qk.call(r)==="[object Object]",Kk=()=>{},pd=Zk();function Zk(){var r,e;return Sr&&((r=window==null?void 0:window.navigator)==null?void 0:r.userAgent)&&(/iP(?:ad|hone|od)/.test(window.navigator.userAgent)||((e=window==null?void 0:window.navigator)==null?void 0:e.maxTouchPoints)>2&&/iPad|Macintosh/.test(window==null?void 0:window.navigator.userAgent))}function Jk(r){return xr()}function Qk(r,e){Jk()&&Yd(r,e)}function cs(r){var e;const t=sc(r);return(e=t==null?void 0:t.$el)!=null?e:t}const ac=Sr?window:void 0;function Jm(...r){let e,t,n,i;if(typeof r[0]=="string"||Array.isArray(r[0])?([t,n,i]=r,e=ac):[e,t,n,i]=r,!e)return Kk;Array.isArray(t)||(t=[t]),Array.isArray(n)||(n=[n]);const o=[],s=()=>{o.forEach(c=>c()),o.length=0},a=(c,f,d,h)=>(c.addEventListener(f,d,h),()=>c.removeEventListener(f,d,h)),l=Ge(()=>[cs(e),sc(i)],([c,f])=>{if(s(),!c)return;const d=Yk(f)?{...f}:f;o.push(...t.flatMap(h=>n.map(g=>a(c,h,g,d))))},{immediate:!0,flush:"post"}),u=()=>{l(),s()};return Zm(u),u}function eP(r){return typeof r=="function"?r:typeof r=="string"?e=>e.key===r:Array.isArray(r)?e=>r.includes(e.key):()=>!0}function tP(...r){let e,t,n={};r.length===3?(e=r[0],t=r[1],n=r[2]):r.length===2?typeof r[1]=="object"?(e=!0,t=r[0],n=r[1]):(e=r[0],t=r[1]):(e=!0,t=r[0]);const{target:i=ac,eventName:o="keydown",passive:s=!1,dedupe:a=!1}=n,l=eP(e);return Jm(i,o,u=>{u.repeat&&sc(a)||l(u)&&t(u)},s)}function nP(){const r=le(!1),e=xr();return e&&$t(()=>{r.value=!0},e),r}function rP(r){return JSON.parse(JSON.stringify(r))}function iP(r,e,t,n={}){var i,o,s;const{clone:a=!1,passive:l=!1,eventName:u,deep:c=!1,defaultValue:f,shouldEmit:d}=n,h=xr(),g=t||(h==null?void 0:h.emit)||((i=h==null?void 0:h.$emit)==null?void 0:i.bind(h))||((s=(o=h==null?void 0:h.proxy)==null?void 0:o.$emit)==null?void 0:s.bind(h==null?void 0:h.proxy));let v=u;v=v||`update:${e.toString()}`;const p=_=>a?typeof a=="function"?a(_):rP(_):_,m=()=>Wk(r[e])?p(r[e]):f,y=_=>{d?d(_)&&g(v,_):g(v,_)};if(l){const _=m(),C=le(_);let b=!1;return Ge(()=>r[e],x=>{b||(b=!0,C.value=p(x),en(()=>b=!1))}),Ge(C,x=>{!b&&(x!==r[e]||c)&&y(x)},{deep:c}),C}else return Ve({get(){return m()},set(_){y(_)}})}function lc(r){return r?r.flatMap(e=>e.type===zn?lc(e.children):[e]):[]}function Xa(r){if(r===null||typeof r!="object")return!1;const e=Object.getPrototypeOf(r);return e!==null&&e!==Object.prototype&&Object.getPrototypeOf(e)!==null||Symbol.iterator in r?!1:Symbol.toStringTag in r?Object.prototype.toString.call(r)==="[object Module]":!0}function lu(r,e,t=".",n){if(!Xa(e))return lu(r,{},t);const i=Object.assign({},e);for(const o in r){if(o==="__proto__"||o==="constructor")continue;const s=r[o];s!=null&&(Array.isArray(s)&&Array.isArray(i[o])?i[o]=[...s,...i[o]]:Xa(s)&&Xa(i[o])?i[o]=lu(s,i[o],(t?`${t}.`:"")+o.toString()):i[o]=s)}return i}function oP(r){return(...e)=>e.reduce((t,n)=>lu(t,n,""),{})}const sP=oP(),[Qm,mO]=oc("ConfigProvider");let aP="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",lP=(r=21)=>{let e="",t=r;for(;t--;)e+=aP[Math.random()*64|0];return e};const uP=Xk(()=>{const r=le(new Map),e=le(),t=Ve(()=>{for(const s of r.value.values())if(s)return!0;return!1}),n=Qm({scrollBody:le(!0)});let i=null;const o=()=>{document.body.style.paddingRight="",document.body.style.marginRight="",document.body.style.pointerEvents="",document.body.style.removeProperty("--scrollbar-width"),document.body.style.overflow=e.value??"",pd&&(i==null||i()),e.value=void 0};return Ge(t,(s,a)=>{var l;if(!Sr)return;if(!s){a&&o();return}e.value===void 0&&(e.value=document.body.style.overflow);const u=window.innerWidth-document.documentElement.clientWidth,c={padding:u,margin:0},f=(l=n.scrollBody)!=null&&l.value?typeof n.scrollBody.value=="object"?sP({padding:n.scrollBody.value.padding===!0?u:n.scrollBody.value.padding,margin:n.scrollBody.value.margin===!0?u:n.scrollBody.value.margin},c):c:{padding:0,margin:0};u>0&&(document.body.style.paddingRight=typeof f.padding=="number"?`${f.padding}px`:String(f.padding),document.body.style.marginRight=typeof f.margin=="number"?`${f.margin}px`:String(f.margin),document.body.style.setProperty("--scrollbar-width",`${u}px`),document.body.style.overflow="hidden"),pd&&(i=Jm(document,"touchmove",d=>fP(d),{passive:!1})),en(()=>{document.body.style.pointerEvents="none",document.body.style.overflow="hidden"})},{immediate:!0,flush:"sync"}),r});function cP(r){const e=lP(6),t=uP();t.value.set(e,r);const n=Ve({get:()=>t.value.get(e)??!1,set:i=>t.value.set(e,i)});return Qk(()=>{t.value.delete(e)}),n}function eg(r){const e=window.getComputedStyle(r);if(e.overflowX==="scroll"||e.overflowY==="scroll"||e.overflowX==="auto"&&r.clientWidth1?!0:(e.preventDefault&&e.cancelable&&e.preventDefault(),!1)}function uc(r){const e=xr(),t=e==null?void 0:e.type.emits,n={};return t!=null&&t.length||console.warn(`No emitted event found. Please check component: ${e==null?void 0:e.type.__name}`),t==null||t.forEach(i=>{n[_v(xv(i))]=(...o)=>r(i,...o)}),n}function Cn(){const r=xr(),e=le(),t=Ve(()=>{var s,a;return["#text","#comment"].includes((s=e.value)==null?void 0:s.$el.nodeName)?(a=e.value)==null?void 0:a.$el.nextElementSibling:cs(e)}),n=Object.assign({},r.exposed),i={};for(const s in r.props)Object.defineProperty(i,s,{enumerable:!0,configurable:!0,get:()=>r.props[s]});if(Object.keys(n).length>0)for(const s in n)Object.defineProperty(i,s,{enumerable:!0,configurable:!0,get:()=>n[s]});Object.defineProperty(i,"$el",{enumerable:!0,configurable:!0,get:()=>r.vnode.el}),r.exposed=i;function o(s){e.value=s,!(s instanceof Element||!s)&&(Object.defineProperty(i,"$el",{enumerable:!0,configurable:!0,get:()=>s.$el}),r.exposed=i)}return{forwardRef:o,currentRef:e,currentElement:t}}var hP=function(r){if(typeof document>"u")return null;var e=Array.isArray(r)?r[0]:r;return e.ownerDocument.body},Lr=new WeakMap,go=new WeakMap,vo={},Wa=0,tg=function(r){return r&&(r.host||tg(r.parentNode))},dP=function(r,e){return e.map(function(t){if(r.contains(t))return t;var n=tg(t);return n&&r.contains(n)?n:(console.error("aria-hidden",t,"in not contained inside",r,". Doing nothing"),null)}).filter(function(t){return!!t})},pP=function(r,e,t,n){var i=dP(e,Array.isArray(r)?r:[r]);vo[t]||(vo[t]=new WeakMap);var o=vo[t],s=[],a=new Set,l=new Set(i),u=function(f){!f||a.has(f)||(a.add(f),u(f.parentNode))};i.forEach(u);var c=function(f){!f||l.has(f)||Array.prototype.forEach.call(f.children,function(d){if(a.has(d))c(d);else try{var h=d.getAttribute(n),g=h!==null&&h!=="false",v=(Lr.get(d)||0)+1,p=(o.get(d)||0)+1;Lr.set(d,v),o.set(d,p),s.push(d),v===1&&g&&go.set(d,!0),p===1&&d.setAttribute(t,"true"),g||d.setAttribute(n,"true")}catch(m){console.error("aria-hidden: cannot operate on ",d,m)}})};return c(e),a.clear(),Wa++,function(){s.forEach(function(f){var d=Lr.get(f)-1,h=o.get(f)-1;Lr.set(f,d),o.set(f,h),d||(go.has(f)||f.removeAttribute(n),go.delete(f)),h||f.removeAttribute(t)}),Wa--,Wa||(Lr=new WeakMap,Lr=new WeakMap,go=new WeakMap,vo={})}},mP=function(r,e,t){t===void 0&&(t="data-aria-hidden");var n=Array.from(Array.isArray(r)?r:[r]),i=hP(r);return i?(n.push.apply(n,Array.from(i.querySelectorAll("[aria-live]"))),pP(n,i,t,"aria-hidden")):function(){return null}};function gP(r){let e;Ge(()=>cs(r),t=>{t?e=mP(t):e&&e()}),Ht(()=>{e&&e()})}function uu(r,e="radix"){return Qm({useId:void 0}),`${e}-${mv()}`}function vP(r,e){const t=le(r);function n(i){return e[t.value][i]??t.value}return{state:t,dispatch:i=>{t.value=n(i)}}}const yP=De({name:"PrimitiveSlot",inheritAttrs:!1,setup(r,{attrs:e,slots:t}){return()=>{var n,i;if(!t.default)return null;const o=lc(t.default()),s=o.findIndex(c=>c.type!==bv);if(s===-1)return o;const a=o[s];(n=a.props)==null||delete n.ref;const l=a.props?jn(e,a.props):e;e.class&&(i=a.props)!=null&&i.class&&delete a.props.class;const u=wv(a,l);for(const c in l)c.startsWith("on")&&(u.props||(u.props={}),u.props[c]=l[c]);return o.length===1?u:(o[s]=u,o)}}}),fs=De({name:"Primitive",inheritAttrs:!1,props:{asChild:{type:Boolean,default:!1},as:{type:[String,Object],default:"div"}},setup(r,{attrs:e,slots:t}){const n=r.asChild?"template":r.as;return typeof n=="string"&&["area","img","input"].includes(n)?()=>wo(n,e):n!=="template"?()=>wo(r.as,e,{default:t.default}):()=>wo(yP,e,{default:t.default})}});function _P(r,e){var t;const n=le({}),i=le("none"),o=le(r),s=r.value?"mounted":"unmounted";let a;const l=((t=e.value)==null?void 0:t.ownerDocument.defaultView)??ac,{state:u,dispatch:c}=vP(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}}),f=p=>{var m;if(Sr){const y=new CustomEvent(p,{bubbles:!1,cancelable:!1});(m=e.value)==null||m.dispatchEvent(y)}};Ge(r,async(p,m)=>{var y;const _=m!==p;if(await en(),_){const C=i.value,b=yo(e.value);p?(c("MOUNT"),f("enter"),b==="none"&&f("after-enter")):b==="none"||((y=n.value)==null?void 0:y.display)==="none"?(c("UNMOUNT"),f("leave"),f("after-leave")):m&&C!==b?(c("ANIMATION_OUT"),f("leave")):(c("UNMOUNT"),f("after-leave"))}},{immediate:!0});const d=p=>{const m=yo(e.value),y=m.includes(p.animationName),_=u.value==="mounted"?"enter":"leave";if(p.target===e.value&&y&&(f(`after-${_}`),c("ANIMATION_END"),!o.value)){const C=e.value.style.animationFillMode;e.value.style.animationFillMode="forwards",a=l==null?void 0:l.setTimeout(()=>{var b;((b=e.value)==null?void 0:b.style.animationFillMode)==="forwards"&&(e.value.style.animationFillMode=C)})}p.target===e.value&&m==="none"&&c("ANIMATION_END")},h=p=>{p.target===e.value&&(i.value=yo(e.value))},g=Ge(e,(p,m)=>{p?(n.value=getComputedStyle(p),p.addEventListener("animationstart",h),p.addEventListener("animationcancel",d),p.addEventListener("animationend",d)):(c("ANIMATION_END"),l==null||l.clearTimeout(a),m==null||m.removeEventListener("animationstart",h),m==null||m.removeEventListener("animationcancel",d),m==null||m.removeEventListener("animationend",d))},{immediate:!0}),v=Ge(u,()=>{const p=yo(e.value);i.value=u.value==="mounted"?p:"none"});return Ht(()=>{g(),v()}),{isPresent:Ve(()=>["mounted","unmountSuspended"].includes(u.value))}}function yo(r){return r&&getComputedStyle(r).animationName||"none"}const ng=De({name:"Presence",props:{present:{type:Boolean,required:!0},forceMount:{type:Boolean}},slots:{},setup(r,{slots:e,expose:t}){var n;const{present:i,forceMount:o}=Jr(r),s=le(),{isPresent:a}=_P(i,s);t({present:a});let l=e.default({present:a});l=lc(l||[]);const u=xr();if(l&&(l==null?void 0:l.length)>1){const c=(n=u==null?void 0:u.parent)!=null&&n.type.name?`<${u.parent.type.name} />`:"component";throw new Error([`Detected an invalid children for \`${c}\` for \`Presence\` component.`,"","Note: Presence works similarly to `v-if` directly, but it waits for animation/transition to finished before unmounting. So it expect only one direct child of valid VNode type.","You can apply a few solutions:",["Provide a single child element so that `presence` directive attach correctly.","Ensure the first child is an actual element instead of a raw text node or comment node."].map(f=>` - ${f}`).join(` -`)].join(` -`))}return()=>o.value||i.value||a.value?wo(e.default({present:a})[0],{ref:c=>{const f=cs(c);return typeof(f==null?void 0:f.hasAttribute)>"u"||(f!=null&&f.hasAttribute("data-radix-popper-content-wrapper")?s.value=f.firstElementChild:s.value=f),f}}):null}}),[Er,xP]=oc("DialogRoot"),bP=De({inheritAttrs:!1,__name:"DialogRoot",props:{open:{type:Boolean,default:void 0},defaultOpen:{type:Boolean,default:!1},modal:{type:Boolean,default:!0}},emits:["update:open"],setup(r,{emit:e}){const t=r,n=iP(t,"open",e,{defaultValue:t.defaultOpen,passive:t.open===void 0}),i=le(),o=le(),{modal:s}=Jr(t);return xP({open:n,modal:s,openModal:()=>{n.value=!0},onOpenChange:a=>{n.value=a},onOpenToggle:()=>{n.value=!n.value},contentId:"",titleId:"",descriptionId:"",triggerElement:i,contentElement:o}),(a,l)=>ut(a.$slots,"default",{open:Y(n)})}}),wP=De({__name:"DialogTrigger",props:{asChild:{type:Boolean},as:{default:"button"}},setup(r){const e=r,t=Er(),{forwardRef:n,currentElement:i}=Cn();return t.contentId||(t.contentId=uu(void 0,"radix-vue-dialog-content")),$t(()=>{t.triggerElement.value=i.value}),(o,s)=>(de(),lt(Y(fs),jn(e,{ref:Y(n),type:o.as==="button"?"button":void 0,"aria-haspopup":"dialog","aria-expanded":Y(t).open.value||!1,"aria-controls":Y(t).open.value?Y(t).contentId:void 0,"data-state":Y(t).open.value?"open":"closed",onClick:Y(t).onOpenToggle}),{default:Ue(()=>[ut(o.$slots,"default")]),_:3},16,["type","aria-expanded","aria-controls","data-state","onClick"]))}}),TP=De({__name:"Teleport",props:{to:{default:"body"},disabled:{type:Boolean},forceMount:{type:Boolean}},setup(r){const e=nP();return(t,n)=>Y(e)||t.forceMount?(de(),lt(gv,{key:0,to:t.to,disabled:t.disabled},[ut(t.$slots,"default")],8,["to","disabled"])):tt("",!0)}}),SP=De({__name:"DialogPortal",props:{to:{},disabled:{type:Boolean},forceMount:{type:Boolean}},setup(r){const e=r;return(t,n)=>(de(),lt(Y(TP),dv(pv(e)),{default:Ue(()=>[ut(t.$slots,"default")]),_:3},16))}}),EP="dismissableLayer.pointerDownOutside",AP="dismissableLayer.focusOutside";function rg(r,e){const t=e.closest("[data-dismissable-layer]"),n=r.dataset.dismissableLayer===""?r:r.querySelector("[data-dismissable-layer]"),i=Array.from(r.ownerDocument.querySelectorAll("[data-dismissable-layer]"));return!!(t&&n===t||i.indexOf(n){});return hn(s=>{if(!Sr)return;const a=async u=>{const c=u.target;if(e!=null&&e.value){if(rg(e.value,c)){i.value=!1;return}if(u.target&&!i.value){let f=function(){Km(EP,r,d)};const d={originalEvent:u};u.pointerType==="touch"?(n.removeEventListener("click",o.value),o.value=f,n.addEventListener("click",o.value,{once:!0})):f()}else n.removeEventListener("click",o.value);i.value=!1}},l=window.setTimeout(()=>{n.addEventListener("pointerdown",a)},0);s(()=>{window.clearTimeout(l),n.removeEventListener("pointerdown",a),n.removeEventListener("click",o.value)})}),{onPointerDownCapture:()=>i.value=!0}}function IP(r,e){var t;const n=((t=e==null?void 0:e.value)==null?void 0:t.ownerDocument)??(globalThis==null?void 0:globalThis.document),i=le(!1);return hn(o=>{if(!Sr)return;const s=async a=>{e!=null&&e.value&&(await en(),!(!e.value||rg(e.value,a.target))&&a.target&&!i.value&&Km(AP,r,{originalEvent:a}))};n.addEventListener("focusin",s),o(()=>n.removeEventListener("focusin",s))}),{onFocusCapture:()=>i.value=!0,onBlurCapture:()=>i.value=!1}}const _n=Wd({layersRoot:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),MP=De({__name:"DismissableLayer",props:{disableOutsidePointerEvents:{type:Boolean,default:!1},asChild:{type:Boolean},as:{}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","dismiss"],setup(r,{emit:e}){const t=r,n=e,{forwardRef:i,currentElement:o}=Cn(),s=Ve(()=>{var g;return((g=o.value)==null?void 0:g.ownerDocument)??globalThis.document}),a=Ve(()=>_n.layersRoot),l=Ve(()=>o.value?Array.from(a.value).indexOf(o.value):-1),u=Ve(()=>_n.layersWithOutsidePointerEventsDisabled.size>0),c=Ve(()=>{const g=Array.from(a.value),[v]=[..._n.layersWithOutsidePointerEventsDisabled].slice(-1),p=g.indexOf(v);return l.value>=p}),f=CP(async g=>{const v=[..._n.branches].some(p=>p==null?void 0:p.contains(g.target));!c.value||v||(n("pointerDownOutside",g),n("interactOutside",g),await en(),g.defaultPrevented||n("dismiss"))},o),d=IP(g=>{[..._n.branches].some(v=>v==null?void 0:v.contains(g.target))||(n("focusOutside",g),n("interactOutside",g),g.defaultPrevented||n("dismiss"))},o);tP("Escape",g=>{l.value===a.value.size-1&&(n("escapeKeyDown",g),g.defaultPrevented||n("dismiss"))});let h;return hn(g=>{o.value&&(t.disableOutsidePointerEvents&&(_n.layersWithOutsidePointerEventsDisabled.size===0&&(h=s.value.body.style.pointerEvents,s.value.body.style.pointerEvents="none"),_n.layersWithOutsidePointerEventsDisabled.add(o.value)),a.value.add(o.value),g(()=>{t.disableOutsidePointerEvents&&_n.layersWithOutsidePointerEventsDisabled.size===1&&(s.value.body.style.pointerEvents=h)}))}),hn(g=>{g(()=>{o.value&&(a.value.delete(o.value),_n.layersWithOutsidePointerEventsDisabled.delete(o.value))})}),(g,v)=>(de(),lt(Y(fs),{ref:Y(i),"as-child":g.asChild,as:g.as,"data-dismissable-layer":"",style:Zr({pointerEvents:u.value?c.value?"auto":"none":void 0}),onFocusCapture:Y(d).onFocusCapture,onBlurCapture:Y(d).onBlurCapture,onPointerdownCapture:Y(f).onPointerDownCapture},{default:Ue(()=>[ut(g.$slots,"default")]),_:3},8,["as-child","as","style","onFocusCapture","onBlurCapture","onPointerdownCapture"]))}}),qa="focusScope.autoFocusOnMount",Ya="focusScope.autoFocusOnUnmount",md={bubbles:!1,cancelable:!0};function kP(r,{select:e=!1}={}){const t=document.activeElement;for(const n of r)if(Fn(n,{select:e}),document.activeElement!==t)return!0}function PP(r){const e=ig(r),t=gd(e,r),n=gd(e.reverse(),r);return[t,n]}function ig(r){const e=[],t=document.createTreeWalker(r,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const i=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||i?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;t.nextNode();)e.push(t.currentNode);return e}function gd(r,e){for(const t of r)if(!RP(t,{upTo:e}))return t}function RP(r,{upTo:e}){if(getComputedStyle(r).visibility==="hidden")return!0;for(;r;){if(e!==void 0&&r===e)return!1;if(getComputedStyle(r).display==="none")return!0;r=r.parentElement}return!1}function OP(r){return r instanceof HTMLInputElement&&"select"in r}function Fn(r,{select:e=!1}={}){if(r&&r.focus){const t=document.activeElement;r.focus({preventScroll:!0}),r!==t&&OP(r)&&e&&r.select()}}const FP=Hk(()=>le([]));function LP(){const r=FP();return{add(e){const t=r.value[0];e!==t&&(t==null||t.pause()),r.value=vd(r.value,e),r.value.unshift(e)},remove(e){var t;r.value=vd(r.value,e),(t=r.value[0])==null||t.resume()}}}function vd(r,e){const t=[...r],n=t.indexOf(e);return n!==-1&&t.splice(n,1),t}function NP(r){return r.filter(e=>e.tagName!=="A")}const DP=De({__name:"FocusScope",props:{loop:{type:Boolean,default:!1},trapped:{type:Boolean,default:!1},asChild:{type:Boolean},as:{}},emits:["mountAutoFocus","unmountAutoFocus"],setup(r,{emit:e}){const t=r,n=e,{currentRef:i,currentElement:o}=Cn(),s=le(null),a=LP(),l=Wd({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}});hn(c=>{if(!Sr)return;const f=o.value;if(!t.trapped)return;function d(p){if(l.paused||!f)return;const m=p.target;f.contains(m)?s.value=m:Fn(s.value,{select:!0})}function h(p){if(l.paused||!f)return;const m=p.relatedTarget;m!==null&&(f.contains(m)||Fn(s.value,{select:!0}))}function g(p){f.contains(s.value)||Fn(f)}document.addEventListener("focusin",d),document.addEventListener("focusout",h);const v=new MutationObserver(g);f&&v.observe(f,{childList:!0,subtree:!0}),c(()=>{document.removeEventListener("focusin",d),document.removeEventListener("focusout",h),v.disconnect()})}),hn(async c=>{const f=o.value;if(await en(),!f)return;a.add(l);const d=document.activeElement;if(!f.contains(d)){const h=new CustomEvent(qa,md);f.addEventListener(qa,g=>n("mountAutoFocus",g)),f.dispatchEvent(h),h.defaultPrevented||(kP(NP(ig(f)),{select:!0}),document.activeElement===d&&Fn(f))}c(()=>{f.removeEventListener(qa,v=>n("mountAutoFocus",v));const h=new CustomEvent(Ya,md),g=v=>{n("unmountAutoFocus",v)};f.addEventListener(Ya,g),f.dispatchEvent(h),setTimeout(()=>{h.defaultPrevented||Fn(d??document.body,{select:!0}),f.removeEventListener(Ya,g),a.remove(l)},0)})});function u(c){if(!t.loop&&!t.trapped||l.paused)return;const f=c.key==="Tab"&&!c.altKey&&!c.ctrlKey&&!c.metaKey,d=document.activeElement;if(f&&d){const h=c.currentTarget,[g,v]=PP(h);g&&v?!c.shiftKey&&d===v?(c.preventDefault(),t.loop&&Fn(g,{select:!0})):c.shiftKey&&d===g&&(c.preventDefault(),t.loop&&Fn(v,{select:!0})):d===h&&c.preventDefault()}}return(c,f)=>(de(),lt(Y(fs),{ref_key:"currentRef",ref:i,tabindex:"-1","as-child":c.asChild,as:c.as,onKeydown:u},{default:Ue(()=>[ut(c.$slots,"default")]),_:3},8,["as-child","as"]))}});function BP(r){return r?"open":"closed"}const og=De({__name:"DialogContentImpl",props:{forceMount:{type:Boolean},trapFocus:{type:Boolean},disableOutsidePointerEvents:{type:Boolean},asChild:{type:Boolean},as:{}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(r,{emit:e}){const t=r,n=e,i=Er(),{forwardRef:o,currentElement:s}=Cn();return i.titleId||(i.titleId=uu(void 0,"radix-vue-dialog-title")),i.descriptionId||(i.descriptionId=uu(void 0,"radix-vue-dialog-description")),$t(()=>{i.contentElement=s,document.activeElement!==document.body&&(i.triggerElement.value=document.activeElement)}),(a,l)=>(de(),lt(Y(DP),{"as-child":"",loop:"",trapped:t.trapFocus,onMountAutoFocus:l[5]||(l[5]=u=>n("openAutoFocus",u)),onUnmountAutoFocus:l[6]||(l[6]=u=>n("closeAutoFocus",u))},{default:Ue(()=>[Fe(Y(MP),jn({id:Y(i).contentId,ref:Y(o),as:a.as,"as-child":a.asChild,"disable-outside-pointer-events":a.disableOutsidePointerEvents,role:"dialog","aria-describedby":Y(i).descriptionId,"aria-labelledby":Y(i).titleId,"data-state":Y(BP)(Y(i).open.value)},a.$attrs,{onDismiss:l[0]||(l[0]=u=>Y(i).onOpenChange(!1)),onEscapeKeyDown:l[1]||(l[1]=u=>n("escapeKeyDown",u)),onFocusOutside:l[2]||(l[2]=u=>n("focusOutside",u)),onInteractOutside:l[3]||(l[3]=u=>n("interactOutside",u)),onPointerDownOutside:l[4]||(l[4]=u=>n("pointerDownOutside",u))}),{default:Ue(()=>[ut(a.$slots,"default")]),_:3},16,["id","as","as-child","disable-outside-pointer-events","aria-describedby","aria-labelledby","data-state"])]),_:3},8,["trapped"]))}}),UP=De({__name:"DialogContentModal",props:{forceMount:{type:Boolean},trapFocus:{type:Boolean},disableOutsidePointerEvents:{type:Boolean},asChild:{type:Boolean},as:{}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(r,{emit:e}){const t=r,n=e,i=Er(),o=uc(n),{forwardRef:s,currentElement:a}=Cn();return gP(a),(l,u)=>(de(),lt(og,jn({...t,...Y(o)},{ref:Y(s),"trap-focus":Y(i).open.value,"disable-outside-pointer-events":!0,onCloseAutoFocus:u[0]||(u[0]=c=>{var f;c.defaultPrevented||(c.preventDefault(),(f=Y(i).triggerElement.value)==null||f.focus())}),onPointerDownOutside:u[1]||(u[1]=c=>{const f=c.detail.originalEvent,d=f.button===0&&f.ctrlKey===!0;(f.button===2||d)&&c.preventDefault()}),onFocusOutside:u[2]||(u[2]=c=>{c.preventDefault()})}),{default:Ue(()=>[ut(l.$slots,"default")]),_:3},16,["trap-focus"]))}}),zP=De({__name:"DialogContentNonModal",props:{forceMount:{type:Boolean},trapFocus:{type:Boolean},disableOutsidePointerEvents:{type:Boolean},asChild:{type:Boolean},as:{}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(r,{emit:e}){const t=r,n=uc(e);Cn();const i=Er(),o=le(!1),s=le(!1);return(a,l)=>(de(),lt(og,jn({...t,...Y(n)},{"trap-focus":!1,"disable-outside-pointer-events":!1,onCloseAutoFocus:l[0]||(l[0]=u=>{var c;u.defaultPrevented||(o.value||(c=Y(i).triggerElement.value)==null||c.focus(),u.preventDefault()),o.value=!1,s.value=!1}),onInteractOutside:l[1]||(l[1]=u=>{var c;u.defaultPrevented||(o.value=!0,u.detail.originalEvent.type==="pointerdown"&&(s.value=!0));const f=u.target;(c=Y(i).triggerElement.value)!=null&&c.contains(f)&&u.preventDefault(),u.detail.originalEvent.type==="focusin"&&s.value&&u.preventDefault()})}),{default:Ue(()=>[ut(a.$slots,"default")]),_:3},16))}}),jP=De({__name:"DialogContent",props:{forceMount:{type:Boolean},trapFocus:{type:Boolean},disableOutsidePointerEvents:{type:Boolean},asChild:{type:Boolean},as:{}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(r,{emit:e}){const t=r,n=e,i=Er(),o=uc(n),{forwardRef:s}=Cn();return(a,l)=>(de(),lt(Y(ng),{present:a.forceMount||Y(i).open.value},{default:Ue(()=>[Y(i).modal.value?(de(),lt(UP,jn({key:0,ref:Y(s)},{...t,...Y(o),...a.$attrs}),{default:Ue(()=>[ut(a.$slots,"default")]),_:3},16)):(de(),lt(zP,jn({key:1,ref:Y(s)},{...t,...Y(o),...a.$attrs}),{default:Ue(()=>[ut(a.$slots,"default")]),_:3},16))]),_:3},8,["present"]))}}),VP=De({__name:"DialogOverlayImpl",props:{asChild:{type:Boolean},as:{}},setup(r){const e=Er();return cP(!0),Cn(),(t,n)=>(de(),lt(Y(fs),{as:t.as,"as-child":t.asChild,"data-state":Y(e).open.value?"open":"closed",style:{"pointer-events":"auto"}},{default:Ue(()=>[ut(t.$slots,"default")]),_:3},8,["as","as-child","data-state"]))}}),GP=De({__name:"DialogOverlay",props:{forceMount:{type:Boolean},asChild:{type:Boolean},as:{}},setup(r){const e=Er(),{forwardRef:t}=Cn();return(n,i)=>{var o;return(o=Y(e))!=null&&o.modal.value?(de(),lt(Y(ng),{key:0,present:n.forceMount||Y(e).open.value},{default:Ue(()=>[Fe(VP,jn(n.$attrs,{ref:Y(t),as:n.as,"as-child":n.asChild}),{default:Ue(()=>[ut(n.$slots,"default")]),_:3},16,["as","as-child"])]),_:3},8,["present"])):tt("",!0)}}});function $P(){if(typeof matchMedia=="function")return matchMedia("(pointer:coarse)").matches?"coarse":"fine"}$P();(function(){try{if(typeof document<"u"){var r=document.createElement("style");r.appendChild(document.createTextNode('[vaul-drawer]{touch-action:none;will-change:transform;transition:transform .5s cubic-bezier(.32,.72,0,1)}[vaul-drawer][vaul-drawer-direction=bottom]{transform:translate3d(0,100%,0)}[vaul-drawer][vaul-drawer-direction=top]{transform:translate3d(0,-100%,0)}[vaul-drawer][vaul-drawer-direction=left]{transform:translate3d(-100%,0,0)}[vaul-drawer][vaul-drawer-direction=right]{transform:translate3d(100%,0,0)}.vaul-dragging .vaul-scrollable [vault-drawer-direction=top],.vaul-dragging .vaul-scrollable [vault-drawer-direction=bottom]{overflow-y:hidden!important}.vaul-dragging .vaul-scrollable [vault-drawer-direction=left],.vaul-dragging .vaul-scrollable [vault-drawer-direction=right]{overflow-x:hidden!important}[vaul-drawer][vaul-drawer-visible=true][vaul-drawer-direction=top],[vaul-drawer][vaul-drawer-visible=true][vaul-drawer-direction=bottom]{transform:translate3d(0,var(--snap-point-height, 0),0)}[vaul-drawer][vaul-drawer-visible=true][vaul-drawer-direction=left],[vaul-drawer][vaul-drawer-visible=true][vaul-drawer-direction=right]{transform:translate3d(var(--snap-point-height, 0),0,0)}[vaul-overlay]{opacity:0;transition:opacity .5s cubic-bezier(.32,.72,0,1)}[vaul-overlay][vaul-drawer-visible=true]{opacity:1}[vaul-drawer]:after{content:"";position:absolute;background:inherit;background-color:inherit}[vaul-drawer][vaul-drawer-direction=top]:after{top:initial;bottom:100%;left:0;right:0;height:200%}[vaul-drawer][vaul-drawer-direction=bottom]:after{top:100%;bottom:initial;left:0;right:0;height:200%}[vaul-drawer][vaul-drawer-direction=left]:after{left:initial;right:100%;top:0;bottom:0;width:200%}[vaul-drawer][vaul-drawer-direction=right]:after{left:100%;right:initial;top:0;bottom:0;width:200%}[vaul-overlay][vaul-snap-points=true]:not([vaul-snap-points-overlay=true]):not([data-state=closed]){opacity:0}[vaul-overlay][vaul-snap-points-overlay=true]:not([vaul-drawer-visible=false]){opacity:1}@keyframes fake-animation{}@media (hover: hover) and (pointer: fine){[vaul-drawer]{-webkit-user-select:none;user-select:none}}')),document.head.appendChild(r)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();const HP=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const XP=r=>typeof r<"u";function WP(r){return JSON.parse(JSON.stringify(r))}function yd(r,e,t,n={}){var i,o,s;const{clone:a=!1,passive:l=!1,eventName:u,deep:c=!1,defaultValue:f,shouldEmit:d}=n,h=xr(),g=t||(h==null?void 0:h.emit)||((i=h==null?void 0:h.$emit)==null?void 0:i.bind(h))||((s=(o=h==null?void 0:h.proxy)==null?void 0:o.$emit)==null?void 0:s.bind(h==null?void 0:h.proxy));let v=u;e||(e="modelValue"),v=v||`update:${e.toString()}`;const p=_=>a?typeof a=="function"?a(_):WP(_):_,m=()=>XP(r[e])?p(r[e]):f,y=_=>{d?d(_)&&g(v,_):g(v,_)};if(l){const _=m(),C=le(_);let b=!1;return Ge(()=>r[e],x=>{b||(b=!0,C.value=p(x),en(()=>b=!1))}),Ge(C,x=>{!b&&(x!==r[e]||c)&&y(x)},{deep:c}),C}else return Ve({get(){return m()},set(_){y(_)}})}const[sg,qP]=oc("DrawerRoot"),ag=new WeakMap;function rt(r,e,t=!1){if(!r||!(r instanceof HTMLElement)||!e)return;const n={};Object.entries(e).forEach(([i,o])=>{if(i.startsWith("--")){r.style.setProperty(i,o);return}n[i]=r.style[i],r.style[i]=o}),!t&&ag.set(r,n)}function _o(r,e){if(!r||!(r instanceof HTMLElement))return;const t=ag.get(r);t&&(e?r.style[e]=t[e]:Object.entries(t).forEach(([n,i])=>{r.style[n]=i}))}function xo(r,e){const t=window.getComputedStyle(r),n=t.transform||t.webkitTransform||t.mozTransform;let i=n.match(/^matrix3d\((.+)\)$/);return i?Number.parseFloat(i[1].split(", ")[yt(e)?13:12]):(i=n.match(/^matrix\((.+)\)$/),i?Number.parseFloat(i[1].split(", ")[yt(e)?5:4]):null)}function YP(r){return 8*(Math.log(r+1)-2)}function yt(r){switch(r){case"top":case"bottom":return!0;case"left":case"right":return!1;default:return r}}const We={DURATION:.5,EASE:[.32,.72,0,1]},lg=.4;function KP({activeSnapPoint:r,snapPoints:e,drawerRef:t,overlayRef:n,fadeFromIndex:i,onSnapPointChange:o,direction:s}){const a=le(typeof window<"u"?{innerWidth:window.innerWidth,innerHeight:window.innerHeight}:void 0);function l(){a.value={innerWidth:window.innerWidth,innerHeight:window.innerHeight}}$t(()=>{typeof window<"u"&&window.addEventListener("resize",l)}),Yd(()=>{typeof window<"u"&&window.removeEventListener("resize",l)});const u=Ve(()=>(e.value&&r.value===e.value[e.value.length-1])??null),c=Ve(()=>e.value&&e.value.length>0&&((i==null?void 0:i.value)||(i==null?void 0:i.value)===0)&&!Number.isNaN(i==null?void 0:i.value)&&e.value[(i==null?void 0:i.value)??-1]===r.value||!e.value),f=Ve(()=>{var y;return((y=e.value)==null?void 0:y.findIndex(_=>_===r.value))??null}),d=Ve(()=>{var y;return((y=e.value)==null?void 0:y.map(_=>{const C=typeof _=="string";let b=0;if(C&&(b=Number.parseInt(_,10)),yt(s.value)){const w=C?b:a.value?_*a.value.innerHeight:0;return a.value?s.value==="bottom"?a.value.innerHeight-w:-a.value.innerHeight+w:w}const x=C?b:a.value?_*a.value.innerWidth:0;return a.value?s.value==="right"?a.value.innerWidth-x:-a.value.innerWidth+x:x}))??[]}),h=Ve(()=>{var y;return f.value!==null?(y=d.value)==null?void 0:y[f.value]:null}),g=y=>{var _,C,b,x;const w=((_=d.value)==null?void 0:_.findIndex(M=>M===y))??null;en(()=>{var M;o(w,d.value),rt((M=t.value)==null?void 0:M.$el,{transition:`transform ${We.DURATION}s cubic-bezier(${We.EASE.join(",")})`,transform:yt(s.value)?`translate3d(0, ${y}px, 0)`:`translate3d(${y}px, 0, 0)`})}),d.value&&w!==d.value.length-1&&w!==(i==null?void 0:i.value)?rt((C=n.value)==null?void 0:C.$el,{transition:`opacity ${We.DURATION}s cubic-bezier(${We.EASE.join(",")})`,opacity:"0"}):rt((b=n.value)==null?void 0:b.$el,{transition:`opacity ${We.DURATION}s cubic-bezier(${We.EASE.join(",")})`,opacity:"1"}),r.value=w!==null?((x=e.value)==null?void 0:x[w])??null:null};Ge([r,d,e],()=>{var y;if(r.value){const _=((y=e.value)==null?void 0:y.findIndex(C=>C===r.value))??-1;d.value&&_!==-1&&typeof d.value[_]=="number"&&g(d.value[_])}},{immediate:!0});function v({draggedDistance:y,closeDrawer:_,velocity:C,dismissible:b}){var x,w,M;if(i.value===void 0)return;const T=s.value==="bottom"||s.value==="right"?(h.value??0)-y:(h.value??0)+y,I=f.value===i.value-1,F=f.value===0,A=y>0;if(I&&rt((x=n.value)==null?void 0:x.$el,{transition:`opacity ${We.DURATION}s cubic-bezier(${We.EASE.join(",")})`}),C>2&&!A){b?_():g(d.value[0]);return}if(C>2&&A&&d&&e.value){g(d.value[e.value.length-1]);return}const X=(w=d.value)==null?void 0:w.reduce((G,O)=>typeof G!="number"||typeof O!="number"?G:Math.abs(O-T)lg&&Math.abs(y)0&&u){g(d.value[(((M=e.value)==null?void 0:M.length)??0)-1]);return}if(F&&G<0&&b&&_(),f.value===null)return;g(d.value[f.value+G]);return}g(X)}function p({draggedDistance:y}){var _;if(h.value===null)return;const C=s.value==="bottom"||s.value==="right"?h.value-y:h.value+y;(s.value==="bottom"||s.value==="right")&&Cd.value[d.value.length-1]||rt((_=t.value)==null?void 0:_.$el,{transform:yt(s.value)?`translate3d(0, ${C}px, 0)`:`translate3d(${C}px, 0, 0)`})}function m(y,_){if(!e.value||typeof f.value!="number"||!d.value||i.value===void 0)return null;const C=f.value===i.value-1;if(f.value>=i.value&&_)return 0;if(C&&!_)return 1;if(!c.value&&!C)return null;const b=C?f.value+1:f.value-1,x=C?d.value[b]-d.value[b-1]:d.value[b+1]-d.value[b],w=y/Math.abs(x);return C?1-w:w}return{isLastSnapPoint:u,shouldFade:c,getPercentageDragged:m,activeSnapPointIndex:f,onRelease:v,onDrag:p,snapPointsOffset:d}}let mi=null;function ZP(r){const{isOpen:e,modal:t,nested:n,hasBeenOpened:i}=r,o=le(typeof window<"u"?window.location.href:""),s=le(0);function a(){if(mi===null&&e.value){mi={position:document.body.style.position,top:document.body.style.top,left:document.body.style.left,height:document.body.style.height};const{scrollX:u,innerHeight:c}=window;document.body.style.position="fixed",document.body.style.top=`-${s.value}px`,document.body.style.left=`-${u}px`,document.body.style.right="0px",document.body.style.height="auto",setTimeout(()=>{requestAnimationFrame(()=>{const f=c-window.innerHeight;f&&s.value>=c&&(document.body.style.top=`-${s.value+f}px`)})},300)}}function l(){if(mi!==null){const u=-Number.parseInt(document.body.style.top,10),c=-Number.parseInt(document.body.style.left,10);Object.assign(document.body.style,mi),requestAnimationFrame(()=>{if(o.value!==window.location.href){o.value=window.location.href;return}window.scrollTo(c,u)}),mi=null}}return $t(()=>{function u(){s.value=window.scrollY}u(),window.addEventListener("scroll",u),Ht(()=>{window.removeEventListener("scroll",u)})}),Ge([e,i,o],()=>{n.value||!i.value||(e.value?(!window.matchMedia("(display-mode: standalone)").matches&&a(),t.value||setTimeout(()=>{l()},500)):l())}),{restorePositionSetting:l}}const JP=.25,QP=100,_d=8,bo=16,eR=26,xd="vaul-dragging";function tR(r,e){return r&&r.value?r:e}function nR(r){const{emitDrag:e,emitRelease:t,emitClose:n,emitOpenChange:i,open:o,dismissible:s,nested:a,fixed:l,modal:u,shouldScaleBackground:c,scrollLockTimeout:f,closeThreshold:d,activeSnapPoint:h,fadeFromIndex:g,direction:v}=r,p=le(o.value??!1),m=le(!1),y=le(!1),_=le(!1),C=le(!1),b=le(null),x=le(null),w=le(null),M=le(null),T=le(null),I=le(!0),F=le(null),A=le(0),X=le(!1);le(0);const S=le(null);le(0);const G=Ve(()=>{var H;return((H=S.value)==null?void 0:H.$el.getBoundingClientRect().height)||0}),O=tR(r.snapPoints,le(void 0)),{activeSnapPointIndex:D,onRelease:L,snapPointsOffset:$,onDrag:k,shouldFade:N,getPercentageDragged:V}=KP({snapPoints:O,activeSnapPoint:h,drawerRef:S,fadeFromIndex:g,overlayRef:b,onSnapPointChange:P,direction:v});function P(H,j){O.value&&H===j.length-1&&(x.value=new Date)}const{restorePositionSetting:J}=ZP({isOpen:p,modal:u,nested:a,hasBeenOpened:m});function Q(){return(window.innerWidth-eR)/window.innerWidth}function ce(H,j){var z;if(!H)return!1;let q=H;const se=(z=window.getSelection())==null?void 0:z.toString(),ae=S.value?xo(S.value.$el,v.value):null,ee=new Date;if(q.hasAttribute("data-vaul-no-drag")||q.closest("[data-vaul-no-drag]"))return!1;if(v.value==="right"||v.value==="left")return!0;if(x.value&&ee.getTime()-x.value.getTime()<500)return!1;if(ae!==null&&(v.value==="bottom"?ae>0:ae<0))return!0;if(se&&se.length>0)return!1;if(T.value&&ee.getTime()-T.value.getTime()q.clientHeight){if(q.scrollTop!==0)return T.value=new Date,!1;if(q.getAttribute("role")==="dialog")return!0}q=q.parentNode}return!0}function pe(H){!s.value&&!O.value||S.value&&!S.value.$el.contains(H.target)||(_.value=!0,w.value=new Date,H.target.setPointerCapture(H.pointerId),A.value=yt(v.value)?H.clientY:H.clientX)}function te(H){var j,z,q,se,ae,ee;if(S.value&&_.value){const he=v.value==="bottom"||v.value==="right"?1:-1,ye=(A.value-(yt(v.value)?H.clientY:H.clientX))*he,me=ye>0,ne=O.value&&!s.value&&!me;if(ne&&D.value===0)return;const fe=Math.abs(ye),ge=document.querySelector("[vaul-drawer-wrapper]");let be=fe/G.value;const Pe=V(fe,me);if(Pe!==null&&(be=Pe),ne&&be>=1||!I.value&&!ce(H.target,me))return;if((j=S==null?void 0:S.value)==null||j.$el.classList.add(xd),I.value=!0,rt((z=S.value)==null?void 0:z.$el,{transition:"none"}),rt((q=b.value)==null?void 0:q.$el,{transition:"none"}),O.value&&k({draggedDistance:ye}),me&&!O.value){const et=YP(ye),Le=Math.min(et*-1,0)*he;rt((se=S.value)==null?void 0:se.$el,{transform:yt(v.value)?`translate3d(0, ${Le}px, 0)`:`translate3d(${Le}px, 0, 0)`});return}const Xe=1-be;if((N.value||g.value&&D.value===g.value-1)&&(e(be),rt((ae=b.value)==null?void 0:ae.$el,{opacity:`${Xe}`,transition:"none"},!0)),ge&&b.value&&c.value){const et=Math.min(Q()+be*(1-Q()),1),Le=8-be*8,ft=Math.max(0,14-be*14);rt(ge,{borderRadius:`${Le}px`,transform:yt(v.value)?`scale(${et}) translate3d(0, ${ft}px, 0)`:`scale(${et}) translate3d(${ft}px, 0, 0)`,transition:"none"},!0)}if(!O.value){const et=fe*he;rt((ee=S.value)==null?void 0:ee.$el,{transform:yt(v.value)?`translate3d(0, ${et}px, 0)`:`translate3d(${et}px, 0, 0)`})}}}function R(){var H;if(!S.value)return;const j=document.querySelector("[vaul-drawer-wrapper]"),z=xo(S.value.$el,v.value);rt(S.value.$el,{transform:"translate3d(0, 0, 0)",transition:`transform ${We.DURATION}s cubic-bezier(${We.EASE.join(",")})`}),rt((H=b.value)==null?void 0:H.$el,{transition:`opacity ${We.DURATION}s cubic-bezier(${We.EASE.join(",")})`,opacity:"1"}),c.value&&z&&z>0&&p.value&&rt(j,{borderRadius:`${_d}px`,overflow:"hidden",...yt(v.value)?{transform:`scale(${Q()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`,transformOrigin:"top"}:{transform:`scale(${Q()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`,transformOrigin:"left"},transitionProperty:"transform, border-radius",transitionDuration:`${We.DURATION}s`,transitionTimingFunction:`cubic-bezier(${We.EASE.join(",")})`},!0)}function B(){var H;S.value&&(n(),rt(S.value.$el,{transform:yt(v.value)?`translate3d(0, ${v.value==="bottom"?"100%":"-100%"}, 0)`:`translate3d(${v.value==="right"?"100%":"-100%"}, 0, 0)`,transition:`transform ${We.DURATION}s cubic-bezier(${We.EASE.join(",")})`}),rt((H=b.value)==null?void 0:H.$el,{opacity:"0",transition:`opacity ${We.DURATION}s cubic-bezier(${We.EASE.join(",")})`}),oe(!1),window.setTimeout(()=>{y.value=!1,p.value=!1},300),window.setTimeout(()=>{O.value&&(h.value=O.value[0])},We.DURATION*1e3))}hn(()=>{if(!p.value&&c.value&&HP){const H=setTimeout(()=>{_o(document.body)},200);return()=>clearTimeout(H)}}),Ht(()=>{oe(!1),J()});function W(H){if(!_.value||!S.value)return;S.value.$el.classList.remove(xd),I.value=!1,_.value=!1,M.value=new Date;const j=xo(S.value.$el,v.value);if(!ce(H.target,!1)||!j||Number.isNaN(j)||w.value===null)return;const z=M.value.getTime()-w.value.getTime(),q=A.value-(yt(v.value)?H.clientY:H.clientX),se=Math.abs(q)/z;if(se>.05&&(C.value=!0,window.setTimeout(()=>{C.value=!1},200)),O.value){const ee=v.value==="bottom"||v.value==="right"?1:-1;L({draggedDistance:q*ee,closeDrawer:B,velocity:se,dismissible:s.value}),t(!0);return}if(v.value==="bottom"||v.value==="right"?q>0:q<0){R(),t(!0);return}if(se>lg){B(),t(!1);return}const ae=Math.min(S.value.$el.getBoundingClientRect().height??0,window.innerHeight);if(j>=ae*d.value){B(),t(!1);return}t(!0),R()}Ge(p,H=>{H&&(x.value=new Date,oe(!0)),i(H)},{immediate:!0}),Ge(o,H=>{H?(p.value=H,m.value=!0):B()},{immediate:!0});function oe(H){const j=document.querySelector("[vaul-drawer-wrapper]");!j||!c.value||(H?(rt(document.body,{background:document.body.style.backgroundColor||document.body.style.background}),rt(document.body,{background:"black"},!0),rt(j,{borderRadius:`${_d}px`,overflow:"hidden",...yt(v.value)?{transform:`scale(${Q()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`,transformOrigin:"top"}:{transform:`scale(${Q()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`,transformOrigin:"left"},transitionProperty:"transform, border-radius",transitionDuration:`${We.DURATION}s`,transitionTimingFunction:`cubic-bezier(${We.EASE.join(",")})`})):(_o(j,"overflow"),_o(j,"transform"),_o(j,"borderRadius"),rt(j,{transitionProperty:"transform, border-radius",transitionDuration:`${We.DURATION}s`,transitionTimingFunction:`cubic-bezier(${We.EASE.join(",")})`})))}function ie(H){var j,z;const q=H?(window.innerWidth-bo)/window.innerWidth:1,se=H?-16:0;F.value&&window.clearTimeout(F.value),rt((j=S.value)==null?void 0:j.$el,{transition:`transform ${We.DURATION}s cubic-bezier(${We.EASE.join(",")})`,transform:`scale(${q}) translate3d(0, ${se}px, 0)`}),!H&&(z=S.value)!=null&&z.$el&&(F.value=window.setTimeout(()=>{var ae,ee;const he=xo((ae=S.value)==null?void 0:ae.$el,v.value);rt((ee=S.value)==null?void 0:ee.$el,{transition:"none",transform:yt(v.value)?`translate3d(0, ${he}px, 0)`:`translate3d(${he}px, 0, 0)`})},500))}function E(H){var j;if(H<0)return;const z=yt(v.value)?window.innerHeight:window.innerWidth,q=(z-bo)/z,se=q+H*(1-q),ae=-16+H*bo;rt((j=S.value)==null?void 0:j.$el,{transform:yt(v.value)?`scale(${se}) translate3d(0, ${ae}px, 0)`:`scale(${se}) translate3d(${ae}px, 0, 0)`,transition:"none"})}function Z(H){var j;const z=yt(v.value)?window.innerHeight:window.innerWidth,q=H?(z-bo)/z:1,se=H?-16:0;H&&rt((j=S.value)==null?void 0:j.$el,{transition:`transform ${We.DURATION}s cubic-bezier(${We.EASE.join(",")})`,transform:yt(v.value)?`scale(${q}) translate3d(0, ${se}px, 0)`:`scale(${q}) translate3d(${se}px, 0, 0)`})}return{open:o,isOpen:p,modal:u,keyboardIsOpen:X,hasBeenOpened:m,isVisible:y,drawerRef:S,drawerHeightRef:G,overlayRef:b,isDragging:_,dragStartTime:w,isAllowedToDrag:I,snapPoints:O,activeSnapPoint:h,pointerStart:A,dismissible:s,snapPointsOffset:$,direction:v,shouldFade:N,fadeFromIndex:g,shouldScaleBackground:c,onPress:pe,onDrag:te,onRelease:W,closeDrawer:B,onNestedDrag:E,onNestedRelease:Z,onNestedOpenChange:ie,emitClose:n,emitDrag:e,emitRelease:t,emitOpenChange:i,nested:a}}const rR=De({__name:"DrawerRoot",props:{activeSnapPoint:{default:void 0},closeThreshold:{default:JP},shouldScaleBackground:{type:Boolean,default:void 0},scrollLockTimeout:{default:QP},fixed:{type:Boolean,default:void 0},dismissible:{type:Boolean,default:!0},modal:{type:Boolean,default:!0},open:{type:Boolean,default:void 0},defaultOpen:{type:Boolean,default:void 0},nested:{type:Boolean,default:!1},direction:{default:"bottom"},snapPoints:{default:void 0},fadeFromIndex:{default:void 0}},emits:["drag","release","close","update:open","update:activeSnapPoint","animationEnd"],setup(r,{expose:e,emit:t}){const n=r,i=t;Pd();const o=Ve(()=>n.fadeFromIndex??(n.snapPoints&&n.snapPoints.length-1)),s=yd(n,"open",i,{defaultValue:n.defaultOpen,passive:n.open===void 0}),a=yd(n,"activeSnapPoint",i,{passive:n.activeSnapPoint===void 0}),l={emitDrag:g=>i("drag",g),emitRelease:g=>i("release",g),emitClose:()=>i("close"),emitOpenChange:g=>{i("update:open",g),setTimeout(()=>{i("animationEnd",g)},We.DURATION*1e3)}},{closeDrawer:u,hasBeenOpened:c,modal:f,isOpen:d}=qP(nR({...l,...Jr(n),activeSnapPoint:a,fadeFromIndex:o,open:s}));function h(g){if(s.value!==void 0){l.emitOpenChange(g);return}g?(c.value=!0,d.value=g):u()}return e({open:d}),(g,v)=>(de(),lt(Y(bP),{open:Y(d),modal:Y(f),"onUpdate:open":h},{default:Ue(()=>[ut(g.$slots,"default",{open:Y(d)})]),_:3},8,["open","modal"]))}}),iR=De({__name:"DrawerOverlay",setup(r){const{overlayRef:e,snapPoints:t,isVisible:n,isOpen:i,shouldFade:o}=sg(),s=Ve(()=>{var a;return t&&(((a=t.value)==null?void 0:a.length)??0)>0});return(a,l)=>(de(),lt(Y(GP),{ref_key:"overlayRef",ref:e,"vaul-drawer-visible":Y(n)?"true":"false","vaul-overlay":"","vaul-snap-points":Y(i)&&s.value?"true":"false","vaul-snap-points-overlay":Y(i)&&Y(o)?"true":"false"},null,8,["vaul-drawer-visible","vaul-snap-points","vaul-snap-points-overlay"]))}}),oR=De({__name:"DrawerContent",setup(r){const{open:e,isOpen:t,isVisible:n,snapPointsOffset:i,drawerRef:o,onPress:s,onDrag:a,onRelease:l,modal:u,emitOpenChange:c,dismissible:f,keyboardIsOpen:d,closeDrawer:h,direction:g}=sg(),v=Ve(()=>i.value&&i.value.length>0?`${i.value[0]}px`:"0");function p(m){if(!u.value||m.defaultPrevented){m.preventDefault();return}d.value&&(d.value=!1),m.preventDefault(),f.value&&c(!1),!(!f.value||e.value!==void 0)&&h()}return Ge(t,m=>{m&&setTimeout(()=>{n.value=!0},1)},{immediate:!0}),(m,y)=>(de(),lt(Y(jP),{ref_key:"drawerRef",ref:o,"vaul-drawer":"","vaul-drawer-direction":Y(g),"vaul-drawer-visible":Y(n)?"true":"false",style:Zr({"--snap-point-height":v.value}),onPointerdown:Y(s),onPointermove:Y(a),onPointerup:Y(l),onPointerDownOutside:p,onEscapeKeyDown:y[0]||(y[0]=_=>{Y(f)||_.preventDefault()})},{default:Ue(()=>[ut(m.$slots,"default")]),_:3},8,["vaul-drawer-direction","vaul-drawer-visible","style","onPointerdown","onPointermove","onPointerup"]))}}),sR={py:"1",flex:"~ col",rounded:"lg","overflow-hidden":""},aR={key:0,flex:"",mr:"12"},lR={flex:"~ col",border:"4 solid pink-200/50 dark:pink-500/50",shadow:"md pink-200/50 dark:none","min-w-20":"","rounded-lg":"","px-2":"","py-1":"",h:"unset {en().then(()=>{n.update(),i.value=n.height.value})}),a(async()=>{en().then(()=>{n.update(),i.value=n.height.value})}),(l,u)=>{const c=Xd("auto-animate");return de(),xe("div",sR,[u[1]||(u[1]=K("div",{"flex-1":""},null,-1)),dt((de(),xe("div",{ref_key:"chatHistoryRef",ref:e,"h-full":"","w-full":"","max-h":"30vh",flex:"~ col","overflow-scroll":""},[u[0]||(u[0]=K("div",{"flex-1":""},null,-1)),(de(!0),xe(zn,null,vr(Y(t),(f,d)=>(de(),xe("div",{key:d,"mb-2":""},[f.role==="assistant"?(de(),xe("div",aR,[K("div",lR,[K("div",null,[K("span",uR,we(l.$t("stage.chat.message.character-name.airi")),1)]),f.content?(de(),xe("div",{key:0,class:"markdown-content",text:"base y.id===p.value);if(!m){a.value=void 0;return}a.value=m}function h(v){const p=v.target;n.stageView=p.value}function g(v){const p=v.target.value;switch(t.value){case"en":case"en-US":c.value=p;break;case"zh":case"zh-CN":case"zh-TW":case"zh-HK":c.value=p;break;case"jp":case"jp-JP":f.value=p;break}}return Ge([l,u],async([v,p])=>{if(!v||!p){o.value=[];return}o.value=await s(v,p)}),$t(async()=>{!l.value||!u.value||(o.value=await s(l.value,u.value))}),(v,p)=>(de(),xe("div",null,[K("h2",yR,we(Y(e)("settings.title")),1),K("div",null,[K("div",_R,[K("div",xR,[K("span",null,we(Y(e)("settings.openai-base-url.label")),1)]),K("div",bR,[dt(K("input",{"onUpdate:modelValue":p[0]||(p[0]=m=>Y(n).openAiApiBaseURL=m),type:"text",placeholder:Y(e)("settings.openai-base-url.placeholder_mobile"),"h-8":"","w-full":"","rounded-md":"","bg-transparent":"","px-2":"","py-1":"","text-right":"","font-mono":"","outline-none":""},null,8,wR),[[jr,Y(n).openAiApiBaseURL]])]),K("div",TR,[K("span",null,we(Y(e)("settings.openai-api-key.label")),1)]),K("div",SR,[dt(K("input",{"onUpdate:modelValue":p[1]||(p[1]=m=>Y(n).openAiApiKey=m),type:"text",placeholder:Y(e)("settings.openai-api-key.placeholder_mobile"),"h-8":"","w-full":"","rounded-md":"","bg-transparent":"","px-2":"","py-1":"","text-right":"","font-mono":"","outline-none":""},null,8,ER),[[jr,Y(n).openAiApiKey]])]),K("div",AR,[K("span",null,we(Y(e)("settings.elevenlabs-api-key.label")),1)]),K("div",CR,[dt(K("input",{"onUpdate:modelValue":p[2]||(p[2]=m=>Y(n).elevenLabsApiKey=m),type:"text",placeholder:Y(e)("settings.elevenlabs-api-key.placeholder_mobile"),"h-8":"","w-full":"","rounded-md":"","bg-transparent":"","px-2":"","py-1":"","text-right":"","font-mono":"","outline-none":""},null,8,IR),[[jr,Y(n).elevenLabsApiKey]])]),K("div",MR,[K("span",null,we(Y(e)("settings.language.title")),1)]),K("div",kR,[dt(K("select",{"onUpdate:modelValue":p[3]||(p[3]=m=>Y(n).language=m),"h-8":"","w-full":"","rounded-md":"","bg-transparent":"","px-2":"","py-1":"","text-right":"","font-mono":"","outline-none":""},[K("option",PR,we(Y(e)("settings.language.english")),1),K("option",RR,we(Y(e)("settings.language.chinese")),1)],512),[[Vd,Y(n).language]])]),K("div",OR,[K("span",null,we(Y(e)("settings.models")),1)]),K("div",FR,[K("select",{"h-8":"","w-full":"","rounded-md":"","bg-transparent":"","px-2":"","py-1":"","text-right":"","font-mono":"","outline-none":"",onChange:d},[K("option",LR,we(Y(e)("stage.select-a-model")),1),Y(n).openAiModel?(de(),xe("option",{key:0,value:Y(n).openAiModel.id},we("name"in Y(n).openAiModel?`${Y(n).openAiModel.name} (${Y(n).openAiModel.id})`:Y(n).openAiModel.id),9,NR)):tt("",!0),(de(!0),xe(zn,null,vr(o.value,m=>(de(),xe("option",{key:m.id,value:m.id},we("name"in m?`${m.name} (${m.id})`:m.id),9,DR))),128))],32)]),K("div",BR,[K("span",null,we(Y(e)("settings.voices")),1)]),K("div",UR,[K("select",{"h-8":"","w-full":"","rounded-md":"","bg-transparent":"","px-2":"","py-1":"","text-right":"","font-mono":"","outline-none":"",onChange:g},[K("option",zR,we(Y(e)("stage.select-a-voice")),1),["en","en-US"].indexOf(Y(t))!==-1&&Y(c)?(de(),xe("option",{key:0,value:Y(c)},we(Y(c)),9,jR)):tt("",!0),["zh","zh-CN","zh-TW","zh-HK"].indexOf(Y(t))!==-1&&Y(c)?(de(),xe("option",{key:1,value:Y(c)},we(Y(c)),9,VR)):tt("",!0),["jp","jp-JP"].indexOf(Y(t))!==-1&&Y(f)?(de(),xe("option",{key:2,value:Y(f)},we(Y(f)),9,GR)):tt("",!0),(de(!0),xe(zn,null,vr(Y(Gd)[Y(t)],(m,y)=>(de(),xe("option",{key:y,value:m},we(m),9,$R))),128))],32)])])]),p[8]||(p[8]=K("h2",{text:"slate-800/80 dark:slate-200/80 xl","font-bold":""}," View ",-1)),K("div",null,[K("div",HR,[p[6]||(p[6]=K("div",{text:"sm pink-500"},[K("span",null,"Viewer")],-1)),K("select",{"h-8":"","w-full":"","rounded-md":"","bg-transparent":"","px-2":"","py-1":"","text-right":"","font-mono":"","outline-none":"",onChange:h},p[5]||(p[5]=[K("option",{value:"2d"}," 2D ",-1),K("option",{value:"3d"}," 3D ",-1)]),32),p[7]||(p[7]=K("div",{text:"sm pink-500"},[K("span",null,"Theme")],-1)),K("label",XR,[dt(K("input",{"onUpdate:modelValue":p[4]||(p[4]=m=>mu(i)?i.value=m:null),checked:Y(i),"aria-checked":Y(i),name:"stageView",type:"checkbox",hidden:"","appearance-none":"","outline-none":""},null,8,WR),[[Kr,Y(i)]]),K("div",qR,[Fe(Zo,{name:"slide-away",mode:"out-in"},{default:Ue(()=>[Y(i)?(de(),xe("div",YR)):(de(),xe("div",KR))]),_:1})])])])])]))}}),JR={relative:"","w-full":"",flex:"","gap-1":""},QR={flex:"","flex-1":""},eO={class:"flex flex-1 flex-col rounded-t-lg p-5",bg:"[#fffbff] dark:[#1f1a1d]","gap-2":""},tO=De({__name:"MobileInteractiveArea",setup(r){const e=le(""),t=le(!1),{isAudioInputOn:n,selectedAudioDeviceId:i}=En(ei()),{send:o,onAfterSend:s}=_r(),{t:a}=Qr();async function l(){e.value.trim()&&await o(e.value)}const{destroy:u,start:c}=Ym(i,{onSpeechStart:()=>{t.value=!0},onVADMisfire:()=>{t.value=!1},onSpeechEnd:d=>{t.value=!1,f()},auto:!1});function f(d){alert("Transcription is not implemented yet")}return Ge(n,async d=>{d==="false"&&u()}),s(async()=>{e.value=""}),$t(()=>{c()}),(d,h)=>(de(),xe("div",null,[K("div",JR,[Fe(vR,{absolute:"","left-0":"","top-0":"",transform:"translate-y-[-100%]","w-full":""}),K("div",QR,[Fe(Y(Zd),{modelValue:e.value,"onUpdate:modelValue":h[0]||(h[0]=g=>e.value=g),placeholder:Y(a)("stage.message"),border:"solid 2 pink-100 dark:pink-400/20",text:"pink-400 hover:pink-600 dark:[#905073] dark:hover:pink-600 placeholder:pink-400 placeholder:hover:pink-600 placeholder:dark:[#905073] placeholder:dark:hover:pink-600",bg:"pink-50 dark:[#3c2632]","max-h":"[10lh]","min-h":"[1lh]","w-full":"","resize-none":"","overflow-y-scroll":"","rounded-l-xl":"","p-2":"","font-medium":"","outline-none":"",transition:"all duration-250 ease-in-out placeholder:all placeholder:duration-250 placeholder:ease-in-out",onSubmit:l},null,8,["modelValue","placeholder"])]),Fe(Y(rR),{"should-scale-background":""},{default:Ue(()=>[Fe(Y(wP),{class:"px-4 py-2.5",border:"solid 2 pink-100 dark:pink-400/20",text:"lg pink-400 hover:pink-600 dark:[#905073] dark:hover:pink-600 placeholder:pink-400 placeholder:hover:pink-600 placeholder:dark:[#905073] placeholder:dark:hover:pink-600",bg:"pink-50 dark:[#3c2632]","max-h":"[10lh]","min-h":"[1lh]","rounded-r-xl":""},{default:Ue(()=>h[1]||(h[1]=[K("div",{"i-solar:settings-bold-duotone":""},null,-1)])),_:1}),Fe(Y(SP),null,{default:Ue(()=>[Fe(Y(iR),{class:"fixed inset-0 z-50 bg-black/40"}),Fe(Y(oR),{"max-h":"[75%]",fixed:"","bottom-0":"","left-0":"","right-0":"","z-50":"","mt-24":"","h-full":"",flex:"","flex-col":"","rounded-t-lg":"",bg:"[#fffbff] dark:[#1f1a1d]"},{default:Ue(()=>[K("div",eO,[Fe(ZR)])]),_:1})]),_:1})]),_:1})])]))}}),nO={relative:"","max-h":"[100vh]","max-w":"[100vw]",p:"2",flex:"~ col","z-2":"","h-full":"","overflow-hidden":""},rO={flex:"~ 1 row (de(),lt(oM,{"h-full":"","w-full":""},{default:Ue(()=>[Fe(uM,{"h-full":"","w-full":"","fill-color":Y(e)?"#563544":"#f8e8f2"},{default:Ue(()=>[K("div",nO,[Fe(ZM,{class:"flex