iflow-engine-base-3d 3.12.28 → 3.12.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { E as a } from "./chunks/engine-3d-
|
|
2
|
-
import { M as d } from "./chunks/engine-3d-
|
|
1
|
+
import { E as a } from "./chunks/engine-3d-BoZgOkJ1.js";
|
|
2
|
+
import { M as d } from "./chunks/engine-3d-BoZgOkJ1.js";
|
|
3
3
|
import { s, a as t, b as l } from "./chunks/sdk-assets-DHhjv3WO.js";
|
|
4
4
|
async function r(e) {
|
|
5
5
|
e?.assetFiles ? await s(e.assetFiles) : e?.assetFile ? await t(e.assetFile) : e?.assetBaseUrl && await s(null), e?.assetBaseUrl && l(e.assetBaseUrl);
|
|
@@ -5203,7 +5203,7 @@ void main() {
|
|
|
5203
5203
|
|
|
5204
5204
|
gl_FragColor = color;
|
|
5205
5205
|
}
|
|
5206
|
-
`},vm=.5,_m=1.1,qm=1;class yJ{engine;composer;saturationPass;ssaoPass;gtaoPass;outputPass;fxaaPass;constructor(A){this.engine=A}applyClippingToAmbientOcclusionPass(A){const t=Array.isArray(this.engine.sectionPlane)?this.engine.sectionPlane:null,e=A?.normalMaterial;e&&(e.clippingPlanes=t,e.needsUpdate=!0)}syncAmbientOcclusionClipping(){this.applyClippingToAmbientOcclusionPass(this.gtaoPass),this.applyClippingToAmbientOcclusionPass(this.ssaoPass)}excludeClippingHelpersFromGtao(A){if(!A||A.__clippingHelpersExcludedFromGtao||typeof A._overrideVisibility!="function"||typeof A._restoreVisibility!="function")return;const t=A._overrideVisibility.bind(A),e=A._restoreVisibility.bind(A),i=[];A._overrideVisibility=()=>{t(),i.length=0,this.engine.scene?.traverse(n=>{n?.isMesh!==!0||n.visible!==!0||!this.isAmbientOcclusionExcluded(n)||(n.visible=!1,i.push(n))})},A._restoreVisibility=()=>{e(),i.forEach(n=>{n.visible=!0}),i.length=0},A.__clippingHelpersExcludedFromGtao=!0}isAmbientOcclusionExcluded(A){let t=A;for(;t;){if(t.name==="ClippingBox"||t.userData?.excludeFromAmbientOcclusion===!0)return!0;t=t.parent}return!1}syncRenderTargetDepthTexture(A){const t=A?.depthTexture,e=A?.width,i=A?.height;if(!(!t||!e||!i)){if(!t.image){t.image={width:e,height:i},t.needsUpdate=!0;return}(t.image.width!==e||t.image.height!==i)&&(t.image.width=e,t.image.height=i,t.needsUpdate=!0)}}syncAmbientOcclusionDepthTextures(){this.syncRenderTargetDepthTexture(this.gtaoPass?.normalRenderTarget),this.syncRenderTargetDepthTexture(this.ssaoPass?.normalRenderTarget)}resize(A,t){if(A===void 0||t===void 0){const n=this.engine.deviceModule.getContainerSize();A=A??n.width,t=t??n.height}if(!A||!t||!this.composer)return;const e=this.engine.renderer?.getPixelRatio?.()??window.devicePixelRatio??1;this.composer.setPixelRatio(e),this.composer.setSize(A,t);const i=this.composer.passes.find(n=>n instanceof rE&&n.material.uniforms.resolution);i&&(i.material.uniforms.resolution.value.x=1/(A*e),i.material.uniforms.resolution.value.y=1/(t*e)),this.syncAmbientOcclusionDepthTextures()}render(){this.composer&&(this.syncAmbientOcclusionDepthTextures(),this.composer.render())}init(){const{width:A,height:t}=this.engine.deviceModule.getContainerSize(),e=this.engine.scene,i=this.engine.camera,n=this.engine.renderer,o=this.engine.deviceModule.isMobile(),g=this.engine.renderer?.getPixelRatio?.()??window.devicePixelRatio??1,a=new pe(A,t,{minFilter:Yt,magFilter:Yt,format:re,samples:o?0:4});a.texture.colorSpace=si,this.composer=new hJ(n,a),this.composer.setPixelRatio(g),this.composer.setSize(A,t);const r=new CJ(e,i);this.composer.addPass(r),this.gtaoPass=new Us(e,i,A,t),this.gtaoPass.output=Us.OUTPUT.Default,this.gtaoPass.blendIntensity=vm,this.gtaoPass.enabled=!1,this.gtaoPass.normalMaterial.side=Tt,this.gtaoPass.normalMaterial.needsUpdate=!0,this.excludeClippingHelpersFromGtao(this.gtaoPass),this.gtaoPass.updateGtaoMaterial&&this.gtaoPass.updateGtaoMaterial({radius:.45,thickness:1.2,distanceExponent:1.3,distanceFallOff:1.35,scale:5,samples:10,screenSpaceRadius:!1}),this.gtaoPass.updatePdMaterial&&this.gtaoPass.updatePdMaterial({radius:6,samples:32,rings:3,radiusExponent:2}),this.applyClippingToAmbientOcclusionPass(this.gtaoPass),this.composer.addPass(this.gtaoPass),this.ssaoPass=new Hn(e,i,A,t),this.ssaoPass.kernelRadius=8,this.ssaoPass.minDistance=.005,this.ssaoPass.maxDistance=.1,this.ssaoPass.output=Hn.OUTPUT.Default,this.ssaoPass.enabled=!1,this.excludeClippingHelpersFromGtao(this.ssaoPass),this.applyClippingToAmbientOcclusionPass(this.ssaoPass),this.composer.addPass(this.ssaoPass),this.saturationPass=new rE(MJ),this.saturationPass.uniforms.saturation.value=_m,this.saturationPass.uniforms.contrast.value=qm,this.saturationPass.enabled=!1,this.composer.addPass(this.saturationPass),this.outputPass=new dJ,this.outputPass.enabled=!0,this.composer.addPass(this.outputPass),this.fxaaPass=new rE(fJ),this.fxaaPass.material.uniforms.resolution.value.x=1/(A*g),this.fxaaPass.material.uniforms.resolution.value.y=1/(t*g),this.fxaaPass.enabled=o,this.composer.addPass(this.fxaaPass),this.syncAmbientOcclusionDepthTextures()}}function $m(s,A){return function(){return s.apply(A,arguments)}}const{toString:pJ}=Object.prototype,{getPrototypeOf:nf}=Object,{iterator:QE,toStringTag:AP}=Symbol,dE=(s=>A=>{const t=pJ.call(A);return s[t]||(s[t]=t.slice(8,-1).toLowerCase())})(Object.create(null)),Xs=s=>(s=s.toLowerCase(),A=>dE(A)===s),fE=s=>A=>typeof A===s,{isArray:wr}=Array,ur=fE("undefined");function Ml(s){return s!==null&&!ur(s)&&s.constructor!==null&&!ur(s.constructor)&&_i(s.constructor.isBuffer)&&s.constructor.isBuffer(s)}const tP=Xs("ArrayBuffer");function DJ(s){let A;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?A=ArrayBuffer.isView(s):A=s&&s.buffer&&tP(s.buffer),A}const wJ=fE("string"),_i=fE("function"),eP=fE("number"),yl=s=>s!==null&&typeof s=="object",uJ=s=>s===!0||s===!1,ME=s=>{if(dE(s)!=="object")return!1;const A=nf(s);return(A===null||A===Object.prototype||Object.getPrototypeOf(A)===null)&&!(AP in s)&&!(QE in s)},mJ=s=>{if(!yl(s)||Ml(s))return!1;try{return Object.keys(s).length===0&&Object.getPrototypeOf(s)===Object.prototype}catch{return!1}},PJ=Xs("Date"),SJ=Xs("File"),YJ=Xs("Blob"),FJ=Xs("FileList"),bJ=s=>yl(s)&&_i(s.pipe),WJ=s=>{let A;return s&&(typeof FormData=="function"&&s instanceof FormData||_i(s.append)&&((A=dE(s))==="formdata"||A==="object"&&_i(s.toString)&&s.toString()==="[object FormData]"))},GJ=Xs("URLSearchParams"),[TJ,KJ,jJ,RJ]=["ReadableStream","Request","Response","Headers"].map(Xs),ZJ=s=>s.trim?s.trim():s.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function pl(s,A,{allOwnKeys:t=!1}={}){if(s===null||typeof s>"u")return;let e,i;if(typeof s!="object"&&(s=[s]),wr(s))for(e=0,i=s.length;e<i;e++)A.call(null,s[e],e,s);else{if(Ml(s))return;const n=t?Object.getOwnPropertyNames(s):Object.keys(s),o=n.length;let g;for(e=0;e<o;e++)g=n[e],A.call(null,s[g],g,s)}}function iP(s,A){if(Ml(s))return null;A=A.toLowerCase();const t=Object.keys(s);let e=t.length,i;for(;e-- >0;)if(i=t[e],A===i.toLowerCase())return i;return null}const Ng=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,sP=s=>!ur(s)&&s!==Ng;function of(){const{caseless:s,skipUndefined:A}=sP(this)&&this||{},t={},e=(i,n)=>{const o=s&&iP(t,n)||n;ME(t[o])&&ME(i)?t[o]=of(t[o],i):ME(i)?t[o]=of({},i):wr(i)?t[o]=i.slice():(!A||!ur(i))&&(t[o]=i)};for(let i=0,n=arguments.length;i<n;i++)arguments[i]&&pl(arguments[i],e);return t}const NJ=(s,A,t,{allOwnKeys:e}={})=>(pl(A,(i,n)=>{t&&_i(i)?s[n]=$m(i,t):s[n]=i},{allOwnKeys:e}),s),UJ=s=>(s.charCodeAt(0)===65279&&(s=s.slice(1)),s),XJ=(s,A,t,e)=>{s.prototype=Object.create(A.prototype,e),s.prototype.constructor=s,Object.defineProperty(s,"super",{value:A.prototype}),t&&Object.assign(s.prototype,t)},JJ=(s,A,t,e)=>{let i,n,o;const g={};if(A=A||{},s==null)return A;do{for(i=Object.getOwnPropertyNames(s),n=i.length;n-- >0;)o=i[n],(!e||e(o,s,A))&&!g[o]&&(A[o]=s[o],g[o]=!0);s=t!==!1&&nf(s)}while(s&&(!t||t(s,A))&&s!==Object.prototype);return A},xJ=(s,A,t)=>{s=String(s),(t===void 0||t>s.length)&&(t=s.length),t-=A.length;const e=s.indexOf(A,t);return e!==-1&&e===t},kJ=s=>{if(!s)return null;if(wr(s))return s;let A=s.length;if(!eP(A))return null;const t=new Array(A);for(;A-- >0;)t[A]=s[A];return t},VJ=(s=>A=>s&&A instanceof s)(typeof Uint8Array<"u"&&nf(Uint8Array)),HJ=(s,A)=>{const e=(s&&s[QE]).call(s);let i;for(;(i=e.next())&&!i.done;){const n=i.value;A.call(s,n[0],n[1])}},OJ=(s,A)=>{let t;const e=[];for(;(t=s.exec(A))!==null;)e.push(t);return e},LJ=Xs("HTMLFormElement"),zJ=s=>s.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(t,e,i){return e.toUpperCase()+i}),nP=(({hasOwnProperty:s})=>(A,t)=>s.call(A,t))(Object.prototype),vJ=Xs("RegExp"),oP=(s,A)=>{const t=Object.getOwnPropertyDescriptors(s),e={};pl(t,(i,n)=>{let o;(o=A(i,n,s))!==!1&&(e[n]=o||i)}),Object.defineProperties(s,e)},_J=s=>{oP(s,(A,t)=>{if(_i(s)&&["arguments","caller","callee"].indexOf(t)!==-1)return!1;const e=s[t];if(_i(e)){if(A.enumerable=!1,"writable"in A){A.writable=!1;return}A.set||(A.set=()=>{throw Error("Can not rewrite read-only method '"+t+"'")})}})},qJ=(s,A)=>{const t={},e=i=>{i.forEach(n=>{t[n]=!0})};return wr(s)?e(s):e(String(s).split(A)),t},$J=()=>{},Ax=(s,A)=>s!=null&&Number.isFinite(s=+s)?s:A;function tx(s){return!!(s&&_i(s.append)&&s[AP]==="FormData"&&s[QE])}const ex=s=>{const A=new Array(10),t=(e,i)=>{if(yl(e)){if(A.indexOf(e)>=0)return;if(Ml(e))return e;if(!("toJSON"in e)){A[i]=e;const n=wr(e)?[]:{};return pl(e,(o,g)=>{const a=t(o,i+1);!ur(a)&&(n[g]=a)}),A[i]=void 0,n}}return e};return t(s,0)},ix=Xs("AsyncFunction"),sx=s=>s&&(yl(s)||_i(s))&&_i(s.then)&&_i(s.catch),gP=((s,A)=>s?setImmediate:A?((t,e)=>(Ng.addEventListener("message",({source:i,data:n})=>{i===Ng&&n===t&&e.length&&e.shift()()},!1),i=>{e.push(i),Ng.postMessage(t,"*")}))(`axios@${Math.random()}`,[]):t=>setTimeout(t))(typeof setImmediate=="function",_i(Ng.postMessage)),nx=typeof queueMicrotask<"u"?queueMicrotask.bind(Ng):typeof process<"u"&&process.nextTick||gP,PA={isArray:wr,isArrayBuffer:tP,isBuffer:Ml,isFormData:WJ,isArrayBufferView:DJ,isString:wJ,isNumber:eP,isBoolean:uJ,isObject:yl,isPlainObject:ME,isEmptyObject:mJ,isReadableStream:TJ,isRequest:KJ,isResponse:jJ,isHeaders:RJ,isUndefined:ur,isDate:PJ,isFile:SJ,isBlob:YJ,isRegExp:vJ,isFunction:_i,isStream:bJ,isURLSearchParams:GJ,isTypedArray:VJ,isFileList:FJ,forEach:pl,merge:of,extend:NJ,trim:ZJ,stripBOM:UJ,inherits:XJ,toFlatObject:JJ,kindOf:dE,kindOfTest:Xs,endsWith:xJ,toArray:kJ,forEachEntry:HJ,matchAll:OJ,isHTMLForm:LJ,hasOwnProperty:nP,hasOwnProp:nP,reduceDescriptors:oP,freezeMethods:_J,toObjectSet:qJ,toCamelCase:zJ,noop:$J,toFiniteNumber:Ax,findKey:iP,global:Ng,isContextDefined:sP,isSpecCompliantForm:tx,toJSONObject:ex,isAsyncFn:ix,isThenable:sx,setImmediate:gP,asap:nx,isIterable:s=>s!=null&&_i(s[QE])};function Dt(s,A,t,e,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=s,this.name="AxiosError",A&&(this.code=A),t&&(this.config=t),e&&(this.request=e),i&&(this.response=i,this.status=i.status?i.status:null)}PA.inherits(Dt,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:PA.toJSONObject(this.config),code:this.code,status:this.status}}});const aP=Dt.prototype,rP={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(s=>{rP[s]={value:s}}),Object.defineProperties(Dt,rP),Object.defineProperty(aP,"isAxiosError",{value:!0}),Dt.from=(s,A,t,e,i,n)=>{const o=Object.create(aP);PA.toFlatObject(s,o,function(I){return I!==Error.prototype},r=>r!=="isAxiosError");const g=s&&s.message?s.message:"Error",a=A==null&&s?s.code:A;return Dt.call(o,g,a,t,e,i),s&&o.cause==null&&Object.defineProperty(o,"cause",{value:s,configurable:!0}),o.name=s&&s.name||"Error",n&&Object.assign(o,n),o};const ox=null;function gf(s){return PA.isPlainObject(s)||PA.isArray(s)}function IP(s){return PA.endsWith(s,"[]")?s.slice(0,-2):s}function lP(s,A,t){return s?s.concat(A).map(function(i,n){return i=IP(i),!t&&n?"["+i+"]":i}).join(t?".":""):A}function gx(s){return PA.isArray(s)&&!s.some(gf)}const ax=PA.toFlatObject(PA,{},null,function(A){return/^is[A-Z]/.test(A)});function yE(s,A,t){if(!PA.isObject(s))throw new TypeError("target must be an object");A=A||new FormData,t=PA.toFlatObject(t,{metaTokens:!0,dots:!1,indexes:!1},!1,function(c,Q){return!PA.isUndefined(Q[c])});const e=t.metaTokens,i=t.visitor||I,n=t.dots,o=t.indexes,a=(t.Blob||typeof Blob<"u"&&Blob)&&PA.isSpecCompliantForm(A);if(!PA.isFunction(i))throw new TypeError("visitor must be a function");function r(E){if(E===null)return"";if(PA.isDate(E))return E.toISOString();if(PA.isBoolean(E))return E.toString();if(!a&&PA.isBlob(E))throw new Dt("Blob is not supported. Use a Buffer instead.");return PA.isArrayBuffer(E)||PA.isTypedArray(E)?a&&typeof Blob=="function"?new Blob([E]):Buffer.from(E):E}function I(E,c,Q){let C=E;if(E&&!Q&&typeof E=="object"){if(PA.endsWith(c,"{}"))c=e?c:c.slice(0,-2),E=JSON.stringify(E);else if(PA.isArray(E)&&gx(E)||(PA.isFileList(E)||PA.endsWith(c,"[]"))&&(C=PA.toArray(E)))return c=IP(c),C.forEach(function(M,y){!(PA.isUndefined(M)||M===null)&&A.append(o===!0?lP([c],y,n):o===null?c:c+"[]",r(M))}),!1}return gf(E)?!0:(A.append(lP(Q,c,n),r(E)),!1)}const l=[],h=Object.assign(ax,{defaultVisitor:I,convertValue:r,isVisitable:gf});function B(E,c){if(!PA.isUndefined(E)){if(l.indexOf(E)!==-1)throw Error("Circular reference detected in "+c.join("."));l.push(E),PA.forEach(E,function(C,d){(!(PA.isUndefined(C)||C===null)&&i.call(A,C,PA.isString(d)?d.trim():d,c,h))===!0&&B(C,c?c.concat(d):[d])}),l.pop()}}if(!PA.isObject(s))throw new TypeError("data must be an object");return B(s),A}function BP(s){const A={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(s).replace(/[!'()~]|%20|%00/g,function(e){return A[e]})}function af(s,A){this._pairs=[],s&&yE(s,this,A)}const hP=af.prototype;hP.append=function(A,t){this._pairs.push([A,t])},hP.toString=function(A){const t=A?function(e){return A.call(this,e,BP)}:BP;return this._pairs.map(function(i){return t(i[0])+"="+t(i[1])},"").join("&")};function rx(s){return encodeURIComponent(s).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function CP(s,A,t){if(!A)return s;const e=t&&t.encode||rx;PA.isFunction(t)&&(t={serialize:t});const i=t&&t.serialize;let n;if(i?n=i(A,t):n=PA.isURLSearchParams(A)?A.toString():new af(A,t).toString(e),n){const o=s.indexOf("#");o!==-1&&(s=s.slice(0,o)),s+=(s.indexOf("?")===-1?"?":"&")+n}return s}class EP{constructor(){this.handlers=[]}use(A,t,e){return this.handlers.push({fulfilled:A,rejected:t,synchronous:e?e.synchronous:!1,runWhen:e?e.runWhen:null}),this.handlers.length-1}eject(A){this.handlers[A]&&(this.handlers[A]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(A){PA.forEach(this.handlers,function(e){e!==null&&A(e)})}}const cP={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Ix={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:af,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},rf=typeof window<"u"&&typeof document<"u",If=typeof navigator=="object"&&navigator||void 0,lx=rf&&(!If||["ReactNative","NativeScript","NS"].indexOf(If.product)<0),Bx=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",hx=rf&&window.location.href||"http://localhost",Pi={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:rf,hasStandardBrowserEnv:lx,hasStandardBrowserWebWorkerEnv:Bx,navigator:If,origin:hx},Symbol.toStringTag,{value:"Module"})),...Ix};function Cx(s,A){return yE(s,new Pi.classes.URLSearchParams,{visitor:function(t,e,i,n){return Pi.isNode&&PA.isBuffer(t)?(this.append(e,t.toString("base64")),!1):n.defaultVisitor.apply(this,arguments)},...A})}function Ex(s){return PA.matchAll(/\w+|\[(\w*)]/g,s).map(A=>A[0]==="[]"?"":A[1]||A[0])}function cx(s){const A={},t=Object.keys(s);let e;const i=t.length;let n;for(e=0;e<i;e++)n=t[e],A[n]=s[n];return A}function QP(s){function A(t,e,i,n){let o=t[n++];if(o==="__proto__")return!0;const g=Number.isFinite(+o),a=n>=t.length;return o=!o&&PA.isArray(i)?i.length:o,a?(PA.hasOwnProp(i,o)?i[o]=[i[o],e]:i[o]=e,!g):((!i[o]||!PA.isObject(i[o]))&&(i[o]=[]),A(t,e,i[o],n)&&PA.isArray(i[o])&&(i[o]=cx(i[o])),!g)}if(PA.isFormData(s)&&PA.isFunction(s.entries)){const t={};return PA.forEachEntry(s,(e,i)=>{A(Ex(e),i,t,0)}),t}return null}function Qx(s,A,t){if(PA.isString(s))try{return(A||JSON.parse)(s),PA.trim(s)}catch(e){if(e.name!=="SyntaxError")throw e}return(t||JSON.stringify)(s)}const Dl={transitional:cP,adapter:["xhr","http","fetch"],transformRequest:[function(A,t){const e=t.getContentType()||"",i=e.indexOf("application/json")>-1,n=PA.isObject(A);if(n&&PA.isHTMLForm(A)&&(A=new FormData(A)),PA.isFormData(A))return i?JSON.stringify(QP(A)):A;if(PA.isArrayBuffer(A)||PA.isBuffer(A)||PA.isStream(A)||PA.isFile(A)||PA.isBlob(A)||PA.isReadableStream(A))return A;if(PA.isArrayBufferView(A))return A.buffer;if(PA.isURLSearchParams(A))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),A.toString();let g;if(n){if(e.indexOf("application/x-www-form-urlencoded")>-1)return Cx(A,this.formSerializer).toString();if((g=PA.isFileList(A))||e.indexOf("multipart/form-data")>-1){const a=this.env&&this.env.FormData;return yE(g?{"files[]":A}:A,a&&new a,this.formSerializer)}}return n||i?(t.setContentType("application/json",!1),Qx(A)):A}],transformResponse:[function(A){const t=this.transitional||Dl.transitional,e=t&&t.forcedJSONParsing,i=this.responseType==="json";if(PA.isResponse(A)||PA.isReadableStream(A))return A;if(A&&PA.isString(A)&&(e&&!this.responseType||i)){const o=!(t&&t.silentJSONParsing)&&i;try{return JSON.parse(A,this.parseReviver)}catch(g){if(o)throw g.name==="SyntaxError"?Dt.from(g,Dt.ERR_BAD_RESPONSE,this,null,this.response):g}}return A}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Pi.classes.FormData,Blob:Pi.classes.Blob},validateStatus:function(A){return A>=200&&A<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};PA.forEach(["delete","get","head","post","put","patch"],s=>{Dl.headers[s]={}});const dx=PA.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),fx=s=>{const A={};let t,e,i;return s&&s.split(`
|
|
5206
|
+
`},vm=.5,_m=1.1,qm=1;class yJ{engine;composer;saturationPass;ssaoPass;gtaoPass;outputPass;fxaaPass;constructor(A){this.engine=A}applyClippingToAmbientOcclusionPass(A){const t=Array.isArray(this.engine.sectionPlane)?this.engine.sectionPlane:null,e=A?.normalMaterial;e&&(e.clippingPlanes=t,e.needsUpdate=!0)}syncAmbientOcclusionClipping(){this.applyClippingToAmbientOcclusionPass(this.gtaoPass),this.applyClippingToAmbientOcclusionPass(this.ssaoPass)}excludeClippingHelpersFromGtao(A){if(!A||A.__clippingHelpersExcludedFromGtao||typeof A._overrideVisibility!="function"||typeof A._restoreVisibility!="function")return;const t=A._overrideVisibility.bind(A),e=A._restoreVisibility.bind(A),i=[];A._overrideVisibility=()=>{t(),i.length=0,this.engine.scene?.traverse(n=>{n?.isMesh!==!0||n.visible!==!0||!this.isAmbientOcclusionExcluded(n)||(n.visible=!1,i.push(n))})},A._restoreVisibility=()=>{e(),i.forEach(n=>{n.visible=!0}),i.length=0},A.__clippingHelpersExcludedFromGtao=!0}isAmbientOcclusionExcluded(A){let t=A;for(;t;){if(t.name==="ClippingBox"||t.userData?.excludeFromAmbientOcclusion===!0)return!0;t=t.parent}return!1}syncRenderTargetDepthTexture(A){const t=A?.depthTexture,e=A?.width,i=A?.height;if(!(!t||!e||!i)){if(!t.image){t.image={width:e,height:i},t.needsUpdate=!0;return}(t.image.width!==e||t.image.height!==i)&&(t.image.width=e,t.image.height=i,t.needsUpdate=!0)}}syncAmbientOcclusionDepthTextures(){this.syncRenderTargetDepthTexture(this.gtaoPass?.normalRenderTarget),this.syncRenderTargetDepthTexture(this.ssaoPass?.normalRenderTarget)}resize(A,t){if(A===void 0||t===void 0){const n=this.engine.deviceModule.getContainerSize();A=A??n.width,t=t??n.height}if(!A||!t||!this.composer)return;const e=this.engine.renderer?.getPixelRatio?.()??window.devicePixelRatio??1;this.composer.setPixelRatio(e),this.composer.setSize(A,t);const i=this.composer.passes.find(n=>n instanceof rE&&n.material.uniforms.resolution);i&&(i.material.uniforms.resolution.value.x=1/(A*e),i.material.uniforms.resolution.value.y=1/(t*e)),this.syncAmbientOcclusionDepthTextures()}render(){this.composer&&(this.syncAmbientOcclusionDepthTextures(),this.composer.render())}init(){const{width:A,height:t}=this.engine.deviceModule.getContainerSize(),e=this.engine.scene,i=this.engine.camera,n=this.engine.renderer,o=this.engine.deviceModule.isMobile(),g=this.engine.renderer?.getPixelRatio?.()??window.devicePixelRatio??1,a=new pe(A,t,{minFilter:Yt,magFilter:Yt,format:re,samples:o?2:4});a.texture.colorSpace=si,this.composer=new hJ(n,a),this.composer.setPixelRatio(g),this.composer.setSize(A,t);const r=new CJ(e,i);this.composer.addPass(r),this.gtaoPass=new Us(e,i,A,t),this.gtaoPass.output=Us.OUTPUT.Default,this.gtaoPass.blendIntensity=vm,this.gtaoPass.enabled=!1,this.gtaoPass.normalMaterial.side=Tt,this.gtaoPass.normalMaterial.needsUpdate=!0,this.excludeClippingHelpersFromGtao(this.gtaoPass),this.gtaoPass.updateGtaoMaterial&&this.gtaoPass.updateGtaoMaterial({radius:.45,thickness:1.2,distanceExponent:1.3,distanceFallOff:1.35,scale:5,samples:10,screenSpaceRadius:!1}),this.gtaoPass.updatePdMaterial&&this.gtaoPass.updatePdMaterial({radius:6,samples:32,rings:3,radiusExponent:2}),this.applyClippingToAmbientOcclusionPass(this.gtaoPass),this.composer.addPass(this.gtaoPass),this.ssaoPass=new Hn(e,i,A,t),this.ssaoPass.kernelRadius=8,this.ssaoPass.minDistance=.005,this.ssaoPass.maxDistance=.1,this.ssaoPass.output=Hn.OUTPUT.Default,this.ssaoPass.enabled=!1,this.excludeClippingHelpersFromGtao(this.ssaoPass),this.applyClippingToAmbientOcclusionPass(this.ssaoPass),this.composer.addPass(this.ssaoPass),this.saturationPass=new rE(MJ),this.saturationPass.uniforms.saturation.value=_m,this.saturationPass.uniforms.contrast.value=qm,this.saturationPass.enabled=!1,this.composer.addPass(this.saturationPass),this.outputPass=new dJ,this.outputPass.enabled=!0,this.composer.addPass(this.outputPass),this.fxaaPass=new rE(fJ),this.fxaaPass.material.uniforms.resolution.value.x=1/(A*g),this.fxaaPass.material.uniforms.resolution.value.y=1/(t*g),this.fxaaPass.enabled=o,this.composer.addPass(this.fxaaPass),this.syncAmbientOcclusionDepthTextures()}}function $m(s,A){return function(){return s.apply(A,arguments)}}const{toString:pJ}=Object.prototype,{getPrototypeOf:nf}=Object,{iterator:QE,toStringTag:AP}=Symbol,dE=(s=>A=>{const t=pJ.call(A);return s[t]||(s[t]=t.slice(8,-1).toLowerCase())})(Object.create(null)),Xs=s=>(s=s.toLowerCase(),A=>dE(A)===s),fE=s=>A=>typeof A===s,{isArray:wr}=Array,ur=fE("undefined");function Ml(s){return s!==null&&!ur(s)&&s.constructor!==null&&!ur(s.constructor)&&_i(s.constructor.isBuffer)&&s.constructor.isBuffer(s)}const tP=Xs("ArrayBuffer");function DJ(s){let A;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?A=ArrayBuffer.isView(s):A=s&&s.buffer&&tP(s.buffer),A}const wJ=fE("string"),_i=fE("function"),eP=fE("number"),yl=s=>s!==null&&typeof s=="object",uJ=s=>s===!0||s===!1,ME=s=>{if(dE(s)!=="object")return!1;const A=nf(s);return(A===null||A===Object.prototype||Object.getPrototypeOf(A)===null)&&!(AP in s)&&!(QE in s)},mJ=s=>{if(!yl(s)||Ml(s))return!1;try{return Object.keys(s).length===0&&Object.getPrototypeOf(s)===Object.prototype}catch{return!1}},PJ=Xs("Date"),SJ=Xs("File"),YJ=Xs("Blob"),FJ=Xs("FileList"),bJ=s=>yl(s)&&_i(s.pipe),WJ=s=>{let A;return s&&(typeof FormData=="function"&&s instanceof FormData||_i(s.append)&&((A=dE(s))==="formdata"||A==="object"&&_i(s.toString)&&s.toString()==="[object FormData]"))},GJ=Xs("URLSearchParams"),[TJ,KJ,jJ,RJ]=["ReadableStream","Request","Response","Headers"].map(Xs),ZJ=s=>s.trim?s.trim():s.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function pl(s,A,{allOwnKeys:t=!1}={}){if(s===null||typeof s>"u")return;let e,i;if(typeof s!="object"&&(s=[s]),wr(s))for(e=0,i=s.length;e<i;e++)A.call(null,s[e],e,s);else{if(Ml(s))return;const n=t?Object.getOwnPropertyNames(s):Object.keys(s),o=n.length;let g;for(e=0;e<o;e++)g=n[e],A.call(null,s[g],g,s)}}function iP(s,A){if(Ml(s))return null;A=A.toLowerCase();const t=Object.keys(s);let e=t.length,i;for(;e-- >0;)if(i=t[e],A===i.toLowerCase())return i;return null}const Ng=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,sP=s=>!ur(s)&&s!==Ng;function of(){const{caseless:s,skipUndefined:A}=sP(this)&&this||{},t={},e=(i,n)=>{const o=s&&iP(t,n)||n;ME(t[o])&&ME(i)?t[o]=of(t[o],i):ME(i)?t[o]=of({},i):wr(i)?t[o]=i.slice():(!A||!ur(i))&&(t[o]=i)};for(let i=0,n=arguments.length;i<n;i++)arguments[i]&&pl(arguments[i],e);return t}const NJ=(s,A,t,{allOwnKeys:e}={})=>(pl(A,(i,n)=>{t&&_i(i)?s[n]=$m(i,t):s[n]=i},{allOwnKeys:e}),s),UJ=s=>(s.charCodeAt(0)===65279&&(s=s.slice(1)),s),XJ=(s,A,t,e)=>{s.prototype=Object.create(A.prototype,e),s.prototype.constructor=s,Object.defineProperty(s,"super",{value:A.prototype}),t&&Object.assign(s.prototype,t)},JJ=(s,A,t,e)=>{let i,n,o;const g={};if(A=A||{},s==null)return A;do{for(i=Object.getOwnPropertyNames(s),n=i.length;n-- >0;)o=i[n],(!e||e(o,s,A))&&!g[o]&&(A[o]=s[o],g[o]=!0);s=t!==!1&&nf(s)}while(s&&(!t||t(s,A))&&s!==Object.prototype);return A},xJ=(s,A,t)=>{s=String(s),(t===void 0||t>s.length)&&(t=s.length),t-=A.length;const e=s.indexOf(A,t);return e!==-1&&e===t},kJ=s=>{if(!s)return null;if(wr(s))return s;let A=s.length;if(!eP(A))return null;const t=new Array(A);for(;A-- >0;)t[A]=s[A];return t},VJ=(s=>A=>s&&A instanceof s)(typeof Uint8Array<"u"&&nf(Uint8Array)),HJ=(s,A)=>{const e=(s&&s[QE]).call(s);let i;for(;(i=e.next())&&!i.done;){const n=i.value;A.call(s,n[0],n[1])}},OJ=(s,A)=>{let t;const e=[];for(;(t=s.exec(A))!==null;)e.push(t);return e},LJ=Xs("HTMLFormElement"),zJ=s=>s.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(t,e,i){return e.toUpperCase()+i}),nP=(({hasOwnProperty:s})=>(A,t)=>s.call(A,t))(Object.prototype),vJ=Xs("RegExp"),oP=(s,A)=>{const t=Object.getOwnPropertyDescriptors(s),e={};pl(t,(i,n)=>{let o;(o=A(i,n,s))!==!1&&(e[n]=o||i)}),Object.defineProperties(s,e)},_J=s=>{oP(s,(A,t)=>{if(_i(s)&&["arguments","caller","callee"].indexOf(t)!==-1)return!1;const e=s[t];if(_i(e)){if(A.enumerable=!1,"writable"in A){A.writable=!1;return}A.set||(A.set=()=>{throw Error("Can not rewrite read-only method '"+t+"'")})}})},qJ=(s,A)=>{const t={},e=i=>{i.forEach(n=>{t[n]=!0})};return wr(s)?e(s):e(String(s).split(A)),t},$J=()=>{},Ax=(s,A)=>s!=null&&Number.isFinite(s=+s)?s:A;function tx(s){return!!(s&&_i(s.append)&&s[AP]==="FormData"&&s[QE])}const ex=s=>{const A=new Array(10),t=(e,i)=>{if(yl(e)){if(A.indexOf(e)>=0)return;if(Ml(e))return e;if(!("toJSON"in e)){A[i]=e;const n=wr(e)?[]:{};return pl(e,(o,g)=>{const a=t(o,i+1);!ur(a)&&(n[g]=a)}),A[i]=void 0,n}}return e};return t(s,0)},ix=Xs("AsyncFunction"),sx=s=>s&&(yl(s)||_i(s))&&_i(s.then)&&_i(s.catch),gP=((s,A)=>s?setImmediate:A?((t,e)=>(Ng.addEventListener("message",({source:i,data:n})=>{i===Ng&&n===t&&e.length&&e.shift()()},!1),i=>{e.push(i),Ng.postMessage(t,"*")}))(`axios@${Math.random()}`,[]):t=>setTimeout(t))(typeof setImmediate=="function",_i(Ng.postMessage)),nx=typeof queueMicrotask<"u"?queueMicrotask.bind(Ng):typeof process<"u"&&process.nextTick||gP,PA={isArray:wr,isArrayBuffer:tP,isBuffer:Ml,isFormData:WJ,isArrayBufferView:DJ,isString:wJ,isNumber:eP,isBoolean:uJ,isObject:yl,isPlainObject:ME,isEmptyObject:mJ,isReadableStream:TJ,isRequest:KJ,isResponse:jJ,isHeaders:RJ,isUndefined:ur,isDate:PJ,isFile:SJ,isBlob:YJ,isRegExp:vJ,isFunction:_i,isStream:bJ,isURLSearchParams:GJ,isTypedArray:VJ,isFileList:FJ,forEach:pl,merge:of,extend:NJ,trim:ZJ,stripBOM:UJ,inherits:XJ,toFlatObject:JJ,kindOf:dE,kindOfTest:Xs,endsWith:xJ,toArray:kJ,forEachEntry:HJ,matchAll:OJ,isHTMLForm:LJ,hasOwnProperty:nP,hasOwnProp:nP,reduceDescriptors:oP,freezeMethods:_J,toObjectSet:qJ,toCamelCase:zJ,noop:$J,toFiniteNumber:Ax,findKey:iP,global:Ng,isContextDefined:sP,isSpecCompliantForm:tx,toJSONObject:ex,isAsyncFn:ix,isThenable:sx,setImmediate:gP,asap:nx,isIterable:s=>s!=null&&_i(s[QE])};function Dt(s,A,t,e,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=s,this.name="AxiosError",A&&(this.code=A),t&&(this.config=t),e&&(this.request=e),i&&(this.response=i,this.status=i.status?i.status:null)}PA.inherits(Dt,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:PA.toJSONObject(this.config),code:this.code,status:this.status}}});const aP=Dt.prototype,rP={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(s=>{rP[s]={value:s}}),Object.defineProperties(Dt,rP),Object.defineProperty(aP,"isAxiosError",{value:!0}),Dt.from=(s,A,t,e,i,n)=>{const o=Object.create(aP);PA.toFlatObject(s,o,function(I){return I!==Error.prototype},r=>r!=="isAxiosError");const g=s&&s.message?s.message:"Error",a=A==null&&s?s.code:A;return Dt.call(o,g,a,t,e,i),s&&o.cause==null&&Object.defineProperty(o,"cause",{value:s,configurable:!0}),o.name=s&&s.name||"Error",n&&Object.assign(o,n),o};const ox=null;function gf(s){return PA.isPlainObject(s)||PA.isArray(s)}function IP(s){return PA.endsWith(s,"[]")?s.slice(0,-2):s}function lP(s,A,t){return s?s.concat(A).map(function(i,n){return i=IP(i),!t&&n?"["+i+"]":i}).join(t?".":""):A}function gx(s){return PA.isArray(s)&&!s.some(gf)}const ax=PA.toFlatObject(PA,{},null,function(A){return/^is[A-Z]/.test(A)});function yE(s,A,t){if(!PA.isObject(s))throw new TypeError("target must be an object");A=A||new FormData,t=PA.toFlatObject(t,{metaTokens:!0,dots:!1,indexes:!1},!1,function(c,Q){return!PA.isUndefined(Q[c])});const e=t.metaTokens,i=t.visitor||I,n=t.dots,o=t.indexes,a=(t.Blob||typeof Blob<"u"&&Blob)&&PA.isSpecCompliantForm(A);if(!PA.isFunction(i))throw new TypeError("visitor must be a function");function r(E){if(E===null)return"";if(PA.isDate(E))return E.toISOString();if(PA.isBoolean(E))return E.toString();if(!a&&PA.isBlob(E))throw new Dt("Blob is not supported. Use a Buffer instead.");return PA.isArrayBuffer(E)||PA.isTypedArray(E)?a&&typeof Blob=="function"?new Blob([E]):Buffer.from(E):E}function I(E,c,Q){let C=E;if(E&&!Q&&typeof E=="object"){if(PA.endsWith(c,"{}"))c=e?c:c.slice(0,-2),E=JSON.stringify(E);else if(PA.isArray(E)&&gx(E)||(PA.isFileList(E)||PA.endsWith(c,"[]"))&&(C=PA.toArray(E)))return c=IP(c),C.forEach(function(M,y){!(PA.isUndefined(M)||M===null)&&A.append(o===!0?lP([c],y,n):o===null?c:c+"[]",r(M))}),!1}return gf(E)?!0:(A.append(lP(Q,c,n),r(E)),!1)}const l=[],h=Object.assign(ax,{defaultVisitor:I,convertValue:r,isVisitable:gf});function B(E,c){if(!PA.isUndefined(E)){if(l.indexOf(E)!==-1)throw Error("Circular reference detected in "+c.join("."));l.push(E),PA.forEach(E,function(C,d){(!(PA.isUndefined(C)||C===null)&&i.call(A,C,PA.isString(d)?d.trim():d,c,h))===!0&&B(C,c?c.concat(d):[d])}),l.pop()}}if(!PA.isObject(s))throw new TypeError("data must be an object");return B(s),A}function BP(s){const A={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(s).replace(/[!'()~]|%20|%00/g,function(e){return A[e]})}function af(s,A){this._pairs=[],s&&yE(s,this,A)}const hP=af.prototype;hP.append=function(A,t){this._pairs.push([A,t])},hP.toString=function(A){const t=A?function(e){return A.call(this,e,BP)}:BP;return this._pairs.map(function(i){return t(i[0])+"="+t(i[1])},"").join("&")};function rx(s){return encodeURIComponent(s).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function CP(s,A,t){if(!A)return s;const e=t&&t.encode||rx;PA.isFunction(t)&&(t={serialize:t});const i=t&&t.serialize;let n;if(i?n=i(A,t):n=PA.isURLSearchParams(A)?A.toString():new af(A,t).toString(e),n){const o=s.indexOf("#");o!==-1&&(s=s.slice(0,o)),s+=(s.indexOf("?")===-1?"?":"&")+n}return s}class EP{constructor(){this.handlers=[]}use(A,t,e){return this.handlers.push({fulfilled:A,rejected:t,synchronous:e?e.synchronous:!1,runWhen:e?e.runWhen:null}),this.handlers.length-1}eject(A){this.handlers[A]&&(this.handlers[A]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(A){PA.forEach(this.handlers,function(e){e!==null&&A(e)})}}const cP={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Ix={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:af,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},rf=typeof window<"u"&&typeof document<"u",If=typeof navigator=="object"&&navigator||void 0,lx=rf&&(!If||["ReactNative","NativeScript","NS"].indexOf(If.product)<0),Bx=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",hx=rf&&window.location.href||"http://localhost",Pi={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:rf,hasStandardBrowserEnv:lx,hasStandardBrowserWebWorkerEnv:Bx,navigator:If,origin:hx},Symbol.toStringTag,{value:"Module"})),...Ix};function Cx(s,A){return yE(s,new Pi.classes.URLSearchParams,{visitor:function(t,e,i,n){return Pi.isNode&&PA.isBuffer(t)?(this.append(e,t.toString("base64")),!1):n.defaultVisitor.apply(this,arguments)},...A})}function Ex(s){return PA.matchAll(/\w+|\[(\w*)]/g,s).map(A=>A[0]==="[]"?"":A[1]||A[0])}function cx(s){const A={},t=Object.keys(s);let e;const i=t.length;let n;for(e=0;e<i;e++)n=t[e],A[n]=s[n];return A}function QP(s){function A(t,e,i,n){let o=t[n++];if(o==="__proto__")return!0;const g=Number.isFinite(+o),a=n>=t.length;return o=!o&&PA.isArray(i)?i.length:o,a?(PA.hasOwnProp(i,o)?i[o]=[i[o],e]:i[o]=e,!g):((!i[o]||!PA.isObject(i[o]))&&(i[o]=[]),A(t,e,i[o],n)&&PA.isArray(i[o])&&(i[o]=cx(i[o])),!g)}if(PA.isFormData(s)&&PA.isFunction(s.entries)){const t={};return PA.forEachEntry(s,(e,i)=>{A(Ex(e),i,t,0)}),t}return null}function Qx(s,A,t){if(PA.isString(s))try{return(A||JSON.parse)(s),PA.trim(s)}catch(e){if(e.name!=="SyntaxError")throw e}return(t||JSON.stringify)(s)}const Dl={transitional:cP,adapter:["xhr","http","fetch"],transformRequest:[function(A,t){const e=t.getContentType()||"",i=e.indexOf("application/json")>-1,n=PA.isObject(A);if(n&&PA.isHTMLForm(A)&&(A=new FormData(A)),PA.isFormData(A))return i?JSON.stringify(QP(A)):A;if(PA.isArrayBuffer(A)||PA.isBuffer(A)||PA.isStream(A)||PA.isFile(A)||PA.isBlob(A)||PA.isReadableStream(A))return A;if(PA.isArrayBufferView(A))return A.buffer;if(PA.isURLSearchParams(A))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),A.toString();let g;if(n){if(e.indexOf("application/x-www-form-urlencoded")>-1)return Cx(A,this.formSerializer).toString();if((g=PA.isFileList(A))||e.indexOf("multipart/form-data")>-1){const a=this.env&&this.env.FormData;return yE(g?{"files[]":A}:A,a&&new a,this.formSerializer)}}return n||i?(t.setContentType("application/json",!1),Qx(A)):A}],transformResponse:[function(A){const t=this.transitional||Dl.transitional,e=t&&t.forcedJSONParsing,i=this.responseType==="json";if(PA.isResponse(A)||PA.isReadableStream(A))return A;if(A&&PA.isString(A)&&(e&&!this.responseType||i)){const o=!(t&&t.silentJSONParsing)&&i;try{return JSON.parse(A,this.parseReviver)}catch(g){if(o)throw g.name==="SyntaxError"?Dt.from(g,Dt.ERR_BAD_RESPONSE,this,null,this.response):g}}return A}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Pi.classes.FormData,Blob:Pi.classes.Blob},validateStatus:function(A){return A>=200&&A<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};PA.forEach(["delete","get","head","post","put","patch"],s=>{Dl.headers[s]={}});const dx=PA.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),fx=s=>{const A={};let t,e,i;return s&&s.split(`
|
|
5207
5207
|
`).forEach(function(o){i=o.indexOf(":"),t=o.substring(0,i).trim().toLowerCase(),e=o.substring(i+1).trim(),!(!t||A[t]&&dx[t])&&(t==="set-cookie"?A[t]?A[t].push(e):A[t]=[e]:A[t]=A[t]?A[t]+", "+e:e)}),A},dP=Symbol("internals");function wl(s){return s&&String(s).trim().toLowerCase()}function pE(s){return s===!1||s==null?s:PA.isArray(s)?s.map(pE):String(s)}function Mx(s){const A=Object.create(null),t=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let e;for(;e=t.exec(s);)A[e[1]]=e[2];return A}const yx=s=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(s.trim());function lf(s,A,t,e,i){if(PA.isFunction(e))return e.call(this,A,t);if(i&&(A=t),!!PA.isString(A)){if(PA.isString(e))return A.indexOf(e)!==-1;if(PA.isRegExp(e))return e.test(A)}}function px(s){return s.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(A,t,e)=>t.toUpperCase()+e)}function Dx(s,A){const t=PA.toCamelCase(" "+A);["get","set","has"].forEach(e=>{Object.defineProperty(s,e+t,{value:function(i,n,o){return this[e].call(this,A,i,n,o)},configurable:!0})})}let qi=class{constructor(A){A&&this.set(A)}set(A,t,e){const i=this;function n(g,a,r){const I=wl(a);if(!I)throw new Error("header name must be a non-empty string");const l=PA.findKey(i,I);(!l||i[l]===void 0||r===!0||r===void 0&&i[l]!==!1)&&(i[l||a]=pE(g))}const o=(g,a)=>PA.forEach(g,(r,I)=>n(r,I,a));if(PA.isPlainObject(A)||A instanceof this.constructor)o(A,t);else if(PA.isString(A)&&(A=A.trim())&&!yx(A))o(fx(A),t);else if(PA.isObject(A)&&PA.isIterable(A)){let g={},a,r;for(const I of A){if(!PA.isArray(I))throw TypeError("Object iterator must return a key-value pair");g[r=I[0]]=(a=g[r])?PA.isArray(a)?[...a,I[1]]:[a,I[1]]:I[1]}o(g,t)}else A!=null&&n(t,A,e);return this}get(A,t){if(A=wl(A),A){const e=PA.findKey(this,A);if(e){const i=this[e];if(!t)return i;if(t===!0)return Mx(i);if(PA.isFunction(t))return t.call(this,i,e);if(PA.isRegExp(t))return t.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(A,t){if(A=wl(A),A){const e=PA.findKey(this,A);return!!(e&&this[e]!==void 0&&(!t||lf(this,this[e],e,t)))}return!1}delete(A,t){const e=this;let i=!1;function n(o){if(o=wl(o),o){const g=PA.findKey(e,o);g&&(!t||lf(e,e[g],g,t))&&(delete e[g],i=!0)}}return PA.isArray(A)?A.forEach(n):n(A),i}clear(A){const t=Object.keys(this);let e=t.length,i=!1;for(;e--;){const n=t[e];(!A||lf(this,this[n],n,A,!0))&&(delete this[n],i=!0)}return i}normalize(A){const t=this,e={};return PA.forEach(this,(i,n)=>{const o=PA.findKey(e,n);if(o){t[o]=pE(i),delete t[n];return}const g=A?px(n):String(n).trim();g!==n&&delete t[n],t[g]=pE(i),e[g]=!0}),this}concat(...A){return this.constructor.concat(this,...A)}toJSON(A){const t=Object.create(null);return PA.forEach(this,(e,i)=>{e!=null&&e!==!1&&(t[i]=A&&PA.isArray(e)?e.join(", "):e)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([A,t])=>A+": "+t).join(`
|
|
5208
5208
|
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(A){return A instanceof this?A:new this(A)}static concat(A,...t){const e=new this(A);return t.forEach(i=>e.set(i)),e}static accessor(A){const e=(this[dP]=this[dP]={accessors:{}}).accessors,i=this.prototype;function n(o){const g=wl(o);e[g]||(Dx(i,o),e[g]=!0)}return PA.isArray(A)?A.forEach(n):n(A),this}};qi.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),PA.reduceDescriptors(qi.prototype,({value:s},A)=>{let t=A[0].toUpperCase()+A.slice(1);return{get:()=>s,set(e){this[t]=e}}}),PA.freezeMethods(qi);function Bf(s,A){const t=this||Dl,e=A||t,i=qi.from(e.headers);let n=e.data;return PA.forEach(s,function(g){n=g.call(t,n,i.normalize(),A?A.status:void 0)}),i.normalize(),n}function fP(s){return!!(s&&s.__CANCEL__)}function mr(s,A,t){Dt.call(this,s??"canceled",Dt.ERR_CANCELED,A,t),this.name="CanceledError"}PA.inherits(mr,Dt,{__CANCEL__:!0});function MP(s,A,t){const e=t.config.validateStatus;!t.status||!e||e(t.status)?s(t):A(new Dt("Request failed with status code "+t.status,[Dt.ERR_BAD_REQUEST,Dt.ERR_BAD_RESPONSE][Math.floor(t.status/100)-4],t.config,t.request,t))}function wx(s){const A=/^([-+\w]{1,25})(:?\/\/|:)/.exec(s);return A&&A[1]||""}function ux(s,A){s=s||10;const t=new Array(s),e=new Array(s);let i=0,n=0,o;return A=A!==void 0?A:1e3,function(a){const r=Date.now(),I=e[n];o||(o=r),t[i]=a,e[i]=r;let l=n,h=0;for(;l!==i;)h+=t[l++],l=l%s;if(i=(i+1)%s,i===n&&(n=(n+1)%s),r-o<A)return;const B=I&&r-I;return B?Math.round(h*1e3/B):void 0}}function mx(s,A){let t=0,e=1e3/A,i,n;const o=(r,I=Date.now())=>{t=I,i=null,n&&(clearTimeout(n),n=null),s(...r)};return[(...r)=>{const I=Date.now(),l=I-t;l>=e?o(r,I):(i=r,n||(n=setTimeout(()=>{n=null,o(i)},e-l)))},()=>i&&o(i)]}const DE=(s,A,t=3)=>{let e=0;const i=ux(50,250);return mx(n=>{const o=n.loaded,g=n.lengthComputable?n.total:void 0,a=o-e,r=i(a),I=o<=g;e=o;const l={loaded:o,total:g,progress:g?o/g:void 0,bytes:a,rate:r||void 0,estimated:r&&g&&I?(g-o)/r:void 0,event:n,lengthComputable:g!=null,[A?"download":"upload"]:!0};s(l)},t)},yP=(s,A)=>{const t=s!=null;return[e=>A[0]({lengthComputable:t,total:s,loaded:e}),A[1]]},pP=s=>(...A)=>PA.asap(()=>s(...A)),Px=Pi.hasStandardBrowserEnv?((s,A)=>t=>(t=new URL(t,Pi.origin),s.protocol===t.protocol&&s.host===t.host&&(A||s.port===t.port)))(new URL(Pi.origin),Pi.navigator&&/(msie|trident)/i.test(Pi.navigator.userAgent)):()=>!0,Sx=Pi.hasStandardBrowserEnv?{write(s,A,t,e,i,n,o){if(typeof document>"u")return;const g=[`${s}=${encodeURIComponent(A)}`];PA.isNumber(t)&&g.push(`expires=${new Date(t).toUTCString()}`),PA.isString(e)&&g.push(`path=${e}`),PA.isString(i)&&g.push(`domain=${i}`),n===!0&&g.push("secure"),PA.isString(o)&&g.push(`SameSite=${o}`),document.cookie=g.join("; ")},read(s){if(typeof document>"u")return null;const A=document.cookie.match(new RegExp("(?:^|; )"+s+"=([^;]*)"));return A?decodeURIComponent(A[1]):null},remove(s){this.write(s,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function Yx(s){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(s)}function Fx(s,A){return A?s.replace(/\/?\/$/,"")+"/"+A.replace(/^\/+/,""):s}function DP(s,A,t){let e=!Yx(A);return s&&(e||t==!1)?Fx(s,A):A}const wP=s=>s instanceof qi?{...s}:s;function Ug(s,A){A=A||{};const t={};function e(r,I,l,h){return PA.isPlainObject(r)&&PA.isPlainObject(I)?PA.merge.call({caseless:h},r,I):PA.isPlainObject(I)?PA.merge({},I):PA.isArray(I)?I.slice():I}function i(r,I,l,h){if(PA.isUndefined(I)){if(!PA.isUndefined(r))return e(void 0,r,l,h)}else return e(r,I,l,h)}function n(r,I){if(!PA.isUndefined(I))return e(void 0,I)}function o(r,I){if(PA.isUndefined(I)){if(!PA.isUndefined(r))return e(void 0,r)}else return e(void 0,I)}function g(r,I,l){if(l in A)return e(r,I);if(l in s)return e(void 0,r)}const a={url:n,method:n,data:n,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:g,headers:(r,I,l)=>i(wP(r),wP(I),l,!0)};return PA.forEach(Object.keys({...s,...A}),function(I){const l=a[I]||i,h=l(s[I],A[I],I);PA.isUndefined(h)&&l!==g||(t[I]=h)}),t}const uP=s=>{const A=Ug({},s);let{data:t,withXSRFToken:e,xsrfHeaderName:i,xsrfCookieName:n,headers:o,auth:g}=A;if(A.headers=o=qi.from(o),A.url=CP(DP(A.baseURL,A.url,A.allowAbsoluteUrls),s.params,s.paramsSerializer),g&&o.set("Authorization","Basic "+btoa((g.username||"")+":"+(g.password?unescape(encodeURIComponent(g.password)):""))),PA.isFormData(t)){if(Pi.hasStandardBrowserEnv||Pi.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if(PA.isFunction(t.getHeaders)){const a=t.getHeaders(),r=["content-type","content-length"];Object.entries(a).forEach(([I,l])=>{r.includes(I.toLowerCase())&&o.set(I,l)})}}if(Pi.hasStandardBrowserEnv&&(e&&PA.isFunction(e)&&(e=e(A)),e||e!==!1&&Px(A.url))){const a=i&&n&&Sx.read(n);a&&o.set(i,a)}return A},bx=typeof XMLHttpRequest<"u"&&function(s){return new Promise(function(t,e){const i=uP(s);let n=i.data;const o=qi.from(i.headers).normalize();let{responseType:g,onUploadProgress:a,onDownloadProgress:r}=i,I,l,h,B,E;function c(){B&&B(),E&&E(),i.cancelToken&&i.cancelToken.unsubscribe(I),i.signal&&i.signal.removeEventListener("abort",I)}let Q=new XMLHttpRequest;Q.open(i.method.toUpperCase(),i.url,!0),Q.timeout=i.timeout;function C(){if(!Q)return;const M=qi.from("getAllResponseHeaders"in Q&&Q.getAllResponseHeaders()),w={data:!g||g==="text"||g==="json"?Q.responseText:Q.response,status:Q.status,statusText:Q.statusText,headers:M,config:s,request:Q};MP(function(p){t(p),c()},function(p){e(p),c()},w),Q=null}"onloadend"in Q?Q.onloadend=C:Q.onreadystatechange=function(){!Q||Q.readyState!==4||Q.status===0&&!(Q.responseURL&&Q.responseURL.indexOf("file:")===0)||setTimeout(C)},Q.onabort=function(){Q&&(e(new Dt("Request aborted",Dt.ECONNABORTED,s,Q)),Q=null)},Q.onerror=function(y){const w=y&&y.message?y.message:"Network Error",D=new Dt(w,Dt.ERR_NETWORK,s,Q);D.event=y||null,e(D),Q=null},Q.ontimeout=function(){let y=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const w=i.transitional||cP;i.timeoutErrorMessage&&(y=i.timeoutErrorMessage),e(new Dt(y,w.clarifyTimeoutError?Dt.ETIMEDOUT:Dt.ECONNABORTED,s,Q)),Q=null},n===void 0&&o.setContentType(null),"setRequestHeader"in Q&&PA.forEach(o.toJSON(),function(y,w){Q.setRequestHeader(w,y)}),PA.isUndefined(i.withCredentials)||(Q.withCredentials=!!i.withCredentials),g&&g!=="json"&&(Q.responseType=i.responseType),r&&([h,E]=DE(r,!0),Q.addEventListener("progress",h)),a&&Q.upload&&([l,B]=DE(a),Q.upload.addEventListener("progress",l),Q.upload.addEventListener("loadend",B)),(i.cancelToken||i.signal)&&(I=M=>{Q&&(e(!M||M.type?new mr(null,s,Q):M),Q.abort(),Q=null)},i.cancelToken&&i.cancelToken.subscribe(I),i.signal&&(i.signal.aborted?I():i.signal.addEventListener("abort",I)));const d=wx(i.url);if(d&&Pi.protocols.indexOf(d)===-1){e(new Dt("Unsupported protocol "+d+":",Dt.ERR_BAD_REQUEST,s));return}Q.send(n||null)})},Wx=(s,A)=>{const{length:t}=s=s?s.filter(Boolean):[];if(A||t){let e=new AbortController,i;const n=function(r){if(!i){i=!0,g();const I=r instanceof Error?r:this.reason;e.abort(I instanceof Dt?I:new mr(I instanceof Error?I.message:I))}};let o=A&&setTimeout(()=>{o=null,n(new Dt(`timeout ${A} of ms exceeded`,Dt.ETIMEDOUT))},A);const g=()=>{s&&(o&&clearTimeout(o),o=null,s.forEach(r=>{r.unsubscribe?r.unsubscribe(n):r.removeEventListener("abort",n)}),s=null)};s.forEach(r=>r.addEventListener("abort",n));const{signal:a}=e;return a.unsubscribe=()=>PA.asap(g),a}},Gx=function*(s,A){let t=s.byteLength;if(t<A){yield s;return}let e=0,i;for(;e<t;)i=e+A,yield s.slice(e,i),e=i},Tx=async function*(s,A){for await(const t of Kx(s))yield*Gx(t,A)},Kx=async function*(s){if(s[Symbol.asyncIterator]){yield*s;return}const A=s.getReader();try{for(;;){const{done:t,value:e}=await A.read();if(t)break;yield e}}finally{await A.cancel()}},mP=(s,A,t,e)=>{const i=Tx(s,A);let n=0,o,g=a=>{o||(o=!0,e&&e(a))};return new ReadableStream({async pull(a){try{const{done:r,value:I}=await i.next();if(r){g(),a.close();return}let l=I.byteLength;if(t){let h=n+=l;t(h)}a.enqueue(new Uint8Array(I))}catch(r){throw g(r),r}},cancel(a){return g(a),i.return()}},{highWaterMark:2})},PP=64*1024,{isFunction:wE}=PA,jx=(({Request:s,Response:A})=>({Request:s,Response:A}))(PA.global),{ReadableStream:SP,TextEncoder:YP}=PA.global,FP=(s,...A)=>{try{return!!s(...A)}catch{return!1}},Rx=s=>{s=PA.merge.call({skipUndefined:!0},jx,s);const{fetch:A,Request:t,Response:e}=s,i=A?wE(A):typeof fetch=="function",n=wE(t),o=wE(e);if(!i)return!1;const g=i&&wE(SP),a=i&&(typeof YP=="function"?(E=>c=>E.encode(c))(new YP):async E=>new Uint8Array(await new t(E).arrayBuffer())),r=n&&g&&FP(()=>{let E=!1;const c=new t(Pi.origin,{body:new SP,method:"POST",get duplex(){return E=!0,"half"}}).headers.has("Content-Type");return E&&!c}),I=o&&g&&FP(()=>PA.isReadableStream(new e("").body)),l={stream:I&&(E=>E.body)};i&&["text","arrayBuffer","blob","formData","stream"].forEach(E=>{!l[E]&&(l[E]=(c,Q)=>{let C=c&&c[E];if(C)return C.call(c);throw new Dt(`Response type '${E}' is not supported`,Dt.ERR_NOT_SUPPORT,Q)})});const h=async E=>{if(E==null)return 0;if(PA.isBlob(E))return E.size;if(PA.isSpecCompliantForm(E))return(await new t(Pi.origin,{method:"POST",body:E}).arrayBuffer()).byteLength;if(PA.isArrayBufferView(E)||PA.isArrayBuffer(E))return E.byteLength;if(PA.isURLSearchParams(E)&&(E=E+""),PA.isString(E))return(await a(E)).byteLength},B=async(E,c)=>{const Q=PA.toFiniteNumber(E.getContentLength());return Q??h(c)};return async E=>{let{url:c,method:Q,data:C,signal:d,cancelToken:M,timeout:y,onDownloadProgress:w,onUploadProgress:D,responseType:p,headers:f,withCredentials:u="same-origin",fetchOptions:Y}=uP(E),b=A||fetch;p=p?(p+"").toLowerCase():"text";let m=Wx([d,M&&M.toAbortSignal()],y),T=null;const F=m&&m.unsubscribe&&(()=>{m.unsubscribe()});let j;try{if(D&&r&&Q!=="get"&&Q!=="head"&&(j=await B(f,C))!==0){let H=new t(c,{method:"POST",body:C,duplex:"half"}),eA;if(PA.isFormData(C)&&(eA=H.headers.get("content-type"))&&f.setContentType(eA),H.body){const[nA,lA]=yP(j,DE(pP(D)));C=mP(H.body,PP,nA,lA)}}PA.isString(u)||(u=u?"include":"omit");const X=n&&"credentials"in t.prototype,v={...Y,signal:m,method:Q.toUpperCase(),headers:f.normalize().toJSON(),body:C,duplex:"half",credentials:X?u:void 0};T=n&&new t(c,v);let k=await(n?b(T,Y):b(c,v));const K=I&&(p==="stream"||p==="response");if(I&&(w||K&&F)){const H={};["status","statusText","headers"].forEach(oA=>{H[oA]=k[oA]});const eA=PA.toFiniteNumber(k.headers.get("content-length")),[nA,lA]=w&&yP(eA,DE(pP(w),!0))||[];k=new e(mP(k.body,PP,nA,()=>{lA&&lA(),F&&F()}),H)}p=p||"text";let z=await l[PA.findKey(l,p)||"text"](k,E);return!K&&F&&F(),await new Promise((H,eA)=>{MP(H,eA,{data:z,headers:qi.from(k.headers),status:k.status,statusText:k.statusText,config:E,request:T})})}catch(X){throw F&&F(),X&&X.name==="TypeError"&&/Load failed|fetch/i.test(X.message)?Object.assign(new Dt("Network Error",Dt.ERR_NETWORK,E,T),{cause:X.cause||X}):Dt.from(X,X&&X.code,E,T)}}},Zx=new Map,bP=s=>{let A=s&&s.env||{};const{fetch:t,Request:e,Response:i}=A,n=[e,i,t];let o=n.length,g=o,a,r,I=Zx;for(;g--;)a=n[g],r=I.get(a),r===void 0&&I.set(a,r=g?new Map:Rx(A)),I=r;return r};bP();const hf={http:ox,xhr:bx,fetch:{get:bP}};PA.forEach(hf,(s,A)=>{if(s){try{Object.defineProperty(s,"name",{value:A})}catch{}Object.defineProperty(s,"adapterName",{value:A})}});const WP=s=>`- ${s}`,Nx=s=>PA.isFunction(s)||s===null||s===!1;function Ux(s,A){s=PA.isArray(s)?s:[s];const{length:t}=s;let e,i;const n={};for(let o=0;o<t;o++){e=s[o];let g;if(i=e,!Nx(e)&&(i=hf[(g=String(e)).toLowerCase()],i===void 0))throw new Dt(`Unknown adapter '${g}'`);if(i&&(PA.isFunction(i)||(i=i.get(A))))break;n[g||"#"+o]=i}if(!i){const o=Object.entries(n).map(([a,r])=>`adapter ${a} `+(r===!1?"is not supported by the environment":"is not available in the build"));let g=t?o.length>1?`since :
|
|
5209
5209
|
`+o.map(WP).join(`
|
|
@@ -6597,7 +6597,7 @@ void main() {
|
|
|
6597
6597
|
#include <premultiplied_alpha_fragment>
|
|
6598
6598
|
|
|
6599
6599
|
}
|
|
6600
|
-
`};class Zy extends $t{constructor(A){super({type:"LineMaterial",uniforms:oi.clone(Zi.line.uniforms),vertexShader:Zi.line.vertexShader,fragmentShader:Zi.line.fragmentShader,clipping:!0}),this.isLineMaterial=!0,this.setValues(A)}get color(){return this.uniforms.diffuse.value}set color(A){this.uniforms.diffuse.value=A}get worldUnits(){return"WORLD_UNITS"in this.defines}set worldUnits(A){A===!0!==this.worldUnits&&(this.needsUpdate=!0),A===!0?this.defines.WORLD_UNITS="":delete this.defines.WORLD_UNITS}get linewidth(){return this.uniforms.linewidth.value}set linewidth(A){this.uniforms.linewidth&&(this.uniforms.linewidth.value=A)}get dashed(){return"USE_DASH"in this.defines}set dashed(A){A===!0!==this.dashed&&(this.needsUpdate=!0),A===!0?this.defines.USE_DASH="":delete this.defines.USE_DASH}get dashScale(){return this.uniforms.dashScale.value}set dashScale(A){this.uniforms.dashScale.value=A}get dashSize(){return this.uniforms.dashSize.value}set dashSize(A){this.uniforms.dashSize.value=A}get dashOffset(){return this.uniforms.dashOffset.value}set dashOffset(A){this.uniforms.dashOffset.value=A}get gapSize(){return this.uniforms.gapSize.value}set gapSize(A){this.uniforms.gapSize.value=A}get opacity(){return this.uniforms.opacity.value}set opacity(A){this.uniforms&&(this.uniforms.opacity.value=A)}get resolution(){return this.uniforms.resolution.value}set resolution(A){this.uniforms.resolution.value.copy(A)}get alphaToCoverage(){return"USE_ALPHA_TO_COVERAGE"in this.defines}set alphaToCoverage(A){this.defines&&(A===!0!==this.alphaToCoverage&&(this.needsUpdate=!0),A===!0?this.defines.USE_ALPHA_TO_COVERAGE="":delete this.defines.USE_ALPHA_TO_COVERAGE)}}const Ny=new Ct,uW=new S,mW=new S,Qi=new Ct,di=new Ct,wn=new Ct,Uy=new S,Xy=new RA,fi=new vi,PW=new S,hQ=new vA,CQ=new be,un=new Ct;let mn,ca;function SW(s,A,t){return un.set(0,0,-A,1).applyMatrix4(s.projectionMatrix),un.multiplyScalar(1/un.w),un.x=ca/t.width,un.y=ca/t.height,un.applyMatrix4(s.projectionMatrixInverse),un.multiplyScalar(1/un.w),Math.abs(Math.max(un.x,un.y))}function X8(s,A){const t=s.matrixWorld,e=s.geometry,i=e.attributes.instanceStart,n=e.attributes.instanceEnd,o=Math.min(e.instanceCount,i.count);for(let g=0,a=o;g<a;g++){fi.start.fromBufferAttribute(i,g),fi.end.fromBufferAttribute(n,g),fi.applyMatrix4(t);const r=new S,I=new S;mn.distanceSqToSegment(fi.start,fi.end,I,r),I.distanceTo(r)<ca*.5&&A.push({point:I,pointOnLine:r,distance:mn.origin.distanceTo(I),object:s,face:null,faceIndex:g,uv:null,uv1:null})}}function J8(s,A,t){const e=A.projectionMatrix,n=s.material.resolution,o=s.matrixWorld,g=s.geometry,a=g.attributes.instanceStart,r=g.attributes.instanceEnd,I=Math.min(g.instanceCount,a.count),l=-A.near;mn.at(1,wn),wn.w=1,wn.applyMatrix4(A.matrixWorldInverse),wn.applyMatrix4(e),wn.multiplyScalar(1/wn.w),wn.x*=n.x/2,wn.y*=n.y/2,wn.z=0,Uy.copy(wn),Xy.multiplyMatrices(A.matrixWorldInverse,o);for(let h=0,B=I;h<B;h++){if(Qi.fromBufferAttribute(a,h),di.fromBufferAttribute(r,h),Qi.w=1,di.w=1,Qi.applyMatrix4(Xy),di.applyMatrix4(Xy),Qi.z>l&&di.z>l)continue;if(Qi.z>l){const M=Qi.z-di.z,y=(Qi.z-l)/M;Qi.lerp(di,y)}else if(di.z>l){const M=di.z-Qi.z,y=(di.z-l)/M;di.lerp(Qi,y)}Qi.applyMatrix4(e),di.applyMatrix4(e),Qi.multiplyScalar(1/Qi.w),di.multiplyScalar(1/di.w),Qi.x*=n.x/2,Qi.y*=n.y/2,di.x*=n.x/2,di.y*=n.y/2,fi.start.copy(Qi),fi.start.z=0,fi.end.copy(di),fi.end.z=0;const c=fi.closestPointToPointParameter(Uy,!0);fi.at(c,PW);const Q=rt.lerp(Qi.z,di.z,c),C=Q>=-1&&Q<=1,d=Uy.distanceTo(PW)<ca*.5;if(C&&d){fi.start.fromBufferAttribute(a,h),fi.end.fromBufferAttribute(r,h),fi.start.applyMatrix4(o),fi.end.applyMatrix4(o);const M=new S,y=new S;mn.distanceSqToSegment(fi.start,fi.end,y,M),t.push({point:y,pointOnLine:M,distance:mn.origin.distanceTo(y),object:s,face:null,faceIndex:h,uv:null,uv1:null})}}}class x8 extends bA{constructor(A=new wW,t=new Zy({color:Math.random()*16777215})){super(A,t),this.isLineSegments2=!0,this.type="LineSegments2"}computeLineDistances(){const A=this.geometry,t=A.attributes.instanceStart,e=A.attributes.instanceEnd,i=new Float32Array(2*t.count);for(let o=0,g=0,a=t.count;o<a;o++,g+=2)uW.fromBufferAttribute(t,o),mW.fromBufferAttribute(e,o),i[g]=g===0?0:i[g-1],i[g+1]=i[g]+uW.distanceTo(mW);const n=new JC(i,2,1);return A.setAttribute("instanceDistanceStart",new ji(n,1,0)),A.setAttribute("instanceDistanceEnd",new ji(n,1,1)),this}raycast(A,t){const e=this.material.worldUnits,i=A.camera;if(i===null&&!e&&console.error('LineSegments2: "Raycaster.camera" needs to be set in order to raycast against LineSegments2 while worldUnits is set to false.'),e===!1&&(this.material.resolution.x===0||this.material.resolution.y===0))return;const n=A.params.Line2!==void 0&&A.params.Line2.threshold||0;mn=A.ray;const o=this.matrixWorld,g=this.geometry,a=this.material;ca=a.linewidth+n,g.boundingSphere===null&&g.computeBoundingSphere(),CQ.copy(g.boundingSphere).applyMatrix4(o);let r;if(e)r=ca*.5;else{const l=Math.max(i.near,CQ.distanceToPoint(mn.origin));r=SW(i,l,a.resolution)}if(CQ.radius+=r,mn.intersectsSphere(CQ)===!1)return;g.boundingBox===null&&g.computeBoundingBox(),hQ.copy(g.boundingBox).applyMatrix4(o);let I;if(e)I=ca*.5;else{const l=Math.max(i.near,hQ.distanceToPoint(mn.origin));I=SW(i,l,a.resolution)}hQ.expandByScalar(I),mn.intersectsBox(hQ)!==!1&&(e?X8(this,t):J8(this,i,t))}onBeforeRender(A){const t=this.material.uniforms;t&&t.resolution&&(A.getViewport(Ny),this.material.uniforms.resolution.value.set(Ny.z,Ny.w))}}class YW extends wW{constructor(){super(),this.isLineGeometry=!0,this.type="LineGeometry"}setPositions(A){const t=A.length-3,e=new Float32Array(2*t);for(let i=0;i<t;i+=3)e[2*i]=A[i],e[2*i+1]=A[i+1],e[2*i+2]=A[i+2],e[2*i+3]=A[i+3],e[2*i+4]=A[i+4],e[2*i+5]=A[i+5];return super.setPositions(e),this}setColors(A){const t=A.length-3,e=new Float32Array(2*t);for(let i=0;i<t;i+=3)e[2*i]=A[i],e[2*i+1]=A[i+1],e[2*i+2]=A[i+2],e[2*i+3]=A[i+3],e[2*i+4]=A[i+4],e[2*i+5]=A[i+5];return super.setColors(e),this}setFromPoints(A){const t=A.length-1,e=new Float32Array(6*t);for(let i=0;i<t;i++)e[6*i]=A[i].x,e[6*i+1]=A[i].y,e[6*i+2]=A[i].z||0,e[6*i+3]=A[i+1].x,e[6*i+4]=A[i+1].y,e[6*i+5]=A[i+1].z||0;return super.setPositions(e),this}fromLine(A){const t=A.geometry;return this.setPositions(t.attributes.position.array),this}}class k8 extends x8{constructor(A=new YW,t=new Zy({color:Math.random()*16777215})){super(A,t),this.isLine2=!0,this.type="Line2"}}const EQ={lineType:"bezier",lineColor:"#22c55e",previewColor:"#f59e0b",pointColor:"#ffffff",selectedPointColor:"#f59e0b",pointSize:.34,lineWidth:4,sampleCount:64,roundedRadius:1,historyLimit:100},V8={bezier:"贝塞尔曲线",straight:"直线",rounded:"圆角直线"},H8={bezier:"∿",straight:"╱",rounded:"⌁"};class O8{type="path-draw";engine;root=new Ot;pointsGroup=new Ot;points=[];history=[];options={...EQ};lineType=EQ.lineType;roundedRadius=EQ.roundedRadius;line=null;previewLine=null;previewMarker=null;transformControl=null;transformHelper=null;selectedPointId=null;panel=null;pointsList=null;statusElement=null;addButton=null;completeButton=null;radiusInput=null;mode="editing";active=!1;closing=!1;transformDragging=!1;suppressNextCanvasClick=!1;controlsEnabledBeforeDrag=!0;pointSequence=0;pathId="";onKeyDown;constructor(A){this.engine=A,this.root.name="PathDrawRoot",this.pointsGroup.name="PathDrawPoints",this.root.add(this.pointsGroup),this.onKeyDown=this.handleKeyDown.bind(this)}open(A={}){this.active&&this.close(),this.options={...EQ,...A},this.pathId=A.id??`path-${Date.now()}`,this.lineType=this.options.lineType,this.roundedRadius=Math.max(0,this.options.roundedRadius),this.active=!0,this.mode="editing",this.engine.scene?.add(this.root),this.ensureTransformControl(),this.createPanel(),this.activateBehavior(),window.addEventListener("keydown",this.onKeyDown,!0),this.refreshAll()}startAddPoint(){return!this.active||this.transformDragging?!1:(this.mode="picking",this.clearSelection(),this.setStatus("请在模型上拾取位置"),this.addButton&&(this.addButton.dataset.active="true"),!0)}setLineType(A){!this.active||this.lineType===A||(this.saveHistory(),this.lineType=A,this.refreshAll(),this.emitChange())}undo(){const A=this.history.pop();return A?(this.restoreSnapshot(A),this.mode="editing",this.clearPreview(),this.refreshAll(),this.emitChange(),!0):!1}clear(){this.points.length!==0&&(this.saveHistory(),this.clearPointRecords(),this.mode="editing",this.clearPreview(),this.refreshAll(),this.emitChange())}getPathData(){if(this.points.length<2)return null;const A=this.buildSamplePoints(this.points.map(t=>t.position));return{version:1,id:this.pathId,lineType:this.lineType,coordinateSystem:"world",closed:!1,roundedRadius:this.roundedRadius,points:this.points.map((t,e)=>({id:t.id,order:e,role:this.getPointRole(e),position:this.toPlainVector(t.position)})),samples:A.map(t=>this.toPlainVector(t)),length:this.calculateLength(A)}}complete(){const A=this.getPathData();if(!A)return null;try{this.options.onComplete?.(A)}finally{this.close()}return A}isActive(){return this.active}close(){this.closeInternal(!0)}closeInternal(A){!this.active&&!this.panel||this.closing||(this.closing=!0,this.active=!1,window.removeEventListener("keydown",this.onKeyDown,!0),this.clearPreview(),this.clearPointRecords(),this.disposeLine("line"),this.detachTransformControl(),this.panel?.remove(),this.panel=null,this.pointsList=null,this.statusElement=null,this.addButton=null,this.completeButton=null,this.radiusInput=null,this.history.length=0,this.selectedPointId=null,this.root.parent?.remove(this.root),A&&this.restoreDefaultBehavior(),this.closing=!1)}dispose(){this.closeInternal(!1),this.transformControl?.dispose(),this.transformControl=null,this.transformHelper=null}update(){!this.active||!this.engine.camera||(this.transformControl&&this.transformControl.camera!==this.engine.camera&&(this.transformControl.camera=this.engine.camera),this.syncLineResolution(this.line),this.syncLineResolution(this.previewLine))}disActive(){this.closing||this.closeInternal(!1)}handleMouseMove(A){if(!this.active||this.mode!=="picking")return;const t=this.getCatchPoint(A?.catch);if(!t){this.clearPreview();return}this.updatePreview(t)}handleMouseClick(A){if(!this.active)return;if(this.suppressNextCanvasClick){this.suppressNextCanvasClick=!1;return}if(this.mode==="picking"){const e=this.getCatchPoint(A?.catch);if(!e)return;this.saveHistory();const i=this.createPointRecord(e);this.points.push(i),this.pointsGroup.add(i.mesh),this.mode="editing",this.clearPreview(),this.selectPoint(i.id),this.refreshAll(),this.emitChange();return}const t=this.pickPointMesh(A);t?this.selectPoint(t.userData.pathDrawPointId):this.clearSelection()}handelKeyEscDown(){if(this.mode==="picking"){this.mode="editing",this.clearPreview(),this.refreshPanel();return}this.clearSelection()}activateBehavior(){const A=this.engine.handelBehaved;A?.init?.(this,{showCatch:!0}),A?.active?.()}restoreDefaultBehavior(){const A=this.engine.handelBehaved;A?.self===this&&(A.disActive?.(),this.engine.interactionModule?.init?.(),this.engine.interactionModule?.active?.(),this.engine.catchSvg&&(this.engine.catchSvg.innerHTML=""))}ensureTransformControl(){if(this.transformControl){this.transformHelper&&!this.transformHelper.parent&&this.engine.scene?.add(this.transformHelper);return}!this.engine.camera||!this.engine.renderer||!this.engine.scene||(this.transformControl=new ql(this.engine.camera,this.engine.renderer.domElement),this.transformControl.setMode("translate"),this.transformControl.size=.72,this.transformControl.addEventListener("dragging-changed",A=>{if(this.transformDragging=!!A.value,this.transformDragging){this.saveHistory(),this.controlsEnabledBeforeDrag=this.engine.controls?.enabled!==!1,this.engine.controls&&(this.engine.controls.enabled=!1);return}this.engine.controls&&(this.engine.controls.enabled=this.controlsEnabledBeforeDrag),this.suppressNextCanvasClick=!0,requestAnimationFrame(()=>{this.suppressNextCanvasClick=!1}),this.refreshAll(),this.emitChange()}),this.transformControl.addEventListener("objectChange",()=>{const A=this.getSelectedPoint();A&&(A.position.copy(A.mesh.position),this.refreshLine(),this.refreshPanel(),this.emitChange())}),this.transformHelper=this.transformControl.getHelper(),this.transformHelper.visible=!1,this.engine.scene.add(this.transformHelper))}detachTransformControl(){this.transformControl?.detach(),this.transformHelper&&(this.transformHelper.visible=!1,this.transformHelper.parent?.remove(this.transformHelper))}createPointRecord(A,t){const e=new an(this.options.pointSize,18,12),i=new Kt({color:this.options.pointColor,depthTest:!1,depthWrite:!1}),n=new bA(e,i),o=t??`path-point-${++this.pointSequence}`;return n.name=o,n.position.copy(A),n.renderOrder=1002,n.userData.pathDrawPointId=o,{id:o,position:A.clone(),mesh:n}}selectPoint(A){const t=this.points.find(e=>e.id===A);!t||!this.transformControl||!this.transformHelper||(this.selectedPointId=A,this.points.forEach(e=>e.mesh.material.color.set(e.id===A?this.options.selectedPointColor:this.options.pointColor)),this.transformControl.attach(t.mesh),this.transformHelper.visible=!0,this.refreshPanel())}clearSelection(){this.selectedPointId=null,this.points.forEach(A=>A.mesh.material.color.set(this.options.pointColor)),this.transformControl?.detach(),this.transformHelper&&(this.transformHelper.visible=!1),this.refreshPanel()}getSelectedPoint(){return this.points.find(A=>A.id===this.selectedPointId)??null}getCatchPoint(A){return A?.point instanceof S?A.point.clone():null}pickPointMesh(A){if(!this.engine.camera||!this.engine.renderer)return null;const t=this.engine.renderer.domElement.clientWidth,e=this.engine.renderer.domElement.clientHeight;if(!t||!e)return null;const i=new MA(A.offsetX/t*2-1,-(A.offsetY/e)*2+1),n=new De;return n.setFromCamera(i,this.engine.camera),n.intersectObjects(this.pointsGroup.children,!1)[0]?.object??null}updatePreview(A){this.previewMarker||(this.previewMarker=new bA(new an(this.options.pointSize*.72,14,10),new Kt({color:this.options.previewColor,depthTest:!1,depthWrite:!1})),this.previewMarker.renderOrder=1003,this.root.add(this.previewMarker)),this.previewMarker.position.copy(A),this.previewMarker.visible=!0;const t=[...this.points.map(i=>i.position),A];if(t.length<2){this.disposeLine("previewLine");return}const e=this.buildSamplePoints(t);this.previewLine=this.updateLineObject(this.previewLine,e,!0)}clearPreview(){this.disposeLine("previewLine"),this.previewMarker&&(this.previewMarker.geometry.dispose(),this.previewMarker.material.dispose(),this.previewMarker.parent?.remove(this.previewMarker),this.previewMarker=null)}refreshAll(){this.refreshLine(),this.refreshPanel(),this.requestRender()}refreshLine(){if(this.points.length<2){this.disposeLine("line");return}const A=this.buildSamplePoints(this.points.map(t=>t.position));this.line=this.updateLineObject(this.line,A,!1)}updateLineObject(A,t,e){const i=new YW;if(i.setPositions(t.flatMap(g=>[g.x,g.y,g.z])),A)return A.geometry.dispose(),A.geometry=i,A.computeLineDistances(),this.syncLineResolution(A),this.requestRender(),A;const n=new Zy({color:e?this.options.previewColor:this.options.lineColor,linewidth:this.options.lineWidth,dashed:e,dashSize:.32,gapSize:.2,depthTest:!1,transparent:e,opacity:e?.82:1}),o=new k8(i,n);return o.name=e?"PathDrawPreviewLine":"PathDrawLine",o.renderOrder=e?1001:1e3,o.computeLineDistances(),this.syncLineResolution(o),this.root.add(o),this.requestRender(),o}syncLineResolution(A){const t=A?.material,e=this.engine.renderer?.domElement;!t||!e||t.resolution.set(e.clientWidth,e.clientHeight)}disposeLine(A){const t=this[A];if(!t)return;t.parent?.remove(t),t.geometry.dispose(),(Array.isArray(t.material)?t.material:[t.material]).forEach(i=>i.dispose()),this[A]=null}buildSamplePoints(A){return A.length<2?A.map(t=>t.clone()):this.lineType==="straight"?A.map(t=>t.clone()):this.lineType==="rounded"?this.sampleRoundedPolyline(A):this.sampleBezier(A)}sampleBezier(A){const t=Math.max(2,this.options.sampleCount);return Array.from({length:t+1},(e,i)=>{const n=A.map(g=>g.clone()),o=i/t;for(let g=n.length-1;g>0;g-=1)for(let a=0;a<g;a+=1)n[a].lerp(n[a+1],o);return n[0]})}sampleRoundedPolyline(A){if(A.length<3||this.roundedRadius<=0)return A.map(i=>i.clone());const t=[A[0].clone()],e=Math.max(4,Math.round(this.options.sampleCount/Math.max(1,A.length-2)));for(let i=1;i<A.length-1;i+=1){const n=A[i-1],o=A[i],g=A[i+1],a=n.distanceTo(o),r=o.distanceTo(g);if(a<1e-8||r<1e-8){t.push(o.clone());continue}const I=Math.min(this.roundedRadius,a*.5,r*.5),l=o.clone().lerp(n,I/a),h=o.clone().lerp(g,I/r);t.push(l);for(let B=1;B<=e;B+=1){const E=B/e,c=1-E;t.push(new S().addScaledVector(l,c*c).addScaledVector(o,2*c*E).addScaledVector(h,E*E))}}return t.push(A[A.length-1].clone()),t}calculateLength(A){let t=0;for(let e=1;e<A.length;e+=1)t+=A[e-1].distanceTo(A[e]);return t}getPointRole(A){return A===0?"start":A===this.points.length-1?"end":"control"}getRoleLabel(A){const t=this.getPointRole(A);return t==="start"?"起点":t==="end"?"终点":`控制点 ${A}`}saveHistory(){this.history.push(this.createSnapshot()),this.history.length>this.options.historyLimit&&this.history.shift()}createSnapshot(){return{lineType:this.lineType,roundedRadius:this.roundedRadius,points:this.points.map(A=>({id:A.id,position:A.position.toArray()}))}}restoreSnapshot(A){this.clearPointRecords(),this.lineType=A.lineType,this.roundedRadius=A.roundedRadius,A.points.forEach(t=>{const e=this.createPointRecord(new S(...t.position),t.id);this.points.push(e),this.pointsGroup.add(e.mesh)})}clearPointRecords(){this.clearSelection(),this.points.forEach(A=>{A.mesh.parent?.remove(A.mesh),A.mesh.geometry.dispose(),A.mesh.material.dispose()}),this.points.length=0}removePoint(A){const t=this.points.findIndex(i=>i.id===A);if(t<0)return;this.saveHistory();const[e]=this.points.splice(t,1);e.mesh.parent?.remove(e.mesh),e.mesh.geometry.dispose(),e.mesh.material.dispose(),this.selectedPointId===A&&this.clearSelection(),this.refreshAll(),this.emitChange()}updatePointCoordinate(A,t,e){const i=this.points.find(n=>n.id===A);!i||!Number.isFinite(e)||i.position[t]===e||(this.saveHistory(),i.position[t]=e,i.mesh.position[t]=e,this.refreshAll(),this.emitChange())}createPanel(){const A=document.createElement("div");A.dataset.pathDrawPanel="true",Object.assign(A.style,{position:"absolute",top:"56px",right:"16px",width:"310px",maxHeight:"calc(100% - 72px)",display:"flex",flexDirection:"column",background:"rgba(255, 255, 255, 0.98)",color:"#111827",border:"1px solid #d1d5db",borderRadius:"6px",boxShadow:"0 12px 28px rgba(15,23,42,0.18)",fontFamily:"Arial, sans-serif",fontSize:"12px",zIndex:"1200",overflow:"hidden"});const t=document.createElement("div");Object.assign(t.style,{display:"flex",alignItems:"center",minHeight:"40px",padding:"0 8px 0 12px",borderBottom:"1px solid #e5e7eb"});const e=document.createElement("strong");e.textContent="路径绘制",e.style.flex="1";const i=document.createElement("span");Object.assign(i.style,{color:"#64748b",marginRight:"8px"});const n=this.createIconButton("×","关闭路径绘制",()=>this.close());t.append(e,i,n),A.appendChild(t),this.statusElement=i;const o=document.createElement("div");Object.assign(o.style,{display:"grid",gridTemplateColumns:"repeat(3, 1fr)",gap:"4px",padding:"8px"}),["bezier","straight","rounded"].forEach(Q=>{const C=this.createIconButton(H8[Q],V8[Q],()=>this.setLineType(Q));C.dataset.lineType=Q,C.style.width="100%",C.style.fontSize="18px",o.appendChild(C)}),A.appendChild(o);const g=document.createElement("label");g.dataset.radiusRow="true",Object.assign(g.style,{display:"none",alignItems:"center",gap:"8px",padding:"0 10px 8px",color:"#475569"});const a=document.createElement("span");a.textContent="圆角";const r=document.createElement("input");r.type="number",r.min="0",r.step="0.1",Object.assign(r.style,{flex:"1",minWidth:"0",height:"26px",padding:"0 7px",color:"#111827",background:"#ffffff",border:"1px solid #cbd5e1",borderRadius:"4px"}),r.addEventListener("change",()=>{const Q=Number(r.value);if(!Number.isFinite(Q)||Q<0||Q===this.roundedRadius){r.value=String(this.roundedRadius);return}this.saveHistory(),this.roundedRadius=Q,this.refreshAll(),this.emitChange()}),g.append(a,r),A.appendChild(g),this.radiusInput=r;const I=document.createElement("div");Object.assign(I.style,{flex:"1",minHeight:"72px",maxHeight:"200px",overflowY:"auto",overflowX:"hidden",borderTop:"1px solid #e5e7eb"}),A.appendChild(I),this.pointsList=I;const l=document.createElement("div");Object.assign(l.style,{display:"grid",gridTemplateColumns:"1fr auto auto auto",gap:"6px",padding:"8px",borderTop:"1px solid #e5e7eb"});const h=this.createIconButton("+","添加点",()=>this.startAddPoint());h.style.width="100%";const B=this.createIconButton("↶","撤销 Ctrl+Z",()=>this.undo());B.dataset.undoButton="true";const E=this.createIconButton("⌫","清空路径",()=>this.clear());E.dataset.clearButton="true";const c=this.createIconButton("✓","完成并返回路径",()=>this.complete());c.dataset.primary="true",l.append(h,B,E,c),A.appendChild(l),this.addButton=h,this.completeButton=c,this.engine.container?.appendChild(A),this.panel=A}createIconButton(A,t,e){const i=document.createElement("button");return i.type="button",i.textContent=A,i.title=t,i.setAttribute("aria-label",t),Object.assign(i.style,{width:"32px",height:"30px",display:"inline-flex",alignItems:"center",justifyContent:"center",padding:"0",border:"1px solid #d1d5db",borderRadius:"4px",background:"#f8fafc",color:"#334155",cursor:"pointer",fontSize:"15px"}),i.addEventListener("click",e),i}refreshPanel(){if(!this.panel||!this.pointsList)return;this.setStatus(this.mode==="picking"?"拾取中":`${this.points.length} 个点`),this.addButton&&(this.addButton.dataset.active=String(this.mode==="picking"),this.addButton.style.background=this.mode==="picking"?"#ffedd5":"#f8fafc",this.addButton.style.borderColor=this.mode==="picking"?"#f97316":"#d1d5db",this.addButton.style.color=this.mode==="picking"?"#9a3412":"#334155"),this.panel.querySelectorAll("[data-line-type]").forEach(i=>{const n=i.dataset.lineType===this.lineType;i.style.background=n?"#dcfce7":"#f8fafc",i.style.borderColor=n?"#22c55e":"#d1d5db",i.style.color=n?"#166534":"#334155"});const A=this.panel.querySelector("[data-radius-row]");A&&(A.style.display=this.lineType==="rounded"?"flex":"none"),this.radiusInput&&(this.radiusInput.value=String(this.roundedRadius));const t=this.panel.querySelector("[data-undo-button]"),e=this.panel.querySelector("[data-clear-button]");this.setButtonDisabled(t,this.history.length===0),this.setButtonDisabled(e,this.points.length===0),this.setButtonDisabled(this.completeButton,this.points.length<2),this.renderPointRows()}renderPointRows(){if(this.pointsList){if(this.pointsList.innerHTML="",this.points.length===0){const A=document.createElement("div");A.textContent="暂无点位",Object.assign(A.style,{padding:"24px 12px",textAlign:"center",color:"#94a3b8"}),this.pointsList.appendChild(A);return}this.points.forEach((A,t)=>{const e=document.createElement("div");Object.assign(e.style,{display:"grid",gridTemplateColumns:"64px repeat(3, minmax(0, 1fr)) 28px",gap:"4px",alignItems:"center",height:"40px",boxSizing:"border-box",padding:"5px 8px",cursor:"pointer",background:A.id===this.selectedPointId?"#fef3c7":"#ffffff",borderBottom:"1px solid #eef2f7"}),e.addEventListener("click",()=>this.selectPoint(A.id));const i=document.createElement("span");i.textContent=this.getRoleLabel(t),i.title=i.textContent,Object.assign(i.style,{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:"#334155"}),e.appendChild(i),["x","y","z"].forEach(o=>{const g=document.createElement("input");g.type="number",g.step="0.001",g.value=A.position[o].toFixed(3),g.title=o.toUpperCase(),Object.assign(g.style,{width:"100%",minWidth:"0",height:"25px",padding:"0 4px",boxSizing:"border-box",color:"#1f2937",background:"#ffffff",border:"1px solid #cbd5e1",borderRadius:"3px",fontSize:"11px"}),g.addEventListener("click",a=>a.stopPropagation()),g.addEventListener("change",()=>this.updatePointCoordinate(A.id,o,Number(g.value))),e.appendChild(g)});const n=this.createIconButton("×",`删除${this.getRoleLabel(t)}`,()=>this.removePoint(A.id));n.style.width="28px",n.style.height="25px",n.addEventListener("click",o=>o.stopPropagation()),e.appendChild(n),this.pointsList?.appendChild(e)})}}setButtonDisabled(A,t){A&&(A.disabled=t,A.style.opacity=t?"0.4":"1",A.style.cursor=t?"not-allowed":"pointer",A.dataset.primary==="true"&&(A.style.background=t?"#f1f5f9":"#16a34a",A.style.color=t?"#94a3b8":"#ffffff",A.style.borderColor=t?"#d1d5db":"#15803d"))}setStatus(A){this.statusElement&&(this.statusElement.textContent=A)}handleKeyDown(A){if(!(!this.active||this.isTextInputTarget(A))){if((A.ctrlKey||A.metaKey)&&!A.shiftKey&&!A.altKey&&A.key.toLowerCase()==="z"){if(this.history.length===0)return;A.preventDefault(),A.stopImmediatePropagation(),this.undo();return}A.key==="Escape"&&this.handelKeyEscDown()}}isTextInputTarget(A){const t=A.target;return!!(t?.isContentEditable||["INPUT","TEXTAREA","SELECT"].includes(t?.tagName??""))}emitChange(){this.options.onChange?.(this.getPathData()),this.requestRender()}requestRender(){this.engine.requestComposerRender?.()}toPlainVector(A){return{x:A.x,y:A.y,z:A.z}}}class L8{engine;continusIds=new Map;constructor(A){this.engine=A}buildContinueIds(A){const e=this.engine?.engineStatus?.models?.find(n=>n.url===A)?.properties?.models;if(e==null||typeof e!="object"){this.continusIds.set(A,new Set);return}const i=new Set;Object.keys(e).forEach(n=>{const o=Number(n);Number.isFinite(o)&&this.shouldFilterId(A,n,e[n])&&i.add(o)}),this.continusIds.set(A,i)}setContinueIds(A,t){const e=new Set;t.forEach(i=>{const n=Number(i);Number.isFinite(n)&&e.add(n)}),this.continusIds.set(A,e)}getContinueIds(A){return Array.from(this.continusIds.get(A)??[])}getContinueIdSet(A){return this.continusIds.get(A)??new Set}hasContinueId(A,t){const e=Number(t);return Number.isFinite(e)?this.getContinueIdSet(A).has(e):!1}clear(A){if(typeof A=="string"){this.continusIds.delete(A);return}this.continusIds.clear()}shouldFilterId(A,t,e){const n=this.engine?.engineStatus?.models?.find(I=>I.url===A)?.properties,o=Array.isArray(e)?e:n?.models?.[t];if(n==null||!Array.isArray(o)||o.length===0)return!1;const g=n.categorys??{},a=n.names??{},r=n.values??{};return o.some(I=>{if(!Array.isArray(I)||I.length<3)return!1;const l=String(g[I[0]]??""),h=String(a[I[1]]??""),B=String(r[I[2]]??"");return l.includes("图层信息")&&h.includes("父类别")&&(B.includes("注释")||B.includes("视口范围")||B.includes("剖面"))})}}const UB={version:"3.12.28"}.version;function Jy(){const s=globalThis.crypto?.subtle;if(!s)throw new Error("[BimEngine] Web Crypto API is required for secure sdkAuth credentials mode");return s}function XB(s){return new TextEncoder().encode(s)}function JB(s){return s.buffer.slice(s.byteOffset,s.byteOffset+s.byteLength)}function FW(s){let A="";return s.forEach(t=>{A+=String.fromCharCode(t)}),btoa(A)}function z8(s){const A=s.getUTCFullYear(),t=String(s.getUTCMonth()+1).padStart(2,"0"),e=String(s.getUTCDate()).padStart(2,"0");return`${A}${t}${e}`}async function v8(s){const A=await Jy().digest("SHA-256",JB(XB(s)));return Array.from(new Uint8Array(A)).map(t=>t.toString(16).padStart(2,"0")).join("")}async function _8(s,A){const t=Jy(),e=await t.importKey("raw",JB(s),{name:"HMAC",hash:"SHA-256"},!1,["sign"]);return t.sign("HMAC",e,JB(XB(A)))}function q8(s){return XB([s.appId,s.engineType,s.requestDate,String(s.timestamp),s.nonce].join("|"))}async function $8(s){const A=Jy(),t=new Date,e=t.getTime(),i=z8(t),n=globalThis.crypto.randomUUID(),o=globalThis.crypto.getRandomValues(new Uint8Array(12)),g=await v8(s.appSecret),a=await _8(XB(g),i),r=await A.importKey("raw",a,"AES-GCM",!1,["encrypt"]),I=JSON.stringify({appKey:s.appKey,appSecret:s.appSecret}),l=await A.encrypt({name:"AES-GCM",iv:o,additionalData:JB(q8({appId:s.appId,engineType:s.engineType,requestDate:i,timestamp:e,nonce:n})),tagLength:128},r,JB(XB(I)));return{appId:s.appId,engineType:s.engineType,requestDate:i,timestamp:e,nonce:n,iv:FW(o),cipherText:FW(new Uint8Array(l)),sdkVersion:s.sdkVersion,origin:s.origin,product:s.product}}const xy=new Map;function cQ(s){return s.replace(/\/+$/,"")}function QQ(s){if(s)return s;if(typeof window<"u"&&typeof window.location?.origin=="string")return window.location.origin}function A3(s,A){return JSON.stringify({endpoint:cQ(s.endpoint),token:s.token??"",appId:s.appId??"",appKey:s.appKey??"",appSecret:s.appSecret??"",origin:QQ(s.origin)??"",product:s.product??"",engineType:A,sdkVersion:UB})}async function ky(s,A,t){const e=typeof AbortController<"u"?new AbortController:void 0,i=e?setTimeout(()=>e.abort(),t):void 0;try{const n=await fetch(s,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(A),signal:e?.signal}),o=await n.json().catch(()=>({}));if(!n.ok){const g=o?.error?.message??o?.message??`SDK authentication failed with status ${n.status}`;throw new Error(g)}return o}finally{i!=null&&clearTimeout(i)}}async function t3(s,A){const t=await ky(`${cQ(s.endpoint)}/oauth/sdk-verify`,{sdkToken:s.token,engineType:A,sdkVersion:UB,origin:QQ(s.origin),product:s.product},s.timeoutMs??8e3);return t.sdkToken=s.token,t}async function e3(s,A){const t=await $8({appId:s.appId,appKey:s.appKey,appSecret:s.appSecret,engineType:A,sdkVersion:UB,origin:QQ(s.origin),product:s.product}),e=await ky(`${cQ(s.endpoint)}/oauth/sdk-token/secure`,t,s.timeoutMs??8e3),i=await ky(`${cQ(s.endpoint)}/oauth/sdk-verify`,{sdkToken:e.sdkToken,engineType:A,sdkVersion:UB,origin:QQ(s.origin),product:s.product},s.timeoutMs??8e3);return i.sdkToken=e.sdkToken,i}async function i3(s,A){const t=s?.sdkAuth;if(!t)return null;if(!t.endpoint)throw new Error("[BimEngine] sdkAuth.endpoint is required");if(!t.token&&!(t.appId&&t.appKey&&t.appSecret))return null;const e=A3(t,A),i=xy.get(e);if(i){const o=await i;return s&&(s.__sdkAuthSession=o),o}const n=(t.token?t3(t,A):e3(t,A)).then(o=>{if(o.authorized!==!0)throw new Error("[BimEngine] SDK authorization rejected");return s&&(s.__sdkAuthSession=o),o}).catch(o=>{throw xy.delete(e),o});return xy.set(e,n),n}var Vy,bW;function Pt(){return bW||(bW=1,Vy={options:{usePureJavaScript:!1}}),Vy}var Hy={exports:{}},Oy,WW;function s3(){if(WW)return Oy;WW=1;var s={};Oy=s;var A={};s.encode=function(e,i,n){if(typeof i!="string")throw new TypeError('"alphabet" must be a string.');if(n!==void 0&&typeof n!="number")throw new TypeError('"maxline" must be a number.');var o="";if(!(e instanceof Uint8Array))o=t(e,i);else{var g=0,a=i.length,r=i.charAt(0),I=[0];for(g=0;g<e.length;++g){for(var l=0,h=e[g];l<I.length;++l)h+=I[l]<<8,I[l]=h%a,h=h/a|0;for(;h>0;)I.push(h%a),h=h/a|0}for(g=0;e[g]===0&&g<e.length-1;++g)o+=r;for(g=I.length-1;g>=0;--g)o+=i[I[g]]}if(n){var B=new RegExp(".{1,"+n+"}","g");o=o.match(B).join(`\r
|
|
6600
|
+
`};class Zy extends $t{constructor(A){super({type:"LineMaterial",uniforms:oi.clone(Zi.line.uniforms),vertexShader:Zi.line.vertexShader,fragmentShader:Zi.line.fragmentShader,clipping:!0}),this.isLineMaterial=!0,this.setValues(A)}get color(){return this.uniforms.diffuse.value}set color(A){this.uniforms.diffuse.value=A}get worldUnits(){return"WORLD_UNITS"in this.defines}set worldUnits(A){A===!0!==this.worldUnits&&(this.needsUpdate=!0),A===!0?this.defines.WORLD_UNITS="":delete this.defines.WORLD_UNITS}get linewidth(){return this.uniforms.linewidth.value}set linewidth(A){this.uniforms.linewidth&&(this.uniforms.linewidth.value=A)}get dashed(){return"USE_DASH"in this.defines}set dashed(A){A===!0!==this.dashed&&(this.needsUpdate=!0),A===!0?this.defines.USE_DASH="":delete this.defines.USE_DASH}get dashScale(){return this.uniforms.dashScale.value}set dashScale(A){this.uniforms.dashScale.value=A}get dashSize(){return this.uniforms.dashSize.value}set dashSize(A){this.uniforms.dashSize.value=A}get dashOffset(){return this.uniforms.dashOffset.value}set dashOffset(A){this.uniforms.dashOffset.value=A}get gapSize(){return this.uniforms.gapSize.value}set gapSize(A){this.uniforms.gapSize.value=A}get opacity(){return this.uniforms.opacity.value}set opacity(A){this.uniforms&&(this.uniforms.opacity.value=A)}get resolution(){return this.uniforms.resolution.value}set resolution(A){this.uniforms.resolution.value.copy(A)}get alphaToCoverage(){return"USE_ALPHA_TO_COVERAGE"in this.defines}set alphaToCoverage(A){this.defines&&(A===!0!==this.alphaToCoverage&&(this.needsUpdate=!0),A===!0?this.defines.USE_ALPHA_TO_COVERAGE="":delete this.defines.USE_ALPHA_TO_COVERAGE)}}const Ny=new Ct,uW=new S,mW=new S,Qi=new Ct,di=new Ct,wn=new Ct,Uy=new S,Xy=new RA,fi=new vi,PW=new S,hQ=new vA,CQ=new be,un=new Ct;let mn,ca;function SW(s,A,t){return un.set(0,0,-A,1).applyMatrix4(s.projectionMatrix),un.multiplyScalar(1/un.w),un.x=ca/t.width,un.y=ca/t.height,un.applyMatrix4(s.projectionMatrixInverse),un.multiplyScalar(1/un.w),Math.abs(Math.max(un.x,un.y))}function X8(s,A){const t=s.matrixWorld,e=s.geometry,i=e.attributes.instanceStart,n=e.attributes.instanceEnd,o=Math.min(e.instanceCount,i.count);for(let g=0,a=o;g<a;g++){fi.start.fromBufferAttribute(i,g),fi.end.fromBufferAttribute(n,g),fi.applyMatrix4(t);const r=new S,I=new S;mn.distanceSqToSegment(fi.start,fi.end,I,r),I.distanceTo(r)<ca*.5&&A.push({point:I,pointOnLine:r,distance:mn.origin.distanceTo(I),object:s,face:null,faceIndex:g,uv:null,uv1:null})}}function J8(s,A,t){const e=A.projectionMatrix,n=s.material.resolution,o=s.matrixWorld,g=s.geometry,a=g.attributes.instanceStart,r=g.attributes.instanceEnd,I=Math.min(g.instanceCount,a.count),l=-A.near;mn.at(1,wn),wn.w=1,wn.applyMatrix4(A.matrixWorldInverse),wn.applyMatrix4(e),wn.multiplyScalar(1/wn.w),wn.x*=n.x/2,wn.y*=n.y/2,wn.z=0,Uy.copy(wn),Xy.multiplyMatrices(A.matrixWorldInverse,o);for(let h=0,B=I;h<B;h++){if(Qi.fromBufferAttribute(a,h),di.fromBufferAttribute(r,h),Qi.w=1,di.w=1,Qi.applyMatrix4(Xy),di.applyMatrix4(Xy),Qi.z>l&&di.z>l)continue;if(Qi.z>l){const M=Qi.z-di.z,y=(Qi.z-l)/M;Qi.lerp(di,y)}else if(di.z>l){const M=di.z-Qi.z,y=(di.z-l)/M;di.lerp(Qi,y)}Qi.applyMatrix4(e),di.applyMatrix4(e),Qi.multiplyScalar(1/Qi.w),di.multiplyScalar(1/di.w),Qi.x*=n.x/2,Qi.y*=n.y/2,di.x*=n.x/2,di.y*=n.y/2,fi.start.copy(Qi),fi.start.z=0,fi.end.copy(di),fi.end.z=0;const c=fi.closestPointToPointParameter(Uy,!0);fi.at(c,PW);const Q=rt.lerp(Qi.z,di.z,c),C=Q>=-1&&Q<=1,d=Uy.distanceTo(PW)<ca*.5;if(C&&d){fi.start.fromBufferAttribute(a,h),fi.end.fromBufferAttribute(r,h),fi.start.applyMatrix4(o),fi.end.applyMatrix4(o);const M=new S,y=new S;mn.distanceSqToSegment(fi.start,fi.end,y,M),t.push({point:y,pointOnLine:M,distance:mn.origin.distanceTo(y),object:s,face:null,faceIndex:h,uv:null,uv1:null})}}}class x8 extends bA{constructor(A=new wW,t=new Zy({color:Math.random()*16777215})){super(A,t),this.isLineSegments2=!0,this.type="LineSegments2"}computeLineDistances(){const A=this.geometry,t=A.attributes.instanceStart,e=A.attributes.instanceEnd,i=new Float32Array(2*t.count);for(let o=0,g=0,a=t.count;o<a;o++,g+=2)uW.fromBufferAttribute(t,o),mW.fromBufferAttribute(e,o),i[g]=g===0?0:i[g-1],i[g+1]=i[g]+uW.distanceTo(mW);const n=new JC(i,2,1);return A.setAttribute("instanceDistanceStart",new ji(n,1,0)),A.setAttribute("instanceDistanceEnd",new ji(n,1,1)),this}raycast(A,t){const e=this.material.worldUnits,i=A.camera;if(i===null&&!e&&console.error('LineSegments2: "Raycaster.camera" needs to be set in order to raycast against LineSegments2 while worldUnits is set to false.'),e===!1&&(this.material.resolution.x===0||this.material.resolution.y===0))return;const n=A.params.Line2!==void 0&&A.params.Line2.threshold||0;mn=A.ray;const o=this.matrixWorld,g=this.geometry,a=this.material;ca=a.linewidth+n,g.boundingSphere===null&&g.computeBoundingSphere(),CQ.copy(g.boundingSphere).applyMatrix4(o);let r;if(e)r=ca*.5;else{const l=Math.max(i.near,CQ.distanceToPoint(mn.origin));r=SW(i,l,a.resolution)}if(CQ.radius+=r,mn.intersectsSphere(CQ)===!1)return;g.boundingBox===null&&g.computeBoundingBox(),hQ.copy(g.boundingBox).applyMatrix4(o);let I;if(e)I=ca*.5;else{const l=Math.max(i.near,hQ.distanceToPoint(mn.origin));I=SW(i,l,a.resolution)}hQ.expandByScalar(I),mn.intersectsBox(hQ)!==!1&&(e?X8(this,t):J8(this,i,t))}onBeforeRender(A){const t=this.material.uniforms;t&&t.resolution&&(A.getViewport(Ny),this.material.uniforms.resolution.value.set(Ny.z,Ny.w))}}class YW extends wW{constructor(){super(),this.isLineGeometry=!0,this.type="LineGeometry"}setPositions(A){const t=A.length-3,e=new Float32Array(2*t);for(let i=0;i<t;i+=3)e[2*i]=A[i],e[2*i+1]=A[i+1],e[2*i+2]=A[i+2],e[2*i+3]=A[i+3],e[2*i+4]=A[i+4],e[2*i+5]=A[i+5];return super.setPositions(e),this}setColors(A){const t=A.length-3,e=new Float32Array(2*t);for(let i=0;i<t;i+=3)e[2*i]=A[i],e[2*i+1]=A[i+1],e[2*i+2]=A[i+2],e[2*i+3]=A[i+3],e[2*i+4]=A[i+4],e[2*i+5]=A[i+5];return super.setColors(e),this}setFromPoints(A){const t=A.length-1,e=new Float32Array(6*t);for(let i=0;i<t;i++)e[6*i]=A[i].x,e[6*i+1]=A[i].y,e[6*i+2]=A[i].z||0,e[6*i+3]=A[i+1].x,e[6*i+4]=A[i+1].y,e[6*i+5]=A[i+1].z||0;return super.setPositions(e),this}fromLine(A){const t=A.geometry;return this.setPositions(t.attributes.position.array),this}}class k8 extends x8{constructor(A=new YW,t=new Zy({color:Math.random()*16777215})){super(A,t),this.isLine2=!0,this.type="Line2"}}const EQ={lineType:"bezier",lineColor:"#22c55e",previewColor:"#f59e0b",pointColor:"#ffffff",selectedPointColor:"#f59e0b",pointSize:.34,lineWidth:4,sampleCount:64,roundedRadius:1,historyLimit:100},V8={bezier:"贝塞尔曲线",straight:"直线",rounded:"圆角直线"},H8={bezier:"∿",straight:"╱",rounded:"⌁"};class O8{type="path-draw";engine;root=new Ot;pointsGroup=new Ot;points=[];history=[];options={...EQ};lineType=EQ.lineType;roundedRadius=EQ.roundedRadius;line=null;previewLine=null;previewMarker=null;transformControl=null;transformHelper=null;selectedPointId=null;panel=null;pointsList=null;statusElement=null;addButton=null;completeButton=null;radiusInput=null;mode="editing";active=!1;closing=!1;transformDragging=!1;suppressNextCanvasClick=!1;controlsEnabledBeforeDrag=!0;pointSequence=0;pathId="";onKeyDown;constructor(A){this.engine=A,this.root.name="PathDrawRoot",this.pointsGroup.name="PathDrawPoints",this.root.add(this.pointsGroup),this.onKeyDown=this.handleKeyDown.bind(this)}open(A={}){this.active&&this.close(),this.options={...EQ,...A},this.pathId=A.id??`path-${Date.now()}`,this.lineType=this.options.lineType,this.roundedRadius=Math.max(0,this.options.roundedRadius),this.active=!0,this.mode="editing",this.engine.scene?.add(this.root),this.ensureTransformControl(),this.createPanel(),this.activateBehavior(),window.addEventListener("keydown",this.onKeyDown,!0),this.refreshAll()}startAddPoint(){return!this.active||this.transformDragging?!1:(this.mode="picking",this.clearSelection(),this.setStatus("请在模型上拾取位置"),this.addButton&&(this.addButton.dataset.active="true"),!0)}setLineType(A){!this.active||this.lineType===A||(this.saveHistory(),this.lineType=A,this.refreshAll(),this.emitChange())}undo(){const A=this.history.pop();return A?(this.restoreSnapshot(A),this.mode="editing",this.clearPreview(),this.refreshAll(),this.emitChange(),!0):!1}clear(){this.points.length!==0&&(this.saveHistory(),this.clearPointRecords(),this.mode="editing",this.clearPreview(),this.refreshAll(),this.emitChange())}getPathData(){if(this.points.length<2)return null;const A=this.buildSamplePoints(this.points.map(t=>t.position));return{version:1,id:this.pathId,lineType:this.lineType,coordinateSystem:"world",closed:!1,roundedRadius:this.roundedRadius,points:this.points.map((t,e)=>({id:t.id,order:e,role:this.getPointRole(e),position:this.toPlainVector(t.position)})),samples:A.map(t=>this.toPlainVector(t)),length:this.calculateLength(A)}}complete(){const A=this.getPathData();if(!A)return null;try{this.options.onComplete?.(A)}finally{this.close()}return A}isActive(){return this.active}close(){this.closeInternal(!0)}closeInternal(A){!this.active&&!this.panel||this.closing||(this.closing=!0,this.active=!1,window.removeEventListener("keydown",this.onKeyDown,!0),this.clearPreview(),this.clearPointRecords(),this.disposeLine("line"),this.detachTransformControl(),this.panel?.remove(),this.panel=null,this.pointsList=null,this.statusElement=null,this.addButton=null,this.completeButton=null,this.radiusInput=null,this.history.length=0,this.selectedPointId=null,this.root.parent?.remove(this.root),A&&this.restoreDefaultBehavior(),this.closing=!1)}dispose(){this.closeInternal(!1),this.transformControl?.dispose(),this.transformControl=null,this.transformHelper=null}update(){!this.active||!this.engine.camera||(this.transformControl&&this.transformControl.camera!==this.engine.camera&&(this.transformControl.camera=this.engine.camera),this.syncLineResolution(this.line),this.syncLineResolution(this.previewLine))}disActive(){this.closing||this.closeInternal(!1)}handleMouseMove(A){if(!this.active||this.mode!=="picking")return;const t=this.getCatchPoint(A?.catch);if(!t){this.clearPreview();return}this.updatePreview(t)}handleMouseClick(A){if(!this.active)return;if(this.suppressNextCanvasClick){this.suppressNextCanvasClick=!1;return}if(this.mode==="picking"){const e=this.getCatchPoint(A?.catch);if(!e)return;this.saveHistory();const i=this.createPointRecord(e);this.points.push(i),this.pointsGroup.add(i.mesh),this.mode="editing",this.clearPreview(),this.selectPoint(i.id),this.refreshAll(),this.emitChange();return}const t=this.pickPointMesh(A);t?this.selectPoint(t.userData.pathDrawPointId):this.clearSelection()}handelKeyEscDown(){if(this.mode==="picking"){this.mode="editing",this.clearPreview(),this.refreshPanel();return}this.clearSelection()}activateBehavior(){const A=this.engine.handelBehaved;A?.init?.(this,{showCatch:!0}),A?.active?.()}restoreDefaultBehavior(){const A=this.engine.handelBehaved;A?.self===this&&(A.disActive?.(),this.engine.interactionModule?.init?.(),this.engine.interactionModule?.active?.(),this.engine.catchSvg&&(this.engine.catchSvg.innerHTML=""))}ensureTransformControl(){if(this.transformControl){this.transformHelper&&!this.transformHelper.parent&&this.engine.scene?.add(this.transformHelper);return}!this.engine.camera||!this.engine.renderer||!this.engine.scene||(this.transformControl=new ql(this.engine.camera,this.engine.renderer.domElement),this.transformControl.setMode("translate"),this.transformControl.size=.72,this.transformControl.addEventListener("dragging-changed",A=>{if(this.transformDragging=!!A.value,this.transformDragging){this.saveHistory(),this.controlsEnabledBeforeDrag=this.engine.controls?.enabled!==!1,this.engine.controls&&(this.engine.controls.enabled=!1);return}this.engine.controls&&(this.engine.controls.enabled=this.controlsEnabledBeforeDrag),this.suppressNextCanvasClick=!0,requestAnimationFrame(()=>{this.suppressNextCanvasClick=!1}),this.refreshAll(),this.emitChange()}),this.transformControl.addEventListener("objectChange",()=>{const A=this.getSelectedPoint();A&&(A.position.copy(A.mesh.position),this.refreshLine(),this.refreshPanel(),this.emitChange())}),this.transformHelper=this.transformControl.getHelper(),this.transformHelper.visible=!1,this.engine.scene.add(this.transformHelper))}detachTransformControl(){this.transformControl?.detach(),this.transformHelper&&(this.transformHelper.visible=!1,this.transformHelper.parent?.remove(this.transformHelper))}createPointRecord(A,t){const e=new an(this.options.pointSize,18,12),i=new Kt({color:this.options.pointColor,depthTest:!1,depthWrite:!1}),n=new bA(e,i),o=t??`path-point-${++this.pointSequence}`;return n.name=o,n.position.copy(A),n.renderOrder=1002,n.userData.pathDrawPointId=o,{id:o,position:A.clone(),mesh:n}}selectPoint(A){const t=this.points.find(e=>e.id===A);!t||!this.transformControl||!this.transformHelper||(this.selectedPointId=A,this.points.forEach(e=>e.mesh.material.color.set(e.id===A?this.options.selectedPointColor:this.options.pointColor)),this.transformControl.attach(t.mesh),this.transformHelper.visible=!0,this.refreshPanel())}clearSelection(){this.selectedPointId=null,this.points.forEach(A=>A.mesh.material.color.set(this.options.pointColor)),this.transformControl?.detach(),this.transformHelper&&(this.transformHelper.visible=!1),this.refreshPanel()}getSelectedPoint(){return this.points.find(A=>A.id===this.selectedPointId)??null}getCatchPoint(A){return A?.point instanceof S?A.point.clone():null}pickPointMesh(A){if(!this.engine.camera||!this.engine.renderer)return null;const t=this.engine.renderer.domElement.clientWidth,e=this.engine.renderer.domElement.clientHeight;if(!t||!e)return null;const i=new MA(A.offsetX/t*2-1,-(A.offsetY/e)*2+1),n=new De;return n.setFromCamera(i,this.engine.camera),n.intersectObjects(this.pointsGroup.children,!1)[0]?.object??null}updatePreview(A){this.previewMarker||(this.previewMarker=new bA(new an(this.options.pointSize*.72,14,10),new Kt({color:this.options.previewColor,depthTest:!1,depthWrite:!1})),this.previewMarker.renderOrder=1003,this.root.add(this.previewMarker)),this.previewMarker.position.copy(A),this.previewMarker.visible=!0;const t=[...this.points.map(i=>i.position),A];if(t.length<2){this.disposeLine("previewLine");return}const e=this.buildSamplePoints(t);this.previewLine=this.updateLineObject(this.previewLine,e,!0)}clearPreview(){this.disposeLine("previewLine"),this.previewMarker&&(this.previewMarker.geometry.dispose(),this.previewMarker.material.dispose(),this.previewMarker.parent?.remove(this.previewMarker),this.previewMarker=null)}refreshAll(){this.refreshLine(),this.refreshPanel(),this.requestRender()}refreshLine(){if(this.points.length<2){this.disposeLine("line");return}const A=this.buildSamplePoints(this.points.map(t=>t.position));this.line=this.updateLineObject(this.line,A,!1)}updateLineObject(A,t,e){const i=new YW;if(i.setPositions(t.flatMap(g=>[g.x,g.y,g.z])),A)return A.geometry.dispose(),A.geometry=i,A.computeLineDistances(),this.syncLineResolution(A),this.requestRender(),A;const n=new Zy({color:e?this.options.previewColor:this.options.lineColor,linewidth:this.options.lineWidth,dashed:e,dashSize:.32,gapSize:.2,depthTest:!1,transparent:e,opacity:e?.82:1}),o=new k8(i,n);return o.name=e?"PathDrawPreviewLine":"PathDrawLine",o.renderOrder=e?1001:1e3,o.computeLineDistances(),this.syncLineResolution(o),this.root.add(o),this.requestRender(),o}syncLineResolution(A){const t=A?.material,e=this.engine.renderer?.domElement;!t||!e||t.resolution.set(e.clientWidth,e.clientHeight)}disposeLine(A){const t=this[A];if(!t)return;t.parent?.remove(t),t.geometry.dispose(),(Array.isArray(t.material)?t.material:[t.material]).forEach(i=>i.dispose()),this[A]=null}buildSamplePoints(A){return A.length<2?A.map(t=>t.clone()):this.lineType==="straight"?A.map(t=>t.clone()):this.lineType==="rounded"?this.sampleRoundedPolyline(A):this.sampleBezier(A)}sampleBezier(A){const t=Math.max(2,this.options.sampleCount);return Array.from({length:t+1},(e,i)=>{const n=A.map(g=>g.clone()),o=i/t;for(let g=n.length-1;g>0;g-=1)for(let a=0;a<g;a+=1)n[a].lerp(n[a+1],o);return n[0]})}sampleRoundedPolyline(A){if(A.length<3||this.roundedRadius<=0)return A.map(i=>i.clone());const t=[A[0].clone()],e=Math.max(4,Math.round(this.options.sampleCount/Math.max(1,A.length-2)));for(let i=1;i<A.length-1;i+=1){const n=A[i-1],o=A[i],g=A[i+1],a=n.distanceTo(o),r=o.distanceTo(g);if(a<1e-8||r<1e-8){t.push(o.clone());continue}const I=Math.min(this.roundedRadius,a*.5,r*.5),l=o.clone().lerp(n,I/a),h=o.clone().lerp(g,I/r);t.push(l);for(let B=1;B<=e;B+=1){const E=B/e,c=1-E;t.push(new S().addScaledVector(l,c*c).addScaledVector(o,2*c*E).addScaledVector(h,E*E))}}return t.push(A[A.length-1].clone()),t}calculateLength(A){let t=0;for(let e=1;e<A.length;e+=1)t+=A[e-1].distanceTo(A[e]);return t}getPointRole(A){return A===0?"start":A===this.points.length-1?"end":"control"}getRoleLabel(A){const t=this.getPointRole(A);return t==="start"?"起点":t==="end"?"终点":`控制点 ${A}`}saveHistory(){this.history.push(this.createSnapshot()),this.history.length>this.options.historyLimit&&this.history.shift()}createSnapshot(){return{lineType:this.lineType,roundedRadius:this.roundedRadius,points:this.points.map(A=>({id:A.id,position:A.position.toArray()}))}}restoreSnapshot(A){this.clearPointRecords(),this.lineType=A.lineType,this.roundedRadius=A.roundedRadius,A.points.forEach(t=>{const e=this.createPointRecord(new S(...t.position),t.id);this.points.push(e),this.pointsGroup.add(e.mesh)})}clearPointRecords(){this.clearSelection(),this.points.forEach(A=>{A.mesh.parent?.remove(A.mesh),A.mesh.geometry.dispose(),A.mesh.material.dispose()}),this.points.length=0}removePoint(A){const t=this.points.findIndex(i=>i.id===A);if(t<0)return;this.saveHistory();const[e]=this.points.splice(t,1);e.mesh.parent?.remove(e.mesh),e.mesh.geometry.dispose(),e.mesh.material.dispose(),this.selectedPointId===A&&this.clearSelection(),this.refreshAll(),this.emitChange()}updatePointCoordinate(A,t,e){const i=this.points.find(n=>n.id===A);!i||!Number.isFinite(e)||i.position[t]===e||(this.saveHistory(),i.position[t]=e,i.mesh.position[t]=e,this.refreshAll(),this.emitChange())}createPanel(){const A=document.createElement("div");A.dataset.pathDrawPanel="true",Object.assign(A.style,{position:"absolute",top:"56px",right:"16px",width:"310px",maxHeight:"calc(100% - 72px)",display:"flex",flexDirection:"column",background:"rgba(255, 255, 255, 0.98)",color:"#111827",border:"1px solid #d1d5db",borderRadius:"6px",boxShadow:"0 12px 28px rgba(15,23,42,0.18)",fontFamily:"Arial, sans-serif",fontSize:"12px",zIndex:"1200",overflow:"hidden"});const t=document.createElement("div");Object.assign(t.style,{display:"flex",alignItems:"center",minHeight:"40px",padding:"0 8px 0 12px",borderBottom:"1px solid #e5e7eb"});const e=document.createElement("strong");e.textContent="路径绘制",e.style.flex="1";const i=document.createElement("span");Object.assign(i.style,{color:"#64748b",marginRight:"8px"});const n=this.createIconButton("×","关闭路径绘制",()=>this.close());t.append(e,i,n),A.appendChild(t),this.statusElement=i;const o=document.createElement("div");Object.assign(o.style,{display:"grid",gridTemplateColumns:"repeat(3, 1fr)",gap:"4px",padding:"8px"}),["bezier","straight","rounded"].forEach(Q=>{const C=this.createIconButton(H8[Q],V8[Q],()=>this.setLineType(Q));C.dataset.lineType=Q,C.style.width="100%",C.style.fontSize="18px",o.appendChild(C)}),A.appendChild(o);const g=document.createElement("label");g.dataset.radiusRow="true",Object.assign(g.style,{display:"none",alignItems:"center",gap:"8px",padding:"0 10px 8px",color:"#475569"});const a=document.createElement("span");a.textContent="圆角";const r=document.createElement("input");r.type="number",r.min="0",r.step="0.1",Object.assign(r.style,{flex:"1",minWidth:"0",height:"26px",padding:"0 7px",color:"#111827",background:"#ffffff",border:"1px solid #cbd5e1",borderRadius:"4px"}),r.addEventListener("change",()=>{const Q=Number(r.value);if(!Number.isFinite(Q)||Q<0||Q===this.roundedRadius){r.value=String(this.roundedRadius);return}this.saveHistory(),this.roundedRadius=Q,this.refreshAll(),this.emitChange()}),g.append(a,r),A.appendChild(g),this.radiusInput=r;const I=document.createElement("div");Object.assign(I.style,{flex:"1",minHeight:"72px",maxHeight:"200px",overflowY:"auto",overflowX:"hidden",borderTop:"1px solid #e5e7eb"}),A.appendChild(I),this.pointsList=I;const l=document.createElement("div");Object.assign(l.style,{display:"grid",gridTemplateColumns:"1fr auto auto auto",gap:"6px",padding:"8px",borderTop:"1px solid #e5e7eb"});const h=this.createIconButton("+","添加点",()=>this.startAddPoint());h.style.width="100%";const B=this.createIconButton("↶","撤销 Ctrl+Z",()=>this.undo());B.dataset.undoButton="true";const E=this.createIconButton("⌫","清空路径",()=>this.clear());E.dataset.clearButton="true";const c=this.createIconButton("✓","完成并返回路径",()=>this.complete());c.dataset.primary="true",l.append(h,B,E,c),A.appendChild(l),this.addButton=h,this.completeButton=c,this.engine.container?.appendChild(A),this.panel=A}createIconButton(A,t,e){const i=document.createElement("button");return i.type="button",i.textContent=A,i.title=t,i.setAttribute("aria-label",t),Object.assign(i.style,{width:"32px",height:"30px",display:"inline-flex",alignItems:"center",justifyContent:"center",padding:"0",border:"1px solid #d1d5db",borderRadius:"4px",background:"#f8fafc",color:"#334155",cursor:"pointer",fontSize:"15px"}),i.addEventListener("click",e),i}refreshPanel(){if(!this.panel||!this.pointsList)return;this.setStatus(this.mode==="picking"?"拾取中":`${this.points.length} 个点`),this.addButton&&(this.addButton.dataset.active=String(this.mode==="picking"),this.addButton.style.background=this.mode==="picking"?"#ffedd5":"#f8fafc",this.addButton.style.borderColor=this.mode==="picking"?"#f97316":"#d1d5db",this.addButton.style.color=this.mode==="picking"?"#9a3412":"#334155"),this.panel.querySelectorAll("[data-line-type]").forEach(i=>{const n=i.dataset.lineType===this.lineType;i.style.background=n?"#dcfce7":"#f8fafc",i.style.borderColor=n?"#22c55e":"#d1d5db",i.style.color=n?"#166534":"#334155"});const A=this.panel.querySelector("[data-radius-row]");A&&(A.style.display=this.lineType==="rounded"?"flex":"none"),this.radiusInput&&(this.radiusInput.value=String(this.roundedRadius));const t=this.panel.querySelector("[data-undo-button]"),e=this.panel.querySelector("[data-clear-button]");this.setButtonDisabled(t,this.history.length===0),this.setButtonDisabled(e,this.points.length===0),this.setButtonDisabled(this.completeButton,this.points.length<2),this.renderPointRows()}renderPointRows(){if(this.pointsList){if(this.pointsList.innerHTML="",this.points.length===0){const A=document.createElement("div");A.textContent="暂无点位",Object.assign(A.style,{padding:"24px 12px",textAlign:"center",color:"#94a3b8"}),this.pointsList.appendChild(A);return}this.points.forEach((A,t)=>{const e=document.createElement("div");Object.assign(e.style,{display:"grid",gridTemplateColumns:"64px repeat(3, minmax(0, 1fr)) 28px",gap:"4px",alignItems:"center",height:"40px",boxSizing:"border-box",padding:"5px 8px",cursor:"pointer",background:A.id===this.selectedPointId?"#fef3c7":"#ffffff",borderBottom:"1px solid #eef2f7"}),e.addEventListener("click",()=>this.selectPoint(A.id));const i=document.createElement("span");i.textContent=this.getRoleLabel(t),i.title=i.textContent,Object.assign(i.style,{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:"#334155"}),e.appendChild(i),["x","y","z"].forEach(o=>{const g=document.createElement("input");g.type="number",g.step="0.001",g.value=A.position[o].toFixed(3),g.title=o.toUpperCase(),Object.assign(g.style,{width:"100%",minWidth:"0",height:"25px",padding:"0 4px",boxSizing:"border-box",color:"#1f2937",background:"#ffffff",border:"1px solid #cbd5e1",borderRadius:"3px",fontSize:"11px"}),g.addEventListener("click",a=>a.stopPropagation()),g.addEventListener("change",()=>this.updatePointCoordinate(A.id,o,Number(g.value))),e.appendChild(g)});const n=this.createIconButton("×",`删除${this.getRoleLabel(t)}`,()=>this.removePoint(A.id));n.style.width="28px",n.style.height="25px",n.addEventListener("click",o=>o.stopPropagation()),e.appendChild(n),this.pointsList?.appendChild(e)})}}setButtonDisabled(A,t){A&&(A.disabled=t,A.style.opacity=t?"0.4":"1",A.style.cursor=t?"not-allowed":"pointer",A.dataset.primary==="true"&&(A.style.background=t?"#f1f5f9":"#16a34a",A.style.color=t?"#94a3b8":"#ffffff",A.style.borderColor=t?"#d1d5db":"#15803d"))}setStatus(A){this.statusElement&&(this.statusElement.textContent=A)}handleKeyDown(A){if(!(!this.active||this.isTextInputTarget(A))){if((A.ctrlKey||A.metaKey)&&!A.shiftKey&&!A.altKey&&A.key.toLowerCase()==="z"){if(this.history.length===0)return;A.preventDefault(),A.stopImmediatePropagation(),this.undo();return}A.key==="Escape"&&this.handelKeyEscDown()}}isTextInputTarget(A){const t=A.target;return!!(t?.isContentEditable||["INPUT","TEXTAREA","SELECT"].includes(t?.tagName??""))}emitChange(){this.options.onChange?.(this.getPathData()),this.requestRender()}requestRender(){this.engine.requestComposerRender?.()}toPlainVector(A){return{x:A.x,y:A.y,z:A.z}}}class L8{engine;continusIds=new Map;constructor(A){this.engine=A}buildContinueIds(A){const e=this.engine?.engineStatus?.models?.find(n=>n.url===A)?.properties?.models;if(e==null||typeof e!="object"){this.continusIds.set(A,new Set);return}const i=new Set;Object.keys(e).forEach(n=>{const o=Number(n);Number.isFinite(o)&&this.shouldFilterId(A,n,e[n])&&i.add(o)}),this.continusIds.set(A,i)}setContinueIds(A,t){const e=new Set;t.forEach(i=>{const n=Number(i);Number.isFinite(n)&&e.add(n)}),this.continusIds.set(A,e)}getContinueIds(A){return Array.from(this.continusIds.get(A)??[])}getContinueIdSet(A){return this.continusIds.get(A)??new Set}hasContinueId(A,t){const e=Number(t);return Number.isFinite(e)?this.getContinueIdSet(A).has(e):!1}clear(A){if(typeof A=="string"){this.continusIds.delete(A);return}this.continusIds.clear()}shouldFilterId(A,t,e){const n=this.engine?.engineStatus?.models?.find(I=>I.url===A)?.properties,o=Array.isArray(e)?e:n?.models?.[t];if(n==null||!Array.isArray(o)||o.length===0)return!1;const g=n.categorys??{},a=n.names??{},r=n.values??{};return o.some(I=>{if(!Array.isArray(I)||I.length<3)return!1;const l=String(g[I[0]]??""),h=String(a[I[1]]??""),B=String(r[I[2]]??"");return l.includes("图层信息")&&h.includes("父类别")&&(B.includes("注释")||B.includes("视口范围")||B.includes("剖面"))})}}const UB={version:"3.12.29"}.version;function Jy(){const s=globalThis.crypto?.subtle;if(!s)throw new Error("[BimEngine] Web Crypto API is required for secure sdkAuth credentials mode");return s}function XB(s){return new TextEncoder().encode(s)}function JB(s){return s.buffer.slice(s.byteOffset,s.byteOffset+s.byteLength)}function FW(s){let A="";return s.forEach(t=>{A+=String.fromCharCode(t)}),btoa(A)}function z8(s){const A=s.getUTCFullYear(),t=String(s.getUTCMonth()+1).padStart(2,"0"),e=String(s.getUTCDate()).padStart(2,"0");return`${A}${t}${e}`}async function v8(s){const A=await Jy().digest("SHA-256",JB(XB(s)));return Array.from(new Uint8Array(A)).map(t=>t.toString(16).padStart(2,"0")).join("")}async function _8(s,A){const t=Jy(),e=await t.importKey("raw",JB(s),{name:"HMAC",hash:"SHA-256"},!1,["sign"]);return t.sign("HMAC",e,JB(XB(A)))}function q8(s){return XB([s.appId,s.engineType,s.requestDate,String(s.timestamp),s.nonce].join("|"))}async function $8(s){const A=Jy(),t=new Date,e=t.getTime(),i=z8(t),n=globalThis.crypto.randomUUID(),o=globalThis.crypto.getRandomValues(new Uint8Array(12)),g=await v8(s.appSecret),a=await _8(XB(g),i),r=await A.importKey("raw",a,"AES-GCM",!1,["encrypt"]),I=JSON.stringify({appKey:s.appKey,appSecret:s.appSecret}),l=await A.encrypt({name:"AES-GCM",iv:o,additionalData:JB(q8({appId:s.appId,engineType:s.engineType,requestDate:i,timestamp:e,nonce:n})),tagLength:128},r,JB(XB(I)));return{appId:s.appId,engineType:s.engineType,requestDate:i,timestamp:e,nonce:n,iv:FW(o),cipherText:FW(new Uint8Array(l)),sdkVersion:s.sdkVersion,origin:s.origin,product:s.product}}const xy=new Map;function cQ(s){return s.replace(/\/+$/,"")}function QQ(s){if(s)return s;if(typeof window<"u"&&typeof window.location?.origin=="string")return window.location.origin}function A3(s,A){return JSON.stringify({endpoint:cQ(s.endpoint),token:s.token??"",appId:s.appId??"",appKey:s.appKey??"",appSecret:s.appSecret??"",origin:QQ(s.origin)??"",product:s.product??"",engineType:A,sdkVersion:UB})}async function ky(s,A,t){const e=typeof AbortController<"u"?new AbortController:void 0,i=e?setTimeout(()=>e.abort(),t):void 0;try{const n=await fetch(s,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(A),signal:e?.signal}),o=await n.json().catch(()=>({}));if(!n.ok){const g=o?.error?.message??o?.message??`SDK authentication failed with status ${n.status}`;throw new Error(g)}return o}finally{i!=null&&clearTimeout(i)}}async function t3(s,A){const t=await ky(`${cQ(s.endpoint)}/oauth/sdk-verify`,{sdkToken:s.token,engineType:A,sdkVersion:UB,origin:QQ(s.origin),product:s.product},s.timeoutMs??8e3);return t.sdkToken=s.token,t}async function e3(s,A){const t=await $8({appId:s.appId,appKey:s.appKey,appSecret:s.appSecret,engineType:A,sdkVersion:UB,origin:QQ(s.origin),product:s.product}),e=await ky(`${cQ(s.endpoint)}/oauth/sdk-token/secure`,t,s.timeoutMs??8e3),i=await ky(`${cQ(s.endpoint)}/oauth/sdk-verify`,{sdkToken:e.sdkToken,engineType:A,sdkVersion:UB,origin:QQ(s.origin),product:s.product},s.timeoutMs??8e3);return i.sdkToken=e.sdkToken,i}async function i3(s,A){const t=s?.sdkAuth;if(!t)return null;if(!t.endpoint)throw new Error("[BimEngine] sdkAuth.endpoint is required");if(!t.token&&!(t.appId&&t.appKey&&t.appSecret))return null;const e=A3(t,A),i=xy.get(e);if(i){const o=await i;return s&&(s.__sdkAuthSession=o),o}const n=(t.token?t3(t,A):e3(t,A)).then(o=>{if(o.authorized!==!0)throw new Error("[BimEngine] SDK authorization rejected");return s&&(s.__sdkAuthSession=o),o}).catch(o=>{throw xy.delete(e),o});return xy.set(e,n),n}var Vy,bW;function Pt(){return bW||(bW=1,Vy={options:{usePureJavaScript:!1}}),Vy}var Hy={exports:{}},Oy,WW;function s3(){if(WW)return Oy;WW=1;var s={};Oy=s;var A={};s.encode=function(e,i,n){if(typeof i!="string")throw new TypeError('"alphabet" must be a string.');if(n!==void 0&&typeof n!="number")throw new TypeError('"maxline" must be a number.');var o="";if(!(e instanceof Uint8Array))o=t(e,i);else{var g=0,a=i.length,r=i.charAt(0),I=[0];for(g=0;g<e.length;++g){for(var l=0,h=e[g];l<I.length;++l)h+=I[l]<<8,I[l]=h%a,h=h/a|0;for(;h>0;)I.push(h%a),h=h/a|0}for(g=0;e[g]===0&&g<e.length-1;++g)o+=r;for(g=I.length-1;g>=0;--g)o+=i[I[g]]}if(n){var B=new RegExp(".{1,"+n+"}","g");o=o.match(B).join(`\r
|
|
6601
6601
|
`)}return o},s.decode=function(e,i){if(typeof e!="string")throw new TypeError('"input" must be a string.');if(typeof i!="string")throw new TypeError('"alphabet" must be a string.');var n=A[i];if(!n){n=A[i]=[];for(var o=0;o<i.length;++o)n[i.charCodeAt(o)]=o}e=e.replace(/\s/g,"");for(var g=i.length,a=i.charAt(0),r=[0],o=0;o<e.length;o++){var I=n[e.charCodeAt(o)];if(I===void 0)return;for(var l=0,h=I;l<r.length;++l)h+=r[l]*g,r[l]=h&255,h>>=8;for(;h>0;)r.push(h&255),h>>=8}for(var B=0;e[B]===a&&B<e.length-1;++B)r.push(0);return typeof Buffer<"u"?Buffer.from(r.reverse()):new Uint8Array(r.reverse())};function t(e,i){var n=0,o=i.length,g=i.charAt(0),a=[0];for(n=0;n<e.length();++n){for(var r=0,I=e.at(n);r<a.length;++r)I+=a[r]<<8,a[r]=I%o,I=I/o|0;for(;I>0;)a.push(I%o),I=I/o|0}var l="";for(n=0;e.at(n)===0&&n<e.length()-1;++n)l+=g;for(n=a.length-1;n>=0;--n)l+=i[a[n]];return l}return Oy}var GW;function Ut(){if(GW)return Hy.exports;GW=1;var s=Pt(),A=s3(),t=Hy.exports=s.util=s.util||{};(function(){if(typeof process<"u"&&process.nextTick&&!process.browser){t.nextTick=process.nextTick,typeof setImmediate=="function"?t.setImmediate=setImmediate:t.setImmediate=t.nextTick;return}if(typeof setImmediate=="function"){t.setImmediate=function(){return setImmediate.apply(void 0,arguments)},t.nextTick=function(p){return setImmediate(p)};return}if(t.setImmediate=function(p){setTimeout(p,0)},typeof window<"u"&&typeof window.postMessage=="function"){let p=function(f){if(f.source===window&&f.data===C){f.stopPropagation();var u=d.slice();d.length=0,u.forEach(function(Y){Y()})}};var C="forge.setImmediate",d=[];t.setImmediate=function(f){d.push(f),d.length===1&&window.postMessage(C,"*")},window.addEventListener("message",p,!0)}if(typeof MutationObserver<"u"){var M=Date.now(),y=!0,w=document.createElement("div"),d=[];new MutationObserver(function(){var f=d.slice();d.length=0,f.forEach(function(u){u()})}).observe(w,{attributes:!0});var D=t.setImmediate;t.setImmediate=function(f){Date.now()-M>15?(M=Date.now(),D(f)):(d.push(f),d.length===1&&w.setAttribute("a",y=!y))}}t.nextTick=t.setImmediate})(),t.isNodejs=typeof process<"u"&&process.versions&&process.versions.node,t.globalScope=(function(){return t.isNodejs?ul:typeof self>"u"?window:self})(),t.isArray=Array.isArray||function(C){return Object.prototype.toString.call(C)==="[object Array]"},t.isArrayBuffer=function(C){return typeof ArrayBuffer<"u"&&C instanceof ArrayBuffer},t.isArrayBufferView=function(C){return C&&t.isArrayBuffer(C.buffer)&&C.byteLength!==void 0};function e(C){if(!(C===8||C===16||C===24||C===32))throw new Error("Only 8, 16, 24, or 32 bits supported: "+C)}t.ByteBuffer=i;function i(C){if(this.data="",this.read=0,typeof C=="string")this.data=C;else if(t.isArrayBuffer(C)||t.isArrayBufferView(C))if(typeof Buffer<"u"&&C instanceof Buffer)this.data=C.toString("binary");else{var d=new Uint8Array(C);try{this.data=String.fromCharCode.apply(null,d)}catch{for(var M=0;M<d.length;++M)this.putByte(d[M])}}else(C instanceof i||typeof C=="object"&&typeof C.data=="string"&&typeof C.read=="number")&&(this.data=C.data,this.read=C.read);this._constructedStringLength=0}t.ByteStringBuffer=i;var n=4096;t.ByteStringBuffer.prototype._optimizeConstructedString=function(C){this._constructedStringLength+=C,this._constructedStringLength>n&&(this.data.substr(0,1),this._constructedStringLength=0)},t.ByteStringBuffer.prototype.length=function(){return this.data.length-this.read},t.ByteStringBuffer.prototype.isEmpty=function(){return this.length()<=0},t.ByteStringBuffer.prototype.putByte=function(C){return this.putBytes(String.fromCharCode(C))},t.ByteStringBuffer.prototype.fillWithByte=function(C,d){C=String.fromCharCode(C);for(var M=this.data;d>0;)d&1&&(M+=C),d>>>=1,d>0&&(C+=C);return this.data=M,this._optimizeConstructedString(d),this},t.ByteStringBuffer.prototype.putBytes=function(C){return this.data+=C,this._optimizeConstructedString(C.length),this},t.ByteStringBuffer.prototype.putString=function(C){return this.putBytes(t.encodeUtf8(C))},t.ByteStringBuffer.prototype.putInt16=function(C){return this.putBytes(String.fromCharCode(C>>8&255)+String.fromCharCode(C&255))},t.ByteStringBuffer.prototype.putInt24=function(C){return this.putBytes(String.fromCharCode(C>>16&255)+String.fromCharCode(C>>8&255)+String.fromCharCode(C&255))},t.ByteStringBuffer.prototype.putInt32=function(C){return this.putBytes(String.fromCharCode(C>>24&255)+String.fromCharCode(C>>16&255)+String.fromCharCode(C>>8&255)+String.fromCharCode(C&255))},t.ByteStringBuffer.prototype.putInt16Le=function(C){return this.putBytes(String.fromCharCode(C&255)+String.fromCharCode(C>>8&255))},t.ByteStringBuffer.prototype.putInt24Le=function(C){return this.putBytes(String.fromCharCode(C&255)+String.fromCharCode(C>>8&255)+String.fromCharCode(C>>16&255))},t.ByteStringBuffer.prototype.putInt32Le=function(C){return this.putBytes(String.fromCharCode(C&255)+String.fromCharCode(C>>8&255)+String.fromCharCode(C>>16&255)+String.fromCharCode(C>>24&255))},t.ByteStringBuffer.prototype.putInt=function(C,d){e(d);var M="";do d-=8,M+=String.fromCharCode(C>>d&255);while(d>0);return this.putBytes(M)},t.ByteStringBuffer.prototype.putSignedInt=function(C,d){return C<0&&(C+=2<<d-1),this.putInt(C,d)},t.ByteStringBuffer.prototype.putBuffer=function(C){return this.putBytes(C.getBytes())},t.ByteStringBuffer.prototype.getByte=function(){return this.data.charCodeAt(this.read++)},t.ByteStringBuffer.prototype.getInt16=function(){var C=this.data.charCodeAt(this.read)<<8^this.data.charCodeAt(this.read+1);return this.read+=2,C},t.ByteStringBuffer.prototype.getInt24=function(){var C=this.data.charCodeAt(this.read)<<16^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2);return this.read+=3,C},t.ByteStringBuffer.prototype.getInt32=function(){var C=this.data.charCodeAt(this.read)<<24^this.data.charCodeAt(this.read+1)<<16^this.data.charCodeAt(this.read+2)<<8^this.data.charCodeAt(this.read+3);return this.read+=4,C},t.ByteStringBuffer.prototype.getInt16Le=function(){var C=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8;return this.read+=2,C},t.ByteStringBuffer.prototype.getInt24Le=function(){var C=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2)<<16;return this.read+=3,C},t.ByteStringBuffer.prototype.getInt32Le=function(){var C=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2)<<16^this.data.charCodeAt(this.read+3)<<24;return this.read+=4,C},t.ByteStringBuffer.prototype.getInt=function(C){e(C);var d=0;do d=(d<<8)+this.data.charCodeAt(this.read++),C-=8;while(C>0);return d},t.ByteStringBuffer.prototype.getSignedInt=function(C){var d=this.getInt(C),M=2<<C-2;return d>=M&&(d-=M<<1),d},t.ByteStringBuffer.prototype.getBytes=function(C){var d;return C?(C=Math.min(this.length(),C),d=this.data.slice(this.read,this.read+C),this.read+=C):C===0?d="":(d=this.read===0?this.data:this.data.slice(this.read),this.clear()),d},t.ByteStringBuffer.prototype.bytes=function(C){return typeof C>"u"?this.data.slice(this.read):this.data.slice(this.read,this.read+C)},t.ByteStringBuffer.prototype.at=function(C){return this.data.charCodeAt(this.read+C)},t.ByteStringBuffer.prototype.setAt=function(C,d){return this.data=this.data.substr(0,this.read+C)+String.fromCharCode(d)+this.data.substr(this.read+C+1),this},t.ByteStringBuffer.prototype.last=function(){return this.data.charCodeAt(this.data.length-1)},t.ByteStringBuffer.prototype.copy=function(){var C=t.createBuffer(this.data);return C.read=this.read,C},t.ByteStringBuffer.prototype.compact=function(){return this.read>0&&(this.data=this.data.slice(this.read),this.read=0),this},t.ByteStringBuffer.prototype.clear=function(){return this.data="",this.read=0,this},t.ByteStringBuffer.prototype.truncate=function(C){var d=Math.max(0,this.length()-C);return this.data=this.data.substr(this.read,d),this.read=0,this},t.ByteStringBuffer.prototype.toHex=function(){for(var C="",d=this.read;d<this.data.length;++d){var M=this.data.charCodeAt(d);M<16&&(C+="0"),C+=M.toString(16)}return C},t.ByteStringBuffer.prototype.toString=function(){return t.decodeUtf8(this.bytes())};function o(C,d){d=d||{},this.read=d.readOffset||0,this.growSize=d.growSize||1024;var M=t.isArrayBuffer(C),y=t.isArrayBufferView(C);if(M||y){M?this.data=new DataView(C):this.data=new DataView(C.buffer,C.byteOffset,C.byteLength),this.write="writeOffset"in d?d.writeOffset:this.data.byteLength;return}this.data=new DataView(new ArrayBuffer(0)),this.write=0,C!=null&&this.putBytes(C),"writeOffset"in d&&(this.write=d.writeOffset)}t.DataBuffer=o,t.DataBuffer.prototype.length=function(){return this.write-this.read},t.DataBuffer.prototype.isEmpty=function(){return this.length()<=0},t.DataBuffer.prototype.accommodate=function(C,d){if(this.length()>=C)return this;d=Math.max(d||this.growSize,C);var M=new Uint8Array(this.data.buffer,this.data.byteOffset,this.data.byteLength),y=new Uint8Array(this.length()+d);return y.set(M),this.data=new DataView(y.buffer),this},t.DataBuffer.prototype.putByte=function(C){return this.accommodate(1),this.data.setUint8(this.write++,C),this},t.DataBuffer.prototype.fillWithByte=function(C,d){this.accommodate(d);for(var M=0;M<d;++M)this.data.setUint8(C);return this},t.DataBuffer.prototype.putBytes=function(C,d){if(t.isArrayBufferView(C)){var M=new Uint8Array(C.buffer,C.byteOffset,C.byteLength),y=M.byteLength-M.byteOffset;this.accommodate(y);var w=new Uint8Array(this.data.buffer,this.write);return w.set(M),this.write+=y,this}if(t.isArrayBuffer(C)){var M=new Uint8Array(C);this.accommodate(M.byteLength);var w=new Uint8Array(this.data.buffer);return w.set(M,this.write),this.write+=M.byteLength,this}if(C instanceof t.DataBuffer||typeof C=="object"&&typeof C.read=="number"&&typeof C.write=="number"&&t.isArrayBufferView(C.data)){var M=new Uint8Array(C.data.byteLength,C.read,C.length());this.accommodate(M.byteLength);var w=new Uint8Array(C.data.byteLength,this.write);return w.set(M),this.write+=M.byteLength,this}if(C instanceof t.ByteStringBuffer&&(C=C.data,d="binary"),d=d||"binary",typeof C=="string"){var D;if(d==="hex")return this.accommodate(Math.ceil(C.length/2)),D=new Uint8Array(this.data.buffer,this.write),this.write+=t.binary.hex.decode(C,D,this.write),this;if(d==="base64")return this.accommodate(Math.ceil(C.length/4)*3),D=new Uint8Array(this.data.buffer,this.write),this.write+=t.binary.base64.decode(C,D,this.write),this;if(d==="utf8"&&(C=t.encodeUtf8(C),d="binary"),d==="binary"||d==="raw")return this.accommodate(C.length),D=new Uint8Array(this.data.buffer,this.write),this.write+=t.binary.raw.decode(D),this;if(d==="utf16")return this.accommodate(C.length*2),D=new Uint16Array(this.data.buffer,this.write),this.write+=t.text.utf16.encode(D),this;throw new Error("Invalid encoding: "+d)}throw Error("Invalid parameter: "+C)},t.DataBuffer.prototype.putBuffer=function(C){return this.putBytes(C),C.clear(),this},t.DataBuffer.prototype.putString=function(C){return this.putBytes(C,"utf16")},t.DataBuffer.prototype.putInt16=function(C){return this.accommodate(2),this.data.setInt16(this.write,C),this.write+=2,this},t.DataBuffer.prototype.putInt24=function(C){return this.accommodate(3),this.data.setInt16(this.write,C>>8&65535),this.data.setInt8(this.write,C>>16&255),this.write+=3,this},t.DataBuffer.prototype.putInt32=function(C){return this.accommodate(4),this.data.setInt32(this.write,C),this.write+=4,this},t.DataBuffer.prototype.putInt16Le=function(C){return this.accommodate(2),this.data.setInt16(this.write,C,!0),this.write+=2,this},t.DataBuffer.prototype.putInt24Le=function(C){return this.accommodate(3),this.data.setInt8(this.write,C>>16&255),this.data.setInt16(this.write,C>>8&65535,!0),this.write+=3,this},t.DataBuffer.prototype.putInt32Le=function(C){return this.accommodate(4),this.data.setInt32(this.write,C,!0),this.write+=4,this},t.DataBuffer.prototype.putInt=function(C,d){e(d),this.accommodate(d/8);do d-=8,this.data.setInt8(this.write++,C>>d&255);while(d>0);return this},t.DataBuffer.prototype.putSignedInt=function(C,d){return e(d),this.accommodate(d/8),C<0&&(C+=2<<d-1),this.putInt(C,d)},t.DataBuffer.prototype.getByte=function(){return this.data.getInt8(this.read++)},t.DataBuffer.prototype.getInt16=function(){var C=this.data.getInt16(this.read);return this.read+=2,C},t.DataBuffer.prototype.getInt24=function(){var C=this.data.getInt16(this.read)<<8^this.data.getInt8(this.read+2);return this.read+=3,C},t.DataBuffer.prototype.getInt32=function(){var C=this.data.getInt32(this.read);return this.read+=4,C},t.DataBuffer.prototype.getInt16Le=function(){var C=this.data.getInt16(this.read,!0);return this.read+=2,C},t.DataBuffer.prototype.getInt24Le=function(){var C=this.data.getInt8(this.read)^this.data.getInt16(this.read+1,!0)<<8;return this.read+=3,C},t.DataBuffer.prototype.getInt32Le=function(){var C=this.data.getInt32(this.read,!0);return this.read+=4,C},t.DataBuffer.prototype.getInt=function(C){e(C);var d=0;do d=(d<<8)+this.data.getInt8(this.read++),C-=8;while(C>0);return d},t.DataBuffer.prototype.getSignedInt=function(C){var d=this.getInt(C),M=2<<C-2;return d>=M&&(d-=M<<1),d},t.DataBuffer.prototype.getBytes=function(C){var d;return C?(C=Math.min(this.length(),C),d=this.data.slice(this.read,this.read+C),this.read+=C):C===0?d="":(d=this.read===0?this.data:this.data.slice(this.read),this.clear()),d},t.DataBuffer.prototype.bytes=function(C){return typeof C>"u"?this.data.slice(this.read):this.data.slice(this.read,this.read+C)},t.DataBuffer.prototype.at=function(C){return this.data.getUint8(this.read+C)},t.DataBuffer.prototype.setAt=function(C,d){return this.data.setUint8(C,d),this},t.DataBuffer.prototype.last=function(){return this.data.getUint8(this.write-1)},t.DataBuffer.prototype.copy=function(){return new t.DataBuffer(this)},t.DataBuffer.prototype.compact=function(){if(this.read>0){var C=new Uint8Array(this.data.buffer,this.read),d=new Uint8Array(C.byteLength);d.set(C),this.data=new DataView(d),this.write-=this.read,this.read=0}return this},t.DataBuffer.prototype.clear=function(){return this.data=new DataView(new ArrayBuffer(0)),this.read=this.write=0,this},t.DataBuffer.prototype.truncate=function(C){return this.write=Math.max(0,this.length()-C),this.read=Math.min(this.read,this.write),this},t.DataBuffer.prototype.toHex=function(){for(var C="",d=this.read;d<this.data.byteLength;++d){var M=this.data.getUint8(d);M<16&&(C+="0"),C+=M.toString(16)}return C},t.DataBuffer.prototype.toString=function(C){var d=new Uint8Array(this.data,this.read,this.length());if(C=C||"utf8",C==="binary"||C==="raw")return t.binary.raw.encode(d);if(C==="hex")return t.binary.hex.encode(d);if(C==="base64")return t.binary.base64.encode(d);if(C==="utf8")return t.text.utf8.decode(d);if(C==="utf16")return t.text.utf16.decode(d);throw new Error("Invalid encoding: "+C)},t.createBuffer=function(C,d){return d=d||"raw",C!==void 0&&d==="utf8"&&(C=t.encodeUtf8(C)),new t.ByteBuffer(C)},t.fillString=function(C,d){for(var M="";d>0;)d&1&&(M+=C),d>>>=1,d>0&&(C+=C);return M},t.xorBytes=function(C,d,M){for(var y="",w="",D="",p=0,f=0;M>0;--M,++p)w=C.charCodeAt(p)^d.charCodeAt(p),f>=10&&(y+=D,D="",f=0),D+=String.fromCharCode(w),++f;return y+=D,y},t.hexToBytes=function(C){var d="",M=0;for(C.length&!0&&(M=1,d+=String.fromCharCode(parseInt(C[0],16)));M<C.length;M+=2)d+=String.fromCharCode(parseInt(C.substr(M,2),16));return d},t.bytesToHex=function(C){return t.createBuffer(C).toHex()},t.int32ToBytes=function(C){return String.fromCharCode(C>>24&255)+String.fromCharCode(C>>16&255)+String.fromCharCode(C>>8&255)+String.fromCharCode(C&255)};var g="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",a=[62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,64,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51],r="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";t.encode64=function(C,d){for(var M="",y="",w,D,p,f=0;f<C.length;)w=C.charCodeAt(f++),D=C.charCodeAt(f++),p=C.charCodeAt(f++),M+=g.charAt(w>>2),M+=g.charAt((w&3)<<4|D>>4),isNaN(D)?M+="==":(M+=g.charAt((D&15)<<2|p>>6),M+=isNaN(p)?"=":g.charAt(p&63)),d&&M.length>d&&(y+=M.substr(0,d)+`\r
|
|
6602
6602
|
`,M=M.substr(d));return y+=M,y},t.decode64=function(C){C=C.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var d="",M,y,w,D,p=0;p<C.length;)M=a[C.charCodeAt(p++)-43],y=a[C.charCodeAt(p++)-43],w=a[C.charCodeAt(p++)-43],D=a[C.charCodeAt(p++)-43],d+=String.fromCharCode(M<<2|y>>4),w!==64&&(d+=String.fromCharCode((y&15)<<4|w>>2),D!==64&&(d+=String.fromCharCode((w&3)<<6|D)));return d},t.encodeUtf8=function(C){return unescape(encodeURIComponent(C))},t.decodeUtf8=function(C){return decodeURIComponent(escape(C))},t.binary={raw:{},hex:{},base64:{},base58:{},baseN:{encode:A.encode,decode:A.decode}},t.binary.raw.encode=function(C){return String.fromCharCode.apply(null,C)},t.binary.raw.decode=function(C,d,M){var y=d;y||(y=new Uint8Array(C.length)),M=M||0;for(var w=M,D=0;D<C.length;++D)y[w++]=C.charCodeAt(D);return d?w-M:y},t.binary.hex.encode=t.bytesToHex,t.binary.hex.decode=function(C,d,M){var y=d;y||(y=new Uint8Array(Math.ceil(C.length/2))),M=M||0;var w=0,D=M;for(C.length&1&&(w=1,y[D++]=parseInt(C[0],16));w<C.length;w+=2)y[D++]=parseInt(C.substr(w,2),16);return d?D-M:y},t.binary.base64.encode=function(C,d){for(var M="",y="",w,D,p,f=0;f<C.byteLength;)w=C[f++],D=C[f++],p=C[f++],M+=g.charAt(w>>2),M+=g.charAt((w&3)<<4|D>>4),isNaN(D)?M+="==":(M+=g.charAt((D&15)<<2|p>>6),M+=isNaN(p)?"=":g.charAt(p&63)),d&&M.length>d&&(y+=M.substr(0,d)+`\r
|
|
6603
6603
|
`,M=M.substr(d));return y+=M,y},t.binary.base64.decode=function(C,d,M){var y=d;y||(y=new Uint8Array(Math.ceil(C.length/4)*3)),C=C.replace(/[^A-Za-z0-9\+\/\=]/g,""),M=M||0;for(var w,D,p,f,u=0,Y=M;u<C.length;)w=a[C.charCodeAt(u++)-43],D=a[C.charCodeAt(u++)-43],p=a[C.charCodeAt(u++)-43],f=a[C.charCodeAt(u++)-43],y[Y++]=w<<2|D>>4,p!==64&&(y[Y++]=(D&15)<<4|p>>2,f!==64&&(y[Y++]=(p&3)<<6|f));return d?Y-M:y.subarray(0,Y)},t.binary.base58.encode=function(C,d){return t.binary.baseN.encode(C,r,d)},t.binary.base58.decode=function(C,d){return t.binary.baseN.decode(C,r,d)},t.text={utf8:{},utf16:{}},t.text.utf8.encode=function(C,d,M){C=t.encodeUtf8(C);var y=d;y||(y=new Uint8Array(C.length)),M=M||0;for(var w=M,D=0;D<C.length;++D)y[w++]=C.charCodeAt(D);return d?w-M:y},t.text.utf8.decode=function(C){return t.decodeUtf8(String.fromCharCode.apply(null,C))},t.text.utf16.encode=function(C,d,M){var y=d;y||(y=new Uint8Array(C.length*2));var w=new Uint16Array(y.buffer);M=M||0;for(var D=M,p=M,f=0;f<C.length;++f)w[p++]=C.charCodeAt(f),D+=2;return d?D-M:y},t.text.utf16.decode=function(C){return String.fromCharCode.apply(null,new Uint16Array(C.buffer))},t.deflate=function(C,d,M){if(d=t.decode64(C.deflate(t.encode64(d)).rval),M){var y=2,w=d.charCodeAt(1);w&32&&(y=6),d=d.substring(y,d.length-4)}return d},t.inflate=function(C,d,M){var y=C.inflate(t.encode64(d)).rval;return y===null?null:t.decode64(y)};var I=function(C,d,M){if(!C)throw new Error("WebStorage not available.");var y;if(M===null?y=C.removeItem(d):(M=t.encode64(JSON.stringify(M)),y=C.setItem(d,M)),typeof y<"u"&&y.rval!==!0){var w=new Error(y.error.message);throw w.id=y.error.id,w.name=y.error.name,w}},l=function(C,d){if(!C)throw new Error("WebStorage not available.");var M=C.getItem(d);if(C.init)if(M.rval===null){if(M.error){var y=new Error(M.error.message);throw y.id=M.error.id,y.name=M.error.name,y}M=null}else M=M.rval;return M!==null&&(M=JSON.parse(t.decode64(M))),M},h=function(C,d,M,y){var w=l(C,d);w===null&&(w={}),w[M]=y,I(C,d,w)},B=function(C,d,M){var y=l(C,d);return y!==null&&(y=M in y?y[M]:null),y},E=function(C,d,M){var y=l(C,d);if(y!==null&&M in y){delete y[M];var w=!0;for(var D in y){w=!1;break}w&&(y=null),I(C,d,y)}},c=function(C,d){I(C,d,null)},Q=function(C,d,M){var y=null;typeof M>"u"&&(M=["web","flash"]);var w,D=!1,p=null;for(var f in M){w=M[f];try{if(w==="flash"||w==="both"){if(d[0]===null)throw new Error("Flash local storage not available.");y=C.apply(this,d),D=w==="flash"}(w==="web"||w==="both")&&(d[0]=localStorage,y=C.apply(this,d),D=!0)}catch(u){p=u}if(D)break}if(!D)throw p;return y};return t.setItem=function(C,d,M,y,w){Q(h,arguments,w)},t.getItem=function(C,d,M,y){return Q(B,arguments,y)},t.removeItem=function(C,d,M,y){Q(E,arguments,y)},t.clearItems=function(C,d,M){Q(c,arguments,M)},t.isEmpty=function(C){for(var d in C)if(C.hasOwnProperty(d))return!1;return!0},t.format=function(C){for(var d=/%./g,M,y,w=0,D=[],p=0;M=d.exec(C);){y=C.substring(p,d.lastIndex-2),y.length>0&&D.push(y),p=d.lastIndex;var f=M[0][1];switch(f){case"s":case"o":w<arguments.length?D.push(arguments[w+++1]):D.push("<?>");break;case"%":D.push("%");break;default:D.push("<%"+f+"?>")}}return D.push(C.substring(p)),D.join("")},t.formatNumber=function(C,d,M,y){var w=C,D=isNaN(d=Math.abs(d))?2:d,p=M===void 0?",":M,f=y===void 0?".":y,u=w<0?"-":"",Y=parseInt(w=Math.abs(+w||0).toFixed(D),10)+"",b=Y.length>3?Y.length%3:0;return u+(b?Y.substr(0,b)+f:"")+Y.substr(b).replace(/(\d{3})(?=\d)/g,"$1"+f)+(D?p+Math.abs(w-Y).toFixed(D).slice(2):"")},t.formatSize=function(C){return C>=1073741824?C=t.formatNumber(C/1073741824,2,".","")+" GiB":C>=1048576?C=t.formatNumber(C/1048576,2,".","")+" MiB":C>=1024?C=t.formatNumber(C/1024,0)+" KiB":C=t.formatNumber(C,0)+" bytes",C},t.bytesFromIP=function(C){return C.indexOf(".")!==-1?t.bytesFromIPv4(C):C.indexOf(":")!==-1?t.bytesFromIPv6(C):null},t.bytesFromIPv4=function(C){if(C=C.split("."),C.length!==4)return null;for(var d=t.createBuffer(),M=0;M<C.length;++M){var y=parseInt(C[M],10);if(isNaN(y))return null;d.putByte(y)}return d.getBytes()},t.bytesFromIPv6=function(C){var d=0;C=C.split(":").filter(function(p){return p.length===0&&++d,!0});for(var M=(8-C.length+d)*2,y=t.createBuffer(),w=0;w<8;++w){if(!C[w]||C[w].length===0){y.fillWithByte(0,M),M=0;continue}var D=t.hexToBytes(C[w]);D.length<2&&y.putByte(0),y.putBytes(D)}return y.getBytes()},t.bytesToIP=function(C){return C.length===4?t.bytesToIPv4(C):C.length===16?t.bytesToIPv6(C):null},t.bytesToIPv4=function(C){if(C.length!==4)return null;for(var d=[],M=0;M<C.length;++M)d.push(C.charCodeAt(M));return d.join(".")},t.bytesToIPv6=function(C){if(C.length!==16)return null;for(var d=[],M=[],y=0,w=0;w<C.length;w+=2){for(var D=t.bytesToHex(C[w]+C[w+1]);D[0]==="0"&&D!=="0";)D=D.substr(1);if(D==="0"){var p=M[M.length-1],f=d.length;!p||f!==p.end+1?M.push({start:f,end:f}):(p.end=f,p.end-p.start>M[y].end-M[y].start&&(y=M.length-1))}d.push(D)}if(M.length>0){var u=M[y];u.end-u.start>0&&(d.splice(u.start,u.end-u.start+1,""),u.start===0&&d.unshift(""),u.end===7&&d.push(""))}return d.join(":")},t.estimateCores=function(C,d){if(typeof C=="function"&&(d=C,C={}),C=C||{},"cores"in t&&!C.update)return d(null,t.cores);if(typeof navigator<"u"&&"hardwareConcurrency"in navigator&&navigator.hardwareConcurrency>0)return t.cores=navigator.hardwareConcurrency,d(null,t.cores);if(typeof Worker>"u")return t.cores=1,d(null,t.cores);if(typeof Blob>"u")return t.cores=2,d(null,t.cores);var M=URL.createObjectURL(new Blob(["(",(function(){self.addEventListener("message",function(p){var f=Date.now(),u=f+4;self.postMessage({st:f,et:u})})}).toString(),")()"],{type:"application/javascript"}));y([],5,16);function y(p,f,u){if(f===0){var Y=Math.floor(p.reduce(function(b,m){return b+m},0)/p.length);return t.cores=Math.max(1,Y),URL.revokeObjectURL(M),d(null,t.cores)}w(u,function(b,m){p.push(D(u,m)),y(p,f-1,u)})}function w(p,f){for(var u=[],Y=[],b=0;b<p;++b){var m=new Worker(M);m.addEventListener("message",function(T){if(Y.push(T.data),Y.length===p){for(var F=0;F<p;++F)u[F].terminate();f(null,Y)}}),u.push(m)}for(var b=0;b<p;++b)u[b].postMessage(b)}function D(p,f){for(var u=[],Y=0;Y<p;++Y)for(var b=f[Y],m=u[Y]=[],T=0;T<p;++T)if(Y!==T){var F=f[T];(b.st>F.st&&b.st<F.et||F.st>b.st&&F.st<b.et)&&m.push(T)}return u.reduce(function(j,X){return Math.max(j,X.length)},0)}},Hy.exports}var Ly,TW;function zy(){if(TW)return Ly;TW=1;var s=Pt();Ut(),Ly=s.cipher=s.cipher||{},s.cipher.algorithms=s.cipher.algorithms||{},s.cipher.createCipher=function(t,e){var i=t;if(typeof i=="string"&&(i=s.cipher.getAlgorithm(i),i&&(i=i())),!i)throw new Error("Unsupported algorithm: "+t);return new s.cipher.BlockCipher({algorithm:i,key:e,decrypt:!1})},s.cipher.createDecipher=function(t,e){var i=t;if(typeof i=="string"&&(i=s.cipher.getAlgorithm(i),i&&(i=i())),!i)throw new Error("Unsupported algorithm: "+t);return new s.cipher.BlockCipher({algorithm:i,key:e,decrypt:!0})},s.cipher.registerAlgorithm=function(t,e){t=t.toUpperCase(),s.cipher.algorithms[t]=e},s.cipher.getAlgorithm=function(t){return t=t.toUpperCase(),t in s.cipher.algorithms?s.cipher.algorithms[t]:null};var A=s.cipher.BlockCipher=function(t){this.algorithm=t.algorithm,this.mode=this.algorithm.mode,this.blockSize=this.mode.blockSize,this._finish=!1,this._input=null,this.output=null,this._op=t.decrypt?this.mode.decrypt:this.mode.encrypt,this._decrypt=t.decrypt,this.algorithm.initialize(t)};return A.prototype.start=function(t){t=t||{};var e={};for(var i in t)e[i]=t[i];e.decrypt=this._decrypt,this._finish=!1,this._input=s.util.createBuffer(),this.output=t.output||s.util.createBuffer(),this.mode.start(e)},A.prototype.update=function(t){for(t&&this._input.putBuffer(t);!this._op.call(this.mode,this._input,this.output,this._finish)&&!this._finish;);this._input.compact()},A.prototype.finish=function(t){t&&(this.mode.name==="ECB"||this.mode.name==="CBC")&&(this.mode.pad=function(i){return t(this.blockSize,i,!1)},this.mode.unpad=function(i){return t(this.blockSize,i,!0)});var e={};return e.decrypt=this._decrypt,e.overflow=this._input.length()%this.blockSize,!(!this._decrypt&&this.mode.pad&&!this.mode.pad(this._input,e)||(this._finish=!0,this.update(),this._decrypt&&this.mode.unpad&&!this.mode.unpad(this.output,e))||this.mode.afterFinish&&!this.mode.afterFinish(this.output,e))},Ly}var vy={exports:{}},KW;function jW(){if(KW)return vy.exports;KW=1;var s=Pt();Ut(),s.cipher=s.cipher||{};var A=vy.exports=s.cipher.modes=s.cipher.modes||{};A.ecb=function(n){n=n||{},this.name="ECB",this.cipher=n.cipher,this.blockSize=n.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints)},A.ecb.prototype.start=function(n){},A.ecb.prototype.encrypt=function(n,o,g){if(n.length()<this.blockSize&&!(g&&n.length()>0))return!0;for(var a=0;a<this._ints;++a)this._inBlock[a]=n.getInt32();this.cipher.encrypt(this._inBlock,this._outBlock);for(var a=0;a<this._ints;++a)o.putInt32(this._outBlock[a])},A.ecb.prototype.decrypt=function(n,o,g){if(n.length()<this.blockSize&&!(g&&n.length()>0))return!0;for(var a=0;a<this._ints;++a)this._inBlock[a]=n.getInt32();this.cipher.decrypt(this._inBlock,this._outBlock);for(var a=0;a<this._ints;++a)o.putInt32(this._outBlock[a])},A.ecb.prototype.pad=function(n,o){var g=n.length()===this.blockSize?this.blockSize:this.blockSize-n.length();return n.fillWithByte(g,g),!0},A.ecb.prototype.unpad=function(n,o){if(o.overflow>0)return!1;var g=n.length(),a=n.at(g-1);return a>this.blockSize<<2?!1:(n.truncate(a),!0)},A.cbc=function(n){n=n||{},this.name="CBC",this.cipher=n.cipher,this.blockSize=n.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints)},A.cbc.prototype.start=function(n){if(n.iv===null){if(!this._prev)throw new Error("Invalid IV parameter.");this._iv=this._prev.slice(0)}else if("iv"in n)this._iv=t(n.iv,this.blockSize),this._prev=this._iv.slice(0);else throw new Error("Invalid IV parameter.")},A.cbc.prototype.encrypt=function(n,o,g){if(n.length()<this.blockSize&&!(g&&n.length()>0))return!0;for(var a=0;a<this._ints;++a)this._inBlock[a]=this._prev[a]^n.getInt32();this.cipher.encrypt(this._inBlock,this._outBlock);for(var a=0;a<this._ints;++a)o.putInt32(this._outBlock[a]);this._prev=this._outBlock},A.cbc.prototype.decrypt=function(n,o,g){if(n.length()<this.blockSize&&!(g&&n.length()>0))return!0;for(var a=0;a<this._ints;++a)this._inBlock[a]=n.getInt32();this.cipher.decrypt(this._inBlock,this._outBlock);for(var a=0;a<this._ints;++a)o.putInt32(this._prev[a]^this._outBlock[a]);this._prev=this._inBlock.slice(0)},A.cbc.prototype.pad=function(n,o){var g=n.length()===this.blockSize?this.blockSize:this.blockSize-n.length();return n.fillWithByte(g,g),!0},A.cbc.prototype.unpad=function(n,o){if(o.overflow>0)return!1;var g=n.length(),a=n.at(g-1);return a>this.blockSize<<2?!1:(n.truncate(a),!0)},A.cfb=function(n){n=n||{},this.name="CFB",this.cipher=n.cipher,this.blockSize=n.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialBlock=new Array(this._ints),this._partialOutput=s.util.createBuffer(),this._partialBytes=0},A.cfb.prototype.start=function(n){if(!("iv"in n))throw new Error("Invalid IV parameter.");this._iv=t(n.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},A.cfb.prototype.encrypt=function(n,o,g){var a=n.length();if(a===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&a>=this.blockSize){for(var r=0;r<this._ints;++r)this._inBlock[r]=n.getInt32()^this._outBlock[r],o.putInt32(this._inBlock[r]);return}var I=(this.blockSize-a)%this.blockSize;I>0&&(I=this.blockSize-I),this._partialOutput.clear();for(var r=0;r<this._ints;++r)this._partialBlock[r]=n.getInt32()^this._outBlock[r],this._partialOutput.putInt32(this._partialBlock[r]);if(I>0)n.read-=this.blockSize;else for(var r=0;r<this._ints;++r)this._inBlock[r]=this._partialBlock[r];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),I>0&&!g)return o.putBytes(this._partialOutput.getBytes(I-this._partialBytes)),this._partialBytes=I,!0;o.putBytes(this._partialOutput.getBytes(a-this._partialBytes)),this._partialBytes=0},A.cfb.prototype.decrypt=function(n,o,g){var a=n.length();if(a===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&a>=this.blockSize){for(var r=0;r<this._ints;++r)this._inBlock[r]=n.getInt32(),o.putInt32(this._inBlock[r]^this._outBlock[r]);return}var I=(this.blockSize-a)%this.blockSize;I>0&&(I=this.blockSize-I),this._partialOutput.clear();for(var r=0;r<this._ints;++r)this._partialBlock[r]=n.getInt32(),this._partialOutput.putInt32(this._partialBlock[r]^this._outBlock[r]);if(I>0)n.read-=this.blockSize;else for(var r=0;r<this._ints;++r)this._inBlock[r]=this._partialBlock[r];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),I>0&&!g)return o.putBytes(this._partialOutput.getBytes(I-this._partialBytes)),this._partialBytes=I,!0;o.putBytes(this._partialOutput.getBytes(a-this._partialBytes)),this._partialBytes=0},A.ofb=function(n){n=n||{},this.name="OFB",this.cipher=n.cipher,this.blockSize=n.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=s.util.createBuffer(),this._partialBytes=0},A.ofb.prototype.start=function(n){if(!("iv"in n))throw new Error("Invalid IV parameter.");this._iv=t(n.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},A.ofb.prototype.encrypt=function(n,o,g){var a=n.length();if(n.length()===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&a>=this.blockSize){for(var r=0;r<this._ints;++r)o.putInt32(n.getInt32()^this._outBlock[r]),this._inBlock[r]=this._outBlock[r];return}var I=(this.blockSize-a)%this.blockSize;I>0&&(I=this.blockSize-I),this._partialOutput.clear();for(var r=0;r<this._ints;++r)this._partialOutput.putInt32(n.getInt32()^this._outBlock[r]);if(I>0)n.read-=this.blockSize;else for(var r=0;r<this._ints;++r)this._inBlock[r]=this._outBlock[r];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),I>0&&!g)return o.putBytes(this._partialOutput.getBytes(I-this._partialBytes)),this._partialBytes=I,!0;o.putBytes(this._partialOutput.getBytes(a-this._partialBytes)),this._partialBytes=0},A.ofb.prototype.decrypt=A.ofb.prototype.encrypt,A.ctr=function(n){n=n||{},this.name="CTR",this.cipher=n.cipher,this.blockSize=n.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=s.util.createBuffer(),this._partialBytes=0},A.ctr.prototype.start=function(n){if(!("iv"in n))throw new Error("Invalid IV parameter.");this._iv=t(n.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},A.ctr.prototype.encrypt=function(n,o,g){var a=n.length();if(a===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&a>=this.blockSize)for(var r=0;r<this._ints;++r)o.putInt32(n.getInt32()^this._outBlock[r]);else{var I=(this.blockSize-a)%this.blockSize;I>0&&(I=this.blockSize-I),this._partialOutput.clear();for(var r=0;r<this._ints;++r)this._partialOutput.putInt32(n.getInt32()^this._outBlock[r]);if(I>0&&(n.read-=this.blockSize),this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),I>0&&!g)return o.putBytes(this._partialOutput.getBytes(I-this._partialBytes)),this._partialBytes=I,!0;o.putBytes(this._partialOutput.getBytes(a-this._partialBytes)),this._partialBytes=0}e(this._inBlock)},A.ctr.prototype.decrypt=A.ctr.prototype.encrypt,A.gcm=function(n){n=n||{},this.name="GCM",this.cipher=n.cipher,this.blockSize=n.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints),this._partialOutput=s.util.createBuffer(),this._partialBytes=0,this._R=3774873600},A.gcm.prototype.start=function(n){if(!("iv"in n))throw new Error("Invalid IV parameter.");var o=s.util.createBuffer(n.iv);this._cipherLength=0;var g;if("additionalData"in n?g=s.util.createBuffer(n.additionalData):g=s.util.createBuffer(),"tagLength"in n?this._tagLength=n.tagLength:this._tagLength=128,this._tag=null,n.decrypt&&(this._tag=s.util.createBuffer(n.tag).getBytes(),this._tag.length!==this._tagLength/8))throw new Error("Authentication tag does not match tag length.");this._hashBlock=new Array(this._ints),this.tag=null,this._hashSubkey=new Array(this._ints),this.cipher.encrypt([0,0,0,0],this._hashSubkey),this.componentBits=4,this._m=this.generateHashTable(this._hashSubkey,this.componentBits);var a=o.length();if(a===12)this._j0=[o.getInt32(),o.getInt32(),o.getInt32(),1];else{for(this._j0=[0,0,0,0];o.length()>0;)this._j0=this.ghash(this._hashSubkey,this._j0,[o.getInt32(),o.getInt32(),o.getInt32(),o.getInt32()]);this._j0=this.ghash(this._hashSubkey,this._j0,[0,0].concat(i(a*8)))}this._inBlock=this._j0.slice(0),e(this._inBlock),this._partialBytes=0,g=s.util.createBuffer(g),this._aDataLength=i(g.length()*8);var r=g.length()%this.blockSize;for(r&&g.fillWithByte(0,this.blockSize-r),this._s=[0,0,0,0];g.length()>0;)this._s=this.ghash(this._hashSubkey,this._s,[g.getInt32(),g.getInt32(),g.getInt32(),g.getInt32()])},A.gcm.prototype.encrypt=function(n,o,g){var a=n.length();if(a===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&a>=this.blockSize){for(var r=0;r<this._ints;++r)o.putInt32(this._outBlock[r]^=n.getInt32());this._cipherLength+=this.blockSize}else{var I=(this.blockSize-a)%this.blockSize;I>0&&(I=this.blockSize-I),this._partialOutput.clear();for(var r=0;r<this._ints;++r)this._partialOutput.putInt32(n.getInt32()^this._outBlock[r]);if(I<=0||g){if(g){var l=a%this.blockSize;this._cipherLength+=l,this._partialOutput.truncate(this.blockSize-l)}else this._cipherLength+=this.blockSize;for(var r=0;r<this._ints;++r)this._outBlock[r]=this._partialOutput.getInt32();this._partialOutput.read-=this.blockSize}if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),I>0&&!g)return n.read-=this.blockSize,o.putBytes(this._partialOutput.getBytes(I-this._partialBytes)),this._partialBytes=I,!0;o.putBytes(this._partialOutput.getBytes(a-this._partialBytes)),this._partialBytes=0}this._s=this.ghash(this._hashSubkey,this._s,this._outBlock),e(this._inBlock)},A.gcm.prototype.decrypt=function(n,o,g){var a=n.length();if(a<this.blockSize&&!(g&&a>0))return!0;this.cipher.encrypt(this._inBlock,this._outBlock),e(this._inBlock),this._hashBlock[0]=n.getInt32(),this._hashBlock[1]=n.getInt32(),this._hashBlock[2]=n.getInt32(),this._hashBlock[3]=n.getInt32(),this._s=this.ghash(this._hashSubkey,this._s,this._hashBlock);for(var r=0;r<this._ints;++r)o.putInt32(this._outBlock[r]^this._hashBlock[r]);a<this.blockSize?this._cipherLength+=a%this.blockSize:this._cipherLength+=this.blockSize},A.gcm.prototype.afterFinish=function(n,o){var g=!0;o.decrypt&&o.overflow&&n.truncate(this.blockSize-o.overflow),this.tag=s.util.createBuffer();var a=this._aDataLength.concat(i(this._cipherLength*8));this._s=this.ghash(this._hashSubkey,this._s,a);var r=[];this.cipher.encrypt(this._j0,r);for(var I=0;I<this._ints;++I)this.tag.putInt32(this._s[I]^r[I]);return this.tag.truncate(this.tag.length()%(this._tagLength/8)),o.decrypt&&this.tag.bytes()!==this._tag&&(g=!1),g},A.gcm.prototype.multiply=function(n,o){for(var g=[0,0,0,0],a=o.slice(0),r=0;r<128;++r){var I=n[r/32|0]&1<<31-r%32;I&&(g[0]^=a[0],g[1]^=a[1],g[2]^=a[2],g[3]^=a[3]),this.pow(a,a)}return g},A.gcm.prototype.pow=function(n,o){for(var g=n[3]&1,a=3;a>0;--a)o[a]=n[a]>>>1|(n[a-1]&1)<<31;o[0]=n[0]>>>1,g&&(o[0]^=this._R)},A.gcm.prototype.tableMultiply=function(n){for(var o=[0,0,0,0],g=0;g<32;++g){var a=g/8|0,r=n[a]>>>(7-g%8)*4&15,I=this._m[g][r];o[0]^=I[0],o[1]^=I[1],o[2]^=I[2],o[3]^=I[3]}return o},A.gcm.prototype.ghash=function(n,o,g){return o[0]^=g[0],o[1]^=g[1],o[2]^=g[2],o[3]^=g[3],this.tableMultiply(o)},A.gcm.prototype.generateHashTable=function(n,o){for(var g=8/o,a=4*g,r=16*g,I=new Array(r),l=0;l<r;++l){var h=[0,0,0,0],B=l/a|0,E=(a-1-l%a)*o;h[B]=1<<o-1<<E,I[l]=this.generateSubHashTable(this.multiply(h,n),o)}return I},A.gcm.prototype.generateSubHashTable=function(n,o){var g=1<<o,a=g>>>1,r=new Array(g);r[a]=n.slice(0);for(var I=a>>>1;I>0;)this.pow(r[2*I],r[I]=[]),I>>=1;for(I=2;I<a;){for(var l=1;l<I;++l){var h=r[I],B=r[l];r[I+l]=[h[0]^B[0],h[1]^B[1],h[2]^B[2],h[3]^B[3]]}I*=2}for(r[0]=[0,0,0,0],I=a+1;I<g;++I){var E=r[I^a];r[I]=[n[0]^E[0],n[1]^E[1],n[2]^E[2],n[3]^E[3]]}return r};function t(n,o){if(typeof n=="string"&&(n=s.util.createBuffer(n)),s.util.isArray(n)&&n.length>4){var g=n;n=s.util.createBuffer();for(var a=0;a<g.length;++a)n.putByte(g[a])}if(n.length()<o)throw new Error("Invalid IV length; got "+n.length()+" bytes and expected "+o+" bytes.");if(!s.util.isArray(n)){for(var r=[],I=o/4,a=0;a<I;++a)r.push(n.getInt32());n=r}return n}function e(n){n[n.length-1]=n[n.length-1]+1&4294967295}function i(n){return[n/4294967296|0,n&4294967295]}return vy.exports}var _y,RW;function Qa(){if(RW)return _y;RW=1;var s=Pt();zy(),jW(),Ut(),_y=s.aes=s.aes||{},s.aes.startEncrypting=function(B,E,c,Q){var C=h({key:B,output:c,decrypt:!1,mode:Q});return C.start(E),C},s.aes.createEncryptionCipher=function(B,E){return h({key:B,output:null,decrypt:!1,mode:E})},s.aes.startDecrypting=function(B,E,c,Q){var C=h({key:B,output:c,decrypt:!0,mode:Q});return C.start(E),C},s.aes.createDecryptionCipher=function(B,E){return h({key:B,output:null,decrypt:!0,mode:E})},s.aes.Algorithm=function(B,E){t||r();var c=this;c.name=B,c.mode=new E({blockSize:16,cipher:{encrypt:function(Q,C){return l(c._w,Q,C,!1)},decrypt:function(Q,C){return l(c._w,Q,C,!0)}}}),c._init=!1},s.aes.Algorithm.prototype.initialize=function(B){if(!this._init){var E=B.key,c;if(typeof E=="string"&&(E.length===16||E.length===24||E.length===32))E=s.util.createBuffer(E);else if(s.util.isArray(E)&&(E.length===16||E.length===24||E.length===32)){c=E,E=s.util.createBuffer();for(var Q=0;Q<c.length;++Q)E.putByte(c[Q])}if(!s.util.isArray(E)){c=E,E=[];var C=c.length();if(C===16||C===24||C===32){C=C>>>2;for(var Q=0;Q<C;++Q)E.push(c.getInt32())}}if(!s.util.isArray(E)||!(E.length===4||E.length===6||E.length===8))throw new Error("Invalid key parameter.");var d=this.mode.name,M=["CFB","OFB","CTR","GCM"].indexOf(d)!==-1;this._w=I(E,B.decrypt&&!M),this._init=!0}},s.aes._expandKey=function(B,E){return t||r(),I(B,E)},s.aes._updateBlock=l,A("AES-ECB",s.cipher.modes.ecb),A("AES-CBC",s.cipher.modes.cbc),A("AES-CFB",s.cipher.modes.cfb),A("AES-OFB",s.cipher.modes.ofb),A("AES-CTR",s.cipher.modes.ctr),A("AES-GCM",s.cipher.modes.gcm);function A(B,E){var c=function(){return new s.aes.Algorithm(B,E)};s.cipher.registerAlgorithm(B,c)}var t=!1,e=4,i,n,o,g,a;function r(){t=!0,o=[0,1,2,4,8,16,32,64,128,27,54];for(var B=new Array(256),E=0;E<128;++E)B[E]=E<<1,B[E+128]=E+128<<1^283;i=new Array(256),n=new Array(256),g=new Array(4),a=new Array(4);for(var E=0;E<4;++E)g[E]=new Array(256),a[E]=new Array(256);for(var c=0,Q=0,C,d,M,y,w,D,p,E=0;E<256;++E){y=Q^Q<<1^Q<<2^Q<<3^Q<<4,y=y>>8^y&255^99,i[c]=y,n[y]=c,w=B[y],C=B[c],d=B[C],M=B[d],D=w<<24^y<<16^y<<8^(y^w),p=(C^d^M)<<24^(c^M)<<16^(c^d^M)<<8^(c^C^M);for(var f=0;f<4;++f)g[f][c]=D,a[f][y]=p,D=D<<24|D>>>8,p=p<<24|p>>>8;c===0?c=Q=1:(c=C^B[B[B[C^M]]],Q^=B[B[Q]])}}function I(B,E){for(var c=B.slice(0),Q,C=1,d=c.length,M=d+6+1,y=e*M,w=d;w<y;++w)Q=c[w-1],w%d===0?(Q=i[Q>>>16&255]<<24^i[Q>>>8&255]<<16^i[Q&255]<<8^i[Q>>>24]^o[C]<<24,C++):d>6&&w%d===4&&(Q=i[Q>>>24]<<24^i[Q>>>16&255]<<16^i[Q>>>8&255]<<8^i[Q&255]),c[w]=c[w-d]^Q;if(E){var D,p=a[0],f=a[1],u=a[2],Y=a[3],b=c.slice(0);y=c.length;for(var w=0,m=y-e;w<y;w+=e,m-=e)if(w===0||w===y-e)b[w]=c[m],b[w+1]=c[m+3],b[w+2]=c[m+2],b[w+3]=c[m+1];else for(var T=0;T<e;++T)D=c[m+T],b[w+(3&-T)]=p[i[D>>>24]]^f[i[D>>>16&255]]^u[i[D>>>8&255]]^Y[i[D&255]];c=b}return c}function l(B,E,c,Q){var C=B.length/4-1,d,M,y,w,D;Q?(d=a[0],M=a[1],y=a[2],w=a[3],D=n):(d=g[0],M=g[1],y=g[2],w=g[3],D=i);var p,f,u,Y,b,m,T;p=E[0]^B[0],f=E[Q?3:1]^B[1],u=E[2]^B[2],Y=E[Q?1:3]^B[3];for(var F=3,j=1;j<C;++j)b=d[p>>>24]^M[f>>>16&255]^y[u>>>8&255]^w[Y&255]^B[++F],m=d[f>>>24]^M[u>>>16&255]^y[Y>>>8&255]^w[p&255]^B[++F],T=d[u>>>24]^M[Y>>>16&255]^y[p>>>8&255]^w[f&255]^B[++F],Y=d[Y>>>24]^M[p>>>16&255]^y[f>>>8&255]^w[u&255]^B[++F],p=b,f=m,u=T;c[0]=D[p>>>24]<<24^D[f>>>16&255]<<16^D[u>>>8&255]<<8^D[Y&255]^B[++F],c[Q?3:1]=D[f>>>24]<<24^D[u>>>16&255]<<16^D[Y>>>8&255]<<8^D[p&255]^B[++F],c[2]=D[u>>>24]<<24^D[Y>>>16&255]<<16^D[p>>>8&255]<<8^D[f&255]^B[++F],c[Q?1:3]=D[Y>>>24]<<24^D[p>>>16&255]<<16^D[f>>>8&255]<<8^D[u&255]^B[++F]}function h(B){B=B||{};var E=(B.mode||"CBC").toUpperCase(),c="AES-"+E,Q;B.decrypt?Q=s.cipher.createDecipher(c,B.key):Q=s.cipher.createCipher(c,B.key);var C=Q.start;return Q.start=function(d,M){var y=null;M instanceof s.util.ByteBuffer&&(y=M,M={}),M=M||{},M.output=y,M.iv=d,C.call(Q,M)},Q}return _y}var qy={exports:{}},$y={exports:{}},Ap={exports:{}},ZW;function da(){if(ZW)return Ap.exports;ZW=1;var s=Pt();s.pki=s.pki||{};var A=Ap.exports=s.pki.oids=s.oids=s.oids||{};function t(i,n){A[i]=n,A[n]=i}function e(i,n){A[i]=n}return t("1.2.840.113549.1.1.1","rsaEncryption"),t("1.2.840.113549.1.1.4","md5WithRSAEncryption"),t("1.2.840.113549.1.1.5","sha1WithRSAEncryption"),t("1.2.840.113549.1.1.7","RSAES-OAEP"),t("1.2.840.113549.1.1.8","mgf1"),t("1.2.840.113549.1.1.9","pSpecified"),t("1.2.840.113549.1.1.10","RSASSA-PSS"),t("1.2.840.113549.1.1.11","sha256WithRSAEncryption"),t("1.2.840.113549.1.1.12","sha384WithRSAEncryption"),t("1.2.840.113549.1.1.13","sha512WithRSAEncryption"),t("1.3.101.112","EdDSA25519"),t("1.2.840.10040.4.3","dsa-with-sha1"),t("1.3.14.3.2.7","desCBC"),t("1.3.14.3.2.26","sha1"),t("1.3.14.3.2.29","sha1WithRSASignature"),t("2.16.840.1.101.3.4.2.1","sha256"),t("2.16.840.1.101.3.4.2.2","sha384"),t("2.16.840.1.101.3.4.2.3","sha512"),t("2.16.840.1.101.3.4.2.4","sha224"),t("2.16.840.1.101.3.4.2.5","sha512-224"),t("2.16.840.1.101.3.4.2.6","sha512-256"),t("1.2.840.113549.2.2","md2"),t("1.2.840.113549.2.5","md5"),t("1.2.840.113549.1.7.1","data"),t("1.2.840.113549.1.7.2","signedData"),t("1.2.840.113549.1.7.3","envelopedData"),t("1.2.840.113549.1.7.4","signedAndEnvelopedData"),t("1.2.840.113549.1.7.5","digestedData"),t("1.2.840.113549.1.7.6","encryptedData"),t("1.2.840.113549.1.9.1","emailAddress"),t("1.2.840.113549.1.9.2","unstructuredName"),t("1.2.840.113549.1.9.3","contentType"),t("1.2.840.113549.1.9.4","messageDigest"),t("1.2.840.113549.1.9.5","signingTime"),t("1.2.840.113549.1.9.6","counterSignature"),t("1.2.840.113549.1.9.7","challengePassword"),t("1.2.840.113549.1.9.8","unstructuredAddress"),t("1.2.840.113549.1.9.14","extensionRequest"),t("1.2.840.113549.1.9.20","friendlyName"),t("1.2.840.113549.1.9.21","localKeyId"),t("1.2.840.113549.1.9.22.1","x509Certificate"),t("1.2.840.113549.1.12.10.1.1","keyBag"),t("1.2.840.113549.1.12.10.1.2","pkcs8ShroudedKeyBag"),t("1.2.840.113549.1.12.10.1.3","certBag"),t("1.2.840.113549.1.12.10.1.4","crlBag"),t("1.2.840.113549.1.12.10.1.5","secretBag"),t("1.2.840.113549.1.12.10.1.6","safeContentsBag"),t("1.2.840.113549.1.5.13","pkcs5PBES2"),t("1.2.840.113549.1.5.12","pkcs5PBKDF2"),t("1.2.840.113549.1.12.1.1","pbeWithSHAAnd128BitRC4"),t("1.2.840.113549.1.12.1.2","pbeWithSHAAnd40BitRC4"),t("1.2.840.113549.1.12.1.3","pbeWithSHAAnd3-KeyTripleDES-CBC"),t("1.2.840.113549.1.12.1.4","pbeWithSHAAnd2-KeyTripleDES-CBC"),t("1.2.840.113549.1.12.1.5","pbeWithSHAAnd128BitRC2-CBC"),t("1.2.840.113549.1.12.1.6","pbewithSHAAnd40BitRC2-CBC"),t("1.2.840.113549.2.7","hmacWithSHA1"),t("1.2.840.113549.2.8","hmacWithSHA224"),t("1.2.840.113549.2.9","hmacWithSHA256"),t("1.2.840.113549.2.10","hmacWithSHA384"),t("1.2.840.113549.2.11","hmacWithSHA512"),t("1.2.840.113549.3.7","des-EDE3-CBC"),t("2.16.840.1.101.3.4.1.2","aes128-CBC"),t("2.16.840.1.101.3.4.1.22","aes192-CBC"),t("2.16.840.1.101.3.4.1.42","aes256-CBC"),t("2.5.4.3","commonName"),t("2.5.4.4","surname"),t("2.5.4.5","serialNumber"),t("2.5.4.6","countryName"),t("2.5.4.7","localityName"),t("2.5.4.8","stateOrProvinceName"),t("2.5.4.9","streetAddress"),t("2.5.4.10","organizationName"),t("2.5.4.11","organizationalUnitName"),t("2.5.4.12","title"),t("2.5.4.13","description"),t("2.5.4.15","businessCategory"),t("2.5.4.17","postalCode"),t("2.5.4.42","givenName"),t("2.5.4.65","pseudonym"),t("1.3.6.1.4.1.311.60.2.1.2","jurisdictionOfIncorporationStateOrProvinceName"),t("1.3.6.1.4.1.311.60.2.1.3","jurisdictionOfIncorporationCountryName"),t("2.16.840.1.113730.1.1","nsCertType"),t("2.16.840.1.113730.1.13","nsComment"),e("2.5.29.1","authorityKeyIdentifier"),e("2.5.29.2","keyAttributes"),e("2.5.29.3","certificatePolicies"),e("2.5.29.4","keyUsageRestriction"),e("2.5.29.5","policyMapping"),e("2.5.29.6","subtreesConstraint"),e("2.5.29.7","subjectAltName"),e("2.5.29.8","issuerAltName"),e("2.5.29.9","subjectDirectoryAttributes"),e("2.5.29.10","basicConstraints"),e("2.5.29.11","nameConstraints"),e("2.5.29.12","policyConstraints"),e("2.5.29.13","basicConstraints"),t("2.5.29.14","subjectKeyIdentifier"),t("2.5.29.15","keyUsage"),e("2.5.29.16","privateKeyUsagePeriod"),t("2.5.29.17","subjectAltName"),t("2.5.29.18","issuerAltName"),t("2.5.29.19","basicConstraints"),e("2.5.29.20","cRLNumber"),e("2.5.29.21","cRLReason"),e("2.5.29.22","expirationDate"),e("2.5.29.23","instructionCode"),e("2.5.29.24","invalidityDate"),e("2.5.29.25","cRLDistributionPoints"),e("2.5.29.26","issuingDistributionPoint"),e("2.5.29.27","deltaCRLIndicator"),e("2.5.29.28","issuingDistributionPoint"),e("2.5.29.29","certificateIssuer"),e("2.5.29.30","nameConstraints"),t("2.5.29.31","cRLDistributionPoints"),t("2.5.29.32","certificatePolicies"),e("2.5.29.33","policyMappings"),e("2.5.29.34","policyConstraints"),t("2.5.29.35","authorityKeyIdentifier"),e("2.5.29.36","policyConstraints"),t("2.5.29.37","extKeyUsage"),e("2.5.29.46","freshestCRL"),e("2.5.29.54","inhibitAnyPolicy"),t("1.3.6.1.4.1.11129.2.4.2","timestampList"),t("1.3.6.1.5.5.7.1.1","authorityInfoAccess"),t("1.3.6.1.5.5.7.3.1","serverAuth"),t("1.3.6.1.5.5.7.3.2","clientAuth"),t("1.3.6.1.5.5.7.3.3","codeSigning"),t("1.3.6.1.5.5.7.3.4","emailProtection"),t("1.3.6.1.5.5.7.3.8","timeStamping"),Ap.exports}var NW;function Pn(){if(NW)return $y.exports;NW=1;var s=Pt();Ut(),da();var A=$y.exports=s.asn1=s.asn1||{};A.Class={UNIVERSAL:0,APPLICATION:64,CONTEXT_SPECIFIC:128,PRIVATE:192},A.Type={NONE:0,BOOLEAN:1,INTEGER:2,BITSTRING:3,OCTETSTRING:4,NULL:5,OID:6,ODESC:7,EXTERNAL:8,REAL:9,ENUMERATED:10,EMBEDDED:11,UTF8:12,ROID:13,SEQUENCE:16,SET:17,PRINTABLESTRING:19,IA5STRING:22,UTCTIME:23,GENERALIZEDTIME:24,BMPSTRING:30},A.maxDepth=256,A.create=function(o,g,a,r,I){if(s.util.isArray(r)){for(var l=[],h=0;h<r.length;++h)r[h]!==void 0&&l.push(r[h]);r=l}var B={tagClass:o,type:g,constructed:a,composed:a||s.util.isArray(r),value:r};return I&&"bitStringContents"in I&&(B.bitStringContents=I.bitStringContents,B.original=A.copy(B)),B},A.copy=function(o,g){var a;if(s.util.isArray(o)){a=[];for(var r=0;r<o.length;++r)a.push(A.copy(o[r],g));return a}return typeof o=="string"?o:(a={tagClass:o.tagClass,type:o.type,constructed:o.constructed,composed:o.composed,value:A.copy(o.value,g)},g&&!g.excludeBitStringContents&&(a.bitStringContents=o.bitStringContents),a)},A.equals=function(o,g,a){if(s.util.isArray(o)){if(!s.util.isArray(g)||o.length!==g.length)return!1;for(var r=0;r<o.length;++r)if(!A.equals(o[r],g[r]))return!1;return!0}if(typeof o!=typeof g)return!1;if(typeof o=="string")return o===g;var I=o.tagClass===g.tagClass&&o.type===g.type&&o.constructed===g.constructed&&o.composed===g.composed&&A.equals(o.value,g.value);return a&&a.includeBitStringContents&&(I=I&&o.bitStringContents===g.bitStringContents),I},A.getBerValueLength=function(o){var g=o.getByte();if(g!==128){var a,r=g&128;return r?a=o.getInt((g&127)<<3):a=g,a}};function t(o,g,a){if(a>g){var r=new Error("Too few bytes to parse DER.");throw r.available=o.length(),r.remaining=g,r.requested=a,r}}var e=function(o,g){var a=o.getByte();if(g--,a!==128){var r,I=a&128;if(!I)r=a;else{var l=a&127;t(o,g,l),r=o.getInt(l<<3)}if(r<0)throw new Error("Negative length: "+r);return r}};A.fromDer=function(o,g){g===void 0&&(g={strict:!0,parseAllBytes:!0,decodeBitStrings:!0}),typeof g=="boolean"&&(g={strict:g,parseAllBytes:!0,decodeBitStrings:!0}),"strict"in g||(g.strict=!0),"parseAllBytes"in g||(g.parseAllBytes=!0),"decodeBitStrings"in g||(g.decodeBitStrings=!0),"maxDepth"in g||(g.maxDepth=A.maxDepth),typeof o=="string"&&(o=s.util.createBuffer(o));var a=o.length(),r=i(o,o.length(),0,g);if(g.parseAllBytes&&o.length()!==0){var I=new Error("Unparsed DER bytes remain after ASN.1 parsing.");throw I.byteCount=a,I.remaining=o.length(),I}return r};function i(o,g,a,r){if(a>=r.maxDepth)throw new Error("ASN.1 parsing error: Max depth exceeded.");var I;t(o,g,2);var l=o.getByte();g--;var h=l&192,B=l&31;I=o.length();var E=e(o,g);if(g-=I-o.length(),E!==void 0&&E>g){if(r.strict){var c=new Error("Too few bytes to read ASN.1 value.");throw c.available=o.length(),c.remaining=g,c.requested=E,c}E=g}var Q,C,d=(l&32)===32;if(d)if(Q=[],E===void 0)for(;;){if(t(o,g,2),o.bytes(2)==="\0\0"){o.getBytes(2),g-=2;break}I=o.length(),Q.push(i(o,g,a+1,r)),g-=I-o.length()}else for(;E>0;)I=o.length(),Q.push(i(o,E,a+1,r)),g-=I-o.length(),E-=I-o.length();if(Q===void 0&&h===A.Class.UNIVERSAL&&B===A.Type.BITSTRING&&(C=o.bytes(E)),Q===void 0&&r.decodeBitStrings&&h===A.Class.UNIVERSAL&&B===A.Type.BITSTRING&&E>1){var M=o.read,y=g,w=0;if(B===A.Type.BITSTRING&&(t(o,g,1),w=o.getByte(),g--),w===0)try{I=o.length();var D={strict:!0,decodeBitStrings:!0},p=i(o,g,a+1,D),f=I-o.length();g-=f,B==A.Type.BITSTRING&&f++;var u=p.tagClass;f===E&&(u===A.Class.UNIVERSAL||u===A.Class.CONTEXT_SPECIFIC)&&(Q=[p])}catch{}Q===void 0&&(o.read=M,g=y)}if(Q===void 0){if(E===void 0){if(r.strict)throw new Error("Non-constructed ASN.1 object of indefinite length.");E=g}if(B===A.Type.BMPSTRING)for(Q="";E>0;E-=2)t(o,g,2),Q+=String.fromCharCode(o.getInt16()),g-=2;else Q=o.getBytes(E),g-=E}var Y=C===void 0?null:{bitStringContents:C};return A.create(h,B,d,Q,Y)}A.toDer=function(o){var g=s.util.createBuffer(),a=o.tagClass|o.type,r=s.util.createBuffer(),I=!1;if("bitStringContents"in o&&(I=!0,o.original&&(I=A.equals(o,o.original))),I)r.putBytes(o.bitStringContents);else if(o.composed){o.constructed?a|=32:r.putByte(0);for(var l=0;l<o.value.length;++l)o.value[l]!==void 0&&r.putBuffer(A.toDer(o.value[l]))}else if(o.type===A.Type.BMPSTRING)for(var l=0;l<o.value.length;++l)r.putInt16(o.value.charCodeAt(l));else o.type===A.Type.INTEGER&&o.value.length>1&&(o.value.charCodeAt(0)===0&&(o.value.charCodeAt(1)&128)===0||o.value.charCodeAt(0)===255&&(o.value.charCodeAt(1)&128)===128)?r.putBytes(o.value.substr(1)):r.putBytes(o.value);if(g.putByte(a),r.length()<=127)g.putByte(r.length()&127);else{var h=r.length(),B="";do B+=String.fromCharCode(h&255),h=h>>>8;while(h>0);g.putByte(B.length|128);for(var l=B.length-1;l>=0;--l)g.putByte(B.charCodeAt(l))}return g.putBuffer(r),g},A.oidToDer=function(o){var g=o.split("."),a=s.util.createBuffer();a.putByte(40*parseInt(g[0],10)+parseInt(g[1],10));for(var r,I,l,h,B=2;B<g.length;++B){if(r=!0,I=[],l=parseInt(g[B],10),l>4294967295)throw new Error("OID value too large; max is 32-bits.");do h=l&127,l=l>>>7,r||(h|=128),I.push(h),r=!1;while(l>0);for(var E=I.length-1;E>=0;--E)a.putByte(I[E])}return a},A.derToOid=function(o){var g;typeof o=="string"&&(o=s.util.createBuffer(o));var a=o.getByte();g=Math.floor(a/40)+"."+a%40;for(var r=0;o.length()>0;){if(r>70368744177663)throw new Error("OID value too large; max is 53-bits.");a=o.getByte(),r=r*128,a&128?r+=a&127:(g+="."+(r+a),r=0)}return g},A.utcTimeToDate=function(o){var g=new Date,a=parseInt(o.substr(0,2),10);a=a>=50?1900+a:2e3+a;var r=parseInt(o.substr(2,2),10)-1,I=parseInt(o.substr(4,2),10),l=parseInt(o.substr(6,2),10),h=parseInt(o.substr(8,2),10),B=0;if(o.length>11){var E=o.charAt(10),c=10;E!=="+"&&E!=="-"&&(B=parseInt(o.substr(10,2),10),c+=2)}if(g.setUTCFullYear(a,r,I),g.setUTCHours(l,h,B,0),c&&(E=o.charAt(c),E==="+"||E==="-")){var Q=parseInt(o.substr(c+1,2),10),C=parseInt(o.substr(c+4,2),10),d=Q*60+C;d*=6e4,E==="+"?g.setTime(+g-d):g.setTime(+g+d)}return g},A.generalizedTimeToDate=function(o){var g=new Date,a=parseInt(o.substr(0,4),10),r=parseInt(o.substr(4,2),10)-1,I=parseInt(o.substr(6,2),10),l=parseInt(o.substr(8,2),10),h=parseInt(o.substr(10,2),10),B=parseInt(o.substr(12,2),10),E=0,c=0,Q=!1;o.charAt(o.length-1)==="Z"&&(Q=!0);var C=o.length-5,d=o.charAt(C);if(d==="+"||d==="-"){var M=parseInt(o.substr(C+1,2),10),y=parseInt(o.substr(C+4,2),10);c=M*60+y,c*=6e4,d==="+"&&(c*=-1),Q=!0}return o.charAt(14)==="."&&(E=parseFloat(o.substr(14),10)*1e3),Q?(g.setUTCFullYear(a,r,I),g.setUTCHours(l,h,B,E),g.setTime(+g+c)):(g.setFullYear(a,r,I),g.setHours(l,h,B,E)),g},A.dateToUtcTime=function(o){if(typeof o=="string")return o;var g="",a=[];a.push((""+o.getUTCFullYear()).substr(2)),a.push(""+(o.getUTCMonth()+1)),a.push(""+o.getUTCDate()),a.push(""+o.getUTCHours()),a.push(""+o.getUTCMinutes()),a.push(""+o.getUTCSeconds());for(var r=0;r<a.length;++r)a[r].length<2&&(g+="0"),g+=a[r];return g+="Z",g},A.dateToGeneralizedTime=function(o){if(typeof o=="string")return o;var g="",a=[];a.push(""+o.getUTCFullYear()),a.push(""+(o.getUTCMonth()+1)),a.push(""+o.getUTCDate()),a.push(""+o.getUTCHours()),a.push(""+o.getUTCMinutes()),a.push(""+o.getUTCSeconds());for(var r=0;r<a.length;++r)a[r].length<2&&(g+="0"),g+=a[r];return g+="Z",g},A.integerToDer=function(o){var g=s.util.createBuffer();if(o>=-128&&o<128)return g.putSignedInt(o,8);if(o>=-32768&&o<32768)return g.putSignedInt(o,16);if(o>=-8388608&&o<8388608)return g.putSignedInt(o,24);if(o>=-2147483648&&o<2147483648)return g.putSignedInt(o,32);var a=new Error("Integer too large; max is 32-bits.");throw a.integer=o,a},A.derToInteger=function(o){typeof o=="string"&&(o=s.util.createBuffer(o));var g=o.length()*8;if(g>32)throw new Error("Integer too large; max is 32-bits.");return o.getSignedInt(g)},A.validate=function(o,g,a,r){var I=!1;if((o.tagClass===g.tagClass||typeof g.tagClass>"u")&&(o.type===g.type||typeof g.type>"u"))if(o.constructed===g.constructed||typeof g.constructed>"u"){if(I=!0,g.value&&s.util.isArray(g.value))for(var l=0,h=0;I&&h<g.value.length;++h){var B=g.value[h];I=!!B.optional;var E=o.value[l];if(!E){B.optional||(I=!1,r&&r.push("["+g.name+'] Missing required element. Expected tag class "'+B.tagClass+'", type "'+B.type+'"'));continue}var c=typeof B.tagClass<"u"&&typeof B.type<"u";if(c&&(E.tagClass!==B.tagClass||E.type!==B.type))if(B.optional){I=!0;continue}else{I=!1,r&&r.push("["+g.name+"] Tag mismatch. Expected ("+B.tagClass+","+B.type+"), got ("+E.tagClass+","+E.type+")");break}var Q=A.validate(E,B,a,r);if(Q)++l,I=!0;else if(B.optional)I=!0;else{I=!1;break}}if(I&&a&&(g.capture&&(a[g.capture]=o.value),g.captureAsn1&&(a[g.captureAsn1]=o),g.captureBitStringContents&&"bitStringContents"in o&&(a[g.captureBitStringContents]=o.bitStringContents),g.captureBitStringValue&&"bitStringContents"in o))if(o.bitStringContents.length<2)a[g.captureBitStringValue]="";else{var C=o.bitStringContents.charCodeAt(0);if(C!==0)throw new Error("captureBitStringValue only supported for zero unused bits");a[g.captureBitStringValue]=o.bitStringContents.slice(1)}}else r&&r.push("["+g.name+'] Expected constructed "'+g.constructed+'", got "'+o.constructed+'"');else r&&(o.tagClass!==g.tagClass&&r.push("["+g.name+'] Expected tag class "'+g.tagClass+'", got "'+o.tagClass+'"'),o.type!==g.type&&r.push("["+g.name+'] Expected type "'+g.type+'", got "'+o.type+'"'));return I};var n=/[^\\u0000-\\u00ff]/;return A.prettyPrint=function(o,g,a){var r="";g=g||0,a=a||2,g>0&&(r+=`
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { S as ki, G as pe, P as Xt, O as Be, M as F, V as d, e as et, T as Un, C as Us, W as Li, a as Ws, b as We, N as Bi, c as Gs, d as lt, f as W, Q as Te, E as Wn, R as me, g as tt, h as Gn, B as R, i as zi, A as qn, j as H, k as z, I as V, l as ri, m as ai, n as Kn, o as jn, L as Qt, p as qs, q as Ks, r as js, s as Yi, D as re, t as Xi, u as Ys, F as Xs, v as xe, w as Yn, x as Xn, y as Ri, z as Qs, H as Qn, J as ae, K as $s, U as Zs, X as Et, Y as Js, Z as $n, _ as eo, $ as Ie, a0 as At, a1 as it, a2 as Xe, a3 as $t, a4 as Oi, a5 as Z, a6 as oe, a7 as St, a8 as to, a9 as nt, aa as wi, ab as Ge, ac as Lt, ad as io, ae as no, af as bi, ag as pt, ah as so, ai as ut, aj as oo, ak as ro, al as Zn, am as Zt, an as Pt, ao as Jt, ap as ao, aq as Qi, ar as Tt, as as It, at as lo, au as co, av as $i, aw as ho, ax as uo, ay as po, az as mo, aA as go, aB as fo, aC as yo, aD as Mo, aE as vo, aF as xo, aG as Jn, aH as wo, aI as bo, aJ as Co, aK as Eo, aL as Ao, aM as So, aN as Po, aO as To, aP as Io, aQ as _o } from "./three-vendor-UroN9p1L.js";
|
|
2
|
-
import { W as fe, C as Do, L as Mt, B as Zi, g as Oe, a as ko, E as Lo, r as Bo } from "./sdk-runtime-
|
|
2
|
+
import { W as fe, C as Do, L as Mt, B as Zi, g as Oe, a as ko, E as Lo, r as Bo } from "./sdk-runtime-CP-PEZRP.js";
|
|
3
3
|
import { r as ee, g as zo } from "./sdk-assets-DHhjv3WO.js";
|
|
4
4
|
import { a as ei, J as Ci, c as Ro, b as Oo, P as li, q as Fo, k as No, n as Ji, E as en, S as Ho } from "./sdk-vendor-DYgn7sFs.js";
|
|
5
5
|
class Vo {
|
|
@@ -2670,7 +2670,7 @@ class sr {
|
|
|
2670
2670
|
magFilter: Qt,
|
|
2671
2671
|
format: jn,
|
|
2672
2672
|
// 移动端关闭多重采样,避免全分辨率多采样缓冲造成显存峰值。
|
|
2673
|
-
samples: o ?
|
|
2673
|
+
samples: o ? 2 : 4
|
|
2674
2674
|
});
|
|
2675
2675
|
l.texture.colorSpace = qs, this.composer = new Ks(s, l), this.composer.setPixelRatio(r), this.composer.setSize(e, t);
|
|
2676
2676
|
const c = new js(i, n);
|