@arcgis/core 4.33.0-next.20250303 → 4.33.0-next.20250304

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (114) hide show
  1. package/assets/esri/core/workers/RemoteClient.js +1 -1
  2. package/assets/esri/core/workers/chunks/04341d50082f864025aa.js +1 -0
  3. package/assets/esri/core/workers/chunks/{b49af2e3a1a38a063ab9.js → 1bd4fe77ba6fb25322e7.js} +1 -1
  4. package/assets/esri/core/workers/chunks/{3ebdd0701e77bb28c75d.js → 2079f9d28e4199714f22.js} +1 -1
  5. package/assets/esri/core/workers/chunks/{0fd6a78b38b0e2dae8a5.js → 237a965bd41ba8903e03.js} +1 -1
  6. package/assets/esri/core/workers/chunks/{4dbd4523281691401272.js → 4539a802cba77a7a7cc7.js} +1 -1
  7. package/assets/esri/core/workers/chunks/{99f90d085aa9eb13e4fb.js → 46fb6ba8900286d18b6f.js} +1 -1
  8. package/assets/esri/core/workers/chunks/{2a44a6e75b2799246257.js → 4fb4884d2de42792abe3.js} +1 -1
  9. package/assets/esri/core/workers/chunks/5295e685ae839087c568.js +1 -0
  10. package/assets/esri/core/workers/chunks/{d60da671aba70485050e.js → 6e6422eda398774acbc7.js} +1 -1
  11. package/assets/esri/core/workers/chunks/{c9cb8a6ff01275bec713.js → 77845cd5d824c1004bfa.js} +1 -1
  12. package/assets/esri/core/workers/chunks/{a73a262ddc959a59819f.js → 7d3b2bdc75525d47389c.js} +1 -1
  13. package/assets/esri/core/workers/chunks/{cc1aedb2b3aa3854b0de.js → 901c957c049f53318e87.js} +1 -1
  14. package/assets/esri/core/workers/chunks/{654fe135d41af81daa13.js → 909be86782af3deb448e.js} +1 -1
  15. package/assets/esri/core/workers/chunks/{7d93ff4f18fd21c7b9f2.js → 94f41ef15f6c61562e5e.js} +1 -1
  16. package/assets/esri/core/workers/chunks/{8540fb31bd0b29ff1906.js → 968956284f44187f0622.js} +1 -1
  17. package/assets/esri/core/workers/chunks/{92b48e3365d1cc933113.js → 96d2a0777f5c418055fb.js} +1 -1
  18. package/assets/esri/core/workers/chunks/988efc508c33ca341e49.js +1 -0
  19. package/assets/esri/core/workers/chunks/{56db71ea7eb8a5652d98.js → abfc5f9ac16c3e885c5f.js} +1 -1
  20. package/assets/esri/core/workers/chunks/{856b03020b2dd047291d.js → ad9b3b83aa96db7b79ea.js} +1 -1
  21. package/assets/esri/core/workers/chunks/{c3b2b05996e2008adbe3.js → afddb94ff4e1a70022c7.js} +1 -1
  22. package/assets/esri/core/workers/chunks/{c409bb2acd846d3b1395.js → b2f9f0767dadf185120c.js} +1 -1
  23. package/assets/esri/core/workers/chunks/{563594357f3648652a5c.js → ba917175ca2a6681501e.js} +1 -1
  24. package/assets/esri/core/workers/chunks/c03e6e35082beaec02a6.js +1 -0
  25. package/assets/esri/core/workers/chunks/{759781cad91d31ab7bc4.js → db4c110ab4c26c4b768c.js} +1 -1
  26. package/assets/esri/core/workers/chunks/dcb043986fb065de0366.js +1 -0
  27. package/assets/esri/core/workers/chunks/{05c80002c37002ac99e8.js → de16b771d2c8d816c738.js} +1 -1
  28. package/assets/esri/core/workers/chunks/{3010a22d00f45fce5939.js → e0ac90b4ad8c36fb7d70.js} +1 -1
  29. package/assets/esri/core/workers/chunks/{5719471414810b6a9aec.js → e56647e61296643c5f84.js} +1 -1
  30. package/assets/esri/core/workers/chunks/{1bc22af4cc4effcbcf2b.js → e6a5911ea21bef32834b.js} +1 -1
  31. package/assets/esri/core/workers/chunks/{2f818b9a6b1f2b61410d.js → e99d7ecb80a9df9ead6d.js} +24 -24
  32. package/assets/esri/core/workers/chunks/{12d798775a96a45aada2.js → f46c4a69ef2f763e905b.js} +1 -1
  33. package/assets/esri/core/workers/chunks/{5e80e10b7c7e66dd861e.js → febae745a29a17ca130a.js} +1 -1
  34. package/chunks/Bufferer-CicaNej1.js +1 -1
  35. package/chunks/DefaultMaterial.glsl.js +22 -22
  36. package/chunks/Distance2DCalculator-C1KHhZwD.js +1 -1
  37. package/chunks/Envelope.js +1 -1
  38. package/chunks/GeodeticDistanceCalculator-CcF1gMZX.js +1 -1
  39. package/chunks/OperatorClip.js +1 -1
  40. package/chunks/OperatorCut.js +1 -1
  41. package/chunks/OperatorGeodesicBuffer.js +1 -1
  42. package/chunks/OperatorGeodeticArea.js +1 -1
  43. package/chunks/OperatorMultiPartToSinglePart.js +1 -1
  44. package/chunks/OperatorProximity.js +1 -1
  45. package/chunks/OperatorShapePreservingProject.js +1 -1
  46. package/chunks/ProjectionTransformation.js +1 -1
  47. package/chunks/SideCalculator2D-BNwb5gvz.js +1 -1
  48. package/chunks/disjointOperator.js +1 -1
  49. package/core/arrayUtils.js +1 -1
  50. package/editing/sharedTemplates/executor/builders/support/builderUtils.js +1 -1
  51. package/editing/sharedTemplates/executor/createTemplateExecutor.js +1 -1
  52. package/editing/sharedTemplates/executor/support/createFeatureServiceEdit.js +5 -0
  53. package/editing/sharedTemplates/executor/support/createPresetServiceEdit.js +5 -0
  54. package/geometry/operators/extendOperator.js +1 -1
  55. package/geometry/operators/gx/operatorAutoComplete.js +1 -1
  56. package/geometry/operators/gx/operatorBuffer.js +1 -1
  57. package/geometry/operators/gx/operatorGraphicBuffer.js +1 -1
  58. package/geometry/operators/gx/operatorIntegrate.js +1 -1
  59. package/geometry/operators/gx/operatorLabelPoint.js +1 -1
  60. package/geometry/operators/gx/operatorLinesToPolygons.js +1 -1
  61. package/geometry/operators/gx/operatorPolygonOverlay.js +1 -1
  62. package/geometry/operators/gx/operatorSimplify.js +1 -1
  63. package/geometry/operators/gx/operatorSymmetricDifference.js +1 -1
  64. package/geometry/operators/gx/operatorUnion.js +1 -1
  65. package/geometry/operators/json/disjointOperator.js +1 -1
  66. package/geometry/operators/reshapeOperator.js +1 -1
  67. package/geometry/operators/support/apiConverter.js +1 -1
  68. package/geometry/operators/support/initNoPeFactory.js +1 -1
  69. package/geometry/operators/support/jsonConverter.js +1 -1
  70. package/interfaces.d.ts +12 -14
  71. package/layers/WMTSLayer.js +1 -1
  72. package/layers/graphics/controllers/FeatureTileController3D.js +1 -1
  73. package/layers/graphics/dehydratedFeatures.js +1 -1
  74. package/layers/support/SubtypeSublayer.js +1 -1
  75. package/layers/support/featureLayerUtils.js +1 -1
  76. package/layers/support/wmtsUtils.js +1 -1
  77. package/package.json +1 -1
  78. package/support/revision.js +1 -1
  79. package/views/3d/layers/BuildingComponentSublayerView3D.js +1 -1
  80. package/views/3d/layers/GraphicsLayerView3D.js +1 -1
  81. package/views/3d/layers/I3SMeshView3D.js +1 -1
  82. package/views/3d/layers/IntegratedMeshLayerView3D.js +1 -1
  83. package/views/3d/layers/SceneLayerView3D.js +1 -1
  84. package/views/3d/layers/graphics/Graphics3DObjectSymbolLayer.js +1 -1
  85. package/views/3d/layers/support/FeatureTile.js +1 -1
  86. package/views/3d/layers/support/FeatureTileFetcher3D.js +1 -1
  87. package/views/3d/layers/support/FeatureTileFetcher3DDebugger.js +1 -1
  88. package/views/3d/layers/support/projectExtentUtils.js +1 -1
  89. package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
  90. package/views/3d/webgl-engine/shaders/DefaultMaterial.glsl.js +1 -1
  91. package/views/View.js +1 -1
  92. package/views/support/LayerLayerViewInfo.js +5 -0
  93. package/views/support/LayerViewManager.js +5 -0
  94. package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
  95. package/widgets/Editor/Edits.js +1 -1
  96. package/widgets/Editor/workflowUtils.js +1 -1
  97. package/widgets/Feature/FeatureRelationship/FeatureRelationshipViewModel.js +1 -1
  98. package/widgets/Feature/FeatureRelationship.js +1 -1
  99. package/widgets/Feature/FeatureUtilityNetworkAssociationList.js +1 -1
  100. package/widgets/Feature/support/featureUtils.js +1 -1
  101. package/widgets/FeatureForm/FeatureFormViewModel.js +1 -1
  102. package/widgets/Features/FeaturesDrillIn.js +1 -1
  103. package/widgets/Features/FeaturesViewModel.js +1 -1
  104. package/widgets/Features.js +1 -1
  105. package/widgets/UtilityNetworkTrace/UtilityNetworkTraceFeaturesDrillIn.js +1 -1
  106. package/widgets/VideoPlayer/VideoPlayerViewModel.js +1 -1
  107. package/widgets/support/UtilityNetworkAssociations/utils/createAssociation.js +1 -1
  108. package/assets/esri/core/workers/chunks/0e6d338b0937724763c7.js +0 -1
  109. package/assets/esri/core/workers/chunks/7d120f8b01fe719eb257.js +0 -1
  110. package/assets/esri/core/workers/chunks/95047f145ebda65c3d8e.js +0 -1
  111. package/assets/esri/core/workers/chunks/960b12a6fd5b6933212f.js +0 -1
  112. package/assets/esri/core/workers/chunks/af005704f23088db3ded.js +0 -1
  113. package/editing/sharedTemplates/executor/support/createServiceEdit.js +0 -5
  114. package/views/LayerViewManager.js +0 -5
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[3169,6061,8125],{76061:(e,t,n)=>{n.d(t,{G:()=>r,S:()=>s});class r{*[Symbol.iterator](){let e=this.next();for(;e;)yield e,e=this.next()}}class s extends r{constructor(e){super(),this.m_iGeom=-1,this.m_aGeoms=e?e.slice():[]}next(){if(this.m_iGeom<this.m_aGeoms.length-1){const e=this.m_aGeoms[++this.m_iGeom];return this.m_aGeoms[this.m_iGeom]=null,e}return null}tock(){return!1}getGeometryID(){return this.m_iGeom}getRank(){return 1}}},78125:(e,t,n)=>{n.r(t),n.d(t,{fromExtent:()=>G,fromGeometry:()=>C,fromMultipoint:()=>M,fromPoint:()=>V,fromPolygon:()=>w,fromPolyline:()=>P,fromSpatialReference:()=>R,getSpatialReference:()=>x,toExtent:()=>v,toGeometry:()=>Z,toMultipoint:()=>d,toPoint:()=>k,toPolygon:()=>E,toPolyline:()=>_});var r=n(83661),s=(n(79187),n(55537)),a=n(95213),o=n(35368),i=n(12189),u=n(5443),c=n(48526),l=n(86738),m=n(39829),h=n(82799),f=(n(90293),n(83299));const g="_gxVersion",y=2,p=1;function x(e){return Array.isArray(e)?e[0].spatialReference:e.spatialReference}function C(e){switch(e.type){case"point":return V(e);case"multipoint":return M(e);case"polyline":return P(e);case"polygon":return w(e);case"extent":return G(e);default:throw new Error(`Unsupported geometry type: ${e.type}`)}}function G(e){if(!e.getCacheValue(g)){const t=new a.E;t.setCoords(e.xmin,e.ymin,e.xmax,e.ymax),e.hasM&&t.setInterval(y,0,e.mmin,e.mmax),e.hasZ&&t.setInterval(p,0,e.zmin,e.zmax),e.setCacheValue(g,t)}return e.getCacheValue(g)}function M(e){if(!e.getCacheValue(g)){const t=new o.M,n=new a.P,r=e.points,s=e.hasM,i=e.hasZ,u=i?3:2;for(let e=0,a=r.length;e<a;e++){const a=r[e];n.setXYCoords(a[0],a[1]),i&&n.setZ(a[2]??0),s&&n.setM(a[u]??NaN),t.add(n)}e.setCacheValue(g,t)}return e.getCacheValue(g)}function V(e){if(!e.getCacheValue(g)){const t=new a.P;t.setXYCoords(e.x,e.y),e.hasM&&t.setM(e.m),e.hasZ&&t.setZ(e.z),e.setCacheValue(g,t)}return e.getCacheValue(g)}function w(e){if(!e.getCacheValue(g)){const{curveRings:t,hasM:n,hasZ:r,rings:s}=e,a=(0,f.fromGeometryToGXGeometry)({curveRings:t,hasM:n,hasZ:r,rings:s});e.setCacheValue(g,a)}return e.getCacheValue(g)}function P(e){if(!e.getCacheValue(g)){const{curvePaths:t,hasM:n,hasZ:r,paths:s}=e,a=(0,f.fromGeometryToGXGeometry)({curvePaths:t,hasM:n,hasZ:r,paths:s});e.setCacheValue(g,a)}return e.getCacheValue(g)}function R(e){if(e.wkid)return(0,i.c)(e.wkid);const t=e.wkt2||e.wkt;return t?(0,i.a)(t):null}function Z(e,t){if(e)switch(e.getGeometryType()){case s.G.enumPoint:return k(e,t);case s.G.enumEnvelope:return v(e,t);case s.G.enumMultiPoint:return d(e,t);case s.G.enumPolyline:return _(e,t);case s.G.enumPolygon:return E(e,t)}return null}function v(e,t){if(e.isEmpty())return null;const n=new u.A({xmin:e.getXMin(),ymin:e.getYMin(),xmax:e.getXMax(),ymax:e.getYMax(),spatialReference:t}),r=e.getDescription();if(r.hasM()){const t=e.queryInterval(y,0);n.mmin=t.vmin,n.mmax=t.vmax}if(r.hasZ()){const t=e.queryInterval(p,0);n.zmin=t.vmin,n.zmax=t.vmax}return n.setCacheValue(g,e),n}function d(e,t){if(e.isEmpty())return null;const n=e.getDescription(),r=n.hasM(),s=n.hasZ(),o=[],i=new a.P;for(let t=0,n=e.getPointCount();t<n;t++){e.getPointByVal(t,i);const n=[i.getX(),i.getY()];s&&n.push(i.getZ()),r&&n.push(i.getM()),o.push(n)}const u=new c.A({hasM:r,hasZ:s,points:o,spatialReference:t});return u.setCacheValue(g,e),u}function k(e,t){if(e instanceof r.P)return new l.A({x:e.x,y:e.y,spatialReference:t});if(e.isEmpty())return null;const n=new l.A({x:e.getX(),y:e.getY(),spatialReference:t}),s=e.getDescription();return s.hasM()&&(n.m=e.getM()),s.hasZ()&&(n.z=e.getZ()),n.setCacheValue(g,e),n}function E(e,t){if(e.isEmpty())return null;const n=m.A.fromJSON({spatialReference:t,...(0,f.toGeometry)(e,null)});return n.setCacheValue(g,e),n}function _(e,t){if(e.isEmpty())return null;const n=h.A.fromJSON({spatialReference:t,...(0,f.toGeometry)(e,null)});return n.setCacheValue(g,e),n}}}]);
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[3169,6061,8125],{76061:(e,t,n)=>{n.d(t,{G:()=>r,S:()=>s});class r{*[Symbol.iterator](){let e=this.next();for(;e;)yield e,e=this.next()}}class s extends r{constructor(e){super(),this.m_iGeom=-1,this.m_aGeoms=e?e.slice():[]}next(){if(this.m_iGeom<this.m_aGeoms.length-1){const e=this.m_aGeoms[++this.m_iGeom];return this.m_aGeoms[this.m_iGeom]=null,e}return null}tock(){return!1}getGeometryID(){return this.m_iGeom}getRank(){return 1}}},78125:(e,t,n)=>{n.r(t),n.d(t,{fromExtent:()=>G,fromGeometry:()=>C,fromMultipoint:()=>M,fromPoint:()=>V,fromPolygon:()=>w,fromPolyline:()=>P,fromSpatialReference:()=>R,getSpatialReference:()=>x,toExtent:()=>v,toGeometry:()=>Z,toMultipoint:()=>d,toPoint:()=>k,toPolygon:()=>E,toPolyline:()=>_});var r=n(83661),s=(n(79187),n(55537)),a=n(95213),o=n(35368),i=n(12189),u=n(5443),c=n(48526),l=n(86738),m=n(39829),h=n(82799),f=(n(90293),n(83299));const g="_gxVersion",y=2,p=1;function x(e){return Array.isArray(e)?e[0].spatialReference:e.spatialReference}function C(e){switch(e.type){case"point":return V(e);case"multipoint":return M(e);case"polyline":return P(e);case"polygon":return w(e);case"extent":return G(e);default:throw new Error(`Unsupported geometry type: ${e.type}`)}}function G(e){if(!e.getCacheValue(g)){const t=new a.E;t.setCoords(e.xmin,e.ymin,e.xmax,e.ymax),e.hasM&&t.setInterval(y,0,e.mmin,e.mmax),e.hasZ&&t.setInterval(p,0,e.zmin,e.zmax),e.setCacheValue(g,t)}return e.getCacheValue(g)}function M(e){if(!e.getCacheValue(g)){const t=new o.M,n=new a.P,r=e.points,s=e.hasM,i=e.hasZ,u=i?3:2;for(let e=0,a=r.length;e<a;e++){const a=r[e];n.setXYCoords(a[0],a[1]),i&&n.setZ(a[2]??0),s&&n.setM(a[u]??NaN),t.add(n)}e.setCacheValue(g,t)}return e.getCacheValue(g)}function V(e){if(!e.getCacheValue(g)){const t=new a.P;t.setXYCoords(e.x,e.y),e.hasM&&t.setM(e.m),e.hasZ&&t.setZ(e.z),e.setCacheValue(g,t)}return e.getCacheValue(g)}function w(e){if(!e.getCacheValue(g)){const{curveRings:t,hasM:n,hasZ:r,rings:s}=e,a=(0,f.fromGeometryToGXGeometry)({curveRings:t,hasM:n,hasZ:r,rings:s});e.setCacheValue(g,a)}return e.getCacheValue(g)}function P(e){if(!e.getCacheValue(g)){const{curvePaths:t,hasM:n,hasZ:r,paths:s}=e,a=(0,f.fromGeometryToGXGeometry)({curvePaths:t,hasM:n,hasZ:r,paths:s});e.setCacheValue(g,a)}return e.getCacheValue(g)}function R(e){if(e.wkid)return(0,i.c)(e.wkid);const t=e.wkt2||e.wkt;return t?(0,i.b)(t):null}function Z(e,t){if(e)switch(e.getGeometryType()){case s.G.enumPoint:return k(e,t);case s.G.enumEnvelope:return v(e,t);case s.G.enumMultiPoint:return d(e,t);case s.G.enumPolyline:return _(e,t);case s.G.enumPolygon:return E(e,t)}return null}function v(e,t){if(e.isEmpty())return null;const n=new u.A({xmin:e.getXMin(),ymin:e.getYMin(),xmax:e.getXMax(),ymax:e.getYMax(),spatialReference:t}),r=e.getDescription();if(r.hasM()){const t=e.queryInterval(y,0);n.mmin=t.vmin,n.mmax=t.vmax}if(r.hasZ()){const t=e.queryInterval(p,0);n.zmin=t.vmin,n.zmax=t.vmax}return n.setCacheValue(g,e),n}function d(e,t){if(e.isEmpty())return null;const n=e.getDescription(),r=n.hasM(),s=n.hasZ(),o=[],i=new a.P;for(let t=0,n=e.getPointCount();t<n;t++){e.getPointByVal(t,i);const n=[i.getX(),i.getY()];s&&n.push(i.getZ()),r&&n.push(i.getM()),o.push(n)}const u=new c.A({hasM:r,hasZ:s,points:o,spatialReference:t});return u.setCacheValue(g,e),u}function k(e,t){if(e instanceof r.P)return new l.A({x:e.x,y:e.y,spatialReference:t});if(e.isEmpty())return null;const n=new l.A({x:e.getX(),y:e.getY(),spatialReference:t}),s=e.getDescription();return s.hasM()&&(n.m=e.getM()),s.hasZ()&&(n.z=e.getZ()),n.setCacheValue(g,e),n}function E(e,t){if(e.isEmpty())return null;const n=m.A.fromJSON({spatialReference:t,...(0,f.toGeometry)(e,null)});return n.setCacheValue(g,e),n}function _(e,t){if(e.isEmpty())return null;const n=h.A.fromJSON({spatialReference:t,...(0,f.toGeometry)(e,null)});return n.setCacheValue(g,e),n}}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[2657,3169,6061,8125],{15546:(e,t,n)=>{n.d(t,{a:()=>s,c:()=>o});var r=n(55537),a=n(83661);function o(e,t){if(!e.isEmpty())switch(e.getGeometryType()){case r.G.enumPolygon:return u(e);case r.G.enumPolyline:return m(e.getImpl());case r.G.enumLine:case r.G.enumBezier:case r.G.enumEllipticArc:return function(e){const t=e.calculateLength2D();return 0===t?e.getStartXY():e.calculateWeightedCentroid2D().mul(1/t)}(e);case r.G.enumMultiPoint:return function(e){const t=new a.K(0),n=new a.K(0),r=e.getImpl(),o=r.getAttributeStreamRef(0),s=r.getPointCount(),u=new a.P;for(let e=0;e<s;e++)o.queryPoint2D(2*e,u),t.add(u.x),n.add(u.y);const c=new a.P;return c.setCoords(t.getResult(),n.getResult()),c.divThis(s)}(e);case r.G.enumEnvelope:return e.getCenterXY();case r.G.enumPoint:return e.getXY();default:return a.P.construct(Number.NaN,Number.NaN)}return a.P.construct(Number.NaN,Number.NaN)}function s(e,t){return u(e,t)}function u(e,t=-1){const n=new a.K(0),r=new a.K(0),o=e.getImpl();let s;const u=o.hasNonLinearSegments();let m;const g=o.getXY(0);if(-1===t){if(m=o.calculateArea2D(),0===m)return l(e);u&&(s=o.querySegmentIterator());for(let e=0,t=o.getPathCount();e<t;e++)c(g,o,e,n,r),u&&i(g,s,n,r)}else{if(m=o.calculateRingArea2D(t),0===m)return l(e,t);u&&(s=o.querySegmentIterator(),s.resetToPath(t)),c(g,o,t,n,r),u&&i(g,s,n,r)}const h=new a.P,f=new a.P;return h.setCoords(n.getResult(),r.getResult()),f.assign(h.mul(1/m).add(g)),f}function c(e,t,n,r,o){const s=t.getPathStart(n),u=t.getPathEnd(n);if(u-s<3)return;const c=t.getAttributeStreamRef(0),i=c.readPoint2D(2*s),l=c.readPoint2D(2*(s+1));l.subThis(i);const m=new a.K(0),g=t.hasNonLinearSegments(),h=1/3,f=new a.P;for(let e=s+2;e<u;e++){c.queryPoint2D(2*e,f),f.subThis(i);const t=.5*f.crossProduct(l);g&&m.add(t);const n=h*t;r.add((l.x+f.x)*n),o.add((l.y+f.y)*n),l.setCoordsPoint2D(f)}const d=g?m.getResult():t.calculateRingArea2D(n),y=i.sub(e).mul(d);r.add(y.x),o.add(y.y)}function i(e,t,n,a){let o;for(t.nextPath()||(0,r.c)("centroid");null!==(o=t.nextCurve());){const t=o.calculateWeightedAreaCentroid2D(e);n.add(t.x),a.add(t.y)}}function l(e,t=-1){return m(e.getImpl(),t)}function m(e,t=-1){const n=-1===t?e.calculateLength2D():e.calculatePathLength2D(t);if(0===n)return function(e,t=-1){if(-1!==t)return e.getXY(e.getPathStart(t));const n=new a.K(0),r=new a.K(0);for(let t=0;t<e.getPathCount();++t){const a=e.getXY(e.getPathStart(t));n.add(a.x),r.add(a.y)}return a.P.construct(n.getResult(),r.getResult()).mul(1/e.getPathCount())}(e,t);const r=new a.K(0),o=new a.K(0),s=e.querySegmentIterator();for(-1!==t&&s.resetToPath(t);s.nextPath();){const n=s.getPathIndex(),a=e.getXY(e.getPathStart(n));for(;s.hasNextSegment();){const e=s.nextSegment(),t=e.calculateLength2D();if(0===t)continue;const n=e.calculateWeightedCentroid2D().sub(a.mul(t));r.add(n.x),o.add(n.y)}const u=a.mul(e.calculatePathLength2D(n));if(r.add(u.x),o.add(u.y),-1!==t)break}const u=new a.P;return u.setCoords(r.getResult(),o.getResult()),u.mul(1/n)}},17077:(e,t,n)=>{n.r(t),n.d(t,{execute:()=>r.e,supportsCurves:()=>r.s});var r=n(48265);n(78125)},48265:(e,t,n)=>{n.d(t,{c:()=>c,e:()=>s,s:()=>u});var r=n(15546),a=n(78125);const o=new class{getOperatorType(){return 10205}accelerateGeometry(e,t,n){return!1}canAccelerateGeometry(e){return!1}supportsCurves(){return!0}execute(e,t){return(0,r.c)(e)}};function s(e){const t=o.execute((0,a.fromGeometry)(e),null);return(0,a.toPoint)(t,(0,a.getSpatialReference)(e))}const u=o.supportsCurves(),c=Object.freeze(Object.defineProperty({__proto__:null,execute:s,supportsCurves:u},Symbol.toStringTag,{value:"Module"}))},76061:(e,t,n)=>{n.d(t,{G:()=>r,S:()=>a});class r{*[Symbol.iterator](){let e=this.next();for(;e;)yield e,e=this.next()}}class a extends r{constructor(e){super(),this.m_iGeom=-1,this.m_aGeoms=e?e.slice():[]}next(){if(this.m_iGeom<this.m_aGeoms.length-1){const e=this.m_aGeoms[++this.m_iGeom];return this.m_aGeoms[this.m_iGeom]=null,e}return null}tock(){return!1}getGeometryID(){return this.m_iGeom}getRank(){return 1}}},78125:(e,t,n)=>{n.r(t),n.d(t,{fromExtent:()=>x,fromGeometry:()=>P,fromMultipoint:()=>C,fromPoint:()=>G,fromPolygon:()=>w,fromPolyline:()=>R,fromSpatialReference:()=>v,getSpatialReference:()=>p,toExtent:()=>S,toGeometry:()=>M,toMultipoint:()=>V,toPoint:()=>D,toPolygon:()=>N,toPolyline:()=>b});var r=n(83661),a=(n(79187),n(55537)),o=n(95213),s=n(35368),u=n(12189),c=n(5443),i=n(48526),l=n(86738),m=n(39829),g=n(82799),h=(n(90293),n(83299));const f="_gxVersion",d=2,y=1;function p(e){return Array.isArray(e)?e[0].spatialReference:e.spatialReference}function P(e){switch(e.type){case"point":return G(e);case"multipoint":return C(e);case"polyline":return R(e);case"polygon":return w(e);case"extent":return x(e);default:throw new Error(`Unsupported geometry type: ${e.type}`)}}function x(e){if(!e.getCacheValue(f)){const t=new o.E;t.setCoords(e.xmin,e.ymin,e.xmax,e.ymax),e.hasM&&t.setInterval(d,0,e.mmin,e.mmax),e.hasZ&&t.setInterval(y,0,e.zmin,e.zmax),e.setCacheValue(f,t)}return e.getCacheValue(f)}function C(e){if(!e.getCacheValue(f)){const t=new s.M,n=new o.P,r=e.points,a=e.hasM,u=e.hasZ,c=u?3:2;for(let e=0,o=r.length;e<o;e++){const o=r[e];n.setXYCoords(o[0],o[1]),u&&n.setZ(o[2]??0),a&&n.setM(o[c]??NaN),t.add(n)}e.setCacheValue(f,t)}return e.getCacheValue(f)}function G(e){if(!e.getCacheValue(f)){const t=new o.P;t.setXYCoords(e.x,e.y),e.hasM&&t.setM(e.m),e.hasZ&&t.setZ(e.z),e.setCacheValue(f,t)}return e.getCacheValue(f)}function w(e){if(!e.getCacheValue(f)){const{curveRings:t,hasM:n,hasZ:r,rings:a}=e,o=(0,h.fromGeometryToGXGeometry)({curveRings:t,hasM:n,hasZ:r,rings:a});e.setCacheValue(f,o)}return e.getCacheValue(f)}function R(e){if(!e.getCacheValue(f)){const{curvePaths:t,hasM:n,hasZ:r,paths:a}=e,o=(0,h.fromGeometryToGXGeometry)({curvePaths:t,hasM:n,hasZ:r,paths:a});e.setCacheValue(f,o)}return e.getCacheValue(f)}function v(e){if(e.wkid)return(0,u.c)(e.wkid);const t=e.wkt2||e.wkt;return t?(0,u.a)(t):null}function M(e,t){if(e)switch(e.getGeometryType()){case a.G.enumPoint:return D(e,t);case a.G.enumEnvelope:return S(e,t);case a.G.enumMultiPoint:return V(e,t);case a.G.enumPolyline:return b(e,t);case a.G.enumPolygon:return N(e,t)}return null}function S(e,t){if(e.isEmpty())return null;const n=new c.A({xmin:e.getXMin(),ymin:e.getYMin(),xmax:e.getXMax(),ymax:e.getYMax(),spatialReference:t}),r=e.getDescription();if(r.hasM()){const t=e.queryInterval(d,0);n.mmin=t.vmin,n.mmax=t.vmax}if(r.hasZ()){const t=e.queryInterval(y,0);n.zmin=t.vmin,n.zmax=t.vmax}return n.setCacheValue(f,e),n}function V(e,t){if(e.isEmpty())return null;const n=e.getDescription(),r=n.hasM(),a=n.hasZ(),s=[],u=new o.P;for(let t=0,n=e.getPointCount();t<n;t++){e.getPointByVal(t,u);const n=[u.getX(),u.getY()];a&&n.push(u.getZ()),r&&n.push(u.getM()),s.push(n)}const c=new i.A({hasM:r,hasZ:a,points:s,spatialReference:t});return c.setCacheValue(f,e),c}function D(e,t){if(e instanceof r.P)return new l.A({x:e.x,y:e.y,spatialReference:t});if(e.isEmpty())return null;const n=new l.A({x:e.getX(),y:e.getY(),spatialReference:t}),a=e.getDescription();return a.hasM()&&(n.m=e.getM()),a.hasZ()&&(n.z=e.getZ()),n.setCacheValue(f,e),n}function N(e,t){if(e.isEmpty())return null;const n=m.A.fromJSON({spatialReference:t,...(0,h.toGeometry)(e,null)});return n.setCacheValue(f,e),n}function b(e,t){if(e.isEmpty())return null;const n=g.A.fromJSON({spatialReference:t,...(0,h.toGeometry)(e,null)});return n.setCacheValue(f,e),n}}}]);
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[2657,3169,6061,8125],{15546:(e,t,n)=>{n.d(t,{a:()=>s,c:()=>o});var r=n(55537),a=n(83661);function o(e,t){if(!e.isEmpty())switch(e.getGeometryType()){case r.G.enumPolygon:return u(e);case r.G.enumPolyline:return m(e.getImpl());case r.G.enumLine:case r.G.enumBezier:case r.G.enumEllipticArc:return function(e){const t=e.calculateLength2D();return 0===t?e.getStartXY():e.calculateWeightedCentroid2D().mul(1/t)}(e);case r.G.enumMultiPoint:return function(e){const t=new a.K(0),n=new a.K(0),r=e.getImpl(),o=r.getAttributeStreamRef(0),s=r.getPointCount(),u=new a.P;for(let e=0;e<s;e++)o.queryPoint2D(2*e,u),t.add(u.x),n.add(u.y);const c=new a.P;return c.setCoords(t.getResult(),n.getResult()),c.divThis(s)}(e);case r.G.enumEnvelope:return e.getCenterXY();case r.G.enumPoint:return e.getXY();default:return a.P.construct(Number.NaN,Number.NaN)}return a.P.construct(Number.NaN,Number.NaN)}function s(e,t){return u(e,t)}function u(e,t=-1){const n=new a.K(0),r=new a.K(0),o=e.getImpl();let s;const u=o.hasNonLinearSegments();let m;const g=o.getXY(0);if(-1===t){if(m=o.calculateArea2D(),0===m)return l(e);u&&(s=o.querySegmentIterator());for(let e=0,t=o.getPathCount();e<t;e++)c(g,o,e,n,r),u&&i(g,s,n,r)}else{if(m=o.calculateRingArea2D(t),0===m)return l(e,t);u&&(s=o.querySegmentIterator(),s.resetToPath(t)),c(g,o,t,n,r),u&&i(g,s,n,r)}const h=new a.P,f=new a.P;return h.setCoords(n.getResult(),r.getResult()),f.assign(h.mul(1/m).add(g)),f}function c(e,t,n,r,o){const s=t.getPathStart(n),u=t.getPathEnd(n);if(u-s<3)return;const c=t.getAttributeStreamRef(0),i=c.readPoint2D(2*s),l=c.readPoint2D(2*(s+1));l.subThis(i);const m=new a.K(0),g=t.hasNonLinearSegments(),h=1/3,f=new a.P;for(let e=s+2;e<u;e++){c.queryPoint2D(2*e,f),f.subThis(i);const t=.5*f.crossProduct(l);g&&m.add(t);const n=h*t;r.add((l.x+f.x)*n),o.add((l.y+f.y)*n),l.setCoordsPoint2D(f)}const d=g?m.getResult():t.calculateRingArea2D(n),y=i.sub(e).mul(d);r.add(y.x),o.add(y.y)}function i(e,t,n,a){let o;for(t.nextPath()||(0,r.c)("centroid");null!==(o=t.nextCurve());){const t=o.calculateWeightedAreaCentroid2D(e);n.add(t.x),a.add(t.y)}}function l(e,t=-1){return m(e.getImpl(),t)}function m(e,t=-1){const n=-1===t?e.calculateLength2D():e.calculatePathLength2D(t);if(0===n)return function(e,t=-1){if(-1!==t)return e.getXY(e.getPathStart(t));const n=new a.K(0),r=new a.K(0);for(let t=0;t<e.getPathCount();++t){const a=e.getXY(e.getPathStart(t));n.add(a.x),r.add(a.y)}return a.P.construct(n.getResult(),r.getResult()).mul(1/e.getPathCount())}(e,t);const r=new a.K(0),o=new a.K(0),s=e.querySegmentIterator();for(-1!==t&&s.resetToPath(t);s.nextPath();){const n=s.getPathIndex(),a=e.getXY(e.getPathStart(n));for(;s.hasNextSegment();){const e=s.nextSegment(),t=e.calculateLength2D();if(0===t)continue;const n=e.calculateWeightedCentroid2D().sub(a.mul(t));r.add(n.x),o.add(n.y)}const u=a.mul(e.calculatePathLength2D(n));if(r.add(u.x),o.add(u.y),-1!==t)break}const u=new a.P;return u.setCoords(r.getResult(),o.getResult()),u.mul(1/n)}},17077:(e,t,n)=>{n.r(t),n.d(t,{execute:()=>r.e,supportsCurves:()=>r.s});var r=n(48265);n(78125)},48265:(e,t,n)=>{n.d(t,{c:()=>c,e:()=>s,s:()=>u});var r=n(15546),a=n(78125);const o=new class{getOperatorType(){return 10205}accelerateGeometry(e,t,n){return!1}canAccelerateGeometry(e){return!1}supportsCurves(){return!0}execute(e,t){return(0,r.c)(e)}};function s(e){const t=o.execute((0,a.fromGeometry)(e),null);return(0,a.toPoint)(t,(0,a.getSpatialReference)(e))}const u=o.supportsCurves(),c=Object.freeze(Object.defineProperty({__proto__:null,execute:s,supportsCurves:u},Symbol.toStringTag,{value:"Module"}))},76061:(e,t,n)=>{n.d(t,{G:()=>r,S:()=>a});class r{*[Symbol.iterator](){let e=this.next();for(;e;)yield e,e=this.next()}}class a extends r{constructor(e){super(),this.m_iGeom=-1,this.m_aGeoms=e?e.slice():[]}next(){if(this.m_iGeom<this.m_aGeoms.length-1){const e=this.m_aGeoms[++this.m_iGeom];return this.m_aGeoms[this.m_iGeom]=null,e}return null}tock(){return!1}getGeometryID(){return this.m_iGeom}getRank(){return 1}}},78125:(e,t,n)=>{n.r(t),n.d(t,{fromExtent:()=>x,fromGeometry:()=>P,fromMultipoint:()=>C,fromPoint:()=>G,fromPolygon:()=>w,fromPolyline:()=>R,fromSpatialReference:()=>v,getSpatialReference:()=>p,toExtent:()=>S,toGeometry:()=>M,toMultipoint:()=>V,toPoint:()=>D,toPolygon:()=>N,toPolyline:()=>b});var r=n(83661),a=(n(79187),n(55537)),o=n(95213),s=n(35368),u=n(12189),c=n(5443),i=n(48526),l=n(86738),m=n(39829),g=n(82799),h=(n(90293),n(83299));const f="_gxVersion",d=2,y=1;function p(e){return Array.isArray(e)?e[0].spatialReference:e.spatialReference}function P(e){switch(e.type){case"point":return G(e);case"multipoint":return C(e);case"polyline":return R(e);case"polygon":return w(e);case"extent":return x(e);default:throw new Error(`Unsupported geometry type: ${e.type}`)}}function x(e){if(!e.getCacheValue(f)){const t=new o.E;t.setCoords(e.xmin,e.ymin,e.xmax,e.ymax),e.hasM&&t.setInterval(d,0,e.mmin,e.mmax),e.hasZ&&t.setInterval(y,0,e.zmin,e.zmax),e.setCacheValue(f,t)}return e.getCacheValue(f)}function C(e){if(!e.getCacheValue(f)){const t=new s.M,n=new o.P,r=e.points,a=e.hasM,u=e.hasZ,c=u?3:2;for(let e=0,o=r.length;e<o;e++){const o=r[e];n.setXYCoords(o[0],o[1]),u&&n.setZ(o[2]??0),a&&n.setM(o[c]??NaN),t.add(n)}e.setCacheValue(f,t)}return e.getCacheValue(f)}function G(e){if(!e.getCacheValue(f)){const t=new o.P;t.setXYCoords(e.x,e.y),e.hasM&&t.setM(e.m),e.hasZ&&t.setZ(e.z),e.setCacheValue(f,t)}return e.getCacheValue(f)}function w(e){if(!e.getCacheValue(f)){const{curveRings:t,hasM:n,hasZ:r,rings:a}=e,o=(0,h.fromGeometryToGXGeometry)({curveRings:t,hasM:n,hasZ:r,rings:a});e.setCacheValue(f,o)}return e.getCacheValue(f)}function R(e){if(!e.getCacheValue(f)){const{curvePaths:t,hasM:n,hasZ:r,paths:a}=e,o=(0,h.fromGeometryToGXGeometry)({curvePaths:t,hasM:n,hasZ:r,paths:a});e.setCacheValue(f,o)}return e.getCacheValue(f)}function v(e){if(e.wkid)return(0,u.c)(e.wkid);const t=e.wkt2||e.wkt;return t?(0,u.b)(t):null}function M(e,t){if(e)switch(e.getGeometryType()){case a.G.enumPoint:return D(e,t);case a.G.enumEnvelope:return S(e,t);case a.G.enumMultiPoint:return V(e,t);case a.G.enumPolyline:return b(e,t);case a.G.enumPolygon:return N(e,t)}return null}function S(e,t){if(e.isEmpty())return null;const n=new c.A({xmin:e.getXMin(),ymin:e.getYMin(),xmax:e.getXMax(),ymax:e.getYMax(),spatialReference:t}),r=e.getDescription();if(r.hasM()){const t=e.queryInterval(d,0);n.mmin=t.vmin,n.mmax=t.vmax}if(r.hasZ()){const t=e.queryInterval(y,0);n.zmin=t.vmin,n.zmax=t.vmax}return n.setCacheValue(f,e),n}function V(e,t){if(e.isEmpty())return null;const n=e.getDescription(),r=n.hasM(),a=n.hasZ(),s=[],u=new o.P;for(let t=0,n=e.getPointCount();t<n;t++){e.getPointByVal(t,u);const n=[u.getX(),u.getY()];a&&n.push(u.getZ()),r&&n.push(u.getM()),s.push(n)}const c=new i.A({hasM:r,hasZ:a,points:s,spatialReference:t});return c.setCacheValue(f,e),c}function D(e,t){if(e instanceof r.P)return new l.A({x:e.x,y:e.y,spatialReference:t});if(e.isEmpty())return null;const n=new l.A({x:e.getX(),y:e.getY(),spatialReference:t}),a=e.getDescription();return a.hasM()&&(n.m=e.getM()),a.hasZ()&&(n.z=e.getZ()),n.setCacheValue(f,e),n}function N(e,t){if(e.isEmpty())return null;const n=m.A.fromJSON({spatialReference:t,...(0,h.toGeometry)(e,null)});return n.setCacheValue(f,e),n}function b(e,t){if(e.isEmpty())return null;const n=g.A.fromJSON({spatialReference:t,...(0,h.toGeometry)(e,null)});return n.setCacheValue(f,e),n}}}]);
@@ -40,7 +40,7 @@ outputHighlight(isHighlightOccluded());
40
40
  uint levelBits = readLevelBits(highlightToAdd, highlightLevel);
41
41
  if ((levelBits & 1u) == 0u) { discard; }
42
42
  outputHighlight(isHighlightOccluded());
43
- }`)):r.code.add(i.H`void calculateOcclusionAndOutputHighlight() {}`)}},10764:(e,t,r)=>{r.d(t,{I:()=>o});var i=r(31821),n=r(46540);function o(e){e.attributes.add(n.r.POSITION,"vec3"),e.vertex.code.add(i.H`vec3 positionModel() { return position; }`)}},11725:(e,t,r)=>{r.d(t,{im:()=>u,m$:()=>i});var i,n,o=r(51850),a=r(69720),s=r(96672),c=r(39341),l=r(43616),d=r(65786);class u extends a.J{constructor(e,t){super(),this.type=s.X.Material,this.supportsEdges=!1,this._renderPriority=0,this.vertexAttributeLocations=c.D,this._pp0=(0,o.fA)(0,0,1),this._pp1=(0,o.fA)(0,0,0),this._parameters=new t,(0,l.MB)(this._parameters,e),this.validateParameters(this._parameters)}get parameters(){return this._parameters}update(e){return!1}setParameters(e,t=!0){(0,l.MB)(this._parameters,e)&&(this.validateParameters(this._parameters),t&&this._parametersChanged())}validateParameters(e){}shouldRender(e){return this.visible&&this.isVisibleForOutput(e.output)&&(!this.parameters.isDecoration||e.bind.decorations)&&!!(this.parameters.renderOccluded&e.renderOccludedMask)}isVisibleForOutput(e){return!0}get renderPriority(){return this._renderPriority}set renderPriority(e){e!==this._renderPriority&&(this._renderPriority=e,this._parametersChanged())}_parametersChanged(){this.repository?.materialChanged(this)}queryRenderOccludedState(e){return this.visible&&this.parameters.renderOccluded===e}get hasEmissions(){return!1}intersectDraped(e,t,r,i,n,o){return this._pp0[0]=this._pp1[0]=i[0],this._pp0[1]=this._pp1[1]=i[1],this.intersect(e,t,r,this._pp0,this._pp1,n)}}(n=i||(i={}))[n.None=0]="None",n[n.Occlude=1]="Occlude",n[n.Transparent=2]="Transparent",n[n.OccludeAndTransparent=4]="OccludeAndTransparent",n[n.OccludeAndTransparentStencil=8]="OccludeAndTransparentStencil",n[n.Opaque=16]="Opaque",d.Y},11787:(e,t,r)=>{r.d(t,{$U:()=>re});var i=r(38954),n=r(51850),o=r(24151),a=r(1843),s=r(49255),c=r(96336),l=r(22911),d=r(62602),u=r(59469),h=r(16943),m=r(89192),f=r(25634),p=r(11725),v=r(33524),g=r(70328),_=r(96672),T=r(620),x=r(46540);class A{constructor(e=!1,t=!0){this.isVerticalRay=e,this.normalRequired=t}}const b=(0,g.vt)();function E(e,t,r,n,o,a){if(!e.visible)return;const s=(0,i.a)(F,n,r),c=(e,t,r)=>{a(e,r,t,!1)},l=new A(!1,t.options.normalRequired);if(e.boundingInfo){(0,T.vA)(e.type===_.X.Mesh);const i=t.tolerance;M(e.boundingInfo,r,s,i,o,l,c)}else{const t=e.attributes.get(x.r.POSITION),n=t.indices;!function(e,t,r,n,o,a,s,c,l,d){const u=t,h=B,m=Math.abs(u[0]),f=Math.abs(u[1]),p=Math.abs(u[2]),v=m>=f?m>=p?0:2:f>=p?1:2,g=v,_=u[g]<0?2:1,T=(v+_)%3,x=(v+(3-_))%3,A=u[T]/u[g],b=u[x]/u[g],E=1/u[g],S=w,M=I,C=O,{normalRequired:R}=l;for(let t=r;t<n;++t){const r=3*t,n=s*o[r];(0,i.i)(h[0],a[n+0],a[n+1],a[n+2]);const l=s*o[r+1];(0,i.i)(h[1],a[l+0],a[l+1],a[l+2]);const u=s*o[r+2];(0,i.i)(h[2],a[u+0],a[u+1],a[u+2]),c&&((0,i.c)(h[0],c.applyToVertex(h[0][0],h[0][1],h[0][2],t)),(0,i.c)(h[1],c.applyToVertex(h[1][0],h[1][1],h[1][2],t)),(0,i.c)(h[2],c.applyToVertex(h[2][0],h[2][1],h[2][2],t))),(0,i.a)(S,h[0],e),(0,i.a)(M,h[1],e),(0,i.a)(C,h[2],e);const m=S[T]-A*S[g],f=S[x]-b*S[g],p=M[T]-A*M[g],v=M[x]-b*M[g],_=C[T]-A*C[g],w=C[x]-b*C[g],I=_*v-w*p,O=m*w-f*_,N=p*f-v*m;if((I<0||O<0||N<0)&&(I>0||O>0||N>0))continue;const P=I+O+N;if(0===P)continue;const L=I*(E*S[g])+O*(E*M[g])+N*(E*C[g]);if(L*Math.sign(P)<0)continue;const D=L/P;D>=0&&d(D,t,R?y(h):null)}}(r,s,0,n.length/3,n,t.data,t.stride,o,l,c)}}const S=(0,n.vt)();function M(e,t,r,n,o,a,s){if(null==e)return;const c=function(e,t){return(0,i.i)(t,1/e[0],1/e[1],1/e[2])}(r,S);if((0,g.Ne)(b,e.bbMin),(0,g.vI)(b,e.bbMax),null!=o&&o.applyToAabb(b),function(e,t,r,i){return function(e,t,r,i){const n=(e[0]-i-t[0])*r[0],o=(e[3]+i-t[0])*r[0];let a=Math.min(n,o),s=Math.max(n,o);const c=(e[1]-i-t[1])*r[1],l=(e[4]+i-t[1])*r[1];if(s=Math.min(s,Math.max(c,l)),s<0)return!1;if(a=Math.max(a,Math.min(c,l)),a>s)return!1;const d=(e[2]-i-t[2])*r[2],u=(e[5]+i-t[2])*r[2];return s=Math.min(s,Math.max(d,u)),!(s<0)&&(a=Math.max(a,Math.min(d,u)),!(a>s)&&a<1/0)}(e,t,r,i)}(b,t,c,n)){const{primitiveIndices:i,position:c}=e,l=i?i.length:c.indices.length/3;if(l>D){const i=e.getChildren();if(void 0!==i){for(const e of i)M(e,t,r,n,o,a,s);return}}!function(e,t,r,i,n,o,a,s,c,l,d){const u=e[0],h=e[1],m=e[2],f=t[0],p=t[1],v=t[2],{normalRequired:g}=l;for(let e=0;e<i;++e){const t=s[e],r=3*t,i=a*n[r];let l=o[i],_=o[i+1],T=o[i+2];const x=a*n[r+1];let A=o[x],b=o[x+1],E=o[x+2];const S=a*n[r+2];let M=o[S],R=o[S+1],w=o[S+2];null!=c&&([l,_,T]=c.applyToVertex(l,_,T,e),[A,b,E]=c.applyToVertex(A,b,E,e),[M,R,w]=c.applyToVertex(M,R,w,e));const I=A-l,O=b-_,y=E-T,P=M-l,L=R-_,D=w-T,F=p*D-L*v,B=v*P-D*f,U=f*L-P*p,G=I*F+O*B+y*U;if(Math.abs(G)<=H)continue;const z=u-l,V=h-_,W=m-T,j=z*F+V*B+W*U;if(G>0){if(j<0||j>G)continue}else if(j>0||j<G)continue;const k=V*y-O*W,Y=W*I-y*z,q=z*O-I*V,X=f*k+p*Y+v*q;if(G>0){if(X<0||j+X>G)continue}else if(X>0||j+X<G)continue;const $=(P*k+L*Y+D*q)/G;$>=0&&d($,t,g?N(I,O,y,P,L,D,C):null)}}(t,r,0,l,c.indices,c.data,c.stride,i,o,a,s)}}const C=(0,n.vt)();function R(e,t,r,i,n,o,a,s){const c=e[0],l=e[1],d=e[2],u=t[0],h=t[1],m=t[2];for(let e=r;e<i;++e){const t=3*e,r=t+1,i=t+2,f=o*t,p=n[f],v=n[f+1],g=n[f+2],_=o*r,T=o*i,x=n[_]-p,A=n[_+1]-v,b=n[_+2]-g,E=n[T]-p,S=n[T+1]-v,M=n[T+2]-g,R=h*M-S*m,w=m*E-M*u,I=u*S-E*h,O=x*R+A*w+b*I;if(Math.abs(O)<=H)continue;const y=c-p,P=l-v,L=d-g,D=y*R+P*w+L*I;if(O>0){if(D<0||D>O)continue}else if(D>0||D<O)continue;const F=P*b-A*L,B=L*x-b*y,U=y*A-x*P,G=u*F+h*B+m*U;if(O>0){if(G<0||D+G>O)continue}else if(G>0||D+G<O)continue;const z=(E*F+S*B+M*U)/O;z>=0&&s(z,e,a?N(x,A,b,E,S,M,C):null)}}const w=(0,n.vt)(),I=(0,n.vt)(),O=(0,n.vt)();function N(e,t,r,n,o,a,s){return(0,i.i)(P,e,t,r),(0,i.i)(L,n,o,a),(0,i.e)(s,P,L),(0,i.n)(s,s),s}function y(e){return(0,i.a)(P,e[1],e[0]),(0,i.a)(L,e[2],e[0]),(0,i.e)(C,P,L),(0,i.n)(C,C),C}const P=(0,n.vt)(),L=(0,n.vt)(),D=1e3,H=1e-7,F=(0,n.vt)(),B=[(0,n.vt)(),(0,n.vt)(),(0,n.vt)()];var U=r(13464),G=r(16396),z=r(13030),V=r(59907);class W{constructor(e){this.vertexBufferLayout=e}elementCount(e){return e.get(x.r.POSITION).indices.length}write(e,t,r,i,n,o){return(0,V.SA)(r,i,this.vertexBufferLayout,e,t,n,o)}intersect(e,t,r,n,o,a,s){const c=this.vertexBufferLayout.createView(e).getField(x.r.POSITION,z.xs);if(null==c)return;const l=(0,i.a)(j,a,o),d=c.count/3,u=n.options.normalRequired;R(o,l,0,d,c.typedBuffer,c.typedBufferStride,u,((e,t,r)=>{s(e,r,t,!1)}))}}const j=(0,n.vt)();var k=r(43616),Y=r(97225),q=r(90237),X=r(53466),$=r(51976),Z=r(35256);class J extends Z.E{constructor(e){super(),this.spherical=e,this.alphaDiscardMode=m.sf.Opaque,this.doubleSidedMode=d.W.None,this.pbrMode=u.A9.Disabled,this.cullFace=m.s2.None,this.normalType=c.W.Attribute,this.customDepthTest=m.it.Less,this.emissionSource=l.ZX.None,this.hasVertexColors=!1,this.hasSymbolColors=!1,this.hasVerticalOffset=!1,this.hasColorTexture=!1,this.hasMetallicRoughnessTexture=!1,this.hasOcclusionTexture=!1,this.hasNormalTexture=!1,this.hasScreenSizePerspective=!1,this.hasVertexTangents=!1,this.hasOccludees=!1,this.hasModelTransformation=!1,this.offsetBackfaces=!1,this.vvSize=!1,this.vvColor=!1,this.receiveShadows=!1,this.receiveAmbientOcclusion=!1,this.textureAlphaPremultiplied=!1,this.instanced=!1,this.instancedColor=!1,this.writeDepth=!0,this.transparent=!1,this.enableOffset=!0,this.terrainDepthTest=!1,this.cullAboveTerrain=!1,this.snowCover=!1,this.hasColorTextureTransform=!1,this.hasEmissionTextureTransform=!1,this.hasNormalTextureTransform=!1,this.hasOcclusionTextureTransform=!1,this.hasMetallicRoughnessTextureTransform=!1,this.occlusionPass=!1,this.hasVvInstancing=!0,this.useCustomDTRExponentForWater=!1,this.useFillLights=!0}get textureCoordinateType(){return this.hasColorTexture||this.hasMetallicRoughnessTexture||this.emissionSource===l.ZX.Texture||this.hasOcclusionTexture||this.hasNormalTexture?X.I.Default:X.I.None}get objectAndLayerIdColorInstanced(){return this.instanced}get discardInvisibleFragments(){return this.transparent}}(0,q._)([(0,$.W)({count:m.sf.COUNT})],J.prototype,"alphaDiscardMode",void 0),(0,q._)([(0,$.W)({count:d.W.COUNT})],J.prototype,"doubleSidedMode",void 0),(0,q._)([(0,$.W)({count:u.A9.COUNT})],J.prototype,"pbrMode",void 0),(0,q._)([(0,$.W)({count:m.s2.COUNT})],J.prototype,"cullFace",void 0),(0,q._)([(0,$.W)({count:c.W.COUNT})],J.prototype,"normalType",void 0),(0,q._)([(0,$.W)({count:m.it.COUNT})],J.prototype,"customDepthTest",void 0),(0,q._)([(0,$.W)({count:l.ZX.COUNT})],J.prototype,"emissionSource",void 0),(0,q._)([(0,$.W)()],J.prototype,"hasVertexColors",void 0),(0,q._)([(0,$.W)()],J.prototype,"hasSymbolColors",void 0),(0,q._)([(0,$.W)()],J.prototype,"hasVerticalOffset",void 0),(0,q._)([(0,$.W)()],J.prototype,"hasColorTexture",void 0),(0,q._)([(0,$.W)()],J.prototype,"hasMetallicRoughnessTexture",void 0),(0,q._)([(0,$.W)()],J.prototype,"hasOcclusionTexture",void 0),(0,q._)([(0,$.W)()],J.prototype,"hasNormalTexture",void 0),(0,q._)([(0,$.W)()],J.prototype,"hasScreenSizePerspective",void 0),(0,q._)([(0,$.W)()],J.prototype,"hasVertexTangents",void 0),(0,q._)([(0,$.W)()],J.prototype,"hasOccludees",void 0),(0,q._)([(0,$.W)()],J.prototype,"hasModelTransformation",void 0),(0,q._)([(0,$.W)()],J.prototype,"offsetBackfaces",void 0),(0,q._)([(0,$.W)()],J.prototype,"vvSize",void 0),(0,q._)([(0,$.W)()],J.prototype,"vvColor",void 0),(0,q._)([(0,$.W)()],J.prototype,"receiveShadows",void 0),(0,q._)([(0,$.W)()],J.prototype,"receiveAmbientOcclusion",void 0),(0,q._)([(0,$.W)()],J.prototype,"textureAlphaPremultiplied",void 0),(0,q._)([(0,$.W)()],J.prototype,"instanced",void 0),(0,q._)([(0,$.W)()],J.prototype,"instancedColor",void 0),(0,q._)([(0,$.W)()],J.prototype,"writeDepth",void 0),(0,q._)([(0,$.W)()],J.prototype,"transparent",void 0),(0,q._)([(0,$.W)()],J.prototype,"enableOffset",void 0),(0,q._)([(0,$.W)()],J.prototype,"terrainDepthTest",void 0),(0,q._)([(0,$.W)()],J.prototype,"cullAboveTerrain",void 0),(0,q._)([(0,$.W)()],J.prototype,"snowCover",void 0),(0,q._)([(0,$.W)()],J.prototype,"hasColorTextureTransform",void 0),(0,q._)([(0,$.W)()],J.prototype,"hasEmissionTextureTransform",void 0),(0,q._)([(0,$.W)()],J.prototype,"hasNormalTextureTransform",void 0),(0,q._)([(0,$.W)()],J.prototype,"hasOcclusionTextureTransform",void 0),(0,q._)([(0,$.W)()],J.prototype,"hasMetallicRoughnessTextureTransform",void 0);var K=r(97220),Q=r(57323);class ee extends Y.R5{constructor(e,t){super(e,t,new K.$(Q.R,(()=>r.e(9933).then(r.bind(r,39933))))),this.type="RealisticTreeTechnique"}}var te=r(49788);class re extends p.im{constructor(e,t){super(e,ne),this.materialType="default",this.supportsEdges=!0,this.produces=new Map([[U.N.OPAQUE_MATERIAL,e=>((0,s.iq)(e)||(0,s.PJ)(e))&&!this.parameters.transparent],[U.N.TRANSPARENT_MATERIAL,e=>((0,s.iq)(e)||(0,s.PJ)(e))&&this.parameters.transparent&&this.parameters.writeDepth],[U.N.TRANSPARENT_MATERIAL_WITHOUT_DEPTH,e=>((0,s.XY)(e)||(0,s.PJ)(e))&&this.parameters.transparent&&!this.parameters.writeDepth]]),this._vertexBufferLayout=function(e){const t=(0,a.BP)().vec3f(x.r.POSITION);return e.normalType===c.W.Compressed?t.vec2i16(x.r.NORMALCOMPRESSED,{glNormalized:!0}):t.vec3f(x.r.NORMAL),e.hasVertexTangents&&t.vec4f(x.r.TANGENT),(e.textureId||e.normalTextureId||e.metallicRoughnessTextureId||e.emissiveTextureId||e.occlusionTextureId)&&t.vec2f(x.r.UV0),e.hasVertexColors&&t.vec4u8(x.r.COLOR),e.hasSymbolColors&&t.vec4u8(x.r.SYMBOLCOLOR),(0,h.E)()&&t.vec4u8(x.r.OBJECTANDLAYERIDCOLOR),t}(this.parameters),this._configuration=new J(t.spherical)}isVisibleForOutput(e){return e!==s.V.Shadow&&e!==s.V.ShadowExcludeHighlight&&e!==s.V.ShadowHighlight||this.parameters.castShadows}get visible(){const e=this.parameters;if(e.layerOpacity<te.Q)return!1;const{hasInstancedColor:t,hasVertexColors:r,hasSymbolColors:i,vvColor:n}=e,o=t||n||i,a="replace"===e.colorMixMode,s=e.opacity>=te.Q;if(r&&o)return a||s;const c=e.externalColor&&e.externalColor[3]>=te.Q;return r?a?c:s:o?a||s:a?c:s}get hasEmissions(){return!!this.parameters.emissiveTextureId||!(0,i.p)(this.parameters.emissiveFactor,n.uY)}getConfiguration(e,t){const r=this.parameters,{treeRendering:i,doubleSided:n,doubleSidedType:o}=r;return this._configuration.output=e,this._configuration.hasNormalTexture=!i&&!!r.normalTextureId,this._configuration.hasColorTexture=!!r.textureId,this._configuration.hasVertexTangents=!i&&r.hasVertexTangents,this._configuration.instanced=r.isInstanced,this._configuration.instancedDoublePrecision=r.instancedDoublePrecision,this._configuration.vvSize=!!r.vvSize,this._configuration.hasVerticalOffset=null!=r.verticalOffset,this._configuration.hasScreenSizePerspective=null!=r.screenSizePerspective,this._configuration.hasSlicePlane=r.hasSlicePlane,this._configuration.alphaDiscardMode=r.textureAlphaMode,this._configuration.normalType=i?c.W.Attribute:r.normalType,this._configuration.transparent=r.transparent,this._configuration.writeDepth=r.writeDepth,null!=r.customDepthTest&&(this._configuration.customDepthTest=r.customDepthTest),this._configuration.hasOccludees=t.hasOccludees,this._configuration.cullFace=r.hasSlicePlane?m.s2.None:r.cullFace,this._configuration.cullAboveTerrain=t.cullAboveTerrain,this._configuration.hasModelTransformation=!i&&null!=r.modelTransformation,this._configuration.hasVertexColors=r.hasVertexColors,this._configuration.hasSymbolColors=r.hasSymbolColors,this._configuration.doubleSidedMode=i?d.W.WindingOrder:n&&"normal"===o?d.W.View:n&&"winding-order"===o?d.W.WindingOrder:d.W.None,this._configuration.instancedColor=r.hasInstancedColor,(0,s.RN)(e)?(this._configuration.terrainDepthTest=t.terrainDepthTest,this._configuration.receiveShadows=r.receiveShadows,this._configuration.receiveAmbientOcclusion=r.receiveAmbientOcclusion&&null!=t.ssao):(this._configuration.terrainDepthTest=!1,this._configuration.receiveShadows=this._configuration.receiveAmbientOcclusion=!1),this._configuration.vvColor=!!r.vvColor,this._configuration.textureAlphaPremultiplied=!!r.textureAlphaPremultiplied,this._configuration.pbrMode=r.usePBR?r.isSchematic?u.A9.Schematic:u.A9.Normal:u.A9.Disabled,this._configuration.hasMetallicRoughnessTexture=!i&&!!r.metallicRoughnessTextureId,this._configuration.emissionSource=i?l.ZX.None:null!=r.emissiveTextureId?l.ZX.Texture:r.usePBR?l.ZX.Value:l.ZX.None,this._configuration.hasOcclusionTexture=!i&&!!r.occlusionTextureId,this._configuration.offsetBackfaces=!(!r.transparent||!r.offsetTransparentBackfaces),this._configuration.oitPass=t.oitPass,this._configuration.enableOffset=t.camera.relativeElevation<v.xt,this._configuration.snowCover=function(e){return null!=e.weather&&e.weatherVisible&&"snowy"===e.weather.type&&"enabled"===e.weather.snowCover}(t),this._configuration.hasColorTextureTransform=!!r.colorTextureTransformMatrix,this._configuration.hasNormalTextureTransform=!!r.normalTextureTransformMatrix,this._configuration.hasEmissionTextureTransform=!!r.emissiveTextureTransformMatrix,this._configuration.hasOcclusionTextureTransform=!!r.occlusionTextureTransformMatrix,this._configuration.hasMetallicRoughnessTextureTransform=!!r.metallicRoughnessTextureTransformMatrix,this._configuration}intersect(e,t,r,n,a,s){if(null!=this.parameters.verticalOffset){const e=r.camera;(0,i.i)(de,t[12],t[13],t[14]);let s=null;switch(r.viewingMode){case o.RT.Global:s=(0,i.n)(ce,de);break;case o.RT.Local:s=(0,i.c)(ce,se)}let c=0;const l=(0,i.d)(ue,de,e.eye),d=(0,i.l)(l),u=(0,i.h)(l,l,1/d);let h=null;this.parameters.screenSizePerspective&&(h=(0,i.f)(s,u)),c+=(0,k.kE)(e,d,this.parameters.verticalOffset,h??0,this.parameters.screenSizePerspective),(0,i.h)(s,s,c),(0,i.q)(le,s,r.transform.inverseRotation),n=(0,i.d)(oe,n,le),a=(0,i.d)(ae,a,le)}E(e,r,n,a,(0,G.ou)(r.verticalOffset),s)}createGLMaterial(e){return new ie(e)}createBufferWriter(){return new W(this._vertexBufferLayout)}}class ie extends f.m8{constructor(e){super({...e,...e.material.parameters})}beginSlot(e){this._material.setParameters({receiveShadows:e.shadowMap.enabled});const t=this._material.parameters;this.updateTexture(t.textureId);const r=e.camera.viewInverseTransposeMatrix;return(0,i.i)(t.origin,r[3],r[7],r[11]),this._material.setParameters(this.textureBindParameters),this.getTechnique(t.treeRendering?ee:Y.R5,e)}}class ne extends Y.uD{constructor(){super(...arguments),this.treeRendering=!1,this.hasVertexTangents=!1}}const oe=(0,n.vt)(),ae=(0,n.vt)(),se=(0,n.fA)(0,0,1),ce=(0,n.vt)(),le=(0,n.vt)(),de=(0,n.vt)(),ue=(0,n.vt)()},11955:(e,t,r)=>{r.d(t,{S:()=>s}),r(69270),r(74333).n;var i=r(20304),n=r(31821),o=r(89192),a=r(49788);function s(e,t){!function(e,t,r){const i=e.fragment,s=t.alphaDiscardMode,c=s===o.sf.Blend;s!==o.sf.Mask&&s!==o.sf.MaskBlend||i.uniforms.add(r),i.code.add(n.H`
43
+ }`)):r.code.add(i.H`void calculateOcclusionAndOutputHighlight() {}`)}},10764:(e,t,r)=>{r.d(t,{I:()=>o});var i=r(31821),n=r(46540);function o(e){e.attributes.add(n.r.POSITION,"vec3"),e.vertex.code.add(i.H`vec3 positionModel() { return position; }`)}},11725:(e,t,r)=>{r.d(t,{im:()=>u,m$:()=>i});var i,n,o=r(51850),a=r(69720),s=r(96672),c=r(39341),l=r(43616),d=r(65786);class u extends a.J{constructor(e,t){super(),this.type=s.X.Material,this.supportsEdges=!1,this._renderPriority=0,this.vertexAttributeLocations=c.D,this._pp0=(0,o.fA)(0,0,1),this._pp1=(0,o.fA)(0,0,0),this._parameters=new t,(0,l.MB)(this._parameters,e),this.validateParameters(this._parameters)}get parameters(){return this._parameters}update(e){return!1}setParameters(e,t=!0){(0,l.MB)(this._parameters,e)&&(this.validateParameters(this._parameters),t&&this._parametersChanged())}validateParameters(e){}shouldRender(e){return this.visible&&this.isVisibleForOutput(e.output)&&(!this.parameters.isDecoration||e.bind.decorations)&&!!(this.parameters.renderOccluded&e.renderOccludedMask)}isVisibleForOutput(e){return!0}get renderPriority(){return this._renderPriority}set renderPriority(e){e!==this._renderPriority&&(this._renderPriority=e,this._parametersChanged())}_parametersChanged(){this.repository?.materialChanged(this)}queryRenderOccludedState(e){return this.visible&&this.parameters.renderOccluded===e}get hasEmissions(){return!1}intersectDraped(e,t,r,i,n,o){return this._pp0[0]=this._pp1[0]=i[0],this._pp0[1]=this._pp1[1]=i[1],this.intersect(e,t,r,this._pp0,this._pp1,n)}}(n=i||(i={}))[n.None=0]="None",n[n.Occlude=1]="Occlude",n[n.Transparent=2]="Transparent",n[n.OccludeAndTransparent=4]="OccludeAndTransparent",n[n.OccludeAndTransparentStencil=8]="OccludeAndTransparentStencil",n[n.Opaque=16]="Opaque",d.Y},11787:(e,t,r)=>{r.d(t,{$U:()=>re});var i=r(38954),n=r(51850),o=r(24151),a=r(1843),s=r(49255),c=r(96336),l=r(22911),d=r(62602),u=r(59469),h=r(16943),m=r(89192),f=r(25634),p=r(11725),v=r(33524),g=r(70328),_=r(96672),T=r(620),x=r(46540);class A{constructor(e=!1,t=!0){this.isVerticalRay=e,this.normalRequired=t}}const b=(0,g.vt)();function E(e,t,r,n,o,a){if(!e.visible)return;const s=(0,i.a)(F,n,r),c=(e,t,r)=>{a(e,r,t,!1)},l=new A(!1,t.options.normalRequired);if(e.boundingInfo){(0,T.vA)(e.type===_.X.Mesh);const i=t.tolerance;M(e.boundingInfo,r,s,i,o,l,c)}else{const t=e.attributes.get(x.r.POSITION),n=t.indices;!function(e,t,r,n,o,a,s,c,l,d){const u=t,h=B,m=Math.abs(u[0]),f=Math.abs(u[1]),p=Math.abs(u[2]),v=m>=f?m>=p?0:2:f>=p?1:2,g=v,_=u[g]<0?2:1,T=(v+_)%3,x=(v+(3-_))%3,A=u[T]/u[g],b=u[x]/u[g],E=1/u[g],S=w,M=I,C=O,{normalRequired:R}=l;for(let t=r;t<n;++t){const r=3*t,n=s*o[r];(0,i.i)(h[0],a[n+0],a[n+1],a[n+2]);const l=s*o[r+1];(0,i.i)(h[1],a[l+0],a[l+1],a[l+2]);const u=s*o[r+2];(0,i.i)(h[2],a[u+0],a[u+1],a[u+2]),c&&((0,i.c)(h[0],c.applyToVertex(h[0][0],h[0][1],h[0][2],t)),(0,i.c)(h[1],c.applyToVertex(h[1][0],h[1][1],h[1][2],t)),(0,i.c)(h[2],c.applyToVertex(h[2][0],h[2][1],h[2][2],t))),(0,i.a)(S,h[0],e),(0,i.a)(M,h[1],e),(0,i.a)(C,h[2],e);const m=S[T]-A*S[g],f=S[x]-b*S[g],p=M[T]-A*M[g],v=M[x]-b*M[g],_=C[T]-A*C[g],w=C[x]-b*C[g],I=_*v-w*p,O=m*w-f*_,N=p*f-v*m;if((I<0||O<0||N<0)&&(I>0||O>0||N>0))continue;const P=I+O+N;if(0===P)continue;const L=I*(E*S[g])+O*(E*M[g])+N*(E*C[g]);if(L*Math.sign(P)<0)continue;const D=L/P;D>=0&&d(D,t,R?y(h):null)}}(r,s,0,n.length/3,n,t.data,t.stride,o,l,c)}}const S=(0,n.vt)();function M(e,t,r,n,o,a,s){if(null==e)return;const c=function(e,t){return(0,i.i)(t,1/e[0],1/e[1],1/e[2])}(r,S);if((0,g.Ne)(b,e.bbMin),(0,g.vI)(b,e.bbMax),null!=o&&o.applyToAabb(b),function(e,t,r,i){return function(e,t,r,i){const n=(e[0]-i-t[0])*r[0],o=(e[3]+i-t[0])*r[0];let a=Math.min(n,o),s=Math.max(n,o);const c=(e[1]-i-t[1])*r[1],l=(e[4]+i-t[1])*r[1];if(s=Math.min(s,Math.max(c,l)),s<0)return!1;if(a=Math.max(a,Math.min(c,l)),a>s)return!1;const d=(e[2]-i-t[2])*r[2],u=(e[5]+i-t[2])*r[2];return s=Math.min(s,Math.max(d,u)),!(s<0)&&(a=Math.max(a,Math.min(d,u)),!(a>s)&&a<1/0)}(e,t,r,i)}(b,t,c,n)){const{primitiveIndices:i,position:c}=e,l=i?i.length:c.indices.length/3;if(l>D){const i=e.getChildren();if(void 0!==i){for(const e of i)M(e,t,r,n,o,a,s);return}}!function(e,t,r,i,n,o,a,s,c,l,d){const u=e[0],h=e[1],m=e[2],f=t[0],p=t[1],v=t[2],{normalRequired:g}=l;for(let e=0;e<i;++e){const t=s[e],r=3*t,i=a*n[r];let l=o[i],_=o[i+1],T=o[i+2];const x=a*n[r+1];let A=o[x],b=o[x+1],E=o[x+2];const S=a*n[r+2];let M=o[S],R=o[S+1],w=o[S+2];null!=c&&([l,_,T]=c.applyToVertex(l,_,T,e),[A,b,E]=c.applyToVertex(A,b,E,e),[M,R,w]=c.applyToVertex(M,R,w,e));const I=A-l,O=b-_,y=E-T,P=M-l,L=R-_,D=w-T,F=p*D-L*v,B=v*P-D*f,U=f*L-P*p,G=I*F+O*B+y*U;if(Math.abs(G)<=H)continue;const z=u-l,V=h-_,W=m-T,j=z*F+V*B+W*U;if(G>0){if(j<0||j>G)continue}else if(j>0||j<G)continue;const k=V*y-O*W,Y=W*I-y*z,q=z*O-I*V,X=f*k+p*Y+v*q;if(G>0){if(X<0||j+X>G)continue}else if(X>0||j+X<G)continue;const $=(P*k+L*Y+D*q)/G;$>=0&&d($,t,g?N(I,O,y,P,L,D,C):null)}}(t,r,0,l,c.indices,c.data,c.stride,i,o,a,s)}}const C=(0,n.vt)();function R(e,t,r,i,n,o,a,s){const c=e[0],l=e[1],d=e[2],u=t[0],h=t[1],m=t[2];for(let e=r;e<i;++e){const t=3*e,r=t+1,i=t+2,f=o*t,p=n[f],v=n[f+1],g=n[f+2],_=o*r,T=o*i,x=n[_]-p,A=n[_+1]-v,b=n[_+2]-g,E=n[T]-p,S=n[T+1]-v,M=n[T+2]-g,R=h*M-S*m,w=m*E-M*u,I=u*S-E*h,O=x*R+A*w+b*I;if(Math.abs(O)<=H)continue;const y=c-p,P=l-v,L=d-g,D=y*R+P*w+L*I;if(O>0){if(D<0||D>O)continue}else if(D>0||D<O)continue;const F=P*b-A*L,B=L*x-b*y,U=y*A-x*P,G=u*F+h*B+m*U;if(O>0){if(G<0||D+G>O)continue}else if(G>0||D+G<O)continue;const z=(E*F+S*B+M*U)/O;z>=0&&s(z,e,a?N(x,A,b,E,S,M,C):null)}}const w=(0,n.vt)(),I=(0,n.vt)(),O=(0,n.vt)();function N(e,t,r,n,o,a,s){return(0,i.i)(P,e,t,r),(0,i.i)(L,n,o,a),(0,i.e)(s,P,L),(0,i.n)(s,s),s}function y(e){return(0,i.a)(P,e[1],e[0]),(0,i.a)(L,e[2],e[0]),(0,i.e)(C,P,L),(0,i.n)(C,C),C}const P=(0,n.vt)(),L=(0,n.vt)(),D=1e3,H=1e-7,F=(0,n.vt)(),B=[(0,n.vt)(),(0,n.vt)(),(0,n.vt)()];var U=r(13464),G=r(16396),z=r(13030),V=r(59907);class W{constructor(e){this.vertexBufferLayout=e}elementCount(e){return e.get(x.r.POSITION).indices.length}write(e,t,r,i,n,o){return(0,V.SA)(r,i,this.vertexBufferLayout,e,t,n,o)}intersect(e,t,r,n,o,a,s){const c=this.vertexBufferLayout.createView(e).getField(x.r.POSITION,z.xs);if(null==c)return;const l=(0,i.a)(j,a,o),d=c.count/3,u=n.options.normalRequired;R(o,l,0,d,c.typedBuffer,c.typedBufferStride,u,((e,t,r)=>{s(e,r,t,!1)}))}}const j=(0,n.vt)();var k=r(43616),Y=r(97225),q=r(90237),X=r(53466),$=r(51976),Z=r(35256);class J extends Z.E{constructor(e){super(),this.spherical=e,this.alphaDiscardMode=m.sf.Opaque,this.doubleSidedMode=d.W.None,this.pbrMode=u.A9.Disabled,this.cullFace=m.s2.None,this.normalType=c.W.Attribute,this.customDepthTest=m.it.Less,this.emissionSource=l.ZX.None,this.hasVertexColors=!1,this.hasSymbolColors=!1,this.hasVerticalOffset=!1,this.hasColorTexture=!1,this.hasMetallicRoughnessTexture=!1,this.hasOcclusionTexture=!1,this.hasNormalTexture=!1,this.hasScreenSizePerspective=!1,this.hasVertexTangents=!1,this.hasOccludees=!1,this.hasModelTransformation=!1,this.offsetBackfaces=!1,this.vvSize=!1,this.vvColor=!1,this.receiveShadows=!1,this.receiveAmbientOcclusion=!1,this.textureAlphaPremultiplied=!1,this.instanced=!1,this.instancedColor=!1,this.writeDepth=!0,this.transparent=!1,this.enableOffset=!0,this.terrainDepthTest=!1,this.cullAboveTerrain=!1,this.snowCover=!1,this.hasColorTextureTransform=!1,this.hasEmissionTextureTransform=!1,this.hasNormalTextureTransform=!1,this.hasOcclusionTextureTransform=!1,this.hasMetallicRoughnessTextureTransform=!1,this.occlusionPass=!1,this.hasVvInstancing=!0,this.useCustomDTRExponentForWater=!1,this.useFillLights=!0}get textureCoordinateType(){return this.hasColorTexture||this.hasMetallicRoughnessTexture||this.emissionSource===l.ZX.Texture||this.hasOcclusionTexture||this.hasNormalTexture?X.I.Default:X.I.None}get objectAndLayerIdColorInstanced(){return this.instanced}get discardInvisibleFragments(){return this.transparent}}(0,q._)([(0,$.W)({count:m.sf.COUNT})],J.prototype,"alphaDiscardMode",void 0),(0,q._)([(0,$.W)({count:d.W.COUNT})],J.prototype,"doubleSidedMode",void 0),(0,q._)([(0,$.W)({count:u.A9.COUNT})],J.prototype,"pbrMode",void 0),(0,q._)([(0,$.W)({count:m.s2.COUNT})],J.prototype,"cullFace",void 0),(0,q._)([(0,$.W)({count:c.W.COUNT})],J.prototype,"normalType",void 0),(0,q._)([(0,$.W)({count:m.it.COUNT})],J.prototype,"customDepthTest",void 0),(0,q._)([(0,$.W)({count:l.ZX.COUNT})],J.prototype,"emissionSource",void 0),(0,q._)([(0,$.W)()],J.prototype,"hasVertexColors",void 0),(0,q._)([(0,$.W)()],J.prototype,"hasSymbolColors",void 0),(0,q._)([(0,$.W)()],J.prototype,"hasVerticalOffset",void 0),(0,q._)([(0,$.W)()],J.prototype,"hasColorTexture",void 0),(0,q._)([(0,$.W)()],J.prototype,"hasMetallicRoughnessTexture",void 0),(0,q._)([(0,$.W)()],J.prototype,"hasOcclusionTexture",void 0),(0,q._)([(0,$.W)()],J.prototype,"hasNormalTexture",void 0),(0,q._)([(0,$.W)()],J.prototype,"hasScreenSizePerspective",void 0),(0,q._)([(0,$.W)()],J.prototype,"hasVertexTangents",void 0),(0,q._)([(0,$.W)()],J.prototype,"hasOccludees",void 0),(0,q._)([(0,$.W)()],J.prototype,"hasModelTransformation",void 0),(0,q._)([(0,$.W)()],J.prototype,"offsetBackfaces",void 0),(0,q._)([(0,$.W)()],J.prototype,"vvSize",void 0),(0,q._)([(0,$.W)()],J.prototype,"vvColor",void 0),(0,q._)([(0,$.W)()],J.prototype,"receiveShadows",void 0),(0,q._)([(0,$.W)()],J.prototype,"receiveAmbientOcclusion",void 0),(0,q._)([(0,$.W)()],J.prototype,"textureAlphaPremultiplied",void 0),(0,q._)([(0,$.W)()],J.prototype,"instanced",void 0),(0,q._)([(0,$.W)()],J.prototype,"instancedColor",void 0),(0,q._)([(0,$.W)()],J.prototype,"writeDepth",void 0),(0,q._)([(0,$.W)()],J.prototype,"transparent",void 0),(0,q._)([(0,$.W)()],J.prototype,"enableOffset",void 0),(0,q._)([(0,$.W)()],J.prototype,"terrainDepthTest",void 0),(0,q._)([(0,$.W)()],J.prototype,"cullAboveTerrain",void 0),(0,q._)([(0,$.W)()],J.prototype,"snowCover",void 0),(0,q._)([(0,$.W)()],J.prototype,"hasColorTextureTransform",void 0),(0,q._)([(0,$.W)()],J.prototype,"hasEmissionTextureTransform",void 0),(0,q._)([(0,$.W)()],J.prototype,"hasNormalTextureTransform",void 0),(0,q._)([(0,$.W)()],J.prototype,"hasOcclusionTextureTransform",void 0),(0,q._)([(0,$.W)()],J.prototype,"hasMetallicRoughnessTextureTransform",void 0);var K=r(97220),Q=r(57323);class ee extends Y.R5{constructor(e,t){super(e,t,new K.$(Q.R,(()=>r.e(9933).then(r.bind(r,39933))))),this.type="RealisticTreeTechnique"}}var te=r(49788);class re extends p.im{constructor(e,t){super(e,ne),this.materialType="default",this.supportsEdges=!0,this.produces=new Map([[U.N.OPAQUE_MATERIAL,e=>((0,s.iq)(e)||(0,s.PJ)(e))&&!this.parameters.transparent],[U.N.TRANSPARENT_MATERIAL,e=>((0,s.iq)(e)||(0,s.PJ)(e))&&this.parameters.transparent&&this.parameters.writeDepth],[U.N.TRANSPARENT_MATERIAL_WITHOUT_DEPTH,e=>((0,s.XY)(e)||(0,s.PJ)(e))&&this.parameters.transparent&&!this.parameters.writeDepth]]),this._vertexBufferLayout=function(e){const t=(0,a.BP)().vec3f(x.r.POSITION);return e.normalType===c.W.Compressed?t.vec2i16(x.r.NORMALCOMPRESSED,{glNormalized:!0}):t.vec3f(x.r.NORMAL),e.hasVertexTangents&&t.vec4f(x.r.TANGENT),(e.textureId||e.normalTextureId||e.metallicRoughnessTextureId||e.emissiveTextureId||e.occlusionTextureId)&&t.vec2f(x.r.UV0),e.hasVertexColors&&t.vec4u8(x.r.COLOR),e.hasSymbolColors&&t.vec4u8(x.r.SYMBOLCOLOR),(0,h.E)()&&t.vec4u8(x.r.OBJECTANDLAYERIDCOLOR),t}(this.parameters),this._configuration=new J(t.spherical)}isVisibleForOutput(e){return e!==s.V.Shadow&&e!==s.V.ShadowExcludeHighlight&&e!==s.V.ShadowHighlight||this.parameters.castShadows}get visible(){const{layerOpacity:e,colorMixMode:t,opacity:r,externalColor:i}=this.parameters;return e*("replace"===t?1:r)*("ignore"===t?1:i[3])>=te.Q}get hasEmissions(){return!!this.parameters.emissiveTextureId||!(0,i.p)(this.parameters.emissiveFactor,n.uY)}getConfiguration(e,t){const r=this.parameters,{treeRendering:i,doubleSided:n,doubleSidedType:o}=r;return this._configuration.output=e,this._configuration.hasNormalTexture=!i&&!!r.normalTextureId,this._configuration.hasColorTexture=!!r.textureId,this._configuration.hasVertexTangents=!i&&r.hasVertexTangents,this._configuration.instanced=r.isInstanced,this._configuration.instancedDoublePrecision=r.instancedDoublePrecision,this._configuration.vvSize=!!r.vvSize,this._configuration.hasVerticalOffset=null!=r.verticalOffset,this._configuration.hasScreenSizePerspective=null!=r.screenSizePerspective,this._configuration.hasSlicePlane=r.hasSlicePlane,this._configuration.alphaDiscardMode=r.textureAlphaMode,this._configuration.normalType=i?c.W.Attribute:r.normalType,this._configuration.transparent=r.transparent,this._configuration.writeDepth=r.writeDepth,null!=r.customDepthTest&&(this._configuration.customDepthTest=r.customDepthTest),this._configuration.hasOccludees=t.hasOccludees,this._configuration.cullFace=r.hasSlicePlane?m.s2.None:r.cullFace,this._configuration.cullAboveTerrain=t.cullAboveTerrain,this._configuration.hasModelTransformation=!i&&null!=r.modelTransformation,this._configuration.hasVertexColors=r.hasVertexColors,this._configuration.hasSymbolColors=r.hasSymbolColors,this._configuration.doubleSidedMode=i?d.W.WindingOrder:n&&"normal"===o?d.W.View:n&&"winding-order"===o?d.W.WindingOrder:d.W.None,this._configuration.instancedColor=r.hasInstancedColor,(0,s.RN)(e)?(this._configuration.terrainDepthTest=t.terrainDepthTest,this._configuration.receiveShadows=r.receiveShadows,this._configuration.receiveAmbientOcclusion=r.receiveAmbientOcclusion&&null!=t.ssao):(this._configuration.terrainDepthTest=!1,this._configuration.receiveShadows=this._configuration.receiveAmbientOcclusion=!1),this._configuration.vvColor=!!r.vvColor,this._configuration.textureAlphaPremultiplied=!!r.textureAlphaPremultiplied,this._configuration.pbrMode=r.usePBR?r.isSchematic?u.A9.Schematic:u.A9.Normal:u.A9.Disabled,this._configuration.hasMetallicRoughnessTexture=!i&&!!r.metallicRoughnessTextureId,this._configuration.emissionSource=i?l.ZX.None:null!=r.emissiveTextureId?l.ZX.Texture:r.usePBR?l.ZX.Value:l.ZX.None,this._configuration.hasOcclusionTexture=!i&&!!r.occlusionTextureId,this._configuration.offsetBackfaces=!(!r.transparent||!r.offsetTransparentBackfaces),this._configuration.oitPass=t.oitPass,this._configuration.enableOffset=t.camera.relativeElevation<v.xt,this._configuration.snowCover=function(e){return null!=e.weather&&e.weatherVisible&&"snowy"===e.weather.type&&"enabled"===e.weather.snowCover}(t),this._configuration.hasColorTextureTransform=!!r.colorTextureTransformMatrix,this._configuration.hasNormalTextureTransform=!!r.normalTextureTransformMatrix,this._configuration.hasEmissionTextureTransform=!!r.emissiveTextureTransformMatrix,this._configuration.hasOcclusionTextureTransform=!!r.occlusionTextureTransformMatrix,this._configuration.hasMetallicRoughnessTextureTransform=!!r.metallicRoughnessTextureTransformMatrix,this._configuration}intersect(e,t,r,n,a,s){if(null!=this.parameters.verticalOffset){const e=r.camera;(0,i.i)(de,t[12],t[13],t[14]);let s=null;switch(r.viewingMode){case o.RT.Global:s=(0,i.n)(ce,de);break;case o.RT.Local:s=(0,i.c)(ce,se)}let c=0;const l=(0,i.d)(ue,de,e.eye),d=(0,i.l)(l),u=(0,i.h)(l,l,1/d);let h=null;this.parameters.screenSizePerspective&&(h=(0,i.f)(s,u)),c+=(0,k.kE)(e,d,this.parameters.verticalOffset,h??0,this.parameters.screenSizePerspective),(0,i.h)(s,s,c),(0,i.q)(le,s,r.transform.inverseRotation),n=(0,i.d)(oe,n,le),a=(0,i.d)(ae,a,le)}E(e,r,n,a,(0,G.ou)(r.verticalOffset),s)}createGLMaterial(e){return new ie(e)}createBufferWriter(){return new W(this._vertexBufferLayout)}}class ie extends f.m8{constructor(e){super({...e,...e.material.parameters})}beginSlot(e){this._material.setParameters({receiveShadows:e.shadowMap.enabled});const t=this._material.parameters;this.updateTexture(t.textureId);const r=e.camera.viewInverseTransposeMatrix;return(0,i.i)(t.origin,r[3],r[7],r[11]),this._material.setParameters(this.textureBindParameters),this.getTechnique(t.treeRendering?ee:Y.R5,e)}}class ne extends Y.uD{constructor(){super(...arguments),this.treeRendering=!1,this.hasVertexTangents=!1}}const oe=(0,n.vt)(),ae=(0,n.vt)(),se=(0,n.fA)(0,0,1),ce=(0,n.vt)(),le=(0,n.vt)(),de=(0,n.vt)(),ue=(0,n.vt)()},11955:(e,t,r)=>{r.d(t,{S:()=>s}),r(69270),r(74333).n;var i=r(20304),n=r(31821),o=r(89192),a=r(49788);function s(e,t){!function(e,t,r){const i=e.fragment,s=t.alphaDiscardMode,c=s===o.sf.Blend;s!==o.sf.Mask&&s!==o.sf.MaskBlend||i.uniforms.add(r),i.code.add(n.H`
44
44
  void discardOrAdjustAlpha(inout vec4 color) {
45
45
  ${s===o.sf.Opaque?"color.a = 1.0;":`if (color.a < ${c?n.H.float(a.Q):"textureAlphaCutoff"}) {\n discard;\n } ${(0,n.If)(s===o.sf.Mask,"else { color.a = 1.0; }")}`}
46
46
  }
@@ -271,10 +271,10 @@ return filterShadow(uv, lvpos, size, shadowMap);
271
271
  // multiply or tint (or something invalid)
272
272
  return allMixed;
273
273
  }
274
- `)}},28449:(e,t,r)=>{function i(e,t,r){for(let i=0;i<r;++i)t[2*i]=e[i],t[2*i+1]=e[i]-t[2*i]}function n(e,t){const r=e.length;for(let i=0;i<r;++i)a[0]=e[i],t[i]=a[0];return t}function o(e,t){const r=e.length;for(let i=0;i<r;++i)a[0]=e[i],a[1]=e[i]-a[0],t[i]=a[1];return t}r.d(t,{Zo:()=>n,jA:()=>o,jS:()=>i});const a=new Float32Array(2)},28491:(e,t,r)=>{r.d(t,{D:()=>z,b:()=>G});var i=r(46686),n=r(32680),o=r(49255),a=r(76591),s=r(76597),c=r(82991),l=r(96336),d=r(10764),u=r(71955),h=r(53466),m=r(92700),f=r(72824),p=r(35640),v=r(40261),g=r(77695),_=r(54849),T=r(74081),x=r(98619),A=r(62602),b=r(22393),E=r(59469),S=r(25618),M=r(96598),C=r(51406),R=r(42398),w=r(11955),I=r(27950),O=r(20693),N=r(33079),y=r(71988),P=r(20304),L=r(31821),D=r(63761),H=r(46540),F=r(60517),B=r(14113),U=r(49788);function G(e){const t=new B.N5,{vertex:r,fragment:G,varyings:z}=t,{output:V,normalType:W,offsetBackfaces:j,instancedColor:k,spherical:Y,receiveShadows:q,snowCover:X,pbrMode:$,textureAlphaPremultiplied:Z,instancedDoublePrecision:J,hasVertexColors:K,hasVertexTangents:Q,hasColorTexture:ee,hasNormalTexture:te,hasNormalTextureTransform:re,hasColorTextureTransform:ie}=e;if((0,O.NB)(r,e),t.include(d.I),z.add("vpos","vec3",{invariant:!0}),t.include(R.A,e),t.include(c.B,e),t.include(p.G,e),t.include(C.q2,e),!(0,o.RN)(V))return t.include(v.E,e),t;t.include(C.Sx,e),t.include(C.MU,e),t.include(C.O1,e),t.include(C.QM,e),(0,O.yu)(r,e),t.include(l.Y,e),t.include(s.d,e);const ne=W===l.W.Attribute||W===l.W.Compressed;return ne&&j&&t.include(n.M),t.include(g.W,e),t.include(f.Mh,e),k&&t.attributes.add(H.r.INSTANCECOLOR,"vec4"),z.add("vPositionLocal","vec3"),t.include(h.U,e),t.include(i.oD,e),t.include(u.K,e),t.include(m.c,e),r.uniforms.add(new y.E("externalColor",(e=>e.externalColor))),z.add("vcolorExt","vec4"),t.include(M.Z,e),r.main.add(L.H`
274
+ `)}},28449:(e,t,r)=>{function i(e,t,r){for(let i=0;i<r;++i)t[2*i]=e[i],t[2*i+1]=e[i]-t[2*i]}function n(e,t){const r=e.length;for(let i=0;i<r;++i)a[0]=e[i],t[i]=a[0];return t}function o(e,t){const r=e.length;for(let i=0;i<r;++i)a[0]=e[i],a[1]=e[i]-a[0],t[i]=a[1];return t}r.d(t,{Zo:()=>n,jA:()=>o,jS:()=>i});const a=new Float32Array(2)},28491:(e,t,r)=>{r.d(t,{D:()=>V,b:()=>z});var i=r(91829),n=r(46686),o=r(32680),a=r(49255),s=r(76591),c=r(76597),l=r(82991),d=r(96336),u=r(10764),h=r(71955),m=r(53466),f=r(92700),p=r(72824),v=r(35640),g=r(40261),_=r(77695),T=r(54849),x=r(74081),A=r(98619),b=r(62602),E=r(22393),S=r(59469),M=r(25618),C=r(96598),R=r(51406),w=r(42398),I=r(11955),O=r(27950),N=r(20693),y=r(33079),P=r(71988),L=r(20304),D=r(31821),H=r(63761),F=r(46540),B=r(60517),U=r(14113),G=r(49788);function z(e){const t=new U.N5,{vertex:r,fragment:z,varyings:V}=t,{output:W,normalType:j,offsetBackfaces:k,instancedColor:Y,spherical:q,receiveShadows:X,snowCover:$,pbrMode:Z,textureAlphaPremultiplied:J,instancedDoublePrecision:K,hasVertexColors:Q,hasVertexTangents:ee,hasColorTexture:te,hasNormalTexture:re,hasNormalTextureTransform:ie,hasColorTextureTransform:ne}=e;if((0,N.NB)(r,e),t.include(u.I),V.add("vpos","vec3",{invariant:!0}),t.include(w.A,e),t.include(l.B,e),t.include(v.G,e),t.include(R.q2,e),!(0,a.RN)(W))return t.include(g.E,e),t;t.include(R.Sx,e),t.include(R.MU,e),t.include(R.O1,e),t.include(R.QM,e),(0,N.yu)(r,e),t.include(d.Y,e),t.include(c.d,e);const oe=j===d.W.Attribute||j===d.W.Compressed;return oe&&k&&t.include(o.M),t.include(_.W,e),t.include(p.Mh,e),Y&&t.attributes.add(F.r.INSTANCECOLOR,"vec4"),V.add("vPositionLocal","vec3"),t.include(m.U,e),t.include(n.oD,e),t.include(h.K,e),t.include(f.c,e),r.uniforms.add(new P.E("externalColor",(e=>"ignore"===e.colorMixMode?i.Un:e.externalColor))),V.add("vcolorExt","vec4"),t.include(C.Z,e),r.main.add(D.H`
275
275
  forwardNormalizedVertexColor();
276
276
  vcolorExt = externalColor;
277
- ${(0,L.If)(k,"vcolorExt *= instanceColor * 0.003921568627451;")}
277
+ ${(0,D.If)(Y,"vcolorExt *= instanceColor * 0.003921568627451;")}
278
278
  vcolorExt *= vvColor();
279
279
  vcolorExt *= getSymbolColor();
280
280
  forwardColorMixMode();
@@ -282,11 +282,11 @@ return filterShadow(uv, lvpos, size, shadowMap);
282
282
  vpos = getVertexInLocalOriginSpace();
283
283
  vPositionLocal = vpos - view[3].xyz;
284
284
  vpos = subtractOrigin(vpos);
285
- ${(0,L.If)(ne,"vNormalWorld = dpNormal(vvLocalNormal(normalModel()));")}
285
+ ${(0,D.If)(oe,"vNormalWorld = dpNormal(vvLocalNormal(normalModel()));")}
286
286
  vpos = addVerticalOffset(vpos, localOrigin);
287
- ${(0,L.If)(Q,"vTangent = dpTransformVertexTangent(tangent);")}
287
+ ${(0,D.If)(ee,"vTangent = dpTransformVertexTangent(tangent);")}
288
288
  gl_Position = transformPosition(proj, view, vpos);
289
- ${(0,L.If)(ne&&j,"gl_Position = offsetBackfacingClipPosition(gl_Position, vpos, vNormalWorld, cameraPosition);")}
289
+ ${(0,D.If)(oe&&k,"gl_Position = offsetBackfacingClipPosition(gl_Position, vpos, vNormalWorld, cameraPosition);")}
290
290
 
291
291
  forwardViewPosDepth((view * vec4(vpos, 1.0)).xyz);
292
292
  forwardLinearDepth();
@@ -297,18 +297,18 @@ return filterShadow(uv, lvpos, size, shadowMap);
297
297
  forwardOcclusionUV();
298
298
  forwardMetallicRoughnessUV();
299
299
 
300
- if (vcolorExt.a < ${L.H.float(U.Q)}) {
300
+ if (vcolorExt.a < ${D.H.float(G.Q)}) {
301
301
  gl_Position = vec4(1e38, 1e38, 1e38, 1.0);
302
302
  }
303
- `),t.include(T.kA,e),t.include(_.n,e),t.include(w.S,e),t.include(J?S.G:S.Bz,e),t.fragment.include(a.HQ,e),t.include(F.z,e),(0,O.yu)(G,e),G.uniforms.add(r.uniforms.get("localOrigin"),new N.t("ambient",(e=>e.ambient)),new N.t("diffuse",(e=>e.diffuse)),new P.m("opacity",(e=>e.opacity)),new P.m("layerOpacity",(e=>e.layerOpacity))),ee&&G.uniforms.add(new D.N("tex",(e=>e.texture))),t.include(E._Z,e),t.include(b.c,e),G.include(I.N),t.include(A.r,e),(0,T.a8)(G),(0,T.eU)(G),(0,x.O4)(G),G.main.add(L.H`
303
+ `),t.include(x.kA,e),t.include(T.n,e),t.include(I.S,e),t.include(K?M.G:M.Bz,e),t.fragment.include(s.HQ,e),t.include(B.z,e),(0,N.yu)(z,e),z.uniforms.add(r.uniforms.get("localOrigin"),new y.t("ambient",(e=>e.ambient)),new y.t("diffuse",(e=>e.diffuse)),new L.m("opacity",(e=>e.opacity)),new L.m("layerOpacity",(e=>e.layerOpacity))),te&&z.uniforms.add(new H.N("tex",(e=>e.texture))),t.include(S._Z,e),t.include(E.c,e),z.include(O.N),t.include(b.r,e),(0,x.a8)(z),(0,x.eU)(z),(0,A.O4)(z),z.main.add(D.H`
304
304
  discardBySlice(vpos);
305
305
  discardByTerrainDepth();
306
- ${ee?L.H`
307
- vec4 texColor = texture(tex, ${ie?"colorUV":"vuv0"});
308
- ${(0,L.If)(Z,"texColor.rgb /= texColor.a;")}
309
- discardOrAdjustAlpha(texColor);`:L.H`vec4 texColor = vec4(1.0);`}
306
+ ${te?D.H`
307
+ vec4 texColor = texture(tex, ${ne?"colorUV":"vuv0"});
308
+ ${(0,D.If)(J,"texColor.rgb /= texColor.a;")}
309
+ discardOrAdjustAlpha(texColor);`:D.H`vec4 texColor = vec4(1.0);`}
310
310
  shadingParams.viewDirection = normalize(vpos - cameraPosition);
311
- ${W===l.W.ScreenDerivative?L.H`vec3 normal = screenDerivativeNormal(vPositionLocal);`:L.H`shadingParams.normalView = vNormalWorld;
311
+ ${j===d.W.ScreenDerivative?D.H`vec3 normal = screenDerivativeNormal(vPositionLocal);`:D.H`shadingParams.normalView = vNormalWorld;
312
312
  vec3 normal = shadingNormal(shadingParams);`}
313
313
  applyPBRFactors();
314
314
  float ssao = evaluateAmbientOcclusionInverse() * getBakedOcclusion();
@@ -316,15 +316,15 @@ return filterShadow(uv, lvpos, size, shadowMap);
316
316
  vec3 posWorld = vpos + localOrigin;
317
317
 
318
318
  float additionalAmbientScale = additionalDirectedAmbientLight(posWorld);
319
- float shadow = ${q?"max(lightingGlobalFactor * (1.0 - additionalAmbientScale), readShadowMap(vpos, linearDepth))":(0,L.If)(Y,"lightingGlobalFactor * (1.0 - additionalAmbientScale)","0.0")};
319
+ float shadow = ${X?"max(lightingGlobalFactor * (1.0 - additionalAmbientScale), readShadowMap(vpos, linearDepth))":(0,D.If)(q,"lightingGlobalFactor * (1.0 - additionalAmbientScale)","0.0")};
320
320
 
321
321
  vec3 matColor = max(ambient, diffuse);
322
- vec3 albedo = mixExternalColor(${(0,L.If)(K,"vColor.rgb *")} matColor, texColor.rgb, vcolorExt.rgb, int(colorMixMode));
323
- float opacity_ = layerOpacity * mixExternalOpacity(${(0,L.If)(K,"vColor.a * ")} opacity, texColor.a, vcolorExt.a, int(colorMixMode));
324
- ${te?`mat3 tangentSpace = computeTangentSpace(${Q?"normal":"normal, vpos, vuv0"});\n vec3 shadingNormal = computeTextureNormal(tangentSpace, ${re?"normalUV":"vuv0"});`:"vec3 shadingNormal = normal;"}
325
- vec3 normalGround = ${Y?"normalize(posWorld);":"vec3(0.0, 0.0, 1.0);"}
322
+ vec3 albedo = mixExternalColor(${(0,D.If)(Q,"vColor.rgb *")} matColor, texColor.rgb, vcolorExt.rgb, int(colorMixMode));
323
+ float opacity_ = layerOpacity * mixExternalOpacity(${(0,D.If)(Q,"vColor.a * ")} opacity, texColor.a, vcolorExt.a, int(colorMixMode));
324
+ ${re?`mat3 tangentSpace = computeTangentSpace(${ee?"normal":"normal, vpos, vuv0"});\n vec3 shadingNormal = computeTextureNormal(tangentSpace, ${ie?"normalUV":"vuv0"});`:"vec3 shadingNormal = normal;"}
325
+ vec3 normalGround = ${q?"normalize(posWorld);":"vec3(0.0, 0.0, 1.0);"}
326
326
 
327
- ${(0,L.If)(X,L.H`
327
+ ${(0,D.If)($,D.H`
328
328
  float snow = smoothstep(0.5, 0.55, dot(normal, normalGround));
329
329
  albedo = mix(albedo, vec3(1), snow);
330
330
  shadingNormal = mix(shadingNormal, normal, snow);
@@ -332,14 +332,14 @@ return filterShadow(uv, lvpos, size, shadowMap);
332
332
 
333
333
  vec3 additionalLight = ssao * mainLightIntensity * additionalAmbientScale * ambientBoostFactor * lightingGlobalFactor;
334
334
 
335
- ${$===E.A9.Normal||$===E.A9.Schematic?L.H`
335
+ ${Z===S.A9.Normal||Z===S.A9.Schematic?D.H`
336
336
  float additionalAmbientIrradiance = additionalAmbientIrradianceFactor * mainLightIntensity[2];
337
- ${(0,L.If)(X,L.H`mrr = mix(mrr, vec3(0.0, 1.0, 0.04), snow);`)}
338
- vec4 emission = ${X?"mix(getEmissions(), vec4(0.0), snow)":"getEmissions()"};
339
- vec3 shadedColor = evaluateSceneLightingPBR(shadingNormal, albedo, shadow, 1.0 - ssao, additionalLight, shadingParams.viewDirection, normalGround, mrr, emission, additionalAmbientIrradiance);`:L.H`vec3 shadedColor = evaluateSceneLighting(shadingNormal, albedo, shadow, 1.0 - ssao, additionalLight);`}
337
+ ${(0,D.If)($,D.H`mrr = mix(mrr, vec3(0.0, 1.0, 0.04), snow);`)}
338
+ vec4 emission = ${$?"mix(getEmissions(), vec4(0.0), snow)":"getEmissions()"};
339
+ vec3 shadedColor = evaluateSceneLightingPBR(shadingNormal, albedo, shadow, 1.0 - ssao, additionalLight, shadingParams.viewDirection, normalGround, mrr, emission, additionalAmbientIrradiance);`:D.H`vec3 shadedColor = evaluateSceneLighting(shadingNormal, albedo, shadow, 1.0 - ssao, additionalLight);`}
340
340
  vec4 finalColor = vec4(shadedColor, opacity_);
341
341
  outputColorHighlightOID(finalColor, vpos);
342
- `),t}const z=Object.freeze(Object.defineProperty({__proto__:null,build:G},Symbol.toStringTag,{value:"Module"}))},29920:(e,t,r)=>{r.d(t,{j:()=>s});var i=r(3694),n=r(38954),o=r(51850),a=r(620);class s{constructor(e,t,r){this.primitiveIndices=e,this._numIndexPerPrimitive=t,this.position=r,this._children=void 0,(0,a.vA)(e.length>=1),(0,a.vA)(3===r.size||4===r.size);const{data:i,size:s,indices:l}=r;(0,a.vA)(l.length%this._numIndexPerPrimitive==0),(0,a.vA)(l.length>=e.length*this._numIndexPerPrimitive);const d=e.length;let u=s*l[this._numIndexPerPrimitive*e[0]];c.clear(),c.push(u);const h=(0,o.fA)(i[u],i[u+1],i[u+2]),m=(0,o.o8)(h);for(let t=0;t<d;++t){const r=this._numIndexPerPrimitive*e[t];for(let e=0;e<this._numIndexPerPrimitive;++e){u=s*l[r+e],c.push(u);let t=i[u];h[0]=Math.min(t,h[0]),m[0]=Math.max(t,m[0]),t=i[u+1],h[1]=Math.min(t,h[1]),m[1]=Math.max(t,m[1]),t=i[u+2],h[2]=Math.min(t,h[2]),m[2]=Math.max(t,m[2])}}this.bbMin=h,this.bbMax=m;const f=(0,n.m)((0,o.vt)(),this.bbMin,this.bbMax,.5);this.radius=.5*Math.max(Math.max(m[0]-h[0],m[1]-h[1]),m[2]-h[2]);let p=this.radius*this.radius;for(let e=0;e<c.length;++e){u=c.at(e);const t=i[u]-f[0],r=i[u+1]-f[1],n=i[u+2]-f[2],o=t*t+r*r+n*n;if(o<=p)continue;const a=Math.sqrt(o),s=.5*(a-this.radius);this.radius=this.radius+s,p=this.radius*this.radius;const l=s/a;f[0]+=t*l,f[1]+=r*l,f[2]+=n*l}this.center=f,c.clear()}getChildren(){if(this._children||(0,n.s)(this.bbMin,this.bbMax)<=1)return this._children;const e=(0,n.m)((0,o.vt)(),this.bbMin,this.bbMax,.5),t=this.primitiveIndices.length,r=new Uint8Array(t),i=new Array(8);for(let e=0;e<8;++e)i[e]=0;const{data:a,size:c,indices:l}=this.position;for(let n=0;n<t;++n){let t=0;const o=this._numIndexPerPrimitive*this.primitiveIndices[n];let s=c*l[o],d=a[s],u=a[s+1],h=a[s+2];for(let e=1;e<this._numIndexPerPrimitive;++e){s=c*l[o+e];const t=a[s],r=a[s+1],i=a[s+2];t<d&&(d=t),r<u&&(u=r),i<h&&(h=i)}d<e[0]&&(t|=1),u<e[1]&&(t|=2),h<e[2]&&(t|=4),r[n]=t,++i[t]}let d=0;for(let e=0;e<8;++e)i[e]>0&&++d;if(d<2)return;const u=new Array(8);for(let e=0;e<8;++e)u[e]=i[e]>0?new Uint32Array(i[e]):void 0;for(let e=0;e<8;++e)i[e]=0;for(let e=0;e<t;++e){const t=r[e];u[t][i[t]++]=this.primitiveIndices[e]}this._children=new Array;for(let e=0;e<8;++e)void 0!==u[e]&&this._children.push(new s(u[e],this._numIndexPerPrimitive,this.position));return this._children}static prune(){c.prune()}}const c=new i.A({deallocator:null})},30164:(e,t,r)=>{r.d(t,{g:()=>A});var i,n,o=r(49186),a=(r(44208),r(53966)),s=r(97768),c=r(74887),l=r(44794),d=r(94656),u=r(63907);(n=i||(i={}))[n.Texture=0]="Texture",n[n.RenderBuffer=1]="RenderBuffer";var h=r(67171);function m(e){(null!=e.width&&e.width<0||null!=e.height&&e.height<0||null!=e.depth&&e.depth<0)&&a.A.getLogger("esri/views/webgl/textureUtils").error("Negative dimension parameters are not allowed!")}function f(e){return null!=e&&"type"in e&&"compressed"===e.type}function p(e){return null!=e&&!f(e)&&!function(e){return null!=e&&"byteLength"in e}(e)}function v(e){return e===u.Ap.TEXTURE_3D||e===u.Ap.TEXTURE_2D_ARRAY}function g(e,t,r,i=1){let n=Math.max(t,r);return e===u.Ap.TEXTURE_3D&&(n=Math.max(n,i)),Math.floor(Math.log2(n))+1}function _(e){if(null!=e.internalFormat)return e.internalFormat===u.Ab.DEPTH_STENCIL?u.Ab.DEPTH24_STENCIL8:e.internalFormat;switch(e.dataType){case u.ld.FLOAT:switch(e.pixelFormat){case u.Ab.RGBA:return u.H0.RGBA32F;case u.Ab.RGB:return u.H0.RGB32F;default:throw new o.A("Unable to derive format")}case u.ld.UNSIGNED_BYTE:switch(e.pixelFormat){case u.Ab.RGBA:return u.H0.RGBA8;case u.Ab.RGB:return u.H0.RGB8}}return e.internalFormat=e.pixelFormat===u.Ab.DEPTH_STENCIL?u.Ab.DEPTH24_STENCIL8:e.pixelFormat}class T extends h.R{constructor(e,t){switch(super(),this.context=e,Object.assign(this,t),this.internalFormat){case u.H0.R16F:case u.H0.R16I:case u.H0.R16UI:case u.H0.R32F:case u.H0.R32I:case u.H0.R32UI:case u.H0.R8_SNORM:case u.H0.R8:case u.H0.R8I:case u.H0.R8UI:this.pixelFormat=u.Ab.RED}}static validate(e,t){return new T(e,t)}}const x=()=>a.A.getLogger("esri/views/webgl/Texture");let A=class e{static{this.TEXTURE_UNIT_FOR_UPDATES=0}static{this.compressionWorkerHandle=null}constructor(e,t=null,r=null){if(this.type=i.Texture,this._glName=null,this._samplingModeDirty=!1,this._wrapModeDirty=!1,this._wasImmutablyAllocated=!1,this._compressionAbortController=(0,l.v)(null),"context"in e)this._descriptor=e,r=t;else{const r=T.validate(e,t);if(!r)throw new o.A("Texture descriptor invalid");this._descriptor=r}this._descriptor.target===u.Ap.TEXTURE_CUBE_MAP?this._setDataCubeMap(r):this.setData(r)}get glName(){return this._glName}get descriptor(){return this._descriptor}get usedMemory(){return(0,h.e)(this._descriptor)}get cachedMemory(){return this.usedMemory}get isDirty(){return this._samplingModeDirty||this._wrapModeDirty}get isCompressing(){return null!==this._compressionAbortController.value}dispose(){this.abortCompression(),this._descriptor.context.gl&&this._glName&&(this._descriptor.context.instanceCounter.decrement(u.vt.Texture,this),this._descriptor.context.unbindTexture(this),this._descriptor.context.gl.deleteTexture(this._glName),this._glName=null)}release(){this.dispose()}resize(e,t){const r=this._descriptor;if(r.width!==e||r.height!==t){if(this._wasImmutablyAllocated)throw new o.A("Immutable textures can't be resized!");r.width=e,r.height=t,this._descriptor.target===u.Ap.TEXTURE_CUBE_MAP?this._setDataCubeMap(null):this.setData(null)}}enableCompression(e){this._descriptor.shouldCompress=e}setData(e){this.abortCompression(),!f(e)&&this._descriptor.internalFormat&&this._descriptor.internalFormat in u.CQ&&(this._descriptor.internalFormat=void 0),this._setData(e),!f(e)&&this._descriptor.shouldCompress&&this._compressOnWorker(e)}updateData(t,r,i,n,a,s,c=0){s||x().error("An attempt to use uninitialized data!"),this._glName||x().error("An attempt to update uninitialized texture!");const l=this._descriptor;l.internalFormat=_(l);const{context:d,pixelFormat:u,dataType:h,target:m,isImmutable:v}=l;if(v&&!this._wasImmutablyAllocated)throw new o.A("Cannot update immutable texture before allocation!");const g=d.bindTexture(this,e.TEXTURE_UNIT_FOR_UPDATES,!0);(r<0||i<0||r+n>l.width||i+a>l.height)&&x().error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage();const{gl:T}=d;c&&(n&&a||x().warn("Must pass width and height if `UNPACK_SKIP_ROWS` is used"),T.pixelStorei(T.UNPACK_SKIP_ROWS,c)),p(s)?T.texSubImage2D(m,t,r,i,n,a,u,h,s):f(s)?T.compressedTexSubImage2D(m,t,r,i,n,a,l.internalFormat,s.levels[t]):T.texSubImage2D(m,t,r,i,n,a,u,h,s),c&&T.pixelStorei(T.UNPACK_SKIP_ROWS,0),d.bindTexture(g,e.TEXTURE_UNIT_FOR_UPDATES)}updateData3D(t,r,i,n,a,s,c,l){l||x().error("An attempt to use uninitialized data!"),this._glName||x().error("An attempt to update an uninitialized texture!");const d=this._descriptor;d.internalFormat=_(d);const{context:u,pixelFormat:h,dataType:m,isImmutable:p,target:g}=d;if(p&&!this._wasImmutablyAllocated)throw new o.A("Cannot update immutable texture before allocation!");v(g)||x().warn("Attempting to set 3D texture data on a non-3D texture");const T=u.bindTexture(this,e.TEXTURE_UNIT_FOR_UPDATES);u.setActiveTexture(e.TEXTURE_UNIT_FOR_UPDATES),(r<0||i<0||n<0||r+a>d.width||i+s>d.height||n+c>d.depth)&&x().error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage();const{gl:A}=u;if(f(l))l=l.levels[t],A.compressedTexSubImage3D(g,t,r,i,n,a,s,c,d.internalFormat,l);else{const e=l;A.texSubImage3D(g,t,r,i,n,a,s,c,h,m,e)}u.bindTexture(T,e.TEXTURE_UNIT_FOR_UPDATES)}generateMipmap(){const t=this._descriptor;if(0===t.width||0===t.height)return;if(!t.hasMipmap){if(this._wasImmutablyAllocated)throw new o.A("Cannot add mipmaps to immutable texture after allocation");t.hasMipmap=!0,this._samplingModeDirty=!0,m(t)}t.samplingMode===u.Cj.LINEAR?(this._samplingModeDirty=!0,t.samplingMode=u.Cj.LINEAR_MIPMAP_NEAREST):t.samplingMode===u.Cj.NEAREST&&(this._samplingModeDirty=!0,t.samplingMode=u.Cj.NEAREST_MIPMAP_NEAREST);const r=this._descriptor.context.bindTexture(this,e.TEXTURE_UNIT_FOR_UPDATES);this._descriptor.context.setActiveTexture(e.TEXTURE_UNIT_FOR_UPDATES),this._descriptor.context.gl.generateMipmap(t.target),this._descriptor.context.bindTexture(r,e.TEXTURE_UNIT_FOR_UPDATES)}clearMipmap(){const e=this._descriptor;if(e.hasMipmap){if(this._wasImmutablyAllocated)throw new o.A("Cannot delete mipmaps to immutable texture after allocation");e.hasMipmap=!1,this._samplingModeDirty=!0,m(e)}e.samplingMode===u.Cj.LINEAR_MIPMAP_NEAREST?(this._samplingModeDirty=!0,e.samplingMode=u.Cj.LINEAR):e.samplingMode===u.Cj.NEAREST_MIPMAP_NEAREST&&(this._samplingModeDirty=!0,e.samplingMode=u.Cj.NEAREST)}setSamplingMode(e){e!==this._descriptor.samplingMode&&(this._descriptor.samplingMode=e,this._samplingModeDirty=!0)}setWrapMode(e){e!==this._descriptor.wrapMode&&(this._descriptor.wrapMode=e,m(this._descriptor),this._wrapModeDirty=!0)}applyChanges(){this._samplingModeDirty&&(this._applySamplingMode(),this._samplingModeDirty=!1),this._wrapModeDirty&&(this._applyWrapMode(),this._wrapModeDirty=!1)}abortCompression(){this.isCompressing&&(this._compressionAbortController.value=(0,s.DC)(this._compressionAbortController.value))}_setData(t,r){const i=this._descriptor,n=i.context?.gl;if(!n)return;(0,d.Y2)(n),this._glName||(this._glName=n.createTexture(),i.context.instanceCounter.increment(u.vt.Texture,this)),m(i);const a=i.context.bindTexture(this,e.TEXTURE_UNIT_FOR_UPDATES);i.context.setActiveTexture(e.TEXTURE_UNIT_FOR_UPDATES),this._configurePixelStorage(),(0,d.Y2)(n);const s=r??i.target,c=v(s);if(p(t))this._setDataFromTexImageSource(t,s);else{const{width:e,height:r,depth:a}=i;if(null==e||null==r)throw new o.A("Width and height must be specified!");if(c&&null==a)throw new o.A("Depth must be specified!");if(i.internalFormat=_(i),i.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(s,i.internalFormat,i.hasMipmap,e,r,a),f(t)){if(!(i.internalFormat in u.CQ))throw new o.A("Attempting to use compressed data with an uncompressed format!");this._setDataFromCompressedSource(t,i.internalFormat,s)}else this._texImage(s,0,i.internalFormat,e,r,a,t),(0,d.Y2)(n),i.hasMipmap&&this.generateMipmap()}this._applySamplingMode(),this._applyWrapMode(),this._applyAnisotropicFilteringParameters(),(0,d.Y2)(n),i.context.bindTexture(a,e.TEXTURE_UNIT_FOR_UPDATES)}_setDataCubeMap(e=null){for(let t=u.Ap.TEXTURE_CUBE_MAP_POSITIVE_X;t<=u.Ap.TEXTURE_CUBE_MAP_NEGATIVE_Z;t++)this._setData(e,t)}_configurePixelStorage(){const e=this._descriptor.context.gl,{unpackAlignment:t,flipped:r,preMultiplyAlpha:i}=this._descriptor;e.pixelStorei(e.UNPACK_ALIGNMENT,t),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,r?1:0),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,i?1:0)}_setDataFromTexImageSource(e,t){const{gl:r}=this._descriptor.context,i=this._descriptor;i.internalFormat=_(i);const n=v(t),{width:o,height:a,depth:s}=function(e){let t="width"in e?e.width:e.codedWidth,r="height"in e?e.height:e.codedHeight;return e instanceof HTMLVideoElement&&(t=e.videoWidth,r=e.videoHeight),{width:t,height:r,depth:1}}(e);i.width&&i.height,i.width||(i.width=o),i.height||(i.height=a),n&&i.depth,n&&(i.depth=s),i.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(t,i.internalFormat,i.hasMipmap,o,a,s),this._texImage(t,0,i.internalFormat,o,a,s,e),(0,d.Y2)(r),i.hasMipmap&&(this.generateMipmap(),(0,d.Y2)(r))}_setDataFromCompressedSource(e,t,r){const i=this._descriptor,{width:n,height:o,depth:a}=i,s=e.levels,c=g(r,n,o,a),l=Math.min(c,s.length)-1;this._descriptor.context.gl.texParameteri(i.target,i.context.gl.TEXTURE_MAX_LEVEL,l),this._forEachMipmapLevel(((e,i,n,o)=>{const a=s[Math.min(e,s.length-1)];this._compressedTexImage(r,e,t,i,n,o,a)}),l)}_texStorage(e,t,r,i,n,a){const{gl:s}=this._descriptor.context;if(!(t in u.H0))throw new o.A("Immutable textures must have a sized internal format");if(!this._descriptor.isImmutable)return;const c=r?g(e,i,n,a):1;if(v(e)){if(null==a)throw new o.A("Missing depth dimension for 3D texture upload");s.texStorage3D(e,c,t,i,n,a)}else s.texStorage2D(e,c,t,i,n);this._wasImmutablyAllocated=!0}_texImage(e,t,r,i,n,a,s){const c=this._descriptor.context.gl,l=v(e),{isImmutable:d,pixelFormat:u,dataType:h}=this._descriptor;if(d){if(null!=s){const r=s;if(l){if(null==a)throw new o.A("Missing depth dimension for 3D texture upload");c.texSubImage3D(e,t,0,0,0,i,n,a,u,h,r)}else c.texSubImage2D(e,t,0,0,i,n,u,h,r)}}else{const d=s;if(l){if(null==a)throw new o.A("Missing depth dimension for 3D texture upload");c.texImage3D(e,t,r,i,n,a,0,u,h,d)}else c.texImage2D(e,t,r,i,n,0,u,h,d)}}_compressedTexImage(e,t,r,i,n,a,s){const c=this._descriptor.context.gl,l=v(e);if(this._descriptor.isImmutable){if(null!=s)if(l){if(null==a)throw new o.A("Missing depth dimension for 3D texture upload");c.compressedTexSubImage3D(e,t,0,0,0,i,n,a,r,s)}else c.compressedTexSubImage2D(e,t,0,0,i,n,r,s)}else if(l){if(null==a)throw new o.A("Missing depth dimension for 3D texture upload");c.compressedTexImage3D(e,t,r,i,n,a,0,s)}else c.compressedTexImage2D(e,t,r,i,n,0,s)}async _compressOnWorker(t){if(!e.compressionWorkerHandle||!e.compressionWorkerHandle.isCompressible(t))return;const r=this._descriptor.context?.gl.getExtension("WEBGL_compressed_texture_etc"),i=this._descriptor.context?.gl.getExtension("WEBGL_compressed_texture_s3tc");if(r||i){const n=new AbortController;this._compressionAbortController.value=n;const o={data:await createImageBitmap(t),flipped:this.descriptor.flipped,width:t.width,height:t.height,hasMipmap:this._descriptor.hasMipmap,hasETC:!!r,hasS3TC:!!i};e.compressionWorkerHandle.invoke(o,this._compressionAbortController.value.signal).then((e=>{e&&this.isCompressing&&this.glName&&(this._descriptor.internalFormat=e.internalFormat,this._setData(e.compressedTexture)),n===this._compressionAbortController.value&&(this._compressionAbortController.value=null)})).catch((e=>{(0,c.zf)(e)||n!==this._compressionAbortController.value||(this._compressionAbortController.value=null)}))}}_forEachMipmapLevel(e,t=1/0){let{width:r,height:i,depth:n,hasMipmap:a,target:s}=this._descriptor;const c=s===u.Ap.TEXTURE_3D;if(null==r||null==i||c&&null==n)throw new o.A("Missing texture dimensions for mipmap calculation");for(let o=0;e(o,r,i,n),a&&(1!==r||1!==i||c&&1!==n)&&!(o>=t);++o)r=Math.max(1,r>>1),i=Math.max(1,i>>1),c&&(n=Math.max(1,n>>1))}_applySamplingMode(){const e=this._descriptor,t=e.context?.gl;let r=e.samplingMode,i=e.samplingMode;r===u.Cj.LINEAR_MIPMAP_NEAREST||r===u.Cj.LINEAR_MIPMAP_LINEAR?(r=u.Cj.LINEAR,e.hasMipmap||(i=u.Cj.LINEAR)):r!==u.Cj.NEAREST_MIPMAP_NEAREST&&r!==u.Cj.NEAREST_MIPMAP_LINEAR||(r=u.Cj.NEAREST,e.hasMipmap||(i=u.Cj.NEAREST)),t.texParameteri(e.target,t.TEXTURE_MAG_FILTER,r),t.texParameteri(e.target,t.TEXTURE_MIN_FILTER,i)}_applyWrapMode(){const e=this._descriptor,t=e.context?.gl;"number"==typeof e.wrapMode?(t.texParameteri(e.target,t.TEXTURE_WRAP_S,e.wrapMode),t.texParameteri(e.target,t.TEXTURE_WRAP_T,e.wrapMode)):(t.texParameteri(e.target,t.TEXTURE_WRAP_S,e.wrapMode.s),t.texParameteri(e.target,t.TEXTURE_WRAP_T,e.wrapMode.t))}_applyAnisotropicFilteringParameters(){const e=this._descriptor,t=e.context.capabilities.textureFilterAnisotropic;t&&e.context.gl.texParameterf(e.target,t.TEXTURE_MAX_ANISOTROPY,e.maxAnisotropy??1)}}},32680:(e,t,r)=>{r.d(t,{M:()=>n});var i=r(31821);function n(e){e.vertex.code.add(i.H`vec4 offsetBackfacingClipPosition(vec4 posClip, vec3 posWorld, vec3 normalWorld, vec3 camPosWorld) {
342
+ `),t}const V=Object.freeze(Object.defineProperty({__proto__:null,build:z},Symbol.toStringTag,{value:"Module"}))},29920:(e,t,r)=>{r.d(t,{j:()=>s});var i=r(3694),n=r(38954),o=r(51850),a=r(620);class s{constructor(e,t,r){this.primitiveIndices=e,this._numIndexPerPrimitive=t,this.position=r,this._children=void 0,(0,a.vA)(e.length>=1),(0,a.vA)(3===r.size||4===r.size);const{data:i,size:s,indices:l}=r;(0,a.vA)(l.length%this._numIndexPerPrimitive==0),(0,a.vA)(l.length>=e.length*this._numIndexPerPrimitive);const d=e.length;let u=s*l[this._numIndexPerPrimitive*e[0]];c.clear(),c.push(u);const h=(0,o.fA)(i[u],i[u+1],i[u+2]),m=(0,o.o8)(h);for(let t=0;t<d;++t){const r=this._numIndexPerPrimitive*e[t];for(let e=0;e<this._numIndexPerPrimitive;++e){u=s*l[r+e],c.push(u);let t=i[u];h[0]=Math.min(t,h[0]),m[0]=Math.max(t,m[0]),t=i[u+1],h[1]=Math.min(t,h[1]),m[1]=Math.max(t,m[1]),t=i[u+2],h[2]=Math.min(t,h[2]),m[2]=Math.max(t,m[2])}}this.bbMin=h,this.bbMax=m;const f=(0,n.m)((0,o.vt)(),this.bbMin,this.bbMax,.5);this.radius=.5*Math.max(Math.max(m[0]-h[0],m[1]-h[1]),m[2]-h[2]);let p=this.radius*this.radius;for(let e=0;e<c.length;++e){u=c.at(e);const t=i[u]-f[0],r=i[u+1]-f[1],n=i[u+2]-f[2],o=t*t+r*r+n*n;if(o<=p)continue;const a=Math.sqrt(o),s=.5*(a-this.radius);this.radius=this.radius+s,p=this.radius*this.radius;const l=s/a;f[0]+=t*l,f[1]+=r*l,f[2]+=n*l}this.center=f,c.clear()}getChildren(){if(this._children||(0,n.s)(this.bbMin,this.bbMax)<=1)return this._children;const e=(0,n.m)((0,o.vt)(),this.bbMin,this.bbMax,.5),t=this.primitiveIndices.length,r=new Uint8Array(t),i=new Array(8);for(let e=0;e<8;++e)i[e]=0;const{data:a,size:c,indices:l}=this.position;for(let n=0;n<t;++n){let t=0;const o=this._numIndexPerPrimitive*this.primitiveIndices[n];let s=c*l[o],d=a[s],u=a[s+1],h=a[s+2];for(let e=1;e<this._numIndexPerPrimitive;++e){s=c*l[o+e];const t=a[s],r=a[s+1],i=a[s+2];t<d&&(d=t),r<u&&(u=r),i<h&&(h=i)}d<e[0]&&(t|=1),u<e[1]&&(t|=2),h<e[2]&&(t|=4),r[n]=t,++i[t]}let d=0;for(let e=0;e<8;++e)i[e]>0&&++d;if(d<2)return;const u=new Array(8);for(let e=0;e<8;++e)u[e]=i[e]>0?new Uint32Array(i[e]):void 0;for(let e=0;e<8;++e)i[e]=0;for(let e=0;e<t;++e){const t=r[e];u[t][i[t]++]=this.primitiveIndices[e]}this._children=new Array;for(let e=0;e<8;++e)void 0!==u[e]&&this._children.push(new s(u[e],this._numIndexPerPrimitive,this.position));return this._children}static prune(){c.prune()}}const c=new i.A({deallocator:null})},30164:(e,t,r)=>{r.d(t,{g:()=>A});var i,n,o=r(49186),a=(r(44208),r(53966)),s=r(97768),c=r(74887),l=r(44794),d=r(94656),u=r(63907);(n=i||(i={}))[n.Texture=0]="Texture",n[n.RenderBuffer=1]="RenderBuffer";var h=r(67171);function m(e){(null!=e.width&&e.width<0||null!=e.height&&e.height<0||null!=e.depth&&e.depth<0)&&a.A.getLogger("esri/views/webgl/textureUtils").error("Negative dimension parameters are not allowed!")}function f(e){return null!=e&&"type"in e&&"compressed"===e.type}function p(e){return null!=e&&!f(e)&&!function(e){return null!=e&&"byteLength"in e}(e)}function v(e){return e===u.Ap.TEXTURE_3D||e===u.Ap.TEXTURE_2D_ARRAY}function g(e,t,r,i=1){let n=Math.max(t,r);return e===u.Ap.TEXTURE_3D&&(n=Math.max(n,i)),Math.floor(Math.log2(n))+1}function _(e){if(null!=e.internalFormat)return e.internalFormat===u.Ab.DEPTH_STENCIL?u.Ab.DEPTH24_STENCIL8:e.internalFormat;switch(e.dataType){case u.ld.FLOAT:switch(e.pixelFormat){case u.Ab.RGBA:return u.H0.RGBA32F;case u.Ab.RGB:return u.H0.RGB32F;default:throw new o.A("Unable to derive format")}case u.ld.UNSIGNED_BYTE:switch(e.pixelFormat){case u.Ab.RGBA:return u.H0.RGBA8;case u.Ab.RGB:return u.H0.RGB8}}return e.internalFormat=e.pixelFormat===u.Ab.DEPTH_STENCIL?u.Ab.DEPTH24_STENCIL8:e.pixelFormat}class T extends h.R{constructor(e,t){switch(super(),this.context=e,Object.assign(this,t),this.internalFormat){case u.H0.R16F:case u.H0.R16I:case u.H0.R16UI:case u.H0.R32F:case u.H0.R32I:case u.H0.R32UI:case u.H0.R8_SNORM:case u.H0.R8:case u.H0.R8I:case u.H0.R8UI:this.pixelFormat=u.Ab.RED}}static validate(e,t){return new T(e,t)}}const x=()=>a.A.getLogger("esri/views/webgl/Texture");let A=class e{static{this.TEXTURE_UNIT_FOR_UPDATES=0}static{this.compressionWorkerHandle=null}constructor(e,t=null,r=null){if(this.type=i.Texture,this._glName=null,this._samplingModeDirty=!1,this._wrapModeDirty=!1,this._wasImmutablyAllocated=!1,this._compressionAbortController=(0,l.v)(null),"context"in e)this._descriptor=e,r=t;else{const r=T.validate(e,t);if(!r)throw new o.A("Texture descriptor invalid");this._descriptor=r}this._descriptor.target===u.Ap.TEXTURE_CUBE_MAP?this._setDataCubeMap(r):this.setData(r)}get glName(){return this._glName}get descriptor(){return this._descriptor}get usedMemory(){return(0,h.e)(this._descriptor)}get cachedMemory(){return this.usedMemory}get isDirty(){return this._samplingModeDirty||this._wrapModeDirty}get isCompressing(){return null!==this._compressionAbortController.value}dispose(){this.abortCompression(),this._descriptor.context.gl&&this._glName&&(this._descriptor.context.instanceCounter.decrement(u.vt.Texture,this),this._descriptor.context.unbindTexture(this),this._descriptor.context.gl.deleteTexture(this._glName),this._glName=null)}release(){this.dispose()}resize(e,t){const r=this._descriptor;if(r.width!==e||r.height!==t){if(this._wasImmutablyAllocated)throw new o.A("Immutable textures can't be resized!");r.width=e,r.height=t,this._descriptor.target===u.Ap.TEXTURE_CUBE_MAP?this._setDataCubeMap(null):this.setData(null)}}enableCompression(e){this._descriptor.shouldCompress=e}setData(e){this.abortCompression(),!f(e)&&this._descriptor.internalFormat&&this._descriptor.internalFormat in u.CQ&&(this._descriptor.internalFormat=void 0),this._setData(e),!f(e)&&this._descriptor.shouldCompress&&this._compressOnWorker(e)}updateData(t,r,i,n,a,s,c=0){s||x().error("An attempt to use uninitialized data!"),this._glName||x().error("An attempt to update uninitialized texture!");const l=this._descriptor;l.internalFormat=_(l);const{context:d,pixelFormat:u,dataType:h,target:m,isImmutable:v}=l;if(v&&!this._wasImmutablyAllocated)throw new o.A("Cannot update immutable texture before allocation!");const g=d.bindTexture(this,e.TEXTURE_UNIT_FOR_UPDATES,!0);(r<0||i<0||r+n>l.width||i+a>l.height)&&x().error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage();const{gl:T}=d;c&&(n&&a||x().warn("Must pass width and height if `UNPACK_SKIP_ROWS` is used"),T.pixelStorei(T.UNPACK_SKIP_ROWS,c)),p(s)?T.texSubImage2D(m,t,r,i,n,a,u,h,s):f(s)?T.compressedTexSubImage2D(m,t,r,i,n,a,l.internalFormat,s.levels[t]):T.texSubImage2D(m,t,r,i,n,a,u,h,s),c&&T.pixelStorei(T.UNPACK_SKIP_ROWS,0),d.bindTexture(g,e.TEXTURE_UNIT_FOR_UPDATES)}updateData3D(t,r,i,n,a,s,c,l){l||x().error("An attempt to use uninitialized data!"),this._glName||x().error("An attempt to update an uninitialized texture!");const d=this._descriptor;d.internalFormat=_(d);const{context:u,pixelFormat:h,dataType:m,isImmutable:p,target:g}=d;if(p&&!this._wasImmutablyAllocated)throw new o.A("Cannot update immutable texture before allocation!");v(g)||x().warn("Attempting to set 3D texture data on a non-3D texture");const T=u.bindTexture(this,e.TEXTURE_UNIT_FOR_UPDATES);u.setActiveTexture(e.TEXTURE_UNIT_FOR_UPDATES),(r<0||i<0||n<0||r+a>d.width||i+s>d.height||n+c>d.depth)&&x().error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage();const{gl:A}=u;if(f(l))l=l.levels[t],A.compressedTexSubImage3D(g,t,r,i,n,a,s,c,d.internalFormat,l);else{const e=l;A.texSubImage3D(g,t,r,i,n,a,s,c,h,m,e)}u.bindTexture(T,e.TEXTURE_UNIT_FOR_UPDATES)}generateMipmap(){const t=this._descriptor;if(0===t.width||0===t.height)return;if(!t.hasMipmap){if(this._wasImmutablyAllocated)throw new o.A("Cannot add mipmaps to immutable texture after allocation");t.hasMipmap=!0,this._samplingModeDirty=!0,m(t)}t.samplingMode===u.Cj.LINEAR?(this._samplingModeDirty=!0,t.samplingMode=u.Cj.LINEAR_MIPMAP_NEAREST):t.samplingMode===u.Cj.NEAREST&&(this._samplingModeDirty=!0,t.samplingMode=u.Cj.NEAREST_MIPMAP_NEAREST);const r=this._descriptor.context.bindTexture(this,e.TEXTURE_UNIT_FOR_UPDATES);this._descriptor.context.setActiveTexture(e.TEXTURE_UNIT_FOR_UPDATES),this._descriptor.context.gl.generateMipmap(t.target),this._descriptor.context.bindTexture(r,e.TEXTURE_UNIT_FOR_UPDATES)}clearMipmap(){const e=this._descriptor;if(e.hasMipmap){if(this._wasImmutablyAllocated)throw new o.A("Cannot delete mipmaps to immutable texture after allocation");e.hasMipmap=!1,this._samplingModeDirty=!0,m(e)}e.samplingMode===u.Cj.LINEAR_MIPMAP_NEAREST?(this._samplingModeDirty=!0,e.samplingMode=u.Cj.LINEAR):e.samplingMode===u.Cj.NEAREST_MIPMAP_NEAREST&&(this._samplingModeDirty=!0,e.samplingMode=u.Cj.NEAREST)}setSamplingMode(e){e!==this._descriptor.samplingMode&&(this._descriptor.samplingMode=e,this._samplingModeDirty=!0)}setWrapMode(e){e!==this._descriptor.wrapMode&&(this._descriptor.wrapMode=e,m(this._descriptor),this._wrapModeDirty=!0)}applyChanges(){this._samplingModeDirty&&(this._applySamplingMode(),this._samplingModeDirty=!1),this._wrapModeDirty&&(this._applyWrapMode(),this._wrapModeDirty=!1)}abortCompression(){this.isCompressing&&(this._compressionAbortController.value=(0,s.DC)(this._compressionAbortController.value))}_setData(t,r){const i=this._descriptor,n=i.context?.gl;if(!n)return;(0,d.Y2)(n),this._glName||(this._glName=n.createTexture(),i.context.instanceCounter.increment(u.vt.Texture,this)),m(i);const a=i.context.bindTexture(this,e.TEXTURE_UNIT_FOR_UPDATES);i.context.setActiveTexture(e.TEXTURE_UNIT_FOR_UPDATES),this._configurePixelStorage(),(0,d.Y2)(n);const s=r??i.target,c=v(s);if(p(t))this._setDataFromTexImageSource(t,s);else{const{width:e,height:r,depth:a}=i;if(null==e||null==r)throw new o.A("Width and height must be specified!");if(c&&null==a)throw new o.A("Depth must be specified!");if(i.internalFormat=_(i),i.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(s,i.internalFormat,i.hasMipmap,e,r,a),f(t)){if(!(i.internalFormat in u.CQ))throw new o.A("Attempting to use compressed data with an uncompressed format!");this._setDataFromCompressedSource(t,i.internalFormat,s)}else this._texImage(s,0,i.internalFormat,e,r,a,t),(0,d.Y2)(n),i.hasMipmap&&this.generateMipmap()}this._applySamplingMode(),this._applyWrapMode(),this._applyAnisotropicFilteringParameters(),(0,d.Y2)(n),i.context.bindTexture(a,e.TEXTURE_UNIT_FOR_UPDATES)}_setDataCubeMap(e=null){for(let t=u.Ap.TEXTURE_CUBE_MAP_POSITIVE_X;t<=u.Ap.TEXTURE_CUBE_MAP_NEGATIVE_Z;t++)this._setData(e,t)}_configurePixelStorage(){const e=this._descriptor.context.gl,{unpackAlignment:t,flipped:r,preMultiplyAlpha:i}=this._descriptor;e.pixelStorei(e.UNPACK_ALIGNMENT,t),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,r?1:0),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,i?1:0)}_setDataFromTexImageSource(e,t){const{gl:r}=this._descriptor.context,i=this._descriptor;i.internalFormat=_(i);const n=v(t),{width:o,height:a,depth:s}=function(e){let t="width"in e?e.width:e.codedWidth,r="height"in e?e.height:e.codedHeight;return e instanceof HTMLVideoElement&&(t=e.videoWidth,r=e.videoHeight),{width:t,height:r,depth:1}}(e);i.width&&i.height,i.width||(i.width=o),i.height||(i.height=a),n&&i.depth,n&&(i.depth=s),i.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(t,i.internalFormat,i.hasMipmap,o,a,s),this._texImage(t,0,i.internalFormat,o,a,s,e),(0,d.Y2)(r),i.hasMipmap&&(this.generateMipmap(),(0,d.Y2)(r))}_setDataFromCompressedSource(e,t,r){const i=this._descriptor,{width:n,height:o,depth:a}=i,s=e.levels,c=g(r,n,o,a),l=Math.min(c,s.length)-1;this._descriptor.context.gl.texParameteri(i.target,i.context.gl.TEXTURE_MAX_LEVEL,l),this._forEachMipmapLevel(((e,i,n,o)=>{const a=s[Math.min(e,s.length-1)];this._compressedTexImage(r,e,t,i,n,o,a)}),l)}_texStorage(e,t,r,i,n,a){const{gl:s}=this._descriptor.context;if(!(t in u.H0))throw new o.A("Immutable textures must have a sized internal format");if(!this._descriptor.isImmutable)return;const c=r?g(e,i,n,a):1;if(v(e)){if(null==a)throw new o.A("Missing depth dimension for 3D texture upload");s.texStorage3D(e,c,t,i,n,a)}else s.texStorage2D(e,c,t,i,n);this._wasImmutablyAllocated=!0}_texImage(e,t,r,i,n,a,s){const c=this._descriptor.context.gl,l=v(e),{isImmutable:d,pixelFormat:u,dataType:h}=this._descriptor;if(d){if(null!=s){const r=s;if(l){if(null==a)throw new o.A("Missing depth dimension for 3D texture upload");c.texSubImage3D(e,t,0,0,0,i,n,a,u,h,r)}else c.texSubImage2D(e,t,0,0,i,n,u,h,r)}}else{const d=s;if(l){if(null==a)throw new o.A("Missing depth dimension for 3D texture upload");c.texImage3D(e,t,r,i,n,a,0,u,h,d)}else c.texImage2D(e,t,r,i,n,0,u,h,d)}}_compressedTexImage(e,t,r,i,n,a,s){const c=this._descriptor.context.gl,l=v(e);if(this._descriptor.isImmutable){if(null!=s)if(l){if(null==a)throw new o.A("Missing depth dimension for 3D texture upload");c.compressedTexSubImage3D(e,t,0,0,0,i,n,a,r,s)}else c.compressedTexSubImage2D(e,t,0,0,i,n,r,s)}else if(l){if(null==a)throw new o.A("Missing depth dimension for 3D texture upload");c.compressedTexImage3D(e,t,r,i,n,a,0,s)}else c.compressedTexImage2D(e,t,r,i,n,0,s)}async _compressOnWorker(t){if(!e.compressionWorkerHandle||!e.compressionWorkerHandle.isCompressible(t))return;const r=this._descriptor.context?.gl.getExtension("WEBGL_compressed_texture_etc"),i=this._descriptor.context?.gl.getExtension("WEBGL_compressed_texture_s3tc");if(r||i){const n=new AbortController;this._compressionAbortController.value=n;const o={data:await createImageBitmap(t),flipped:this.descriptor.flipped,width:t.width,height:t.height,hasMipmap:this._descriptor.hasMipmap,hasETC:!!r,hasS3TC:!!i};e.compressionWorkerHandle.invoke(o,this._compressionAbortController.value.signal).then((e=>{e&&this.isCompressing&&this.glName&&(this._descriptor.internalFormat=e.internalFormat,this._setData(e.compressedTexture)),n===this._compressionAbortController.value&&(this._compressionAbortController.value=null)})).catch((e=>{(0,c.zf)(e)||n!==this._compressionAbortController.value||(this._compressionAbortController.value=null)}))}}_forEachMipmapLevel(e,t=1/0){let{width:r,height:i,depth:n,hasMipmap:a,target:s}=this._descriptor;const c=s===u.Ap.TEXTURE_3D;if(null==r||null==i||c&&null==n)throw new o.A("Missing texture dimensions for mipmap calculation");for(let o=0;e(o,r,i,n),a&&(1!==r||1!==i||c&&1!==n)&&!(o>=t);++o)r=Math.max(1,r>>1),i=Math.max(1,i>>1),c&&(n=Math.max(1,n>>1))}_applySamplingMode(){const e=this._descriptor,t=e.context?.gl;let r=e.samplingMode,i=e.samplingMode;r===u.Cj.LINEAR_MIPMAP_NEAREST||r===u.Cj.LINEAR_MIPMAP_LINEAR?(r=u.Cj.LINEAR,e.hasMipmap||(i=u.Cj.LINEAR)):r!==u.Cj.NEAREST_MIPMAP_NEAREST&&r!==u.Cj.NEAREST_MIPMAP_LINEAR||(r=u.Cj.NEAREST,e.hasMipmap||(i=u.Cj.NEAREST)),t.texParameteri(e.target,t.TEXTURE_MAG_FILTER,r),t.texParameteri(e.target,t.TEXTURE_MIN_FILTER,i)}_applyWrapMode(){const e=this._descriptor,t=e.context?.gl;"number"==typeof e.wrapMode?(t.texParameteri(e.target,t.TEXTURE_WRAP_S,e.wrapMode),t.texParameteri(e.target,t.TEXTURE_WRAP_T,e.wrapMode)):(t.texParameteri(e.target,t.TEXTURE_WRAP_S,e.wrapMode.s),t.texParameteri(e.target,t.TEXTURE_WRAP_T,e.wrapMode.t))}_applyAnisotropicFilteringParameters(){const e=this._descriptor,t=e.context.capabilities.textureFilterAnisotropic;t&&e.context.gl.texParameterf(e.target,t.TEXTURE_MAX_ANISOTROPY,e.maxAnisotropy??1)}}},32680:(e,t,r)=>{r.d(t,{M:()=>n});var i=r(31821);function n(e){e.vertex.code.add(i.H`vec4 offsetBackfacingClipPosition(vec4 posClip, vec3 posWorld, vec3 normalWorld, vec3 camPosWorld) {
343
343
  vec3 camToVert = posWorld - camPosWorld;
344
344
  bool isBackface = dot(camToVert, normalWorld) > 0.0;
345
345
  if (isBackface) {
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[3299],{83299:(e,t,n)=>{n.r(t),n.d(t,{fromGeometries:()=>ue,fromGeometry:()=>me,fromGeometryToGXGeometry:()=>le,getSpatialReference:()=>ae,toGeometry:()=>ce});var r=n(55537),i=n(83661),s=n(12189),a=n(95213),o=n(35368);function u(){if(-1===this.m_i)return this.m_i=0,{value:{m_token:1,m_value:null},done:!1};if(this.m_i<this.m_keys.length){const e=this.m_bReturnKey,t=Math.trunc(this.m_i);return this.m_bReturnKey=!this.m_bReturnKey,this.m_i+=.5,e?{value:{m_token:5,m_value:this.m_keys[t]},done:!1}:{value:{m_token:6,m_value:this.m_o[this.m_keys[t]]},done:!1}}return{value:{m_token:3,m_value:null},done:!0}}function m(){if(-1===this.m_i)return this.m_i=0,{value:{m_token:2,m_value:null},done:!1};if(this.m_i<this.m_a.length){const e={value:{m_token:6,m_value:this.m_a[this.m_i++]},done:!1};return this.m_strict||void 0===e.value.m_value&&(e.value.m_value=Number.NaN),e}return{value:{m_token:4,m_value:null},done:!0}}n(90293);class l{createJSONObjectIterator(e){return{m_iteratorType:"object",m_o:e,m_keys:this.m_options.strict?Object.keys(e):Object.keys(e).filter((t=>void 0!==e[t])),m_i:-1,m_bReturnKey:!0,next:u}}createJSONArrayIterator(e){return{m_iteratorType:"array",m_strict:this.m_options.strict,m_i:-1,m_a:e,next:m}}constructor(e,t){this.m_currentToken=0,this.m_options=t?{...t}:{strict:!0};const n=e;this.m_iteratorStack=[n instanceof Array?this.createJSONArrayIterator(n):this.createJSONObjectIterator(n)],this.m_nextFlatToken={m_value:null,m_token:0}}nextToken(){if(0===this.m_iteratorStack.length)return this.m_currentToken=0;switch(this.m_nextFlatToken=this.m_iteratorStack.at(-1).next().value,this.m_currentValue=void 0,this.m_nextFlatToken.m_token){case 1:return this.m_currentToken=1;case 3:return this.m_iteratorStack.pop(),this.m_currentToken=3;case 2:return this.m_currentToken=2;case 4:return this.m_iteratorStack.pop(),this.m_currentToken=4;case 5:return this.m_currentValue=this.m_nextFlatToken.m_value,this.m_currentToken=5;case 6:if(this.m_nextFlatToken.m_value instanceof Array)return this.m_iteratorStack.push(this.createJSONArrayIterator(this.m_nextFlatToken.m_value)),this.nextToken();if(this.m_nextFlatToken.m_value instanceof Object)return this.m_iteratorStack.push(this.createJSONObjectIterator(this.m_nextFlatToken.m_value)),this.nextToken();if("number"==typeof this.m_nextFlatToken.m_value)return this.m_currentValue=this.m_nextFlatToken.m_value,Number.isSafeInteger(this.m_currentValue)&&this.m_currentValue>=(0,i.ao)()&&this.m_currentValue<=(0,i.i)()?this.m_currentToken=8:this.m_currentToken=7;if("string"==typeof this.m_nextFlatToken.m_value)return this.m_currentValue=this.m_nextFlatToken.m_value,this.m_currentToken=6;if("boolean"==typeof this.m_nextFlatToken.m_value)return this.m_currentValue=this.m_nextFlatToken.m_value,this.m_currentToken=this.m_nextFlatToken.m_value?11:12;if("object"==typeof this.m_nextFlatToken.m_value)return this.m_currentValue=null,this.m_currentToken=10;(0,r.c)("unrecognized json element type")}return(0,r.c)("unrecognized json element type"),0}currentToken(){return this.m_currentToken}skipChildren(){if(0!==this.m_iteratorStack.length)switch(this.m_currentValue=void 0,this.m_nextFlatToken.m_token){case 1:return this.m_iteratorStack.pop(),this.m_nextFlatToken.m_token=3,void(this.m_currentToken=3);case 2:return this.m_iteratorStack.pop(),this.m_nextFlatToken.m_token=4,void(this.m_currentToken=4)}}currentString(){return 6!==this.m_currentToken&&5!==this.m_currentToken&&(0,r.t)("invalid token"),this.m_currentValue}currentDoubleValue(){return 7!==this.m_currentToken&&8!==this.m_currentToken&&(0,r.t)("invalid token"),this.m_currentValue}currentInt32Value(){return 8!==this.m_currentToken&&(0,r.t)("invalid token"),this.m_currentValue}currentInt64Value(){return(0,r.g)(0),0n}currentBoolValue(){return 12!==this.m_currentToken&&11!==this.m_currentToken&&(0,r.t)("invalid token"),this.m_currentValue}isError(){return 0}}class c{constructor(e){return this.m_buffer=null,this.m_view=null,this.m_sz=0,this.m_offset=0,this.m_bOwnsBuffer=!0,this.m_bLittleEndian=!0,this.m_element=new ArrayBuffer(8),this.m_elementBytes=new Uint8Array(this.m_element),this.m_elementView=new DataView(this.m_element),this.m_elementDouble=new Float64Array(this.m_element),this.m_elementFloat=new Float32Array(this.m_element),this.m_elementInt64=new BigInt64Array(this.m_element),this.m_elementInt32=new Int32Array(this.m_element),this.m_elementInt16=new Int16Array(this.m_element),void 0!==e.sz?(this.m_sz=e.sz,e.buffer?(this.m_sz<0&&(0,r.n)("size out of range"),this.m_buffer=e.buffer,this.m_offset=void 0!==e.offset?e.offset:0,this.m_view=void 0!==e.offset?new DataView(e.buffer,e.offset,e.sz):new DataView(this.m_buffer),this.m_bOwnsBuffer=!1,void(this.m_bLittleEndian=!0)):(this.m_sz<0&&(0,r.n)("size out of range"),void(this.m_sz>0&&(this.m_buffer=new ArrayBuffer(this.m_sz),this.m_view=new DataView(this.m_buffer))))):e.move?(this.m_sz=e.move.m_sz,this.m_buffer=e.move.m_buffer,this.m_view=e.move.m_view,this.m_bOwnsBuffer=e.move.m_bOwnsBuffer,this.m_bLittleEndian=e.move.m_bLittleEndian,e.move.m_buffer=null,e.move.m_view=null,e.move.m_sz=0,void(e.move.m_bOwnsBuffer=!0)):void(0,r.c)("unrecognized constructor options")}swapBytesDouble(){this.doSwap()&&(this.m_elementDouble[0]=this.m_elementBytes[0]<<56|this.m_elementBytes[1]<<48|this.m_elementBytes[2]<<40|this.m_elementBytes[3]<<32|this.m_elementBytes[4]<<24|this.m_elementBytes[5]<<16|this.m_elementBytes[6]<<8|this.m_elementBytes[7])}swapBytesInt32(){this.doSwap()&&(this.m_elementInt32[0]=this.m_elementBytes[0]<<24|this.m_elementBytes[1]<<16|this.m_elementBytes[2]<<8|this.m_elementBytes[3])}getOffset(){return this.m_offset}assignMove(e){return this===e||(this.clear(),this.m_sz=e.m_sz,this.m_buffer=e.m_buffer,this.m_view=e.m_view,this.m_bOwnsBuffer=e.m_bOwnsBuffer,this.m_bLittleEndian=e.m_bLittleEndian,e.m_buffer=null,e.m_sz=0,e.m_bOwnsBuffer=!0),this}doSwap(){return this.m_bLittleEndian!==(1===c.getNativeByteOrder())}setNativeByteOrder(){this.m_bLittleEndian=1===c.getNativeByteOrder()}setOrder(e){this.m_bLittleEndian=1===e}getOrder(){return this.m_bLittleEndian?1:0}getView(){return this.m_view||(0,r.m)("buffer not defined"),this.m_view}static getNativeByteOrder(){return 1}clear(){this.m_buffer=null,this.m_sz=0,this.m_bOwnsBuffer=!0}size(){return this.m_sz}readDouble(e){return this.doSwap()?(this.m_elementDouble[0]=this.m_view.getFloat64(e,this.m_bLittleEndian),this.swapBytesDouble(),this.m_elementDouble[0]):this.m_view.getFloat64(e,this.m_bLittleEndian)}writeDouble(e,t){this.m_elementDouble[0]=t,this.swapBytesDouble(),this.m_view.setFloat64(e,this.m_elementDouble[0],this.m_bLittleEndian)}readInt32(e){return this.doSwap()?(this.m_elementInt32[0]=this.m_view.getInt32(e,this.m_bLittleEndian),this.swapBytesInt32(),this.m_elementInt32[0]):this.m_view.getInt32(e,this.m_bLittleEndian)}writeInt32(e,t){this.m_elementInt32[0]=t,this.swapBytesInt32(),this.m_view.setInt32(e,this.m_elementInt32[0],this.m_bLittleEndian)}getPtr(){return this.m_buffer}setSizeNoRealloc(e){(0,r.g)(e>=0&&e<=this.m_sz),this.m_sz=e}}function d(e){let t=!1;for(;3!==e.nextToken();){const n=e.currentString();e.nextToken(),"uwkid"===n?t||(t=!0,8===e.currentToken()&&e.currentInt32Value()):e.skipChildren()}return null}function h(e){let t=!1,n=!1,r=!1,i=!1,a=!1,o=!1,u=!1,m=!1,l=!1,c=!1,h=!1,_=!1,f=!1,p=!1,k=!1,b=!1,y=!1,g=-1,N=-1,T=-1,v=-1,x=0,A=0,S=0,w=0,C=0,D=0,F=0,j=0,z=0,I=0,O="",E="",P=null;for(;3!==e.nextToken();){const s=e.currentString();e.nextToken(),"wkid"===s?t||(t=!0,8===e.currentToken()&&(g=e.currentInt32Value())):"latestWkid"===s?n||(n=!0,8===e.currentToken()&&(N=e.currentInt32Value())):"wkt"===s?a||(a=!0,6===e.currentToken()&&(O=e.currentString())):"wkt2"===s?a||6===e.currentToken()&&(E=e.currentString()):"vcsWkid"===s?r||(r=!0,8===e.currentToken()&&(T=e.currentInt32Value())):"latestVcsWkid"===s?i||(i=!0,8===e.currentToken()&&(v=e.currentInt32Value())):"xyTolerance"===s?u||(u=!0,o=!0,x=e.currentDoubleValue()):"zTolerance"===s?m||(m=!0,o=!0,A=e.currentDoubleValue()):"mTolerance"===s?l||(l=!0,o=!0,S=e.currentDoubleValue()):"falseX"===s?c||(c=!0,o=!0,F=e.currentDoubleValue()):"falseY"===s?h||(h=!0,o=!0,j=e.currentDoubleValue()):"falseZ"===s?_||(_=!0,o=!0,z=e.currentDoubleValue()):"falseM"===s?f||(f=!0,o=!0,I=e.currentDoubleValue()):"xyUnits"===s?p||(p=!0,o=!0,w=e.currentDoubleValue()):"zUnits"===s?k||(k=!0,o=!0,C=e.currentDoubleValue()):"mUnits"===s?b||(b=!0,o=!0,D=e.currentDoubleValue()):"unit"===s?y||(y=!0,P=d(e)):e.skipChildren()}v<=0&&T>0&&(v=T),T<=0&&v>0&&(T=v);let G=null,B=!0;if(0!==O.length&&(B=!1,(0,s.aA)(O)&&(G=(0,s.a)(O))),G||0===E.length||(B=!1,(0,s.aA)(E)&&(G=(0,s.a)(E))),!G&&N>0&&(B=!1,(0,s.aB)(N)&&(v<=0||(0,s.aC)())&&(G=(0,s.c)(N,v))),!G&&g>0&&(B=!1,(0,s.aB)(g)&&(T<=0||(0,s.aC)())&&(G=(0,s.c)(g,T))),B&&(G=(0,s.z)(P)),o&&G){const e=new s.aE;G.queryPrecisionDescriptorWithoutFalseXY(e),u&&e.setTolerance(0,x),m&&e.setTolerance(1,A),l&&e.setTolerance(2,S),p&&c&&h&&e.setGridParams(F,j,w),k&&_&&e.setZParams(z,C),b&&f&&e.setMParams(I,D),G=(0,s.aD)(G,e)}return G}function _(e,t,n,s){2!==s.currentToken()&&(0,r.t)("failed to parse multipath: array of array of vertices is expected");const u=e?new o.a:new o.P,m=u,l=(0,a.z)(0),c=(0,a.F)(2,0),d=(0,a.D)(0);let h=null,_=null,f=null,p=null,b=null,T=0,v=0,x=0;const A=new o.S,S=i.P.getNAN();let w=0,C=0;const D=e?1:0;for(;4!==s.nextToken();){2!==s.currentToken()&&(0,r.t)("failed to parse multipath: ring/path array is expected");let n=2,u=0,F=!0;const j=4;let z=0,I=0;const O=i.P.getNAN(),E=(0,i.d)(j,Number.NaN),P=(0,i.d)(j,Number.NaN);let G=!1;for(s.nextToken();4!==s.currentToken();){if(t&&1===s.currentToken())F&&(0,r.t)("failed to parse multipath: starting vertex array is expected"),f||(f=(0,a.D)(w-1,1),p=(0,a.z)(w-1,-1),b=(0,a.F)(0)),G=!0,n=1,({segFlag:x,toPointSz:z}=N(A,E,S,s));else{for(G=!1,2!==s.currentToken()&&(0,r.t)("failed to parse multipath: array is expected, rings/paths vertices consist of arrays of coordinates"),z=0;4!==s.nextToken();)z===j&&(0,r.t)("failed to parse multipath: each vertex array has to have at most 4 elements"),E[z++]=k(s);z<2&&(0,r.t)("failed to parse multipath: each vertex array has to have at least 2 elements"),(0,a.J)(E[0],E[1])||(0,r.t)("failed to parse multipath: x and y must be finite")}s.nextToken();do{if(c.size()===2*w&&c.resize(y(w)),c.writePoint2D(2*w,O.setCoords(E[0],E[1])),h&&h.size()===w&&h.resize(g(w)),z>2?(h||(h=(0,a.F)(w+1,Number.NaN)),h.write(w,E[2])):h&&h.write(w,Number.NaN),_&&_.size()===w&&_.resize(g(w)),z>3?(_||(_=(0,a.F)(w+1,Number.NaN)),_.write(w,E[3])):_&&_.write(w,Number.NaN),F)C++,l.add(w),d.add(D),F=!1,I=z,(0,i.a)(P,E,0,0,I);else if(null!==f)if(G){const e=(0,o.A)(x),t=b.size();b.resize(t+e),f.add(x),p.add(T),A.get().writeInBufferStream(b,T),T+=e,m.incCurveType(x,1),v++}else f.add(1),p.add(-1);w++,u++,S.setCoords(E[0],E[1])}while(u<n&&4===s.currentToken())}0!==u&&(e&&u>n&&z===I&&0===(0,i.ap)(E,P,z)?(w--,u--):null!==f&&(f.add(1),p.add(-1)))}return w&&(l.resize(C),d.resize(C),w>0&&(l.add(w),d.add(0)),m.setAttributeStreamRef(0,c),m.setPathFlagsStreamRef(d),m.setPathStreamRef(l),null!==f&&(m.updateCurveCounter(v),m.setSegmentData(p,b,f,T)),m.notifyModifiedFlags(65535)),{geometry:u,as:h,bs:_}}function f(e,t){2!==t.currentToken()&&(0,r.t)("failed to parse multipoint: array of vertices is expected");let n=0;const s=new o.M,u=(0,a.F)(2,0);let m=0;const l=(0,i.d)(4,Number.NaN),c=new i.P;let d=null,h=null;for(;4!==t.nextToken();){for(2!==t.currentToken()&&(0,r.t)("failed to parse multipoint: array is expected, multipoint vertices consist of arrays of cooridinates"),m=0;4!==t.nextToken();)4===m&&(0,r.t)("failed to parse multipoint: each vertex array has to have at most 4 elements"),l[m++]=k(t);m<2&&(0,r.t)("failed to parse multipoint: each vertex array has to have at least 2 elements"),(0,a.J)(l[0],l[1])||(0,r.t)("failed to parse multipoint: x and y must be finite"),u.size()===2*n&&u.resize(y(n)),u.writePoint2D(2*n,c.setCoords(l[0],l[1])),d&&d.size()===n&&d.resize(g(n)),m>2?(d||(d=(0,a.F)(n+1,Number.NaN)),d.write(n,l[2])):d&&d.write(n,Number.NaN),h&&h.size()===n&&h.resize(g(n)),m>3?(h||(h=(0,a.F)(n+1,Number.NaN)),h.write(n,l[3])):h&&h.write(n,Number.NaN),n++}if(n){const e=s.getImpl();e.setAttributeStreamRef(0,u),e.resizeNoInit(n),e.notifyModifiedFlags(65535)}return{geometry:s,as:d,bs:h}}function p(e,t){2!==t.currentToken()&&(0,r.t)("failed to parse array of IDs: array of array of integers is expected");const n=(0,a.K)(2,0);let i=0,s=-1;for(;4!==t.nextToken();){const e=i;n.size()===i&&n.resize(g(i)),i++;let a=0;for(-1===s?s=2===t.currentToken()?1:0:1===s&&2!==t.currentToken()&&(0,r.t)("failed to parse array of IDs: array of array of integers is expected"),0===s&&(n.size()===i&&n.resize(g(i)),n.write(i,b(t)),a++,i++);4!==t.nextToken();)n.size()===i&&n.resize(g(i)),n.write(i,b(t)),a++,i++;if(n.write(e,a),0===s)break}return n.resize(i),n}function k(e){const t=e.currentToken();if(10===t||6===t&&"NaN"===e.currentString())return Number.NaN;{const t=e.currentDoubleValue();return Number.isNaN(t)?Number.NaN:t}}function b(e){return e.currentInt32Value()}function y(e){let t=2*Math.trunc(3*(e+1)/2);return t<8?t=8:t<32&&(t=32),t}function g(e){let t=Math.trunc(3*(e+1)/2);return t<4?t=4:t<16&&(t=16),t}function N(e,t,n,s,a){const u={segFlag:0,toPointSz:0};let m=s.currentToken();m=s.nextToken();const l=s.currentString(),d=l[0];for((1!==l.length||"a"!==d&&"b"!==d&&"c"!==d&&"n"!==d&&"q"!==d)&&(0,r.t)('failed to parse curve: expecting "a", "b", "n", "q", or "c"'),m=s.nextToken(),2!==m&&(0,r.t)("failed to parse curve: start array is expected for curve parameters"),m=s.nextToken(),2!==m&&(0,r.t)("failed to parse curve: start array is expected for to point"),u.toPointSz=0;4!==s.nextToken();)4===u.toPointSz&&(0,r.t)("failed to parse curve: vertex array cannot have more than 4 elements"),t[u.toPointSz++]=k(s);u.toPointSz<2&&(0,r.t)("failed to parse curve: vertex array must have at least 2 elements");const h=i.P.construct(t[0],t[1]),_=i.P.getNAN();let f=-1,p=-1,b=!1,y=Number.NaN,g=Number.NaN,N=Number.NaN;const v=[i.P.getNAN(),i.P.getNAN(),i.P.getNAN()],x=i.P.getNAN();if("a"===d){m=s.nextToken(),2!==m&&(0,r.t)("failed to parse curve: start array is expected for center point"),m=s.nextToken();const e=k(s);m=s.nextToken();const t=k(s);m=s.nextToken(),4!==m&&(0,r.t)("failed to parse curve: end array is expected for center point"),_.setCoords(e,t),m=s.nextToken(),f=s.currentInt32Value(),m=s.nextToken(),p=s.currentInt32Value(),m=s.nextToken(),4!==m?(b=!1,y=k(s),m=s.nextToken(),g=k(s),m=s.nextToken(),N=k(s),m=s.nextToken(),4!==m&&(0,r.t)("failed to parse curve: end array is expected for curve parameters")):b=!0,u.segFlag=4}else if("b"===d){for(let e=0;e<2;e++){m=s.nextToken(),2!==m&&(0,r.t)("failed to parse curve: start array is expected for control point"),m=s.nextToken();const t=k(s);m=s.nextToken();const n=k(s);m=s.nextToken(),4!==m&&(0,r.t)("failed to parse curve: end array is expected for control point"),v[e].setCoords(t,n)}m=s.nextToken(),4!==m&&(0,r.t)("failed to parse curve: end array is expected for curve parameters"),u.segFlag=2}else if("n"===d){{m=s.nextToken(),2!==m&&(0,r.t)("failed to parse curve: start array is expected for control point"),m=s.nextToken();const e=k(s);m=s.nextToken();const t=k(s);m=s.nextToken(),4!==m&&(0,r.t)("failed to parse curve: end array is expected for control point"),v[0].setCoords(e,t)}m=s.nextToken();const e=k(s);m=s.nextToken();const t=k(s);m=s.nextToken();const n=k(s);v[1].setCoords(e,t),v[2].setCoords(n,n),m=s.nextToken(),4!==m&&(0,r.t)("failed to parse curve: end array is expected for curve parameters"),u.segFlag=8}else if("q"===d){for(let e=0;e<1;e++){m=s.nextToken(),2!==m&&(0,r.t)("failed to parse curve: start array is expected for control point"),m=s.nextToken();const t=k(s);m=s.nextToken();const n=k(s);m=s.nextToken(),4!==m&&(0,r.t)("failed to parse curve: end array is expected for control point"),v[e].setCoords(t,n)}m=s.nextToken(),4!==m&&(0,r.t)("failed to parse curve: end array is expected for curve parameters"),u.segFlag=16}else{m=s.nextToken(),2!==m&&(0,r.t)("failed to parse curve: start array is expected for interior point"),m=s.nextToken();const e=k(s);m=s.nextToken();const t=k(s);m=s.nextToken(),4!==m&&(0,r.t)("failed to parse curve: end array is expected for interior point"),x.setCoords(e,t),m=s.nextToken(),4!==m&&(0,r.t)("failed to parse curve: end array is expected for curve parameters"),u.segFlag=4}if(m=s.nextToken(),3!==m&&(0,r.t)("failed to parse curve: end object is expected for curve"),"a"===d)if(e.createEllipticArc(),b){const t=!0;T(e.get(),n,h,_,t,f,p)}else!function(e,t,n,r,i,s,a,u,m){e.dropAllAttributes();const l=new ArrayBuffer(44),d=new c({sz:44,buffer:l});let h=0;d.writeDouble(h,r.x),h+=8,d.writeDouble(h,r.y),h+=8,d.writeDouble(h,a),h+=8,d.writeDouble(h,u),h+=8,d.writeDouble(h,m),h+=8;let _=0;s||(_|=2048),i&&(_|=4096),d.writeInt32(h,_),h+=4,function(e,t,n,r){e.m_bits=0,e.m_center.x=r.readDouble(0),e.m_center.y=r.readDouble(8),e.m_rotation=r.readDouble(16),e.m_semiMajorAxis=r.readDouble(24),e.m_minorMajorRatio=r.readDouble(32),e.m_XStart=t.x,e.m_YStart=t.y,e.m_XEnd=n.x,e.m_YEnd=n.y;const i=r.readInt32(40);if(1&i)return!1;let s=!!(64&i),a=!!(128&i);const u=!!(2048&i),m=!!(4096&i);!(512&i)&&!(1024&i)||a||(s=!0),a&&!t.equals(n)?(a=!1,s=!0):s&&t.equals(n)&&(a=!0,s=!1),a?(e.m_center.assign(t),e.m_startAngle=e.m_center.x,e.m_sweepAngle=e.m_center.y,(0,o.z)(e,Number.NaN,u,m),e.m_semiMajorAxis=0,e.m_interior.setCoordsPoint2D(t)):s?(e.m_center.setNAN(),e.m_semiMajorAxis=1,e.m_minorMajorRatio=0,e.m_center.setNAN(),e.m_sweepAngle=0,e.m_startAngle=0,(0,o.x)(e),e.queryCoord2D(.5,e.m_interior)):e.constructEllipticArcEndPointsCenter(t,n,e.m_semiMajorAxis,e.m_minorMajorRatio,e.m_rotation,!m,u,e.m_center),e.setProjectionBehavior(1),(0,o.x)(e)}(e,t,n,d)}(e.get(),n,h,_,f,p,y,g,N);else if("b"===d)e.createCubicBezier(),function(e,t,n,s){e.dropAllAttributes();const a=new ArrayBuffer(32),o=new c({sz:32,buffer:a});let u=0;o.writeDouble(u,s[0].x),u+=8,o.writeDouble(u,s[0].y),u+=8,o.writeDouble(u,s[1].x),u+=8,o.writeDouble(u,s[1].y),u+=8,function(e,t,n,s){(0,r.g)(32<=s.size()),e.m_cp=(0,i.m)(i.P,2),e.m_cp[0].x=s.readDouble(0),e.m_cp[0].y=s.readDouble(8),e.m_cp[1].x=s.readDouble(16),e.m_cp[1].y=s.readDouble(24),e.m_XStart=t.x,e.m_YStart=t.y,e.m_XEnd=n.x,e.m_YEnd=n.y}(e,t,n,o)}(e.get(),n,h,v);else if("n"===d)e.createQuadraticRationalBezier(),function(e,t,n,r,i,s,a){e.dropAllAttributes();const o=new ArrayBuffer(40),u=new c({sz:40,buffer:o});let m=0;u.writeDouble(m,r.x),m+=8,u.writeDouble(m,r.y),m+=8,u.writeDouble(m,i),m+=8,u.writeDouble(m,s),m+=8,u.writeDouble(m,a),m+=8,function(e,t,n,r){e.m_cp.x=r.readDouble(0),e.m_cp.y=r.readDouble(8),e.m_weights[0]=r.readDouble(16),e.m_weights[1]=r.readDouble(24),e.m_weights[2]=r.readDouble(32),e.m_XStart=t.x,e.m_YStart=t.y,e.m_XEnd=n.x,e.m_YEnd=n.y}(e,t,n,u)}(e.get(),n,h,v[0],v[1].x,v[1].y,v[2].x);else if("q"===d)e.createQuadraticBezier(),e.get().construct(n,v[0],h);else{e.createEllipticArc();const t=!1;T(e.get(),n,h,x,t,-1,-1)}return u}function T(e,t,n,s,a,u,m){e.dropAllAttributes();const l=new ArrayBuffer(20),d=new c({sz:20,buffer:l});let h=0;d.writeDouble(h,s.x),h+=8,d.writeDouble(h,s.y),h+=8;let _=0;a?(m||(_|=8),u&&(_|=16)):_|=128,d.writeInt32(h,_),h+=4,function(e,t,n,s){0>=s.size()&&(0,r.n)("Byte_buffer out of range access"),e.m_bits=0,e.m_rotation=0,e.m_cosr=1,e.m_sinr=0,e.setStartXY(t),e.setEndXY(n);const a=i.P.getNAN();a.x=s.readDouble(0),a.y=s.readDouble(8);const u=s.readInt32(16);if(1&u)return e.m_semiMajorAxis=0,e.m_minorMajorRatio=1,e.m_interior.assign(a),e.m_center.setNAN(),e.m_sweepAngle=0,e.m_startAngle=0,(0,o.x)(e),!1;let m=!!(64&u);const l=!!(128&u);let c=!!(32&u);const d=!!(8&u),h=!!(16&u),_=t.equals(n);m&&!_&&(m=!1,c=!0),c&&_&&(m=!0,c=!1,a.setCoords(0,0)),m||(l?c?(e.m_semiMajorAxis=1,e.m_minorMajorRatio=0,e.m_interior.assign(a),e.m_center.setNAN(),e.m_sweepAngle=0,e.m_startAngle=0):(e.constructCircularArcThreePoint(t,n,a),_&&d===e.isClockwise()&&e.reverse()):c?(e.m_semiMajorAxis=1,e.m_minorMajorRatio=0,e.m_center.setNAN(),e.m_sweepAngle=0,e.m_startAngle=0,(0,o.x)(e),e.queryCoord2D(.5,e.m_interior)):(0,o.y)(e,t,n,a,d,h)),m&&(e.m_center.assign(t),e.m_startAngle=a.x,e.m_sweepAngle=a.y,(0,o.z)(e,Number.NaN,d,h),e.m_semiMajorAxis=0,e.m_minorMajorRatio=1,e.m_interior.setCoordsPoint2D(t)),e.setProjectionBehavior(0),(0,o.x)(e)}(e,t,n,d)}function v(e,t,n,i,s){const a=e.getGeometryType();if(a===r.G.enumEllipticArc)return function(e,t,n,i,s){(0,r.g)(!(0,o.w)(e));const a=e.getEndXY(),u=e.hasAttribute(1)&&!t,m=e.hasAttribute(2)&&!n;let l=Number.NaN,c=Number.NaN;if(u&&(l=e.getEndAttributeAsDbl(1,0)),m&&(c=e.getEndAttributeAsDbl(2,0)),e.isDegenerateToLine()||e.isDegenerate(0))return A(u,m,a.x,a.y,l,c,i,s),!0;const d=0===e.projectionBehavior(),h=!!d&&e.isClosed();if(d&&!h)s.startObject(),s.addFieldName("c"),s.startArray(),A(u,m,a.x,a.y,l,c,i,s),S(e.m_interior.x,e.m_interior.y,17,s),s.endArray(),s.endObject();else if(d){s.startObject(),s.addFieldName("a"),s.startArray(),A(u,m,a.x,a.y,l,c,i,s);const t=0,n=0;S(e.m_center.x+t,e.m_center.y+n,17,s);const r=!e.isMajor();s.addInt32(r?1:0);const o=e.isClockwise();s.addInt32(o?1:0),s.endArray(),s.endObject()}else{s.startObject(),s.addFieldName("a"),s.startArray(),A(u,m,a.x,a.y,l,c,i,s);const t=e;S(t.m_center.x,t.m_center.y,17,s);const n=!t.isMajor();s.addInt32(n?1:0);const r=t.isClockwise();s.addInt32(r?1:0),s.addDouble(t.m_rotation,17),s.addDouble(t.m_semiMajorAxis,17),s.addDouble(t.m_minorMajorRatio,17),s.endArray(),s.endObject()}return!1}(e,t,n,i,s);if(a===r.G.enumBezier)return x(e,t,n,i,s);if(a===r.G.enumRationalBezier2)return function(e,t,n,r,i){const s=e.getEndXY(),a=e.hasAttribute(1)&&!t,o=e.hasAttribute(2)&&!n;let u=Number.NaN,m=Number.NaN;a&&(u=e.getEndAttributeAsDbl(1,0)),o&&(m=e.getEndAttributeAsDbl(2,0)),i.startObject(),i.addFieldName("n"),i.startArray(),A(a,o,s.x,s.y,u,m,r,i),S(e.m_cp.x,e.m_cp.y,r,i);const l=r;return i.addDouble(e.m_weights[0],l),i.addDouble(e.m_weights[1],l),i.addDouble(e.m_weights[2],l),i.endArray(),i.endObject(),!1}(e,t,n,i,s);if(a===r.G.enumBezier2){const r=new o.C;return r.constructFromQuadraticSegment(e),x(r,t,n,i,s)}(0,r.b)("")}function x(e,t,n,r,i){const s=e.getEndXY(),a=e.hasAttribute(1)&&!t,o=e.hasAttribute(2)&&!n;let u=Number.NaN,m=Number.NaN;return a&&(u=e.getEndAttributeAsDbl(1,0)),o&&(m=e.getEndAttributeAsDbl(2,0)),i.startObject(),i.addFieldName("b"),i.startArray(),A(a,o,s.x,s.y,u,m,r,i),S(e.m_cp[0].x,e.m_cp[0].y,r,i),S(e.m_cp[1].x,e.m_cp[1].y,r,i),i.endArray(),i.endObject(),!1}function A(e,t,n,r,i,s,a,o){o.startArray(),o.addDouble(n,a),o.addDouble(r,a),e&&o.addDouble(i,a),t&&o.addDouble(s,a),o.endArray()}function S(e,t,n,r){r.startArray(),r.addDouble(e,n),r.addDouble(t,n),r.endArray()}function w(e,t,n,i){const s=n.getImpl(),u=!!(2&t),m=!!(4&t),l=!!(8&t),c=s.hasAttribute(1)&&!u,d=s.hasAttribute(2)&&!m,h=s.hasAttribute(3)&&!l,_=s.hasNonLinearSegments();c&&(i.addFieldName("hasZ"),i.addBool(!0)),d&&(i.addFieldName("hasM"),i.addBool(!0)),e?_?i.addFieldName("curveRings"):i.addFieldName("rings"):_?i.addFieldName("curvePaths"):i.addFieldName("paths");let f=null;const p=[];if(n.isEmpty())i.startArray(),i.endArray();else{const e=17-(31&t>>13);i.startArray();const l=n.getPathCount();let k=0;const b=s.getAttributeStreamRef(0);let y=null,g=null,N=null;const T=new o.S;let x=null,A=null,S=null;_&&(x=s.getSegmentFlagsStreamRef(),A=s.getSegmentIndexStreamRef(),S=s.getSegmentDataStreamRef()),c&&(y=s.getAttributeStreamRef(1)),d&&(g=s.getAttributeStreamRef(2)),h&&(N=s.getAttributeStreamRef(3),f=(0,a.t)(3,0));for(let t=0;t<l;t++){i.startArray(),h&&p.push(0);const s=n.getPathEnd(t);if(k===s){i.endArray();continue}const a=n.isClosedPath(t);let o=b.read(2*k),l=b.read(2*k+1),_=c?y.read(k):Number.NaN,w=d?g.read(k):Number.NaN,D=h?N.read(k):0;C(c,d,o,l,_,w,e,i);let F=1;h&&(f.add(D),p[p.length-1]++);const j=o,z=l,I=_,O=w,E=D;let P=!1,G=0,B=Number.NaN,V=Number.NaN,M=0;for(let t=k+1,n=k,R=a?s+1:s;t<R;t++,n++){const a=null!==x?31&x.read(n):1;let k,R;if(t<s?(k=b.read(2*t),R=b.read(2*t+1),c&&(B=y.read(t)),d&&(V=g.read(t)),h&&(M=N.read(t))):(k=j,R=z,B=I,V=O,M=E),1!==a){P=!0,4===a?T.createEllipticArc():2===a?T.createCubicBezier():16===a?T.createQuadraticBezier():8===a?T.createQuadraticRationalBezier():(0,r.b)("JSON export.unsupported curve");const t=T.get(),s=A.read(n);t.setStartXYCoords(o,l),t.setEndXYCoords(k,R),c&&(t.setStartAttribute(1,0,_),t.setEndAttribute(1,0,B)),d&&(t.setStartAttribute(2,0,w),t.setEndAttribute(2,0,V)),t.readFromBufferStream(S,s),v(T.get(),u,m,e,i)&&G++}else C(c,d,k,R,B,V,e,i);h&&(f.add(M),p[p.length-1]++),F++,o=k,l=R,_=B,w=V,D=M}P&&0===G||(F<2&&G<1&&(C(c,d,o,l,_,w,e,i),F++,h&&(f.add(D),p[p.length-1]++)),a&&F<3&&G<2&&(C(c,d,j,z,I,O,e,i),F++,o=j,l=z,_=I,w=O,D=E,h&&(f.add(E),p[p.length-1]++))),i.endArray(),k=s}i.endArray()}if(h){i.addFieldName("ids"),i.startArray();let e=0;for(let t=0,n=p.length;t<n;++t){const n=p[t];(0,r.g)(0===n||null!==f&&e+n<=f.size()),i.startArray();for(let t=0;t<n;++t)i.addInt32(f.read(e)),e++;i.endArray()}i.endArray()}}function C(e,t,n,r,i,s,a,o){o.startArray(),o.addDouble(n,a),o.addDouble(r,a),e&&o.addDouble(i,a),t&&o.addDouble(s,a),o.endArray()}const D="a".charCodeAt(0),F="A".charCodeAt(0),j="*".charCodeAt(0),z="b".charCodeAt(0),I=("\b".charCodeAt(0),"\\".charCodeAt(0)),O="[".charCodeAt(0),E="{".charCodeAt(0),P=":".charCodeAt(0),G=".".charCodeAt(0),B=",".charCodeAt(0),V='"'.charCodeAt(0),M="]".charCodeAt(0),R="}".charCodeAt(0),U="e".charCodeAt(0),W="E".charCodeAt(0),X="f".charCodeAt(0),L=("\f".charCodeAt(0),"F".charCodeAt(0)),Y="/".charCodeAt(0),K=("<".charCodeAt(0),"-".charCodeAt(0)),q="+".charCodeAt(0),J="n".charCodeAt(0),Z="N".charCodeAt(0),H=("\n".charCodeAt(0),"r".charCodeAt(0)),Q=("\r".charCodeAt(0),"t".charCodeAt(0)),$=("\t".charCodeAt(0),"u".charCodeAt(0)),ee="0".charCodeAt(0),te="9".charCodeAt(0);class ne{constructor(e){this.m_functionStack=[],this.m_pushPositions=[],this.m_utf8Decoder=new TextDecoder("utf-8",{fatal:!0}),void 0===e?(this.m_startToken=Number.MAX_SAFE_INTEGER,this.m_endToken=0,this.m_currentTokenType=0,this.m_functionStack.push((()=>this.accept_())),this.m_jsonString=null,this.m_bHasEscapes=!1):e.jsonString?this.resetParserFromString(e.jsonString):e.jsonStream?(0,r.b)("streaming json parsing not yet impl"):(0,r.c)("invalid constructor parameter")}prepSubstrString_(){}getCurrentSubstrString_(){return this.m_jsonString.slice(this.m_startToken,this.m_endToken)}stepOverCharString_(){this.m_endToken++}peekCharString_(){return this.m_jsonString.charCodeAt(this.m_endToken)}getString_(e){const t=this.m_jsonString?.slice(this.m_startToken,this.m_startToken+e-1);return this.m_endToken+=e-1,{s:t,bDone:this.m_endToken>=this.m_jsonString.length}}incrementString_(){this.m_endToken++}eofString_(){return this.m_endToken>=this.m_jsonString.length}setStringFunctions_(){this.m_prepSubstr=this.prepSubstrString_,this.m_getCurrentSubstr=this.getCurrentSubstrString_,this.m_stepOverChar=this.stepOverCharString_,this.m_peekChar=this.peekCharString_,this.m_get=this.getString_,this.m_increment=this.incrementString_,this.m_eof=this.eofString_}setStreamFunctions_(){(0,r.b)("streaming json parsing not yet impl")}reset_(){this.m_jsonString=null,this.m_endToken=0,this.m_startToken=Number.MAX_SAFE_INTEGER,this.m_currentTokenType=0,this.m_bHasEscapes=!1,this.m_functionStack.length=0,this.m_functionStack.push((()=>this.start_())),this.m_pushPositions.length=0}resetParserFromString(e){this.reset_(),this.setStringFunctions_(),this.m_jsonString=e}resetParserFromStream(e){(0,r.b)("streaming json parsing not yet impl")}resetToPosition(e){return!!this.m_jsonString&&(this.m_endToken=e,this.m_startToken=Number.MAX_VALUE,this.m_currentTokenType=0,this.m_functionStack.length=0,e>=this.m_jsonString.length?(this.m_functionStack.push((()=>this.accept_())),!1):(this.m_functionStack.push((()=>this.start_())),!0))}nextToken(){return this.m_functionStack.at(-1)(),this.m_currentTokenType}currentToken(){return this.m_currentTokenType}currentTokenStartIndex(){return this.m_startToken}currentTokenEndIndex(){return this.m_endToken}currentText(){return(0,r.g)(0),""}childrenAsString(){return(0,r.g)(0),""}skipChildren(){this.skipChildren_()}skipChildren_(){if(1!==this.m_currentTokenType)if(2!==this.m_currentTokenType);else{let e=1;do{this.m_currentTokenType=this.nextToken(),2===this.m_currentTokenType?e++:4===this.m_currentTokenType&&e--}while(4!==this.m_currentTokenType||0!==e)}else{let e=1;do{this.m_currentTokenType=this.nextToken(),1===this.m_currentTokenType?e++:3===this.m_currentTokenType&&e--}while(3!==this.m_currentTokenType||0!==e)}}currentTerminalAsString_(){switch(this.m_currentTokenType){case 7:case 8:case 9:return this.m_getCurrentSubstr().slice(0,this.m_endToken-this.m_startToken);case 10:return"null";case 11:return"true";case 12:return"false"}(0,r.t)("invalid token")}toUTF8_(e,t){let n=0,r=e;for(;t.charCodeAt(r)===I&&t.charCodeAt(r+1)===$;)n++,r+=6;r=e;const i=new Uint8Array(n);let s=0;for(;t.charCodeAt(r)===I&&t.charCodeAt(r+1)===$;)i[s++]=Number.parseInt(t.slice(r+2,r+6),16),r+=6;return{u8s:this.m_utf8Decoder.decode(i),end:r}}unquoteCurrentString_(){let e="",t=1;const n=this.m_endToken-this.m_startToken-1;let r=0;const i=this.m_getCurrentSubstr();for(let s=t;s<n;s++)if(i.charCodeAt(s)!==I)r++;else{switch(r>0&&(e+=i.slice(t,t+r)),i.charCodeAt(++s)){case V:e+='"';break;case $:{const{u8s:t,end:n}=this.toUTF8_(s-1,i);s=n-1,e+=t;break}case I:e+="\\";break;case Y:e+="/";break;case z:e+="\b";break;case X:e+="\f";break;case J:e+="\n";break;case H:e+="\r";break;case Q:e+="\t"}t=s+1,r=0}return r>0&&(e+=i.slice(t,t+r)),e}currentString(){return 5!==this.m_currentTokenType&&6!==this.m_currentTokenType?this.currentTerminalAsString_():this.m_bHasEscapes?this.unquoteCurrentString_():this.m_getCurrentSubstr().slice(1,this.m_endToken-this.m_startToken-2+1)}currentDoubleValue(){if(7!==this.m_currentTokenType&&8!==this.m_currentTokenType&&9!==this.m_currentTokenType&&6!==this.m_currentTokenType&&10!==this.m_currentTokenType&&(0,r.t)("invalid token"),10===this.m_currentTokenType)return Number.NaN;let e=this.m_getCurrentSubstr(),t=this.m_endToken-this.m_startToken;if(6===this.m_currentTokenType){if("NaN"===this.currentString())return Number.NaN;e=e.slice(1),t-=2,0===t&&(0,r.t)("invalid token")}const n=Number.parseFloat(e);if(6===this.m_currentTokenType)Number.isNaN(n)&&(0,r.t)("invalid token");else if(Number.isNaN(n))return Number.NaN;return n}currentInt32Value(){8!==this.m_currentTokenType&&6!==this.m_currentTokenType&&(0,r.t)("invalid token");let e=this.m_getCurrentSubstr(),t=this.m_endToken-this.m_startToken;6===this.m_currentTokenType&&(e=e.slice(1),t-=2,0===t&&(0,r.t)("invalid token"));const n=parseInt(e);return Number.isNaN(n)&&(0,r.t)("invalid token"),n}currentInt64Value(){return(0,r.g)(0),0n}currentBoolValue(){return(0,r.g)(0),!1}isError(){return 0}JSONString(){return(0,r.g)(0),""}pushPosition(){return(0,r.g)(0),!1}popPosition(){return(0,r.g)(0),!1}skipCStyleComments_(){(0,r.g)(0)}skipCppStyleComments_(){(0,r.g)(0)}skipComments_(){this.m_prepSubstr();let e=this.m_peekChar();this.m_stepOverChar(),this.m_eof()&&(0,r.t)("invalid token"),e=this.m_peekChar(),e===j?this.skipCStyleComments_():e===Y?this.skipCppStyleComments_():(0,r.t)("invalid token")}skipWhiteSpace_(){let e;do{this.m_eof()&&(0,r.t)("invalid token");let t=this.m_peekChar();for(;t>=9&&t<=13||32===t;)this.m_increment(),this.m_eof()&&(0,r.t)("invalid token"),t=this.m_peekChar();t===Y?(this.m_startToken=this.m_endToken,e=!0,this.skipComments_()):e=!1}while(e)}rightBracket_(){return this.m_peekChar()===M&&(this.m_startToken=this.m_endToken,this.m_increment(),this.m_currentTokenType=4,!0)}rightBrace_(){return this.m_peekChar()===R&&(this.m_startToken=this.m_endToken,this.m_increment(),this.m_currentTokenType=3,!0)}string_(){this.m_prepSubstr(),this.m_bHasEscapes=!1,this.m_stepOverChar(),this.m_eof()&&(0,r.t)("invalid token");let e=this.m_peekChar();for(;e!==V;){const t=e===I;if(this.m_stepOverChar(),this.m_eof()&&(0,r.t)("invalid token"),e=this.m_peekChar(),t)if(this.m_bHasEscapes=!0,e===V||e===I||e===Y||e===z||e===X||e===J||e===H||e===Q)this.m_stepOverChar(),this.m_eof()&&(0,r.t)("invalid token"),e=this.m_peekChar();else if(e===$)for(let t=0;t<4;t++)this.m_stepOverChar(),this.m_eof()&&(0,r.t)("invalid token"),e=this.m_peekChar(),e>=ee&&e<=te||e>=D&&e<=X||e>=F&&e<=L||(0,r.t)("invalid token");else(0,r.t)("invalid token")}this.m_stepOverChar()}comma_(){return this.m_peekChar()===B&&(this.m_increment(),!0)}colon_(){return this.m_peekChar()===P&&(this.m_increment(),!0)}fieldNameEnd_(){this.skipWhiteSpace_(),this.m_functionStack.pop(),this.colon_()?(this.skipWhiteSpace_(),this.value_()):(0,r.t)("invalid token")}fieldNameStart_(){this.m_startToken=this.m_endToken,this.m_peekChar()!==V&&(0,r.t)("invalid token"),this.string_(),this.m_currentTokenType=5,this.m_functionStack.push((()=>this.fieldNameEnd_()))}pairEnd_(){this.skipWhiteSpace_(),this.comma_()?(this.skipWhiteSpace_(),this.fieldNameStart_()):this.rightBrace_()?this.m_functionStack.pop():(0,r.t)("invalid token")}arrayStart_(){this.skipWhiteSpace_(),this.m_functionStack.pop(),this.rightBracket_()||(this.m_functionStack.push((()=>this.elementEnd_())),this.value_())}elementEnd_(){this.skipWhiteSpace_(),this.comma_()?(this.skipWhiteSpace_(),this.value_()):this.rightBracket_()?this.m_functionStack.pop():(0,r.t)("invalid token")}objectStart_(){this.skipWhiteSpace_(),this.m_functionStack.pop(),this.rightBrace_()||(this.m_functionStack.push((()=>this.pairEnd_())),this.fieldNameStart_())}valueStartObject_(){this.m_increment(),this.m_currentTokenType=1,this.m_functionStack.push((()=>this.objectStart_()))}valueStartArray_(){this.m_increment(),this.m_currentTokenType=2,this.m_functionStack.push((()=>this.arrayStart_()))}valueString_(){this.string_(),this.m_currentTokenType=6}int_(){this.m_peekChar()!==ee?this.digits_():this.m_stepOverChar()}digits_(){let e=this.m_peekChar();do{this.m_stepOverChar(),this.m_eof()&&(0,r.t)("invalid token"),e=this.m_peekChar()}while(e>=ee&&e<=te)}frac_(){let e=this.m_peekChar();this.m_stepOverChar(),this.m_eof()&&(0,r.t)("invalid token"),e=this.m_peekChar(),e>=ee&&e<=te||(0,r.t)("invalid token"),this.digits_()}exp_(){let e=this.m_peekChar();this.m_stepOverChar(),this.m_eof()&&(0,r.t)("invalid token"),e=this.m_peekChar(),e!==q&&e!==K||(this.m_stepOverChar(),this.m_eof()&&(0,r.t)("invalid token"),e=this.m_peekChar()),e>=ee&&e<=te||(0,r.t)("invalid token"),this.digits_()}valueNumber_(){this.m_prepSubstr();let e=!1,t=this.m_peekChar();if(t===K?(this.m_stepOverChar(),this.m_eof()&&(0,r.t)("invalid token"),t=this.m_peekChar(),e=!0,t>=ee&&t<=te||(0,r.t)("invalid token"),this.int_()):this.int_(),t=this.m_peekChar(),t===G)this.m_currentTokenType=7,this.frac_(),t=this.m_peekChar(),t!==U&&t!==W||this.exp_();else if(t===U||t===W)this.m_currentTokenType=7,this.exp_();else{let t=0;e&&t++;const n=this.m_endToken-this.m_startToken-t;if(n<10)this.m_currentTokenType=8;else if(10===n){const n=this.m_getCurrentSubstr();e?n.slice(t)<="2147483648"?this.m_currentTokenType=8:this.m_currentTokenType=9:n.slice(t)<="2147483647"?this.m_currentTokenType=8:this.m_currentTokenType=9}else if(n<19)this.m_currentTokenType=9;else if(19===n){const n=this.m_getCurrentSubstr();e?n.slice(t)<="9223372036854775808"?this.m_currentTokenType=9:this.m_currentTokenType=7:n.slice(t)<="9223372036854775807"?this.m_currentTokenType=9:this.m_currentTokenType=7}else this.m_currentTokenType=7}}valueNull_(){const{s:e,bDone:t}=this.m_get(5);t&&(0,r.t)("invalid token"),"null"!==e&&(0,r.t)("invalid token"),this.m_currentTokenType=10}valueTrue_(){const{s:e,bDone:t}=this.m_get(5);t&&(0,r.t)("invalid token"),"true"!==e&&(0,r.t)("invalid token"),this.m_currentTokenType=11}valueFalse_(){const{s:e,bDone:t}=this.m_get(6);t&&(0,r.t)("invalid token"),"false"!==e&&(0,r.t)("invalid token"),this.m_currentTokenType=12}valueNan_(){const{s:e,bDone:t}=this.m_get(4);t&&(0,r.t)("invalid token"),"NaN"!==e&&(0,r.t)("invalid token"),this.m_currentTokenType=7}value_(){this.m_startToken=this.m_endToken;const e=this.m_peekChar();e===E?this.valueStartObject_():e===O?this.valueStartArray_():e===V?this.valueString_():e===K||e>=ee&&e<=ee+9?this.valueNumber_():e===J?this.valueNull_():e===Q?this.valueTrue_():e===X?this.valueFalse_():e===Z?this.valueNan_():(0,r.t)("invalid token")}start_(){this.skipWhiteSpace_(),this.m_functionStack.pop(),this.m_functionStack.push((()=>this.accept_()));const e=this.m_peekChar();e!==E&&e!==O&&(0,r.t)("invalid token"),this.value_()}accept_(){this.m_startToken=this.m_endToken,this.m_currentTokenType=0}}const re=new class{constructor(){this.m_pendingKey=null,this.m_acceptedObject=null,this.m_currentObject=[]}reset(){this.m_pendingKey=null,this.m_acceptedObject=null,this.m_currentObject.length=0}startObject(){const e={};this.m_pendingKey?(this.m_currentObject.at(-1)[this.m_pendingKey]=e,this.m_pendingKey=null):Array.isArray(this.m_currentObject.at(-1))&&this.m_currentObject.at(-1).push(e),this.m_currentObject.push(e)}startArray(){const e=[];this.m_pendingKey?(this.m_currentObject.at(-1)[this.m_pendingKey]=e,this.m_pendingKey=null):Array.isArray(this.m_currentObject.at(-1))&&this.m_currentObject.at(-1).push(e),this.m_currentObject.push(e)}endObject(){this.m_acceptedObject=this.m_currentObject.at(-1),this.m_currentObject.pop()}endArray(){this.m_currentObject.pop()}addFieldName(e){this.m_pendingKey=e}addValue_(e){this.m_pendingKey?(this.m_currentObject.at(-1)[this.m_pendingKey]=e,this.m_pendingKey=null):this.m_currentObject.at(-1).push(e)}addString(e){this.addValue_(e)}addDouble(e,t){this.addValue_(e)}addInt64(e){(0,r.g)(0)}addInt32(e){this.addValue_(e)}addBool(e){this.addValue_(e)}addNull(){this.addValue_(null)}getObject(){return this.m_acceptedObject}},ie=new class{getOperatorType(){return 10405}accelerateGeometry(e,t,n){return!1}canAccelerateGeometry(e){return!1}supportsCurves(){return!0}execute(e,t,n,i,a,o){!function(e,t,n,i){if(t||n){if(i.startObject(),null!==t)switch(t.getGeometryType()){case r.G.enumPolygon:w(!0,e,t,i);break;case r.G.enumPolyline:w(!1,e,t,i);break;case r.G.enumMultiPoint:!function(e,t,n){const i=t.getImpl(),s=i.hasAttribute(1)&&!(2&e),a=i.hasAttribute(2)&&!(4&e),o=i.hasAttribute(3)&&!(8&e);s&&(n.addFieldName("hasZ"),n.addBool(!0)),a&&(n.addFieldName("hasM"),n.addBool(!0)),n.addFieldName("points");const u=t.getPointCount();if(t.isEmpty())n.startArray(),n.endArray();else{const t=17-(31&e>>13);n.startArray();const r=i.getAttributeStreamRef(0);let o=null,m=null;s&&(o=i.getAttributeStreamRef(1)),a&&(m=i.getAttributeStreamRef(2));for(let e=0;e<u;e++){const i=r.read(2*e),u=r.read(2*e+1);let l=Number.NaN,c=Number.NaN;s&&(l=o.read(e)),a&&(c=m.read(e)),C(s,a,i,u,l,c,t,n)}n.endArray()}if(o){let e=null;i.isEmpty()||(e=i.getAttributeStreamRef(3)),(0,r.g)(0===u||null!==e&&e.size()>=u),n.addFieldName("ids"),n.startArray();for(let t=0;t<u;t++)n.addInt32(e.read(t));n.endArray()}}(e,t,i);break;case r.G.enumPoint:!function(e,t,n){const r=t.hasAttribute(1)&&!(2&e),i=t.hasAttribute(2)&&!(4&e),s=t.hasAttribute(3)&&!(8&e);if(t.isEmpty())return n.addFieldName("x"),n.addNull(),n.addFieldName("y"),n.addNull(),r&&(n.addFieldName("z"),n.addNull()),i&&(n.addFieldName("m"),n.addNull()),void(s&&(n.addFieldName("id"),n.addInt32(0)));const a=17-(31&e>>13);n.addFieldName("x"),n.addDouble(t.getX(),a),n.addFieldName("y"),n.addDouble(t.getY(),a),r&&(n.addFieldName("z"),n.addDouble(t.getZ(),a)),i&&(n.addFieldName("m"),n.addDouble(t.getM(),a)),s&&(n.addFieldName("id"),n.addInt32(t.getID()))}(e,t,i);break;case r.G.enumEnvelope:!function(e,t,n){const r=t.hasAttribute(1)&&!(2&e),i=t.hasAttribute(2)&&!(4&e),s=t.hasAttribute(3)&&!(8&e);if(t.isEmpty())return n.addFieldName("xmin"),n.addNull(),n.addFieldName("ymin"),n.addNull(),n.addFieldName("xmax"),n.addNull(),n.addFieldName("ymax"),n.addNull(),r&&(n.addFieldName("zmin"),n.addNull(),n.addFieldName("zmax"),n.addNull()),i&&(n.addFieldName("mmin"),n.addNull(),n.addFieldName("mmax"),n.addNull()),void(s&&(n.addFieldName("idmin"),n.addInt32(0),n.addFieldName("idmax"),n.addInt32(0)));const a=17-(31&e>>13);if(n.addFieldName("xmin"),n.addDouble(t.getXMin(),a),n.addFieldName("ymin"),n.addDouble(t.getYMin(),a),n.addFieldName("xmax"),n.addDouble(t.getXMax(),a),n.addFieldName("ymax"),n.addDouble(t.getYMax(),a),r){const e=t.queryInterval(1,0);n.addFieldName("zmin"),n.addDouble(e.vmin,a),n.addFieldName("zmax"),n.addDouble(e.vmax,a)}if(i){const e=t.queryInterval(2,0);n.addFieldName("mmin"),n.addDouble(e.vmin,a),n.addFieldName("mmax"),n.addDouble(e.vmax,a)}if(s){const e=t.queryInterval(3,0);n.addFieldName("idmin"),n.addInt32(e.vmin),n.addFieldName("idmax"),n.addInt32(e.vmax)}}(e,t,i);break;case r.G.enumMultipatch:(0,r.g)(0);break;default:(0,r.c)("exportToJSON")}null!==n&&(i.addFieldName("spatialReference"),function(e,t,n){n.startObject();let i=0;t.isCustomWkid()||(i=t.getOldID());let a=0;const o=t.getVCS();if(null!==o&&(o.isCustomWkid()||(a=o.getOldID()),a<=0&&(i=0)),i>0){n.addFieldName("wkid"),n.addInt32(i);const e=t.getLatestID();if(e>0&&e!==i&&(n.addFieldName("latestWkid"),n.addInt32(e)),a>0){n.addFieldName("vcsWkid"),n.addInt32(a);const e=t.getLatestVerticalID();e!==a&&(n.addFieldName("latestVcsWkid"),n.addInt32(e))}}if(0===t.getCoordinateSystemType())n.addFieldName("wkid"),n.addNull(),null!==t.getUnit()&&(n.addFieldName("unit"),function(e,t,n){n.startObject();const i=t.getID();i<=0&&(0,r.t)("cannot export unit that has no valid WKID"),n.addFieldName("uwkid"),n.addInt32(i),n.endObject()}(0,t.getUnit(),n));else if(i<=0||1&e){let r="";64&e&&(r=t.getText2(),n.addFieldName("wkt2"),n.addString(r));const i=t.getText();i!==r&&(n.addFieldName("wkt"),n.addString(i))}if(16&e){const e=new s.aE;t.queryPrecisionDescriptor(e),n.addFieldName("xyTolerance"),n.addDouble(e.getTolerance(0)),n.addFieldName("zTolerance"),n.addDouble(e.getTolerance(1)),n.addFieldName("mTolerance"),n.addDouble(e.getTolerance(2)),n.addFieldName("falseX"),n.addDouble(e.getFalseX()),n.addFieldName("falseY"),n.addDouble(e.getFalseY()),n.addFieldName("xyUnits"),n.addDouble(e.getGridUnitsXY()),n.addFieldName("falseZ"),n.addDouble(e.getFalseZ()),n.addFieldName("zUnits"),n.addDouble(e.getGridUnitsZ()),n.addFieldName("falseM"),n.addDouble(e.getFalseM()),n.addFieldName("mUnits"),n.addDouble(e.getGridUnitsM())}n.endObject()}(e,n,i)),i.endObject()}}(e,t,n,i)}exportSpatialReference(e,t,n,i){(0,r.g)(0)}exportProjectionTransformation(e,t,n,i){(0,r.g)(0)}exportDatumTransformation(e,t,n,i){(0,r.g)(0)}static geometryTypeToString(e){return(0,r.g)(0),""}},se=new class{getOperatorType(){return 10404}accelerateGeometry(e,t,n){return!1}canAccelerateGeometry(e){return!1}supportsCurves(){return!0}execute(e,t,n,i,u,m,l){let c;"string"==typeof n?(c=new ne({jsonString:n}),c.nextToken()):c=n,1!==c.currentToken()&&(0,r.t)("failed to import map geometry: start of object is expected");const d=function(e,t,n,i,s){let u=!1,m=!1,l=!1,c=!1,d=!1,y=!1,g=!1,N=!1,T=!1,v=!1,x=!1,A=!1,S=!1,w=!1,C=!1,D=!1,F=!1,j=!1,z=!1,I=!1,O=!1,E=!1,P=!1,G=!1,B=Number.NaN,V=Number.NaN,M=Number.NaN,R=Number.NaN,U=0,W=Number.NaN,X=Number.NaN,L=Number.NaN,Y=Number.NaN,K=Number.NaN,q=Number.NaN,J=Number.NaN,Z=Number.NaN,H=0,Q=0,$=!1,ee=!1,te=null,ne=null,re=null,ie=null,se=null;for(;3!==n.nextToken();){const t=n.currentString();if(n.nextToken(),"spatialReference"===t){if(s&&!u){u=!0,1===n.currentToken()?ie=h(n):10!==n.currentToken()&&(0,r.t)("failed to parse spatial reference: object or null is expected");continue}}else if(i)if("hasZ"===t){if(!m){m=!0,$=11===n.currentToken();continue}}else if("hasM"===t){if(!l){l=!0,ee=11===n.currentToken();continue}}else if("rings"===t){if(!(d||y||e!==r.G.enumUnknown&&e!==r.G.enumPolygon)){d=!0,({geometry:se,as:te,bs:ne}=_(!0,!1,0,n));continue}}else if("curveRings"===t){if(!y&&(e===r.G.enumUnknown||e===r.G.enumPolygon)){y=!0,({geometry:se,as:te,bs:ne}=_(!0,!0,0,n));continue}}else if("paths"===t){if(!(g||N||e!==r.G.enumUnknown&&e!==r.G.enumPolyline)){g=!0,({geometry:se,as:te,bs:ne}=_(!1,!1,0,n));continue}}else if("curvePaths"===t){if(!N&&(e===r.G.enumUnknown||e===r.G.enumPolyline)){N=!0,({geometry:se,as:te,bs:ne}=_(!1,!0,0,n));continue}}else if("points"===t){if(!T&&(e===r.G.enumUnknown||e===r.G.enumMultiPoint)){T=!0,({geometry:se,as:te,bs:ne}=f(0,n));continue}}else if("ids"===t){if(!c){c=!0,re=p(0,n);continue}}else if("x"===t){if(!v&&(e===r.G.enumUnknown||e===r.G.enumPoint)){v=!0,B=k(n);continue}}else if("y"===t){if(!x&&(e===r.G.enumUnknown||e===r.G.enumPoint)){x=!0,V=k(n);continue}}else if("z"===t){if(!A&&(e===r.G.enumUnknown||e===r.G.enumPoint)){A=!0,M=k(n);continue}}else if("m"===t){if(!S&&(e===r.G.enumUnknown||e===r.G.enumPoint)){S=!0,R=k(n);continue}}else if("id"===t){if(!w&&(e===r.G.enumUnknown||e===r.G.enumPoint)){w=!0,U=b(n);continue}}else if("xmin"===t){if(!C&&(e===r.G.enumUnknown||e===r.G.enumEnvelope)){C=!0,W=k(n);continue}}else if("ymin"===t){if(!D&&(e===r.G.enumUnknown||e===r.G.enumEnvelope)){D=!0,X=k(n);continue}}else if("mmin"===t){if(!O&&(e===r.G.enumUnknown||e===r.G.enumEnvelope)){O=!0,J=k(n);continue}}else if("zmin"===t){if(!z&&(e===r.G.enumUnknown||e===r.G.enumEnvelope)){z=!0,K=k(n);continue}}else if("idmin"===t){if(!P&&(e===r.G.enumUnknown||e===r.G.enumEnvelope)){P=!0,H=b(n);continue}}else if("xmax"===t){if(!F&&(e===r.G.enumUnknown||e===r.G.enumEnvelope)){F=!0,L=k(n);continue}}else if("ymax"===t){if(!j&&(e===r.G.enumUnknown||e===r.G.enumEnvelope)){j=!0,Y=k(n);continue}}else if("mmax"===t){if(!E&&(e===r.G.enumUnknown||e===r.G.enumEnvelope)){E=!0,Z=k(n);continue}}else if("zmax"===t){if(!I&&(e===r.G.enumUnknown||e===r.G.enumEnvelope)){I=!0,q=k(n);continue}}else if("idmax"===t){if(!G&&(e===r.G.enumUnknown||e===r.G.enumEnvelope)){G=!0,Q=b(n);continue}}else"materials"===t&&(0,r.g)(0);n.skipChildren()}if(d||y||g||N||T){let e=null,t=null;const n=se;$&&(se.addAttribute(1),e=te,e||(e=(0,a.F)(n.getPointCount(),Number.NaN))),ee&&(se.addAttribute(2),t=$?ne:te),null!=re&&se.addAttribute(3),$&&null!=e&&n.setAttributeStreamRef(1,e),ee&&null!=t&&n.setAttributeStreamRef(2,t),null!=re&&function(e,t){if(e.isEmpty())return;const n=(0,a.K)(2,0),i=e.getGeometryType();let s=0;i===o.M.type?s=1:i===o.P.type||i===o.a.type?s=e.getPathCount():(0,r.c)("not implemented"),n.resize(e.getPointCount(),0);let u=0;for(let a=0;a<s;++a){const s=t.read(u);u++;const m=u+s;let l=0,c=0;i===o.M.type?l=e.getPointCount():i===o.P.type||i===o.a.type?(l=e.getPathSize(a),c=e.getPathStart(a)):(0,r.c)("not implemented");for(let e=0,r=Math.min(s,l);e<r;++e)n.write(c,t.read(u)),u++,c++;u=m}e.getImpl().setAttributeStreamRef(3,n)}(n,re)}else if(v||x||S||A||w){(0,a.I)(B,V)||(0,r.t)("failed to parse point: x and y must be finite or nan"),(Number.isNaN(V)||Number.isNaN(B))&&(B=Number.NaN,V=Number.NaN);const e=new a.P({x:B,y:V});A&&e.setZ(M),S&&e.setM(R),w&&e.setID(U),se=e}else if(C||D||F||j||z||I||O||E||P||G){(Number.isNaN(X)||Number.isNaN(L)||Number.isNaN(Y))&&(W=Number.NaN);const e=new a.E({xmin:W,ymin:X,xmax:L,ymax:Y});z&&I&&e.setInterval(1,0,K,q),O&&E&&e.setInterval(2,0,J,Z),P&&G&&e.setInterval(3,0,H,Q),se=e}return{...se?{geom:se}:{},...ie?{sr:ie}:{}}}(t,0,c,i,u);return new s.aF(d)}importProjectionTransformation(e,t){return(0,r.g)(0),{}}importDatumTransformation(e,t){return(0,r.g)(0),{}}static stringToGeometryType(e){return(e=e.toLowerCase()).startsWith("esrigeometry")||(0,r.t)("string_to_geometry_type"),e.endsWith("point")?r.G.enumPoint:e.endsWith("envelope")?r.G.enumEnvelope:e.endsWith("multipoint")?r.G.enumMultiPoint:e.endsWith("polyline")?r.G.enumPolyline:e.endsWith("polygon")?r.G.enumPolygon:void(0,r.t)("string_to_geometry_type")}};function ae(e){return Array.isArray(e)?e[0].spatialReference:e.spatialReference}function oe(e,t){const n=new l(e,{strict:!1});return n.nextToken(),se.execute(0,r.G.enumUnknown,n,!0,t)}function ue(e){let t=null;return[e.map((e=>{if(null==t){const n=me(e);return t=n.getSpatialReference(),n.getGeometry()}return le(e)})),t]}function me(e){return oe(e,!0)}function le(e){return oe(e,!1).getGeometry()}function ce(e,t){return e instanceof s.aF&&(t=e.getSpatialReference(),e=e.getGeometry()),e?.isEmpty()?null:(re.reset(),ie.execute(0,e,t,re),re.getObject())}},90293:(e,t,n)=>{n(79187),n(55537),n(35368),n(95213),n(83661);var r=n(12189),i=n(83047),s=n(21325);(0,r.i)((e=>{let t,n;"number"==typeof e?t=e:n=e;const r={wkid:t,wkt:n};let a,o;if(n){a=(0,i.x1)(n);const e=(0,s.EA)(r);if(!a&&!e)throw new Error(`Unsupported WKT type: ${n}`)}else a=!(0,s.EA)(r);return o=t&&i.yD.has(t)?Math.PI/200:a?(0,i.Ao)(r):Math.PI/180,{isPCS:a,metersOrRadiansPerUnit:o,semiMajor:0,wkidOrWkt:e}}))}}]);
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[3299],{83299:(e,t,n)=>{n.r(t),n.d(t,{fromGeometries:()=>ue,fromGeometry:()=>me,fromGeometryToGXGeometry:()=>le,getSpatialReference:()=>ae,toGeometry:()=>ce});var r=n(55537),i=n(83661),s=n(12189),a=n(95213),o=n(35368);function u(){if(-1===this.m_i)return this.m_i=0,{value:{m_token:1,m_value:null},done:!1};if(this.m_i<this.m_keys.length){const e=this.m_bReturnKey,t=Math.trunc(this.m_i);return this.m_bReturnKey=!this.m_bReturnKey,this.m_i+=.5,e?{value:{m_token:5,m_value:this.m_keys[t]},done:!1}:{value:{m_token:6,m_value:this.m_o[this.m_keys[t]]},done:!1}}return{value:{m_token:3,m_value:null},done:!0}}function m(){if(-1===this.m_i)return this.m_i=0,{value:{m_token:2,m_value:null},done:!1};if(this.m_i<this.m_a.length){const e={value:{m_token:6,m_value:this.m_a[this.m_i++]},done:!1};return this.m_strict||void 0===e.value.m_value&&(e.value.m_value=Number.NaN),e}return{value:{m_token:4,m_value:null},done:!0}}n(90293);class l{createJSONObjectIterator(e){return{m_iteratorType:"object",m_o:e,m_keys:this.m_options.strict?Object.keys(e):Object.keys(e).filter((t=>void 0!==e[t])),m_i:-1,m_bReturnKey:!0,next:u}}createJSONArrayIterator(e){return{m_iteratorType:"array",m_strict:this.m_options.strict,m_i:-1,m_a:e,next:m}}constructor(e,t){this.m_currentToken=0,this.m_options=t?{...t}:{strict:!0};const n=e;this.m_iteratorStack=[n instanceof Array?this.createJSONArrayIterator(n):this.createJSONObjectIterator(n)],this.m_nextFlatToken={m_value:null,m_token:0}}nextToken(){if(0===this.m_iteratorStack.length)return this.m_currentToken=0;switch(this.m_nextFlatToken=this.m_iteratorStack.at(-1).next().value,this.m_currentValue=void 0,this.m_nextFlatToken.m_token){case 1:return this.m_currentToken=1;case 3:return this.m_iteratorStack.pop(),this.m_currentToken=3;case 2:return this.m_currentToken=2;case 4:return this.m_iteratorStack.pop(),this.m_currentToken=4;case 5:return this.m_currentValue=this.m_nextFlatToken.m_value,this.m_currentToken=5;case 6:if(this.m_nextFlatToken.m_value instanceof Array)return this.m_iteratorStack.push(this.createJSONArrayIterator(this.m_nextFlatToken.m_value)),this.nextToken();if(this.m_nextFlatToken.m_value instanceof Object)return this.m_iteratorStack.push(this.createJSONObjectIterator(this.m_nextFlatToken.m_value)),this.nextToken();if("number"==typeof this.m_nextFlatToken.m_value)return this.m_currentValue=this.m_nextFlatToken.m_value,Number.isSafeInteger(this.m_currentValue)&&this.m_currentValue>=(0,i.ao)()&&this.m_currentValue<=(0,i.i)()?this.m_currentToken=8:this.m_currentToken=7;if("string"==typeof this.m_nextFlatToken.m_value)return this.m_currentValue=this.m_nextFlatToken.m_value,this.m_currentToken=6;if("boolean"==typeof this.m_nextFlatToken.m_value)return this.m_currentValue=this.m_nextFlatToken.m_value,this.m_currentToken=this.m_nextFlatToken.m_value?11:12;if("object"==typeof this.m_nextFlatToken.m_value)return this.m_currentValue=null,this.m_currentToken=10;(0,r.c)("unrecognized json element type")}return(0,r.c)("unrecognized json element type"),0}currentToken(){return this.m_currentToken}skipChildren(){if(0!==this.m_iteratorStack.length)switch(this.m_currentValue=void 0,this.m_nextFlatToken.m_token){case 1:return this.m_iteratorStack.pop(),this.m_nextFlatToken.m_token=3,void(this.m_currentToken=3);case 2:return this.m_iteratorStack.pop(),this.m_nextFlatToken.m_token=4,void(this.m_currentToken=4)}}currentString(){return 6!==this.m_currentToken&&5!==this.m_currentToken&&(0,r.t)("invalid token"),this.m_currentValue}currentDoubleValue(){return 7!==this.m_currentToken&&8!==this.m_currentToken&&(0,r.t)("invalid token"),this.m_currentValue}currentInt32Value(){return 8!==this.m_currentToken&&(0,r.t)("invalid token"),this.m_currentValue}currentInt64Value(){return(0,r.g)(0),0n}currentBoolValue(){return 12!==this.m_currentToken&&11!==this.m_currentToken&&(0,r.t)("invalid token"),this.m_currentValue}isError(){return 0}}class c{constructor(e){return this.m_buffer=null,this.m_view=null,this.m_sz=0,this.m_offset=0,this.m_bOwnsBuffer=!0,this.m_bLittleEndian=!0,this.m_element=new ArrayBuffer(8),this.m_elementBytes=new Uint8Array(this.m_element),this.m_elementView=new DataView(this.m_element),this.m_elementDouble=new Float64Array(this.m_element),this.m_elementFloat=new Float32Array(this.m_element),this.m_elementInt64=new BigInt64Array(this.m_element),this.m_elementInt32=new Int32Array(this.m_element),this.m_elementInt16=new Int16Array(this.m_element),void 0!==e.sz?(this.m_sz=e.sz,e.buffer?(this.m_sz<0&&(0,r.n)("size out of range"),this.m_buffer=e.buffer,this.m_offset=void 0!==e.offset?e.offset:0,this.m_view=void 0!==e.offset?new DataView(e.buffer,e.offset,e.sz):new DataView(this.m_buffer),this.m_bOwnsBuffer=!1,void(this.m_bLittleEndian=!0)):(this.m_sz<0&&(0,r.n)("size out of range"),void(this.m_sz>0&&(this.m_buffer=new ArrayBuffer(this.m_sz),this.m_view=new DataView(this.m_buffer))))):e.move?(this.m_sz=e.move.m_sz,this.m_buffer=e.move.m_buffer,this.m_view=e.move.m_view,this.m_bOwnsBuffer=e.move.m_bOwnsBuffer,this.m_bLittleEndian=e.move.m_bLittleEndian,e.move.m_buffer=null,e.move.m_view=null,e.move.m_sz=0,void(e.move.m_bOwnsBuffer=!0)):void(0,r.c)("unrecognized constructor options")}swapBytesDouble(){this.doSwap()&&(this.m_elementDouble[0]=this.m_elementBytes[0]<<56|this.m_elementBytes[1]<<48|this.m_elementBytes[2]<<40|this.m_elementBytes[3]<<32|this.m_elementBytes[4]<<24|this.m_elementBytes[5]<<16|this.m_elementBytes[6]<<8|this.m_elementBytes[7])}swapBytesInt32(){this.doSwap()&&(this.m_elementInt32[0]=this.m_elementBytes[0]<<24|this.m_elementBytes[1]<<16|this.m_elementBytes[2]<<8|this.m_elementBytes[3])}getOffset(){return this.m_offset}assignMove(e){return this===e||(this.clear(),this.m_sz=e.m_sz,this.m_buffer=e.m_buffer,this.m_view=e.m_view,this.m_bOwnsBuffer=e.m_bOwnsBuffer,this.m_bLittleEndian=e.m_bLittleEndian,e.m_buffer=null,e.m_sz=0,e.m_bOwnsBuffer=!0),this}doSwap(){return this.m_bLittleEndian!==(1===c.getNativeByteOrder())}setNativeByteOrder(){this.m_bLittleEndian=1===c.getNativeByteOrder()}setOrder(e){this.m_bLittleEndian=1===e}getOrder(){return this.m_bLittleEndian?1:0}getView(){return this.m_view||(0,r.m)("buffer not defined"),this.m_view}static getNativeByteOrder(){return 1}clear(){this.m_buffer=null,this.m_sz=0,this.m_bOwnsBuffer=!0}size(){return this.m_sz}readDouble(e){return this.doSwap()?(this.m_elementDouble[0]=this.m_view.getFloat64(e,this.m_bLittleEndian),this.swapBytesDouble(),this.m_elementDouble[0]):this.m_view.getFloat64(e,this.m_bLittleEndian)}writeDouble(e,t){this.m_elementDouble[0]=t,this.swapBytesDouble(),this.m_view.setFloat64(e,this.m_elementDouble[0],this.m_bLittleEndian)}readInt32(e){return this.doSwap()?(this.m_elementInt32[0]=this.m_view.getInt32(e,this.m_bLittleEndian),this.swapBytesInt32(),this.m_elementInt32[0]):this.m_view.getInt32(e,this.m_bLittleEndian)}writeInt32(e,t){this.m_elementInt32[0]=t,this.swapBytesInt32(),this.m_view.setInt32(e,this.m_elementInt32[0],this.m_bLittleEndian)}getPtr(){return this.m_buffer}setSizeNoRealloc(e){(0,r.g)(e>=0&&e<=this.m_sz),this.m_sz=e}}function d(e){let t=!1;for(;3!==e.nextToken();){const n=e.currentString();e.nextToken(),"uwkid"===n?t||(t=!0,8===e.currentToken()&&e.currentInt32Value()):e.skipChildren()}return null}function h(e){let t=!1,n=!1,r=!1,i=!1,a=!1,o=!1,u=!1,m=!1,l=!1,c=!1,h=!1,_=!1,f=!1,p=!1,k=!1,b=!1,y=!1,g=-1,N=-1,T=-1,v=-1,x=0,A=0,S=0,w=0,C=0,D=0,F=0,j=0,z=0,I=0,O="",E="",P=null;for(;3!==e.nextToken();){const s=e.currentString();e.nextToken(),"wkid"===s?t||(t=!0,8===e.currentToken()&&(g=e.currentInt32Value())):"latestWkid"===s?n||(n=!0,8===e.currentToken()&&(N=e.currentInt32Value())):"wkt"===s?a||(a=!0,6===e.currentToken()&&(O=e.currentString())):"wkt2"===s?a||6===e.currentToken()&&(E=e.currentString()):"vcsWkid"===s?r||(r=!0,8===e.currentToken()&&(T=e.currentInt32Value())):"latestVcsWkid"===s?i||(i=!0,8===e.currentToken()&&(v=e.currentInt32Value())):"xyTolerance"===s?u||(u=!0,o=!0,x=e.currentDoubleValue()):"zTolerance"===s?m||(m=!0,o=!0,A=e.currentDoubleValue()):"mTolerance"===s?l||(l=!0,o=!0,S=e.currentDoubleValue()):"falseX"===s?c||(c=!0,o=!0,F=e.currentDoubleValue()):"falseY"===s?h||(h=!0,o=!0,j=e.currentDoubleValue()):"falseZ"===s?_||(_=!0,o=!0,z=e.currentDoubleValue()):"falseM"===s?f||(f=!0,o=!0,I=e.currentDoubleValue()):"xyUnits"===s?p||(p=!0,o=!0,w=e.currentDoubleValue()):"zUnits"===s?k||(k=!0,o=!0,C=e.currentDoubleValue()):"mUnits"===s?b||(b=!0,o=!0,D=e.currentDoubleValue()):"unit"===s?y||(y=!0,P=d(e)):e.skipChildren()}v<=0&&T>0&&(v=T),T<=0&&v>0&&(T=v);let G=null,B=!0;if(0!==O.length&&(B=!1,(0,s.aA)(O)&&(G=(0,s.b)(O))),G||0===E.length||(B=!1,(0,s.aA)(E)&&(G=(0,s.b)(E))),!G&&N>0&&(B=!1,(0,s.aB)(N)&&(v<=0||(0,s.aC)())&&(G=(0,s.c)(N,v))),!G&&g>0&&(B=!1,(0,s.aB)(g)&&(T<=0||(0,s.aC)())&&(G=(0,s.c)(g,T))),B&&(G=(0,s.z)(P)),o&&G){const e=new s.aE;G.queryPrecisionDescriptorWithoutFalseXY(e),u&&e.setTolerance(0,x),m&&e.setTolerance(1,A),l&&e.setTolerance(2,S),p&&c&&h&&e.setGridParams(F,j,w),k&&_&&e.setZParams(z,C),b&&f&&e.setMParams(I,D),G=(0,s.aD)(G,e)}return G}function _(e,t,n,s){2!==s.currentToken()&&(0,r.t)("failed to parse multipath: array of array of vertices is expected");const u=e?new o.a:new o.P,m=u,l=(0,a.z)(0),c=(0,a.F)(2,0),d=(0,a.D)(0);let h=null,_=null,f=null,p=null,b=null,T=0,v=0,x=0;const A=new o.S,S=i.P.getNAN();let w=0,C=0;const D=e?1:0;for(;4!==s.nextToken();){2!==s.currentToken()&&(0,r.t)("failed to parse multipath: ring/path array is expected");let n=2,u=0,F=!0;const j=4;let z=0,I=0;const O=i.P.getNAN(),E=(0,i.d)(j,Number.NaN),P=(0,i.d)(j,Number.NaN);let G=!1;for(s.nextToken();4!==s.currentToken();){if(t&&1===s.currentToken())F&&(0,r.t)("failed to parse multipath: starting vertex array is expected"),f||(f=(0,a.D)(w-1,1),p=(0,a.z)(w-1,-1),b=(0,a.F)(0)),G=!0,n=1,({segFlag:x,toPointSz:z}=N(A,E,S,s));else{for(G=!1,2!==s.currentToken()&&(0,r.t)("failed to parse multipath: array is expected, rings/paths vertices consist of arrays of coordinates"),z=0;4!==s.nextToken();)z===j&&(0,r.t)("failed to parse multipath: each vertex array has to have at most 4 elements"),E[z++]=k(s);z<2&&(0,r.t)("failed to parse multipath: each vertex array has to have at least 2 elements"),(0,a.J)(E[0],E[1])||(0,r.t)("failed to parse multipath: x and y must be finite")}s.nextToken();do{if(c.size()===2*w&&c.resize(y(w)),c.writePoint2D(2*w,O.setCoords(E[0],E[1])),h&&h.size()===w&&h.resize(g(w)),z>2?(h||(h=(0,a.F)(w+1,Number.NaN)),h.write(w,E[2])):h&&h.write(w,Number.NaN),_&&_.size()===w&&_.resize(g(w)),z>3?(_||(_=(0,a.F)(w+1,Number.NaN)),_.write(w,E[3])):_&&_.write(w,Number.NaN),F)C++,l.add(w),d.add(D),F=!1,I=z,(0,i.a)(P,E,0,0,I);else if(null!==f)if(G){const e=(0,o.A)(x),t=b.size();b.resize(t+e),f.add(x),p.add(T),A.get().writeInBufferStream(b,T),T+=e,m.incCurveType(x,1),v++}else f.add(1),p.add(-1);w++,u++,S.setCoords(E[0],E[1])}while(u<n&&4===s.currentToken())}0!==u&&(e&&u>n&&z===I&&0===(0,i.ap)(E,P,z)?(w--,u--):null!==f&&(f.add(1),p.add(-1)))}return w&&(l.resize(C),d.resize(C),w>0&&(l.add(w),d.add(0)),m.setAttributeStreamRef(0,c),m.setPathFlagsStreamRef(d),m.setPathStreamRef(l),null!==f&&(m.updateCurveCounter(v),m.setSegmentData(p,b,f,T)),m.notifyModifiedFlags(65535)),{geometry:u,as:h,bs:_}}function f(e,t){2!==t.currentToken()&&(0,r.t)("failed to parse multipoint: array of vertices is expected");let n=0;const s=new o.M,u=(0,a.F)(2,0);let m=0;const l=(0,i.d)(4,Number.NaN),c=new i.P;let d=null,h=null;for(;4!==t.nextToken();){for(2!==t.currentToken()&&(0,r.t)("failed to parse multipoint: array is expected, multipoint vertices consist of arrays of cooridinates"),m=0;4!==t.nextToken();)4===m&&(0,r.t)("failed to parse multipoint: each vertex array has to have at most 4 elements"),l[m++]=k(t);m<2&&(0,r.t)("failed to parse multipoint: each vertex array has to have at least 2 elements"),(0,a.J)(l[0],l[1])||(0,r.t)("failed to parse multipoint: x and y must be finite"),u.size()===2*n&&u.resize(y(n)),u.writePoint2D(2*n,c.setCoords(l[0],l[1])),d&&d.size()===n&&d.resize(g(n)),m>2?(d||(d=(0,a.F)(n+1,Number.NaN)),d.write(n,l[2])):d&&d.write(n,Number.NaN),h&&h.size()===n&&h.resize(g(n)),m>3?(h||(h=(0,a.F)(n+1,Number.NaN)),h.write(n,l[3])):h&&h.write(n,Number.NaN),n++}if(n){const e=s.getImpl();e.setAttributeStreamRef(0,u),e.resizeNoInit(n),e.notifyModifiedFlags(65535)}return{geometry:s,as:d,bs:h}}function p(e,t){2!==t.currentToken()&&(0,r.t)("failed to parse array of IDs: array of array of integers is expected");const n=(0,a.K)(2,0);let i=0,s=-1;for(;4!==t.nextToken();){const e=i;n.size()===i&&n.resize(g(i)),i++;let a=0;for(-1===s?s=2===t.currentToken()?1:0:1===s&&2!==t.currentToken()&&(0,r.t)("failed to parse array of IDs: array of array of integers is expected"),0===s&&(n.size()===i&&n.resize(g(i)),n.write(i,b(t)),a++,i++);4!==t.nextToken();)n.size()===i&&n.resize(g(i)),n.write(i,b(t)),a++,i++;if(n.write(e,a),0===s)break}return n.resize(i),n}function k(e){const t=e.currentToken();if(10===t||6===t&&"NaN"===e.currentString())return Number.NaN;{const t=e.currentDoubleValue();return Number.isNaN(t)?Number.NaN:t}}function b(e){return e.currentInt32Value()}function y(e){let t=2*Math.trunc(3*(e+1)/2);return t<8?t=8:t<32&&(t=32),t}function g(e){let t=Math.trunc(3*(e+1)/2);return t<4?t=4:t<16&&(t=16),t}function N(e,t,n,s,a){const u={segFlag:0,toPointSz:0};let m=s.currentToken();m=s.nextToken();const l=s.currentString(),d=l[0];for((1!==l.length||"a"!==d&&"b"!==d&&"c"!==d&&"n"!==d&&"q"!==d)&&(0,r.t)('failed to parse curve: expecting "a", "b", "n", "q", or "c"'),m=s.nextToken(),2!==m&&(0,r.t)("failed to parse curve: start array is expected for curve parameters"),m=s.nextToken(),2!==m&&(0,r.t)("failed to parse curve: start array is expected for to point"),u.toPointSz=0;4!==s.nextToken();)4===u.toPointSz&&(0,r.t)("failed to parse curve: vertex array cannot have more than 4 elements"),t[u.toPointSz++]=k(s);u.toPointSz<2&&(0,r.t)("failed to parse curve: vertex array must have at least 2 elements");const h=i.P.construct(t[0],t[1]),_=i.P.getNAN();let f=-1,p=-1,b=!1,y=Number.NaN,g=Number.NaN,N=Number.NaN;const v=[i.P.getNAN(),i.P.getNAN(),i.P.getNAN()],x=i.P.getNAN();if("a"===d){m=s.nextToken(),2!==m&&(0,r.t)("failed to parse curve: start array is expected for center point"),m=s.nextToken();const e=k(s);m=s.nextToken();const t=k(s);m=s.nextToken(),4!==m&&(0,r.t)("failed to parse curve: end array is expected for center point"),_.setCoords(e,t),m=s.nextToken(),f=s.currentInt32Value(),m=s.nextToken(),p=s.currentInt32Value(),m=s.nextToken(),4!==m?(b=!1,y=k(s),m=s.nextToken(),g=k(s),m=s.nextToken(),N=k(s),m=s.nextToken(),4!==m&&(0,r.t)("failed to parse curve: end array is expected for curve parameters")):b=!0,u.segFlag=4}else if("b"===d){for(let e=0;e<2;e++){m=s.nextToken(),2!==m&&(0,r.t)("failed to parse curve: start array is expected for control point"),m=s.nextToken();const t=k(s);m=s.nextToken();const n=k(s);m=s.nextToken(),4!==m&&(0,r.t)("failed to parse curve: end array is expected for control point"),v[e].setCoords(t,n)}m=s.nextToken(),4!==m&&(0,r.t)("failed to parse curve: end array is expected for curve parameters"),u.segFlag=2}else if("n"===d){{m=s.nextToken(),2!==m&&(0,r.t)("failed to parse curve: start array is expected for control point"),m=s.nextToken();const e=k(s);m=s.nextToken();const t=k(s);m=s.nextToken(),4!==m&&(0,r.t)("failed to parse curve: end array is expected for control point"),v[0].setCoords(e,t)}m=s.nextToken();const e=k(s);m=s.nextToken();const t=k(s);m=s.nextToken();const n=k(s);v[1].setCoords(e,t),v[2].setCoords(n,n),m=s.nextToken(),4!==m&&(0,r.t)("failed to parse curve: end array is expected for curve parameters"),u.segFlag=8}else if("q"===d){for(let e=0;e<1;e++){m=s.nextToken(),2!==m&&(0,r.t)("failed to parse curve: start array is expected for control point"),m=s.nextToken();const t=k(s);m=s.nextToken();const n=k(s);m=s.nextToken(),4!==m&&(0,r.t)("failed to parse curve: end array is expected for control point"),v[e].setCoords(t,n)}m=s.nextToken(),4!==m&&(0,r.t)("failed to parse curve: end array is expected for curve parameters"),u.segFlag=16}else{m=s.nextToken(),2!==m&&(0,r.t)("failed to parse curve: start array is expected for interior point"),m=s.nextToken();const e=k(s);m=s.nextToken();const t=k(s);m=s.nextToken(),4!==m&&(0,r.t)("failed to parse curve: end array is expected for interior point"),x.setCoords(e,t),m=s.nextToken(),4!==m&&(0,r.t)("failed to parse curve: end array is expected for curve parameters"),u.segFlag=4}if(m=s.nextToken(),3!==m&&(0,r.t)("failed to parse curve: end object is expected for curve"),"a"===d)if(e.createEllipticArc(),b){const t=!0;T(e.get(),n,h,_,t,f,p)}else!function(e,t,n,r,i,s,a,u,m){e.dropAllAttributes();const l=new ArrayBuffer(44),d=new c({sz:44,buffer:l});let h=0;d.writeDouble(h,r.x),h+=8,d.writeDouble(h,r.y),h+=8,d.writeDouble(h,a),h+=8,d.writeDouble(h,u),h+=8,d.writeDouble(h,m),h+=8;let _=0;s||(_|=2048),i&&(_|=4096),d.writeInt32(h,_),h+=4,function(e,t,n,r){e.m_bits=0,e.m_center.x=r.readDouble(0),e.m_center.y=r.readDouble(8),e.m_rotation=r.readDouble(16),e.m_semiMajorAxis=r.readDouble(24),e.m_minorMajorRatio=r.readDouble(32),e.m_XStart=t.x,e.m_YStart=t.y,e.m_XEnd=n.x,e.m_YEnd=n.y;const i=r.readInt32(40);if(1&i)return!1;let s=!!(64&i),a=!!(128&i);const u=!!(2048&i),m=!!(4096&i);!(512&i)&&!(1024&i)||a||(s=!0),a&&!t.equals(n)?(a=!1,s=!0):s&&t.equals(n)&&(a=!0,s=!1),a?(e.m_center.assign(t),e.m_startAngle=e.m_center.x,e.m_sweepAngle=e.m_center.y,(0,o.z)(e,Number.NaN,u,m),e.m_semiMajorAxis=0,e.m_interior.setCoordsPoint2D(t)):s?(e.m_center.setNAN(),e.m_semiMajorAxis=1,e.m_minorMajorRatio=0,e.m_center.setNAN(),e.m_sweepAngle=0,e.m_startAngle=0,(0,o.x)(e),e.queryCoord2D(.5,e.m_interior)):e.constructEllipticArcEndPointsCenter(t,n,e.m_semiMajorAxis,e.m_minorMajorRatio,e.m_rotation,!m,u,e.m_center),e.setProjectionBehavior(1),(0,o.x)(e)}(e,t,n,d)}(e.get(),n,h,_,f,p,y,g,N);else if("b"===d)e.createCubicBezier(),function(e,t,n,s){e.dropAllAttributes();const a=new ArrayBuffer(32),o=new c({sz:32,buffer:a});let u=0;o.writeDouble(u,s[0].x),u+=8,o.writeDouble(u,s[0].y),u+=8,o.writeDouble(u,s[1].x),u+=8,o.writeDouble(u,s[1].y),u+=8,function(e,t,n,s){(0,r.g)(32<=s.size()),e.m_cp=(0,i.m)(i.P,2),e.m_cp[0].x=s.readDouble(0),e.m_cp[0].y=s.readDouble(8),e.m_cp[1].x=s.readDouble(16),e.m_cp[1].y=s.readDouble(24),e.m_XStart=t.x,e.m_YStart=t.y,e.m_XEnd=n.x,e.m_YEnd=n.y}(e,t,n,o)}(e.get(),n,h,v);else if("n"===d)e.createQuadraticRationalBezier(),function(e,t,n,r,i,s,a){e.dropAllAttributes();const o=new ArrayBuffer(40),u=new c({sz:40,buffer:o});let m=0;u.writeDouble(m,r.x),m+=8,u.writeDouble(m,r.y),m+=8,u.writeDouble(m,i),m+=8,u.writeDouble(m,s),m+=8,u.writeDouble(m,a),m+=8,function(e,t,n,r){e.m_cp.x=r.readDouble(0),e.m_cp.y=r.readDouble(8),e.m_weights[0]=r.readDouble(16),e.m_weights[1]=r.readDouble(24),e.m_weights[2]=r.readDouble(32),e.m_XStart=t.x,e.m_YStart=t.y,e.m_XEnd=n.x,e.m_YEnd=n.y}(e,t,n,u)}(e.get(),n,h,v[0],v[1].x,v[1].y,v[2].x);else if("q"===d)e.createQuadraticBezier(),e.get().construct(n,v[0],h);else{e.createEllipticArc();const t=!1;T(e.get(),n,h,x,t,-1,-1)}return u}function T(e,t,n,s,a,u,m){e.dropAllAttributes();const l=new ArrayBuffer(20),d=new c({sz:20,buffer:l});let h=0;d.writeDouble(h,s.x),h+=8,d.writeDouble(h,s.y),h+=8;let _=0;a?(m||(_|=8),u&&(_|=16)):_|=128,d.writeInt32(h,_),h+=4,function(e,t,n,s){0>=s.size()&&(0,r.n)("Byte_buffer out of range access"),e.m_bits=0,e.m_rotation=0,e.m_cosr=1,e.m_sinr=0,e.setStartXY(t),e.setEndXY(n);const a=i.P.getNAN();a.x=s.readDouble(0),a.y=s.readDouble(8);const u=s.readInt32(16);if(1&u)return e.m_semiMajorAxis=0,e.m_minorMajorRatio=1,e.m_interior.assign(a),e.m_center.setNAN(),e.m_sweepAngle=0,e.m_startAngle=0,(0,o.x)(e),!1;let m=!!(64&u);const l=!!(128&u);let c=!!(32&u);const d=!!(8&u),h=!!(16&u),_=t.equals(n);m&&!_&&(m=!1,c=!0),c&&_&&(m=!0,c=!1,a.setCoords(0,0)),m||(l?c?(e.m_semiMajorAxis=1,e.m_minorMajorRatio=0,e.m_interior.assign(a),e.m_center.setNAN(),e.m_sweepAngle=0,e.m_startAngle=0):(e.constructCircularArcThreePoint(t,n,a),_&&d===e.isClockwise()&&e.reverse()):c?(e.m_semiMajorAxis=1,e.m_minorMajorRatio=0,e.m_center.setNAN(),e.m_sweepAngle=0,e.m_startAngle=0,(0,o.x)(e),e.queryCoord2D(.5,e.m_interior)):(0,o.y)(e,t,n,a,d,h)),m&&(e.m_center.assign(t),e.m_startAngle=a.x,e.m_sweepAngle=a.y,(0,o.z)(e,Number.NaN,d,h),e.m_semiMajorAxis=0,e.m_minorMajorRatio=1,e.m_interior.setCoordsPoint2D(t)),e.setProjectionBehavior(0),(0,o.x)(e)}(e,t,n,d)}function v(e,t,n,i,s){const a=e.getGeometryType();if(a===r.G.enumEllipticArc)return function(e,t,n,i,s){(0,r.g)(!(0,o.w)(e));const a=e.getEndXY(),u=e.hasAttribute(1)&&!t,m=e.hasAttribute(2)&&!n;let l=Number.NaN,c=Number.NaN;if(u&&(l=e.getEndAttributeAsDbl(1,0)),m&&(c=e.getEndAttributeAsDbl(2,0)),e.isDegenerateToLine()||e.isDegenerate(0))return A(u,m,a.x,a.y,l,c,i,s),!0;const d=0===e.projectionBehavior(),h=!!d&&e.isClosed();if(d&&!h)s.startObject(),s.addFieldName("c"),s.startArray(),A(u,m,a.x,a.y,l,c,i,s),S(e.m_interior.x,e.m_interior.y,17,s),s.endArray(),s.endObject();else if(d){s.startObject(),s.addFieldName("a"),s.startArray(),A(u,m,a.x,a.y,l,c,i,s);const t=0,n=0;S(e.m_center.x+t,e.m_center.y+n,17,s);const r=!e.isMajor();s.addInt32(r?1:0);const o=e.isClockwise();s.addInt32(o?1:0),s.endArray(),s.endObject()}else{s.startObject(),s.addFieldName("a"),s.startArray(),A(u,m,a.x,a.y,l,c,i,s);const t=e;S(t.m_center.x,t.m_center.y,17,s);const n=!t.isMajor();s.addInt32(n?1:0);const r=t.isClockwise();s.addInt32(r?1:0),s.addDouble(t.m_rotation,17),s.addDouble(t.m_semiMajorAxis,17),s.addDouble(t.m_minorMajorRatio,17),s.endArray(),s.endObject()}return!1}(e,t,n,i,s);if(a===r.G.enumBezier)return x(e,t,n,i,s);if(a===r.G.enumRationalBezier2)return function(e,t,n,r,i){const s=e.getEndXY(),a=e.hasAttribute(1)&&!t,o=e.hasAttribute(2)&&!n;let u=Number.NaN,m=Number.NaN;a&&(u=e.getEndAttributeAsDbl(1,0)),o&&(m=e.getEndAttributeAsDbl(2,0)),i.startObject(),i.addFieldName("n"),i.startArray(),A(a,o,s.x,s.y,u,m,r,i),S(e.m_cp.x,e.m_cp.y,r,i);const l=r;return i.addDouble(e.m_weights[0],l),i.addDouble(e.m_weights[1],l),i.addDouble(e.m_weights[2],l),i.endArray(),i.endObject(),!1}(e,t,n,i,s);if(a===r.G.enumBezier2){const r=new o.C;return r.constructFromQuadraticSegment(e),x(r,t,n,i,s)}(0,r.b)("")}function x(e,t,n,r,i){const s=e.getEndXY(),a=e.hasAttribute(1)&&!t,o=e.hasAttribute(2)&&!n;let u=Number.NaN,m=Number.NaN;return a&&(u=e.getEndAttributeAsDbl(1,0)),o&&(m=e.getEndAttributeAsDbl(2,0)),i.startObject(),i.addFieldName("b"),i.startArray(),A(a,o,s.x,s.y,u,m,r,i),S(e.m_cp[0].x,e.m_cp[0].y,r,i),S(e.m_cp[1].x,e.m_cp[1].y,r,i),i.endArray(),i.endObject(),!1}function A(e,t,n,r,i,s,a,o){o.startArray(),o.addDouble(n,a),o.addDouble(r,a),e&&o.addDouble(i,a),t&&o.addDouble(s,a),o.endArray()}function S(e,t,n,r){r.startArray(),r.addDouble(e,n),r.addDouble(t,n),r.endArray()}function w(e,t,n,i){const s=n.getImpl(),u=!!(2&t),m=!!(4&t),l=!!(8&t),c=s.hasAttribute(1)&&!u,d=s.hasAttribute(2)&&!m,h=s.hasAttribute(3)&&!l,_=s.hasNonLinearSegments();c&&(i.addFieldName("hasZ"),i.addBool(!0)),d&&(i.addFieldName("hasM"),i.addBool(!0)),e?_?i.addFieldName("curveRings"):i.addFieldName("rings"):_?i.addFieldName("curvePaths"):i.addFieldName("paths");let f=null;const p=[];if(n.isEmpty())i.startArray(),i.endArray();else{const e=17-(31&t>>13);i.startArray();const l=n.getPathCount();let k=0;const b=s.getAttributeStreamRef(0);let y=null,g=null,N=null;const T=new o.S;let x=null,A=null,S=null;_&&(x=s.getSegmentFlagsStreamRef(),A=s.getSegmentIndexStreamRef(),S=s.getSegmentDataStreamRef()),c&&(y=s.getAttributeStreamRef(1)),d&&(g=s.getAttributeStreamRef(2)),h&&(N=s.getAttributeStreamRef(3),f=(0,a.t)(3,0));for(let t=0;t<l;t++){i.startArray(),h&&p.push(0);const s=n.getPathEnd(t);if(k===s){i.endArray();continue}const a=n.isClosedPath(t);let o=b.read(2*k),l=b.read(2*k+1),_=c?y.read(k):Number.NaN,w=d?g.read(k):Number.NaN,D=h?N.read(k):0;C(c,d,o,l,_,w,e,i);let F=1;h&&(f.add(D),p[p.length-1]++);const j=o,z=l,I=_,O=w,E=D;let P=!1,G=0,B=Number.NaN,V=Number.NaN,M=0;for(let t=k+1,n=k,R=a?s+1:s;t<R;t++,n++){const a=null!==x?31&x.read(n):1;let k,R;if(t<s?(k=b.read(2*t),R=b.read(2*t+1),c&&(B=y.read(t)),d&&(V=g.read(t)),h&&(M=N.read(t))):(k=j,R=z,B=I,V=O,M=E),1!==a){P=!0,4===a?T.createEllipticArc():2===a?T.createCubicBezier():16===a?T.createQuadraticBezier():8===a?T.createQuadraticRationalBezier():(0,r.b)("JSON export.unsupported curve");const t=T.get(),s=A.read(n);t.setStartXYCoords(o,l),t.setEndXYCoords(k,R),c&&(t.setStartAttribute(1,0,_),t.setEndAttribute(1,0,B)),d&&(t.setStartAttribute(2,0,w),t.setEndAttribute(2,0,V)),t.readFromBufferStream(S,s),v(T.get(),u,m,e,i)&&G++}else C(c,d,k,R,B,V,e,i);h&&(f.add(M),p[p.length-1]++),F++,o=k,l=R,_=B,w=V,D=M}P&&0===G||(F<2&&G<1&&(C(c,d,o,l,_,w,e,i),F++,h&&(f.add(D),p[p.length-1]++)),a&&F<3&&G<2&&(C(c,d,j,z,I,O,e,i),F++,o=j,l=z,_=I,w=O,D=E,h&&(f.add(E),p[p.length-1]++))),i.endArray(),k=s}i.endArray()}if(h){i.addFieldName("ids"),i.startArray();let e=0;for(let t=0,n=p.length;t<n;++t){const n=p[t];(0,r.g)(0===n||null!==f&&e+n<=f.size()),i.startArray();for(let t=0;t<n;++t)i.addInt32(f.read(e)),e++;i.endArray()}i.endArray()}}function C(e,t,n,r,i,s,a,o){o.startArray(),o.addDouble(n,a),o.addDouble(r,a),e&&o.addDouble(i,a),t&&o.addDouble(s,a),o.endArray()}const D="a".charCodeAt(0),F="A".charCodeAt(0),j="*".charCodeAt(0),z="b".charCodeAt(0),I=("\b".charCodeAt(0),"\\".charCodeAt(0)),O="[".charCodeAt(0),E="{".charCodeAt(0),P=":".charCodeAt(0),G=".".charCodeAt(0),B=",".charCodeAt(0),V='"'.charCodeAt(0),M="]".charCodeAt(0),R="}".charCodeAt(0),U="e".charCodeAt(0),W="E".charCodeAt(0),X="f".charCodeAt(0),L=("\f".charCodeAt(0),"F".charCodeAt(0)),Y="/".charCodeAt(0),K=("<".charCodeAt(0),"-".charCodeAt(0)),q="+".charCodeAt(0),J="n".charCodeAt(0),Z="N".charCodeAt(0),H=("\n".charCodeAt(0),"r".charCodeAt(0)),Q=("\r".charCodeAt(0),"t".charCodeAt(0)),$=("\t".charCodeAt(0),"u".charCodeAt(0)),ee="0".charCodeAt(0),te="9".charCodeAt(0);class ne{constructor(e){this.m_functionStack=[],this.m_pushPositions=[],this.m_utf8Decoder=new TextDecoder("utf-8",{fatal:!0}),void 0===e?(this.m_startToken=Number.MAX_SAFE_INTEGER,this.m_endToken=0,this.m_currentTokenType=0,this.m_functionStack.push((()=>this.accept_())),this.m_jsonString=null,this.m_bHasEscapes=!1):e.jsonString?this.resetParserFromString(e.jsonString):e.jsonStream?(0,r.b)("streaming json parsing not yet impl"):(0,r.c)("invalid constructor parameter")}prepSubstrString_(){}getCurrentSubstrString_(){return this.m_jsonString.slice(this.m_startToken,this.m_endToken)}stepOverCharString_(){this.m_endToken++}peekCharString_(){return this.m_jsonString.charCodeAt(this.m_endToken)}getString_(e){const t=this.m_jsonString?.slice(this.m_startToken,this.m_startToken+e-1);return this.m_endToken+=e-1,{s:t,bDone:this.m_endToken>=this.m_jsonString.length}}incrementString_(){this.m_endToken++}eofString_(){return this.m_endToken>=this.m_jsonString.length}setStringFunctions_(){this.m_prepSubstr=this.prepSubstrString_,this.m_getCurrentSubstr=this.getCurrentSubstrString_,this.m_stepOverChar=this.stepOverCharString_,this.m_peekChar=this.peekCharString_,this.m_get=this.getString_,this.m_increment=this.incrementString_,this.m_eof=this.eofString_}setStreamFunctions_(){(0,r.b)("streaming json parsing not yet impl")}reset_(){this.m_jsonString=null,this.m_endToken=0,this.m_startToken=Number.MAX_SAFE_INTEGER,this.m_currentTokenType=0,this.m_bHasEscapes=!1,this.m_functionStack.length=0,this.m_functionStack.push((()=>this.start_())),this.m_pushPositions.length=0}resetParserFromString(e){this.reset_(),this.setStringFunctions_(),this.m_jsonString=e}resetParserFromStream(e){(0,r.b)("streaming json parsing not yet impl")}resetToPosition(e){return!!this.m_jsonString&&(this.m_endToken=e,this.m_startToken=Number.MAX_VALUE,this.m_currentTokenType=0,this.m_functionStack.length=0,e>=this.m_jsonString.length?(this.m_functionStack.push((()=>this.accept_())),!1):(this.m_functionStack.push((()=>this.start_())),!0))}nextToken(){return this.m_functionStack.at(-1)(),this.m_currentTokenType}currentToken(){return this.m_currentTokenType}currentTokenStartIndex(){return this.m_startToken}currentTokenEndIndex(){return this.m_endToken}currentText(){return(0,r.g)(0),""}childrenAsString(){return(0,r.g)(0),""}skipChildren(){this.skipChildren_()}skipChildren_(){if(1!==this.m_currentTokenType)if(2!==this.m_currentTokenType);else{let e=1;do{this.m_currentTokenType=this.nextToken(),2===this.m_currentTokenType?e++:4===this.m_currentTokenType&&e--}while(4!==this.m_currentTokenType||0!==e)}else{let e=1;do{this.m_currentTokenType=this.nextToken(),1===this.m_currentTokenType?e++:3===this.m_currentTokenType&&e--}while(3!==this.m_currentTokenType||0!==e)}}currentTerminalAsString_(){switch(this.m_currentTokenType){case 7:case 8:case 9:return this.m_getCurrentSubstr().slice(0,this.m_endToken-this.m_startToken);case 10:return"null";case 11:return"true";case 12:return"false"}(0,r.t)("invalid token")}toUTF8_(e,t){let n=0,r=e;for(;t.charCodeAt(r)===I&&t.charCodeAt(r+1)===$;)n++,r+=6;r=e;const i=new Uint8Array(n);let s=0;for(;t.charCodeAt(r)===I&&t.charCodeAt(r+1)===$;)i[s++]=Number.parseInt(t.slice(r+2,r+6),16),r+=6;return{u8s:this.m_utf8Decoder.decode(i),end:r}}unquoteCurrentString_(){let e="",t=1;const n=this.m_endToken-this.m_startToken-1;let r=0;const i=this.m_getCurrentSubstr();for(let s=t;s<n;s++)if(i.charCodeAt(s)!==I)r++;else{switch(r>0&&(e+=i.slice(t,t+r)),i.charCodeAt(++s)){case V:e+='"';break;case $:{const{u8s:t,end:n}=this.toUTF8_(s-1,i);s=n-1,e+=t;break}case I:e+="\\";break;case Y:e+="/";break;case z:e+="\b";break;case X:e+="\f";break;case J:e+="\n";break;case H:e+="\r";break;case Q:e+="\t"}t=s+1,r=0}return r>0&&(e+=i.slice(t,t+r)),e}currentString(){return 5!==this.m_currentTokenType&&6!==this.m_currentTokenType?this.currentTerminalAsString_():this.m_bHasEscapes?this.unquoteCurrentString_():this.m_getCurrentSubstr().slice(1,this.m_endToken-this.m_startToken-2+1)}currentDoubleValue(){if(7!==this.m_currentTokenType&&8!==this.m_currentTokenType&&9!==this.m_currentTokenType&&6!==this.m_currentTokenType&&10!==this.m_currentTokenType&&(0,r.t)("invalid token"),10===this.m_currentTokenType)return Number.NaN;let e=this.m_getCurrentSubstr(),t=this.m_endToken-this.m_startToken;if(6===this.m_currentTokenType){if("NaN"===this.currentString())return Number.NaN;e=e.slice(1),t-=2,0===t&&(0,r.t)("invalid token")}const n=Number.parseFloat(e);if(6===this.m_currentTokenType)Number.isNaN(n)&&(0,r.t)("invalid token");else if(Number.isNaN(n))return Number.NaN;return n}currentInt32Value(){8!==this.m_currentTokenType&&6!==this.m_currentTokenType&&(0,r.t)("invalid token");let e=this.m_getCurrentSubstr(),t=this.m_endToken-this.m_startToken;6===this.m_currentTokenType&&(e=e.slice(1),t-=2,0===t&&(0,r.t)("invalid token"));const n=parseInt(e);return Number.isNaN(n)&&(0,r.t)("invalid token"),n}currentInt64Value(){return(0,r.g)(0),0n}currentBoolValue(){return(0,r.g)(0),!1}isError(){return 0}JSONString(){return(0,r.g)(0),""}pushPosition(){return(0,r.g)(0),!1}popPosition(){return(0,r.g)(0),!1}skipCStyleComments_(){(0,r.g)(0)}skipCppStyleComments_(){(0,r.g)(0)}skipComments_(){this.m_prepSubstr();let e=this.m_peekChar();this.m_stepOverChar(),this.m_eof()&&(0,r.t)("invalid token"),e=this.m_peekChar(),e===j?this.skipCStyleComments_():e===Y?this.skipCppStyleComments_():(0,r.t)("invalid token")}skipWhiteSpace_(){let e;do{this.m_eof()&&(0,r.t)("invalid token");let t=this.m_peekChar();for(;t>=9&&t<=13||32===t;)this.m_increment(),this.m_eof()&&(0,r.t)("invalid token"),t=this.m_peekChar();t===Y?(this.m_startToken=this.m_endToken,e=!0,this.skipComments_()):e=!1}while(e)}rightBracket_(){return this.m_peekChar()===M&&(this.m_startToken=this.m_endToken,this.m_increment(),this.m_currentTokenType=4,!0)}rightBrace_(){return this.m_peekChar()===R&&(this.m_startToken=this.m_endToken,this.m_increment(),this.m_currentTokenType=3,!0)}string_(){this.m_prepSubstr(),this.m_bHasEscapes=!1,this.m_stepOverChar(),this.m_eof()&&(0,r.t)("invalid token");let e=this.m_peekChar();for(;e!==V;){const t=e===I;if(this.m_stepOverChar(),this.m_eof()&&(0,r.t)("invalid token"),e=this.m_peekChar(),t)if(this.m_bHasEscapes=!0,e===V||e===I||e===Y||e===z||e===X||e===J||e===H||e===Q)this.m_stepOverChar(),this.m_eof()&&(0,r.t)("invalid token"),e=this.m_peekChar();else if(e===$)for(let t=0;t<4;t++)this.m_stepOverChar(),this.m_eof()&&(0,r.t)("invalid token"),e=this.m_peekChar(),e>=ee&&e<=te||e>=D&&e<=X||e>=F&&e<=L||(0,r.t)("invalid token");else(0,r.t)("invalid token")}this.m_stepOverChar()}comma_(){return this.m_peekChar()===B&&(this.m_increment(),!0)}colon_(){return this.m_peekChar()===P&&(this.m_increment(),!0)}fieldNameEnd_(){this.skipWhiteSpace_(),this.m_functionStack.pop(),this.colon_()?(this.skipWhiteSpace_(),this.value_()):(0,r.t)("invalid token")}fieldNameStart_(){this.m_startToken=this.m_endToken,this.m_peekChar()!==V&&(0,r.t)("invalid token"),this.string_(),this.m_currentTokenType=5,this.m_functionStack.push((()=>this.fieldNameEnd_()))}pairEnd_(){this.skipWhiteSpace_(),this.comma_()?(this.skipWhiteSpace_(),this.fieldNameStart_()):this.rightBrace_()?this.m_functionStack.pop():(0,r.t)("invalid token")}arrayStart_(){this.skipWhiteSpace_(),this.m_functionStack.pop(),this.rightBracket_()||(this.m_functionStack.push((()=>this.elementEnd_())),this.value_())}elementEnd_(){this.skipWhiteSpace_(),this.comma_()?(this.skipWhiteSpace_(),this.value_()):this.rightBracket_()?this.m_functionStack.pop():(0,r.t)("invalid token")}objectStart_(){this.skipWhiteSpace_(),this.m_functionStack.pop(),this.rightBrace_()||(this.m_functionStack.push((()=>this.pairEnd_())),this.fieldNameStart_())}valueStartObject_(){this.m_increment(),this.m_currentTokenType=1,this.m_functionStack.push((()=>this.objectStart_()))}valueStartArray_(){this.m_increment(),this.m_currentTokenType=2,this.m_functionStack.push((()=>this.arrayStart_()))}valueString_(){this.string_(),this.m_currentTokenType=6}int_(){this.m_peekChar()!==ee?this.digits_():this.m_stepOverChar()}digits_(){let e=this.m_peekChar();do{this.m_stepOverChar(),this.m_eof()&&(0,r.t)("invalid token"),e=this.m_peekChar()}while(e>=ee&&e<=te)}frac_(){let e=this.m_peekChar();this.m_stepOverChar(),this.m_eof()&&(0,r.t)("invalid token"),e=this.m_peekChar(),e>=ee&&e<=te||(0,r.t)("invalid token"),this.digits_()}exp_(){let e=this.m_peekChar();this.m_stepOverChar(),this.m_eof()&&(0,r.t)("invalid token"),e=this.m_peekChar(),e!==q&&e!==K||(this.m_stepOverChar(),this.m_eof()&&(0,r.t)("invalid token"),e=this.m_peekChar()),e>=ee&&e<=te||(0,r.t)("invalid token"),this.digits_()}valueNumber_(){this.m_prepSubstr();let e=!1,t=this.m_peekChar();if(t===K?(this.m_stepOverChar(),this.m_eof()&&(0,r.t)("invalid token"),t=this.m_peekChar(),e=!0,t>=ee&&t<=te||(0,r.t)("invalid token"),this.int_()):this.int_(),t=this.m_peekChar(),t===G)this.m_currentTokenType=7,this.frac_(),t=this.m_peekChar(),t!==U&&t!==W||this.exp_();else if(t===U||t===W)this.m_currentTokenType=7,this.exp_();else{let t=0;e&&t++;const n=this.m_endToken-this.m_startToken-t;if(n<10)this.m_currentTokenType=8;else if(10===n){const n=this.m_getCurrentSubstr();e?n.slice(t)<="2147483648"?this.m_currentTokenType=8:this.m_currentTokenType=9:n.slice(t)<="2147483647"?this.m_currentTokenType=8:this.m_currentTokenType=9}else if(n<19)this.m_currentTokenType=9;else if(19===n){const n=this.m_getCurrentSubstr();e?n.slice(t)<="9223372036854775808"?this.m_currentTokenType=9:this.m_currentTokenType=7:n.slice(t)<="9223372036854775807"?this.m_currentTokenType=9:this.m_currentTokenType=7}else this.m_currentTokenType=7}}valueNull_(){const{s:e,bDone:t}=this.m_get(5);t&&(0,r.t)("invalid token"),"null"!==e&&(0,r.t)("invalid token"),this.m_currentTokenType=10}valueTrue_(){const{s:e,bDone:t}=this.m_get(5);t&&(0,r.t)("invalid token"),"true"!==e&&(0,r.t)("invalid token"),this.m_currentTokenType=11}valueFalse_(){const{s:e,bDone:t}=this.m_get(6);t&&(0,r.t)("invalid token"),"false"!==e&&(0,r.t)("invalid token"),this.m_currentTokenType=12}valueNan_(){const{s:e,bDone:t}=this.m_get(4);t&&(0,r.t)("invalid token"),"NaN"!==e&&(0,r.t)("invalid token"),this.m_currentTokenType=7}value_(){this.m_startToken=this.m_endToken;const e=this.m_peekChar();e===E?this.valueStartObject_():e===O?this.valueStartArray_():e===V?this.valueString_():e===K||e>=ee&&e<=ee+9?this.valueNumber_():e===J?this.valueNull_():e===Q?this.valueTrue_():e===X?this.valueFalse_():e===Z?this.valueNan_():(0,r.t)("invalid token")}start_(){this.skipWhiteSpace_(),this.m_functionStack.pop(),this.m_functionStack.push((()=>this.accept_()));const e=this.m_peekChar();e!==E&&e!==O&&(0,r.t)("invalid token"),this.value_()}accept_(){this.m_startToken=this.m_endToken,this.m_currentTokenType=0}}const re=new class{constructor(){this.m_pendingKey=null,this.m_acceptedObject=null,this.m_currentObject=[]}reset(){this.m_pendingKey=null,this.m_acceptedObject=null,this.m_currentObject.length=0}startObject(){const e={};this.m_pendingKey?(this.m_currentObject.at(-1)[this.m_pendingKey]=e,this.m_pendingKey=null):Array.isArray(this.m_currentObject.at(-1))&&this.m_currentObject.at(-1).push(e),this.m_currentObject.push(e)}startArray(){const e=[];this.m_pendingKey?(this.m_currentObject.at(-1)[this.m_pendingKey]=e,this.m_pendingKey=null):Array.isArray(this.m_currentObject.at(-1))&&this.m_currentObject.at(-1).push(e),this.m_currentObject.push(e)}endObject(){this.m_acceptedObject=this.m_currentObject.at(-1),this.m_currentObject.pop()}endArray(){this.m_currentObject.pop()}addFieldName(e){this.m_pendingKey=e}addValue_(e){this.m_pendingKey?(this.m_currentObject.at(-1)[this.m_pendingKey]=e,this.m_pendingKey=null):this.m_currentObject.at(-1).push(e)}addString(e){this.addValue_(e)}addDouble(e,t){this.addValue_(e)}addInt64(e){(0,r.g)(0)}addInt32(e){this.addValue_(e)}addBool(e){this.addValue_(e)}addNull(){this.addValue_(null)}getObject(){return this.m_acceptedObject}},ie=new class{getOperatorType(){return 10405}accelerateGeometry(e,t,n){return!1}canAccelerateGeometry(e){return!1}supportsCurves(){return!0}execute(e,t,n,i,a,o){!function(e,t,n,i){if(t||n){if(i.startObject(),null!==t)switch(t.getGeometryType()){case r.G.enumPolygon:w(!0,e,t,i);break;case r.G.enumPolyline:w(!1,e,t,i);break;case r.G.enumMultiPoint:!function(e,t,n){const i=t.getImpl(),s=i.hasAttribute(1)&&!(2&e),a=i.hasAttribute(2)&&!(4&e),o=i.hasAttribute(3)&&!(8&e);s&&(n.addFieldName("hasZ"),n.addBool(!0)),a&&(n.addFieldName("hasM"),n.addBool(!0)),n.addFieldName("points");const u=t.getPointCount();if(t.isEmpty())n.startArray(),n.endArray();else{const t=17-(31&e>>13);n.startArray();const r=i.getAttributeStreamRef(0);let o=null,m=null;s&&(o=i.getAttributeStreamRef(1)),a&&(m=i.getAttributeStreamRef(2));for(let e=0;e<u;e++){const i=r.read(2*e),u=r.read(2*e+1);let l=Number.NaN,c=Number.NaN;s&&(l=o.read(e)),a&&(c=m.read(e)),C(s,a,i,u,l,c,t,n)}n.endArray()}if(o){let e=null;i.isEmpty()||(e=i.getAttributeStreamRef(3)),(0,r.g)(0===u||null!==e&&e.size()>=u),n.addFieldName("ids"),n.startArray();for(let t=0;t<u;t++)n.addInt32(e.read(t));n.endArray()}}(e,t,i);break;case r.G.enumPoint:!function(e,t,n){const r=t.hasAttribute(1)&&!(2&e),i=t.hasAttribute(2)&&!(4&e),s=t.hasAttribute(3)&&!(8&e);if(t.isEmpty())return n.addFieldName("x"),n.addNull(),n.addFieldName("y"),n.addNull(),r&&(n.addFieldName("z"),n.addNull()),i&&(n.addFieldName("m"),n.addNull()),void(s&&(n.addFieldName("id"),n.addInt32(0)));const a=17-(31&e>>13);n.addFieldName("x"),n.addDouble(t.getX(),a),n.addFieldName("y"),n.addDouble(t.getY(),a),r&&(n.addFieldName("z"),n.addDouble(t.getZ(),a)),i&&(n.addFieldName("m"),n.addDouble(t.getM(),a)),s&&(n.addFieldName("id"),n.addInt32(t.getID()))}(e,t,i);break;case r.G.enumEnvelope:!function(e,t,n){const r=t.hasAttribute(1)&&!(2&e),i=t.hasAttribute(2)&&!(4&e),s=t.hasAttribute(3)&&!(8&e);if(t.isEmpty())return n.addFieldName("xmin"),n.addNull(),n.addFieldName("ymin"),n.addNull(),n.addFieldName("xmax"),n.addNull(),n.addFieldName("ymax"),n.addNull(),r&&(n.addFieldName("zmin"),n.addNull(),n.addFieldName("zmax"),n.addNull()),i&&(n.addFieldName("mmin"),n.addNull(),n.addFieldName("mmax"),n.addNull()),void(s&&(n.addFieldName("idmin"),n.addInt32(0),n.addFieldName("idmax"),n.addInt32(0)));const a=17-(31&e>>13);if(n.addFieldName("xmin"),n.addDouble(t.getXMin(),a),n.addFieldName("ymin"),n.addDouble(t.getYMin(),a),n.addFieldName("xmax"),n.addDouble(t.getXMax(),a),n.addFieldName("ymax"),n.addDouble(t.getYMax(),a),r){const e=t.queryInterval(1,0);n.addFieldName("zmin"),n.addDouble(e.vmin,a),n.addFieldName("zmax"),n.addDouble(e.vmax,a)}if(i){const e=t.queryInterval(2,0);n.addFieldName("mmin"),n.addDouble(e.vmin,a),n.addFieldName("mmax"),n.addDouble(e.vmax,a)}if(s){const e=t.queryInterval(3,0);n.addFieldName("idmin"),n.addInt32(e.vmin),n.addFieldName("idmax"),n.addInt32(e.vmax)}}(e,t,i);break;case r.G.enumMultipatch:(0,r.g)(0);break;default:(0,r.c)("exportToJSON")}null!==n&&(i.addFieldName("spatialReference"),function(e,t,n){n.startObject();let i=0;t.isCustomWkid()||(i=t.getOldID());let a=0;const o=t.getVCS();if(null!==o&&(o.isCustomWkid()||(a=o.getOldID()),a<=0&&(i=0)),i>0){n.addFieldName("wkid"),n.addInt32(i);const e=t.getLatestID();if(e>0&&e!==i&&(n.addFieldName("latestWkid"),n.addInt32(e)),a>0){n.addFieldName("vcsWkid"),n.addInt32(a);const e=t.getLatestVerticalID();e!==a&&(n.addFieldName("latestVcsWkid"),n.addInt32(e))}}if(0===t.getCoordinateSystemType())n.addFieldName("wkid"),n.addNull(),null!==t.getUnit()&&(n.addFieldName("unit"),function(e,t,n){n.startObject();const i=t.getID();i<=0&&(0,r.t)("cannot export unit that has no valid WKID"),n.addFieldName("uwkid"),n.addInt32(i),n.endObject()}(0,t.getUnit(),n));else if(i<=0||1&e){let r="";64&e&&(r=t.getText2(),n.addFieldName("wkt2"),n.addString(r));const i=t.getText();i!==r&&(n.addFieldName("wkt"),n.addString(i))}if(16&e){const e=new s.aE;t.queryPrecisionDescriptor(e),n.addFieldName("xyTolerance"),n.addDouble(e.getTolerance(0)),n.addFieldName("zTolerance"),n.addDouble(e.getTolerance(1)),n.addFieldName("mTolerance"),n.addDouble(e.getTolerance(2)),n.addFieldName("falseX"),n.addDouble(e.getFalseX()),n.addFieldName("falseY"),n.addDouble(e.getFalseY()),n.addFieldName("xyUnits"),n.addDouble(e.getGridUnitsXY()),n.addFieldName("falseZ"),n.addDouble(e.getFalseZ()),n.addFieldName("zUnits"),n.addDouble(e.getGridUnitsZ()),n.addFieldName("falseM"),n.addDouble(e.getFalseM()),n.addFieldName("mUnits"),n.addDouble(e.getGridUnitsM())}n.endObject()}(e,n,i)),i.endObject()}}(e,t,n,i)}exportSpatialReference(e,t,n,i){(0,r.g)(0)}exportProjectionTransformation(e,t,n,i){(0,r.g)(0)}exportDatumTransformation(e,t,n,i){(0,r.g)(0)}static geometryTypeToString(e){return(0,r.g)(0),""}},se=new class{getOperatorType(){return 10404}accelerateGeometry(e,t,n){return!1}canAccelerateGeometry(e){return!1}supportsCurves(){return!0}execute(e,t,n,i,u,m,l){let c;"string"==typeof n?(c=new ne({jsonString:n}),c.nextToken()):c=n,1!==c.currentToken()&&(0,r.t)("failed to import map geometry: start of object is expected");const d=function(e,t,n,i,s){let u=!1,m=!1,l=!1,c=!1,d=!1,y=!1,g=!1,N=!1,T=!1,v=!1,x=!1,A=!1,S=!1,w=!1,C=!1,D=!1,F=!1,j=!1,z=!1,I=!1,O=!1,E=!1,P=!1,G=!1,B=Number.NaN,V=Number.NaN,M=Number.NaN,R=Number.NaN,U=0,W=Number.NaN,X=Number.NaN,L=Number.NaN,Y=Number.NaN,K=Number.NaN,q=Number.NaN,J=Number.NaN,Z=Number.NaN,H=0,Q=0,$=!1,ee=!1,te=null,ne=null,re=null,ie=null,se=null;for(;3!==n.nextToken();){const t=n.currentString();if(n.nextToken(),"spatialReference"===t){if(s&&!u){u=!0,1===n.currentToken()?ie=h(n):10!==n.currentToken()&&(0,r.t)("failed to parse spatial reference: object or null is expected");continue}}else if(i)if("hasZ"===t){if(!m){m=!0,$=11===n.currentToken();continue}}else if("hasM"===t){if(!l){l=!0,ee=11===n.currentToken();continue}}else if("rings"===t){if(!(d||y||e!==r.G.enumUnknown&&e!==r.G.enumPolygon)){d=!0,({geometry:se,as:te,bs:ne}=_(!0,!1,0,n));continue}}else if("curveRings"===t){if(!y&&(e===r.G.enumUnknown||e===r.G.enumPolygon)){y=!0,({geometry:se,as:te,bs:ne}=_(!0,!0,0,n));continue}}else if("paths"===t){if(!(g||N||e!==r.G.enumUnknown&&e!==r.G.enumPolyline)){g=!0,({geometry:se,as:te,bs:ne}=_(!1,!1,0,n));continue}}else if("curvePaths"===t){if(!N&&(e===r.G.enumUnknown||e===r.G.enumPolyline)){N=!0,({geometry:se,as:te,bs:ne}=_(!1,!0,0,n));continue}}else if("points"===t){if(!T&&(e===r.G.enumUnknown||e===r.G.enumMultiPoint)){T=!0,({geometry:se,as:te,bs:ne}=f(0,n));continue}}else if("ids"===t){if(!c){c=!0,re=p(0,n);continue}}else if("x"===t){if(!v&&(e===r.G.enumUnknown||e===r.G.enumPoint)){v=!0,B=k(n);continue}}else if("y"===t){if(!x&&(e===r.G.enumUnknown||e===r.G.enumPoint)){x=!0,V=k(n);continue}}else if("z"===t){if(!A&&(e===r.G.enumUnknown||e===r.G.enumPoint)){A=!0,M=k(n);continue}}else if("m"===t){if(!S&&(e===r.G.enumUnknown||e===r.G.enumPoint)){S=!0,R=k(n);continue}}else if("id"===t){if(!w&&(e===r.G.enumUnknown||e===r.G.enumPoint)){w=!0,U=b(n);continue}}else if("xmin"===t){if(!C&&(e===r.G.enumUnknown||e===r.G.enumEnvelope)){C=!0,W=k(n);continue}}else if("ymin"===t){if(!D&&(e===r.G.enumUnknown||e===r.G.enumEnvelope)){D=!0,X=k(n);continue}}else if("mmin"===t){if(!O&&(e===r.G.enumUnknown||e===r.G.enumEnvelope)){O=!0,J=k(n);continue}}else if("zmin"===t){if(!z&&(e===r.G.enumUnknown||e===r.G.enumEnvelope)){z=!0,K=k(n);continue}}else if("idmin"===t){if(!P&&(e===r.G.enumUnknown||e===r.G.enumEnvelope)){P=!0,H=b(n);continue}}else if("xmax"===t){if(!F&&(e===r.G.enumUnknown||e===r.G.enumEnvelope)){F=!0,L=k(n);continue}}else if("ymax"===t){if(!j&&(e===r.G.enumUnknown||e===r.G.enumEnvelope)){j=!0,Y=k(n);continue}}else if("mmax"===t){if(!E&&(e===r.G.enumUnknown||e===r.G.enumEnvelope)){E=!0,Z=k(n);continue}}else if("zmax"===t){if(!I&&(e===r.G.enumUnknown||e===r.G.enumEnvelope)){I=!0,q=k(n);continue}}else if("idmax"===t){if(!G&&(e===r.G.enumUnknown||e===r.G.enumEnvelope)){G=!0,Q=b(n);continue}}else"materials"===t&&(0,r.g)(0);n.skipChildren()}if(d||y||g||N||T){let e=null,t=null;const n=se;$&&(se.addAttribute(1),e=te,e||(e=(0,a.F)(n.getPointCount(),Number.NaN))),ee&&(se.addAttribute(2),t=$?ne:te),null!=re&&se.addAttribute(3),$&&null!=e&&n.setAttributeStreamRef(1,e),ee&&null!=t&&n.setAttributeStreamRef(2,t),null!=re&&function(e,t){if(e.isEmpty())return;const n=(0,a.K)(2,0),i=e.getGeometryType();let s=0;i===o.M.type?s=1:i===o.P.type||i===o.a.type?s=e.getPathCount():(0,r.c)("not implemented"),n.resize(e.getPointCount(),0);let u=0;for(let a=0;a<s;++a){const s=t.read(u);u++;const m=u+s;let l=0,c=0;i===o.M.type?l=e.getPointCount():i===o.P.type||i===o.a.type?(l=e.getPathSize(a),c=e.getPathStart(a)):(0,r.c)("not implemented");for(let e=0,r=Math.min(s,l);e<r;++e)n.write(c,t.read(u)),u++,c++;u=m}e.getImpl().setAttributeStreamRef(3,n)}(n,re)}else if(v||x||S||A||w){(0,a.I)(B,V)||(0,r.t)("failed to parse point: x and y must be finite or nan"),(Number.isNaN(V)||Number.isNaN(B))&&(B=Number.NaN,V=Number.NaN);const e=new a.P({x:B,y:V});A&&e.setZ(M),S&&e.setM(R),w&&e.setID(U),se=e}else if(C||D||F||j||z||I||O||E||P||G){(Number.isNaN(X)||Number.isNaN(L)||Number.isNaN(Y))&&(W=Number.NaN);const e=new a.E({xmin:W,ymin:X,xmax:L,ymax:Y});z&&I&&e.setInterval(1,0,K,q),O&&E&&e.setInterval(2,0,J,Z),P&&G&&e.setInterval(3,0,H,Q),se=e}return{...se?{geom:se}:{},...ie?{sr:ie}:{}}}(t,0,c,i,u);return new s.aF(d)}importProjectionTransformation(e,t){return(0,r.g)(0),{}}importDatumTransformation(e,t){return(0,r.g)(0),{}}static stringToGeometryType(e){return(e=e.toLowerCase()).startsWith("esrigeometry")||(0,r.t)("string_to_geometry_type"),e.endsWith("point")?r.G.enumPoint:e.endsWith("envelope")?r.G.enumEnvelope:e.endsWith("multipoint")?r.G.enumMultiPoint:e.endsWith("polyline")?r.G.enumPolyline:e.endsWith("polygon")?r.G.enumPolygon:void(0,r.t)("string_to_geometry_type")}};function ae(e){return Array.isArray(e)?e[0].spatialReference:e.spatialReference}function oe(e,t){const n=new l(e,{strict:!1});return n.nextToken(),se.execute(0,r.G.enumUnknown,n,!0,t)}function ue(e){let t=null;return[e.map((e=>{if(null==t){const n=me(e);return t=n.getSpatialReference(),n.getGeometry()}return le(e)})),t]}function me(e){return oe(e,!0)}function le(e){return oe(e,!1).getGeometry()}function ce(e,t){return e instanceof s.aF&&(t=e.getSpatialReference(),e=e.getGeometry()),e?.isEmpty()?null:(re.reset(),ie.execute(0,e,t,re),re.getObject())}},90293:(e,t,n)=>{n(79187),n(55537),n(35368),n(95213),n(83661);var r=n(12189),i=n(83047),s=n(21325);(0,r.j)((e=>{let t,n;"number"==typeof e?t=e:n=e;const r={wkid:t,wkt:n};let a,o;if(n){a=(0,i.x1)(n);const e=(0,s.EA)(r);if(!a&&!e)throw new Error(`Unsupported WKT type: ${n}`)}else a=!(0,s.EA)(r);return o=t&&i.yD.has(t)?Math.PI/200:a?(0,i.Ao)(r):Math.PI/180,{isPCS:a,metersOrRadiansPerUnit:o,semiMajor:0,wkidOrWkt:e}}))}}]);