wangjuncheng
2025-04-28 f54c45de2ec6dfadc825c064b75e6707513bd094
public/CimSDK/Workers/transcodeKTX2.js
@@ -3,7 +3,7 @@
 * Version 5.3.1
 */
import{a as rn}from"./chunk-CQELY6Z3.js";import{a as M}from"./chunk-YGIPMXAD.js";import{a as ie}from"./chunk-54HAFFPJ.js";import{a as _n}from"./chunk-5HWP5DW7.js";import{b as nn}from"./chunk-INT7THOB.js";import{a as Gt,c as or,d as sr,e as ge}from"./chunk-PPCZYYBW.js";var Rn=or((it,pt)=>{var Nt=function(){var i=typeof document<"u"&&document.currentScript?document.currentScript.src:void 0;return typeof __filename<"u"&&(i=i||__filename),function(f){f=f||{};var r=typeof f<"u"?f:{},C,l;r.ready=new Promise(function(e,t){C=e,l=t});var P={},F;for(F in r)r.hasOwnProperty(F)&&(P[F]=r[F]);var U=[],y="./this.program",m=function(e,t){throw t},V=!1,d=!1,p=!1,Q=!1;V=typeof window=="object",d=typeof importScripts=="function",p=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string",Q=!V&&!p&&!d;var T="";function X(e){return r.locateFile?r.locateFile(e,T):T+e}var oe,le,W,J,g,Fe;p?(d?T=Gt("path").dirname(T)+"/":T=__dirname+"/",oe=function(t,n){return g||(g=Gt("fs")),Fe||(Fe=Gt("path")),t=Fe.normalize(t),g.readFileSync(t,n?null:"utf8")},W=function(t){var n=oe(t,!0);return n.buffer||(n=new Uint8Array(n)),Se(n.buffer),n},process.argv.length>1&&(y=process.argv[1].replace(/\\/g,"/")),U=process.argv.slice(2),process.on("uncaughtException",function(e){if(!(e instanceof rr))throw e}),process.on("unhandledRejection",Me),m=function(e){process.exit(e)},r.inspect=function(){return"[Emscripten Module object]"}):Q?(typeof read<"u"&&(oe=function(t){return read(t)}),W=function(t){var n;return typeof readbuffer=="function"?new Uint8Array(readbuffer(t)):(n=read(t,"binary"),Se(typeof n=="object"),n)},typeof scriptArgs<"u"?U=scriptArgs:typeof arguments<"u"&&(U=arguments),typeof quit=="function"&&(m=function(e){quit(e)}),typeof print<"u"&&(typeof console>"u"&&(console={}),console.log=print,console.warn=console.error=typeof printErr<"u"?printErr:print)):(V||d)&&(d?T=self.location.href:typeof document<"u"&&document.currentScript&&(T=document.currentScript.src),i&&(T=i),T.indexOf("blob:")!==0?T=T.substr(0,T.lastIndexOf("/")+1):T="",oe=function(e){var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),t.responseText},d&&(W=function(e){var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}),le=function(e,t,n){var _=new XMLHttpRequest;_.open("GET",e,!0),_.responseType="arraybuffer",_.onload=function(){if(_.status==200||_.status==0&&_.response){t(_.response);return}n()},_.onerror=n,_.send(null)},J=function(e){document.title=e});var ot=r.print||console.log.bind(console),ee=r.printErr||console.warn.bind(console);for(F in P)P.hasOwnProperty(F)&&(r[F]=P[F]);P=null,r.arguments&&(U=r.arguments),r.thisProgram&&(y=r.thisProgram),r.quit&&(m=r.quit);var De=0,Ie=function(e){De=e},ae;r.wasmBinary&&(ae=r.wasmBinary);var st=r.noExitRuntime||!0;typeof WebAssembly!="object"&&Me("no native wasm support detected");var ce,de=!1,be;function Se(e,t){e||Me("Assertion failed: "+t)}var we=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function He(e,t,n){for(var _=t+n,o=t;e[o]&&!(o>=_);)++o;if(o-t>16&&e.subarray&&we)return we.decode(e.subarray(t,o));for(var a="";t<o;){var c=e[t++];if(!(c&128)){a+=String.fromCharCode(c);continue}var s=e[t++]&63;if((c&224)==192){a+=String.fromCharCode((c&31)<<6|s);continue}var R=e[t++]&63;if((c&240)==224?c=(c&15)<<12|s<<6|R:c=(c&7)<<18|s<<12|R<<6|e[t++]&63,c<65536)a+=String.fromCharCode(c);else{var u=c-65536;a+=String.fromCharCode(55296|u>>10,56320|u&1023)}}return a}function Xe(e,t){return e?He(D,e,t):""}function Rt(e,t,n,_){if(!(_>0))return 0;for(var o=n,a=n+_-1,c=0;c<e.length;++c){var s=e.charCodeAt(c);if(s>=55296&&s<=57343){var R=e.charCodeAt(++c);s=65536+((s&1023)<<10)|R&1023}if(s<=127){if(n>=a)break;t[n++]=s}else if(s<=2047){if(n+1>=a)break;t[n++]=192|s>>6,t[n++]=128|s&63}else if(s<=65535){if(n+2>=a)break;t[n++]=224|s>>12,t[n++]=128|s>>6&63,t[n++]=128|s&63}else{if(n+3>=a)break;t[n++]=240|s>>18,t[n++]=128|s>>12&63,t[n++]=128|s>>6&63,t[n++]=128|s&63}}return t[n]=0,n-o}function L(e,t,n){return Rt(e,D,t,n)}function j(e){for(var t=0,n=0;n<e.length;++n){var _=e.charCodeAt(n);_>=55296&&_<=57343&&(_=65536+((_&1023)<<10)|e.charCodeAt(++n)&1023),_<=127?++t:_<=2047?t+=2:_<=65535?t+=3:t+=4}return t}var Ae=typeof TextDecoder<"u"?new TextDecoder("utf-16le"):void 0;function at(e,t){for(var n=e,_=n>>1,o=_+t/2;!(_>=o)&&Ge[_];)++_;if(n=_<<1,n-e>32&&Ae)return Ae.decode(D.subarray(e,n));for(var a="",c=0;!(c>=t/2);++c){var s=fe[e+c*2>>1];if(s==0)break;a+=String.fromCharCode(s)}return a}function xe(e,t,n){if(n===void 0&&(n=2147483647),n<2)return 0;n-=2;for(var _=t,o=n<e.length*2?n/2:e.length,a=0;a<o;++a){var c=e.charCodeAt(a);fe[t>>1]=c,t+=2}return fe[t>>1]=0,t-_}function un(e){return e.length*2}function Tn(e,t){for(var n=0,_="";!(n>=t/4);){var o=w[e+n*4>>2];if(o==0)break;if(++n,o>=65536){var a=o-65536;_+=String.fromCharCode(55296|a>>10,56320|a&1023)}else _+=String.fromCharCode(o)}return _}function On(e,t,n){if(n===void 0&&(n=2147483647),n<4)return 0;for(var _=t,o=_+n-4,a=0;a<e.length;++a){var c=e.charCodeAt(a);if(c>=55296&&c<=57343){var s=e.charCodeAt(++a);c=65536+((c&1023)<<10)|s&1023}if(w[t>>2]=c,t+=4,t+4>o)break}return w[t>>2]=0,t-_}function ln(e){for(var t=0,n=0;n<e.length;++n){var _=e.charCodeAt(n);_>=55296&&_<=57343&&++n,t+=4}return t}function Mn(e,t){return e%t>0&&(e+=t-e%t),e}var ct,ke,D,fe,Ge,w,Y,Pt,Et;function vt(e){ct=e,r.HEAP8=ke=new Int8Array(e),r.HEAP16=fe=new Int16Array(e),r.HEAP32=w=new Int32Array(e),r.HEAPU8=D=new Uint8Array(e),r.HEAPU16=Ge=new Uint16Array(e),r.HEAPU32=Y=new Uint32Array(e),r.HEAPF32=Pt=new Float32Array(e),r.HEAPF64=Et=new Float64Array(e)}var Tr=r.INITIAL_MEMORY||16777216,Ve,ht=[],Ut=[],Kn=[],yt=[],Bn=!1;function Cn(){if(r.preRun)for(typeof r.preRun=="function"&&(r.preRun=[r.preRun]);r.preRun.length;)Gn(r.preRun.shift());$e(ht)}function Fn(){Bn=!0,$e(Ut)}function dn(){$e(Kn)}function Sn(){if(r.postRun)for(typeof r.postRun=="function"&&(r.postRun=[r.postRun]);r.postRun.length;)Nn(r.postRun.shift());$e(yt)}function Gn(e){ht.unshift(e)}function Vn(e){Ut.unshift(e)}function Nn(e){yt.unshift(e)}var ue=0,At=null,Ne=null;function pn(e){ue++,r.monitorRunDependencies&&r.monitorRunDependencies(ue)}function Pn(e){if(ue--,r.monitorRunDependencies&&r.monitorRunDependencies(ue),ue==0&&(At!==null&&(clearInterval(At),At=null),Ne)){var t=Ne;Ne=null,t()}}r.preloadedImages={},r.preloadedAudios={};function Me(e){r.onAbort&&r.onAbort(e),e+="",ee(e),de=!0,be=1,e="abort("+e+"). Build with -s ASSERTIONS=1 for more info.";var t=new WebAssembly.RuntimeError(e);throw l(t),t}function gt(e,t){return String.prototype.startsWith?e.startsWith(t):e.indexOf(t)===0}var En="data:application/octet-stream;base64,";function Lt(e){return gt(e,En)}var vn="file://";function mt(e){return gt(e,vn)}var x="basis_transcoder.wasm";Lt(x)||(x=X(x));function Dt(e){try{if(e==x&&ae)return new Uint8Array(ae);if(W)return W(e);throw"both async and sync fetching of the wasm failed"}catch(t){Me(t)}}function hn(){if(!ae&&(V||d)){if(typeof fetch=="function"&&!mt(x))return fetch(x,{credentials:"same-origin"}).then(function(e){if(!e.ok)throw"failed to load wasm binary file at '"+x+"'";return e.arrayBuffer()}).catch(function(){return Dt(x)});if(le)return new Promise(function(e,t){le(x,function(n){e(new Uint8Array(n))},t)})}return Promise.resolve().then(function(){return Dt(x)})}function Un(){var e={a:er};function t(c,s){var R=c.exports;r.asm=R,ce=r.asm.K,vt(ce.buffer),Ve=r.asm.O,Vn(r.asm.L),Pn("wasm-instantiate")}pn("wasm-instantiate");function n(c){t(c.instance)}function _(c){return hn().then(function(s){var R=WebAssembly.instantiate(s,e);return R}).then(c,function(s){ee("failed to asynchronously prepare wasm: "+s),Me(s)})}function o(){return!ae&&typeof WebAssembly.instantiateStreaming=="function"&&!Lt(x)&&!mt(x)&&typeof fetch=="function"?fetch(x,{credentials:"same-origin"}).then(function(c){var s=WebAssembly.instantiateStreaming(c,e);return s.then(n,function(R){return ee("wasm streaming compile failed: "+R),ee("falling back to ArrayBuffer instantiation"),_(n)})}):_(n)}if(r.instantiateWasm)try{var a=r.instantiateWasm(e,t);return a}catch(c){return ee("Module.instantiateWasm callback failed with error: "+c),!1}return o().catch(l),{}}function $e(e){for(;e.length>0;){var t=e.shift();if(typeof t=="function"){t(r);continue}var n=t.func;typeof n=="number"?t.arg===void 0?Ve.get(n)():Ve.get(n)(t.arg):n(t.arg===void 0?null:t.arg)}}var We={};function je(e){for(;e.length;){var t=e.pop(),n=e.pop();n(t)}}function pe(e){return this.fromWireType(Y[e>>2])}var Ke={},Te={},ze={},yn=48,gn=57;function Ye(e){if(e===void 0)return"_unknown";e=e.replace(/[^a-zA-Z0-9_]/g,"$");var t=e.charCodeAt(0);return t>=yn&&t<=gn?"_"+e:e}function qe(e,t){return e=Ye(e),new Function("body","return function "+e+`() {
import{a as rn}from"./chunk-6MN6BBPN.js";import{a as M}from"./chunk-YGIPMXAD.js";import{a as ie}from"./chunk-PZ34T7DL.js";import{a as _n}from"./chunk-5HWP5DW7.js";import{b as nn}from"./chunk-3K67FZLU.js";import{a as Gt,c as or,d as sr,e as ge}from"./chunk-55TU6MJR.js";var Rn=or((it,pt)=>{var Nt=function(){var i=typeof document<"u"&&document.currentScript?document.currentScript.src:void 0;return typeof __filename<"u"&&(i=i||__filename),function(f){f=f||{};var r=typeof f<"u"?f:{},C,l;r.ready=new Promise(function(e,t){C=e,l=t});var P={},F;for(F in r)r.hasOwnProperty(F)&&(P[F]=r[F]);var U=[],y="./this.program",m=function(e,t){throw t},V=!1,d=!1,p=!1,Q=!1;V=typeof window=="object",d=typeof importScripts=="function",p=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string",Q=!V&&!p&&!d;var T="";function X(e){return r.locateFile?r.locateFile(e,T):T+e}var oe,le,W,J,g,Fe;p?(d?T=Gt("path").dirname(T)+"/":T=__dirname+"/",oe=function(t,n){return g||(g=Gt("fs")),Fe||(Fe=Gt("path")),t=Fe.normalize(t),g.readFileSync(t,n?null:"utf8")},W=function(t){var n=oe(t,!0);return n.buffer||(n=new Uint8Array(n)),Se(n.buffer),n},process.argv.length>1&&(y=process.argv[1].replace(/\\/g,"/")),U=process.argv.slice(2),process.on("uncaughtException",function(e){if(!(e instanceof rr))throw e}),process.on("unhandledRejection",Me),m=function(e){process.exit(e)},r.inspect=function(){return"[Emscripten Module object]"}):Q?(typeof read<"u"&&(oe=function(t){return read(t)}),W=function(t){var n;return typeof readbuffer=="function"?new Uint8Array(readbuffer(t)):(n=read(t,"binary"),Se(typeof n=="object"),n)},typeof scriptArgs<"u"?U=scriptArgs:typeof arguments<"u"&&(U=arguments),typeof quit=="function"&&(m=function(e){quit(e)}),typeof print<"u"&&(typeof console>"u"&&(console={}),console.log=print,console.warn=console.error=typeof printErr<"u"?printErr:print)):(V||d)&&(d?T=self.location.href:typeof document<"u"&&document.currentScript&&(T=document.currentScript.src),i&&(T=i),T.indexOf("blob:")!==0?T=T.substr(0,T.lastIndexOf("/")+1):T="",oe=function(e){var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),t.responseText},d&&(W=function(e){var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}),le=function(e,t,n){var _=new XMLHttpRequest;_.open("GET",e,!0),_.responseType="arraybuffer",_.onload=function(){if(_.status==200||_.status==0&&_.response){t(_.response);return}n()},_.onerror=n,_.send(null)},J=function(e){document.title=e});var ot=r.print||console.log.bind(console),ee=r.printErr||console.warn.bind(console);for(F in P)P.hasOwnProperty(F)&&(r[F]=P[F]);P=null,r.arguments&&(U=r.arguments),r.thisProgram&&(y=r.thisProgram),r.quit&&(m=r.quit);var De=0,Ie=function(e){De=e},ae;r.wasmBinary&&(ae=r.wasmBinary);var st=r.noExitRuntime||!0;typeof WebAssembly!="object"&&Me("no native wasm support detected");var ce,de=!1,be;function Se(e,t){e||Me("Assertion failed: "+t)}var we=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function He(e,t,n){for(var _=t+n,o=t;e[o]&&!(o>=_);)++o;if(o-t>16&&e.subarray&&we)return we.decode(e.subarray(t,o));for(var a="";t<o;){var c=e[t++];if(!(c&128)){a+=String.fromCharCode(c);continue}var s=e[t++]&63;if((c&224)==192){a+=String.fromCharCode((c&31)<<6|s);continue}var R=e[t++]&63;if((c&240)==224?c=(c&15)<<12|s<<6|R:c=(c&7)<<18|s<<12|R<<6|e[t++]&63,c<65536)a+=String.fromCharCode(c);else{var u=c-65536;a+=String.fromCharCode(55296|u>>10,56320|u&1023)}}return a}function Xe(e,t){return e?He(D,e,t):""}function Rt(e,t,n,_){if(!(_>0))return 0;for(var o=n,a=n+_-1,c=0;c<e.length;++c){var s=e.charCodeAt(c);if(s>=55296&&s<=57343){var R=e.charCodeAt(++c);s=65536+((s&1023)<<10)|R&1023}if(s<=127){if(n>=a)break;t[n++]=s}else if(s<=2047){if(n+1>=a)break;t[n++]=192|s>>6,t[n++]=128|s&63}else if(s<=65535){if(n+2>=a)break;t[n++]=224|s>>12,t[n++]=128|s>>6&63,t[n++]=128|s&63}else{if(n+3>=a)break;t[n++]=240|s>>18,t[n++]=128|s>>12&63,t[n++]=128|s>>6&63,t[n++]=128|s&63}}return t[n]=0,n-o}function L(e,t,n){return Rt(e,D,t,n)}function j(e){for(var t=0,n=0;n<e.length;++n){var _=e.charCodeAt(n);_>=55296&&_<=57343&&(_=65536+((_&1023)<<10)|e.charCodeAt(++n)&1023),_<=127?++t:_<=2047?t+=2:_<=65535?t+=3:t+=4}return t}var Ae=typeof TextDecoder<"u"?new TextDecoder("utf-16le"):void 0;function at(e,t){for(var n=e,_=n>>1,o=_+t/2;!(_>=o)&&Ge[_];)++_;if(n=_<<1,n-e>32&&Ae)return Ae.decode(D.subarray(e,n));for(var a="",c=0;!(c>=t/2);++c){var s=fe[e+c*2>>1];if(s==0)break;a+=String.fromCharCode(s)}return a}function xe(e,t,n){if(n===void 0&&(n=2147483647),n<2)return 0;n-=2;for(var _=t,o=n<e.length*2?n/2:e.length,a=0;a<o;++a){var c=e.charCodeAt(a);fe[t>>1]=c,t+=2}return fe[t>>1]=0,t-_}function un(e){return e.length*2}function Tn(e,t){for(var n=0,_="";!(n>=t/4);){var o=w[e+n*4>>2];if(o==0)break;if(++n,o>=65536){var a=o-65536;_+=String.fromCharCode(55296|a>>10,56320|a&1023)}else _+=String.fromCharCode(o)}return _}function On(e,t,n){if(n===void 0&&(n=2147483647),n<4)return 0;for(var _=t,o=_+n-4,a=0;a<e.length;++a){var c=e.charCodeAt(a);if(c>=55296&&c<=57343){var s=e.charCodeAt(++a);c=65536+((c&1023)<<10)|s&1023}if(w[t>>2]=c,t+=4,t+4>o)break}return w[t>>2]=0,t-_}function ln(e){for(var t=0,n=0;n<e.length;++n){var _=e.charCodeAt(n);_>=55296&&_<=57343&&++n,t+=4}return t}function Mn(e,t){return e%t>0&&(e+=t-e%t),e}var ct,ke,D,fe,Ge,w,Y,Pt,Et;function vt(e){ct=e,r.HEAP8=ke=new Int8Array(e),r.HEAP16=fe=new Int16Array(e),r.HEAP32=w=new Int32Array(e),r.HEAPU8=D=new Uint8Array(e),r.HEAPU16=Ge=new Uint16Array(e),r.HEAPU32=Y=new Uint32Array(e),r.HEAPF32=Pt=new Float32Array(e),r.HEAPF64=Et=new Float64Array(e)}var Tr=r.INITIAL_MEMORY||16777216,Ve,ht=[],Ut=[],Kn=[],yt=[],Bn=!1;function Cn(){if(r.preRun)for(typeof r.preRun=="function"&&(r.preRun=[r.preRun]);r.preRun.length;)Gn(r.preRun.shift());$e(ht)}function Fn(){Bn=!0,$e(Ut)}function dn(){$e(Kn)}function Sn(){if(r.postRun)for(typeof r.postRun=="function"&&(r.postRun=[r.postRun]);r.postRun.length;)Nn(r.postRun.shift());$e(yt)}function Gn(e){ht.unshift(e)}function Vn(e){Ut.unshift(e)}function Nn(e){yt.unshift(e)}var ue=0,At=null,Ne=null;function pn(e){ue++,r.monitorRunDependencies&&r.monitorRunDependencies(ue)}function Pn(e){if(ue--,r.monitorRunDependencies&&r.monitorRunDependencies(ue),ue==0&&(At!==null&&(clearInterval(At),At=null),Ne)){var t=Ne;Ne=null,t()}}r.preloadedImages={},r.preloadedAudios={};function Me(e){r.onAbort&&r.onAbort(e),e+="",ee(e),de=!0,be=1,e="abort("+e+"). Build with -s ASSERTIONS=1 for more info.";var t=new WebAssembly.RuntimeError(e);throw l(t),t}function gt(e,t){return String.prototype.startsWith?e.startsWith(t):e.indexOf(t)===0}var En="data:application/octet-stream;base64,";function Lt(e){return gt(e,En)}var vn="file://";function mt(e){return gt(e,vn)}var x="basis_transcoder.wasm";Lt(x)||(x=X(x));function Dt(e){try{if(e==x&&ae)return new Uint8Array(ae);if(W)return W(e);throw"both async and sync fetching of the wasm failed"}catch(t){Me(t)}}function hn(){if(!ae&&(V||d)){if(typeof fetch=="function"&&!mt(x))return fetch(x,{credentials:"same-origin"}).then(function(e){if(!e.ok)throw"failed to load wasm binary file at '"+x+"'";return e.arrayBuffer()}).catch(function(){return Dt(x)});if(le)return new Promise(function(e,t){le(x,function(n){e(new Uint8Array(n))},t)})}return Promise.resolve().then(function(){return Dt(x)})}function Un(){var e={a:er};function t(c,s){var R=c.exports;r.asm=R,ce=r.asm.K,vt(ce.buffer),Ve=r.asm.O,Vn(r.asm.L),Pn("wasm-instantiate")}pn("wasm-instantiate");function n(c){t(c.instance)}function _(c){return hn().then(function(s){var R=WebAssembly.instantiate(s,e);return R}).then(c,function(s){ee("failed to asynchronously prepare wasm: "+s),Me(s)})}function o(){return!ae&&typeof WebAssembly.instantiateStreaming=="function"&&!Lt(x)&&!mt(x)&&typeof fetch=="function"?fetch(x,{credentials:"same-origin"}).then(function(c){var s=WebAssembly.instantiateStreaming(c,e);return s.then(n,function(R){return ee("wasm streaming compile failed: "+R),ee("falling back to ArrayBuffer instantiation"),_(n)})}):_(n)}if(r.instantiateWasm)try{var a=r.instantiateWasm(e,t);return a}catch(c){return ee("Module.instantiateWasm callback failed with error: "+c),!1}return o().catch(l),{}}function $e(e){for(;e.length>0;){var t=e.shift();if(typeof t=="function"){t(r);continue}var n=t.func;typeof n=="number"?t.arg===void 0?Ve.get(n)():Ve.get(n)(t.arg):n(t.arg===void 0?null:t.arg)}}var We={};function je(e){for(;e.length;){var t=e.pop(),n=e.pop();n(t)}}function pe(e){return this.fromWireType(Y[e>>2])}var Ke={},Te={},ze={},yn=48,gn=57;function Ye(e){if(e===void 0)return"_unknown";e=e.replace(/[^a-zA-Z0-9_]/g,"$");var t=e.charCodeAt(0);return t>=yn&&t<=gn?"_"+e:e}function qe(e,t){return e=Ye(e),new Function("body","return function "+e+`() {
    "use strict";    return body.apply(this, arguments);
};
`)(t)}function ft(e,t){var n=qe(t,function(_){this.name=t,this.message=_;var o=new Error(_).stack;o!==void 0&&(this.stack=this.toString()+`