@arcgis/core 5.2.0-next.48 → 5.2.0-next.49

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.
Files changed (190) hide show
  1. package/applications/Components/OrientedImageryViewer/PanoramicViewer/utils.d.ts +33 -0
  2. package/applications/Components/OrientedImageryViewer/PanoramicViewer/utils.js +2 -0
  3. package/arcgisGlobal.d.ts +2 -0
  4. package/assets/esri/core/workers/RemoteClient.js +1 -1
  5. package/assets/esri/core/workers/chunks/031ccf2e1583beebdf24.js +1 -0
  6. package/assets/esri/core/workers/chunks/0474af7687466d8befd2.js +1 -0
  7. package/assets/esri/core/workers/chunks/{f9b2727b41943d83d4ca.js → 0a413d917f3d19440fc1.js} +1 -1
  8. package/assets/esri/core/workers/chunks/0b2ca406761c63529a6a.js +1 -0
  9. package/assets/esri/core/workers/chunks/{c369d4266f38e9ea6592.js → 1119a33245138e7b3914.js} +1 -1
  10. package/assets/esri/core/workers/chunks/{6fbcf1b85461c6c6c127.js → 172571397c66f992d08c.js} +1 -1
  11. package/assets/esri/core/workers/chunks/18edf2846d7546285e5e.js +1 -0
  12. package/assets/esri/core/workers/chunks/{7759a489205a874e13bb.js → 1b0557fcb058fc450230.js} +1 -1
  13. package/assets/esri/core/workers/chunks/{7d0ff52748fd4eb0334d.js → 1bc45872d22d61dbd7d1.js} +1 -1
  14. package/assets/esri/core/workers/chunks/{835643f716f7058a2722.js → 1cf8fb704c48ac3d3b15.js} +1 -1
  15. package/assets/esri/core/workers/chunks/25cb56c3b538d00e7693.js +1 -0
  16. package/assets/esri/core/workers/chunks/{2c0d92c0e3511775401a.js → 35cbf00f0c37a86517af.js} +1 -1
  17. package/assets/esri/core/workers/chunks/382d9491c2a56c1925fe.js +1 -0
  18. package/assets/esri/core/workers/chunks/3af2b9d6d5466cb2b957.js +256 -0
  19. package/assets/esri/core/workers/chunks/{c3766d98f0a70897647f.js → 3bc2943035391b44d4cf.js} +1 -1
  20. package/assets/esri/core/workers/chunks/{bd8b180c61a80e60568c.js → 40f7bb0ebd918d76f078.js} +1 -1
  21. package/assets/esri/core/workers/chunks/43b39abd49c4a8ce891f.js +1 -0
  22. package/assets/esri/core/workers/chunks/{821176ee3be724621bb0.js → 461c2de938bf4c9b1442.js} +1 -1
  23. package/assets/esri/core/workers/chunks/4ee7232ea41fa41c5ed4.js +29 -0
  24. package/assets/esri/core/workers/chunks/50674ba5f24129d61d89.js +1 -0
  25. package/assets/esri/core/workers/chunks/547a2fe53139f705f95e.js +1 -0
  26. package/assets/esri/core/workers/chunks/5ce09c4d06e98b1e9251.js +1 -0
  27. package/assets/esri/core/workers/chunks/{4d9433f127aef76f3449.js → 5dbd28fce73751d2d1aa.js} +1 -1
  28. package/assets/esri/core/workers/chunks/5ec8b02e097cf6718462.js +1 -0
  29. package/assets/esri/core/workers/chunks/5f54d927dc77e92cf145.js +1 -0
  30. package/assets/esri/core/workers/chunks/63e3d338751240479335.js +1 -0
  31. package/assets/esri/core/workers/chunks/6ccd5fa5e35dc70fcd5d.js +1 -0
  32. package/assets/esri/core/workers/chunks/6e520ef645c5edcd499a.js +1 -0
  33. package/assets/esri/core/workers/chunks/{68d898037feb0aee3138.js → 78add8e6b54b51eaa299.js} +1 -1
  34. package/assets/esri/core/workers/chunks/7b61f56d0f766421eaef.js +1 -0
  35. package/assets/esri/core/workers/chunks/7f2f2a92dce3f68e579b.js +1 -0
  36. package/assets/esri/core/workers/chunks/{e7e3ea7af928b49b226c.js → 801a664f21e0218bc705.js} +1 -1
  37. package/assets/esri/core/workers/chunks/8d21e2dabc5165f1c8ca.js +1 -0
  38. package/assets/esri/core/workers/chunks/9008090a5d8431ddfa22.js +1 -0
  39. package/assets/esri/core/workers/chunks/{71ce1009dadcae8f8094.js → 95b3b8fe45ef4ac6b277.js} +1 -1
  40. package/assets/esri/core/workers/chunks/{78918035144c3c76df71.js → 96cec8a02ca96175d602.js} +1 -1
  41. package/assets/esri/core/workers/chunks/{bab71e1b8b93d09d4809.js → 99eccf9ce53582cfa5b5.js} +1 -1
  42. package/assets/esri/core/workers/chunks/9b7cb96acea388d86fa4.js +1 -0
  43. package/assets/esri/core/workers/chunks/{ff2c4f648f77850922d5.js → 9e474465d069cb9e94f5.js} +1 -1
  44. package/assets/esri/core/workers/chunks/{ae9f9e975d7a9d442fa5.js → ab5aa4280ed0cb7fcbe9.js} +1 -1
  45. package/assets/esri/core/workers/chunks/b49952541d189b4b9f7e.js +1 -0
  46. package/assets/esri/core/workers/chunks/{fed6c75485601cd3afa1.js → baac90da0703891d59c4.js} +1 -1
  47. package/assets/esri/core/workers/chunks/bb552089b34d6811fb03.js +1 -0
  48. package/assets/esri/core/workers/chunks/{b30237361d87cf982e41.js → d1af0bd611a3dc549858.js} +64 -59
  49. package/assets/esri/core/workers/chunks/d2cb3d5ef0a9285afb78.js +1 -0
  50. package/assets/esri/core/workers/chunks/d560ed96dde5ca3a5583.js +1 -0
  51. package/assets/esri/core/workers/chunks/dc1787d88b11ed985159.js +1 -0
  52. package/assets/esri/core/workers/chunks/{399e23d777a043efa9f1.js → dd95f50dac3f33cdb6d2.js} +1 -1
  53. package/assets/esri/core/workers/chunks/ddb92c815d17c67a45e6.js +1 -0
  54. package/assets/esri/core/workers/chunks/{52efa4ded11c1e71f04f.js → e2e2162adbfb9b46bede.js} +1 -1
  55. package/assets/esri/core/workers/chunks/e4353f0792f45aa6a62f.js +1 -0
  56. package/assets/esri/core/workers/chunks/eac8cae89da9ce2f4946.js +1 -0
  57. package/assets/esri/core/workers/chunks/edf87407dd20685c82ab.js +1 -0
  58. package/assets/esri/core/workers/chunks/{be6caade351e89f84251.js → ee7c8a7f384ea6393487.js} +107 -82
  59. package/assets/esri/core/workers/chunks/f1299b4fc760ccca1518.js +1 -0
  60. package/assets/esri/core/workers/chunks/f244632f7934a4b72c91.js +1 -0
  61. package/assets/esri/core/workers/chunks/fc639c730115e07a4a1a.js +1 -0
  62. package/assets/esri/libs/dxtEncoder/dxt_encoder.wasm +0 -0
  63. package/chunks/Component.glsl.js +104 -67
  64. package/chunks/LineMarker.glsl.js +31 -31
  65. package/chunks/RibbonLine.glsl.js +60 -49
  66. package/chunks/dxt_encoder.js +1 -1
  67. package/chunks/vec3.js +1 -1
  68. package/config.js +1 -1
  69. package/core/has.js +1 -1
  70. package/geometry/support/aaBoundingBox.js +1 -1
  71. package/geometry/support/buffer/math/vec3.js +1 -1
  72. package/geometry/support/frustum.js +1 -1
  73. package/geometry/support/meshUtils/extent.js +1 -1
  74. package/geometry/support/meshUtils/vertexSpaceConversion.js +1 -1
  75. package/kernel.js +1 -1
  76. package/layers/orientedImagery/transformations/imageToWorld.js +1 -1
  77. package/layers/orientedImagery/transformations/utils.js +1 -1
  78. package/package.json +1 -1
  79. package/support/revision.js +1 -1
  80. package/symbols/cim/CIMSymbolDrawHelper.js +1 -1
  81. package/symbols/cim/CIMSymbolHelper.js +1 -1
  82. package/symbols/cim/TextRasterizer.js +1 -1
  83. package/symbols/cim/cimAnalyzer.js +1 -1
  84. package/symbols/cim/richTextUtils.js +2 -0
  85. package/views/2d/engine/webgl/TextureManager.js +1 -1
  86. package/views/2d/engine/webgl/definitions.js +1 -1
  87. package/views/2d/engine/webgl/mesh/templates/shapingUtils.js +1 -1
  88. package/views/2d/engine/webgl/shaderGraph/techniques/labels/LabelMeshWriter.js +1 -1
  89. package/views/2d/engine/webgl/shaderGraph/techniques/text/TextMeshWriter.js +1 -1
  90. package/views/2d/engine/webgl/util/DimensionMatcher.js +1 -1
  91. package/views/2d/layers/FeatureLikeLayerView2D.js +1 -1
  92. package/views/2d/layers/features/schema/processor/symbols/SymbolSchema.js +1 -1
  93. package/views/2d/layers/support/annodime/DimensionInfo.js +1 -1
  94. package/views/2d/layers/support/annodime/dimensionUtils.js +1 -1
  95. package/views/3d/analysis/LineOfSight/LineOfSightReshapeTool3D.js +1 -1
  96. package/views/3d/analysis/Viewshed/ViewshedConfiguration.js +1 -1
  97. package/views/3d/analysis/Viewshed/ViewshedEditTool.js +1 -1
  98. package/views/3d/analysis/Viewshed/ViewshedSubTool.js +1 -1
  99. package/views/3d/analysis/Viewshed/ViewshedSubVisualization.js +1 -1
  100. package/views/3d/analysis/Viewshed/ViewshedTool.js +1 -1
  101. package/views/3d/analysis/ViewshedAnalysisView3D.js +1 -1
  102. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillController.js +1 -1
  103. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillVisualization.js +1 -1
  104. package/views/3d/focusAreaUtils.js +1 -1
  105. package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
  106. package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
  107. package/views/3d/layers/graphics/objectResourceUtils.js +1 -1
  108. package/views/3d/layers/graphics/wosrLoader.js +1 -1
  109. package/views/3d/layers/i3s/meshUtils.js +1 -1
  110. package/views/3d/webgl/RenderCamera.js +1 -1
  111. package/views/3d/webgl/RenderNode.js +1 -1
  112. package/views/3d/webgl-engine/collections/Component/Material/Component.glsl.js +1 -1
  113. package/views/3d/webgl-engine/core/shaderLibrary/TextureBackedBuffer.glsl.js +2 -2
  114. package/views/3d/webgl-engine/core/shaderLibrary/TextureBackedBufferFields.glsl.js +2 -2
  115. package/views/3d/webgl-engine/core/shaderLibrary/attributes/RibbonVertexPosition.glsl.js +36 -25
  116. package/views/3d/webgl-engine/core/shaderLibrary/terrain/Overlay.glsl.js +17 -10
  117. package/views/3d/webgl-engine/lib/BoundingInfo.js +1 -1
  118. package/views/3d/webgl-engine/lib/Object3D.js +1 -1
  119. package/views/3d/webgl-engine/lib/PolygonIntersections2D.js +1 -1
  120. package/views/3d/webgl-engine/lib/RayIntersections.js +1 -1
  121. package/views/3d/webgl-engine/lib/RenderGeometry.js +1 -1
  122. package/views/3d/webgl-engine/lib/depthRangeUtils.js +1 -1
  123. package/views/3d/webgl-engine/lib/lodRendering/LodLevel.js +1 -1
  124. package/views/3d/webgl-engine/lib/screenPolygonOverlapUtils.js +1 -1
  125. package/views/3d/webgl-engine/lib/screenPolygonTriangleIntersections.js +1 -1
  126. package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
  127. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  128. package/views/3d/webgl-engine/shaders/AnimatedLine.glsl.js +8 -5
  129. package/views/3d/webgl-engine/shaders/RibbonLine.glsl.js +1 -1
  130. package/views/3d/webgl-engine/shaders/RibbonLineLayouts.js +1 -1
  131. package/views/3d/webgl-engine/shaders/RibbonLineTechnique.js +1 -1
  132. package/views/3d/webgl-engine/shaders/RibbonLineTextureBuffer.glsl.js +1 -1
  133. package/views/SceneView.js +1 -1
  134. package/views/interactive/snapping/featureSources/FeatureServiceSnappingSource.js +1 -1
  135. package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceSnappingSourceWorkerHandle.js +1 -1
  136. package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTiledFetcher.js +1 -1
  137. package/views/selection/SelectionOperation.js +1 -1
  138. package/views/support/DefaultsFromMap.js +1 -1
  139. package/views/support/LayerViewManager.js +1 -1
  140. package/views/support/TextureCompressionWorker.js +1 -1
  141. package/views/webgl/RenderingContext.js +1 -1
  142. package/widgets/Editor.js +1 -1
  143. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  144. package/widgets/OrientedImageryViewer/services/SuperimposeService.js +1 -1
  145. package/widgets/OrientedImageryViewer/support/superimposeUtils.js +1 -1
  146. package/widgets/PanoramicViewer/support/PanoramicTileNode.d.ts +63 -0
  147. package/widgets/PanoramicViewer/support/PanoramicTileNode.js +1 -1
  148. package/widgets/PanoramicViewer/support/PanoramicTilePyramid.d.ts +66 -0
  149. package/widgets/PanoramicViewer/support/PanoramicTilePyramid.js +1 -1
  150. package/widgets/PanoramicViewer/utils.js +1 -1
  151. package/widgets/Sketch/VisibleElements.d.ts +0 -10
  152. package/widgets/Sketch.js +1 -1
  153. package/widgets/support/SelectionToolbar/SelectionToolbarViewModel.js +1 -1
  154. package/widgets/support/SelectionToolbar.js +1 -1
  155. package/widgets/support/Selector3D/selectorUtils.js +2 -0
  156. package/assets/esri/core/workers/chunks/0e64e20fedfe01a1985f.js +0 -1
  157. package/assets/esri/core/workers/chunks/0f674c625f24ac73e25a.js +0 -1
  158. package/assets/esri/core/workers/chunks/15351354afcbf840a23d.js +0 -29
  159. package/assets/esri/core/workers/chunks/1843a762f7051f61af43.js +0 -1
  160. package/assets/esri/core/workers/chunks/1d1f5578c7d8619f7a46.js +0 -1
  161. package/assets/esri/core/workers/chunks/2015f4def2ef201bdab8.js +0 -1
  162. package/assets/esri/core/workers/chunks/20c363a113dc068de9e0.js +0 -1
  163. package/assets/esri/core/workers/chunks/24d936d459c538187af6.js +0 -1
  164. package/assets/esri/core/workers/chunks/272c8ab189217240d05f.js +0 -1
  165. package/assets/esri/core/workers/chunks/2e121eac97ae72a8b49a.js +0 -1
  166. package/assets/esri/core/workers/chunks/327899182a4dace428eb.js +0 -1
  167. package/assets/esri/core/workers/chunks/32ca15d928d51b380068.js +0 -1
  168. package/assets/esri/core/workers/chunks/3e1a7e4c674057807e3a.js +0 -1
  169. package/assets/esri/core/workers/chunks/4e2baa60c5d5197b2271.js +0 -1
  170. package/assets/esri/core/workers/chunks/519c0b51b1ba42fb71d7.js +0 -1
  171. package/assets/esri/core/workers/chunks/57fa3c0e7892c2eef3ee.js +0 -261
  172. package/assets/esri/core/workers/chunks/68b615bbd27fadcfcb66.js +0 -1
  173. package/assets/esri/core/workers/chunks/69d740ab18510156f5d6.js +0 -1
  174. package/assets/esri/core/workers/chunks/8d21f3d6edbcd7b335d0.js +0 -1
  175. package/assets/esri/core/workers/chunks/9a97f6cda2f36941efae.js +0 -1
  176. package/assets/esri/core/workers/chunks/9ceeae787dc7c194d60e.js +0 -1
  177. package/assets/esri/core/workers/chunks/a90f7b1c6c69b6033b4c.js +0 -1
  178. package/assets/esri/core/workers/chunks/b32bdf5730953c2fb16b.js +0 -1
  179. package/assets/esri/core/workers/chunks/b5d23efa584c74955d5b.js +0 -1
  180. package/assets/esri/core/workers/chunks/b83f2bbd634f57a5e8f9.js +0 -1
  181. package/assets/esri/core/workers/chunks/bb8e9b8343b83dd1ba3c.js +0 -1
  182. package/assets/esri/core/workers/chunks/bef1990159c0e49e7d27.js +0 -1
  183. package/assets/esri/core/workers/chunks/bf287f0e2ecb4532dc00.js +0 -1
  184. package/assets/esri/core/workers/chunks/c5e36544b2d1792e4c5f.js +0 -1
  185. package/assets/esri/core/workers/chunks/cba3316910ff088f4d77.js +0 -1
  186. package/assets/esri/core/workers/chunks/de9573871f64c01e9f01.js +0 -1
  187. package/assets/esri/core/workers/chunks/e232459f0b00110e07ac.js +0 -1
  188. package/assets/esri/core/workers/chunks/ee6bb6cd16f99421c76b.js +0 -1
  189. package/assets/esri/core/workers/chunks/fd2ba6f76645ba503cbb.js +0 -1
  190. package/views/3d/analysis/Viewshed/ViewshedTool2.js +0 -2
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- var r,e=(r="undefined"!=typeof document?document.currentScript?.src:void 0,function(e={}){var t,n,o=e,a=new Promise((r,e)=>{t=r,n=e}),i="object"==typeof window,s="undefined"!=typeof WorkerGlobalScope;"object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node&&process.type;var l,d,u=Object.assign({},o),c="./this.program",f="";function h(r){return o.locateFile?o.locateFile(r,f):f+r}(i||s)&&(s?f=self.location.href:"undefined"!=typeof document&&document.currentScript&&(f=document.currentScript.src),r&&(f=r),f=f.startsWith("blob:")?"":f.substr(0,f.replace(/[?#].*/,"").lastIndexOf("/")+1),s&&(d=r=>{var e=new XMLHttpRequest;return e.open("GET",r,!1),e.responseType="arraybuffer",e.send(null),new Uint8Array(e.response)}),l=async r=>{var e=await fetch(r,{credentials:"same-origin"});if(e.ok)return e.arrayBuffer();throw new Error(e.status+" : "+e.url)});var m=o.print||console.log.bind(console),p=o.printErr||console.error.bind(console);Object.assign(o,u),u=null,o.arguments&&o.arguments,o.thisProgram&&(c=o.thisProgram);var v,w,g,y,E,b,k,_,A,P=o.wasmBinary,$=!1;function D(){var r=v.buffer;o.HEAP8=w=new Int8Array(r),o.HEAP16=y=new Int16Array(r),o.HEAPU8=g=new Uint8Array(r),o.HEAPU16=E=new Uint16Array(r),o.HEAP32=b=new Int32Array(r),o.HEAPU32=k=new Uint32Array(r),o.HEAPF32=_=new Float32Array(r),o.HEAPF64=A=new Float64Array(r)}var F=[],S=[],C=[];function T(){if(o.preRun)for("function"==typeof o.preRun&&(o.preRun=[o.preRun]);o.preRun.length;)x(o.preRun.shift());rr(F)}function M(){o.noFSInit||ct.initialized||ct.init(),ct.ignorePermissions=!1,rr(S)}function j(){if(o.postRun)for("function"==typeof o.postRun&&(o.postRun=[o.postRun]);o.postRun.length;)N(o.postRun.shift());rr(C)}function x(r){F.unshift(r)}function R(r){S.unshift(r)}function N(r){C.unshift(r)}var z=0,O=null;function B(r){z++,o.monitorRunDependencies?.(z)}function U(r){if(z--,o.monitorRunDependencies?.(z),0==z&&O){var e=O;O=null,e()}}function W(r){o.onAbort?.(r),p(r="Aborted("+r+")"),$=!0,r+=". Build with -sASSERTIONS for more info.";var e=new WebAssembly.RuntimeError(r);throw n(e),e}var L,H,I,V="data:application/octet-stream;base64,",q=r=>r.startsWith(V);function X(){var r="dxt_encoder.wasm";return q(r)?r:h(r)}function G(r){if(r==L&&P)return new Uint8Array(P);if(d)return d(r);throw"both async and sync fetching of the wasm failed"}async function K(r){if(!P)try{var e=await l(r);return new Uint8Array(e)}catch{}return G(r)}async function J(r,e){try{var t=await K(r);return await WebAssembly.instantiate(t,e)}catch(n){p(`failed to asynchronously prepare wasm: ${n}`),W(n)}}async function Q(r,e,t){if(!r&&"function"==typeof WebAssembly.instantiateStreaming&&!q(e)&&"function"==typeof fetch)try{var n=fetch(e,{credentials:"same-origin"});return await WebAssembly.instantiateStreaming(n,t)}catch(o){p(`wasm streaming compile failed: ${o}`),p("falling back to ArrayBuffer instantiation")}return J(e,t)}function Y(){return{a:bt}}async function Z(){function r(r,e){return Et=r.exports,v=Et.G,D(),Rr=Et.J,R(Et.H),U(),Et}function e(e){r(e.instance)}B();var t=Y();if(o.instantiateWasm)try{return o.instantiateWasm(t,r)}catch(i){p(`Module.instantiateWasm callback failed with error: ${i}`),n(i)}L??=X();try{var a=await Q(P,L,t);return e(a),a}catch(i){return void n(i)}}var rr=r=>{for(;r.length>0;)r.shift()(o)};o.noExitRuntime;class er{constructor(r){this.excPtr=r,this.ptr=r-24}set_type(r){k[this.ptr+4>>2]=r}get_type(){return k[this.ptr+4>>2]}set_destructor(r){k[this.ptr+8>>2]=r}get_destructor(){return k[this.ptr+8>>2]}set_caught(r){r=r?1:0,w[this.ptr+12]=r}get_caught(){return 0!=w[this.ptr+12]}set_rethrown(r){r=r?1:0,w[this.ptr+13]=r}get_rethrown(){return 0!=w[this.ptr+13]}init(r,e){this.set_adjusted_ptr(0),this.set_type(r),this.set_destructor(e)}set_adjusted_ptr(r){k[this.ptr+16>>2]=r}get_adjusted_ptr(){return k[this.ptr+16>>2]}}var tr,nr,or,ar=(r,e,t)=>{throw new er(r).init(e,t),r},ir=()=>W(""),sr=(r,e,t,n,o)=>{},lr=()=>{for(var r=new Array(256),e=0;e<256;++e)r[e]=String.fromCharCode(e);tr=r},dr=r=>{for(var e="",t=r;g[t];)e+=tr[g[t++]];return e},ur={},cr={},fr={},hr=r=>{throw new nr(r)},mr=r=>{throw new or(r)},pr=(r,e,t)=>{function n(e){var n=t(e);n.length!==r.length&&mr("Mismatched type converter count");for(var o=0;o<r.length;++o)wr(r[o],n[o])}r.forEach(r=>fr[r]=e);var o=new Array(e.length),a=[],i=0;e.forEach((r,e)=>{cr.hasOwnProperty(r)?o[e]=cr[r]:(a.push(r),ur.hasOwnProperty(r)||(ur[r]=[]),ur[r].push(()=>{o[e]=cr[r],++i===a.length&&n(o)}))}),0===a.length&&n(o)};function vr(r,e,t={}){var n=e.name;if(r||hr(`type "${n}" must have a positive integer typeid pointer`),cr.hasOwnProperty(r)){if(t.ignoreDuplicateRegistrations)return;hr(`Cannot register type '${n}' twice`)}if(cr[r]=e,delete fr[r],ur.hasOwnProperty(r)){var o=ur[r];delete ur[r],o.forEach(r=>r())}}function wr(r,e,t={}){return vr(r,e,t)}var gr=8,yr=(r,e,t,n)=>{wr(r,{name:e=dr(e),fromWireType:function(r){return!!r},toWireType:function(r,e){return e?t:n},argPackAdvance:gr,readValueFromPointer:function(r){return this.fromWireType(g[r])},destructorFunction:null})},Er=[],br=[],kr=r=>{r>9&&0===--br[r+1]&&(br[r]=void 0,Er.push(r))},_r=()=>br.length/2-5-Er.length,Ar=()=>{br.push(0,1,void 0,1,null,1,!0,1,!1,1),o.count_emval_handles=_r},Pr={toValue:r=>(r||hr("Cannot use deleted val. handle = "+r),br[r]),toHandle:r=>{switch(r){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:{const e=Er.pop()||br.length;return br[e]=r,br[e+1]=1,e}}}};function $r(r){return this.fromWireType(k[r>>2])}var Dr={name:"emscripten::val",fromWireType:r=>{var e=Pr.toValue(r);return kr(r),e},toWireType:(r,e)=>Pr.toHandle(e),argPackAdvance:gr,readValueFromPointer:$r,destructorFunction:null},Fr=r=>wr(r,Dr),Sr=(r,e)=>{switch(e){case 4:return function(r){return this.fromWireType(_[r>>2])};case 8:return function(r){return this.fromWireType(A[r>>3])};default:throw new TypeError(`invalid float width (${e}): ${r}`)}},Cr=(r,e,t)=>{wr(r,{name:e=dr(e),fromWireType:r=>r,toWireType:(r,e)=>e,argPackAdvance:gr,readValueFromPointer:Sr(e,t),destructorFunction:null})},Tr=(r,e)=>Object.defineProperty(e,"name",{value:r}),Mr=r=>{for(;r.length;){var e=r.pop();r.pop()(e)}};function jr(r){for(var e=1;e<r.length;++e)if(null!==r[e]&&void 0===r[e].destructorFunction)return!0;return!1}function xr(r,e,t,n,o,a){var i=e.length;i<2&&hr("argTypes array size mismatch! Must at least get return value and 'this' types!"),e[1];var s=jr(e),l="void"!==e[0].name,d=i-2,u=new Array(d),c=[],f=[];return Tr(r,function(...r){var t;f.length=0,c.length=1,c[0]=o;for(var a=0;a<d;++a)u[a]=e[a+2].toWireType(f,r[a]),c.push(u[a]);function i(r){if(s)Mr(f);else for(var n=2;n<e.length;n++){var o=1===n?t:u[n-2];null!==e[n].destructorFunction&&e[n].destructorFunction(o)}if(l)return e[0].fromWireType(r)}return i(n(...c))})}var Rr,Nr,zr=(r,e,t)=>{if(void 0===r[e].overloadTable){var n=r[e];r[e]=function(...n){return r[e].overloadTable.hasOwnProperty(n.length)||hr(`Function '${t}' called with an invalid number of arguments (${n.length}) - expects one of (${r[e].overloadTable})!`),r[e].overloadTable[n.length].apply(this,n)},r[e].overloadTable=[],r[e].overloadTable[n.argCount]=n}},Or=(r,e,t)=>{o.hasOwnProperty(r)?((void 0===t||void 0!==o[r].overloadTable&&void 0!==o[r].overloadTable[t])&&hr(`Cannot register public name '${r}' twice`),zr(o,r,r),o[r].overloadTable.hasOwnProperty(t)&&hr(`Cannot register multiple overloads of a function with the same number of arguments (${t})!`),o[r].overloadTable[t]=e):(o[r]=e,o[r].argCount=t)},Br=(r,e)=>{for(var t=[],n=0;n<r;n++)t.push(k[e+4*n>>2]);return t},Ur=(r,e,t)=>{o.hasOwnProperty(r)||mr("Replacing nonexistent public symbol"),void 0!==o[r].overloadTable&&void 0!==t?o[r].overloadTable[t]=e:(o[r]=e,o[r].argCount=t)},Wr=(r,e,t)=>(r=r.replace(/p/g,"i"),(0,o["dynCall_"+r])(e,...t)),Lr=[],Hr=r=>{var e=Lr[r];return e||(r>=Lr.length&&(Lr.length=r+1),Lr[r]=e=Rr.get(r)),e},Ir=(r,e,t=[])=>r.includes("j")?Wr(r,e,t):Hr(e)(...t),Vr=(r,e)=>(...t)=>Ir(r,e,t),qr=(r,e)=>{function t(){return r.includes("j")?Vr(r,e):Hr(e)}r=dr(r);var n=t();return"function"!=typeof n&&hr(`unknown function pointer with signature ${r}: ${e}`),n},Xr=(r,e)=>{var t=Tr(e,function(r){this.name=e,this.message=r;var t=new Error(r).stack;void 0!==t&&(this.stack=this.toString()+"\n"+t.replace(/^Error(:[^\n]*)?\n/,""))});return t.prototype=Object.create(r.prototype),t.prototype.constructor=t,t.prototype.toString=function(){return void 0===this.message?this.name:`${this.name}: ${this.message}`},t},Gr=r=>{var e=_t(r),t=dr(e);return Pt(e),t},Kr=(r,e)=>{var t=[],n={};function o(r){n[r]||cr[r]||(fr[r]?fr[r].forEach(o):(t.push(r),n[r]=!0))}throw e.forEach(o),new Nr(`${r}: `+t.map(Gr).join([", "]))},Jr=r=>{const e=(r=r.trim()).indexOf("(");return-1!==e?r.substr(0,e):r},Qr=(r,e,t,n,o,a,i,s)=>{var l=Br(e,t);r=dr(r),r=Jr(r),o=qr(n,o),Or(r,function(){Kr(`Cannot call ${r} due to unbound types`,l)},e-1),pr([],l,t=>{var n=[t[0],null].concat(t.slice(1));return Ur(r,xr(r,n,null,o,a),e-1),[]})},Yr=(r,e,t)=>{switch(e){case 1:return t?r=>w[r]:r=>g[r];case 2:return t?r=>y[r>>1]:r=>E[r>>1];case 4:return t?r=>b[r>>2]:r=>k[r>>2];default:throw new TypeError(`invalid integer width (${e}): ${r}`)}},Zr=(r,e,t,n,o)=>{e=dr(e);var a=r=>r;if(0===n){var i=32-8*t;a=r=>r<<i>>>i}var s=e.includes("unsigned"),l=(r,e)=>{};wr(r,{name:e,fromWireType:a,toWireType:s?function(r,e){return l(e,this.name),e>>>0}:function(r,e){return l(e,this.name),e},argPackAdvance:gr,readValueFromPointer:Yr(e,t,0!==n),destructorFunction:null})},re=(r,e,t)=>{var n=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][e];function o(r){var e=k[r>>2],t=k[r+4>>2];return new n(w.buffer,t,e)}wr(r,{name:t=dr(t),fromWireType:o,argPackAdvance:gr,readValueFromPointer:o},{ignoreDuplicateRegistrations:!0})},ee=(r,e,t,n)=>{if(!(n>0))return 0;for(var o=t,a=t+n-1,i=0;i<r.length;++i){var s=r.charCodeAt(i);if(s>=55296&&s<=57343&&(s=65536+((1023&s)<<10)|1023&r.charCodeAt(++i)),s<=127){if(t>=a)break;e[t++]=s}else if(s<=2047){if(t+1>=a)break;e[t++]=192|s>>6,e[t++]=128|63&s}else if(s<=65535){if(t+2>=a)break;e[t++]=224|s>>12,e[t++]=128|s>>6&63,e[t++]=128|63&s}else{if(t+3>=a)break;e[t++]=240|s>>18,e[t++]=128|s>>12&63,e[t++]=128|s>>6&63,e[t++]=128|63&s}}return e[t]=0,t-o},te=(r,e,t)=>ee(r,g,e,t),ne=r=>{for(var e=0,t=0;t<r.length;++t){var n=r.charCodeAt(t);n<=127?e++:n<=2047?e+=2:n>=55296&&n<=57343?(e+=4,++t):e+=3}return e},oe="undefined"!=typeof TextDecoder?new TextDecoder:void 0,ae=(r,e=0,t=NaN)=>{for(var n=e+t,o=e;r[o]&&!(o>=n);)++o;if(o-e>16&&r.buffer&&oe)return oe.decode(r.subarray(e,o));for(var a="";e<o;){var i=r[e++];if(128&i){var s=63&r[e++];if(192!=(224&i)){var l=63&r[e++];if((i=224==(240&i)?(15&i)<<12|s<<6|l:(7&i)<<18|s<<12|l<<6|63&r[e++])<65536)a+=String.fromCharCode(i);else{var d=i-65536;a+=String.fromCharCode(55296|d>>10,56320|1023&d)}}else a+=String.fromCharCode((31&i)<<6|s)}else a+=String.fromCharCode(i)}return a},ie=(r,e)=>r?ae(g,r,e):"",se=(r,e)=>{wr(r,{name:e=dr(e),fromWireType(r){for(var e,t=k[r>>2],n=r+4,o=n,a=0;a<=t;++a){var i=n+a;if(a==t||0==g[i]){var s=ie(o,i-o);void 0===e?e=s:(e+=String.fromCharCode(0),e+=s),o=i+1}}return Pt(r),e},toWireType(r,e){var t;e instanceof ArrayBuffer&&(e=new Uint8Array(e));var n="string"==typeof e;n||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Int8Array||hr("Cannot pass non-string to std::string"),t=n?ne(e):e.length;var o=At(4+t+1),a=o+4;if(k[o>>2]=t,n)te(e,a,t+1);else if(n)for(var i=0;i<t;++i){var s=e.charCodeAt(i);s>255&&(Pt(a),hr("String has UTF-16 code units that do not fit in 8 bits")),g[a+i]=s}else for(i=0;i<t;++i)g[a+i]=e[i];return null!==r&&r.push(Pt,o),o},argPackAdvance:gr,readValueFromPointer:$r,destructorFunction(r){Pt(r)}})},le="undefined"!=typeof TextDecoder?new TextDecoder("utf-16le"):void 0,de=(r,e)=>{for(var t=r,n=t>>1,o=n+e/2;!(n>=o)&&E[n];)++n;if((t=n<<1)-r>32&&le)return le.decode(g.subarray(r,t));for(var a="",i=0;!(i>=e/2);++i){var s=y[r+2*i>>1];if(0==s)break;a+=String.fromCharCode(s)}return a},ue=(r,e,t)=>{if(t??=2147483647,t<2)return 0;for(var n=e,o=(t-=2)<2*r.length?t/2:r.length,a=0;a<o;++a){var i=r.charCodeAt(a);y[e>>1]=i,e+=2}return y[e>>1]=0,e-n},ce=r=>2*r.length,fe=(r,e)=>{for(var t=0,n="";!(t>=e/4);){var o=b[r+4*t>>2];if(0==o)break;if(++t,o>=65536){var a=o-65536;n+=String.fromCharCode(55296|a>>10,56320|1023&a)}else n+=String.fromCharCode(o)}return n},he=(r,e,t)=>{if(t??=2147483647,t<4)return 0;for(var n=e,o=n+t-4,a=0;a<r.length;++a){var i=r.charCodeAt(a);if(i>=55296&&i<=57343&&(i=65536+((1023&i)<<10)|1023&r.charCodeAt(++a)),b[e>>2]=i,(e+=4)+4>o)break}return b[e>>2]=0,e-n},me=r=>{for(var e=0,t=0;t<r.length;++t){var n=r.charCodeAt(t);n>=55296&&n<=57343&&++t,e+=4}return e},pe=(r,e,t)=>{var n,o,a,i;t=dr(t),2===e?(n=de,o=ue,i=ce,a=r=>E[r>>1]):4===e&&(n=fe,o=he,i=me,a=r=>k[r>>2]),wr(r,{name:t,fromWireType:r=>{for(var t,o=k[r>>2],i=r+4,s=0;s<=o;++s){var l=r+4+s*e;if(s==o||0==a(l)){var d=n(i,l-i);void 0===t?t=d:(t+=String.fromCharCode(0),t+=d),i=l+e}}return Pt(r),t},toWireType:(r,n)=>{"string"!=typeof n&&hr(`Cannot pass non-string to C++ string type ${t}`);var a=i(n),s=At(4+a+e);return k[s>>2]=a/e,o(n,s+4,a+e),null!==r&&r.push(Pt,s),s},argPackAdvance:gr,readValueFromPointer:$r,destructorFunction(r){Pt(r)}})},ve=(r,e)=>{wr(r,{isVoid:!0,name:e=dr(e),argPackAdvance:0,fromWireType:()=>{},toWireType:(r,e)=>{}})},we=(r,e,t)=>g.copyWithin(r,e,e+t),ge=(r,e)=>{var t=cr[r];return void 0===t&&hr(`${e} has unknown type ${Gr(r)}`),t},ye=(r,e,t)=>{var n=[],o=r.toWireType(n,t);return n.length&&(k[e>>2]=Pr.toHandle(n)),o},Ee=(r,e,t)=>(r=Pr.toValue(r),e=ge(e,"emval::as"),ye(e,t,r)),be=[],ke=(r,e,t,n)=>(r=be[r])(null,e=Pr.toValue(e),t,n),_e={},Ae=r=>{var e=_e[r];return void 0===e?dr(r):e},Pe=(r,e,t,n,o)=>(r=be[r])(e=Pr.toValue(e),e[t=Ae(t)],n,o),$e=()=>{if("object"==typeof globalThis)return globalThis;function r(r){r.$$$embind_global$$$=r;var e="object"==typeof $$$embind_global$$$&&r.$$$embind_global$$$==r;return e||delete r.$$$embind_global$$$,e}if("object"==typeof $$$embind_global$$$)return $$$embind_global$$$;if("object"==typeof global&&r(global)?$$$embind_global$$$=global:"object"==typeof self&&r(self)&&($$$embind_global$$$=self),"object"==typeof $$$embind_global$$$)return $$$embind_global$$$;throw Error("unable to get global object.")},De=r=>0===r?Pr.toHandle($e()):(r=Ae(r),Pr.toHandle($e()[r])),Fe=r=>{var e=be.length;return be.push(r),e},Se=(r,e)=>{for(var t=new Array(r),n=0;n<r;++n)t[n]=ge(k[e+4*n>>2],"parameter "+n);return t},Ce=Reflect.construct,Te=(r,e,t)=>{var n=Se(r,e),o=n.shift();r--;var a=new Array(r),i=(e,i,s,l)=>{for(var d=0,u=0;u<r;++u)a[u]=n[u].readValueFromPointer(l+d),d+=n[u].argPackAdvance;var c=1===t?Ce(i,a):i.apply(e,a);return ye(o,s,c)},s=`methodCaller<(${n.map(r=>r.name).join(", ")}) => ${o.name}>`;return Fe(Tr(s,i))},Me=r=>(r=Ae(r),Pr.toHandle(o[r])),je=(r,e)=>(r=Pr.toValue(r),e=Pr.toValue(e),Pr.toHandle(r[e])),xe=r=>{r>9&&(br[r+1]+=1)},Re=r=>Pr.toHandle(Ae(r)),Ne=r=>{var e=Pr.toValue(r);Mr(e),kr(r)},ze=(r,e,t,n)=>{var o=(new Date).getFullYear(),a=new Date(o,0,1),i=new Date(o,6,1),s=a.getTimezoneOffset(),l=i.getTimezoneOffset(),d=Math.max(s,l);k[r>>2]=60*d,b[e>>2]=Number(s!=l);var u=r=>{var e=r>=0?"-":"+",t=Math.abs(r);return`UTC${e}${String(Math.floor(t/60)).padStart(2,"0")}${String(t%60).padStart(2,"0")}`},c=u(s),f=u(l);l<s?(te(c,t,17),te(f,n,17)):(te(c,n,17),te(f,t,17))},Oe=()=>2147483648,Be=(r,e)=>Math.ceil(r/e)*e,Ue=r=>{var e=(r-v.buffer.byteLength+65535)/65536|0;try{return v.grow(e),D(),1}catch(t){}},We=r=>{var e=g.length;r>>>=0;var t=Oe();if(r>t)return!1;for(var n=1;n<=4;n*=2){var o=e*(1+.2/n);o=Math.min(o,r+100663296);var a=Math.min(t,Be(Math.max(r,o),65536));if(Ue(a))return!0}return!1},Le={},He=()=>c||"./this.program",Ie=()=>{if(!Ie.strings){var r={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:He()};for(var e in Le)void 0===Le[e]?delete r[e]:r[e]=Le[e];var t=[];for(var e in r)t.push(`${e}=${r[e]}`);Ie.strings=t}return Ie.strings},Ve=(r,e)=>{for(var t=0;t<r.length;++t)w[e++]=r.charCodeAt(t);w[e]=0},qe=(r,e)=>{var t=0;return Ie().forEach((n,o)=>{var a=e+t;k[r+4*o>>2]=a,Ve(n,a),t+=n.length+1}),0},Xe=(r,e)=>{var t=Ie();k[r>>2]=t.length;var n=0;return t.forEach(r=>n+=r.length+1),k[e>>2]=n,0},Ge={isAbs:r=>"/"===r.charAt(0),splitPath:r=>/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(r).slice(1),normalizeArray:(r,e)=>{for(var t=0,n=r.length-1;n>=0;n--){var o=r[n];"."===o?r.splice(n,1):".."===o?(r.splice(n,1),t++):t&&(r.splice(n,1),t--)}if(e)for(;t;t--)r.unshift("..");return r},normalize:r=>{var e=Ge.isAbs(r),t="/"===r.substr(-1);return(r=Ge.normalizeArray(r.split("/").filter(r=>!!r),!e).join("/"))||e||(r="."),r&&t&&(r+="/"),(e?"/":"")+r},dirname:r=>{var e=Ge.splitPath(r),t=e[0],n=e[1];return t||n?(n&&(n=n.substr(0,n.length-1)),t+n):"."},basename:r=>{if("/"===r)return"/";var e=(r=(r=Ge.normalize(r)).replace(/\/$/,"")).lastIndexOf("/");return-1===e?r:r.substr(e+1)},join:(...r)=>Ge.normalize(r.join("/")),join2:(r,e)=>Ge.normalize(r+"/"+e)},Ke=()=>{if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues)return r=>crypto.getRandomValues(r);W("initRandomDevice")},Je=r=>(Je=Ke())(r),Qe={resolve:(...r)=>{for(var e="",t=!1,n=r.length-1;n>=-1&&!t;n--){var o=n>=0?r[n]:ct.cwd();if("string"!=typeof o)throw new TypeError("Arguments to path.resolve must be strings");if(!o)return"";e=o+"/"+e,t=Ge.isAbs(o)}return(t?"/":"")+(e=Ge.normalizeArray(e.split("/").filter(r=>!!r),!t).join("/"))||"."},relative:(r,e)=>{function t(r){for(var e=0;e<r.length&&""===r[e];e++);for(var t=r.length-1;t>=0&&""===r[t];t--);return e>t?[]:r.slice(e,t-e+1)}r=Qe.resolve(r).substr(1),e=Qe.resolve(e).substr(1);for(var n=t(r.split("/")),o=t(e.split("/")),a=Math.min(n.length,o.length),i=a,s=0;s<a;s++)if(n[s]!==o[s]){i=s;break}var l=[];for(s=i;s<n.length;s++)l.push("..");return(l=l.concat(o.slice(i))).join("/")}},Ye=[];function Ze(r,e,t){var n=ne(r)+1,o=new Array(n),a=ee(r,o,0,o.length);return o.length=a,o}var rt=()=>{if(!Ye.length){var r=null;if("undefined"!=typeof window&&"function"==typeof window.prompt&&null!==(r=window.prompt("Input: "))&&(r+="\n"),!r)return null;Ye=Ze(r)}return Ye.shift()},et={ttys:[],init(){},shutdown(){},register(r,e){et.ttys[r]={input:[],output:[],ops:e},ct.registerDevice(r,et.stream_ops)},stream_ops:{open(r){var e=et.ttys[r.node.rdev];if(!e)throw new ct.ErrnoError(43);r.tty=e,r.seekable=!1},close(r){r.tty.ops.fsync(r.tty)},fsync(r){r.tty.ops.fsync(r.tty)},read(r,e,t,n,o){if(!r.tty||!r.tty.ops.get_char)throw new ct.ErrnoError(60);for(var a=0,i=0;i<n;i++){var s;try{s=r.tty.ops.get_char(r.tty)}catch(l){throw new ct.ErrnoError(29)}if(void 0===s&&0===a)throw new ct.ErrnoError(6);if(null==s)break;a++,e[t+i]=s}return a&&(r.node.atime=Date.now()),a},write(r,e,t,n,o){if(!r.tty||!r.tty.ops.put_char)throw new ct.ErrnoError(60);try{for(var a=0;a<n;a++)r.tty.ops.put_char(r.tty,e[t+a])}catch(i){throw new ct.ErrnoError(29)}return n&&(r.node.mtime=r.node.ctime=Date.now()),a}},default_tty_ops:{get_char:r=>rt(),put_char(r,e){null===e||10===e?(m(ae(r.output)),r.output=[]):0!=e&&r.output.push(e)},fsync(r){r.output&&r.output.length>0&&(m(ae(r.output)),r.output=[])},ioctl_tcgets:r=>({c_iflag:25856,c_oflag:5,c_cflag:191,c_lflag:35387,c_cc:[3,28,127,21,4,0,1,0,17,19,26,0,18,15,23,22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}),ioctl_tcsets:(r,e,t)=>0,ioctl_tiocgwinsz:r=>[24,80]},default_tty1_ops:{put_char(r,e){null===e||10===e?(p(ae(r.output)),r.output=[]):0!=e&&r.output.push(e)},fsync(r){r.output&&r.output.length>0&&(p(ae(r.output)),r.output=[])}}},tt=r=>{W()},nt={ops_table:null,mount:r=>nt.createNode(null,"/",16895,0),createNode(r,e,t,n){if(ct.isBlkdev(t)||ct.isFIFO(t))throw new ct.ErrnoError(63);nt.ops_table||={dir:{node:{getattr:nt.node_ops.getattr,setattr:nt.node_ops.setattr,lookup:nt.node_ops.lookup,mknod:nt.node_ops.mknod,rename:nt.node_ops.rename,unlink:nt.node_ops.unlink,rmdir:nt.node_ops.rmdir,readdir:nt.node_ops.readdir,symlink:nt.node_ops.symlink},stream:{llseek:nt.stream_ops.llseek}},file:{node:{getattr:nt.node_ops.getattr,setattr:nt.node_ops.setattr},stream:{llseek:nt.stream_ops.llseek,read:nt.stream_ops.read,write:nt.stream_ops.write,allocate:nt.stream_ops.allocate,mmap:nt.stream_ops.mmap,msync:nt.stream_ops.msync}},link:{node:{getattr:nt.node_ops.getattr,setattr:nt.node_ops.setattr,readlink:nt.node_ops.readlink},stream:{}},chrdev:{node:{getattr:nt.node_ops.getattr,setattr:nt.node_ops.setattr},stream:ct.chrdev_stream_ops}};var o=ct.createNode(r,e,t,n);return ct.isDir(o.mode)?(o.node_ops=nt.ops_table.dir.node,o.stream_ops=nt.ops_table.dir.stream,o.contents={}):ct.isFile(o.mode)?(o.node_ops=nt.ops_table.file.node,o.stream_ops=nt.ops_table.file.stream,o.usedBytes=0,o.contents=null):ct.isLink(o.mode)?(o.node_ops=nt.ops_table.link.node,o.stream_ops=nt.ops_table.link.stream):ct.isChrdev(o.mode)&&(o.node_ops=nt.ops_table.chrdev.node,o.stream_ops=nt.ops_table.chrdev.stream),o.atime=o.mtime=o.ctime=Date.now(),r&&(r.contents[e]=o,r.atime=r.mtime=r.ctime=o.atime),o},getFileDataAsTypedArray:r=>r.contents?r.contents.subarray?r.contents.subarray(0,r.usedBytes):new Uint8Array(r.contents):new Uint8Array(0),expandFileStorage(r,e){var t=r.contents?r.contents.length:0;if(!(t>=e)){var n=1048576;e=Math.max(e,t*(t<n?2:1.125)>>>0),0!=t&&(e=Math.max(e,256));var o=r.contents;r.contents=new Uint8Array(e),r.usedBytes>0&&r.contents.set(o.subarray(0,r.usedBytes),0)}},resizeFileStorage(r,e){if(r.usedBytes!=e)if(0==e)r.contents=null,r.usedBytes=0;else{var t=r.contents;r.contents=new Uint8Array(e),t&&r.contents.set(t.subarray(0,Math.min(e,r.usedBytes))),r.usedBytes=e}},node_ops:{getattr(r){var e={};return e.dev=ct.isChrdev(r.mode)?r.id:1,e.ino=r.id,e.mode=r.mode,e.nlink=1,e.uid=0,e.gid=0,e.rdev=r.rdev,ct.isDir(r.mode)?e.size=4096:ct.isFile(r.mode)?e.size=r.usedBytes:ct.isLink(r.mode)?e.size=r.link.length:e.size=0,e.atime=new Date(r.atime),e.mtime=new Date(r.mtime),e.ctime=new Date(r.ctime),e.blksize=4096,e.blocks=Math.ceil(e.size/e.blksize),e},setattr(r,e){for(const t of["mode","atime","mtime","ctime"])e[t]&&(r[t]=e[t]);void 0!==e.size&&nt.resizeFileStorage(r,e.size)},lookup(r,e){throw nt.doesNotExistError},mknod:(r,e,t,n)=>nt.createNode(r,e,t,n),rename(r,e,t){var n;try{n=ct.lookupNode(e,t)}catch(a){}if(n){if(ct.isDir(r.mode))for(var o in n.contents)throw new ct.ErrnoError(55);ct.hashRemoveNode(n)}delete r.parent.contents[r.name],e.contents[t]=r,r.name=t,e.ctime=e.mtime=r.parent.ctime=r.parent.mtime=Date.now()},unlink(r,e){delete r.contents[e],r.ctime=r.mtime=Date.now()},rmdir(r,e){var t=ct.lookupNode(r,e);for(var n in t.contents)throw new ct.ErrnoError(55);delete r.contents[e],r.ctime=r.mtime=Date.now()},readdir:r=>[".","..",...Object.keys(r.contents)],symlink(r,e,t){var n=nt.createNode(r,e,41471,0);return n.link=t,n},readlink(r){if(!ct.isLink(r.mode))throw new ct.ErrnoError(28);return r.link}},stream_ops:{read(r,e,t,n,o){var a=r.node.contents;if(o>=r.node.usedBytes)return 0;var i=Math.min(r.node.usedBytes-o,n);if(i>8&&a.subarray)e.set(a.subarray(o,o+i),t);else for(var s=0;s<i;s++)e[t+s]=a[o+s];return i},write(r,e,t,n,o,a){if(e.buffer===w.buffer&&(a=!1),!n)return 0;var i=r.node;if(i.mtime=i.ctime=Date.now(),e.subarray&&(!i.contents||i.contents.subarray)){if(a)return i.contents=e.subarray(t,t+n),i.usedBytes=n,n;if(0===i.usedBytes&&0===o)return i.contents=e.slice(t,t+n),i.usedBytes=n,n;if(o+n<=i.usedBytes)return i.contents.set(e.subarray(t,t+n),o),n}if(nt.expandFileStorage(i,o+n),i.contents.subarray&&e.subarray)i.contents.set(e.subarray(t,t+n),o);else for(var s=0;s<n;s++)i.contents[o+s]=e[t+s];return i.usedBytes=Math.max(i.usedBytes,o+n),n},llseek(r,e,t){var n=e;if(1===t?n+=r.position:2===t&&ct.isFile(r.node.mode)&&(n+=r.node.usedBytes),n<0)throw new ct.ErrnoError(28);return n},allocate(r,e,t){nt.expandFileStorage(r.node,e+t),r.node.usedBytes=Math.max(r.node.usedBytes,e+t)},mmap(r,e,t,n,o){if(!ct.isFile(r.node.mode))throw new ct.ErrnoError(43);var a,i,s=r.node.contents;if(2&o||!s||s.buffer!==w.buffer){if(i=!0,!(a=tt()))throw new ct.ErrnoError(48);s&&((t>0||t+e<s.length)&&(s=s.subarray?s.subarray(t,t+e):Array.prototype.slice.call(s,t,t+e)),w.set(s,a))}else i=!1,a=s.byteOffset;return{ptr:a,allocated:i}},msync:(r,e,t,n,o)=>(nt.stream_ops.write(r,e,0,n,t,!1),0)}},ot=async r=>{var e=await l(r);return new Uint8Array(e)},at=(r,e,t,n,o,a)=>{ct.createDataFile(r,e,t,n,o,a)},it=o.preloadPlugins||[],st=(r,e,t,n)=>{"undefined"!=typeof Browser&&Browser.init();var o=!1;return it.forEach(a=>{o||a.canHandle(e)&&(a.handle(r,e,t,n),o=!0)}),o},lt=(r,e,t,n,o,a,i,s,l,d)=>{var u=e?Qe.resolve(Ge.join2(r,e)):r;function c(t){function c(t){d?.(),s||at(r,e,t,n,o,l),a?.(),U()}st(t,u,c,()=>{i?.(),U()})||c(t)}B(),"string"==typeof t?ot(t).then(c,i):c(t)},dt=r=>{var e={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090}[r];if(void 0===e)throw new Error(`Unknown file open mode: ${r}`);return e},ut=(r,e)=>{var t=0;return r&&(t|=365),e&&(t|=146),t},ct={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,ErrnoError:class{name="ErrnoError";constructor(r){this.errno=r}},filesystems:null,syncFSRequests:0,readFiles:{},FSStream:class{shared={};get object(){return this.node}set object(r){this.node=r}get isRead(){return 1!=(2097155&this.flags)}get isWrite(){return!!(2097155&this.flags)}get isAppend(){return 1024&this.flags}get flags(){return this.shared.flags}set flags(r){this.shared.flags=r}get position(){return this.shared.position}set position(r){this.shared.position=r}},FSNode:class{node_ops={};stream_ops={};readMode=365;writeMode=146;mounted=null;constructor(r,e,t,n){r||(r=this),this.parent=r,this.mount=r.mount,this.id=ct.nextInode++,this.name=e,this.mode=t,this.rdev=n,this.atime=this.mtime=this.ctime=Date.now()}get read(){return(this.mode&this.readMode)===this.readMode}set read(r){r?this.mode|=this.readMode:this.mode&=~this.readMode}get write(){return(this.mode&this.writeMode)===this.writeMode}set write(r){r?this.mode|=this.writeMode:this.mode&=~this.writeMode}get isFolder(){return ct.isDir(this.mode)}get isDevice(){return ct.isChrdev(this.mode)}},lookupPath(r,e={}){if(!r)return{path:"",node:null};e.follow_mount??=!0,Ge.isAbs(r)||(r=ct.cwd()+"/"+r);r:for(var t=0;t<40;t++){for(var n=r.split("/").filter(r=>!!r&&"."!==r),o=ct.root,a="/",i=0;i<n.length;i++){var s=i===n.length-1;if(s&&e.parent)break;if(".."!==n[i]){a=Ge.join2(a,n[i]);try{o=ct.lookupNode(o,n[i])}catch(d){if(44===d?.errno&&s&&e.noent_okay)return{path:a};throw d}if(!ct.isMountpoint(o)||s&&!e.follow_mount||(o=o.mounted.root),ct.isLink(o.mode)&&(!s||e.follow)){if(!o.node_ops.readlink)throw new ct.ErrnoError(52);var l=o.node_ops.readlink(o);Ge.isAbs(l)||(l=Ge.dirname(a)+"/"+l),r=l+"/"+n.slice(i+1).join("/");continue r}}else a=Ge.dirname(a),o=o.parent}return{path:a,node:o}}throw new ct.ErrnoError(32)},getPath(r){for(var e;;){if(ct.isRoot(r)){var t=r.mount.mountpoint;return e?"/"!==t[t.length-1]?`${t}/${e}`:t+e:t}e=e?`${r.name}/${e}`:r.name,r=r.parent}},hashName(r,e){for(var t=0,n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n)|0;return(r+t>>>0)%ct.nameTable.length},hashAddNode(r){var e=ct.hashName(r.parent.id,r.name);r.name_next=ct.nameTable[e],ct.nameTable[e]=r},hashRemoveNode(r){var e=ct.hashName(r.parent.id,r.name);if(ct.nameTable[e]===r)ct.nameTable[e]=r.name_next;else for(var t=ct.nameTable[e];t;){if(t.name_next===r){t.name_next=r.name_next;break}t=t.name_next}},lookupNode(r,e){var t=ct.mayLookup(r);if(t)throw new ct.ErrnoError(t);for(var n=ct.hashName(r.id,e),o=ct.nameTable[n];o;o=o.name_next){var a=o.name;if(o.parent.id===r.id&&a===e)return o}return ct.lookup(r,e)},createNode(r,e,t,n){var o=new ct.FSNode(r,e,t,n);return ct.hashAddNode(o),o},destroyNode(r){ct.hashRemoveNode(r)},isRoot:r=>r===r.parent,isMountpoint:r=>!!r.mounted,isFile:r=>32768==(61440&r),isDir:r=>16384==(61440&r),isLink:r=>40960==(61440&r),isChrdev:r=>8192==(61440&r),isBlkdev:r=>24576==(61440&r),isFIFO:r=>4096==(61440&r),isSocket:r=>!(49152&~r),flagsToPermissionString(r){var e=["r","w","rw"][3&r];return 512&r&&(e+="w"),e},nodePermissions:(r,e)=>ct.ignorePermissions||(!e.includes("r")||292&r.mode)&&(!e.includes("w")||146&r.mode)&&(!e.includes("x")||73&r.mode)?0:2,mayLookup(r){if(!ct.isDir(r.mode))return 54;var e=ct.nodePermissions(r,"x");return e||(r.node_ops.lookup?0:2)},mayCreate(r,e){if(!ct.isDir(r.mode))return 54;try{return ct.lookupNode(r,e),20}catch(t){}return ct.nodePermissions(r,"wx")},mayDelete(r,e,t){var n;try{n=ct.lookupNode(r,e)}catch(a){return a.errno}var o=ct.nodePermissions(r,"wx");if(o)return o;if(t){if(!ct.isDir(n.mode))return 54;if(ct.isRoot(n)||ct.getPath(n)===ct.cwd())return 10}else if(ct.isDir(n.mode))return 31;return 0},mayOpen:(r,e)=>r?ct.isLink(r.mode)?32:ct.isDir(r.mode)&&("r"!==ct.flagsToPermissionString(e)||512&e)?31:ct.nodePermissions(r,ct.flagsToPermissionString(e)):44,MAX_OPEN_FDS:4096,nextfd(){for(var r=0;r<=ct.MAX_OPEN_FDS;r++)if(!ct.streams[r])return r;throw new ct.ErrnoError(33)},getStreamChecked(r){var e=ct.getStream(r);if(!e)throw new ct.ErrnoError(8);return e},getStream:r=>ct.streams[r],createStream:(r,e=-1)=>(r=Object.assign(new ct.FSStream,r),-1==e&&(e=ct.nextfd()),r.fd=e,ct.streams[e]=r,r),closeStream(r){ct.streams[r]=null},dupStream(r,e=-1){var t=ct.createStream(r,e);return t.stream_ops?.dup?.(t),t},chrdev_stream_ops:{open(r){var e=ct.getDevice(r.node.rdev);r.stream_ops=e.stream_ops,r.stream_ops.open?.(r)},llseek(){throw new ct.ErrnoError(70)}},major:r=>r>>8,minor:r=>255&r,makedev:(r,e)=>r<<8|e,registerDevice(r,e){ct.devices[r]={stream_ops:e}},getDevice:r=>ct.devices[r],getMounts(r){for(var e=[],t=[r];t.length;){var n=t.pop();e.push(n),t.push(...n.mounts)}return e},syncfs(r,e){"function"==typeof r&&(e=r,r=!1),ct.syncFSRequests++,ct.syncFSRequests>1&&p(`warning: ${ct.syncFSRequests} FS.syncfs operations in flight at once, probably just doing extra work`);var t=ct.getMounts(ct.root.mount),n=0;function o(r){return ct.syncFSRequests--,e(r)}function a(r){if(r)return a.errored?void 0:(a.errored=!0,o(r));++n>=t.length&&o(null)}t.forEach(e=>{if(!e.type.syncfs)return a(null);e.type.syncfs(e,r,a)})},mount(r,e,t){var n,o="/"===t,a=!t;if(o&&ct.root)throw new ct.ErrnoError(10);if(!o&&!a){var i=ct.lookupPath(t,{follow_mount:!1});if(t=i.path,n=i.node,ct.isMountpoint(n))throw new ct.ErrnoError(10);if(!ct.isDir(n.mode))throw new ct.ErrnoError(54)}var s={type:r,opts:e,mountpoint:t,mounts:[]},l=r.mount(s);return l.mount=s,s.root=l,o?ct.root=l:n&&(n.mounted=s,n.mount&&n.mount.mounts.push(s)),l},unmount(r){var e=ct.lookupPath(r,{follow_mount:!1});if(!ct.isMountpoint(e.node))throw new ct.ErrnoError(28);var t=e.node,n=t.mounted,o=ct.getMounts(n);Object.keys(ct.nameTable).forEach(r=>{for(var e=ct.nameTable[r];e;){var t=e.name_next;o.includes(e.mount)&&ct.destroyNode(e),e=t}}),t.mounted=null;var a=t.mount.mounts.indexOf(n);t.mount.mounts.splice(a,1)},lookup:(r,e)=>r.node_ops.lookup(r,e),mknod(r,e,t){var n=ct.lookupPath(r,{parent:!0}).node,o=Ge.basename(r);if(!o||"."===o||".."===o)throw new ct.ErrnoError(28);var a=ct.mayCreate(n,o);if(a)throw new ct.ErrnoError(a);if(!n.node_ops.mknod)throw new ct.ErrnoError(63);return n.node_ops.mknod(n,o,e,t)},statfs(r){var e={bsize:4096,frsize:4096,blocks:1e6,bfree:5e5,bavail:5e5,files:ct.nextInode,ffree:ct.nextInode-1,fsid:42,flags:2,namelen:255},t=ct.lookupPath(r,{follow:!0}).node;return t?.node_ops.statfs&&Object.assign(e,t.node_ops.statfs(t.mount.opts.root)),e},create:(r,e=438)=>(e&=4095,e|=32768,ct.mknod(r,e,0)),mkdir:(r,e=511)=>(e&=1023,e|=16384,ct.mknod(r,e,0)),mkdirTree(r,e){for(var t=r.split("/"),n="",o=0;o<t.length;++o)if(t[o]){n+="/"+t[o];try{ct.mkdir(n,e)}catch(a){if(20!=a.errno)throw a}}},mkdev:(r,e,t)=>(void 0===t&&(t=e,e=438),e|=8192,ct.mknod(r,e,t)),symlink(r,e){if(!Qe.resolve(r))throw new ct.ErrnoError(44);var t=ct.lookupPath(e,{parent:!0}).node;if(!t)throw new ct.ErrnoError(44);var n=Ge.basename(e),o=ct.mayCreate(t,n);if(o)throw new ct.ErrnoError(o);if(!t.node_ops.symlink)throw new ct.ErrnoError(63);return t.node_ops.symlink(t,n,r)},rename(r,e){var t,n,o=Ge.dirname(r),a=Ge.dirname(e),i=Ge.basename(r),s=Ge.basename(e);if(t=ct.lookupPath(r,{parent:!0}).node,n=ct.lookupPath(e,{parent:!0}).node,!t||!n)throw new ct.ErrnoError(44);if(t.mount!==n.mount)throw new ct.ErrnoError(75);var l,d=ct.lookupNode(t,i),u=Qe.relative(r,a);if("."!==u.charAt(0))throw new ct.ErrnoError(28);if("."!==(u=Qe.relative(e,o)).charAt(0))throw new ct.ErrnoError(55);try{l=ct.lookupNode(n,s)}catch(h){}if(d!==l){var c=ct.isDir(d.mode),f=ct.mayDelete(t,i,c);if(f)throw new ct.ErrnoError(f);if(f=l?ct.mayDelete(n,s,c):ct.mayCreate(n,s))throw new ct.ErrnoError(f);if(!t.node_ops.rename)throw new ct.ErrnoError(63);if(ct.isMountpoint(d)||l&&ct.isMountpoint(l))throw new ct.ErrnoError(10);if(n!==t&&(f=ct.nodePermissions(t,"w")))throw new ct.ErrnoError(f);ct.hashRemoveNode(d);try{t.node_ops.rename(d,n,s),d.parent=n}catch(h){throw h}finally{ct.hashAddNode(d)}}},rmdir(r){var e=ct.lookupPath(r,{parent:!0}).node,t=Ge.basename(r),n=ct.lookupNode(e,t),o=ct.mayDelete(e,t,!0);if(o)throw new ct.ErrnoError(o);if(!e.node_ops.rmdir)throw new ct.ErrnoError(63);if(ct.isMountpoint(n))throw new ct.ErrnoError(10);e.node_ops.rmdir(e,t),ct.destroyNode(n)},readdir(r){var e=ct.lookupPath(r,{follow:!0}).node;if(!e.node_ops.readdir)throw new ct.ErrnoError(54);return e.node_ops.readdir(e)},unlink(r){var e=ct.lookupPath(r,{parent:!0}).node;if(!e)throw new ct.ErrnoError(44);var t=Ge.basename(r),n=ct.lookupNode(e,t),o=ct.mayDelete(e,t,!1);if(o)throw new ct.ErrnoError(o);if(!e.node_ops.unlink)throw new ct.ErrnoError(63);if(ct.isMountpoint(n))throw new ct.ErrnoError(10);e.node_ops.unlink(e,t),ct.destroyNode(n)},readlink(r){var e=ct.lookupPath(r).node;if(!e)throw new ct.ErrnoError(44);if(!e.node_ops.readlink)throw new ct.ErrnoError(28);return e.node_ops.readlink(e)},stat(r,e){var t=ct.lookupPath(r,{follow:!e}).node;if(!t)throw new ct.ErrnoError(44);if(!t.node_ops.getattr)throw new ct.ErrnoError(63);return t.node_ops.getattr(t)},lstat:r=>ct.stat(r,!0),chmod(r,e,t){var n;if(!(n="string"==typeof r?ct.lookupPath(r,{follow:!t}).node:r).node_ops.setattr)throw new ct.ErrnoError(63);n.node_ops.setattr(n,{mode:4095&e|-4096&n.mode,ctime:Date.now()})},lchmod(r,e){ct.chmod(r,e,!0)},fchmod(r,e){var t=ct.getStreamChecked(r);ct.chmod(t.node,e)},chown(r,e,t,n){var o;if(!(o="string"==typeof r?ct.lookupPath(r,{follow:!n}).node:r).node_ops.setattr)throw new ct.ErrnoError(63);o.node_ops.setattr(o,{timestamp:Date.now()})},lchown(r,e,t){ct.chown(r,e,t,!0)},fchown(r,e,t){var n=ct.getStreamChecked(r);ct.chown(n.node,e,t)},truncate(r,e){if(e<0)throw new ct.ErrnoError(28);var t;if(!(t="string"==typeof r?ct.lookupPath(r,{follow:!0}).node:r).node_ops.setattr)throw new ct.ErrnoError(63);if(ct.isDir(t.mode))throw new ct.ErrnoError(31);if(!ct.isFile(t.mode))throw new ct.ErrnoError(28);var n=ct.nodePermissions(t,"w");if(n)throw new ct.ErrnoError(n);t.node_ops.setattr(t,{size:e,timestamp:Date.now()})},ftruncate(r,e){var t=ct.getStreamChecked(r);if(!(2097155&t.flags))throw new ct.ErrnoError(28);ct.truncate(t.node,e)},utime(r,e,t){var n=ct.lookupPath(r,{follow:!0}).node;n.node_ops.setattr(n,{atime:e,mtime:t})},open(r,e,t=438){if(""===r)throw new ct.ErrnoError(44);var n;if(t=64&(e="string"==typeof e?dt(e):e)?4095&t|32768:0,"object"==typeof r)n=r;else{var a=ct.lookupPath(r,{follow:!(131072&e),noent_okay:!0});n=a.node,r=a.path}var i=!1;if(64&e)if(n){if(128&e)throw new ct.ErrnoError(20)}else n=ct.mknod(r,t,0),i=!0;if(!n)throw new ct.ErrnoError(44);if(ct.isChrdev(n.mode)&&(e&=-513),65536&e&&!ct.isDir(n.mode))throw new ct.ErrnoError(54);if(!i){var s=ct.mayOpen(n,e);if(s)throw new ct.ErrnoError(s)}512&e&&!i&&ct.truncate(n,0),e&=-131713;var l=ct.createStream({node:n,path:ct.getPath(n),flags:e,seekable:!0,position:0,stream_ops:n.stream_ops,ungotten:[],error:!1});return l.stream_ops.open&&l.stream_ops.open(l),!o.logReadFiles||1&e||r in ct.readFiles||(ct.readFiles[r]=1),l},close(r){if(ct.isClosed(r))throw new ct.ErrnoError(8);r.getdents&&(r.getdents=null);try{r.stream_ops.close&&r.stream_ops.close(r)}catch(e){throw e}finally{ct.closeStream(r.fd)}r.fd=null},isClosed:r=>null===r.fd,llseek(r,e,t){if(ct.isClosed(r))throw new ct.ErrnoError(8);if(!r.seekable||!r.stream_ops.llseek)throw new ct.ErrnoError(70);if(0!=t&&1!=t&&2!=t)throw new ct.ErrnoError(28);return r.position=r.stream_ops.llseek(r,e,t),r.ungotten=[],r.position},read(r,e,t,n,o){if(n<0||o<0)throw new ct.ErrnoError(28);if(ct.isClosed(r))throw new ct.ErrnoError(8);if(1==(2097155&r.flags))throw new ct.ErrnoError(8);if(ct.isDir(r.node.mode))throw new ct.ErrnoError(31);if(!r.stream_ops.read)throw new ct.ErrnoError(28);var a=void 0!==o;if(a){if(!r.seekable)throw new ct.ErrnoError(70)}else o=r.position;var i=r.stream_ops.read(r,e,t,n,o);return a||(r.position+=i),i},write(r,e,t,n,o,a){if(n<0||o<0)throw new ct.ErrnoError(28);if(ct.isClosed(r))throw new ct.ErrnoError(8);if(!(2097155&r.flags))throw new ct.ErrnoError(8);if(ct.isDir(r.node.mode))throw new ct.ErrnoError(31);if(!r.stream_ops.write)throw new ct.ErrnoError(28);r.seekable&&1024&r.flags&&ct.llseek(r,0,2);var i=void 0!==o;if(i){if(!r.seekable)throw new ct.ErrnoError(70)}else o=r.position;var s=r.stream_ops.write(r,e,t,n,o,a);return i||(r.position+=s),s},allocate(r,e,t){if(ct.isClosed(r))throw new ct.ErrnoError(8);if(e<0||t<=0)throw new ct.ErrnoError(28);if(!(2097155&r.flags))throw new ct.ErrnoError(8);if(!ct.isFile(r.node.mode)&&!ct.isDir(r.node.mode))throw new ct.ErrnoError(43);if(!r.stream_ops.allocate)throw new ct.ErrnoError(138);r.stream_ops.allocate(r,e,t)},mmap(r,e,t,n,o){if(2&n&&!(2&o)&&2!=(2097155&r.flags))throw new ct.ErrnoError(2);if(1==(2097155&r.flags))throw new ct.ErrnoError(2);if(!r.stream_ops.mmap)throw new ct.ErrnoError(43);if(!e)throw new ct.ErrnoError(28);return r.stream_ops.mmap(r,e,t,n,o)},msync:(r,e,t,n,o)=>r.stream_ops.msync?r.stream_ops.msync(r,e,t,n,o):0,ioctl(r,e,t){if(!r.stream_ops.ioctl)throw new ct.ErrnoError(59);return r.stream_ops.ioctl(r,e,t)},readFile(r,e={}){if(e.flags=e.flags||0,e.encoding=e.encoding||"binary","utf8"!==e.encoding&&"binary"!==e.encoding)throw new Error(`Invalid encoding type "${e.encoding}"`);var t,n=ct.open(r,e.flags),o=ct.stat(r).size,a=new Uint8Array(o);return ct.read(n,a,0,o,0),"utf8"===e.encoding?t=ae(a):"binary"===e.encoding&&(t=a),ct.close(n),t},writeFile(r,e,t={}){t.flags=t.flags||577;var n=ct.open(r,t.flags,t.mode);if("string"==typeof e){var o=new Uint8Array(ne(e)+1),a=ee(e,o,0,o.length);ct.write(n,o,0,a,void 0,t.canOwn)}else{if(!ArrayBuffer.isView(e))throw new Error("Unsupported data type");ct.write(n,e,0,e.byteLength,void 0,t.canOwn)}ct.close(n)},cwd:()=>ct.currentPath,chdir(r){var e=ct.lookupPath(r,{follow:!0});if(null===e.node)throw new ct.ErrnoError(44);if(!ct.isDir(e.node.mode))throw new ct.ErrnoError(54);var t=ct.nodePermissions(e.node,"x");if(t)throw new ct.ErrnoError(t);ct.currentPath=e.path},createDefaultDirectories(){ct.mkdir("/tmp"),ct.mkdir("/home"),ct.mkdir("/home/web_user")},createDefaultDevices(){ct.mkdir("/dev"),ct.registerDevice(ct.makedev(1,3),{read:()=>0,write:(r,e,t,n,o)=>n,llseek:()=>0}),ct.mkdev("/dev/null",ct.makedev(1,3)),et.register(ct.makedev(5,0),et.default_tty_ops),et.register(ct.makedev(6,0),et.default_tty1_ops),ct.mkdev("/dev/tty",ct.makedev(5,0)),ct.mkdev("/dev/tty1",ct.makedev(6,0));var r=new Uint8Array(1024),e=0,t=()=>(0===e&&(e=Je(r).byteLength),r[--e]);ct.createDevice("/dev","random",t),ct.createDevice("/dev","urandom",t),ct.mkdir("/dev/shm"),ct.mkdir("/dev/shm/tmp")},createSpecialDirectories(){ct.mkdir("/proc");var r=ct.mkdir("/proc/self");ct.mkdir("/proc/self/fd"),ct.mount({mount(){var e=ct.createNode(r,"fd",16895,73);return e.stream_ops={llseek:nt.stream_ops.llseek},e.node_ops={lookup(r,e){var t=+e,n=ct.getStreamChecked(t),o={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:()=>n.path},id:t+1};return o.parent=o,o},readdir:()=>Array.from(ct.streams.entries()).filter(([r,e])=>e).map(([r,e])=>r.toString())},e}},{},"/proc/self/fd")},createStandardStreams(r,e,t){r?ct.createDevice("/dev","stdin",r):ct.symlink("/dev/tty","/dev/stdin"),e?ct.createDevice("/dev","stdout",null,e):ct.symlink("/dev/tty","/dev/stdout"),t?ct.createDevice("/dev","stderr",null,t):ct.symlink("/dev/tty1","/dev/stderr"),ct.open("/dev/stdin",0),ct.open("/dev/stdout",1),ct.open("/dev/stderr",1)},staticInit(){ct.nameTable=new Array(4096),ct.mount(nt,{},"/"),ct.createDefaultDirectories(),ct.createDefaultDevices(),ct.createSpecialDirectories(),ct.filesystems={MEMFS:nt}},init(r,e,t){ct.initialized=!0,r??=o.stdin,e??=o.stdout,t??=o.stderr,ct.createStandardStreams(r,e,t)},quit(){ct.initialized=!1;for(var r=0;r<ct.streams.length;r++){var e=ct.streams[r];e&&ct.close(e)}},findObject(r,e){var t=ct.analyzePath(r,e);return t.exists?t.object:null},analyzePath(r,e){try{r=(n=ct.lookupPath(r,{follow:!e})).path}catch(o){}var t={isRoot:!1,exists:!1,error:0,name:null,path:null,object:null,parentExists:!1,parentPath:null,parentObject:null};try{var n=ct.lookupPath(r,{parent:!0});t.parentExists=!0,t.parentPath=n.path,t.parentObject=n.node,t.name=Ge.basename(r),n=ct.lookupPath(r,{follow:!e}),t.exists=!0,t.path=n.path,t.object=n.node,t.name=n.node.name,t.isRoot="/"===n.path}catch(o){t.error=o.errno}return t},createPath(r,e,t,n){r="string"==typeof r?r:ct.getPath(r);for(var o=e.split("/").reverse();o.length;){var a=o.pop();if(a){var i=Ge.join2(r,a);try{ct.mkdir(i)}catch(s){}r=i}}return i},createFile(r,e,t,n,o){var a=Ge.join2("string"==typeof r?r:ct.getPath(r),e),i=ut(n,o);return ct.create(a,i)},createDataFile(r,e,t,n,o,a){var i=e;r&&(r="string"==typeof r?r:ct.getPath(r),i=e?Ge.join2(r,e):r);var s=ut(n,o),l=ct.create(i,s);if(t){if("string"==typeof t){for(var d=new Array(t.length),u=0,c=t.length;u<c;++u)d[u]=t.charCodeAt(u);t=d}ct.chmod(l,146|s);var f=ct.open(l,577);ct.write(f,t,0,t.length,0,a),ct.close(f),ct.chmod(l,s)}},createDevice(r,e,t,n){var o=Ge.join2("string"==typeof r?r:ct.getPath(r),e),a=ut(!!t,!!n);ct.createDevice.major??=64;var i=ct.makedev(ct.createDevice.major++,0);return ct.registerDevice(i,{open(r){r.seekable=!1},close(r){n?.buffer?.length&&n(10)},read(r,e,n,o,a){for(var i=0,s=0;s<o;s++){var l;try{l=t()}catch(d){throw new ct.ErrnoError(29)}if(void 0===l&&0===i)throw new ct.ErrnoError(6);if(null==l)break;i++,e[n+s]=l}return i&&(r.node.atime=Date.now()),i},write(r,e,t,o,a){for(var i=0;i<o;i++)try{n(e[t+i])}catch(s){throw new ct.ErrnoError(29)}return o&&(r.node.mtime=r.node.ctime=Date.now()),i}}),ct.mkdev(o,a,i)},forceLoadFile(r){if(r.isDevice||r.isFolder||r.link||r.contents)return!0;if("undefined"!=typeof XMLHttpRequest)throw new Error("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.");try{r.contents=d(r.url),r.usedBytes=r.contents.length}catch(e){throw new ct.ErrnoError(29)}},createLazyFile(r,e,t,n,o){class a{lengthKnown=!1;chunks=[];get(r){if(!(r>this.length-1||r<0)){var e=r%this.chunkSize,t=r/this.chunkSize|0;return this.getter(t)[e]}}setDataGetter(r){this.getter=r}cacheLength(){var r=new XMLHttpRequest;if(r.open("HEAD",t,!1),r.send(null),!(r.status>=200&&r.status<300||304===r.status))throw new Error("Couldn't load "+t+". Status: "+r.status);var e,n=Number(r.getResponseHeader("Content-length")),o=(e=r.getResponseHeader("Accept-Ranges"))&&"bytes"===e,a=(e=r.getResponseHeader("Content-Encoding"))&&"gzip"===e,i=1048576;o||(i=n);var s=(r,e)=>{if(r>e)throw new Error("invalid range ("+r+", "+e+") or no bytes requested!");if(e>n-1)throw new Error("only "+n+" bytes available! programmer error!");var o=new XMLHttpRequest;if(o.open("GET",t,!1),n!==i&&o.setRequestHeader("Range","bytes="+r+"-"+e),o.responseType="arraybuffer",o.overrideMimeType&&o.overrideMimeType("text/plain; charset=x-user-defined"),o.send(null),!(o.status>=200&&o.status<300||304===o.status))throw new Error("Couldn't load "+t+". Status: "+o.status);return void 0!==o.response?new Uint8Array(o.response||[]):Ze(o.responseText||"")},l=this;l.setDataGetter(r=>{var e=r*i,t=(r+1)*i-1;if(t=Math.min(t,n-1),void 0===l.chunks[r]&&(l.chunks[r]=s(e,t)),void 0===l.chunks[r])throw new Error("doXHR failed!");return l.chunks[r]}),!a&&n||(i=n=1,n=this.getter(0).length,i=n,m("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=n,this._chunkSize=i,this.lengthKnown=!0}get length(){return this.lengthKnown||this.cacheLength(),this._length}get chunkSize(){return this.lengthKnown||this.cacheLength(),this._chunkSize}}if("undefined"!=typeof XMLHttpRequest){if(!s)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var i={isDevice:!1,contents:new a}}else i={isDevice:!1,url:t};var l=ct.createFile(r,e,i,n,o);i.contents?l.contents=i.contents:i.url&&(l.contents=null,l.url=i.url),Object.defineProperties(l,{usedBytes:{get:function(){return this.contents.length}}});var d={};function u(r,e,t,n,o){var a=r.node.contents;if(o>=a.length)return 0;var i=Math.min(a.length-o,n);if(a.slice)for(var s=0;s<i;s++)e[t+s]=a[o+s];else for(s=0;s<i;s++)e[t+s]=a.get(o+s);return i}return Object.keys(l.stream_ops).forEach(r=>{var e=l.stream_ops[r];d[r]=(...r)=>(ct.forceLoadFile(l),e(...r))}),d.read=(r,e,t,n,o)=>(ct.forceLoadFile(l),u(r,e,t,n,o)),d.mmap=(r,e,t,n,o)=>{ct.forceLoadFile(l);var a=tt();if(!a)throw new ct.ErrnoError(48);return u(r,w,a,e,t),{ptr:a,allocated:!0}},l.stream_ops=d,l}},ft={DEFAULT_POLLMASK:5,calculateAt(r,e,t){if(Ge.isAbs(e))return e;var n;if(n=-100===r?ct.cwd():ft.getStreamFromFD(r).path,0==e.length){if(!t)throw new ct.ErrnoError(44);return n}return n+"/"+e},doStat(r,e,t){var n=r(e);b[t>>2]=n.dev,b[t+4>>2]=n.mode,k[t+8>>2]=n.nlink,b[t+12>>2]=n.uid,b[t+16>>2]=n.gid,b[t+20>>2]=n.rdev,I=[n.size>>>0,(H=n.size,+Math.abs(H)>=1?H>0?+Math.floor(H/4294967296)>>>0:~~+Math.ceil((H-+(~~H>>>0))/4294967296)>>>0:0)],b[t+24>>2]=I[0],b[t+28>>2]=I[1],b[t+32>>2]=4096,b[t+36>>2]=n.blocks;var o=n.atime.getTime(),a=n.mtime.getTime(),i=n.ctime.getTime();return I=[Math.floor(o/1e3)>>>0,(H=Math.floor(o/1e3),+Math.abs(H)>=1?H>0?+Math.floor(H/4294967296)>>>0:~~+Math.ceil((H-+(~~H>>>0))/4294967296)>>>0:0)],b[t+40>>2]=I[0],b[t+44>>2]=I[1],k[t+48>>2]=o%1e3*1e3*1e3,I=[Math.floor(a/1e3)>>>0,(H=Math.floor(a/1e3),+Math.abs(H)>=1?H>0?+Math.floor(H/4294967296)>>>0:~~+Math.ceil((H-+(~~H>>>0))/4294967296)>>>0:0)],b[t+56>>2]=I[0],b[t+60>>2]=I[1],k[t+64>>2]=a%1e3*1e3*1e3,I=[Math.floor(i/1e3)>>>0,(H=Math.floor(i/1e3),+Math.abs(H)>=1?H>0?+Math.floor(H/4294967296)>>>0:~~+Math.ceil((H-+(~~H>>>0))/4294967296)>>>0:0)],b[t+72>>2]=I[0],b[t+76>>2]=I[1],k[t+80>>2]=i%1e3*1e3*1e3,I=[n.ino>>>0,(H=n.ino,+Math.abs(H)>=1?H>0?+Math.floor(H/4294967296)>>>0:~~+Math.ceil((H-+(~~H>>>0))/4294967296)>>>0:0)],b[t+88>>2]=I[0],b[t+92>>2]=I[1],0},doMsync(r,e,t,n,o){if(!ct.isFile(e.node.mode))throw new ct.ErrnoError(43);if(2&n)return 0;var a=g.slice(r,r+t);ct.msync(e,a,o,t,n)},getStreamFromFD:r=>ct.getStreamChecked(r),varargs:void 0,getStr:r=>ie(r)};function ht(r){try{var e=ft.getStreamFromFD(r);return ct.close(e),0}catch(t){if(void 0===ct||"ErrnoError"!==t.name)throw t;return t.errno}}var mt=(r,e,t,n)=>{for(var o=0,a=0;a<t;a++){var i=k[e>>2],s=k[e+4>>2];e+=8;var l=ct.read(r,w,i,s,n);if(l<0)return-1;if(o+=l,l<s)break}return o};function pt(r,e,t,n){try{var o=ft.getStreamFromFD(r),a=mt(o,e,t);return k[n>>2]=a,0}catch(i){if(void 0===ct||"ErrnoError"!==i.name)throw i;return i.errno}}var vt=(r,e)=>e+2097152>>>0<4194305-!!r?(r>>>0)+4294967296*e:NaN;function wt(r,e,t,n,o){var a=vt(e,t);try{if(isNaN(a))return 61;var i=ft.getStreamFromFD(r);return ct.llseek(i,a,n),I=[i.position>>>0,(H=i.position,+Math.abs(H)>=1?H>0?+Math.floor(H/4294967296)>>>0:~~+Math.ceil((H-+(~~H>>>0))/4294967296)>>>0:0)],b[o>>2]=I[0],b[o+4>>2]=I[1],i.getdents&&0===a&&0===n&&(i.getdents=null),0}catch(s){if(void 0===ct||"ErrnoError"!==s.name)throw s;return s.errno}}var gt=(r,e,t,n)=>{for(var o=0,a=0;a<t;a++){var i=k[e>>2],s=k[e+4>>2];e+=8;var l=ct.write(r,w,i,s,n);if(l<0)return-1;if(o+=l,l<s)break}return o};function yt(r,e,t,n){try{var o=ft.getStreamFromFD(r),a=gt(o,e,t);return k[n>>2]=a,0}catch(i){if(void 0===ct||"ErrnoError"!==i.name)throw i;return i.errno}}lr(),nr=o.BindingError=class extends Error{constructor(r){super(r),this.name="BindingError"}},or=o.InternalError=class extends Error{constructor(r){super(r),this.name="InternalError"}},Ar(),Nr=o.UnboundTypeError=Xr(Error,"UnboundTypeError"),ct.createPreloadedFile=lt,ct.staticInit(),nt.doesNotExistError=new ct.ErrnoError(44),nt.doesNotExistError.stack="<generic error, no stack>";var Et,bt={q:ar,w:ir,s:sr,D:yr,B:Fr,p:Cr,i:Qr,c:Zr,a:re,C:se,j:pe,E:ve,A:we,n:Ee,l:ke,k:Pe,b:kr,F:De,g:Te,m:Me,e:je,h:xe,f:Re,d:Ne,t:ze,z:We,u:qe,v:Xe,x:ht,y:pt,r:wt,o:yt};Z();var kt,_t=r=>(_t=Et.I)(r),At=r=>(At=Et.K)(r),Pt=r=>(Pt=Et.L)(r);function $t(){function r(){kt||(kt=!0,o.calledRun=!0,$||(M(),t(o),o.onRuntimeInitialized?.(),j()))}z>0||(T(),z>0||(o.setStatus?(o.setStatus("Running..."),setTimeout(()=>{setTimeout(()=>o.setStatus(""),1),r()},1)):r()))}if(o.dynCall_jiji=(r,e,t,n,a)=>(o.dynCall_jiji=Et.M)(r,e,t,n,a),o.dynCall_viijii=(r,e,t,n,a,i,s)=>(o.dynCall_viijii=Et.N)(r,e,t,n,a,i,s),o.dynCall_iiiiij=(r,e,t,n,a,i,s)=>(o.dynCall_iiiiij=Et.O)(r,e,t,n,a,i,s),o.dynCall_iiiiijj=(r,e,t,n,a,i,s,l,d)=>(o.dynCall_iiiiijj=Et.P)(r,e,t,n,a,i,s,l,d),o.dynCall_iiiiiijj=(r,e,t,n,a,i,s,l,d,u)=>(o.dynCall_iiiiiijj=Et.Q)(r,e,t,n,a,i,s,l,d,u),O=function r(){kt||$t(),kt||(O=r)},o.preInit)for("function"==typeof o.preInit&&(o.preInit=[o.preInit]);o.preInit.length>0;)o.preInit.pop()();return $t(),a});export{e as default};
2
+ var r,e=(r="undefined"!=typeof document?document.currentScript?.src:void 0,function(e={}){var t,n,o=e,a=new Promise((r,e)=>{t=r,n=e}),i="object"==typeof window,s="undefined"!=typeof WorkerGlobalScope;"object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node&&process.type;var l,d,u=Object.assign({},o),c="./this.program",f="";function h(r){return o.locateFile?o.locateFile(r,f):f+r}(i||s)&&(s?f=self.location.href:"undefined"!=typeof document&&document.currentScript&&(f=document.currentScript.src),r&&(f=r),f=f.startsWith("blob:")?"":f.substr(0,f.replace(/[?#].*/,"").lastIndexOf("/")+1),s&&(d=r=>{var e=new XMLHttpRequest;return e.open("GET",r,!1),e.responseType="arraybuffer",e.send(null),new Uint8Array(e.response)}),l=async r=>{var e=await fetch(r,{credentials:"same-origin"});if(e.ok)return e.arrayBuffer();throw new Error(e.status+" : "+e.url)});var m=o.print||console.log.bind(console),p=o.printErr||console.error.bind(console);Object.assign(o,u),u=null,o.arguments&&o.arguments,o.thisProgram&&(c=o.thisProgram);var v,w,g,y,E,b,k,_,A,P=o.wasmBinary,$=!1;function D(){var r=v.buffer;o.HEAP8=w=new Int8Array(r),o.HEAP16=y=new Int16Array(r),o.HEAPU8=g=new Uint8Array(r),o.HEAPU16=E=new Uint16Array(r),o.HEAP32=b=new Int32Array(r),o.HEAPU32=k=new Uint32Array(r),o.HEAPF32=_=new Float32Array(r),o.HEAPF64=A=new Float64Array(r)}var F=[],S=[],C=[];function T(){if(o.preRun)for("function"==typeof o.preRun&&(o.preRun=[o.preRun]);o.preRun.length;)x(o.preRun.shift());rr(F)}function M(){o.noFSInit||ct.initialized||ct.init(),ct.ignorePermissions=!1,rr(S)}function j(){if(o.postRun)for("function"==typeof o.postRun&&(o.postRun=[o.postRun]);o.postRun.length;)N(o.postRun.shift());rr(C)}function x(r){F.unshift(r)}function R(r){S.unshift(r)}function N(r){C.unshift(r)}var z=0,O=null;function B(r){z++,o.monitorRunDependencies?.(z)}function U(r){if(z--,o.monitorRunDependencies?.(z),0==z&&O){var e=O;O=null,e()}}function W(r){o.onAbort?.(r),p(r="Aborted("+r+")"),$=!0,r+=". Build with -sASSERTIONS for more info.";var e=new WebAssembly.RuntimeError(r);throw n(e),e}var L,H,I,V="data:application/octet-stream;base64,",q=r=>r.startsWith(V);function X(){var r="dxt_encoder.wasm";return q(r)?r:h(r)}function G(r){if(r==L&&P)return new Uint8Array(P);if(d)return d(r);throw"both async and sync fetching of the wasm failed"}async function K(r){if(!P)try{var e=await l(r);return new Uint8Array(e)}catch{}return G(r)}async function J(r,e){try{var t=await K(r);return await WebAssembly.instantiate(t,e)}catch(n){p(`failed to asynchronously prepare wasm: ${n}`),W(n)}}async function Q(r,e,t){if(!r&&"function"==typeof WebAssembly.instantiateStreaming&&!q(e)&&"function"==typeof fetch)try{var n=fetch(e,{credentials:"same-origin"});return await WebAssembly.instantiateStreaming(n,t)}catch(o){p(`wasm streaming compile failed: ${o}`),p("falling back to ArrayBuffer instantiation")}return J(e,t)}function Y(){return{a:bt}}async function Z(){function r(r,e){return Et=r.exports,v=Et.G,D(),Rr=Et.J,R(Et.H),U(),Et}function e(e){r(e.instance)}B();var t=Y();if(o.instantiateWasm)try{return o.instantiateWasm(t,r)}catch(i){p(`Module.instantiateWasm callback failed with error: ${i}`),n(i)}L??=X();try{var a=await Q(P,L,t);return e(a),a}catch(i){return void n(i)}}var rr=r=>{for(;r.length>0;)r.shift()(o)};o.noExitRuntime;class er{constructor(r){this.excPtr=r,this.ptr=r-24}set_type(r){k[this.ptr+4>>2]=r}get_type(){return k[this.ptr+4>>2]}set_destructor(r){k[this.ptr+8>>2]=r}get_destructor(){return k[this.ptr+8>>2]}set_caught(r){r=r?1:0,w[this.ptr+12]=r}get_caught(){return 0!=w[this.ptr+12]}set_rethrown(r){r=r?1:0,w[this.ptr+13]=r}get_rethrown(){return 0!=w[this.ptr+13]}init(r,e){this.set_adjusted_ptr(0),this.set_type(r),this.set_destructor(e)}set_adjusted_ptr(r){k[this.ptr+16>>2]=r}get_adjusted_ptr(){return k[this.ptr+16>>2]}}var tr,nr,or,ar=(r,e,t)=>{throw new er(r).init(e,t),r},ir=()=>W(""),sr=(r,e,t,n,o)=>{},lr=()=>{for(var r=new Array(256),e=0;e<256;++e)r[e]=String.fromCharCode(e);tr=r},dr=r=>{for(var e="",t=r;g[t];)e+=tr[g[t++]];return e},ur={},cr={},fr={},hr=r=>{throw new nr(r)},mr=r=>{throw new or(r)},pr=(r,e,t)=>{function n(e){var n=t(e);n.length!==r.length&&mr("Mismatched type converter count");for(var o=0;o<r.length;++o)wr(r[o],n[o])}r.forEach(r=>fr[r]=e);var o=new Array(e.length),a=[],i=0;e.forEach((r,e)=>{cr.hasOwnProperty(r)?o[e]=cr[r]:(a.push(r),ur.hasOwnProperty(r)||(ur[r]=[]),ur[r].push(()=>{o[e]=cr[r],++i===a.length&&n(o)}))}),0===a.length&&n(o)};function vr(r,e,t={}){var n=e.name;if(r||hr(`type "${n}" must have a positive integer typeid pointer`),cr.hasOwnProperty(r)){if(t.ignoreDuplicateRegistrations)return;hr(`Cannot register type '${n}' twice`)}if(cr[r]=e,delete fr[r],ur.hasOwnProperty(r)){var o=ur[r];delete ur[r],o.forEach(r=>r())}}function wr(r,e,t={}){return vr(r,e,t)}var gr=8,yr=(r,e,t,n)=>{wr(r,{name:e=dr(e),fromWireType:function(r){return!!r},toWireType:function(r,e){return e?t:n},argPackAdvance:gr,readValueFromPointer:function(r){return this.fromWireType(g[r])},destructorFunction:null})},Er=[],br=[],kr=r=>{r>9&&0===--br[r+1]&&(br[r]=void 0,Er.push(r))},_r=()=>br.length/2-5-Er.length,Ar=()=>{br.push(0,1,void 0,1,null,1,!0,1,!1,1),o.count_emval_handles=_r},Pr={toValue:r=>(r||hr("Cannot use deleted val. handle = "+r),br[r]),toHandle:r=>{switch(r){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:{const e=Er.pop()||br.length;return br[e]=r,br[e+1]=1,e}}}};function $r(r){return this.fromWireType(k[r>>2])}var Dr={name:"emscripten::val",fromWireType:r=>{var e=Pr.toValue(r);return kr(r),e},toWireType:(r,e)=>Pr.toHandle(e),argPackAdvance:gr,readValueFromPointer:$r,destructorFunction:null},Fr=r=>wr(r,Dr),Sr=(r,e)=>{switch(e){case 4:return function(r){return this.fromWireType(_[r>>2])};case 8:return function(r){return this.fromWireType(A[r>>3])};default:throw new TypeError(`invalid float width (${e}): ${r}`)}},Cr=(r,e,t)=>{wr(r,{name:e=dr(e),fromWireType:r=>r,toWireType:(r,e)=>e,argPackAdvance:gr,readValueFromPointer:Sr(e,t),destructorFunction:null})},Tr=(r,e)=>Object.defineProperty(e,"name",{value:r}),Mr=r=>{for(;r.length;){var e=r.pop();r.pop()(e)}};function jr(r){for(var e=1;e<r.length;++e)if(null!==r[e]&&void 0===r[e].destructorFunction)return!0;return!1}function xr(r,e,t,n,o,a){var i=e.length;i<2&&hr("argTypes array size mismatch! Must at least get return value and 'this' types!"),e[1];var s=jr(e),l="void"!==e[0].name,d=i-2,u=new Array(d),c=[],f=[];return Tr(r,function(...r){var t;f.length=0,c.length=1,c[0]=o;for(var a=0;a<d;++a)u[a]=e[a+2].toWireType(f,r[a]),c.push(u[a]);function i(r){if(s)Mr(f);else for(var n=2;n<e.length;n++){var o=1===n?t:u[n-2];null!==e[n].destructorFunction&&e[n].destructorFunction(o)}if(l)return e[0].fromWireType(r)}return i(n(...c))})}var Rr,Nr,zr=(r,e,t)=>{if(void 0===r[e].overloadTable){var n=r[e];r[e]=function(...n){return r[e].overloadTable.hasOwnProperty(n.length)||hr(`Function '${t}' called with an invalid number of arguments (${n.length}) - expects one of (${r[e].overloadTable})!`),r[e].overloadTable[n.length].apply(this,n)},r[e].overloadTable=[],r[e].overloadTable[n.argCount]=n}},Or=(r,e,t)=>{o.hasOwnProperty(r)?((void 0===t||void 0!==o[r].overloadTable&&void 0!==o[r].overloadTable[t])&&hr(`Cannot register public name '${r}' twice`),zr(o,r,r),o[r].overloadTable.hasOwnProperty(t)&&hr(`Cannot register multiple overloads of a function with the same number of arguments (${t})!`),o[r].overloadTable[t]=e):(o[r]=e,o[r].argCount=t)},Br=(r,e)=>{for(var t=[],n=0;n<r;n++)t.push(k[e+4*n>>2]);return t},Ur=(r,e,t)=>{o.hasOwnProperty(r)||mr("Replacing nonexistent public symbol"),void 0!==o[r].overloadTable&&void 0!==t?o[r].overloadTable[t]=e:(o[r]=e,o[r].argCount=t)},Wr=(r,e,t)=>(r=r.replace(/p/g,"i"),(0,o["dynCall_"+r])(e,...t)),Lr=[],Hr=r=>{var e=Lr[r];return e||(r>=Lr.length&&(Lr.length=r+1),Lr[r]=e=Rr.get(r)),e},Ir=(r,e,t=[])=>r.includes("j")?Wr(r,e,t):Hr(e)(...t),Vr=(r,e)=>(...t)=>Ir(r,e,t),qr=(r,e)=>{function t(){return r.includes("j")?Vr(r,e):Hr(e)}r=dr(r);var n=t();return"function"!=typeof n&&hr(`unknown function pointer with signature ${r}: ${e}`),n},Xr=(r,e)=>{var t=Tr(e,function(r){this.name=e,this.message=r;var t=new Error(r).stack;void 0!==t&&(this.stack=this.toString()+"\n"+t.replace(/^Error(:[^\n]*)?\n/,""))});return t.prototype=Object.create(r.prototype),t.prototype.constructor=t,t.prototype.toString=function(){return void 0===this.message?this.name:`${this.name}: ${this.message}`},t},Gr=r=>{var e=_t(r),t=dr(e);return Pt(e),t},Kr=(r,e)=>{var t=[],n={};function o(r){n[r]||cr[r]||(fr[r]?fr[r].forEach(o):(t.push(r),n[r]=!0))}throw e.forEach(o),new Nr(`${r}: `+t.map(Gr).join([", "]))},Jr=r=>{const e=(r=r.trim()).indexOf("(");return-1!==e?r.substr(0,e):r},Qr=(r,e,t,n,o,a,i,s)=>{var l=Br(e,t);r=dr(r),r=Jr(r),o=qr(n,o),Or(r,function(){Kr(`Cannot call ${r} due to unbound types`,l)},e-1),pr([],l,t=>{var n=[t[0],null].concat(t.slice(1));return Ur(r,xr(r,n,null,o,a),e-1),[]})},Yr=(r,e,t)=>{switch(e){case 1:return t?r=>w[r]:r=>g[r];case 2:return t?r=>y[r>>1]:r=>E[r>>1];case 4:return t?r=>b[r>>2]:r=>k[r>>2];default:throw new TypeError(`invalid integer width (${e}): ${r}`)}},Zr=(r,e,t,n,o)=>{e=dr(e);var a=r=>r;if(0===n){var i=32-8*t;a=r=>r<<i>>>i}var s=e.includes("unsigned"),l=(r,e)=>{};wr(r,{name:e,fromWireType:a,toWireType:s?function(r,e){return l(e,this.name),e>>>0}:function(r,e){return l(e,this.name),e},argPackAdvance:gr,readValueFromPointer:Yr(e,t,0!==n),destructorFunction:null})},re=(r,e,t)=>{var n=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][e];function o(r){var e=k[r>>2],t=k[r+4>>2];return new n(w.buffer,t,e)}wr(r,{name:t=dr(t),fromWireType:o,argPackAdvance:gr,readValueFromPointer:o},{ignoreDuplicateRegistrations:!0})},ee=(r,e,t,n)=>{if(!(n>0))return 0;for(var o=t,a=t+n-1,i=0;i<r.length;++i){var s=r.charCodeAt(i);if(s>=55296&&s<=57343&&(s=65536+((1023&s)<<10)|1023&r.charCodeAt(++i)),s<=127){if(t>=a)break;e[t++]=s}else if(s<=2047){if(t+1>=a)break;e[t++]=192|s>>6,e[t++]=128|63&s}else if(s<=65535){if(t+2>=a)break;e[t++]=224|s>>12,e[t++]=128|s>>6&63,e[t++]=128|63&s}else{if(t+3>=a)break;e[t++]=240|s>>18,e[t++]=128|s>>12&63,e[t++]=128|s>>6&63,e[t++]=128|63&s}}return e[t]=0,t-o},te=(r,e,t)=>ee(r,g,e,t),ne=r=>{for(var e=0,t=0;t<r.length;++t){var n=r.charCodeAt(t);n<=127?e++:n<=2047?e+=2:n>=55296&&n<=57343?(e+=4,++t):e+=3}return e},oe="undefined"!=typeof TextDecoder?new TextDecoder:void 0,ae=(r,e=0,t=NaN)=>{for(var n=e+t,o=e;r[o]&&!(o>=n);)++o;if(o-e>16&&r.buffer&&oe)return oe.decode(r.subarray(e,o));for(var a="";e<o;){var i=r[e++];if(128&i){var s=63&r[e++];if(192!=(224&i)){var l=63&r[e++];if((i=224==(240&i)?(15&i)<<12|s<<6|l:(7&i)<<18|s<<12|l<<6|63&r[e++])<65536)a+=String.fromCharCode(i);else{var d=i-65536;a+=String.fromCharCode(55296|d>>10,56320|1023&d)}}else a+=String.fromCharCode((31&i)<<6|s)}else a+=String.fromCharCode(i)}return a},ie=(r,e)=>r?ae(g,r,e):"",se=(r,e)=>{wr(r,{name:e=dr(e),fromWireType(r){for(var e,t=k[r>>2],n=r+4,o=n,a=0;a<=t;++a){var i=n+a;if(a==t||0==g[i]){var s=ie(o,i-o);void 0===e?e=s:(e+=String.fromCharCode(0),e+=s),o=i+1}}return Pt(r),e},toWireType(r,e){var t;e instanceof ArrayBuffer&&(e=new Uint8Array(e));var n="string"==typeof e;n||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Int8Array||hr("Cannot pass non-string to std::string"),t=n?ne(e):e.length;var o=At(4+t+1),a=o+4;if(k[o>>2]=t,n)te(e,a,t+1);else if(n)for(var i=0;i<t;++i){var s=e.charCodeAt(i);s>255&&(Pt(a),hr("String has UTF-16 code units that do not fit in 8 bits")),g[a+i]=s}else for(i=0;i<t;++i)g[a+i]=e[i];return null!==r&&r.push(Pt,o),o},argPackAdvance:gr,readValueFromPointer:$r,destructorFunction(r){Pt(r)}})},le="undefined"!=typeof TextDecoder?new TextDecoder("utf-16le"):void 0,de=(r,e)=>{for(var t=r,n=t>>1,o=n+e/2;!(n>=o)&&E[n];)++n;if((t=n<<1)-r>32&&le)return le.decode(g.subarray(r,t));for(var a="",i=0;!(i>=e/2);++i){var s=y[r+2*i>>1];if(0==s)break;a+=String.fromCharCode(s)}return a},ue=(r,e,t)=>{if(t??=2147483647,t<2)return 0;for(var n=e,o=(t-=2)<2*r.length?t/2:r.length,a=0;a<o;++a){var i=r.charCodeAt(a);y[e>>1]=i,e+=2}return y[e>>1]=0,e-n},ce=r=>2*r.length,fe=(r,e)=>{for(var t=0,n="";!(t>=e/4);){var o=b[r+4*t>>2];if(0==o)break;if(++t,o>=65536){var a=o-65536;n+=String.fromCharCode(55296|a>>10,56320|1023&a)}else n+=String.fromCharCode(o)}return n},he=(r,e,t)=>{if(t??=2147483647,t<4)return 0;for(var n=e,o=n+t-4,a=0;a<r.length;++a){var i=r.charCodeAt(a);if(i>=55296&&i<=57343&&(i=65536+((1023&i)<<10)|1023&r.charCodeAt(++a)),b[e>>2]=i,(e+=4)+4>o)break}return b[e>>2]=0,e-n},me=r=>{for(var e=0,t=0;t<r.length;++t){var n=r.charCodeAt(t);n>=55296&&n<=57343&&++t,e+=4}return e},pe=(r,e,t)=>{var n,o,a,i;t=dr(t),2===e?(n=de,o=ue,i=ce,a=r=>E[r>>1]):4===e&&(n=fe,o=he,i=me,a=r=>k[r>>2]),wr(r,{name:t,fromWireType:r=>{for(var t,o=k[r>>2],i=r+4,s=0;s<=o;++s){var l=r+4+s*e;if(s==o||0==a(l)){var d=n(i,l-i);void 0===t?t=d:(t+=String.fromCharCode(0),t+=d),i=l+e}}return Pt(r),t},toWireType:(r,n)=>{"string"!=typeof n&&hr(`Cannot pass non-string to C++ string type ${t}`);var a=i(n),s=At(4+a+e);return k[s>>2]=a/e,o(n,s+4,a+e),null!==r&&r.push(Pt,s),s},argPackAdvance:gr,readValueFromPointer:$r,destructorFunction(r){Pt(r)}})},ve=(r,e)=>{wr(r,{isVoid:!0,name:e=dr(e),argPackAdvance:0,fromWireType:()=>{},toWireType:(r,e)=>{}})},we=(r,e,t)=>g.copyWithin(r,e,e+t),ge=(r,e)=>{var t=cr[r];return void 0===t&&hr(`${e} has unknown type ${Gr(r)}`),t},ye=(r,e,t)=>{var n=[],o=r.toWireType(n,t);return n.length&&(k[e>>2]=Pr.toHandle(n)),o},Ee=(r,e,t)=>(r=Pr.toValue(r),e=ge(e,"emval::as"),ye(e,t,r)),be=[],ke=(r,e,t,n)=>(r=be[r])(null,e=Pr.toValue(e),t,n),_e={},Ae=r=>{var e=_e[r];return void 0===e?dr(r):e},Pe=(r,e,t,n,o)=>(r=be[r])(e=Pr.toValue(e),e[t=Ae(t)],n,o),$e=()=>{if("object"==typeof globalThis)return globalThis;function r(r){r.$$$embind_global$$$=r;var e="object"==typeof $$$embind_global$$$&&r.$$$embind_global$$$==r;return e||delete r.$$$embind_global$$$,e}if("object"==typeof $$$embind_global$$$)return $$$embind_global$$$;if("object"==typeof global&&r(global)?$$$embind_global$$$=global:"object"==typeof self&&r(self)&&($$$embind_global$$$=self),"object"==typeof $$$embind_global$$$)return $$$embind_global$$$;throw Error("unable to get global object.")},De=r=>0===r?Pr.toHandle($e()):(r=Ae(r),Pr.toHandle($e()[r])),Fe=r=>{var e=be.length;return be.push(r),e},Se=(r,e)=>{for(var t=new Array(r),n=0;n<r;++n)t[n]=ge(k[e+4*n>>2],"parameter "+n);return t},Ce=Reflect.construct,Te=(r,e,t)=>{var n=Se(r,e),o=n.shift();r--;var a=new Array(r),i=(e,i,s,l)=>{for(var d=0,u=0;u<r;++u)a[u]=n[u].readValueFromPointer(l+d),d+=n[u].argPackAdvance;var c=1===t?Ce(i,a):i.apply(e,a);return ye(o,s,c)},s=`methodCaller<(${n.map(r=>r.name).join(", ")}) => ${o.name}>`;return Fe(Tr(s,i))},Me=r=>(r=Ae(r),Pr.toHandle(o[r])),je=(r,e)=>(r=Pr.toValue(r),e=Pr.toValue(e),Pr.toHandle(r[e])),xe=r=>{r>9&&(br[r+1]+=1)},Re=r=>Pr.toHandle(Ae(r)),Ne=r=>{var e=Pr.toValue(r);Mr(e),kr(r)},ze=(r,e,t,n)=>{var o=(new Date).getFullYear(),a=new Date(o,0,1),i=new Date(o,6,1),s=a.getTimezoneOffset(),l=i.getTimezoneOffset(),d=Math.max(s,l);k[r>>2]=60*d,b[e>>2]=Number(s!=l);var u=r=>{var e=r>=0?"-":"+",t=Math.abs(r);return`UTC${e}${String(Math.floor(t/60)).padStart(2,"0")}${String(t%60).padStart(2,"0")}`},c=u(s),f=u(l);l<s?(te(c,t,17),te(f,n,17)):(te(c,n,17),te(f,t,17))},Oe=()=>2147483648,Be=(r,e)=>Math.ceil(r/e)*e,Ue=r=>{var e=(r-v.buffer.byteLength+65535)/65536|0;try{return v.grow(e),D(),1}catch(t){}},We=r=>{var e=g.length;r>>>=0;var t=Oe();if(r>t)return!1;for(var n=1;n<=4;n*=2){var o=e*(1+.2/n);o=Math.min(o,r+100663296);var a=Math.min(t,Be(Math.max(r,o),65536));if(Ue(a))return!0}return!1},Le={},He=()=>c||"./this.program",Ie=()=>{if(!Ie.strings){var r={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:He()};for(var e in Le)void 0===Le[e]?delete r[e]:r[e]=Le[e];var t=[];for(var e in r)t.push(`${e}=${r[e]}`);Ie.strings=t}return Ie.strings},Ve=(r,e)=>{for(var t=0;t<r.length;++t)w[e++]=r.charCodeAt(t);w[e]=0},qe=(r,e)=>{var t=0;return Ie().forEach((n,o)=>{var a=e+t;k[r+4*o>>2]=a,Ve(n,a),t+=n.length+1}),0},Xe=(r,e)=>{var t=Ie();k[r>>2]=t.length;var n=0;return t.forEach(r=>n+=r.length+1),k[e>>2]=n,0},Ge={isAbs:r=>"/"===r.charAt(0),splitPath:r=>/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(r).slice(1),normalizeArray:(r,e)=>{for(var t=0,n=r.length-1;n>=0;n--){var o=r[n];"."===o?r.splice(n,1):".."===o?(r.splice(n,1),t++):t&&(r.splice(n,1),t--)}if(e)for(;t;t--)r.unshift("..");return r},normalize:r=>{var e=Ge.isAbs(r),t="/"===r.substr(-1);return(r=Ge.normalizeArray(r.split("/").filter(r=>!!r),!e).join("/"))||e||(r="."),r&&t&&(r+="/"),(e?"/":"")+r},dirname:r=>{var e=Ge.splitPath(r),t=e[0],n=e[1];return t||n?(n&&(n=n.substr(0,n.length-1)),t+n):"."},basename:r=>{if("/"===r)return"/";var e=(r=(r=Ge.normalize(r)).replace(/\/$/,"")).lastIndexOf("/");return-1===e?r:r.substr(e+1)},join:(...r)=>Ge.normalize(r.join("/")),join2:(r,e)=>Ge.normalize(r+"/"+e)},Ke=()=>{if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues)return r=>crypto.getRandomValues(r);W("initRandomDevice")},Je=r=>(Je=Ke())(r),Qe={resolve:(...r)=>{for(var e="",t=!1,n=r.length-1;n>=-1&&!t;n--){var o=n>=0?r[n]:ct.cwd();if("string"!=typeof o)throw new TypeError("Arguments to path.resolve must be strings");if(!o)return"";e=o+"/"+e,t=Ge.isAbs(o)}return(t?"/":"")+(e=Ge.normalizeArray(e.split("/").filter(r=>!!r),!t).join("/"))||"."},relative:(r,e)=>{function t(r){for(var e=0;e<r.length&&""===r[e];e++);for(var t=r.length-1;t>=0&&""===r[t];t--);return e>t?[]:r.slice(e,t-e+1)}r=Qe.resolve(r).substr(1),e=Qe.resolve(e).substr(1);for(var n=t(r.split("/")),o=t(e.split("/")),a=Math.min(n.length,o.length),i=a,s=0;s<a;s++)if(n[s]!==o[s]){i=s;break}var l=[];for(s=i;s<n.length;s++)l.push("..");return(l=l.concat(o.slice(i))).join("/")}},Ye=[];function Ze(r,e,t){var n=ne(r)+1,o=new Array(n),a=ee(r,o,0,o.length);return o.length=a,o}var rt=()=>{if(!Ye.length){var r=null;if("undefined"!=typeof window&&"function"==typeof window.prompt&&null!==(r=window.prompt("Input: "))&&(r+="\n"),!r)return null;Ye=Ze(r)}return Ye.shift()},et={ttys:[],init(){},shutdown(){},register(r,e){et.ttys[r]={input:[],output:[],ops:e},ct.registerDevice(r,et.stream_ops)},stream_ops:{open(r){var e=et.ttys[r.node.rdev];if(!e)throw new ct.ErrnoError(43);r.tty=e,r.seekable=!1},close(r){r.tty.ops.fsync(r.tty)},fsync(r){r.tty.ops.fsync(r.tty)},read(r,e,t,n,o){if(!r.tty||!r.tty.ops.get_char)throw new ct.ErrnoError(60);for(var a=0,i=0;i<n;i++){var s;try{s=r.tty.ops.get_char(r.tty)}catch(l){throw new ct.ErrnoError(29)}if(void 0===s&&0===a)throw new ct.ErrnoError(6);if(null==s)break;a++,e[t+i]=s}return a&&(r.node.atime=Date.now()),a},write(r,e,t,n,o){if(!r.tty||!r.tty.ops.put_char)throw new ct.ErrnoError(60);try{for(var a=0;a<n;a++)r.tty.ops.put_char(r.tty,e[t+a])}catch(i){throw new ct.ErrnoError(29)}return n&&(r.node.mtime=r.node.ctime=Date.now()),a}},default_tty_ops:{get_char:r=>rt(),put_char(r,e){null===e||10===e?(m(ae(r.output)),r.output=[]):0!=e&&r.output.push(e)},fsync(r){r.output&&r.output.length>0&&(m(ae(r.output)),r.output=[])},ioctl_tcgets:r=>({c_iflag:25856,c_oflag:5,c_cflag:191,c_lflag:35387,c_cc:[3,28,127,21,4,0,1,0,17,19,26,0,18,15,23,22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}),ioctl_tcsets:(r,e,t)=>0,ioctl_tiocgwinsz:r=>[24,80]},default_tty1_ops:{put_char(r,e){null===e||10===e?(p(ae(r.output)),r.output=[]):0!=e&&r.output.push(e)},fsync(r){r.output&&r.output.length>0&&(p(ae(r.output)),r.output=[])}}},tt=r=>{W()},nt={ops_table:null,mount:r=>nt.createNode(null,"/",16895,0),createNode(r,e,t,n){if(ct.isBlkdev(t)||ct.isFIFO(t))throw new ct.ErrnoError(63);nt.ops_table||={dir:{node:{getattr:nt.node_ops.getattr,setattr:nt.node_ops.setattr,lookup:nt.node_ops.lookup,mknod:nt.node_ops.mknod,rename:nt.node_ops.rename,unlink:nt.node_ops.unlink,rmdir:nt.node_ops.rmdir,readdir:nt.node_ops.readdir,symlink:nt.node_ops.symlink},stream:{llseek:nt.stream_ops.llseek}},file:{node:{getattr:nt.node_ops.getattr,setattr:nt.node_ops.setattr},stream:{llseek:nt.stream_ops.llseek,read:nt.stream_ops.read,write:nt.stream_ops.write,allocate:nt.stream_ops.allocate,mmap:nt.stream_ops.mmap,msync:nt.stream_ops.msync}},link:{node:{getattr:nt.node_ops.getattr,setattr:nt.node_ops.setattr,readlink:nt.node_ops.readlink},stream:{}},chrdev:{node:{getattr:nt.node_ops.getattr,setattr:nt.node_ops.setattr},stream:ct.chrdev_stream_ops}};var o=ct.createNode(r,e,t,n);return ct.isDir(o.mode)?(o.node_ops=nt.ops_table.dir.node,o.stream_ops=nt.ops_table.dir.stream,o.contents={}):ct.isFile(o.mode)?(o.node_ops=nt.ops_table.file.node,o.stream_ops=nt.ops_table.file.stream,o.usedBytes=0,o.contents=null):ct.isLink(o.mode)?(o.node_ops=nt.ops_table.link.node,o.stream_ops=nt.ops_table.link.stream):ct.isChrdev(o.mode)&&(o.node_ops=nt.ops_table.chrdev.node,o.stream_ops=nt.ops_table.chrdev.stream),o.atime=o.mtime=o.ctime=Date.now(),r&&(r.contents[e]=o,r.atime=r.mtime=r.ctime=o.atime),o},getFileDataAsTypedArray:r=>r.contents?r.contents.subarray?r.contents.subarray(0,r.usedBytes):new Uint8Array(r.contents):new Uint8Array(0),expandFileStorage(r,e){var t=r.contents?r.contents.length:0;if(!(t>=e)){var n=1048576;e=Math.max(e,t*(t<n?2:1.125)>>>0),0!=t&&(e=Math.max(e,256));var o=r.contents;r.contents=new Uint8Array(e),r.usedBytes>0&&r.contents.set(o.subarray(0,r.usedBytes),0)}},resizeFileStorage(r,e){if(r.usedBytes!=e)if(0==e)r.contents=null,r.usedBytes=0;else{var t=r.contents;r.contents=new Uint8Array(e),t&&r.contents.set(t.subarray(0,Math.min(e,r.usedBytes))),r.usedBytes=e}},node_ops:{getattr(r){var e={};return e.dev=ct.isChrdev(r.mode)?r.id:1,e.ino=r.id,e.mode=r.mode,e.nlink=1,e.uid=0,e.gid=0,e.rdev=r.rdev,ct.isDir(r.mode)?e.size=4096:ct.isFile(r.mode)?e.size=r.usedBytes:ct.isLink(r.mode)?e.size=r.link.length:e.size=0,e.atime=new Date(r.atime),e.mtime=new Date(r.mtime),e.ctime=new Date(r.ctime),e.blksize=4096,e.blocks=Math.ceil(e.size/e.blksize),e},setattr(r,e){for(const t of["mode","atime","mtime","ctime"])e[t]&&(r[t]=e[t]);void 0!==e.size&&nt.resizeFileStorage(r,e.size)},lookup(r,e){throw nt.doesNotExistError},mknod:(r,e,t,n)=>nt.createNode(r,e,t,n),rename(r,e,t){var n;try{n=ct.lookupNode(e,t)}catch(a){}if(n){if(ct.isDir(r.mode))for(var o in n.contents)throw new ct.ErrnoError(55);ct.hashRemoveNode(n)}delete r.parent.contents[r.name],e.contents[t]=r,r.name=t,e.ctime=e.mtime=r.parent.ctime=r.parent.mtime=Date.now()},unlink(r,e){delete r.contents[e],r.ctime=r.mtime=Date.now()},rmdir(r,e){var t=ct.lookupNode(r,e);for(var n in t.contents)throw new ct.ErrnoError(55);delete r.contents[e],r.ctime=r.mtime=Date.now()},readdir:r=>[".","..",...Object.keys(r.contents)],symlink(r,e,t){var n=nt.createNode(r,e,41471,0);return n.link=t,n},readlink(r){if(!ct.isLink(r.mode))throw new ct.ErrnoError(28);return r.link}},stream_ops:{read(r,e,t,n,o){var a=r.node.contents;if(o>=r.node.usedBytes)return 0;var i=Math.min(r.node.usedBytes-o,n);if(i>8&&a.subarray)e.set(a.subarray(o,o+i),t);else for(var s=0;s<i;s++)e[t+s]=a[o+s];return i},write(r,e,t,n,o,a){if(e.buffer===w.buffer&&(a=!1),!n)return 0;var i=r.node;if(i.mtime=i.ctime=Date.now(),e.subarray&&(!i.contents||i.contents.subarray)){if(a)return i.contents=e.subarray(t,t+n),i.usedBytes=n,n;if(0===i.usedBytes&&0===o)return i.contents=e.slice(t,t+n),i.usedBytes=n,n;if(o+n<=i.usedBytes)return i.contents.set(e.subarray(t,t+n),o),n}if(nt.expandFileStorage(i,o+n),i.contents.subarray&&e.subarray)i.contents.set(e.subarray(t,t+n),o);else for(var s=0;s<n;s++)i.contents[o+s]=e[t+s];return i.usedBytes=Math.max(i.usedBytes,o+n),n},llseek(r,e,t){var n=e;if(1===t?n+=r.position:2===t&&ct.isFile(r.node.mode)&&(n+=r.node.usedBytes),n<0)throw new ct.ErrnoError(28);return n},allocate(r,e,t){nt.expandFileStorage(r.node,e+t),r.node.usedBytes=Math.max(r.node.usedBytes,e+t)},mmap(r,e,t,n,o){if(!ct.isFile(r.node.mode))throw new ct.ErrnoError(43);var a,i,s=r.node.contents;if(2&o||!s||s.buffer!==w.buffer){if(i=!0,!(a=tt()))throw new ct.ErrnoError(48);s&&((t>0||t+e<s.length)&&(s=s.subarray?s.subarray(t,t+e):Array.prototype.slice.call(s,t,t+e)),w.set(s,a))}else i=!1,a=s.byteOffset;return{ptr:a,allocated:i}},msync:(r,e,t,n,o)=>(nt.stream_ops.write(r,e,0,n,t,!1),0)}},ot=async r=>{var e=await l(r);return new Uint8Array(e)},at=(r,e,t,n,o,a)=>{ct.createDataFile(r,e,t,n,o,a)},it=o.preloadPlugins||[],st=(r,e,t,n)=>{"undefined"!=typeof Browser&&Browser.init();var o=!1;return it.forEach(a=>{o||a.canHandle(e)&&(a.handle(r,e,t,n),o=!0)}),o},lt=(r,e,t,n,o,a,i,s,l,d)=>{var u=e?Qe.resolve(Ge.join2(r,e)):r;function c(t){function c(t){d?.(),s||at(r,e,t,n,o,l),a?.(),U()}st(t,u,c,()=>{i?.(),U()})||c(t)}B(),"string"==typeof t?ot(t).then(c,i):c(t)},dt=r=>{var e={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090}[r];if(void 0===e)throw new Error(`Unknown file open mode: ${r}`);return e},ut=(r,e)=>{var t=0;return r&&(t|=365),e&&(t|=146),t},ct={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,ErrnoError:class{name="ErrnoError";constructor(r){this.errno=r}},filesystems:null,syncFSRequests:0,readFiles:{},FSStream:class{shared={};get object(){return this.node}set object(r){this.node=r}get isRead(){return 1!=(2097155&this.flags)}get isWrite(){return!!(2097155&this.flags)}get isAppend(){return 1024&this.flags}get flags(){return this.shared.flags}set flags(r){this.shared.flags=r}get position(){return this.shared.position}set position(r){this.shared.position=r}},FSNode:class{node_ops={};stream_ops={};readMode=365;writeMode=146;mounted=null;constructor(r,e,t,n){r||(r=this),this.parent=r,this.mount=r.mount,this.id=ct.nextInode++,this.name=e,this.mode=t,this.rdev=n,this.atime=this.mtime=this.ctime=Date.now()}get read(){return(this.mode&this.readMode)===this.readMode}set read(r){r?this.mode|=this.readMode:this.mode&=~this.readMode}get write(){return(this.mode&this.writeMode)===this.writeMode}set write(r){r?this.mode|=this.writeMode:this.mode&=~this.writeMode}get isFolder(){return ct.isDir(this.mode)}get isDevice(){return ct.isChrdev(this.mode)}},lookupPath(r,e={}){if(!r)return{path:"",node:null};e.follow_mount??=!0,Ge.isAbs(r)||(r=ct.cwd()+"/"+r);r:for(var t=0;t<40;t++){for(var n=r.split("/").filter(r=>!!r&&"."!==r),o=ct.root,a="/",i=0;i<n.length;i++){var s=i===n.length-1;if(s&&e.parent)break;if(".."!==n[i]){a=Ge.join2(a,n[i]);try{o=ct.lookupNode(o,n[i])}catch(d){if(44===d?.errno&&s&&e.noent_okay)return{path:a};throw d}if(!ct.isMountpoint(o)||s&&!e.follow_mount||(o=o.mounted.root),ct.isLink(o.mode)&&(!s||e.follow)){if(!o.node_ops.readlink)throw new ct.ErrnoError(52);var l=o.node_ops.readlink(o);Ge.isAbs(l)||(l=Ge.dirname(a)+"/"+l),r=l+"/"+n.slice(i+1).join("/");continue r}}else a=Ge.dirname(a),o=o.parent}return{path:a,node:o}}throw new ct.ErrnoError(32)},getPath(r){for(var e;;){if(ct.isRoot(r)){var t=r.mount.mountpoint;return e?"/"!==t[t.length-1]?`${t}/${e}`:t+e:t}e=e?`${r.name}/${e}`:r.name,r=r.parent}},hashName(r,e){for(var t=0,n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n)|0;return(r+t>>>0)%ct.nameTable.length},hashAddNode(r){var e=ct.hashName(r.parent.id,r.name);r.name_next=ct.nameTable[e],ct.nameTable[e]=r},hashRemoveNode(r){var e=ct.hashName(r.parent.id,r.name);if(ct.nameTable[e]===r)ct.nameTable[e]=r.name_next;else for(var t=ct.nameTable[e];t;){if(t.name_next===r){t.name_next=r.name_next;break}t=t.name_next}},lookupNode(r,e){var t=ct.mayLookup(r);if(t)throw new ct.ErrnoError(t);for(var n=ct.hashName(r.id,e),o=ct.nameTable[n];o;o=o.name_next){var a=o.name;if(o.parent.id===r.id&&a===e)return o}return ct.lookup(r,e)},createNode(r,e,t,n){var o=new ct.FSNode(r,e,t,n);return ct.hashAddNode(o),o},destroyNode(r){ct.hashRemoveNode(r)},isRoot:r=>r===r.parent,isMountpoint:r=>!!r.mounted,isFile:r=>32768==(61440&r),isDir:r=>16384==(61440&r),isLink:r=>40960==(61440&r),isChrdev:r=>8192==(61440&r),isBlkdev:r=>24576==(61440&r),isFIFO:r=>4096==(61440&r),isSocket:r=>!(49152&~r),flagsToPermissionString(r){var e=["r","w","rw"][3&r];return 512&r&&(e+="w"),e},nodePermissions:(r,e)=>ct.ignorePermissions||(!e.includes("r")||292&r.mode)&&(!e.includes("w")||146&r.mode)&&(!e.includes("x")||73&r.mode)?0:2,mayLookup(r){if(!ct.isDir(r.mode))return 54;var e=ct.nodePermissions(r,"x");return e||(r.node_ops.lookup?0:2)},mayCreate(r,e){if(!ct.isDir(r.mode))return 54;try{return ct.lookupNode(r,e),20}catch(t){}return ct.nodePermissions(r,"wx")},mayDelete(r,e,t){var n;try{n=ct.lookupNode(r,e)}catch(a){return a.errno}var o=ct.nodePermissions(r,"wx");if(o)return o;if(t){if(!ct.isDir(n.mode))return 54;if(ct.isRoot(n)||ct.getPath(n)===ct.cwd())return 10}else if(ct.isDir(n.mode))return 31;return 0},mayOpen:(r,e)=>r?ct.isLink(r.mode)?32:ct.isDir(r.mode)&&("r"!==ct.flagsToPermissionString(e)||512&e)?31:ct.nodePermissions(r,ct.flagsToPermissionString(e)):44,MAX_OPEN_FDS:4096,nextfd(){for(var r=0;r<=ct.MAX_OPEN_FDS;r++)if(!ct.streams[r])return r;throw new ct.ErrnoError(33)},getStreamChecked(r){var e=ct.getStream(r);if(!e)throw new ct.ErrnoError(8);return e},getStream:r=>ct.streams[r],createStream:(r,e=-1)=>(r=Object.assign(new ct.FSStream,r),-1==e&&(e=ct.nextfd()),r.fd=e,ct.streams[e]=r,r),closeStream(r){ct.streams[r]=null},dupStream(r,e=-1){var t=ct.createStream(r,e);return t.stream_ops?.dup?.(t),t},chrdev_stream_ops:{open(r){var e=ct.getDevice(r.node.rdev);r.stream_ops=e.stream_ops,r.stream_ops.open?.(r)},llseek(){throw new ct.ErrnoError(70)}},major:r=>r>>8,minor:r=>255&r,makedev:(r,e)=>r<<8|e,registerDevice(r,e){ct.devices[r]={stream_ops:e}},getDevice:r=>ct.devices[r],getMounts(r){for(var e=[],t=[r];t.length;){var n=t.pop();e.push(n),t.push(...n.mounts)}return e},syncfs(r,e){"function"==typeof r&&(e=r,r=!1),ct.syncFSRequests++,ct.syncFSRequests>1&&p(`warning: ${ct.syncFSRequests} FS.syncfs operations in flight at once, probably just doing extra work`);var t=ct.getMounts(ct.root.mount),n=0;function o(r){return ct.syncFSRequests--,e(r)}function a(r){if(r)return a.errored?void 0:(a.errored=!0,o(r));++n>=t.length&&o(null)}t.forEach(e=>{if(!e.type.syncfs)return a(null);e.type.syncfs(e,r,a)})},mount(r,e,t){var n,o="/"===t,a=!t;if(o&&ct.root)throw new ct.ErrnoError(10);if(!o&&!a){var i=ct.lookupPath(t,{follow_mount:!1});if(t=i.path,n=i.node,ct.isMountpoint(n))throw new ct.ErrnoError(10);if(!ct.isDir(n.mode))throw new ct.ErrnoError(54)}var s={type:r,opts:e,mountpoint:t,mounts:[]},l=r.mount(s);return l.mount=s,s.root=l,o?ct.root=l:n&&(n.mounted=s,n.mount&&n.mount.mounts.push(s)),l},unmount(r){var e=ct.lookupPath(r,{follow_mount:!1});if(!ct.isMountpoint(e.node))throw new ct.ErrnoError(28);var t=e.node,n=t.mounted,o=ct.getMounts(n);Object.keys(ct.nameTable).forEach(r=>{for(var e=ct.nameTable[r];e;){var t=e.name_next;o.includes(e.mount)&&ct.destroyNode(e),e=t}}),t.mounted=null;var a=t.mount.mounts.indexOf(n);t.mount.mounts.splice(a,1)},lookup:(r,e)=>r.node_ops.lookup(r,e),mknod(r,e,t){var n=ct.lookupPath(r,{parent:!0}).node,o=Ge.basename(r);if(!o||"."===o||".."===o)throw new ct.ErrnoError(28);var a=ct.mayCreate(n,o);if(a)throw new ct.ErrnoError(a);if(!n.node_ops.mknod)throw new ct.ErrnoError(63);return n.node_ops.mknod(n,o,e,t)},statfs(r){var e={bsize:4096,frsize:4096,blocks:1e6,bfree:5e5,bavail:5e5,files:ct.nextInode,ffree:ct.nextInode-1,fsid:42,flags:2,namelen:255},t=ct.lookupPath(r,{follow:!0}).node;return t?.node_ops.statfs&&Object.assign(e,t.node_ops.statfs(t.mount.opts.root)),e},create:(r,e=438)=>(e&=4095,e|=32768,ct.mknod(r,e,0)),mkdir:(r,e=511)=>(e&=1023,e|=16384,ct.mknod(r,e,0)),mkdirTree(r,e){for(var t=r.split("/"),n="",o=0;o<t.length;++o)if(t[o]){n+="/"+t[o];try{ct.mkdir(n,e)}catch(a){if(20!=a.errno)throw a}}},mkdev:(r,e,t)=>(void 0===t&&(t=e,e=438),e|=8192,ct.mknod(r,e,t)),symlink(r,e){if(!Qe.resolve(r))throw new ct.ErrnoError(44);var t=ct.lookupPath(e,{parent:!0}).node;if(!t)throw new ct.ErrnoError(44);var n=Ge.basename(e),o=ct.mayCreate(t,n);if(o)throw new ct.ErrnoError(o);if(!t.node_ops.symlink)throw new ct.ErrnoError(63);return t.node_ops.symlink(t,n,r)},rename(r,e){var t,n,o=Ge.dirname(r),a=Ge.dirname(e),i=Ge.basename(r),s=Ge.basename(e);if(t=ct.lookupPath(r,{parent:!0}).node,n=ct.lookupPath(e,{parent:!0}).node,!t||!n)throw new ct.ErrnoError(44);if(t.mount!==n.mount)throw new ct.ErrnoError(75);var l,d=ct.lookupNode(t,i),u=Qe.relative(r,a);if("."!==u.charAt(0))throw new ct.ErrnoError(28);if("."!==(u=Qe.relative(e,o)).charAt(0))throw new ct.ErrnoError(55);try{l=ct.lookupNode(n,s)}catch(h){}if(d!==l){var c=ct.isDir(d.mode),f=ct.mayDelete(t,i,c);if(f)throw new ct.ErrnoError(f);if(f=l?ct.mayDelete(n,s,c):ct.mayCreate(n,s))throw new ct.ErrnoError(f);if(!t.node_ops.rename)throw new ct.ErrnoError(63);if(ct.isMountpoint(d)||l&&ct.isMountpoint(l))throw new ct.ErrnoError(10);if(n!==t&&(f=ct.nodePermissions(t,"w")))throw new ct.ErrnoError(f);ct.hashRemoveNode(d);try{t.node_ops.rename(d,n,s),d.parent=n}catch(h){throw h}finally{ct.hashAddNode(d)}}},rmdir(r){var e=ct.lookupPath(r,{parent:!0}).node,t=Ge.basename(r),n=ct.lookupNode(e,t),o=ct.mayDelete(e,t,!0);if(o)throw new ct.ErrnoError(o);if(!e.node_ops.rmdir)throw new ct.ErrnoError(63);if(ct.isMountpoint(n))throw new ct.ErrnoError(10);e.node_ops.rmdir(e,t),ct.destroyNode(n)},readdir(r){var e=ct.lookupPath(r,{follow:!0}).node;if(!e.node_ops.readdir)throw new ct.ErrnoError(54);return e.node_ops.readdir(e)},unlink(r){var e=ct.lookupPath(r,{parent:!0}).node;if(!e)throw new ct.ErrnoError(44);var t=Ge.basename(r),n=ct.lookupNode(e,t),o=ct.mayDelete(e,t,!1);if(o)throw new ct.ErrnoError(o);if(!e.node_ops.unlink)throw new ct.ErrnoError(63);if(ct.isMountpoint(n))throw new ct.ErrnoError(10);e.node_ops.unlink(e,t),ct.destroyNode(n)},readlink(r){var e=ct.lookupPath(r).node;if(!e)throw new ct.ErrnoError(44);if(!e.node_ops.readlink)throw new ct.ErrnoError(28);return e.node_ops.readlink(e)},stat(r,e){var t=ct.lookupPath(r,{follow:!e}).node;if(!t)throw new ct.ErrnoError(44);if(!t.node_ops.getattr)throw new ct.ErrnoError(63);return t.node_ops.getattr(t)},lstat:r=>ct.stat(r,!0),chmod(r,e,t){var n;if(!(n="string"==typeof r?ct.lookupPath(r,{follow:!t}).node:r).node_ops.setattr)throw new ct.ErrnoError(63);n.node_ops.setattr(n,{mode:4095&e|-4096&n.mode,ctime:Date.now()})},lchmod(r,e){ct.chmod(r,e,!0)},fchmod(r,e){var t=ct.getStreamChecked(r);ct.chmod(t.node,e)},chown(r,e,t,n){var o;if(!(o="string"==typeof r?ct.lookupPath(r,{follow:!n}).node:r).node_ops.setattr)throw new ct.ErrnoError(63);o.node_ops.setattr(o,{timestamp:Date.now()})},lchown(r,e,t){ct.chown(r,e,t,!0)},fchown(r,e,t){var n=ct.getStreamChecked(r);ct.chown(n.node,e,t)},truncate(r,e){if(e<0)throw new ct.ErrnoError(28);var t;if(!(t="string"==typeof r?ct.lookupPath(r,{follow:!0}).node:r).node_ops.setattr)throw new ct.ErrnoError(63);if(ct.isDir(t.mode))throw new ct.ErrnoError(31);if(!ct.isFile(t.mode))throw new ct.ErrnoError(28);var n=ct.nodePermissions(t,"w");if(n)throw new ct.ErrnoError(n);t.node_ops.setattr(t,{size:e,timestamp:Date.now()})},ftruncate(r,e){var t=ct.getStreamChecked(r);if(!(2097155&t.flags))throw new ct.ErrnoError(28);ct.truncate(t.node,e)},utime(r,e,t){var n=ct.lookupPath(r,{follow:!0}).node;n.node_ops.setattr(n,{atime:e,mtime:t})},open(r,e,t=438){if(""===r)throw new ct.ErrnoError(44);var n;if(t=64&(e="string"==typeof e?dt(e):e)?4095&t|32768:0,"object"==typeof r)n=r;else{var a=ct.lookupPath(r,{follow:!(131072&e),noent_okay:!0});n=a.node,r=a.path}var i=!1;if(64&e)if(n){if(128&e)throw new ct.ErrnoError(20)}else n=ct.mknod(r,t,0),i=!0;if(!n)throw new ct.ErrnoError(44);if(ct.isChrdev(n.mode)&&(e&=-513),65536&e&&!ct.isDir(n.mode))throw new ct.ErrnoError(54);if(!i){var s=ct.mayOpen(n,e);if(s)throw new ct.ErrnoError(s)}512&e&&!i&&ct.truncate(n,0),e&=-131713;var l=ct.createStream({node:n,path:ct.getPath(n),flags:e,seekable:!0,position:0,stream_ops:n.stream_ops,ungotten:[],error:!1});return l.stream_ops.open&&l.stream_ops.open(l),!o.logReadFiles||1&e||r in ct.readFiles||(ct.readFiles[r]=1),l},close(r){if(ct.isClosed(r))throw new ct.ErrnoError(8);r.getdents&&(r.getdents=null);try{r.stream_ops.close&&r.stream_ops.close(r)}catch(e){throw e}finally{ct.closeStream(r.fd)}r.fd=null},isClosed:r=>null===r.fd,llseek(r,e,t){if(ct.isClosed(r))throw new ct.ErrnoError(8);if(!r.seekable||!r.stream_ops.llseek)throw new ct.ErrnoError(70);if(0!=t&&1!=t&&2!=t)throw new ct.ErrnoError(28);return r.position=r.stream_ops.llseek(r,e,t),r.ungotten=[],r.position},read(r,e,t,n,o){if(n<0||o<0)throw new ct.ErrnoError(28);if(ct.isClosed(r))throw new ct.ErrnoError(8);if(1==(2097155&r.flags))throw new ct.ErrnoError(8);if(ct.isDir(r.node.mode))throw new ct.ErrnoError(31);if(!r.stream_ops.read)throw new ct.ErrnoError(28);var a=void 0!==o;if(a){if(!r.seekable)throw new ct.ErrnoError(70)}else o=r.position;var i=r.stream_ops.read(r,e,t,n,o);return a||(r.position+=i),i},write(r,e,t,n,o,a){if(n<0||o<0)throw new ct.ErrnoError(28);if(ct.isClosed(r))throw new ct.ErrnoError(8);if(!(2097155&r.flags))throw new ct.ErrnoError(8);if(ct.isDir(r.node.mode))throw new ct.ErrnoError(31);if(!r.stream_ops.write)throw new ct.ErrnoError(28);r.seekable&&1024&r.flags&&ct.llseek(r,0,2);var i=void 0!==o;if(i){if(!r.seekable)throw new ct.ErrnoError(70)}else o=r.position;var s=r.stream_ops.write(r,e,t,n,o,a);return i||(r.position+=s),s},allocate(r,e,t){if(ct.isClosed(r))throw new ct.ErrnoError(8);if(e<0||t<=0)throw new ct.ErrnoError(28);if(!(2097155&r.flags))throw new ct.ErrnoError(8);if(!ct.isFile(r.node.mode)&&!ct.isDir(r.node.mode))throw new ct.ErrnoError(43);if(!r.stream_ops.allocate)throw new ct.ErrnoError(138);r.stream_ops.allocate(r,e,t)},mmap(r,e,t,n,o){if(2&n&&!(2&o)&&2!=(2097155&r.flags))throw new ct.ErrnoError(2);if(1==(2097155&r.flags))throw new ct.ErrnoError(2);if(!r.stream_ops.mmap)throw new ct.ErrnoError(43);if(!e)throw new ct.ErrnoError(28);return r.stream_ops.mmap(r,e,t,n,o)},msync:(r,e,t,n,o)=>r.stream_ops.msync?r.stream_ops.msync(r,e,t,n,o):0,ioctl(r,e,t){if(!r.stream_ops.ioctl)throw new ct.ErrnoError(59);return r.stream_ops.ioctl(r,e,t)},readFile(r,e={}){if(e.flags=e.flags||0,e.encoding=e.encoding||"binary","utf8"!==e.encoding&&"binary"!==e.encoding)throw new Error(`Invalid encoding type "${e.encoding}"`);var t,n=ct.open(r,e.flags),o=ct.stat(r).size,a=new Uint8Array(o);return ct.read(n,a,0,o,0),"utf8"===e.encoding?t=ae(a):"binary"===e.encoding&&(t=a),ct.close(n),t},writeFile(r,e,t={}){t.flags=t.flags||577;var n=ct.open(r,t.flags,t.mode);if("string"==typeof e){var o=new Uint8Array(ne(e)+1),a=ee(e,o,0,o.length);ct.write(n,o,0,a,void 0,t.canOwn)}else{if(!ArrayBuffer.isView(e))throw new Error("Unsupported data type");ct.write(n,e,0,e.byteLength,void 0,t.canOwn)}ct.close(n)},cwd:()=>ct.currentPath,chdir(r){var e=ct.lookupPath(r,{follow:!0});if(null===e.node)throw new ct.ErrnoError(44);if(!ct.isDir(e.node.mode))throw new ct.ErrnoError(54);var t=ct.nodePermissions(e.node,"x");if(t)throw new ct.ErrnoError(t);ct.currentPath=e.path},createDefaultDirectories(){ct.mkdir("/tmp"),ct.mkdir("/home"),ct.mkdir("/home/web_user")},createDefaultDevices(){ct.mkdir("/dev"),ct.registerDevice(ct.makedev(1,3),{read:()=>0,write:(r,e,t,n,o)=>n,llseek:()=>0}),ct.mkdev("/dev/null",ct.makedev(1,3)),et.register(ct.makedev(5,0),et.default_tty_ops),et.register(ct.makedev(6,0),et.default_tty1_ops),ct.mkdev("/dev/tty",ct.makedev(5,0)),ct.mkdev("/dev/tty1",ct.makedev(6,0));var r=new Uint8Array(1024),e=0,t=()=>(0===e&&(e=Je(r).byteLength),r[--e]);ct.createDevice("/dev","random",t),ct.createDevice("/dev","urandom",t),ct.mkdir("/dev/shm"),ct.mkdir("/dev/shm/tmp")},createSpecialDirectories(){ct.mkdir("/proc");var r=ct.mkdir("/proc/self");ct.mkdir("/proc/self/fd"),ct.mount({mount(){var e=ct.createNode(r,"fd",16895,73);return e.stream_ops={llseek:nt.stream_ops.llseek},e.node_ops={lookup(r,e){var t=+e,n=ct.getStreamChecked(t),o={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:()=>n.path},id:t+1};return o.parent=o,o},readdir:()=>Array.from(ct.streams.entries()).filter(([r,e])=>e).map(([r,e])=>r.toString())},e}},{},"/proc/self/fd")},createStandardStreams(r,e,t){r?ct.createDevice("/dev","stdin",r):ct.symlink("/dev/tty","/dev/stdin"),e?ct.createDevice("/dev","stdout",null,e):ct.symlink("/dev/tty","/dev/stdout"),t?ct.createDevice("/dev","stderr",null,t):ct.symlink("/dev/tty1","/dev/stderr"),ct.open("/dev/stdin",0),ct.open("/dev/stdout",1),ct.open("/dev/stderr",1)},staticInit(){ct.nameTable=new Array(4096),ct.mount(nt,{},"/"),ct.createDefaultDirectories(),ct.createDefaultDevices(),ct.createSpecialDirectories(),ct.filesystems={MEMFS:nt}},init(r,e,t){ct.initialized=!0,r??=o.stdin,e??=o.stdout,t??=o.stderr,ct.createStandardStreams(r,e,t)},quit(){ct.initialized=!1;for(var r=0;r<ct.streams.length;r++){var e=ct.streams[r];e&&ct.close(e)}},findObject(r,e){var t=ct.analyzePath(r,e);return t.exists?t.object:null},analyzePath(r,e){try{r=(n=ct.lookupPath(r,{follow:!e})).path}catch(o){}var t={isRoot:!1,exists:!1,error:0,name:null,path:null,object:null,parentExists:!1,parentPath:null,parentObject:null};try{var n=ct.lookupPath(r,{parent:!0});t.parentExists=!0,t.parentPath=n.path,t.parentObject=n.node,t.name=Ge.basename(r),n=ct.lookupPath(r,{follow:!e}),t.exists=!0,t.path=n.path,t.object=n.node,t.name=n.node.name,t.isRoot="/"===n.path}catch(o){t.error=o.errno}return t},createPath(r,e,t,n){r="string"==typeof r?r:ct.getPath(r);for(var o=e.split("/").reverse();o.length;){var a=o.pop();if(a){var i=Ge.join2(r,a);try{ct.mkdir(i)}catch(s){}r=i}}return i},createFile(r,e,t,n,o){var a=Ge.join2("string"==typeof r?r:ct.getPath(r),e),i=ut(n,o);return ct.create(a,i)},createDataFile(r,e,t,n,o,a){var i=e;r&&(r="string"==typeof r?r:ct.getPath(r),i=e?Ge.join2(r,e):r);var s=ut(n,o),l=ct.create(i,s);if(t){if("string"==typeof t){for(var d=new Array(t.length),u=0,c=t.length;u<c;++u)d[u]=t.charCodeAt(u);t=d}ct.chmod(l,146|s);var f=ct.open(l,577);ct.write(f,t,0,t.length,0,a),ct.close(f),ct.chmod(l,s)}},createDevice(r,e,t,n){var o=Ge.join2("string"==typeof r?r:ct.getPath(r),e),a=ut(!!t,!!n);ct.createDevice.major??=64;var i=ct.makedev(ct.createDevice.major++,0);return ct.registerDevice(i,{open(r){r.seekable=!1},close(r){n?.buffer?.length&&n(10)},read(r,e,n,o,a){for(var i=0,s=0;s<o;s++){var l;try{l=t()}catch(d){throw new ct.ErrnoError(29)}if(void 0===l&&0===i)throw new ct.ErrnoError(6);if(null==l)break;i++,e[n+s]=l}return i&&(r.node.atime=Date.now()),i},write(r,e,t,o,a){for(var i=0;i<o;i++)try{n(e[t+i])}catch(s){throw new ct.ErrnoError(29)}return o&&(r.node.mtime=r.node.ctime=Date.now()),i}}),ct.mkdev(o,a,i)},forceLoadFile(r){if(r.isDevice||r.isFolder||r.link||r.contents)return!0;if("undefined"!=typeof XMLHttpRequest)throw new Error("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.");try{r.contents=d(r.url),r.usedBytes=r.contents.length}catch(e){throw new ct.ErrnoError(29)}},createLazyFile(r,e,t,n,o){class a{lengthKnown=!1;chunks=[];get(r){if(!(r>this.length-1||r<0)){var e=r%this.chunkSize,t=r/this.chunkSize|0;return this.getter(t)[e]}}setDataGetter(r){this.getter=r}cacheLength(){var r=new XMLHttpRequest;if(r.open("HEAD",t,!1),r.send(null),!(r.status>=200&&r.status<300||304===r.status))throw new Error("Couldn't load "+t+". Status: "+r.status);var e,n=Number(r.getResponseHeader("Content-length")),o=(e=r.getResponseHeader("Accept-Ranges"))&&"bytes"===e,a=(e=r.getResponseHeader("Content-Encoding"))&&"gzip"===e,i=1048576;o||(i=n);var s=(r,e)=>{if(r>e)throw new Error("invalid range ("+r+", "+e+") or no bytes requested!");if(e>n-1)throw new Error("only "+n+" bytes available! programmer error!");var o=new XMLHttpRequest;if(o.open("GET",t,!1),n!==i&&o.setRequestHeader("Range","bytes="+r+"-"+e),o.responseType="arraybuffer",o.overrideMimeType&&o.overrideMimeType("text/plain; charset=x-user-defined"),o.send(null),!(o.status>=200&&o.status<300||304===o.status))throw new Error("Couldn't load "+t+". Status: "+o.status);return void 0!==o.response?new Uint8Array(o.response||[]):Ze(o.responseText||"")},l=this;l.setDataGetter(r=>{var e=r*i,t=(r+1)*i-1;if(t=Math.min(t,n-1),void 0===l.chunks[r]&&(l.chunks[r]=s(e,t)),void 0===l.chunks[r])throw new Error("doXHR failed!");return l.chunks[r]}),!a&&n||(i=n=1,n=this.getter(0).length,i=n,m("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=n,this._chunkSize=i,this.lengthKnown=!0}get length(){return this.lengthKnown||this.cacheLength(),this._length}get chunkSize(){return this.lengthKnown||this.cacheLength(),this._chunkSize}}if("undefined"!=typeof XMLHttpRequest){if(!s)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var i={isDevice:!1,contents:new a}}else i={isDevice:!1,url:t};var l=ct.createFile(r,e,i,n,o);i.contents?l.contents=i.contents:i.url&&(l.contents=null,l.url=i.url),Object.defineProperties(l,{usedBytes:{get:function(){return this.contents.length}}});var d={};function u(r,e,t,n,o){var a=r.node.contents;if(o>=a.length)return 0;var i=Math.min(a.length-o,n);if(a.slice)for(var s=0;s<i;s++)e[t+s]=a[o+s];else for(s=0;s<i;s++)e[t+s]=a.get(o+s);return i}return Object.keys(l.stream_ops).forEach(r=>{var e=l.stream_ops[r];d[r]=(...r)=>(ct.forceLoadFile(l),e(...r))}),d.read=(r,e,t,n,o)=>(ct.forceLoadFile(l),u(r,e,t,n,o)),d.mmap=(r,e,t,n,o)=>{ct.forceLoadFile(l);var a=tt();if(!a)throw new ct.ErrnoError(48);return u(r,w,a,e,t),{ptr:a,allocated:!0}},l.stream_ops=d,l}},ft={DEFAULT_POLLMASK:5,calculateAt(r,e,t){if(Ge.isAbs(e))return e;var n;if(n=-100===r?ct.cwd():ft.getStreamFromFD(r).path,0==e.length){if(!t)throw new ct.ErrnoError(44);return n}return n+"/"+e},doStat(r,e,t){var n=r(e);b[t>>2]=n.dev,b[t+4>>2]=n.mode,k[t+8>>2]=n.nlink,b[t+12>>2]=n.uid,b[t+16>>2]=n.gid,b[t+20>>2]=n.rdev,I=[n.size>>>0,(H=n.size,+Math.abs(H)>=1?H>0?+Math.floor(H/4294967296)>>>0:~~+Math.ceil((H-+(~~H>>>0))/4294967296)>>>0:0)],b[t+24>>2]=I[0],b[t+28>>2]=I[1],b[t+32>>2]=4096,b[t+36>>2]=n.blocks;var o=n.atime.getTime(),a=n.mtime.getTime(),i=n.ctime.getTime();return I=[Math.floor(o/1e3)>>>0,(H=Math.floor(o/1e3),+Math.abs(H)>=1?H>0?+Math.floor(H/4294967296)>>>0:~~+Math.ceil((H-+(~~H>>>0))/4294967296)>>>0:0)],b[t+40>>2]=I[0],b[t+44>>2]=I[1],k[t+48>>2]=o%1e3*1e3*1e3,I=[Math.floor(a/1e3)>>>0,(H=Math.floor(a/1e3),+Math.abs(H)>=1?H>0?+Math.floor(H/4294967296)>>>0:~~+Math.ceil((H-+(~~H>>>0))/4294967296)>>>0:0)],b[t+56>>2]=I[0],b[t+60>>2]=I[1],k[t+64>>2]=a%1e3*1e3*1e3,I=[Math.floor(i/1e3)>>>0,(H=Math.floor(i/1e3),+Math.abs(H)>=1?H>0?+Math.floor(H/4294967296)>>>0:~~+Math.ceil((H-+(~~H>>>0))/4294967296)>>>0:0)],b[t+72>>2]=I[0],b[t+76>>2]=I[1],k[t+80>>2]=i%1e3*1e3*1e3,I=[n.ino>>>0,(H=n.ino,+Math.abs(H)>=1?H>0?+Math.floor(H/4294967296)>>>0:~~+Math.ceil((H-+(~~H>>>0))/4294967296)>>>0:0)],b[t+88>>2]=I[0],b[t+92>>2]=I[1],0},doMsync(r,e,t,n,o){if(!ct.isFile(e.node.mode))throw new ct.ErrnoError(43);if(2&n)return 0;var a=g.slice(r,r+t);ct.msync(e,a,o,t,n)},getStreamFromFD:r=>ct.getStreamChecked(r),varargs:void 0,getStr:r=>ie(r)};function ht(r){try{var e=ft.getStreamFromFD(r);return ct.close(e),0}catch(t){if(void 0===ct||"ErrnoError"!==t.name)throw t;return t.errno}}var mt=(r,e,t,n)=>{for(var o=0,a=0;a<t;a++){var i=k[e>>2],s=k[e+4>>2];e+=8;var l=ct.read(r,w,i,s,n);if(l<0)return-1;if(o+=l,l<s)break}return o};function pt(r,e,t,n){try{var o=ft.getStreamFromFD(r),a=mt(o,e,t);return k[n>>2]=a,0}catch(i){if(void 0===ct||"ErrnoError"!==i.name)throw i;return i.errno}}var vt=(r,e)=>e+2097152>>>0<4194305-!!r?(r>>>0)+4294967296*e:NaN;function wt(r,e,t,n,o){var a=vt(e,t);try{if(isNaN(a))return 61;var i=ft.getStreamFromFD(r);return ct.llseek(i,a,n),I=[i.position>>>0,(H=i.position,+Math.abs(H)>=1?H>0?+Math.floor(H/4294967296)>>>0:~~+Math.ceil((H-+(~~H>>>0))/4294967296)>>>0:0)],b[o>>2]=I[0],b[o+4>>2]=I[1],i.getdents&&0===a&&0===n&&(i.getdents=null),0}catch(s){if(void 0===ct||"ErrnoError"!==s.name)throw s;return s.errno}}var gt=(r,e,t,n)=>{for(var o=0,a=0;a<t;a++){var i=k[e>>2],s=k[e+4>>2];e+=8;var l=ct.write(r,w,i,s,n);if(l<0)return-1;if(o+=l,l<s)break}return o};function yt(r,e,t,n){try{var o=ft.getStreamFromFD(r),a=gt(o,e,t);return k[n>>2]=a,0}catch(i){if(void 0===ct||"ErrnoError"!==i.name)throw i;return i.errno}}lr(),nr=o.BindingError=class extends Error{constructor(r){super(r),this.name="BindingError"}},or=o.InternalError=class extends Error{constructor(r){super(r),this.name="InternalError"}},Ar(),Nr=o.UnboundTypeError=Xr(Error,"UnboundTypeError"),ct.createPreloadedFile=lt,ct.staticInit(),nt.doesNotExistError=new ct.ErrnoError(44),nt.doesNotExistError.stack="<generic error, no stack>";var Et,bt={r:ar,x:ir,t:sr,E:yr,C:Fr,q:Cr,j:Qr,d:Zr,b:re,D:se,m:pe,F:ve,B:we,o:Ee,i:ke,k:Pe,a:kr,n:De,e:Te,l:Me,g:je,f:xe,h:Re,c:Ne,u:ze,A:We,v:qe,w:Xe,y:ht,z:pt,s:wt,p:yt};Z();var kt,_t=r=>(_t=Et.I)(r),At=r=>(At=Et.K)(r),Pt=r=>(Pt=Et.L)(r);function $t(){function r(){kt||(kt=!0,o.calledRun=!0,$||(M(),t(o),o.onRuntimeInitialized?.(),j()))}z>0||(T(),z>0||(o.setStatus?(o.setStatus("Running..."),setTimeout(()=>{setTimeout(()=>o.setStatus(""),1),r()},1)):r()))}if(o.dynCall_jiji=(r,e,t,n,a)=>(o.dynCall_jiji=Et.M)(r,e,t,n,a),o.dynCall_viijii=(r,e,t,n,a,i,s)=>(o.dynCall_viijii=Et.N)(r,e,t,n,a,i,s),o.dynCall_iiiiij=(r,e,t,n,a,i,s)=>(o.dynCall_iiiiij=Et.O)(r,e,t,n,a,i,s),o.dynCall_iiiiijj=(r,e,t,n,a,i,s,l,d)=>(o.dynCall_iiiiijj=Et.P)(r,e,t,n,a,i,s,l,d),o.dynCall_iiiiiijj=(r,e,t,n,a,i,s,l,d,u)=>(o.dynCall_iiiiiijj=Et.Q)(r,e,t,n,a,i,s,l,d,u),O=function r(){kt||$t(),kt||(O=r)},o.preInit)for("function"==typeof o.preInit&&(o.preInit=[o.preInit]);o.preInit.length>0;)o.preInit.pop()();return $t(),a});export{e as default};
package/chunks/vec3.js CHANGED
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{colorGamma as t}from"../colorUtils.js";import"../core/has.js";import{getCount as e}from"../geometry/support/buffer/math/common.js";function f(t,e,f){r(t.typedBuffer,e.typedBuffer,f,t.typedBufferStride,e.typedBufferStride)}function r(t,f,r,n=3,o=n){const i=e(t.length,n,3),u=e(f.length,o,3),a=Math.min(i,u),s=r[0],l=r[1],d=r[2],c=r[4],p=r[5],y=r[6],B=r[8],h=r[9],m=r[10],g=r[12],S=r[13],M=r[14];let b=0,j=0;for(let e=0;e<a;e++){const e=f[b],r=f[b+1],i=f[b+2];t[j]=s*e+c*r+B*i+g,t[j+1]=l*e+p*r+h*i+S,t[j+2]=d*e+y*r+m*i+M,b+=o,j+=n}return t}function n(t,e,f){o(t.typedBuffer,e.typedBuffer,f,t.typedBufferStride,e.typedBufferStride)}function o(t,f,r,n=3,o=n){const i=e(t.length,n,3),u=e(f.length,o,3),a=Math.min(i,u),s=r[0],l=r[1],d=r[2],c=r[3],p=r[4],y=r[5],B=r[6],h=r[7],m=r[8];let g=0,S=0;for(let e=0;e<a;e++){const e=f[g],r=f[g+1],i=f[g+2];t[S]=s*e+c*r+B*i,t[S+1]=l*e+p*r+h*i,t[S+2]=d*e+y*r+m*i,g+=o,S+=n}}function i(t,e,f){u(t.typedBuffer,e.typedBuffer,f,t.typedBufferStride,e.typedBufferStride)}function u(t,e,f,r=3,n=r){const o=Math.min(t.length/r,e.length/n);let i=0,u=0;for(let a=0;a<o;a++)t[u]=f*e[i],t[u+1]=f*e[i+1],t[u+2]=f*e[i+2],i+=n,u+=r;return t}function a(t,e,f,r){s(t.typedBuffer,e.typedBuffer,f,r,t.typedBufferStride,e.typedBufferStride)}function s(e,f,r,n,o=3,i=o){const u=Math.min(e.length/o,f.length/i);let a=0,s=0;const l=1/t;for(let t=0;t<u;t++)e[s]=n*(r*f[a])**l,e[s+1]=n*(r*f[a+1])**l,e[s+2]=n*(r*f[a+2])**l,a+=i,s+=o}function l(t,f,r,n=3,o=n){const i=e(t.length,n,3),u=e(f.length,o,3),a=Math.min(i,u);let s=0,l=0;for(let e=0;e<a;e++)t[l]=f[s]+r[0],t[l+1]=f[s+1]+r[1],t[l+2]=f[s+2]+r[2],s+=o,l+=n;return t}function d(t,e){c(t.typedBuffer,e.typedBuffer,t.typedBufferStride,e.typedBufferStride)}function c(t,e,f=3,r=f){const n=Math.min(t.length/f,e.length/r);let o=0,i=0;for(let u=0;u<n;u++){const n=e[o],u=e[o+1],a=e[o+2],s=n*n+u*u+a*a;if(s>0){const e=1/Math.sqrt(s);t[i]=e*n,t[i+1]=e*u,t[i+2]=e*a}o+=r,i+=f}}function p(t,e,f){const r=Math.min(t.count,e.count),n=t.typedBuffer,o=t.typedBufferStride,i=e.typedBuffer,u=e.typedBufferStride;let a=0,s=0;for(let l=0;l<r;l++)n[s]=i[a]>>f,n[s+1]=i[a+1]>>f,n[s+2]=i[a+2]>>f,a+=u,s+=o}const y=Object.freeze(Object.defineProperty({__proto__:null,linearToSRGB:s,linearToSRGBView:a,normalize:c,normalizeView:d,scale:u,scaleView:i,shiftRight:p,transformMat3:o,transformMat3View:n,transformMat4:r,transformMat4View:f,translate:l},Symbol.toStringTag,{value:"Module"}));export{r as a,o as b,f as c,n as d,d as e,s as f,i as g,p as h,a as l,c as n,u as s,l as t,y as v};
2
+ import{colorGamma as t}from"../colorUtils.js";import"../core/has.js";import{getCount as e}from"../geometry/support/buffer/math/common.js";function f(t,e,f){r(t.typedBuffer,e.typedBuffer,f,t.typedBufferStride,e.typedBufferStride)}function r(t,f,r,n=3,o=n){const i=e(t.length,n,3),u=e(f.length,o,3),a=Math.min(i,u),s=r[0],l=r[1],d=r[2],c=r[4],p=r[5],y=r[6],B=r[8],h=r[9],m=r[10],g=r[12],S=r[13],M=r[14];let b=0,j=0;for(let e=0;e<a;e++){const e=f[b],r=f[b+1],i=f[b+2];t[j]=s*e+c*r+B*i+g,t[j+1]=l*e+p*r+h*i+S,t[j+2]=d*e+y*r+m*i+M,b+=o,j+=n}return t}function n(t,e,f){o(t.typedBuffer,e.typedBuffer,f,t.typedBufferStride,e.typedBufferStride)}function o(t,f,r,n=3,o=n){const i=e(t.length,n,3),u=e(f.length,o,3),a=Math.min(i,u),s=r[0],l=r[1],d=r[2],c=r[3],p=r[4],y=r[5],B=r[6],h=r[7],m=r[8];let g=0,S=0;for(let e=0;e<a;e++){const e=f[g],r=f[g+1],i=f[g+2];t[S]=s*e+c*r+B*i,t[S+1]=l*e+p*r+h*i,t[S+2]=d*e+y*r+m*i,g+=o,S+=n}}function i(t,e,f){u(t.typedBuffer,e.typedBuffer,f,t.typedBufferStride,e.typedBufferStride)}function u(t,e,f,r=3,n=r){const o=Math.min(t.length/r,e.length/n);let i=0,u=0;for(let a=0;a<o;a++)t[u]=f*e[i],t[u+1]=f*e[i+1],t[u+2]=f*e[i+2],i+=n,u+=r;return t}function a(t,e,f,r){s(t.typedBuffer,e.typedBuffer,f,r,t.typedBufferStride,e.typedBufferStride)}function s(e,f,r,n,o=3,i=o){const u=Math.min(e.length/o,f.length/i);let a=0,s=0;const l=1/t;for(let t=0;t<u;t++)e[s]=n*(r*f[a])**l,e[s+1]=n*(r*f[a+1])**l,e[s+2]=n*(r*f[a+2])**l,a+=i,s+=o}function l(t,f,r,n=3,o=n){const i=e(t.length,n,3),u=e(f.length,o,3),a=Math.min(i,u);let s=0,l=0;for(let e=0;e<a;e++)t[l]=f[s]+r[0],t[l+1]=f[s+1]+r[1],t[l+2]=f[s+2]+r[2],s+=o,l+=n;return t}function d(t,e){c(t.typedBuffer,e.typedBuffer,t.typedBufferStride,e.typedBufferStride)}function c(t,e,f=3,r=f){const n=Math.min(t.length/f,e.length/r);let o=0,i=0;for(let u=0;u<n;u++){const n=e[o],u=e[o+1],a=e[o+2],s=n*n+u*u+a*a;if(s>0){const e=1/Math.sqrt(s);t[i]=e*n,t[i+1]=e*u,t[i+2]=e*a}o+=r,i+=f}}function p(t,e,f){const r=Math.min(t.count,e.count),n=t.typedBuffer,o=t.typedBufferStride,i=e.typedBuffer,u=e.typedBufferStride;let a=0,s=0;for(let l=0;l<r;l++)n[s]=i[a]>>f,n[s+1]=i[a+1]>>f,n[s+2]=i[a+2]>>f,a+=u,s+=o}const y=Object.freeze(Object.defineProperty({__proto__:null,linearToSRGB:s,linearToSRGBView:a,normalize:c,normalizeView:d,scale:u,scaleView:i,shiftRight:p,transformMat3:o,transformMat3View:n,transformMat4:r,transformMat4View:f,translate:l},Symbol.toStringTag,{value:"Module"}));export{l as a,o as b,f as c,n as d,d as e,s as f,i as g,p as h,a as l,c as n,u as s,r as t,y as v};
package/config.js CHANGED
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import"./core/has.js";import{deepMerge as e}from"./core/object.js";const s={apiKey:void 0,apiKeys:{scopes:[]},applicationName:"",applicationUrl:globalThis.location?.href,assetsPath:"",fontsUrl:"https://static.arcgis.com/fonts",geometryServiceUrl:"https://utility.arcgisonline.com/arcgis/rest/services/Geometry/GeometryServer",geoRSSServiceUrl:"https://utility.arcgis.com/sharing/rss",kmlServiceUrl:"https://utility.arcgis.com/sharing/kml",userPrivilegesApplied:!0,portalUrl:"https://www.arcgis.com",respectPrefersReducedMotion:!0,routeServiceUrl:"https://route-api.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World",workers:{loaderConfig:{has:{},paths:{},map:{},packages:[]}},request:{crossOriginNoCorsDomains:null,httpsDomains:["arcgis.com","arcgisonline.com","esrikr.com","premiumservices.blackbridge.com","esripremium.accuweather.com","gbm.digitalglobe.com","firstlook.digitalglobe.com","msi.digitalglobe.com"],interceptors:[],internalInterceptors:[],maxUrlLength:2e3,priority:"high",proxyRules:[],proxyUrl:null,timeout:62e3,trustedServers:[],useIdentity:!0},log:{interceptors:[],level:null}};if(globalThis.esriConfig&&(e(s,globalThis.esriConfig,!0),delete s.has),!s.assetsPath){{const e="5.2.0-next.48";s.assetsPath=`https://cdn.jsdelivr.net/npm/@arcgis/core@${e}/assets`}s.defaultAssetsPath=s.assetsPath}export{s as default};
2
+ import"./core/has.js";import{deepMerge as e}from"./core/object.js";const s={apiKey:void 0,apiKeys:{scopes:[]},applicationName:"",applicationUrl:globalThis.location?.href,assetsPath:"",fontsUrl:"https://static.arcgis.com/fonts",geometryServiceUrl:"https://utility.arcgisonline.com/arcgis/rest/services/Geometry/GeometryServer",geoRSSServiceUrl:"https://utility.arcgis.com/sharing/rss",kmlServiceUrl:"https://utility.arcgis.com/sharing/kml",userPrivilegesApplied:!0,portalUrl:"https://www.arcgis.com",respectPrefersReducedMotion:!0,routeServiceUrl:"https://route-api.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World",workers:{loaderConfig:{has:{},paths:{},map:{},packages:[]}},request:{crossOriginNoCorsDomains:null,httpsDomains:["arcgis.com","arcgisonline.com","esrikr.com","premiumservices.blackbridge.com","esripremium.accuweather.com","gbm.digitalglobe.com","firstlook.digitalglobe.com","msi.digitalglobe.com"],interceptors:[],internalInterceptors:[],maxUrlLength:2e3,priority:"high",proxyRules:[],proxyUrl:null,timeout:62e3,trustedServers:[],useIdentity:!0},log:{interceptors:[],level:null}};if(globalThis.esriConfig&&(e(s,globalThis.esriConfig,!0),delete s.has),!s.assetsPath){{const e="5.2.0-next.49";s.assetsPath=`https://cdn.jsdelivr.net/npm/@arcgis/core@${e}/assets`}s.defaultAssetsPath=s.assetsPath}export{s as default};
package/core/has.js CHANGED
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- const e=globalThis,a={...e.esriConfig?.has};function has(d){return"function"==typeof a[d]?a[d]=a[d](e):a[d]}has.add=(e,d,r,t)=>{(t||void 0===a[e])&&(a[e]=d),r&&has(e)},has.cache=a,has.add("big-integer-warning-enabled",!0),has.add("esri-deprecation-warnings",!0),has.add("esri-tests-disable-screenshots",!1),has.add("esri-tests-use-full-window",!1),has.add("esri-tests-post-to-influx",!0),has.add("esri-cim-animations-enable-status","enabled"),has.add("esri-cim-animations-spotlight",!1),has.add("esri-cim-animations-freeze-time",!1),(()=>{has.add("host-webworker",void 0!==e.WorkerGlobalScope&&self instanceof e.WorkerGlobalScope);const a="undefined"!=typeof window&&"undefined"!=typeof location&&"undefined"!=typeof document&&window.location===location&&window.document===document;if(has.add("host-browser",a),has.add("host-node",!("object"!=typeof e.process||!e.process.versions?.node||!e.process.versions.v8)),has.add("dom",a),has("host-browser")){const e=navigator,a=e.userAgent,d=e.appVersion,r=parseFloat(d);if(has.add("wp",parseFloat(a.split("Windows Phone")[1])||void 0),has.add("msapp",parseFloat(a.split("MSAppHost/")[1])||void 0),has.add("khtml",d.includes("Konqueror")?r:void 0),has.add("edge",parseFloat(a.split("Edge/")[1])||void 0),has.add("opr",parseFloat(a.split("OPR/")[1])||void 0),has.add("webkit",!has("wp")&&!has("edge")&&parseFloat(a.split("WebKit/")[1])||void 0),has.add("chrome",!has("edge")&&!has("opr")&&parseFloat(a.split("Chrome/")[1])||void 0),has.add("android",!has("wp")&&parseFloat(a.split("Android ")[1])||void 0),has.add("safari",!d.includes("Safari")||has("wp")||has("chrome")||has("android")||has("edge")||has("opr")?void 0:parseFloat(d.split("Version/")[1])),has.add("mac",d.includes("Macintosh")),!has("wp")&&/(iPhone|iPod|iPad)/.test(a)){const e=RegExp.$1.replace(/P/,"p"),d=/OS ([\d_]+)/.test(a)?RegExp.$1:"1",r=parseFloat(d.replace(/_/,".").replaceAll("_",""));has.add(e,r),has.add("ios",r)}has("webkit")||(!a.includes("Gecko")||has("wp")||has("khtml")||has("edge")||has.add("mozilla",r),has("mozilla")&&has.add("ff",parseFloat(a.split("Firefox/")[1]||a.split("Minefield/")[1])||void 0))}})(),(()=>{if(e.navigator){const e=navigator.userAgent,a=/Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini|IEMobile/i.test(e),d=/iPhone/i.test(e);a&&has.add("esri-mobile",a),d&&has.add("esri-iPhone",d),has.add("esri-geolocation",!!navigator.geolocation)}has.add("esri-wasm","WebAssembly"in e),has.add("esri-performance-mode-frames-between-render",20),has.add("esri-force-performance-mode",!1),has.add("esri-shared-array-buffer",()=>{const a="SharedArrayBuffer"in e,d=!1===e.crossOriginIsolated;return a&&!d}),has.add("wasm-simd",()=>{const e=[0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,10,1,8,0,65,0,253,15,253,98,11];return WebAssembly.validate(new Uint8Array(e))}),has.add("esri-atomics","Atomics"in e),has.add("esri-workers","Worker"in e),has.add("web-feat:cache","caches"in e),has.add("esri-workers-arraybuffer-transfer",!has("safari")||Number(has("safari"))>=12),has.add("min-workers-pool-size",2),has.add("max-workers-pool-size",has("esri-mobile")?3:8),has.add("featurelayer-simplify-thresholds",[.5,.5,.5,.5]),has.add("featurelayer-simplify-payload-size-factors",[1,1,4]),has.add("featurelayer-animation-enabled",!0),has.add("featurelayer-hybrid-tile-enabled",!0),has.add("featurelayer-snapshot-enabled",!0),has.add("featurelayer-snapshot-initial-tolerance",0),has.add("featurelayer-snapshot-point-min-threshold",8e4),has.add("featurelayer-snapshot-point-max-threshold",4e5),has.add("featurelayer-snapshot-multipoint-min-threshold",2e4),has.add("featurelayer-snapshot-multipoint-max-threshold",1e5),has.add("featurelayer-snapshot-polygon-min-threshold",2e3),has.add("featurelayer-snapshot-polygon-max-threshold",2e3),has.add("featurelayer-snapshot-polyline-min-threshold",2e3),has.add("featurelayer-snapshot-polyline-max-threshold",2e3),has.add("featurelayer-snapshot-max-vertex-count",25e4),has.add("featurelayer-snapshot-non-hosted-exceedslimit-enabled",!0),has.add("featurelayer-snapshot-concurrency",4),has.add("featurelayer-snapshot-allow-editable",!1),has.add("featurelayer-snapshot-coverage",.1),has.add("featurelayer-pixel-buffering-enabled",!0),has.add("featurelayer-query-max-depth",4),has.add("featurelayer-query-max-page-size",8e3),has.add("featurelayer-query-pausing-enabled",!1),has.add("featurelayer-query-tile-concurrency",4),has.add("featurelayer-query-tile-max-features",6e5),has.add("featurelayer-advanced-symbols",!1),has.add("featurelayer-pbf",!0),has.add("featurelayer-pbf-statistics",!1),has.add("featurelayer-pbf-true-curves",!0),has.add("feature-layers-workers",!0),has.add("feature-polyline-generalization-factor",1),has.add("featurelayer-relative-time-queries-enabled",!0),has.add("featurelayer-relative-time-queries-bin-window-public",1),has.add("featurelayer-relative-time-queries-bin-window-private",60),has.add("parquetlayer-full-query-feature-count",5e5),has.add("parquetlayer-persistence-enabled",!0),has.add("parquetlayer-cache-enabled",!0),has.add("parquetlayer-legacy-field-overrides-enabled",!1),has.add("mapview-transitions-duration",200),has.add("mapview-essential-goto-duration",200),has.add("mapview-srswitch-adjust-rotation-scale-threshold",24e6),has.add("mapserver-pbf-version-support",10.81),has.add("mapservice-popup-identify-max-tolerance",20),has.add("request-queue-concurrency-global",64),has.add("request-queue-concurrency-hosted",16),has.add("request-queue-concurrency-non-hosted",16),has.add("curve-densification-coarse-segments",128),has.add("curve-densification-max-segments",2e3),has.add("curve-densification-min-segments",3),has.add("curve-densification-pixel-deviation",.5),has.add("view-readyState-waiting-delay",1e3),has.add("gradient-depth-bias",.01),has.add("gradient-depth-epsilon",1e-8),has.add("enable-feature:analysis-drawtool-line-of-sight",!1),has.add("enable-feature:analysis-drawtool-line-of-sight-placement-visuals",!1),has.add("enable-feature:esri-compress-textures",!0),has.add("enable-feature:analysis-new-viewshed-tool",!0),has.add("enable-feature:basemap-groundlayers",!0),has.add("enable-feature:im-shading",!0),has.add("enable-feature:im-vertex-normals",!0),!has("host-webworker")&&has("host-browser")&&(has.add("esri-csp-restrictions",()=>{try{new Function}catch{return!0}return!1}),has.add("esri-url-encodes-apostrophe",()=>{const e=window.document.createElement("a");return e.href="?'",e.href.includes("?%27")}))})();export{has as default};
2
+ const e=globalThis,a={...e.esriConfig?.has};function has(d){return"function"==typeof a[d]?a[d]=a[d](e):a[d]}has.add=(e,d,r,t)=>{(t||void 0===a[e])&&(a[e]=d),r&&has(e)},has.cache=a,has.add("big-integer-warning-enabled",!0),has.add("esri-deprecation-warnings",!0),has.add("esri-tests-disable-screenshots",!1),has.add("esri-tests-use-full-window",!1),has.add("esri-tests-post-to-influx",!0),has.add("esri-cim-animations-enable-status","enabled"),has.add("esri-cim-animations-spotlight",!1),has.add("esri-cim-animations-freeze-time",!1),(()=>{has.add("host-webworker",void 0!==e.WorkerGlobalScope&&self instanceof e.WorkerGlobalScope);const a="undefined"!=typeof window&&"undefined"!=typeof location&&"undefined"!=typeof document&&window.location===location&&window.document===document;if(has.add("host-browser",a),has.add("host-node",!("object"!=typeof e.process||!e.process.versions?.node||!e.process.versions.v8)),has.add("dom",a),has("host-browser")){const e=navigator,a=e.userAgent,d=e.appVersion,r=parseFloat(d);if(has.add("wp",parseFloat(a.split("Windows Phone")[1])||void 0),has.add("msapp",parseFloat(a.split("MSAppHost/")[1])||void 0),has.add("khtml",d.includes("Konqueror")?r:void 0),has.add("edge",parseFloat(a.split("Edge/")[1])||void 0),has.add("opr",parseFloat(a.split("OPR/")[1])||void 0),has.add("webkit",!has("wp")&&!has("edge")&&parseFloat(a.split("WebKit/")[1])||void 0),has.add("chrome",!has("edge")&&!has("opr")&&parseFloat(a.split("Chrome/")[1])||void 0),has.add("android",!has("wp")&&parseFloat(a.split("Android ")[1])||void 0),has.add("safari",!d.includes("Safari")||has("wp")||has("chrome")||has("android")||has("edge")||has("opr")?void 0:parseFloat(d.split("Version/")[1])),has.add("mac",d.includes("Macintosh")),!has("wp")&&/(iPhone|iPod|iPad)/.test(a)){const e=RegExp.$1.replace(/P/,"p"),d=/OS ([\d_]+)/.test(a)?RegExp.$1:"1",r=parseFloat(d.replace(/_/,".").replaceAll("_",""));has.add(e,r),has.add("ios",r)}has("webkit")||(!a.includes("Gecko")||has("wp")||has("khtml")||has("edge")||has.add("mozilla",r),has("mozilla")&&has.add("ff",parseFloat(a.split("Firefox/")[1]||a.split("Minefield/")[1])||void 0))}})(),(()=>{if(e.navigator){const e=navigator.userAgent,a=/Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini|IEMobile/i.test(e),d=/iPhone/i.test(e);a&&has.add("esri-mobile",a),d&&has.add("esri-iPhone",d),has.add("esri-geolocation",!!navigator.geolocation)}has.add("esri-wasm","WebAssembly"in e),has.add("esri-performance-mode-frames-between-render",20),has.add("esri-force-performance-mode",!1),has.add("esri-shared-array-buffer",()=>{const a="SharedArrayBuffer"in e,d=!1===e.crossOriginIsolated;return a&&!d}),has.add("wasm-simd",()=>{const e=[0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,10,1,8,0,65,0,253,15,253,98,11];return WebAssembly.validate(new Uint8Array(e))}),has.add("esri-atomics","Atomics"in e),has.add("esri-workers","Worker"in e),has.add("web-feat:cache","caches"in e),has.add("esri-workers-arraybuffer-transfer",!has("safari")||Number(has("safari"))>=12),has.add("min-workers-pool-size",2),has.add("max-workers-pool-size",has("esri-mobile")?3:8),has.add("featurelayer-simplify-thresholds",[.5,.5,.5,.5]),has.add("featurelayer-simplify-payload-size-factors",[1,1,4]),has.add("featurelayer-animation-enabled",!0),has.add("featurelayer-hybrid-tile-enabled",!0),has.add("featurelayer-snapshot-enabled",!0),has.add("featurelayer-snapshot-initial-tolerance",0),has.add("featurelayer-snapshot-point-min-threshold",8e4),has.add("featurelayer-snapshot-point-max-threshold",4e5),has.add("featurelayer-snapshot-multipoint-min-threshold",2e4),has.add("featurelayer-snapshot-multipoint-max-threshold",1e5),has.add("featurelayer-snapshot-polygon-min-threshold",2e3),has.add("featurelayer-snapshot-polygon-max-threshold",2e3),has.add("featurelayer-snapshot-polyline-min-threshold",2e3),has.add("featurelayer-snapshot-polyline-max-threshold",2e3),has.add("featurelayer-snapshot-max-vertex-count",25e4),has.add("featurelayer-snapshot-non-hosted-exceedslimit-enabled",!0),has.add("featurelayer-snapshot-concurrency",4),has.add("featurelayer-snapshot-allow-editable",!1),has.add("featurelayer-snapshot-coverage",.1),has.add("featurelayer-pixel-buffering-enabled",!0),has.add("featurelayer-query-max-depth",4),has.add("featurelayer-query-max-page-size",8e3),has.add("featurelayer-query-pausing-enabled",!1),has.add("featurelayer-query-tile-concurrency",4),has.add("featurelayer-query-tile-max-features",6e5),has.add("featurelayer-advanced-symbols",!1),has.add("featurelayer-pbf",!0),has.add("featurelayer-pbf-statistics",!1),has.add("featurelayer-pbf-true-curves",!0),has.add("feature-layers-workers",!0),has.add("feature-polyline-generalization-factor",1),has.add("featurelayer-relative-time-queries-enabled",!0),has.add("featurelayer-relative-time-queries-bin-window-public",1),has.add("featurelayer-relative-time-queries-bin-window-private",60),has.add("parquetlayer-full-query-feature-count",5e5),has.add("parquetlayer-persistence-enabled",!0),has.add("parquetlayer-cache-enabled",!0),has.add("parquetlayer-legacy-field-overrides-enabled",!1),has.add("mapview-transitions-duration",200),has.add("mapview-essential-goto-duration",200),has.add("mapview-srswitch-adjust-rotation-scale-threshold",24e6),has.add("mapserver-pbf-version-support",10.81),has.add("mapservice-popup-identify-max-tolerance",20),has.add("request-queue-concurrency-global",64),has.add("request-queue-concurrency-hosted",16),has.add("request-queue-concurrency-non-hosted",16),has.add("curve-densification-coarse-segments",128),has.add("curve-densification-max-segments",2e3),has.add("curve-densification-min-segments",3),has.add("curve-densification-pixel-deviation",.5),has.add("view-readyState-waiting-delay",1e3),has.add("gradient-depth-bias",.01),has.add("gradient-depth-epsilon",1e-8),has.add("enable-feature:analysis-drawtool-line-of-sight",!0),has.add("enable-feature:esri-compress-textures",!0),has.add("enable-feature:basemap-groundlayers",!0),has.add("enable-feature:im-shading",!0),has.add("enable-feature:im-vertex-normals",!0),!has("host-webworker")&&has("host-browser")&&(has.add("esri-csp-restrictions",()=>{try{new Function}catch{return!0}return!1}),has.add("esri-url-encodes-apostrophe",()=>{const e=window.document.createElement("a");return e.href="?'",e.href.includes("?%27")}))})();export{has as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{len as n}from"../../core/libs/gl-matrix-2/math/vec3.js";import t from"../Extent.js";import{create as r}from"./aaBoundingRect.js";import{newDoubleArray as a}from"./DoubleArray.js";function i(n){return n}function u(n=en){return i([n[0],n[1],n[2],n[3],n[4],n[5]])}function e(n,t){for(let r=0;r<6;r++)n[r]=t[r];return n}function m(n,t,r,a,i,e,m=u()){return m[0]=n,m[1]=t,m[2]=r,m[3]=a,m[4]=i,m[5]=e,m}function o(n,t=u()){return t[0]=n.xmin,t[1]=n.ymin,t[2]=n.hasZ?n.zmin:-1/0,t[3]=n.xmax,t[4]=n.ymax,t[5]=n.hasZ?n.zmax:1/0,t}function f(n,t=u()){return c(n,0,n.length/3,t)}function c(n,t,r,a=u()){return L(a,un),g(a,n,t,r),a}function h(n){n[0]=1/0,n[1]=1/0,n[2]=1/0,n[3]=-1/0,n[4]=-1/0,n[5]=-1/0}function M(n,t){for(let r=0;r<6;r++)if(n[r]!==t[r])return!1;return!0}function x(n){return!(n[0]<=n[3]&&n[1]<=n[4]&&n[2]<=n[5])}function l(n,t=a(24)){const[r,i,u,e,m,o]=n;return t[0]=r,t[1]=i,t[2]=u,t[3]=r,t[4]=i,t[5]=o,t[6]=r,t[7]=m,t[8]=u,t[9]=r,t[10]=m,t[11]=o,t[12]=e,t[13]=i,t[14]=u,t[15]=e,t[16]=i,t[17]=o,t[18]=e,t[19]=m,t[20]=u,t[21]=e,t[22]=m,t[23]=o,t}function s(n,r){const a=isFinite(n[2])||isFinite(n[5]);return new t(a?{xmin:n[0],xmax:n[3],ymin:n[1],ymax:n[4],zmin:n[2],zmax:n[5],spatialReference:r}:{xmin:n[0],xmax:n[3],ymin:n[1],ymax:n[4],spatialReference:r})}function N(n,t,r=u()){return r[0]=n[0],r[1]=n[1],r[2]=n[2],r[3]=t[0],r[4]=t[1],r[5]=t[2],r}function I(n,t,r=n){r[0]=Math.min(n[0],t[0]),r[1]=Math.min(n[1],t[1]),r[2]=Math.min(n[2],t[2]),r[3]=Math.max(n[3],t[3]),r[4]=Math.max(n[4],t[4]),r[5]=Math.max(n[5],t[5])}function b(n,t){n[0]=Math.min(n[0],t[0]),n[1]=Math.min(n[1],t[1]),n[3]=Math.max(n[3],t[2]),n[4]=Math.max(n[4],t[3])}function y(n,t){n[0]=Math.min(n[0],t[0]),n[1]=Math.min(n[1],t[1]),n[2]=Math.min(n[2],t[2]),n[3]=Math.max(n[3],t[0]),n[4]=Math.max(n[4],t[1]),n[5]=Math.max(n[5],t[2])}function g(n,t,r=0,a=t.length/3){let i=n[0],u=n[1],e=n[2],m=n[3],o=n[4],f=n[5];for(let c=0;c<a;c++)i=Math.min(i,t[r+3*c]),u=Math.min(u,t[r+3*c+1]),e=Math.min(e,t[r+3*c+2]),m=Math.max(m,t[r+3*c]),o=Math.max(o,t[r+3*c+1]),f=Math.max(f,t[r+3*c+2]);n[0]=i,n[1]=u,n[2]=e,n[3]=m,n[4]=o,n[5]=f}function T(n,t,r,a){n[0]=Math.min(n[0],n[0]+t),n[3]=Math.max(n[3],n[3]+t),n[1]=Math.min(n[1],n[1]+r),n[4]=Math.max(n[4],n[4]+r),n[2]=Math.min(n[2],n[2]+a),n[5]=Math.max(n[5],n[5]+a)}function p(n,{xmin:t,ymin:r,zmin:a,xmax:i,ymax:u,zmax:e}){n[0]=Math.min(n[0],t),n[3]=Math.max(n[3],i),n[1]=Math.min(n[1],r),n[4]=Math.max(n[4],u),n[2]=Math.min(n[2],a??-1/0),n[5]=Math.max(n[5],e??1/0)}function E(n,t,r){const a=t.length;let i=n[0],u=n[1],e=n[2],m=n[3],o=n[4],f=n[5];if(r)for(let c=0;c<a;c++){const n=t[c];i=Math.min(i,n[0]),u=Math.min(u,n[1]),e=Math.min(e,n[2]),m=Math.max(m,n[0]),o=Math.max(o,n[1]),f=Math.max(f,n[2])}else for(let c=0;c<a;c++){const n=t[c];i=Math.min(i,n[0]),u=Math.min(u,n[1]),m=Math.max(m,n[0]),o=Math.max(o,n[1])}n[0]=i,n[1]=u,n[2]=e,n[3]=m,n[4]=o,n[5]=f}function F(n){for(let t=0;t<6;t++)if(!isFinite(n[t]))return!1;return!0}function z(n){return n[0]>=n[3]?0:n[3]-n[0]}function j(n){return n[1]>=n[4]?0:n[4]-n[1]}function V(n){return n[2]>=n[5]?0:n[5]-n[2]}function Y(n){const t=z(n),r=V(n),a=j(n);return Math.sqrt(t*t+r*r+a*a)}function _(n,t=[0,0,0]){return t[0]=n[0]+z(n)/2,t[1]=n[1]+j(n)/2,t[2]=n[2]+V(n)/2,t}function d(n,t=[0,0,0]){return t[0]=z(n),t[1]=j(n),t[2]=V(n),t}function A(n){return Math.max(z(n),V(n),j(n))}function R(n,t){return t[0]>=n[0]&&t[1]>=n[1]&&t[2]>=n[2]&&t[0]<=n[3]&&t[1]<=n[4]&&t[2]<=n[5]}function G(n,t,r){return t[0]>=n[0]-r&&t[1]>=n[1]-r&&t[2]>=n[2]-r&&t[0]<=n[3]+r&&t[1]<=n[4]+r&&t[2]<=n[5]+r}function O(n,t){return t[0]>=n[0]&&t[1]>=n[1]&&t[2]>=n[2]&&t[3]<=n[3]&&t[4]<=n[4]&&t[5]<=n[5]}function P(n,t){const{center:r,radius:a}=t;let i=0;for(let u=0;u<3;u++)i+=Math.max(Math.abs(n[u]-r[u]),Math.abs(n[u+3]-r[u]))**2;return i<=a**2}function S(n,t){return Math.max(t[0],n[0])<=Math.min(t[3],n[3])&&Math.max(t[1],n[1])<=Math.min(t[4],n[4])&&Math.max(t[2],n[2])<=Math.min(t[5],n[5])}function Z(n,t){return null==t||S(n,t)}function k(n,t,r){let a=0,i=1;for(let u=0;u<3;++u){const e=n[u],m=n[u+3],o=t[u],f=r[u],c=f<o,h=c?f:o,M=c?o:f,x=Math.max(e,h),l=Math.min(m,M);if(x>l)return!1;if(M===h)break;const s=M-h,N=(x-h)/s,I=(l-h)/s;if(a=Math.max(a,c?1-I:N),i=Math.min(i,c?1-N:I),a>i)return!1}return!0}function q(n,t){const{center:r,radius:a}=t;let i=0;for(let u=0;u<3;u++){const t=Math.max(0,n[u]-r[u],r[u]-n[u+3]);if(t>a)return!1;i+=t**2}return i<=a**2}function v(t,r,a,i){const u=1e-8;let{tMin:e,tMax:m}=i;if(!(e<m))return null;if(!(Math.abs(n(a)-1)<1e-4))return null;for(let n=0;n<3;n++){const i=a[n],o=r[n],f=t[n],c=t[n+3];if(!(f<c))return null;if(Math.abs(i)<u){if(o<f||o>c)return null;continue}const h=1/i,M=(f-o)*h,x=(c-o)*h,l=h<0?x:M,s=h<0?M:x;if(e=Math.max(e,l),m=Math.min(m,s),m<=e)return null}return{tMin:e,tMax:m}}function w(n,t){const r=t[3];let a=r,i=r;for(let u=0;u<3;u++){const r=t[u],e=r*n[u],m=r*n[u+3];a+=Math.min(e,m),i+=Math.max(e,m)}return a>0?a:i<0?i:0}function B(n,t,r,a,i=n){return i[0]=n[0]+t,i[1]=n[1]+r,i[2]=n[2]+a,i[3]=n[3]+t,i[4]=n[4]+r,i[5]=n[5]+a,i}function D(n,t,r=n){const a=n[0]+z(n)/2,i=n[1]+j(n)/2,u=n[2]+V(n)/2;return r[0]=a+(n[0]-a)*t,r[1]=i+(n[1]-i)*t,r[2]=u+(n[2]-u)*t,r[3]=a+(n[3]-a)*t,r[4]=i+(n[4]-i)*t,r[5]=u+(n[5]-u)*t,r}function C(n,t){return t[0]=n[0],t[1]=n[1],t[2]=n[2],t}function H(n,t){return t[0]=n[3],t[1]=n[4],t[2]=n[5],t}function J(n,t,r=n){return r[0]=t[0],r[1]=t[1],r[2]=t[2],r!==n&&(r[3]=n[3],r[4]=n[4],r[5]=n[5]),r}function K(n,t,r=n){return r[3]=t[0],r[4]=t[1],r[5]=t[2],r!==n&&(r[0]=n[0],r[1]=n[1],r[2]=n[2]),n}function L(n,t){return n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n}function Q(n){return n?L(n,un):u(un)}function U(n,t=r()){return t[0]=n[0],t[1]=n[1],t[2]=n[3],t[3]=n[4],t}function W(n,t){return n[0]=t[0],n[1]=t[1],n[2]=Number.NEGATIVE_INFINITY,n[3]=t[2],n[4]=t[3],n[5]=Number.POSITIVE_INFINITY,n}function X(n,t,r,a,i){return n[0]=t,n[1]=r,n[2]=Number.NEGATIVE_INFINITY,n[3]=a,n[4]=i,n[5]=Number.POSITIVE_INFINITY,n}function $(n){return 6===n.length}function nn(n){return 0===z(n)&&0===j(n)&&0===V(n)}function tn(n,t,r){if(null==n||null==t)return n===t;if(!$(n)||!$(t))return!1;if(r){for(let a=0;a<n.length;a++)if(!r(n[a],t[a]))return!1}else for(let a=0;a<n.length;a++)if(n[a]!==t[a])return!1;return!0}function rn(n,t,r,a,i,u){return m(n,t,r,a,i,u,on)}const an=i([-1/0,-1/0,-1/0,1/0,1/0,1/0]),un=i([1/0,1/0,1/0,-1/0,-1/0,-1/0]),en=i([0,0,0,0,0,0]),mn=i([NaN,NaN,NaN,NaN,NaN,NaN]),on=u();export{F as allFinite,_ as center,P as containedBySphere,O as contains,R as containsPoint,G as containsPointWithMargin,e as copy,u as create,j as depth,Y as diameter,Q as empty,tn as equals,M as exactEquals,I as expandWithAABB,g as expandWithBuffer,p as expandWithExtent,E as expandWithNestedArray,T as expandWithOffset,b as expandWithRect,y as expandWithVec3,f as fromBuffer,o as fromExtent,N as fromMinMax,W as fromRect,X as fromRectValues,c as fromSubBuffer,m as fromValues,H as getMax,C as getMin,V as height,S as intersects,Z as intersectsClippingArea,v as intersectsRay,k as intersectsSegment,q as intersectsSphere,$ as is,x as isEmpty,nn as isPoint,A as maximumDimension,mn as nan,un as negativeInfinity,B as offset,an as positiveInfinity,D as scale,L as set,h as setEmpty,K as setMax,J as setMin,w as signedDistanceFromPlane,d as size,l as toCorners,s as toExtent,U as toRect,z as width,rn as wrap,en as zero};
2
+ import{len as n}from"../../core/libs/gl-matrix-2/math/vec3.js";import t from"../Extent.js";import{create as r}from"./aaBoundingRect.js";import{newDoubleArray as a}from"./DoubleArray.js";function i(n){return n}function u(n=mn){return i([n[0],n[1],n[2],n[3],n[4],n[5]])}function e(n,t){for(let r=0;r<6;r++)n[r]=t[r];return n}function o(n,t,r,a,i,e,o=u()){return o[0]=n,o[1]=t,o[2]=r,o[3]=a,o[4]=i,o[5]=e,o}function m(n,t=u()){return t[0]=n.xmin,t[1]=n.ymin,t[2]=n.hasZ?n.zmin:-1/0,t[3]=n.xmax,t[4]=n.ymax,t[5]=n.hasZ?n.zmax:1/0,t}function f(n,t=u()){return c(n,0,n.length/3,t)}function c(n,t,r,a=u()){return U(a,on),T(a,n,t,r),a}function h(n){n[0]=1/0,n[1]=1/0,n[2]=1/0,n[3]=-1/0,n[4]=-1/0,n[5]=-1/0}function M(n,t){for(let r=0;r<6;r++)if(n[r]!==t[r])return!1;return!0}function x(n){return!(n[0]<=n[3]&&n[1]<=n[4]&&n[2]<=n[5])}function l(n,t=a(24)){const[r,i,u,e,o,m]=n;return t[0]=r,t[1]=i,t[2]=u,t[3]=r,t[4]=i,t[5]=m,t[6]=r,t[7]=o,t[8]=u,t[9]=r,t[10]=o,t[11]=m,t[12]=e,t[13]=i,t[14]=u,t[15]=e,t[16]=i,t[17]=m,t[18]=e,t[19]=o,t[20]=u,t[21]=e,t[22]=o,t[23]=m,t}function s(n,r){const a=isFinite(n[2])||isFinite(n[5]);return new t(a?{xmin:n[0],xmax:n[3],ymin:n[1],ymax:n[4],zmin:n[2],zmax:n[5],spatialReference:r}:{xmin:n[0],xmax:n[3],ymin:n[1],ymax:n[4],spatialReference:r})}function N(n,t,r=u()){return r[0]=n[0],r[1]=n[1],r[2]=n[2],r[3]=t[0],r[4]=t[1],r[5]=t[2],r}function I(n,t,r=n){r[0]=Math.min(n[0],t[0]),r[1]=Math.min(n[1],t[1]),r[2]=Math.min(n[2],t[2]),r[3]=Math.max(n[3],t[3]),r[4]=Math.max(n[4],t[4]),r[5]=Math.max(n[5],t[5])}function b(n,t){n[0]=Math.min(n[0],t[0]),n[1]=Math.min(n[1],t[1]),n[3]=Math.max(n[3],t[2]),n[4]=Math.max(n[4],t[3])}function y(n,[t,r,a]){g(n,t,r,a)}function g(n,t,r,a){n[0]=Math.min(n[0],t),n[1]=Math.min(n[1],r),n[2]=Math.min(n[2],a),n[3]=Math.max(n[3],t),n[4]=Math.max(n[4],r),n[5]=Math.max(n[5],a)}function T(n,t,r=0,a=t.length/3){let i=n[0],u=n[1],e=n[2],o=n[3],m=n[4],f=n[5];for(let c=0;c<a;c++)i=Math.min(i,t[r+3*c]),u=Math.min(u,t[r+3*c+1]),e=Math.min(e,t[r+3*c+2]),o=Math.max(o,t[r+3*c]),m=Math.max(m,t[r+3*c+1]),f=Math.max(f,t[r+3*c+2]);n[0]=i,n[1]=u,n[2]=e,n[3]=o,n[4]=m,n[5]=f}function p(n,t,r,a){n[0]=Math.min(n[0],n[0]+t),n[3]=Math.max(n[3],n[3]+t),n[1]=Math.min(n[1],n[1]+r),n[4]=Math.max(n[4],n[4]+r),n[2]=Math.min(n[2],n[2]+a),n[5]=Math.max(n[5],n[5]+a)}function E(n,{xmin:t,ymin:r,zmin:a,xmax:i,ymax:u,zmax:e}){n[0]=Math.min(n[0],t),n[3]=Math.max(n[3],i),n[1]=Math.min(n[1],r),n[4]=Math.max(n[4],u),n[2]=Math.min(n[2],a??-1/0),n[5]=Math.max(n[5],e??1/0)}function F(n,t,r){const a=t.length;let i=n[0],u=n[1],e=n[2],o=n[3],m=n[4],f=n[5];if(r)for(let c=0;c<a;c++){const n=t[c];i=Math.min(i,n[0]),u=Math.min(u,n[1]),e=Math.min(e,n[2]),o=Math.max(o,n[0]),m=Math.max(m,n[1]),f=Math.max(f,n[2])}else for(let c=0;c<a;c++){const n=t[c];i=Math.min(i,n[0]),u=Math.min(u,n[1]),o=Math.max(o,n[0]),m=Math.max(m,n[1])}n[0]=i,n[1]=u,n[2]=e,n[3]=o,n[4]=m,n[5]=f}function z(n){for(let t=0;t<6;t++)if(!isFinite(n[t]))return!1;return!0}function j(n){return n[0]>=n[3]?0:n[3]-n[0]}function V(n){return n[1]>=n[4]?0:n[4]-n[1]}function Y(n){return n[2]>=n[5]?0:n[5]-n[2]}function _(n){return Math.sqrt(d(n))}function d(n){const t=j(n),r=Y(n),a=V(n);return t*t+r*r+a*a}function A(n,t=[0,0,0]){return t[0]=n[0]+j(n)/2,t[1]=n[1]+V(n)/2,t[2]=n[2]+Y(n)/2,t}function R(n,t=[0,0,0]){return t[0]=j(n),t[1]=V(n),t[2]=Y(n),t}function G(n){return Math.max(j(n),Y(n),V(n))}function O(n,t){return t[0]>=n[0]&&t[1]>=n[1]&&t[2]>=n[2]&&t[0]<=n[3]&&t[1]<=n[4]&&t[2]<=n[5]}function P(n,t,r){return t[0]>=n[0]-r&&t[1]>=n[1]-r&&t[2]>=n[2]-r&&t[0]<=n[3]+r&&t[1]<=n[4]+r&&t[2]<=n[5]+r}function S(n,t){return t[0]>=n[0]&&t[1]>=n[1]&&t[2]>=n[2]&&t[3]<=n[3]&&t[4]<=n[4]&&t[5]<=n[5]}function Z(n,t){const{center:r,radius:a}=t;let i=0;for(let u=0;u<3;u++)i+=Math.max(Math.abs(n[u]-r[u]),Math.abs(n[u+3]-r[u]))**2;return i<=a**2}function k(n,t){return Math.max(t[0],n[0])<=Math.min(t[3],n[3])&&Math.max(t[1],n[1])<=Math.min(t[4],n[4])&&Math.max(t[2],n[2])<=Math.min(t[5],n[5])}function q(n,t){return null==t||k(n,t)}function v(n,t,r){let a=0,i=1;for(let u=0;u<3;++u){const e=n[u],o=n[u+3],m=t[u],f=r[u],c=f<m,h=c?f:m,M=c?m:f,x=Math.max(e,h),l=Math.min(o,M);if(x>l)return!1;if(M===h)break;const s=M-h,N=(x-h)/s,I=(l-h)/s;if(a=Math.max(a,c?1-I:N),i=Math.min(i,c?1-N:I),a>i)return!1}return!0}function w(n,t){const{center:r,radius:a}=t;let i=0;for(let u=0;u<3;u++){const t=Math.max(0,n[u]-r[u],r[u]-n[u+3]);if(t>a)return!1;i+=t**2}return i<=a**2}function B(t,r,a,i){const u=1e-8;let{tMin:e,tMax:o}=i;if(!(e<o))return null;if(!(Math.abs(n(a)-1)<1e-4))return null;for(let n=0;n<3;n++){const i=a[n],m=r[n],f=t[n],c=t[n+3];if(!(f<c))return null;if(Math.abs(i)<u){if(m<f||m>c)return null;continue}const h=1/i,M=(f-m)*h,x=(c-m)*h,l=h<0?x:M,s=h<0?M:x;if(e=Math.max(e,l),o=Math.min(o,s),o<=e)return null}return{tMin:e,tMax:o}}function D(n,t){const r=t[3];let a=r,i=r;for(let u=0;u<3;u++){const r=t[u],e=r*n[u],o=r*n[u+3];a+=Math.min(e,o),i+=Math.max(e,o)}return a>0?a:i<0?i:0}function C(n,t,r,a,i=n){return i[0]=n[0]+t,i[1]=n[1]+r,i[2]=n[2]+a,i[3]=n[3]+t,i[4]=n[4]+r,i[5]=n[5]+a,i}function H(n,t,r=n){const a=n[0]+j(n)/2,i=n[1]+V(n)/2,u=n[2]+Y(n)/2;return r[0]=a+(n[0]-a)*t,r[1]=i+(n[1]-i)*t,r[2]=u+(n[2]-u)*t,r[3]=a+(n[3]-a)*t,r[4]=i+(n[4]-i)*t,r[5]=u+(n[5]-u)*t,r}function J(n,t){return t[0]=n[0],t[1]=n[1],t[2]=n[2],t}function K(n,t){return t[0]=n[3],t[1]=n[4],t[2]=n[5],t}function L(n,t,r=n){return r[0]=t[0],r[1]=t[1],r[2]=t[2],r!==n&&(r[3]=n[3],r[4]=n[4],r[5]=n[5]),r}function Q(n,t,r=n){return r[3]=t[0],r[4]=t[1],r[5]=t[2],r!==n&&(r[0]=n[0],r[1]=n[1],r[2]=n[2]),n}function U(n,t){return n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n}function W(n){return n?U(n,on):u(on)}function X(n,t=r()){return t[0]=n[0],t[1]=n[1],t[2]=n[3],t[3]=n[4],t}function $(n,t){return n[0]=t[0],n[1]=t[1],n[2]=Number.NEGATIVE_INFINITY,n[3]=t[2],n[4]=t[3],n[5]=Number.POSITIVE_INFINITY,n}function nn(n,t,r,a,i){return n[0]=t,n[1]=r,n[2]=Number.NEGATIVE_INFINITY,n[3]=a,n[4]=i,n[5]=Number.POSITIVE_INFINITY,n}function tn(n){return 6===n.length}function rn(n){return 0===j(n)&&0===V(n)&&0===Y(n)}function an(n,t,r){if(null==n||null==t)return n===t;if(!tn(n)||!tn(t))return!1;if(r){for(let a=0;a<n.length;a++)if(!r(n[a],t[a]))return!1}else for(let a=0;a<n.length;a++)if(n[a]!==t[a])return!1;return!0}function un(n,t,r,a,i,u){return o(n,t,r,a,i,u,cn)}const en=i([-1/0,-1/0,-1/0,1/0,1/0,1/0]),on=i([1/0,1/0,1/0,-1/0,-1/0,-1/0]),mn=i([0,0,0,0,0,0]),fn=i([NaN,NaN,NaN,NaN,NaN,NaN]),cn=u();export{z as allFinite,A as center,Z as containedBySphere,S as contains,O as containsPoint,P as containsPointWithMargin,e as copy,u as create,V as depth,_ as diameter,W as empty,an as equals,M as exactEquals,I as expandWithAABB,T as expandWithBuffer,E as expandWithExtent,F as expandWithNestedArray,p as expandWithOffset,b as expandWithRect,g as expandWithValues,y as expandWithVec3,f as fromBuffer,m as fromExtent,N as fromMinMax,$ as fromRect,nn as fromRectValues,c as fromSubBuffer,o as fromValues,K as getMax,J as getMin,Y as height,k as intersects,q as intersectsClippingArea,B as intersectsRay,v as intersectsSegment,w as intersectsSphere,tn as is,x as isEmpty,rn as isPoint,G as maximumDimension,fn as nan,on as negativeInfinity,C as offset,en as positiveInfinity,H as scale,U as set,h as setEmpty,Q as setMax,L as setMin,D as signedDistanceFromPlane,R as size,d as squareDiameter,l as toCorners,s as toExtent,X as toRect,j as width,un as wrap,mn as zero};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import"../../../../colorUtils.js";import"../../../../core/has.js";import"./common.js";export{f as linearToSRGB,l as linearToSRGBView,n as normalize,e as normalizeView,s as scale,g as scaleView,h as shiftRight,b as transformMat3,d as transformMat3View,a as transformMat4,c as transformMat4View,t as translate}from"../../../../chunks/vec3.js";
2
+ import"../../../../colorUtils.js";import"../../../../core/has.js";import"./common.js";export{f as linearToSRGB,l as linearToSRGBView,n as normalize,e as normalizeView,s as scale,g as scaleView,h as shiftRight,b as transformMat3,d as transformMat3View,t as transformMat4,c as transformMat4View,a as translate}from"../../../../chunks/vec3.js";
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{ObjectStack as t}from"../../core/ObjectStack.js";import{multiply as r,invert as n}from"../../core/libs/gl-matrix-2/math/mat4.js";import{set as o}from"../../core/libs/gl-matrix-2/math/vec3.js";import{create as e}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import{transformMat4 as c}from"../../core/libs/gl-matrix-2/math/vec4.js";import{fromValues as i}from"../../core/libs/gl-matrix-2/factories/vec4f64.js";import{fromRay as f,fromLineSegmentAndDirection as u,create as a}from"./clipRay.js";import{create as s,fromPoints as m,signedDistance as l,clip as p,clipInfinite as b,copy as g}from"./plane.js";import{sm4d as h,sv4d as j}from"./vectorStacks.js";function x(t){return t?[s(t[0]),s(t[1]),s(t[2]),s(t[3]),s(t[4]),s(t[5])]:[s(),s(),s(),s(),s(),s()]}function M(){return[e(),e(),e(),e(),e(),e(),e(),e()]}function v(t,r){for(let n=0;n<H;n++)g(t[n],r[n]);return t}function k(t,e,i,f=L){const u=r(h.get(),e,t);n(u,u);for(let r=0;r<I;++r){const t=c(j.get(),J[r],u);o(f[r],t[0]/t[3],t[1]/t[3],t[2]/t[3])}y(i,f)}function y(t,r){m(r[4],r[0],r[3],t[0]),m(r[1],r[5],r[6],t[1]),m(r[4],r[5],r[1],t[2]),m(r[3],r[2],r[6],t[3]),m(r[0],r[1],r[2],t[4]),m(r[5],r[4],r[7],t[5])}function S(t,r){return d(t,r.center,r.radius)}function d(t,r,n){for(let o=0;o<H;o++){const e=t[o];if(e[0]*r[0]+e[1]*r[1]+e[2]*r[2]+e[3]>=n)return!1}return!0}function w(t,r,n){return O(t,r[0],r[1],r[2],n[0],n[1],n[2])}function O(t,r,n,o,e,c,i){const f=(r+e)/2,u=(n+c)/2,a=(o+i)/2,s=(e-r)/2,m=(c-n)/2,l=(i-o)/2;for(let p=0;p<H;p++){const r=t[p];if(r[0]*f+r[1]*u+r[2]*a+r[3]-(Math.abs(r[0])*s+Math.abs(r[1])*m+Math.abs(r[2])*l)>0)return!1}return!0}function R(t,r,n){return n?z(t,r[0],r[1],r[2],r[3],r[4],r[5],n):O(t,r[0],r[1],r[2],r[3],r[4],r[5])}function q(t,r,n,o){return o?z(t,r[0],r[1],r[2],n[0],n[1],n[2],o):O(t,r[0],r[1],r[2],n[0],n[1],n[2])}function z(t,r,n,o,e,c,i,f){return F(t,(r+e)/2,(n+c)/2,(o+i)/2,(e-r)/2,(c-n)/2,(i-o)/2,f)}function A(t,r){return E(t,f(r,K.get()))}function B(t,r){for(let n=0;n<H;n++){const o=t[n];if(!b(o,r))return!1}return!0}function C(t,r,n){return E(t,u(r,n,K.get()))}function D(t,r){for(let n=0;n<H;n++){if(l(t[n],r)>0)return!1}return!0}function E(t,r){for(let n=0;n<H;n++)if(!p(t[n],r))return!1;return!0}function F(t,r,n,o,e,c,i,f){const u=f[0]*r+f[4]*n+f[8]*o+f[12],a=f[1]*r+f[5]*n+f[9]*o+f[13],s=f[2]*r+f[6]*n+f[10]*o+f[14];for(let m=0;m<H;m++){const r=t[m];if(r[0]*u+r[1]*a+r[2]*s+r[3]-(Math.abs(r[0]*f[0]+r[1]*f[1]+r[2]*f[2])*e+Math.abs(r[0]*f[4]+r[1]*f[5]+r[2]*f[6])*c+Math.abs(r[0]*f[8]+r[1]*f[9]+r[2]*f[10])*i)>0)return!1}return!0}const G={bottom:[5,1,0,4],near:[0,1,2,3],far:[5,4,7,6],right:[1,5,6,2],left:[4,0,3,7],top:[7,3,2,6]},H=6,I=8,J=[i(-1,-1,-1,1),i(1,-1,-1,1),i(1,1,-1,1),i(-1,1,-1,1),i(-1,-1,1,1),i(1,-1,1,1),i(1,1,1,1),i(-1,1,1,1)],K=new t(a),L=M();export{y as computePlanes,v as copy,x as create,M as createPoints,k as fromMatrix,B as intersectClipRay,w as intersectsAabbFromMinMax,C as intersectsLineSegment,D as intersectsPoint,A as intersectsRay,S as intersectsSphere,d as intersectsSphereCenterRadius,R as intersectsTransformedAabb,q as intersectsTransformedAabbFromMinMax,H as numPlanes,I as numPoints,G as planePointIndices};
2
+ import{ObjectStack as t}from"../../core/ObjectStack.js";import{multiply as r,invert as o}from"../../core/libs/gl-matrix-2/math/mat4.js";import{transformMat4 as n,set as e}from"../../core/libs/gl-matrix-2/math/vec3.js";import{create as i}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import{transformMat4 as c}from"../../core/libs/gl-matrix-2/math/vec4.js";import{fromValues as f}from"../../core/libs/gl-matrix-2/factories/vec4f64.js";import{center as a,width as s,depth as u,height as m}from"./aaBoundingBox.js";import{fromRay as l,fromLineSegmentAndDirection as p,create as b}from"./clipRay.js";import{create as g,fromPoints as j,signedDistance as h,clip as x,copy as M,clipInfinite as v}from"./plane.js";import{sm4d as d,sv4d as k}from"./vectorStacks.js";function y(t){return t?[g(t[0]),g(t[1]),g(t[2]),g(t[3]),g(t[4]),g(t[5])]:[g(),g(),g(),g(),g(),g()]}function B(){return[i(),i(),i(),i(),i(),i(),i(),i()]}function S(t,r){for(let o=0;o<J;o++)M(t[o],r[o]);return t}function w(t,n,i,f=P){const a=r(d.get(),n,t);o(a,a);for(let r=0;r<K;++r){const t=c(k.get(),L[r],a);e(f[r],t[0]/t[3],t[1]/t[3],t[2]/t[3])}O(i,f)}function O(t,r){j(r[4],r[0],r[3],t[0]),j(r[1],r[5],r[6],t[1]),j(r[4],r[5],r[1],t[2]),j(r[3],r[2],r[6],t[3]),j(r[0],r[1],r[2],t[4]),j(r[5],r[4],r[7],t[5])}function R(t,r){return q(t,r.center,r.radius)}function q(t,r,o){for(let n=0;n<J;n++){const e=t[n];if(e[0]*r[0]+e[1]*r[1]+e[2]*r[2]+e[3]>=o)return!1}return!0}function z(t,r,o){const n=a(r,Q),e=s(r)/2,i=u(r)/2,c=m(r)/2;return o?C(t,n,e,i,c,o):A(t,n,e,i,c)}function A(t,r,o,n,e){for(let i=0;i<J;i++){const c=t[i];if(c[0]*r[0]+c[1]*r[1]+c[2]*r[2]+c[3]-(Math.abs(c[0])*o+Math.abs(c[1])*n+Math.abs(c[2])*e)>0)return!1}return!0}function C(t,r,o,e,i,c){const f=n(T,r,c);for(let n=0;n<J;n++){const r=t[n];if(r[0]*f[0]+r[1]*f[1]+r[2]*f[2]+r[3]-(Math.abs(r[0]*c[0]+r[1]*c[1]+r[2]*c[2])*o+Math.abs(r[0]*c[4]+r[1]*c[5]+r[2]*c[6])*e+Math.abs(r[0]*c[8]+r[1]*c[9]+r[2]*c[10])*i)>0)return!1}return!0}function D(t,r){return H(t,l(r,N.get()))}function E(t,r){for(let o=0;o<J;o++){const n=t[o];if(!v(n,r))return!1}return!0}function F(t,r,o){return H(t,p(r,o,N.get()))}function G(t,r){for(let o=0;o<J;o++){if(h(t[o],r)>0)return!1}return!0}function H(t,r){for(let o=0;o<J;o++)if(!x(t[o],r))return!1;return!0}const I={bottom:[5,1,0,4],near:[0,1,2,3],far:[5,4,7,6],right:[1,5,6,2],left:[4,0,3,7],top:[7,3,2,6]},J=6,K=8,L=[f(-1,-1,-1,1),f(1,-1,-1,1),f(1,1,-1,1),f(-1,1,-1,1),f(-1,-1,1,1),f(1,-1,1,1),f(1,1,1,1),f(-1,1,1,1)],N=new t(b),P=B(),Q=i(),T=i();export{O as computePlanes,S as copy,y as create,B as createPoints,w as fromMatrix,E as intersectClipRay,F as intersectsLineSegment,G as intersectsPoint,D as intersectsRay,R as intersectsSphere,q as intersectsSphereCenterRadius,z as intersectsTransformedAabb,J as numPlanes,K as numPoints,I as planePointIndices};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{create as r}from"../../../core/libs/gl-matrix-2/factories/mat4f64.js";import o from"../../Extent.js";import{canProjectWithoutEngine as t}from"../../projectionUtils.js";import{getSphericalPCPF as e}from"../../spatialReferenceEllipsoidUtils.js";import{computeTranslationToOriginAndRotation as i}from"../../projection/computeTranslationToOriginAndRotation.js";import{projectBuffer as n}from"../../projection/projectBuffer.js";import{toCorners as m,toExtent as s,fromBuffer as a}from"../aaBoundingBox.js";import{newDoubleArray as f}from"../DoubleArray.js";import{isRelativeVertexSpace as p}from"../meshVertexSpaceUtils.js";import{a as c,t as j}from"../../../chunks/vec3.js";function l(r){const{spatialReference:f,vertexSpace:l,untransformedBounds:d}=r,g=m(d,u);if(p(l)&&r.transform&&c(g,g,r.transform.localMatrix),"georeferenced"===l.type){const r=l.origin;return r&&j(g,g,r),s(a(g),f)}const y=e(f),B=l.origin;if(!t(y,f)){const[r,t,e]=B;return new o({xmin:r,ymin:t,zmin:e,xmax:r,ymax:t,zmax:e,spatialReference:f})}return i(f,B,x,y),c(g,g,x),n(g,y,0,g,f,0),s(a(g),f)}const x=r(),u=f(24);export{l as computeMeshExtent};
2
+ import{create as r}from"../../../core/libs/gl-matrix-2/factories/mat4f64.js";import o from"../../Extent.js";import{canProjectWithoutEngine as t}from"../../projectionUtils.js";import{getSphericalPCPF as e}from"../../spatialReferenceEllipsoidUtils.js";import{computeTranslationToOriginAndRotation as i}from"../../projection/computeTranslationToOriginAndRotation.js";import{projectBuffer as n}from"../../projection/projectBuffer.js";import{toCorners as m,toExtent as s,fromBuffer as a}from"../aaBoundingBox.js";import{newDoubleArray as f}from"../DoubleArray.js";import{isRelativeVertexSpace as p}from"../meshVertexSpaceUtils.js";import{t as c,a as j}from"../../../chunks/vec3.js";function l(r){const{spatialReference:f,vertexSpace:l,untransformedBounds:d}=r,g=m(d,u);if(p(l)&&r.transform&&c(g,g,r.transform.localMatrix),"georeferenced"===l.type){const r=l.origin;return r&&j(g,g,r),s(a(g),f)}const y=e(f),B=l.origin;if(!t(y,f)){const[r,t,e]=B;return new o({xmin:r,ymin:t,zmin:e,xmax:r,ymax:t,zmax:e,spatialReference:f})}return i(f,B,x,y),c(g,g,x),n(g,y,0,g,f,0),s(a(g),f)}const x=r(),u=f(24);export{l as computeMeshExtent};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import t from"../../../core/Logger.js";import{floatEqualUlp as n}from"../../../core/mathUtils.js";import{getMetersPerCartesianUnitForSR as r,convertUnit as e}from"../../../core/units.js";import{normalFromMat4 as o}from"../../../core/libs/gl-matrix-2/math/mat3.js";import{create as i}from"../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{exactEquals as l,scale as a,invert as s,copy as c,multiply as u}from"../../../core/libs/gl-matrix-2/math/mat4.js";import{IDENTITY as f,create as m}from"../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{negate as p,subtract as g,transformMat4 as x}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{create as h}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{isEarth as v}from"../../ellipsoidUtils.js";import{WGS84ECEFSpatialReference as j,getSphericalPCPF as A}from"../../spatialReferenceEllipsoidUtils.js";import{computeTranslationToOriginAndRotation as w}from"../../projection/computeTranslationToOriginAndRotation.js";import{projectPointToVector as y}from"../../projection/projectPointToVector.js";import{isRelativeVertexSpace as F,vertexSpaceEquals as b}from"../meshVertexSpaceUtils.js";import{t as d,a as R,b as S}from"../../../chunks/vec3.js";import{logProjectionError as U,projectToPCPF as M,projectNormalToPCPF as T,projectTangentToPCPF as B,transformNormal as E,transformTangent as L,projectFromPCPF as V,projectNormalFromPCPF as k,projectTangentFromPCPF as C}from"./projection.js";const O=()=>t.getLogger("esri.geometry.support.meshUtils.vertexSpaceConversion");function P(t,n,{vertexSpace:r,spatialReference:e}){if("georeferenced"===r.type){const o=t;if(!y(n,o,e))return!1;const{origin:i}=r;return g(t,o,i),!0}const o=A(e),i=t;if(!y(n,i,o))return!1;const{origin:l}=r,a=lt;if(!w(e,l,a,o))return!1;const c=s(lt,a);return null!=c&&(x(t,i,c),!0)}function q(t,n,r){const{vertexSpace:e,transform:o,vertexAttributes:i}=t,a=F(e)?o:null,s=Y(t.spatialReference,r,3);if(b(e,n)&&(!a||l(a.localMatrix,f))&&Z(s)){const{position:t,normal:n,tangent:e}=i,o=r?.allowBufferReuse;return{position:o?t:t.slice(),normal:o?n:n?.slice(),tangent:o?e:e?.slice()}}switch(t.vertexSpace.type){case"local":return"local"===n.type?J(t,t.vertexSpace,n.origin,r):G(t,t.vertexSpace,n.origin,r);case"georeferenced":return"local"===n.type?H(t,t.vertexSpace,n.origin,r):z(t,t.vertexSpace,n.origin,r)}}function z({vertexAttributes:t,transform:n,spatialReference:r},{origin:e},o,i){const l=Y(r,i,3),a=e||!Z(l)?c(rt,n?.localMatrix??f):null;a&&X(a,r,i,3);const{position:s,normal:u,tangent:m}=a?K(t,a):t,g=i?.allowBufferReuse,x=g?s:new Float64Array(s.length);let h=s;if(e&&(h=d(x,h,e)),o){const t=p(it,o);h=d(x,h,t)}return{position:h!==t.position||g?h:h.slice(),normal:u!==t.normal||g?u:u?.slice(),tangent:m!==t.tangent||g?m:m?.slice()}}function D(t,n){return n?.useEllipsoid&&v(t)?j:A(t)}function G({spatialReference:t,vertexAttributes:n,transform:r},{origin:e},o,i){const l=D(t,i);if(!w(t,e,rt,l))return U(O(),t,l),null;r&&u(rt,rt,r.localMatrix),X(rt,t,i,1);const a=new Float64Array(n.position.length),s=N(n.position,rt,t,a,l);if(!s)return null;const c=Q(s,t,a,l,n.normal,rt);if(n.normal&&!c)return null;const f=W(s,t,a,l,n.tangent,rt);if(n.tangent&&!f)return null;if(o){const t=p(it,o);d(s,s,t)}return{position:s,normal:c,tangent:f}}function H({vertexAttributes:t,spatialReference:n,transform:r},{origin:e},i,l){const c=D(n,l);if(!w(n,i,rt,c))return U(O(),n,c),null;const u=1/Y(n,l,2);a(rt,rt,[u,u,u]);const f=s(et,rt),{position:m,normal:p,tangent:g}=I(t,e,r),x=new Float64Array(m.length),h=$(m,n,f,x,c);if(!h)return null;const v=o(ot,f),j=_(p,m,n,x,c,v,p!==t.normal?p:void 0);if(!j&&p)return null;const A=tt(g,m,n,x,c,v,g!==t.tangent?g:void 0);return!A&&g?null:{position:h,normal:j,tangent:A}}function I(t,n,r){if(!n)return t;if(!r){const{position:r,normal:e,tangent:o}=t;return{position:d(new Float64Array(r.length),r,n),tangent:o,normal:e}}const e=K(t,r.localMatrix);return d(e.position,e.position,n),e}function J({vertexAttributes:t,spatialReference:n,transform:r},{origin:e},o,i){const l=D(n,i);if(!w(n,e,rt,l))return U(O(),n,l),null;if(r&&u(rt,rt,r.localMatrix),!w(n,o,et,l))return U(O(),l,n),null;s(et,et);const a=u(rt,et,rt);return X(a,n,i,3),K(t,a)}function K(t,n){const r=new Float64Array(t.position.length);R(r,t.position,n);const e=t.normal?new Float32Array(t.normal.length):null,o=t.tangent?new Float32Array(t.tangent.length):null;return e&&t.normal&&E(t.normal,e,n),o&&t.tangent&&L(t.tangent,o,n),{position:r,normal:e,tangent:o}}function N(t,n,r,e,o){R(e,t,n);const i=new Float64Array(t.length);return V(e,o,i,r)?i:(U(O(),o,r),null)}function Q(t,n,r,e,o,i){if(null==o)return null;const l=new Float32Array(o.length);return E(o,l,i),k(l,t,n,r,e,l)?l:(U(O(),e,n),null)}function W(t,n,r,e,o,i){if(null==o)return null;const l=new Float32Array(o.length);return L(o,l,i),C(l,t,n,r,e,l)?l:(U(O(),e,n),null)}function X(t,n,r,e){const o=Y(n,r,e);Z(o)||a(t,t,[o,o,o])}function Y(t,n,r){const e=!!(1&r),o=!!(2&r),i=n?.sourceUnit,l=n?.targetUnit;if(!i&&!l)return 1;let a=nt(i,t);e||!i||Z(a)||(O().warn("source unit conversion not supported"),a=1);let s=1/nt(l,t);return o||!l||Z(s)||(O().warn("target unit conversion not supported"),s=1),a*s}function Z(t){return n(t,1)}function $(t,n,r,e,o){const i=M(t,n,e,o);if(!i)return U(O(),n,o),null;const l=new Float64Array(i.length);return R(l,i,r),l}function _(t,n,r,e,o,i,l){if(null==t)return null;const a=l??new Float32Array(t.length);return T(t,n,r,e,o,a)?(S(a,a,i),a):(U(O(),r,o),null)}function tt(t,n,r,e,o,i,l){if(null==t)return null;const a=l??new Float32Array(t.length);return B(t,n,r,e,o,a)?(S(a,a,i,4),a):(U(O(),r,o),null)}function nt(t,n){if(null==t)return 1;const o=r(n);return 1/e(o,"meters",t)}const rt=m(),et=m(),ot=i(),it=h(),lt=m();export{q as convertVertexSpace,nt as getUnitToSpatialReferenceScaleConversion,P as projectPointToVertexSpace};
2
+ import t from"../../../core/Logger.js";import{floatEqualUlp as n}from"../../../core/mathUtils.js";import{getMetersPerCartesianUnitForSR as r,convertUnit as e}from"../../../core/units.js";import{normalFromMat4 as o}from"../../../core/libs/gl-matrix-2/math/mat3.js";import{create as i}from"../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{exactEquals as l,scale as a,invert as s,copy as c,multiply as u}from"../../../core/libs/gl-matrix-2/math/mat4.js";import{IDENTITY as f,create as m}from"../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{negate as p,subtract as g,transformMat4 as x}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{create as h}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{isEarth as v}from"../../ellipsoidUtils.js";import{WGS84ECEFSpatialReference as j,getSphericalPCPF as A}from"../../spatialReferenceEllipsoidUtils.js";import{computeTranslationToOriginAndRotation as w}from"../../projection/computeTranslationToOriginAndRotation.js";import{projectPointToVector as y}from"../../projection/projectPointToVector.js";import{isRelativeVertexSpace as F,vertexSpaceEquals as b}from"../meshVertexSpaceUtils.js";import{a as d,t as R,b as S}from"../../../chunks/vec3.js";import{logProjectionError as U,projectToPCPF as M,projectNormalToPCPF as T,projectTangentToPCPF as B,transformNormal as E,transformTangent as L,projectFromPCPF as V,projectNormalFromPCPF as k,projectTangentFromPCPF as C}from"./projection.js";const O=()=>t.getLogger("esri.geometry.support.meshUtils.vertexSpaceConversion");function P(t,n,{vertexSpace:r,spatialReference:e}){if("georeferenced"===r.type){const o=t;if(!y(n,o,e))return!1;const{origin:i}=r;return g(t,o,i),!0}const o=A(e),i=t;if(!y(n,i,o))return!1;const{origin:l}=r,a=lt;if(!w(e,l,a,o))return!1;const c=s(lt,a);return null!=c&&(x(t,i,c),!0)}function q(t,n,r){const{vertexSpace:e,transform:o,vertexAttributes:i}=t,a=F(e)?o:null,s=Y(t.spatialReference,r,3);if(b(e,n)&&(!a||l(a.localMatrix,f))&&Z(s)){const{position:t,normal:n,tangent:e}=i,o=r?.allowBufferReuse;return{position:o?t:t.slice(),normal:o?n:n?.slice(),tangent:o?e:e?.slice()}}switch(t.vertexSpace.type){case"local":return"local"===n.type?J(t,t.vertexSpace,n.origin,r):G(t,t.vertexSpace,n.origin,r);case"georeferenced":return"local"===n.type?H(t,t.vertexSpace,n.origin,r):z(t,t.vertexSpace,n.origin,r)}}function z({vertexAttributes:t,transform:n,spatialReference:r},{origin:e},o,i){const l=Y(r,i,3),a=e||!Z(l)?c(rt,n?.localMatrix??f):null;a&&X(a,r,i,3);const{position:s,normal:u,tangent:m}=a?K(t,a):t,g=i?.allowBufferReuse,x=g?s:new Float64Array(s.length);let h=s;if(e&&(h=d(x,h,e)),o){const t=p(it,o);h=d(x,h,t)}return{position:h!==t.position||g?h:h.slice(),normal:u!==t.normal||g?u:u?.slice(),tangent:m!==t.tangent||g?m:m?.slice()}}function D(t,n){return n?.useEllipsoid&&v(t)?j:A(t)}function G({spatialReference:t,vertexAttributes:n,transform:r},{origin:e},o,i){const l=D(t,i);if(!w(t,e,rt,l))return U(O(),t,l),null;r&&u(rt,rt,r.localMatrix),X(rt,t,i,1);const a=new Float64Array(n.position.length),s=N(n.position,rt,t,a,l);if(!s)return null;const c=Q(s,t,a,l,n.normal,rt);if(n.normal&&!c)return null;const f=W(s,t,a,l,n.tangent,rt);if(n.tangent&&!f)return null;if(o){const t=p(it,o);d(s,s,t)}return{position:s,normal:c,tangent:f}}function H({vertexAttributes:t,spatialReference:n,transform:r},{origin:e},i,l){const c=D(n,l);if(!w(n,i,rt,c))return U(O(),n,c),null;const u=1/Y(n,l,2);a(rt,rt,[u,u,u]);const f=s(et,rt),{position:m,normal:p,tangent:g}=I(t,e,r),x=new Float64Array(m.length),h=$(m,n,f,x,c);if(!h)return null;const v=o(ot,f),j=_(p,m,n,x,c,v,p!==t.normal?p:void 0);if(!j&&p)return null;const A=tt(g,m,n,x,c,v,g!==t.tangent?g:void 0);return!A&&g?null:{position:h,normal:j,tangent:A}}function I(t,n,r){if(!n)return t;if(!r){const{position:r,normal:e,tangent:o}=t;return{position:d(new Float64Array(r.length),r,n),tangent:o,normal:e}}const e=K(t,r.localMatrix);return d(e.position,e.position,n),e}function J({vertexAttributes:t,spatialReference:n,transform:r},{origin:e},o,i){const l=D(n,i);if(!w(n,e,rt,l))return U(O(),n,l),null;if(r&&u(rt,rt,r.localMatrix),!w(n,o,et,l))return U(O(),l,n),null;s(et,et);const a=u(rt,et,rt);return X(a,n,i,3),K(t,a)}function K(t,n){const r=new Float64Array(t.position.length);R(r,t.position,n);const e=t.normal?new Float32Array(t.normal.length):null,o=t.tangent?new Float32Array(t.tangent.length):null;return e&&t.normal&&E(t.normal,e,n),o&&t.tangent&&L(t.tangent,o,n),{position:r,normal:e,tangent:o}}function N(t,n,r,e,o){R(e,t,n);const i=new Float64Array(t.length);return V(e,o,i,r)?i:(U(O(),o,r),null)}function Q(t,n,r,e,o,i){if(null==o)return null;const l=new Float32Array(o.length);return E(o,l,i),k(l,t,n,r,e,l)?l:(U(O(),e,n),null)}function W(t,n,r,e,o,i){if(null==o)return null;const l=new Float32Array(o.length);return L(o,l,i),C(l,t,n,r,e,l)?l:(U(O(),e,n),null)}function X(t,n,r,e){const o=Y(n,r,e);Z(o)||a(t,t,[o,o,o])}function Y(t,n,r){const e=!!(1&r),o=!!(2&r),i=n?.sourceUnit,l=n?.targetUnit;if(!i&&!l)return 1;let a=nt(i,t);e||!i||Z(a)||(O().warn("source unit conversion not supported"),a=1);let s=1/nt(l,t);return o||!l||Z(s)||(O().warn("target unit conversion not supported"),s=1),a*s}function Z(t){return n(t,1)}function $(t,n,r,e,o){const i=M(t,n,e,o);if(!i)return U(O(),n,o),null;const l=new Float64Array(i.length);return R(l,i,r),l}function _(t,n,r,e,o,i,l){if(null==t)return null;const a=l??new Float32Array(t.length);return T(t,n,r,e,o,a)?(S(a,a,i),a):(U(O(),r,o),null)}function tt(t,n,r,e,o,i,l){if(null==t)return null;const a=l??new Float32Array(t.length);return B(t,n,r,e,o,a)?(S(a,a,i,4),a):(U(O(),r,o),null)}function nt(t,n){if(null==t)return 1;const o=r(n);return 1/e(o,"meters",t)}const rt=m(),et=m(),ot=i(),it=h(),lt=m();export{q as convertVertexSpace,nt as getUnitToSpatialReferenceScaleConversion,P as projectPointToVertexSpace};
package/kernel.js CHANGED
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import has from"./core/has.js";import{addQueryParameter as o}from"./core/urlUtils.js";export{buildDate,commitHash as revision}from"./support/revision.js";Symbol.dispose??=Symbol("Symbol.dispose"),Symbol.asyncDispose??=Symbol("Symbol.asyncDispose");const e="5.2";let s,r=e;function i(o){s=o}function t(e){const r=s?.findCredential(e);return r?.token?o(e,"token",r.token):e}r="5.2.0-next.48",has("host-webworker")||globalThis.$arcgis||Object.defineProperty(globalThis,"$arcgis",{configurable:!1,enumerable:!0,writable:!1,value:{}}),has("host-webworker");export{t as addTokenParameter,r as fullVersion,s as id,i as setId,e as version};
2
+ import has from"./core/has.js";import{addQueryParameter as o}from"./core/urlUtils.js";export{buildDate,commitHash as revision}from"./support/revision.js";Symbol.dispose??=Symbol("Symbol.dispose"),Symbol.asyncDispose??=Symbol("Symbol.asyncDispose");const e="5.2";let s,r=e;function i(o){s=o}function t(e){const r=s?.findCredential(e);return r?.token?o(e,"token",r.token):e}r="5.2.0-next.49",has("host-webworker")||globalThis.$arcgis||Object.defineProperty(globalThis,"$arcgis",{configurable:!1,enumerable:!0,writable:!1,value:{}}),has("host-webworker");export{t as addTokenParameter,r as fullVersion,s as id,i as setId,e as version};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{isArrayLike as e}from"../../../core/arrayUtils.js";import{deg2rad as t}from"../../../core/mathUtils.js";import{clone as r,zeros as a}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import i from"../../../geometry/Point.js";import{isElevationSource as n}from"../core/ElevationSourceDefinitions.js";import{rectifyMapPointPanoramic as o,rectifyMapPoint as c}from"./rectifyMapPoint.js";import{getWebMercatorScalingFactor as s,hasAngles as f,convertPixelToHeadingPitch as l,adjustHorizonAngles as m,isElevationSampler as p,reducerFn as h,validatePixelsToTransform as u,validateRotationMatrix as y,computeFarplaneVertices as d,computeHFOVAndVFOV as w,vecToPoint as g,or as v,isUpdateElevationWithElevationSource as x,scaleAndAddWithFactor as R,computeNewReferenceCoordinates as M,projectiveTransform as P}from"./utils.js";import{worldToImage as A}from"./worldToImage.js";import{viewingLimit as V}from"../../../widgets/OrientedImageryViewer/constants.js";async function j(e,t,r){const{verticalFieldOfView:a,imageBoundaries:i,scalingFactor:n,farPlaneVertices:o,cameraLocation:c,pixelsToTransform:s,vecToPoint:f,pixelDepths:l}=S(e,t),m=new Array;return await F(s,o,i,f,t,m,c,n,a,r,l),Array.isArray(e)?m:m[0]}async function F(e,t,r,a,n,o,s,f,l,m,p){let h=n.averageElevation;const u=e.length;for(let y=0;y<u;y+=1){const u=e.at(y),d=O(t,r,u,a,n),w=p?.at(y);if("number"==typeof w){const e=b(d,s,f),t=w*f,r=[s[0]+e[0]*t,s[1]+e[1]*t,s[2]+e[2]*w];o.push(new i(r,n.cameraLocation.spatialReference));continue}if(m&&v("elevationSample"in m,x(m))){h=(await c(a(d),{x:u[0],y:u[1]},{...n,...m,farPlaneVertices:t.map(a)}))[2]}o.push(a(T(d,s,f,h,n.cameraPitch,l)))}}function b(e,t,r){const i=e[0]-t[0],n=e[1]-t[1],o=e[2]-t[2],c=Math.hypot(i,n)/r,s=Math.hypot(o,c)*r,f=a();return f[0]=i/s,f[1]=n/s,f[2]=o/s,f[2]=f[2]*r,f}function T(e,t,a,i,n,o){let c=r(e);const s=b(e,t,a);if(L(e[2],i,n,o)){const e=Math.abs((t[2]-i)/-s[2])*a;c=R(t,s,e,a)}else c[2]=i;return c}function L(e,t,r,a){return e<t||r+a/2<V}function O(e,t,r,a,i){let n=null;const o=9;let c,s=0,f=e,l=t;for(;s<=o;){const e=D(r,l,f,i);if(c=e.error,n=e.transformedPoint,v(c<=1,s===o))break;f=M(f,c,r,t),l=z(f,a,i),s++}return n}function z(e,t,r){return A(e.map(t),r).map(({x:e,y:t})=>[e,t,1])}function D(e,t,r,a){const{cameraLocation:n}=a,o=P(e,t,r),{x:c,y:s}=A(new i(o,n.spatialReference),a);return{transformedPoint:o,error:E(e,[c,s,1])}}function E(e,t){return Math.abs(e[0]-t[0])+Math.abs(e[1]-t[1])}function S(t,r){const a=e(t)||"items"in t?t:[t],{cameraLocation:n,rotationMatrix:o}=r;if(u(a,n),y(o),9!==o?.length)throw new Error("Rotation matrix is not provided or is not a valid 3x3 matrix");const c=s(n.y,n.spatialReference),f=d({...r,scalingFactor:c}),l=A(f.map(e=>new i(e,n.spatialReference)),r),{vfov:m}=w(r.horizontalFieldOfView,r.verticalFieldOfView,r.cameraRoll);return{cameraLocation:n.toArray(),imageBoundaries:l.map(({x:e,y:t})=>[e,t,1]),verticalFieldOfView:m,farPlaneVertices:f,scalingFactor:c,pixelsToTransform:a.map(e=>[e.x,e.y,1]),vecToPoint:g(n.spatialReference),pixelDepths:a.map(e=>B(e)?e.depth:void 0)}}function B(e){return"depth"in e&&"number"==typeof e.depth}async function I(e,r,a){const{cameraLocation:c,farDistance:u,imageHeight:y,imageWidth:d,verticalFieldOfView:w,horizonPitch:g,horizonRoll:v,horizonYaw:x}=r,R=s(c.y,c.spatialReference),M=u*R,P=new Array,[A,V,j]=c.toArray(),F=Array.isArray(e)?e:[e];for(const s of F){let e,F;const b=B(s),L=b?s.depth*R:M;if(f(s))e=s.heading,F=s.pitch;else{const t=l({x:s.x,y:s.y},d,y),r=m(t.heading,t.pitch,[g,v,x],!0);e=r[0],F=r[1]}const O=[A+Math.sin(t(e))*Math.sin(t(F))*L,V+Math.cos(t(e))*Math.sin(t(F))*L,j+-Math.cos(t(F))*(b?s.depth:u)];if(b){P.push(new i(O,c.spatialReference));continue}let z=r.averageElevation;if(a&&(n(a)||p(a.elevationSample))){z=(await o(new i(O,c.spatialReference),{heading:e,pitch:F},{...r,...a,farPlaneVertices:h(u,u).map(([e,t])=>new i([c.x+e,c.y+t],c.spatialReference))}))[2]}P.push(new i(T(O,c.toArray(),R,z,F,w),c.spatialReference))}return Array.isArray(e)?P:P[0]}export{j as imageToWorld,I as imageToWorldPanoramic};
2
+ import{isArrayLike as e}from"../../../core/arrayUtils.js";import{deg2rad as t}from"../../../core/mathUtils.js";import{clone as r,zeros as a}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import i from"../../../geometry/Point.js";import{isElevationSource as n}from"../core/ElevationSourceDefinitions.js";import{rectifyMapPointPanoramic as o,rectifyMapPoint as c}from"./rectifyMapPoint.js";import{getWebMercatorScalingFactor as s,hasAngles as f,convertPixelToHeadingPitch as l,adjustHorizonAngles as m,isElevationSampler as p,reducerFn as h,scaleAndAddWithFactor as u,validatePixelsToTransform as y,validateRotationMatrix as d,computeFarplaneVertices as w,computeHFOVAndVFOV as g,vecToPoint as v,or as x,isUpdateElevationWithElevationSource as R,computeNewReferenceCoordinates as M,projectiveTransform as P}from"./utils.js";import{worldToImage as A}from"./worldToImage.js";import{viewingLimit as V}from"../../../widgets/OrientedImageryViewer/constants.js";async function j(e,t,r){const{verticalFieldOfView:a,imageBoundaries:i,scalingFactor:n,farPlaneVertices:o,cameraLocation:c,pixelsToTransform:s,vecToPoint:f,pixelDepths:l}=S(e,t),m=new Array;return await F(s,o,i,f,t,m,c,n,a,r,l),Array.isArray(e)?m:m[0]}async function F(e,t,r,a,n,o,s,f,l,m,p){let h=n.averageElevation;const u=e.length;for(let y=0;y<u;y+=1){const u=e.at(y),d=O(t,r,u,a,n),w=p?.at(y);if("number"==typeof w){const e=b(d,s,f),t=w*f,r=[s[0]+e[0]*t,s[1]+e[1]*t,s[2]+e[2]*w];o.push(new i(r,n.cameraLocation.spatialReference));continue}if(m&&x("elevationSample"in m,R(m))){h=(await c(a(d),{x:u[0],y:u[1]},{...n,...m,farPlaneVertices:t.map(a)}))[2]}o.push(a(T(d,s,f,h,n.cameraPitch,l)))}}function b(e,t,r){const i=e[0]-t[0],n=e[1]-t[1],o=e[2]-t[2],c=Math.hypot(i,n)/r,s=Math.hypot(o,c)*r,f=a();return f[0]=i/s,f[1]=n/s,f[2]=o/s,f[2]=f[2]*r,f}function T(e,t,a,i,n,o){let c=r(e);const s=b(e,t,a);if(L(e[2],i,n,o)){const e=Math.abs((t[2]-i)/-s[2])*a;c=u(t,s,e,a)}else c[2]=i;return c}function L(e,t,r,a){return e<t||r+a/2<V}function O(e,t,r,a,i){let n=null;const o=9;let c,s=0,f=e,l=t;for(;s<=o;){const e=D(r,l,f,i);if(c=e.error,n=e.transformedPoint,x(c<=1,s===o))break;f=M(f,c,r,t),l=z(f,a,i),s++}return n}function z(e,t,r){return A(e.map(t),r).map(({x:e,y:t})=>[e,t,1])}function D(e,t,r,a){const{cameraLocation:n}=a,o=P(e,t,r),{x:c,y:s}=A(new i(o,n.spatialReference),a);return{transformedPoint:o,error:E(e,[c,s,1])}}function E(e,t){return Math.abs(e[0]-t[0])+Math.abs(e[1]-t[1])}function S(t,r){const a=e(t)||"items"in t?t:[t],{cameraLocation:n,rotationMatrix:o}=r;if(y(a,n),d(o),9!==o?.length)throw new Error("Rotation matrix is not provided or is not a valid 3x3 matrix");const c=s(n.y,n.spatialReference),f=w({...r,scalingFactor:c}),l=A(f.map(e=>new i(e,n.spatialReference)),r),{vfov:m}=g(r.horizontalFieldOfView,r.verticalFieldOfView,r.cameraRoll);return{cameraLocation:n.toArray(),imageBoundaries:l.map(({x:e,y:t})=>[e,t,1]),verticalFieldOfView:m,farPlaneVertices:f,scalingFactor:c,pixelsToTransform:a.map(e=>[e.x,e.y,1]),vecToPoint:v(n.spatialReference),pixelDepths:a.map(e=>B(e)?e.depth:void 0)}}function B(e){return"depth"in e&&"number"==typeof e.depth}async function I(e,r,a){const{cameraLocation:c,farDistance:u,imageHeight:y,imageWidth:d,verticalFieldOfView:w,horizonPitch:g,horizonRoll:v,horizonYaw:x}=r,R=s(c.y,c.spatialReference),M=u*R,P=new Array,[A,V,j]=c.toArray(),F=Array.isArray(e)?e:[e];for(const s of F){let e,F;const b=B(s),L=b?s.depth*R:M;if(f(s))e=s.heading,F=s.pitch;else{const t=l({x:s.x,y:s.y},d,y),r=m(t.heading,t.pitch,[g,v,x],!0);e=r[0],F=r[1]}const O=[A+Math.sin(t(e))*Math.sin(t(F))*L,V+Math.cos(t(e))*Math.sin(t(F))*L,j+-Math.cos(t(F))*(b?s.depth:u)];if(b){P.push(new i(O,c.spatialReference));continue}let z=r.averageElevation;if(a&&(n(a)||p(a.elevationSample))){z=(await o(new i(O,c.spatialReference),{heading:e,pitch:F},{...r,...a,farPlaneVertices:h(u,u).map(([e,t])=>new i([c.x+e,c.y+t],c.spatialReference))}))[2]}P.push(new i(T(O,c.toArray(),R,z,F,w),c.spatialReference))}return Array.isArray(e)?P:P[0]}export{j as imageToWorld,I as imageToWorldPanoramic};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import t from"../../../core/Error.js";import{rad2deg as n,deg2rad as a}from"../../../core/mathUtils.js";import{create as e}from"../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{create as i,fromValues as o}from"../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{zeros as r,create as c}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromArray as s}from"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{transpose as l,multiply as f}from"../../../core/libs/gl-matrix-2/math/mat3.js";import{invertOrIdentity as u,mul as h}from"../../../core/libs/gl-matrix-2/math/mat4.js";import{scale as m,sub as p,add as g}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{isSerializable as v}from"../../../core/support/jsonUtils.js";import M from"../../../geometry/Point.js";import{projectAsync as d}from"../../../geometry/projectionUtils.js";import{earth as x}from"../../../geometry/support/Ellipsoid.js";import{isWebMercator as w}from"../../../geometry/support/spatialReferenceUtils.js";import{t as y}from"../../../chunks/vec3.js";import{isConstantElevation as b,ConstantElevation as j,isElevationSource as O}from"../core/ElevationSourceDefinitions.js";import{getMetersPerUnitOfSR as z}from"../core/utils.js";import{getElevationSampler as P}from"./updateElevationUtils.js";import{isNumber as R}from"../../../support/guards.js";import{defaultImageSphereSize as F}from"../../../widgets/PanoramicViewer/constants.js";function E(t,n,a){const[e,o,r,c]=n,[s,l,f,m]=a;S(e,o,r,c);const p=S(s,l,f,m),g=H(e,o,r,c),v=H(s,l,f,m),M=u(i(),g),d=h(i(),M,v),[x,w,y,b]=D(t,d);return[x/b,w/b,p?0:y/b]}function S(t,n,a,e){return 0===t[2]&&0===n[2]&&0===a[2]&&0===e[2]&&(t[2]=n[2]=a[2]=e[2]=1,!0)}function V(t){return 0===t?1:t}function D(t,n){const[a,e,i]=t,o=[0,0,0,0];return o[0]=a*n[0]+e*n[1]+i*n[2]+n[3],o[1]=a*n[4]+e*n[5]+i*n[6]+n[7],o[2]=a*n[8]+e*n[9]+i*n[10]+n[11],o[3]=V(a*n[12]+e*n[13]+i*n[14]+n[15]),o}function H(t,n,a,e){const r=I(s([...e,1]),u(new Array(16),o(t[0],n[0],a[0],0,t[1],n[1],a[1],0,t[2],n[2],a[2],0,1,1,1,1))),c=r[0],l=r[1],f=r[2],h=i();return h[0]=c*t[0],h[1]=l*n[0],h[2]=f*a[0],h[3]=0,h[4]=c*t[1],h[5]=l*n[1],h[6]=f*a[1],h[7]=0,h[8]=c*t[2],h[9]=l*n[2],h[10]=f*a[2],h[11]=0,h[12]=c,h[13]=l,h[14]=f,h[15]=1,h}function L(t,n,a,e,i=r()){return i[0]=t[0]+n[0]*a,i[1]=t[1]+n[1]*a,i[2]=t[2]+n[2]*(a/e),i}function N(t,n,a){const e=r();return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*(n/a),e}function A(t,n){const[a,e,i]=t,o=r();return o[0]=a*n[0]+e*n[3]+i*n[6],o[1]=a*n[1]+e*n[4]+i*n[7],o[2]=a*n[2]+e*n[5]+i*n[8],o}function I(t,n){const[a,e,i,o]=t,r=new Array(4);return r[0]=a*n[0]+e*n[1]+i*n[2]+o*n[3],r[1]=a*n[4]+e*n[5]+i*n[6]+o*n[7],r[2]=a*n[8]+e*n[9]+i*n[10]+o*n[11],r[3]=a*n[12]+e*n[13]+i*n[14]+o*n[15],r}function Y(n,i,o,r=!0){if(!Number.isFinite(n))throw new t("InvalidRotationAngle","Please specify a valid angle for rotation");const c=o*(r?a(n):n),s=Math.cos(c),l=Math.sin(c),f=e();switch(i){case 0:f[4]=s,f[5]=-l,f[7]=l,f[8]=s;break;case 1:f[0]=s,f[2]=l,f[6]=-l,f[8]=s;break;case 2:f[0]=s,f[1]=-l,f[3]=l,f[4]=s;break;default:throw new t("InvalidRotationAxis","Please specify either 0, 1 or 2 for X, Y or Z axis respectively")}return f}const k={HPR:[[2,-1],[0,1],[2,-1]],OPK:[[0,1],[1,1],[2,1]],YPR:[[0,-1],[1,-1],[2,-1]]};function q(n,a,i=!0){if(3!==n?.length||3!==a?.length)throw new t("InvalidRotationAngles","Please specify three angles with config for rotation");const o=e();for(let t=0;t<3;t++){const[e,r]=a[t],c=Y(n[t],e,r,i);f(o,c,o)}return o}function U(t,n=!0){return q(t,k.OPK,n)}function C(t,n=!0){return q(t,k.HPR,n)}function K(t,n,e){const i=Math.sin(a(e)),o=Math.cos(a(e)),r=[[t,0],[t,n],[0,n]];r.forEach((t,n)=>{r[n]=[o*t[0]-i*t[1],i*t[0]+o*t[1]]});const c={xmin:Math.min(0,r[0][0],r[1][0],r[2][0]),xmax:Math.max(0,r[0][0],r[1][0],r[2][0]),ymin:Math.min(0,r[0][1],r[1][1],r[2][1]),ymax:Math.max(0,r[0][1],r[1][1],r[2][1])};return{hfov:Math.abs(c.xmax-c.xmin),vfov:Math.abs(c.ymax-c.ymin)}}function T(t,e){const i=Number(t[0]),o=Number(t[1]),r=Number(t[2]),[c,s,l,f]=e,u=a(c),h=a(s),m=l/Math.sqrt(1-f*Math.sin(u)**2),p=i/m,g=o/m,v=r/m,M=Math.cos(u)-Math.sin(u)*g+Math.cos(u)*v,d=Math.sin(u)+Math.cos(u)*g+Math.sin(u)*v,x=Math.sqrt(M**2+p**2),w=f*m*Math.sin(u),y=(t,n=5)=>{if(0===n)return t;const a=y(t,n-1);return Math.atan(d/x-(w-f*(l/Math.sqrt(1-f*Math.sin(a)**2))*Math.sin(a))/(m*x))},b=y(u),j=Math.atan(i/(m*M))+h,O=n(b);return[n(j),O,i/(Math.cos(b)*Math.sin(j-h))-l/Math.sqrt(1-f*Math.sin(b)**2)]}function W(t,n,a){const e=360/n,i=180/a;return{heading:(t.x-n/2)*e,pitch:90-(t.y-a/2)*i}}function X(t,n,a,e,i=F/2){const{heading:o,pitch:r}=G(t,i),c=e?Rt(o,r,e):[o,r];return{heading:o,pitch:r,...Z(c[0],c[1],n,a)}}function Z(t,n,a,e){const i=t%360;return{x:a/2+(i<-180?i+360:i>180?i-360:i)/(360/a),y:e-n/(180/e)}}function G(t,a){const e=n(Math.acos(-t.z/a));return{heading:n(Math.atan2(t.x,t.y)),pitch:e}}function J(t,n){return[Math.sin(a(t))*Math.sin(a(n)),Math.cos(a(t))*Math.sin(a(n)),Math.cos(a(180-n))]}function $(t,n,a,e=F/2){const i=a?Rt(t,n,a,!0):[t,n];return m(c(),J(i[0],i[1]),e)}function B(t,n,a,e,i=F/2){const{heading:o,pitch:r}=W(t,n,a);return $(o,r,e,i)}async function Q(t,a,e){const i=await d(a,t.spatialReference,e);let o=n(Math.atan2(i.y-t.y,i.x-t.x));return o=o>=0&&o<=90?90-o:o>90&&o<=180?360-o+90:90+Math.abs(o),o}function _(t,n,a){const e=Math.cos(a),i=Math.sin(a),o=[1,0,0,1,0,0],r=o[0]*e+o[2]*i,c=o[1]*e+o[3]*i,s=-o[0]*i+o[2]*e,l=-o[1]*i+o[3]*e;o[0]=r,o[1]=c,o[2]=s,o[3]=l;return[t*o[0]+n*o[2]+o[4],t*o[1]+n*o[3]+o[5]]}const tt=t=>t.toArray(),nt=(...t)=>t.some(t=>t);function at(t,n){if(nt(0===t.length,t.some(({x:t,y:n})=>nt(null==t,null==n)),!n.hasZ))throw new Error("Input pixels must have x, y and camera location must have z value")}function et(t,n){if(t.some(t=>null==t.z)||null==n.z)throw new Error("Input points and camera location must have z value")}function it(t){if(9!==t?.length)throw new Error("Rotation matrix is not provided or is not a valid 3x3 matrix")}function ot(t,n){return w(n)?1/Math.cos(Math.PI/2-2*Math.atan(Math.exp(-1*t/x.radius))):1}const rt=t=>n=>new M({x:n[0],y:n[1],z:n[2],spatialReference:t}),ct=t=>null!=t&&"queryExtent"in t;function st(t,n,a,e){return[[-n,-n],[+n,-n],[+n,+n],[-n,+n]].map(([n,i])=>E(y(r(),a,[n,i,0]),e,t))}function lt({a0:t,a1:n,a2:a,b0:e,b1:i,b2:o},r,c,s){const l=[t??r/2-.5,n,a??0,e??c/2-.5,i??0,o].map(ft);return null!=s&&ut(l)?{affines:l,focalLength:s}:{affines:[r/2-.5,1,0,c/2-.5,0,-1]}}function ft(t,n){if(null==t)return null;const a=parseFloat(`${t}`);return isNaN(a)?null:a}function ut(t){return null!=t[1]&&null!=t[5]}function ht(t,n,a){const{cameraHeight:e,cameraPitch:i,cameraRoll:o,elevation:r,farDistance:c,horizontalFieldOfView:s,location:l,verticalFieldOfView:f}=zt(t,t.location.spatialReference),u=r??(l.z??0)-e;return{...gt(t,n,a),averageElevation:u,cameraPitch:i,cameraRoll:o??0,farDistance:c,horizontalFieldOfView:s,verticalFieldOfView:f}}function mt(t,n,a,e){return jt(e)?U([e.omega,e.phi,e.kappa]):Ot(e)?C([e.heading,e.pitch,e.roll]):C([t,n,a??0])}function pt(t,n,a){const{cameraHeading:e,cameraHeight:i,farDistance:o,horizontalFieldOfView:r,location:c,verticalFieldOfView:s}=zt(t,t.location.spatialReference),l=(c.z??0)-i;let f=-e,u=0,h=0;if(t?.matrix){const{matrix:n}=t;[u,h,f]=Pt(n)}return{averageElevation:l,cameraLocation:c,cameraHeading:e,farDistance:o,horizontalFieldOfView:r,imageHeight:a,imageWidth:n,verticalFieldOfView:s,horizonYaw:f,horizonPitch:u,horizonRoll:h}}function gt(t,n,a){const{a0:e,a1:i,a2:o,b0:r,b1:c,b2:s,cameraHeading:l,cameraOrientation:f,cameraPitch:u,cameraRoll:h,focalLength:m,horizontalFieldOfView:p,location:g,matrix:v,principalX:M,principalY:d,radial:x,tangential:w,verticalFieldOfView:y}=t,{affines:b,focalLength:j}=lt({a0:e,a1:i,a2:o,b0:r,b1:c,b2:s},n,a,m),O=v??mt(l,u,h,f),z=null!=M&&null!=d?[M,d]:void 0;return{affineTransformations:f?.affineTransformations??b,cameraLocation:g.clone(),focalLength:f?.focalLength??j,horizontalFieldOfView:p,imageHeight:a,imageWidth:n,principalOffsetPoint:f?.principalOffsetPoint??z,radialDistortionCoefficients:f?.radialDistortionCoefficients??x,rotationMatrix:O,tangentialDistortionCoefficients:f?.tangentialDistortionCoefficients??w,verticalFieldOfView:y}}const vt=t=>null!=t&&"elevationSample"in t&&null!=t.elevationSample,Mt=t=>O(t?.elevationSource)&&null!=t?.extent,dt=t=>b(t?.elevationSource),xt=async(t,n,a,e,i)=>{const o=z(t),r=n-a/o;return dt(e)?(e.elevationSource=new j({constantElevation:e.elevationSource.constantElevation/o}),e):vt(e)?e:Mt(e)?{elevationSample:await P({...v(e.elevationSource)?e.elevationSource.toJSON():e.elevationSource,extent:e.extent},i),elevationSource:new j({constantElevation:r})}:{averageGroundElevation:r,spatialReference:t}},wt=t=>R(t?.heading)&&R(t?.pitch),yt=(t,n)=>[[-t,-n],[t,-n],[t,n],[-t,n]];function bt(t){const{cameraLocation:n,farDistance:i,horizontalFieldOfView:o,rotationMatrix:c,scalingFactor:s,verticalFieldOfView:f}=t,u=e();l(u,c);const h=2*Math.tan(a(f)/2)*i*s,m=2*Math.tan(a(o)/2)*i*s,v=A([0,0,-1],u),M=L([n.x,n.y,n.z],v,t.farDistance*s,s),d=A([0,1,0],u),x=A([1,0,0],u),w=N(d,h/2,s),y=N(x,m/2,s),b=p(r(),w,y),j=g(r(),w,y);return[g(r(),M,b),g(r(),M,j),p(r(),M,b),p(r(),M,j)]}const jt=t=>2===t?.type,Ot=t=>1===t?.type;function zt(t,n,a=!0){const e=z(n),i=a?t.clone():t;return i.cameraHeight/=e,i.farDistance/=e,i.nearDistance/=e,b(i.elevationSource)&&(i.elevationSource.constantElevation/=e),i}function Pt(t){return[n(Math.asin(-t[6])),n(Math.atan(t[7]/t[8])),n(Math.atan2(t[3],t[0]))]}function Rt(t,n,a,e=!1){return Ft(J(t,n),a,e)}function Ft(t,a,i=!1){const o=i?l(e(),q(a,k.YPR)):q(a,k.YPR),r=t[0]*o[0]+t[1]*o[1]+t[2]*o[2],c=t[0]*o[3]+t[1]*o[4]+t[2]*o[5],s=t[0]*o[6]+t[1]*o[7]+t[2]*o[8],f=n(Math.acos(-s));return[n(Math.atan2(r,c)),f]}export{Rt as adjustHorizonAngles,Ft as adjustHorizonAnglesVec3,bt as computeFarplaneVertices,K as computeHFOVAndVFOV,st as computeNewReferenceCoordinates,$ as convertHeadingPitchToSphereVertex,Z as convertOrientationToPixelLocation,B as convertPixelLocationToSphereVertex,W as convertPixelToHeadingPitch,G as convertSphereVertexToOrientation,X as convertSphereVertexToPixelLocation,zt as convertToSRUnits,J as createMeshSpaceVector,q as createRotationMatrix,C as createRotationMatrixFromHPR,U as createRotationMatrixFromOPK,Pt as extractHorizonAngles,lt as getAffinesAndFocalLength,pt as getImageToWorldPanoramicProperties,ht as getImageToWorldProperties,Q as getInitialAngle,xt as getUpdateElevationProps,ot as getWebMercatorScalingFactor,gt as getWorldToImageProperties,wt as hasAngles,Ot as hasHeadingPitchRoll,jt as hasOmegaPhiKappa,ct as isElevationSampler,vt as isUpdateElevationWithElevationSampler,Mt as isUpdateElevationWithElevationSource,dt as isUpdateUsingConstantElevation,ut as isValidAffines,H as linearEquationSolve,T as ltpToGeographic,nt as or,tt as pointToArray,E as projectiveTransform,yt as reducerFn,_ as rotatePixel,L as scaleAndAddWithFactor,N as scaleWithFactor,A as transformMat3,I as transformMat4,at as validatePixelsToTransform,et as validatePointsToTransform,it as validateRotationMatrix,rt as vecToPoint};
2
+ import t from"../../../core/Error.js";import{rad2deg as n,deg2rad as a}from"../../../core/mathUtils.js";import{create as e}from"../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{create as i,fromValues as o}from"../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{zeros as r,create as c}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromArray as s}from"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{transpose as l,multiply as f}from"../../../core/libs/gl-matrix-2/math/mat3.js";import{invertOrIdentity as u,mul as h}from"../../../core/libs/gl-matrix-2/math/mat4.js";import{scale as m,sub as p,add as g}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{isSerializable as v}from"../../../core/support/jsonUtils.js";import M from"../../../geometry/Point.js";import{projectAsync as d}from"../../../geometry/projectionUtils.js";import{earth as x}from"../../../geometry/support/Ellipsoid.js";import{isWebMercator as w}from"../../../geometry/support/spatialReferenceUtils.js";import{a as y}from"../../../chunks/vec3.js";import{isConstantElevation as b,ConstantElevation as j,isElevationSource as O}from"../core/ElevationSourceDefinitions.js";import{getMetersPerUnitOfSR as z}from"../core/utils.js";import{getElevationSampler as P}from"./updateElevationUtils.js";import{isNumber as R}from"../../../support/guards.js";import{defaultImageSphereSize as F}from"../../../widgets/PanoramicViewer/constants.js";function E(t,n,a){const[e,o,r,c]=n,[s,l,f,m]=a;S(e,o,r,c);const p=S(s,l,f,m),g=H(e,o,r,c),v=H(s,l,f,m),M=u(i(),g),d=h(i(),M,v),[x,w,y,b]=D(t,d);return[x/b,w/b,p?0:y/b]}function S(t,n,a,e){return 0===t[2]&&0===n[2]&&0===a[2]&&0===e[2]&&(t[2]=n[2]=a[2]=e[2]=1,!0)}function V(t){return 0===t?1:t}function D(t,n){const[a,e,i]=t,o=[0,0,0,0];return o[0]=a*n[0]+e*n[1]+i*n[2]+n[3],o[1]=a*n[4]+e*n[5]+i*n[6]+n[7],o[2]=a*n[8]+e*n[9]+i*n[10]+n[11],o[3]=V(a*n[12]+e*n[13]+i*n[14]+n[15]),o}function H(t,n,a,e){const r=I(s([...e,1]),u(new Array(16),o(t[0],n[0],a[0],0,t[1],n[1],a[1],0,t[2],n[2],a[2],0,1,1,1,1))),c=r[0],l=r[1],f=r[2],h=i();return h[0]=c*t[0],h[1]=l*n[0],h[2]=f*a[0],h[3]=0,h[4]=c*t[1],h[5]=l*n[1],h[6]=f*a[1],h[7]=0,h[8]=c*t[2],h[9]=l*n[2],h[10]=f*a[2],h[11]=0,h[12]=c,h[13]=l,h[14]=f,h[15]=1,h}function L(t,n,a,e,i=r()){return i[0]=t[0]+n[0]*a,i[1]=t[1]+n[1]*a,i[2]=t[2]+n[2]*(a/e),i}function N(t,n,a){const e=r();return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*(n/a),e}function A(t,n){const[a,e,i]=t,o=r();return o[0]=a*n[0]+e*n[3]+i*n[6],o[1]=a*n[1]+e*n[4]+i*n[7],o[2]=a*n[2]+e*n[5]+i*n[8],o}function I(t,n){const[a,e,i,o]=t,r=new Array(4);return r[0]=a*n[0]+e*n[1]+i*n[2]+o*n[3],r[1]=a*n[4]+e*n[5]+i*n[6]+o*n[7],r[2]=a*n[8]+e*n[9]+i*n[10]+o*n[11],r[3]=a*n[12]+e*n[13]+i*n[14]+o*n[15],r}function Y(n,i,o,r=!0){if(!Number.isFinite(n))throw new t("InvalidRotationAngle","Please specify a valid angle for rotation");const c=o*(r?a(n):n),s=Math.cos(c),l=Math.sin(c),f=e();switch(i){case 0:f[4]=s,f[5]=-l,f[7]=l,f[8]=s;break;case 1:f[0]=s,f[2]=l,f[6]=-l,f[8]=s;break;case 2:f[0]=s,f[1]=-l,f[3]=l,f[4]=s;break;default:throw new t("InvalidRotationAxis","Please specify either 0, 1 or 2 for X, Y or Z axis respectively")}return f}const k={HPR:[[2,-1],[0,1],[2,-1]],OPK:[[0,1],[1,1],[2,1]],YPR:[[0,-1],[1,-1],[2,-1]]};function q(n,a,i=!0){if(3!==n?.length||3!==a?.length)throw new t("InvalidRotationAngles","Please specify three angles with config for rotation");const o=e();for(let t=0;t<3;t++){const[e,r]=a[t],c=Y(n[t],e,r,i);f(o,c,o)}return o}function U(t,n=!0){return q(t,k.OPK,n)}function C(t,n=!0){return q(t,k.HPR,n)}function K(t,n,e){const i=Math.sin(a(e)),o=Math.cos(a(e)),r=[[t,0],[t,n],[0,n]];r.forEach((t,n)=>{r[n]=[o*t[0]-i*t[1],i*t[0]+o*t[1]]});const c={xmin:Math.min(0,r[0][0],r[1][0],r[2][0]),xmax:Math.max(0,r[0][0],r[1][0],r[2][0]),ymin:Math.min(0,r[0][1],r[1][1],r[2][1]),ymax:Math.max(0,r[0][1],r[1][1],r[2][1])};return{hfov:Math.abs(c.xmax-c.xmin),vfov:Math.abs(c.ymax-c.ymin)}}function T(t,e){const i=Number(t[0]),o=Number(t[1]),r=Number(t[2]),[c,s,l,f]=e,u=a(c),h=a(s),m=l/Math.sqrt(1-f*Math.sin(u)**2),p=i/m,g=o/m,v=r/m,M=Math.cos(u)-Math.sin(u)*g+Math.cos(u)*v,d=Math.sin(u)+Math.cos(u)*g+Math.sin(u)*v,x=Math.sqrt(M**2+p**2),w=f*m*Math.sin(u),y=(t,n=5)=>{if(0===n)return t;const a=y(t,n-1);return Math.atan(d/x-(w-f*(l/Math.sqrt(1-f*Math.sin(a)**2))*Math.sin(a))/(m*x))},b=y(u),j=Math.atan(i/(m*M))+h,O=n(b);return[n(j),O,i/(Math.cos(b)*Math.sin(j-h))-l/Math.sqrt(1-f*Math.sin(b)**2)]}function W(t,n,a){const e=360/n,i=180/a;return{heading:(t.x-n/2)*e,pitch:90-(t.y-a/2)*i}}function X(t,n,a,e,i=F/2){const{heading:o,pitch:r}=G(t,i),c=e?Rt(o,r,e):[o,r];return{heading:o,pitch:r,...Z(c[0],c[1],n,a)}}function Z(t,n,a,e){const i=t%360;return{x:a/2+(i<-180?i+360:i>180?i-360:i)/(360/a),y:e-n/(180/e)}}function G(t,a){const e=n(Math.acos(-t.z/a));return{heading:n(Math.atan2(t.x,t.y)),pitch:e}}function J(t,n){return[Math.sin(a(t))*Math.sin(a(n)),Math.cos(a(t))*Math.sin(a(n)),Math.cos(a(180-n))]}function $(t,n,a,e=F/2){const i=a?Rt(t,n,a,!0):[t,n];return m(c(),J(i[0],i[1]),e)}function B(t,n,a,e,i=F/2){const{heading:o,pitch:r}=W(t,n,a);return $(o,r,e,i)}async function Q(t,a,e){const i=await d(a,t.spatialReference,e);let o=n(Math.atan2(i.y-t.y,i.x-t.x));return o=o>=0&&o<=90?90-o:o>90&&o<=180?360-o+90:90+Math.abs(o),o}function _(t,n,a){const e=Math.cos(a),i=Math.sin(a),o=[1,0,0,1,0,0],r=o[0]*e+o[2]*i,c=o[1]*e+o[3]*i,s=-o[0]*i+o[2]*e,l=-o[1]*i+o[3]*e;o[0]=r,o[1]=c,o[2]=s,o[3]=l;return[t*o[0]+n*o[2]+o[4],t*o[1]+n*o[3]+o[5]]}const tt=t=>t.toArray(),nt=(...t)=>t.some(t=>t);function at(t,n){if(nt(0===t.length,t.some(({x:t,y:n})=>nt(null==t,null==n)),!n.hasZ))throw new Error("Input pixels must have x, y and camera location must have z value")}function et(t,n){if(t.some(t=>null==t.z)||null==n.z)throw new Error("Input points and camera location must have z value")}function it(t){if(9!==t?.length)throw new Error("Rotation matrix is not provided or is not a valid 3x3 matrix")}function ot(t,n){return w(n)?1/Math.cos(Math.PI/2-2*Math.atan(Math.exp(-1*t/x.radius))):1}const rt=t=>n=>new M({x:n[0],y:n[1],z:n[2],spatialReference:t}),ct=t=>null!=t&&"queryExtent"in t;function st(t,n,a,e){return[[-n,-n],[+n,-n],[+n,+n],[-n,+n]].map(([n,i])=>E(y(r(),a,[n,i,0]),e,t))}function lt({a0:t,a1:n,a2:a,b0:e,b1:i,b2:o},r,c,s){const l=[t??r/2-.5,n,a??0,e??c/2-.5,i??0,o].map(ft);return null!=s&&ut(l)?{affines:l,focalLength:s}:{affines:[r/2-.5,1,0,c/2-.5,0,-1]}}function ft(t,n){if(null==t)return null;const a=parseFloat(`${t}`);return isNaN(a)?null:a}function ut(t){return null!=t[1]&&null!=t[5]}function ht(t,n,a){const{cameraHeight:e,cameraPitch:i,cameraRoll:o,elevation:r,farDistance:c,horizontalFieldOfView:s,location:l,verticalFieldOfView:f}=zt(t,t.location.spatialReference),u=r??(l.z??0)-e;return{...gt(t,n,a),averageElevation:u,cameraPitch:i,cameraRoll:o??0,farDistance:c,horizontalFieldOfView:s,verticalFieldOfView:f}}function mt(t,n,a,e){return jt(e)?U([e.omega,e.phi,e.kappa]):Ot(e)?C([e.heading,e.pitch,e.roll]):C([t,n,a??0])}function pt(t,n,a){const{cameraHeading:e,cameraHeight:i,farDistance:o,horizontalFieldOfView:r,location:c,verticalFieldOfView:s}=zt(t,t.location.spatialReference),l=(c.z??0)-i;let f=-e,u=0,h=0;if(t?.matrix){const{matrix:n}=t;[u,h,f]=Pt(n)}return{averageElevation:l,cameraLocation:c,cameraHeading:e,farDistance:o,horizontalFieldOfView:r,imageHeight:a,imageWidth:n,verticalFieldOfView:s,horizonYaw:f,horizonPitch:u,horizonRoll:h}}function gt(t,n,a){const{a0:e,a1:i,a2:o,b0:r,b1:c,b2:s,cameraHeading:l,cameraOrientation:f,cameraPitch:u,cameraRoll:h,focalLength:m,horizontalFieldOfView:p,location:g,matrix:v,principalX:M,principalY:d,radial:x,tangential:w,verticalFieldOfView:y}=t,{affines:b,focalLength:j}=lt({a0:e,a1:i,a2:o,b0:r,b1:c,b2:s},n,a,m),O=v??mt(l,u,h,f),z=null!=M&&null!=d?[M,d]:void 0;return{affineTransformations:f?.affineTransformations??b,cameraLocation:g.clone(),focalLength:f?.focalLength??j,horizontalFieldOfView:p,imageHeight:a,imageWidth:n,principalOffsetPoint:f?.principalOffsetPoint??z,radialDistortionCoefficients:f?.radialDistortionCoefficients??x,rotationMatrix:O,tangentialDistortionCoefficients:f?.tangentialDistortionCoefficients??w,verticalFieldOfView:y}}const vt=t=>null!=t&&"elevationSample"in t&&null!=t.elevationSample,Mt=t=>O(t?.elevationSource)&&null!=t?.extent,dt=t=>b(t?.elevationSource),xt=async(t,n,a,e,i)=>{const o=z(t),r=n-a/o;return dt(e)?(e.elevationSource=new j({constantElevation:e.elevationSource.constantElevation/o}),e):vt(e)?e:Mt(e)?{elevationSample:await P({...v(e.elevationSource)?e.elevationSource.toJSON():e.elevationSource,extent:e.extent},i),elevationSource:new j({constantElevation:r})}:{averageGroundElevation:r,spatialReference:t}},wt=t=>R(t?.heading)&&R(t?.pitch),yt=(t,n)=>[[-t,-n],[t,-n],[t,n],[-t,n]];function bt(t){const{cameraLocation:n,farDistance:i,horizontalFieldOfView:o,rotationMatrix:c,scalingFactor:s,verticalFieldOfView:f}=t,u=e();l(u,c);const h=2*Math.tan(a(f)/2)*i*s,m=2*Math.tan(a(o)/2)*i*s,v=A([0,0,-1],u),M=L([n.x,n.y,n.z],v,t.farDistance*s,s),d=A([0,1,0],u),x=A([1,0,0],u),w=N(d,h/2,s),y=N(x,m/2,s),b=p(r(),w,y),j=g(r(),w,y);return[g(r(),M,b),g(r(),M,j),p(r(),M,b),p(r(),M,j)]}const jt=t=>2===t?.type,Ot=t=>1===t?.type;function zt(t,n,a=!0){const e=z(n),i=a?t.clone():t;return i.cameraHeight/=e,i.farDistance/=e,i.nearDistance/=e,b(i.elevationSource)&&(i.elevationSource.constantElevation/=e),i}function Pt(t){return[n(Math.asin(-t[6])),n(Math.atan(t[7]/t[8])),n(Math.atan2(t[3],t[0]))]}function Rt(t,n,a,e=!1){return Ft(J(t,n),a,e)}function Ft(t,a,i=!1){const o=i?l(e(),q(a,k.YPR)):q(a,k.YPR),r=t[0]*o[0]+t[1]*o[1]+t[2]*o[2],c=t[0]*o[3]+t[1]*o[4]+t[2]*o[5],s=t[0]*o[6]+t[1]*o[7]+t[2]*o[8],f=n(Math.acos(-s));return[n(Math.atan2(r,c)),f]}export{Rt as adjustHorizonAngles,Ft as adjustHorizonAnglesVec3,bt as computeFarplaneVertices,K as computeHFOVAndVFOV,st as computeNewReferenceCoordinates,$ as convertHeadingPitchToSphereVertex,Z as convertOrientationToPixelLocation,B as convertPixelLocationToSphereVertex,W as convertPixelToHeadingPitch,G as convertSphereVertexToOrientation,X as convertSphereVertexToPixelLocation,zt as convertToSRUnits,J as createMeshSpaceVector,q as createRotationMatrix,C as createRotationMatrixFromHPR,U as createRotationMatrixFromOPK,Pt as extractHorizonAngles,lt as getAffinesAndFocalLength,pt as getImageToWorldPanoramicProperties,ht as getImageToWorldProperties,Q as getInitialAngle,xt as getUpdateElevationProps,ot as getWebMercatorScalingFactor,gt as getWorldToImageProperties,wt as hasAngles,Ot as hasHeadingPitchRoll,jt as hasOmegaPhiKappa,ct as isElevationSampler,vt as isUpdateElevationWithElevationSampler,Mt as isUpdateElevationWithElevationSource,dt as isUpdateUsingConstantElevation,ut as isValidAffines,H as linearEquationSolve,T as ltpToGeographic,nt as or,tt as pointToArray,E as projectiveTransform,yt as reducerFn,_ as rotatePixel,L as scaleAndAddWithFactor,N as scaleWithFactor,A as transformMat3,I as transformMat4,at as validatePixelsToTransform,et as validatePointsToTransform,it as validateRotationMatrix,rt as vecToPoint};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcgis/core",
3
- "version": "5.2.0-next.48",
3
+ "version": "5.2.0-next.49",
4
4
  "type": "module",
5
5
  "homepage": "https://js.arcgis.com",
6
6
  "description": "ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API",
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- const b="20260714",c="dbac1bd110d89d159c73758c25e187b8993bb46e";export{b as buildDate,c as commitHash};
2
+ const a="20260715",b="819bb268649af76af147d85760bd7ae755c6cf6a";export{a as buildDate,b as commitHash};