混淆
使用 javascript-obfuscator 做标识符重命名、字符串数组编码和常量拆分。 在 vite build 后增加生产环境混淆步骤,开发环境保持源码可读。 关闭 sourcemap,避免直接暴露原始源码。 当前主包约 1.7 MB,建议先拆出第三方依赖,再只混淆应用自身代码,而不是整个 dist。
This commit is contained in:
1 parent
5f7e30063b
commit
c93ec671da
10 files changed
+2825
-1332
No files matched your search
Vendored
-2
@@ -1,2 +0,0 @@
|
||||
var ft=Object.defineProperty;var gt=(W,t,e)=>t in W?ft(W,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):W[t]=e;var T=(W,t,e)=>gt(W,typeof t!="symbol"?t+"":t,e);import{f as ht,R as pt,N as dt,ac as ut,Z as mt,b4 as yt,O as rt,b5 as at,U as D,B as Tt}from"./index-Bt9Riflf.js";import{$ as Rt,a0 as Yt,a1 as Ft,a2 as Et,y as _t,a3 as Ot,a4 as kt,a5 as Xt,a6 as Bt,a7 as Nt,a8 as Dt,a9 as $t,aa as zt,ab as Wt,ad as qt,H as Gt,ae as Jt,af as Ht,ag as Zt,ah as Kt,ai as Qt,aj as jt,ak as te,al as ee,am as se,an as ne,ao as ie,ap as oe,aq as re,ar as ae,as as le,at as ce,au as he,av as pe,aw as de,ax as ue,ay as fe,az as ge,aA as me,aB as ye,aC as Te,aD as be,aE as we,aF as xe,aG as Ae,aH as Pe,aI as Ie,aJ as Ce,aK as Ve,aL as Le,aM as Se,aN as Me,aO as ve,aP as Ue,aQ as Re,aR as Ye,aS as Fe,aT as Ee,x as _e,aU as Oe,aV as ke,aW as Xe,aX as Be,aY as Ne,aZ as De,a_ as $e,a$ as ze,b0 as We,b1 as qe,b2 as Ge,b3 as Je,b6 as He,b7 as Ze,b8 as Ke,b9 as Qe,ba as je,bb as ts,bc as es,bd as ss,be as ns,bf as is,bg as os,bh as rs,bi as as,bj as ls,bk as cs,bl as hs,bm as ps,bn as ds,bo as us,bp as fs,bq as gs,br as ms,bs as ys,bt as Ts,bu as bs,w as ws,X as xs,J as As,Y as Ps,z as Is,bv as Cs,bw as Vs,bx as Ls,by as Ss,bz as Ms,bA as vs,bB as Us,bC as Rs,bD as Ys,bE as Fs,bF as Es,bG as _s,T as Os,bH as ks,bI as Xs,b as Bs,bJ as Ns,c as Ds,bK as $s,bL as zs,bM as Ws,bN as qs,bO as Gs,bP as Js,bQ as Hs,bR as Zs,bS as Ks,bT as Qs,bU as js,bV as tn,bW as en,bX as sn,bY as nn,bZ as on,b_ as rn,V as an,b$ as ln,c0 as cn,c1 as hn,c2 as pn,c3 as dn}from"./index-Bt9Riflf.js";class It{constructor(t){T(this,"skeletonData");T(this,"animationToMixTime",{});T(this,"defaultMix",0);if(!t)throw new Error("skeletonData cannot be null.");this.skeletonData=t}setMix(t,e,n){return typeof t=="string"?this.setMix1(t,e,n):this.setMix2(t,e,n)}setMix1(t,e,n){const s=this.skeletonData.findAnimation(t);if(!s)throw new Error(`Animation not found: ${t}`);const i=this.skeletonData.findAnimation(e);if(!i)throw new Error(`Animation not found: ${e}`);this.setMix2(s,i,n)}setMix2(t,e,n){if(!t)throw new Error("from cannot be null.");if(!e)throw new Error("to cannot be null.");const s=`${t.name}.${e.name}`;this.animationToMixTime[s]=n}getMix(t,e){const n=`${t.name}.${e.name}`,s=this.animationToMixTime[n];return s===void 0?this.defaultMix:s}}class Ct{constructor(t,e="",n=new bt,s=new lt){T(this,"textureLoader");T(this,"pathPrefix");T(this,"downloader");T(this,"cache");T(this,"errors",{});T(this,"toLoad",0);T(this,"loaded",0);T(this,"texturePmaInfo",{});this.textureLoader=t,this.pathPrefix=e,this.downloader=n,this.cache=s}start(t){return this.toLoad++,this.pathPrefix+t}success(t,e,n){this.toLoad--,this.loaded++,this.cache.assets[e]=n,this.cache.assetsRefCount[e]=(this.cache.assetsRefCount[e]||0)+1,t&&t(e,n)}error(t,e,n){this.toLoad--,this.loaded++,this.errors[e]=n,t&&t(e,n)}loadAll(){return new Promise((e,n)=>{const s=()=>{if(this.isLoadingComplete()){this.hasErrors()?n(this.errors):e(this);return}requestAnimationFrame(s)};requestAnimationFrame(s)})}setRawDataURI(t,e){this.downloader.rawDataUris[this.pathPrefix+t]=e}loadBinary(t,e=()=>{},n=()=>{}){t=this.start(t),!this.reuseAssets(t,e,n)&&(this.cache.assetsLoaded[t]=new Promise((s,i)=>{this.downloader.downloadBinary(t,o=>{this.success(e,t,o),s(o)},(o,r)=>{const l=`Couldn't load binary ${t}: status ${o}, ${r}`;this.error(n,t,l),i(l)})}))}loadText(t,e=()=>{},n=()=>{}){t=this.start(t),this.downloader.downloadText(t,s=>{this.success(e,t,s)},(s,i)=>{this.error(n,t,`Couldn't load text ${t}: status ${s}, ${i}`)})}loadJson(t,e=()=>{},n=()=>{}){t=this.start(t),!this.reuseAssets(t,e,n)&&(this.cache.assetsLoaded[t]=new Promise((s,i)=>{this.downloader.downloadJson(t,o=>{this.success(e,t,o),s(o)},(o,r)=>{const l=`Couldn't load JSON ${t}: status ${o}, ${r}`;this.error(n,t,l),i(l)})}))}reuseAssets(t,e=()=>{},n=()=>{}){const s=this.cache.getAsset(t),i=s!==void 0;return i&&(this.cache.assetsLoaded[t]=s.then(o=>(o=o instanceof Image||o instanceof ImageBitmap?this.textureLoader(o):o,this.success(e,t,o),o)).catch(o=>{this.error(n,t,o)})),i}loadTexture(t,e=()=>{},n=()=>{}){if(t=this.start(t),this.reuseAssets(t,e,n))return;const s=this.texturePmaInfo[t];this.cache.assetsLoaded[t]=new Promise((i,o)=>{if(!!!(typeof window<"u"&&typeof navigator<"u"&&window.document))fetch(t,{mode:"cors"}).then(c=>{if(c.ok)return c.blob();const a=`Couldn't load image: ${t}`;this.error(n,t,`Couldn't load image: ${t}`),o(a)}).then(c=>c?createImageBitmap(c,{premultiplyAlpha:"none",colorSpaceConversion:"none"}):null).then(c=>{if(c){const a=this.createTexture(t,s,c);this.success(e,t,a),i(a)}});else{const c=new Image;c.crossOrigin="anonymous",c.onload=()=>{const a=this.createTexture(t,s,c);this.success(e,t,a),i(a)},c.onerror=()=>{const a=`Couldn't load image: ${t}`;this.error(n,t,a),o(a)},this.downloader.rawDataUris[t]&&(t=this.downloader.rawDataUris[t]),c.src=t}})}loadTextureAtlas(t,e=()=>{},n=()=>{},s){const i=t.lastIndexOf("/"),o=i>=0?t.substring(0,i+1)Line truncated
|
||||
${n}`:""}`)}remove(t){t=this.pathPrefix+t;const e=this.cache.assets[t];return e.dispose&&e.dispose(),delete this.cache.assets[t],delete this.cache.assetsRefCount[t],delete this.cache.assetsLoaded[t],e}removeAll(){for(const t in this.cache.assets){const e=this.cache.assets[t];e.dispose&&e.dispose()}this.cache.assets={},this.cache.assetsLoaded={},this.cache.assetsRefCount={}}isLoadingComplete(){return this.toLoad===0}getToLoad(){return this.toLoad}getLoaded(){return this.loaded}dispose(){this.removeAll()}disposeAsset(t){const e=this.cache.assets[t];if(e instanceof ht){e.dispose();return}this.disposeAssetInternal(t)}hasErrors(){return Object.keys(this.errors).length>0}getErrors(){return this.errors}disposeAssetInternal(t){if(this.cache.assetsRefCount[t]>0&&--this.cache.assetsRefCount[t]===0)return this.remove(t)}createTextureAtlas(t,e,n,s){const i=new ht(t);i.dispose=()=>{var o;if(!(this.cache.assetsRefCount[n]<=0)){this.disposeAssetInternal(n);for(const r of i.pages)(o=r.texture)==null||o.dispose()}};for(const o of i.pages){const r=this.texturePath(e,o.name,s);this.texturePmaInfo[this.pathPrefix+r]=o.pma}return i}createTexture(t,e,n){const s=this.textureLoader(n,e),i=s.dispose.bind(s);return s.dispose=()=>{this.disposeAssetInternal(t)&&i()},s}texturePath(t,e,n){return n?n[e]:t+e}}const nt=class nt{constructor(){T(this,"assets",{});T(this,"assetsRefCount",{});T(this,"assetsLoaded",{})}static getCache(t){const e=nt.AVAILABLE_CACHES.get(t);if(e)return e;const n=new nt;return nt.AVAILABLE_CACHES.set(t,n),n}async addAsset(t,e){return this.assetsLoaded[t]=Promise.resolve(e),this.assets[t]=e,e}getAsset(t){return this.assetsLoaded[t]}};T(nt,"AVAILABLE_CACHES",new Map);let lt=nt;class bt{constructor(){T(this,"callbacks",{});T(this,"rawDataUris",{})}dataUriToString(t){if(!t.startsWith("data:"))throw new Error("Not a data URI.");let e=t.indexOf("base64,");return e!==-1?(e+=7,atob(t.substr(e))):t.substr(t.indexOf(",")+1)}base64ToUint8Array(t){var e=window.atob(t),n=e.length,s=new Uint8Array(n);for(let i=0;i<n;i++)s[i]=e.charCodeAt(i);return s}dataUriToUint8Array(t){if(!t.startsWith("data:"))throw new Error("Not a data URI.");let e=t.indexOf("base64,");if(e===-1)throw new Error("Not a binary data URI.");return e+=7,this.base64ToUint8Array(t.substr(e))}downloadText(t,e,n){if(this.start(t,e,n))return;const s=this.rawDataUris[t];if(s&&!s.includes(".")){try{this.finish(t,200,this.dataUriToString(s))}catch(r){this.finish(t,400,JSON.stringify(r))}return}const i=new XMLHttpRequest;i.overrideMimeType("text/html"),i.open("GET",s||t,!0);const o=()=>{this.finish(t,i.status,i.responseText)};i.onload=o,i.onerror=o,i.send()}downloadJson(t,e,n){this.downloadText(t,s=>{e(JSON.parse(s))},n)}downloadBinary(t,e,n){if(this.start(t,e,n))return;const s=this.rawDataUris[t];if(s&&!s.includes(".")){try{this.finish(t,200,this.dataUriToUint8Array(s))}catch(r){this.finish(t,400,JSON.stringify(r))}return}const i=new XMLHttpRequest;i.open("GET",s||t,!0),i.responseType="arraybuffer";const o=()=>{this.finish(t,i.status,i.response)};i.onload=()=>{i.status===200||i.status===0?this.finish(t,200,new Uint8Array(i.response)):o()},i.onerror=o,i.send()}start(t,e,n){let s=this.callbacks[t];try{if(s)return!0;this.callbacks[t]=s=[]}finally{s.push(e,n)}}finish(t,e,n){const s=this.callbacks[t];if(delete this.callbacks[t],e===200||e===0)for(let i=0,o=s.length;i<o;i+=2)s[i](n);else for(let i=1,o=s.length;i<o;i+=2)s[i](e,n)}}class Vt{constructor(t,e=!1){T(this,"atlas");T(this,"allowMissingRegions");this.atlas=t,this.allowMissingRegions=e}findRegions(t,e,n){const s=n.regions;for(let i=0,o=s.length;i<o;i++)s[i]=this.findRegion(t,n.getPath(e,i))}findRegion(t,e){const n=this.atlas.findRegion(e);if(!n&&!this.allowMissingRegions)throw new Error(`Region not found in atlas: ${e} (attachment: ${t})`);return n}newRegionAttachment(t,e,n,s,i){return this.findRegions(n,s,i),new pt(n,i)}newMeshAttachment(t,e,n,s,i){return this.findRegions(n,s,i),new dt(n,i)}newBoundingBoxAttachment(t,e,n){return new ut(n)}newPathAttachment(t,e,n){return new mt(n)}newPointAttachment(t,e,n){return new yt(n)}newClippingAttachment(t,e,n){return new rt(n)}}class Lt{constructor(){T(this,"minX",0);T(this,"minY",0);T(this,"maxX",0);T(this,"maxY",0);T(this,"boundingBoxes",[]);T(this,"polygons",[]);T(this,"polygonPool",new at(()=>D.newFloatArray(16)))}update(t,e){if(!t)throw new Error("skeleton cannot be null.");const n=this.boundingBoxes,s=this.polygons,i=this.polygonPool,o=t.slots,r=o.length;n.length=0,i.freeAll(s),s.length=0;for(let l=0;l<r;l++){const c=o[l];if(!c.bone.active)continue;const a=c.appliedPose.attachment;if(a instanceof ut){n.push(a);let h=i.obtain();h.length!==a.worldVerticesLength&&(h=D.newFloatArray(a.worldVerticesLength)),s.push(h),a.computeWorldVertices(t,c,0,a.worldVerticesLength,h,0,2)}}e?this.aabbCompute():(this.minX=Number.POSITIVE_INFINITY,this.minY=Number.POSITIVE_INFINITY,this.maxX=Number.NEGATIVE_INFINITY,this.maxY=Number.NEGATIVE_INFINITY)}aabbCompute(){let t=Number.POSITIVE_INFLine truncated
|
||||
Vendored
-1257
File diff suppressed because it is too large.
Load diff
Vendored
-71
@@ -1,71 +0,0 @@
|
||||
var Ae=Object.defineProperty;var Be=(m,o,e)=>o in m?Ae(m,o,{enumerable:!0,configurable:!0,writable:!0,value:e}):m[o]=e;var a=(m,o,e)=>Be(m,typeof o!="symbol"?o+"":o,e);import{T as Fe,a as he,b as F,S as ue,M as pe,c as oe,W as ne,B as H,d as z,L as Te,E as O,e as ce,p as q,f as Ee,g as fe,A as Q,h as me,i as De,j as V,s as re,G as we,k as $,l as Y,m as Le,P as Ie,n as Re,o as Ne,C as X,q as be,r as _e,t as Ue,u as Ye,v as Xe,w as ee,x as j,y as ke,z as Ve,D as J,F as ge,V as Ge,H as ae,I as We,J as $e,U as xe,K as E,R as ve,N as ye,O as Pe,Q as Oe,X as He,Y as ze,Z as qe,_ as Ke}from"./index-Bt9Riflf.js";import{$ as bt,a0 as kt,a1 as vt,a2 as yt,a3 as Pt,a4 as St,a5 as Mt,a6 as At,a7 as Bt,a8 as Ft,a9 as Et,aa as Dt,ab as Lt,ac as It,ad as Rt,ae as Nt,af as _t,ag as Ut,ah as Yt,ai as Xt,aj as Vt,ak as Gt,al as Wt,am as $t,an as Ot,ao as Ht,ap as zt,aq as qt,ar as Kt,as as Zt,at as Jt,au as Qt,av as jt,aw as es,ax as ts,ay as ss,az as os,aA as ns,aB as as,aC as rs,aD as is,aE as ls,aF as hs,aG as cs,aH as ds,aI as us,aJ as ps,aK as fs,aL as ms,aM as gs,aN as xs,aO as Cs,aP as Ts,aQ as ws,aR as bs,aS as ks,aT as vs,aU as ys,aV as Ps,aW as Ss,aX as Ms,aY as As,aZ as Bs,a_ as Fs,a$ as Es,b0 as Ds,b1 as Ls,b2 as Is,b3 as Rs,b4 as Ns,b5 as _s,b6 as Us,b7 as Ys,b8 as Xs,b9 as Vs,ba as Gs,bb as Ws,bc as $s,bd as Os,be as Hs,bf as zs,bg as qs,bh as Ks,bi as Zs,bj as Js,bk as Qs,bl as js,bm as eo,bn as to,bo as so,bp as oo,bq as no,br as ao,bs as ro,bt as io,bu as lo,bv as ho,bw as co,bx as uo,by as po,bz as fo,bA as mo,bB as go,bC as xo,bD as Co,bE as To,bF as wo,bG as bo,bH as ko,bI as vo,bJ as yo,bK as Po,bL as So,bM as Mo,bN as Ao,bO as Bo,bP as Fo,bQ as Eo,bR as Do,bS as Lo,bT as Io,bU as Ro,bV as No,bW as _o,bX as Uo,bY as Yo,bZ as Xo,b_ as Vo,b$ as Go,c0 as Wo,c1 as $o,c2 as Oo,c3 as Ho}from"./index-Bt9Riflf.js";import{SkeletonClipping as de,SkeletonPhysicsMovement as Ze,AnimationStateData as Je,AtlasAttachmentLoader as Qe,SkeletonBounds as je}from"./index-7TEaXqdY.js";import{AssetCache as qo,AssetManagerBase as Ko,Downloader as Zo,SkeletonRendererCore as Jo,Triangulator as Qo}from"./index-7TEaXqdY.js";if(typeof window<"u"&&window.PIXI){const m=window.require;window.require=o=>{if(m)return m(o);if(o.startsWith("@pixi/"))return window.PIXI}}const _=class _ extends Fe{constructor(e){super(e.resource.source);a(this,"texture");this.texture=he.from(e)}static from(e){return _.textureMap.has(e)?_.textureMap.get(e):new _(e)}setFilters(e,t){this.texture.baseTexture.scaleMode=_.toPixiTextureFilter(e),this.texture.baseTexture.mipmap=_.toPixiMipMap(e)}setWraps(e,t){this.texture.baseTexture.wrapMode=_.toPixiTextureWrap(e)}dispose(){this.texture.destroy()}static toPixiTextureFilter(e){switch(e){case F.Nearest:case F.MipMapNearestLinear:case F.MipMapNearestNearest:return ue.NEAREST;case F.Linear:case F.MipMapLinearLinear:case F.MipMapLinearNearest:return ue.LINEAR;default:throw new Error(`Unknown texture filter: ${String(e)}`)}}static toPixiMipMap(e){switch(e){case F.Nearest:case F.Linear:return pe.OFF;case F.MipMapNearestLinear:case F.MipMapNearestNearest:case F.MipMapLinearLinear:case F.MipMapLinearNearest:return pe.ON;default:throw new Error(`Unknown texture filter: ${String(e)}`)}}static toPixiTextureWrap(e){switch(e){case oe.ClampToEdge:return ne.CLAMP;case oe.MirroredRepeat:return ne.MIRRORED_REPEAT;case oe.Repeat:return ne.REPEAT;default:throw new Error(`Unknown texture wrap: ${String(e)}`)}}static toPixiBlending(e){switch(e){case H.Normal:return z.NORMAL;case H.Additive:return z.ADD;case H.Multiply:return z.MULTIPLY;case H.Screen:return z.SCREEN;default:throw new Error(`Unknown blendMode: ${String(e)}`)}}};a(_,"textureMap",new Map);let G=_;const K="spineTextureAtlasLoader",et={extension:O.Asset,resolver:{test:m=>V(m,".atlas"),parse:m=>{var e,t;const o=m.split(".");return{resolution:parseFloat(((t=(e=re.RETINA_PREFIX)==null?void 0:e.exec(m))==null?void 0:t[1])??"1"),format:o[o.length-2],src:m}}},loader:{name:K,extension:{type:O.LoadParser,priority:Te.Normal,name:K},test(m){return V(m,".atlas")},async load(m){const o=await re.ADAPTER.fetch(m);if(!o.ok)throw new Error(`[${K}] Failed to fetch ${m}: ${o.status} ${o.statusText}`);return await o.text()},testParse(m,o){const e=V(o.src,".atlas"),t=typeof m=="string",s=o.loadParser===K;return Promise.resolve((e||s)&&t)},unload(m){m.dispose()},async parse(m,o,e){var p;const t=o.data||{};let s=q.dirname(o.src);s&&s.lastIndexOf("/")!==s.length-1&&(s+="/");const n=new Ee(m);if(t.images instanceof fe||typeof t.images=="string"){const h=t.images;t.images={},t.images[n.pages[0].name]=h}const r=[];let l=!0;for(const h of e.parsers)if(h.name==="loadTextures"){l=(p=h.config)==null?void 0:p.preferCreateImageBitmap;break}Q.setPreferences({preferCreateImageBitmap:!1});for(const h of n.pages){const u=h.name,c=t!=null&&t.images?t.images[u]:void 0;if(c instanceof fe)h.setTexture(G.from(c));else{const i=c??q.normalize([...s.split(q.sep),u].join(q.sep)),g={src:De(i,o.src),data:{...t.imageMetadLine truncated
|
||||
attribute vec2 aVertexPosition;
|
||||
attribute vec2 aTextureCoord;
|
||||
|
||||
uniform mat3 projectionMatrix;
|
||||
uniform mat3 translationMatrix;
|
||||
uniform mat3 uTextureMatrix;
|
||||
|
||||
varying vec2 vTextureCoord;
|
||||
|
||||
void main(void)
|
||||
{
|
||||
gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);
|
||||
|
||||
vTextureCoord = (uTextureMatrix * vec3(aTextureCoord, 1.0)).xy;
|
||||
}
|
||||
`,rt=`
|
||||
varying vec2 vTextureCoord;
|
||||
uniform vec4 uColor;
|
||||
uniform vec4 uDarkColor;
|
||||
|
||||
uniform sampler2D uSampler;
|
||||
|
||||
void main(void)
|
||||
{
|
||||
vec4 texColor = texture2D(uSampler, vTextureCoord);
|
||||
gl_FragColor.a = texColor.a * uColor.a;
|
||||
gl_FragColor.rgb = ((texColor.a - 1.0) * uDarkColor.a + 1.0 - texColor.rgb) * uDarkColor.rgb + texColor.rgb * uColor.rgb;
|
||||
}
|
||||
`;class it extends Le{constructor(e){const t={uSampler:e??he.EMPTY,alpha:1,uTextureMatrix:Re.IDENTITY,uColor:new Float32Array([1,1,1,1]),uDarkColor:new Float32Array([0,0,0,0])},s={tint:16777215,darkTint:0,alpha:1,pluginName:"darkTintBatch"};super(Ie.from(at,rt),t);a(this,"uvMatrix");a(this,"batchable");a(this,"pluginName");a(this,"_tintRGB");a(this,"_darkTintRGB");a(this,"_colorDirty");a(this,"_alpha");a(this,"_tintColor");a(this,"_darkTintColor");this._colorDirty=!1,this.uvMatrix=new Ne(t.uSampler),this.batchable=!0,this.pluginName=s.pluginName,this._tintColor=new X(s.tint),this._darkTintColor=new X(s.darkTint),this._tintRGB=this._tintColor.toLittleEndianNumber(),this._darkTintRGB=this._darkTintColor.toLittleEndianNumber(),this._alpha=s.alpha,this._colorDirty=!0}get texture(){return this.uniforms.uSampler}set texture(e){this.uniforms.uSampler!==e&&(!this.uniforms.uSampler.baseTexture.alphaMode!=!e.baseTexture.alphaMode&&(this._colorDirty=!0),this.uniforms.uSampler=e,this.uvMatrix.texture=e)}set alpha(e){e!==this._alpha&&(this._alpha=e,this._colorDirty=!0)}get alpha(){return this._alpha}set tint(e){e!==this.tint&&(this._tintColor.setValue(e),this._tintRGB=this._tintColor.toLittleEndianNumber(),this._colorDirty=!0)}get tint(){return this._tintColor.value}set darkTint(e){e!==this.darkTint&&(this._darkTintColor.setValue(e),this._darkTintRGB=this._darkTintColor.toLittleEndianNumber(),this._colorDirty=!0)}get darkTint(){return this._darkTintColor.value}get tintValue(){return this._tintColor.toNumber()}get darkTintValue(){return this._darkTintColor.toNumber()}update(){this._colorDirty&&(this._colorDirty=!1,X.shared.setValue(this._tintColor).premultiply(this._alpha,!0).toArray(this.uniforms.uColor),X.shared.setValue(this._darkTintColor).premultiply(this._alpha,!0).premultiply(1,!1).toArray(this.uniforms.uDarkColor)),this.uvMatrix.update()&&(this.uniforms.uTextureMatrix=this.uvMatrix.mapCoord)}}class lt extends be{constructor(e){super(new nt,new it(e),void 0,void 0);a(this,"_darkTintRGB",0)}get darkTint(){return"darkTint"in this.shader?this.shader.darkTint:null}set darkTint(e){this.shader.darkTint=e}get darkTintValue(){return this.shader.darkTintValue}_renderToBatch(e){const t=this.geometry,s=this.shader;s.uvMatrix&&(s.uvMatrix.update(),this.calculateUvs()),this.calculateVertices(),this.indices=t.indexBuffer.data,this._tintRGB=s._tintRGB,this._darkTintRGB=s._darkTintRGB,this._texture=s.texture;const n=this.material.pluginName;e.batch.setObjectRenderer(e.plugins[n]),e.plugins[n].render(this)}}const y=class y extends lt{constructor(){super();a(this,"name","")}updateFromSpineData(e,t,s,n,r,l,p,h){var C,T;this.texture=e.texture;const u=r/(h?12:8)*2,c=this.geometry.getBuffer("aTextureCoord");((C=c.data)==null?void 0:C.length)!==u&&(c.data=new Float32Array(u));const i=this.geometry.getBuffer("aVertexPosition");((T=i.data)==null?void 0:T.length)!==u&&(i.data=new Float32Array(u));let g=0;const x=c.data,d=i.data;for(let k=0;k<r;k+=h?12:8){let b=k;d[g]=n[b++],d[g+1]=n[b++],b+=4,x[g]=n[b++],x[g+1]=n[b++],g+=2}h?(y.auxColor[0]=n[8],y.auxColor[1]=n[9],y.auxColor[2]=n[10],y.auxColor[3]=n[11],this.darkTint=y.auxColor,y.auxColor[0]=n[2],y.auxColor[1]=n[3],y.auxColor[2]=n[4],y.auxColor[3]=n[5],this.tint=y.auxColor):(y.auxColor[0]=n[2],y.auxColor[1]=n[3],y.auxColor[2]=n[4],y.auxColor[3]=n[5],this.tint=y.auxColor),this.blendMode=G.toPixiBlending(t),this.alpha=y.auxColor[3];const f=this.geometry.indexBuffer;if(f.data.length!==l.length)f.data=new Uint32Array(l);else{const k=f.data;for(let b=0;b<p;b++)k[b]=l[b]}this.name=s,c.update(),i.update(),f.update()}};a(y,"auxColor",[0,0,0,0]);let ie=y;class ht extends we{constructor(e=!1){super();a(this,"_buffer");a(this,"_indexBuffer");this._buffer=new $(void 0,e,!1),this._indexBuffer=new $(void 0,e,!0),this.addAttribute("aVertexPosition",this._buffer,2,!1,Y.FLOAT).addAttribute("aTextureCoord",this._buffer,2,!1,Y.FLOAT).addAttribute("aColor",this._buffer,4,!0,Y.UNSIGNED_BYTE).addAttribute("aDarkColor",this._buffer,4,!0,Y.UNSIGNED_BYTE).addAttribute("aTextureId",this._buffer,1,!0,Y.FLOAT).addIndex(this._indexBuffer)}}const ct=`
|
||||
precision highp float;
|
||||
attribute vec2 aVertexPosition;
|
||||
attribute vec2 aTextureCoord;
|
||||
attribute vec4 aColor;
|
||||
attribute vec4 aDarkColor;
|
||||
attribute float aTextureId;
|
||||
|
||||
uniform mat3 projectionMatrix;
|
||||
uniform mat3 translationMatrix;
|
||||
uniform vec4 tint;
|
||||
|
||||
varying vec2 vTextureCoord;
|
||||
varying vec4 vColor;
|
||||
varying vec4 vDarkColor;
|
||||
varying float vTextureId;
|
||||
|
||||
void main(void){
|
||||
gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);
|
||||
|
||||
vTextureCoord = aTextureCoord;
|
||||
vTextureId = aTextureId;
|
||||
vColor = aColor * tint;
|
||||
vDarkColor = aDarkColor * tint;
|
||||
|
||||
}
|
||||
`,dt=`
|
||||
varying vec2 vTextureCoord;
|
||||
varying vec4 vColor;
|
||||
varying vec4 vDarkColor;
|
||||
varying float vTextureId;
|
||||
uniform sampler2D uSamplers[%count%];
|
||||
|
||||
void main(void){
|
||||
vec4 color;
|
||||
%forloop%
|
||||
|
||||
|
||||
gl_FragColor.a = color.a * vColor.a;
|
||||
gl_FragColor.rgb = ((color.a - 1.0) * vDarkColor.a + 1.0 - color.rgb) * vDarkColor.rgb + color.rgb * vColor.rgb;
|
||||
}
|
||||
`;class Se extends _e{constructor(o){super(o),this.shaderGenerator=new Ue(ct,dt),this.geometryClass=ht,this.vertexSize=7}packInterleavedGeometry(o,e,t,s,n){const{uint32View:r,float32View:l}=e,p=s/this.vertexSize,h=o.uvs,u=o.indices,c=o.vertexData,i=o._texture.baseTexture._batchLocation,g=Math.min(o.worldAlpha,1),x=X.shared.setValue(o._tintRGB).toPremultiplied(g,!0),d=X.shared.setValue(o._darkTintRGB).premultiply(g,!0).toPremultiplied(1,!1);for(let f=0;f<c.length;f+=2)l[s++]=c[f],l[s++]=c[f+1],l[s++]=h[f],l[s++]=h[f+1],r[s++]=x,r[s++]=d,l[s++]=i;for(let f=0;f<u.length;f++)t[n++]=p+u[f]}}a(Se,"extension",{name:"darkTintBatch",type:O.RendererPlugin});ce.add(Se);const U=class U extends be{constructor(){const e=new Ye;e.getBuffer("aVertexPosition").static=!1,e.getBuffer("aTextureCoord").static=!1;const t=new Xe(he.EMPTY);super(e,t);a(this,"name","");a(this,"warnedTwoTint",!1)}updateFromSpineData(e,t,s,n,r,l,p,h){var C,T;this.texture=e.texture;const u=r/(h?12:8)*2,c=this.geometry.getBuffer("aTextureCoord");((C=c.data)==null?void 0:C.length)!==u&&(c.data=new Float32Array(u));const i=this.geometry.getBuffer("aVertexPosition");((T=i.data)==null?void 0:T.length)!==u&&(i.data=new Float32Array(u));let g=0;const x=c.data,d=i.data;for(let k=0;k<r;k+=h?12:8){let b=k;d[g]=n[b++],d[g+1]=n[b++],b+=4,x[g]=n[b++],x[g+1]=n[b++],g+=2}h&&!this.warnedTwoTint&&(console.warn("DarkTint is not enabled by default. To enable use a DarkSlotMesh factory while creating the Spine object."),this.warnedTwoTint=!0),U.auxColor[0]=n[2],U.auxColor[1]=n[3],U.auxColor[2]=n[4],U.auxColor[3]=n[5],this.tint=U.auxColor,this.alpha=U.auxColor[3],this.blendMode=G.toPixiBlending(t);const f=this.geometry.indexBuffer;if(f.data.length!==l.length)f.data=new Uint32Array(l);else{const k=f.data;for(let b=0;b<p;b++)k[b]=l[b]}this.name=s,c.update(),i.update(),f.update()}};a(U,"auxColor",[0,0,0,0]);let le=U;class mt{constructor(o,e,t,s){a(this,"x");a(this,"y");a(this,"width");a(this,"height");this.x=o,this.y=e,this.width=t,this.height=s}calculateBounds(){return{x:this.x,y:this.y,width:this.width,height:this.height}}}class gt{constructor(o=!1){a(this,"clipping");this.clipping=o}calculateBounds(o){if(!o.skeleton)return{x:0,y:0,width:0,height:0};const e=new ee(o.skeleton.data);e.setupPose(),e.updateWorldTransform(j.update);const t=e.getBoundsRect(this.clipping?new de:void 0);return t.width===Number.NEGATIVE_INFINITY?{x:0,y:0,width:0,height:0}:t}}class xt{constructor(o,e=[],t=.05,s=!1){a(this,"animation");a(this,"skins");a(this,"timeStep");a(this,"clipping");this.animation=o,this.skins=e,this.timeStep=t,this.clipping=s}calculateBounds(o){if(!o.skeleton||!o.state)return{x:0,y:0,width:0,height:0};const e=new ke(o.state.data),t=new ee(o.skeleton.data),s=this.clipping?new de:void 0,n=t.data;if(this.skins.length>0){const l=new Ve("custom-skin");for(const p of this.skins){const h=n.findSkin(p);h!=null&&l.addSkin(h)}t.setSkin(l)}t.setupPose();const r=this.animation!=null?n.findAnimation(this.animation):null;if(r==null){t.updateWorldTransform(j.update);const l=t.getBoundsRect(s);return l.width===Number.NEGATIVE_INFINITY?{x:0,y:0,width:0,height:0}:l}else{let l=Number.POSITIVE_INFINITY,p=Number.POSITIVE_INFINITY,h=Number.NEGATIVE_INFINITY,u=Number.NEGATIVE_INFINITY;e.clearTracks(),e.setAnimation(0,r,!1);const c=Math.max(r.duration/this.timeStep,1);for(let g=0;g<c;g++){const x=g>0?this.timeStep:0;e.update(x),e.apply(t),t.update(x),t.updateWorldTransform(j.update);const d=t.getBoundsRect(s);l=Math.min(l,d.x),p=Math.min(p,d.y),h=Math.max(h,d.x+d.width),u=Math.max(u,d.y+d.height)}const i={x:l,y:p,width:h-l,height:u-p};return i.width===Number.NEGATIVE_INFINITY?{x:0,y:0,width:0,height:0}:i}}}const w=class w extends J{constructor(e){super();a(this,"skeleton");a(this,"state");a(this,"skeletonPhysics");a(this,"darkTint",!1);a(this,"hasNeverUpdated",!0);a(this,"_debug");a(this,"slotMeshFactory",()=>new le);a(this,"beforeUpdateWorldTransforms",()=>{});a(this,"afterUpdateWorldTransforms",()=>{});a(this,"_autoUpdate",!1);a(this,"_ticker",ge.shared);a(this,"meshesCache",new Map);a(this,"lightColor",new ae);a(this,"darkColor",new ae);a(this,"clippingVertAux",new Float32Array(6));a(this,"_boundsProvider");a(this,"_boundsPoint",new We);a(this,"_boundsSpineID",-1);a(this,"_boundsSpineDirty",!0);a(this,"slotsObject",new Map);a(this,"verticesCache",xe.newFloatArray(1024));a(this,"clippingSlotToPixiMasks",{});e instanceof $e?e={skeletonData:e}:"skeleton"in e&&(e=new.target.createOptions(e));const{autoUpdate:t=!0,boundsProvider:s,darkTint:n,skeletonData:r,ticker:l}=e;this.skeleton=new ee(r),this.skeletonPhysics=new Ze(this.skeleton,{readTransform:(p,h)=>this.readPhysicsTransform(p,h),worldToSkeleton:p=>this.pixiWorldCoordinatesToSkeleton(p)}),this.state=new ke(new Je(r)),l&&(this._ticker=l),this.autoUpdate=t,this.boundsProvider=s,this.darkTint=n===void 0?this.skeleton.slots.some(p=>!!p.data.setupPose.darkColor):n,this.darkTint&&(this.slotMeshFactory=()=>new ie)}get debug(){return this._debug}set debu
Line truncated
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
const _0x6745e=_0x2734;(function(_0x30306b,_0x4c7c61){const _0x5224d2=_0x2734,_0x500037=_0x30306b();while(!![]){try{const _0x58f533=parseInt(_0x5224d2(0xc9e))/0x1+parseInt(_0x5224d2(0xbb0))/0x2+-parseInt(_0x5224d2(0x340c))/0x3+parseInt(_0x5224d2(0x242f))/0x4*(parseInt(_0x5224d2(0x10a0))/0x5)+-parseInt(_0x5224d2(0xe1a))/0x6*(-parseInt(_0x5224d2(0x2a62))/0x7)+parseInt(_0x5224d2(0x4415))/0x8*(parseInt(_0x5224d2(0x2cdc))/0x9)+-parseInt(_0x5224d2(0x57b))/0xa*(parseInt(_0x5224d2(0x3c39))/0xb);if(_0x58f533===_0x4c7c61)break;else _0x500037['push'](_0x500037['shift']());}catch(_0x4eadc6){_0x500037['push'](_0x500037['shift']());}}}(_0x20d3,0xe722f));var rs=Object[_0x6745e(0x1fdb)+_0x6745e(0x4ee)],ls=(_0x547dc4,_0x38174b,_0x57c5fb)=>_0x38174b in _0x547dc4?rs(_0x547dc4,_0x38174b,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x57c5fb}):_0x547dc4[_0x38174b]=_0x57c5fb,Ce=(_0x903dc,_0x107213,_0x2fb672)=>ls(_0x903dc,typeof _0x107213!=_0x6745e(0x40e1)?_0x107213+'':_0x107213,_0x2fb672);import{T as _0x3e2c3a,S as _0x5bf396,C as _0x2f02fc,G as _0x33e108,a as _0x43cad4,d as _0x3d1027,c as _0x3d14e6,w as _0xf3faed,b as _0x16b5f3,M as _0x2cb91c,A as _0x2d49c1,e as _0x1ab80e,f as _0x20bcab,g as _0x43efd7,h as _0x2b82f5,i as _0x4bfdab,j as _0x40f021,m as _0x31d65e,r as _0x2952a2,o as _0x56c168,k as _0x3928b5,l as _0x4fe1ee,n as _0x17ae06,p as _0x3a5021,q as _0x18d237,s as _0x1f3c1f,t as _0xb25afa,u as _0x3e9337,v as _0x543239,x as _0x175a7b,y as _0x335e74,z as _0x59a7fc,B as _0x179c28,D as _0x27ddd8,E as _0x373927,F as _0x16b72b,H as _0x41ba7c,I as _0x36da41,J as _0x5b2b40,K as _0x27e8db,L as _0x309117,N as _0x5b137a,O as _0x1f06a0,P as _0x45fb80,Q as _0x3dea51,R as _0xb06d2b,U as _0x49f829,V as _0x1a9dbc,W as _0x4c04f1,X as _0x324ffd,Y as _0x596d6f,Z as _0x533955,_ as _0x266932,$ as _0x28215a,a0 as _0x82a8f8,a1 as _0x4b1a8d,a2 as _0x176b3d,a3 as _0x52c85b,a4 as _0x32f0ce,a5 as _0x575b80,a6 as _0x2b5d05,a7 as _0x3bd644,a8 as _0x359bef,a9 as _0x394213,aa as _0x3ca422,ab as _0x15e420,ac as _0x5b0576,ad as _0x3a90d8,ae as _0x2435b7,af as _0x10dcb3,ag as _0x18f9ca,ah as _0x5c3f46,ai as _0x5deaa1}from'./vendor-Cb_6CYmx.js';(function(){const _0x5e3fa3=_0x6745e,_0x11b289=document[_0x5e3fa3(0x3f7f)+_0x5e3fa3(0x14e9)]('link')[_0x5e3fa3(0x9dd)];if(_0x11b289&&_0x11b289[_0x5e3fa3(0x23dd)]&&_0x11b289[_0x5e3fa3(0x23dd)](_0x5e3fa3(0x17fe)+_0x5e3fa3(0xc9b)))return;for(const _0x5d022d of document[_0x5e3fa3(0x1caf)+_0x5e3fa3(0x1a16)](_0x5e3fa3(0x3a54)+_0x5e3fa3(0x1f6b)+'preload\x22'+']'))_0xed15f8(_0x5d022d);new MutationObserver(_0x59da43=>{const _0x3d30a7=_0x5e3fa3;for(const _0x51068d of _0x59da43)if(_0x51068d[_0x3d30a7(0x2e8)]===_0x3d30a7(0x2182)+'t'){for(const _0x8360b6 of _0x51068d[_0x3d30a7(0x3c71)+'es'])_0x8360b6['tagName']===_0x3d30a7(0x1e2a)&&_0x8360b6['rel']===_0x3d30a7(0x17fe)+_0x3d30a7(0xc9b)&&_0xed15f8(_0x8360b6);}})[_0x5e3fa3(0x3282)](document,{'childList':!0x0,'subtree':!0x0});function _0x22f022(_0x392db1){const _0x3784e2=_0x5e3fa3,_0x4048ff={};return _0x392db1[_0x3784e2(0x1b54)+'y']&&(_0x4048ff['integrit'+'y']=_0x392db1['integrit'+'y']),_0x392db1[_0x3784e2(0x3883)+_0x3784e2(0x10de)]&&(_0x4048ff[_0x3784e2(0x3883)+_0x3784e2(0x10de)]=_0x392db1[_0x3784e2(0x3883)+_0x3784e2(0x10de)]),_0x392db1[_0x3784e2(0x277)+_0x3784e2(0x26c5)]===_0x3784e2(0x1eda)+_0x3784e2(0xb6c)?_0x4048ff[_0x3784e2(0x42bd)+'als']=_0x3784e2(0x2e00):_0x392db1['crossOri'+_0x3784e2(0x26c5)]===_0x3784e2(0x4529)+'s'?_0x4048ff[_0x3784e2(0x42bd)+'als']=_0x3784e2(0x2b08):_0x4048ff[_0x3784e2(0x42bd)+_0x3784e2(0xf1e)]=_0x3784e2(0x3e5d)+_0x3784e2(0x26c5),_0x4048ff;}function _0xed15f8(_0x535aaa){const _0x482fca=_0x5e3fa3;if(_0x535aaa['ep'])return;_0x535aaa['ep']=!0x0;const _0x591e48=_0x22f022(_0x535aaa);fetch(_0x535aaa[_0x482fca(0x310d)],_0x591e48);}}());function Fn(_0x2a16b5,_0x3bf737){const _0x312386=_0x6745e,_0x45b854=Math['max'](0x0,Number(_0x2a16b5)||0x0),_0x304f69=Math[_0x312386(0x4231)](0x0,Number(_0x3bf737)||0x0);return{'inner':Math[_0x312386(0x2819)](_0x45b854,_0x304f69),'outer':Math[_0x312386(0x4231)](_0x45b854,_0x304f69)};}function Oi(_0x4d7951){const _0x5d9feb=_0x6745e,_0x6febc5=Math[_0x5d9feb(0x4231)](0x0,Number(_0x4d7951['outerRec'+'tW'])||0x0),_0x1b86a0=Math[_0x5d9feb(0x4231)](0x0,Number(_0x4d7951[_0x5d9feb(0x3cfb)+'tH'])||0x0);return{'innerW':Math['min'](_0x6febc5,Math[_0x5d9feb(0x4231)](0x0,Number(_0x4d7951[_0x5d9feb(0x13b0)+'tW'])||0x0)),'innerH':Math['min'](_0x1b86a0,Math[_0x5d9feb(0x4231)](0x0,Number(_0x4d7951[_0x5d9feb(0x13b0)+'tH'])||0x0)),'outerW':_0x6febc5,'outerH':_0x1b86a0};}function js(_0x1ff123,_0x5244b4,_0x42d0d9,_0x378b3a,_0xed0b18){const _0x1ccdff=_0x6745e;if(_0x1ff123===_0x1ccdff(0x34bb))return _0xed0b18();const _0x569e3e=Math[_0x1ccdff(0x4231)](0x1,Math['round'](_0x42d0d9)),_0x45f303=Math[_0x1ccdff(0x4231)](0x0,Math[_0x1ccdff(0x1f1f)](_0x5244b4))%_0x569e3e;return _0x378b3a?_0x45f303/_0x569e3e:_0x569e3e<=0x1?0.5:_0x45f303/(_0x569e3e-0x1);}function Io(_0x1a7009,_0x21fd66,_0x836600,_0x20f357){const _0x4b9dff=_0x6745e,_0x1d95ac=Math[_0x4Line truncated
|
||||
Vendored
+1327
File diff suppressed because it is too large.
Load diff
Vendored
+2
-1
@@ -9,7 +9,8 @@
|
||||
html, body { margin: 0; padding: 0; background: #111; color: #eee; font-family: system-ui, -apple-system, sans-serif; }
|
||||
#app { display: flex; flex-direction: column; height: 100vh; }
|
||||
</style>
|
||||
<script type="module" crossorigin src="/assets/index-Bt9Riflf.js"></script>
|
||||
<script type="module" crossorigin src="/assets/index-uew0C5KI.js"></script>
|
||||
<link rel="modulepreload" crossorigin href="/assets/vendor-Cb_6CYmx.js">
|
||||
<link rel="stylesheet" crossorigin href="/assets/index-DtKmj2iL.css">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
Reference in new issue
Block a user