微信小程序-省心预览工具

This commit is contained in:
Yeomai committed 2026-09-28 21:23:52 +08:00
commit edf1e51846
173 files changed
+78282

No files matched your search

@@ -0,0 +1,84 @@
"use strict";var spine=(()=>{var Ie=Object.defineProperty,Hi=Object.getOwnPropertyDescriptor,_i=Object.getOwnPropertyNames,ji=Object.prototype.hasOwnProperty,Zi=(e,t)=>{for(var s in t)Ie(e,s,{get:t[s],enumerable:!0})},Ki=(e,t,s,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of _i(t))!ji.call(e,r)&&r!==s&&Ie(e,r,{get:()=>t[r],enumerable:!(i=Hi(t,r))||i.enumerable});return e},Ji=e=>Ki(Ie({},"__esModule",{value:!0}),e),Ws={};Zi(Ws,{AlphaTimeline:()=>ze,Animation:()=>ne,AnimationState:()=>sr,AnimationStateAdapter:()=>ir,AnimationStateData:()=>rr,AssetCache:()=>li,AssetManager:()=>bi,AssetManagerBase:()=>ai,AtlasAttachmentLoader:()=>lr,Attachment:()=>Re,AttachmentTimeline:()=>Ot,BinaryInput:()=>gi,BlendMode:()=>Is,Bone:()=>ms,BoneData:()=>us,BoundingBoxAttachment:()=>hs,CURRENT:()=>ei,CameraController:()=>qr,ClippingAttachment:()=>$t,Color:()=>st,Color2Attribute:()=>Ai,ColorAttribute:()=>me,ConstraintData:()=>ee,CurveTimeline:()=>Ct,CurveTimeline1:()=>yt,CurveTimeline2:()=>ae,DebugUtils:()=>tr,DeformTimeline:()=>Ge,Downloader:()=>gs,DrawOrderTimeline:()=>zt,Event:()=>xs,EventData:()=>ps,EventQueue:()=>Qs,EventTimeline:()=>le,EventType:()=>$s,FIRST:()=>as,FakeTexture:()=>nr,GLTexture:()=>Gt,HOLD_FIRST:()=>he,HOLD_MIX:()=>ti,HOLD_SUBSEQUENT:()=>ls,IkConstraint:()=>oi,IkConstraintData:()=>ws,IkConstraintTimeline:()=>He,Inherit:()=>de,InheritTimeline:()=>De,Input:()=>Ys,IntSet:()=>Qi,Interpolation:()=>qs,LoadingScreen:()=>Zr,M00:()=>D,M01:()=>G,M02:()=>H,M03:()=>N,M10:()=>_,M11:()=>U,M12:()=>j,M13:()=>z,M20:()=>Z,M21:()=>K,M22:()=>W,M23:()=>q,M30:()=>$,M31:()=>tt,M32:()=>et,M33:()=>Q,ManagedWebGLRenderingContext:()=>xt,MathUtils:()=>P,Matrix4:()=>se,Mesh:()=>ks,MeshAttachment:()=>Wt,MixBlend:()=>Zs,MixDirection:()=>Ks,OrthoCamera:()=>vi,PathAttachment:()=>qt,PathConstraint:()=>hi,PathConstraintData:()=>bs,PathConstraintMixTimeline:()=>Ke,PathConstraintPositionTimeline:()=>je,PathConstraintSpacingTimeline:()=>Ze,Physics:()=>ui,PhysicsConstraintDampingTimeline:()=>$e,PhysicsConstraintGravityTimeline:()=>ss,PhysicsConstraintInertiaTimeline:()=>Je,PhysicsConstraintMassTimeline:()=>ts,PhysicsConstraintMixTimeline:()=>is,PhysicsConstraintResetTimeline:()=>rs,PhysicsConstraintStrengthTimeline:()=>Qe,PhysicsConstraintTimeline:()=>Pt,PhysicsConstraintWindTimeline:()=>es,PointAttachment:()=>ni,PolygonBatcher:()=>Xs,Pool:()=>Jt,Position2Attribute:()=>ue,Position3Attribute:()=>Gr,PositionMode:()=>vs,Pow:()=>Gs,PowOut:()=>$i,RGB2Timeline:()=>qe,RGBA2Timeline:()=>We,RGBATimeline:()=>Ne,RGBTimeline:()=>Ue,RegionAttachment:()=>te,ResizeMode:()=>ki,RotateMode:()=>As,RotateTimeline:()=>Qt,SETUP:()=>os,SUBSEQUENT:()=>oe,ScaleTimeline:()=>Xe,ScaleXTimeline:()=>Pe,ScaleYTimeline:()=>Le,SceneRenderer:()=>Yi,SequenceTimeline:()=>ns,Shader:()=>Tt,ShapeRenderer:()=>Ps,ShapeType:()=>Mi,ShearTimeline:()=>Be,ShearXTimeline:()=>Ve,ShearYTimeline:()=>Oe,Skeleton:()=>fi,SkeletonBinary:()=>hr,SkeletonBounds:()=>xi,SkeletonClipping:()=>wi,SkeletonData:()=>Cs,SkeletonDebugRenderer:()=>Ei,SkeletonJson:()=>zr,SkeletonRenderer:()=>Ri,Skin:()=>fe,SkinEntry:()=>Ss,Slot:()=>ci,SlotData:()=>Ts,SpacingMode:()=>ys,SpineCanvas:()=>Qr,StringSet:()=>Me,TexCoordAttribute:()=>Fs,Texture:()=>cs,TextureAtlas:()=>ds,TextureAtlasPage:()=>ri,TextureAtlasRegion:()=>fs,TextureFilter:()=>ce,TextureRegion:()=>ii,TextureWrap:()=>si,TimeKeeper:()=>Ee,Timeline:()=>ft,Touch:()=>yi,TrackEntry:()=>Js,TransformConstraint:()=>di,TransformConstraintData:()=>Ms,TransformConstraintTimeline:()=>_e,TranslateTimeline:()=>Ye,TranslateXTimeline:()=>ke,TranslateYTimeline:()=>Fe,Triangulator:()=>pi,Utils:()=>L,Vector2:()=>Vt,Vector3:()=>At,VertexAttachment:()=>Yt,VertexAttribute:()=>Ht,VertexAttributeType:()=>Ci,WindowedMean:()=>er});var Qi=class{array=new Array;add(e){let t=this.contains(e);return this.array[e|0]=e|0,!t}contains(e){return this.array[e|0]!=null}remove(e){this.array[e|0]=void 0}clear(){this.array.length=0}},Me=class{entries={};size=0;add(e){let t=this.entries[e];return this.entries[e]=!0,t?!1:(this.size++,!0)}addAll(e){let t=this.size;for(var s=0,i=e.length;s<i;s++)this.add(e[s]);return t!=this.size}contains(e){return this.entries[e]}clear(){this.entries={},this.size=0}},st=class Nt{constructor(t=0,s=0,i=0,r=0){this.r=t,this.g=s,this.b=i,this.a=r}static WHITE=new Nt(1,1,1,1);static RED=new Nt(1,0,0,1);static GREEN=new Nt(0,1,0,1);static BLUE=new Nt(0,0,1,1);static MAGENTA=new Nt(1,0,1,1);set(t,s,i,r){return this.r=t,this.g=s,this.b=i,this.a=r,this.clamp()}setFromColor(t){return this.r=t.r,this.g=t.g,this.b=t.b,this.a=t.a,this}setFromString(t){return t=t.charAt(0)=="#"?t.substr(1):t,this.r=parseInt(t.substr(0,2),16)/255,this.g=parseInt(t.substr(2,2),16)/255,this.b=parseInt(t.substr(4,2),16)/255,this.a=t.length!=8?1:parseInt(t.substr(6,2),16)/255,this}add(t,s,i,r){return this.r+=t,this.g+=s,this.b+=i,this.a+=r,this.clamp()}clamp(){return this.r<0?this.r=0:this.r>1&&(this.r=1),this.g<0?this.g=0:this.g>1&&(this.g=1),this.b<0?this.b=0:this.b>1&&(this.b=1),this.a<Line truncated
`+s:""))}remove(e){e=this.pathPrefix+e;let t=this.cache.assets[e];return t.dispose&&t.dispose(),delete this.cache.assets[e],delete this.cache.assetsRefCount[e],delete this.cache.assetsLoaded[e],t}removeAll(){for(let e in this.cache.assets){let t=this.cache.assets[e];t.dispose&&t.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(e){const t=this.cache.assets[e];if(t instanceof ds){t.dispose();return}this.disposeAssetInternal(e)}hasErrors(){return Object.keys(this.errors).length>0}getErrors(){return this.errors}disposeAssetInternal(e){if(this.cache.assetsRefCount[e]>0&&--this.cache.assetsRefCount[e]===0)return this.remove(e)}createTextureAtlas(e,t){const s=new ds(t);return s.dispose=()=>{if(!(this.cache.assetsRefCount[e]<=0)){this.disposeAssetInternal(e);for(const i of s.pages)i.texture?.dispose()}},s}createTexture(e,t){const s=this.textureLoader(t),i=s.dispose.bind(s);return s.dispose=()=>{this.disposeAssetInternal(e)&&i()},s}},li=class Se{assets={};assetsRefCount={};assetsLoaded={};static AVAILABLE_CACHES=new Map;static getCache(t){const s=Se.AVAILABLE_CACHES.get(t);if(s)return s;const i=new Se;return Se.AVAILABLE_CACHES.set(t,i),i}async addAsset(t,s){this.assetsLoaded[t]=Promise.resolve(s),this.assets[t]=await s}},gs=class{callbacks={};rawDataUris={};dataUriToString(e){if(!e.startsWith("data:"))throw new Error("Not a data URI.");let t=e.indexOf("base64,");return t!=-1?(t+=7,atob(e.substr(t))):e.substr(e.indexOf(",")+1)}base64ToUint8Array(e){for(var t=window.atob(e),s=t.length,i=new Uint8Array(s),r=0;r<s;r++)i[r]=t.charCodeAt(r);return i}dataUriToUint8Array(e){if(!e.startsWith("data:"))throw new Error("Not a data URI.");let t=e.indexOf("base64,");if(t==-1)throw new Error("Not a binary data URI.");return t+=7,this.base64ToUint8Array(e.substr(t))}downloadText(e,t,s){if(this.start(e,t,s))return;const i=this.rawDataUris[e];if(i&&!i.includes(".")){try{this.finish(e,200,this.dataUriToString(i))}catch(l){this.finish(e,400,JSON.stringify(l))}return}let r=new XMLHttpRequest;r.overrideMimeType("text/html"),r.open("GET",i||e,!0);let h=()=>{this.finish(e,r.status,r.responseText)};r.onload=h,r.onerror=h,r.send()}downloadJson(e,t,s){this.downloadText(e,i=>{t(JSON.parse(i))},s)}downloadBinary(e,t,s){if(this.start(e,t,s))return;const i=this.rawDataUris[e];if(i&&!i.includes(".")){try{this.finish(e,200,this.dataUriToUint8Array(i))}catch(l){this.finish(e,400,JSON.stringify(l))}return}let r=new XMLHttpRequest;r.open("GET",i||e,!0),r.responseType="arraybuffer";let h=()=>{this.finish(e,r.status,r.response)};r.onload=()=>{r.status==200||r.status==0?this.finish(e,200,new Uint8Array(r.response)):h()},r.onerror=h,r.send()}start(e,t,s){let i=this.callbacks[e];try{if(i)return!0;this.callbacks[e]=i=[]}finally{i.push(t,s)}}finish(e,t,s){let i=this.callbacks[e];delete this.callbacks[e];let r=t==200||t==0?[s]:[t,s];for(let h=r.length-1,l=i.length;h<l;h+=2)i[h].apply(null,r)}},xs=class{data;intValue=0;floatValue=0;stringValue=null;time=0;volume=0;balance=0;constructor(e,t){if(!t)throw new Error("data cannot be null.");this.time=e,this.data=t}},ps=class{name;intValue=0;floatValue=0;stringValue=null;audioPath=null;volume=0;balance=0;constructor(e){this.name=e}},oi=class{data;bones;target;bendDirection=0;compress=!1;stretch=!1;mix=1;softness=0;active=!1;constructor(e,t){if(!e)throw new Error("data cannot be null.");if(!t)throw new Error("skeleton cannot be null.");this.data=e,this.bones=new Array;for(let i=0;i<e.bones.length;i++){let r=t.findBone(e.bones[i].name);if(!r)throw new Error(`Couldn't find bone ${e.bones[i].name}`);this.bones.push(r)}let s=t.findBone(e.target.name);if(!s)throw new Error(`Couldn't find bone ${e.target.name}`);this.target=s,this.mix=e.mix,this.softness=e.softness,this.bendDirection=e.bendDirection,this.compress=e.compress,this.stretch=e.stretch}isActive(){return this.active}setToSetupPose(){const e=this.data;this.mix=e.mix,this.softness=e.softness,this.bendDirection=e.bendDirection,this.compress=e.compress,this.stretch=e.stretch}update(e){if(this.mix==0)return;let t=this.target,s=this.bones;switch(s.length){case 1:this.apply1(s[0],t.worldX,t.worldY,this.compress,this.stretch,this.data.uniform,this.mix);break;case 2:this.apply2(s[0],s[1],t.worldX,t.worldY,this.bendDirection,this.stretch,this.data.uniform,this.softness,this.mix);break}}apply1(e,t,s,i,r,h,l){let n=e.parent;if(!n)throw new Error("IK bone must have parent.");let a=n.a,o=n.b,c=n.c,d=n.d,f=-e.ashearX-e.arotation,m=0,u=0;switch(e.inherit){case 1:m=(t-e.worldX)*P.signum(e.skeleton.scaleX),u=(s-e.worldY)*P.signum(e.skeleton.scaleY);break;case 2:let b=Math.abs(a*d-o*c)/Math.max(1e-4,a*a+c*c),x=a/e.skeleton.scaleX,p=c/e.skeleton.scaleY;o=-p*b*e.skeleton.scaleX,d=x*b*e.skeleton.scaleY,f+=Math.atan2(p,x)*P.radDeg;default:let v=t-n.worldX,y=s-n.worldY,A=a*d-o*c;Math.abs(A)<=1e-4?(m=0,u=0) Line truncated
attribute vec4 ${dt.POSITION};
attribute vec4 ${dt.COLOR};
attribute vec2 ${dt.TEXCOORDS};
uniform mat4 ${dt.MVP_MATRIX};
varying vec4 v_color;
varying vec2 v_texCoords;
void main () {
v_color = ${dt.COLOR};
v_texCoords = ${dt.TEXCOORDS};
gl_Position = ${dt.MVP_MATRIX} * ${dt.POSITION};
}
`,i=`
#ifdef GL_ES
#define LOWP lowp
precision mediump float;
#else
#define LOWP
#endif
varying LOWP vec4 v_color;
varying vec2 v_texCoords;
uniform sampler2D u_texture;
void main () {
gl_FragColor = v_color * texture2D(u_texture, v_texCoords);
}
`;return new dt(t,s,i)}static newTwoColoredTextured(t){let s=`
attribute vec4 ${dt.POSITION};
attribute vec4 ${dt.COLOR};
attribute vec4 ${dt.COLOR2};
attribute vec2 ${dt.TEXCOORDS};
uniform mat4 ${dt.MVP_MATRIX};
varying vec4 v_light;
varying vec4 v_dark;
varying vec2 v_texCoords;
void main () {
v_light = ${dt.COLOR};
v_dark = ${dt.COLOR2};
v_texCoords = ${dt.TEXCOORDS};
gl_Position = ${dt.MVP_MATRIX} * ${dt.POSITION};
}
`,i=`
#ifdef GL_ES
#define LOWP lowp
precision mediump float;
#else
#define LOWP
#endif
varying LOWP vec4 v_light;
varying LOWP vec4 v_dark;
varying vec2 v_texCoords;
uniform sampler2D u_texture;
void main () {
vec4 texColor = texture2D(u_texture, v_texCoords);
gl_FragColor.a = texColor.a * v_light.a;
gl_FragColor.rgb = ((texColor.a - 1.0) * v_dark.a + 1.0 - texColor.rgb) * v_dark.rgb + texColor.rgb * v_light.rgb;
}
`;return new dt(t,s,i)}static newColored(t){let s=`
attribute vec4 ${dt.POSITION};
attribute vec4 ${dt.COLOR};
uniform mat4 ${dt.MVP_MATRIX};
varying vec4 v_color;
void main () {
v_color = ${dt.COLOR};
gl_Position = ${dt.MVP_MATRIX} * ${dt.POSITION};
}
`,i=`
#ifdef GL_ES
#define LOWP lowp
precision mediump float;
#else
#define LOWP
#endif
varying LOWP vec4 v_color;
void main () {
gl_FragColor = v_color;
}
`;return new dt(t,s,i)}},ks=class{constructor(e,t,s,i){this.attributes=t,this.context=e instanceof xt?e:new xt(e),this.elementsPerVertex=0;for(let r=0;r<t.length;r++)this.elementsPerVertex+=t[r].numElements;this.vertices=new Float32Array(s*this.elementsPerVertex),this.indices=new Uint16Array(i),this.context.addRestorable(this)}context;vertices;verticesBuffer=null;verticesLength=0;dirtyVertices=!1;indices;indicesBuffer=null;indicesLength=0;dirtyIndices=!1;elementsPerVertex=0;getAttributes(){return this.attributes}maxVertices(){return this.vertices.length/this.elementsPerVertex}numVertices(){return this.verticesLength/this.elementsPerVertex}setVerticesLength(e){this.dirtyVertices=!0,this.verticesLength=e}getVertices(){return this.vertices}maxIndices(){return this.indices.length}numIndices(){return this.indicesLength}setIndicesLength(e){this.dirtyIndices=!0,this.indicesLength=e}getIndices(){return this.indices}getVertexSizeInFloats(){let e=0;for(var t=0;t<this.attributes.length;t++){let s=this.attributes[t];e+=s.numElements}return e}setVertices(e){if(this.dirtyVertices=!0,e.length>this.vertices.length)throw Error("Mesh can't store more than "+this.maxVertices()+" vertices");this.vertices.set(e,0),this.verticesLength=e.length}setIndices(e){if(this.dirtyIndices=!0,e.length>this.indices.length)throw Error("Mesh can't store more than "+this.maxIndices()+" indices");this.indices.set(e,0),this.indicesLength=e.length}draw(e,t){this.drawWithOffset(e,t,0,this.indicesLength>0?this.indicesLength:this.verticesLength/this.elementsPerVertex)}drawWithOffset(e,t,s,i){let r=this.context.gl;(this.dirtyVertices||this.dirtyIndices)&&this.update(),this.bind(e),this.indicesLength>0?r.drawElements(t,i,r.UNSIGNED_SHORT,s*2):r.drawArrays(t,s,i),this.unbind(e)}bind(e){let t=this.context.gl;t.bindBuffer(t.ARRAY_BUFFER,this.verticesBuffer);let s=0;for(let i=0;i<this.attributes.length;i++){let r=this.attributes[i],h=e.getAttributeLocation(r.name);t.enableVertexAttribArray(h),t.vertexAttribPointer(h,r.numElements,t.FLOAT,!1,this.elementsPerVertex*4,s*4),s+=r.numElements}this.indicesLength>0&&t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,this.indicesBuffer)}unbind(e){let t=this.context.gl;for(let s=0;s<this.attributes.length;s++){let i=this.attributes[s],r=e.getAttributeLocation(i.name);t.disableVertexAttribArray(r)}t.bindBuffer(t.ARRAY_BUFFER,null),this.indicesLength>0&&t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,null)}update(){let e=this.context.gl;this.dirtyVertices&&(this.verticesBuffer||(this.verticesBuffer=e.createBuffer()),e.bindBuffer(e.ARRAY_BUFFER,this.verticesBuffer),e.bufferData(e.ARRAY_BUFFER,this.vertices.subarray(0,this.verticesLength),e.DYNAMIC_DRAW),this.dirtyVertices=!1),this.dirtyIndices&&(this.indicesBuffer||(this.indicesBuffer=e.createBuffer()),e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,this.indicesBuffer),e.bufferData(e.ELEMENT_ARRAY_BUFFER,this.indices.subarray(0,this.indicesLength),e.DYNAMIC_DRAW),this.dirtyIndices=!1)}restore(){this.verticesBuffer=null,this.indicesBuffer=null,this.update()}dispose(){this.context.removeRestorable(this);let e=this.context.gl;e.deleteBuffer(this.verticesBuffer),e.deleteBuffer(this.indicesBuffer)}},Ht=class{constructor(e,t,s){this.name=e,this.type=t,this.numElements=s}},ue=class extends Ht{constructor(){super(Tt.POSITION,0,2)}},Gr=class extends Ht{constructor(){super(Tt.POSITION,0,3)}},Fs=class extends Ht{constructor(e=0){super(Tt.TEXCOORDS+(e==0?"":e),0,2)}},me=class extends Ht{constructor(){super(Tt.COLOR,0,4)}},Ai=class extends Ht{constructor(){super(Tt.COLOR2,0,4)}},Ci=(e=>(e[e.Float=0]="Float",e))(Ci||{}),Xt=1,Hr=769,Si=770,Ti=771,Ii=774,Xs=class Ut{static disableCulling=!1;context;drawCalls=0;static globalDrawCalls=0;isDrawing=!1;mesh;shader=null;lastTexture=null;verticesLength=0;indicesLength=0;srcColorBlend;srcAlphaBlend;dstBlend;cullWasEnabled=!1;constructor(t,s=!0,i=10920){if(i>10920)throw new Error("Can't have more than 10920 triangles per batch: "+i);this.context=t instanceof xt?t:new xt(t);let r=s?[new ue,new me,new Fs,new Ai]:[new ue,new me,new Fs];this.mesh=new ks(t,r,i,i*3);let h=this.context.gl;this.srcColorBlend=h.SRC_ALPHA,this.srcAlphaBlend=h.ONE,this.dstBlend=h.ONE_MINUS_SRC_ALPHA}begin(t){if(this.isDrawing)throw new Error("PolygonBatch is already drawing. Call PolygonBatch.end() before calling PolygonBatch.begin()");this.drawCalls=0,this.shader=t,this.lastTexture=null,this.isDrawing=!0;let s=this.context.gl;s.enable(s.BLEND),s.blendFuncSeparate(this.srcColorBlend,this.dstBlend,this.srcAlphaBlend,this.dstBlend),Ut.disableCulling&&(this.cullWasEnabled=s.isEnabled(s.CULL_FACE),this.cullWasEnabled&&s.disable(s.CULL_FACE))}static blendModesGL=[{srcRgb:Si,srcRgbPma:Xt,dstRgb:Ti,srcAlpha:Xt},{srcRgb:Si,srcRgbPma:Xt,dstRgb:Xt,srcAlpha:Xt},{srcRgb:Ii,srcRgbPma:Ii,dstRgb:Ti,srcAlpha:Xt},{srcRgb:Xt,srcRgbPma:Xt,dstRgb:Hr,srcAlpha:Xt}];setBlendMode(t,s){const i=Ut.blendModesGL[t],r=s?i.srcRgbPma:i.srcRgb,h=i.srcAlpha,l=i.dstRgb;if(this.srcColorBlend==r&&this.srcAlphaBlend==h&&this.dstBlend==l)return; Line truncated