@arcgis/core 5.2.0-next.30 → 5.2.0-next.31
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.
- package/WebDocument2D.js +1 -1
- package/WebScene.js +1 -1
- package/arcade/ArcadePortal.js +1 -1
- package/arcade/Attachment.js +1 -1
- package/arcade/Dictionary.js +1 -1
- package/arcade/Feature.js +1 -1
- package/arcade/arcadeAsyncRuntime.js +1 -1
- package/arcade/arcadeCompiler.js +1 -1
- package/arcade/arcadeRuntime.js +1 -1
- package/arcade/containerUtils.js +1 -1
- package/arcade/debug.js +1 -1
- package/arcade/deepClone.js +1 -1
- package/arcade/featureSetUtils.js +1 -1
- package/arcade/featureset/sources/FeatureLayerDynamic.js +1 -1
- package/arcade/featureset/support/shared.js +1 -1
- package/arcade/functions/convertdirection.js +1 -1
- package/arcade/functions/date.js +1 -1
- package/arcade/functions/feature.js +1 -1
- package/arcade/functions/featuresetbase.js +1 -1
- package/arcade/functions/featuresetgeom.js +1 -1
- package/arcade/functions/featuresetstats.js +1 -1
- package/arcade/functions/featuresetstring.js +1 -1
- package/arcade/functions/geomasync.js +1 -1
- package/arcade/functions/geometry.js +1 -1
- package/arcade/functions/geomsync.js +1 -1
- package/arcade/functions/knowledgegraph.js +1 -1
- package/arcade/functions/maths.js +1 -1
- package/arcade/functions/stats.js +1 -1
- package/arcade/functions/string.js +1 -1
- package/arcade/geometry/constructors.js +1 -1
- package/arcade/geometry/functions.js +1 -1
- package/arcade/languageUtils.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{e5d2fab228d54b18a8a8.js → 08405116b5feb2d00101.js} +1 -1
- package/assets/esri/core/workers/chunks/{774615303c1cc9a77e20.js → 11af659688cf963ea6cd.js} +1 -1
- package/assets/esri/core/workers/chunks/{2665337e1b665e7e2b70.js → 15081b361fc42f40b865.js} +1 -1
- package/assets/esri/core/workers/chunks/{bcb2092c87d8d21c6458.js → 197b9f8483fad2258650.js} +1 -1
- package/assets/esri/core/workers/chunks/1cd8dff4373494b01ad4.js +1 -0
- package/assets/esri/core/workers/chunks/1d92da90fbbc3f98b201.js +1 -0
- package/assets/esri/core/workers/chunks/210ffc448c73a7bf63aa.js +1 -0
- package/assets/esri/core/workers/chunks/{a14e5607c5c091c77e3d.js → 2540beb53f1443a070d7.js} +1 -1
- package/assets/esri/core/workers/chunks/{689673173ca1c0e098fe.js → 25932fa010f9a32475c1.js} +1 -1
- package/assets/esri/core/workers/chunks/{e2d500ac1a264d09c857.js → 32b5d2537feefe6e94a3.js} +1 -1
- package/assets/esri/core/workers/chunks/34a024eda22d228e1fbe.js +1 -0
- package/assets/esri/core/workers/chunks/3f63b14b53b5ca716e3a.js +1 -0
- package/assets/esri/core/workers/chunks/{6df54132299b9e8f6dad.js → 456b77b8f13933a75b68.js} +1 -1
- package/assets/esri/core/workers/chunks/{3c342e662c13a05f4caf.js → 49713dfa4c8b788079d1.js} +1 -1
- package/assets/esri/core/workers/chunks/{45e4b9069263adeae394.js → 49a45083a9a155614c1c.js} +1 -1
- package/assets/esri/core/workers/chunks/4be31fcc5482a2526d2b.js +1 -0
- package/assets/esri/core/workers/chunks/{31d92ba9089617aa59ab.js → 57c003c6745d450558a7.js} +1 -1
- package/assets/esri/core/workers/chunks/{8104ac2eee69d79ada86.js → 6048c89fc4dcd2e9988d.js} +1 -1
- package/assets/esri/core/workers/chunks/{1b9c68e8431bb4608209.js → 6162f6735ea4622e54d8.js} +1 -1
- package/assets/esri/core/workers/chunks/684c9b4bd9590d2db12f.js +1 -0
- package/assets/esri/core/workers/chunks/684d3cb4fb233180b2d0.js +1 -0
- package/assets/esri/core/workers/chunks/{fe6385115d76e16e8da0.js → 75baf6dff6e7658b17b3.js} +1 -1
- package/assets/esri/core/workers/chunks/{166a0df6e37627e18976.js → 7a2dfa42610fe8414ed7.js} +1 -1
- package/assets/esri/core/workers/chunks/{43847d66726fd0bcbbb7.js → 83ae56c7fa8d84865605.js} +1 -1
- package/assets/esri/core/workers/chunks/8722e2790272e90a1897.js +1 -0
- package/assets/esri/core/workers/chunks/{1282598516cd0e3056b7.js → 977e6f589bd266d6067d.js} +2 -2
- package/assets/esri/core/workers/chunks/9f3d37e5f42bf1529673.js +1 -0
- package/assets/esri/core/workers/chunks/a833fc9250635eb4152f.js +1 -0
- package/assets/esri/core/workers/chunks/{47290f27375c76bcc9c7.js → b0253fe7b3529bc22270.js} +1 -1
- package/assets/esri/core/workers/chunks/b324bdb9c74fc3f956db.js +1 -0
- package/assets/esri/core/workers/chunks/{1bd7b7f4ee7ea6cb7ef9.js → b60f24a6c777301803f4.js} +1 -1
- package/assets/esri/core/workers/chunks/bd155794e9bc16dd0474.js +1 -0
- package/assets/esri/core/workers/chunks/{906f4c0fa8135e6c2f03.js → c660a5a1086870a3a6b9.js} +1 -1
- package/assets/esri/core/workers/chunks/cb58aff1ff186fa18345.js +1 -0
- package/assets/esri/core/workers/chunks/{17b98787a0698f584882.js → e7cb1b72f0b54e845741.js} +1 -1
- package/assets/esri/core/workers/chunks/{21122f3f3e19a7fd7d33.js → f69d3ff8a69c1985bca3.js} +1 -1
- package/assets/esri/libs/lyr3d/lyr3DMain.wasm +0 -0
- package/assets/esri/libs/parquet/pkg/bundle_bg.wasm +0 -0
- package/chunks/ShadowCastVisualize.glsl.js +4 -10
- package/chunks/aiServices.js +1 -1
- package/chunks/array.js +1 -1
- package/chunks/languageUtils.js +1 -1
- package/chunks/lyr3DMain.js +1 -1
- package/config.js +1 -1
- package/core/has.js +1 -1
- package/graphic/AnnotationFeatureGraphicOrigin.d.ts +3 -3
- package/graphic/AnnotationFeatureGraphicOrigin.js +1 -1
- package/intl/messages.d.ts +12 -2
- package/intl/t9n.d.ts +8 -1
- package/intl.d.ts +4 -0
- package/kernel.js +1 -1
- package/layers/AnnotationFeatureLayer.d.ts +1 -4
- package/layers/AnnotationFeatureLayer.js +1 -1
- package/layers/DimensionFeatureLayer.js +1 -1
- package/layers/VoxelWasmPerSceneView.js +1 -1
- package/layers/mixins/DataElementMixin.js +2 -0
- package/layers/support/AnnotationFeatureSublayer.js +1 -1
- package/layers/support/parquetUtils.js +1 -1
- package/package.json +1 -1
- package/support/ArcadeExpression.js +1 -1
- package/support/arcadeUtils.js +1 -1
- package/support/revision.js +1 -1
- package/symbols/cim/supportUtils.js +2 -0
- package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
- package/views/2d/engine/webgl/util/DimensionMatcher.js +1 -1
- package/views/2d/layers/features/layerAdapters/AnnotationLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/DimensionLayerAdapter.js +1 -1
- package/views/2d/layers/features/support/FeatureSetReaderParquet.js +1 -1
- package/views/2d/layers/support/annodime/annotationSchema.js +1 -1
- package/views/2d/layers/support/annodime/dimensionSchema.js +1 -1
- package/views/2d/layers/support/annodime/utils.js +1 -1
- package/views/2d/layers/support/annodime/virtualFields.js +1 -1
- package/views/3d/camera/constraintUtils.js +1 -1
- package/views/3d/state/ConstraintsManager.js +1 -1
- package/views/3d/terrain/PatchGeometryFactory.js +1 -1
- package/views/3d/terrain/PatchRenderData.js +1 -1
- package/views/3d/terrain/PatchRenderDataWaterproofness.js +2 -0
- package/views/3d/terrain/PlanarPatch.js +1 -1
- package/views/3d/terrain/SphericalPatch.js +1 -1
- package/views/3d/terrain/TileRenderer.js +1 -1
- package/views/3d/webgl-engine/effects/OpaqueEnvironment.js +1 -1
- package/views/3d/webgl-engine/effects/RenderNodes.js +1 -1
- package/views/3d/webgl-engine/effects/debug/RenderNodeVisualizerNode.js +1 -1
- package/views/3d/webgl-engine/effects/focusArea/FocusAreaMask.js +1 -1
- package/views/3d/webgl-engine/effects/geometry/ObjectAndLayerID.js +1 -1
- package/views/3d/webgl-engine/effects/highlight/Highlight.js +1 -1
- package/views/3d/webgl-engine/effects/highlight/ShadowHighlight.js +1 -1
- package/views/3d/webgl-engine/effects/highlight/ShadowHighlightBuffer.js +1 -1
- package/views/3d/webgl-engine/effects/laserlines/LaserLineRenderer.js +1 -1
- package/views/3d/webgl-engine/effects/magnifier/Magnifier.js +1 -1
- package/views/3d/webgl-engine/effects/smaa/SMAA.js +1 -1
- package/views/3d/webgl-engine/effects/stars/Stars.js +1 -1
- package/views/3d/webgl-engine/effects/stars/StarsTechnique.js +1 -1
- package/views/3d/webgl-engine/lib/CutFillComputation.js +1 -1
- package/views/3d/webgl-engine/lib/GaussianSplatRenderer.js +1 -1
- package/views/3d/webgl-engine/lib/GaussianSplatShadows.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/lib/ShadowAccumulator.js +1 -1
- package/views/3d/webgl-engine/lib/ShadowCastRenderer.js +1 -1
- package/views/3d/webgl-engine/lib/ShadowMap.js +1 -1
- package/views/3d/webgl-engine/statistics/RendererPerformanceInfo.js +1 -1
- package/views/3d/webgl.js +1 -1
- package/views/PopupView.js +1 -1
- package/views/layers/FeatureLikeLayerView.js +1 -1
- package/views/popupAdapter.js +1 -1
- package/webdoc/support/thumbnailUtils.js +1 -1
- package/webdoc/support/webdocSaveUtils.js +1 -1
- package/widgets/support/widget.d.ts +1 -0
- package/assets/esri/core/workers/chunks/125edba5c618c6257cb8.js +0 -1
- package/assets/esri/core/workers/chunks/168be2eac0fa3c67ae27.js +0 -1
- package/assets/esri/core/workers/chunks/32740b075d7a890d7888.js +0 -1
- package/assets/esri/core/workers/chunks/5189413a83faf3480e29.js +0 -1
- package/assets/esri/core/workers/chunks/a2be8784f2cfdbb42681.js +0 -1
- package/assets/esri/core/workers/chunks/a9db775210ebeee41738.js +0 -1
- package/assets/esri/core/workers/chunks/bca6abc185dedec0f41b.js +0 -1
- package/assets/esri/core/workers/chunks/bee56a6ac99312f03109.js +0 -1
- package/assets/esri/core/workers/chunks/d1d135a54233092ad637.js +0 -1
- package/assets/esri/core/workers/chunks/d750e4abeb777caa8c36.js +0 -1
- package/assets/esri/core/workers/chunks/daf539e9f88fc9e101e4.js +0 -1
- package/assets/esri/core/workers/chunks/e774303efefee31952d0.js +0 -1
- package/assets/esri/core/workers/chunks/e8546ab510fc9515bd23.js +0 -1
- package/assets/esri/core/workers/chunks/fc9664d3282b052ef40f.js +0 -1
- package/views/2d/layers/support/annodime/DimensionMatcherSchema.js +0 -2
- package/views/2d/layers/support/annodime/unsupported.js +0 -2
|
@@ -385,7 +385,7 @@ float joinCenterDistance = abs(vSubdivisionFactor > 0.5 ? joinCenterSDFs.x : joi
|
|
|
385
385
|
float straightFeather = (joinCenterDistance - straightFeatherStartDistance) / (lineWidth - straightFeatherStartDistance);
|
|
386
386
|
feather = vIsInsideJoin == 1 ? max(feather, straightFeather) : feather;
|
|
387
387
|
finalColor.a *= 1.0 - clamp(feather, 0.0, 1.0);`),z&&E.main.add("finalColor = animate(finalColor);")),E.main.add(x.H`outputColorHighlightOLID(applySlice(finalColor, vpos), finalColor.rgb);`),t}const E=Object.freeze(Object.defineProperty({__proto__:null,build:A,ribbonlineNumRoundJoinSubdivisions:T},Symbol.toStringTag,{value:"Module"}))},92942(e,t,i){i.d(t,{T:()=>u,a:()=>d,b:()=>h});var r=i(51850),n=i(82048),s=i(33079),o=i(31821),a=i(63761),l=i(65786),c=i(14113);class u extends l.Y{constructor(){super(...arguments),this.color=(0,r.fA)(1,1,1)}}function h(){const e=new c.N5;return e.include(n.c),e.fragment.uniforms.add(new a.N("tex",e=>e.texture),new s.t("uColor",e=>e.color)).main.add(o.H`vec4 texColor = texture(tex, uv);
|
|
388
|
-
fragColor = texColor * vec4(uColor, 1.0);`),e}const d=Object.freeze(Object.defineProperty({__proto__:null,TexturePassParameters:u,build:h},Symbol.toStringTag,{value:"Module"}))},83349(e,t,i){function r(e,t,i){i=i||2;var r,s,a,l,c,u,d,p=t&&t.length,f=p?t[0]*i:e.length,g=n(e,0,f,i,!0),m=[];if(!g||g.next===g.prev)return m;if(p&&(g=h(e,t,g,i)),e.length>80*i){r=a=e[0],s=l=e[1];for(var v=i;v<f;v+=i)(c=e[v])<r&&(r=c),(u=e[v+1])<s&&(s=u),c>a&&(a=c),u>l&&(l=u);d=0!==(d=Math.max(a-r,l-s))?1/d:0}return o(g,m,i,r,s,d),m}function n(e,t,i,r,n){var s,o;if(n===L(e,t,i,r)>0)for(s=t;s<i;s+=r)o=R(s,e[s],e[s+1],o);else for(s=i-r;s>=t;s-=r)o=R(s,e[s],e[s+1],o);if(o&&S(o,o.next)){var a=o.next;O(o),o=a}return o}function s(e,t){if(!e)return e;t||(t=e);var i,r=e;do{if(i=!1,r.steiner||!S(r,r.next)&&0!==b(r.prev,r,r.next))r=r.next;else{var n=r.prev;if(O(r),(r=t=n)===r.next)break;i=!0}}while(i||r!==t);return t}function o(e,t,i,r,n,h,d){if(e){!d&&h&&m(e,r,n,h);for(var p,f,g=e;e.prev!==e.next;)if(p=e.prev,f=e.next,h?l(e,r,n,h):a(e))t.push(p.i/i),t.push(e.i/i),t.push(f.i/i),O(e),e=f.next,g=f.next;else if((e=f)===g){d?1===d?o(e=c(s(e),t,i),t,i,r,n,h,2):2===d&&u(e,t,i,r,n,h):o(s(e),t,i,r,n,h,1);break}}}function a(e){var t=e.prev,i=e,r=e.next;if(b(t,i,r)>=0)return!1;for(var n=e.next.next;n!==e.prev;){if(y(t.x,t.y,i.x,i.y,r.x,r.y,n.x,n.y)&&b(n.prev,n,n.next)>=0)return!1;n=n.next}return!0}function l(e,t,i,r){var n=e.prev,s=e,o=e.next;if(b(n,s,o)>=0)return!1;for(var a=n.x<s.x?n.x<o.x?n.x:o.x:s.x<o.x?s.x:o.x,l=n.y<s.y?n.y<o.y?n.y:o.y:s.y<o.y?s.y:o.y,c=n.x>s.x?n.x>o.x?n.x:o.x:s.x>o.x?s.x:o.x,u=n.y>s.y?n.y>o.y?n.y:o.y:s.y>o.y?s.y:o.y,h=v(a,l,t,i,r),d=v(c,u,t,i,r),p=e.prevZ,f=e.nextZ;p&&p.z>=h&&f&&f.z<=d;){if(p!==e.prev&&p!==e.next&&y(n.x,n.y,s.x,s.y,o.x,o.y,p.x,p.y)&&b(p.prev,p,p.next)>=0)return!1;if(p=p.prevZ,f!==e.prev&&f!==e.next&&y(n.x,n.y,s.x,s.y,o.x,o.y,f.x,f.y)&&b(f.prev,f,f.next)>=0)return!1;f=f.nextZ}for(;p&&p.z>=h;){if(p!==e.prev&&p!==e.next&&y(n.x,n.y,s.x,s.y,o.x,o.y,p.x,p.y)&&b(p.prev,p,p.next)>=0)return!1;p=p.prevZ}for(;f&&f.z<=d;){if(f!==e.prev&&f!==e.next&&y(n.x,n.y,s.x,s.y,o.x,o.y,f.x,f.y)&&b(f.prev,f,f.next)>=0)return!1;f=f.nextZ}return!0}function c(e,t,i){var r=e;do{var n=r.prev,o=r.next.next;!S(n,o)&&w(n,r,r.next,o)&&A(n,o)&&A(o,n)&&(t.push(n.i/i),t.push(r.i/i),t.push(o.i/i),O(r),O(r.next),r=e=o),r=r.next}while(r!==e);return s(r)}function u(e,t,i,r,n,a){var l=e;do{for(var c=l.next.next;c!==l.prev;){if(l.i!==c.i&&_(l,c)){var u=E(l,c);return l=s(l,l.next),u=s(u,u.next),o(l,t,i,r,n,a),void o(u,t,i,r,n,a)}c=c.next}l=l.next}while(l!==e)}function h(e,t,i,r){var o,a,l,c=[];for(o=0,a=t.length;o<a;o++)(l=n(e,t[o]*r,o<a-1?t[o+1]*r:e.length,r,!1))===l.next&&(l.steiner=!0),c.push(x(l));for(c.sort(d),o=0;o<c.length;o++)i=s(i=f(c[o],i),i.next);return i}function d(e,t){return e.x-t.x}function p(e){if(e.next.prev===e)return e;let t=e;for(;;){const i=t.next;if(i.prev===t||i===t||i===e)break;t=i}return t}function f(e,t){var i=function(e,t){var i,r=t,n=e.x,s=e.y,o=-1/0;do{if(s<=r.y&&s>=r.next.y&&r.next.y!==r.y){var a=r.x+(s-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(a<=n&&a>o){if(o=a,a===n){if(s===r.y)return r;if(s===r.next.y)return r.next}i=r.x<r.next.x?r:r.next}}r=r.next}while(r!==t);if(!i)return null;if(n===o)return i;var l,c=i,u=i.x,h=i.y,d=1/0;r=i;do{n>=r.x&&r.x>=u&&n!==r.x&&y(s<h?n:o,s,u,h,s<h?o:n,s,r.x,r.y)&&(l=Math.abs(s-r.y)/(n-r.x),A(r,e)&&(l<d||l===d&&(r.x>i.x||r.x===i.x&&g(i,r)))&&(i=r,d=l)),r=r.next}while(r!==c);return i}(e,t);if(!i)return t;var r=E(i,e),n=s(i,i.next);let o=p(r);return s(o,o.next),n=p(n),p(t===i?n:t)}function g(e,t){return b(e.prev,e,t.prev)<0&&b(t.next,e,e.next)<0}function m(e,t,i,r){var n=e;do{null===n.z&&(n.z=v(n.x,n.y,t,i,r)),n.prevZ=n.prev,n.nextZ=n.next,n=n.next}while(n!==e);n.prevZ.nextZ=null,n.prevZ=null,function(e){var t,i,r,n,s,o,a,l,c=1;do{for(i=e,e=null,s=null,o=0;i;){for(o++,r=i,a=0,t=0;t<c&&(a++,r=r.nextZ);t++);for(l=c;a>0||l>0&&r;)0!==a&&(0===l||!r||i.z<=r.z)?(n=i,i=i.nextZ,a--):(n=r,r=r.nextZ,l--),s?s.nextZ=n:e=n,n.prevZ=s,s=n;i=r}s.nextZ=null,c*=2}while(o>1)}(n)}function v(e,t,i,r,n){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-i)*n)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-r)*n)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function x(e){var t=e,i=e;do{(t.x<i.x||t.x===i.x&&t.y<i.y)&&(i=t),t=t.next}while(t!==e);return i}function y(e,t,i,r,n,s,o,a){return(n-o)*(t-a)-(e-o)*(s-a)>=0&&(e-o)*(r-a)-(i-o)*(t-a)>=0&&(i-o)*(s-a)-(n-o)*(r-a)>=0}function _(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){var i=e;do{if(i.i!==e.i&&i.next.i!==e.i&&i.i!==t.i&&i.next.i!==t.i&&w(i,i.next,e,t))return!0;i=i.next}while(i!==e);return!1}(e,t)&&(A(e,t)&&A(t,e)&&function(e,t){var i=e,r=!1,n=(e.x+t.x)/2,s=(e.y+t.y)/2;do{i.y>s!=i.next.y>s&&i.next.y!==i.y&&n<(i.next.x-i.x)*(s-i.y)/(i.next.y-i.y)+i.x&&(r=!r),i=i.next}while(i!==e);return r}(e,t)&&(b(e.prev,e,t.prev)||b(e,t.prev,t))||S(e,t)&&b(e.prev,e,e.next)>0&&b(t.prev,t,t.next)>0)}function b(e,t,i){return(t.y-e.y)*(i.x-t.x)-(t.x-e.x)*(i.y-t.y)}function S(e,t){return e.x===t.x&&e.y===t.y}function w(e,t,i,r){var n=T(b(e,t,i)),s=T(b(e,t,r)),o=T(b(i,r,e)),a=T(b(i,r,t));return n!==s&&o!==a||!(0!==n||!C(e,i,t))||!(0!==s||!C(e,r,t))||!(0!==o||!C(i,e,r))||!(0!==a||!C(i,t,r))}function C(e,t,i){return t.x<=Math.max(e.x,i.x)&&t.x>=Math.min(e.x,i.x)&&t.y<=Math.max(e.y,i.y)&&t.y>=Math.min(e.y,i.y)}function T(e){return e>0?1:e<0?-1:0}function A(e,t){return b(e.prev,e,e.next)<0?b(e,t,e.next)>=0&&b(e,e.prev,t)>=0:b(e,t,e.prev)<0||b(e,e.next,t)<0}function E(e,t){var i=new M(e.i,e.x,e.y),r=new M(t.i,t.x,t.y),n=e.next,s=t.prev;return e.next=t,t.prev=e,i.next=n,n.prev=i,r.next=i,i.prev=r,s.next=r,r.prev=s,r}function R(e,t,i,r){var n=new M(e,t,i);return r?(n.next=r.next,n.prev=r,r.next.prev=n,r.next=n):(n.prev=n,n.next=n),n}function O(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function M(e,t,i){this.i=e,this.x=t,this.y=i,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function L(e,t,i,r){for(var n=0,s=t,o=i-r;s<i;s+=r)n+=(e[o]-e[s])*(e[s+1]+e[o+1]),o=s;return n}i.d(t,{e:()=>r}),r.deviation=function(e,t,i,r){var n=t&&t.length,s=n?t[0]*i:e.length,o=Math.abs(L(e,0,s,i));if(n)for(var a=0,l=t.length;a<l;a++){var c=t[a]*i,u=a<l-1?t[a+1]*i:e.length;o-=Math.abs(L(e,c,u,i))}var h=0;for(a=0;a<r.length;a+=3){var d=r[a]*i,p=r[a+1]*i,f=r[a+2]*i;h+=Math.abs((e[d]-e[f])*(e[p+1]-e[d+1])-(e[d]-e[p])*(e[f+1]-e[d+1]))}return 0===o&&0===h?0:Math.abs((h-o)/o)},r.flatten=function(e){for(var t=e[0][0].length,i={vertices:[],holes:[],dimensions:t},r=0,n=0;n<e.length;n++){for(var s=0;s<e[n].length;s++)for(var o=0;o<t;o++)i.vertices.push(e[n][s][o]);n>0&&(r+=e[n-1].length,i.holes.push(r))}return i}},21287(e,t,i){i.d(t,{M5:()=>h,eV:()=>u});var r=i(11254),n=i(49186),s=i(17676),o=i(84952),a=i(26306);let l=null,c=!0;function u(e,t,i,r){if(!t||!i)throw new Error("Cannot construct image data without dimensions");if(c)try{return new ImageData(e,t,i)}catch(e){c=!1}const n=function(e,t,i){return i||(l||(l=document.createElement("canvas"),l.width=1,l.height=1),i=l),i.getContext("2d").createImageData(e,t)}(t,i,r);return n.data.set(e,0),n}async function h(e,t){const{arrayBuffer:l,mediaType:c}=await async function(e,t){const i=(0,o.r$)(e);if(i?.isBase64)return{arrayBuffer:(0,a.M)(i.data),mediaType:i.mediaType};const n=await(0,r.A)(e,{responseType:"array-buffer",...t});return{arrayBuffer:n.data,mediaType:n.getHeader?.("Content-Type")??""}}(e,t),u="image/png"===c;if("image/gif"===c){const{isAnimatedGIF:e,parseGif:r}=await i.e(820).then(i.bind(i,10820));if(e(l))return r(l,t)}if(u){const{isAnimatedPNG:e,parseApng:r}=await i.e(2390).then(i.bind(i,22390));if(e(l))return r(l,t)}return async function(e,t){const i=window.URL.createObjectURL(e);try{const{data:e}=await(0,r.A)(i,{...t,responseType:"image"});return e}catch(e){if(!(0,s.zf)(e))throw new n.A("invalid-image",`Could not fetch requested image at ${i}`);throw e}finally{window.URL.revokeObjectURL(i)}}(new Blob([l],{type:c}),t)}},83300(e,t,i){i.r(t),i.d(t,{default:()=>Oe});var r=i(5482),n=i(69540),s=i(92474),o=i(53966),a=i(61893),l=i(17676),c=i(36708),u=i(91429),h=i(51850),d=i(91075),p=i(86738),f=i(39829),g=i(70328),m=i(24770),v=i(16939),x=i(49186);const y="Expected location to be a Point instance";class _ extends x.A{constructor(){super("invalid-input:location",y)}}var b=i(95696),S=i(18251),w=i(73836),C=i(1193),T=i(27615),A=i(35522),E=i(65806);function R(e,t){switch(e.type){case"georeferenced":return t.isGeographic;case"local":return t.isGeographic||t.isWebMercator}}var O=i(22141),M=i(72258);const L=()=>o.A.getLogger("esri.geometry.support.meshUtils.centerAt");const P=(0,h.vt)(),I=(0,h.vt)(),D=(0,h.vt)();var F=i(9093),N=i(5443),z=i(91218),H=i(98764),V=i(48353),W=i(9762),j=i(4197),U=i(73354);const B=(0,F.vt)(),$=(0,j.jh)(24);var Z=i(84952);function k(e){const t=(0,Z.nM)(e.url);return i=>{const r=(0,Z.V1)(i,t,t),n=r?r.replace(/^ *\.\//,""):null;return(n?e.files.get(n):null)??i}}async function G(e,t){switch(e.type){case"client":return Array.isArray(e.files)?function(e){if(!e.length)throw new x.A("mesh-load-external:missing-assets","There must be at least one file to load");return ee(e.map(e=>({name:e.name,mimeType:e.type,source:q(e)})))}(e.files):q(e.files);case"service":return async function(e,t){if(!e.length)throw new x.A("mesh-load-external:missing-assets","There must be at least one file to load");const i=await(0,l.nA)(e.map(async e=>{const i=await async function(e,t){const{parts:i,assetMimeType:r,assetName:n}=e;if(1===i.length)return new te(i[0].partUrl);const s=await e.toBlob(t);return(0,l.Te)(t),te.fromBlob(s,ie(n,r))}(e);return(0,l.Te)(t),{name:e.assetName,mimeType:e.assetMimeType,source:i}}));if((0,l.G4)(t))throw i.forEach(e=>e.source.dispose()),(0,l.NK)();return ee(i)}(e.assets,t);default:throw new x.A("mesh-load-external:invalid-source","Invalid source type")}}function q(e){return te.fromBlob(e,ie(e.name,e.type))}const Y=/^model\/gltf\+json$/,Q=/^model\/gltf-binary$/,X=/\.gltf$/i,K=/\.glb$/i;function J({mimeType:e,source:t,name:i}){return Y.test(e)||X.test(i)?{url:t.url,type:"gltf"}:Q.test(e)||K.test(i)?{url:t.url,type:"glb"}:null}function ee(e){const t=new Map;let i=null,r=null;for(const n of e){const{source:e,name:s}=n;i??=J(n),"ESRI3DO_NORM.glb"===s&&(r=J(n)),t.set(s,e.url),e.files.forEach((e,i)=>t.set(i,e))}const n=r??i;if(null==n)throw new x.A("mesh-load-external:missing-files","Missing files to load external mesh source");return new te(n.url,()=>e.forEach(({source:e})=>e.dispose()),t,n.type)}class te{constructor(e,t=()=>{},i=new Map,r){this.url=e,this.dispose=t,this.files=i,this.type=r}static fromBlob(e,t){const i=URL.createObjectURL(e);return new te(i,()=>URL.revokeObjectURL(i),void 0,t)}}function ie(e,t){return Y.test(t)||X.test(e)?"gltf":Q.test(t)||X.test(e)?"glb":void 0}var re=i(66895),ne=i(29461),se=i(15070),oe=i(77690),ae=i(29242),le=i(58083),ce=i(67026),ue=i(82534);const he=()=>o.A.getLogger("esri.geometry.support.meshUtils.rotate");function de(e,t,i,r=h.uY){if(null!=e){(0,le.$0)(me,(0,m.$I)(t),(0,m.yo)(t));for(let t=0;t<e.length;t+=i){for(let i=0;i<3;i++)pe[i]=e[t+i]-r[i];(0,A.Z0)(pe,pe,me);for(let i=0;i<3;i++)e[t+i]=pe[i]+r[i]}}}const pe=(0,h.vt)(),fe=(0,F.vt)(),ge=(0,m.vt)(),me=(0,F.vt)(),ve=(0,ae.vt)(),xe=(0,h.vt)(),ye=(0,ue.vt)(),_e=()=>o.A.getLogger("esri.geometry.support.meshUtils.scale");function be(e,t,i=h.uY){if(e)for(let r=0;r<e.length;r+=3){for(let t=0;t<3;t++)Se[t]=e[r+t]-i[t];(0,A.hs)(Se,Se,t);for(let t=0;t<3;t++)e[r+t]=Se[t]+i[t]}}const Se=(0,h.vt)(),we=(0,h.vt)(),Ce=(0,F.vt)(),Te=(0,h.vt)();var Ae,Ee=i(65801);const Re={base:null,key:"type",defaultKeyValue:"georeferenced",typeMap:{georeferenced:b.A,local:S.default}};let Oe=Ae=class extends((0,n.OU)((0,s.WV)((0,a.g)(d.A)))){constructor(e){super(e),this.components=null,this.vertexSpace=new b.A,this.transform=null,this.metadata=new ne.O,this.hasZ=!0,this.hasM=!1,this.vertexAttributes=new C.default,this.type="mesh"}initialize(){(0===this.metadata.externalSources.length||this.vertexAttributes.position.length)&&(this.loadStatus="loaded"),this.when(()=>{this.addHandles((0,c.wB)(()=>({vertexAttributes:this.vertexAttributes,components:this.components?.map(e=>e.clone())}),()=>this._clearSources(),{once:!0,sync:!0}))}).catch(()=>{})}get hasExtent(){return this.loaded?this.vertexAttributes.position.length>0&&(!this.components||this.components.length>0):null!=this.metadata.displaySource?.extent}get _transformedExtent(){const{spatialReference:e,vertexSpace:t}=this,i=this;return function(e){const{spatialReference:t,vertexSpace:i,untransformedBounds:r}=e,n=(0,g.gE)(r,$);if((0,T.Hq)(i)&&e.transform&&(0,U.a)(n,n,e.transform.localMatrix),"georeferenced"===i.type){const e=i.origin;return e&&(0,U.t)(n,n,e),(0,g.w1)((0,g.vY)(n),t)}const s=(0,H.lO)(t),o=i.origin;if(!(0,z.canProjectWithoutEngine)(s,t)){const[e,i,r]=o;return new N.A({xmin:e,ymin:i,zmin:r,xmax:e,ymax:i,zmax:r,spatialReference:t})}return(0,V.l)(t,o,B,s),(0,U.a)(n,n,B),(0,W.projectBuffer)(n,s,0,n,t,0),(0,g.w1)((0,g.vY)(n),t)}({get transform(){return i.transform},vertexSpace:t,spatialReference:e,untransformedBounds:this._untransformedBounds})}get _untransformedBounds(){const{vertexAttributes:{position:e},components:t}=this;return 0===e.length||0===t?.length?(0,g.vt)(g.v_):(0,g.vY)(e)}get origin(){const e=(0,T.MW)(this.vertexSpace,this.spatialReference);if(null!=e)return e;const{center:t,zmin:i}=this._transformedExtent;return new p.A({x:t.x,y:t.y,z:i,spatialReference:this.spatialReference})}get extent(){return this.loaded||null==this.metadata?.displaySource?.extent?this._transformedExtent:this.metadata.displaySource.extent.clone()}addComponent(e){this._checkIfLoaded("addComponent()")&&(this.components||(this.components=[]),this.components.push(v.default.from(e)),this.notifyChange("components"))}removeComponent(e){if(this._checkIfLoaded("removeComponent()")){if(this.components){const t=this.components.indexOf(e);if(-1!==t)return this.components.splice(t,1),void this.notifyChange("components")}o.A.getLogger(this).error("removeComponent()","Provided component is not part of the list of components")}}rotate(e,t,i,r){return(0,m.AU)(e,t,i,Me),function(e,t,i){if(!e.vertexAttributes?.position||0===t[3])return;const{spatialReference:r,vertexSpace:n}=e,s=i?.origin??e.origin;(0,T.CK)(e)?function(e,t,i){e.transform??=new w.A;const{vertexSpace:r,transform:n,spatialReference:s}=e,[o,a,l]=r.origin,c=new p.A({x:o,y:a,z:l,spatialReference:s}),u=pe;if(c.equals(i))(0,A.hZ)(u,0,0,0);else if(!(0,M.p5)(u,i,e))return void(0,O.CN)(he(),i.spatialReference,s,O.JP);(0,ce.x8)(ye,(0,m.yo)(t),(0,m.$I)(t));const d=(0,le.O7)(fe,ye,h.uY,h.Un,u),{localMatrix:f}=n,g=(0,le.lw)(fe,d,f);n.scale=(0,le.X_)((0,h.vt)(),g),(0,le.hs)(g,g,(0,A.DI)(pe,n.scale));const v=n.rotationAxis;n.rotation=(0,m.ui)(g),0===n.rotationAngle&&(n.rotationAxis=v),n.translation=(0,le.sC)((0,h.vt)(),g)}(e,t,s):R(n,r)?function(e,t,i){const r=e.spatialReference,n=(0,H.lO)(r),s=xe;if(!(0,E.g)(i,s,n)&&((0,O.CN)(he(),i.spatialReference,n,"Falling back to mesh origin"),!(0,E.g)(e.origin,s,n)))return void(0,O.CN)(he(),e.origin.spatialReference,n);const o=e.vertexAttributes.position,a=e.vertexAttributes.normal,l=e.vertexAttributes.tangent,c=new Float64Array(o.length),u=null!=a?new Float32Array(a.length):null,h=null!=l?new Float32Array(l.length):null;(0,V.l)(n,s,me,n),(0,oe.z0)(ve,me);const d=ge;(0,A.ei)((0,m.yo)(ge),(0,m.yo)(t),ve),d[3]=t[3],!(0,O.gr)(o,r,c,n)||null!=a&&null!=u&&!(0,O.X4)(a,o,r,c,n,u)||null!=l&&null!=h&&!(0,O.xA)(l,o,r,c,n,h)?(0,O.CN)(he(),r,n):(de(c,d,3,s),!(0,O.$5)(c,n,o,r)||null!=a&&null!=u&&(de(u,d,3),!(0,O.si)(u,o,r,c,n,a))||null!=l&&null!=h&&(de(h,d,4),!(0,O.Mv)(h,o,r,c,n,l))?(0,O.CN)(he(),n,r):e.vertexAttributesChanged())}(e,t,s):function(e,t,i){const r=xe;if(!(0,E.g)(i,r,e.spatialReference)){const t=e.origin;return r[0]=t.x,r[1]=t.y,r[2]=t.z,void(0,O.CN)(he(),i.spatialReference,e.spatialReference,O.JP)}de(e.vertexAttributes.position,t,3,r),de(e.vertexAttributes.normal,t,3),de(e.vertexAttributes.tangent,t,4),e.vertexAttributesChanged()}(e,t,s)}(this,Me,r),this}offset(e,t,i){if(!this._checkIfLoaded("offset()"))return this;const{vertexSpace:r,vertexAttributes:n}=this,s=n?.position;if(!s)return this;if((0,T.Hq)(r)){const[n,s,o]=r.origin;r.origin=(0,h.fA)(n+e,s+t,o+i)}else{for(let r=0;r<s.length;r+=3)s[r]+=e,s[r+1]+=t,s[r+2]+=i;this.vertexAttributesChanged()}return this}scale(e,t){return this._checkIfLoaded("scale()")?(function(e,t,i){if(!e.vertexAttributes?.position)return;const{vertexSpace:r,spatialReference:n}=e,s=i?.origin??e.origin;(0,T.CK)(e)?function(e,t,i){e.transform??=new w.A;const{vertexSpace:r,transform:n,spatialReference:s}=e,[o,a,l]=r.origin,c=new p.A({x:o,y:a,z:l,spatialReference:s}),u=Se;if(c.equals(i))(0,A.hZ)(u,0,0,0);else if(!(0,M.p5)(u,i,e))return void(0,O.CN)(_e(),i.spatialReference,s,O.JP);const d=(0,A.hZ)(we,t,t,t),f=(0,le.O7)(Ce,ue.zK,h.uY,d,u),{localMatrix:g}=n,v=(0,le.lw)(Ce,f,g);n.scale=(0,le.X_)((0,h.vt)(),v),(0,le.hs)(v,v,(0,A.DI)(Se,n.scale));const x=n.rotationAxis;n.rotation=(0,m.ui)(v),0===n.rotationAngle&&(n.rotationAxis=x),n.translation=(0,le.sC)((0,h.vt)(),v)}(e,t,s):R(r,n)?function(e,t,i){const r=e.spatialReference,n=(0,H.lO)(r),s=Te;if(!(0,E.g)(i,s,n)&&((0,O.CN)(_e(),i.spatialReference,n,"Falling back to mesh origin"),!(0,E.g)(e.origin,s,n)))return void(0,O.CN)(_e(),e.origin.spatialReference,n);const o=e.vertexAttributes.position,a=e.vertexAttributes.normal,l=e.vertexAttributes.tangent,c=new Float64Array(o.length),u=null!=a?new Float32Array(a.length):null,h=null!=l?new Float32Array(l.length):null;!(0,O.gr)(o,r,c,n)||null!=a&&null!=u&&!(0,O.X4)(a,o,r,c,n,u)||null!=l&&null!=h&&!(0,O.xA)(l,o,r,c,n,h)?(0,O.CN)(_e(),r,n):(be(c,t,s),!(0,O.$5)(c,n,o,r)||null!=a&&null!=u&&!(0,O.si)(u,o,r,c,n,a)||null!=l&&null!=h&&!(0,O.Mv)(h,o,r,c,n,l)?(0,O.CN)(_e(),n,r):e.vertexAttributesChanged())}(e,t,s):function(e,t,i){const r=Te;if(!(0,E.g)(i,r,e.spatialReference)){const t=e.origin;return r[0]=t.x,r[1]=t.y,r[2]=t.z,void(0,O.CN)(_e(),i.spatialReference,e.spatialReference,O.JP)}be(e.vertexAttributes.position,t,r),e.vertexAttributesChanged()}(e,t,s)}(this,e,t),this):this}centerAt(e,t){return this._checkIfLoaded("centerAt()")?(function(e,t,i){if(!e.vertexAttributes?.position)return;const{vertexSpace:r}=e,n=i?.origin??e.origin;(0,T.Hq)(r)?function(e,t,i){const{vertexSpace:r}=e;if(!(0,T.Hq)(r))return;const n=I,s=P;if(!(0,E.g)(t,s,e.spatialReference))return void(0,O.CN)(L(),t.spatialReference,e.spatialReference,O.JP);if(!(0,E.g)(i,n,e.spatialReference))return void(0,O.CN)(L(),i.spatialReference,e.spatialReference,O.JP);const o=(0,A.Re)(D,s,n);r.origin=(0,A.WQ)((0,h.vt)(),r.origin,o)}(e,t,n):R(r,n.spatialReference)?function(e,t,i){const r=(0,h.fA)(i.x,i.y,i.z??0),n=(0,M.UR)(e,new S.default({origin:r}));if(!n)return;const s=(0,h.fA)(t.x,t.y,t.z??0),o=(0,M.UR)({vertexAttributes:n,spatialReference:e.spatialReference,vertexSpace:new S.default({origin:s})},b.A.absolute);if(!o)return;const{position:a,normal:l,tangent:c}=o;e.vertexAttributes.position=a,e.vertexAttributes.normal=l,e.vertexAttributes.tangent=c,e.vertexAttributesChanged()}(e,t,n):function(e,t,i){const r=I,n=P;if((0,E.g)(t,n,e.spatialReference)){if(!(0,E.g)(i,r,e.spatialReference)){const t=e.origin;return r[0]=t.x,r[1]=t.y,r[2]=t.z,void(0,O.CN)(L(),i.spatialReference,e.spatialReference,O.JP)}(function(e,t,i){if(e)for(let r=0;r<e.length;r+=3)for(let n=0;n<3;n++)e[r+n]+=t[n]-i[n]})(e.vertexAttributes.position,n,r),e.vertexAttributesChanged()}else(0,O.CN)(L(),t.spatialReference,e.spatialReference,O.JP)}(e,t,n)}(this,e,t),this):this}load(e){const{metadata:{displaySource:t}}=this;return t&&this.addResolvingPromise(async function(e,t,r){switch(t.source.type){case"client":case"service":return async function(e,t,r){const{source:n}=t,{loadGLTFMesh:s}=await(0,l.qr)(i.e(5841).then(i.bind(i,35841)),r),o=await G(n,r);(0,l.Te)(r);const a=s(new p.A({x:0,y:0,z:0,spatialReference:e.spatialReference}),o.url,{resolveFile:k(o),signal:r?.signal,expectedType:o.type,unitConversionDisabled:t.unitConversionDisabled}),{mesh:{vertexAttributes:c,components:u},meta:{isDracoDecompressed:h}}=await a.finally(()=>o.dispose());if(h)throw new x.A("mesh-load-external:draco-not-supported","The provided mesh uses Draco compression which is not supported.");e.vertexAttributes=c,e.components=u}(e,t,r);case"loadable":return t.source.load(e,r);default:t.source}}(this,t,e)),Promise.resolve(this)}addExternalSources(e){this.metadata.externalSources.addMany(e)}updateDisplaySource(e){this.metadata.displaySource=e}clone(e){return super.clone((0,re.WO)((0,re.QN)(e)))}cloneShallow(){return new Ae({components:this.components,spatialReference:this.spatialReference,vertexAttributes:this.vertexAttributes,vertexSpace:this.vertexSpace.clone(),transform:this.transform,metadata:this.metadata})}vertexAttributesChanged(){this.notifyChange("vertexAttributes")}async toBinaryGLTF(e){const[{toBinaryGLTF:t}]=await Promise.all([i.e(4038).then(i.bind(i,84038)),this.load(e)]);return(0,l.Te)(e),await t(this,e)}get usedMemory(){return this.components?this.components.reduce((e,t)=>e+t.memoryUsage,this.vertexAttributes.usedMemory):this.vertexAttributes.usedMemory}_clearSources(){this.metadata.clearSources()}_checkIfLoaded(e){return!!this.loaded||(o.A.getLogger(this).error(e,"Mesh must be loaded before applying operations"),!1)}static createBox(e,t){if(!(e instanceof p.A))return o.A.getLogger(this.prototype).error(".createBox()",y),null;const i=new Ae((0,se.UG)((0,se.H8)(),e,t));return t?.imageFace&&"all"!==t.imageFace?(0,se.bQ)(i,t.imageFace):i}static createSphere(e,t){return e instanceof p.A?new Ae((0,se.UG)((0,se.Dk)(t?.densificationFactor||0),e,t)):(o.A.getLogger(this.prototype).error(".createSphere()",y),null)}static createCylinder(e,t){return e instanceof p.A?new Ae((0,se.UG)((0,se.ai)(t?.densificationFactor||0),e,t)):(o.A.getLogger(this.prototype).error(".createCylinder()",y),null)}static createPlane(e,t){if(!(e instanceof p.A))return o.A.getLogger(this.prototype).error(".createPlane()",y),null;const i=t?.facing??"up",r=(0,se.uF)(i,t?.size);return new Ae((0,se.UG)((0,se.Uh)(i),e,{...t,size:r}))}static createFromPolygon(e,t){if(!(e instanceof f.A))return o.A.getLogger(this.prototype).error(".createFromPolygon()","Expected polygon to be a Polygon instance"),null;const i=(0,Ee.uM)(e,{method:"earcut"}),r=(0,l.$X)(i)?null:i,n=r?.positions??[],s=r?.polygonIndices??[];return new Ae({vertexAttributes:new C.default({position:n}),components:[new v.default({faces:s,shading:"flat",material:t?.material??null})],spatialReference:e.spatialReference,vertexSpace:new b.A})}static async createFromGLTF(e,t,r){if(!(e instanceof p.A)){const e=new _;throw o.A.getLogger(this.prototype).error(".createfromGLTF()",e.message),e}const{loadGLTFMesh:n}=await(0,l.qr)(i.e(5841).then(i.bind(i,35841)),r);return new Ae((await n(e,t,r)).mesh)}};(0,r.Cg)([(0,u.MZ)({type:[v.default],json:{write:!0}})],Oe.prototype,"components",void 0),(0,r.Cg)([(0,u.MZ)({nonNullable:!0,types:Re,constructOnly:!0,json:{write:!0},clonable:(e,t)=>(0,re.o2)(t)?.vertexSpace??e.clone(t)})],Oe.prototype,"vertexSpace",void 0),(0,r.Cg)([(0,u.MZ)({type:w.A,clonable:(e,t)=>{const i=(0,re.o2)(t);return i&&"transform"in i?i.transform:e?.clone()??e},json:{write:!0}})],Oe.prototype,"transform",void 0),(0,r.Cg)([(0,u.MZ)({constructOnly:!0,type:ne.O,clonable:(e,t)=>(0,re.o2)(t)?.metadata??e.clone()})],Oe.prototype,"metadata",void 0),(0,r.Cg)([(0,u.MZ)()],Oe.prototype,"hasExtent",null),(0,r.Cg)([(0,u.MZ)()],Oe.prototype,"_transformedExtent",null),(0,r.Cg)([(0,u.MZ)()],Oe.prototype,"_untransformedBounds",null),(0,r.Cg)([(0,u.MZ)()],Oe.prototype,"origin",null),(0,r.Cg)([(0,u.MZ)({readOnly:!0,json:{read:!1}})],Oe.prototype,"extent",null),(0,r.Cg)([(0,u.MZ)({readOnly:!0,json:{read:!1,write:!0,default:!0}})],Oe.prototype,"hasZ",void 0),(0,r.Cg)([(0,u.MZ)({readOnly:!0,json:{read:!1,write:!0,default:!1}})],Oe.prototype,"hasM",void 0),(0,r.Cg)([(0,u.MZ)({type:C.default,nonNullable:!0,json:{write:!0},clonable:(e,t)=>(0,re.o2)(t)?.vertexAttributes??e.clone(t)})],Oe.prototype,"vertexAttributes",void 0),Oe=Ae=(0,r.Cg)([(0,u.$K)("esri.geometry.Mesh")],Oe);const Me=(0,m.vt)()},15585(e,t,i){i.d(t,{If:()=>p,O5:()=>v,O9:()=>g,QT:()=>m,l3:()=>f});var r=i(5482),n=i(2741),s=i(49186),o=i(44208),a=i(34727);let l=null,c=null,u=null,h=null;const d=(new Float32Array(0),new Uint32Array(0),new Uint32Array(0),new Uint32Array(0),{vertices:new Float64Array(0),indices:new Uint32Array(0),outlineIndices:new Uint32Array(0),outlineRingLengths:new Uint32Array(0),vertexCount:0,indexCount:0,outlineIndexCount:0,outlineRingCount:0});async function p(){return l??=async function(){const e=await i.e(2997).then(i.bind(i,42997)),t=await e.default({locateFile:e=>(0,n.s)(`esri/core/libs/libtess/${e}`)});u=t}(),l}async function f(){return c??=async function(){const e=await i.e(9134).then(i.bind(i,99134)),t=await e.default({locateFile:e=>(0,n.s)(`esri/core/libs/libtess/${e}`)});h=t}(),c}function g(){return null!==h}function m(e,t,i=2){const n={stack:[],error:void 0,hasError:!1};try{const a=u;if(!a)throw new s.A("libtess:not-loaded","libtessF32 not loaded");const l=(0,r.mS)(n,b.from(a,e),!1),c=(0,r.mS)(n,w.from(a,t),!1),h=e.length/i*4,d=(0,r.mS)(n,new b(a,h*i),!1),p=a.triangulate(l.ptr,c.ptr,c.size,i,d.ptr,h);if((0,o.A)("esri-tessellation-debug")){const e=a.getError();0!==e&&console.warn("libtess:triangulation",C(e))}return{buffer:d.slice(0,p*i),vertexCount:p}}catch(e){n.error=e,n.hasError=!0}finally{(0,r.hk)(n)}}function v(e,t,i=2,n=!0){const l={stack:[],error:void 0,hasError:!1};try{const c=h;if(!c)throw new s.A("libtess:not-loaded","libtessF64 not loaded");const u=(0,r.mS)(l,S.from(c,e),!1),p=(0,r.mS)(l,w.from(c,t),!1),f=(0,r.mS)(l,new w(c,1),!1),g=(0,r.mS)(l,new w(c,1),!1),m=(0,r.mS)(l,new w(c,1),!1),v=(0,r.mS)(l,new w(c,1),!1),{maxVertexCount:x,maxIndexCount:y,maxOutlineIndexCount:b,maxOutlineRingCount:T}=function(e,t){const i=e.reduce((e,t)=>e+t,0),r=e.length,n=Math.max(0,e.length-1),s=Math.max(0,i+2*n-2),o=Math.max(0,Math.ceil(2*i)),l=Math.max(0,Math.ceil(3*s*2)),c=(0,a.mP)(l,3),u=i>0?Math.max(2,Math.ceil(.25*i)):0,h=i>0?Math.max(1,Math.ceil(u/3)):0;return{maxVertexCount:o,maxIndexCount:c,maxOutlineIndexCount:t?Math.max(0,i+r+u):0,maxOutlineRingCount:t?Math.max(0,r+h):0}}(t,n);let A=0,E=0,R=0,O=0,M=0;{const e={stack:[],error:void 0,hasError:!1};try{const t=(0,r.mS)(e,new S(c,x*i),!1),s=(0,r.mS)(e,new w(c,y),!1),o=(0,r.mS)(e,n?new w(c,b):null,!1),a=(0,r.mS)(e,n?new w(c,T):null,!1);if(c.triangulateIndexed(u.ptr,p.ptr,p.size,i,t.ptr,x,i,s.ptr,y,f.ptr,g.ptr,o?.ptr??0,b,a?.ptr??0,T,m.ptr,v.ptr),M=c.getError(),A=_(c)[f.ptr/Int32Array.BYTES_PER_ELEMENT],E=_(c)[g.ptr/Int32Array.BYTES_PER_ELEMENT],R=_(c)[m.ptr/Int32Array.BYTES_PER_ELEMENT],O=_(c)[v.ptr/Int32Array.BYTES_PER_ELEMENT],0===M){const e=t.slice(0,A*i);return{vertices:e,indices:s.slice(0,E),outlineIndices:n&&o?o.slice(0,R):d.outlineIndices,outlineRingLengths:n&&a?a.slice(0,O):d.outlineRingLengths,vertexCount:A,indexCount:E,outlineIndexCount:n?R:0,outlineRingCount:n?O:0}}}catch(t){e.error=t,e.hasError=!0}finally{(0,r.hk)(e)}}if(100903!==M)return(0,o.A)("esri-tessellation-debug")&&console.warn("libtess:triangulation",C(M)),d;const L=(0,r.mS)(l,new S(c,A*i),!1),P=(0,r.mS)(l,new w(c,E),!1),I=(0,r.mS)(l,n?new w(c,R):null,!1),D=(0,r.mS)(l,n?new w(c,O):null,!1);if(c.triangulateIndexed(u.ptr,p.ptr,p.size,i,L.ptr,A,i,P.ptr,E,f.ptr,g.ptr,I?.ptr??0,n?R:0,D?.ptr??0,n?O:0,m.ptr,v.ptr),M=c.getError(),0!==M)return(0,o.A)("esri-tessellation-debug")&&console.warn("libtess:triangulation",C(M)),d;const F=_(c)[f.ptr/Int32Array.BYTES_PER_ELEMENT],N=_(c)[g.ptr/Int32Array.BYTES_PER_ELEMENT],z=_(c)[m.ptr/Int32Array.BYTES_PER_ELEMENT],H=_(c)[v.ptr/Int32Array.BYTES_PER_ELEMENT],V=L.slice(0,F*i);return{vertices:V,indices:P.slice(0,N),outlineIndices:n&&I?I.slice(0,z):d.outlineIndices,outlineRingLengths:n&&D?D.slice(0,H):d.outlineRingLengths,vertexCount:F,indexCount:N,outlineIndexCount:n?z:0,outlineRingCount:n?H:0}}catch(e){l.error=e,l.hasError=!0}finally{(0,r.hk)(l)}}function x(e){return e.HEAPF64}function y(e){return e.HEAPF32}function _(e){return e.HEAP32}class b{static from(e,t){const i=new b(e,t.length);return i.set(t),i}constructor(e,t){this._libtess=e,this.size=t,this.ptr=e.allocateCoordinateArray(t)}destroy(){this._libtess.destroyCoordinateArray(this.ptr)}[Symbol.dispose](){this.destroy()}get bytesPerCoordinate(){return Float32Array.BYTES_PER_ELEMENT}set(e){y(this._libtess).set(e,this.ptr/this.bytesPerCoordinate)}slice(e,t){const i=this.ptr/this.bytesPerCoordinate;return y(this._libtess).slice(i+e,i+t)}}class S{static from(e,t){const i=new S(e,t.length);return i.set(t),i}constructor(e,t){this._libtess=e,this.size=t,this.ptr=e.allocateCoordinateArray(t)}destroy(){this._libtess.destroyCoordinateArray(this.ptr)}[Symbol.dispose](){this.destroy()}get bytesPerCoordinate(){return Float64Array.BYTES_PER_ELEMENT}set(e){x(this._libtess).set(e,this.ptr/this.bytesPerCoordinate)}slice(e,t){const i=this.ptr/this.bytesPerCoordinate;return x(this._libtess).slice(i+e,i+t)}}class w{static from(e,t){const i=new w(e,t.length);return i.set(t),i}constructor(e,t){this._libtess=e,this.size=t,this.ptr=e.allocateLengthsArray(t)}destroy(){this._libtess.destroyLengthsArray(this.ptr)}[Symbol.dispose](){this.destroy()}get bytesPerCoordinate(){return Int32Array.BYTES_PER_ELEMENT}set(e){_(this._libtess).set(e,this.ptr/this.bytesPerCoordinate)}slice(e,t){const i=this.ptr/this.bytesPerCoordinate;return function(e){const t=_(e);return new Uint32Array(t.buffer,t.byteOffset,t.length)}(this._libtess).slice(i+e,i+t)}}function C(e){switch(e){case 100903:return"Insufficient output buffer";case 100902:return"Out of memory";case 100151:return"Missing begin polygon";case 100152:return"Missing begin contour";case 100153:return"Missing end polygon";case 100154:return"Missing end countour";case 100155:return"Coordinates too large";case 100156:return"Missing combine callback";default:return`Unknown: ${e}`}}},16939(e,t,i){i.r(t),i.d(t,{default:()=>p});var r,n=i(5482),s=i(69540),o=i(25482),a=i(53966),l=i(91429),c=i(56507),u=i(19211),h=i(80882),d=i(31199);let p=r=class extends((0,s.OU)(o.o)){static from(e){return(0,c.PZ)(r,e)}constructor(e){super(e),this.material=null,this.name=void 0,this.shading="source",this.trustSourceNormals=!1}get faces(){return this._get("faces")??null}set faces(e){this._set("faces",(0,d.b)(e,Uint32Array,[Uint16Array],{loggerTag:".faces=",stride:3},a.A.getLogger(this)))}castMaterial(e){return(0,c.PZ)(e&&"object"==typeof e&&("metallic"in e||"roughness"in e||"metallicRoughnessTexture"in e)?h.A:u.default,e)}get memoryUsage(){let e=0;return null!=this.faces&&(e+=this.faces.byteLength),null!=this.material&&(e+=this.material.memoryUsage),e}};(0,n.Cg)([(0,l.MZ)({json:{write:d.B}})],p.prototype,"faces",null),(0,n.Cg)([(0,l.MZ)({type:u.default,json:{write:!0}})],p.prototype,"material",void 0),(0,n.Cg)([(0,l.wg)("material")],p.prototype,"castMaterial",null),(0,n.Cg)([(0,l.MZ)({json:{write:!0}})],p.prototype,"name",void 0),(0,n.Cg)([(0,l.MZ)({type:String,json:{write:!0}})],p.prototype,"shading",void 0),(0,n.Cg)([(0,l.MZ)({type:Boolean})],p.prototype,"trustSourceNormals",void 0),p=r=(0,n.Cg)([(0,l.$K)("esri.geometry.support.MeshComponent")],p)},95696(e,t,i){i.d(t,{A:()=>c});var r,n=i(5482),s=i(69540),o=i(25482),a=i(91429),l=i(93223);let c=class extends((0,s.OU)(o.o)){static{r=this}constructor(e){super(e),this.type="georeferenced",this.origin=null}static{this.absolute=new r}};(0,n.Cg)([(0,l.e)({georeferenced:"georeferenced"},{readOnly:!0})],c.prototype,"type",void 0),(0,n.Cg)([(0,a.MZ)({type:[Number],nonNullable:!1,json:{write:!0}})],c.prototype,"origin",void 0),c=r=(0,n.Cg)([(0,a.$K)("esri.geometry.support.MeshGeoreferencedVertexSpace")],c)},18251(e,t,i){i.r(t),i.d(t,{default:()=>c});var r=i(5482),n=i(69540),s=i(25482),o=i(91429),a=i(51850),l=i(93223);let c=class extends((0,n.OU)(s.o)){constructor(e){super(e),this.type="local",this.origin=(0,a.vt)()}};(0,r.Cg)([(0,l.e)({local:"local"},{readOnly:!0})],c.prototype,"type",void 0),(0,r.Cg)([(0,o.MZ)({type:[Number],nonNullable:!0,json:{write:!0}})],c.prototype,"origin",void 0),c=(0,r.Cg)([(0,o.$K)("esri.geometry.support.MeshLocalVertexSpace")],c)},19211(e,t,i){i.r(t),i.d(t,{default:()=>h});var r=i(5482),n=i(68197),s=i(69540),o=i(25482),a=i(91429),l=i(35063),c=i(51147),u=i(66895);let h=class extends((0,s.OU)(o.o)){constructor(e){super(e),this.color=null,this.colorTextureTransform=null,this.normalTextureTransform=void 0,this.alphaMode="auto",this.alphaCutoff=.5,this.doubleSided=!0}get colorTexture(){return this._get("colorTexture")}set colorTexture(e){this._set("colorTexture",null==e?null:l.default.from(e))}get normalTexture(){return this._get("normalTexture")}set normalTexture(e){this._set("normalTexture",null==e?null:l.default.from(e))}clone(e){const t=(0,u.hz)(e),i=t?.materialMap?.get(this);if(i)return i;const r=super.clone((0,u.QN)(e));return t?.materialMap?.set(this,r),r}get memoryUsage(){return this.getMemoryUsage()}getMemoryUsage(){let e=0;return e+=null!=this.color?16:0,null!=this.colorTexture&&(e+=this.colorTexture.memoryUsage),e+=null!=this.colorTextureTransform?20:0,null!=this.normalTexture&&(e+=this.normalTexture.memoryUsage),e+=null!=this.normalTextureTransform?20:0,e}};(0,r.Cg)([(0,a.MZ)({type:n.A,json:{write:!0}})],h.prototype,"color",void 0),(0,r.Cg)([(0,a.MZ)({type:l.default,json:{write:!0},value:null})],h.prototype,"colorTexture",null),(0,r.Cg)([(0,a.MZ)({type:c.A,json:{write:!0}})],h.prototype,"colorTextureTransform",void 0),(0,r.Cg)([(0,a.MZ)({type:l.default,json:{write:!0},value:null})],h.prototype,"normalTexture",null),(0,r.Cg)([(0,a.MZ)({type:c.A,json:{write:!0}})],h.prototype,"normalTextureTransform",void 0),(0,r.Cg)([(0,a.MZ)({nonNullable:!0,json:{write:!0}})],h.prototype,"alphaMode",void 0),(0,r.Cg)([(0,a.MZ)({nonNullable:!0,json:{write:!0}})],h.prototype,"alphaCutoff",void 0),(0,r.Cg)([(0,a.MZ)({nonNullable:!0,json:{write:!0}})],h.prototype,"doubleSided",void 0),h=(0,r.Cg)([(0,a.$K)("esri.geometry.support.MeshMaterial")],h)},80882(e,t,i){i.d(t,{A:()=>c});var r=i(5482),n=i(68197),s=i(91429),o=i(19211),a=i(35063),l=i(51147);let c=class extends o.default{constructor(e){super(e),this.emissiveColor=null,this.emissiveStrength=null,this.emissiveTextureTransform=void 0,this.occlusionTextureTransform=void 0,this.metallic=1,this.roughness=1,this.metallicRoughnessTextureTransform=void 0}get emissiveTexture(){return this._get("emissiveTexture")}set emissiveTexture(e){this._set("emissiveTexture",null==e?null:a.default.from(e))}get occlusionTexture(){return this._get("occlusionTexture")}set occlusionTexture(e){this._set("occlusionTexture",null==e?null:a.default.from(e))}get metallicRoughnessTexture(){return this._get("metallicRoughnessTexture")}set metallicRoughnessTexture(e){this._set("metallicRoughnessTexture",null==e?null:a.default.from(e))}getMemoryUsage(){let e=super.getMemoryUsage();return e+=null!=this.emissiveColor?16:0,null!=this.emissiveTexture&&(e+=this.emissiveTexture.memoryUsage),e+=null!=this.emissiveTextureTransform?20:0,null!=this.occlusionTexture&&(e+=this.occlusionTexture.memoryUsage),e+=null!=this.occlusionTextureTransform?20:0,null!=this.metallicRoughnessTexture&&(e+=this.metallicRoughnessTexture.memoryUsage),e+=null!=this.metallicRoughnessTextureTransform?20:0,e}};(0,r.Cg)([(0,s.MZ)({type:n.A,json:{write:!0}})],c.prototype,"emissiveColor",void 0),(0,r.Cg)([(0,s.MZ)({json:{write:!0}})],c.prototype,"emissiveStrength",void 0),(0,r.Cg)([(0,s.MZ)({type:a.default,json:{write:!0},value:null})],c.prototype,"emissiveTexture",null),(0,r.Cg)([(0,s.MZ)({type:l.A,json:{write:!0}})],c.prototype,"emissiveTextureTransform",void 0),(0,r.Cg)([(0,s.MZ)({type:a.default,json:{write:!0},value:null})],c.prototype,"occlusionTexture",null),(0,r.Cg)([(0,s.MZ)({type:l.A,json:{write:!0}})],c.prototype,"occlusionTextureTransform",void 0),(0,r.Cg)([(0,s.MZ)({type:Number,nonNullable:!0,json:{write:!0},range:{min:0,max:1}})],c.prototype,"metallic",void 0),(0,r.Cg)([(0,s.MZ)({type:Number,nonNullable:!0,json:{write:!0},range:{min:0,max:1}})],c.prototype,"roughness",void 0),(0,r.Cg)([(0,s.MZ)({type:a.default,json:{write:!0},value:null})],c.prototype,"metallicRoughnessTexture",null),(0,r.Cg)([(0,s.MZ)({type:l.A,json:{write:!0}})],c.prototype,"metallicRoughnessTextureTransform",void 0),c=(0,r.Cg)([(0,s.$K)("esri.geometry.support.MeshMaterialMetallicRoughness")],c)},35063(e,t,i){i.r(t),i.d(t,{default:()=>m});var r,n=i(5482),s=i(69540),o=i(21287),a=i(25482),l=i(91429),c=i(56507),u=i(66895),h=i(97159),d=i(43937),p=i(36005);const f=new WeakMap;let g=0,m=class extends((0,s.OU)(a.o)){static{r=this}constructor(e){super(e),this.wrap="repeat"}get url(){return this._get("url")||null}set url(e){this._set("url",e),e&&this._set("data",null)}get data(){return this._get("data")||null}set data(e){this._set("data",e),e&&this._set("url",null)}writeData(e,t,i,r){if(e instanceof HTMLImageElement){const n={type:"image-element",src:(0,h.t)(e.src,r),crossOrigin:e.crossOrigin};t[i]=n}else if(e instanceof HTMLCanvasElement){const r={type:"canvas-element",imageData:v(e.getContext("2d").getImageData(0,0,e.width,e.height))};t[i]=r}else if(e instanceof HTMLVideoElement){const n={type:"video-element",src:(0,h.t)(e.src,r),autoplay:e.autoplay,loop:e.loop,muted:e.muted,crossOrigin:e.crossOrigin,preload:e.preload};t[i]=n}else if(e instanceof ImageData){const r={type:"image-data",imageData:v(e)};t[i]=r}}readData(e){switch(e.type){case"image-element":{const t=new Image;return t.src=e.src,t.crossOrigin=e.crossOrigin,t}case"canvas-element":{const t=x(e.imageData),i=document.createElement("canvas");return i.width=t.width,i.height=t.height,i.getContext("2d").putImageData(t,0,0),i}case"image-data":return x(e.imageData);case"video-element":{const t=document.createElement("video");return t.src=e.src,t.crossOrigin=e.crossOrigin,t.autoplay=e.autoplay,t.loop=e.loop,t.muted=e.muted,t.preload=e.preload,t}default:return}}get transparent(){const{data:e,url:t}=this,i=e=>e?.toLowerCase().endsWith(".png")||e?.toLocaleLowerCase().startsWith("data:image/png;");return e instanceof HTMLCanvasElement?y(e.getContext("2d").getImageData(0,0,e.width,e.height)):e instanceof ImageData?y(e):!(!t||!i(t))||!!(e instanceof HTMLImageElement&&i(e.src))}set transparent(e){this._overrideIfSome("transparent",e)}get contentHash(){const e="string"==typeof this.wrap?this.wrap:"object"==typeof this.wrap?`${this.wrap.horizontal}/${this.wrap.vertical}`:"",t=(t="")=>`d:${t},t:${this.transparent},w:${e}`;return null!=this.url?t(this.url):null!=this.data?this.data instanceof HTMLImageElement||this.data instanceof HTMLVideoElement?t(this.data.src):(f.has(this.data)||f.set(this.data,++g),t(f.get(this.data))):t()}get memoryUsage(){let e=0;if(e+=null!=this.url?this.url.length:0,null!=this.data){const t=this.data;"data"in t?e+=t.data.byteLength:t instanceof HTMLImageElement?e+=t.naturalWidth*t.naturalHeight*3:t instanceof HTMLCanvasElement&&(e+=t.width*t.height*3)}return e}clone(e){const t=(0,u.$N)(e),i=t?.textureMap?.get(this);if(i)return i;const r=super.clone(e);return t?.textureMap?.set(this,r),r}static from(e){return"string"==typeof e?new r({url:e}):e instanceof HTMLImageElement||e instanceof HTMLCanvasElement||e instanceof ImageData||e instanceof HTMLVideoElement?new r({data:e}):(0,c.PZ)(r,e)}};function v(e){let t="";for(let i=0;i<e.data.length;i++)t+=String.fromCharCode(e.data[i]);return{data:btoa(t),width:e.width,height:e.height}}function x(e){const t=atob(e.data),i=new Uint8ClampedArray(t.length);for(let e=0;e<t.length;e++)i[e]=t.charCodeAt(e);return(0,o.eV)(i,e.width,e.height)}function y(e){for(let t=3;t<e.data.length;t+=4)if(255!==e.data[t])return!0;return!1}(0,n.Cg)([(0,l.MZ)({type:String,json:{write:h.w}})],m.prototype,"url",null),(0,n.Cg)([(0,l.MZ)({clonable:"reference",json:{write:{overridePolicy(){return{enabled:!this.url}}}}})],m.prototype,"data",null),(0,n.Cg)([(0,d.K)("data")],m.prototype,"writeData",null),(0,n.Cg)([(0,p.w)("data")],m.prototype,"readData",null),(0,n.Cg)([(0,l.MZ)({type:Boolean,json:{write:{overridePolicy(){return{enabled:this._isOverridden("transparent")}}}}})],m.prototype,"transparent",null),(0,n.Cg)([(0,l.MZ)({json:{write:!0}})],m.prototype,"wrap",void 0),(0,n.Cg)([(0,l.MZ)({readOnly:!0})],m.prototype,"contentHash",null),m=r=(0,n.Cg)([(0,l.$K)("esri.geometry.support.MeshTexture")],m)},51147(e,t,i){i.d(t,{A:()=>a});var r=i(5482),n=i(69540),s=i(25482),o=i(91429);let a=class extends((0,n.OU)(s.o)){constructor(e){super(e),this.offset=[0,0],this.rotation=0,this.scale=[1,1]}};(0,r.Cg)([(0,o.MZ)({type:[Number],nonNullable:!0,json:{write:!0}})],a.prototype,"offset",void 0),(0,r.Cg)([(0,o.MZ)({type:Number,nonNullable:!0,json:{write:!0}})],a.prototype,"rotation",void 0),(0,r.Cg)([(0,o.MZ)({type:[Number],nonNullable:!0,json:{write:!0}})],a.prototype,"scale",void 0),a=(0,r.Cg)([(0,o.$K)("esri.geometry.support.MeshTextureTransform")],a)},1193(e,t,i){i.r(t),i.d(t,{default:()=>h});var r,n=i(5482),s=i(69540),o=i(25482),a=i(4718),l=i(53966),c=i(91429),u=i(31199);let h=r=class extends((0,s.OU)(o.o)){constructor(e){super(e),this.color=null,this.position=new Float64Array(0),this.uv=null,this.normal=null,this.tangent=null}castColor(e){return(0,u.b)(e,Uint8Array,[Uint8ClampedArray],{loggerTag:".color=",stride:4},l.A.getLogger(this))}castPosition(e){return e&&e instanceof Float32Array&&l.A.getLogger(this).warn(".position=","Setting position attribute from a Float32Array may cause precision problems. Consider storing data in a Float64Array or a regular number array"),(0,u.b)(e,Float64Array,[Float32Array],{loggerTag:".position=",stride:3},l.A.getLogger(this))}castUv(e){return(0,u.b)(e,Float32Array,[Float64Array],{loggerTag:".uv=",stride:2},l.A.getLogger(this))}castNormal(e){return(0,u.b)(e,Float32Array,[Float64Array],{loggerTag:".normal=",stride:3},l.A.getLogger(this))}castTangent(e){return(0,u.b)(e,Float32Array,[Float64Array],{loggerTag:".tangent=",stride:4},l.A.getLogger(this))}clonePositional(){const e={position:(0,a.o8)(this.position),normal:(0,a.o8)(this.normal),tangent:(0,a.o8)(this.tangent),uv:this.uv,color:this.color};return new r(e)}get usedMemory(){return this.position.byteLength+(this.uv?.byteLength??0)+(this.normal?.byteLength??0)+(this.tangent?.byteLength??0)+(this.color?.byteLength??0)}};(0,n.Cg)([(0,c.MZ)({json:{write:u.B}})],h.prototype,"color",void 0),(0,n.Cg)([(0,c.wg)("color")],h.prototype,"castColor",null),(0,n.Cg)([(0,c.MZ)({nonNullable:!0,json:{write:u.B}})],h.prototype,"position",void 0),(0,n.Cg)([(0,c.wg)("position")],h.prototype,"castPosition",null),(0,n.Cg)([(0,c.MZ)({json:{write:u.B}})],h.prototype,"uv",void 0),(0,n.Cg)([(0,c.wg)("uv")],h.prototype,"castUv",null),(0,n.Cg)([(0,c.MZ)({json:{write:u.B}})],h.prototype,"normal",void 0),(0,n.Cg)([(0,c.wg)("normal")],h.prototype,"castNormal",null),(0,n.Cg)([(0,c.MZ)({json:{write:u.B}})],h.prototype,"tangent",void 0),(0,n.Cg)([(0,c.wg)("tangent")],h.prototype,"castTangent",null),h=r=(0,n.Cg)([(0,c.$K)("esri.geometry.support.MeshVertexAttributes")],h)},31199(e,t,i){function r(e,t,i,r){const{loggerTag:n,stride:s}=t;return e.length%s!==0?(r.error(n,`Invalid array length, expected a multiple of ${s}`),new i([])):e}function n(e,t,i,n,s){if(!e)return e;if(e instanceof t)return r(e,n,t,s);for(const o of i)if(e instanceof o)return r(new t(e),n,t,s);if(Array.isArray(e))return r(new t(e),n,t,s);{const r=i.map(e=>`'${e.name}'`);return s.error(`Failed to set property, expected one of ${r}, but got ${e.constructor.name}`),new t([])}}function s(e,t,i){t[i]=function(e){const t=new Array(e.length);for(let i=0;i<e.length;i++)t[i]=e[i];return t}(e)}i.d(t,{B:()=>s,b:()=>n})},40118(e,t,i){i.d(t,{H5:()=>h,wh:()=>c,createWithExternalSource:()=>u});var r=i(49186),n=(i(17676),i(83300)),s=(i(16939),i(95696),i(73836)),o=(i(1193),i(27615));i(53966),i(35522),i(51850),i(66895),i(72258);var a=i(29461),l=i(15070);function c(e,t){return new n.default((0,l.UG)((0,l.Dk)(t?.densificationFactor||0),e,t))}function u(e,t,i){const r=i?.extent??null,{spatialReference:l}=e,c=i?.transform?.clone()??new s.A,u=(0,o.TE)(e,i),h=i?.unitConversionDisabled,d={source:t,extent:r,unitConversionDisabled:h},p=new a.O;return p.externalSources.push(d),new n.default({metadata:p,transform:c,vertexSpace:u,spatialReference:l})}function h(e,t){const{spatialReference:i}=e,a=t?.transform?.clone()??new s.A,l=(0,o.TE)(e,t),c=new n.default({transform:a,vertexSpace:l,spatialReference:i});return c.addResolvingPromise(Promise.reject(new r.A("mesh-incomplete","Mesh resources are not complete"))),c}i(65801)},63579(e,t,i){i.d(t,{Bq:()=>l,Qp:()=>a,WN:()=>m,dK:()=>v,eN:()=>p,fH:()=>g,in:()=>f,yr:()=>c});var r=i(11254),n=i(4576),s=i(17676),o=i(20557);class a{constructor(e,t,i){this.assetName=e,this.assetMimeType=t,this.parts=i}equals(e){return this===e||this.assetName===e.assetName&&this.assetMimeType===e.assetMimeType&&(0,n.aI)(this.parts,e.parts,(e,t)=>e.equals(t))}isOnService(e){return this.parts.every(t=>t.isOnService(e))}makeHash(){let e="";for(const t of this.parts)e+=t.partHash;return e}async toBlob(e){const{parts:t}=this;if(1===t.length)return t[0].toBlob(e);const i=await Promise.all(t.map(t=>t.toBlob(e)));return(0,s.Te)(e),new Blob(i)}}class l{constructor(e,t){this.partUrl=e,this.partHash=t}equals(e){return this===e||this.partUrl===e.partUrl&&this.partHash===e.partHash}isOnService(e){return this.partUrl.startsWith(`${e.path}/assets/`)}async toBlob(e){const{data:t}=await(0,r.A)(this.partUrl,{responseType:"blob"});return(0,s.Te)(e),t}}function c(e){return function(e){switch(e?.type){case"client":return Array.isArray(e.files)?e.files.some(d):d(e.files);case"service":return e.assets.some(d);case"loadable":return!0;default:return!1}}(e?.source)}const u=/^(model\/gltf\+json)|(model\/gltf-binary)$/,h=/\.(gltf|glb)/i;function d(e){if(e instanceof File){const{type:t,name:i}=e;return u.test(t)||h.test(i)}return u.test(e.assetMimeType)||h.test(e.assetName)}function p(e,t){if(!e)return!1;const{source:i}=e;return function(e,t){return"service"===e.type&&e.assets.every(e=>e.isOnService(t))}(i,t)}function f(e,t){if(e===t)return!0;const{source:i}=e,{source:r}=t;if(i===r)return!0;if("service"===i.type&&"service"===r.type){if(i.assets.length!==r.assets.length)return!1;const e=(e,t)=>e.assetName<t.assetName?-1:e.assetName>t.assetName?1:0,t=[...i.assets].sort(e),n=[...r.assets].sort(e);for(let e=0;e<t.length;++e)if(!t[e].equals(n[e]))return!1;return!0}return!1}function g(e,t){return e instanceof File?(0,o.rq)(e,t):(0,o.z$)(e.assetMimeType,e.assetName,t)}function m(e){switch(e.type){case"client":return Array.isArray(e.files)?e.files:[e.files];case"service":return e.assets;case"loadable":return}}function v(e){return!!e.original}},29461(e,t,i){i.d(t,{O:()=>c});var r=i(5482),n=i(69540),s=i(7762),o=i(36708),a=i(91429),l=i(63579);let c=class extends n.Pw{constructor(e){super(e),this.externalSources=new s.A,this._explicitDisplaySource=null,this.addHandles((0,o.on)(()=>this.externalSources,"after-remove",({item:e})=>{e===this._explicitDisplaySource&&(this._explicitDisplaySource=null)},{sync:!0,onListenerRemove:()=>this._explicitDisplaySource=null}))}get displaySource(){return this._explicitDisplaySource??this._implicitDisplaySource}set displaySource(e){if(null!=e&&!(0,l.yr)(e))throw new Error("Cannot use this source for display: it is not in a supported format.");this._explicitDisplaySource=e,e&&this.externalSources.every(t=>!(0,l.in)(t,e))&&this.externalSources.add(e)}clearSources(){this.externalSources.removeAll()}getExternalSourcesOnService(e){return this.externalSources.items.filter(t=>(0,l.eN)(t,e))}get _implicitDisplaySource(){return this.externalSources.find(l.yr)}};(0,r.Cg)([(0,a.MZ)()],c.prototype,"externalSources",void 0),(0,r.Cg)([(0,a.MZ)()],c.prototype,"displaySource",null),(0,r.Cg)([(0,a.MZ)()],c.prototype,"_implicitDisplaySource",null),(0,r.Cg)([(0,a.MZ)()],c.prototype,"_explicitDisplaySource",void 0),c=(0,r.Cg)([(0,a.$K)("esri.geometry.support.meshUtils.Metadata")],c)},66895(e,t,i){i.d(t,{$N:()=>u,Lz:()=>s,QN:()=>h,WO:()=>l,hz:()=>a,o2:()=>n});const r=Symbol("meshContext");function n(e){return e&&"object"==typeof e&&r in e?e[r]:void 0}function s(e,t){const i=n(e);return{...e,[r]:{...i,...t}}}const o=Symbol("meshMaterialContext");function a(e){return e&&"object"==typeof e&&o in e?e[o]:void 0}function l(e){const t=a(e);if(t?.materialMap)return e;const i={materialMap:new Map};return{...e,[o]:i}}const c=Symbol("meshTextureContext");function u(e){return e&&"object"==typeof e&&c in e?e[c]:void 0}function h(e){const t=u(e);if(t?.textureMap)return e;const i={textureMap:new Map};return{...e,[c]:i}}},15070(e,t,i){i.d(t,{Dk:()=>d,H8:()=>u,UG:()=>v,Uh:()=>g,ai:()=>p,bQ:()=>h,uF:()=>f});var r=i(29242),n=i(35522),s=i(51850),o=i(16939),a=i(1193),l=i(27615),c=i(72258);function u(){const{faceDescriptions:e,faceVertexOffsets:t,uvScales:i}=x,r=4*e.length,n=new Float64Array(3*r),s=new Float32Array(3*r),o=new Float32Array(2*r),a=new Uint32Array(2*e.length*3);let l=0,c=0,u=0,h=0;for(let r=0;r<e.length;r++){const d=e[r],p=l/3;for(const e of t)a[h++]=p+e;const f=d.corners;for(let e=0;e<4;e++){const t=f[e];let r=0;o[u++]=.25*i[e][0]+d.uvOrigin[0],o[u++]=d.uvOrigin[1]-.25*i[e][1];for(let e=0;e<3;e++)0!==d.axis[e]?(n[l++]=.5*d.axis[e],s[c++]=d.axis[e]):(n[l++]=.5*t[r++],s[c++]=0)}}return{position:n,normal:s,uv:o,faces:a}}function h(e,t){const i=e.components[0],r=i.faces,n=y[t],s=6*n,a=new Array(6),l=new Array(r.length-6);let c=0,u=0;for(let e=0;e<r.length;e++)e>=s&&e<s+6?a[c++]=r[e]:l[u++]=r[e];if(null!=e.vertexAttributes.uv){const t=new Float32Array(e.vertexAttributes.uv),i=4*n*2,r=[0,1,1,1,1,0,0,0];for(let e=0;e<r.length;e++)t[i+e]=r[e];e.vertexAttributes.uv=t}return e.components=[new o.default({faces:a,material:i.material}),new o.default({faces:l})],e}function d(e=0){const t=Math.round(8*2**e),i=2*t,r=(t-1)*(i+1)+2*i,n=new Float64Array(3*r),s=new Float32Array(3*r),o=new Float32Array(2*r),a=new Uint32Array((t-1)*i*2*3);let l=0,c=0,u=0,h=0;for(let e=0;e<=t;e++){const r=e/t*Math.PI+.5*Math.PI,d=Math.cos(r),p=Math.sin(r);_[2]=p;const f=0===e||e===t,g=f?i-1:i;for(let r=0;r<=g;r++){const p=r/g*2*Math.PI;_[0]=-Math.sin(p)*d,_[1]=Math.cos(p)*d;for(let e=0;e<3;e++)n[l]=.5*_[e],s[l]=_[e],++l;o[c++]=(r+(f?.5:0))/i,o[c++]=e/t,0!==e&&r!==i&&(e!==t&&(a[u++]=h,a[u++]=h+1,a[u++]=h-i),1!==e&&(a[u++]=h,a[u++]=h-i,a[u++]=h-i-1)),h++}}return{position:n,normal:s,uv:o,faces:a}}function p(e=0){const t=Math.round(16*2**e),i=4*(t+1)+2*t,r=new Float64Array(3*i),n=new Float32Array(3*i),s=new Float32Array(2*i),o=new Uint32Array(4*t*3);let a=0,l=0,c=0,u=0,h=0;for(let e=0;e<=5;e++){const i=0===e||5===e,d=e<=1||e>=4,p=2===e||4===e,f=i?t-1:t;for(let g=0;g<=f;g++){const m=g/f*2*Math.PI,v=i?0:.5;_[0]=v*Math.sin(m),_[1]=v*-Math.cos(m),_[2]=e<=2?.5:-.5;for(let t=0;t<3;t++)r[a++]=_[t],n[l++]=d?2===t?e<=1?1:-1:0:2===t?0:_[t]/v;s[c++]=(g+(i?.5:0))/t,s[c++]=e<=1?1*e/3:e<=3?1*(e-2)/3+1/3:1*(e-4)/3+2/3,p||0===e||g===t||(5!==e&&(o[u++]=h,o[u++]=h+1,o[u++]=h-t),1!==e&&(o[u++]=h,o[u++]=h-t,o[u++]=h-t-1)),h++}}return{position:r,normal:n,uv:s,faces:o}}function f(e,t){const i="number"==typeof t?t:null!=t?t.width:1,r="number"==typeof t?t:null!=t?t.height:1;switch(e){case"up":case"down":return{width:i,depth:r};case"north":case"south":return{width:i,height:r};case"east":case"west":return{depth:i,height:r}}}function g(e){const t=m.facingAxisOrderSwap[e],i=m.position,r=m.normal,n=new Float64Array(i.length),s=new Float32Array(r.length);let o=0;for(let e=0;e<4;e++){const e=o;for(let a=0;a<3;a++){const l=t[a],c=Math.abs(l)-1,u=l>=0?1:-1;n[o]=i[e+c]*u,s[o]=r[e+c]*u,o++}}return{position:n,normal:s,uv:new Float32Array(m.uv),faces:new Uint32Array(m.faces),isPlane:!0}}const m={position:[-.5,-.5,0,.5,-.5,0,.5,.5,0,-.5,.5,0],normal:[0,0,1,0,0,1,0,0,1,0,0,1],uv:[0,1,1,1,1,0,0,0],faces:[0,1,2,0,2,3],facingAxisOrderSwap:{east:[3,1,2],west:[-3,-1,2],north:[-1,3,2],south:[1,-3,2],up:[1,2,3],down:[1,-2,-3]}};function v(e,t,i){e.isPlane||function(e){for(let t=0;t<e.position.length;t+=3)e.position[t+2]+=.5}(e),function(e,t){if(null!=t){b[0]=t[0],b[4]=t[1],b[8]=t[2];for(let t=0;t<e.position.length;t+=3){for(let i=0;i<3;i++)_[i]=e.position[t+i];(0,n.ei)(_,_,b);for(let i=0;i<3;i++)e.position[t+i]=_[i]}if(t[0]!==t[1]||t[1]!==t[2]){b[0]=1/t[0],b[4]=1/t[1],b[8]=1/t[2];for(let t=0;t<e.normal.length;t+=3){for(let i=0;i<3;i++)_[i]=e.normal[t+i];(0,n.ei)(_,_,b),(0,n.S8)(_,_);for(let i=0;i<3;i++)e.normal[t+i]=_[i]}}}}(e,function(e,t,i){const r=(0,c.xK)(t,i);if(null==e&&1===r)return null;if(null==e)return[r,r,r];if("number"==typeof e){const t=e*r;return[t,t,t]}return[null!=e.width?e.width*r:r,null!=e.depth?e.depth*r:r,null!=e.height?e.height*r:r]}(i?.size,i?.unit,t.spatialReference));const r=(0,l.TE)(t,i),s=t.spatialReference.isGeographic?(0,l.TE)(t):r,u=(0,c.UR)({vertexAttributes:e,vertexSpace:s,spatialReference:t.spatialReference},r,{allowBufferReuse:!0});return{vertexAttributes:new a.default({...u,uv:e.uv}),vertexSpace:r,components:[new o.default({faces:e.faces,material:i?.material||null})],spatialReference:t.spatialReference}}const x={faceDescriptions:[{axis:[0,-1,0],uvOrigin:[0,.625],corners:[[-1,-1],[1,-1],[1,1],[-1,1]]},{axis:[1,0,0],uvOrigin:[.25,.625],corners:[[-1,-1],[1,-1],[1,1],[-1,1]]},{axis:[0,1,0],uvOrigin:[.5,.625],corners:[[1,-1],[-1,-1],[-1,1],[1,1]]},{axis:[-1,0,0],uvOrigin:[.75,.625],corners:[[1,-1],[-1,-1],[-1,1],[1,1]]},{axis:[0,0,1],uvOrigin:[0,.375],corners:[[-1,-1],[1,-1],[1,1],[-1,1]]},{axis:[0,0,-1],uvOrigin:[0,.875],corners:[[-1,1],[1,1],[1,-1],[-1,-1]]}],uvScales:[[0,0],[1,0],[1,1],[0,1]],faceVertexOffsets:[0,1,2,0,2,3]},y={south:0,east:1,north:2,west:3,up:4,down:5},_=(0,s.vt)(),b=(0,r.vt)()},22141(e,t,i){i.d(t,{$5:()=>w,CN:()=>y,JP:()=>x,KM:()=>T,Mv:()=>E,X4:()=>_,gr:()=>S,qs:()=>C,si:()=>b,xA:()=>A});var r=i(34727),n=i(77690),s=i(29242),o=i(58083),a=i(9093),l=i(35522),c=i(51850),u=i(73941),h=i(48353),d=i(9762),p=(i(79258),i(21325)),f=i(28735),g=i(13030),m=i(73354),v=i(50867);const x="Projection may be possible after calling projection.load().";function y(e,t,i,r){e.error(`Failed to project from (wkid:${t.wkid}) to (wkid:${i.wkid}).${r?" ":""}${r}`)}function _(e,t,i,r,n,s){return O(0,g.xs.fromTypedArray(e),0,g.Xm.fromTypedArray(t),i,g.Xm.fromTypedArray(r),n,g.xs.fromTypedArray(s))?s:null}function b(e,t,i,r,n,s){return O(1,g.xs.fromTypedArray(e),0,g.Xm.fromTypedArray(t),i,g.Xm.fromTypedArray(r),n,g.xs.fromTypedArray(s))?s:null}function S(e,t,i,r){return(0,d.projectBuffer)(e,t,0,i,r,0)?i:null}function w(e,t,i,r){return(0,d.projectBuffer)(e,t,0,i,r,0)?i:null}function C(e,t,i){return(0,n.Ge)(I,i),(0,m.b)(t,e,I),(0,r.or)(I)&&(0,m.n)(t,t),t}function T(e,t,i){return(0,n.z0)(I,i),(0,v.t)(t,e,I),(0,r.or)(I)&&(0,m.n)(t,t,4),t}function A(e,t,i,r,n,s){if(!O(0,g.xs.fromTypedArray(e,4*Float32Array.BYTES_PER_ELEMENT),1,g.Xm.fromTypedArray(t),i,g.Xm.fromTypedArray(r),n,g.xs.fromTypedArray(s,4*Float32Array.BYTES_PER_ELEMENT)))return null;for(let t=3;t<e.length;t+=4)s[t]=e[t];return s}function E(e,t,i,r,n,s){if(!O(1,g.xs.fromTypedArray(e,16),1,g.Xm.fromTypedArray(t),i,g.Xm.fromTypedArray(r),n,g.xs.fromTypedArray(s,16)))return null;for(let t=3;t<e.length;t+=4)s[t]=e[t];return s}function R(e,t,i,r,s){switch((0,h.l)(r,i,P,r),1===e&&(0,o.B8)(P,P),t){case 0:return(0,n.Ge)(s,P);case 1:return(0,n.z0)(s,P)}}function O(e,t,i,r,n,s,o,a){if(!t)return;const c=r.count;if(function(e){return e.isWGS84||(0,p.x1)(e)||(0,u.q8)(e)||(0,u.KQ)(e)}(n))for(let r=0;r<c;r++)s.getVec(r,M),t.getVec(r,L),(0,l.ei)(L,L,R(e,i,M,o,I)),a.setVec(r,L);else for(let n=0;n<c;n++){s.getVec(n,M),t.getVec(n,L);const c=(0,f.jg)(r.get(n,1));let u=Math.cos(c);1===i!=(0===e)&&(u=1/u),R(e,i,M,o,I),0===e?(I[0]*=u,I[1]*=u,I[2]*=u,I[3]*=u,I[4]*=u,I[5]*=u):(I[0]*=u,I[3]*=u,I[6]*=u,I[1]*=u,I[4]*=u,I[7]*=u),(0,l.ei)(L,L,I),(0,l.S8)(L,L),a.setVec(n,L)}return a}const M=(0,c.vt)(),L=(0,c.vt)(),P=(0,a.vt)(),I=(0,s.vt)()},72258(e,t,i){i.d(t,{UR:()=>b,p5:()=>_,xK:()=>E});var r=i(53966),n=i(34727),s=i(86211),o=i(77690),a=i(29242),l=i(58083),c=i(9093),u=i(35522),h=i(51850),d=i(73941),p=i(98764),f=i(48353),g=i(65806),m=i(27615),v=i(73354),x=i(22141);const y=()=>r.A.getLogger("esri.geometry.support.meshUtils.vertexSpaceConversion");function _(e,t,{vertexSpace:i,spatialReference:r}){if("georeferenced"===i.type){const n=e;if(!(0,g.g)(t,n,r))return!1;const{origin:s}=i;return(0,u.Re)(e,n,s),!0}const n=(0,p.lO)(r),s=e;if(!(0,g.g)(t,s,n))return!1;const{origin:o}=i,a=P;if(!(0,f.l)(r,o,a,n))return!1;const c=(0,l.B8)(P,a);return null!=c&&((0,u.Z0)(e,s,c),!0)}function b(e,t,i){const{vertexSpace:r,transform:n,vertexAttributes:s}=e,a=(0,m.Hq)(r)?n:null,h=T(e.spatialReference,i,3);if((0,m.yJ)(r,t)&&(!a||(0,l.t2)(a.localMatrix,c.zK))&&A(h)){const{position:e,normal:t,tangent:r}=s,n=i?.allowBufferReuse;return{position:n?e:e.slice(),normal:n?t:t?.slice(),tangent:n?r:r?.slice()}}switch(e.vertexSpace.type){case"local":return"local"===t.type?function({vertexAttributes:e,spatialReference:t,transform:i},{origin:r},n,s){const o=S(t,s);if(!(0,f.l)(t,r,R,o))return(0,x.CN)(y(),t,o),null;if(i&&(0,l.lw)(R,R,i.localMatrix),!(0,f.l)(t,n,O,o))return(0,x.CN)(y(),o,t),null;(0,l.B8)(O,O);const a=(0,l.lw)(R,O,R);return C(a,t,s,3),w(e,a)}(e,e.vertexSpace,t.origin,i):function({spatialReference:e,vertexAttributes:t,transform:i},{origin:r},n,s){const o=S(e,s);if(!(0,f.l)(e,r,R,o))return(0,x.CN)(y(),e,o),null;i&&(0,l.lw)(R,R,i.localMatrix),C(R,e,s,1);const a=new Float64Array(t.position.length),c=function(e,t,i,r,n){(0,v.a)(r,e,t);const s=new Float64Array(e.length);return(0,x.$5)(r,n,s,i)?s:((0,x.CN)(y(),n,i),null)}(t.position,R,e,a,o);if(!c)return null;const h=function(e,t,i,r,n,s){if(null==n)return null;const o=new Float32Array(n.length);return(0,x.qs)(n,o,s),(0,x.si)(o,e,t,i,r,o)?o:((0,x.CN)(y(),r,t),null)}(c,e,a,o,t.normal,R);if(t.normal&&!h)return null;const d=function(e,t,i,r,n,s){if(null==n)return null;const o=new Float32Array(n.length);return(0,x.KM)(n,o,s),(0,x.Mv)(o,e,t,i,r,o)?o:((0,x.CN)(y(),r,t),null)}(c,e,a,o,t.tangent,R);if(t.tangent&&!d)return null;if(n){const e=(0,u.ze)(L,n);(0,v.t)(c,c,e)}return{position:c,normal:h,tangent:d}}(e,e.vertexSpace,t.origin,i);case"georeferenced":return"local"===t.type?function({vertexAttributes:e,spatialReference:t,transform:i},{origin:r},n,s){const a=S(t,s);if(!(0,f.l)(t,n,R,a))return(0,x.CN)(y(),t,a),null;const c=1/T(t,s,2);(0,l.hs)(R,R,[c,c,c]);const u=(0,l.B8)(O,R),{position:h,normal:d,tangent:p}=function(e,t,i){if(!t)return e;if(!i){const{position:i,normal:r,tangent:n}=e;return{position:(0,v.t)(new Float64Array(i.length),i,t),tangent:n,normal:r}}const r=w(e,i.localMatrix);return(0,v.t)(r.position,r.position,t),r}(e,r,i),g=new Float64Array(h.length),m=function(e,t,i,r,n){const s=(0,x.gr)(e,t,r,n);if(!s)return(0,x.CN)(y(),t,n),null;const o=new Float64Array(s.length);return(0,v.a)(o,s,i),o}(h,t,u,g,a);if(!m)return null;const _=(0,o.Ge)(M,u),b=function(e,t,i,r,n,s,o){if(null==e)return null;const a=o??new Float32Array(e.length);return(0,x.X4)(e,t,i,r,n,a)?((0,v.b)(a,a,s),a):((0,x.CN)(y(),i,n),null)}(d,h,t,g,a,_,d!==e.normal?d:void 0);if(!b&&d)return null;const C=function(e,t,i,r,n,s,o){if(null==e)return null;const a=o??new Float32Array(e.length);return(0,x.xA)(e,t,i,r,n,a)?((0,v.b)(a,a,s,4),a):((0,x.CN)(y(),i,n),null)}(p,h,t,g,a,_,p!==e.tangent?p:void 0);return!C&&p?null:{position:m,normal:b,tangent:C}}(e,e.vertexSpace,t.origin,i):function({vertexAttributes:e,transform:t,spatialReference:i},{origin:r},n,s){const o=T(i,s,3),a=r||!A(o)?(0,l.C)(R,t?.localMatrix??c.zK):null;a&&C(a,i,s,3);const{position:h,normal:d,tangent:p}=a?w(e,a):e,f=s?.allowBufferReuse,g=f?h:new Float64Array(h.length);let m=h;if(r&&(m=(0,v.t)(g,m,r)),n){const e=(0,u.ze)(L,n);m=(0,v.t)(g,m,e)}return{position:m!==e.position||f?m:m.slice(),normal:d!==e.normal||f?d:d?.slice(),tangent:p!==e.tangent||f?p:p?.slice()}}(e,e.vertexSpace,t.origin,i)}}function S(e,t){return t?.useEllipsoid&&(0,d.B3)(e)?p.Y0:(0,p.lO)(e)}function w(e,t){const i=new Float64Array(e.position.length);(0,v.a)(i,e.position,t);const r=e.normal?new Float32Array(e.normal.length):null,n=e.tangent?new Float32Array(e.tangent.length):null;return r&&e.normal&&(0,x.qs)(e.normal,r,t),n&&e.tangent&&(0,x.KM)(e.tangent,n,t),{position:i,normal:r,tangent:n}}function C(e,t,i,r){const n=T(t,i,r);A(n)||(0,l.hs)(e,e,[n,n,n])}function T(e,t,i){const r=!!(1&i),n=!!(2&i),s=t?.sourceUnit,o=t?.targetUnit;if(!s&&!o)return 1;let a=E(s,e);r||!s||A(a)||(y().warn("source unit conversion not supported"),a=1);let l=1/E(o,e);return n||!o||A(l)||(y().warn("target unit conversion not supported"),l=1),a*l}function A(e){return(0,n.Io)(e,1)}function E(e,t){if(null==e)return 1;const i=(0,s.KX)(t);return 1/(0,s.oU)(i,"meters",e)}const R=(0,c.vt)(),O=(0,c.vt)(),M=(0,a.vt)(),L=(0,h.vt)(),P=(0,c.vt)()},27615(e,t,i){i.d(t,{CK:()=>l,Hq:()=>a,MW:()=>c,TE:()=>u,yJ:()=>h});var r=i(35522),n=i(86738),s=i(95696),o=i(18251);function a(e){return null!=e.origin}function l(e){return a(e.vertexSpace)}function c(e,t){if(!a(e))return null;const[i,r,s]=e.origin;return new n.A({x:i,y:r,z:s,spatialReference:t})}function u(e,t){const{x:i,y:r,z:n,spatialReference:a}=e,l=[i,r,n??0];return"local"===(t?.vertexSpace??function(e){return e.isGeographic||e.isWebMercator?"local":"georeferenced"}(a))?new o.default({origin:l}):new s.A({origin:l})}function h(e,t){return e.type===t.type&&(e.origin===t.origin||null!=e.origin&&null!=t.origin&&(0,r.t2)(e.origin,t.origin))}},65801(e,t,i){i.d(t,{uM:()=>Hr});var r=i(17676),n=i(9762),s=i(4197),o=i(58083),a=i(9093),l=i(51850);i(48353),(0,a.vt)(),new class{constructor(){this.verticalDistanceToGround=0,this.sampledElevation=0,this.z=0}},(0,l.vt)();var c=i(44208),u=i(53966),h=i(62788),d=i(95488),p=i(83349),f=i(15585),g=i(95108),m=i(97146),v=i(34727),x=i(86211),y=i(35522),_=i(27921);const b=(0,_.vt)();function S(e,t,i){if(!t)return 2;const r=e.map(e=>{const r=L(e,t);return r<3?2:function(e,t,i){const r=function(e,t,i,r){const n=(e=>!Array.isArray(e[0]))(t)?(e,i)=>t[3*e+i]:(e,i)=>t[e][i],s=(0,x.GA)(r)/(0,x.G9)(r);return(0,_.lU)(e,(e,t)=>(0,y.hZ)(e,n(t,0)*s,n(t,1)*s,n(t,2)),i)}(b,e,t,i)?(0,_.Qj)(b):[0,0,1];return Math.abs(r[2])>Math.cos((0,v.kU)(80))?2:Math.abs(r[1])>Math.abs(r[0])?1:0}(e,r,i)}),n=r[0];return r.every(e=>e===n)?n:2}function w(e,t,i){if(!t)return!(0,g.$3)(e);if(e.length<3)return!1;switch(i){case 0:return!(0,g.$3)(e,1,2);case 1:return!(0,g.$3)(e,0,2);case 2:return!(0,g.$3)(e,0,1)}}const C=new d.I;let T=new WeakSet;function A(e,t){if(!(0,f.O9)())return P("libtess-not-loaded");const i=null!=t.outlines,{positions:r,mergedPathLengths:n}=function(e){const t=function(e){const t=e.reduce((e,t)=>e+t.pathLengths.length,0),i=new Array(t);let r=0;for(let t=0;t<e.length;t++){const n=e[t].pathLengths;for(let e=0;e<n.length;e++)i[r++]=n[e]}return i}(e.polygons),i=3*e.polygonVertexCount;return i===e.positions.length?{positions:e.positions,mergedPathLengths:t}:{positions:(0,s.l5)(e.positions,0,i),mergedPathLengths:t}}(e),o=performance.now(),{vertices:a,indices:l,outlineIndices:c,outlineRingLengths:u}=(0,f.O5)(r,n,3,i),h=performance.now()-o;if(null!=t.owner&&h>250&&T.add(t.owner),a.length%3!=0)return P("positions-not-multiple-of-3");const{positions:d,outlineIndexBuffer:p,mergedOutlineRingLengths:g}=i?function(e,t,i,r,n){const o=e.polygonVertexCount,a=t?.filter(e=>e.index>=o)??[];if(0===a.length)return{positions:i,outlineIndexBuffer:r,mergedOutlineRingLengths:n};const l=3*o,c=(0,s.l5)(e.positions,l,e.positions.length-l),u=(0,s.yH)(i,c),h=i.length/3,d=a.map(e=>({index:h+e.index-o,count:e.count})),{outlineIndexBuffer:p,outlineRingLengths:f}=R(d,u);return{positions:u,outlineIndexBuffer:(0,m.lC)(r,p,u.length/3),mergedOutlineRingLengths:(0,m.lC)(n,f,n.length+f.length)}}(e,t.outlines,a,c,u):{positions:a,outlineIndexBuffer:void 0,mergedOutlineRingLengths:void 0};return{succeeded:!0,positions:d,indices:l,outlineIndexBuffer:p,outlineRingLengths:g,vertexCount:d.length/3,method:"libtess"}}function E(e,t,i){for(let r=0;r<e.length;r+=3){const n=e[r+t];e[r+t]=e[r+i],e[r+i]=n}}function R(e,t){const i=(0,m.my)(e.length);let r=0;for(let n=0;n<e.length;n++){const s=e[n],o=s.count;if(o<=0){i[n]=0;continue}const a=3*s.index,l=3*(s.index+o-1),c=o>1&&t[a]===t[l]&&t[a+1]===t[l+1]&&t[a+2]===t[l+2]?o-1:o,u=c>0?c+1:0;i[n]=u,r+=u}const n=(0,m.my)(r,t.length/3);let s=0;for(let t=0;t<e.length;t++){const r=i[t];if(0===r)continue;const o=e[t].index,a=r-1;for(let e=0;e<a;e++)n[s++]=o+e;n[s++]=o}return{outlineIndexBuffer:n,outlineRingLengths:i}}function O(e,{index:t,count:i}){return(0,s.l5)(e,3*t,3*i)}function M(e,t,i,r,n,s){let o=s?e.length-1:0;const a=s?-1:1;i*=3;for(let s=0;s<r;++s){const r=e[o];t[i++]=r[0],t[i++]=r[1],t[i++]=n&&null!=r[2]?r[2]:0,o+=a}return i/3}function L(e,t){return function(e,t){const i=e.length;if(i<2)return!1;const r=e[0],n=e[i-1];return r[0]===n[0]&&r[1]===n[1]&&(!t||r[2]===n[2])}(e,t)?e.length-1:e.length}function P(e){return{succeeded:!1,message:e}}var I=i(5482),D=i(4576),F=i(65529),N=i(91869),z=i(97768),H=i(15142),V=i(36708),W=i(3483),j=i(91429),U=i(26857),B=i(78955),$=i(19419);class Z{constructor(e,t){this.vec3=e,this.id=t}}function k(e,t,i,r){return new Z((0,l.fA)(e,t,i),r)}class G{constructor(){this._extent=(0,$.vt)(),this.resolution=0,this.renderLocalOrigin=k(0,0,0,"O"),this.pixelRatio=1,this.mapUnitsPerPixel=1,this.canvasGeometries=new q}get extent(){return this._extent}setExtent(e){(0,B.C)(this._extent,e)}setupGeometryViews(e){if(this._setupGeometryView(),!e)return;const t=.001*e.range;if(this._extent[0]-t<=e.min){const t=this.canvasGeometries.extents[this.canvasGeometries.numViews++];(0,$.cY)(this._extent,e.range,0,t)}if(this._extent[2]+t>=e.max){const t=this.canvasGeometries.extents[this.canvasGeometries.numViews++];(0,$.cY)(this._extent,-e.range,0,t)}}_setupGeometryView(){this.canvasGeometries.numViews=1,(0,$.C)(this.canvasGeometries.extents[0],this._extent)}hasSomeSizedView(){for(let e=0;e<this.canvasGeometries.numViews;e++){const t=this.canvasGeometries.extents[e];if(t[0]!==t[2]&&t[1]!==t[3])return!0}return!1}}class q{constructor(){this.extents=[(0,$.vt)(),(0,$.vt)(),(0,$.vt)()],this.numViews=0}}class Y{constructor(e,t,i){this._fbos=e,this._format=t,this._name=i}get valid(){return null!=this._handle?.getTexture()}dispose(){this._handle=(0,z.Gz)(this._handle)}get texture(){return this._handle?.getTexture()}ensureFramebuffer(e,t){this._handle&&this._handle.fbo?.width===e&&this._handle.fbo?.height===t||(this._handle?.release(),this._handle=this._fbos.acquire(e,t,this._name,this._format))}bind(e){e.bindFramebuffer(this._handle?.fbo)}generateMipMap(){this._handle?.getTexture()?.descriptor?.hasMipmap&&this._handle?.getTexture()?.generateMipmap()}}var Q=i(16943);class X{constructor(e,t,i,r,n=1,s=6){this.output=i,this.content=r,this.redrawOnRequest=n,this.fbo=new Y(e,s,t)}handleRenderRequest(e){return 1===e||e===this.redrawOnRequest}get valid(){return this.fbo.valid}}class K{constructor(e){const t=[new X(e,"overlay color",0,0),new X(e,"overlay IM color",0,1),new X(e,"overlay highlight",10,2,1,3),new X(e,"overlay water",4,3,0),new X(e,"overlay occluded",0,4)];(0,Q.E)()&&t.push(new X(e,"overlay olid",11,5,1,5)),this.targets=t}getTexture(e){return this.targets[e]?.fbo.texture}dispose(e){if(0!==e)for(const e of this.targets)e.fbo.dispose();else this.targets[3].fbo.dispose()}computeValidity(){return this.targets.reduce((e,t,i)=>t.valid?e|=1<<i:e,0)}}var J=i(91712),ee=i(69622);class te extends ee.A{precompile(e){return!!this.acquireTechniques(e)}get usedMemory(){return 0}get renderOccludedFlags(){return 1}get testsTransparentRenderOrder(){return 0}get isDecoration(){return!1}get readyToRun(){return!1}get numGeometries(){return 0}get hasOccludees(){return!1}get emissions(){return 0}forEachGeometry(e){}}class ie extends te{}var re=i(37585),ne=i(92044),se=i(78607),oe=i(13840),ae=i(98958),le=i(72091),ce=i(41976),ue=i(90644);let he=class extends ae.w{constructor(e,t){super(e,t,ce.wR),this.shader=new oe.r(le.H,()=>i.e(785).then(i.bind(i,13166)))}initializePipeline(){return(0,ue.Ey)({blending:ue.T8,colorWrite:ue.kn})}};he=(0,I.Cg)([(0,j.$K)("esri.views.3d.webgl-engine.effects.highlight.HighlightApplyTechnique")],he);var de=i(28476);let pe=class extends ae.w{constructor(e,t){super(e,t,ce.wR),this.shader=new oe.r(de.a,()=>i.e(6027).then(i.bind(i,76027)))}initializePipeline(){return(0,ue.Ey)({colorWrite:ue.kn})}};pe=(0,I.Cg)([(0,j.$K)("esri.views.3d.webgl-engine.effects.highlight.HighlightBlurTechnique")],pe);var fe=i(34053);let ge=class extends ae.w{constructor(){super(...arguments),this.shader=new oe.r(fe.a,()=>i.e(9438).then(i.bind(i,29438)))}initializePipeline(){return(0,ue.Ey)({colorWrite:ue.kn})}};ge=(0,I.Cg)([(0,j.$K)("esri.views.3d.webgl-engine.effects.highlight.HighlightDownsampleTechnique")],ge);var me=i(68197);new me.A("cyan"),new me.A("black"),new me.A("yellow");var ve=i(65786);class xe extends ve.Y{constructor(){super(...arguments),this.occludedFactor=.25,this.verticalCellCount=0,this.horizontalCellCount=0,this.highlightLevel=0,this.pixelRatio=1}}var ye=i(16824);let _e=class extends ae.w{constructor(e,t){super(e,t,ce.wR),this.shader=new oe.r(ye.H,()=>i.e(1011).then(i.bind(i,51011)))}initializePipeline(){return(0,ue.Ey)({colorWrite:ue.kn})}};_e=(0,I.Cg)([(0,j.$K)("esri.views.3d.webgl-engine.effects.highlight.HighlightToSingleTechnique")],_e);var be=i(79785);class Se extends be.Z{}var we=i(48852),Ce=i(63907),Te=i(21231),Ae=i(67171),Ee=i(66289);let Re=class extends se.A{constructor(){super(...arguments),this.produces=ne.OG.HIGHLIGHT_COLOR,this.consumes={required:[ne.OG.HIGHLIGHT_COLOR,"highlights"]},this._downsampleDrawParameters=new fe.H,this._passParameters=new xe,this._highlightBlurDrawParameters=new de.H,this._grid=new Oe}initialize(){this.addHandles([(0,V.wB)(()=>this._updateOptionsTexture(),()=>{},V.Vh)])}destroy(){this._grid.coverage=(0,z.Gz)(this._grid.coverage),this._grid.vao=(0,z.WD)(this._grid.vao),this._passParameters.highlightOptionsTexture=(0,z.Gz)(this._passParameters.highlightOptionsTexture)}_updateOptionsTexture(){if(null==this._passParameters.highlightOptionsTexture){const e=new Ae.R(16,2);e.internalFormat=6408,e.samplingMode=9728,this._passParameters.highlightOptionsTexture=new Te.A(this.renderingContext,e,null)}this._passParameters.highlightOptionsTexture.setData(function(e){const t=new Uint8Array(128);let i=0;for(const r of e){const e=4*i,n=4*i+64;++i;const{color:s}=r,o=r.haloColor??s;t[e+0]=s.r,t[e+1]=s.g,t[e+2]=s.b,t[e+3]=r.fillOpacity*s.a*255,t[n+0]=o.r,t[n+1]=o.g,t[n+2]=o.b,t[n+3]=r.haloOpacity*o.a*255}return t}(this.view.state.highlights)),this.requestRender(1)}render(e){const t=e.find(({name:e})=>e===ne.OG.HIGHLIGHT_COLOR),{techniques:i,bindParameters:r,fboCache:n,_passParameters:s,renderingContext:o}=this;if(!r.decorations)return t;const a=i.getCompiled(ge),l=i.getCompiled(_e),c=i.getCompiled(pe),u=i.getCompiled(he);if(!(a&&u&&c&&l))return this.requestRender(1),t;const h=e.find(({name:e})=>"highlights"===e).getTexture();s.highlightTexture=h;const d=this._prepareAndDownSample(h),{width:p,height:f}=h.descriptor;s.highlightTexture=h;const{camera:g}=r,{fullWidth:m,fullHeight:v,pixelRatio:x,fullViewport:y}=g,_=Math.ceil(m/x),b=Math.ceil(v/x),{_highlightBlurDrawParameters:S}=this,w=this.view.stage.renderView.renderer,{highlights:C}=r;for(let e=0;e<C.length;++e){const{name:i}=C[e];if(!w.hasHighlight(i))continue;s.highlightLevel=e,o.setClearColor(0,0,0,0);const a=n.acquire(p,f,"single highlight",2);o.bindFramebuffer(a.fbo),o.setViewport(0,0,p,f),o.clear(16384),o.bindTechnique(l,r,s),this._renderGrid(d),S.blurInput=a.getTexture(),(0,re.hZ)(S.blurSize,1/_,0);const h=n.acquire(_,b,"single highlight blur",2);o.unbindTexture(h.fbo?.colorTexture),o.bindFramebuffer(h.fbo),o.setViewport(0,0,_,b),o.clear(16384),o.bindTechnique(c,r,s,S),this._renderGrid(d),a.release(),(0,re.hZ)(S.blurSize,0,1/b),s.highlightBlurTexture=h.getTexture(),o.bindFramebuffer(t.fbo),o.setDrawBuffers([Ce.r6]),o.setViewport4fv(y),o.bindTechnique(u,r,s,S),this._renderGrid(d),h.release()}return s.coverageTexture=s.highlightTexture=null,t}_prepareAndDownSample(e){this._gridUpdateResources(e);const t=this.techniques.get(ge),i=this._gridComputeCoverage(t,e),{horizontalCellCount:r,verticalCellCount:n}=i,s=this._passParameters;return s.horizontalCellCount=r,s.verticalCellCount=n,s.coverageTexture=i.coverage?.getTexture(),i}_renderGrid(e){const t=e.verticalCellCount*e.horizontalCellCount;this.renderingContext.bindVAO(e.vao),this.renderingContext.drawElementsInstanced(Ce.WR.TRIANGLES,6,Ce.pe.UNSIGNED_BYTE,0,t)}_gridUpdateResources(e){const t=this._grid,{width:i,height:r}=e.descriptor;if(t.horizontalCellCount=Math.ceil(i/fe.g),t.verticalCellCount=Math.ceil(r/fe.g),t.vao)return;const n=this.renderingContext,s=we.g.createIndex(n,35044,Le);t.vao=new Se(n,new Ee.R(n,ce.wR),s)}_gridComputeCoverage(e,t){const i=this.renderingContext,r=this._grid,n=t.descriptor,s=Math.ceil(n.width/fe.g),o=Math.ceil(n.height/fe.g);this._downsampleDrawParameters.input=t;const{highlights:a}=this.bindParameters;r.coverage?.release();const l=this.fboCache.acquire(s,o,"highlight coverage",a.length>Pe?3:1);return r.coverage=l,i.bindFramebuffer(l.fbo),i.bindTechnique(e,this.bindParameters,this._passParameters,this._downsampleDrawParameters),i.setViewport(0,0,s,o),i.screen.draw(),r}get test(){}};(0,I.Cg)([(0,j.MZ)()],Re.prototype,"produces",void 0),(0,I.Cg)([(0,j.MZ)()],Re.prototype,"consumes",void 0),Re=(0,I.Cg)([(0,j.$K)("esri.views.3d.webgl-engine.effects.highlight.Highlight")],Re);class Oe{constructor(){this.coverage=null,this.vao=null,this.verticalCellCount=0,this.horizontalCellCount=0,this.viewportWidth=0,this.viewportHeight=0}}let Me=0;const Le=new Uint8Array([0,1,2,2,1,3]),Pe=4;class Ie{constructor(e,t,i){this.material=e,this.techniques=t,this.textures=i}}var De=i(620);class Fe{constructor(e,t,i,r){this._textures=e,this._techniques=t,this.materialChanged=i,this.requestRender=r,this._id2glMaterialRef=new Map}dispose(){this._textures.destroy()}acquire(e,t,i){this._ownMaterial(e);const r=e.produces.get(t);if(!r?.(i))return null;let n=this._id2glMaterialRef.get(e.id);if(null==n){const t=e.createGLMaterial(new Ie(e,this._techniques,this._textures));n=new Ne(t),this._id2glMaterialRef.set(e.id,n)}return n.ref(),n.glMaterial}release(e){const t=this._id2glMaterialRef.get(e.id);null!=t&&(t.unref(),t.referenced||((0,z.WD)(t.glMaterial),this._id2glMaterialRef.delete(e.id)))}_ownMaterial(e){e.repository&&e.repository!==this&&u.A.getLogger("esri.views.3d.webgl-engine.lib.GLMaterialRepository").error("Material is already owned by a different material repository"),e.repository=this}}class Ne{constructor(e){this.glMaterial=e,this._refCnt=0}ref(){++this._refCnt}unref(){--this._refCnt,(0,De.vA)(this._refCnt>=0)}get referenced(){return this._refCnt>0}}var ze=i(24326),He=i(91829),Ve=i(46610),We=i(16613),je=i(94008),Ue=i(32728),Be=i(17478);function $e(e,t){return null==e&&(e=[]),e.push(t),e}function Ze(e,t){if(null==e)return null;const i=e.filter(e=>e!==t);return 0===i.length?null:i}i(28449),(0,l.vt)(),new Float32Array(6);class ke{constructor(e={}){this.id=(0,ze.c)(),this._highlightIds=new Set,this._shaderTransformation=null,this._visible=!0,this.castShadow=e.castShadow??!0,this.usesVerticalDistanceToGround=e.usesVerticalDistanceToGround??!1,this.graphicUid=e.graphicUid,this.layerViewUid=e.layerViewUid,e.isElevationSource&&(this.lastValidElevationBB=new Ge),this._geometries=e.geometries?Array.from(e.geometries):[]}dispose(){this._geometries.length=0}get layer(){return this._layer}set layer(e){(0,De.vA)(null==this._layer||null==e,"Object3D can only be added to a single Layer"),this._layer=e}addGeometry(e){e.visible=this._visible,this._geometries.push(e);for(const t of this._highlightIds)e.addHighlight(t);this._emit("geometryAdded",{object:this,geometry:e}),this._highlightIds.size&&this._emit("highlightChanged",this),this._invalidateBoundingVolume()}removeGeometry(e){const t=this._geometries.splice(e,1)[0];if(t){for(const e of this._highlightIds)t.removeHighlight(e);this._emit("geometryRemoved",{object:this,geometry:t}),this._highlightIds.size&&this._emit("highlightChanged",this),this._invalidateBoundingVolume()}}removeAllGeometries(){for(;this._geometries.length>0;)this.removeGeometry(0)}geometryVertexAttributeUpdated(e,t,i=!1){this._emit("attributesChanged",{object:this,geometry:e,attribute:t,sync:i}),function(e){return"position"===e}(t)&&this._invalidateBoundingVolume()}get visible(){return this._visible}set visible(e){if(this._visible!==e){this._visible=e;for(const e of this._geometries)e.visible=this._visible;this._emit("visibilityChanged",this)}}maskOccludee(){const e=new Be.p;for(const t of this._geometries)t.occludees=$e(t.occludees,e);return this._emit("occlusionChanged",this),e}removeOcclude(e){for(const t of this._geometries)t.occludees=Ze(t.occludees,e);this._emit("occlusionChanged",this)}highlight(e){const t=new Be.h(e);for(const e of this._geometries)e.addHighlight(t);return this._emit("highlightChanged",this),this._highlightIds.add(t),t}removeHighlight(e){this._highlightIds.delete(e);for(const t of this._geometries)t.removeHighlight(e);this._emit("highlightChanged",this)}removeStateID(e){0===e.channel?this.removeHighlight(e):this.removeOcclude(e)}getCombinedStaticTransformation(e,t){return(0,o.lw)(t,this.transformation,e.transformation)}getCombinedShaderTransformation(e,t=(0,a.vt)()){return(0,o.lw)(t,this.effectiveTransformation,e.transformation)}get boundingVolumeWorldSpace(){return this._bvWorldSpace||(this._bvWorldSpace=new qe,this._validateBoundingVolume(this._bvWorldSpace,0)),this._bvWorldSpace}get boundingVolumeObjectSpace(){return this._bvObjectSpace||(this._bvObjectSpace=new qe,this._validateBoundingVolume(this._bvObjectSpace,1)),this._bvObjectSpace}_validateBoundingVolume(e,t){const i=1===t;for(const t of this._geometries){const r=t.boundingInfo;r&&Ye(r,e,i?t.transformation:this.getCombinedShaderTransformation(t))}(0,y.Cc)(e.bounds.center,e.min,e.max,.5);for(const t of this._geometries){const r=t.boundingInfo;if(null==r)continue;const n=i?t.transformation:this.getCombinedShaderTransformation(t),s=(0,Ue.hG)(n);(0,y.Z0)(Je,r.center,n);const o=(0,y.Io)(Je,e.bounds.center),a=r.radius*s;e.bounds.radius=Math.max(e.bounds.radius,o+a)}}_invalidateBoundingVolume(){const e=this._bvWorldSpace?.bounds;this._bvObjectSpace=this._bvWorldSpace=void 0,this.layer&&e&&this.layer.notifyObjectBBChanged(this,e)}_emit(e,t){this.layer?.events.emit(e,t)}get geometries(){return this._geometries}get transformation(){return this._transformation??a.zK}set transformation(e){this._transformation=(0,o.C)(this._transformation??(0,a.vt)(),e),this._invalidateBoundingVolume(),this._emit("transformationChanged",this)}get shaderTransformation(){return this._shaderTransformation}set shaderTransformation(e){this._shaderTransformation=e?(0,o.C)(this._shaderTransformation??(0,a.vt)(),e):null,this._invalidateBoundingVolume(),this._emit("shaderTransformationChanged",this)}get effectiveTransformation(){return this.shaderTransformation??this.transformation}get test(){}}class Ge{constructor(){this._data=[Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE]}get min(){return(0,l.fA)(this._data[0],this._data[1],this._data[2])}get max(){return(0,l.fA)(this._data[3],this._data[4],this._data[5])}minWith(e){const{_data:t}=this;t[0]=Math.min(t[0],e[0]),t[1]=Math.min(t[1],e[1]),t[2]=Math.min(t[2],e[2])}maxWith(e){const{_data:t}=this;t[3]=Math.max(t[3],e[0]),t[4]=Math.max(t[4],e[1]),t[5]=Math.max(t[5],e[2])}assignMinMax(e,t){for(let i=0;i<3;++i)this._data[0+i]=e[i],this._data[3+i]=t[i]}isEmpty(){return this._data[3]<this._data[0]&&this._data[4]<this._data[1]&&this._data[5]<this._data[2]}}class qe extends Ge{constructor(){super(...arguments),this.bounds=new je.iy}}function Ye(e,t,i){const r=e.bbMin,n=e.bbMax;if((0,o.tZ)(i)){const e=(0,y.hZ)(Qe,i[12],i[13],i[14]);return(0,y.WQ)(Xe,r,e),(0,y.WQ)(Ke,n,e),t.minWith(Xe),void t.maxWith(Ke)}if((0,y.Z0)(Xe,r,i),(0,y.t2)(r,n))return t.minWith(Xe),void t.maxWith(Xe);(0,y.Z0)(Ke,n,i),t.minWith(Xe),t.minWith(Ke),t.maxWith(Xe),t.maxWith(Ke);for(let e=0;e<3;++e)(0,y.C)(Xe,r),(0,y.C)(Ke,n),Xe[e]=n[e],Ke[e]=r[e],(0,y.Z0)(Xe,Xe,i),(0,y.Z0)(Ke,Ke,i),t.minWith(Xe),t.minWith(Ke),t.maxWith(Xe),t.maxWith(Ke)}const Qe=(0,l.vt)(),Xe=(0,l.vt)(),Ke=(0,l.vt)(),Je=(0,l.vt)();var et=i(21818),tt=i(71511);const it=["layerObjectAdded","layerObjectRemoved","layerObjectsAdded","layerObjectsRemoved","transformationChanged","shaderTransformationChanged","visibilityChanged","occlusionChanged","highlightChanged","geometryAdded","geometryRemoved","attributesChanged"];var rt=i(78230);class nt{constructor(e,t,i=""){this.stage=e,this.apiLayerViewUid=i,this.id=(0,ze.c)(),this.events=new F.bk,this.visible=!0,this.sliceable=!1,this._objectsAdded=new Array,this._handles=new tt.A,this._objects=new Map,this._pickable=!0,this.visible=t?.visible??!0,this._pickable=t?.pickable??!0,this.updatePolicy=t?.updatePolicy??0,e.addLayer(this);for(const t of it)this._handles.add(this.events.on(t,i=>e.handleEvent(t,i)))}destroy(){this._handles.size&&(this._handles.destroy(),this.stage.removeLayer(this),this.invalidateSpatialQueryAccelerator())}get objects(){return this._objects}getObject(e){return(0,et.z)(this._objects.get(e))}set pickable(e){this._pickable=e}get pickable(){return this._pickable&&this.visible}add(e){this._objects.set(e.id,e),e.layer=this,this.events.emit("layerObjectAdded",e),null!=this._octree&&this._objectsAdded.push(e)}remove(e){this._objects.delete(e.id)&&(this.events.emit("layerObjectRemoved",e),e.layer=null,null!=this._octree&&((0,D.Xy)(this._objectsAdded,e)||this._octree.remove([e])))}addMany(e){for(const t of e)this._objects.set(t.id,t),t.layer=this;this.events.emit("layerObjectsAdded",e),null!=this._octree&&this._objectsAdded.push(...e)}removeMany(e){const t=new Array;for(const i of e)this._objects.delete(i.id)&&t.push(i);if(0!==t.length&&(this.events.emit("layerObjectsRemoved",t),t.forEach(e=>e.layer=null),null!=this._octree)){for(let e=0;e<t.length;)(0,D.Xy)(this._objectsAdded,t[e])?(t[e]=t[t.length-1],t.length-=1):++e;this._octree.remove(t)}}commit(){this.stage.commitLayer(this)}sync(){1!==this.updatePolicy&&this.stage.syncLayer(this.id)}notifyObjectBBChanged(e,t){null==this._octree||this._objectsAdded.includes(e)||this._octree.update(e,t)}getSpatialQueryAccelerator(){return null==this._octree&&this._objects.size>50?(this._octree=new rt.x(e=>e.boundingVolumeWorldSpace.bounds),this._octree.add(this._objects.values())):null!=this._octree&&this._objectsAdded.length>0&&(this._octree.add(this._objectsAdded),this._objectsAdded.length=0),this._octree}invalidateSpatialQueryAccelerator(){this._octree=(0,z.pR)(this._octree),this._objectsAdded.length=0}get test(){}}var st=i(90629),ot=i(78659),at=i(20498),lt=i(11964),ct=i(13030),ut=i(49255),ht=i(92130),dt=i(11725),pt=i(77194),ft=i(96095),gt=i(35622),mt=i(59907),vt=i(32565),xt=i(7298),yt=i(4431),_t=i(33524),bt=i(56133),St=i(33442);let wt=class extends ae.w{constructor(e,t){super(e,t,(0,yt.U)((0,xt.bP)(t))),this.shader=new oe.r(vt.R,()=>i.e(2059).then(i.bind(i,92059))),this.ignoreUnused=!0,this.primitiveType=t.wireframe?Ce.WR.LINES:Ce.WR.TRIANGLE_STRIP}_makePipelineState(e,t){const{output:i,hasOccludees:r}=e;return(0,ue.Ey)({blending:(0,_t.Yf)(i,!1,e.emissionDimmingPass),depthTest:(0,_t.mt)(i),depthWrite:(0,_t.z5)(e),colorWrite:ue.kn,stencilWrite:r?bt.v0:null,stencilTest:r?t?bt.Ax:bt.cP:null,polygonOffset:(0,St.T)(e)})}initializePipeline(e){if(e.occluder){const{hasOccludees:t}=e;this._occluderPipelineTransparent=(0,ue.Ey)({blending:ue.T8,polygonOffset:(0,St.T)(e),depthTest:bt.sf,depthWrite:null,colorWrite:ue.kn,stencilWrite:null,stencilTest:t?bt.Q0:null}),this._occluderPipelineOpaque=(0,ue.Ey)({blending:ue.T8,polygonOffset:(0,St.T)(e),depthTest:t?bt.sf:bt.m,depthWrite:null,colorWrite:ue.kn,stencilWrite:t?bt.r8:null,stencilTest:t?bt.iB:null}),this._occluderPipelineMaskWrite=(0,ue.Ey)({blending:null,polygonOffset:(0,St.T)(e),depthTest:bt.m,depthWrite:null,colorWrite:null,stencilWrite:t?bt.v0:null,stencilTest:t?bt.Ax:null})}return this._occludeePipeline=this._makePipelineState(e,!0),this._makePipelineState(e,!1)}getPipeline(e,t,i){if(i)return this._occludeePipeline;switch(e.occluder){case 11:return this._occluderPipelineTransparent??super.getPipeline(e,t,i);case 10:return this._occluderPipelineOpaque??super.getPipeline(e,t,i);default:e.occluder;case void 0:case null:return this._occluderPipelineMaskWrite??super.getPipeline(e,t,i)}}};wt=(0,I.Cg)([(0,j.$K)("esri.views.3d.webgl-engine.shaders.RibbonLineTechnique")],wt);var Ct=i(51976),Tt=i(47724);class At extends Tt.L{constructor(e){super(),this.spherical=e,this.capType=0,this.emissionSource=0,this.animation=2,this.polygonOffsetIndex=0,this.writeDepth=!1,this.draped=!1,this.stippleEnabled=!1,this.stippleOffColorEnabled=!1,this.stipplePreferContinuous=!0,this.numJoinSubdivisions=1,this.roundJoins=!1,this.applyMarkerOffset=!1,this.hasVVSize=!1,this.hasVVColor=!1,this.hasVVOpacity=!1,this.falloffEnabled=!1,this.innerColorEnabled=!1,this.hasOccludees=!1,this.occluder=!1,this.wireframe=!1,this.hasScreenSizePerspective=!1,this.worldSizedImagePattern=!1,this.textureCoordinateType=0,this.hasVVInstancing=!1,this.hasSliceTranslatedView=!0,this.overlayEnabled=!1,this.snowCover=!1,this.renderOccluded=!1}get hasAnimation(){return 0!==this.animation}}(0,I.Cg)([(0,Ct.W)({count:3})],At.prototype,"capType",void 0),(0,I.Cg)([(0,Ct.W)({count:8})],At.prototype,"emissionSource",void 0),(0,I.Cg)([(0,Ct.W)({count:4})],At.prototype,"animation",void 0),(0,I.Cg)([(0,Ct.W)({count:16})],At.prototype,"polygonOffsetIndex",void 0),(0,I.Cg)([(0,Ct.W)()],At.prototype,"writeDepth",void 0),(0,I.Cg)([(0,Ct.W)()],At.prototype,"draped",void 0),(0,I.Cg)([(0,Ct.W)()],At.prototype,"stippleEnabled",void 0),(0,I.Cg)([(0,Ct.W)()],At.prototype,"stippleOffColorEnabled",void 0),(0,I.Cg)([(0,Ct.W)()],At.prototype,"stipplePreferContinuous",void 0),(0,I.Cg)([(0,Ct.W)({count:8})],At.prototype,"numJoinSubdivisions",void 0),(0,I.Cg)([(0,Ct.W)()],At.prototype,"roundJoins",void 0),(0,I.Cg)([(0,Ct.W)()],At.prototype,"applyMarkerOffset",void 0),(0,I.Cg)([(0,Ct.W)()],At.prototype,"hasVVSize",void 0),(0,I.Cg)([(0,Ct.W)()],At.prototype,"hasVVColor",void 0),(0,I.Cg)([(0,Ct.W)()],At.prototype,"hasVVOpacity",void 0),(0,I.Cg)([(0,Ct.W)()],At.prototype,"falloffEnabled",void 0),(0,I.Cg)([(0,Ct.W)()],At.prototype,"innerColorEnabled",void 0),(0,I.Cg)([(0,Ct.W)()],At.prototype,"hasOccludees",void 0),(0,I.Cg)([(0,Ct.W)()],At.prototype,"occluder",void 0),(0,I.Cg)([(0,Ct.W)()],At.prototype,"wireframe",void 0),(0,I.Cg)([(0,Ct.W)()],At.prototype,"hasScreenSizePerspective",void 0),(0,I.Cg)([(0,Ct.W)()],At.prototype,"worldSizedImagePattern",void 0);var Et=i(49788);class Rt extends dt.i{constructor(e,t){super(e,Mt),this.produces=new Map([[2,e=>(0,ut.Ex)(e)||(0,ut._o)(e)&&8===this.parameters.renderOccluded],[3,e=>(0,ut.eh)(e)],[10,e=>(0,ut.gr)(e)&&8===this.parameters.renderOccluded],[11,e=>(0,ut.gr)(e)&&8===this.parameters.renderOccluded],[4,e=>(0,ut._o)(e)&&this.parameters.writeDepth&&8!==this.parameters.renderOccluded],[8,e=>(0,ut._o)(e)&&!this.parameters.writeDepth&&8!==this.parameters.renderOccluded],[18,e=>(0,ut.i3)(e)]]),this._configuration=new At(t)}updateConfiguration(e){super.updateConfiguration(e);const t=18===e.slot,i=null!=this.parameters.stipplePattern&&null!=this.parameters.stippleTexture&&10!==e.output,r=i&&t&&this.parameters.isImagePattern();this._configuration.draped=t,this._configuration.polygonOffset=this.parameters.polygonOffset,this._configuration.stippleEnabled=i,this._configuration.stippleOffColorEnabled=i&&null!=this.parameters.stippleOffColor,this._configuration.stipplePreferContinuous=i&&this.parameters.stipplePreferContinuous,this._configuration.numJoinSubdivisions=Dt(this.parameters.join,i),this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.roundJoins="round"===this.parameters.join,this._configuration.capType=this.parameters.cap,this._configuration.applyMarkerOffset=null!=this.parameters.markerParameters&&function(e){return 1===e.anchor&&e.hideOnShortSegments&&"begin-end"===e.placement&&e.worldSpace}(this.parameters.markerParameters),this._configuration.polygonOffsetIndex=this.parameters.polygonOffsetIndex,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.hasVVSize=this.parameters.hasVVSize,this._configuration.hasVVColor=this.parameters.hasVVColor,this._configuration.hasVVOpacity=this.parameters.hasVVOpacity,this._configuration.innerColorEnabled=this.parameters.innerWidth>0&&null!=this.parameters.innerColor,this._configuration.falloffEnabled=this.parameters.falloff>0,this._configuration.hasOccludees=e.hasOccludees,this._configuration.occluder=8===this.parameters.renderOccluded,this._configuration.wireframe=this.parameters.wireframe,this._configuration.animation=this.parameters.animation,this._configuration.emissionSource=this.emissions?1:0,this._configuration.hasScreenSizePerspective=!!this.parameters.screenSizePerspective&&!r,this._configuration.worldSizedImagePattern=r}get visible(){return this.parameters.color[3]>=Et.Q||null!=this.parameters.stipplePattern&&(this.parameters.stippleOffColor?.[3]??0)>Et.Q}get emissions(){return this.parameters.emissiveStrength>0?8!==this.parameters.renderOccluded?2:1:0}setParameters(e,t){e.animation=this.parameters.animation,super.setParameters(e,t)}intersectScreenPolygon(){}intersectRayDraped({attributes:e,screenToWorldRatio:t},i,r,n,s){if(!i.options.selectionMode)return;const o=e.get("size");let a=this.parameters.width;if(this.parameters.vvSize){const t=e.get("sizeFeatureAttribute").data[0];Number.isNaN(t)?a*=this.parameters.vvSize.fallback[0]:a*=(0,v.qE)(this.parameters.vvSize.offset[0]+t*this.parameters.vvSize.factor[0],this.parameters.vvSize.minSize[0],this.parameters.vvSize.maxSize[0])}else o&&(a*=o.data[0]);const l=r[0],c=r[1],u=(a/2+4)*t;let h=Number.MAX_VALUE,d=0;const p=e.get("position").data,f=It(this.parameters,e)?p.length-2:p.length-5;for(let e=0;e<f;e+=3){const t=p[e],i=p[e+1],r=(e+3)%p.length,n=l-t,s=c-i,o=p[r]-t,a=p[r+1]-i,u=(0,v.qE)((o*n+a*s)/(o*o+a*a),0,1),f=o*u-n,g=a*u-s,m=f*f+g*g;m<h&&(h=m,d=e/3)}h<u*u&&n(s.distance,s.normal,d)}intersectRay(e,t,i,r,n,s){const{options:o,camera:a,rayBegin:l,rayEnd:c}=i;if(!o.selectionMode||!e.visible||!a)return;if(!(0,De.zH)(t))return void u.A.getLogger("esri.views.3d.webgl-engine.materials.RibbonLineMaterial").error("intersection assumes a translation-only matrix");const h=e.attributes,d=h.get("position").data;let p=this.parameters.width;if(this.parameters.vvSize){const e=h.get("sizeFeatureAttribute").data[0];Number.isNaN(e)||(p*=(0,v.qE)(this.parameters.vvSize.offset[0]+e*this.parameters.vvSize.factor[0],this.parameters.vvSize.minSize[0],this.parameters.vvSize.maxSize[0]))}else h.has("size")&&(p*=h.get("size").data[0]);const f=Bt;(0,re.C)(f,i.point);const g=p*a.pixelRatio,m=4*a.pixelRatio,x=g/2+m;(0,y.hZ)(ei[0],f[0]-x,f[1]+x,0),(0,y.hZ)(ei[1],f[0]+x,f[1]+x,0),(0,y.hZ)(ei[2],f[0]+x,f[1]-x,0),(0,y.hZ)(ei[3],f[0]-x,f[1]-x,0);for(let e=0;e<4;e++)if(!a.unprojectFromRenderScreen(ei[e],ti[e]))return;(0,_.Cr)(a.eye,ti[0],ti[1],ii),(0,_.Cr)(a.eye,ti[1],ti[2],ri),(0,_.Cr)(a.eye,ti[2],ti[3],ni),(0,_.Cr)(a.eye,ti[3],ti[0],si);let b=Number.MAX_VALUE,S=0;const w=It(this.parameters,h)?d.length-2:d.length-5;for(let e=0;e<w;e+=3){Nt[0]=d[e]+t[12],Nt[1]=d[e+1]+t[13],Nt[2]=d[e+2]+t[14];const i=(e+3)%d.length;if(zt[0]=d[i]+t[12],zt[1]=d[i+1]+t[13],zt[2]=d[i+2]+t[14],(0,_.mN)(ii,Nt)<0&&(0,_.mN)(ii,zt)<0||(0,_.mN)(ri,Nt)<0&&(0,_.mN)(ri,zt)<0||(0,_.mN)(ni,Nt)<0&&(0,_.mN)(ni,zt)<0||(0,_.mN)(si,Nt)<0&&(0,_.mN)(si,zt)<0)continue;const r=a.projectToRenderScreen(Nt,$t),n=a.projectToRenderScreen(zt,Zt);if(null==r||null==n)continue;if(r[2]<0&&n[2]>0){(0,y.Re)(jt,Nt,zt);const e=a.frustum,t=-(0,_.mN)(e[4],Nt)/(0,y.Om)(jt,(0,_.Qj)(e[4]));if((0,y.hs)(jt,jt,t),(0,y.WQ)(Nt,Nt,jt),!a.projectToRenderScreen(Nt,r))continue}else if(r[2]>0&&n[2]<0){(0,y.Re)(jt,zt,Nt);const e=a.frustum,t=-(0,_.mN)(e[4],zt)/(0,y.Om)(jt,(0,_.Qj)(e[4]));if((0,y.hs)(jt,jt,t),(0,y.WQ)(zt,zt,jt),!a.projectToRenderScreen(zt,n))continue}else if(r[2]<0&&n[2]<0)continue;r[2]=0,n[2]=0;const s=(0,lt.Cr)(r,n,qt),o=(0,lt.kb)(s,f);if(!(o>=b)){if(this.parameters.screenSizePerspective){const e=this.computeScreenSizePerspectiveWidth(s,Nt,zt,f,a,p,m);if(o>=e*e)continue}b=o,(0,y.C)(kt,Nt),(0,y.C)(Gt,zt),S=e/3}}if(b<x*x){let e=Number.MAX_VALUE;if((0,lt.ld)((0,lt.Cr)(kt,Gt,qt),(0,lt.Cr)(l,c,Yt),Ut)){(0,y.Re)(Ut,Ut,l);const t=(0,y.Bw)(Ut);(0,y.hs)(Ut,Ut,1/t),e=t/(0,y.Io)(l,c)}s(e,Ut,S)}}createBufferWriter(){return new Lt((0,xt.bP)(this.parameters),(0,xt.qB)(this.parameters),this.parameters)}createGLMaterial(e){return new Ot(e)}validateParameters(e){"miter"!==e.join&&(e.miterLimit=0),null!=e.markerParameters&&(e.markerScale=e.markerParameters.width/e.width)}update(e){return!!this.parameters.hasAnimation&&(this.setParameters({timeElapsed:(0,ot.y)(e.time)},!1),0!==e.dt)}computeScreenSizePerspectiveWidth(e,t,i,r,n,s,o){const a=(0,lt.G1)(e,r);(0,y.Cc)(Ht,t,i,a),(0,y.Z0)(Vt,Ht,n.viewMatrix);const l=(0,y.Bw)(Vt),c=this.computeCameraAbsCosAngle(Ht,n,this._configuration.spherical);return Ft.update(c,l,this.parameters.screenSizePerspective,this.parameters.screenSizePerspectiveMinPixelReferenceSize),Ft.apply(s)*n.pixelRatio/2+o}computeCameraAbsCosAngle(e,t,i){return i?(0,y.S8)(Ut,e):(0,y.hZ)(Ut,0,0,1),(0,y.Re)(Wt,e,t.eye),(0,y.S8)(Wt,Wt),Math.abs((0,y.Om)(Ut,Wt))}}class Ot extends ht.A{constructor(){super(...arguments),this._stipplePattern=null}dispose(){super.dispose(),this._stippleTextures?.release(this._stipplePattern),this._stipplePattern=null}beginSlot(e){const{stipplePattern:t}=this._material.parameters;return this._stipplePattern!==t&&(this._material.setParameters({stippleTexture:this._stippleTextures.swap(t,this._stipplePattern)}),this._stipplePattern=t),this.getTechnique(wt,e)}}class Mt extends gt.S{constructor(){super(...arguments),this._width=0,this.color=He.Un,this.join="miter",this.cap=0,this.miterLimit=5,this.writeDepth=!0,this.polygonOffset=0,this.polygonOffsetIndex=0,this.stippleTexture=null,this.stipplePreferContinuous=!0,this.markerParameters=null,this.markerScale=1,this.hasSlicePlane=!1,this.vvFastUpdate=!1,this.isClosed=!1,this.falloff=0,this.innerWidth=0,this.wireframe=!1,this.timeElapsed=(0,ot.Kp)(0),this.animation=0,this.animationSpeed=1,this.trailLength=1,this.startTime=(0,ot.Kp)(0),this.endTime=(0,ot.Kp)(1/0),this.emissiveStrength=0}get width(){return this.isImagePattern()?this.stipplePattern.width:this._width}set width(e){this._width=e}get transparent(){return this.color[3]<1||this.hasAnimation||null!=this.stipplePattern&&(this.stippleOffColor?.[3]??0)<1}get hasAnimation(){return 0!==this.animation}isImagePattern(){return(0,ft.sL)(this.stipplePattern)&&null!=this.stippleTexture}}class Lt{constructor(e,t,i){this.layout=e,this.textureBufferLayout=t,this._parameters=i,this.numJoinSubdivisions=Dt(this._parameters.join,null!=this._parameters.stipplePattern)}_isClosed(e){return It(this._parameters,e)}allocate(e){return this.layout.createBuffer(e)}elementCountTextureBuffer(e){return e.get("position").data.length/3}elementCount(e){const t=e.get("position").indices.length/2+1,i=this._isClosed(e);let r=i?2:4;return r+=((i?t:t-1)-(i?0:1))*(2*this.numJoinSubdivisions+4),r+=2,this._parameters.wireframe&&(r=2+4*(r-2)),r}write(e,t,i,r,n,s){const{buffer:o,offset:a}=n,{layout:l,textureBufferLayout:c}=this,u=i.get("position"),h=u.indices,d=u.data.length/3,p=d,f=i.get("distanceToStart")?.data;h&&h.length!==2*(d-1)&&console.warn("RibbonLineMaterial does not support indices");const g=o.getField("textureElementIndex",ct.P);(0,De.vA)(null!=g,"Missing texture buffer index field"),(0,De.vA)(null!==s,"Expected texture buffer target"),(0,De.vA)(null!==c,"Expected valid textureBufferLayout");const{textureBufferRange:m,offset:v}=s;(0,De.vA)(null!=m,"Using a texture layout, but the texture range for this instance was not provided");const x=m.from;(0,De.vA)(m.numElements===p,"Expected number of elements in TextureBuffer to equal number of points");const{buffer:_}=s,b=_.getField("position",ct.xs);(0,De.vA)(null!==b,"Expected valid position field in texture buffer");const S=l.fields.has("sizeFeatureAttribute");let w=1,C=null;if(S){const e=i.get("sizeFeatureAttribute");1===e.data.length?w=e.data[0]:C=e.data}else w=i.get("size")?.data[0]??1;let T=[1,1,1,1],A=0,E=null;const R=l.fields.has("colorFeatureAttribute");if(R){const e=i.get("colorFeatureAttribute");1===e.data.length?A=e.data[0]:E=e.data}else T=i.get("color")?.data??T;const O=i.get("timeStamps")?.data,M=O&&l.fields.has("timeStamps"),L=l.fields.has("opacityFeatureAttribute");let P=0,I=null;if(L){const e=i.get("opacityFeatureAttribute");1===e.data.length?P=e.data[0]:I=e.data}const D=new Float32Array(o.buffer),F=(0,at.Bg)(o.buffer),N=new Uint8Array(o.buffer),z=new Uint32Array(o.buffer),H=l.stride/4;let V=a*H;const W=V;let j=0;const U=f?(e,t,i)=>j=f[i]:(e,t,i)=>j+=(0,y.Io)(e,t),$=D.BYTES_PER_ELEMENT/F.BYTES_PER_ELEMENT,Z=4/$,k=(0,Q.E)(),G=(e,t,i,n,s,o,a,l)=>{const c=a;z[V]=x+c,V++,b.setVec(v+c,t),(0,mt.Wu)(e,t,F,V*$),V+=Z,(0,mt.Wu)(i,t,F,V*$),V+=Z,D[V++]=l;let u=V*$;if(F[u++]=s,F[u++]=o,V=Math.ceil(u/$),R)D[V]=E?.[a]??A;else{const e=Math.min(4*a,T.length-4),t=4*V;N[t]=255*T[e],N[t+1]=255*T[e+1],N[t+2]=255*T[e+2],N[t+3]=255*T[e+3]}if(V++,D[V++]=C?.[a]??w,L&&(D[V++]=I?.[a]??P),k){let e=4*V;r?(N[e++]=r[0],N[e++]=r[1],N[e++]=r[2],N[e++]=r[3]):(N[e++]=0,N[e++]=0,N[e++]=0,N[e++]=0),V=Math.ceil(.25*e)}M&&(u=V*$,F[u++]=n[0],F[u++]=n[1],F[u++]=n[2],F[u++]=n[3],V=Math.ceil(u/$))};V+=H,(0,y.hZ)(Xt,u.data[0],u.data[1],u.data[2]),M&&(0,B.hZ)(Jt,O[0],O[1],O[2],O[3]),e&&(0,y.Z0)(Xt,Xt,e);const q=this._isClosed(i);if(q){const t=u.data.length-3;(0,y.hZ)(Qt,u.data[t],u.data[t+1],u.data[t+2]),e&&(0,y.Z0)(Qt,Qt,e)}else(0,y.hZ)(Kt,u.data[3],u.data[4],u.data[5]),e&&(0,y.Z0)(Kt,Kt,e),G(Xt,Xt,Kt,Jt,1,-4,0,0),G(Xt,Xt,Kt,Jt,1,4,0,0),(0,y.C)(Qt,Xt),(0,y.C)(Xt,Kt),M&&(0,B.hZ)(Jt,O[4],O[5],O[6],O[7]);const Y=q?0:1,X=q?d:d-1;for(let t=Y;t<X;t++){const i=(t+1)%d*3;(0,y.hZ)(Kt,u.data[i],u.data[i+1],u.data[i+2]),e&&(0,y.Z0)(Kt,Kt,e),U(Qt,Xt,t),G(Qt,Xt,Kt,Jt,0,-1,t,j),G(Qt,Xt,Kt,Jt,0,1,t,j);const r=this.numJoinSubdivisions;for(let e=0;e<r;++e){const i=(e+1)/(r+1);G(Qt,Xt,Kt,Jt,i,-1,t,j),G(Qt,Xt,Kt,Jt,i,1,t,j)}if(G(Qt,Xt,Kt,Jt,1,-2,t,j),G(Qt,Xt,Kt,Jt,1,2,t,j),(0,y.C)(Qt,Xt),(0,y.C)(Xt,Kt),M){const e=(t+1)%d*4;(0,B.hZ)(Jt,O[e],O[e+1],O[e+2],O[e+3])}}q?((0,y.hZ)(Kt,u.data[3],u.data[4],u.data[5]),e&&(0,y.Z0)(Kt,Kt,e),j=U(Qt,Xt,X),G(Qt,Xt,Kt,Jt,0,-1,Y,j),G(Qt,Xt,Kt,Jt,0,1,Y,j)):(j=U(Qt,Xt,X),G(Qt,Xt,Xt,Jt,0,-5,X,j),G(Qt,Xt,Xt,Jt,0,5,X,j)),Pt(D,W+H,D,W,H),V=Pt(D,V-H,D,V,H),this._parameters.wireframe&&this._addWireframeVertices(o,W,V,H)}_addWireframeVertices(e,t,i,r){const n=new Uint8Array(e.buffer,i*Float32Array.BYTES_PER_ELEMENT),s=new Uint8Array(e.buffer,t*Float32Array.BYTES_PER_ELEMENT,(i-t)*Float32Array.BYTES_PER_ELEMENT),o=r*Float32Array.BYTES_PER_ELEMENT;let a=0;const l=e=>a=Pt(s,e,n,a,o);for(let e=0;e<=s.length-4*o;e+=2*o)l(e),l(e+2*o),l(e+1*o),l(e+2*o),l(e+1*o),l(e+3*o)}}function Pt(e,t,i,r,n){for(let s=0;s<n;s++)i[r++]=e[t++];return r}function It(e,t){return!!e.isClosed&&t.get("position").indices.length>2}function Dt(e,t){const i=t?1:0;switch(e){case"miter":case"bevel":return i;case"round":return vt.r+i}}const Ft=new pt.PS,Nt=(0,l.vt)(),zt=(0,l.vt)(),Ht=(0,l.vt)(),Vt=(0,l.vt)(),Wt=(0,l.vt)(),jt=(0,l.vt)(),Ut=(0,l.vt)(),Bt=(0,l.vt)(),$t=(0,st.r_)(),Zt=(0,st.r_)(),kt=(0,l.vt)(),Gt=(0,l.vt)(),qt=(0,lt.vt)(),Yt=(0,lt.vt)(),Qt=(0,l.vt)(),Xt=(0,l.vt)(),Kt=(0,l.vt)(),Jt=(0,He.vt)(),ei=[(0,st.r_)(),(0,st.r_)(),(0,st.r_)(),(0,st.r_)()],ti=[(0,l.vt)(),(0,l.vt)(),(0,l.vt)(),(0,l.vt)()],ii=(0,_.vt)(),ri=(0,_.vt)(),ni=(0,_.vt)(),si=(0,_.vt)();class oi{constructor(e){this._originSR=e,this._rootOriginId="root/"+(0,ze.c)(),this._origins=new Map,this._objects=new Map,this._gridSize=5e5,this._originSR?.isGeographic&&(this._gridSize/=(0,x.GA)(this._originSR)),this._baselineDistance=.5*this._gridSize;const t=this._baselineDistance*li;this._baselineObjectSize=t/ci}getOrigin(e){const t=this._origins.get(this._rootOriginId);if(null==t){const t=null;if(null!=t)return this._origins.set(this._rootOriginId,k(t[0],t[1],t[2],this._rootOriginId)),this.getOrigin(e);const i=k(e[0]+Math.random()-.5,e[1]+Math.random()-.5,e[2]+Math.random()-.5,this._rootOriginId);return this._origins.set(this._rootOriginId,i),i}const i=this._gridSize,r=Math.round(e[0]/i),n=Math.round(e[1]/i),s=Math.round(e[2]/i),o=`${r}/${n}/${s}`;let a=this._origins.get(o);const l=.5*i;if((0,y.Re)(ai,e,t.vec3),ai[0]=Math.abs(ai[0]),ai[1]=Math.abs(ai[1]),ai[2]=Math.abs(ai[2]),ai[0]<l&&ai[1]<l&&ai[2]<l){if(a){const t=Math.max(...ai);if((0,y.Re)(ai,e,a.vec3),ai[0]=Math.abs(ai[0]),ai[1]=Math.abs(ai[1]),ai[2]=Math.abs(ai[2]),Math.max(...ai)<t)return a}return t}return a||(a=k(r*i,n*i,s*i,o),this._origins.set(o,a)),a}needsOriginUpdate(e,t,i){const r=(0,y.Io)(e.vec3,t),n=Math.max(1,i/this._baselineObjectSize);return r>this._baselineDistance*n}_drawOriginBox(e,t=(0,He.fA)(1,1,0,1)){const i=window.view,r=i.stage,s=t.toString();if(!this._objects.has(s)){this._material=new Rt({width:2,color:t},!1);const e=new nt(r,{pickable:!1}),i=new ke({castShadow:!1});e.add(i),this._objects.set(s,i)}const o=this._objects.get(s),a=[0,1,5,4,0,2,1,7,6,2,0,1,3,7,5,4,6,2,0],l=a.length,c=new Array(3*l),u=new Array,h=.5*this._gridSize;for(let t=0;t<l;t++)c[3*t]=e[0]+(1&a[t]?h:-h),c[3*t+1]=e[1]+(2&a[t]?h:-h),c[3*t+2]=e[2]+(4&a[t]?h:-h),t>0&&u.push(t-1,t);(0,n.projectBuffer)(c,this._originSR,0,c,i.renderSpatialReference,0,l);const d=new We.V(this._material,[["position",new Ve.n(c,u,3,!0)]],null,2);o.addGeometry(d)}get test(){}}const ai=(0,l.vt)(),li=2**-23,ci=.05;var ui,hi=i(44794),di=i(48163),pi=i(24770),fi=i(79258),gi=i(25482),mi=i(93223);let vi=ui=class extends gi.o{constructor(e){super(e),this.type="cloudy",this.cloudCover=.5,this.fogOpacity=0}clone(){return new ui({cloudCover:this.cloudCover})}};(0,I.Cg)([(0,mi.e)({cloudy:"cloudy"}),(0,j.MZ)({json:{write:{isRequired:!0}}})],vi.prototype,"type",void 0),(0,I.Cg)([(0,j.MZ)({type:Number,nonNullable:!0,range:{min:0,max:1},json:{write:!0}})],vi.prototype,"cloudCover",void 0),vi=ui=(0,I.Cg)([(0,j.$K)("esri.views.3d.environment.CloudyWeather")],vi);const xi=vi;var yi;let _i=class extends gi.o{static{yi=this}constructor(e){super(e),this.type="foggy",this.fogStrength=.5}clone(){return new yi({fogStrength:this.fogStrength})}get fogOpacity(){return(0,v.Cc)(yi.minFogOpacity,yi.maxFogOpacity,this.fogStrength**3)}static{this.minFogOpacity=3e-5}static{this.maxFogOpacity=.005}};(0,I.Cg)([(0,mi.e)({foggy:"foggy"}),(0,j.MZ)({json:{write:{isRequired:!0}}})],_i.prototype,"type",void 0),(0,I.Cg)([(0,j.MZ)({type:Number,nonNullable:!0,range:{min:0,max:1},json:{write:!0}})],_i.prototype,"fogStrength",void 0),_i=yi=(0,I.Cg)([(0,j.$K)("esri.views.3d.environment.FoggyWeather")],_i);const bi=_i;var Si;let wi=class extends gi.o{static{Si=this}constructor(e){super(e),this.type="rainy",this.cloudCover=.5,this.precipitation=.5}clone(){return new Si({cloudCover:this.cloudCover,precipitation:this.precipitation})}get fogOpacity(){return(0,v.Cc)(Si.minFogOpacity,Si.maxFogOpacity,this.precipitation**3)}static{this.minFogOpacity=4e-6}static{this.maxFogOpacity=2e-4}};(0,I.Cg)([(0,mi.e)({rainy:"rainy"}),(0,j.MZ)({json:{write:{isRequired:!0}}})],wi.prototype,"type",void 0),(0,I.Cg)([(0,j.MZ)({type:Number,nonNullable:!0,range:{min:0,max:1},json:{write:!0}})],wi.prototype,"cloudCover",void 0),(0,I.Cg)([(0,j.MZ)({type:Number,nonNullable:!0,range:{min:0,max:1},json:{write:!0}})],wi.prototype,"precipitation",void 0),wi=Si=(0,I.Cg)([(0,j.$K)("esri.views.3d.environment.RainyWeather")],wi);const Ci=wi;var Ti;let Ai=Ti=class extends gi.o{constructor(e){super(e),this.type="snowy",this.cloudCover=.5,this.precipitation=.5,this.snowCover="disabled"}clone(){return new Ti({cloudCover:this.cloudCover,precipitation:this.precipitation,snowCover:this.snowCover})}get fogOpacity(){return(0,v.Cc)(Ci.minFogOpacity,Ci.maxFogOpacity,this.precipitation**3)}};(0,I.Cg)([(0,mi.e)({snowy:"snowy"}),(0,j.MZ)({json:{write:{isRequired:!0}}})],Ai.prototype,"type",void 0),(0,I.Cg)([(0,j.MZ)({type:Number,nonNullable:!0,range:{min:0,max:1},json:{write:!0}})],Ai.prototype,"cloudCover",void 0),(0,I.Cg)([(0,j.MZ)({type:Number,nonNullable:!0,range:{min:0,max:1},json:{write:!0}})],Ai.prototype,"precipitation",void 0),(0,I.Cg)([(0,j.MZ)({type:["enabled","disabled"],nonNullable:!0,json:{write:!0}})],Ai.prototype,"snowCover",void 0),Ai=Ti=(0,I.Cg)([(0,j.$K)("esri.views.3d.environment.SnowyWeather")],Ai);const Ei=Ai;var Ri;let Oi=Ri=class extends gi.o{constructor(e){super(e),this.type="sunny",this.cloudCover=.5,this.fogOpacity=0}clone(){return new Ri({cloudCover:this.cloudCover})}};(0,I.Cg)([(0,mi.e)({sunny:"sunny"}),(0,j.MZ)({json:{write:{isRequired:!0}}})],Oi.prototype,"type",void 0),(0,I.Cg)([(0,j.MZ)({type:Number,nonNullable:!0,range:{min:0,max:1},json:{write:!0}})],Oi.prototype,"cloudCover",void 0),Oi=Ri=(0,I.Cg)([(0,j.$K)("esri.views.3d.environment.SunnyWeather")],Oi);const Mi={key:"type",base:Oi,typeMap:{sunny:Oi,cloudy:xi,rainy:Ci,snowy:Ei,foggy:bi}};Object.keys(Mi.typeMap);class Li{constructor(){this.startTime=0,this._data=(0,hi.v)(null),this.coverage=0,this.absorption=0,this._readChannels=0,this.parallax=new Pi,this.parallaxNew=new Pi,this._anchorPoint=(0,l.vt)(),this._fadeState=(0,hi.v)(0),this._fadeFactor=(0,hi.v)(1)}get data(){return this._data.value}set data(e){this._data.value=e}get readChannels(){return this._readChannels}get fadeState(){return this._fadeState.value}get fadeFactor(){return this._fadeFactor.value}get opacity(){switch(this.fadeState){case 0:return 0;case 4:return 1-this.fadeFactor;case 1:return this.fadeFactor;case 2:case 3:return 1}}fade(e,t,i){this.isFading&&this.fadeFactor<1&&(this._fadeFactor.value=i?(0,v.qE)((t-this.startTime)/(Ni*i),0,1):1,1===this.fadeFactor&&this._endFade()),this._evaluateState(e,t),this._updateParallax(e)}_evaluateState(e,t){const i=e.relativeElevation,r=this._updateAnchorPoint(e);(Math.abs(i)>17e3||r>Hi)&&this.opacity>0?this._startFade(0,t):this.isFading||(Math.abs(i)>1e4||r>zi*Hi?this.opacity>0&&this._startFade(4,t):function(e){return null!=e&&!e.readyToRun}(this.data)&&(0===this.opacity?this._startFade(1,t):2===this.data.state&&(2===this.fadeState?this._startFade(3,t):this._startFade(2,t))))}_updateParallax(e){const t=(0,y.m3)(e.eye);this.parallax.radiusCurvatureCorrection=.84*Math.sqrt(Math.max(t-fi.$O.radius*fi.$O.radius,0))/Math.sqrt(t),(0,pi.Cr)(Ii,this.parallax.anchorPoint,Di),(0,o.e$)(this.parallax.transform,a.zK,Di[3],(0,pi.yo)(Di)),(0,pi.Cr)(Ii,this.parallaxNew.anchorPoint,Di),(0,o.e$)(this.parallaxNew.transform,a.zK,Di[3],(0,pi.yo)(Di))}_updateAnchorPoint(e){return(0,y.S8)(this._anchorPoint,e.eye),(0,y.hs)(this._anchorPoint,this._anchorPoint,fi.$O.radius),0===this.fadeState&&2===this.data?.state?((0,y.C)(this.parallax.anchorPoint,this._anchorPoint),0):(0,y.Bw)((0,y.Re)(Fi,this.parallax.anchorPoint,this._anchorPoint))}requestFade(){this._fadeFactor.value=0}_startFade(e,t){switch(this._fadeState.value=e,this.startTime=t,e){case 3:this.requestFade(),this._switchReadChannels(),(0,y.C)(this.parallaxNew.anchorPoint,this._anchorPoint);break;case 1:this.requestFade(),this._switchReadChannels(),(0,y.C)(this.parallax.anchorPoint,this._anchorPoint),(0,y.C)(this.parallaxNew.anchorPoint,this._anchorPoint);break;case 4:this.requestFade();break;case 2:this._switchReadChannels(),(0,y.C)(this.parallax.anchorPoint,this._anchorPoint),(0,y.C)(this.parallaxNew.anchorPoint,this._anchorPoint),this._endFade();break;case 0:this._endFade()}}_endFade(){switch(this._fadeFactor.value=1,this.data&&2!==this.data.state&&(this.data.state=0),this.fadeState){case 3:(0,y.C)(this.parallax.anchorPoint,this.parallaxNew.anchorPoint),this._fadeState.value=2;break;case 1:this._fadeState.value=2;break;case 4:this._fadeState.value=0;break;case 2:case 0:break;default:this.fadeState}}_switchReadChannels(){2===this.data?.state&&(this._readChannels=1-this._readChannels,this.data.state=3)}get isFading(){return 4===this.fadeState||1===this.fadeState||3===this.fadeState}}class Pi{constructor(){this.anchorPoint=(0,l.vt)(),this.radiusCurvatureCorrection=0,this.transform=(0,a.vt)()}}const Ii=(0,l.fA)(0,0,1),Di=(0,pi.vt)(),Fi=(0,l.vt)(),Ni=1.25,zi=.5,Hi=2e5;class Vi{constructor(){this.lastFrameCamera=new J.A,this.matrix=(0,a.vt)(),this.viewMatrix=(0,a.vt)()}}class Wi{constructor(){this.enabled=!1,this.fadeFactor=1}}var ji=i(57226);class Ui{constructor(e,t){this._rctx=e,this.shadowMap=t,this._output=0,this.slot=2,this.slicePlane=null,this.hasOccludees=!1,this.emissions=0,this.transparentWithoutDepthEmissionDimmingPass=!1,this.useFloatBlend=(0,hi.v)(!0),this.enableFillLights=!0,this.alignPixelEnabled=!1,this.decorations=!0,this.overlayStretch=1,this.viewshedEnabled=!1,this.cutFillComputationEnabled=!1,this.cutFillVisualizationEnabled=!1,this._camera=new J.A,this._inverseViewport=(0,di.vt)(),this._oldLighting=new ji.TA,this._newLighting=new ji.TA,this._fadedLighting=new ji.TA,this._lighting=this._newLighting,this.screenSpaceReflections=new Wi,this.reprojection=new Vi,this.highlights=new Array,this.highlightMixOrigin=(0,di.vt)(),this.highlightMixTexture=null,this.globalIlluminationEnabled=!1,this.hudRenderStyle=0,this.snowCover=0,this.clouds=new Li,this.hasShadowHighlights=!1}destroy(){this._camera=this.contentCamera=null,this.mainDepth=this.overlay=this.ssao=this.shadowHighlight=null,this.depth=(0,z.Gz)(this.depth),this.shadowMap?.dispose()}get output(){return this._output}set output(e){this._output!==e&&(this._output=e,this._rctx.resetDrawBuffers(e))}get hasEmission(){switch(this.output){case 0:return this.hasOpaqueEmission;case 1:case 2:return this.hasTransparentEmission;default:return!1}}get hasOpaqueEmission(){return 1===this.emissions||3===this.emissions}get hasTransparentEmission(){return 2===this.emissions||3===this.emissions}get camera(){return this._camera}set camera(e){this._camera=e,this._inverseViewport[0]=1/e.fullViewport[2],this._inverseViewport[1]=1/e.fullViewport[3]}get enableOITOffset(){return this.camera.relativeElevation<5e5}get inverseViewport(){return this._inverseViewport}get lighting(){return this._lighting}fadeLighting(){switch(this.clouds.fadeFactor){case 0:this._lighting=this._oldLighting;break;default:this._fadedLighting.lerpLighting(this._oldLighting,this._newLighting,this.clouds.fadeFactor),this._lighting=this._fadedLighting;break;case 1:this._lighting=this._newLighting,this._oldLighting.copyFrom(this._newLighting)}}updateLighting(e,t,i,r){this._oldLighting.copyFrom(this.lighting),this._newLighting.noonFactor=t,this._newLighting.globalFactor=i,this._newLighting.set(e),this._oldLighting.updateLegacy(),1===r&&this.clouds.requestFade(),this.fadeLighting()}get hasScreenSpaceReflections(){return(0,ut._o)(this.output)&&this.screenSpaceReflections.enabled&&null!=this.reprojection.lastFrameColor}get highlight(){return null==this.highlightLevel?null:this.highlights[this.highlightLevel]}get depth(){return this._depth}set depth(e){e&&(e.name="geometry depth"),this._depth=e}get occluder(){return 10===this.slot||11===this.slot?this.slot:null}}class Bi{constructor(e,t,i){this.rctx=e,this.techniques=i,this.renderOccludedMask=$i,this.time=(0,ot.l5)(0),this.bind=new Ui(e,t),this.bind.alignPixelEnabled=!0}destroy(){this.bind.destroy()}get output(){return this.bind.output}}const $i=13;var Zi=i(29242);let ki=class extends J.A{constructor(){super(...arguments),this._projectionMatrix=(0,a.vt)()}get projectionMatrix(){return this._projectionMatrix}};(0,I.Cg)([(0,j.MZ)()],ki.prototype,"_projectionMatrix",void 0),(0,I.Cg)([(0,j.MZ)({readOnly:!0})],ki.prototype,"projectionMatrix",null),ki=(0,I.Cg)([(0,j.$K)("esri.views.3d.webgl-engine.lib.CascadeCamera")],ki);var Gi=i(78988);class qi{constructor(){this.camera=new ki,this.lightMat=(0,a.vt)()}}class Yi{constructor(){this.maxNumCascadesHighQuality=4,this.maxNumCascadesLowQuality=4,this.textureSizeModHighQuality=1.3,this.textureSizeModLowQuality=.9,this.splitSchemeLambda=0}}class Qi{constructor(e,t){this._fbos=e,this._viewingMode=t,this._enabled=!1,this._outputs=new Array,this._textureHeight=0,this._numCascades=1,this.settings=new Yi,this._projectionView=(0,a.vt)(),this._projectionViewInverse=(0,a.vt)(),this._modelViewLight=(0,a.vt)(),this._cascadeDistances=[0,0,0,0,0],this._usedCascadeDistances=(0,He.vt)(),this._cascades=[new qi,new qi,new qi,new qi],this._lastOrigin=null,this._maxTextureWidth=Math.min((0,c.A)("esri-mobile")?4096:16384,e.rctx.parameters.maxTextureSize)}dispose(){this.enabled=!1}disposeOutputs(){this._handle=(0,z.Gz)(this._handle),this._outputs.forEach(e=>e?.release()),this._outputs.length=0}disposeOutput(e){this._outputs[e]=(0,z.Gz)(this._outputs[e])}set maxCascades(e){this.settings.maxNumCascadesHighQuality=(0,v.qE)(Math.floor(e),1,4)}get maxCascades(){return this.settings.maxNumCascadesHighQuality}set enabled(e){this._enabled=e,e||this.disposeOutputs()}get enabled(){return this._enabled}get ready(){return!!this.getOutput(5)||!!this.getOutput(7)}get renderTarget(){return this._handle}get cascades(){for(let e=0;e<this._numCascades;++e)or[e]=this._cascades[e];return or.length=this._numCascades,or}start(e,t,i,r,n){(0,De.vA)(this.enabled);const{near:s,far:o}=function(e){let{near:t,far:i}=e;return t<2&&(t=2),i<2&&(i=2),t>=i&&(t=2,i=4),{near:t,far:i}}(i);this._computeCascadeDistances(s,o,r),this._textureHeight=this._computeTextureHeight(e,n,r),this._setupMatrices(e,t);for(let i=0;i<this._numCascades;++i)this._constructCascade(i,e,t);this._lastOrigin=null,this.clear()}getShadowMapMatrices(e){if(!this._lastOrigin||!(0,y.t2)(e,this._lastOrigin)){this._lastOrigin=this._lastOrigin||(0,l.vt)(),(0,y.C)(this._lastOrigin,e);for(let t=0;t<this._numCascades;++t){(0,o.Tl)(ar,this._cascades[t].lightMat,e);for(let e=0;e<16;++e)lr[16*t+e]=ar[e]}}return lr}finish(e){(0,De.vA)(this.enabled),this._outputs[e]?.release(),this._outputs[e]=this._handle,this._handle?.setName(6===e?"shadow map highlight":"shadow map excluding highlight"),this._handle=null}getOutput(e){return this.enabled?this._outputs[e]?.getTexture(Ce.nI):null}clear(){this._ensureFbo(),this.bindFramebuffer(),this._fbos.rctx.clear(256)}_computeTextureHeight({pixelRatio:e,fullWidth:t,fullHeight:i},r,n){const s=Math.min(window.devicePixelRatio,r)/e,o=n?this.settings.textureSizeModHighQuality:this.settings.textureSizeModLowQuality;return(0,Gi.Mv)(Math.max(t,i)*s*o,this._maxTextureWidth/this._numCascades)}_ensureFbo(){this._handle?.fbo?.width===this._textureWidth&&this._handle?.fbo.height===this._textureHeight||(this._handle?.release(),this._handle=this._fbos.acquire(this._textureWidth,this._textureHeight,"shadow map",13),this._handle.getTexture(Ce.nI)?.setShadowFiltering(!0))}bindFramebuffer(){this._fbos.rctx.bindFramebuffer(this._handle?.fbo)}_constructCascade(e,t,i){const{viewMatrix:r,projectionMatrix:n,relativeElevation:s}=t,a=this._cascades[e],l=-this._cascadeDistances[e],c=-this._cascadeDistances[e+1],u=(n[10]*l+n[14])/Math.abs(n[11]*l+n[15]),h=(n[10]*c+n[14])/Math.abs(n[11]*c+n[15]);(0,De.vA)(u<h);for(let e=0;e<8;++e){(0,B.hZ)(Ki,e%4==0||e%4==3?-1:1,e%4==0||e%4==1?-1:1,e<4?u:h,1);const t=Ji[e];(0,B.Z0)(t,Ki,this._projectionViewInverse),t[0]/=t[3],t[1]/=t[3],t[2]/=t[3]}(0,y.ze)(sr,Ji[0]),a.camera.viewMatrix=(0,o.Tl)(Xi,this._modelViewLight,sr);for(let e=0;e<8;++e)(0,y.Z0)(Ji[e],Ji[e],a.camera.viewMatrix);let d=Ji[0][2],p=Ji[0][2];for(let e=1;e<8;++e)d=Math.min(d,Ji[e][2]),p=Math.max(p,Ji[e][2]);d-=200,p+=200,a.camera.near=-p,a.camera.far=-d,a.camera.relativeElevation=s,function(e,t,i,r,n){const s=1/Ji[0][3],o=1/Ji[4][3];(0,De.vA)(s<o);let a=s+Math.sqrt(s*o);const l=Math.sin((0,v.XM)(e[2]*t[0]+e[6]*t[1]+e[10]*t[2]));a/=l,function(e,t,i,r,n,s,o,a){(0,re.hZ)(cr,0,0);for(let t=0;t<4;++t)(0,re.WQ)(cr,cr,e[t]);(0,re.hs)(cr,cr,.25),(0,re.hZ)(ur,0,0);for(let t=4;t<8;++t)(0,re.WQ)(ur,ur,e[t]);(0,re.hs)(ur,ur,.25),(0,re.Cc)(hr[0],e[4],e[5],.5),(0,re.Cc)(hr[1],e[5],e[6],.5),(0,re.Cc)(hr[2],e[6],e[7],.5),(0,re.Cc)(hr[3],e[7],e[4],.5);let l=0,c=(0,re.hG)(hr[0],cr);for(let e=1;e<4;++e){const t=(0,re.hG)(hr[e],cr);t<c&&(c=t,l=e)}(0,re.Re)(dr,hr[l],e[l+4]);const u=dr[0];let h,d;dr[0]=-dr[1],dr[1]=u,(0,re.Re)(pr,ur,cr),(0,re.Om)(pr,dr)<0&&(0,re.ze)(dr,dr),(0,re.Cc)(dr,dr,pr,i),(0,re.S8)(dr,dr),h=d=(0,re.Om)((0,re.Re)(fr,e[0],cr),dr);for(let t=1;t<8;++t){const i=(0,re.Om)((0,re.Re)(fr,e[t],cr),dr);i<h?h=i:i>d&&(d=i)}(0,re.C)(r,cr),(0,re.hs)(fr,dr,h-t),(0,re.WQ)(r,r,fr);let p=-1,f=1,g=0,m=0;for(let t=0;t<8;++t){(0,re.Re)(gr,e[t],r),(0,re.S8)(gr,gr);const i=dr[0]*gr[1]-dr[1]*gr[0];i>0?i>p&&(p=i,g=t):i<f&&(f=i,m=t)}(0,De.MX)(p>0,"leftArea"),(0,De.MX)(f<0,"rightArea"),(0,re.hs)(mr,dr,h),(0,re.WQ)(mr,mr,cr),(0,re.hs)(vr,dr,d),(0,re.WQ)(vr,vr,cr),xr[0]=-dr[1],xr[1]=dr[0];const v=(0,De.L)(r,e[m],vr,(0,re.WQ)(fr,vr,xr),1,n),x=(0,De.L)(r,e[g],vr,fr,1,s),y=(0,De.L)(r,e[g],mr,(0,re.WQ)(fr,mr,xr),1,o),_=(0,De.L)(r,e[m],mr,fr,1,a);(0,De.MX)(v,"rayRay"),(0,De.MX)(x,"rayRay"),(0,De.MX)(y,"rayRay"),(0,De.MX)(_,"rayRay")}(Ji,a,l,er,tr,ir,rr,nr),function(e,t,i,r,n){(0,re.Re)(Sr,i,r),(0,re.hs)(Sr,Sr,.5),wr[0]=Sr[0],wr[1]=Sr[1],wr[2]=0,wr[3]=Sr[1],wr[4]=-Sr[0],wr[5]=0,wr[6]=Sr[0]*Sr[0]+Sr[1]*Sr[1],wr[7]=Sr[0]*Sr[1]-Sr[1]*Sr[0],wr[8]=1,wr[yr(0,2)]=-(0,re.Om)(br(wr,0),e),wr[yr(1,2)]=-(0,re.Om)(br(wr,1),e);let s=(0,re.Om)(br(wr,0),i)+wr[yr(0,2)],o=(0,re.Om)(br(wr,1),i)+wr[yr(1,2)],a=(0,re.Om)(br(wr,0),r)+wr[yr(0,2)],l=(0,re.Om)(br(wr,1),r)+wr[yr(1,2)];s=-(s+a)/(o+l),wr[yr(0,0)]+=wr[yr(1,0)]*s,wr[yr(0,1)]+=wr[yr(1,1)]*s,wr[yr(0,2)]+=wr[yr(1,2)]*s,s=1/((0,re.Om)(br(wr,0),i)+wr[yr(0,2)]),o=1/((0,re.Om)(br(wr,1),i)+wr[yr(1,2)]),wr[yr(0,0)]*=s,wr[yr(0,1)]*=s,wr[yr(0,2)]*=s,wr[yr(1,0)]*=o,wr[yr(1,1)]*=o,wr[yr(1,2)]*=o,wr[yr(2,0)]=wr[yr(1,0)],wr[yr(2,1)]=wr[yr(1,1)],wr[yr(2,2)]=wr[yr(1,2)],wr[yr(1,2)]+=1,s=(0,re.Om)(br(wr,1),t)+wr[yr(1,2)],o=(0,re.Om)(br(wr,2),t)+wr[yr(2,2)],a=(0,re.Om)(br(wr,1),i)+wr[yr(1,2)],l=(0,re.Om)(br(wr,2),i)+wr[yr(2,2)],s=-.5*(s/o+a/l),wr[yr(1,0)]+=wr[yr(2,0)]*s,wr[yr(1,1)]+=wr[yr(2,1)]*s,wr[yr(1,2)]+=wr[yr(2,2)]*s,s=(0,re.Om)(br(wr,1),t)+wr[yr(1,2)],o=(0,re.Om)(br(wr,2),t)+wr[yr(2,2)],a=-o/s,wr[yr(1,0)]*=a,wr[yr(1,1)]*=a,wr[yr(1,2)]*=a,n[0]=wr[0],n[1]=wr[1],n[2]=0,n[3]=wr[2],n[4]=wr[3],n[5]=wr[4],n[6]=0,n[7]=wr[5],n[8]=0,n[9]=0,n[10]=1,n[11]=0,n[12]=wr[6],n[13]=wr[7],n[14]=0,n[15]=wr[8]}(er,tr,rr,nr,n.projectionMatrix),n.projectionMatrix[10]=2/(i-r),n.projectionMatrix[14]=-(i+r)/(i-r)}(r,i,d,p,a.camera),(0,o.lw)(a.lightMat,a.camera.projectionMatrix,a.camera.viewMatrix);const f=this._textureHeight;a.camera.viewport=[e*f,0,f,f]}_setupMatrices(e,t){(0,o.lw)(this._projectionView,e.projectionMatrix,e.viewMatrix),(0,o.B8)(this._projectionViewInverse,this._projectionView);const i=1===this._viewingMode?e.eye:(0,y.hZ)(sr,0,0,1);(0,o.t5)(this._modelViewLight,[0,0,0],[-t[0],-t[1],-t[2]],i)}_computeCascadeDistances(e,t,i){const r=i?this.settings.maxNumCascadesHighQuality:this.settings.maxNumCascadesLowQuality;this._numCascades=Math.min(1+Math.floor((0,De.kL)(t/e,4)),r);const n=(t-e)/this._numCascades,s=(t/e)**(1/this._numCascades);let o=e,a=e;for(let e=0;e<this._numCascades+1;++e)this._cascadeDistances[e]=(0,v.Cc)(o,a,this.settings.splitSchemeLambda),o*=s,a+=n}get _textureWidth(){return this._textureHeight*this._numCascades}get numCascades(){return this._numCascades}get cascadeDistances(){return(0,B.hZ)(this._usedCascadeDistances,this._cascadeDistances[0],this._numCascades>1?this._cascadeDistances[1]:1/0,this._numCascades>2?this._cascadeDistances[2]:1/0,this._numCascades>3?this._cascadeDistances[3]:1/0)}get test(){}}const Xi=(0,a.vt)(),Ki=(0,He.vt)(),Ji=[];for(let e=0;e<8;++e)Ji.push((0,He.vt)());const er=(0,di.vt)(),tr=(0,di.vt)(),ir=(0,di.vt)(),rr=(0,di.vt)(),nr=(0,di.vt)(),sr=(0,l.vt)(),or=[],ar=(0,a.vt)(),lr=a.zK.concat(a.zK,a.zK,a.zK),cr=(0,di.vt)(),ur=(0,di.vt)(),hr=[(0,di.vt)(),(0,di.vt)(),(0,di.vt)(),(0,di.vt)()],dr=(0,di.vt)(),pr=(0,di.vt)(),fr=(0,di.vt)(),gr=(0,di.vt)(),mr=(0,di.vt)(),vr=(0,di.vt)(),xr=(0,di.vt)();function yr(e,t){return 3*t+e}const _r=(0,di.vt)();function br(e,t){return(0,re.hZ)(_r,e[t],e[t+3]),_r}const Sr=(0,di.vt)(),wr=(0,Zi.vt)();var Cr=i(92942);let Tr=class extends ae.w{constructor(){super(...arguments),this.shader=new oe.r(Cr.a,()=>i.e(959).then(i.bind(i,959)))}initializePipeline(e){return e.hasAlpha?(0,ue.Ey)({blending:ue.T8,colorWrite:ue.kn}):(0,ue.Ey)({colorWrite:ue.kn})}};Tr=(0,I.Cg)([(0,j.$K)("esri.views.3d.webgl-engine.lib.TextureTechnique")],Tr);class Ar extends Ct.K{constructor(){super(...arguments),this.hasAlpha=!1}}(0,I.Cg)([(0,Ct.W)()],Ar.prototype,"hasAlpha",void 0);var Er=i(75497),Rr=i(80583);let Or=class extends ae.w{constructor(){super(...arguments),this.shader=new oe.r(Rr.a,()=>i.e(4849).then(i.bind(i,64849))),this.ignoreUnused=!0}};Or=(0,I.Cg)([(0,j.$K)("esri.views.3d.webgl-engine.shaders.OverlayCompositingTechnique")],Or);var Mr=i(92359);let Lr=class extends ie{constructor(e){super(e),this._overlays=null,this._renderTargets=null,this._overlayParameters=new Rr.O,this.hasHighlights=!1,this.renderOccludedFlags=1,this._hasWater=!1,this._renderers=new Map,this._sortedDrapeSourceRenderersDirty=!1,this._sortedRenderers=new H.A,this._passParameters=new Cr.T,this._screenToWorldRatio=1,this._localOriginFactory=null,this.unloadedMemory=0,this.ignoresMemoryFactor=!1,this._camera=new J.A,this.events=new F.bk,this.longitudeCyclical=null,this.produces=new Map([[18,e=>10!==e||this.hasHighlights],[19,()=>this._hasWater]]),this._hasTargetWithoutRasterImage=!1,this._hasDrapedFeatureSource=!1,this._hasDrapedRasterSource=!1,this._hasDrapedFlowSource=!1;const{state:t,stage:i}=e.parent.view,r=i.renderer.fboCache,n=i.renderView.renderingContext,s=i.renderView.techniques;this._renderContext=new Bi(n,new Qi(r,t.viewingMode),s)}initialize(){const e=this._view,t=e.stage.renderView.waterTextures;this.addHandles([(0,V.wB)(()=>t.updating,()=>this.events.emit("content-changed"),V.pc),(0,V.wB)(()=>this._spatialReference,e=>this._localOriginFactory=new oi(e),V.pc),(0,V.on)(()=>e.allLayerViews,"after-changes",()=>this._sortedDrapeSourceRenderersDirty=!0),(0,V.wB)(()=>function(e){let t=0;for(const i of e){const{name:e}=i;t+=e.length;const{color:r,fillOpacity:n,haloColor:s,haloOpacity:o}=i;t+=r.r+r.g+r.b+r.a+n,t+=s?s.r+s.g+s.b+s.a+o:0}const i=e.at(0);if(i){const{shadowOpacity:e,shadowDifference:r,shadowColor:n}=i;t+=e+r+n.r+n.g+n.b+n.a}return Me+++(t>=0?0:1)}(e.state.highlights),()=>this._sortedDrapeSourceRenderersDirty=!0,V.Vh),(0,V.wB)(()=>e.state.highlights,e=>{this._bindParameters.highlights=e},V.Vh),e.resourceController.scheduler.registerTask(Mr.W6.OVERLAY_RENDERER,this)]);const i=this._camera;i.near=1,i.far=1e4,i.relativeElevation=null,this._bindParameters.slot=18,this._bindParameters.camera=i,this._bindParameters.updateLighting(new Er.$p((0,l.S)()),0,0,0)}destroy(){this._renderers.forEach(e=>e.destroy()),this._renderers.clear(),this._passParameters.texture=(0,z.WD)(this._passParameters.texture),this.disposeOverlays(),this._renderContext.destroy(),this._sortedRenderers.prune()}get _bindParameters(){return this._renderContext.bind}get _rctx(){return this._stage.renderView.renderingContext}get _view(){return this.parent.view}get _stage(){return this.parent.view.stage}get _spatialReference(){return this.parent.spatialReference}get _techniques(){return this._stage.renderView.techniques}get rctx(){return this._rctx}get materials(){return this._pluginContext.materials}get screenToWorldRatio(){return this._screenToWorldRatio}get localOriginFactory(){return this._localOriginFactory}set time(e){this._renderContext.time=e}get pluginContext(){return this._pluginContext}initializeRenderContext(e){const t=new Fe(this._view.stage.renderView.textures,this._techniques,()=>{this._onMaterialOrContentChanged(),this.events.emit("content-changed"),this.notifyChange("updating"),this.notifyChange("isEmpty")},()=>this.events.emit("content-changed"));this._pluginContext={...e,materials:t},this._techniques.precompile(Or)}uninitializeRenderContext(){}acquireTechniques(){return[]}render(){}get updating(){return this._sortedDrapeSourceRenderersDirty||(0,N.Bs)(this._renderers,e=>e.updating||e.canCompact)}get hasOverlays(){return null!=this._overlays&&null!=this._renderTargets}getMaterialRenderer(e){for(const t of this._renderers.values()){const i=t.getMaterialRenderer(e);if(i)return i}return null}get layers(){return this._sortedDrapeSourceRenderersDirty&&this._updateSortedDrapeSourceRenderers(),(0,D.Am)(this._sortedRenderers.map(e=>e.drapeSource.layer).filter(e=>!!e))}registerDrapeSource(e,t){const i=this._renderers.get(e);null!=i&&i.destroy(),this._renderers.set(e,t),this._sortedDrapeSourceRenderersDirty=!0,"fullOpacity"in e&&this.addHandles((0,V.wB)(()=>e.fullOpacity,()=>this.events.emit("content-changed")),e)}removeDrapeSourceRenderer(e){if(null==e)return;const t=this._renderers.get(e);null!=t&&(this._sortedDrapeSourceRenderersDirty=!0,this._renderers.delete(e),this.removeHandles(e),t.destroy())}computeValidity(){return this._renderTargets?.computeValidity()??0}releaseRenderTargets(e){this._renderTargets?.dispose(e)}get overlays(){return this._overlays??[]}ensureDrapeTargets(e){this._hasTargetWithoutRasterImage=!!this._overlays&&(0,W.bw)(e,e=>1===e.drapeTargetType)}ensureDrapeSources(e){this._overlays?(this._hasDrapedFeatureSource=(0,W.bw)(e,e=>1===e.drapeSourceType),this._hasDrapedRasterSource=(0,W.bw)(e,e=>0===e.drapeSourceType),this._hasDrapedFlowSource=(0,W.bw)(e,e=>2===e.drapeSourceType)):this._hasDrapedFeatureSource=this._hasDrapedRasterSource=this._hasDrapedFlowSource=!1}get _needsColorWithoutRasterImage(){return this._hasDrapedRasterSource&&this._hasDrapedFeatureSource&&this._hasTargetWithoutRasterImage}ensureOverlays(e,t,i=this._bindParameters.overlayStretch){null==this._overlays&&(this._renderTargets=new K(this._stage.renderer.fboCache),this._overlays=[new G,new G]),this.ensureDrapeTargets(e),this.ensureDrapeSources(t),this._bindParameters.overlayStretch=i}disposeOverlays(){this._overlays=null,this._renderTargets?.dispose(1),this._renderTargets=null,this.events.emit("textures-disposed")}_useOverlayColorInsteadOfColorNoRasterImage(e){return 1===e&&!this._needsColorWithoutRasterImage&&this._hasDrapedFeatureSource}getTexture(e){const t=this._useOverlayColorInsteadOfColorNoRasterImage(e);return this._renderTargets?.getTexture(t?0:e)}get readyToRun(){return this.updating}runTask(e){this._processDrapeSources(()=>!0,e)}_onMaterialOrContentChanged(){this.renderOccludedFlags=(0,N.Bs)(this._renderers,e=>e.hasOccluders)?Dr:1}_processDrapeSources(e,t){let i=!1;for(const[r,n]of this._renderers){if(t?.done)break;(r.destroyed||e(r))&&n.commitChanges()&&(i=!0,t?.madeProgress())}this._sortedDrapeSourceRenderersDirty&&(this._sortedDrapeSourceRenderersDirty=!1,i=!0,this._updateSortedDrapeSourceRenderers(),t?.madeProgress()),t&&this.compact(t),i&&(null!=this._overlays&&0===this._renderers.size&&this.disposeOverlays(),this.notifyChange("updating"),this.notifyChange("isEmpty"),this._onMaterialOrContentChanged(),this.hasHighlights=(0,N.Bs)(this._renderers,e=>e.hasHighlights),this.events.emit("content-changed"))}compact(e){let t=!1;for(const i of this._renderers.values()){if(e.done)break;t=i.compact(e)||t}return t&&this.notifyChange("updating"),t}hasHighlight(e){return(0,N.Bs)(this._renderers,t=>t.hasHighlight(e))}processSyncDrapeSources(){this._processDrapeSources(e=>1===e.updatePolicy)}get isEmpty(){return!U.b.OVERLAY_DRAW_DEBUG_TEXTURE&&(0,N.mt)(this._renderers,e=>e.isEmpty)}get hasWater(){const e=(0,N.Bs)(this._renderers,({hasWater:e})=>e);return e!==this._hasWater&&(this._hasWater=e,this.events.emit("has-water")),this._hasWater}renders(e){if(U.b.OVERLAY_DRAW_DEBUG_TEXTURE&&4!==e&&2!==e)return!0;if(!this._overlays)return!1;const t=this._overlays[0];for(const e of this._overlays)e.setupGeometryViews(this.longitudeCyclical);if(!t.hasSomeSizedView())return!1;const i=this._setOutput(this._renderTargets?.targets.find(t=>t.content===e)?.output??0);++this._techniques.precompiling;const r=this._sortedRenderers.some(({renderer:e})=>e.precompile(this._renderContext));return--this._techniques.precompiling,this._setOutput(i),r}_setOutput(e){const t=this._bindParameters.output;return this._bindParameters.output=e,this._bindParameters.slot=4===e?19:18,t}get mode(){return this.isEmpty?0:this.hasWater&&this.renders(3)?2:this._renderTargets?.getTexture(0)?1:0}updateAnimation(e){let t=!1;return this._renderers.forEach(i=>t=i.updateAnimation(e)||t),t&&this.parent.requestRender(0),t}updateDrapeSourceOrder(){this._sortedDrapeSourceRenderersDirty=!0}precompileShaders(e){if(!this._overlays||!this._renderTargets)return!1;const t=this._bindParameters;t.alignPixelEnabled=e.alignPixelEnabled,++this._techniques.precompiling;for(const e of this._renderTargets.targets){if(1===e.content&&!this._needsColorWithoutRasterImage)continue;const{output:i}=e;this._setOutput(i),10===i&&(t.highlightMixTexture=t.highlights.length>1?this._rctx.emptyTexture:null);const r=this._renderContext.renderOccludedMask;4===e.content&&(this._renderContext.renderOccludedMask=Dr),this._sortedRenderers.forAll(({drapeSource:t,renderer:i})=>{1===e.content&&0===t.drapeSourceType||4===e.content&&i.hasOnlyOccluders||i.precompile(this._renderContext)}),this._renderContext.renderOccludedMask=r,t.highlightMixTexture=null}return--this._techniques.precompiling,!0}drawOverlays(e,t){if(!this._overlays||!this._renderTargets)return;for(const e of this._overlays)e.setupGeometryViews(this.longitudeCyclical);this._bindParameters.alignPixelEnabled=e.alignPixelEnabled;const i=this.allSourcesOccluders;for(const e of this._renderTargets.targets){if((0!==e.content||!this._hasDrapedFlowSource)&&!e.handleRenderRequest(t)||1===e.content&&!this._needsColorWithoutRasterImage||4===e.content&&i)continue;const r=this._drawTarget(0,e),n=this._drawTarget(1,e);(r||n)&&e.fbo.generateMipMap()}}_drawTarget(e,t){const i=this._overlays[e],r=i.canvasGeometries;if(0===r.numViews)return!1;const n=this._view.state.contentPixelRatio;this._screenToWorldRatio=n*i.mapUnitsPerPixel/this._bindParameters.overlayStretch;const{output:s,content:o}=t;if(this.isEmpty||4===s&&!this.hasWater||!i.hasSomeSizedView())return!1;const{_rctx:a,_camera:l,_renderContext:c,_bindParameters:u}=this;if(l.pixelRatio=i.pixelRatio*n,this._setOutput(s),u.screenToWorldRatio=this._screenToWorldRatio,u.screenToPCSRatio=this._screenToWorldRatio*this.parent.worldToPCSRatio,4===o&&(c.renderOccludedMask=Dr),!this.renders(o))return c.renderOccludedMask=$i,!1;const{resolution:h}=i,d=0===e,p=d?0:h;if(a.setViewport(p,0,h,h),this._bindTargetFBO(t),d&&(10===s?a.gl.clearBufferuiv(a.gl.COLOR,0,[0,0,0,0]):(a.setClearColor(0,0,0,0),a.clear(16384))),U.b.OVERLAY_DRAW_DEBUG_TEXTURE&&4!==o&&2!==o){this._techniques.precompile(Tr,Fr);const t=this._techniques.get(Tr,Fr);for(let n=0;n<r.numViews;n++)this._setViewParameters(r.extents[n],i),this._ensureDebugPatternResources(i.resolution,Ir[e]),a.bindTechnique(t,u,this._passParameters),a.screen.draw()}if(10===s){const{fboCache:i}=this._stage.renderer,r=this._resolution;this._bindTargetFBO(t),function(e,t,i,r,n,s,o=0){const{highlights:a}=n,l=a.length>1?t.acquire(i,r,"highlight mix",a.length>Pe?3:1):null,{gl:c}=e;if(l){const t=e.boundFramebuffer;e.bindFramebuffer(l.fbo),c.clearBufferuiv(c.COLOR,0,[0,0,0,0]),e.bindFramebuffer(t)}const u=l?.getTexture();n.highlightMixTexture=u,(0,re.hZ)(n.highlightMixOrigin,o,0),a.forEach((t,a)=>{if(a>0){const t=Te.A.TEXTURE_UNIT_FOR_UPDATES;e.bindTexture(u,t),e.setActiveTexture(t),c.copyTexSubImage2D(3553,0,0,0,o,0,i,r),e.bindTexture(null,t)}e.clear(256),n.highlightLevel=a,s()}),n.highlightLevel=null,n.highlightMixTexture=null,l?.release()}(a,i,r,r,u,()=>this._renderAllGeometry(e,t),p)}else this._renderAllGeometry(e,t);return a.bindFramebuffer(null),c.renderOccludedMask=$i,!0}get allSourcesOccluders(){return(0,N.mt)(this._renderers,e=>e.hasOnlyOccluders)}_renderAllGeometry(e,t){const i=this._overlays[e],r=i.canvasGeometries;this._sortedRenderers.forAll(({drapeSource:n,renderer:s})=>{if(1===t.content&&0===n.drapeSourceType)return;const{fullOpacity:o}=n,a=null!=o&&o<1&&0===t.output&&this._bindTemporaryFBO();for(let e=0;e<r.numViews;e++)this._setViewParameters(r.extents[e],i),s.render(this._renderContext);if(a){this._bindTargetFBO(t),this._overlayParameters.texture=a.getTexture(),this._overlayParameters.opacity=o,this._overlayParameters.overlayIndex=e;const i=this._techniques.get(Or);this._rctx.bindTechnique(i,this._bindParameters,this._overlayParameters),this._rctx.screen.draw(),a.release()}})}_bindTargetFBO(e){const t=this._resolution,i=2*t;e.fbo.ensureFramebuffer(i,t),e.fbo.bind(this._rctx)}_bindTemporaryFBO(){const e=this._resolution,t=2*e,i=this._stage.renderer.fboCache,r=i.acquire(t,e,"overlay tmp");return i.rctx.bindFramebuffer(r.fbo),i.rctx.clear(16384),r}get _resolution(){return this._overlays?.[0].resolution??0}notifyContentChanged(){this.events.emit("content-changed")}intersectRay(e,t,i,r){this._sortedDrapeSourceRenderersDirty&&this._updateSortedDrapeSourceRenderers();let n=0;for(const{renderer:s}of this._sortedRenderers)n=s.intersect?.(e,t,i,r,n)??n}_updateSortedDrapeSourceRenderers(){if(this._sortedRenderers.clear(),0===this._renderers.size)return;const e=this._view.map.allLayers.map(e=>e.uid),t=e.length;this._renderers.forEach((i,r)=>{const n=e.indexOf(r.layer?.uid),s=n>=0,o=r.renderGroup??(s?0:1),a=r.drapeSourcePriorityOffset??0,l=t*o+(s?n:0)+a;this._sortedRenderers.push(new Pr(r,i,l))}),this._sortedRenderers.sort((e,t)=>e.index-t.index)}_setViewParameters(e,t){const i=this._camera;i.viewport=[0,0,t.resolution,t.resolution],(0,o.v3)(i.projectionMatrix,0,e[2]-e[0],0,e[3]-e[1],i.near,i.far),(0,o.kN)(i.viewMatrix,[-e[0],-e[1],0])}_ensureDebugPatternResources(e,t){if((0,y.hZ)(this._passParameters.color,t[0],t[1],t[2]),this._passParameters.texture)return;const i=new Uint8Array(e*e*4);let r=0;for(let t=0;t<e;t++)for(let n=0;n<e;n++){const s=Math.floor(n/10),o=Math.floor(t/10);s<2||o<2||10*s>e-20||10*o>e-20?(i[r++]=255,i[r++]=255,i[r++]=255,i[r++]=255):(i[r++]=255,i[r++]=255,i[r++]=255,i[r++]=1&s&&1&o?1&n^1&t?0:255:1&s^1&o?0:128)}const n=new Ae.R(e);n.samplingMode=9728,this._passParameters.texture=new Te.A(this._rctx,n,i)}get test(){}};(0,I.Cg)([(0,j.MZ)()],Lr.prototype,"hasHighlights",void 0),(0,I.Cg)([(0,j.MZ)()],Lr.prototype,"renderOccludedFlags",void 0),(0,I.Cg)([(0,j.MZ)()],Lr.prototype,"_sortedDrapeSourceRenderersDirty",void 0),(0,I.Cg)([(0,j.MZ)({constructOnly:!0})],Lr.prototype,"parent",void 0),(0,I.Cg)([(0,j.MZ)({readOnly:!0})],Lr.prototype,"_techniques",null),(0,I.Cg)([(0,j.MZ)({type:Boolean,readOnly:!0})],Lr.prototype,"updating",null),(0,I.Cg)([(0,j.MZ)()],Lr.prototype,"isEmpty",null),Lr=(0,I.Cg)([(0,j.$K)("esri.views.3d.terrain.OverlayRenderer")],Lr);class Pr{constructor(e,t,i){this.drapeSource=e,this.renderer=t,this.index=i}}const Ir=[[1,.5,.5],[.5,.5,1]],Dr=4,Fr=new Ar;Fr.hasAlpha=!0;class Nr{constructor(e,t,i,r){this.positions=e,this.polygonIndices=t,this.outline=i,this.projectionSuccess=r,this.count=e.length/3}get vertexCount(){return this.positions.length/3}get polygonIndexCount(){return this.polygonIndices.length}get outlineIndexCount(){const{outline:e}=this;if("tessellated-indices"!==e.output)return 0;let t=0;for(let i=0;i<e.outlineIndices.length;i++)t+=Wr(e.outlineIndices[i]);return t}get outlineSegmentCount(){const{outline:e}=this;if("tessellated-indices"!==e.output)return 0;let t=0;for(let i=0;i<e.outlineIndices.length;i++)t+=Wr(e.outlineIndices[i]);return t}}class zr extends Nr{}function Hr(e,t){const{projectIfNearlyVertical:i=!1,outlineOutput:n="none",method:o,owner:a}=t??{},l="tessellated-indices"===n,c=S(e.rings,!!e.hasZ,e.spatialReference),u=function(e,t){const{hasZ:i,ccwRingsAsHoles:r,spatialReference:n}=t,o=t.axis??S(e,i,n),a=e.length,l=[],c=[],u=[],h=[],d=e.reduce((e,t)=>e+t.length,0);let p=0;const f=(0,s.jh)(3*d);let g=0;const m=r&&e[0]&&w(e[0],i,o);for(let t=a-1;t>=0;t--){const n=e[t],s=L(n,i);if(s<3){s>1&&h.push(n);continue}const a=!!r&&w(n,i,o);if(m?!a:a)l[p++]=n;else{let e=n.length;for(let t=0;t<p;++t)e+=l[t].length;const t={index:g,pathLengths:new Array(p+1),count:e,holeIndices:new Array(p)};t.pathLengths[0]=n.length,n.length>0&&u.push({index:g,count:n.length}),g=M(n,f,g,n.length,i,m);for(let e=0;e<p;++e){const r=l[e];t.holeIndices[e]=g,t.pathLengths[e+1]=r.length,r.length>0&&u.push({index:g,count:r.length}),g=M(r,f,g,r.length,i,m)}p=0,t.count>0&&c.push(t)}}const v=g;for(const e of h)u.push({index:g,count:e.length}),g=M(e,f,g,e.length,i,m);return{positions:3*g===f.length?f:(0,s.l5)(f,0,3*g),polygonVertexCount:v,polygons:c,outlines:u}}(e.rings,{hasZ:!!e.hasZ,ccwRingsAsHoles:!0,spatialReference:e.spatialReference,axis:c}),d=function(e,t){const i=function(e,t){const i={method:t?.method??"auto",projectionAxis:t?.projectionAxis??void 0,outlines:t?.outlines??void 0,owner:t?.owner??void 0},{projectionAxis:r}=i,n=null!=r&&2!==r;n&&E(e.positions,r,2);const s=function(e,t){if("libtess"===t.method)return A(e,t);const i=function(e,t){const i=null!=t.owner&&T.has(t.owner);return"auto"===t.method&&!(i&&e.polygonVertexCount>=1e4)}(e,t),r=Array();let n=0;for(const s of e.polygons){const o=O(e.positions,s),a=(s.holeIndices??[]).map(e=>e-s.index),l=a.length>0?a:null,c=(0,p.e)(o,l,3),u=p.e.deviation(o,a,3,c);if(i&&u>1e-5)return A(e,t);for(let e=0;e<c.length;e++)r.push(c[e]+s.index);n=Math.max(n,u)}const{outlineIndexBuffer:s,outlineRingLengths:o}=null!=t.outlines?R(t.outlines,e.positions):{outlineIndexBuffer:void 0,outlineRingLengths:void 0};return{succeeded:!0,positions:e.positions,indices:(0,m.uW)(r),outlineIndexBuffer:s,outlineRingLengths:o,vertexCount:e.positions.length/3,method:"earcut",deviation:n}}(e,i);if(n){const t=s.succeeded?s.positions:null;null!=t&&t!==e.positions&&E(t,2,r),E(e.positions,2,r)}return s}(e,t);return i.succeeded?i:"libtess-not-loaded"===i.message?((0,h.gc)(C),async function(){try{await(0,f.l3)(),C.notify()}catch(e){throw e}}()):i}(u,{projectionAxis:i?c:void 0,outlines:l?u.outlines:void 0,method:o,owner:a});if((0,r.$X)(d))return d;if(!d.succeeded)return null;let g={output:"none"};if("vertex-data"===n){const e=d.positions!==u.positions?u.positions:u.positions.slice();g={output:"vertex-data",outlines:Vr(u.outlines,e)}}else"tessellated-indices"===n&&(g=function(e){const{outlineIndexBuffer:t,outlineRingLengths:i}=e;if(null==t||null==i)return{output:"none"};const r=new Array(i.length);let n=0;for(let e=0;e<i.length;e++){const s=i[e],o=t.slice(n,n+s);r[e]=o,n+=s}return{output:"tessellated-indices",outlineIndices:r}}(d));return new zr(d.positions,d.indices,g,!0)}function Vr(e,t,i=null){return e.filter(({count:e})=>e>1).map(({index:e,count:r})=>{const n=3*e,o=3*r;return null!=i?new Ur(e,r,(0,s.l5)(t,n,o),(0,s.l5)(i,n,o)):new jr(e,r,(0,s.l5)(t,n,o))})}function Wr(e,t=0,i=e.length){return i>1&&e[t]===e[t+i-1]?i-1:i}class jr{constructor(e,t,i){this.index=e,this.count=t,this.position=i}}class Ur extends jr{constructor(e,t,i,r){super(e,t,i),this.mapPositions=r}}},6733(e,t,i){i.d(t,{Q:()=>h});var r=i(37585),n=i(48163),s=i(31821),o=i(74333);class a extends o.n{constructor(e,t){super(e,"ivec2",1,(i,r,n)=>i.setUniform2iv(e,t(r,n)))}}var l=i(93588),c=i(9273),u=i(34053);function h(e){const{vertex:t}=e;t.uniforms.add(new c.R("coverageTexture",e=>e.coverageTexture),new a("highlightRenderCellCount",e=>(0,r.hZ)(d,e.horizontalCellCount,e.verticalCellCount)),new a("highlightTextureResolution",({highlightTexture:e})=>(0,r.hZ)(d,e.descriptor.width,e.descriptor.height)),new l.c("highlightLevel",e=>e.highlightLevel)).constants.add("cellSize","int",u.g),e.varyings.add("sUV","vec2"),e.varyings.add("vOutlinePossible","float"),t.code.add(s.H`const ivec2 cellVertices[4] = ivec2[4](ivec2(0,0), ivec2(1,0), ivec2(0,1), ivec2(1,1));`),t.main.add(s.H`int cellIndex = gl_InstanceID;
|
|
388
|
+
fragColor = texColor * vec4(uColor, 1.0);`),e}const d=Object.freeze(Object.defineProperty({__proto__:null,TexturePassParameters:u,build:h},Symbol.toStringTag,{value:"Module"}))},83349(e,t,i){function r(e,t,i){i=i||2;var r,s,a,l,c,u,d,p=t&&t.length,f=p?t[0]*i:e.length,g=n(e,0,f,i,!0),m=[];if(!g||g.next===g.prev)return m;if(p&&(g=h(e,t,g,i)),e.length>80*i){r=a=e[0],s=l=e[1];for(var v=i;v<f;v+=i)(c=e[v])<r&&(r=c),(u=e[v+1])<s&&(s=u),c>a&&(a=c),u>l&&(l=u);d=0!==(d=Math.max(a-r,l-s))?1/d:0}return o(g,m,i,r,s,d),m}function n(e,t,i,r,n){var s,o;if(n===L(e,t,i,r)>0)for(s=t;s<i;s+=r)o=R(s,e[s],e[s+1],o);else for(s=i-r;s>=t;s-=r)o=R(s,e[s],e[s+1],o);if(o&&S(o,o.next)){var a=o.next;O(o),o=a}return o}function s(e,t){if(!e)return e;t||(t=e);var i,r=e;do{if(i=!1,r.steiner||!S(r,r.next)&&0!==b(r.prev,r,r.next))r=r.next;else{var n=r.prev;if(O(r),(r=t=n)===r.next)break;i=!0}}while(i||r!==t);return t}function o(e,t,i,r,n,h,d){if(e){!d&&h&&m(e,r,n,h);for(var p,f,g=e;e.prev!==e.next;)if(p=e.prev,f=e.next,h?l(e,r,n,h):a(e))t.push(p.i/i),t.push(e.i/i),t.push(f.i/i),O(e),e=f.next,g=f.next;else if((e=f)===g){d?1===d?o(e=c(s(e),t,i),t,i,r,n,h,2):2===d&&u(e,t,i,r,n,h):o(s(e),t,i,r,n,h,1);break}}}function a(e){var t=e.prev,i=e,r=e.next;if(b(t,i,r)>=0)return!1;for(var n=e.next.next;n!==e.prev;){if(y(t.x,t.y,i.x,i.y,r.x,r.y,n.x,n.y)&&b(n.prev,n,n.next)>=0)return!1;n=n.next}return!0}function l(e,t,i,r){var n=e.prev,s=e,o=e.next;if(b(n,s,o)>=0)return!1;for(var a=n.x<s.x?n.x<o.x?n.x:o.x:s.x<o.x?s.x:o.x,l=n.y<s.y?n.y<o.y?n.y:o.y:s.y<o.y?s.y:o.y,c=n.x>s.x?n.x>o.x?n.x:o.x:s.x>o.x?s.x:o.x,u=n.y>s.y?n.y>o.y?n.y:o.y:s.y>o.y?s.y:o.y,h=v(a,l,t,i,r),d=v(c,u,t,i,r),p=e.prevZ,f=e.nextZ;p&&p.z>=h&&f&&f.z<=d;){if(p!==e.prev&&p!==e.next&&y(n.x,n.y,s.x,s.y,o.x,o.y,p.x,p.y)&&b(p.prev,p,p.next)>=0)return!1;if(p=p.prevZ,f!==e.prev&&f!==e.next&&y(n.x,n.y,s.x,s.y,o.x,o.y,f.x,f.y)&&b(f.prev,f,f.next)>=0)return!1;f=f.nextZ}for(;p&&p.z>=h;){if(p!==e.prev&&p!==e.next&&y(n.x,n.y,s.x,s.y,o.x,o.y,p.x,p.y)&&b(p.prev,p,p.next)>=0)return!1;p=p.prevZ}for(;f&&f.z<=d;){if(f!==e.prev&&f!==e.next&&y(n.x,n.y,s.x,s.y,o.x,o.y,f.x,f.y)&&b(f.prev,f,f.next)>=0)return!1;f=f.nextZ}return!0}function c(e,t,i){var r=e;do{var n=r.prev,o=r.next.next;!S(n,o)&&w(n,r,r.next,o)&&A(n,o)&&A(o,n)&&(t.push(n.i/i),t.push(r.i/i),t.push(o.i/i),O(r),O(r.next),r=e=o),r=r.next}while(r!==e);return s(r)}function u(e,t,i,r,n,a){var l=e;do{for(var c=l.next.next;c!==l.prev;){if(l.i!==c.i&&_(l,c)){var u=E(l,c);return l=s(l,l.next),u=s(u,u.next),o(l,t,i,r,n,a),void o(u,t,i,r,n,a)}c=c.next}l=l.next}while(l!==e)}function h(e,t,i,r){var o,a,l,c=[];for(o=0,a=t.length;o<a;o++)(l=n(e,t[o]*r,o<a-1?t[o+1]*r:e.length,r,!1))===l.next&&(l.steiner=!0),c.push(x(l));for(c.sort(d),o=0;o<c.length;o++)i=s(i=f(c[o],i),i.next);return i}function d(e,t){return e.x-t.x}function p(e){if(e.next.prev===e)return e;let t=e;for(;;){const i=t.next;if(i.prev===t||i===t||i===e)break;t=i}return t}function f(e,t){var i=function(e,t){var i,r=t,n=e.x,s=e.y,o=-1/0;do{if(s<=r.y&&s>=r.next.y&&r.next.y!==r.y){var a=r.x+(s-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(a<=n&&a>o){if(o=a,a===n){if(s===r.y)return r;if(s===r.next.y)return r.next}i=r.x<r.next.x?r:r.next}}r=r.next}while(r!==t);if(!i)return null;if(n===o)return i;var l,c=i,u=i.x,h=i.y,d=1/0;r=i;do{n>=r.x&&r.x>=u&&n!==r.x&&y(s<h?n:o,s,u,h,s<h?o:n,s,r.x,r.y)&&(l=Math.abs(s-r.y)/(n-r.x),A(r,e)&&(l<d||l===d&&(r.x>i.x||r.x===i.x&&g(i,r)))&&(i=r,d=l)),r=r.next}while(r!==c);return i}(e,t);if(!i)return t;var r=E(i,e),n=s(i,i.next);let o=p(r);return s(o,o.next),n=p(n),p(t===i?n:t)}function g(e,t){return b(e.prev,e,t.prev)<0&&b(t.next,e,e.next)<0}function m(e,t,i,r){var n=e;do{null===n.z&&(n.z=v(n.x,n.y,t,i,r)),n.prevZ=n.prev,n.nextZ=n.next,n=n.next}while(n!==e);n.prevZ.nextZ=null,n.prevZ=null,function(e){var t,i,r,n,s,o,a,l,c=1;do{for(i=e,e=null,s=null,o=0;i;){for(o++,r=i,a=0,t=0;t<c&&(a++,r=r.nextZ);t++);for(l=c;a>0||l>0&&r;)0!==a&&(0===l||!r||i.z<=r.z)?(n=i,i=i.nextZ,a--):(n=r,r=r.nextZ,l--),s?s.nextZ=n:e=n,n.prevZ=s,s=n;i=r}s.nextZ=null,c*=2}while(o>1)}(n)}function v(e,t,i,r,n){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-i)*n)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-r)*n)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function x(e){var t=e,i=e;do{(t.x<i.x||t.x===i.x&&t.y<i.y)&&(i=t),t=t.next}while(t!==e);return i}function y(e,t,i,r,n,s,o,a){return(n-o)*(t-a)-(e-o)*(s-a)>=0&&(e-o)*(r-a)-(i-o)*(t-a)>=0&&(i-o)*(s-a)-(n-o)*(r-a)>=0}function _(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){var i=e;do{if(i.i!==e.i&&i.next.i!==e.i&&i.i!==t.i&&i.next.i!==t.i&&w(i,i.next,e,t))return!0;i=i.next}while(i!==e);return!1}(e,t)&&(A(e,t)&&A(t,e)&&function(e,t){var i=e,r=!1,n=(e.x+t.x)/2,s=(e.y+t.y)/2;do{i.y>s!=i.next.y>s&&i.next.y!==i.y&&n<(i.next.x-i.x)*(s-i.y)/(i.next.y-i.y)+i.x&&(r=!r),i=i.next}while(i!==e);return r}(e,t)&&(b(e.prev,e,t.prev)||b(e,t.prev,t))||S(e,t)&&b(e.prev,e,e.next)>0&&b(t.prev,t,t.next)>0)}function b(e,t,i){return(t.y-e.y)*(i.x-t.x)-(t.x-e.x)*(i.y-t.y)}function S(e,t){return e.x===t.x&&e.y===t.y}function w(e,t,i,r){var n=T(b(e,t,i)),s=T(b(e,t,r)),o=T(b(i,r,e)),a=T(b(i,r,t));return n!==s&&o!==a||!(0!==n||!C(e,i,t))||!(0!==s||!C(e,r,t))||!(0!==o||!C(i,e,r))||!(0!==a||!C(i,t,r))}function C(e,t,i){return t.x<=Math.max(e.x,i.x)&&t.x>=Math.min(e.x,i.x)&&t.y<=Math.max(e.y,i.y)&&t.y>=Math.min(e.y,i.y)}function T(e){return e>0?1:e<0?-1:0}function A(e,t){return b(e.prev,e,e.next)<0?b(e,t,e.next)>=0&&b(e,e.prev,t)>=0:b(e,t,e.prev)<0||b(e,e.next,t)<0}function E(e,t){var i=new M(e.i,e.x,e.y),r=new M(t.i,t.x,t.y),n=e.next,s=t.prev;return e.next=t,t.prev=e,i.next=n,n.prev=i,r.next=i,i.prev=r,s.next=r,r.prev=s,r}function R(e,t,i,r){var n=new M(e,t,i);return r?(n.next=r.next,n.prev=r,r.next.prev=n,r.next=n):(n.prev=n,n.next=n),n}function O(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function M(e,t,i){this.i=e,this.x=t,this.y=i,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function L(e,t,i,r){for(var n=0,s=t,o=i-r;s<i;s+=r)n+=(e[o]-e[s])*(e[s+1]+e[o+1]),o=s;return n}i.d(t,{e:()=>r}),r.deviation=function(e,t,i,r){var n=t&&t.length,s=n?t[0]*i:e.length,o=Math.abs(L(e,0,s,i));if(n)for(var a=0,l=t.length;a<l;a++){var c=t[a]*i,u=a<l-1?t[a+1]*i:e.length;o-=Math.abs(L(e,c,u,i))}var h=0;for(a=0;a<r.length;a+=3){var d=r[a]*i,p=r[a+1]*i,f=r[a+2]*i;h+=Math.abs((e[d]-e[f])*(e[p+1]-e[d+1])-(e[d]-e[p])*(e[f+1]-e[d+1]))}return 0===o&&0===h?0:Math.abs((h-o)/o)},r.flatten=function(e){for(var t=e[0][0].length,i={vertices:[],holes:[],dimensions:t},r=0,n=0;n<e.length;n++){for(var s=0;s<e[n].length;s++)for(var o=0;o<t;o++)i.vertices.push(e[n][s][o]);n>0&&(r+=e[n-1].length,i.holes.push(r))}return i}},21287(e,t,i){i.d(t,{M5:()=>h,eV:()=>u});var r=i(11254),n=i(49186),s=i(17676),o=i(84952),a=i(26306);let l=null,c=!0;function u(e,t,i,r){if(!t||!i)throw new Error("Cannot construct image data without dimensions");if(c)try{return new ImageData(e,t,i)}catch(e){c=!1}const n=function(e,t,i){return i||(l||(l=document.createElement("canvas"),l.width=1,l.height=1),i=l),i.getContext("2d").createImageData(e,t)}(t,i,r);return n.data.set(e,0),n}async function h(e,t){const{arrayBuffer:l,mediaType:c}=await async function(e,t){const i=(0,o.r$)(e);if(i?.isBase64)return{arrayBuffer:(0,a.M)(i.data),mediaType:i.mediaType};const n=await(0,r.A)(e,{responseType:"array-buffer",...t});return{arrayBuffer:n.data,mediaType:n.getHeader?.("Content-Type")??""}}(e,t),u="image/png"===c;if("image/gif"===c){const{isAnimatedGIF:e,parseGif:r}=await i.e(820).then(i.bind(i,10820));if(e(l))return r(l,t)}if(u){const{isAnimatedPNG:e,parseApng:r}=await i.e(2390).then(i.bind(i,22390));if(e(l))return r(l,t)}return async function(e,t){const i=window.URL.createObjectURL(e);try{const{data:e}=await(0,r.A)(i,{...t,responseType:"image"});return e}catch(e){if(!(0,s.zf)(e))throw new n.A("invalid-image",`Could not fetch requested image at ${i}`);throw e}finally{window.URL.revokeObjectURL(i)}}(new Blob([l],{type:c}),t)}},83300(e,t,i){i.r(t),i.d(t,{default:()=>Oe});var r=i(5482),n=i(69540),s=i(92474),o=i(53966),a=i(61893),l=i(17676),c=i(36708),u=i(91429),h=i(51850),d=i(91075),p=i(86738),f=i(39829),g=i(70328),m=i(24770),v=i(16939),x=i(49186);const y="Expected location to be a Point instance";class _ extends x.A{constructor(){super("invalid-input:location",y)}}var b=i(95696),S=i(18251),w=i(73836),C=i(1193),T=i(27615),A=i(35522),E=i(65806);function R(e,t){switch(e.type){case"georeferenced":return t.isGeographic;case"local":return t.isGeographic||t.isWebMercator}}var O=i(22141),M=i(72258);const L=()=>o.A.getLogger("esri.geometry.support.meshUtils.centerAt");const P=(0,h.vt)(),I=(0,h.vt)(),D=(0,h.vt)();var F=i(9093),N=i(5443),z=i(91218),H=i(98764),V=i(48353),W=i(9762),j=i(4197),U=i(73354);const B=(0,F.vt)(),$=(0,j.jh)(24);var Z=i(84952);function k(e){const t=(0,Z.nM)(e.url);return i=>{const r=(0,Z.V1)(i,t,t),n=r?r.replace(/^ *\.\//,""):null;return(n?e.files.get(n):null)??i}}async function G(e,t){switch(e.type){case"client":return Array.isArray(e.files)?function(e){if(!e.length)throw new x.A("mesh-load-external:missing-assets","There must be at least one file to load");return ee(e.map(e=>({name:e.name,mimeType:e.type,source:q(e)})))}(e.files):q(e.files);case"service":return async function(e,t){if(!e.length)throw new x.A("mesh-load-external:missing-assets","There must be at least one file to load");const i=await(0,l.nA)(e.map(async e=>{const i=await async function(e,t){const{parts:i,assetMimeType:r,assetName:n}=e;if(1===i.length)return new te(i[0].partUrl);const s=await e.toBlob(t);return(0,l.Te)(t),te.fromBlob(s,ie(n,r))}(e);return(0,l.Te)(t),{name:e.assetName,mimeType:e.assetMimeType,source:i}}));if((0,l.G4)(t))throw i.forEach(e=>e.source.dispose()),(0,l.NK)();return ee(i)}(e.assets,t);default:throw new x.A("mesh-load-external:invalid-source","Invalid source type")}}function q(e){return te.fromBlob(e,ie(e.name,e.type))}const Y=/^model\/gltf\+json$/,Q=/^model\/gltf-binary$/,X=/\.gltf$/i,K=/\.glb$/i;function J({mimeType:e,source:t,name:i}){return Y.test(e)||X.test(i)?{url:t.url,type:"gltf"}:Q.test(e)||K.test(i)?{url:t.url,type:"glb"}:null}function ee(e){const t=new Map;let i=null,r=null;for(const n of e){const{source:e,name:s}=n;i??=J(n),"ESRI3DO_NORM.glb"===s&&(r=J(n)),t.set(s,e.url),e.files.forEach((e,i)=>t.set(i,e))}const n=r??i;if(null==n)throw new x.A("mesh-load-external:missing-files","Missing files to load external mesh source");return new te(n.url,()=>e.forEach(({source:e})=>e.dispose()),t,n.type)}class te{constructor(e,t=()=>{},i=new Map,r){this.url=e,this.dispose=t,this.files=i,this.type=r}static fromBlob(e,t){const i=URL.createObjectURL(e);return new te(i,()=>URL.revokeObjectURL(i),void 0,t)}}function ie(e,t){return Y.test(t)||X.test(e)?"gltf":Q.test(t)||X.test(e)?"glb":void 0}var re=i(66895),ne=i(29461),se=i(15070),oe=i(77690),ae=i(29242),le=i(58083),ce=i(67026),ue=i(82534);const he=()=>o.A.getLogger("esri.geometry.support.meshUtils.rotate");function de(e,t,i,r=h.uY){if(null!=e){(0,le.$0)(me,(0,m.$I)(t),(0,m.yo)(t));for(let t=0;t<e.length;t+=i){for(let i=0;i<3;i++)pe[i]=e[t+i]-r[i];(0,A.Z0)(pe,pe,me);for(let i=0;i<3;i++)e[t+i]=pe[i]+r[i]}}}const pe=(0,h.vt)(),fe=(0,F.vt)(),ge=(0,m.vt)(),me=(0,F.vt)(),ve=(0,ae.vt)(),xe=(0,h.vt)(),ye=(0,ue.vt)(),_e=()=>o.A.getLogger("esri.geometry.support.meshUtils.scale");function be(e,t,i=h.uY){if(e)for(let r=0;r<e.length;r+=3){for(let t=0;t<3;t++)Se[t]=e[r+t]-i[t];(0,A.hs)(Se,Se,t);for(let t=0;t<3;t++)e[r+t]=Se[t]+i[t]}}const Se=(0,h.vt)(),we=(0,h.vt)(),Ce=(0,F.vt)(),Te=(0,h.vt)();var Ae,Ee=i(65801);const Re={base:null,key:"type",defaultKeyValue:"georeferenced",typeMap:{georeferenced:b.A,local:S.default}};let Oe=Ae=class extends((0,n.OU)((0,s.WV)((0,a.g)(d.A)))){constructor(e){super(e),this.components=null,this.vertexSpace=new b.A,this.transform=null,this.metadata=new ne.O,this.hasZ=!0,this.hasM=!1,this.vertexAttributes=new C.default,this.type="mesh"}initialize(){(0===this.metadata.externalSources.length||this.vertexAttributes.position.length)&&(this.loadStatus="loaded"),this.when(()=>{this.addHandles((0,c.wB)(()=>({vertexAttributes:this.vertexAttributes,components:this.components?.map(e=>e.clone())}),()=>this._clearSources(),{once:!0,sync:!0}))}).catch(()=>{})}get hasExtent(){return this.loaded?this.vertexAttributes.position.length>0&&(!this.components||this.components.length>0):null!=this.metadata.displaySource?.extent}get _transformedExtent(){const{spatialReference:e,vertexSpace:t}=this,i=this;return function(e){const{spatialReference:t,vertexSpace:i,untransformedBounds:r}=e,n=(0,g.gE)(r,$);if((0,T.Hq)(i)&&e.transform&&(0,U.a)(n,n,e.transform.localMatrix),"georeferenced"===i.type){const e=i.origin;return e&&(0,U.t)(n,n,e),(0,g.w1)((0,g.vY)(n),t)}const s=(0,H.lO)(t),o=i.origin;if(!(0,z.canProjectWithoutEngine)(s,t)){const[e,i,r]=o;return new N.A({xmin:e,ymin:i,zmin:r,xmax:e,ymax:i,zmax:r,spatialReference:t})}return(0,V.l)(t,o,B,s),(0,U.a)(n,n,B),(0,W.projectBuffer)(n,s,0,n,t,0),(0,g.w1)((0,g.vY)(n),t)}({get transform(){return i.transform},vertexSpace:t,spatialReference:e,untransformedBounds:this._untransformedBounds})}get _untransformedBounds(){const{vertexAttributes:{position:e},components:t}=this;return 0===e.length||0===t?.length?(0,g.vt)(g.v_):(0,g.vY)(e)}get origin(){const e=(0,T.MW)(this.vertexSpace,this.spatialReference);if(null!=e)return e;const{center:t,zmin:i}=this._transformedExtent;return new p.A({x:t.x,y:t.y,z:i,spatialReference:this.spatialReference})}get extent(){return this.loaded||null==this.metadata?.displaySource?.extent?this._transformedExtent:this.metadata.displaySource.extent.clone()}addComponent(e){this._checkIfLoaded("addComponent()")&&(this.components||(this.components=[]),this.components.push(v.default.from(e)),this.notifyChange("components"))}removeComponent(e){if(this._checkIfLoaded("removeComponent()")){if(this.components){const t=this.components.indexOf(e);if(-1!==t)return this.components.splice(t,1),void this.notifyChange("components")}o.A.getLogger(this).error("removeComponent()","Provided component is not part of the list of components")}}rotate(e,t,i,r){return(0,m.AU)(e,t,i,Me),function(e,t,i){if(!e.vertexAttributes?.position||0===t[3])return;const{spatialReference:r,vertexSpace:n}=e,s=i?.origin??e.origin;(0,T.CK)(e)?function(e,t,i){e.transform??=new w.A;const{vertexSpace:r,transform:n,spatialReference:s}=e,[o,a,l]=r.origin,c=new p.A({x:o,y:a,z:l,spatialReference:s}),u=pe;if(c.equals(i))(0,A.hZ)(u,0,0,0);else if(!(0,M.p5)(u,i,e))return void(0,O.CN)(he(),i.spatialReference,s,O.JP);(0,ce.x8)(ye,(0,m.yo)(t),(0,m.$I)(t));const d=(0,le.O7)(fe,ye,h.uY,h.Un,u),{localMatrix:f}=n,g=(0,le.lw)(fe,d,f);n.scale=(0,le.X_)((0,h.vt)(),g),(0,le.hs)(g,g,(0,A.DI)(pe,n.scale));const v=n.rotationAxis;n.rotation=(0,m.ui)(g),0===n.rotationAngle&&(n.rotationAxis=v),n.translation=(0,le.sC)((0,h.vt)(),g)}(e,t,s):R(n,r)?function(e,t,i){const r=e.spatialReference,n=(0,H.lO)(r),s=xe;if(!(0,E.g)(i,s,n)&&((0,O.CN)(he(),i.spatialReference,n,"Falling back to mesh origin"),!(0,E.g)(e.origin,s,n)))return void(0,O.CN)(he(),e.origin.spatialReference,n);const o=e.vertexAttributes.position,a=e.vertexAttributes.normal,l=e.vertexAttributes.tangent,c=new Float64Array(o.length),u=null!=a?new Float32Array(a.length):null,h=null!=l?new Float32Array(l.length):null;(0,V.l)(n,s,me,n),(0,oe.z0)(ve,me);const d=ge;(0,A.ei)((0,m.yo)(ge),(0,m.yo)(t),ve),d[3]=t[3],!(0,O.gr)(o,r,c,n)||null!=a&&null!=u&&!(0,O.X4)(a,o,r,c,n,u)||null!=l&&null!=h&&!(0,O.xA)(l,o,r,c,n,h)?(0,O.CN)(he(),r,n):(de(c,d,3,s),!(0,O.$5)(c,n,o,r)||null!=a&&null!=u&&(de(u,d,3),!(0,O.si)(u,o,r,c,n,a))||null!=l&&null!=h&&(de(h,d,4),!(0,O.Mv)(h,o,r,c,n,l))?(0,O.CN)(he(),n,r):e.vertexAttributesChanged())}(e,t,s):function(e,t,i){const r=xe;if(!(0,E.g)(i,r,e.spatialReference)){const t=e.origin;return r[0]=t.x,r[1]=t.y,r[2]=t.z,void(0,O.CN)(he(),i.spatialReference,e.spatialReference,O.JP)}de(e.vertexAttributes.position,t,3,r),de(e.vertexAttributes.normal,t,3),de(e.vertexAttributes.tangent,t,4),e.vertexAttributesChanged()}(e,t,s)}(this,Me,r),this}offset(e,t,i){if(!this._checkIfLoaded("offset()"))return this;const{vertexSpace:r,vertexAttributes:n}=this,s=n?.position;if(!s)return this;if((0,T.Hq)(r)){const[n,s,o]=r.origin;r.origin=(0,h.fA)(n+e,s+t,o+i)}else{for(let r=0;r<s.length;r+=3)s[r]+=e,s[r+1]+=t,s[r+2]+=i;this.vertexAttributesChanged()}return this}scale(e,t){return this._checkIfLoaded("scale()")?(function(e,t,i){if(!e.vertexAttributes?.position)return;const{vertexSpace:r,spatialReference:n}=e,s=i?.origin??e.origin;(0,T.CK)(e)?function(e,t,i){e.transform??=new w.A;const{vertexSpace:r,transform:n,spatialReference:s}=e,[o,a,l]=r.origin,c=new p.A({x:o,y:a,z:l,spatialReference:s}),u=Se;if(c.equals(i))(0,A.hZ)(u,0,0,0);else if(!(0,M.p5)(u,i,e))return void(0,O.CN)(_e(),i.spatialReference,s,O.JP);const d=(0,A.hZ)(we,t,t,t),f=(0,le.O7)(Ce,ue.zK,h.uY,d,u),{localMatrix:g}=n,v=(0,le.lw)(Ce,f,g);n.scale=(0,le.X_)((0,h.vt)(),v),(0,le.hs)(v,v,(0,A.DI)(Se,n.scale));const x=n.rotationAxis;n.rotation=(0,m.ui)(v),0===n.rotationAngle&&(n.rotationAxis=x),n.translation=(0,le.sC)((0,h.vt)(),v)}(e,t,s):R(r,n)?function(e,t,i){const r=e.spatialReference,n=(0,H.lO)(r),s=Te;if(!(0,E.g)(i,s,n)&&((0,O.CN)(_e(),i.spatialReference,n,"Falling back to mesh origin"),!(0,E.g)(e.origin,s,n)))return void(0,O.CN)(_e(),e.origin.spatialReference,n);const o=e.vertexAttributes.position,a=e.vertexAttributes.normal,l=e.vertexAttributes.tangent,c=new Float64Array(o.length),u=null!=a?new Float32Array(a.length):null,h=null!=l?new Float32Array(l.length):null;!(0,O.gr)(o,r,c,n)||null!=a&&null!=u&&!(0,O.X4)(a,o,r,c,n,u)||null!=l&&null!=h&&!(0,O.xA)(l,o,r,c,n,h)?(0,O.CN)(_e(),r,n):(be(c,t,s),!(0,O.$5)(c,n,o,r)||null!=a&&null!=u&&!(0,O.si)(u,o,r,c,n,a)||null!=l&&null!=h&&!(0,O.Mv)(h,o,r,c,n,l)?(0,O.CN)(_e(),n,r):e.vertexAttributesChanged())}(e,t,s):function(e,t,i){const r=Te;if(!(0,E.g)(i,r,e.spatialReference)){const t=e.origin;return r[0]=t.x,r[1]=t.y,r[2]=t.z,void(0,O.CN)(_e(),i.spatialReference,e.spatialReference,O.JP)}be(e.vertexAttributes.position,t,r),e.vertexAttributesChanged()}(e,t,s)}(this,e,t),this):this}centerAt(e,t){return this._checkIfLoaded("centerAt()")?(function(e,t,i){if(!e.vertexAttributes?.position)return;const{vertexSpace:r}=e,n=i?.origin??e.origin;(0,T.Hq)(r)?function(e,t,i){const{vertexSpace:r}=e;if(!(0,T.Hq)(r))return;const n=I,s=P;if(!(0,E.g)(t,s,e.spatialReference))return void(0,O.CN)(L(),t.spatialReference,e.spatialReference,O.JP);if(!(0,E.g)(i,n,e.spatialReference))return void(0,O.CN)(L(),i.spatialReference,e.spatialReference,O.JP);const o=(0,A.Re)(D,s,n);r.origin=(0,A.WQ)((0,h.vt)(),r.origin,o)}(e,t,n):R(r,n.spatialReference)?function(e,t,i){const r=(0,h.fA)(i.x,i.y,i.z??0),n=(0,M.UR)(e,new S.default({origin:r}));if(!n)return;const s=(0,h.fA)(t.x,t.y,t.z??0),o=(0,M.UR)({vertexAttributes:n,spatialReference:e.spatialReference,vertexSpace:new S.default({origin:s})},b.A.absolute);if(!o)return;const{position:a,normal:l,tangent:c}=o;e.vertexAttributes.position=a,e.vertexAttributes.normal=l,e.vertexAttributes.tangent=c,e.vertexAttributesChanged()}(e,t,n):function(e,t,i){const r=I,n=P;if((0,E.g)(t,n,e.spatialReference)){if(!(0,E.g)(i,r,e.spatialReference)){const t=e.origin;return r[0]=t.x,r[1]=t.y,r[2]=t.z,void(0,O.CN)(L(),i.spatialReference,e.spatialReference,O.JP)}(function(e,t,i){if(e)for(let r=0;r<e.length;r+=3)for(let n=0;n<3;n++)e[r+n]+=t[n]-i[n]})(e.vertexAttributes.position,n,r),e.vertexAttributesChanged()}else(0,O.CN)(L(),t.spatialReference,e.spatialReference,O.JP)}(e,t,n)}(this,e,t),this):this}load(e){const{metadata:{displaySource:t}}=this;return t&&this.addResolvingPromise(async function(e,t,r){switch(t.source.type){case"client":case"service":return async function(e,t,r){const{source:n}=t,{loadGLTFMesh:s}=await(0,l.qr)(i.e(5841).then(i.bind(i,35841)),r),o=await G(n,r);(0,l.Te)(r);const a=s(new p.A({x:0,y:0,z:0,spatialReference:e.spatialReference}),o.url,{resolveFile:k(o),signal:r?.signal,expectedType:o.type,unitConversionDisabled:t.unitConversionDisabled}),{mesh:{vertexAttributes:c,components:u},meta:{isDracoDecompressed:h}}=await a.finally(()=>o.dispose());if(h)throw new x.A("mesh-load-external:draco-not-supported","The provided mesh uses Draco compression which is not supported.");e.vertexAttributes=c,e.components=u}(e,t,r);case"loadable":return t.source.load(e,r);default:t.source}}(this,t,e)),Promise.resolve(this)}addExternalSources(e){this.metadata.externalSources.addMany(e)}updateDisplaySource(e){this.metadata.displaySource=e}clone(e){return super.clone((0,re.WO)((0,re.QN)(e)))}cloneShallow(){return new Ae({components:this.components,spatialReference:this.spatialReference,vertexAttributes:this.vertexAttributes,vertexSpace:this.vertexSpace.clone(),transform:this.transform,metadata:this.metadata})}vertexAttributesChanged(){this.notifyChange("vertexAttributes")}async toBinaryGLTF(e){const[{toBinaryGLTF:t}]=await Promise.all([i.e(4038).then(i.bind(i,84038)),this.load(e)]);return(0,l.Te)(e),await t(this,e)}get usedMemory(){return this.components?this.components.reduce((e,t)=>e+t.memoryUsage,this.vertexAttributes.usedMemory):this.vertexAttributes.usedMemory}_clearSources(){this.metadata.clearSources()}_checkIfLoaded(e){return!!this.loaded||(o.A.getLogger(this).error(e,"Mesh must be loaded before applying operations"),!1)}static createBox(e,t){if(!(e instanceof p.A))return o.A.getLogger(this.prototype).error(".createBox()",y),null;const i=new Ae((0,se.UG)((0,se.H8)(),e,t));return t?.imageFace&&"all"!==t.imageFace?(0,se.bQ)(i,t.imageFace):i}static createSphere(e,t){return e instanceof p.A?new Ae((0,se.UG)((0,se.Dk)(t?.densificationFactor||0),e,t)):(o.A.getLogger(this.prototype).error(".createSphere()",y),null)}static createCylinder(e,t){return e instanceof p.A?new Ae((0,se.UG)((0,se.ai)(t?.densificationFactor||0),e,t)):(o.A.getLogger(this.prototype).error(".createCylinder()",y),null)}static createPlane(e,t){if(!(e instanceof p.A))return o.A.getLogger(this.prototype).error(".createPlane()",y),null;const i=t?.facing??"up",r=(0,se.uF)(i,t?.size);return new Ae((0,se.UG)((0,se.Uh)(i),e,{...t,size:r}))}static createFromPolygon(e,t){if(!(e instanceof f.A))return o.A.getLogger(this.prototype).error(".createFromPolygon()","Expected polygon to be a Polygon instance"),null;const i=(0,Ee.uM)(e,{method:"earcut"}),r=(0,l.$X)(i)?null:i,n=r?.positions??[],s=r?.polygonIndices??[];return new Ae({vertexAttributes:new C.default({position:n}),components:[new v.default({faces:s,shading:"flat",material:t?.material??null})],spatialReference:e.spatialReference,vertexSpace:new b.A})}static async createFromGLTF(e,t,r){if(!(e instanceof p.A)){const e=new _;throw o.A.getLogger(this.prototype).error(".createfromGLTF()",e.message),e}const{loadGLTFMesh:n}=await(0,l.qr)(i.e(5841).then(i.bind(i,35841)),r);return new Ae((await n(e,t,r)).mesh)}};(0,r.Cg)([(0,u.MZ)({type:[v.default],json:{write:!0}})],Oe.prototype,"components",void 0),(0,r.Cg)([(0,u.MZ)({nonNullable:!0,types:Re,constructOnly:!0,json:{write:!0},clonable:(e,t)=>(0,re.o2)(t)?.vertexSpace??e.clone(t)})],Oe.prototype,"vertexSpace",void 0),(0,r.Cg)([(0,u.MZ)({type:w.A,clonable:(e,t)=>{const i=(0,re.o2)(t);return i&&"transform"in i?i.transform:e?.clone()??e},json:{write:!0}})],Oe.prototype,"transform",void 0),(0,r.Cg)([(0,u.MZ)({constructOnly:!0,type:ne.O,clonable:(e,t)=>(0,re.o2)(t)?.metadata??e.clone()})],Oe.prototype,"metadata",void 0),(0,r.Cg)([(0,u.MZ)()],Oe.prototype,"hasExtent",null),(0,r.Cg)([(0,u.MZ)()],Oe.prototype,"_transformedExtent",null),(0,r.Cg)([(0,u.MZ)()],Oe.prototype,"_untransformedBounds",null),(0,r.Cg)([(0,u.MZ)()],Oe.prototype,"origin",null),(0,r.Cg)([(0,u.MZ)({readOnly:!0,json:{read:!1}})],Oe.prototype,"extent",null),(0,r.Cg)([(0,u.MZ)({readOnly:!0,json:{read:!1,write:!0,default:!0}})],Oe.prototype,"hasZ",void 0),(0,r.Cg)([(0,u.MZ)({readOnly:!0,json:{read:!1,write:!0,default:!1}})],Oe.prototype,"hasM",void 0),(0,r.Cg)([(0,u.MZ)({type:C.default,nonNullable:!0,json:{write:!0},clonable:(e,t)=>(0,re.o2)(t)?.vertexAttributes??e.clone(t)})],Oe.prototype,"vertexAttributes",void 0),Oe=Ae=(0,r.Cg)([(0,u.$K)("esri.geometry.Mesh")],Oe);const Me=(0,m.vt)()},15585(e,t,i){i.d(t,{If:()=>p,O5:()=>v,O9:()=>g,QT:()=>m,l3:()=>f});var r=i(5482),n=i(2741),s=i(49186),o=i(44208),a=i(34727);let l=null,c=null,u=null,h=null;const d=(new Float32Array(0),new Uint32Array(0),new Uint32Array(0),new Uint32Array(0),{vertices:new Float64Array(0),indices:new Uint32Array(0),outlineIndices:new Uint32Array(0),outlineRingLengths:new Uint32Array(0),vertexCount:0,indexCount:0,outlineIndexCount:0,outlineRingCount:0});async function p(){return l??=async function(){const e=await i.e(2997).then(i.bind(i,42997)),t=await e.default({locateFile:e=>(0,n.s)(`esri/core/libs/libtess/${e}`)});u=t}(),l}async function f(){return c??=async function(){const e=await i.e(9134).then(i.bind(i,99134)),t=await e.default({locateFile:e=>(0,n.s)(`esri/core/libs/libtess/${e}`)});h=t}(),c}function g(){return null!==h}function m(e,t,i=2){const n={stack:[],error:void 0,hasError:!1};try{const a=u;if(!a)throw new s.A("libtess:not-loaded","libtessF32 not loaded");const l=(0,r.mS)(n,b.from(a,e),!1),c=(0,r.mS)(n,w.from(a,t),!1),h=e.length/i*4,d=(0,r.mS)(n,new b(a,h*i),!1),p=a.triangulate(l.ptr,c.ptr,c.size,i,d.ptr,h);if((0,o.A)("esri-tessellation-debug")){const e=a.getError();0!==e&&console.warn("libtess:triangulation",C(e))}return{buffer:d.slice(0,p*i),vertexCount:p}}catch(e){n.error=e,n.hasError=!0}finally{(0,r.hk)(n)}}function v(e,t,i=2,n=!0){const l={stack:[],error:void 0,hasError:!1};try{const c=h;if(!c)throw new s.A("libtess:not-loaded","libtessF64 not loaded");const u=(0,r.mS)(l,S.from(c,e),!1),p=(0,r.mS)(l,w.from(c,t),!1),f=(0,r.mS)(l,new w(c,1),!1),g=(0,r.mS)(l,new w(c,1),!1),m=(0,r.mS)(l,new w(c,1),!1),v=(0,r.mS)(l,new w(c,1),!1),{maxVertexCount:x,maxIndexCount:y,maxOutlineIndexCount:b,maxOutlineRingCount:T}=function(e,t){const i=e.reduce((e,t)=>e+t,0),r=e.length,n=Math.max(0,e.length-1),s=Math.max(0,i+2*n-2),o=Math.max(0,Math.ceil(2*i)),l=Math.max(0,Math.ceil(3*s*2)),c=(0,a.mP)(l,3),u=i>0?Math.max(2,Math.ceil(.25*i)):0,h=i>0?Math.max(1,Math.ceil(u/3)):0;return{maxVertexCount:o,maxIndexCount:c,maxOutlineIndexCount:t?Math.max(0,i+r+u):0,maxOutlineRingCount:t?Math.max(0,r+h):0}}(t,n);let A=0,E=0,R=0,O=0,M=0;{const e={stack:[],error:void 0,hasError:!1};try{const t=(0,r.mS)(e,new S(c,x*i),!1),s=(0,r.mS)(e,new w(c,y),!1),o=(0,r.mS)(e,n?new w(c,b):null,!1),a=(0,r.mS)(e,n?new w(c,T):null,!1);if(c.triangulateIndexed(u.ptr,p.ptr,p.size,i,t.ptr,x,i,s.ptr,y,f.ptr,g.ptr,o?.ptr??0,b,a?.ptr??0,T,m.ptr,v.ptr),M=c.getError(),A=_(c)[f.ptr/Int32Array.BYTES_PER_ELEMENT],E=_(c)[g.ptr/Int32Array.BYTES_PER_ELEMENT],R=_(c)[m.ptr/Int32Array.BYTES_PER_ELEMENT],O=_(c)[v.ptr/Int32Array.BYTES_PER_ELEMENT],0===M){const e=t.slice(0,A*i);return{vertices:e,indices:s.slice(0,E),outlineIndices:n&&o?o.slice(0,R):d.outlineIndices,outlineRingLengths:n&&a?a.slice(0,O):d.outlineRingLengths,vertexCount:A,indexCount:E,outlineIndexCount:n?R:0,outlineRingCount:n?O:0}}}catch(t){e.error=t,e.hasError=!0}finally{(0,r.hk)(e)}}if(100903!==M)return(0,o.A)("esri-tessellation-debug")&&console.warn("libtess:triangulation",C(M)),d;const L=(0,r.mS)(l,new S(c,A*i),!1),P=(0,r.mS)(l,new w(c,E),!1),I=(0,r.mS)(l,n?new w(c,R):null,!1),D=(0,r.mS)(l,n?new w(c,O):null,!1);if(c.triangulateIndexed(u.ptr,p.ptr,p.size,i,L.ptr,A,i,P.ptr,E,f.ptr,g.ptr,I?.ptr??0,n?R:0,D?.ptr??0,n?O:0,m.ptr,v.ptr),M=c.getError(),0!==M)return(0,o.A)("esri-tessellation-debug")&&console.warn("libtess:triangulation",C(M)),d;const F=_(c)[f.ptr/Int32Array.BYTES_PER_ELEMENT],N=_(c)[g.ptr/Int32Array.BYTES_PER_ELEMENT],z=_(c)[m.ptr/Int32Array.BYTES_PER_ELEMENT],H=_(c)[v.ptr/Int32Array.BYTES_PER_ELEMENT],V=L.slice(0,F*i);return{vertices:V,indices:P.slice(0,N),outlineIndices:n&&I?I.slice(0,z):d.outlineIndices,outlineRingLengths:n&&D?D.slice(0,H):d.outlineRingLengths,vertexCount:F,indexCount:N,outlineIndexCount:n?z:0,outlineRingCount:n?H:0}}catch(e){l.error=e,l.hasError=!0}finally{(0,r.hk)(l)}}function x(e){return e.HEAPF64}function y(e){return e.HEAPF32}function _(e){return e.HEAP32}class b{static from(e,t){const i=new b(e,t.length);return i.set(t),i}constructor(e,t){this._libtess=e,this.size=t,this.ptr=e.allocateCoordinateArray(t)}destroy(){this._libtess.destroyCoordinateArray(this.ptr)}[Symbol.dispose](){this.destroy()}get bytesPerCoordinate(){return Float32Array.BYTES_PER_ELEMENT}set(e){y(this._libtess).set(e,this.ptr/this.bytesPerCoordinate)}slice(e,t){const i=this.ptr/this.bytesPerCoordinate;return y(this._libtess).slice(i+e,i+t)}}class S{static from(e,t){const i=new S(e,t.length);return i.set(t),i}constructor(e,t){this._libtess=e,this.size=t,this.ptr=e.allocateCoordinateArray(t)}destroy(){this._libtess.destroyCoordinateArray(this.ptr)}[Symbol.dispose](){this.destroy()}get bytesPerCoordinate(){return Float64Array.BYTES_PER_ELEMENT}set(e){x(this._libtess).set(e,this.ptr/this.bytesPerCoordinate)}slice(e,t){const i=this.ptr/this.bytesPerCoordinate;return x(this._libtess).slice(i+e,i+t)}}class w{static from(e,t){const i=new w(e,t.length);return i.set(t),i}constructor(e,t){this._libtess=e,this.size=t,this.ptr=e.allocateLengthsArray(t)}destroy(){this._libtess.destroyLengthsArray(this.ptr)}[Symbol.dispose](){this.destroy()}get bytesPerCoordinate(){return Int32Array.BYTES_PER_ELEMENT}set(e){_(this._libtess).set(e,this.ptr/this.bytesPerCoordinate)}slice(e,t){const i=this.ptr/this.bytesPerCoordinate;return function(e){const t=_(e);return new Uint32Array(t.buffer,t.byteOffset,t.length)}(this._libtess).slice(i+e,i+t)}}function C(e){switch(e){case 100903:return"Insufficient output buffer";case 100902:return"Out of memory";case 100151:return"Missing begin polygon";case 100152:return"Missing begin contour";case 100153:return"Missing end polygon";case 100154:return"Missing end countour";case 100155:return"Coordinates too large";case 100156:return"Missing combine callback";default:return`Unknown: ${e}`}}},16939(e,t,i){i.r(t),i.d(t,{default:()=>p});var r,n=i(5482),s=i(69540),o=i(25482),a=i(53966),l=i(91429),c=i(56507),u=i(19211),h=i(80882),d=i(31199);let p=r=class extends((0,s.OU)(o.o)){static from(e){return(0,c.PZ)(r,e)}constructor(e){super(e),this.material=null,this.name=void 0,this.shading="source",this.trustSourceNormals=!1}get faces(){return this._get("faces")??null}set faces(e){this._set("faces",(0,d.b)(e,Uint32Array,[Uint16Array],{loggerTag:".faces=",stride:3},a.A.getLogger(this)))}castMaterial(e){return(0,c.PZ)(e&&"object"==typeof e&&("metallic"in e||"roughness"in e||"metallicRoughnessTexture"in e)?h.A:u.default,e)}get memoryUsage(){let e=0;return null!=this.faces&&(e+=this.faces.byteLength),null!=this.material&&(e+=this.material.memoryUsage),e}};(0,n.Cg)([(0,l.MZ)({json:{write:d.B}})],p.prototype,"faces",null),(0,n.Cg)([(0,l.MZ)({type:u.default,json:{write:!0}})],p.prototype,"material",void 0),(0,n.Cg)([(0,l.wg)("material")],p.prototype,"castMaterial",null),(0,n.Cg)([(0,l.MZ)({json:{write:!0}})],p.prototype,"name",void 0),(0,n.Cg)([(0,l.MZ)({type:String,json:{write:!0}})],p.prototype,"shading",void 0),(0,n.Cg)([(0,l.MZ)({type:Boolean})],p.prototype,"trustSourceNormals",void 0),p=r=(0,n.Cg)([(0,l.$K)("esri.geometry.support.MeshComponent")],p)},95696(e,t,i){i.d(t,{A:()=>c});var r,n=i(5482),s=i(69540),o=i(25482),a=i(91429),l=i(93223);let c=class extends((0,s.OU)(o.o)){static{r=this}constructor(e){super(e),this.type="georeferenced",this.origin=null}static{this.absolute=new r}};(0,n.Cg)([(0,l.e)({georeferenced:"georeferenced"},{readOnly:!0})],c.prototype,"type",void 0),(0,n.Cg)([(0,a.MZ)({type:[Number],nonNullable:!1,json:{write:!0}})],c.prototype,"origin",void 0),c=r=(0,n.Cg)([(0,a.$K)("esri.geometry.support.MeshGeoreferencedVertexSpace")],c)},18251(e,t,i){i.r(t),i.d(t,{default:()=>c});var r=i(5482),n=i(69540),s=i(25482),o=i(91429),a=i(51850),l=i(93223);let c=class extends((0,n.OU)(s.o)){constructor(e){super(e),this.type="local",this.origin=(0,a.vt)()}};(0,r.Cg)([(0,l.e)({local:"local"},{readOnly:!0})],c.prototype,"type",void 0),(0,r.Cg)([(0,o.MZ)({type:[Number],nonNullable:!0,json:{write:!0}})],c.prototype,"origin",void 0),c=(0,r.Cg)([(0,o.$K)("esri.geometry.support.MeshLocalVertexSpace")],c)},19211(e,t,i){i.r(t),i.d(t,{default:()=>h});var r=i(5482),n=i(68197),s=i(69540),o=i(25482),a=i(91429),l=i(35063),c=i(51147),u=i(66895);let h=class extends((0,s.OU)(o.o)){constructor(e){super(e),this.color=null,this.colorTextureTransform=null,this.normalTextureTransform=void 0,this.alphaMode="auto",this.alphaCutoff=.5,this.doubleSided=!0}get colorTexture(){return this._get("colorTexture")}set colorTexture(e){this._set("colorTexture",null==e?null:l.default.from(e))}get normalTexture(){return this._get("normalTexture")}set normalTexture(e){this._set("normalTexture",null==e?null:l.default.from(e))}clone(e){const t=(0,u.hz)(e),i=t?.materialMap?.get(this);if(i)return i;const r=super.clone((0,u.QN)(e));return t?.materialMap?.set(this,r),r}get memoryUsage(){return this.getMemoryUsage()}getMemoryUsage(){let e=0;return e+=null!=this.color?16:0,null!=this.colorTexture&&(e+=this.colorTexture.memoryUsage),e+=null!=this.colorTextureTransform?20:0,null!=this.normalTexture&&(e+=this.normalTexture.memoryUsage),e+=null!=this.normalTextureTransform?20:0,e}};(0,r.Cg)([(0,a.MZ)({type:n.A,json:{write:!0}})],h.prototype,"color",void 0),(0,r.Cg)([(0,a.MZ)({type:l.default,json:{write:!0},value:null})],h.prototype,"colorTexture",null),(0,r.Cg)([(0,a.MZ)({type:c.A,json:{write:!0}})],h.prototype,"colorTextureTransform",void 0),(0,r.Cg)([(0,a.MZ)({type:l.default,json:{write:!0},value:null})],h.prototype,"normalTexture",null),(0,r.Cg)([(0,a.MZ)({type:c.A,json:{write:!0}})],h.prototype,"normalTextureTransform",void 0),(0,r.Cg)([(0,a.MZ)({nonNullable:!0,json:{write:!0}})],h.prototype,"alphaMode",void 0),(0,r.Cg)([(0,a.MZ)({nonNullable:!0,json:{write:!0}})],h.prototype,"alphaCutoff",void 0),(0,r.Cg)([(0,a.MZ)({nonNullable:!0,json:{write:!0}})],h.prototype,"doubleSided",void 0),h=(0,r.Cg)([(0,a.$K)("esri.geometry.support.MeshMaterial")],h)},80882(e,t,i){i.d(t,{A:()=>c});var r=i(5482),n=i(68197),s=i(91429),o=i(19211),a=i(35063),l=i(51147);let c=class extends o.default{constructor(e){super(e),this.emissiveColor=null,this.emissiveStrength=null,this.emissiveTextureTransform=void 0,this.occlusionTextureTransform=void 0,this.metallic=1,this.roughness=1,this.metallicRoughnessTextureTransform=void 0}get emissiveTexture(){return this._get("emissiveTexture")}set emissiveTexture(e){this._set("emissiveTexture",null==e?null:a.default.from(e))}get occlusionTexture(){return this._get("occlusionTexture")}set occlusionTexture(e){this._set("occlusionTexture",null==e?null:a.default.from(e))}get metallicRoughnessTexture(){return this._get("metallicRoughnessTexture")}set metallicRoughnessTexture(e){this._set("metallicRoughnessTexture",null==e?null:a.default.from(e))}getMemoryUsage(){let e=super.getMemoryUsage();return e+=null!=this.emissiveColor?16:0,null!=this.emissiveTexture&&(e+=this.emissiveTexture.memoryUsage),e+=null!=this.emissiveTextureTransform?20:0,null!=this.occlusionTexture&&(e+=this.occlusionTexture.memoryUsage),e+=null!=this.occlusionTextureTransform?20:0,null!=this.metallicRoughnessTexture&&(e+=this.metallicRoughnessTexture.memoryUsage),e+=null!=this.metallicRoughnessTextureTransform?20:0,e}};(0,r.Cg)([(0,s.MZ)({type:n.A,json:{write:!0}})],c.prototype,"emissiveColor",void 0),(0,r.Cg)([(0,s.MZ)({json:{write:!0}})],c.prototype,"emissiveStrength",void 0),(0,r.Cg)([(0,s.MZ)({type:a.default,json:{write:!0},value:null})],c.prototype,"emissiveTexture",null),(0,r.Cg)([(0,s.MZ)({type:l.A,json:{write:!0}})],c.prototype,"emissiveTextureTransform",void 0),(0,r.Cg)([(0,s.MZ)({type:a.default,json:{write:!0},value:null})],c.prototype,"occlusionTexture",null),(0,r.Cg)([(0,s.MZ)({type:l.A,json:{write:!0}})],c.prototype,"occlusionTextureTransform",void 0),(0,r.Cg)([(0,s.MZ)({type:Number,nonNullable:!0,json:{write:!0},range:{min:0,max:1}})],c.prototype,"metallic",void 0),(0,r.Cg)([(0,s.MZ)({type:Number,nonNullable:!0,json:{write:!0},range:{min:0,max:1}})],c.prototype,"roughness",void 0),(0,r.Cg)([(0,s.MZ)({type:a.default,json:{write:!0},value:null})],c.prototype,"metallicRoughnessTexture",null),(0,r.Cg)([(0,s.MZ)({type:l.A,json:{write:!0}})],c.prototype,"metallicRoughnessTextureTransform",void 0),c=(0,r.Cg)([(0,s.$K)("esri.geometry.support.MeshMaterialMetallicRoughness")],c)},35063(e,t,i){i.r(t),i.d(t,{default:()=>m});var r,n=i(5482),s=i(69540),o=i(21287),a=i(25482),l=i(91429),c=i(56507),u=i(66895),h=i(97159),d=i(43937),p=i(36005);const f=new WeakMap;let g=0,m=class extends((0,s.OU)(a.o)){static{r=this}constructor(e){super(e),this.wrap="repeat"}get url(){return this._get("url")||null}set url(e){this._set("url",e),e&&this._set("data",null)}get data(){return this._get("data")||null}set data(e){this._set("data",e),e&&this._set("url",null)}writeData(e,t,i,r){if(e instanceof HTMLImageElement){const n={type:"image-element",src:(0,h.t)(e.src,r),crossOrigin:e.crossOrigin};t[i]=n}else if(e instanceof HTMLCanvasElement){const r={type:"canvas-element",imageData:v(e.getContext("2d").getImageData(0,0,e.width,e.height))};t[i]=r}else if(e instanceof HTMLVideoElement){const n={type:"video-element",src:(0,h.t)(e.src,r),autoplay:e.autoplay,loop:e.loop,muted:e.muted,crossOrigin:e.crossOrigin,preload:e.preload};t[i]=n}else if(e instanceof ImageData){const r={type:"image-data",imageData:v(e)};t[i]=r}}readData(e){switch(e.type){case"image-element":{const t=new Image;return t.src=e.src,t.crossOrigin=e.crossOrigin,t}case"canvas-element":{const t=x(e.imageData),i=document.createElement("canvas");return i.width=t.width,i.height=t.height,i.getContext("2d").putImageData(t,0,0),i}case"image-data":return x(e.imageData);case"video-element":{const t=document.createElement("video");return t.src=e.src,t.crossOrigin=e.crossOrigin,t.autoplay=e.autoplay,t.loop=e.loop,t.muted=e.muted,t.preload=e.preload,t}default:return}}get transparent(){const{data:e,url:t}=this,i=e=>e?.toLowerCase().endsWith(".png")||e?.toLocaleLowerCase().startsWith("data:image/png;");return e instanceof HTMLCanvasElement?y(e.getContext("2d").getImageData(0,0,e.width,e.height)):e instanceof ImageData?y(e):!(!t||!i(t))||!!(e instanceof HTMLImageElement&&i(e.src))}set transparent(e){this._overrideIfSome("transparent",e)}get contentHash(){const e="string"==typeof this.wrap?this.wrap:"object"==typeof this.wrap?`${this.wrap.horizontal}/${this.wrap.vertical}`:"",t=(t="")=>`d:${t},t:${this.transparent},w:${e}`;return null!=this.url?t(this.url):null!=this.data?this.data instanceof HTMLImageElement||this.data instanceof HTMLVideoElement?t(this.data.src):(f.has(this.data)||f.set(this.data,++g),t(f.get(this.data))):t()}get memoryUsage(){let e=0;if(e+=null!=this.url?this.url.length:0,null!=this.data){const t=this.data;"data"in t?e+=t.data.byteLength:t instanceof HTMLImageElement?e+=t.naturalWidth*t.naturalHeight*3:t instanceof HTMLCanvasElement&&(e+=t.width*t.height*3)}return e}clone(e){const t=(0,u.$N)(e),i=t?.textureMap?.get(this);if(i)return i;const r=super.clone(e);return t?.textureMap?.set(this,r),r}static from(e){return"string"==typeof e?new r({url:e}):e instanceof HTMLImageElement||e instanceof HTMLCanvasElement||e instanceof ImageData||e instanceof HTMLVideoElement?new r({data:e}):(0,c.PZ)(r,e)}};function v(e){let t="";for(let i=0;i<e.data.length;i++)t+=String.fromCharCode(e.data[i]);return{data:btoa(t),width:e.width,height:e.height}}function x(e){const t=atob(e.data),i=new Uint8ClampedArray(t.length);for(let e=0;e<t.length;e++)i[e]=t.charCodeAt(e);return(0,o.eV)(i,e.width,e.height)}function y(e){for(let t=3;t<e.data.length;t+=4)if(255!==e.data[t])return!0;return!1}(0,n.Cg)([(0,l.MZ)({type:String,json:{write:h.w}})],m.prototype,"url",null),(0,n.Cg)([(0,l.MZ)({clonable:"reference",json:{write:{overridePolicy(){return{enabled:!this.url}}}}})],m.prototype,"data",null),(0,n.Cg)([(0,d.K)("data")],m.prototype,"writeData",null),(0,n.Cg)([(0,p.w)("data")],m.prototype,"readData",null),(0,n.Cg)([(0,l.MZ)({type:Boolean,json:{write:{overridePolicy(){return{enabled:this._isOverridden("transparent")}}}}})],m.prototype,"transparent",null),(0,n.Cg)([(0,l.MZ)({json:{write:!0}})],m.prototype,"wrap",void 0),(0,n.Cg)([(0,l.MZ)({readOnly:!0})],m.prototype,"contentHash",null),m=r=(0,n.Cg)([(0,l.$K)("esri.geometry.support.MeshTexture")],m)},51147(e,t,i){i.d(t,{A:()=>a});var r=i(5482),n=i(69540),s=i(25482),o=i(91429);let a=class extends((0,n.OU)(s.o)){constructor(e){super(e),this.offset=[0,0],this.rotation=0,this.scale=[1,1]}};(0,r.Cg)([(0,o.MZ)({type:[Number],nonNullable:!0,json:{write:!0}})],a.prototype,"offset",void 0),(0,r.Cg)([(0,o.MZ)({type:Number,nonNullable:!0,json:{write:!0}})],a.prototype,"rotation",void 0),(0,r.Cg)([(0,o.MZ)({type:[Number],nonNullable:!0,json:{write:!0}})],a.prototype,"scale",void 0),a=(0,r.Cg)([(0,o.$K)("esri.geometry.support.MeshTextureTransform")],a)},1193(e,t,i){i.r(t),i.d(t,{default:()=>h});var r,n=i(5482),s=i(69540),o=i(25482),a=i(4718),l=i(53966),c=i(91429),u=i(31199);let h=r=class extends((0,s.OU)(o.o)){constructor(e){super(e),this.color=null,this.position=new Float64Array(0),this.uv=null,this.normal=null,this.tangent=null}castColor(e){return(0,u.b)(e,Uint8Array,[Uint8ClampedArray],{loggerTag:".color=",stride:4},l.A.getLogger(this))}castPosition(e){return e&&e instanceof Float32Array&&l.A.getLogger(this).warn(".position=","Setting position attribute from a Float32Array may cause precision problems. Consider storing data in a Float64Array or a regular number array"),(0,u.b)(e,Float64Array,[Float32Array],{loggerTag:".position=",stride:3},l.A.getLogger(this))}castUv(e){return(0,u.b)(e,Float32Array,[Float64Array],{loggerTag:".uv=",stride:2},l.A.getLogger(this))}castNormal(e){return(0,u.b)(e,Float32Array,[Float64Array],{loggerTag:".normal=",stride:3},l.A.getLogger(this))}castTangent(e){return(0,u.b)(e,Float32Array,[Float64Array],{loggerTag:".tangent=",stride:4},l.A.getLogger(this))}clonePositional(){const e={position:(0,a.o8)(this.position),normal:(0,a.o8)(this.normal),tangent:(0,a.o8)(this.tangent),uv:this.uv,color:this.color};return new r(e)}get usedMemory(){return this.position.byteLength+(this.uv?.byteLength??0)+(this.normal?.byteLength??0)+(this.tangent?.byteLength??0)+(this.color?.byteLength??0)}};(0,n.Cg)([(0,c.MZ)({json:{write:u.B}})],h.prototype,"color",void 0),(0,n.Cg)([(0,c.wg)("color")],h.prototype,"castColor",null),(0,n.Cg)([(0,c.MZ)({nonNullable:!0,json:{write:u.B}})],h.prototype,"position",void 0),(0,n.Cg)([(0,c.wg)("position")],h.prototype,"castPosition",null),(0,n.Cg)([(0,c.MZ)({json:{write:u.B}})],h.prototype,"uv",void 0),(0,n.Cg)([(0,c.wg)("uv")],h.prototype,"castUv",null),(0,n.Cg)([(0,c.MZ)({json:{write:u.B}})],h.prototype,"normal",void 0),(0,n.Cg)([(0,c.wg)("normal")],h.prototype,"castNormal",null),(0,n.Cg)([(0,c.MZ)({json:{write:u.B}})],h.prototype,"tangent",void 0),(0,n.Cg)([(0,c.wg)("tangent")],h.prototype,"castTangent",null),h=r=(0,n.Cg)([(0,c.$K)("esri.geometry.support.MeshVertexAttributes")],h)},31199(e,t,i){function r(e,t,i,r){const{loggerTag:n,stride:s}=t;return e.length%s!==0?(r.error(n,`Invalid array length, expected a multiple of ${s}`),new i([])):e}function n(e,t,i,n,s){if(!e)return e;if(e instanceof t)return r(e,n,t,s);for(const o of i)if(e instanceof o)return r(new t(e),n,t,s);if(Array.isArray(e))return r(new t(e),n,t,s);{const r=i.map(e=>`'${e.name}'`);return s.error(`Failed to set property, expected one of ${r}, but got ${e.constructor.name}`),new t([])}}function s(e,t,i){t[i]=function(e){const t=new Array(e.length);for(let i=0;i<e.length;i++)t[i]=e[i];return t}(e)}i.d(t,{B:()=>s,b:()=>n})},40118(e,t,i){i.d(t,{H5:()=>h,wh:()=>c,createWithExternalSource:()=>u});var r=i(49186),n=(i(17676),i(83300)),s=(i(16939),i(95696),i(73836)),o=(i(1193),i(27615));i(53966),i(35522),i(51850),i(66895),i(72258);var a=i(29461),l=i(15070);function c(e,t){return new n.default((0,l.UG)((0,l.Dk)(t?.densificationFactor||0),e,t))}function u(e,t,i){const r=i?.extent??null,{spatialReference:l}=e,c=i?.transform?.clone()??new s.A,u=(0,o.TE)(e,i),h=i?.unitConversionDisabled,d={source:t,extent:r,unitConversionDisabled:h},p=new a.O;return p.externalSources.push(d),new n.default({metadata:p,transform:c,vertexSpace:u,spatialReference:l})}function h(e,t){const{spatialReference:i}=e,a=t?.transform?.clone()??new s.A,l=(0,o.TE)(e,t),c=new n.default({transform:a,vertexSpace:l,spatialReference:i});return c.addResolvingPromise(Promise.reject(new r.A("mesh-incomplete","Mesh resources are not complete"))),c}i(65801)},63579(e,t,i){i.d(t,{Bq:()=>l,Qp:()=>a,WN:()=>m,dK:()=>v,eN:()=>p,fH:()=>g,in:()=>f,yr:()=>c});var r=i(11254),n=i(4576),s=i(17676),o=i(20557);class a{constructor(e,t,i){this.assetName=e,this.assetMimeType=t,this.parts=i}equals(e){return this===e||this.assetName===e.assetName&&this.assetMimeType===e.assetMimeType&&(0,n.aI)(this.parts,e.parts,(e,t)=>e.equals(t))}isOnService(e){return this.parts.every(t=>t.isOnService(e))}makeHash(){let e="";for(const t of this.parts)e+=t.partHash;return e}async toBlob(e){const{parts:t}=this;if(1===t.length)return t[0].toBlob(e);const i=await Promise.all(t.map(t=>t.toBlob(e)));return(0,s.Te)(e),new Blob(i)}}class l{constructor(e,t){this.partUrl=e,this.partHash=t}equals(e){return this===e||this.partUrl===e.partUrl&&this.partHash===e.partHash}isOnService(e){return this.partUrl.startsWith(`${e.path}/assets/`)}async toBlob(e){const{data:t}=await(0,r.A)(this.partUrl,{responseType:"blob"});return(0,s.Te)(e),t}}function c(e){return function(e){switch(e?.type){case"client":return Array.isArray(e.files)?e.files.some(d):d(e.files);case"service":return e.assets.some(d);case"loadable":return!0;default:return!1}}(e?.source)}const u=/^(model\/gltf\+json)|(model\/gltf-binary)$/,h=/\.(gltf|glb)/i;function d(e){if(e instanceof File){const{type:t,name:i}=e;return u.test(t)||h.test(i)}return u.test(e.assetMimeType)||h.test(e.assetName)}function p(e,t){if(!e)return!1;const{source:i}=e;return function(e,t){return"service"===e.type&&e.assets.every(e=>e.isOnService(t))}(i,t)}function f(e,t){if(e===t)return!0;const{source:i}=e,{source:r}=t;if(i===r)return!0;if("service"===i.type&&"service"===r.type){if(i.assets.length!==r.assets.length)return!1;const e=(e,t)=>e.assetName<t.assetName?-1:e.assetName>t.assetName?1:0,t=[...i.assets].sort(e),n=[...r.assets].sort(e);for(let e=0;e<t.length;++e)if(!t[e].equals(n[e]))return!1;return!0}return!1}function g(e,t){return e instanceof File?(0,o.rq)(e,t):(0,o.z$)(e.assetMimeType,e.assetName,t)}function m(e){switch(e.type){case"client":return Array.isArray(e.files)?e.files:[e.files];case"service":return e.assets;case"loadable":return}}function v(e){return!!e.original}},29461(e,t,i){i.d(t,{O:()=>c});var r=i(5482),n=i(69540),s=i(7762),o=i(36708),a=i(91429),l=i(63579);let c=class extends n.Pw{constructor(e){super(e),this.externalSources=new s.A,this._explicitDisplaySource=null,this.addHandles((0,o.on)(()=>this.externalSources,"after-remove",({item:e})=>{e===this._explicitDisplaySource&&(this._explicitDisplaySource=null)},{sync:!0,onListenerRemove:()=>this._explicitDisplaySource=null}))}get displaySource(){return this._explicitDisplaySource??this._implicitDisplaySource}set displaySource(e){if(null!=e&&!(0,l.yr)(e))throw new Error("Cannot use this source for display: it is not in a supported format.");this._explicitDisplaySource=e,e&&this.externalSources.every(t=>!(0,l.in)(t,e))&&this.externalSources.add(e)}clearSources(){this.externalSources.removeAll()}getExternalSourcesOnService(e){return this.externalSources.items.filter(t=>(0,l.eN)(t,e))}get _implicitDisplaySource(){return this.externalSources.find(l.yr)}};(0,r.Cg)([(0,a.MZ)()],c.prototype,"externalSources",void 0),(0,r.Cg)([(0,a.MZ)()],c.prototype,"displaySource",null),(0,r.Cg)([(0,a.MZ)()],c.prototype,"_implicitDisplaySource",null),(0,r.Cg)([(0,a.MZ)()],c.prototype,"_explicitDisplaySource",void 0),c=(0,r.Cg)([(0,a.$K)("esri.geometry.support.meshUtils.Metadata")],c)},66895(e,t,i){i.d(t,{$N:()=>u,Lz:()=>s,QN:()=>h,WO:()=>l,hz:()=>a,o2:()=>n});const r=Symbol("meshContext");function n(e){return e&&"object"==typeof e&&r in e?e[r]:void 0}function s(e,t){const i=n(e);return{...e,[r]:{...i,...t}}}const o=Symbol("meshMaterialContext");function a(e){return e&&"object"==typeof e&&o in e?e[o]:void 0}function l(e){const t=a(e);if(t?.materialMap)return e;const i={materialMap:new Map};return{...e,[o]:i}}const c=Symbol("meshTextureContext");function u(e){return e&&"object"==typeof e&&c in e?e[c]:void 0}function h(e){const t=u(e);if(t?.textureMap)return e;const i={textureMap:new Map};return{...e,[c]:i}}},15070(e,t,i){i.d(t,{Dk:()=>d,H8:()=>u,UG:()=>v,Uh:()=>g,ai:()=>p,bQ:()=>h,uF:()=>f});var r=i(29242),n=i(35522),s=i(51850),o=i(16939),a=i(1193),l=i(27615),c=i(72258);function u(){const{faceDescriptions:e,faceVertexOffsets:t,uvScales:i}=x,r=4*e.length,n=new Float64Array(3*r),s=new Float32Array(3*r),o=new Float32Array(2*r),a=new Uint32Array(2*e.length*3);let l=0,c=0,u=0,h=0;for(let r=0;r<e.length;r++){const d=e[r],p=l/3;for(const e of t)a[h++]=p+e;const f=d.corners;for(let e=0;e<4;e++){const t=f[e];let r=0;o[u++]=.25*i[e][0]+d.uvOrigin[0],o[u++]=d.uvOrigin[1]-.25*i[e][1];for(let e=0;e<3;e++)0!==d.axis[e]?(n[l++]=.5*d.axis[e],s[c++]=d.axis[e]):(n[l++]=.5*t[r++],s[c++]=0)}}return{position:n,normal:s,uv:o,faces:a}}function h(e,t){const i=e.components[0],r=i.faces,n=y[t],s=6*n,a=new Array(6),l=new Array(r.length-6);let c=0,u=0;for(let e=0;e<r.length;e++)e>=s&&e<s+6?a[c++]=r[e]:l[u++]=r[e];if(null!=e.vertexAttributes.uv){const t=new Float32Array(e.vertexAttributes.uv),i=4*n*2,r=[0,1,1,1,1,0,0,0];for(let e=0;e<r.length;e++)t[i+e]=r[e];e.vertexAttributes.uv=t}return e.components=[new o.default({faces:a,material:i.material}),new o.default({faces:l})],e}function d(e=0){const t=Math.round(8*2**e),i=2*t,r=(t-1)*(i+1)+2*i,n=new Float64Array(3*r),s=new Float32Array(3*r),o=new Float32Array(2*r),a=new Uint32Array((t-1)*i*2*3);let l=0,c=0,u=0,h=0;for(let e=0;e<=t;e++){const r=e/t*Math.PI+.5*Math.PI,d=Math.cos(r),p=Math.sin(r);_[2]=p;const f=0===e||e===t,g=f?i-1:i;for(let r=0;r<=g;r++){const p=r/g*2*Math.PI;_[0]=-Math.sin(p)*d,_[1]=Math.cos(p)*d;for(let e=0;e<3;e++)n[l]=.5*_[e],s[l]=_[e],++l;o[c++]=(r+(f?.5:0))/i,o[c++]=e/t,0!==e&&r!==i&&(e!==t&&(a[u++]=h,a[u++]=h+1,a[u++]=h-i),1!==e&&(a[u++]=h,a[u++]=h-i,a[u++]=h-i-1)),h++}}return{position:n,normal:s,uv:o,faces:a}}function p(e=0){const t=Math.round(16*2**e),i=4*(t+1)+2*t,r=new Float64Array(3*i),n=new Float32Array(3*i),s=new Float32Array(2*i),o=new Uint32Array(4*t*3);let a=0,l=0,c=0,u=0,h=0;for(let e=0;e<=5;e++){const i=0===e||5===e,d=e<=1||e>=4,p=2===e||4===e,f=i?t-1:t;for(let g=0;g<=f;g++){const m=g/f*2*Math.PI,v=i?0:.5;_[0]=v*Math.sin(m),_[1]=v*-Math.cos(m),_[2]=e<=2?.5:-.5;for(let t=0;t<3;t++)r[a++]=_[t],n[l++]=d?2===t?e<=1?1:-1:0:2===t?0:_[t]/v;s[c++]=(g+(i?.5:0))/t,s[c++]=e<=1?1*e/3:e<=3?1*(e-2)/3+1/3:1*(e-4)/3+2/3,p||0===e||g===t||(5!==e&&(o[u++]=h,o[u++]=h+1,o[u++]=h-t),1!==e&&(o[u++]=h,o[u++]=h-t,o[u++]=h-t-1)),h++}}return{position:r,normal:n,uv:s,faces:o}}function f(e,t){const i="number"==typeof t?t:null!=t?t.width:1,r="number"==typeof t?t:null!=t?t.height:1;switch(e){case"up":case"down":return{width:i,depth:r};case"north":case"south":return{width:i,height:r};case"east":case"west":return{depth:i,height:r}}}function g(e){const t=m.facingAxisOrderSwap[e],i=m.position,r=m.normal,n=new Float64Array(i.length),s=new Float32Array(r.length);let o=0;for(let e=0;e<4;e++){const e=o;for(let a=0;a<3;a++){const l=t[a],c=Math.abs(l)-1,u=l>=0?1:-1;n[o]=i[e+c]*u,s[o]=r[e+c]*u,o++}}return{position:n,normal:s,uv:new Float32Array(m.uv),faces:new Uint32Array(m.faces),isPlane:!0}}const m={position:[-.5,-.5,0,.5,-.5,0,.5,.5,0,-.5,.5,0],normal:[0,0,1,0,0,1,0,0,1,0,0,1],uv:[0,1,1,1,1,0,0,0],faces:[0,1,2,0,2,3],facingAxisOrderSwap:{east:[3,1,2],west:[-3,-1,2],north:[-1,3,2],south:[1,-3,2],up:[1,2,3],down:[1,-2,-3]}};function v(e,t,i){e.isPlane||function(e){for(let t=0;t<e.position.length;t+=3)e.position[t+2]+=.5}(e),function(e,t){if(null!=t){b[0]=t[0],b[4]=t[1],b[8]=t[2];for(let t=0;t<e.position.length;t+=3){for(let i=0;i<3;i++)_[i]=e.position[t+i];(0,n.ei)(_,_,b);for(let i=0;i<3;i++)e.position[t+i]=_[i]}if(t[0]!==t[1]||t[1]!==t[2]){b[0]=1/t[0],b[4]=1/t[1],b[8]=1/t[2];for(let t=0;t<e.normal.length;t+=3){for(let i=0;i<3;i++)_[i]=e.normal[t+i];(0,n.ei)(_,_,b),(0,n.S8)(_,_);for(let i=0;i<3;i++)e.normal[t+i]=_[i]}}}}(e,function(e,t,i){const r=(0,c.xK)(t,i);if(null==e&&1===r)return null;if(null==e)return[r,r,r];if("number"==typeof e){const t=e*r;return[t,t,t]}return[null!=e.width?e.width*r:r,null!=e.depth?e.depth*r:r,null!=e.height?e.height*r:r]}(i?.size,i?.unit,t.spatialReference));const r=(0,l.TE)(t,i),s=t.spatialReference.isGeographic?(0,l.TE)(t):r,u=(0,c.UR)({vertexAttributes:e,vertexSpace:s,spatialReference:t.spatialReference},r,{allowBufferReuse:!0});return{vertexAttributes:new a.default({...u,uv:e.uv}),vertexSpace:r,components:[new o.default({faces:e.faces,material:i?.material||null})],spatialReference:t.spatialReference}}const x={faceDescriptions:[{axis:[0,-1,0],uvOrigin:[0,.625],corners:[[-1,-1],[1,-1],[1,1],[-1,1]]},{axis:[1,0,0],uvOrigin:[.25,.625],corners:[[-1,-1],[1,-1],[1,1],[-1,1]]},{axis:[0,1,0],uvOrigin:[.5,.625],corners:[[1,-1],[-1,-1],[-1,1],[1,1]]},{axis:[-1,0,0],uvOrigin:[.75,.625],corners:[[1,-1],[-1,-1],[-1,1],[1,1]]},{axis:[0,0,1],uvOrigin:[0,.375],corners:[[-1,-1],[1,-1],[1,1],[-1,1]]},{axis:[0,0,-1],uvOrigin:[0,.875],corners:[[-1,1],[1,1],[1,-1],[-1,-1]]}],uvScales:[[0,0],[1,0],[1,1],[0,1]],faceVertexOffsets:[0,1,2,0,2,3]},y={south:0,east:1,north:2,west:3,up:4,down:5},_=(0,s.vt)(),b=(0,r.vt)()},22141(e,t,i){i.d(t,{$5:()=>w,CN:()=>y,JP:()=>x,KM:()=>T,Mv:()=>E,X4:()=>_,gr:()=>S,qs:()=>C,si:()=>b,xA:()=>A});var r=i(34727),n=i(77690),s=i(29242),o=i(58083),a=i(9093),l=i(35522),c=i(51850),u=i(73941),h=i(48353),d=i(9762),p=(i(79258),i(21325)),f=i(28735),g=i(13030),m=i(73354),v=i(50867);const x="Projection may be possible after calling projection.load().";function y(e,t,i,r){e.error(`Failed to project from (wkid:${t.wkid}) to (wkid:${i.wkid}).${r?" ":""}${r}`)}function _(e,t,i,r,n,s){return O(0,g.xs.fromTypedArray(e),0,g.Xm.fromTypedArray(t),i,g.Xm.fromTypedArray(r),n,g.xs.fromTypedArray(s))?s:null}function b(e,t,i,r,n,s){return O(1,g.xs.fromTypedArray(e),0,g.Xm.fromTypedArray(t),i,g.Xm.fromTypedArray(r),n,g.xs.fromTypedArray(s))?s:null}function S(e,t,i,r){return(0,d.projectBuffer)(e,t,0,i,r,0)?i:null}function w(e,t,i,r){return(0,d.projectBuffer)(e,t,0,i,r,0)?i:null}function C(e,t,i){return(0,n.Ge)(I,i),(0,m.b)(t,e,I),(0,r.or)(I)&&(0,m.n)(t,t),t}function T(e,t,i){return(0,n.z0)(I,i),(0,v.t)(t,e,I),(0,r.or)(I)&&(0,m.n)(t,t,4),t}function A(e,t,i,r,n,s){if(!O(0,g.xs.fromTypedArray(e,4*Float32Array.BYTES_PER_ELEMENT),1,g.Xm.fromTypedArray(t),i,g.Xm.fromTypedArray(r),n,g.xs.fromTypedArray(s,4*Float32Array.BYTES_PER_ELEMENT)))return null;for(let t=3;t<e.length;t+=4)s[t]=e[t];return s}function E(e,t,i,r,n,s){if(!O(1,g.xs.fromTypedArray(e,16),1,g.Xm.fromTypedArray(t),i,g.Xm.fromTypedArray(r),n,g.xs.fromTypedArray(s,16)))return null;for(let t=3;t<e.length;t+=4)s[t]=e[t];return s}function R(e,t,i,r,s){switch((0,h.l)(r,i,P,r),1===e&&(0,o.B8)(P,P),t){case 0:return(0,n.Ge)(s,P);case 1:return(0,n.z0)(s,P)}}function O(e,t,i,r,n,s,o,a){if(!t)return;const c=r.count;if(function(e){return e.isWGS84||(0,p.x1)(e)||(0,u.q8)(e)||(0,u.KQ)(e)}(n))for(let r=0;r<c;r++)s.getVec(r,M),t.getVec(r,L),(0,l.ei)(L,L,R(e,i,M,o,I)),a.setVec(r,L);else for(let n=0;n<c;n++){s.getVec(n,M),t.getVec(n,L);const c=(0,f.jg)(r.get(n,1));let u=Math.cos(c);1===i!=(0===e)&&(u=1/u),R(e,i,M,o,I),0===e?(I[0]*=u,I[1]*=u,I[2]*=u,I[3]*=u,I[4]*=u,I[5]*=u):(I[0]*=u,I[3]*=u,I[6]*=u,I[1]*=u,I[4]*=u,I[7]*=u),(0,l.ei)(L,L,I),(0,l.S8)(L,L),a.setVec(n,L)}return a}const M=(0,c.vt)(),L=(0,c.vt)(),P=(0,a.vt)(),I=(0,s.vt)()},72258(e,t,i){i.d(t,{UR:()=>b,p5:()=>_,xK:()=>E});var r=i(53966),n=i(34727),s=i(86211),o=i(77690),a=i(29242),l=i(58083),c=i(9093),u=i(35522),h=i(51850),d=i(73941),p=i(98764),f=i(48353),g=i(65806),m=i(27615),v=i(73354),x=i(22141);const y=()=>r.A.getLogger("esri.geometry.support.meshUtils.vertexSpaceConversion");function _(e,t,{vertexSpace:i,spatialReference:r}){if("georeferenced"===i.type){const n=e;if(!(0,g.g)(t,n,r))return!1;const{origin:s}=i;return(0,u.Re)(e,n,s),!0}const n=(0,p.lO)(r),s=e;if(!(0,g.g)(t,s,n))return!1;const{origin:o}=i,a=P;if(!(0,f.l)(r,o,a,n))return!1;const c=(0,l.B8)(P,a);return null!=c&&((0,u.Z0)(e,s,c),!0)}function b(e,t,i){const{vertexSpace:r,transform:n,vertexAttributes:s}=e,a=(0,m.Hq)(r)?n:null,h=T(e.spatialReference,i,3);if((0,m.yJ)(r,t)&&(!a||(0,l.t2)(a.localMatrix,c.zK))&&A(h)){const{position:e,normal:t,tangent:r}=s,n=i?.allowBufferReuse;return{position:n?e:e.slice(),normal:n?t:t?.slice(),tangent:n?r:r?.slice()}}switch(e.vertexSpace.type){case"local":return"local"===t.type?function({vertexAttributes:e,spatialReference:t,transform:i},{origin:r},n,s){const o=S(t,s);if(!(0,f.l)(t,r,R,o))return(0,x.CN)(y(),t,o),null;if(i&&(0,l.lw)(R,R,i.localMatrix),!(0,f.l)(t,n,O,o))return(0,x.CN)(y(),o,t),null;(0,l.B8)(O,O);const a=(0,l.lw)(R,O,R);return C(a,t,s,3),w(e,a)}(e,e.vertexSpace,t.origin,i):function({spatialReference:e,vertexAttributes:t,transform:i},{origin:r},n,s){const o=S(e,s);if(!(0,f.l)(e,r,R,o))return(0,x.CN)(y(),e,o),null;i&&(0,l.lw)(R,R,i.localMatrix),C(R,e,s,1);const a=new Float64Array(t.position.length),c=function(e,t,i,r,n){(0,v.a)(r,e,t);const s=new Float64Array(e.length);return(0,x.$5)(r,n,s,i)?s:((0,x.CN)(y(),n,i),null)}(t.position,R,e,a,o);if(!c)return null;const h=function(e,t,i,r,n,s){if(null==n)return null;const o=new Float32Array(n.length);return(0,x.qs)(n,o,s),(0,x.si)(o,e,t,i,r,o)?o:((0,x.CN)(y(),r,t),null)}(c,e,a,o,t.normal,R);if(t.normal&&!h)return null;const d=function(e,t,i,r,n,s){if(null==n)return null;const o=new Float32Array(n.length);return(0,x.KM)(n,o,s),(0,x.Mv)(o,e,t,i,r,o)?o:((0,x.CN)(y(),r,t),null)}(c,e,a,o,t.tangent,R);if(t.tangent&&!d)return null;if(n){const e=(0,u.ze)(L,n);(0,v.t)(c,c,e)}return{position:c,normal:h,tangent:d}}(e,e.vertexSpace,t.origin,i);case"georeferenced":return"local"===t.type?function({vertexAttributes:e,spatialReference:t,transform:i},{origin:r},n,s){const a=S(t,s);if(!(0,f.l)(t,n,R,a))return(0,x.CN)(y(),t,a),null;const c=1/T(t,s,2);(0,l.hs)(R,R,[c,c,c]);const u=(0,l.B8)(O,R),{position:h,normal:d,tangent:p}=function(e,t,i){if(!t)return e;if(!i){const{position:i,normal:r,tangent:n}=e;return{position:(0,v.t)(new Float64Array(i.length),i,t),tangent:n,normal:r}}const r=w(e,i.localMatrix);return(0,v.t)(r.position,r.position,t),r}(e,r,i),g=new Float64Array(h.length),m=function(e,t,i,r,n){const s=(0,x.gr)(e,t,r,n);if(!s)return(0,x.CN)(y(),t,n),null;const o=new Float64Array(s.length);return(0,v.a)(o,s,i),o}(h,t,u,g,a);if(!m)return null;const _=(0,o.Ge)(M,u),b=function(e,t,i,r,n,s,o){if(null==e)return null;const a=o??new Float32Array(e.length);return(0,x.X4)(e,t,i,r,n,a)?((0,v.b)(a,a,s),a):((0,x.CN)(y(),i,n),null)}(d,h,t,g,a,_,d!==e.normal?d:void 0);if(!b&&d)return null;const C=function(e,t,i,r,n,s,o){if(null==e)return null;const a=o??new Float32Array(e.length);return(0,x.xA)(e,t,i,r,n,a)?((0,v.b)(a,a,s,4),a):((0,x.CN)(y(),i,n),null)}(p,h,t,g,a,_,p!==e.tangent?p:void 0);return!C&&p?null:{position:m,normal:b,tangent:C}}(e,e.vertexSpace,t.origin,i):function({vertexAttributes:e,transform:t,spatialReference:i},{origin:r},n,s){const o=T(i,s,3),a=r||!A(o)?(0,l.C)(R,t?.localMatrix??c.zK):null;a&&C(a,i,s,3);const{position:h,normal:d,tangent:p}=a?w(e,a):e,f=s?.allowBufferReuse,g=f?h:new Float64Array(h.length);let m=h;if(r&&(m=(0,v.t)(g,m,r)),n){const e=(0,u.ze)(L,n);m=(0,v.t)(g,m,e)}return{position:m!==e.position||f?m:m.slice(),normal:d!==e.normal||f?d:d?.slice(),tangent:p!==e.tangent||f?p:p?.slice()}}(e,e.vertexSpace,t.origin,i)}}function S(e,t){return t?.useEllipsoid&&(0,d.B3)(e)?p.Y0:(0,p.lO)(e)}function w(e,t){const i=new Float64Array(e.position.length);(0,v.a)(i,e.position,t);const r=e.normal?new Float32Array(e.normal.length):null,n=e.tangent?new Float32Array(e.tangent.length):null;return r&&e.normal&&(0,x.qs)(e.normal,r,t),n&&e.tangent&&(0,x.KM)(e.tangent,n,t),{position:i,normal:r,tangent:n}}function C(e,t,i,r){const n=T(t,i,r);A(n)||(0,l.hs)(e,e,[n,n,n])}function T(e,t,i){const r=!!(1&i),n=!!(2&i),s=t?.sourceUnit,o=t?.targetUnit;if(!s&&!o)return 1;let a=E(s,e);r||!s||A(a)||(y().warn("source unit conversion not supported"),a=1);let l=1/E(o,e);return n||!o||A(l)||(y().warn("target unit conversion not supported"),l=1),a*l}function A(e){return(0,n.Io)(e,1)}function E(e,t){if(null==e)return 1;const i=(0,s.KX)(t);return 1/(0,s.oU)(i,"meters",e)}const R=(0,c.vt)(),O=(0,c.vt)(),M=(0,a.vt)(),L=(0,h.vt)(),P=(0,c.vt)()},27615(e,t,i){i.d(t,{CK:()=>l,Hq:()=>a,MW:()=>c,TE:()=>u,yJ:()=>h});var r=i(35522),n=i(86738),s=i(95696),o=i(18251);function a(e){return null!=e.origin}function l(e){return a(e.vertexSpace)}function c(e,t){if(!a(e))return null;const[i,r,s]=e.origin;return new n.A({x:i,y:r,z:s,spatialReference:t})}function u(e,t){const{x:i,y:r,z:n,spatialReference:a}=e,l=[i,r,n??0];return"local"===(t?.vertexSpace??function(e){return e.isGeographic||e.isWebMercator?"local":"georeferenced"}(a))?new o.default({origin:l}):new s.A({origin:l})}function h(e,t){return e.type===t.type&&(e.origin===t.origin||null!=e.origin&&null!=t.origin&&(0,r.t2)(e.origin,t.origin))}},65801(e,t,i){i.d(t,{uM:()=>Hr});var r=i(17676),n=i(9762),s=i(4197),o=i(58083),a=i(9093),l=i(51850);i(48353),(0,a.vt)(),new class{constructor(){this.verticalDistanceToGround=0,this.sampledElevation=0,this.z=0}},(0,l.vt)();var c=i(44208),u=i(53966),h=i(62788),d=i(95488),p=i(83349),f=i(15585),g=i(95108),m=i(97146),v=i(34727),x=i(86211),y=i(35522),_=i(27921);const b=(0,_.vt)();function S(e,t,i){if(!t)return 2;const r=e.map(e=>{const r=L(e,t);return r<3?2:function(e,t,i){const r=function(e,t,i,r){const n=(e=>!Array.isArray(e[0]))(t)?(e,i)=>t[3*e+i]:(e,i)=>t[e][i],s=(0,x.GA)(r)/(0,x.G9)(r);return(0,_.lU)(e,(e,t)=>(0,y.hZ)(e,n(t,0)*s,n(t,1)*s,n(t,2)),i)}(b,e,t,i)?(0,_.Qj)(b):[0,0,1];return Math.abs(r[2])>Math.cos((0,v.kU)(80))?2:Math.abs(r[1])>Math.abs(r[0])?1:0}(e,r,i)}),n=r[0];return r.every(e=>e===n)?n:2}function w(e,t,i){if(!t)return!(0,g.$3)(e);if(e.length<3)return!1;switch(i){case 0:return!(0,g.$3)(e,1,2);case 1:return!(0,g.$3)(e,0,2);case 2:return!(0,g.$3)(e,0,1)}}const C=new d.I;let T=new WeakSet;function A(e,t){if(!(0,f.O9)())return P("libtess-not-loaded");const i=null!=t.outlines,{positions:r,mergedPathLengths:n}=function(e){const t=function(e){const t=e.reduce((e,t)=>e+t.pathLengths.length,0),i=new Array(t);let r=0;for(let t=0;t<e.length;t++){const n=e[t].pathLengths;for(let e=0;e<n.length;e++)i[r++]=n[e]}return i}(e.polygons),i=3*e.polygonVertexCount;return i===e.positions.length?{positions:e.positions,mergedPathLengths:t}:{positions:(0,s.l5)(e.positions,0,i),mergedPathLengths:t}}(e),o=performance.now(),{vertices:a,indices:l,outlineIndices:c,outlineRingLengths:u}=(0,f.O5)(r,n,3,i),h=performance.now()-o;if(null!=t.owner&&h>250&&T.add(t.owner),a.length%3!=0)return P("positions-not-multiple-of-3");const{positions:d,outlineIndexBuffer:p,mergedOutlineRingLengths:g}=i?function(e,t,i,r,n){const o=e.polygonVertexCount,a=t?.filter(e=>e.index>=o)??[];if(0===a.length)return{positions:i,outlineIndexBuffer:r,mergedOutlineRingLengths:n};const l=3*o,c=(0,s.l5)(e.positions,l,e.positions.length-l),u=(0,s.yH)(i,c),h=i.length/3,d=a.map(e=>({index:h+e.index-o,count:e.count})),{outlineIndexBuffer:p,outlineRingLengths:f}=R(d,u);return{positions:u,outlineIndexBuffer:(0,m.lC)(r,p,u.length/3),mergedOutlineRingLengths:(0,m.lC)(n,f,n.length+f.length)}}(e,t.outlines,a,c,u):{positions:a,outlineIndexBuffer:void 0,mergedOutlineRingLengths:void 0};return{succeeded:!0,positions:d,indices:l,outlineIndexBuffer:p,outlineRingLengths:g,vertexCount:d.length/3,method:"libtess"}}function E(e,t,i){for(let r=0;r<e.length;r+=3){const n=e[r+t];e[r+t]=e[r+i],e[r+i]=n}}function R(e,t){const i=(0,m.my)(e.length);let r=0;for(let n=0;n<e.length;n++){const s=e[n],o=s.count;if(o<=0){i[n]=0;continue}const a=3*s.index,l=3*(s.index+o-1),c=o>1&&t[a]===t[l]&&t[a+1]===t[l+1]&&t[a+2]===t[l+2]?o-1:o,u=c>0?c+1:0;i[n]=u,r+=u}const n=(0,m.my)(r,t.length/3);let s=0;for(let t=0;t<e.length;t++){const r=i[t];if(0===r)continue;const o=e[t].index,a=r-1;for(let e=0;e<a;e++)n[s++]=o+e;n[s++]=o}return{outlineIndexBuffer:n,outlineRingLengths:i}}function O(e,{index:t,count:i}){return(0,s.l5)(e,3*t,3*i)}function M(e,t,i,r,n,s){let o=s?e.length-1:0;const a=s?-1:1;i*=3;for(let s=0;s<r;++s){const r=e[o];t[i++]=r[0],t[i++]=r[1],t[i++]=n&&null!=r[2]?r[2]:0,o+=a}return i/3}function L(e,t){return function(e,t){const i=e.length;if(i<2)return!1;const r=e[0],n=e[i-1];return r[0]===n[0]&&r[1]===n[1]&&(!t||r[2]===n[2])}(e,t)?e.length-1:e.length}function P(e){return{succeeded:!1,message:e}}var I=i(5482),D=i(4576),F=i(65529),N=i(91869),z=i(97768),H=i(15142),V=i(36708),W=i(3483),j=i(91429),U=i(26857),B=i(78955),$=i(19419);class Z{constructor(e,t){this.vec3=e,this.id=t}}function k(e,t,i,r){return new Z((0,l.fA)(e,t,i),r)}class G{constructor(){this._extent=(0,$.vt)(),this.resolution=0,this.renderLocalOrigin=k(0,0,0,"O"),this.pixelRatio=1,this.mapUnitsPerPixel=1,this.canvasGeometries=new q}get extent(){return this._extent}setExtent(e){(0,B.C)(this._extent,e)}setupGeometryViews(e){if(this._setupGeometryView(),!e)return;const t=.001*e.range;if(this._extent[0]-t<=e.min){const t=this.canvasGeometries.extents[this.canvasGeometries.numViews++];(0,$.cY)(this._extent,e.range,0,t)}if(this._extent[2]+t>=e.max){const t=this.canvasGeometries.extents[this.canvasGeometries.numViews++];(0,$.cY)(this._extent,-e.range,0,t)}}_setupGeometryView(){this.canvasGeometries.numViews=1,(0,$.C)(this.canvasGeometries.extents[0],this._extent)}hasSomeSizedView(){for(let e=0;e<this.canvasGeometries.numViews;e++){const t=this.canvasGeometries.extents[e];if(t[0]!==t[2]&&t[1]!==t[3])return!0}return!1}}class q{constructor(){this.extents=[(0,$.vt)(),(0,$.vt)(),(0,$.vt)()],this.numViews=0}}class Y{constructor(e,t,i){this._fbos=e,this._format=t,this._name=i}get valid(){return null!=this._handle?.getTexture()}dispose(){this._handle=(0,z.Gz)(this._handle)}get texture(){return this._handle?.getTexture()}ensureFramebuffer(e,t){this._handle&&this._handle.fbo?.width===e&&this._handle.fbo?.height===t||(this._handle?.release(),this._handle=this._fbos.acquire(e,t,this._name,this._format))}bind(e){e.bindFramebuffer(this._handle?.fbo)}generateMipMap(){this._handle?.getTexture()?.descriptor?.hasMipmap&&this._handle?.getTexture()?.generateMipmap()}}var Q=i(16943);class X{constructor(e,t,i,r,n=1,s=6){this.output=i,this.content=r,this.redrawOnRequest=n,this.fbo=new Y(e,s,t)}handleRenderRequest(e){return 1===e||e===this.redrawOnRequest}get valid(){return this.fbo.valid}}class K{constructor(e){const t=[new X(e,"overlay color",0,0),new X(e,"overlay IM color",0,1),new X(e,"overlay highlight",10,2,1,3),new X(e,"overlay water",4,3,0),new X(e,"overlay occluded",0,4)];(0,Q.E)()&&t.push(new X(e,"overlay olid",11,5,1,5)),this.targets=t}getTexture(e){return this.targets[e]?.fbo.texture}dispose(e){if(0!==e)for(const e of this.targets)e.fbo.dispose();else this.targets[3].fbo.dispose()}computeValidity(){return this.targets.reduce((e,t,i)=>t.valid?e|=1<<i:e,0)}}var J=i(91712),ee=i(69622);class te extends ee.A{precompile(e){return!!this.acquireTechniques(e)}get usedMemory(){return 0}get renderOccludedFlags(){return 1}get testsTransparentRenderOrder(){return 0}get isDecoration(){return!1}get readyToRun(){return!1}get numGeometries(){return 0}get hasOccludees(){return!1}get emissions(){return 0}forEachGeometry(e){}}class ie extends te{}var re=i(37585),ne=i(92044),se=i(78607),oe=i(13840),ae=i(98958),le=i(72091),ce=i(41976),ue=i(90644);let he=class extends ae.w{constructor(e,t){super(e,t,ce.wR),this.shader=new oe.r(le.H,()=>i.e(785).then(i.bind(i,13166)))}initializePipeline(){return(0,ue.Ey)({blending:ue.T8,colorWrite:ue.kn})}};he=(0,I.Cg)([(0,j.$K)("esri.views.3d.webgl-engine.effects.highlight.HighlightApplyTechnique")],he);var de=i(28476);let pe=class extends ae.w{constructor(e,t){super(e,t,ce.wR),this.shader=new oe.r(de.a,()=>i.e(6027).then(i.bind(i,76027)))}initializePipeline(){return(0,ue.Ey)({colorWrite:ue.kn})}};pe=(0,I.Cg)([(0,j.$K)("esri.views.3d.webgl-engine.effects.highlight.HighlightBlurTechnique")],pe);var fe=i(34053);let ge=class extends ae.w{constructor(){super(...arguments),this.shader=new oe.r(fe.a,()=>i.e(9438).then(i.bind(i,29438)))}initializePipeline(){return(0,ue.Ey)({colorWrite:ue.kn})}};ge=(0,I.Cg)([(0,j.$K)("esri.views.3d.webgl-engine.effects.highlight.HighlightDownsampleTechnique")],ge);var me=i(68197);new me.A("cyan"),new me.A("black"),new me.A("yellow");var ve=i(65786);class xe extends ve.Y{constructor(){super(...arguments),this.occludedFactor=.25,this.verticalCellCount=0,this.horizontalCellCount=0,this.highlightLevel=0,this.pixelRatio=1}}var ye=i(16824);let _e=class extends ae.w{constructor(e,t){super(e,t,ce.wR),this.shader=new oe.r(ye.H,()=>i.e(1011).then(i.bind(i,51011)))}initializePipeline(){return(0,ue.Ey)({colorWrite:ue.kn})}};_e=(0,I.Cg)([(0,j.$K)("esri.views.3d.webgl-engine.effects.highlight.HighlightToSingleTechnique")],_e);var be=i(79785);class Se extends be.Z{}var we=i(48852),Ce=i(63907),Te=i(21231),Ae=i(67171),Ee=i(66289);let Re=class extends se.A{constructor(){super(...arguments),this.consumes={required:[ne.OG.HIGHLIGHT_COLOR,"highlights"]},this.produces=ne.OG.HIGHLIGHT_COLOR,this._downsampleDrawParameters=new fe.H,this._passParameters=new xe,this._highlightBlurDrawParameters=new de.H,this._grid=new Oe}initialize(){this.addHandles([(0,V.wB)(()=>this._updateOptionsTexture(),()=>{},V.Vh)])}destroy(){this._grid.coverage=(0,z.Gz)(this._grid.coverage),this._grid.vao=(0,z.WD)(this._grid.vao),this._passParameters.highlightOptionsTexture=(0,z.Gz)(this._passParameters.highlightOptionsTexture)}_updateOptionsTexture(){if(null==this._passParameters.highlightOptionsTexture){const e=new Ae.R(16,2);e.internalFormat=6408,e.samplingMode=9728,this._passParameters.highlightOptionsTexture=new Te.A(this.renderingContext,e,null)}this._passParameters.highlightOptionsTexture.setData(function(e){const t=new Uint8Array(128);let i=0;for(const r of e){const e=4*i,n=4*i+64;++i;const{color:s}=r,o=r.haloColor??s;t[e+0]=s.r,t[e+1]=s.g,t[e+2]=s.b,t[e+3]=r.fillOpacity*s.a*255,t[n+0]=o.r,t[n+1]=o.g,t[n+2]=o.b,t[n+3]=r.haloOpacity*o.a*255}return t}(this.view.state.highlights)),this.requestRender(1)}render(e){const t=e.find(({name:e})=>e===ne.OG.HIGHLIGHT_COLOR),{techniques:i,bindParameters:r,fboCache:n,_passParameters:s,renderingContext:o}=this;if(!r.decorations)return t;const a=i.getCompiled(ge),l=i.getCompiled(_e),c=i.getCompiled(pe),u=i.getCompiled(he);if(!(a&&u&&c&&l))return this.requestRender(1),t;const h=e.find(({name:e})=>"highlights"===e).getTexture();s.highlightTexture=h;const d=this._prepareAndDownSample(h),{width:p,height:f}=h.descriptor;s.highlightTexture=h;const{camera:g}=r,{fullWidth:m,fullHeight:v,pixelRatio:x,fullViewport:y}=g,_=Math.ceil(m/x),b=Math.ceil(v/x),{_highlightBlurDrawParameters:S}=this,w=this.view.stage.renderView.renderer,{highlights:C}=r;for(let e=0;e<C.length;++e){const{name:i}=C[e];if(!w.hasHighlight(i))continue;s.highlightLevel=e,o.setClearColor(0,0,0,0);const a=n.acquire(p,f,"single highlight",2);o.bindFramebuffer(a.fbo),o.setViewport(0,0,p,f),o.clear(16384),o.bindTechnique(l,r,s),this._renderGrid(d),S.blurInput=a.getTexture(),(0,re.hZ)(S.blurSize,1/_,0);const h=n.acquire(_,b,"single highlight blur",2);o.unbindTexture(h.fbo?.colorTexture),o.bindFramebuffer(h.fbo),o.setViewport(0,0,_,b),o.clear(16384),o.bindTechnique(c,r,s,S),this._renderGrid(d),a.release(),(0,re.hZ)(S.blurSize,0,1/b),s.highlightBlurTexture=h.getTexture(),o.bindFramebuffer(t.fbo),o.setDrawBuffers([Ce.r6]),o.setViewport4fv(y),o.bindTechnique(u,r,s,S),this._renderGrid(d),h.release()}return s.coverageTexture=s.highlightTexture=null,t}_prepareAndDownSample(e){this._gridUpdateResources(e);const t=this.techniques.get(ge),i=this._gridComputeCoverage(t,e),{horizontalCellCount:r,verticalCellCount:n}=i,s=this._passParameters;return s.horizontalCellCount=r,s.verticalCellCount=n,s.coverageTexture=i.coverage?.getTexture(),i}_renderGrid(e){const t=e.verticalCellCount*e.horizontalCellCount;this.renderingContext.bindVAO(e.vao),this.renderingContext.drawElementsInstanced(Ce.WR.TRIANGLES,6,Ce.pe.UNSIGNED_BYTE,0,t)}_gridUpdateResources(e){const t=this._grid,{width:i,height:r}=e.descriptor;if(t.horizontalCellCount=Math.ceil(i/fe.g),t.verticalCellCount=Math.ceil(r/fe.g),t.vao)return;const n=this.renderingContext,s=we.g.createIndex(n,35044,Le);t.vao=new Se(n,new Ee.R(n,ce.wR),s)}_gridComputeCoverage(e,t){const i=this.renderingContext,r=this._grid,n=t.descriptor,s=Math.ceil(n.width/fe.g),o=Math.ceil(n.height/fe.g);this._downsampleDrawParameters.input=t;const{highlights:a}=this.bindParameters;r.coverage?.release();const l=this.fboCache.acquire(s,o,"highlight coverage",a.length>Pe?3:1);return r.coverage=l,i.bindFramebuffer(l.fbo),i.bindTechnique(e,this.bindParameters,this._passParameters,this._downsampleDrawParameters),i.setViewport(0,0,s,o),i.screen.draw(),r}get test(){}};(0,I.Cg)([(0,j.MZ)()],Re.prototype,"consumes",void 0),(0,I.Cg)([(0,j.MZ)()],Re.prototype,"produces",void 0),Re=(0,I.Cg)([(0,j.$K)("esri.views.3d.webgl-engine.effects.highlight.Highlight")],Re);class Oe{constructor(){this.coverage=null,this.vao=null,this.verticalCellCount=0,this.horizontalCellCount=0,this.viewportWidth=0,this.viewportHeight=0}}let Me=0;const Le=new Uint8Array([0,1,2,2,1,3]),Pe=4;class Ie{constructor(e,t,i){this.material=e,this.techniques=t,this.textures=i}}var De=i(620);class Fe{constructor(e,t,i,r){this._textures=e,this._techniques=t,this.materialChanged=i,this.requestRender=r,this._id2glMaterialRef=new Map}dispose(){this._textures.destroy()}acquire(e,t,i){this._ownMaterial(e);const r=e.produces.get(t);if(!r?.(i))return null;let n=this._id2glMaterialRef.get(e.id);if(null==n){const t=e.createGLMaterial(new Ie(e,this._techniques,this._textures));n=new Ne(t),this._id2glMaterialRef.set(e.id,n)}return n.ref(),n.glMaterial}release(e){const t=this._id2glMaterialRef.get(e.id);null!=t&&(t.unref(),t.referenced||((0,z.WD)(t.glMaterial),this._id2glMaterialRef.delete(e.id)))}_ownMaterial(e){e.repository&&e.repository!==this&&u.A.getLogger("esri.views.3d.webgl-engine.lib.GLMaterialRepository").error("Material is already owned by a different material repository"),e.repository=this}}class Ne{constructor(e){this.glMaterial=e,this._refCnt=0}ref(){++this._refCnt}unref(){--this._refCnt,(0,De.vA)(this._refCnt>=0)}get referenced(){return this._refCnt>0}}var ze=i(24326),He=i(91829),Ve=i(46610),We=i(16613),je=i(94008),Ue=i(32728),Be=i(17478);function $e(e,t){return null==e&&(e=[]),e.push(t),e}function Ze(e,t){if(null==e)return null;const i=e.filter(e=>e!==t);return 0===i.length?null:i}i(28449),(0,l.vt)(),new Float32Array(6);class ke{constructor(e={}){this.id=(0,ze.c)(),this._highlightIds=new Set,this._shaderTransformation=null,this._visible=!0,this.castShadow=e.castShadow??!0,this.usesVerticalDistanceToGround=e.usesVerticalDistanceToGround??!1,this.graphicUid=e.graphicUid,this.layerViewUid=e.layerViewUid,e.isElevationSource&&(this.lastValidElevationBB=new Ge),this._geometries=e.geometries?Array.from(e.geometries):[]}dispose(){this._geometries.length=0}get layer(){return this._layer}set layer(e){(0,De.vA)(null==this._layer||null==e,"Object3D can only be added to a single Layer"),this._layer=e}addGeometry(e){e.visible=this._visible,this._geometries.push(e);for(const t of this._highlightIds)e.addHighlight(t);this._emit("geometryAdded",{object:this,geometry:e}),this._highlightIds.size&&this._emit("highlightChanged",this),this._invalidateBoundingVolume()}removeGeometry(e){const t=this._geometries.splice(e,1)[0];if(t){for(const e of this._highlightIds)t.removeHighlight(e);this._emit("geometryRemoved",{object:this,geometry:t}),this._highlightIds.size&&this._emit("highlightChanged",this),this._invalidateBoundingVolume()}}removeAllGeometries(){for(;this._geometries.length>0;)this.removeGeometry(0)}geometryVertexAttributeUpdated(e,t,i=!1){this._emit("attributesChanged",{object:this,geometry:e,attribute:t,sync:i}),function(e){return"position"===e}(t)&&this._invalidateBoundingVolume()}get visible(){return this._visible}set visible(e){if(this._visible!==e){this._visible=e;for(const e of this._geometries)e.visible=this._visible;this._emit("visibilityChanged",this)}}maskOccludee(){const e=new Be.p;for(const t of this._geometries)t.occludees=$e(t.occludees,e);return this._emit("occlusionChanged",this),e}removeOcclude(e){for(const t of this._geometries)t.occludees=Ze(t.occludees,e);this._emit("occlusionChanged",this)}highlight(e){const t=new Be.h(e);for(const e of this._geometries)e.addHighlight(t);return this._emit("highlightChanged",this),this._highlightIds.add(t),t}removeHighlight(e){this._highlightIds.delete(e);for(const t of this._geometries)t.removeHighlight(e);this._emit("highlightChanged",this)}removeStateID(e){0===e.channel?this.removeHighlight(e):this.removeOcclude(e)}getCombinedStaticTransformation(e,t){return(0,o.lw)(t,this.transformation,e.transformation)}getCombinedShaderTransformation(e,t=(0,a.vt)()){return(0,o.lw)(t,this.effectiveTransformation,e.transformation)}get boundingVolumeWorldSpace(){return this._bvWorldSpace||(this._bvWorldSpace=new qe,this._validateBoundingVolume(this._bvWorldSpace,0)),this._bvWorldSpace}get boundingVolumeObjectSpace(){return this._bvObjectSpace||(this._bvObjectSpace=new qe,this._validateBoundingVolume(this._bvObjectSpace,1)),this._bvObjectSpace}_validateBoundingVolume(e,t){const i=1===t;for(const t of this._geometries){const r=t.boundingInfo;r&&Ye(r,e,i?t.transformation:this.getCombinedShaderTransformation(t))}(0,y.Cc)(e.bounds.center,e.min,e.max,.5);for(const t of this._geometries){const r=t.boundingInfo;if(null==r)continue;const n=i?t.transformation:this.getCombinedShaderTransformation(t),s=(0,Ue.hG)(n);(0,y.Z0)(Je,r.center,n);const o=(0,y.Io)(Je,e.bounds.center),a=r.radius*s;e.bounds.radius=Math.max(e.bounds.radius,o+a)}}_invalidateBoundingVolume(){const e=this._bvWorldSpace?.bounds;this._bvObjectSpace=this._bvWorldSpace=void 0,this.layer&&e&&this.layer.notifyObjectBBChanged(this,e)}_emit(e,t){this.layer?.events.emit(e,t)}get geometries(){return this._geometries}get transformation(){return this._transformation??a.zK}set transformation(e){this._transformation=(0,o.C)(this._transformation??(0,a.vt)(),e),this._invalidateBoundingVolume(),this._emit("transformationChanged",this)}get shaderTransformation(){return this._shaderTransformation}set shaderTransformation(e){this._shaderTransformation=e?(0,o.C)(this._shaderTransformation??(0,a.vt)(),e):null,this._invalidateBoundingVolume(),this._emit("shaderTransformationChanged",this)}get effectiveTransformation(){return this.shaderTransformation??this.transformation}get test(){}}class Ge{constructor(){this._data=[Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE]}get min(){return(0,l.fA)(this._data[0],this._data[1],this._data[2])}get max(){return(0,l.fA)(this._data[3],this._data[4],this._data[5])}minWith(e){const{_data:t}=this;t[0]=Math.min(t[0],e[0]),t[1]=Math.min(t[1],e[1]),t[2]=Math.min(t[2],e[2])}maxWith(e){const{_data:t}=this;t[3]=Math.max(t[3],e[0]),t[4]=Math.max(t[4],e[1]),t[5]=Math.max(t[5],e[2])}assignMinMax(e,t){for(let i=0;i<3;++i)this._data[0+i]=e[i],this._data[3+i]=t[i]}isEmpty(){return this._data[3]<this._data[0]&&this._data[4]<this._data[1]&&this._data[5]<this._data[2]}}class qe extends Ge{constructor(){super(...arguments),this.bounds=new je.iy}}function Ye(e,t,i){const r=e.bbMin,n=e.bbMax;if((0,o.tZ)(i)){const e=(0,y.hZ)(Qe,i[12],i[13],i[14]);return(0,y.WQ)(Xe,r,e),(0,y.WQ)(Ke,n,e),t.minWith(Xe),void t.maxWith(Ke)}if((0,y.Z0)(Xe,r,i),(0,y.t2)(r,n))return t.minWith(Xe),void t.maxWith(Xe);(0,y.Z0)(Ke,n,i),t.minWith(Xe),t.minWith(Ke),t.maxWith(Xe),t.maxWith(Ke);for(let e=0;e<3;++e)(0,y.C)(Xe,r),(0,y.C)(Ke,n),Xe[e]=n[e],Ke[e]=r[e],(0,y.Z0)(Xe,Xe,i),(0,y.Z0)(Ke,Ke,i),t.minWith(Xe),t.minWith(Ke),t.maxWith(Xe),t.maxWith(Ke)}const Qe=(0,l.vt)(),Xe=(0,l.vt)(),Ke=(0,l.vt)(),Je=(0,l.vt)();var et=i(21818),tt=i(71511);const it=["layerObjectAdded","layerObjectRemoved","layerObjectsAdded","layerObjectsRemoved","transformationChanged","shaderTransformationChanged","visibilityChanged","occlusionChanged","highlightChanged","geometryAdded","geometryRemoved","attributesChanged"];var rt=i(78230);class nt{constructor(e,t,i=""){this.stage=e,this.apiLayerViewUid=i,this.id=(0,ze.c)(),this.events=new F.bk,this.visible=!0,this.sliceable=!1,this._objectsAdded=new Array,this._handles=new tt.A,this._objects=new Map,this._pickable=!0,this.visible=t?.visible??!0,this._pickable=t?.pickable??!0,this.updatePolicy=t?.updatePolicy??0,e.addLayer(this);for(const t of it)this._handles.add(this.events.on(t,i=>e.handleEvent(t,i)))}destroy(){this._handles.size&&(this._handles.destroy(),this.stage.removeLayer(this),this.invalidateSpatialQueryAccelerator())}get objects(){return this._objects}getObject(e){return(0,et.z)(this._objects.get(e))}set pickable(e){this._pickable=e}get pickable(){return this._pickable&&this.visible}add(e){this._objects.set(e.id,e),e.layer=this,this.events.emit("layerObjectAdded",e),null!=this._octree&&this._objectsAdded.push(e)}remove(e){this._objects.delete(e.id)&&(this.events.emit("layerObjectRemoved",e),e.layer=null,null!=this._octree&&((0,D.Xy)(this._objectsAdded,e)||this._octree.remove([e])))}addMany(e){for(const t of e)this._objects.set(t.id,t),t.layer=this;this.events.emit("layerObjectsAdded",e),null!=this._octree&&this._objectsAdded.push(...e)}removeMany(e){const t=new Array;for(const i of e)this._objects.delete(i.id)&&t.push(i);if(0!==t.length&&(this.events.emit("layerObjectsRemoved",t),t.forEach(e=>e.layer=null),null!=this._octree)){for(let e=0;e<t.length;)(0,D.Xy)(this._objectsAdded,t[e])?(t[e]=t[t.length-1],t.length-=1):++e;this._octree.remove(t)}}commit(){this.stage.commitLayer(this)}sync(){1!==this.updatePolicy&&this.stage.syncLayer(this.id)}notifyObjectBBChanged(e,t){null==this._octree||this._objectsAdded.includes(e)||this._octree.update(e,t)}getSpatialQueryAccelerator(){return null==this._octree&&this._objects.size>50?(this._octree=new rt.x(e=>e.boundingVolumeWorldSpace.bounds),this._octree.add(this._objects.values())):null!=this._octree&&this._objectsAdded.length>0&&(this._octree.add(this._objectsAdded),this._objectsAdded.length=0),this._octree}invalidateSpatialQueryAccelerator(){this._octree=(0,z.pR)(this._octree),this._objectsAdded.length=0}get test(){}}var st=i(90629),ot=i(78659),at=i(20498),lt=i(11964),ct=i(13030),ut=i(49255),ht=i(92130),dt=i(11725),pt=i(77194),ft=i(96095),gt=i(35622),mt=i(59907),vt=i(32565),xt=i(7298),yt=i(4431),_t=i(33524),bt=i(56133),St=i(33442);let wt=class extends ae.w{constructor(e,t){super(e,t,(0,yt.U)((0,xt.bP)(t))),this.shader=new oe.r(vt.R,()=>i.e(2059).then(i.bind(i,92059))),this.ignoreUnused=!0,this.primitiveType=t.wireframe?Ce.WR.LINES:Ce.WR.TRIANGLE_STRIP}_makePipelineState(e,t){const{output:i,hasOccludees:r}=e;return(0,ue.Ey)({blending:(0,_t.Yf)(i,!1,e.emissionDimmingPass),depthTest:(0,_t.mt)(i),depthWrite:(0,_t.z5)(e),colorWrite:ue.kn,stencilWrite:r?bt.v0:null,stencilTest:r?t?bt.Ax:bt.cP:null,polygonOffset:(0,St.T)(e)})}initializePipeline(e){if(e.occluder){const{hasOccludees:t}=e;this._occluderPipelineTransparent=(0,ue.Ey)({blending:ue.T8,polygonOffset:(0,St.T)(e),depthTest:bt.sf,depthWrite:null,colorWrite:ue.kn,stencilWrite:null,stencilTest:t?bt.Q0:null}),this._occluderPipelineOpaque=(0,ue.Ey)({blending:ue.T8,polygonOffset:(0,St.T)(e),depthTest:t?bt.sf:bt.m,depthWrite:null,colorWrite:ue.kn,stencilWrite:t?bt.r8:null,stencilTest:t?bt.iB:null}),this._occluderPipelineMaskWrite=(0,ue.Ey)({blending:null,polygonOffset:(0,St.T)(e),depthTest:bt.m,depthWrite:null,colorWrite:null,stencilWrite:t?bt.v0:null,stencilTest:t?bt.Ax:null})}return this._occludeePipeline=this._makePipelineState(e,!0),this._makePipelineState(e,!1)}getPipeline(e,t,i){if(i)return this._occludeePipeline;switch(e.occluder){case 11:return this._occluderPipelineTransparent??super.getPipeline(e,t,i);case 10:return this._occluderPipelineOpaque??super.getPipeline(e,t,i);default:e.occluder;case void 0:case null:return this._occluderPipelineMaskWrite??super.getPipeline(e,t,i)}}};wt=(0,I.Cg)([(0,j.$K)("esri.views.3d.webgl-engine.shaders.RibbonLineTechnique")],wt);var Ct=i(51976),Tt=i(47724);class At extends Tt.L{constructor(e){super(),this.spherical=e,this.capType=0,this.emissionSource=0,this.animation=2,this.polygonOffsetIndex=0,this.writeDepth=!1,this.draped=!1,this.stippleEnabled=!1,this.stippleOffColorEnabled=!1,this.stipplePreferContinuous=!0,this.numJoinSubdivisions=1,this.roundJoins=!1,this.applyMarkerOffset=!1,this.hasVVSize=!1,this.hasVVColor=!1,this.hasVVOpacity=!1,this.falloffEnabled=!1,this.innerColorEnabled=!1,this.hasOccludees=!1,this.occluder=!1,this.wireframe=!1,this.hasScreenSizePerspective=!1,this.worldSizedImagePattern=!1,this.textureCoordinateType=0,this.hasVVInstancing=!1,this.hasSliceTranslatedView=!0,this.overlayEnabled=!1,this.snowCover=!1,this.renderOccluded=!1}get hasAnimation(){return 0!==this.animation}}(0,I.Cg)([(0,Ct.W)({count:3})],At.prototype,"capType",void 0),(0,I.Cg)([(0,Ct.W)({count:8})],At.prototype,"emissionSource",void 0),(0,I.Cg)([(0,Ct.W)({count:4})],At.prototype,"animation",void 0),(0,I.Cg)([(0,Ct.W)({count:16})],At.prototype,"polygonOffsetIndex",void 0),(0,I.Cg)([(0,Ct.W)()],At.prototype,"writeDepth",void 0),(0,I.Cg)([(0,Ct.W)()],At.prototype,"draped",void 0),(0,I.Cg)([(0,Ct.W)()],At.prototype,"stippleEnabled",void 0),(0,I.Cg)([(0,Ct.W)()],At.prototype,"stippleOffColorEnabled",void 0),(0,I.Cg)([(0,Ct.W)()],At.prototype,"stipplePreferContinuous",void 0),(0,I.Cg)([(0,Ct.W)({count:8})],At.prototype,"numJoinSubdivisions",void 0),(0,I.Cg)([(0,Ct.W)()],At.prototype,"roundJoins",void 0),(0,I.Cg)([(0,Ct.W)()],At.prototype,"applyMarkerOffset",void 0),(0,I.Cg)([(0,Ct.W)()],At.prototype,"hasVVSize",void 0),(0,I.Cg)([(0,Ct.W)()],At.prototype,"hasVVColor",void 0),(0,I.Cg)([(0,Ct.W)()],At.prototype,"hasVVOpacity",void 0),(0,I.Cg)([(0,Ct.W)()],At.prototype,"falloffEnabled",void 0),(0,I.Cg)([(0,Ct.W)()],At.prototype,"innerColorEnabled",void 0),(0,I.Cg)([(0,Ct.W)()],At.prototype,"hasOccludees",void 0),(0,I.Cg)([(0,Ct.W)()],At.prototype,"occluder",void 0),(0,I.Cg)([(0,Ct.W)()],At.prototype,"wireframe",void 0),(0,I.Cg)([(0,Ct.W)()],At.prototype,"hasScreenSizePerspective",void 0),(0,I.Cg)([(0,Ct.W)()],At.prototype,"worldSizedImagePattern",void 0);var Et=i(49788);class Rt extends dt.i{constructor(e,t){super(e,Mt),this.produces=new Map([[2,e=>(0,ut.Ex)(e)||(0,ut._o)(e)&&8===this.parameters.renderOccluded],[3,e=>(0,ut.eh)(e)],[10,e=>(0,ut.gr)(e)&&8===this.parameters.renderOccluded],[11,e=>(0,ut.gr)(e)&&8===this.parameters.renderOccluded],[4,e=>(0,ut._o)(e)&&this.parameters.writeDepth&&8!==this.parameters.renderOccluded],[8,e=>(0,ut._o)(e)&&!this.parameters.writeDepth&&8!==this.parameters.renderOccluded],[18,e=>(0,ut.i3)(e)]]),this._configuration=new At(t)}updateConfiguration(e){super.updateConfiguration(e);const t=18===e.slot,i=null!=this.parameters.stipplePattern&&null!=this.parameters.stippleTexture&&10!==e.output,r=i&&t&&this.parameters.isImagePattern();this._configuration.draped=t,this._configuration.polygonOffset=this.parameters.polygonOffset,this._configuration.stippleEnabled=i,this._configuration.stippleOffColorEnabled=i&&null!=this.parameters.stippleOffColor,this._configuration.stipplePreferContinuous=i&&this.parameters.stipplePreferContinuous,this._configuration.numJoinSubdivisions=Dt(this.parameters.join,i),this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.roundJoins="round"===this.parameters.join,this._configuration.capType=this.parameters.cap,this._configuration.applyMarkerOffset=null!=this.parameters.markerParameters&&function(e){return 1===e.anchor&&e.hideOnShortSegments&&"begin-end"===e.placement&&e.worldSpace}(this.parameters.markerParameters),this._configuration.polygonOffsetIndex=this.parameters.polygonOffsetIndex,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.hasVVSize=this.parameters.hasVVSize,this._configuration.hasVVColor=this.parameters.hasVVColor,this._configuration.hasVVOpacity=this.parameters.hasVVOpacity,this._configuration.innerColorEnabled=this.parameters.innerWidth>0&&null!=this.parameters.innerColor,this._configuration.falloffEnabled=this.parameters.falloff>0,this._configuration.hasOccludees=e.hasOccludees,this._configuration.occluder=8===this.parameters.renderOccluded,this._configuration.wireframe=this.parameters.wireframe,this._configuration.animation=this.parameters.animation,this._configuration.emissionSource=this.emissions?1:0,this._configuration.hasScreenSizePerspective=!!this.parameters.screenSizePerspective&&!r,this._configuration.worldSizedImagePattern=r}get visible(){return this.parameters.color[3]>=Et.Q||null!=this.parameters.stipplePattern&&(this.parameters.stippleOffColor?.[3]??0)>Et.Q}get emissions(){return this.parameters.emissiveStrength>0?8!==this.parameters.renderOccluded?2:1:0}setParameters(e,t){e.animation=this.parameters.animation,super.setParameters(e,t)}intersectScreenPolygon(){}intersectRayDraped({attributes:e,screenToWorldRatio:t},i,r,n,s){if(!i.options.selectionMode)return;const o=e.get("size");let a=this.parameters.width;if(this.parameters.vvSize){const t=e.get("sizeFeatureAttribute").data[0];Number.isNaN(t)?a*=this.parameters.vvSize.fallback[0]:a*=(0,v.qE)(this.parameters.vvSize.offset[0]+t*this.parameters.vvSize.factor[0],this.parameters.vvSize.minSize[0],this.parameters.vvSize.maxSize[0])}else o&&(a*=o.data[0]);const l=r[0],c=r[1],u=(a/2+4)*t;let h=Number.MAX_VALUE,d=0;const p=e.get("position").data,f=It(this.parameters,e)?p.length-2:p.length-5;for(let e=0;e<f;e+=3){const t=p[e],i=p[e+1],r=(e+3)%p.length,n=l-t,s=c-i,o=p[r]-t,a=p[r+1]-i,u=(0,v.qE)((o*n+a*s)/(o*o+a*a),0,1),f=o*u-n,g=a*u-s,m=f*f+g*g;m<h&&(h=m,d=e/3)}h<u*u&&n(s.distance,s.normal,d)}intersectRay(e,t,i,r,n,s){const{options:o,camera:a,rayBegin:l,rayEnd:c}=i;if(!o.selectionMode||!e.visible||!a)return;if(!(0,De.zH)(t))return void u.A.getLogger("esri.views.3d.webgl-engine.materials.RibbonLineMaterial").error("intersection assumes a translation-only matrix");const h=e.attributes,d=h.get("position").data;let p=this.parameters.width;if(this.parameters.vvSize){const e=h.get("sizeFeatureAttribute").data[0];Number.isNaN(e)||(p*=(0,v.qE)(this.parameters.vvSize.offset[0]+e*this.parameters.vvSize.factor[0],this.parameters.vvSize.minSize[0],this.parameters.vvSize.maxSize[0]))}else h.has("size")&&(p*=h.get("size").data[0]);const f=Bt;(0,re.C)(f,i.point);const g=p*a.pixelRatio,m=4*a.pixelRatio,x=g/2+m;(0,y.hZ)(ei[0],f[0]-x,f[1]+x,0),(0,y.hZ)(ei[1],f[0]+x,f[1]+x,0),(0,y.hZ)(ei[2],f[0]+x,f[1]-x,0),(0,y.hZ)(ei[3],f[0]-x,f[1]-x,0);for(let e=0;e<4;e++)if(!a.unprojectFromRenderScreen(ei[e],ti[e]))return;(0,_.Cr)(a.eye,ti[0],ti[1],ii),(0,_.Cr)(a.eye,ti[1],ti[2],ri),(0,_.Cr)(a.eye,ti[2],ti[3],ni),(0,_.Cr)(a.eye,ti[3],ti[0],si);let b=Number.MAX_VALUE,S=0;const w=It(this.parameters,h)?d.length-2:d.length-5;for(let e=0;e<w;e+=3){Nt[0]=d[e]+t[12],Nt[1]=d[e+1]+t[13],Nt[2]=d[e+2]+t[14];const i=(e+3)%d.length;if(zt[0]=d[i]+t[12],zt[1]=d[i+1]+t[13],zt[2]=d[i+2]+t[14],(0,_.mN)(ii,Nt)<0&&(0,_.mN)(ii,zt)<0||(0,_.mN)(ri,Nt)<0&&(0,_.mN)(ri,zt)<0||(0,_.mN)(ni,Nt)<0&&(0,_.mN)(ni,zt)<0||(0,_.mN)(si,Nt)<0&&(0,_.mN)(si,zt)<0)continue;const r=a.projectToRenderScreen(Nt,$t),n=a.projectToRenderScreen(zt,Zt);if(null==r||null==n)continue;if(r[2]<0&&n[2]>0){(0,y.Re)(jt,Nt,zt);const e=a.frustum,t=-(0,_.mN)(e[4],Nt)/(0,y.Om)(jt,(0,_.Qj)(e[4]));if((0,y.hs)(jt,jt,t),(0,y.WQ)(Nt,Nt,jt),!a.projectToRenderScreen(Nt,r))continue}else if(r[2]>0&&n[2]<0){(0,y.Re)(jt,zt,Nt);const e=a.frustum,t=-(0,_.mN)(e[4],zt)/(0,y.Om)(jt,(0,_.Qj)(e[4]));if((0,y.hs)(jt,jt,t),(0,y.WQ)(zt,zt,jt),!a.projectToRenderScreen(zt,n))continue}else if(r[2]<0&&n[2]<0)continue;r[2]=0,n[2]=0;const s=(0,lt.Cr)(r,n,qt),o=(0,lt.kb)(s,f);if(!(o>=b)){if(this.parameters.screenSizePerspective){const e=this.computeScreenSizePerspectiveWidth(s,Nt,zt,f,a,p,m);if(o>=e*e)continue}b=o,(0,y.C)(kt,Nt),(0,y.C)(Gt,zt),S=e/3}}if(b<x*x){let e=Number.MAX_VALUE;if((0,lt.ld)((0,lt.Cr)(kt,Gt,qt),(0,lt.Cr)(l,c,Yt),Ut)){(0,y.Re)(Ut,Ut,l);const t=(0,y.Bw)(Ut);(0,y.hs)(Ut,Ut,1/t),e=t/(0,y.Io)(l,c)}s(e,Ut,S)}}createBufferWriter(){return new Lt((0,xt.bP)(this.parameters),(0,xt.qB)(this.parameters),this.parameters)}createGLMaterial(e){return new Ot(e)}validateParameters(e){"miter"!==e.join&&(e.miterLimit=0),null!=e.markerParameters&&(e.markerScale=e.markerParameters.width/e.width)}update(e){return!!this.parameters.hasAnimation&&(this.setParameters({timeElapsed:(0,ot.y)(e.time)},!1),0!==e.dt)}computeScreenSizePerspectiveWidth(e,t,i,r,n,s,o){const a=(0,lt.G1)(e,r);(0,y.Cc)(Ht,t,i,a),(0,y.Z0)(Vt,Ht,n.viewMatrix);const l=(0,y.Bw)(Vt),c=this.computeCameraAbsCosAngle(Ht,n,this._configuration.spherical);return Ft.update(c,l,this.parameters.screenSizePerspective,this.parameters.screenSizePerspectiveMinPixelReferenceSize),Ft.apply(s)*n.pixelRatio/2+o}computeCameraAbsCosAngle(e,t,i){return i?(0,y.S8)(Ut,e):(0,y.hZ)(Ut,0,0,1),(0,y.Re)(Wt,e,t.eye),(0,y.S8)(Wt,Wt),Math.abs((0,y.Om)(Ut,Wt))}}class Ot extends ht.A{constructor(){super(...arguments),this._stipplePattern=null}dispose(){super.dispose(),this._stippleTextures?.release(this._stipplePattern),this._stipplePattern=null}beginSlot(e){const{stipplePattern:t}=this._material.parameters;return this._stipplePattern!==t&&(this._material.setParameters({stippleTexture:this._stippleTextures.swap(t,this._stipplePattern)}),this._stipplePattern=t),this.getTechnique(wt,e)}}class Mt extends gt.S{constructor(){super(...arguments),this._width=0,this.color=He.Un,this.join="miter",this.cap=0,this.miterLimit=5,this.writeDepth=!0,this.polygonOffset=0,this.polygonOffsetIndex=0,this.stippleTexture=null,this.stipplePreferContinuous=!0,this.markerParameters=null,this.markerScale=1,this.hasSlicePlane=!1,this.vvFastUpdate=!1,this.isClosed=!1,this.falloff=0,this.innerWidth=0,this.wireframe=!1,this.timeElapsed=(0,ot.Kp)(0),this.animation=0,this.animationSpeed=1,this.trailLength=1,this.startTime=(0,ot.Kp)(0),this.endTime=(0,ot.Kp)(1/0),this.emissiveStrength=0}get width(){return this.isImagePattern()?this.stipplePattern.width:this._width}set width(e){this._width=e}get transparent(){return this.color[3]<1||this.hasAnimation||null!=this.stipplePattern&&(this.stippleOffColor?.[3]??0)<1}get hasAnimation(){return 0!==this.animation}isImagePattern(){return(0,ft.sL)(this.stipplePattern)&&null!=this.stippleTexture}}class Lt{constructor(e,t,i){this.layout=e,this.textureBufferLayout=t,this._parameters=i,this.numJoinSubdivisions=Dt(this._parameters.join,null!=this._parameters.stipplePattern)}_isClosed(e){return It(this._parameters,e)}allocate(e){return this.layout.createBuffer(e)}elementCountTextureBuffer(e){return e.get("position").data.length/3}elementCount(e){const t=e.get("position").indices.length/2+1,i=this._isClosed(e);let r=i?2:4;return r+=((i?t:t-1)-(i?0:1))*(2*this.numJoinSubdivisions+4),r+=2,this._parameters.wireframe&&(r=2+4*(r-2)),r}write(e,t,i,r,n,s){const{buffer:o,offset:a}=n,{layout:l,textureBufferLayout:c}=this,u=i.get("position"),h=u.indices,d=u.data.length/3,p=d,f=i.get("distanceToStart")?.data;h&&h.length!==2*(d-1)&&console.warn("RibbonLineMaterial does not support indices");const g=o.getField("textureElementIndex",ct.P);(0,De.vA)(null!=g,"Missing texture buffer index field"),(0,De.vA)(null!==s,"Expected texture buffer target"),(0,De.vA)(null!==c,"Expected valid textureBufferLayout");const{textureBufferRange:m,offset:v}=s;(0,De.vA)(null!=m,"Using a texture layout, but the texture range for this instance was not provided");const x=m.from;(0,De.vA)(m.numElements===p,"Expected number of elements in TextureBuffer to equal number of points");const{buffer:_}=s,b=_.getField("position",ct.xs);(0,De.vA)(null!==b,"Expected valid position field in texture buffer");const S=l.fields.has("sizeFeatureAttribute");let w=1,C=null;if(S){const e=i.get("sizeFeatureAttribute");1===e.data.length?w=e.data[0]:C=e.data}else w=i.get("size")?.data[0]??1;let T=[1,1,1,1],A=0,E=null;const R=l.fields.has("colorFeatureAttribute");if(R){const e=i.get("colorFeatureAttribute");1===e.data.length?A=e.data[0]:E=e.data}else T=i.get("color")?.data??T;const O=i.get("timeStamps")?.data,M=O&&l.fields.has("timeStamps"),L=l.fields.has("opacityFeatureAttribute");let P=0,I=null;if(L){const e=i.get("opacityFeatureAttribute");1===e.data.length?P=e.data[0]:I=e.data}const D=new Float32Array(o.buffer),F=(0,at.Bg)(o.buffer),N=new Uint8Array(o.buffer),z=new Uint32Array(o.buffer),H=l.stride/4;let V=a*H;const W=V;let j=0;const U=f?(e,t,i)=>j=f[i]:(e,t,i)=>j+=(0,y.Io)(e,t),$=D.BYTES_PER_ELEMENT/F.BYTES_PER_ELEMENT,Z=4/$,k=(0,Q.E)(),G=(e,t,i,n,s,o,a,l)=>{const c=a;z[V]=x+c,V++,b.setVec(v+c,t),(0,mt.Wu)(e,t,F,V*$),V+=Z,(0,mt.Wu)(i,t,F,V*$),V+=Z,D[V++]=l;let u=V*$;if(F[u++]=s,F[u++]=o,V=Math.ceil(u/$),R)D[V]=E?.[a]??A;else{const e=Math.min(4*a,T.length-4),t=4*V;N[t]=255*T[e],N[t+1]=255*T[e+1],N[t+2]=255*T[e+2],N[t+3]=255*T[e+3]}if(V++,D[V++]=C?.[a]??w,L&&(D[V++]=I?.[a]??P),k){let e=4*V;r?(N[e++]=r[0],N[e++]=r[1],N[e++]=r[2],N[e++]=r[3]):(N[e++]=0,N[e++]=0,N[e++]=0,N[e++]=0),V=Math.ceil(.25*e)}M&&(u=V*$,F[u++]=n[0],F[u++]=n[1],F[u++]=n[2],F[u++]=n[3],V=Math.ceil(u/$))};V+=H,(0,y.hZ)(Xt,u.data[0],u.data[1],u.data[2]),M&&(0,B.hZ)(Jt,O[0],O[1],O[2],O[3]),e&&(0,y.Z0)(Xt,Xt,e);const q=this._isClosed(i);if(q){const t=u.data.length-3;(0,y.hZ)(Qt,u.data[t],u.data[t+1],u.data[t+2]),e&&(0,y.Z0)(Qt,Qt,e)}else(0,y.hZ)(Kt,u.data[3],u.data[4],u.data[5]),e&&(0,y.Z0)(Kt,Kt,e),G(Xt,Xt,Kt,Jt,1,-4,0,0),G(Xt,Xt,Kt,Jt,1,4,0,0),(0,y.C)(Qt,Xt),(0,y.C)(Xt,Kt),M&&(0,B.hZ)(Jt,O[4],O[5],O[6],O[7]);const Y=q?0:1,X=q?d:d-1;for(let t=Y;t<X;t++){const i=(t+1)%d*3;(0,y.hZ)(Kt,u.data[i],u.data[i+1],u.data[i+2]),e&&(0,y.Z0)(Kt,Kt,e),U(Qt,Xt,t),G(Qt,Xt,Kt,Jt,0,-1,t,j),G(Qt,Xt,Kt,Jt,0,1,t,j);const r=this.numJoinSubdivisions;for(let e=0;e<r;++e){const i=(e+1)/(r+1);G(Qt,Xt,Kt,Jt,i,-1,t,j),G(Qt,Xt,Kt,Jt,i,1,t,j)}if(G(Qt,Xt,Kt,Jt,1,-2,t,j),G(Qt,Xt,Kt,Jt,1,2,t,j),(0,y.C)(Qt,Xt),(0,y.C)(Xt,Kt),M){const e=(t+1)%d*4;(0,B.hZ)(Jt,O[e],O[e+1],O[e+2],O[e+3])}}q?((0,y.hZ)(Kt,u.data[3],u.data[4],u.data[5]),e&&(0,y.Z0)(Kt,Kt,e),j=U(Qt,Xt,X),G(Qt,Xt,Kt,Jt,0,-1,Y,j),G(Qt,Xt,Kt,Jt,0,1,Y,j)):(j=U(Qt,Xt,X),G(Qt,Xt,Xt,Jt,0,-5,X,j),G(Qt,Xt,Xt,Jt,0,5,X,j)),Pt(D,W+H,D,W,H),V=Pt(D,V-H,D,V,H),this._parameters.wireframe&&this._addWireframeVertices(o,W,V,H)}_addWireframeVertices(e,t,i,r){const n=new Uint8Array(e.buffer,i*Float32Array.BYTES_PER_ELEMENT),s=new Uint8Array(e.buffer,t*Float32Array.BYTES_PER_ELEMENT,(i-t)*Float32Array.BYTES_PER_ELEMENT),o=r*Float32Array.BYTES_PER_ELEMENT;let a=0;const l=e=>a=Pt(s,e,n,a,o);for(let e=0;e<=s.length-4*o;e+=2*o)l(e),l(e+2*o),l(e+1*o),l(e+2*o),l(e+1*o),l(e+3*o)}}function Pt(e,t,i,r,n){for(let s=0;s<n;s++)i[r++]=e[t++];return r}function It(e,t){return!!e.isClosed&&t.get("position").indices.length>2}function Dt(e,t){const i=t?1:0;switch(e){case"miter":case"bevel":return i;case"round":return vt.r+i}}const Ft=new pt.PS,Nt=(0,l.vt)(),zt=(0,l.vt)(),Ht=(0,l.vt)(),Vt=(0,l.vt)(),Wt=(0,l.vt)(),jt=(0,l.vt)(),Ut=(0,l.vt)(),Bt=(0,l.vt)(),$t=(0,st.r_)(),Zt=(0,st.r_)(),kt=(0,l.vt)(),Gt=(0,l.vt)(),qt=(0,lt.vt)(),Yt=(0,lt.vt)(),Qt=(0,l.vt)(),Xt=(0,l.vt)(),Kt=(0,l.vt)(),Jt=(0,He.vt)(),ei=[(0,st.r_)(),(0,st.r_)(),(0,st.r_)(),(0,st.r_)()],ti=[(0,l.vt)(),(0,l.vt)(),(0,l.vt)(),(0,l.vt)()],ii=(0,_.vt)(),ri=(0,_.vt)(),ni=(0,_.vt)(),si=(0,_.vt)();class oi{constructor(e){this._originSR=e,this._rootOriginId="root/"+(0,ze.c)(),this._origins=new Map,this._objects=new Map,this._gridSize=5e5,this._originSR?.isGeographic&&(this._gridSize/=(0,x.GA)(this._originSR)),this._baselineDistance=.5*this._gridSize;const t=this._baselineDistance*li;this._baselineObjectSize=t/ci}getOrigin(e){const t=this._origins.get(this._rootOriginId);if(null==t){const t=null;if(null!=t)return this._origins.set(this._rootOriginId,k(t[0],t[1],t[2],this._rootOriginId)),this.getOrigin(e);const i=k(e[0]+Math.random()-.5,e[1]+Math.random()-.5,e[2]+Math.random()-.5,this._rootOriginId);return this._origins.set(this._rootOriginId,i),i}const i=this._gridSize,r=Math.round(e[0]/i),n=Math.round(e[1]/i),s=Math.round(e[2]/i),o=`${r}/${n}/${s}`;let a=this._origins.get(o);const l=.5*i;if((0,y.Re)(ai,e,t.vec3),ai[0]=Math.abs(ai[0]),ai[1]=Math.abs(ai[1]),ai[2]=Math.abs(ai[2]),ai[0]<l&&ai[1]<l&&ai[2]<l){if(a){const t=Math.max(...ai);if((0,y.Re)(ai,e,a.vec3),ai[0]=Math.abs(ai[0]),ai[1]=Math.abs(ai[1]),ai[2]=Math.abs(ai[2]),Math.max(...ai)<t)return a}return t}return a||(a=k(r*i,n*i,s*i,o),this._origins.set(o,a)),a}needsOriginUpdate(e,t,i){const r=(0,y.Io)(e.vec3,t),n=Math.max(1,i/this._baselineObjectSize);return r>this._baselineDistance*n}_drawOriginBox(e,t=(0,He.fA)(1,1,0,1)){const i=window.view,r=i.stage,s=t.toString();if(!this._objects.has(s)){this._material=new Rt({width:2,color:t},!1);const e=new nt(r,{pickable:!1}),i=new ke({castShadow:!1});e.add(i),this._objects.set(s,i)}const o=this._objects.get(s),a=[0,1,5,4,0,2,1,7,6,2,0,1,3,7,5,4,6,2,0],l=a.length,c=new Array(3*l),u=new Array,h=.5*this._gridSize;for(let t=0;t<l;t++)c[3*t]=e[0]+(1&a[t]?h:-h),c[3*t+1]=e[1]+(2&a[t]?h:-h),c[3*t+2]=e[2]+(4&a[t]?h:-h),t>0&&u.push(t-1,t);(0,n.projectBuffer)(c,this._originSR,0,c,i.renderSpatialReference,0,l);const d=new We.V(this._material,[["position",new Ve.n(c,u,3,!0)]],null,2);o.addGeometry(d)}get test(){}}const ai=(0,l.vt)(),li=2**-23,ci=.05;var ui,hi=i(44794),di=i(48163),pi=i(24770),fi=i(79258),gi=i(25482),mi=i(93223);let vi=ui=class extends gi.o{constructor(e){super(e),this.type="cloudy",this.cloudCover=.5,this.fogOpacity=0}clone(){return new ui({cloudCover:this.cloudCover})}};(0,I.Cg)([(0,mi.e)({cloudy:"cloudy"}),(0,j.MZ)({json:{write:{isRequired:!0}}})],vi.prototype,"type",void 0),(0,I.Cg)([(0,j.MZ)({type:Number,nonNullable:!0,range:{min:0,max:1},json:{write:!0}})],vi.prototype,"cloudCover",void 0),vi=ui=(0,I.Cg)([(0,j.$K)("esri.views.3d.environment.CloudyWeather")],vi);const xi=vi;var yi;let _i=class extends gi.o{static{yi=this}constructor(e){super(e),this.type="foggy",this.fogStrength=.5}clone(){return new yi({fogStrength:this.fogStrength})}get fogOpacity(){return(0,v.Cc)(yi.minFogOpacity,yi.maxFogOpacity,this.fogStrength**3)}static{this.minFogOpacity=3e-5}static{this.maxFogOpacity=.005}};(0,I.Cg)([(0,mi.e)({foggy:"foggy"}),(0,j.MZ)({json:{write:{isRequired:!0}}})],_i.prototype,"type",void 0),(0,I.Cg)([(0,j.MZ)({type:Number,nonNullable:!0,range:{min:0,max:1},json:{write:!0}})],_i.prototype,"fogStrength",void 0),_i=yi=(0,I.Cg)([(0,j.$K)("esri.views.3d.environment.FoggyWeather")],_i);const bi=_i;var Si;let wi=class extends gi.o{static{Si=this}constructor(e){super(e),this.type="rainy",this.cloudCover=.5,this.precipitation=.5}clone(){return new Si({cloudCover:this.cloudCover,precipitation:this.precipitation})}get fogOpacity(){return(0,v.Cc)(Si.minFogOpacity,Si.maxFogOpacity,this.precipitation**3)}static{this.minFogOpacity=4e-6}static{this.maxFogOpacity=2e-4}};(0,I.Cg)([(0,mi.e)({rainy:"rainy"}),(0,j.MZ)({json:{write:{isRequired:!0}}})],wi.prototype,"type",void 0),(0,I.Cg)([(0,j.MZ)({type:Number,nonNullable:!0,range:{min:0,max:1},json:{write:!0}})],wi.prototype,"cloudCover",void 0),(0,I.Cg)([(0,j.MZ)({type:Number,nonNullable:!0,range:{min:0,max:1},json:{write:!0}})],wi.prototype,"precipitation",void 0),wi=Si=(0,I.Cg)([(0,j.$K)("esri.views.3d.environment.RainyWeather")],wi);const Ci=wi;var Ti;let Ai=Ti=class extends gi.o{constructor(e){super(e),this.type="snowy",this.cloudCover=.5,this.precipitation=.5,this.snowCover="disabled"}clone(){return new Ti({cloudCover:this.cloudCover,precipitation:this.precipitation,snowCover:this.snowCover})}get fogOpacity(){return(0,v.Cc)(Ci.minFogOpacity,Ci.maxFogOpacity,this.precipitation**3)}};(0,I.Cg)([(0,mi.e)({snowy:"snowy"}),(0,j.MZ)({json:{write:{isRequired:!0}}})],Ai.prototype,"type",void 0),(0,I.Cg)([(0,j.MZ)({type:Number,nonNullable:!0,range:{min:0,max:1},json:{write:!0}})],Ai.prototype,"cloudCover",void 0),(0,I.Cg)([(0,j.MZ)({type:Number,nonNullable:!0,range:{min:0,max:1},json:{write:!0}})],Ai.prototype,"precipitation",void 0),(0,I.Cg)([(0,j.MZ)({type:["enabled","disabled"],nonNullable:!0,json:{write:!0}})],Ai.prototype,"snowCover",void 0),Ai=Ti=(0,I.Cg)([(0,j.$K)("esri.views.3d.environment.SnowyWeather")],Ai);const Ei=Ai;var Ri;let Oi=Ri=class extends gi.o{constructor(e){super(e),this.type="sunny",this.cloudCover=.5,this.fogOpacity=0}clone(){return new Ri({cloudCover:this.cloudCover})}};(0,I.Cg)([(0,mi.e)({sunny:"sunny"}),(0,j.MZ)({json:{write:{isRequired:!0}}})],Oi.prototype,"type",void 0),(0,I.Cg)([(0,j.MZ)({type:Number,nonNullable:!0,range:{min:0,max:1},json:{write:!0}})],Oi.prototype,"cloudCover",void 0),Oi=Ri=(0,I.Cg)([(0,j.$K)("esri.views.3d.environment.SunnyWeather")],Oi);const Mi={key:"type",base:Oi,typeMap:{sunny:Oi,cloudy:xi,rainy:Ci,snowy:Ei,foggy:bi}};Object.keys(Mi.typeMap);class Li{constructor(){this.startTime=0,this._data=(0,hi.v)(null),this.coverage=0,this.absorption=0,this._readChannels=0,this.parallax=new Pi,this.parallaxNew=new Pi,this._anchorPoint=(0,l.vt)(),this._fadeState=(0,hi.v)(0),this._fadeFactor=(0,hi.v)(1)}get data(){return this._data.value}set data(e){this._data.value=e}get readChannels(){return this._readChannels}get fadeState(){return this._fadeState.value}get fadeFactor(){return this._fadeFactor.value}get opacity(){switch(this.fadeState){case 0:return 0;case 4:return 1-this.fadeFactor;case 1:return this.fadeFactor;case 2:case 3:return 1}}fade(e,t,i){this.isFading&&this.fadeFactor<1&&(this._fadeFactor.value=i?(0,v.qE)((t-this.startTime)/(Ni*i),0,1):1,1===this.fadeFactor&&this._endFade()),this._evaluateState(e,t),this._updateParallax(e)}_evaluateState(e,t){const i=e.relativeElevation,r=this._updateAnchorPoint(e);(Math.abs(i)>17e3||r>Hi)&&this.opacity>0?this._startFade(0,t):this.isFading||(Math.abs(i)>1e4||r>zi*Hi?this.opacity>0&&this._startFade(4,t):function(e){return null!=e&&!e.readyToRun}(this.data)&&(0===this.opacity?this._startFade(1,t):2===this.data.state&&(2===this.fadeState?this._startFade(3,t):this._startFade(2,t))))}_updateParallax(e){const t=(0,y.m3)(e.eye);this.parallax.radiusCurvatureCorrection=.84*Math.sqrt(Math.max(t-fi.$O.radius*fi.$O.radius,0))/Math.sqrt(t),(0,pi.Cr)(Ii,this.parallax.anchorPoint,Di),(0,o.e$)(this.parallax.transform,a.zK,Di[3],(0,pi.yo)(Di)),(0,pi.Cr)(Ii,this.parallaxNew.anchorPoint,Di),(0,o.e$)(this.parallaxNew.transform,a.zK,Di[3],(0,pi.yo)(Di))}_updateAnchorPoint(e){return(0,y.S8)(this._anchorPoint,e.eye),(0,y.hs)(this._anchorPoint,this._anchorPoint,fi.$O.radius),0===this.fadeState&&2===this.data?.state?((0,y.C)(this.parallax.anchorPoint,this._anchorPoint),0):(0,y.Bw)((0,y.Re)(Fi,this.parallax.anchorPoint,this._anchorPoint))}requestFade(){this._fadeFactor.value=0}_startFade(e,t){switch(this._fadeState.value=e,this.startTime=t,e){case 3:this.requestFade(),this._switchReadChannels(),(0,y.C)(this.parallaxNew.anchorPoint,this._anchorPoint);break;case 1:this.requestFade(),this._switchReadChannels(),(0,y.C)(this.parallax.anchorPoint,this._anchorPoint),(0,y.C)(this.parallaxNew.anchorPoint,this._anchorPoint);break;case 4:this.requestFade();break;case 2:this._switchReadChannels(),(0,y.C)(this.parallax.anchorPoint,this._anchorPoint),(0,y.C)(this.parallaxNew.anchorPoint,this._anchorPoint),this._endFade();break;case 0:this._endFade()}}_endFade(){switch(this._fadeFactor.value=1,this.data&&2!==this.data.state&&(this.data.state=0),this.fadeState){case 3:(0,y.C)(this.parallax.anchorPoint,this.parallaxNew.anchorPoint),this._fadeState.value=2;break;case 1:this._fadeState.value=2;break;case 4:this._fadeState.value=0;break;case 2:case 0:break;default:this.fadeState}}_switchReadChannels(){2===this.data?.state&&(this._readChannels=1-this._readChannels,this.data.state=3)}get isFading(){return 4===this.fadeState||1===this.fadeState||3===this.fadeState}}class Pi{constructor(){this.anchorPoint=(0,l.vt)(),this.radiusCurvatureCorrection=0,this.transform=(0,a.vt)()}}const Ii=(0,l.fA)(0,0,1),Di=(0,pi.vt)(),Fi=(0,l.vt)(),Ni=1.25,zi=.5,Hi=2e5;class Vi{constructor(){this.lastFrameCamera=new J.A,this.matrix=(0,a.vt)(),this.viewMatrix=(0,a.vt)()}}class Wi{constructor(){this.enabled=!1,this.fadeFactor=1}}var ji=i(57226);class Ui{constructor(e,t){this._rctx=e,this.shadowMap=t,this._output=0,this.slot=2,this.slicePlane=null,this.hasOccludees=!1,this.emissions=0,this.transparentWithoutDepthEmissionDimmingPass=!1,this.useFloatBlend=(0,hi.v)(!0),this.enableFillLights=!0,this.alignPixelEnabled=!1,this.decorations=!0,this.overlayStretch=1,this.viewshedEnabled=!1,this.cutFillComputationEnabled=!1,this.cutFillVisualizationEnabled=!1,this._camera=new J.A,this._inverseViewport=(0,di.vt)(),this._oldLighting=new ji.TA,this._newLighting=new ji.TA,this._fadedLighting=new ji.TA,this._lighting=this._newLighting,this.screenSpaceReflections=new Wi,this.reprojection=new Vi,this.highlights=new Array,this.highlightMixOrigin=(0,di.vt)(),this.highlightMixTexture=null,this.globalIlluminationEnabled=!1,this.hudRenderStyle=0,this.snowCover=0,this.clouds=new Li,this.hasShadowHighlights=!1}destroy(){this._camera=this.contentCamera=null,this.mainDepth=this.overlay=this.ssao=this.shadowHighlight=null,this.depth=(0,z.Gz)(this.depth),this.shadowMap?.dispose()}get output(){return this._output}set output(e){this._output!==e&&(this._output=e,this._rctx.resetDrawBuffers(e))}get hasEmission(){switch(this.output){case 0:return this.hasOpaqueEmission;case 1:case 2:return this.hasTransparentEmission;default:return!1}}get hasOpaqueEmission(){return 1===this.emissions||3===this.emissions}get hasTransparentEmission(){return 2===this.emissions||3===this.emissions}get camera(){return this._camera}set camera(e){this._camera=e,this._inverseViewport[0]=1/e.fullViewport[2],this._inverseViewport[1]=1/e.fullViewport[3]}get enableOITOffset(){return this.camera.relativeElevation<5e5}get inverseViewport(){return this._inverseViewport}get lighting(){return this._lighting}fadeLighting(){switch(this.clouds.fadeFactor){case 0:this._lighting=this._oldLighting;break;default:this._fadedLighting.lerpLighting(this._oldLighting,this._newLighting,this.clouds.fadeFactor),this._lighting=this._fadedLighting;break;case 1:this._lighting=this._newLighting,this._oldLighting.copyFrom(this._newLighting)}}updateLighting(e,t,i,r){this._oldLighting.copyFrom(this.lighting),this._newLighting.noonFactor=t,this._newLighting.globalFactor=i,this._newLighting.set(e),this._oldLighting.updateLegacy(),1===r&&this.clouds.requestFade(),this.fadeLighting()}get hasScreenSpaceReflections(){return(0,ut._o)(this.output)&&this.screenSpaceReflections.enabled&&null!=this.reprojection.lastFrameColor}get highlight(){return null==this.highlightLevel?null:this.highlights[this.highlightLevel]}get depth(){return this._depth}set depth(e){e&&(e.name="geometry depth"),this._depth=e}get occluder(){return 10===this.slot||11===this.slot?this.slot:null}}class Bi{constructor(e,t,i){this.rctx=e,this.techniques=i,this.renderOccludedMask=$i,this.time=(0,ot.l5)(0),this.bind=new Ui(e,t),this.bind.alignPixelEnabled=!0}destroy(){this.bind.destroy()}get output(){return this.bind.output}}const $i=13;var Zi=i(29242);let ki=class extends J.A{constructor(){super(...arguments),this._projectionMatrix=(0,a.vt)()}get projectionMatrix(){return this._projectionMatrix}};(0,I.Cg)([(0,j.MZ)()],ki.prototype,"_projectionMatrix",void 0),(0,I.Cg)([(0,j.MZ)({readOnly:!0})],ki.prototype,"projectionMatrix",null),ki=(0,I.Cg)([(0,j.$K)("esri.views.3d.webgl-engine.lib.CascadeCamera")],ki);var Gi=i(78988);class qi{constructor(){this.camera=new ki,this.lightMat=(0,a.vt)()}}class Yi{constructor(){this.maxNumCascadesHighQuality=4,this.maxNumCascadesLowQuality=4,this.textureSizeModHighQuality=1.3,this.textureSizeModLowQuality=.9,this.splitSchemeLambda=0}}class Qi{constructor(e,t){this._fbos=e,this._viewingMode=t,this._enabled=!1,this._outputs=new Array,this._height=0,this._numCascades=1,this.settings=new Yi,this._projectionView=(0,a.vt)(),this._projectionViewInverse=(0,a.vt)(),this._modelViewLight=(0,a.vt)(),this._cascadeDistances=[0,0,0,0,0],this._usedCascadeDistances=(0,He.vt)(),this._cascades=[new qi,new qi,new qi,new qi],this._lastOrigin=null,this._maxTextureWidth=Math.min((0,c.A)("esri-mobile")?4096:16384,e.rctx.parameters.maxTextureSize)}dispose(){this.enabled=!1}disposeOutputs(){this._handle=(0,z.Gz)(this._handle),this._outputs.forEach(e=>e?.release()),this._outputs.length=0}disposeOutput(e){this._outputs[e]=(0,z.Gz)(this._outputs[e])}set maxCascades(e){this.settings.maxNumCascadesHighQuality=(0,v.qE)(Math.floor(e),1,4)}get maxCascades(){return this.settings.maxNumCascadesHighQuality}set enabled(e){this._enabled=e,e||this.disposeOutputs()}get enabled(){return this._enabled}get ready(){return!!this.getOutput(5)||!!this.getOutput(7)}get renderTarget(){return this._handle}get cascades(){for(let e=0;e<this._numCascades;++e)or[e]=this._cascades[e];return or.length=this._numCascades,or}start(e,t,i,r,n){(0,De.vA)(this.enabled);const{near:s,far:o}=function(e){let{near:t,far:i}=e;return t<2&&(t=2),i<2&&(i=2),t>=i&&(t=2,i=4),{near:t,far:i}}(i);this._computeCascadeDistances(s,o,r),this._height=this._computeTextureHeight(e,n,r),this._setupMatrices(e,t);for(let i=0;i<this._numCascades;++i)this._constructCascade(i,e,t);this._lastOrigin=null,this.clear()}getShadowMapMatrices(e){if(!this._lastOrigin||!(0,y.t2)(e,this._lastOrigin)){this._lastOrigin=this._lastOrigin||(0,l.vt)(),(0,y.C)(this._lastOrigin,e);for(let t=0;t<this._numCascades;++t){(0,o.Tl)(ar,this._cascades[t].lightMat,e);for(let e=0;e<16;++e)lr[16*t+e]=ar[e]}}return lr}finish(e){(0,De.vA)(this.enabled),this._outputs[e]?.release(),this._outputs[e]=this._handle,this._handle?.setName(6===e?"shadow map highlight":"shadow map excluding highlight"),this._handle=null}getOutput(e){return this.enabled?this._outputs[e]?.getTexture(Ce.nI):null}clear(){this._ensureFbo(),this.bindFramebuffer(),this._fbos.rctx.clear(256)}_computeTextureHeight({pixelRatio:e,fullWidth:t,fullHeight:i},r,n){const s=Math.min(window.devicePixelRatio,r)/e,o=n?this.settings.textureSizeModHighQuality:this.settings.textureSizeModLowQuality;return(0,Gi.Mv)(Math.max(t,i)*s*o,this._maxTextureWidth/this._numCascades)}_ensureFbo(){this._handle?.fbo?.width===this._width&&this._handle?.fbo.height===this._height||(this._handle?.release(),this._handle=this._fbos.acquire(this._width,this._height,ne.OG.SHADOWMAP,13),this._handle.getTexture(Ce.nI)?.setShadowFiltering(!0))}bindFramebuffer(){this._fbos.rctx.bindFramebuffer(this._handle?.fbo)}_constructCascade(e,t,i){const{viewMatrix:r,projectionMatrix:n,relativeElevation:s}=t,a=this._cascades[e],l=-this._cascadeDistances[e],c=-this._cascadeDistances[e+1],u=(n[10]*l+n[14])/Math.abs(n[11]*l+n[15]),h=(n[10]*c+n[14])/Math.abs(n[11]*c+n[15]);(0,De.vA)(u<h);for(let e=0;e<8;++e){(0,B.hZ)(Ki,e%4==0||e%4==3?-1:1,e%4==0||e%4==1?-1:1,e<4?u:h,1);const t=Ji[e];(0,B.Z0)(t,Ki,this._projectionViewInverse),t[0]/=t[3],t[1]/=t[3],t[2]/=t[3]}(0,y.ze)(sr,Ji[0]),a.camera.viewMatrix=(0,o.Tl)(Xi,this._modelViewLight,sr);for(let e=0;e<8;++e)(0,y.Z0)(Ji[e],Ji[e],a.camera.viewMatrix);let d=Ji[0][2],p=Ji[0][2];for(let e=1;e<8;++e)d=Math.min(d,Ji[e][2]),p=Math.max(p,Ji[e][2]);d-=200,p+=200,a.camera.near=-p,a.camera.far=-d,a.camera.relativeElevation=s,function(e,t,i,r,n){const s=1/Ji[0][3],o=1/Ji[4][3];(0,De.vA)(s<o);let a=s+Math.sqrt(s*o);const l=Math.sin((0,v.XM)(e[2]*t[0]+e[6]*t[1]+e[10]*t[2]));a/=l,function(e,t,i,r,n,s,o,a){(0,re.hZ)(cr,0,0);for(let t=0;t<4;++t)(0,re.WQ)(cr,cr,e[t]);(0,re.hs)(cr,cr,.25),(0,re.hZ)(ur,0,0);for(let t=4;t<8;++t)(0,re.WQ)(ur,ur,e[t]);(0,re.hs)(ur,ur,.25),(0,re.Cc)(hr[0],e[4],e[5],.5),(0,re.Cc)(hr[1],e[5],e[6],.5),(0,re.Cc)(hr[2],e[6],e[7],.5),(0,re.Cc)(hr[3],e[7],e[4],.5);let l=0,c=(0,re.hG)(hr[0],cr);for(let e=1;e<4;++e){const t=(0,re.hG)(hr[e],cr);t<c&&(c=t,l=e)}(0,re.Re)(dr,hr[l],e[l+4]);const u=dr[0];let h,d;dr[0]=-dr[1],dr[1]=u,(0,re.Re)(pr,ur,cr),(0,re.Om)(pr,dr)<0&&(0,re.ze)(dr,dr),(0,re.Cc)(dr,dr,pr,i),(0,re.S8)(dr,dr),h=d=(0,re.Om)((0,re.Re)(fr,e[0],cr),dr);for(let t=1;t<8;++t){const i=(0,re.Om)((0,re.Re)(fr,e[t],cr),dr);i<h?h=i:i>d&&(d=i)}(0,re.C)(r,cr),(0,re.hs)(fr,dr,h-t),(0,re.WQ)(r,r,fr);let p=-1,f=1,g=0,m=0;for(let t=0;t<8;++t){(0,re.Re)(gr,e[t],r),(0,re.S8)(gr,gr);const i=dr[0]*gr[1]-dr[1]*gr[0];i>0?i>p&&(p=i,g=t):i<f&&(f=i,m=t)}(0,De.MX)(p>0,"leftArea"),(0,De.MX)(f<0,"rightArea"),(0,re.hs)(mr,dr,h),(0,re.WQ)(mr,mr,cr),(0,re.hs)(vr,dr,d),(0,re.WQ)(vr,vr,cr),xr[0]=-dr[1],xr[1]=dr[0];const v=(0,De.L)(r,e[m],vr,(0,re.WQ)(fr,vr,xr),1,n),x=(0,De.L)(r,e[g],vr,fr,1,s),y=(0,De.L)(r,e[g],mr,(0,re.WQ)(fr,mr,xr),1,o),_=(0,De.L)(r,e[m],mr,fr,1,a);(0,De.MX)(v,"rayRay"),(0,De.MX)(x,"rayRay"),(0,De.MX)(y,"rayRay"),(0,De.MX)(_,"rayRay")}(Ji,a,l,er,tr,ir,rr,nr),function(e,t,i,r,n){(0,re.Re)(Sr,i,r),(0,re.hs)(Sr,Sr,.5),wr[0]=Sr[0],wr[1]=Sr[1],wr[2]=0,wr[3]=Sr[1],wr[4]=-Sr[0],wr[5]=0,wr[6]=Sr[0]*Sr[0]+Sr[1]*Sr[1],wr[7]=Sr[0]*Sr[1]-Sr[1]*Sr[0],wr[8]=1,wr[yr(0,2)]=-(0,re.Om)(br(wr,0),e),wr[yr(1,2)]=-(0,re.Om)(br(wr,1),e);let s=(0,re.Om)(br(wr,0),i)+wr[yr(0,2)],o=(0,re.Om)(br(wr,1),i)+wr[yr(1,2)],a=(0,re.Om)(br(wr,0),r)+wr[yr(0,2)],l=(0,re.Om)(br(wr,1),r)+wr[yr(1,2)];s=-(s+a)/(o+l),wr[yr(0,0)]+=wr[yr(1,0)]*s,wr[yr(0,1)]+=wr[yr(1,1)]*s,wr[yr(0,2)]+=wr[yr(1,2)]*s,s=1/((0,re.Om)(br(wr,0),i)+wr[yr(0,2)]),o=1/((0,re.Om)(br(wr,1),i)+wr[yr(1,2)]),wr[yr(0,0)]*=s,wr[yr(0,1)]*=s,wr[yr(0,2)]*=s,wr[yr(1,0)]*=o,wr[yr(1,1)]*=o,wr[yr(1,2)]*=o,wr[yr(2,0)]=wr[yr(1,0)],wr[yr(2,1)]=wr[yr(1,1)],wr[yr(2,2)]=wr[yr(1,2)],wr[yr(1,2)]+=1,s=(0,re.Om)(br(wr,1),t)+wr[yr(1,2)],o=(0,re.Om)(br(wr,2),t)+wr[yr(2,2)],a=(0,re.Om)(br(wr,1),i)+wr[yr(1,2)],l=(0,re.Om)(br(wr,2),i)+wr[yr(2,2)],s=-.5*(s/o+a/l),wr[yr(1,0)]+=wr[yr(2,0)]*s,wr[yr(1,1)]+=wr[yr(2,1)]*s,wr[yr(1,2)]+=wr[yr(2,2)]*s,s=(0,re.Om)(br(wr,1),t)+wr[yr(1,2)],o=(0,re.Om)(br(wr,2),t)+wr[yr(2,2)],a=-o/s,wr[yr(1,0)]*=a,wr[yr(1,1)]*=a,wr[yr(1,2)]*=a,n[0]=wr[0],n[1]=wr[1],n[2]=0,n[3]=wr[2],n[4]=wr[3],n[5]=wr[4],n[6]=0,n[7]=wr[5],n[8]=0,n[9]=0,n[10]=1,n[11]=0,n[12]=wr[6],n[13]=wr[7],n[14]=0,n[15]=wr[8]}(er,tr,rr,nr,n.projectionMatrix),n.projectionMatrix[10]=2/(i-r),n.projectionMatrix[14]=-(i+r)/(i-r)}(r,i,d,p,a.camera),(0,o.lw)(a.lightMat,a.camera.projectionMatrix,a.camera.viewMatrix);const f=this._height;a.camera.viewport=[e*f,0,f,f]}_setupMatrices(e,t){(0,o.lw)(this._projectionView,e.projectionMatrix,e.viewMatrix),(0,o.B8)(this._projectionViewInverse,this._projectionView);const i=1===this._viewingMode?e.eye:(0,y.hZ)(sr,0,0,1);(0,o.t5)(this._modelViewLight,[0,0,0],[-t[0],-t[1],-t[2]],i)}_computeCascadeDistances(e,t,i){const r=i?this.settings.maxNumCascadesHighQuality:this.settings.maxNumCascadesLowQuality;this._numCascades=Math.min(1+Math.floor((0,De.kL)(t/e,4)),r);const n=(t-e)/this._numCascades,s=(t/e)**(1/this._numCascades);let o=e,a=e;for(let e=0;e<this._numCascades+1;++e)this._cascadeDistances[e]=(0,v.Cc)(o,a,this.settings.splitSchemeLambda),o*=s,a+=n}get _width(){return this._height*this._numCascades}get numCascades(){return this._numCascades}get cascadeDistances(){return(0,B.hZ)(this._usedCascadeDistances,this._cascadeDistances[0],this._numCascades>1?this._cascadeDistances[1]:1/0,this._numCascades>2?this._cascadeDistances[2]:1/0,this._numCascades>3?this._cascadeDistances[3]:1/0)}get test(){}}const Xi=(0,a.vt)(),Ki=(0,He.vt)(),Ji=[];for(let e=0;e<8;++e)Ji.push((0,He.vt)());const er=(0,di.vt)(),tr=(0,di.vt)(),ir=(0,di.vt)(),rr=(0,di.vt)(),nr=(0,di.vt)(),sr=(0,l.vt)(),or=[],ar=(0,a.vt)(),lr=a.zK.concat(a.zK,a.zK,a.zK),cr=(0,di.vt)(),ur=(0,di.vt)(),hr=[(0,di.vt)(),(0,di.vt)(),(0,di.vt)(),(0,di.vt)()],dr=(0,di.vt)(),pr=(0,di.vt)(),fr=(0,di.vt)(),gr=(0,di.vt)(),mr=(0,di.vt)(),vr=(0,di.vt)(),xr=(0,di.vt)();function yr(e,t){return 3*t+e}const _r=(0,di.vt)();function br(e,t){return(0,re.hZ)(_r,e[t],e[t+3]),_r}const Sr=(0,di.vt)(),wr=(0,Zi.vt)();var Cr=i(92942);let Tr=class extends ae.w{constructor(){super(...arguments),this.shader=new oe.r(Cr.a,()=>i.e(959).then(i.bind(i,959)))}initializePipeline(e){return e.hasAlpha?(0,ue.Ey)({blending:ue.T8,colorWrite:ue.kn}):(0,ue.Ey)({colorWrite:ue.kn})}};Tr=(0,I.Cg)([(0,j.$K)("esri.views.3d.webgl-engine.lib.TextureTechnique")],Tr);class Ar extends Ct.K{constructor(){super(...arguments),this.hasAlpha=!1}}(0,I.Cg)([(0,Ct.W)()],Ar.prototype,"hasAlpha",void 0);var Er=i(75497),Rr=i(80583);let Or=class extends ae.w{constructor(){super(...arguments),this.shader=new oe.r(Rr.a,()=>i.e(4849).then(i.bind(i,64849))),this.ignoreUnused=!0}};Or=(0,I.Cg)([(0,j.$K)("esri.views.3d.webgl-engine.shaders.OverlayCompositingTechnique")],Or);var Mr=i(92359);let Lr=class extends ie{constructor(e){super(e),this._overlays=null,this._renderTargets=null,this._overlayParameters=new Rr.O,this.hasHighlights=!1,this.renderOccludedFlags=1,this._hasWater=!1,this._renderers=new Map,this._sortedDrapeSourceRenderersDirty=!1,this._sortedRenderers=new H.A,this._passParameters=new Cr.T,this._screenToWorldRatio=1,this._localOriginFactory=null,this.unloadedMemory=0,this.ignoresMemoryFactor=!1,this._camera=new J.A,this.events=new F.bk,this.longitudeCyclical=null,this.produces=new Map([[18,e=>10!==e||this.hasHighlights],[19,()=>this._hasWater]]),this._hasTargetWithoutRasterImage=!1,this._hasDrapedFeatureSource=!1,this._hasDrapedRasterSource=!1,this._hasDrapedFlowSource=!1;const{state:t,stage:i}=e.parent.view,r=i.renderer.fboCache,n=i.renderView.renderingContext,s=i.renderView.techniques;this._renderContext=new Bi(n,new Qi(r,t.viewingMode),s)}initialize(){const e=this._view,t=e.stage.renderView.waterTextures;this.addHandles([(0,V.wB)(()=>t.updating,()=>this.events.emit("content-changed"),V.pc),(0,V.wB)(()=>this._spatialReference,e=>this._localOriginFactory=new oi(e),V.pc),(0,V.on)(()=>e.allLayerViews,"after-changes",()=>this._sortedDrapeSourceRenderersDirty=!0),(0,V.wB)(()=>function(e){let t=0;for(const i of e){const{name:e}=i;t+=e.length;const{color:r,fillOpacity:n,haloColor:s,haloOpacity:o}=i;t+=r.r+r.g+r.b+r.a+n,t+=s?s.r+s.g+s.b+s.a+o:0}const i=e.at(0);if(i){const{shadowOpacity:e,shadowDifference:r,shadowColor:n}=i;t+=e+r+n.r+n.g+n.b+n.a}return Me+++(t>=0?0:1)}(e.state.highlights),()=>this._sortedDrapeSourceRenderersDirty=!0,V.Vh),(0,V.wB)(()=>e.state.highlights,e=>{this._bindParameters.highlights=e},V.Vh),e.resourceController.scheduler.registerTask(Mr.W6.OVERLAY_RENDERER,this)]);const i=this._camera;i.near=1,i.far=1e4,i.relativeElevation=null,this._bindParameters.slot=18,this._bindParameters.camera=i,this._bindParameters.updateLighting(new Er.$p((0,l.S)()),0,0,0)}destroy(){this._renderers.forEach(e=>e.destroy()),this._renderers.clear(),this._passParameters.texture=(0,z.WD)(this._passParameters.texture),this.disposeOverlays(),this._renderContext.destroy(),this._sortedRenderers.prune()}get _bindParameters(){return this._renderContext.bind}get _rctx(){return this._stage.renderView.renderingContext}get _view(){return this.parent.view}get _stage(){return this.parent.view.stage}get _spatialReference(){return this.parent.spatialReference}get _techniques(){return this._stage.renderView.techniques}get rctx(){return this._rctx}get materials(){return this._pluginContext.materials}get screenToWorldRatio(){return this._screenToWorldRatio}get localOriginFactory(){return this._localOriginFactory}set time(e){this._renderContext.time=e}get pluginContext(){return this._pluginContext}initializeRenderContext(e){const t=new Fe(this._view.stage.renderView.textures,this._techniques,()=>{this._onMaterialOrContentChanged(),this.events.emit("content-changed"),this.notifyChange("updating"),this.notifyChange("isEmpty")},()=>this.events.emit("content-changed"));this._pluginContext={...e,materials:t},this._techniques.precompile(Or)}uninitializeRenderContext(){}acquireTechniques(){return[]}render(){}get updating(){return this._sortedDrapeSourceRenderersDirty||(0,N.Bs)(this._renderers,e=>e.updating||e.canCompact)}get hasOverlays(){return null!=this._overlays&&null!=this._renderTargets}getMaterialRenderer(e){for(const t of this._renderers.values()){const i=t.getMaterialRenderer(e);if(i)return i}return null}get layers(){return this._sortedDrapeSourceRenderersDirty&&this._updateSortedDrapeSourceRenderers(),(0,D.Am)(this._sortedRenderers.map(e=>e.drapeSource.layer).filter(e=>!!e))}registerDrapeSource(e,t){const i=this._renderers.get(e);null!=i&&i.destroy(),this._renderers.set(e,t),this._sortedDrapeSourceRenderersDirty=!0,"fullOpacity"in e&&this.addHandles((0,V.wB)(()=>e.fullOpacity,()=>this.events.emit("content-changed")),e)}removeDrapeSourceRenderer(e){if(null==e)return;const t=this._renderers.get(e);null!=t&&(this._sortedDrapeSourceRenderersDirty=!0,this._renderers.delete(e),this.removeHandles(e),t.destroy())}computeValidity(){return this._renderTargets?.computeValidity()??0}releaseRenderTargets(e){this._renderTargets?.dispose(e)}get overlays(){return this._overlays??[]}ensureDrapeTargets(e){this._hasTargetWithoutRasterImage=!!this._overlays&&(0,W.bw)(e,e=>1===e.drapeTargetType)}ensureDrapeSources(e){this._overlays?(this._hasDrapedFeatureSource=(0,W.bw)(e,e=>1===e.drapeSourceType),this._hasDrapedRasterSource=(0,W.bw)(e,e=>0===e.drapeSourceType),this._hasDrapedFlowSource=(0,W.bw)(e,e=>2===e.drapeSourceType)):this._hasDrapedFeatureSource=this._hasDrapedRasterSource=this._hasDrapedFlowSource=!1}get _needsColorWithoutRasterImage(){return this._hasDrapedRasterSource&&this._hasDrapedFeatureSource&&this._hasTargetWithoutRasterImage}ensureOverlays(e,t,i=this._bindParameters.overlayStretch){null==this._overlays&&(this._renderTargets=new K(this._stage.renderer.fboCache),this._overlays=[new G,new G]),this.ensureDrapeTargets(e),this.ensureDrapeSources(t),this._bindParameters.overlayStretch=i}disposeOverlays(){this._overlays=null,this._renderTargets?.dispose(1),this._renderTargets=null,this.events.emit("textures-disposed")}_useOverlayColorInsteadOfColorNoRasterImage(e){return 1===e&&!this._needsColorWithoutRasterImage&&this._hasDrapedFeatureSource}getTexture(e){const t=this._useOverlayColorInsteadOfColorNoRasterImage(e);return this._renderTargets?.getTexture(t?0:e)}get readyToRun(){return this.updating}runTask(e){this._processDrapeSources(()=>!0,e)}_onMaterialOrContentChanged(){this.renderOccludedFlags=(0,N.Bs)(this._renderers,e=>e.hasOccluders)?Dr:1}_processDrapeSources(e,t){let i=!1;for(const[r,n]of this._renderers){if(t?.done)break;(r.destroyed||e(r))&&n.commitChanges()&&(i=!0,t?.madeProgress())}this._sortedDrapeSourceRenderersDirty&&(this._sortedDrapeSourceRenderersDirty=!1,i=!0,this._updateSortedDrapeSourceRenderers(),t?.madeProgress()),t&&this.compact(t),i&&(null!=this._overlays&&0===this._renderers.size&&this.disposeOverlays(),this.notifyChange("updating"),this.notifyChange("isEmpty"),this._onMaterialOrContentChanged(),this.hasHighlights=(0,N.Bs)(this._renderers,e=>e.hasHighlights),this.events.emit("content-changed"))}compact(e){let t=!1;for(const i of this._renderers.values()){if(e.done)break;t=i.compact(e)||t}return t&&this.notifyChange("updating"),t}hasHighlight(e){return(0,N.Bs)(this._renderers,t=>t.hasHighlight(e))}processSyncDrapeSources(){this._processDrapeSources(e=>1===e.updatePolicy)}get isEmpty(){return!U.b.OVERLAY_DRAW_DEBUG_TEXTURE&&(0,N.mt)(this._renderers,e=>e.isEmpty)}get hasWater(){const e=(0,N.Bs)(this._renderers,({hasWater:e})=>e);return e!==this._hasWater&&(this._hasWater=e,this.events.emit("has-water")),this._hasWater}renders(e){if(U.b.OVERLAY_DRAW_DEBUG_TEXTURE&&4!==e&&2!==e)return!0;if(!this._overlays)return!1;const t=this._overlays[0];for(const e of this._overlays)e.setupGeometryViews(this.longitudeCyclical);if(!t.hasSomeSizedView())return!1;const i=this._setOutput(this._renderTargets?.targets.find(t=>t.content===e)?.output??0);++this._techniques.precompiling;const r=this._sortedRenderers.some(({renderer:e})=>e.precompile(this._renderContext));return--this._techniques.precompiling,this._setOutput(i),r}_setOutput(e){const t=this._bindParameters.output;return this._bindParameters.output=e,this._bindParameters.slot=4===e?19:18,t}get mode(){return this.isEmpty?0:this.hasWater&&this.renders(3)?2:this._renderTargets?.getTexture(0)?1:0}updateAnimation(e){let t=!1;return this._renderers.forEach(i=>t=i.updateAnimation(e)||t),t&&this.parent.requestRender(0),t}updateDrapeSourceOrder(){this._sortedDrapeSourceRenderersDirty=!0}precompileShaders(e){if(!this._overlays||!this._renderTargets)return!1;const t=this._bindParameters;t.alignPixelEnabled=e.alignPixelEnabled,++this._techniques.precompiling;for(const e of this._renderTargets.targets){if(1===e.content&&!this._needsColorWithoutRasterImage)continue;const{output:i}=e;this._setOutput(i),10===i&&(t.highlightMixTexture=t.highlights.length>1?this._rctx.emptyTexture:null);const r=this._renderContext.renderOccludedMask;4===e.content&&(this._renderContext.renderOccludedMask=Dr),this._sortedRenderers.forAll(({drapeSource:t,renderer:i})=>{1===e.content&&0===t.drapeSourceType||4===e.content&&i.hasOnlyOccluders||i.precompile(this._renderContext)}),this._renderContext.renderOccludedMask=r,t.highlightMixTexture=null}return--this._techniques.precompiling,!0}drawOverlays(e,t){if(!this._overlays||!this._renderTargets)return;for(const e of this._overlays)e.setupGeometryViews(this.longitudeCyclical);this._bindParameters.alignPixelEnabled=e.alignPixelEnabled;const i=this.allSourcesOccluders;for(const e of this._renderTargets.targets){if((0!==e.content||!this._hasDrapedFlowSource)&&!e.handleRenderRequest(t)||1===e.content&&!this._needsColorWithoutRasterImage||4===e.content&&i)continue;const r=this._drawTarget(0,e),n=this._drawTarget(1,e);(r||n)&&e.fbo.generateMipMap()}}_drawTarget(e,t){const i=this._overlays[e],r=i.canvasGeometries;if(0===r.numViews)return!1;const n=this._view.state.contentPixelRatio;this._screenToWorldRatio=n*i.mapUnitsPerPixel/this._bindParameters.overlayStretch;const{output:s,content:o}=t;if(this.isEmpty||4===s&&!this.hasWater||!i.hasSomeSizedView())return!1;const{_rctx:a,_camera:l,_renderContext:c,_bindParameters:u}=this;if(l.pixelRatio=i.pixelRatio*n,this._setOutput(s),u.screenToWorldRatio=this._screenToWorldRatio,u.screenToPCSRatio=this._screenToWorldRatio*this.parent.worldToPCSRatio,4===o&&(c.renderOccludedMask=Dr),!this.renders(o))return c.renderOccludedMask=$i,!1;const{resolution:h}=i,d=0===e,p=d?0:h;if(a.setViewport(p,0,h,h),this._bindTargetFBO(t),d&&(10===s?a.gl.clearBufferuiv(a.gl.COLOR,0,[0,0,0,0]):(a.setClearColor(0,0,0,0),a.clear(16384))),U.b.OVERLAY_DRAW_DEBUG_TEXTURE&&4!==o&&2!==o){this._techniques.precompile(Tr,Fr);const t=this._techniques.get(Tr,Fr);for(let n=0;n<r.numViews;n++)this._setViewParameters(r.extents[n],i),this._ensureDebugPatternResources(i.resolution,Ir[e]),a.bindTechnique(t,u,this._passParameters),a.screen.draw()}if(10===s){const{fboCache:i}=this._stage.renderer,r=this._resolution;this._bindTargetFBO(t),function(e,t,i,r,n,s,o=0){const{highlights:a}=n,l=a.length>1?t.acquire(i,r,"highlight mix",a.length>Pe?3:1):null,{gl:c}=e;if(l){const t=e.boundFramebuffer;e.bindFramebuffer(l.fbo),c.clearBufferuiv(c.COLOR,0,[0,0,0,0]),e.bindFramebuffer(t)}const u=l?.getTexture();n.highlightMixTexture=u,(0,re.hZ)(n.highlightMixOrigin,o,0),a.forEach((t,a)=>{if(a>0){const t=Te.A.TEXTURE_UNIT_FOR_UPDATES;e.bindTexture(u,t),e.setActiveTexture(t),c.copyTexSubImage2D(3553,0,0,0,o,0,i,r),e.bindTexture(null,t)}e.clear(256),n.highlightLevel=a,s()}),n.highlightLevel=null,n.highlightMixTexture=null,l?.release()}(a,i,r,r,u,()=>this._renderAllGeometry(e,t),p)}else this._renderAllGeometry(e,t);return a.bindFramebuffer(null),c.renderOccludedMask=$i,!0}get allSourcesOccluders(){return(0,N.mt)(this._renderers,e=>e.hasOnlyOccluders)}_renderAllGeometry(e,t){const i=this._overlays[e],r=i.canvasGeometries;this._sortedRenderers.forAll(({drapeSource:n,renderer:s})=>{if(1===t.content&&0===n.drapeSourceType)return;const{fullOpacity:o}=n,a=null!=o&&o<1&&0===t.output&&this._bindTemporaryFBO();for(let e=0;e<r.numViews;e++)this._setViewParameters(r.extents[e],i),s.render(this._renderContext);if(a){this._bindTargetFBO(t),this._overlayParameters.texture=a.getTexture(),this._overlayParameters.opacity=o,this._overlayParameters.overlayIndex=e;const i=this._techniques.get(Or);this._rctx.bindTechnique(i,this._bindParameters,this._overlayParameters),this._rctx.screen.draw(),a.release()}})}_bindTargetFBO(e){const t=this._resolution,i=2*t;e.fbo.ensureFramebuffer(i,t),e.fbo.bind(this._rctx)}_bindTemporaryFBO(){const e=this._resolution,t=2*e,i=this._stage.renderer.fboCache,r=i.acquire(t,e,"overlay tmp");return i.rctx.bindFramebuffer(r.fbo),i.rctx.clear(16384),r}get _resolution(){return this._overlays?.[0].resolution??0}notifyContentChanged(){this.events.emit("content-changed")}intersectRay(e,t,i,r){this._sortedDrapeSourceRenderersDirty&&this._updateSortedDrapeSourceRenderers();let n=0;for(const{renderer:s}of this._sortedRenderers)n=s.intersect?.(e,t,i,r,n)??n}_updateSortedDrapeSourceRenderers(){if(this._sortedRenderers.clear(),0===this._renderers.size)return;const e=this._view.map.allLayers.map(e=>e.uid),t=e.length;this._renderers.forEach((i,r)=>{const n=e.indexOf(r.layer?.uid),s=n>=0,o=r.renderGroup??(s?0:1),a=r.drapeSourcePriorityOffset??0,l=t*o+(s?n:0)+a;this._sortedRenderers.push(new Pr(r,i,l))}),this._sortedRenderers.sort((e,t)=>e.index-t.index)}_setViewParameters(e,t){const i=this._camera;i.viewport=[0,0,t.resolution,t.resolution],(0,o.v3)(i.projectionMatrix,0,e[2]-e[0],0,e[3]-e[1],i.near,i.far),(0,o.kN)(i.viewMatrix,[-e[0],-e[1],0])}_ensureDebugPatternResources(e,t){if((0,y.hZ)(this._passParameters.color,t[0],t[1],t[2]),this._passParameters.texture)return;const i=new Uint8Array(e*e*4);let r=0;for(let t=0;t<e;t++)for(let n=0;n<e;n++){const s=Math.floor(n/10),o=Math.floor(t/10);s<2||o<2||10*s>e-20||10*o>e-20?(i[r++]=255,i[r++]=255,i[r++]=255,i[r++]=255):(i[r++]=255,i[r++]=255,i[r++]=255,i[r++]=1&s&&1&o?1&n^1&t?0:255:1&s^1&o?0:128)}const n=new Ae.R(e);n.samplingMode=9728,this._passParameters.texture=new Te.A(this._rctx,n,i)}get test(){}};(0,I.Cg)([(0,j.MZ)()],Lr.prototype,"hasHighlights",void 0),(0,I.Cg)([(0,j.MZ)()],Lr.prototype,"renderOccludedFlags",void 0),(0,I.Cg)([(0,j.MZ)()],Lr.prototype,"_sortedDrapeSourceRenderersDirty",void 0),(0,I.Cg)([(0,j.MZ)({constructOnly:!0})],Lr.prototype,"parent",void 0),(0,I.Cg)([(0,j.MZ)({readOnly:!0})],Lr.prototype,"_techniques",null),(0,I.Cg)([(0,j.MZ)({type:Boolean,readOnly:!0})],Lr.prototype,"updating",null),(0,I.Cg)([(0,j.MZ)()],Lr.prototype,"isEmpty",null),Lr=(0,I.Cg)([(0,j.$K)("esri.views.3d.terrain.OverlayRenderer")],Lr);class Pr{constructor(e,t,i){this.drapeSource=e,this.renderer=t,this.index=i}}const Ir=[[1,.5,.5],[.5,.5,1]],Dr=4,Fr=new Ar;Fr.hasAlpha=!0;class Nr{constructor(e,t,i,r){this.positions=e,this.polygonIndices=t,this.outline=i,this.projectionSuccess=r,this.count=e.length/3}get vertexCount(){return this.positions.length/3}get polygonIndexCount(){return this.polygonIndices.length}get outlineIndexCount(){const{outline:e}=this;if("tessellated-indices"!==e.output)return 0;let t=0;for(let i=0;i<e.outlineIndices.length;i++)t+=Wr(e.outlineIndices[i]);return t}get outlineSegmentCount(){const{outline:e}=this;if("tessellated-indices"!==e.output)return 0;let t=0;for(let i=0;i<e.outlineIndices.length;i++)t+=Wr(e.outlineIndices[i]);return t}}class zr extends Nr{}function Hr(e,t){const{projectIfNearlyVertical:i=!1,outlineOutput:n="none",method:o,owner:a}=t??{},l="tessellated-indices"===n,c=S(e.rings,!!e.hasZ,e.spatialReference),u=function(e,t){const{hasZ:i,ccwRingsAsHoles:r,spatialReference:n}=t,o=t.axis??S(e,i,n),a=e.length,l=[],c=[],u=[],h=[],d=e.reduce((e,t)=>e+t.length,0);let p=0;const f=(0,s.jh)(3*d);let g=0;const m=r&&e[0]&&w(e[0],i,o);for(let t=a-1;t>=0;t--){const n=e[t],s=L(n,i);if(s<3){s>1&&h.push(n);continue}const a=!!r&&w(n,i,o);if(m?!a:a)l[p++]=n;else{let e=n.length;for(let t=0;t<p;++t)e+=l[t].length;const t={index:g,pathLengths:new Array(p+1),count:e,holeIndices:new Array(p)};t.pathLengths[0]=n.length,n.length>0&&u.push({index:g,count:n.length}),g=M(n,f,g,n.length,i,m);for(let e=0;e<p;++e){const r=l[e];t.holeIndices[e]=g,t.pathLengths[e+1]=r.length,r.length>0&&u.push({index:g,count:r.length}),g=M(r,f,g,r.length,i,m)}p=0,t.count>0&&c.push(t)}}const v=g;for(const e of h)u.push({index:g,count:e.length}),g=M(e,f,g,e.length,i,m);return{positions:3*g===f.length?f:(0,s.l5)(f,0,3*g),polygonVertexCount:v,polygons:c,outlines:u}}(e.rings,{hasZ:!!e.hasZ,ccwRingsAsHoles:!0,spatialReference:e.spatialReference,axis:c}),d=function(e,t){const i=function(e,t){const i={method:t?.method??"auto",projectionAxis:t?.projectionAxis??void 0,outlines:t?.outlines??void 0,owner:t?.owner??void 0},{projectionAxis:r}=i,n=null!=r&&2!==r;n&&E(e.positions,r,2);const s=function(e,t){if("libtess"===t.method)return A(e,t);const i=function(e,t){const i=null!=t.owner&&T.has(t.owner);return"auto"===t.method&&!(i&&e.polygonVertexCount>=1e4)}(e,t),r=Array();let n=0;for(const s of e.polygons){const o=O(e.positions,s),a=(s.holeIndices??[]).map(e=>e-s.index),l=a.length>0?a:null,c=(0,p.e)(o,l,3),u=p.e.deviation(o,a,3,c);if(i&&u>1e-5)return A(e,t);for(let e=0;e<c.length;e++)r.push(c[e]+s.index);n=Math.max(n,u)}const{outlineIndexBuffer:s,outlineRingLengths:o}=null!=t.outlines?R(t.outlines,e.positions):{outlineIndexBuffer:void 0,outlineRingLengths:void 0};return{succeeded:!0,positions:e.positions,indices:(0,m.uW)(r),outlineIndexBuffer:s,outlineRingLengths:o,vertexCount:e.positions.length/3,method:"earcut",deviation:n}}(e,i);if(n){const t=s.succeeded?s.positions:null;null!=t&&t!==e.positions&&E(t,2,r),E(e.positions,2,r)}return s}(e,t);return i.succeeded?i:"libtess-not-loaded"===i.message?((0,h.gc)(C),async function(){try{await(0,f.l3)(),C.notify()}catch(e){throw e}}()):i}(u,{projectionAxis:i?c:void 0,outlines:l?u.outlines:void 0,method:o,owner:a});if((0,r.$X)(d))return d;if(!d.succeeded)return null;let g={output:"none"};if("vertex-data"===n){const e=d.positions!==u.positions?u.positions:u.positions.slice();g={output:"vertex-data",outlines:Vr(u.outlines,e)}}else"tessellated-indices"===n&&(g=function(e){const{outlineIndexBuffer:t,outlineRingLengths:i}=e;if(null==t||null==i)return{output:"none"};const r=new Array(i.length);let n=0;for(let e=0;e<i.length;e++){const s=i[e],o=t.slice(n,n+s);r[e]=o,n+=s}return{output:"tessellated-indices",outlineIndices:r}}(d));return new zr(d.positions,d.indices,g,!0)}function Vr(e,t,i=null){return e.filter(({count:e})=>e>1).map(({index:e,count:r})=>{const n=3*e,o=3*r;return null!=i?new Ur(e,r,(0,s.l5)(t,n,o),(0,s.l5)(i,n,o)):new jr(e,r,(0,s.l5)(t,n,o))})}function Wr(e,t=0,i=e.length){return i>1&&e[t]===e[t+i-1]?i-1:i}class jr{constructor(e,t,i){this.index=e,this.count=t,this.position=i}}class Ur extends jr{constructor(e,t,i,r){super(e,t,i),this.mapPositions=r}}},6733(e,t,i){i.d(t,{Q:()=>h});var r=i(37585),n=i(48163),s=i(31821),o=i(74333);class a extends o.n{constructor(e,t){super(e,"ivec2",1,(i,r,n)=>i.setUniform2iv(e,t(r,n)))}}var l=i(93588),c=i(9273),u=i(34053);function h(e){const{vertex:t}=e;t.uniforms.add(new c.R("coverageTexture",e=>e.coverageTexture),new a("highlightRenderCellCount",e=>(0,r.hZ)(d,e.horizontalCellCount,e.verticalCellCount)),new a("highlightTextureResolution",({highlightTexture:e})=>(0,r.hZ)(d,e.descriptor.width,e.descriptor.height)),new l.c("highlightLevel",e=>e.highlightLevel)).constants.add("cellSize","int",u.g),e.varyings.add("sUV","vec2"),e.varyings.add("vOutlinePossible","float"),t.code.add(s.H`const ivec2 cellVertices[4] = ivec2[4](ivec2(0,0), ivec2(1,0), ivec2(0,1), ivec2(1,1));`),t.main.add(s.H`int cellIndex = gl_InstanceID;
|
|
389
389
|
int cellX = cellIndex % highlightRenderCellCount[0];
|
|
390
390
|
int cellY = (cellIndex - cellX) / highlightRenderCellCount[0];
|
|
391
391
|
ivec2 cellPos = ivec2(cellX, cellY);
|